@powersync/common 0.0.0-dev-20250922104723 → 0.0.0-dev-20250922105207

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.
Files changed (29) hide show
  1. package/dist/bundle.cjs +4 -4
  2. package/dist/bundle.mjs +5 -5
  3. package/dist/index.d.cts +845 -1054
  4. package/lib/client/AbstractPowerSyncDatabase.d.ts +4 -16
  5. package/lib/client/AbstractPowerSyncDatabase.js +26 -36
  6. package/lib/client/ConnectionManager.d.ts +2 -26
  7. package/lib/client/ConnectionManager.js +2 -114
  8. package/lib/client/SQLOpenFactory.d.ts +2 -0
  9. package/lib/client/sync/bucket/BucketStorageAdapter.d.ts +1 -9
  10. package/lib/client/sync/bucket/BucketStorageAdapter.js +0 -1
  11. package/lib/client/sync/stream/AbstractRemote.js +0 -3
  12. package/lib/client/sync/stream/AbstractStreamingSyncImplementation.d.ts +3 -24
  13. package/lib/client/sync/stream/AbstractStreamingSyncImplementation.js +39 -54
  14. package/lib/client/sync/stream/core-instruction.d.ts +1 -20
  15. package/lib/client/sync/stream/core-instruction.js +1 -26
  16. package/lib/client/triggers/TriggerManager.d.ts +1 -1
  17. package/lib/client/watched/WatchedQuery.d.ts +0 -2
  18. package/lib/client/watched/WatchedQuery.js +0 -1
  19. package/lib/client/watched/processors/AbstractQueryProcessor.d.ts +1 -2
  20. package/lib/client/watched/processors/AbstractQueryProcessor.js +15 -30
  21. package/lib/client/watched/processors/DifferentialQueryProcessor.js +1 -7
  22. package/lib/client/watched/processors/OnChangeQueryProcessor.js +1 -7
  23. package/lib/db/crud/SyncStatus.d.ts +1 -37
  24. package/lib/db/crud/SyncStatus.js +0 -61
  25. package/lib/index.d.ts +0 -1
  26. package/lib/index.js +0 -1
  27. package/package.json +1 -1
  28. package/lib/client/sync/sync-streams.d.ts +0 -98
  29. package/lib/client/sync/sync-streams.js +0 -1
@@ -1,98 +0,0 @@
1
- /**
2
- * A description of a sync stream, consisting of its {@link name} and the {@link parameters} used when subscribing.
3
- */
4
- export interface SyncStreamDescription {
5
- /**
6
- * The name of the stream as it appears in the stream definition for the PowerSync service.
7
- */
8
- name: string;
9
- /**
10
- * The parameters used to subscribe to the stream, if any.
11
- *
12
- * The same stream can be subscribed to multiple times with different parameters.
13
- */
14
- parameters: Record<string, any> | null;
15
- }
16
- /**
17
- * Information about a subscribed sync stream.
18
- *
19
- * This includes the {@link SyncStreamDescription}, along with information about the current sync status.
20
- */
21
- export interface SyncSubscriptionDescription extends SyncStreamDescription {
22
- active: boolean;
23
- /**
24
- * Whether this stream subscription is included by default, regardless of whether the stream has explicitly been
25
- * subscribed to or not.
26
- *
27
- * It's possible for both {@link isDefault} and {@link hasExplicitSubscription} to be true at the same time - this
28
- * happens when a default stream was subscribed explicitly.
29
- */
30
- isDefault: boolean;
31
- /**
32
- * Whether this stream has been subscribed to explicitly.
33
- *
34
- * It's possible for both {@link isDefault} and {@link hasExplicitSubscription} to be true at the same time - this
35
- * happens when a default stream was subscribed explicitly.
36
- */
37
- hasExplicitSubscription: boolean;
38
- /**
39
- * For sync streams that have a time-to-live, the current time at which the stream would expire if not subscribed to
40
- * again.
41
- */
42
- expiresAt: Date | null;
43
- /**
44
- * Whether this stream subscription has been synced at least once.
45
- */
46
- hasSynced: boolean;
47
- /**
48
- * If {@link hasSynced} is true, the last time data from this stream has been synced.
49
- */
50
- lastSyncedAt: Date | null;
51
- }
52
- export interface SyncStreamSubscribeOptions {
53
- /**
54
- * A "time to live" for this stream subscription, in seconds.
55
- *
56
- * The TTL control when a stream gets evicted after not having an active {@link SyncStreamSubscription} object
57
- * attached to it.
58
- */
59
- ttl?: number;
60
- /**
61
- * A priority to assign to this subscription. This overrides the default priority that may have been set on streams.
62
- *
63
- * For details on priorities, see [priotized sync](https://docs.powersync.com/usage/use-case-examples/prioritized-sync).
64
- */
65
- priority?: 0 | 1 | 2 | 3;
66
- }
67
- /**
68
- * A handle to a {@link SyncStreamDescription} that allows subscribing to the stream.
69
- *
70
- * To obtain an instance of {@link SyncStream}, call {@link AbstractPowerSyncDatabase.syncStream}.
71
- */
72
- export interface SyncStream extends SyncStreamDescription {
73
- /**
74
- * Adds a subscription to this stream, requesting it to be included when connecting to the sync service.
75
- *
76
- * You should keep a reference to the returned {@link SyncStreamSubscription} object along as you need data for that
77
- * stream. As soon as {@link SyncStreamSubscription.unsubscribe} is called for all subscriptions on this stream
78
- * (including subscriptions created on other tabs), the {@link SyncStreamSubscribeOptions.ttl} starts ticking and will
79
- * eventually evict the stream (unless {@link subscribe} is called again).
80
- */
81
- subscribe(options?: SyncStreamSubscribeOptions): Promise<SyncStreamSubscription>;
82
- /**
83
- * Clears all subscriptions attached to this stream and resets the TTL for the stream.
84
- *
85
- * This is a potentially dangerous operations, as it interferes with other stream subscriptions.
86
- */
87
- unsubscribeAll(): Promise<void>;
88
- }
89
- export interface SyncStreamSubscription extends SyncStreamDescription {
90
- /**
91
- * A promise that resolves once data from in this sync stream has been synced and applied.
92
- */
93
- waitForFirstSync(abort?: AbortSignal): Promise<void>;
94
- /**
95
- * Removes this stream subscription.
96
- */
97
- unsubscribe(): void;
98
- }
@@ -1 +0,0 @@
1
- export {};