tero 0.0.13 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/backup.d.ts CHANGED
@@ -64,6 +64,13 @@ export interface BackupConfig {
64
64
  logger?: 'silent' | BackupLogger;
65
65
  /** Override bucket subprefix (takes precedence over cloudStorage.dbName). */
66
66
  bucketPrefix?: string;
67
+ /**
68
+ * Whether to delete remote files that are not present locally.
69
+ * Default: true for full local databases, false when running in lazy-hydration mode.
70
+ */
71
+ pruneDeleted?: boolean;
72
+ /** Optional custom S3 client for mocking/testing */
73
+ customS3Client?: any;
67
74
  }
68
75
  export interface BackupMetadata {
69
76
  timestamp: string;
@@ -87,6 +94,8 @@ export declare class BackupManager {
87
94
  private dbPath;
88
95
  /** Injected or default logger (see BackupConfig.logger). */
89
96
  private log;
97
+ private inFlightBackupToBucket?;
98
+ private inFlightPerformBackup?;
90
99
  constructor(dbPath: string, config: BackupConfig);
91
100
  private initializeCloudStorage;
92
101
  private parseInterval;
@@ -123,6 +132,7 @@ export declare class BackupManager {
123
132
  metadata: BackupMetadata;
124
133
  cloudUploaded?: boolean;
125
134
  }>;
135
+ private _doPerformBackup;
126
136
  private cleanupOldBackups;
127
137
  scheduleBackup(config: {
128
138
  interval: string;
@@ -148,7 +158,9 @@ export declare class BackupManager {
148
158
  backupToBucket(options?: {
149
159
  walArchivePaths?: string[];
150
160
  tag?: string;
161
+ engine?: ACIDStorageEngine;
151
162
  }): Promise<BucketBackupResult>;
163
+ private _doBackupToBucket;
152
164
  /**
153
165
  * Upload an arbitrary buffer (used for the bucket manifest and small artifacts).
154
166
  */
@@ -179,8 +191,23 @@ export declare class BackupManager {
179
191
  tag?: string;
180
192
  }): Promise<LiveCheckpointResult>;
181
193
  private doLiveCheckpoint;
194
+ /**
195
+ * Crash-safe restore: downloads and replays WAL into a fresh temporary staging directory,
196
+ * then promotes staging to targetDir via a crash-safe .restore-in-progress marker protocol.
197
+ */
182
198
  restoreLiveToDirectory(targetDir: string, opts?: {
183
199
  nodeId?: string;
184
200
  pointInTime?: number;
201
+ targetLsn?: number;
202
+ }): Promise<RestoreLiveResult>;
203
+ /**
204
+ * Explicit merge restore: restores state directly into an existing target directory
205
+ * without staging or promoting. Stale files not present in the backup will survive.
206
+ */
207
+ mergeRestoreToDirectory(targetDir: string, opts?: {
208
+ nodeId?: string;
209
+ pointInTime?: number;
210
+ targetLsn?: number;
185
211
  }): Promise<RestoreLiveResult>;
212
+ private _restoreToTargetDirectory;
186
213
  }