@verdant-web/common 1.11.0 → 1.12.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.
Files changed (159) hide show
  1. package/dist/cjs/EventSubscriber.d.ts +17 -17
  2. package/dist/cjs/EventSubscriber.js +66 -66
  3. package/dist/cjs/baseline.d.ts +5 -5
  4. package/dist/cjs/baseline.js +2 -2
  5. package/dist/cjs/batching.d.ts +41 -41
  6. package/dist/cjs/batching.js +88 -88
  7. package/dist/cjs/files.d.ts +19 -19
  8. package/dist/cjs/files.js +18 -18
  9. package/dist/cjs/index.d.ts +18 -18
  10. package/dist/cjs/index.js +35 -35
  11. package/dist/cjs/indexes.d.ts +14 -14
  12. package/dist/cjs/indexes.js +115 -115
  13. package/dist/cjs/indexes.test.d.ts +1 -1
  14. package/dist/cjs/indexes.test.js +127 -127
  15. package/dist/cjs/migration.d.ts +98 -98
  16. package/dist/cjs/migration.js +127 -127
  17. package/dist/cjs/oids.d.ts +85 -87
  18. package/dist/cjs/oids.js +363 -374
  19. package/dist/cjs/oids.js.map +1 -1
  20. package/dist/cjs/oids.test.d.ts +1 -1
  21. package/dist/cjs/oids.test.js +269 -251
  22. package/dist/cjs/oids.test.js.map +1 -1
  23. package/dist/cjs/operation.d.ts +139 -139
  24. package/dist/cjs/operation.js +532 -532
  25. package/dist/cjs/operation.js.map +1 -1
  26. package/dist/cjs/operation.test.d.ts +1 -1
  27. package/dist/cjs/operation.test.js +505 -505
  28. package/dist/cjs/operation.test.js.map +1 -1
  29. package/dist/cjs/patch.d.ts +26 -26
  30. package/dist/cjs/patch.js +226 -226
  31. package/dist/cjs/patch.js.map +1 -1
  32. package/dist/cjs/presence.d.ts +27 -27
  33. package/dist/cjs/presence.js +2 -2
  34. package/dist/cjs/protocol.d.ts +145 -145
  35. package/dist/cjs/protocol.js +3 -3
  36. package/dist/cjs/refs.d.ts +5 -5
  37. package/dist/cjs/refs.js +21 -21
  38. package/dist/cjs/replica.d.ts +28 -28
  39. package/dist/cjs/replica.js +28 -28
  40. package/dist/cjs/schema/defaults.d.ts +4 -4
  41. package/dist/cjs/schema/defaults.js +71 -71
  42. package/dist/cjs/schema/defaults.test.d.ts +1 -1
  43. package/dist/cjs/schema/defaults.test.js +20 -20
  44. package/dist/cjs/schema/defaults.test.js.map +1 -1
  45. package/dist/cjs/schema/index.d.ts +8 -8
  46. package/dist/cjs/schema/index.js +28 -28
  47. package/dist/cjs/schema/indexFilters.d.ts +6 -6
  48. package/dist/cjs/schema/indexFilters.js +30 -30
  49. package/dist/cjs/schema/types/collection.d.ts +51 -51
  50. package/dist/cjs/schema/types/collection.js +2 -2
  51. package/dist/cjs/schema/types/compounds.d.ts +12 -12
  52. package/dist/cjs/schema/types/compounds.js +2 -2
  53. package/dist/cjs/schema/types/fields.d.ts +59 -59
  54. package/dist/cjs/schema/types/fields.js +2 -2
  55. package/dist/cjs/schema/types/filters.d.ts +29 -29
  56. package/dist/cjs/schema/types/filters.js +2 -2
  57. package/dist/cjs/schema/types/shapes.d.ts +21 -21
  58. package/dist/cjs/schema/types/shapes.js +2 -2
  59. package/dist/cjs/schema/types/synthetics.d.ts +28 -28
  60. package/dist/cjs/schema/types/synthetics.js +2 -2
  61. package/dist/cjs/schema/types.d.ts +18 -18
  62. package/dist/cjs/schema/types.js +22 -22
  63. package/dist/cjs/timestamp.d.ts +48 -48
  64. package/dist/cjs/timestamp.js +243 -243
  65. package/dist/cjs/timestamp.test.d.ts +1 -1
  66. package/dist/cjs/timestamp.test.js +93 -93
  67. package/dist/cjs/undo.d.ts +3 -3
  68. package/dist/cjs/undo.js +198 -198
  69. package/dist/cjs/utils.d.ts +15 -15
  70. package/dist/cjs/utils.js +127 -127
  71. package/dist/cjs/utils.test.d.ts +1 -1
  72. package/dist/cjs/utils.test.js +36 -36
  73. package/dist/esm/EventSubscriber.d.ts +17 -17
  74. package/dist/esm/EventSubscriber.js +62 -62
  75. package/dist/esm/baseline.d.ts +5 -5
  76. package/dist/esm/baseline.js +1 -1
  77. package/dist/esm/batching.d.ts +41 -41
  78. package/dist/esm/batching.js +83 -83
  79. package/dist/esm/files.d.ts +19 -19
  80. package/dist/esm/files.js +12 -12
  81. package/dist/esm/index.d.ts +18 -18
  82. package/dist/esm/index.js +15 -15
  83. package/dist/esm/indexes.d.ts +14 -14
  84. package/dist/esm/indexes.js +105 -105
  85. package/dist/esm/indexes.test.d.ts +1 -1
  86. package/dist/esm/indexes.test.js +125 -125
  87. package/dist/esm/migration.d.ts +98 -98
  88. package/dist/esm/migration.js +121 -121
  89. package/dist/esm/oids.d.ts +85 -87
  90. package/dist/esm/oids.js +336 -347
  91. package/dist/esm/oids.js.map +1 -1
  92. package/dist/esm/oids.test.d.ts +1 -1
  93. package/dist/esm/oids.test.js +267 -249
  94. package/dist/esm/oids.test.js.map +1 -1
  95. package/dist/esm/operation.d.ts +139 -139
  96. package/dist/esm/operation.js +517 -517
  97. package/dist/esm/operation.js.map +1 -1
  98. package/dist/esm/operation.test.d.ts +1 -1
  99. package/dist/esm/operation.test.js +503 -503
  100. package/dist/esm/operation.test.js.map +1 -1
  101. package/dist/esm/patch.d.ts +26 -26
  102. package/dist/esm/patch.js +222 -222
  103. package/dist/esm/patch.js.map +1 -1
  104. package/dist/esm/presence.d.ts +27 -27
  105. package/dist/esm/presence.js +1 -1
  106. package/dist/esm/protocol.d.ts +145 -145
  107. package/dist/esm/protocol.js +2 -2
  108. package/dist/esm/refs.d.ts +5 -5
  109. package/dist/esm/refs.js +16 -16
  110. package/dist/esm/replica.d.ts +28 -28
  111. package/dist/esm/replica.js +25 -25
  112. package/dist/esm/schema/defaults.d.ts +4 -4
  113. package/dist/esm/schema/defaults.js +65 -65
  114. package/dist/esm/schema/defaults.test.d.ts +1 -1
  115. package/dist/esm/schema/defaults.test.js +18 -18
  116. package/dist/esm/schema/defaults.test.js.map +1 -1
  117. package/dist/esm/schema/index.d.ts +8 -8
  118. package/dist/esm/schema/index.js +9 -9
  119. package/dist/esm/schema/indexFilters.d.ts +6 -6
  120. package/dist/esm/schema/indexFilters.js +22 -22
  121. package/dist/esm/schema/types/collection.d.ts +51 -51
  122. package/dist/esm/schema/types/collection.js +1 -1
  123. package/dist/esm/schema/types/compounds.d.ts +12 -12
  124. package/dist/esm/schema/types/compounds.js +1 -1
  125. package/dist/esm/schema/types/fields.d.ts +59 -59
  126. package/dist/esm/schema/types/fields.js +1 -1
  127. package/dist/esm/schema/types/filters.d.ts +29 -29
  128. package/dist/esm/schema/types/filters.js +1 -1
  129. package/dist/esm/schema/types/shapes.d.ts +21 -21
  130. package/dist/esm/schema/types/shapes.js +1 -1
  131. package/dist/esm/schema/types/synthetics.d.ts +28 -28
  132. package/dist/esm/schema/types/synthetics.js +1 -1
  133. package/dist/esm/schema/types.d.ts +18 -18
  134. package/dist/esm/schema/types.js +6 -6
  135. package/dist/esm/timestamp.d.ts +48 -48
  136. package/dist/esm/timestamp.js +228 -228
  137. package/dist/esm/timestamp.test.d.ts +1 -1
  138. package/dist/esm/timestamp.test.js +91 -91
  139. package/dist/esm/undo.d.ts +3 -3
  140. package/dist/esm/undo.js +194 -194
  141. package/dist/esm/utils.d.ts +15 -15
  142. package/dist/esm/utils.js +113 -113
  143. package/dist/esm/utils.test.d.ts +1 -1
  144. package/dist/esm/utils.test.js +34 -34
  145. package/dist/tsconfig-cjs.tsbuildinfo +1 -1
  146. package/dist/tsconfig.tsbuildinfo +1 -1
  147. package/package.json +1 -1
  148. package/src/oids.test.ts +62 -51
  149. package/src/oids.ts +7 -26
  150. package/src/operation.test.ts +32 -40
  151. package/src/operation.ts +4 -16
  152. package/src/patch.ts +5 -15
  153. package/src/schema/defaults.test.ts +1 -1
  154. package/dist/cjs/files.test.d.ts +0 -1
  155. package/dist/cjs/files.test.js +0 -81
  156. package/dist/cjs/files.test.js.map +0 -1
  157. package/dist/esm/files.test.d.ts +0 -1
  158. package/dist/esm/files.test.js +0 -79
  159. package/dist/esm/files.test.js.map +0 -1
@@ -1,27 +1,27 @@
1
- export interface UserInfo<Profile, Presence> {
2
- /**
3
- * This is the ID representing the user who is utilizing a
4
- * replica client to connect to the storage network.
5
- * One user may have multiple replica clients active at once,
6
- * but their presence will only reflect the most recent
7
- * replica used.
8
- */
9
- id: string;
10
- /**
11
- * This is the ID representing the replica client that is
12
- * connected to the storage network. This is used to
13
- * identify the client when sending messages to it.
14
- */
15
- replicaId: string;
16
- /**
17
- * This is the user's server profile. This data is associated
18
- * with the logged in user of the app and cannot be modified
19
- * by the local replica directly.
20
- */
21
- profile: Profile;
22
- /**
23
- * Presence info which can update frequently as a replica
24
- * makes changes. The shape of presence is up to you.
25
- */
26
- presence: Presence;
27
- }
1
+ export interface UserInfo<Profile, Presence> {
2
+ /**
3
+ * This is the ID representing the user who is utilizing a
4
+ * replica client to connect to the storage network.
5
+ * One user may have multiple replica clients active at once,
6
+ * but their presence will only reflect the most recent
7
+ * replica used.
8
+ */
9
+ id: string;
10
+ /**
11
+ * This is the ID representing the replica client that is
12
+ * connected to the storage network. This is used to
13
+ * identify the client when sending messages to it.
14
+ */
15
+ replicaId: string;
16
+ /**
17
+ * This is the user's server profile. This data is associated
18
+ * with the logged in user of the app and cannot be modified
19
+ * by the local replica directly.
20
+ */
21
+ profile: Profile;
22
+ /**
23
+ * Presence info which can update frequently as a replica
24
+ * makes changes. The shape of presence is up to you.
25
+ */
26
+ presence: Presence;
27
+ }
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=presence.js.map
@@ -1,145 +1,145 @@
1
- import { DocumentBaseline } from './baseline.js';
2
- import { Operation } from './operation.js';
3
- import { UserInfo } from './presence.js';
4
- export declare type HeartbeatMessage = {
5
- type: 'heartbeat';
6
- timestamp: string;
7
- replicaId: string;
8
- };
9
- export declare type HeartbeatResponseMessage = {
10
- type: 'heartbeat-response';
11
- };
12
- /**
13
- * Used by clients to indicate they have
14
- * successfully applied all operations from the
15
- * server up to this one. Uses the nonce from the
16
- * operation rebroadcast message as the ack.
17
- */
18
- export declare type AckMessage = {
19
- type: 'ack';
20
- replicaId: string;
21
- timestamp?: string;
22
- nonce?: string;
23
- };
24
- export declare type OperationMessage = {
25
- type: 'op';
26
- replicaId: string;
27
- operations: Operation[];
28
- timestamp: string;
29
- };
30
- export declare type OperationRebroadcastMessage = {
31
- type: 'op-re';
32
- operations: Operation[];
33
- baselines: DocumentBaseline[];
34
- replicaId: string;
35
- globalAckTimestamp: string | undefined;
36
- ackThisNonce?: string;
37
- };
38
- export declare type SyncMessage = {
39
- type: 'sync';
40
- /** This client's replica ID */
41
- replicaId: string;
42
- /** the logical time this message was sent */
43
- timestamp: string;
44
- /** Any new operations created since the requested time */
45
- operations: Operation[];
46
- /** Any new baselines created since the requested time */
47
- baselines: DocumentBaseline[];
48
- /** the schema version known by this client */
49
- schemaVersion: number;
50
- /**
51
- * the client may have lost its local data, in which
52
- * case it may set this flag to be treated as a new client
53
- * and receive a full baseline
54
- */
55
- resyncAll?: boolean;
56
- /**
57
- * timestamp of when the replica changes began. null means
58
- * full changeset from start of time
59
- */
60
- since: string | null;
61
- };
62
- export declare type SyncResponseMessage = {
63
- type: 'sync-resp';
64
- operations: Operation[];
65
- baselines: DocumentBaseline[];
66
- /**
67
- * If this flag is set, the client should discard local data
68
- * and reset to incoming data only. Used when a client requested
69
- * resyncAll in its sync message, or for clients which have been
70
- * offline for too long. When specified true, provideChangesSince
71
- * should be ignored.
72
- */
73
- overwriteLocalData: boolean;
74
- /**
75
- * Update client on the global ack
76
- */
77
- globalAckTimestamp: string | undefined;
78
- /**
79
- * A map of connected clients' presences values
80
- */
81
- peerPresence: Record<string, UserInfo<any, any>>;
82
- /**
83
- * The timestamp sent in the original sync message -
84
- * this confirms the server has received the client's
85
- * state up to this point. Subsequent syncs should not
86
- * include operations or baselines older than this timestamp.
87
- */
88
- ackedTimestamp: string;
89
- /**
90
- * The client should respond with a sync-ack containing
91
- * this nonce to confirm it has received this message if
92
- * it is not undefined
93
- */
94
- ackThisNonce?: string;
95
- };
96
- /** @deprecated use ack */
97
- export declare type SyncAckMessage = {
98
- type: 'sync-ack';
99
- /** The client's replica ID */
100
- replicaId: string;
101
- /** the logical time this message was sent */
102
- timestamp: string;
103
- /** the nonce sent in the sync-resp message */
104
- nonce: string;
105
- };
106
- export declare type PresenceUpdateMessage = {
107
- type: 'presence-update';
108
- /** The client's replica ID */
109
- replicaId: string;
110
- /** new presence value */
111
- presence: any;
112
- };
113
- export declare type PresenceChangedMessage = {
114
- type: 'presence-changed';
115
- /** The client's replica ID */
116
- replicaId: string;
117
- userInfo: UserInfo<any, any>;
118
- };
119
- /**
120
- * This is only emitted when all of a user's replicas
121
- * go offline.
122
- */
123
- export declare type PresenceOfflineMessage = {
124
- type: 'presence-offline';
125
- userId: string;
126
- /** The last replicaID seen by the server before the user was offline */
127
- replicaId: string;
128
- };
129
- export declare type GlobalAckMessage = {
130
- type: 'global-ack';
131
- timestamp: string;
132
- };
133
- export declare type ForbiddenMessage = {
134
- type: 'forbidden';
135
- };
136
- export declare type ServerAckMessage = {
137
- type: 'server-ack';
138
- timestamp: string;
139
- };
140
- export declare type ServerNeedSinceMessage = {
141
- type: 'need-since';
142
- since: string | null;
143
- };
144
- export declare type ClientMessage = HeartbeatMessage | SyncMessage | OperationMessage | AckMessage | SyncAckMessage | PresenceUpdateMessage;
145
- export declare type ServerMessage = HeartbeatResponseMessage | SyncResponseMessage | OperationRebroadcastMessage | PresenceChangedMessage | PresenceOfflineMessage | GlobalAckMessage | ForbiddenMessage | ServerAckMessage | ServerNeedSinceMessage;
1
+ import { DocumentBaseline } from './baseline.js';
2
+ import { Operation } from './operation.js';
3
+ import { UserInfo } from './presence.js';
4
+ export declare type HeartbeatMessage = {
5
+ type: 'heartbeat';
6
+ timestamp: string;
7
+ replicaId: string;
8
+ };
9
+ export declare type HeartbeatResponseMessage = {
10
+ type: 'heartbeat-response';
11
+ };
12
+ /**
13
+ * Used by clients to indicate they have
14
+ * successfully applied all operations from the
15
+ * server up to this one. Uses the nonce from the
16
+ * operation rebroadcast message as the ack.
17
+ */
18
+ export declare type AckMessage = {
19
+ type: 'ack';
20
+ replicaId: string;
21
+ timestamp?: string;
22
+ nonce?: string;
23
+ };
24
+ export declare type OperationMessage = {
25
+ type: 'op';
26
+ replicaId: string;
27
+ operations: Operation[];
28
+ timestamp: string;
29
+ };
30
+ export declare type OperationRebroadcastMessage = {
31
+ type: 'op-re';
32
+ operations: Operation[];
33
+ baselines: DocumentBaseline[];
34
+ replicaId: string;
35
+ globalAckTimestamp: string | undefined;
36
+ ackThisNonce?: string;
37
+ };
38
+ export declare type SyncMessage = {
39
+ type: 'sync';
40
+ /** This client's replica ID */
41
+ replicaId: string;
42
+ /** the logical time this message was sent */
43
+ timestamp: string;
44
+ /** Any new operations created since the requested time */
45
+ operations: Operation[];
46
+ /** Any new baselines created since the requested time */
47
+ baselines: DocumentBaseline[];
48
+ /** the schema version known by this client */
49
+ schemaVersion: number;
50
+ /**
51
+ * the client may have lost its local data, in which
52
+ * case it may set this flag to be treated as a new client
53
+ * and receive a full baseline
54
+ */
55
+ resyncAll?: boolean;
56
+ /**
57
+ * timestamp of when the replica changes began. null means
58
+ * full changeset from start of time
59
+ */
60
+ since: string | null;
61
+ };
62
+ export declare type SyncResponseMessage = {
63
+ type: 'sync-resp';
64
+ operations: Operation[];
65
+ baselines: DocumentBaseline[];
66
+ /**
67
+ * If this flag is set, the client should discard local data
68
+ * and reset to incoming data only. Used when a client requested
69
+ * resyncAll in its sync message, or for clients which have been
70
+ * offline for too long. When specified true, provideChangesSince
71
+ * should be ignored.
72
+ */
73
+ overwriteLocalData: boolean;
74
+ /**
75
+ * Update client on the global ack
76
+ */
77
+ globalAckTimestamp: string | undefined;
78
+ /**
79
+ * A map of connected clients' presences values
80
+ */
81
+ peerPresence: Record<string, UserInfo<any, any>>;
82
+ /**
83
+ * The timestamp sent in the original sync message -
84
+ * this confirms the server has received the client's
85
+ * state up to this point. Subsequent syncs should not
86
+ * include operations or baselines older than this timestamp.
87
+ */
88
+ ackedTimestamp: string;
89
+ /**
90
+ * The client should respond with a sync-ack containing
91
+ * this nonce to confirm it has received this message if
92
+ * it is not undefined
93
+ */
94
+ ackThisNonce?: string;
95
+ };
96
+ /** @deprecated use ack */
97
+ export declare type SyncAckMessage = {
98
+ type: 'sync-ack';
99
+ /** The client's replica ID */
100
+ replicaId: string;
101
+ /** the logical time this message was sent */
102
+ timestamp: string;
103
+ /** the nonce sent in the sync-resp message */
104
+ nonce: string;
105
+ };
106
+ export declare type PresenceUpdateMessage = {
107
+ type: 'presence-update';
108
+ /** The client's replica ID */
109
+ replicaId: string;
110
+ /** new presence value */
111
+ presence: any;
112
+ };
113
+ export declare type PresenceChangedMessage = {
114
+ type: 'presence-changed';
115
+ /** The client's replica ID */
116
+ replicaId: string;
117
+ userInfo: UserInfo<any, any>;
118
+ };
119
+ /**
120
+ * This is only emitted when all of a user's replicas
121
+ * go offline.
122
+ */
123
+ export declare type PresenceOfflineMessage = {
124
+ type: 'presence-offline';
125
+ userId: string;
126
+ /** The last replicaID seen by the server before the user was offline */
127
+ replicaId: string;
128
+ };
129
+ export declare type GlobalAckMessage = {
130
+ type: 'global-ack';
131
+ timestamp: string;
132
+ };
133
+ export declare type ForbiddenMessage = {
134
+ type: 'forbidden';
135
+ };
136
+ export declare type ServerAckMessage = {
137
+ type: 'server-ack';
138
+ timestamp: string;
139
+ };
140
+ export declare type ServerNeedSinceMessage = {
141
+ type: 'need-since';
142
+ since: string | null;
143
+ };
144
+ export declare type ClientMessage = HeartbeatMessage | SyncMessage | OperationMessage | AckMessage | SyncAckMessage | PresenceUpdateMessage;
145
+ export declare type ServerMessage = HeartbeatResponseMessage | SyncResponseMessage | OperationRebroadcastMessage | PresenceChangedMessage | PresenceOfflineMessage | GlobalAckMessage | ForbiddenMessage | ServerAckMessage | ServerNeedSinceMessage;
@@ -1,4 +1,4 @@
1
- "use strict";
2
- // client ID, and therefore library ID, is inferred
3
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ // client ID, and therefore library ID, is inferred
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  //# sourceMappingURL=protocol.js.map
@@ -1,5 +1,5 @@
1
- import { FileRef } from './files.js';
2
- import { ObjectRef } from './operation.js';
3
- export declare function isRef(obj: any): boolean;
4
- export declare function compareRefs(a: any, b: any): boolean;
5
- export declare type Ref = ObjectRef | FileRef;
1
+ import { FileRef } from './files.js';
2
+ import { ObjectRef } from './operation.js';
3
+ export declare function isRef(obj: any): boolean;
4
+ export declare function compareRefs(a: any, b: any): boolean;
5
+ export declare type Ref = ObjectRef | FileRef;
package/dist/cjs/refs.js CHANGED
@@ -1,22 +1,22 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.compareRefs = exports.isRef = void 0;
4
- const files_js_1 = require("./files.js");
5
- const operation_js_1 = require("./operation.js");
6
- function isRef(obj) {
7
- return (0, operation_js_1.isObjectRef)(obj) || (0, files_js_1.isFileRef)(obj);
8
- }
9
- exports.isRef = isRef;
10
- function compareRefs(a, b) {
11
- if (a === b)
12
- return true;
13
- if (!isRef(a) || !isRef(b))
14
- return false;
15
- if (a['@@type'] !== b['@@type'])
16
- return false;
17
- if (a.id !== b.id)
18
- return false;
19
- return true;
20
- }
21
- exports.compareRefs = compareRefs;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.compareRefs = exports.isRef = void 0;
4
+ const files_js_1 = require("./files.js");
5
+ const operation_js_1 = require("./operation.js");
6
+ function isRef(obj) {
7
+ return (0, operation_js_1.isObjectRef)(obj) || (0, files_js_1.isFileRef)(obj);
8
+ }
9
+ exports.isRef = isRef;
10
+ function compareRefs(a, b) {
11
+ if (a === b)
12
+ return true;
13
+ if (!isRef(a) || !isRef(b))
14
+ return false;
15
+ if (a['@@type'] !== b['@@type'])
16
+ return false;
17
+ if (a.id !== b.id)
18
+ return false;
19
+ return true;
20
+ }
21
+ exports.compareRefs = compareRefs;
22
22
  //# sourceMappingURL=refs.js.map
@@ -1,28 +1,28 @@
1
- export interface ReplicaInfo {
2
- id: string;
3
- ackedLogicalTime: string | null;
4
- }
5
- /**
6
- * Different token types allow different replica client behaviors.
7
- * - Realtime: allows the client to subscribe to realtime events.
8
- * - Push: allows the client to push and pull data with HTTP, but not use realtime.
9
- * - PassivePush: allows the client to push and pull data with HTTP, but offline changes
10
- * will be discarded on reconnect.
11
- * - PassiveRealtime: allows the client to subscribe to realtime events, but offline changes
12
- * will be discarded on reconnect.
13
- * - ReadOnlyPull: the client may only pull changes using HTTP. It may not subscribe
14
- * to realtime events or push changes.
15
- * - ReadOnlyRealtime: the client may only subscribe to realtime events or pull from HTTP.
16
- * It may not push changes.
17
- *
18
- * Choosing the right token type can optimize client storage metrics significantly when
19
- * many replicas are connecting to a library.
20
- */
21
- export declare enum ReplicaType {
22
- Realtime = 0,
23
- Push = 1,
24
- PassiveRealtime = 2,
25
- PassivePush = 3,
26
- ReadOnlyPull = 4,
27
- ReadOnlyRealtime = 5
28
- }
1
+ export interface ReplicaInfo {
2
+ id: string;
3
+ ackedLogicalTime: string | null;
4
+ }
5
+ /**
6
+ * Different token types allow different replica client behaviors.
7
+ * - Realtime: allows the client to subscribe to realtime events.
8
+ * - Push: allows the client to push and pull data with HTTP, but not use realtime.
9
+ * - PassivePush: allows the client to push and pull data with HTTP, but offline changes
10
+ * will be discarded on reconnect.
11
+ * - PassiveRealtime: allows the client to subscribe to realtime events, but offline changes
12
+ * will be discarded on reconnect.
13
+ * - ReadOnlyPull: the client may only pull changes using HTTP. It may not subscribe
14
+ * to realtime events or push changes.
15
+ * - ReadOnlyRealtime: the client may only subscribe to realtime events or pull from HTTP.
16
+ * It may not push changes.
17
+ *
18
+ * Choosing the right token type can optimize client storage metrics significantly when
19
+ * many replicas are connecting to a library.
20
+ */
21
+ export declare enum ReplicaType {
22
+ Realtime = 0,
23
+ Push = 1,
24
+ PassiveRealtime = 2,
25
+ PassivePush = 3,
26
+ ReadOnlyPull = 4,
27
+ ReadOnlyRealtime = 5
28
+ }
@@ -1,29 +1,29 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ReplicaType = void 0;
4
- /**
5
- * Different token types allow different replica client behaviors.
6
- * - Realtime: allows the client to subscribe to realtime events.
7
- * - Push: allows the client to push and pull data with HTTP, but not use realtime.
8
- * - PassivePush: allows the client to push and pull data with HTTP, but offline changes
9
- * will be discarded on reconnect.
10
- * - PassiveRealtime: allows the client to subscribe to realtime events, but offline changes
11
- * will be discarded on reconnect.
12
- * - ReadOnlyPull: the client may only pull changes using HTTP. It may not subscribe
13
- * to realtime events or push changes.
14
- * - ReadOnlyRealtime: the client may only subscribe to realtime events or pull from HTTP.
15
- * It may not push changes.
16
- *
17
- * Choosing the right token type can optimize client storage metrics significantly when
18
- * many replicas are connecting to a library.
19
- */
20
- var ReplicaType;
21
- (function (ReplicaType) {
22
- ReplicaType[ReplicaType["Realtime"] = 0] = "Realtime";
23
- ReplicaType[ReplicaType["Push"] = 1] = "Push";
24
- ReplicaType[ReplicaType["PassiveRealtime"] = 2] = "PassiveRealtime";
25
- ReplicaType[ReplicaType["PassivePush"] = 3] = "PassivePush";
26
- ReplicaType[ReplicaType["ReadOnlyPull"] = 4] = "ReadOnlyPull";
27
- ReplicaType[ReplicaType["ReadOnlyRealtime"] = 5] = "ReadOnlyRealtime";
28
- })(ReplicaType = exports.ReplicaType || (exports.ReplicaType = {}));
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReplicaType = void 0;
4
+ /**
5
+ * Different token types allow different replica client behaviors.
6
+ * - Realtime: allows the client to subscribe to realtime events.
7
+ * - Push: allows the client to push and pull data with HTTP, but not use realtime.
8
+ * - PassivePush: allows the client to push and pull data with HTTP, but offline changes
9
+ * will be discarded on reconnect.
10
+ * - PassiveRealtime: allows the client to subscribe to realtime events, but offline changes
11
+ * will be discarded on reconnect.
12
+ * - ReadOnlyPull: the client may only pull changes using HTTP. It may not subscribe
13
+ * to realtime events or push changes.
14
+ * - ReadOnlyRealtime: the client may only subscribe to realtime events or pull from HTTP.
15
+ * It may not push changes.
16
+ *
17
+ * Choosing the right token type can optimize client storage metrics significantly when
18
+ * many replicas are connecting to a library.
19
+ */
20
+ var ReplicaType;
21
+ (function (ReplicaType) {
22
+ ReplicaType[ReplicaType["Realtime"] = 0] = "Realtime";
23
+ ReplicaType[ReplicaType["Push"] = 1] = "Push";
24
+ ReplicaType[ReplicaType["PassiveRealtime"] = 2] = "PassiveRealtime";
25
+ ReplicaType[ReplicaType["PassivePush"] = 3] = "PassivePush";
26
+ ReplicaType[ReplicaType["ReadOnlyPull"] = 4] = "ReadOnlyPull";
27
+ ReplicaType[ReplicaType["ReadOnlyRealtime"] = 5] = "ReadOnlyRealtime";
28
+ })(ReplicaType = exports.ReplicaType || (exports.ReplicaType = {}));
29
29
  //# sourceMappingURL=replica.js.map
@@ -1,4 +1,4 @@
1
- import type { StorageFieldSchema, StorageCollectionSchema } from './types.js';
2
- export declare function addFieldDefaults(collection: StorageCollectionSchema, value: any): any;
3
- export declare function traverseCollectionFieldsAndApplyDefaults(value: any, field: StorageFieldSchema): any;
4
- export declare function getFieldDefault(field: StorageFieldSchema): any;
1
+ import type { StorageFieldSchema, StorageCollectionSchema } from './types.js';
2
+ export declare function addFieldDefaults(collection: StorageCollectionSchema, value: any): any;
3
+ export declare function traverseCollectionFieldsAndApplyDefaults(value: any, field: StorageFieldSchema): any;
4
+ export declare function getFieldDefault(field: StorageFieldSchema): any;