tinybase 5.4.0-beta.3 → 5.4.0-beta.4
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/@types/mergeable-store/index.d.cts +5 -4
- package/@types/mergeable-store/index.d.ts +5 -4
- package/@types/mergeable-store/with-schemas/index.d.cts +5 -4
- package/@types/mergeable-store/with-schemas/index.d.ts +5 -4
- package/@types/persisters/index.d.cts +1 -0
- package/@types/persisters/index.d.ts +1 -0
- package/@types/persisters/persister-durable-object-storage/index.d.cts +25 -17
- package/@types/persisters/persister-durable-object-storage/index.d.ts +25 -17
- package/@types/persisters/persister-durable-object-storage/with-schemas/index.d.cts +26 -18
- package/@types/persisters/persister-durable-object-storage/with-schemas/index.d.ts +26 -18
- package/@types/persisters/persister-partykit-server/index.d.cts +12 -0
- package/@types/persisters/persister-partykit-server/index.d.ts +12 -0
- package/@types/persisters/persister-partykit-server/with-schemas/index.d.cts +15 -0
- package/@types/persisters/persister-partykit-server/with-schemas/index.d.ts +15 -0
- package/@types/persisters/with-schemas/index.d.cts +1 -0
- package/@types/persisters/with-schemas/index.d.ts +1 -0
- package/@types/store/index.d.cts +10 -8
- package/@types/store/index.d.ts +10 -8
- package/@types/store/with-schemas/index.d.cts +10 -8
- package/@types/store/with-schemas/index.d.ts +10 -8
- package/@types/synchronizers/synchronizer-ws-server-durable-object/index.d.cts +206 -28
- package/@types/synchronizers/synchronizer-ws-server-durable-object/index.d.ts +206 -28
- package/@types/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.d.cts +219 -28
- package/@types/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.d.ts +219 -28
- package/cjs/es6/index.cjs +0 -1
- package/cjs/es6/indexes/index.cjs +1 -1
- package/cjs/es6/indexes/with-schemas/index.cjs +1 -1
- package/cjs/es6/metrics/index.cjs +1 -1
- package/cjs/es6/metrics/with-schemas/index.cjs +1 -1
- package/cjs/es6/min/index.cjs +1 -1
- package/cjs/es6/min/index.cjs.gz +0 -0
- package/cjs/es6/min/indexes/index.cjs +1 -1
- package/cjs/es6/min/indexes/index.cjs.gz +0 -0
- package/cjs/es6/min/indexes/with-schemas/index.cjs +1 -1
- package/cjs/es6/min/indexes/with-schemas/index.cjs.gz +0 -0
- package/cjs/es6/min/metrics/index.cjs +1 -1
- package/cjs/es6/min/metrics/index.cjs.gz +0 -0
- package/cjs/es6/min/metrics/with-schemas/index.cjs +1 -1
- package/cjs/es6/min/metrics/with-schemas/index.cjs.gz +0 -0
- package/cjs/es6/min/persisters/persister-durable-object-storage/index.cjs +1 -1
- package/cjs/es6/min/persisters/persister-durable-object-storage/index.cjs.gz +0 -0
- package/cjs/es6/min/persisters/persister-durable-object-storage/with-schemas/index.cjs +1 -1
- package/cjs/es6/min/persisters/persister-durable-object-storage/with-schemas/index.cjs.gz +0 -0
- package/cjs/es6/min/queries/index.cjs +1 -1
- package/cjs/es6/min/queries/index.cjs.gz +0 -0
- package/cjs/es6/min/queries/with-schemas/index.cjs +1 -1
- package/cjs/es6/min/queries/with-schemas/index.cjs.gz +0 -0
- package/cjs/es6/min/relationships/index.cjs +1 -1
- package/cjs/es6/min/relationships/index.cjs.gz +0 -0
- package/cjs/es6/min/relationships/with-schemas/index.cjs +1 -1
- package/cjs/es6/min/relationships/with-schemas/index.cjs.gz +0 -0
- package/cjs/es6/min/synchronizers/synchronizer-ws-server-durable-object/index.cjs +1 -1
- package/cjs/es6/min/synchronizers/synchronizer-ws-server-durable-object/index.cjs.gz +0 -0
- package/cjs/es6/min/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.cjs +1 -1
- package/cjs/es6/min/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.cjs.gz +0 -0
- package/cjs/es6/min/with-schemas/index.cjs +1 -1
- package/cjs/es6/min/with-schemas/index.cjs.gz +0 -0
- package/cjs/es6/persisters/persister-durable-object-storage/index.cjs +1 -1
- package/cjs/es6/persisters/persister-durable-object-storage/with-schemas/index.cjs +1 -1
- package/cjs/es6/persisters/persister-partykit-client/index.cjs +2 -5
- package/cjs/es6/persisters/persister-partykit-client/with-schemas/index.cjs +2 -5
- package/cjs/es6/queries/index.cjs +0 -1
- package/cjs/es6/queries/with-schemas/index.cjs +0 -1
- package/cjs/es6/relationships/index.cjs +1 -1
- package/cjs/es6/relationships/with-schemas/index.cjs +1 -1
- package/cjs/es6/synchronizers/synchronizer-ws-server-durable-object/index.cjs +1 -1
- package/cjs/es6/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.cjs +1 -1
- package/cjs/es6/with-schemas/index.cjs +0 -1
- package/cjs/min/persisters/persister-durable-object-storage/index.cjs +1 -1
- package/cjs/min/persisters/persister-durable-object-storage/index.cjs.gz +0 -0
- package/cjs/min/persisters/persister-durable-object-storage/with-schemas/index.cjs +1 -1
- package/cjs/min/persisters/persister-durable-object-storage/with-schemas/index.cjs.gz +0 -0
- package/cjs/min/synchronizers/synchronizer-ws-server-durable-object/index.cjs +1 -1
- package/cjs/min/synchronizers/synchronizer-ws-server-durable-object/index.cjs.gz +0 -0
- package/cjs/min/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.cjs +1 -1
- package/cjs/min/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.cjs.gz +0 -0
- package/cjs/persisters/persister-durable-object-storage/index.cjs +1 -1
- package/cjs/persisters/persister-durable-object-storage/with-schemas/index.cjs +1 -1
- package/cjs/persisters/persister-partykit-client/index.cjs +2 -5
- package/cjs/persisters/persister-partykit-client/with-schemas/index.cjs +2 -5
- package/cjs/synchronizers/synchronizer-ws-server-durable-object/index.cjs +1 -1
- package/cjs/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.cjs +1 -1
- package/es6/index.js +0 -1
- package/es6/indexes/index.js +1 -1
- package/es6/indexes/with-schemas/index.js +1 -1
- package/es6/metrics/index.js +1 -1
- package/es6/metrics/with-schemas/index.js +1 -1
- package/es6/min/index.js +1 -1
- package/es6/min/index.js.gz +0 -0
- package/es6/min/indexes/index.js +1 -1
- package/es6/min/indexes/index.js.gz +0 -0
- package/es6/min/indexes/with-schemas/index.js +1 -1
- package/es6/min/indexes/with-schemas/index.js.gz +0 -0
- package/es6/min/metrics/index.js +1 -1
- package/es6/min/metrics/index.js.gz +0 -0
- package/es6/min/metrics/with-schemas/index.js +1 -1
- package/es6/min/metrics/with-schemas/index.js.gz +0 -0
- package/es6/min/persisters/persister-durable-object-storage/index.js +1 -1
- package/es6/min/persisters/persister-durable-object-storage/index.js.gz +0 -0
- package/es6/min/persisters/persister-durable-object-storage/with-schemas/index.js +1 -1
- package/es6/min/persisters/persister-durable-object-storage/with-schemas/index.js.gz +0 -0
- package/es6/min/persisters/persister-file/index.js +1 -1
- package/es6/min/persisters/persister-file/index.js.gz +0 -0
- package/es6/min/persisters/persister-file/with-schemas/index.js +1 -1
- package/es6/min/persisters/persister-file/with-schemas/index.js.gz +0 -0
- package/es6/min/queries/index.js +1 -1
- package/es6/min/queries/index.js.gz +0 -0
- package/es6/min/queries/with-schemas/index.js +1 -1
- package/es6/min/queries/with-schemas/index.js.gz +0 -0
- package/es6/min/relationships/index.js +1 -1
- package/es6/min/relationships/index.js.gz +0 -0
- package/es6/min/relationships/with-schemas/index.js +1 -1
- package/es6/min/relationships/with-schemas/index.js.gz +0 -0
- package/es6/min/synchronizers/synchronizer-ws-server-durable-object/index.js +1 -1
- package/es6/min/synchronizers/synchronizer-ws-server-durable-object/index.js.gz +0 -0
- package/es6/min/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js +1 -1
- package/es6/min/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js.gz +0 -0
- package/es6/min/ui-react-dom/index.js +1 -1
- package/es6/min/ui-react-dom/index.js.gz +0 -0
- package/es6/min/ui-react-dom/with-schemas/index.js +1 -1
- package/es6/min/ui-react-dom/with-schemas/index.js.gz +0 -0
- package/es6/min/ui-react-inspector/index.js +1 -1
- package/es6/min/ui-react-inspector/index.js.gz +0 -0
- package/es6/min/ui-react-inspector/with-schemas/index.js +1 -1
- package/es6/min/ui-react-inspector/with-schemas/index.js.gz +0 -0
- package/es6/min/with-schemas/index.js +1 -1
- package/es6/min/with-schemas/index.js.gz +0 -0
- package/es6/persisters/persister-durable-object-storage/index.js +1 -1
- package/es6/persisters/persister-durable-object-storage/with-schemas/index.js +1 -1
- package/es6/persisters/persister-file/index.js +1 -1
- package/es6/persisters/persister-file/with-schemas/index.js +1 -1
- package/es6/persisters/persister-partykit-client/index.js +2 -5
- package/es6/persisters/persister-partykit-client/with-schemas/index.js +2 -5
- package/es6/queries/index.js +0 -1
- package/es6/queries/with-schemas/index.js +0 -1
- package/es6/relationships/index.js +1 -1
- package/es6/relationships/with-schemas/index.js +1 -1
- package/es6/synchronizers/synchronizer-ws-server-durable-object/index.js +1 -1
- package/es6/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js +1 -1
- package/es6/ui-react-dom/index.js +8 -8
- package/es6/ui-react-dom/with-schemas/index.js +8 -8
- package/es6/ui-react-inspector/index.js +4 -4
- package/es6/ui-react-inspector/with-schemas/index.js +4 -4
- package/es6/with-schemas/index.js +0 -1
- package/min/persisters/persister-durable-object-storage/index.js +1 -1
- package/min/persisters/persister-durable-object-storage/index.js.gz +0 -0
- package/min/persisters/persister-durable-object-storage/with-schemas/index.js +1 -1
- package/min/persisters/persister-durable-object-storage/with-schemas/index.js.gz +0 -0
- package/min/persisters/persister-file/index.js +1 -1
- package/min/persisters/persister-file/index.js.gz +0 -0
- package/min/persisters/persister-file/with-schemas/index.js +1 -1
- package/min/persisters/persister-file/with-schemas/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-ws-server-durable-object/index.js +1 -1
- package/min/synchronizers/synchronizer-ws-server-durable-object/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js +1 -1
- package/min/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js.gz +0 -0
- package/min/ui-react-dom/index.js +1 -1
- package/min/ui-react-dom/index.js.gz +0 -0
- package/min/ui-react-dom/with-schemas/index.js +1 -1
- package/min/ui-react-dom/with-schemas/index.js.gz +0 -0
- package/min/ui-react-inspector/index.js +1 -1
- package/min/ui-react-inspector/index.js.gz +0 -0
- package/min/ui-react-inspector/with-schemas/index.js +1 -1
- package/min/ui-react-inspector/with-schemas/index.js.gz +0 -0
- package/package.json +1 -1
- package/persisters/persister-durable-object-storage/index.js +1 -1
- package/persisters/persister-durable-object-storage/with-schemas/index.js +1 -1
- package/persisters/persister-file/index.js +1 -1
- package/persisters/persister-file/with-schemas/index.js +1 -1
- package/persisters/persister-partykit-client/index.js +2 -5
- package/persisters/persister-partykit-client/with-schemas/index.js +2 -5
- package/readme.md +2 -2
- package/synchronizers/synchronizer-ws-server-durable-object/index.js +1 -1
- package/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js +1 -1
- package/ui-react-dom/index.js +8 -8
- package/ui-react-dom/with-schemas/index.js +8 -8
- package/ui-react-inspector/index.js +4 -4
- package/ui-react-inspector/with-schemas/index.js +4 -4
- package/umd/es6/index.js +0 -1
- package/umd/es6/indexes/index.js +1 -5
- package/umd/es6/indexes/with-schemas/index.js +1 -5
- package/umd/es6/metrics/index.js +1 -5
- package/umd/es6/metrics/with-schemas/index.js +1 -5
- package/umd/es6/min/index.js +1 -1
- package/umd/es6/min/index.js.gz +0 -0
- package/umd/es6/min/indexes/index.js +1 -1
- package/umd/es6/min/indexes/index.js.gz +0 -0
- package/umd/es6/min/indexes/with-schemas/index.js +1 -1
- package/umd/es6/min/indexes/with-schemas/index.js.gz +0 -0
- package/umd/es6/min/metrics/index.js +1 -1
- package/umd/es6/min/metrics/index.js.gz +0 -0
- package/umd/es6/min/metrics/with-schemas/index.js +1 -1
- package/umd/es6/min/metrics/with-schemas/index.js.gz +0 -0
- package/umd/es6/min/persisters/persister-durable-object-storage/index.js +1 -1
- package/umd/es6/min/persisters/persister-durable-object-storage/index.js.gz +0 -0
- package/umd/es6/min/persisters/persister-durable-object-storage/with-schemas/index.js +1 -1
- package/umd/es6/min/persisters/persister-durable-object-storage/with-schemas/index.js.gz +0 -0
- package/umd/es6/min/queries/index.js +1 -1
- package/umd/es6/min/queries/index.js.gz +0 -0
- package/umd/es6/min/queries/with-schemas/index.js +1 -1
- package/umd/es6/min/queries/with-schemas/index.js.gz +0 -0
- package/umd/es6/min/relationships/index.js +1 -1
- package/umd/es6/min/relationships/index.js.gz +0 -0
- package/umd/es6/min/relationships/with-schemas/index.js +1 -1
- package/umd/es6/min/relationships/with-schemas/index.js.gz +0 -0
- package/umd/es6/min/synchronizers/synchronizer-ws-server-durable-object/index.js +1 -1
- package/umd/es6/min/synchronizers/synchronizer-ws-server-durable-object/index.js.gz +0 -0
- package/umd/es6/min/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js +1 -1
- package/umd/es6/min/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js.gz +0 -0
- package/umd/es6/min/with-schemas/index.js +1 -1
- package/umd/es6/min/with-schemas/index.js.gz +0 -0
- package/umd/es6/persisters/persister-durable-object-storage/index.js +1 -1
- package/umd/es6/persisters/persister-durable-object-storage/with-schemas/index.js +1 -1
- package/umd/es6/persisters/persister-partykit-client/index.js +2 -5
- package/umd/es6/persisters/persister-partykit-client/with-schemas/index.js +2 -5
- package/umd/es6/queries/index.js +0 -1
- package/umd/es6/queries/with-schemas/index.js +0 -1
- package/umd/es6/relationships/index.js +1 -5
- package/umd/es6/relationships/with-schemas/index.js +1 -5
- package/umd/es6/synchronizers/synchronizer-ws-server-durable-object/index.js +1 -1
- package/umd/es6/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js +1 -1
- package/umd/es6/with-schemas/index.js +0 -1
- package/umd/min/persisters/persister-durable-object-storage/index.js +1 -1
- package/umd/min/persisters/persister-durable-object-storage/index.js.gz +0 -0
- package/umd/min/persisters/persister-durable-object-storage/with-schemas/index.js +1 -1
- package/umd/min/persisters/persister-durable-object-storage/with-schemas/index.js.gz +0 -0
- package/umd/min/synchronizers/synchronizer-ws-server-durable-object/index.js +1 -1
- package/umd/min/synchronizers/synchronizer-ws-server-durable-object/index.js.gz +0 -0
- package/umd/min/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js +1 -1
- package/umd/min/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js.gz +0 -0
- package/umd/persisters/persister-durable-object-storage/index.js +1 -1
- package/umd/persisters/persister-durable-object-storage/with-schemas/index.js +1 -1
- package/umd/persisters/persister-partykit-client/index.js +2 -5
- package/umd/persisters/persister-partykit-client/with-schemas/index.js +2 -5
- package/umd/synchronizers/synchronizer-ws-server-durable-object/index.js +1 -1
- package/umd/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js +1 -1
|
@@ -71,6 +71,7 @@ export type TinyBasePartyKitServerConfig = {
|
|
|
71
71
|
* @since v4.3.0
|
|
72
72
|
*/
|
|
73
73
|
storePath?: string;
|
|
74
|
+
|
|
74
75
|
/**
|
|
75
76
|
* The prefix at the beginning of the web socket messages between the client
|
|
76
77
|
* and the server when synchronizing the Store. Use this to make sure they do
|
|
@@ -81,6 +82,7 @@ export type TinyBasePartyKitServerConfig = {
|
|
|
81
82
|
* @since v4.3.0
|
|
82
83
|
*/
|
|
83
84
|
messagePrefix?: string;
|
|
85
|
+
|
|
84
86
|
/**
|
|
85
87
|
* The prefix used before all the keys in the server's durable storage. Use
|
|
86
88
|
* this in case you are worried about the Store data colliding with other data
|
|
@@ -89,6 +91,7 @@ export type TinyBasePartyKitServerConfig = {
|
|
|
89
91
|
* @since v4.3.0
|
|
90
92
|
*/
|
|
91
93
|
storagePrefix?: string;
|
|
94
|
+
|
|
92
95
|
/**
|
|
93
96
|
* An object containing the extra HTTP(S) headers returned to the client from
|
|
94
97
|
* this server. This defaults to the following three headers to allow CORS.
|
|
@@ -160,10 +163,12 @@ export type TinyBasePartyKitServerConfig = {
|
|
|
160
163
|
export class TinyBasePartyKitServer implements Server {
|
|
161
164
|
/**
|
|
162
165
|
* The constructor is used to create the server.
|
|
166
|
+
* @returns A new instance of the TinyBasePartyKitServer.
|
|
163
167
|
* @category Creation
|
|
164
168
|
* @since v4.3.9
|
|
165
169
|
*/
|
|
166
170
|
constructor(party: Party);
|
|
171
|
+
|
|
167
172
|
/**
|
|
168
173
|
* The config property is used to optionally configure the server, using an
|
|
169
174
|
* object of the TinyBasePartyKitServerConfig type.
|
|
@@ -173,6 +178,7 @@ export class TinyBasePartyKitServer implements Server {
|
|
|
173
178
|
* @since v4.3.9
|
|
174
179
|
*/
|
|
175
180
|
readonly config: TinyBasePartyKitServerConfig;
|
|
181
|
+
|
|
176
182
|
/**
|
|
177
183
|
* The onRequest method is called when a HTTP request is made to the party
|
|
178
184
|
* URL.
|
|
@@ -199,6 +205,7 @@ export class TinyBasePartyKitServer implements Server {
|
|
|
199
205
|
* @since v4.3.0
|
|
200
206
|
*/
|
|
201
207
|
onRequest(request: Request): Promise<Response>;
|
|
208
|
+
|
|
202
209
|
/**
|
|
203
210
|
* The onMessage method is called when the server receives a message from a
|
|
204
211
|
* client.
|
|
@@ -225,6 +232,7 @@ export class TinyBasePartyKitServer implements Server {
|
|
|
225
232
|
* @since v4.3.0
|
|
226
233
|
*/
|
|
227
234
|
onMessage(message: string, connection: Connection): Promise<void>;
|
|
235
|
+
|
|
228
236
|
/**
|
|
229
237
|
* The canSetTable method lets you allow or disallow any changes to a Table
|
|
230
238
|
* stored on the server, as sent from a client.
|
|
@@ -273,6 +281,7 @@ export class TinyBasePartyKitServer implements Server {
|
|
|
273
281
|
initialSave: boolean,
|
|
274
282
|
requestOrConnection: Request | Connection,
|
|
275
283
|
): Promise<boolean>;
|
|
284
|
+
|
|
276
285
|
/**
|
|
277
286
|
* The canDelTable method lets you allow or disallow deletions of a Table
|
|
278
287
|
* stored on the server, as sent from a client.
|
|
@@ -307,6 +316,7 @@ export class TinyBasePartyKitServer implements Server {
|
|
|
307
316
|
* @since v4.3.12
|
|
308
317
|
*/
|
|
309
318
|
canDelTable(tableId: Id, connection: Connection): Promise<boolean>;
|
|
319
|
+
|
|
310
320
|
/**
|
|
311
321
|
* The canSetRow method lets you allow or disallow any changes to a Row stored
|
|
312
322
|
* on the server, as sent from a client.
|
|
@@ -352,6 +362,7 @@ export class TinyBasePartyKitServer implements Server {
|
|
|
352
362
|
initialSave: boolean,
|
|
353
363
|
requestOrConnection: Request | Connection,
|
|
354
364
|
): Promise<boolean>;
|
|
365
|
+
|
|
355
366
|
/**
|
|
356
367
|
* The canDelRow method lets you allow or disallow deletions of a Row stored
|
|
357
368
|
* on the server, as sent from a client.
|
|
@@ -387,6 +398,7 @@ export class TinyBasePartyKitServer implements Server {
|
|
|
387
398
|
* @since v4.3.12
|
|
388
399
|
*/
|
|
389
400
|
canDelRow(tableId: Id, rowId: Id, connection: Connection): Promise<boolean>;
|
|
401
|
+
|
|
390
402
|
/**
|
|
391
403
|
* The canSetCell method lets you allow or disallow any changes to a Cell
|
|
392
404
|
* stored on the server, as sent from a client.
|
|
@@ -452,6 +464,7 @@ export class TinyBasePartyKitServer implements Server {
|
|
|
452
464
|
requestOrConnection: Request | Connection,
|
|
453
465
|
oldCell: CellOrUndefined<NoTablesSchema, Id, Id>,
|
|
454
466
|
): Promise<boolean>;
|
|
467
|
+
|
|
455
468
|
/**
|
|
456
469
|
* The canDelCell method lets you allow or disallow deletions of a Cell stored
|
|
457
470
|
* on the server, as sent from a client.
|
|
@@ -492,6 +505,7 @@ export class TinyBasePartyKitServer implements Server {
|
|
|
492
505
|
cellId: Id,
|
|
493
506
|
connection: Connection,
|
|
494
507
|
): Promise<boolean>;
|
|
508
|
+
|
|
495
509
|
/**
|
|
496
510
|
* The canSetValue method lets you allow or disallow any changes to a Value
|
|
497
511
|
* stored on the server, as sent from a client.
|
|
@@ -553,6 +567,7 @@ export class TinyBasePartyKitServer implements Server {
|
|
|
553
567
|
requestOrConnection: Request | Connection,
|
|
554
568
|
oldValue: ValueOrUndefined<NoValuesSchema, Id>,
|
|
555
569
|
): Promise<boolean>;
|
|
570
|
+
|
|
556
571
|
/**
|
|
557
572
|
* The canDelValue method lets you allow or disallow deletions of a Value
|
|
558
573
|
* stored on the server, as sent from a client.
|
|
@@ -71,6 +71,7 @@ export type TinyBasePartyKitServerConfig = {
|
|
|
71
71
|
* @since v4.3.0
|
|
72
72
|
*/
|
|
73
73
|
storePath?: string;
|
|
74
|
+
|
|
74
75
|
/**
|
|
75
76
|
* The prefix at the beginning of the web socket messages between the client
|
|
76
77
|
* and the server when synchronizing the Store. Use this to make sure they do
|
|
@@ -81,6 +82,7 @@ export type TinyBasePartyKitServerConfig = {
|
|
|
81
82
|
* @since v4.3.0
|
|
82
83
|
*/
|
|
83
84
|
messagePrefix?: string;
|
|
85
|
+
|
|
84
86
|
/**
|
|
85
87
|
* The prefix used before all the keys in the server's durable storage. Use
|
|
86
88
|
* this in case you are worried about the Store data colliding with other data
|
|
@@ -89,6 +91,7 @@ export type TinyBasePartyKitServerConfig = {
|
|
|
89
91
|
* @since v4.3.0
|
|
90
92
|
*/
|
|
91
93
|
storagePrefix?: string;
|
|
94
|
+
|
|
92
95
|
/**
|
|
93
96
|
* An object containing the extra HTTP(S) headers returned to the client from
|
|
94
97
|
* this server. This defaults to the following three headers to allow CORS.
|
|
@@ -160,10 +163,12 @@ export type TinyBasePartyKitServerConfig = {
|
|
|
160
163
|
export class TinyBasePartyKitServer implements Server {
|
|
161
164
|
/**
|
|
162
165
|
* The constructor is used to create the server.
|
|
166
|
+
* @returns A new instance of the TinyBasePartyKitServer.
|
|
163
167
|
* @category Creation
|
|
164
168
|
* @since v4.3.9
|
|
165
169
|
*/
|
|
166
170
|
constructor(party: Party);
|
|
171
|
+
|
|
167
172
|
/**
|
|
168
173
|
* The config property is used to optionally configure the server, using an
|
|
169
174
|
* object of the TinyBasePartyKitServerConfig type.
|
|
@@ -173,6 +178,7 @@ export class TinyBasePartyKitServer implements Server {
|
|
|
173
178
|
* @since v4.3.9
|
|
174
179
|
*/
|
|
175
180
|
readonly config: TinyBasePartyKitServerConfig;
|
|
181
|
+
|
|
176
182
|
/**
|
|
177
183
|
* The onRequest method is called when a HTTP request is made to the party
|
|
178
184
|
* URL.
|
|
@@ -199,6 +205,7 @@ export class TinyBasePartyKitServer implements Server {
|
|
|
199
205
|
* @since v4.3.0
|
|
200
206
|
*/
|
|
201
207
|
onRequest(request: Request): Promise<Response>;
|
|
208
|
+
|
|
202
209
|
/**
|
|
203
210
|
* The onMessage method is called when the server receives a message from a
|
|
204
211
|
* client.
|
|
@@ -225,6 +232,7 @@ export class TinyBasePartyKitServer implements Server {
|
|
|
225
232
|
* @since v4.3.0
|
|
226
233
|
*/
|
|
227
234
|
onMessage(message: string, connection: Connection): Promise<void>;
|
|
235
|
+
|
|
228
236
|
/**
|
|
229
237
|
* The canSetTable method lets you allow or disallow any changes to a Table
|
|
230
238
|
* stored on the server, as sent from a client.
|
|
@@ -273,6 +281,7 @@ export class TinyBasePartyKitServer implements Server {
|
|
|
273
281
|
initialSave: boolean,
|
|
274
282
|
requestOrConnection: Request | Connection,
|
|
275
283
|
): Promise<boolean>;
|
|
284
|
+
|
|
276
285
|
/**
|
|
277
286
|
* The canDelTable method lets you allow or disallow deletions of a Table
|
|
278
287
|
* stored on the server, as sent from a client.
|
|
@@ -307,6 +316,7 @@ export class TinyBasePartyKitServer implements Server {
|
|
|
307
316
|
* @since v4.3.12
|
|
308
317
|
*/
|
|
309
318
|
canDelTable(tableId: Id, connection: Connection): Promise<boolean>;
|
|
319
|
+
|
|
310
320
|
/**
|
|
311
321
|
* The canSetRow method lets you allow or disallow any changes to a Row stored
|
|
312
322
|
* on the server, as sent from a client.
|
|
@@ -352,6 +362,7 @@ export class TinyBasePartyKitServer implements Server {
|
|
|
352
362
|
initialSave: boolean,
|
|
353
363
|
requestOrConnection: Request | Connection,
|
|
354
364
|
): Promise<boolean>;
|
|
365
|
+
|
|
355
366
|
/**
|
|
356
367
|
* The canDelRow method lets you allow or disallow deletions of a Row stored
|
|
357
368
|
* on the server, as sent from a client.
|
|
@@ -387,6 +398,7 @@ export class TinyBasePartyKitServer implements Server {
|
|
|
387
398
|
* @since v4.3.12
|
|
388
399
|
*/
|
|
389
400
|
canDelRow(tableId: Id, rowId: Id, connection: Connection): Promise<boolean>;
|
|
401
|
+
|
|
390
402
|
/**
|
|
391
403
|
* The canSetCell method lets you allow or disallow any changes to a Cell
|
|
392
404
|
* stored on the server, as sent from a client.
|
|
@@ -452,6 +464,7 @@ export class TinyBasePartyKitServer implements Server {
|
|
|
452
464
|
requestOrConnection: Request | Connection,
|
|
453
465
|
oldCell: CellOrUndefined<NoTablesSchema, Id, Id>,
|
|
454
466
|
): Promise<boolean>;
|
|
467
|
+
|
|
455
468
|
/**
|
|
456
469
|
* The canDelCell method lets you allow or disallow deletions of a Cell stored
|
|
457
470
|
* on the server, as sent from a client.
|
|
@@ -492,6 +505,7 @@ export class TinyBasePartyKitServer implements Server {
|
|
|
492
505
|
cellId: Id,
|
|
493
506
|
connection: Connection,
|
|
494
507
|
): Promise<boolean>;
|
|
508
|
+
|
|
495
509
|
/**
|
|
496
510
|
* The canSetValue method lets you allow or disallow any changes to a Value
|
|
497
511
|
* stored on the server, as sent from a client.
|
|
@@ -553,6 +567,7 @@ export class TinyBasePartyKitServer implements Server {
|
|
|
553
567
|
requestOrConnection: Request | Connection,
|
|
554
568
|
oldValue: ValueOrUndefined<NoValuesSchema, Id>,
|
|
555
569
|
): Promise<boolean>;
|
|
570
|
+
|
|
556
571
|
/**
|
|
557
572
|
* The canDelValue method lets you allow or disallow deletions of a Value
|
|
558
573
|
* stored on the server, as sent from a client.
|
|
@@ -1561,6 +1561,7 @@ export interface Persister<
|
|
|
1561
1561
|
* the underlying Store and storage are removed and it can be correctly
|
|
1562
1562
|
* garbage collected. It is equivalent to running the stopAutoLoad method and
|
|
1563
1563
|
* the stopAutoSave method in succession.
|
|
1564
|
+
* @returns A reference to the Persister object.
|
|
1564
1565
|
* @example
|
|
1565
1566
|
* This example creates a Store, associates a Persister object with it (that
|
|
1566
1567
|
* registers a TablesListener with the underlying Store), and then destroys it
|
|
@@ -1561,6 +1561,7 @@ export interface Persister<
|
|
|
1561
1561
|
* the underlying Store and storage are removed and it can be correctly
|
|
1562
1562
|
* garbage collected. It is equivalent to running the stopAutoLoad method and
|
|
1563
1563
|
* the stopAutoSave method in succession.
|
|
1564
|
+
* @returns A reference to the Persister object.
|
|
1564
1565
|
* @example
|
|
1565
1566
|
* This example creates a Store, associates a Persister object with it (that
|
|
1566
1567
|
* registers a TablesListener with the underlying Store), and then destroys it
|
package/@types/store/index.d.cts
CHANGED
|
@@ -473,13 +473,14 @@ export type GetCell = (cellId: Id) => CellOrUndefined;
|
|
|
473
473
|
|
|
474
474
|
/**
|
|
475
475
|
* The IdAddedOrRemoved type describes a change made to an Id in either the
|
|
476
|
-
* tabular
|
|
476
|
+
* tabular or keyed-value part of the Store (or in other TinyBase modules).
|
|
477
477
|
*
|
|
478
478
|
* This type is used in other types like ChangedTableIds, ChangedRowIds,
|
|
479
|
-
* ChangedCellIds, and ChangedValueIds
|
|
479
|
+
* ChangedCellIds, and ChangedValueIds, as well as in other events or listeners
|
|
480
|
+
* where a list of Ids has changed.
|
|
480
481
|
*
|
|
481
|
-
* It is a simple number: a 1 indicates that a given Id was added to
|
|
482
|
-
*
|
|
482
|
+
* It is a simple number: a 1 indicates that a given Id was added to a list of
|
|
483
|
+
* Ids, and a -1 indicates that it was removed.
|
|
483
484
|
* @category Transaction
|
|
484
485
|
* @since v4.0.0
|
|
485
486
|
*/
|
|
@@ -7518,13 +7519,14 @@ export interface Store {
|
|
|
7518
7519
|
getListenerStats(): StoreListenerStats;
|
|
7519
7520
|
|
|
7520
7521
|
/**
|
|
7521
|
-
* The isMergeable
|
|
7522
|
+
* The isMergeable method lets you know if the Store is mergeable.
|
|
7522
7523
|
*
|
|
7523
|
-
* This will always
|
|
7524
|
-
* @
|
|
7524
|
+
* This will always return false for a Store, and true for a MergeableStore.
|
|
7525
|
+
* @returns Whether the Store is mergeable.
|
|
7526
|
+
* @category Getter
|
|
7525
7527
|
* @since v5.0.0
|
|
7526
7528
|
*/
|
|
7527
|
-
isMergeable
|
|
7529
|
+
isMergeable(): boolean;
|
|
7528
7530
|
//
|
|
7529
7531
|
}
|
|
7530
7532
|
|
package/@types/store/index.d.ts
CHANGED
|
@@ -473,13 +473,14 @@ export type GetCell = (cellId: Id) => CellOrUndefined;
|
|
|
473
473
|
|
|
474
474
|
/**
|
|
475
475
|
* The IdAddedOrRemoved type describes a change made to an Id in either the
|
|
476
|
-
* tabular
|
|
476
|
+
* tabular or keyed-value part of the Store (or in other TinyBase modules).
|
|
477
477
|
*
|
|
478
478
|
* This type is used in other types like ChangedTableIds, ChangedRowIds,
|
|
479
|
-
* ChangedCellIds, and ChangedValueIds
|
|
479
|
+
* ChangedCellIds, and ChangedValueIds, as well as in other events or listeners
|
|
480
|
+
* where a list of Ids has changed.
|
|
480
481
|
*
|
|
481
|
-
* It is a simple number: a 1 indicates that a given Id was added to
|
|
482
|
-
*
|
|
482
|
+
* It is a simple number: a 1 indicates that a given Id was added to a list of
|
|
483
|
+
* Ids, and a -1 indicates that it was removed.
|
|
483
484
|
* @category Transaction
|
|
484
485
|
* @since v4.0.0
|
|
485
486
|
*/
|
|
@@ -7518,13 +7519,14 @@ export interface Store {
|
|
|
7518
7519
|
getListenerStats(): StoreListenerStats;
|
|
7519
7520
|
|
|
7520
7521
|
/**
|
|
7521
|
-
* The isMergeable
|
|
7522
|
+
* The isMergeable method lets you know if the Store is mergeable.
|
|
7522
7523
|
*
|
|
7523
|
-
* This will always
|
|
7524
|
-
* @
|
|
7524
|
+
* This will always return false for a Store, and true for a MergeableStore.
|
|
7525
|
+
* @returns Whether the Store is mergeable.
|
|
7526
|
+
* @category Getter
|
|
7525
7527
|
* @since v5.0.0
|
|
7526
7528
|
*/
|
|
7527
|
-
isMergeable
|
|
7529
|
+
isMergeable(): boolean;
|
|
7528
7530
|
//
|
|
7529
7531
|
}
|
|
7530
7532
|
|
|
@@ -749,13 +749,14 @@ export type GetCell<
|
|
|
749
749
|
|
|
750
750
|
/**
|
|
751
751
|
* The IdAddedOrRemoved type describes a change made to an Id in either the
|
|
752
|
-
* tabular
|
|
752
|
+
* tabular or keyed-value part of the Store (or in other TinyBase modules).
|
|
753
753
|
*
|
|
754
754
|
* This type is used in other types like ChangedTableIds, ChangedRowIds,
|
|
755
|
-
* ChangedCellIds, and ChangedValueIds
|
|
755
|
+
* ChangedCellIds, and ChangedValueIds, as well as in other events or listeners
|
|
756
|
+
* where a list of Ids has changed.
|
|
756
757
|
*
|
|
757
|
-
* It is a simple number: a 1 indicates that a given Id was added to
|
|
758
|
-
*
|
|
758
|
+
* It is a simple number: a 1 indicates that a given Id was added to a list of
|
|
759
|
+
* Ids, and a -1 indicates that it was removed.
|
|
759
760
|
* @category Transaction
|
|
760
761
|
* @since v4.0.0
|
|
761
762
|
*/
|
|
@@ -9191,13 +9192,14 @@ export interface Store<in out Schemas extends OptionalSchemas> {
|
|
|
9191
9192
|
getListenerStats(): StoreListenerStats;
|
|
9192
9193
|
|
|
9193
9194
|
/**
|
|
9194
|
-
* The isMergeable
|
|
9195
|
+
* The isMergeable method lets you know if the Store is mergeable.
|
|
9195
9196
|
*
|
|
9196
|
-
* This will always
|
|
9197
|
-
* @
|
|
9197
|
+
* This will always return false for a Store, and true for a MergeableStore.
|
|
9198
|
+
* @returns Whether the Store is mergeable.
|
|
9199
|
+
* @category Getter
|
|
9198
9200
|
* @since v5.0.0
|
|
9199
9201
|
*/
|
|
9200
|
-
isMergeable
|
|
9202
|
+
isMergeable(): boolean;
|
|
9201
9203
|
}
|
|
9202
9204
|
|
|
9203
9205
|
/**
|
|
@@ -749,13 +749,14 @@ export type GetCell<
|
|
|
749
749
|
|
|
750
750
|
/**
|
|
751
751
|
* The IdAddedOrRemoved type describes a change made to an Id in either the
|
|
752
|
-
* tabular
|
|
752
|
+
* tabular or keyed-value part of the Store (or in other TinyBase modules).
|
|
753
753
|
*
|
|
754
754
|
* This type is used in other types like ChangedTableIds, ChangedRowIds,
|
|
755
|
-
* ChangedCellIds, and ChangedValueIds
|
|
755
|
+
* ChangedCellIds, and ChangedValueIds, as well as in other events or listeners
|
|
756
|
+
* where a list of Ids has changed.
|
|
756
757
|
*
|
|
757
|
-
* It is a simple number: a 1 indicates that a given Id was added to
|
|
758
|
-
*
|
|
758
|
+
* It is a simple number: a 1 indicates that a given Id was added to a list of
|
|
759
|
+
* Ids, and a -1 indicates that it was removed.
|
|
759
760
|
* @category Transaction
|
|
760
761
|
* @since v4.0.0
|
|
761
762
|
*/
|
|
@@ -9191,13 +9192,14 @@ export interface Store<in out Schemas extends OptionalSchemas> {
|
|
|
9191
9192
|
getListenerStats(): StoreListenerStats;
|
|
9192
9193
|
|
|
9193
9194
|
/**
|
|
9194
|
-
* The isMergeable
|
|
9195
|
+
* The isMergeable method lets you know if the Store is mergeable.
|
|
9195
9196
|
*
|
|
9196
|
-
* This will always
|
|
9197
|
-
* @
|
|
9197
|
+
* This will always return false for a Store, and true for a MergeableStore.
|
|
9198
|
+
* @returns Whether the Store is mergeable.
|
|
9199
|
+
* @category Getter
|
|
9198
9200
|
* @since v5.0.0
|
|
9199
9201
|
*/
|
|
9200
|
-
isMergeable
|
|
9202
|
+
isMergeable(): boolean;
|
|
9201
9203
|
}
|
|
9202
9204
|
|
|
9203
9205
|
/**
|