@powersync/common 1.53.1 → 1.54.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/bundle.cjs +560 -353
- package/dist/bundle.cjs.map +1 -1
- package/dist/bundle.mjs +560 -353
- package/dist/bundle.mjs.map +1 -1
- package/dist/bundle.node.cjs +560 -353
- package/dist/bundle.node.cjs.map +1 -1
- package/dist/bundle.node.mjs +560 -353
- package/dist/bundle.node.mjs.map +1 -1
- package/dist/index.d.cts +733 -198
- package/lib/attachments/AttachmentContext.d.ts +7 -6
- package/lib/attachments/AttachmentContext.js +2 -1
- package/lib/attachments/AttachmentContext.js.map +1 -1
- package/lib/attachments/AttachmentErrorHandler.d.ts +6 -6
- package/lib/attachments/AttachmentQueue.d.ts +61 -20
- package/lib/attachments/AttachmentQueue.js +16 -18
- package/lib/attachments/AttachmentQueue.js.map +1 -1
- package/lib/attachments/LocalStorageAdapter.d.ts +14 -8
- package/lib/attachments/LocalStorageAdapter.js +3 -0
- package/lib/attachments/LocalStorageAdapter.js.map +1 -1
- package/lib/attachments/RemoteStorageAdapter.d.ts +4 -4
- package/lib/attachments/Schema.d.ts +12 -4
- package/lib/attachments/Schema.js +8 -3
- package/lib/attachments/Schema.js.map +1 -1
- package/lib/attachments/WatchedAttachmentItem.d.ts +3 -1
- package/lib/client/AbstractPowerSyncDatabase.d.ts +110 -58
- package/lib/client/AbstractPowerSyncDatabase.js +59 -48
- package/lib/client/AbstractPowerSyncDatabase.js.map +1 -1
- package/lib/client/AbstractPowerSyncOpenFactory.d.ts +6 -0
- package/lib/client/AbstractPowerSyncOpenFactory.js +3 -0
- package/lib/client/AbstractPowerSyncOpenFactory.js.map +1 -1
- package/lib/client/ConnectionManager.d.ts +4 -1
- package/lib/client/ConnectionManager.js +1 -1
- package/lib/client/ConnectionManager.js.map +1 -1
- package/lib/client/Query.d.ts +9 -0
- package/lib/client/SQLOpenFactory.d.ts +12 -0
- package/lib/client/SQLOpenFactory.js +6 -0
- package/lib/client/SQLOpenFactory.js.map +1 -1
- package/lib/client/compilableQueryWatch.d.ts +6 -0
- package/lib/client/compilableQueryWatch.js +3 -0
- package/lib/client/compilableQueryWatch.js.map +1 -1
- package/lib/client/connection/PowerSyncBackendConnector.d.ts +3 -0
- package/lib/client/connection/PowerSyncCredentials.d.ts +3 -0
- package/lib/client/constants.d.ts +3 -0
- package/lib/client/constants.js +3 -0
- package/lib/client/constants.js.map +1 -1
- package/lib/client/runOnSchemaChange.d.ts +3 -0
- package/lib/client/runOnSchemaChange.js +3 -0
- package/lib/client/runOnSchemaChange.js.map +1 -1
- package/lib/client/sync/bucket/BucketStorageAdapter.d.ts +12 -0
- package/lib/client/sync/bucket/BucketStorageAdapter.js +6 -0
- package/lib/client/sync/bucket/BucketStorageAdapter.js.map +1 -1
- package/lib/client/sync/bucket/CrudBatch.d.ts +2 -0
- package/lib/client/sync/bucket/CrudBatch.js +2 -0
- package/lib/client/sync/bucket/CrudBatch.js.map +1 -1
- package/lib/client/sync/bucket/CrudEntry.d.ts +9 -0
- package/lib/client/sync/bucket/CrudEntry.js +4 -0
- package/lib/client/sync/bucket/CrudEntry.js.map +1 -1
- package/lib/client/sync/bucket/CrudTransaction.d.ts +3 -0
- package/lib/client/sync/bucket/CrudTransaction.js +3 -0
- package/lib/client/sync/bucket/CrudTransaction.js.map +1 -1
- package/lib/client/sync/bucket/SqliteBucketStorage.d.ts +3 -0
- package/lib/client/sync/bucket/SqliteBucketStorage.js +3 -0
- package/lib/client/sync/bucket/SqliteBucketStorage.js.map +1 -1
- package/lib/client/sync/stream/AbstractRemote.d.ts +30 -1
- package/lib/client/sync/stream/AbstractRemote.js +15 -1
- package/lib/client/sync/stream/AbstractRemote.js.map +1 -1
- package/lib/client/sync/stream/AbstractStreamingSyncImplementation.d.ts +61 -14
- package/lib/client/sync/stream/AbstractStreamingSyncImplementation.js +60 -47
- package/lib/client/sync/stream/AbstractStreamingSyncImplementation.js.map +1 -1
- package/lib/client/sync/stream/JsonValue.d.ts +3 -0
- package/lib/client/sync/stream/WebsocketClientTransport.js +2 -1
- package/lib/client/sync/stream/WebsocketClientTransport.js.map +1 -1
- package/lib/client/sync/sync-streams.d.ts +22 -7
- package/lib/client/triggers/TriggerManager.d.ts +19 -18
- package/lib/client/triggers/TriggerManager.js +2 -1
- package/lib/client/triggers/TriggerManager.js.map +1 -1
- package/lib/client/triggers/TriggerManagerImpl.d.ts +1 -1
- package/lib/client/triggers/TriggerManagerImpl.js +3 -3
- package/lib/client/triggers/TriggerManagerImpl.js.map +1 -1
- package/lib/client/triggers/sanitizeSQL.d.ts +4 -0
- package/lib/client/triggers/sanitizeSQL.js +4 -0
- package/lib/client/triggers/sanitizeSQL.js.map +1 -1
- package/lib/client/watched/GetAllQuery.d.ts +4 -0
- package/lib/client/watched/GetAllQuery.js +2 -0
- package/lib/client/watched/GetAllQuery.js.map +1 -1
- package/lib/client/watched/WatchedQuery.d.ts +24 -2
- package/lib/client/watched/WatchedQuery.js +9 -0
- package/lib/client/watched/WatchedQuery.js.map +1 -1
- package/lib/client/watched/processors/AbstractQueryProcessor.d.ts +1 -1
- package/lib/client/watched/processors/AbstractQueryProcessor.js.map +1 -1
- package/lib/client/watched/processors/DifferentialQueryProcessor.d.ts +20 -0
- package/lib/client/watched/processors/DifferentialQueryProcessor.js +4 -0
- package/lib/client/watched/processors/DifferentialQueryProcessor.js.map +1 -1
- package/lib/client/watched/processors/OnChangeQueryProcessor.d.ts +4 -0
- package/lib/client/watched/processors/OnChangeQueryProcessor.js.map +1 -1
- package/lib/client/watched/processors/comparators.d.ts +8 -0
- package/lib/client/watched/processors/comparators.js +4 -0
- package/lib/client/watched/processors/comparators.js.map +1 -1
- package/lib/db/ConnectionClosedError.d.ts +2 -0
- package/lib/db/ConnectionClosedError.js +2 -0
- package/lib/db/ConnectionClosedError.js.map +1 -1
- package/lib/db/DBAdapter.d.ts +56 -6
- package/lib/db/DBAdapter.js +15 -3
- package/lib/db/DBAdapter.js.map +1 -1
- package/lib/db/crud/SyncProgress.d.ts +6 -1
- package/lib/db/crud/SyncProgress.js +2 -0
- package/lib/db/crud/SyncProgress.js.map +1 -1
- package/lib/db/crud/SyncStatus.d.ts +36 -38
- package/lib/db/crud/SyncStatus.js +19 -14
- package/lib/db/crud/SyncStatus.js.map +1 -1
- package/lib/db/crud/UploadQueueStatus.d.ts +3 -0
- package/lib/db/crud/UploadQueueStatus.js +3 -0
- package/lib/db/crud/UploadQueueStatus.js.map +1 -1
- package/lib/db/schema/Column.d.ts +28 -0
- package/lib/db/schema/Column.js +16 -3
- package/lib/db/schema/Column.js.map +1 -1
- package/lib/db/schema/Index.d.ts +9 -0
- package/lib/db/schema/Index.js +6 -0
- package/lib/db/schema/Index.js.map +1 -1
- package/lib/db/schema/IndexedColumn.d.ts +9 -0
- package/lib/db/schema/IndexedColumn.js +6 -0
- package/lib/db/schema/IndexedColumn.js.map +1 -1
- package/lib/db/schema/RawTable.d.ts +7 -1
- package/lib/db/schema/Schema.d.ts +6 -1
- package/lib/db/schema/Schema.js +3 -1
- package/lib/db/schema/Schema.js.map +1 -1
- package/lib/db/schema/Table.d.ts +27 -3
- package/lib/db/schema/Table.js +9 -0
- package/lib/db/schema/Table.js.map +1 -1
- package/lib/db/schema/TableV2.d.ts +2 -0
- package/lib/db/schema/TableV2.js +2 -0
- package/lib/db/schema/TableV2.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/types/types.d.ts +6 -0
- package/lib/utils/AbortOperation.d.ts +2 -0
- package/lib/utils/AbortOperation.js +2 -0
- package/lib/utils/AbortOperation.js.map +1 -1
- package/lib/utils/BaseObserver.d.ts +12 -0
- package/lib/utils/BaseObserver.js +3 -0
- package/lib/utils/BaseObserver.js.map +1 -1
- package/lib/utils/ControlledExecutor.d.ts +6 -0
- package/lib/utils/ControlledExecutor.js +3 -0
- package/lib/utils/ControlledExecutor.js.map +1 -1
- package/lib/utils/Logger.d.ts +9 -0
- package/lib/utils/Logger.js +6 -0
- package/lib/utils/Logger.js.map +1 -1
- package/lib/utils/async.d.ts +13 -7
- package/lib/utils/async.js +38 -24
- package/lib/utils/async.js.map +1 -1
- package/lib/utils/mutex.d.ts +8 -0
- package/lib/utils/mutex.js +3 -0
- package/lib/utils/mutex.js.map +1 -1
- package/lib/utils/parseQuery.d.ts +6 -0
- package/lib/utils/parseQuery.js +3 -0
- package/lib/utils/parseQuery.js.map +1 -1
- package/lib/utils/stream_transform.d.ts +3 -1
- package/lib/utils/stream_transform.js.map +1 -1
- package/package.json +3 -2
- package/src/attachments/AttachmentContext.ts +7 -6
- package/src/attachments/AttachmentErrorHandler.ts +6 -6
- package/src/attachments/AttachmentQueue.ts +71 -23
- package/src/attachments/LocalStorageAdapter.ts +14 -8
- package/src/attachments/README.md +2 -0
- package/src/attachments/RemoteStorageAdapter.ts +4 -4
- package/src/attachments/Schema.ts +12 -4
- package/src/attachments/WatchedAttachmentItem.ts +3 -1
- package/src/client/AbstractPowerSyncDatabase.ts +117 -62
- package/src/client/AbstractPowerSyncOpenFactory.ts +6 -0
- package/src/client/ConnectionManager.ts +4 -1
- package/src/client/Query.ts +9 -0
- package/src/client/SQLOpenFactory.ts +12 -0
- package/src/client/compilableQueryWatch.ts +6 -0
- package/src/client/connection/PowerSyncBackendConnector.ts +3 -0
- package/src/client/connection/PowerSyncCredentials.ts +3 -0
- package/src/client/constants.ts +3 -0
- package/src/client/runOnSchemaChange.ts +3 -0
- package/src/client/sync/bucket/BucketStorageAdapter.ts +12 -0
- package/src/client/sync/bucket/CrudBatch.ts +2 -0
- package/src/client/sync/bucket/CrudEntry.ts +9 -0
- package/src/client/sync/bucket/CrudTransaction.ts +3 -0
- package/src/client/sync/bucket/SqliteBucketStorage.ts +3 -0
- package/src/client/sync/stream/AbstractRemote.ts +30 -1
- package/src/client/sync/stream/AbstractStreamingSyncImplementation.ts +86 -59
- package/src/client/sync/stream/JsonValue.ts +3 -0
- package/src/client/sync/stream/WebsocketClientTransport.ts +3 -1
- package/src/client/sync/sync-streams.ts +22 -9
- package/src/client/triggers/TriggerManager.ts +19 -18
- package/src/client/triggers/TriggerManagerImpl.ts +5 -5
- package/src/client/triggers/sanitizeSQL.ts +5 -0
- package/src/client/watched/GetAllQuery.ts +5 -1
- package/src/client/watched/WatchedQuery.ts +24 -2
- package/src/client/watched/processors/AbstractQueryProcessor.ts +6 -6
- package/src/client/watched/processors/DifferentialQueryProcessor.ts +28 -5
- package/src/client/watched/processors/OnChangeQueryProcessor.ts +9 -3
- package/src/client/watched/processors/comparators.ts +8 -0
- package/src/db/ConnectionClosedError.ts +2 -0
- package/src/db/DBAdapter.ts +58 -6
- package/src/db/crud/SyncProgress.ts +6 -1
- package/src/db/crud/SyncStatus.ts +40 -21
- package/src/db/crud/UploadQueueStatus.ts +3 -0
- package/src/db/schema/Column.ts +28 -3
- package/src/db/schema/Index.ts +9 -0
- package/src/db/schema/IndexedColumn.ts +9 -0
- package/src/db/schema/RawTable.ts +7 -1
- package/src/db/schema/Schema.ts +8 -3
- package/src/db/schema/Table.ts +30 -5
- package/src/db/schema/TableV2.ts +2 -0
- package/src/index.ts +1 -1
- package/src/types/types.ts +6 -0
- package/src/utils/AbortOperation.ts +2 -0
- package/src/utils/BaseObserver.ts +12 -0
- package/src/utils/ControlledExecutor.ts +6 -0
- package/src/utils/Logger.ts +9 -0
- package/src/utils/async.ts +51 -24
- package/src/utils/mutex.ts +12 -0
- package/src/utils/parseQuery.ts +6 -0
- package/src/utils/stream_transform.ts +3 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AbstractPowerSyncDatabase } from '../client/AbstractPowerSyncDatabase.js';
|
|
2
|
-
import { ILogger } from '../utils/Logger.js';
|
|
3
2
|
import { Transaction } from '../db/DBAdapter.js';
|
|
3
|
+
import { ILogger } from '../utils/Logger.js';
|
|
4
4
|
import { AttachmentRecord } from './Schema.js';
|
|
5
5
|
/**
|
|
6
6
|
* AttachmentContext provides database operations for managing attachment records.
|
|
@@ -8,17 +8,18 @@ import { AttachmentRecord } from './Schema.js';
|
|
|
8
8
|
* Provides methods to query, insert, update, and delete attachment records with
|
|
9
9
|
* proper transaction management through PowerSync.
|
|
10
10
|
*
|
|
11
|
-
* @
|
|
11
|
+
* @experimental
|
|
12
|
+
* @alpha
|
|
12
13
|
*/
|
|
13
14
|
export declare class AttachmentContext {
|
|
14
15
|
/** PowerSync database instance for executing queries */
|
|
15
|
-
db: AbstractPowerSyncDatabase;
|
|
16
|
+
readonly db: AbstractPowerSyncDatabase;
|
|
16
17
|
/** Name of the database table storing attachment records */
|
|
17
|
-
tableName: string;
|
|
18
|
+
readonly tableName: string;
|
|
18
19
|
/** Logger instance for diagnostic information */
|
|
19
|
-
logger: ILogger;
|
|
20
|
+
readonly logger: ILogger;
|
|
20
21
|
/** Maximum number of archived attachments to keep before cleanup */
|
|
21
|
-
archivedCacheLimit: number;
|
|
22
|
+
readonly archivedCacheLimit: number;
|
|
22
23
|
/**
|
|
23
24
|
* Creates a new AttachmentContext instance.
|
|
24
25
|
*
|
|
@@ -5,7 +5,8 @@ import { AttachmentState, attachmentFromSql } from './Schema.js';
|
|
|
5
5
|
* Provides methods to query, insert, update, and delete attachment records with
|
|
6
6
|
* proper transaction management through PowerSync.
|
|
7
7
|
*
|
|
8
|
-
* @
|
|
8
|
+
* @experimental
|
|
9
|
+
* @alpha
|
|
9
10
|
*/
|
|
10
11
|
export class AttachmentContext {
|
|
11
12
|
/** PowerSync database instance for executing queries */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttachmentContext.js","sourceRoot":"","sources":["../../src/attachments/AttachmentContext.ts"],"names":[],"mappings":"AAGA,OAAO,EAAoB,eAAe,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEnF
|
|
1
|
+
{"version":3,"file":"AttachmentContext.js","sourceRoot":"","sources":["../../src/attachments/AttachmentContext.ts"],"names":[],"mappings":"AAGA,OAAO,EAAoB,eAAe,EAAE,iBAAiB,EAAE,MAAM,aAAa,CA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AM,KAAK,CAAC,EAAE,CAAC;YAC7B,OAAO;QACT,CAAC;QACD,MAAM,IAAI,CAAC,EAAE,CAAC,gBAAgB,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE;YAC1C,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;gBACrC,MAAM,IAAI,CAAC,gBAAgB,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;YAC9C,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -9,22 +9,22 @@ import { AttachmentRecord } from './Schema.js';
|
|
|
9
9
|
export interface AttachmentErrorHandler {
|
|
10
10
|
/**
|
|
11
11
|
* Handles a download error for a specific attachment.
|
|
12
|
-
* @param attachment The attachment that failed to download
|
|
13
|
-
* @param error The error encountered during the download
|
|
12
|
+
* @param attachment - The attachment that failed to download
|
|
13
|
+
* @param error - The error encountered during the download
|
|
14
14
|
* @returns `true` to retry the operation, `false` to archive the attachment
|
|
15
15
|
*/
|
|
16
16
|
onDownloadError(attachment: AttachmentRecord, error: unknown): Promise<boolean>;
|
|
17
17
|
/**
|
|
18
18
|
* Handles an upload error for a specific attachment.
|
|
19
|
-
* @param attachment The attachment that failed to upload
|
|
20
|
-
* @param error The error encountered during the upload
|
|
19
|
+
* @param attachment - The attachment that failed to upload
|
|
20
|
+
* @param error - The error encountered during the upload
|
|
21
21
|
* @returns `true` to retry the operation, `false` to archive the attachment
|
|
22
22
|
*/
|
|
23
23
|
onUploadError(attachment: AttachmentRecord, error: unknown): Promise<boolean>;
|
|
24
24
|
/**
|
|
25
25
|
* Handles a delete error for a specific attachment.
|
|
26
|
-
* @param attachment The attachment that failed to delete
|
|
27
|
-
* @param error The error encountered during the delete
|
|
26
|
+
* @param attachment - The attachment that failed to delete
|
|
27
|
+
* @param error - The error encountered during the delete
|
|
28
28
|
* @returns `true` to retry the operation, `false` to archive the attachment
|
|
29
29
|
*/
|
|
30
30
|
onDeleteError(attachment: AttachmentRecord, error: unknown): Promise<boolean>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { AbstractPowerSyncDatabase } from '../client/AbstractPowerSyncDatabase.js';
|
|
2
|
-
import { ILogger } from '../utils/Logger.js';
|
|
3
2
|
import { Transaction } from '../db/DBAdapter.js';
|
|
3
|
+
import { ILogger } from '../utils/Logger.js';
|
|
4
|
+
import { AttachmentContext } from './AttachmentContext.js';
|
|
5
|
+
import { AttachmentErrorHandler } from './AttachmentErrorHandler.js';
|
|
4
6
|
import { AttachmentData, LocalStorageAdapter } from './LocalStorageAdapter.js';
|
|
5
7
|
import { RemoteStorageAdapter } from './RemoteStorageAdapter.js';
|
|
6
8
|
import { AttachmentRecord } from './Schema.js';
|
|
7
9
|
import { WatchedAttachmentItem } from './WatchedAttachmentItem.js';
|
|
8
|
-
import { AttachmentErrorHandler } from './AttachmentErrorHandler.js';
|
|
9
10
|
/**
|
|
10
11
|
* AttachmentQueue manages the lifecycle and synchronization of attachments
|
|
11
12
|
* between local and remote storage.
|
|
@@ -15,7 +16,7 @@ import { AttachmentErrorHandler } from './AttachmentErrorHandler.js';
|
|
|
15
16
|
* @experimental
|
|
16
17
|
* @alpha This is currently experimental and may change without a major version bump.
|
|
17
18
|
*/
|
|
18
|
-
export declare class AttachmentQueue {
|
|
19
|
+
export declare class AttachmentQueue implements AttachmentQueue {
|
|
19
20
|
/** Timer for periodic synchronization operations */
|
|
20
21
|
private periodicSyncTimer?;
|
|
21
22
|
/** Service for synchronizing attachments between local and remote storage */
|
|
@@ -62,27 +63,47 @@ export declare class AttachmentQueue {
|
|
|
62
63
|
* Creates a new AttachmentQueue instance.
|
|
63
64
|
*
|
|
64
65
|
* @param options - Configuration options
|
|
65
|
-
* @param options.db - PowerSync database instance
|
|
66
|
-
* @param options.remoteStorage - Remote storage adapter for upload/download operations
|
|
67
|
-
* @param options.localStorage - Local storage adapter for file persistence
|
|
68
|
-
* @param options.watchAttachments - Callback for monitoring attachment changes in your data model
|
|
69
|
-
* @param options.tableName - Name of the table to store attachment records. Default: 'ps_attachment_queue'
|
|
70
|
-
* @param options.logger - Logger instance. Defaults to db.logger
|
|
71
|
-
* @param options.syncIntervalMs - Periodic polling interval in milliseconds for retrying failed uploads/downloads. Default: 30000
|
|
72
|
-
* @param options.syncThrottleDuration - Throttle duration in milliseconds for the reactive watch query that detects attachment changes. Prevents rapid-fire syncs during bulk changes. Default: 30
|
|
73
|
-
* @param options.downloadAttachments - Whether to automatically download remote attachments. Default: true
|
|
74
|
-
* @param options.archivedCacheLimit - Maximum archived attachments before cleanup. Default: 100
|
|
75
66
|
*/
|
|
76
67
|
constructor({ db, localStorage, remoteStorage, watchAttachments, logger, tableName, syncIntervalMs, syncThrottleDuration, downloadAttachments, archivedCacheLimit, errorHandler }: {
|
|
68
|
+
/**
|
|
69
|
+
* PowerSync database instance
|
|
70
|
+
*/
|
|
77
71
|
db: AbstractPowerSyncDatabase;
|
|
72
|
+
/**
|
|
73
|
+
* Remote storage adapter for upload/download operations
|
|
74
|
+
*/
|
|
78
75
|
remoteStorage: RemoteStorageAdapter;
|
|
76
|
+
/**
|
|
77
|
+
* Local storage adapter for file persistence
|
|
78
|
+
*/
|
|
79
79
|
localStorage: LocalStorageAdapter;
|
|
80
|
+
/**
|
|
81
|
+
* Callback for monitoring attachment changes in your data model
|
|
82
|
+
*/
|
|
80
83
|
watchAttachments: (onUpdate: (attachment: WatchedAttachmentItem[]) => Promise<void>, signal: AbortSignal) => void;
|
|
84
|
+
/**
|
|
85
|
+
* Name of the table to store attachment records. Default: 'ps_attachment_queue'
|
|
86
|
+
*/
|
|
81
87
|
tableName?: string;
|
|
88
|
+
/**
|
|
89
|
+
* Logger instance. Defaults to db.logger
|
|
90
|
+
*/
|
|
82
91
|
logger?: ILogger;
|
|
92
|
+
/**
|
|
93
|
+
* Periodic polling interval in milliseconds for retrying failed uploads/downloads. Default: 30000
|
|
94
|
+
*/
|
|
83
95
|
syncIntervalMs?: number;
|
|
96
|
+
/**
|
|
97
|
+
* Throttle duration in milliseconds for the reactive watch query that detects attachment changes. Prevents rapid-fire syncs during bulk changes. Default: 30
|
|
98
|
+
*/
|
|
84
99
|
syncThrottleDuration?: number;
|
|
100
|
+
/**
|
|
101
|
+
* Whether to automatically download remote attachments. Default: true
|
|
102
|
+
*/
|
|
85
103
|
downloadAttachments?: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Maximum archived attachments before cleanup. Default: 100
|
|
106
|
+
*/
|
|
86
107
|
archivedCacheLimit?: number;
|
|
87
108
|
errorHandler?: AttachmentErrorHandler;
|
|
88
109
|
});
|
|
@@ -116,25 +137,45 @@ export declare class AttachmentQueue {
|
|
|
116
137
|
* Clears the periodic sync timer and closes all active attachment watchers.
|
|
117
138
|
*/
|
|
118
139
|
stopSync(): Promise<void>;
|
|
140
|
+
/**
|
|
141
|
+
* Provides an {@link AttachmentContext} to a callback.
|
|
142
|
+
*
|
|
143
|
+
* The callback runs while the attachment queue mutex is held. Do not call
|
|
144
|
+
* other {@link AttachmentQueue} methods from within the callback, as they may
|
|
145
|
+
* attempt to acquire the same mutex and block indefinitely.
|
|
146
|
+
*/
|
|
147
|
+
withAttachmentContext<T>(callback: (context: AttachmentContext) => Promise<T>): Promise<T>;
|
|
119
148
|
/**
|
|
120
149
|
* Saves a file to local storage and queues it for upload to remote storage.
|
|
121
150
|
*
|
|
122
151
|
* @param options - File save options
|
|
123
|
-
* @param options.data - The file data as ArrayBuffer, Blob, or base64 string
|
|
124
|
-
* @param options.fileExtension - File extension (e.g., 'jpg', 'pdf')
|
|
125
|
-
* @param options.mediaType - MIME type of the file (e.g., 'image/jpeg')
|
|
126
|
-
* @param options.metaData - Optional metadata to associate with the attachment
|
|
127
|
-
* @param options.id - Optional custom ID. If not provided, a UUID will be generated
|
|
128
|
-
* @param options.updateHook - Optional callback to execute additional database operations
|
|
129
|
-
* within the same transaction as the attachment creation
|
|
130
152
|
* @returns Promise resolving to the created attachment record
|
|
131
153
|
*/
|
|
132
154
|
saveFile({ data, fileExtension, mediaType, metaData, id, updateHook }: {
|
|
155
|
+
/**
|
|
156
|
+
* The file data as ArrayBuffer, Blob, or base64 string
|
|
157
|
+
*/
|
|
133
158
|
data: AttachmentData;
|
|
159
|
+
/**
|
|
160
|
+
* File extension (e.g., 'jpg', 'pdf')
|
|
161
|
+
*/
|
|
134
162
|
fileExtension: string;
|
|
163
|
+
/**
|
|
164
|
+
* MIME type of the file (e.g., 'image/jpeg')
|
|
165
|
+
*/
|
|
135
166
|
mediaType?: string;
|
|
167
|
+
/**
|
|
168
|
+
* Optional metadata to associate with the attachment
|
|
169
|
+
*/
|
|
136
170
|
metaData?: string;
|
|
171
|
+
/**
|
|
172
|
+
* Optional custom ID. If not provided, a UUID will be generated
|
|
173
|
+
*/
|
|
137
174
|
id?: string;
|
|
175
|
+
/**
|
|
176
|
+
* Optional callback to execute additional database operations within the same transaction as the attachment
|
|
177
|
+
* creation.
|
|
178
|
+
*/
|
|
138
179
|
updateHook?: (transaction: Transaction, attachment: AttachmentRecord) => Promise<void>;
|
|
139
180
|
}): Promise<AttachmentRecord>;
|
|
140
181
|
deleteFile({ id, updateHook }: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DEFAULT_WATCH_THROTTLE_MS } from '../client/watched/WatchedQuery.js';
|
|
2
|
+
import { AttachmentService } from './AttachmentService.js';
|
|
2
3
|
import { ATTACHMENT_TABLE, AttachmentState } from './Schema.js';
|
|
3
4
|
import { SyncingService } from './SyncingService.js';
|
|
4
|
-
import { AttachmentService } from './AttachmentService.js';
|
|
5
5
|
/**
|
|
6
6
|
* AttachmentQueue manages the lifecycle and synchronization of attachments
|
|
7
7
|
* between local and remote storage.
|
|
@@ -58,16 +58,6 @@ export class AttachmentQueue {
|
|
|
58
58
|
* Creates a new AttachmentQueue instance.
|
|
59
59
|
*
|
|
60
60
|
* @param options - Configuration options
|
|
61
|
-
* @param options.db - PowerSync database instance
|
|
62
|
-
* @param options.remoteStorage - Remote storage adapter for upload/download operations
|
|
63
|
-
* @param options.localStorage - Local storage adapter for file persistence
|
|
64
|
-
* @param options.watchAttachments - Callback for monitoring attachment changes in your data model
|
|
65
|
-
* @param options.tableName - Name of the table to store attachment records. Default: 'ps_attachment_queue'
|
|
66
|
-
* @param options.logger - Logger instance. Defaults to db.logger
|
|
67
|
-
* @param options.syncIntervalMs - Periodic polling interval in milliseconds for retrying failed uploads/downloads. Default: 30000
|
|
68
|
-
* @param options.syncThrottleDuration - Throttle duration in milliseconds for the reactive watch query that detects attachment changes. Prevents rapid-fire syncs during bulk changes. Default: 30
|
|
69
|
-
* @param options.downloadAttachments - Whether to automatically download remote attachments. Default: true
|
|
70
|
-
* @param options.archivedCacheLimit - Maximum archived attachments before cleanup. Default: 100
|
|
71
61
|
*/
|
|
72
62
|
constructor({ db, localStorage, remoteStorage, watchAttachments, logger, tableName = ATTACHMENT_TABLE, syncIntervalMs = 30 * 1000, syncThrottleDuration = DEFAULT_WATCH_THROTTLE_MS, downloadAttachments = true, archivedCacheLimit = 100, errorHandler }) {
|
|
73
63
|
this.db = db;
|
|
@@ -156,6 +146,7 @@ export class AttachmentQueue {
|
|
|
156
146
|
state: AttachmentState.QUEUED_DOWNLOAD,
|
|
157
147
|
hasSynced: false,
|
|
158
148
|
metaData: watchedAttachment.metaData,
|
|
149
|
+
mediaType: watchedAttachment.mediaType,
|
|
159
150
|
timestamp: new Date().getTime()
|
|
160
151
|
});
|
|
161
152
|
continue;
|
|
@@ -243,17 +234,24 @@ export class AttachmentQueue {
|
|
|
243
234
|
this.statusListenerDispose = undefined;
|
|
244
235
|
}
|
|
245
236
|
}
|
|
237
|
+
/**
|
|
238
|
+
* Provides an {@link AttachmentContext} to a callback.
|
|
239
|
+
*
|
|
240
|
+
* The callback runs while the attachment queue mutex is held. Do not call
|
|
241
|
+
* other {@link AttachmentQueue} methods from within the callback, as they may
|
|
242
|
+
* attempt to acquire the same mutex and block indefinitely.
|
|
243
|
+
*/
|
|
244
|
+
withAttachmentContext(callback) {
|
|
245
|
+
/**
|
|
246
|
+
* AttachmentService is internal and private in this class.
|
|
247
|
+
* We only need to expose its locking and context functionality for extending classes.
|
|
248
|
+
*/
|
|
249
|
+
return this.attachmentService.withContext(callback);
|
|
250
|
+
}
|
|
246
251
|
/**
|
|
247
252
|
* Saves a file to local storage and queues it for upload to remote storage.
|
|
248
253
|
*
|
|
249
254
|
* @param options - File save options
|
|
250
|
-
* @param options.data - The file data as ArrayBuffer, Blob, or base64 string
|
|
251
|
-
* @param options.fileExtension - File extension (e.g., 'jpg', 'pdf')
|
|
252
|
-
* @param options.mediaType - MIME type of the file (e.g., 'image/jpeg')
|
|
253
|
-
* @param options.metaData - Optional metadata to associate with the attachment
|
|
254
|
-
* @param options.id - Optional custom ID. If not provided, a UUID will be generated
|
|
255
|
-
* @param options.updateHook - Optional callback to execute additional database operations
|
|
256
|
-
* within the same transaction as the attachment creation
|
|
257
255
|
* @returns Promise resolving to the created attachment record
|
|
258
256
|
*/
|
|
259
257
|
async saveFile({ data, fileExtension, mediaType, metaData, id, updateHook }) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttachmentQueue.js","sourceRoot":"","sources":["../../src/attachments/AttachmentQueue.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAM9E,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"AttachmentQueue.js","sourceRoot":"","sources":["../../src/attachments/AttachmentQueue.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAM9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAG3D,OAAO,EAAE,gBAAgB,EAAoB,eAAe,EAAE,MAAM,aAAa,CAAC;AAClF,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAGrD;;;;;;;;GAQG;AACH,MAAM,OAAO,eAAe;IAC1B,oDAAoD;IAC5C,iBAAiB,CAAkC;IAE3D,6EAA6E;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AAM,EAAE,CAAC;wBAChD,yEAAyE;wBACzE,uBAAuB;wBACvB,OAAO,CAAC,IAAI,CAAC;4BACX,GAAG,UAAU;4BACb,KAAK,EAAE,eAAe,CAAC,eAAe;4BACtC,QAAQ,EAAE,SAAS;yBACpB,CAAC,CAAC;oBACL,CAAC;yBAAM,CAAC;wBACN,uEAAuE;wBACvE,OAAO,CAAC,IAAI,CAAC;4BACX,GAAG,UAAU;4BACb,KAAK,EAAE,eAAe,CAAC,QAAQ;4BAC/B,QAAQ,EAAE,SAAS,CAAC,mBAAmB;yBACxC,CAAC,CAAC;oBACL,CAAC;gBACH,CAAC;YACH,CAAC;YAED,MAAM,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @alpha
|
|
3
|
+
*/
|
|
1
4
|
export type AttachmentData = ArrayBuffer | string;
|
|
5
|
+
/**
|
|
6
|
+
* @alpha
|
|
7
|
+
*/
|
|
2
8
|
export declare enum EncodingType {
|
|
3
9
|
UTF8 = "utf8",
|
|
4
10
|
Base64 = "base64"
|
|
@@ -13,36 +19,36 @@ export declare enum EncodingType {
|
|
|
13
19
|
export interface LocalStorageAdapter {
|
|
14
20
|
/**
|
|
15
21
|
* Saves data to a local file.
|
|
16
|
-
* @param filePath Path where the file will be stored
|
|
17
|
-
* @param data Data to store (ArrayBuffer, Blob, or string)
|
|
22
|
+
* @param filePath - Path where the file will be stored
|
|
23
|
+
* @param data - Data to store (ArrayBuffer, Blob, or string)
|
|
18
24
|
* @returns Number of bytes written
|
|
19
25
|
*/
|
|
20
26
|
saveFile(filePath: string, data: AttachmentData): Promise<number>;
|
|
21
27
|
/**
|
|
22
28
|
* Retrieves file data as an ArrayBuffer.
|
|
23
|
-
* @param filePath Path where the file is stored
|
|
29
|
+
* @param filePath - Path where the file is stored
|
|
24
30
|
* @returns ArrayBuffer containing the file data
|
|
25
31
|
*/
|
|
26
32
|
readFile(filePath: string): Promise<ArrayBuffer>;
|
|
27
33
|
/**
|
|
28
34
|
* Deletes the file at the given path.
|
|
29
|
-
* @param filePath Path where the file is stored
|
|
35
|
+
* @param filePath - Path where the file is stored
|
|
30
36
|
*/
|
|
31
37
|
deleteFile(filePath: string): Promise<void>;
|
|
32
38
|
/**
|
|
33
39
|
* Checks if a file exists at the given path.
|
|
34
|
-
* @param filePath Path where the file is stored
|
|
40
|
+
* @param filePath - Path where the file is stored
|
|
35
41
|
* @returns True if the file exists, false otherwise
|
|
36
42
|
*/
|
|
37
43
|
fileExists(filePath: string): Promise<boolean>;
|
|
38
44
|
/**
|
|
39
45
|
* Creates a directory at the specified path.
|
|
40
|
-
* @param path The full path to the directory
|
|
46
|
+
* @param path - The full path to the directory
|
|
41
47
|
*/
|
|
42
48
|
makeDir(path: string): Promise<void>;
|
|
43
49
|
/**
|
|
44
50
|
* Removes a directory at the specified path.
|
|
45
|
-
* @param path The full path to the directory
|
|
51
|
+
* @param path - The full path to the directory
|
|
46
52
|
*/
|
|
47
53
|
rmDir(path: string): Promise<void>;
|
|
48
54
|
/**
|
|
@@ -55,7 +61,7 @@ export interface LocalStorageAdapter {
|
|
|
55
61
|
clear(): Promise<void>;
|
|
56
62
|
/**
|
|
57
63
|
* Returns the file path for the provided filename in the storage directory.
|
|
58
|
-
* @param filename The filename to get the path for
|
|
64
|
+
* @param filename - The filename to get the path for
|
|
59
65
|
* @returns The full file path
|
|
60
66
|
*/
|
|
61
67
|
getLocalUri(filename: string): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocalStorageAdapter.js","sourceRoot":"","sources":["../../src/attachments/LocalStorageAdapter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LocalStorageAdapter.js","sourceRoot":"","sources":["../../src/attachments/LocalStorageAdapter.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,6BAAa,CAAA;IACb,iCAAiB,CAAA;AACnB,CAAC,EAHW,YAAY,KAAZ,YAAY,QAGvB"}
|
|
@@ -9,19 +9,19 @@ import { AttachmentRecord } from './Schema.js';
|
|
|
9
9
|
export interface RemoteStorageAdapter {
|
|
10
10
|
/**
|
|
11
11
|
* Uploads a file to remote storage.
|
|
12
|
-
* @param fileData The binary content of the file to upload
|
|
13
|
-
* @param attachment The associated attachment metadata
|
|
12
|
+
* @param fileData - The binary content of the file to upload
|
|
13
|
+
* @param attachment - The associated attachment metadata
|
|
14
14
|
*/
|
|
15
15
|
uploadFile(fileData: ArrayBuffer, attachment: AttachmentRecord): Promise<void>;
|
|
16
16
|
/**
|
|
17
17
|
* Downloads a file from remote storage.
|
|
18
|
-
* @param attachment The attachment describing the file to download
|
|
18
|
+
* @param attachment - The attachment describing the file to download
|
|
19
19
|
* @returns The binary data of the downloaded file
|
|
20
20
|
*/
|
|
21
21
|
downloadFile(attachment: AttachmentRecord): Promise<ArrayBuffer>;
|
|
22
22
|
/**
|
|
23
23
|
* Deletes a file from remote storage.
|
|
24
|
-
* @param attachment The attachment describing the file to delete
|
|
24
|
+
* @param attachment - The attachment describing the file to delete
|
|
25
25
|
*/
|
|
26
26
|
deleteFile(attachment: AttachmentRecord): Promise<void>;
|
|
27
27
|
}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { Table } from '../db/schema/Table.js';
|
|
2
2
|
import { TableV2Options } from '../db/schema/Table.js';
|
|
3
|
+
/**
|
|
4
|
+
* The default name of the local table storing attachment data.
|
|
5
|
+
*
|
|
6
|
+
* @alpha
|
|
7
|
+
*/
|
|
3
8
|
export declare const ATTACHMENT_TABLE = "attachments";
|
|
4
9
|
/**
|
|
5
10
|
* AttachmentRecord represents an attachment in the local database.
|
|
6
11
|
*
|
|
7
|
-
* @
|
|
12
|
+
* @alpha
|
|
8
13
|
*/
|
|
9
14
|
export interface AttachmentRecord {
|
|
10
15
|
id: string;
|
|
@@ -23,13 +28,13 @@ export interface AttachmentRecord {
|
|
|
23
28
|
* @param row - The database row object
|
|
24
29
|
* @returns The corresponding AttachmentRecord
|
|
25
30
|
*
|
|
26
|
-
* @
|
|
31
|
+
* @alpha
|
|
27
32
|
*/
|
|
28
33
|
export declare function attachmentFromSql(row: any): AttachmentRecord;
|
|
29
34
|
/**
|
|
30
35
|
* AttachmentState represents the current synchronization state of an attachment.
|
|
31
36
|
*
|
|
32
|
-
* @
|
|
37
|
+
* @alpha
|
|
33
38
|
*/
|
|
34
39
|
export declare enum AttachmentState {
|
|
35
40
|
QUEUED_UPLOAD = 0,// Attachment to be uploaded
|
|
@@ -38,12 +43,15 @@ export declare enum AttachmentState {
|
|
|
38
43
|
SYNCED = 3,// Attachment has been synced
|
|
39
44
|
ARCHIVED = 4
|
|
40
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* @alpha
|
|
48
|
+
*/
|
|
41
49
|
export interface AttachmentTableOptions extends Omit<TableV2Options, 'name' | 'columns'> {
|
|
42
50
|
}
|
|
43
51
|
/**
|
|
44
52
|
* AttachmentTable defines the schema for the attachment queue table.
|
|
45
53
|
*
|
|
46
|
-
* @
|
|
54
|
+
* @alpha
|
|
47
55
|
*/
|
|
48
56
|
export declare class AttachmentTable extends Table {
|
|
49
57
|
constructor(options?: AttachmentTableOptions);
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { column } from '../db/schema/Column.js';
|
|
2
2
|
import { Table } from '../db/schema/Table.js';
|
|
3
|
+
/**
|
|
4
|
+
* The default name of the local table storing attachment data.
|
|
5
|
+
*
|
|
6
|
+
* @alpha
|
|
7
|
+
*/
|
|
3
8
|
export const ATTACHMENT_TABLE = 'attachments';
|
|
4
9
|
/**
|
|
5
10
|
* Maps a database row to an AttachmentRecord.
|
|
@@ -7,7 +12,7 @@ export const ATTACHMENT_TABLE = 'attachments';
|
|
|
7
12
|
* @param row - The database row object
|
|
8
13
|
* @returns The corresponding AttachmentRecord
|
|
9
14
|
*
|
|
10
|
-
* @
|
|
15
|
+
* @alpha
|
|
11
16
|
*/
|
|
12
17
|
export function attachmentFromSql(row) {
|
|
13
18
|
return {
|
|
@@ -25,7 +30,7 @@ export function attachmentFromSql(row) {
|
|
|
25
30
|
/**
|
|
26
31
|
* AttachmentState represents the current synchronization state of an attachment.
|
|
27
32
|
*
|
|
28
|
-
* @
|
|
33
|
+
* @alpha
|
|
29
34
|
*/
|
|
30
35
|
export var AttachmentState;
|
|
31
36
|
(function (AttachmentState) {
|
|
@@ -38,7 +43,7 @@ export var AttachmentState;
|
|
|
38
43
|
/**
|
|
39
44
|
* AttachmentTable defines the schema for the attachment queue table.
|
|
40
45
|
*
|
|
41
|
-
* @
|
|
46
|
+
* @alpha
|
|
42
47
|
*/
|
|
43
48
|
export class AttachmentTable extends Table {
|
|
44
49
|
constructor(options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Schema.js","sourceRoot":"","sources":["../../src/attachments/Schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAG9C,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAmB9C;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAAC,GAAQ;IACxC,OAAO;QACL,EAAE,EAAE,GAAG,CAAC,EAAE;QACV,QAAQ,EAAE,GAAG,CAAC,QAAQ;QACtB,QAAQ,EAAE,GAAG,CAAC,SAAS;QACvB,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,SAAS,EAAE,GAAG,CAAC,UAAU;QACzB,SAAS,EAAE,GAAG,CAAC,SAAS;QACxB,QAAQ,EAAE,GAAG,CAAC,SAAS;QACvB,SAAS,EAAE,GAAG,CAAC,UAAU,KAAK,CAAC;QAC/B,KAAK,EAAE,GAAG,CAAC,KAAK;KACjB,CAAC;AACJ,CAAC;AAED;;;;GAI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ACrB,SAAS,EAAE,MAAM,CAAC,IAAI;YACtB,SAAS,EAAE,MAAM,CAAC,OAAO;YACzB,IAAI,EAAE,MAAM,CAAC,OAAO;YACpB,UAAU,EAAE,MAAM,CAAC,IAAI;YACvB,KAAK,EAAE,MAAM,CAAC,OAAO,EAAE,iCAAiC;YACxD,UAAU,EAAE,MAAM,CAAC,OAAO;YAC1B,SAAS,EAAE,MAAM,CAAC,IAAI;SACvB,EACD;YACE,GAAG,OAAO;YACV,QAAQ,EAAE,OAAO,EAAE,QAAQ,IAAI,gBAAgB;YAC/C,SAAS,EAAE,IAAI;YACf,UAAU,EAAE,KAAK;SAClB,CACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -2,16 +2,18 @@
|
|
|
2
2
|
* WatchedAttachmentItem represents an attachment reference in your application's data model.
|
|
3
3
|
* Use either filename OR fileExtension (not both).
|
|
4
4
|
*
|
|
5
|
-
* @
|
|
5
|
+
* @alpha
|
|
6
6
|
*/
|
|
7
7
|
export type WatchedAttachmentItem = {
|
|
8
8
|
id: string;
|
|
9
9
|
filename: string;
|
|
10
10
|
fileExtension?: never;
|
|
11
11
|
metaData?: string;
|
|
12
|
+
mediaType?: string;
|
|
12
13
|
} | {
|
|
13
14
|
id: string;
|
|
14
15
|
fileExtension: string;
|
|
15
16
|
filename?: never;
|
|
16
17
|
metaData?: string;
|
|
18
|
+
mediaType?: string;
|
|
17
19
|
};
|