Backup system public API.
- Source
- Deprecated
- Use backup/index.js for new code
- Source
Methods
(inner) beginModifications()
Begins modification phase (new API bridge)
- Source
(inner) completeSession(statsopt)
Completes the backup session (new API bridge)
| Name | Type | Attributes | Description |
|---|---|---|---|
stats | Object | <optional> | Operation stats |
- Source
(inner) createBackup(filePath, _backupDir, optionsopt) → {string|null}
Creates a backup of a file (legacy API)
| Name | Type | Attributes | Description |
|---|---|---|---|
filePath | string | File to backup | |
_backupDir | string | Backup directory (ignored, uses .i18nkit/backups) | |
options | Object | <optional> | Options |
- Source
Backup path or null if skipped
- Type:
- string |
null
(inner) createBackupSession(cwd, command) → {Session}
Creates and starts a new backup session
| Name | Type | Description |
|---|---|---|
cwd | string | |
command | string |
- Source
- Type:
- Session
(inner) getBackupFiles() → {Map.<string, string>}
Gets the map of backed-up files (legacy API)
- Source
- Type:
- Map.<string, string>
(inner) getBackupSession(cwd, sessionId) → {Session|null}
| Name | Type | Description |
|---|---|---|
cwd | string | |
sessionId | string |
- Source
- Type:
- Session |
null
(inner) getLatestBackupSession(cwd) → {Session|null}
| Name | Type | Description |
|---|---|---|
cwd | string |
- Source
- Type:
- Session |
null
(inner) listBackupSessions(cwd) → {Array.<Object>}
| Name | Type | Description |
|---|---|---|
cwd | string |
- Source
- Type:
- Array.<Object>
(inner) markReady()
Marks session as ready for modifications (new API bridge)
- Source
(inner) resetSession()
Resets session state (for testing)
- Source
(inner) restoreBackups() → {number}
Restores all backed-up files (legacy API)
- Source
Count of restored files
- Type:
- number
(inner) withBackup(ctx) → {*}
Wraps operation with backup session lifecycle
| Name | Type | Description |
|---|---|---|
ctx | Object | Context with cwd, command, operation, options |
- Source
Operation result
- Type:
- *