Backup system public API.

Deprecated
  • Use backup/index.js for new code

Methods

(inner) beginModifications()

Begins modification phase (new API bridge)

(inner) completeSession(statsopt)

Completes the backup session (new API bridge)

Parameters:
NameTypeAttributesDescription
statsObject<optional>

Operation stats

(inner) createBackup(filePath, _backupDir, optionsopt) → {string|null}

Creates a backup of a file (legacy API)

Parameters:
NameTypeAttributesDescription
filePathstring

File to backup

_backupDirstring

Backup directory (ignored, uses .i18nkit/backups)

optionsObject<optional>

Options

Returns:

Backup path or null if skipped

Type: 
string | null

(inner) createBackupSession(cwd, command) → {Session}

Creates and starts a new backup session

Parameters:
NameTypeDescription
cwdstring
commandstring
Returns:
Type: 
Session

(inner) getBackupFiles() → {Map.<string, string>}

Gets the map of backed-up files (legacy API)

Returns:
Type: 
Map.<string, string>

(inner) getBackupSession(cwd, sessionId) → {Session|null}

Parameters:
NameTypeDescription
cwdstring
sessionIdstring
Returns:
Type: 
Session | null

(inner) getLatestBackupSession(cwd) → {Session|null}

Parameters:
NameTypeDescription
cwdstring
Returns:
Type: 
Session | null

(inner) listBackupSessions(cwd) → {Array.<Object>}

Parameters:
NameTypeDescription
cwdstring
Returns:
Type: 
Array.<Object>

(inner) markReady()

Marks session as ready for modifications (new API bridge)

(inner) resetSession()

Resets session state (for testing)

(inner) restoreBackups() → {number}

Restores all backed-up files (legacy API)

Returns:

Count of restored files

Type: 
number

(inner) withBackup(ctx) → {*}

Wraps operation with backup session lifecycle

Parameters:
NameTypeDescription
ctxObject

Context with cwd, command, operation, options

Returns:

Operation result

Type: 
*

Backward-compatible backup API wrapping new session-based system.

Deprecated
  • Use backup/index.js for new code

Methods

(inner) beginModifications()

Begins modification phase (new API bridge)

(inner) completeSession(statsopt)

Completes the backup session (new API bridge)

Parameters:
NameTypeAttributesDescription
statsObject<optional>

Operation stats

(inner) createBackup(filePath, _backupDir, optionsopt) → {string|null}

Creates a backup of a file (legacy API)

Parameters:
NameTypeAttributesDescription
filePathstring

File to backup

_backupDirstring

Backup directory (ignored, uses .i18nkit/backups)

optionsObject<optional>

Options

Returns:

Backup path or null if skipped

Type: 
string | null

(inner) createBackupSession(cwd, command) → {Session}

Creates and starts a new backup session

Parameters:
NameTypeDescription
cwdstring
commandstring
Returns:
Type: 
Session

(inner) getBackupFiles() → {Map.<string, string>}

Gets the map of backed-up files (legacy API)

Returns:
Type: 
Map.<string, string>

(inner) getBackupSession(cwd, sessionId) → {Session|null}

Parameters:
NameTypeDescription
cwdstring
sessionIdstring
Returns:
Type: 
Session | null

(inner) getLatestBackupSession(cwd) → {Session|null}

Parameters:
NameTypeDescription
cwdstring
Returns:
Type: 
Session | null

(inner) listBackupSessions(cwd) → {Array.<Object>}

Parameters:
NameTypeDescription
cwdstring
Returns:
Type: 
Array.<Object>

(inner) markReady()

Marks session as ready for modifications (new API bridge)

(inner) resetSession()

Resets session state (for testing)

(inner) restoreBackups() → {number}

Restores all backed-up files (legacy API)

Returns:

Count of restored files

Type: 
number

(inner) withBackup(ctx) → {*}

Wraps operation with backup session lifecycle

Parameters:
NameTypeDescription
ctxObject

Context with cwd, command, operation, options

Returns:

Operation result

Type: 
*