@framers/sql-storage-adapter 0.6.11 → 0.6.13
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/README.md +1 -1
- package/dist/adapters/baseStorageAdapter.d.ts +3 -3
- package/dist/adapters/betterSqliteAdapter.d.ts +18 -1
- package/dist/adapters/betterSqliteAdapter.d.ts.map +1 -1
- package/dist/adapters/betterSqliteAdapter.js +77 -8
- package/dist/adapters/betterSqliteAdapter.js.map +1 -1
- package/dist/adapters/capacitorSqliteAdapter.d.ts +1 -1
- package/dist/adapters/electron/electronMainAdapter.d.ts +1 -1
- package/dist/adapters/electron/electronRendererAdapter.d.ts +2 -2
- package/dist/adapters/electron/index.d.ts +10 -10
- package/dist/adapters/electron/ipc/index.d.ts +3 -3
- package/dist/adapters/electron/ipc/protocol.d.ts +1 -1
- package/dist/adapters/electron/ipc/types.d.ts +1 -1
- package/dist/adapters/electron/migration/autoMigrator.d.ts +1 -1
- package/dist/adapters/electron/migration/index.d.ts +1 -1
- package/dist/adapters/electron/preload.d.ts +2 -2
- package/dist/adapters/electron/recovery/corruptionDetector.d.ts +1 -1
- package/dist/adapters/electron/recovery/index.d.ts +2 -2
- package/dist/adapters/electron/recovery/walCheckpoint.d.ts +1 -1
- package/dist/adapters/electron/window/index.d.ts +1 -1
- package/dist/adapters/electron/window/windowManager.d.ts +1 -1
- package/dist/adapters/indexedDbAdapter.d.ts +1 -1
- package/dist/adapters/postgresAdapter.d.ts +1 -1
- package/dist/adapters/sqlJsAdapter.d.ts +1 -1
- package/dist/adapters/supabase.d.ts +2 -2
- package/dist/core/contracts/context.d.ts +2 -2
- package/dist/core/contracts/events.d.ts +2 -2
- package/dist/core/contracts/extensions.d.ts +3 -3
- package/dist/core/contracts/hooks.d.ts +1 -1
- package/dist/core/contracts/index.d.ts +2 -2
- package/dist/core/contracts/limitations.d.ts +1 -1
- package/dist/core/database.d.ts +6 -6
- package/dist/core/resolver.d.ts +5 -5
- package/dist/features/backup/cloudBackup.d.ts +1 -1
- package/dist/features/migrations/dataExport.d.ts +1 -1
- package/dist/features/migrations/dataImport.d.ts +2 -2
- package/dist/features/migrations/migration.d.ts +2 -2
- package/dist/features/sync/conflicts/conflictResolver.d.ts +1 -1
- package/dist/features/sync/conflicts/index.d.ts +1 -1
- package/dist/features/sync/crossPlatformSync.d.ts +6 -6
- package/dist/features/sync/devices/deviceManager.d.ts +2 -2
- package/dist/features/sync/devices/index.d.ts +1 -1
- package/dist/features/sync/index.d.ts +9 -9
- package/dist/features/sync/protocol/index.d.ts +2 -2
- package/dist/features/sync/protocol/messages.d.ts +1 -1
- package/dist/features/sync/syncManager.d.ts +1 -1
- package/dist/features/sync/tables/index.d.ts +1 -1
- package/dist/features/sync/tables/syncLogManager.d.ts +4 -4
- package/dist/features/sync/transport/httpTransport.d.ts +2 -2
- package/dist/features/sync/transport/index.d.ts +3 -3
- package/dist/features/sync/transport/transport.d.ts +1 -1
- package/dist/features/sync/transport/websocketTransport.d.ts +2 -2
- package/dist/index.d.ts +25 -25
- package/dist/shared/connectionGate.d.ts +71 -0
- package/dist/shared/connectionGate.d.ts.map +1 -0
- package/dist/shared/connectionGate.js +77 -0
- package/dist/shared/connectionGate.js.map +1 -0
- package/dist/shared/parameterUtils.d.ts +1 -1
- package/dist/shared/serializedTransaction.d.ts +1 -1
- package/dist/types/index.d.ts +7 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -503,7 +503,7 @@ On Postgres, `features.exporter` requires a Node runtime plus an adapter that wa
|
|
|
503
503
|
## CI, Releases, and Badges
|
|
504
504
|
|
|
505
505
|
- GitHub Actions workflows:
|
|
506
|
-
- `ci.yml` runs lint, tests, and
|
|
506
|
+
- `ci.yml` runs on pushes and pull requests to `master`: lint, type check, tests with coverage and the build, then it packs the package, installs the tarball into a new ES module project and type-checks a consumer with `--module nodenext --moduleResolution nodenext`.
|
|
507
507
|
- `release.yml` publishes new versions to npm, tags the commit (`vX.Y.Z`), and creates/updates the GitHub Release when `CHANGELOG.md` and `package.json` bump the version.
|
|
508
508
|
- Check badge health whenever builds fail:
|
|
509
509
|
- CI badge should be green for `master`.
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
* });
|
|
44
44
|
* ```
|
|
45
45
|
*/
|
|
46
|
-
import type { StorageAdapter, StorageCapability, StorageOpenOptions, StorageParameters, StorageRunResult, BatchOperation, BatchResult, PreparedStatement } from '../core/contracts';
|
|
47
|
-
import type { PerformanceConfig, PerformanceSettings, CacheStats } from '../core/contracts/performance';
|
|
48
|
-
import type { StorageHooks } from '../core/contracts/hooks';
|
|
46
|
+
import type { StorageAdapter, StorageCapability, StorageOpenOptions, StorageParameters, StorageRunResult, BatchOperation, BatchResult, PreparedStatement } from '../core/contracts/index.js';
|
|
47
|
+
import type { PerformanceConfig, PerformanceSettings, CacheStats } from '../core/contracts/performance.js';
|
|
48
|
+
import type { StorageHooks } from '../core/contracts/hooks.js';
|
|
49
49
|
/**
|
|
50
50
|
* Options for BaseStorageAdapter configuration.
|
|
51
51
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { StorageAdapter, StorageOpenOptions, StorageParameters, StorageRunResult, StorageCapability, BatchOperation, BatchResult } from '../core/contracts';
|
|
1
|
+
import type { StorageAdapter, StorageOpenOptions, StorageParameters, StorageRunResult, StorageCapability, BatchOperation, BatchResult } from '../core/contracts/index.js';
|
|
2
2
|
/**
|
|
3
3
|
* Native SQLite adapter using better-sqlite3.
|
|
4
4
|
*
|
|
@@ -43,6 +43,12 @@ export declare class BetterSqliteAdapter implements StorageAdapter {
|
|
|
43
43
|
private db;
|
|
44
44
|
private preparedStatements;
|
|
45
45
|
private readonly runSerializedTransaction;
|
|
46
|
+
/**
|
|
47
|
+
* Holds statements from outside an open transaction until it ends, so they
|
|
48
|
+
* neither join it nor read what it has not committed. open() gives it Node's
|
|
49
|
+
* AsyncLocalStorage, which tells the transaction's own statements apart.
|
|
50
|
+
*/
|
|
51
|
+
private gate;
|
|
46
52
|
/**
|
|
47
53
|
* Creates a new better-sqlite3 adapter instance.
|
|
48
54
|
*
|
|
@@ -60,6 +66,16 @@ export declare class BetterSqliteAdapter implements StorageAdapter {
|
|
|
60
66
|
get<T = unknown>(statement: string, parameters?: StorageParameters): Promise<T | null>;
|
|
61
67
|
all<T>(statement: string, parameters?: StorageParameters): Promise<T[]>;
|
|
62
68
|
exec(script: string): Promise<void>;
|
|
69
|
+
private runNow;
|
|
70
|
+
private getNow;
|
|
71
|
+
private allNow;
|
|
72
|
+
private execNow;
|
|
73
|
+
/**
|
|
74
|
+
* The statements of one transaction's handle: they carry the transaction's
|
|
75
|
+
* token, so the gate admits them whatever async context runs them (a callback
|
|
76
|
+
* may reach its handle through an AsyncResource made before the transaction).
|
|
77
|
+
*/
|
|
78
|
+
private handleStatements;
|
|
63
79
|
transaction<T>(fn: (trx: StorageAdapter) => Promise<T>): Promise<T>;
|
|
64
80
|
close(): Promise<void>;
|
|
65
81
|
/**
|
|
@@ -72,6 +88,7 @@ export declare class BetterSqliteAdapter implements StorageAdapter {
|
|
|
72
88
|
* @returns Results of the batch operation
|
|
73
89
|
*/
|
|
74
90
|
batch(operations: BatchOperation[]): Promise<BatchResult>;
|
|
91
|
+
private batchNow;
|
|
75
92
|
private prepareInternal;
|
|
76
93
|
private ensureOpen;
|
|
77
94
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"betterSqliteAdapter.d.ts","sourceRoot":"","sources":["../../src/adapters/betterSqliteAdapter.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"betterSqliteAdapter.d.ts","sourceRoot":"","sources":["../../src/adapters/betterSqliteAdapter.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,cAAc,EAAE,kB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CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IA8BnE,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAWnC;;;;;;;;OAQG;IACU,KAAK,CAAC,UAAU,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC;IAItE,OAAO,CAAC,QAAQ;IA+ChB,OAAO,CAAC,eAAe;IAWvB,OAAO,CAAC,UAAU;CAKnB;AAED;;GAEG;AACH;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB,aAAc,MAAM,KAAG,cAQ5D,CAAC"}
|
|
@@ -9,6 +9,7 @@ import path from 'path';
|
|
|
9
9
|
const isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
|
|
10
10
|
import { normaliseParameters } from '../shared/parameterUtils.js';
|
|
11
11
|
import { createSerializedTransactionRunner, createSharedConnectionTransactionAdapter, } from '../shared/serializedTransaction.js';
|
|
12
|
+
import { createConnectionGate, whenAdmitted, } from '../shared/connectionGate.js';
|
|
12
13
|
/** The version of the better-sqlite3 that `require` resolves; undefined when it cannot be read. */
|
|
13
14
|
const versionOf = (require) => {
|
|
14
15
|
try {
|
|
@@ -82,6 +83,21 @@ const betterSqliteRuntimeRefusal = (version, nodeApi) => {
|
|
|
82
83
|
return (`better-sqlite3 ${version} needs Node-API 10 (Node.js 22.14+ or 23.6+, Electron 35+), and this runtime has ${has}. ` +
|
|
83
84
|
'Install better-sqlite3 12 for this runtime, or choose another adapter.');
|
|
84
85
|
};
|
|
86
|
+
/**
|
|
87
|
+
* Node's AsyncLocalStorage for the connection gate, or null where it cannot be
|
|
88
|
+
* loaded (the gate then admits every statement at once). Loaded when the
|
|
89
|
+
* adapter opens, like the native module, so that browser bundles never import
|
|
90
|
+
* a Node built-in.
|
|
91
|
+
*/
|
|
92
|
+
const loadTransactionContext = async () => {
|
|
93
|
+
try {
|
|
94
|
+
const { AsyncLocalStorage } = await import('async_hooks');
|
|
95
|
+
return new AsyncLocalStorage();
|
|
96
|
+
}
|
|
97
|
+
catch {
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
};
|
|
85
101
|
const normaliseRowId = (rowId) => {
|
|
86
102
|
if (rowId === null || rowId === undefined) {
|
|
87
103
|
return null;
|
|
@@ -147,6 +163,12 @@ export class BetterSqliteAdapter {
|
|
|
147
163
|
this.db = null;
|
|
148
164
|
this.preparedStatements = new Map();
|
|
149
165
|
this.runSerializedTransaction = createSerializedTransactionRunner();
|
|
166
|
+
/**
|
|
167
|
+
* Holds statements from outside an open transaction until it ends, so they
|
|
168
|
+
* neither join it nor read what it has not committed. open() gives it Node's
|
|
169
|
+
* AsyncLocalStorage, which tells the transaction's own statements apart.
|
|
170
|
+
*/
|
|
171
|
+
this.gate = createConnectionGate(null);
|
|
150
172
|
}
|
|
151
173
|
/**
|
|
152
174
|
* Open (or no-op if already open) the underlying native database.
|
|
@@ -182,38 +204,80 @@ export class BetterSqliteAdapter {
|
|
|
182
204
|
}
|
|
183
205
|
}
|
|
184
206
|
const databaseOptions = options?.readOnly ? { readonly: true } : undefined;
|
|
207
|
+
this.gate = createConnectionGate(await loadTransactionContext());
|
|
185
208
|
this.db = new DatabaseCtor(resolvedPath, databaseOptions);
|
|
186
209
|
}
|
|
187
210
|
async run(statement, parameters) {
|
|
211
|
+
return whenAdmitted(this.gate, () => this.runNow(statement, parameters));
|
|
212
|
+
}
|
|
213
|
+
async get(statement, parameters) {
|
|
214
|
+
return whenAdmitted(this.gate, () => this.getNow(statement, parameters));
|
|
215
|
+
}
|
|
216
|
+
async all(statement, parameters) {
|
|
217
|
+
return whenAdmitted(this.gate, () => this.allNow(statement, parameters));
|
|
218
|
+
}
|
|
219
|
+
async exec(script) {
|
|
220
|
+
return whenAdmitted(this.gate, () => this.execNow(script));
|
|
221
|
+
}
|
|
222
|
+
runNow(statement, parameters) {
|
|
188
223
|
const stmt = this.prepareInternal(statement);
|
|
189
224
|
const { named, positional } = normaliseParameters(parameters);
|
|
190
225
|
const result = named ? stmt.run(named) : stmt.run(positional ?? []);
|
|
191
226
|
return { changes: result.changes, lastInsertRowid: normaliseRowId(result.lastInsertRowid) };
|
|
192
227
|
}
|
|
193
|
-
|
|
228
|
+
getNow(statement, parameters) {
|
|
194
229
|
const stmt = this.prepareInternal(statement);
|
|
195
230
|
const { named, positional } = normaliseParameters(parameters);
|
|
196
231
|
const row = named ? stmt.get(named) : stmt.get(positional ?? []);
|
|
197
232
|
return row ?? null;
|
|
198
233
|
}
|
|
199
|
-
|
|
234
|
+
allNow(statement, parameters) {
|
|
200
235
|
const stmt = this.prepareInternal(statement);
|
|
201
236
|
const { named, positional } = normaliseParameters(parameters);
|
|
202
237
|
const rows = named ? stmt.all(named) : stmt.all(positional ?? []);
|
|
203
238
|
return rows;
|
|
204
239
|
}
|
|
205
|
-
|
|
240
|
+
execNow(script) {
|
|
206
241
|
this.ensureOpen();
|
|
207
242
|
this.db.exec(script);
|
|
208
243
|
}
|
|
244
|
+
/**
|
|
245
|
+
* The statements of one transaction's handle: they carry the transaction's
|
|
246
|
+
* token, so the gate admits them whatever async context runs them (a callback
|
|
247
|
+
* may reach its handle through an AsyncResource made before the transaction).
|
|
248
|
+
*/
|
|
249
|
+
handleStatements(token) {
|
|
250
|
+
return {
|
|
251
|
+
kind: this.kind,
|
|
252
|
+
capabilities: this.capabilities,
|
|
253
|
+
open: async () => { },
|
|
254
|
+
close: async () => { },
|
|
255
|
+
run: (statement, parameters) => whenAdmitted(this.gate, () => this.runNow(statement, parameters), token),
|
|
256
|
+
get: (statement, parameters) => whenAdmitted(this.gate, () => this.getNow(statement, parameters), token),
|
|
257
|
+
all: (statement, parameters) => whenAdmitted(this.gate, () => this.allNow(statement, parameters), token),
|
|
258
|
+
exec: (script) => whenAdmitted(this.gate, () => this.execNow(script), token),
|
|
259
|
+
batch: (operations) => whenAdmitted(this.gate, () => this.batchNow(operations), token),
|
|
260
|
+
// The handle answers a nested transaction() itself and never calls this.
|
|
261
|
+
transaction: (fn) => fn(this),
|
|
262
|
+
};
|
|
263
|
+
}
|
|
209
264
|
async transaction(fn) {
|
|
210
265
|
this.ensureOpen();
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
//
|
|
266
|
+
const openToken = this.gate.inside() ? this.gate.openToken() : null;
|
|
267
|
+
if (openToken) {
|
|
268
|
+
// Code the open transaction runs called the adapter itself: the callback
|
|
269
|
+
// joins the open transaction, as one given to the handle's transaction()
|
|
270
|
+
// does, instead of queueing behind the transaction it belongs to. Its
|
|
271
|
+
// handle carries the open transaction's token, as the outer one does.
|
|
272
|
+
return fn(createSharedConnectionTransactionAdapter(this.handleStatements(openToken)));
|
|
273
|
+
}
|
|
274
|
+
// The adapter has one physical connection. Queue top-level callbacks so
|
|
275
|
+
// overlapping callers cannot issue a second BEGIN inside the first tx, and
|
|
276
|
+
// hold the gate so other callers' statements wait for its end.
|
|
277
|
+
return this.runSerializedTransaction(() => this.gate.hold(async (token) => {
|
|
214
278
|
this.ensureOpen();
|
|
215
279
|
this.db.exec('BEGIN');
|
|
216
|
-
const transactionAdapter = createSharedConnectionTransactionAdapter(this);
|
|
280
|
+
const transactionAdapter = createSharedConnectionTransactionAdapter(this.handleStatements(token));
|
|
217
281
|
try {
|
|
218
282
|
const result = await fn(transactionAdapter);
|
|
219
283
|
this.db.exec('COMMIT');
|
|
@@ -226,9 +290,11 @@ export class BetterSqliteAdapter {
|
|
|
226
290
|
catch { /* ignore rollback errors */ }
|
|
227
291
|
throw error;
|
|
228
292
|
}
|
|
229
|
-
});
|
|
293
|
+
}));
|
|
230
294
|
}
|
|
231
295
|
async close() {
|
|
296
|
+
this.gate.dispose();
|
|
297
|
+
this.gate = createConnectionGate(null);
|
|
232
298
|
if (this.db) {
|
|
233
299
|
// Finalize all prepared statements
|
|
234
300
|
this.preparedStatements.clear();
|
|
@@ -246,6 +312,9 @@ export class BetterSqliteAdapter {
|
|
|
246
312
|
* @returns Results of the batch operation
|
|
247
313
|
*/
|
|
248
314
|
async batch(operations) {
|
|
315
|
+
return whenAdmitted(this.gate, () => this.batchNow(operations));
|
|
316
|
+
}
|
|
317
|
+
batchNow(operations) {
|
|
249
318
|
this.ensureOpen();
|
|
250
319
|
const results = [];
|
|
251
320
|
const errors = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"betterSqliteAdapter.js","sourceRoot":"","sources":["../../src/adapters/betterSqliteAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB;;;;;;GAMG;AACH,MAAM,SAAS,GAAG,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,QAAQ,KAAK,WAAW,CAAC;AAO1F,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EACL,iCAAiC,EACjC,wCAAwC,GACzC,MAAM,iCAAiC,CAAC;AAYzC,mGAAmG;AACnG,MAAM,SAAS,GAAG,CAAC,OAAoB,EAAsB,EAAE;IAC7D,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,OAAO,CAAC,6BAA6B,CAA0B,CAAC;QAC5E,OAAO,OAAO,GAAG,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IACnE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC,CAAC;AAEF;;;;;GAKG;AACH;;;;;;;;;;GAUG;AACH,MAAM,gBAAgB,GAAG,KAAK,IAAwC,EAAE;IACtE,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,CAAC;IACjD,IAAI,CAAC;QACH,2EAA2E;QAC3E,qDAAqD;QACrD,MAAM,QAAQ,GAAG,CAAC,MAAM,MAAM,CAAC,gBAAgB,CAAC,CAAkC,CAAC;QACnF,OAAO,EAAE,MAAM,EAA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AAgB,EAAkB,EAAE;IAC5E,IAAI,QAAQ,KAAK,UAAU,IAAI,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5D,OAAO,IAAI,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAC3C,CAAC;IACD,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;QACxC,CAAC,CAAC,QAAQ;QACV,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,QAAQ,CAAC,CAAC;IAC1C,OAAO,IAAI,mBAAmB,CAAC,QAAQ,CAAC,CAAC;AAC3C,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { StorageAdapter, StorageCapability, StorageOpenOptions, StorageParameters, StorageRunResult } from '../core/contracts';
|
|
1
|
+
import type { StorageAdapter, StorageCapability, StorageOpenOptions, StorageParameters, StorageRunResult } from '../core/contracts/index.js';
|
|
2
2
|
export interface CapacitorAdapterOptions {
|
|
3
3
|
/**
|
|
4
4
|
* Database name. Defaults to `app`.
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
* await db.open();
|
|
32
32
|
* ```
|
|
33
33
|
*/
|
|
34
|
-
import type { StorageAdapter, StorageCapability, StorageOpenOptions, StorageParameters, StorageRunResult, BatchOperation, BatchResult, PreparedStatement } from '../../core/contracts';
|
|
34
|
+
import type { StorageAdapter, StorageCapability, StorageOpenOptions, StorageParameters, StorageRunResult, BatchOperation, BatchResult, PreparedStatement } from '../../core/contracts/index.js';
|
|
35
35
|
/**
|
|
36
36
|
* WAL (Write-Ahead Logging) configuration.
|
|
37
37
|
*/
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
* const users = await db.all('SELECT * FROM users');
|
|
28
28
|
* ```
|
|
29
29
|
*/
|
|
30
|
-
import type { StorageAdapter, StorageCapability, StorageOpenOptions, StorageParameters, StorageRunResult, BatchOperation, BatchResult, PreparedStatement } from '../../core/contracts';
|
|
31
|
-
import type { DbChangeEvent, SyncStatus } from './ipc/types';
|
|
30
|
+
import type { StorageAdapter, StorageCapability, StorageOpenOptions, StorageParameters, StorageRunResult, BatchOperation, BatchResult, PreparedStatement } from '../../core/contracts/index.js';
|
|
31
|
+
import type { DbChangeEvent, SyncStatus } from './ipc/types.js';
|
|
32
32
|
/**
|
|
33
33
|
* Options for ElectronRendererAdapter.
|
|
34
34
|
*/
|
|
@@ -61,14 +61,14 @@
|
|
|
61
61
|
*
|
|
62
62
|
* @packageDocumentation
|
|
63
63
|
*/
|
|
64
|
-
export { ElectronMainAdapter, createElectronMainAdapter, type ElectronMainAdapterOptions, type WalConfig, type RecoveryConfig, type MigrationConfig, type BackupConfig, type CloudBackupProvider, type MultiWindowConfig, } from './electronMainAdapter';
|
|
65
|
-
export { ElectronRendererAdapter, createElectronRendererAdapter, isElectronRenderer, isPreloadApiAvailable, type ElectronRendererAdapterOptions, } from './electronRendererAdapter';
|
|
66
|
-
export { sqlStorageApi, type SqlStorageApi, } from './preload';
|
|
67
|
-
export { IPC_CHANNELS, DB_CHANNELS, TRANSACTION_CHANNELS, SYNC_CHANNELS, BACKUP_CHANNELS, RECOVERY_CHANNELS, MIGRATION_CHANNELS, BROADCAST_CHANNELS, type IpcChannel, } from './ipc/channels';
|
|
68
|
-
export type { IpcRequest, IpcResponse, IpcError, SqlOperationPayload, ExecPayload, BatchPayload, OpenPayload, TransactionContext, TransactionOperationPayload, SyncStatus, BackupInfo, DbChangeEvent, ConnectionStateEvent, IntegrityCheckResult, WalCheckpointResult, MigrationStatus, } from './ipc/types';
|
|
69
|
-
export { IpcProtocolManager, protocolManager, initializeIpcProtocol, disposeIpcProtocol, } from './ipc/protocol';
|
|
70
|
-
export { WalCheckpointManager, createWalCheckpointManager, type WalCheckpointConfig, type CheckpointStrategy, type CheckpointResult, type WalStatus, CorruptionDetector, createCorruptionDetector, type CorruptionDetectorConfig, type IntegrityCheckLevel, type IntegrityCheckResult as RecoveryIntegrityCheckResult, type CorruptionIssue, type RepairStrategy, type RepairResult, } from './recovery';
|
|
71
|
-
export { AutoMigrator, createAutoMigrator, type AutoMigratorConfig, type MigrationFile, type AppliedMigration, type MigrationResult, } from './migration';
|
|
72
|
-
export { WindowManager, createWindowManager, type WindowManagerConfig, type WindowManagerCallbacks, type RegisteredWindow, } from './window';
|
|
73
|
-
export type { StorageAdapter, StorageCapability, StorageOpenOptions, StorageParameters, StorageRunResult, BatchOperation, BatchResult, } from '../../core/contracts';
|
|
64
|
+
export { ElectronMainAdapter, createElectronMainAdapter, type ElectronMainAdapterOptions, type WalConfig, type RecoveryConfig, type MigrationConfig, type BackupConfig, type CloudBackupProvider, type MultiWindowConfig, } from './electronMainAdapter.js';
|
|
65
|
+
export { ElectronRendererAdapter, createElectronRendererAdapter, isElectronRenderer, isPreloadApiAvailable, type ElectronRendererAdapterOptions, } from './electronRendererAdapter.js';
|
|
66
|
+
export { sqlStorageApi, type SqlStorageApi, } from './preload.js';
|
|
67
|
+
export { IPC_CHANNELS, DB_CHANNELS, TRANSACTION_CHANNELS, SYNC_CHANNELS, BACKUP_CHANNELS, RECOVERY_CHANNELS, MIGRATION_CHANNELS, BROADCAST_CHANNELS, type IpcChannel, } from './ipc/channels.js';
|
|
68
|
+
export type { IpcRequest, IpcResponse, IpcError, SqlOperationPayload, ExecPayload, BatchPayload, OpenPayload, TransactionContext, TransactionOperationPayload, SyncStatus, BackupInfo, DbChangeEvent, ConnectionStateEvent, IntegrityCheckResult, WalCheckpointResult, MigrationStatus, } from './ipc/types.js';
|
|
69
|
+
export { IpcProtocolManager, protocolManager, initializeIpcProtocol, disposeIpcProtocol, } from './ipc/protocol.js';
|
|
70
|
+
export { WalCheckpointManager, createWalCheckpointManager, type WalCheckpointConfig, type CheckpointStrategy, type CheckpointResult, type WalStatus, CorruptionDetector, createCorruptionDetector, type CorruptionDetectorConfig, type IntegrityCheckLevel, type IntegrityCheckResult as RecoveryIntegrityCheckResult, type CorruptionIssue, type RepairStrategy, type RepairResult, } from './recovery/index.js';
|
|
71
|
+
export { AutoMigrator, createAutoMigrator, type AutoMigratorConfig, type MigrationFile, type AppliedMigration, type MigrationResult, } from './migration/index.js';
|
|
72
|
+
export { WindowManager, createWindowManager, type WindowManagerConfig, type WindowManagerCallbacks, type RegisteredWindow, } from './window/index.js';
|
|
73
|
+
export type { StorageAdapter, StorageCapability, StorageOpenOptions, StorageParameters, StorageRunResult, BatchOperation, BatchResult, } from '../../core/contracts/index.js';
|
|
74
74
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @packageDocumentation
|
|
7
7
|
*/
|
|
8
|
-
export * from './channels';
|
|
9
|
-
export * from './types';
|
|
10
|
-
export { IpcProtocolManager, protocolManager, initializeIpcProtocol, disposeIpcProtocol, } from './protocol';
|
|
8
|
+
export * from './channels.js';
|
|
9
|
+
export * from './types.js';
|
|
10
|
+
export { IpcProtocolManager, protocolManager, initializeIpcProtocol, disposeIpcProtocol, } from './protocol.js';
|
|
11
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* operations from renderer processes. Ensures type-safe communication
|
|
6
6
|
* and proper error handling.
|
|
7
7
|
*/
|
|
8
|
-
import type { StorageAdapter } from '../../../core/contracts';
|
|
8
|
+
import type { StorageAdapter } from '../../../core/contracts/index.js';
|
|
9
9
|
/**
|
|
10
10
|
* IPC Protocol Manager.
|
|
11
11
|
*
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Provides type-safe request/response patterns for IPC communication
|
|
5
5
|
* between main and renderer processes.
|
|
6
6
|
*/
|
|
7
|
-
import type { StorageParameters, StorageRunResult, StorageOpenOptions, StorageCapability, BatchOperation, BatchResult } from '../../../core/contracts';
|
|
7
|
+
import type { StorageParameters, StorageRunResult, StorageOpenOptions, StorageCapability, BatchOperation, BatchResult } from '../../../core/contracts/index.js';
|
|
8
8
|
/**
|
|
9
9
|
* Base request structure with correlation ID for request tracking.
|
|
10
10
|
*/
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @packageDocumentation
|
|
7
7
|
*/
|
|
8
|
-
export { AutoMigrator, createAutoMigrator, type AutoMigratorConfig, type MigrationFile, type AppliedMigration, type MigrationResult, } from './autoMigrator';
|
|
8
|
+
export { AutoMigrator, createAutoMigrator, type AutoMigratorConfig, type MigrationFile, type AppliedMigration, type MigrationResult, } from './autoMigrator.js';
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
* });
|
|
22
22
|
* ```
|
|
23
23
|
*/
|
|
24
|
-
import type { TransactionContext, SyncStatus, DbChangeEvent } from './ipc/types';
|
|
25
|
-
import type { StorageRunResult, StorageOpenOptions, StorageParameters, BatchOperation, BatchResult, StorageCapability } from '../../core/contracts';
|
|
24
|
+
import type { TransactionContext, SyncStatus, DbChangeEvent } from './ipc/types.js';
|
|
25
|
+
import type { StorageRunResult, StorageOpenOptions, StorageParameters, BatchOperation, BatchResult, StorageCapability } from '../../core/contracts/index.js';
|
|
26
26
|
/**
|
|
27
27
|
* SQL Storage API exposed to renderer processes.
|
|
28
28
|
*/
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
|
-
export { WalCheckpointManager, createWalCheckpointManager, type WalCheckpointConfig, type CheckpointStrategy, type CheckpointResult, type WalStatus, } from './walCheckpoint';
|
|
10
|
-
export { CorruptionDetector, createCorruptionDetector, type CorruptionDetectorConfig, type IntegrityCheckLevel, type IntegrityCheckResult, type CorruptionIssue, type RepairStrategy, type RepairResult, } from './corruptionDetector';
|
|
9
|
+
export { WalCheckpointManager, createWalCheckpointManager, type WalCheckpointConfig, type CheckpointStrategy, type CheckpointResult, type WalStatus, } from './walCheckpoint.js';
|
|
10
|
+
export { CorruptionDetector, createCorruptionDetector, type CorruptionDetectorConfig, type IntegrityCheckLevel, type IntegrityCheckResult, type CorruptionIssue, type RepairStrategy, type RepairResult, } from './corruptionDetector.js';
|
|
11
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @packageDocumentation
|
|
7
7
|
*/
|
|
8
|
-
export { WindowManager, createWindowManager, type WindowManagerConfig, type WindowManagerCallbacks, type RegisteredWindow, } from './windowManager';
|
|
8
|
+
export { WindowManager, createWindowManager, type WindowManagerConfig, type WindowManagerCallbacks, type RegisteredWindow, } from './windowManager.js';
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
* console.log(session);
|
|
43
43
|
* ```
|
|
44
44
|
*/
|
|
45
|
-
import type { StorageAdapter, StorageCapability, StorageOpenOptions, StorageParameters, StorageRunResult } from '../core/contracts';
|
|
45
|
+
import type { StorageAdapter, StorageCapability, StorageOpenOptions, StorageParameters, StorageRunResult } from '../core/contracts/index.js';
|
|
46
46
|
/**
|
|
47
47
|
* Configuration for IndexedDB adapter.
|
|
48
48
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { StorageAdapter, StorageCapability, StorageOpenOptions, StorageParameters, StorageRunResult } from '../core/contracts';
|
|
1
|
+
import type { StorageAdapter, StorageCapability, StorageOpenOptions, StorageParameters, StorageRunResult } from '../core/contracts/index.js';
|
|
2
2
|
/**
|
|
3
3
|
* Configuration options for PostgreSQL adapter.
|
|
4
4
|
* Supports both connection strings and granular configuration.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SqlJsConfig } from 'sql.js';
|
|
2
|
-
import type { StorageAdapter, StorageCapability, StorageOpenOptions, StorageParameters, StorageRunResult } from '../core/contracts';
|
|
2
|
+
import type { StorageAdapter, StorageCapability, StorageOpenOptions, StorageParameters, StorageRunResult } from '../core/contracts/index.js';
|
|
3
3
|
type SqlJsAdapterOptions = SqlJsConfig;
|
|
4
4
|
/**
|
|
5
5
|
* Storage adapter backed by sql.js (WebAssembly) for environments without native SQLite bindings.
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Supabase Postgres Storage Adapter
|
|
3
3
|
* Provides full Postgres capabilities with Supabase's managed infrastructure
|
|
4
4
|
*/
|
|
5
|
-
import type { StorageAdapter, StorageCapability, StorageOpenOptions, StorageParameters, StorageRunResult, BatchResult } from '../core/contracts';
|
|
6
|
-
import type { StorageAdapterExtensions, ExtendedBatchOperation, Migration, PerformanceMetrics, StreamOptions } from '../core/contracts/extensions';
|
|
5
|
+
import type { StorageAdapter, StorageCapability, StorageOpenOptions, StorageParameters, StorageRunResult, BatchResult } from '../core/contracts/index.js';
|
|
6
|
+
import type { StorageAdapterExtensions, ExtendedBatchOperation, Migration, PerformanceMetrics, StreamOptions } from '../core/contracts/extensions.js';
|
|
7
7
|
export interface SupabaseAdapterOptions extends StorageOpenOptions {
|
|
8
8
|
connectionString?: string;
|
|
9
9
|
poolConfig?: {
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* connection state, and performance characteristics without requiring
|
|
6
6
|
* developers to manually check capability flags.
|
|
7
7
|
*/
|
|
8
|
-
import type { StorageAdapter, StorageCapability } from './index';
|
|
9
|
-
import type { PerformanceMetrics } from './extensions';
|
|
8
|
+
import type { StorageAdapter, StorageCapability } from './index.js';
|
|
9
|
+
import type { PerformanceMetrics } from './extensions.js';
|
|
10
10
|
/**
|
|
11
11
|
* Type of database connection.
|
|
12
12
|
*/
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* These types enable applications to subscribe to adapter events
|
|
5
5
|
* for logging, monitoring, debugging, and analytics purposes.
|
|
6
6
|
*/
|
|
7
|
-
import type { StorageParameters } from './index';
|
|
8
|
-
import type { AdapterContext } from './context';
|
|
7
|
+
import type { StorageParameters } from './index.js';
|
|
8
|
+
import type { AdapterContext } from './context.js';
|
|
9
9
|
/**
|
|
10
10
|
* Event emitted when a connection is opened.
|
|
11
11
|
*/
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* These types are used by adapters that provide additional functionality
|
|
4
4
|
* beyond the core StorageAdapter interface.
|
|
5
5
|
*/
|
|
6
|
-
import type { BatchOperation as CoreBatchOperation } from './index';
|
|
6
|
+
import type { BatchOperation as CoreBatchOperation } from './index.js';
|
|
7
7
|
/**
|
|
8
8
|
* Performance metrics for monitoring adapter usage.
|
|
9
9
|
*/
|
|
@@ -68,6 +68,6 @@ export interface StorageAdapterExtensions {
|
|
|
68
68
|
*/
|
|
69
69
|
stream?<T>(statement: string, parameters?: unknown, options?: StreamOptions): AsyncIterableIterator<T>;
|
|
70
70
|
}
|
|
71
|
-
export type { BatchOperation } from './index';
|
|
72
|
-
export type { BatchResult } from './index';
|
|
71
|
+
export type { BatchOperation } from './index.js';
|
|
72
|
+
export type { BatchResult } from './index.js';
|
|
73
73
|
//# sourceMappingURL=extensions.d.ts.map
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
* const db = await createDatabase({ hooks: auditHooks });
|
|
35
35
|
* ```
|
|
36
36
|
*/
|
|
37
|
-
import type { StorageParameters, StorageRunResult } from './index';
|
|
37
|
+
import type { StorageParameters, StorageRunResult } from './index.js';
|
|
38
38
|
/**
|
|
39
39
|
* Base context for all operations.
|
|
40
40
|
*
|
|
@@ -236,12 +236,12 @@ export declare class StorageResolutionError extends Error {
|
|
|
236
236
|
* Performance configuration types for cost/accuracy optimization.
|
|
237
237
|
* See `OPTIMIZATION_GUIDE.md` for detailed usage documentation.
|
|
238
238
|
*/
|
|
239
|
-
export * from './performance';
|
|
239
|
+
export * from './performance.js';
|
|
240
240
|
/**
|
|
241
241
|
* Lifecycle hooks for extending adapter behavior.
|
|
242
242
|
* Designed for RAG integration, analytics, and auditing.
|
|
243
243
|
*/
|
|
244
|
-
export * from './hooks';
|
|
244
|
+
export * from './hooks.js';
|
|
245
245
|
export type { SqlDialect } from './dialect.js';
|
|
246
246
|
export type { IFullTextSearch } from './fts.js';
|
|
247
247
|
export type { IBlobCodec } from './blobCodec.js';
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* supported database adapter, enabling runtime introspection and
|
|
6
6
|
* automatic constraint enforcement.
|
|
7
7
|
*/
|
|
8
|
-
import type { AdapterLimitations } from './context';
|
|
8
|
+
import type { AdapterLimitations } from './context.js';
|
|
9
9
|
/**
|
|
10
10
|
* Limitations for better-sqlite3 adapter.
|
|
11
11
|
*/
|
package/dist/core/database.d.ts
CHANGED
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
* - connectDatabase() - Explicit connection with clear options
|
|
7
7
|
* - openDatabase() - Simple file-based database
|
|
8
8
|
*/
|
|
9
|
-
import type { StorageAdapter } from './contracts';
|
|
10
|
-
import { type AdapterKind } from './resolver';
|
|
11
|
-
import type { PostgresAdapterOptions } from '../adapters/postgresAdapter';
|
|
12
|
-
import type { CapacitorAdapterOptions } from '../adapters/capacitorSqliteAdapter';
|
|
13
|
-
import type { IndexedDbAdapterOptions } from '../adapters/indexedDbAdapter';
|
|
9
|
+
import type { StorageAdapter } from './contracts/index.js';
|
|
10
|
+
import { type AdapterKind } from './resolver.js';
|
|
11
|
+
import type { PostgresAdapterOptions } from '../adapters/postgresAdapter.js';
|
|
12
|
+
import type { CapacitorAdapterOptions } from '../adapters/capacitorSqliteAdapter.js';
|
|
13
|
+
import type { IndexedDbAdapterOptions } from '../adapters/indexedDbAdapter.js';
|
|
14
14
|
/**
|
|
15
15
|
* Database connection options.
|
|
16
16
|
*/
|
|
@@ -152,5 +152,5 @@ export declare function openDatabase(filePath: string): Promise<StorageAdapter>;
|
|
|
152
152
|
* ```
|
|
153
153
|
*/
|
|
154
154
|
export declare function createMemoryDatabase(): Promise<StorageAdapter>;
|
|
155
|
-
export { resolveStorageAdapter } from './resolver';
|
|
155
|
+
export { resolveStorageAdapter } from './resolver.js';
|
|
156
156
|
//# sourceMappingURL=database.d.ts.map
|
package/dist/core/resolver.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { StorageAdapter, StorageOpenOptions } from './contracts';
|
|
2
|
-
import type { AdapterKind } from './contracts/context';
|
|
3
|
-
import { type CapacitorAdapterOptions } from '../adapters/capacitorSqliteAdapter';
|
|
4
|
-
import { type IndexedDbAdapterOptions } from '../adapters/indexedDbAdapter';
|
|
5
|
-
export type { AdapterKind } from './contracts/context';
|
|
1
|
+
import type { StorageAdapter, StorageOpenOptions } from './contracts/index.js';
|
|
2
|
+
import type { AdapterKind } from './contracts/context.js';
|
|
3
|
+
import { type CapacitorAdapterOptions } from '../adapters/capacitorSqliteAdapter.js';
|
|
4
|
+
import { type IndexedDbAdapterOptions } from '../adapters/indexedDbAdapter.js';
|
|
5
|
+
export type { AdapterKind } from './contracts/context.js';
|
|
6
6
|
export interface StorageResolutionOptions {
|
|
7
7
|
/** Absolute path for sqlite file (used by better-sqlite3/sql.js when persistence is desired). */
|
|
8
8
|
filePath?: string;
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
*
|
|
31
31
|
* @module cloudBackup
|
|
32
32
|
*/
|
|
33
|
-
import type { StorageAdapter } from '../../core/contracts';
|
|
33
|
+
import type { StorageAdapter } from '../../core/contracts/index.js';
|
|
34
34
|
/** Supported backup export formats */
|
|
35
35
|
export type BackupFormat = 'json' | 'sql';
|
|
36
36
|
/** Supported compression algorithms */
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Data export utilities for cross-adapter migration and backup.
|
|
3
3
|
* Supports exporting data to portable formats (JSON, SQL, CSV).
|
|
4
4
|
*/
|
|
5
|
-
import type { StorageAdapter } from '../../core/contracts';
|
|
5
|
+
import type { StorageAdapter } from '../../core/contracts/index.js';
|
|
6
6
|
/**
|
|
7
7
|
* Export format types.
|
|
8
8
|
*/
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Data import utilities for cross-adapter migration and restoration.
|
|
3
3
|
* Supports importing from JSON, SQL dumps, and CSV files.
|
|
4
4
|
*/
|
|
5
|
-
import type { StorageAdapter } from '../../core/contracts';
|
|
6
|
-
import type { ExportedData } from './dataExport';
|
|
5
|
+
import type { StorageAdapter } from '../../core/contracts/index.js';
|
|
6
|
+
import type { ExportedData } from './dataExport.js';
|
|
7
7
|
/**
|
|
8
8
|
* Options for data import.
|
|
9
9
|
*/
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* High-level migration utilities for moving data between adapters.
|
|
3
3
|
* Simplifies common migration scenarios like local -> Supabase, Supabase -> local, etc.
|
|
4
4
|
*/
|
|
5
|
-
import type { StorageAdapter } from '../../core/contracts';
|
|
6
|
-
import { type ImportResult, type DataImportOptions } from './dataImport';
|
|
5
|
+
import type { StorageAdapter } from '../../core/contracts/index.js';
|
|
6
|
+
import { type ImportResult, type DataImportOptions } from './dataImport.js';
|
|
7
7
|
/**
|
|
8
8
|
* Migration strategy for handling conflicts and errors.
|
|
9
9
|
*/
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
|
-
import type { StorageAdapter } from '../../core/contracts';
|
|
10
|
-
import type { VectorClockData } from './protocol/vectorClock';
|
|
11
|
-
import type { ChangeRecord } from './protocol/messages';
|
|
12
|
-
import type { TransportOptions } from './transport/transport';
|
|
13
|
-
import type { SyncConflict, ConflictResolution, ConflictStrategy, ConflictUIHooks, FieldMerger } from './conflicts/conflictResolver';
|
|
14
|
-
import type { DeviceInfo, DeviceType } from './devices/deviceManager';
|
|
9
|
+
import type { StorageAdapter } from '../../core/contracts/index.js';
|
|
10
|
+
import type { VectorClockData } from './protocol/vectorClock.js';
|
|
11
|
+
import type { ChangeRecord } from './protocol/messages.js';
|
|
12
|
+
import type { TransportOptions } from './transport/transport.js';
|
|
13
|
+
import type { SyncConflict, ConflictResolution, ConflictStrategy, ConflictUIHooks, FieldMerger } from './conflicts/conflictResolver.js';
|
|
14
|
+
import type { DeviceInfo, DeviceType } from './devices/deviceManager.js';
|
|
15
15
|
/**
|
|
16
16
|
* Table sync configuration.
|
|
17
17
|
*/
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
|
-
import type { StorageAdapter } from '../../../core/contracts';
|
|
10
|
-
import type { VectorClock } from '../protocol/vectorClock';
|
|
9
|
+
import type { StorageAdapter } from '../../../core/contracts/index.js';
|
|
10
|
+
import type { VectorClock } from '../protocol/vectorClock.js';
|
|
11
11
|
/**
|
|
12
12
|
* Device types supported for sync.
|
|
13
13
|
*/
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
* await sync.sync();
|
|
26
26
|
* ```
|
|
27
27
|
*/
|
|
28
|
-
export { CrossPlatformSync, createCrossPlatformSync, type CrossPlatformSyncOptions, type CrossPlatformSyncHooks, type TableSyncConfig, type SyncResult, type SyncStatus as CrossPlatformSyncStatus, } from './crossPlatformSync';
|
|
29
|
-
export { VectorClock, createVectorClock, compareClocks, mergeClocks, generateDeviceId, dominates, type VectorClockData, type CausalRelation, type SerializedVectorClock, } from './protocol/vectorClock';
|
|
30
|
-
export { type ChangeOperation, type ChangeRecord, type ChangeBatch, type SyncProgress, type SyncStatus as ProtocolSyncStatus, type BaseMessage, type HandshakeRequest, type HandshakeResponse, type DeltaPush, type DeltaPullRequest, type DeltaPullResponse, type AckMessage, type ConflictMessage, type PresenceMessage, type HeartbeatMessage, type HeartbeatAck, type ErrorMessage, type SyncMessage, type SyncMessageType, type DeviceType as ProtocolDeviceType, type DeviceInfo as ProtocolDeviceInfo, type ConflictResolution as ProtocolConflictResolution, generateMessageId, createBaseMessage, createHandshakeRequest, createAck, createHeartbeat, createError, createDeltaPushMessage, createDeltaPullRequest, createPresenceMessage, createHeartbeatMessage, createAckMessage, generateChangeId, createChangeRecord, isHandshakeRequest, isDeltaPush, isConflict, isError, isSyncMessage, } from './protocol/messages';
|
|
31
|
-
export { BaseTransport, TransportError, TransportErrorCodes, type SyncTransport, type TransportOptions, type TransportState, type TransportStats, type TransportEventType, type TransportEvents, type TransportEventListener, } from './transport/transport';
|
|
32
|
-
export { WebSocketTransport, createWebSocketTransport, type WebSocketTransportOptions, } from './transport/websocketTransport';
|
|
33
|
-
export { HttpTransport, createHttpTransport, type HttpTransportOptions, } from './transport/httpTransport';
|
|
34
|
-
export { ConflictResolver, createConflictResolver, FieldMergers, type ConflictStrategy, type ResolutionDecision, type SyncConflict, type ConflictResolution, type ConflictUIHooks, type ConflictResolverOptions, type FieldMerger, } from './conflicts/conflictResolver';
|
|
35
|
-
export { DeviceManager, createDeviceManager, type DeviceType, type PresenceStatus, type DeviceInfo, type DeviceCapabilities, type DeviceRegistrationOptions, type PresenceEvent, type DeviceManagerEventType, type DeviceManagerEvents, type DeviceManagerOptions, } from './devices/deviceManager';
|
|
36
|
-
export { SyncLogManager, type ChangeLogEntry as SyncLogChange, type ConflictEntry as SyncLogConflict, } from './tables/syncLogManager';
|
|
28
|
+
export { CrossPlatformSync, createCrossPlatformSync, type CrossPlatformSyncOptions, type CrossPlatformSyncHooks, type TableSyncConfig, type SyncResult, type SyncStatus as CrossPlatformSyncStatus, } from './crossPlatformSync.js';
|
|
29
|
+
export { VectorClock, createVectorClock, compareClocks, mergeClocks, generateDeviceId, dominates, type VectorClockData, type CausalRelation, type SerializedVectorClock, } from './protocol/vectorClock.js';
|
|
30
|
+
export { type ChangeOperation, type ChangeRecord, type ChangeBatch, type SyncProgress, type SyncStatus as ProtocolSyncStatus, type BaseMessage, type HandshakeRequest, type HandshakeResponse, type DeltaPush, type DeltaPullRequest, type DeltaPullResponse, type AckMessage, type ConflictMessage, type PresenceMessage, type HeartbeatMessage, type HeartbeatAck, type ErrorMessage, type SyncMessage, type SyncMessageType, type DeviceType as ProtocolDeviceType, type DeviceInfo as ProtocolDeviceInfo, type ConflictResolution as ProtocolConflictResolution, generateMessageId, createBaseMessage, createHandshakeRequest, createAck, createHeartbeat, createError, createDeltaPushMessage, createDeltaPullRequest, createPresenceMessage, createHeartbeatMessage, createAckMessage, generateChangeId, createChangeRecord, isHandshakeRequest, isDeltaPush, isConflict, isError, isSyncMessage, } from './protocol/messages.js';
|
|
31
|
+
export { BaseTransport, TransportError, TransportErrorCodes, type SyncTransport, type TransportOptions, type TransportState, type TransportStats, type TransportEventType, type TransportEvents, type TransportEventListener, } from './transport/transport.js';
|
|
32
|
+
export { WebSocketTransport, createWebSocketTransport, type WebSocketTransportOptions, } from './transport/websocketTransport.js';
|
|
33
|
+
export { HttpTransport, createHttpTransport, type HttpTransportOptions, } from './transport/httpTransport.js';
|
|
34
|
+
export { ConflictResolver, createConflictResolver, FieldMergers, type ConflictStrategy, type ResolutionDecision, type SyncConflict, type ConflictResolution, type ConflictUIHooks, type ConflictResolverOptions, type FieldMerger, } from './conflicts/conflictResolver.js';
|
|
35
|
+
export { DeviceManager, createDeviceManager, type DeviceType, type PresenceStatus, type DeviceInfo, type DeviceCapabilities, type DeviceRegistrationOptions, type PresenceEvent, type DeviceManagerEventType, type DeviceManagerEvents, type DeviceManagerOptions, } from './devices/deviceManager.js';
|
|
36
|
+
export { SyncLogManager, type ChangeLogEntry as SyncLogChange, type ConflictEntry as SyncLogConflict, } from './tables/syncLogManager.js';
|
|
37
37
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
* const changes = await syncLog.getChangesSince(remoteVectorClock);
|
|
23
23
|
* ```
|
|
24
24
|
*/
|
|
25
|
-
import type { StorageAdapter } from '../../../core/contracts';
|
|
26
|
-
import type { VectorClockData } from '../protocol/vectorClock';
|
|
27
|
-
import { VectorClock } from '../protocol/vectorClock';
|
|
28
|
-
import type { ChangeRecord, ChangeOperation, DeviceInfo, DeviceType } from '../protocol/messages';
|
|
25
|
+
import type { StorageAdapter } from '../../../core/contracts/index.js';
|
|
26
|
+
import type { VectorClockData } from '../protocol/vectorClock.js';
|
|
27
|
+
import { VectorClock } from '../protocol/vectorClock.js';
|
|
28
|
+
import type { ChangeRecord, ChangeOperation, DeviceInfo, DeviceType } from '../protocol/messages.js';
|
|
29
29
|
/**
|
|
30
30
|
* Change log entry as stored in database.
|
|
31
31
|
*/
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
|
-
import { BaseTransport, type TransportOptions } from './transport';
|
|
10
|
-
import type { SyncMessage } from '../protocol/messages';
|
|
9
|
+
import { BaseTransport, type TransportOptions } from './transport.js';
|
|
10
|
+
import type { SyncMessage } from '../protocol/messages.js';
|
|
11
11
|
/**
|
|
12
12
|
* HTTP-specific transport options.
|
|
13
13
|
*/
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
|
-
export * from './transport';
|
|
10
|
-
export * from './websocketTransport';
|
|
11
|
-
export * from './httpTransport';
|
|
9
|
+
export * from './transport.js';
|
|
10
|
+
export * from './websocketTransport.js';
|
|
11
|
+
export * from './httpTransport.js';
|
|
12
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
|
-
import { BaseTransport, type TransportOptions } from './transport';
|
|
10
|
-
import type { SyncMessage } from '../protocol/messages';
|
|
9
|
+
import { BaseTransport, type TransportOptions } from './transport.js';
|
|
10
|
+
import type { SyncMessage } from '../protocol/messages.js';
|
|
11
11
|
/**
|
|
12
12
|
* WebSocket-specific transport options.
|
|
13
13
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
export * from './types';
|
|
2
|
-
export * from './core/database';
|
|
3
|
-
export * from './core/resolver';
|
|
4
|
-
export * from './adapters/betterSqliteAdapter';
|
|
5
|
-
export * from './adapters/sqlJsAdapter';
|
|
6
|
-
export * from './adapters/indexedDbAdapter';
|
|
7
|
-
export * from './adapters/capacitorSqliteAdapter';
|
|
8
|
-
export * from './adapters/postgresAdapter';
|
|
9
|
-
export * from './adapters/supabase';
|
|
10
|
-
export * from './adapters/baseStorageAdapter';
|
|
11
|
-
export * from './features/backup/cloudBackup';
|
|
12
|
-
export * from './features/migrations/dataExport';
|
|
13
|
-
export * from './features/migrations/dataImport';
|
|
14
|
-
export * from './features/migrations/migration';
|
|
15
|
-
export * from './features/sync/syncManager';
|
|
16
|
-
export * from './shared/parameterUtils';
|
|
17
|
-
export { SqliteDialect } from './dialects/SqliteDialect';
|
|
18
|
-
export { PostgresDialect } from './dialects/PostgresDialect';
|
|
19
|
-
export { SqliteFts5 } from './fts/SqliteFts5';
|
|
20
|
-
export { PostgresFts } from './fts/PostgresFts';
|
|
21
|
-
export { NodeBlobCodec } from './codecs/NodeBlobCodec';
|
|
22
|
-
export { BrowserBlobCodec } from './codecs/BrowserBlobCodec';
|
|
23
|
-
export { SqliteFileExporter } from './exporters/SqliteFileExporter';
|
|
24
|
-
export { PostgresExporter } from './exporters/PostgresExporter';
|
|
25
|
-
export { createStorageFeatures } from './core/contracts/features';
|
|
1
|
+
export * from './types/index.js';
|
|
2
|
+
export * from './core/database.js';
|
|
3
|
+
export * from './core/resolver.js';
|
|
4
|
+
export * from './adapters/betterSqliteAdapter.js';
|
|
5
|
+
export * from './adapters/sqlJsAdapter.js';
|
|
6
|
+
export * from './adapters/indexedDbAdapter.js';
|
|
7
|
+
export * from './adapters/capacitorSqliteAdapter.js';
|
|
8
|
+
export * from './adapters/postgresAdapter.js';
|
|
9
|
+
export * from './adapters/supabase.js';
|
|
10
|
+
export * from './adapters/baseStorageAdapter.js';
|
|
11
|
+
export * from './features/backup/cloudBackup.js';
|
|
12
|
+
export * from './features/migrations/dataExport.js';
|
|
13
|
+
export * from './features/migrations/dataImport.js';
|
|
14
|
+
export * from './features/migrations/migration.js';
|
|
15
|
+
export * from './features/sync/syncManager.js';
|
|
16
|
+
export * from './shared/parameterUtils.js';
|
|
17
|
+
export { SqliteDialect } from './dialects/SqliteDialect.js';
|
|
18
|
+
export { PostgresDialect } from './dialects/PostgresDialect.js';
|
|
19
|
+
export { SqliteFts5 } from './fts/SqliteFts5.js';
|
|
20
|
+
export { PostgresFts } from './fts/PostgresFts.js';
|
|
21
|
+
export { NodeBlobCodec } from './codecs/NodeBlobCodec.js';
|
|
22
|
+
export { BrowserBlobCodec } from './codecs/BrowserBlobCodec.js';
|
|
23
|
+
export { SqliteFileExporter } from './exporters/SqliteFileExporter.js';
|
|
24
|
+
export { PostgresExporter } from './exporters/PostgresExporter.js';
|
|
25
|
+
export { createStorageFeatures } from './core/contracts/features.js';
|
|
26
26
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keeps statements from outside an open transaction out of it.
|
|
3
|
+
*
|
|
4
|
+
* An adapter whose transactions share one connection runs BEGIN, the
|
|
5
|
+
* callback's statements and COMMIT on that connection. While the callback
|
|
6
|
+
* awaits, a statement another caller issues would otherwise run on the same
|
|
7
|
+
* connection inside the open transaction: a write would be undone if the
|
|
8
|
+
* transaction rolled back, and a read would see rows the transaction has not
|
|
9
|
+
* committed. The gate makes such a statement wait until the transaction ends.
|
|
10
|
+
*
|
|
11
|
+
* A statement issued from inside the transaction runs in it. Through the
|
|
12
|
+
* callback's handle it carries the transaction's token, so it is admitted
|
|
13
|
+
* whatever async context runs it. Through the adapter itself, from code the
|
|
14
|
+
* callback runs, the callback's async context tells it apart, so the gate needs
|
|
15
|
+
* a context store (Node's AsyncLocalStorage); without one it admits every
|
|
16
|
+
* statement that carries no token at once, which is how the adapters behaved
|
|
17
|
+
* before the gate.
|
|
18
|
+
*
|
|
19
|
+
* This module imports nothing from Node, so browser bundles can include it;
|
|
20
|
+
* the adapter that runs on Node passes the store in.
|
|
21
|
+
*/
|
|
22
|
+
/** The part of Node's `AsyncLocalStorage` the gate uses. */
|
|
23
|
+
export interface TransactionContextStore {
|
|
24
|
+
run<R>(store: symbol, callback: () => R): R;
|
|
25
|
+
getStore(): symbol | undefined;
|
|
26
|
+
/** Releases the store; Node collects an enabled store only after this. */
|
|
27
|
+
disable(): void;
|
|
28
|
+
}
|
|
29
|
+
/** The gate of one shared connection. */
|
|
30
|
+
export interface ConnectionGate {
|
|
31
|
+
/**
|
|
32
|
+
* True when a statement must wait: a transaction is open and the statement
|
|
33
|
+
* is not its own. A transaction handle passes its token; any other caller is
|
|
34
|
+
* judged by its async context.
|
|
35
|
+
*/
|
|
36
|
+
blocks(token?: symbol): boolean;
|
|
37
|
+
/** True when a transaction is open and the caller runs inside it. */
|
|
38
|
+
inside(): boolean;
|
|
39
|
+
/** The open transaction's token, for a handle made inside it; null when none is open. */
|
|
40
|
+
openToken(): symbol | null;
|
|
41
|
+
/** Settles when the open transaction ends; at once when none is open. */
|
|
42
|
+
ended(): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* Runs one transaction's body with the gate closed to callers outside it.
|
|
45
|
+
* The body receives the transaction's token for its handle, and runs in its
|
|
46
|
+
* own async context, so code it runs is admitted too. The caller runs one
|
|
47
|
+
* body at a time (the adapter's transaction queue).
|
|
48
|
+
*/
|
|
49
|
+
hold<T>(body: (token: symbol) => Promise<T>): Promise<T>;
|
|
50
|
+
/** Releases the context store when the connection closes. */
|
|
51
|
+
dispose(): void;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Creates the gate of one shared connection.
|
|
55
|
+
*
|
|
56
|
+
* @param context - Node's AsyncLocalStorage, or null where there is none (the
|
|
57
|
+
* gate then admits every statement at once).
|
|
58
|
+
*/
|
|
59
|
+
export declare const createConnectionGate: (context: TransactionContextStore | null) => ConnectionGate;
|
|
60
|
+
/**
|
|
61
|
+
* Runs `work`, a synchronous statement, once the gate admits it. The last check
|
|
62
|
+
* and the work happen in the same turn, so no transaction can open between
|
|
63
|
+
* them; a caller woken when a transaction ends checks again, since the next
|
|
64
|
+
* transaction may already be open.
|
|
65
|
+
*
|
|
66
|
+
* @param token - The transaction's token when the statement comes through a
|
|
67
|
+
* transaction handle; a handle whose transaction has ended waits like any
|
|
68
|
+
* outside caller.
|
|
69
|
+
*/
|
|
70
|
+
export declare const whenAdmitted: <T>(gate: ConnectionGate, work: () => T, token?: symbol) => Promise<T>;
|
|
71
|
+
//# sourceMappingURL=connectionGate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connectionGate.d.ts","sourceRoot":"","sources":["../../src/shared/connectionGate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,4DAA4D;AAC5D,MAAM,WAAW,uBAAuB;IACtC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;IAC5C,QAAQ,IAAI,MAAM,GAAG,SAAS,CAAC;IAC/B,0EAA0E;IAC1E,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,yCAAyC;AACzC,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,MAAM,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC,qEAAqE;IACrE,MAAM,IAAI,OAAO,CAAC;IAClB,yFAAyF;IACzF,SAAS,IAAI,MAAM,GAAG,IAAI,CAAC;IAC3B,yEAAyE;IACzE,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB;;;;;OAKG;IACH,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACzD,6DAA6D;IAC7D,OAAO,IAAI,IAAI,CAAC;CACjB;AAED;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,YAAa,uBAAuB,GAAG,IAAI,KAAG,cA8B9E,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,GAAU,CAAC,QAAQ,cAAc,QAAQ,MAAM,CAAC,UAAU,MAAM,KAAG,OAAO,CAAC,CAAC,CAKpG,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keeps statements from outside an open transaction out of it.
|
|
3
|
+
*
|
|
4
|
+
* An adapter whose transactions share one connection runs BEGIN, the
|
|
5
|
+
* callback's statements and COMMIT on that connection. While the callback
|
|
6
|
+
* awaits, a statement another caller issues would otherwise run on the same
|
|
7
|
+
* connection inside the open transaction: a write would be undone if the
|
|
8
|
+
* transaction rolled back, and a read would see rows the transaction has not
|
|
9
|
+
* committed. The gate makes such a statement wait until the transaction ends.
|
|
10
|
+
*
|
|
11
|
+
* A statement issued from inside the transaction runs in it. Through the
|
|
12
|
+
* callback's handle it carries the transaction's token, so it is admitted
|
|
13
|
+
* whatever async context runs it. Through the adapter itself, from code the
|
|
14
|
+
* callback runs, the callback's async context tells it apart, so the gate needs
|
|
15
|
+
* a context store (Node's AsyncLocalStorage); without one it admits every
|
|
16
|
+
* statement that carries no token at once, which is how the adapters behaved
|
|
17
|
+
* before the gate.
|
|
18
|
+
*
|
|
19
|
+
* This module imports nothing from Node, so browser bundles can include it;
|
|
20
|
+
* the adapter that runs on Node passes the store in.
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* Creates the gate of one shared connection.
|
|
24
|
+
*
|
|
25
|
+
* @param context - Node's AsyncLocalStorage, or null where there is none (the
|
|
26
|
+
* gate then admits every statement at once).
|
|
27
|
+
*/
|
|
28
|
+
export const createConnectionGate = (context) => {
|
|
29
|
+
let open = null;
|
|
30
|
+
return {
|
|
31
|
+
blocks: (token) => {
|
|
32
|
+
if (open === null)
|
|
33
|
+
return false;
|
|
34
|
+
if (token !== undefined)
|
|
35
|
+
return token !== open.id;
|
|
36
|
+
return context !== null && context.getStore() !== open.id;
|
|
37
|
+
},
|
|
38
|
+
inside: () => open !== null && context !== null && context.getStore() === open.id,
|
|
39
|
+
openToken: () => open?.id ?? null,
|
|
40
|
+
ended: () => open?.done ?? Promise.resolve(),
|
|
41
|
+
async hold(body) {
|
|
42
|
+
const id = Symbol('transaction');
|
|
43
|
+
let release;
|
|
44
|
+
const done = new Promise((resolve) => {
|
|
45
|
+
release = resolve;
|
|
46
|
+
});
|
|
47
|
+
open = { id, done };
|
|
48
|
+
try {
|
|
49
|
+
return await (context ? context.run(id, () => body(id)) : body(id));
|
|
50
|
+
}
|
|
51
|
+
finally {
|
|
52
|
+
open = null;
|
|
53
|
+
release();
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
dispose: () => {
|
|
57
|
+
context?.disable();
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Runs `work`, a synchronous statement, once the gate admits it. The last check
|
|
63
|
+
* and the work happen in the same turn, so no transaction can open between
|
|
64
|
+
* them; a caller woken when a transaction ends checks again, since the next
|
|
65
|
+
* transaction may already be open.
|
|
66
|
+
*
|
|
67
|
+
* @param token - The transaction's token when the statement comes through a
|
|
68
|
+
* transaction handle; a handle whose transaction has ended waits like any
|
|
69
|
+
* outside caller.
|
|
70
|
+
*/
|
|
71
|
+
export const whenAdmitted = async (gate, work, token) => {
|
|
72
|
+
while (gate.blocks(token)) {
|
|
73
|
+
await gate.ended();
|
|
74
|
+
}
|
|
75
|
+
return work();
|
|
76
|
+
};
|
|
77
|
+
//# sourceMappingURL=connectionGate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connectionGate.js","sourceRoot":"","sources":["../../src/shared/connectionGate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAmCH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,OAAuC,EAAkB,EAAE;IAC9F,IAAI,IAAI,GAA+C,IAAI,CAAC;IAE5D,OAAO;QACL,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE;YAChB,IAAI,IAAI,KAAK,IAAI;gBAAE,OAAO,KAAK,CAAC;YAChC,IAAI,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AoB,EAAE,IAAa,EAAE,KAAc,EAAc,EAAE;IACvG,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;IACD,OAAO,IAAI,EAAE,CAAC;AAChB,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { StorageAdapter } from '../core/contracts';
|
|
1
|
+
import type { StorageAdapter } from '../core/contracts/index.js';
|
|
2
2
|
/** Function that runs one asynchronous operation after earlier operations finish. */
|
|
3
3
|
export type SerializedTransactionRunner = <T>(operation: () => Promise<T>) => Promise<T>;
|
|
4
4
|
/**
|
package/dist/types/index.d.ts
CHANGED
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
* } from '@framers/sql-storage-adapter/types';
|
|
20
20
|
* ```
|
|
21
21
|
*/
|
|
22
|
-
export * from '../core/contracts';
|
|
23
|
-
export * from '../core/contracts/context';
|
|
24
|
-
export * from '../core/contracts/events';
|
|
25
|
-
export * from '../core/contracts/extensions';
|
|
26
|
-
export * from '../core/contracts/limitations';
|
|
27
|
-
export * from '../core/contracts/performance';
|
|
28
|
-
export * from '../core/contracts/hooks';
|
|
22
|
+
export * from '../core/contracts/index.js';
|
|
23
|
+
export * from '../core/contracts/context.js';
|
|
24
|
+
export * from '../core/contracts/events.js';
|
|
25
|
+
export * from '../core/contracts/extensions.js';
|
|
26
|
+
export * from '../core/contracts/limitations.js';
|
|
27
|
+
export * from '../core/contracts/performance.js';
|
|
28
|
+
export * from '../core/contracts/hooks.js';
|
|
29
29
|
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED