tinybase 5.4.0-beta.5 → 5.5.0-beta.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.
@@ -51,8 +51,8 @@ export type Slice = Ids;
51
51
  * can do something based on every Index in the Indexes object. See that method
52
52
  * for specific examples.
53
53
  * @param indexId The Id of the Index that the callback can operate on.
54
- * @param forEachRow A function that will let you iterate over the Slice objects
55
- * in this Index.
54
+ * @param forEachSlice A function that will let you iterate over the Slice
55
+ * objects in this Index.
56
56
  * @category Callback
57
57
  * @since v1.0.0
58
58
  */
@@ -51,8 +51,8 @@ export type Slice = Ids;
51
51
  * can do something based on every Index in the Indexes object. See that method
52
52
  * for specific examples.
53
53
  * @param indexId The Id of the Index that the callback can operate on.
54
- * @param forEachRow A function that will let you iterate over the Slice objects
55
- * in this Index.
54
+ * @param forEachSlice A function that will let you iterate over the Slice
55
+ * objects in this Index.
56
56
  * @category Callback
57
57
  * @since v1.0.0
58
58
  */
@@ -75,8 +75,8 @@ export type Slice = Ids;
75
75
  * can do something based on every Index in the Indexes object. See that method
76
76
  * for specific examples.
77
77
  * @param indexId The Id of the Index that the callback can operate on.
78
- * @param forEachRow A function that will let you iterate over the Slice objects
79
- * in this Index.
78
+ * @param forEachSlice A function that will let you iterate over the Slice
79
+ * objects in this Index.
80
80
  * @category Callback
81
81
  * @since v1.0.0
82
82
  */
@@ -75,8 +75,8 @@ export type Slice = Ids;
75
75
  * can do something based on every Index in the Indexes object. See that method
76
76
  * for specific examples.
77
77
  * @param indexId The Id of the Index that the callback can operate on.
78
- * @param forEachRow A function that will let you iterate over the Slice objects
79
- * in this Index.
78
+ * @param forEachSlice A function that will let you iterate over the Slice
79
+ * objects in this Index.
80
80
  * @category Callback
81
81
  * @since v1.0.0
82
82
  */
@@ -2,6 +2,7 @@
2
2
  * The persister-durable-object-storage module of the TinyBase project lets you
3
3
  * save and load Store data to and from Cloudflare Durable Object storage (in an
4
4
  * appropriate environment).
5
+ * @see Cloudflare Durable Objects guide
5
6
  * @see Persistence guides
6
7
  * @packageDocumentation
7
8
  * @module persister-durable-object-storage
@@ -72,6 +73,12 @@ export interface DurableObjectStoragePersister
72
73
  * A DurableObjectStoragePersister only supports MergeableStore objects, and
73
74
  * cannot be used to persist a regular Store.
74
75
  *
76
+ * Durable Objects have limitations on the data that can be stored in each key
77
+ * of their key-value structure. The DurableObjectStoragePersister uses one key
78
+ * per TinyBase Value, one key per Cell, one key per Row, and one key per Table.
79
+ * Mostly this is CRDT metadata, but the main caution is to ensure that each
80
+ * individual TinyBase Cell and Value data does not exceed the (128 KiB) limit.
81
+ *
75
82
  * As well as providing a reference to the MergeableStore to persist, you must
76
83
  * provide a `storage` parameter which identifies the Durable Object storage to
77
84
  * persist it to.
@@ -2,6 +2,7 @@
2
2
  * The persister-durable-object-storage module of the TinyBase project lets you
3
3
  * save and load Store data to and from Cloudflare Durable Object storage (in an
4
4
  * appropriate environment).
5
+ * @see Cloudflare Durable Objects guide
5
6
  * @see Persistence guides
6
7
  * @packageDocumentation
7
8
  * @module persister-durable-object-storage
@@ -72,6 +73,12 @@ export interface DurableObjectStoragePersister
72
73
  * A DurableObjectStoragePersister only supports MergeableStore objects, and
73
74
  * cannot be used to persist a regular Store.
74
75
  *
76
+ * Durable Objects have limitations on the data that can be stored in each key
77
+ * of their key-value structure. The DurableObjectStoragePersister uses one key
78
+ * per TinyBase Value, one key per Cell, one key per Row, and one key per Table.
79
+ * Mostly this is CRDT metadata, but the main caution is to ensure that each
80
+ * individual TinyBase Cell and Value data does not exceed the (128 KiB) limit.
81
+ *
75
82
  * As well as providing a reference to the MergeableStore to persist, you must
76
83
  * provide a `storage` parameter which identifies the Durable Object storage to
77
84
  * persist it to.
@@ -2,6 +2,7 @@
2
2
  * The persister-durable-object-storage module of the TinyBase project lets you
3
3
  * save and load Store data to and from Cloudflare Durable Object storage (in an
4
4
  * appropriate environment).
5
+ * @see Cloudflare Durable Objects guide
5
6
  * @see Persistence guides
6
7
  * @packageDocumentation
7
8
  * @module persister-durable-object-storage
@@ -84,6 +85,12 @@ export interface DurableObjectStoragePersister<Schemas extends OptionalSchemas>
84
85
  * A DurableObjectStoragePersister only supports MergeableStore objects, and
85
86
  * cannot be used to persist a regular Store.
86
87
  *
88
+ * Durable Objects have limitations on the data that can be stored in each key
89
+ * of their key-value structure. The DurableObjectStoragePersister uses one key
90
+ * per TinyBase Value, one key per Cell, one key per Row, and one key per Table.
91
+ * Mostly this is CRDT metadata, but the main caution is to ensure that each
92
+ * individual TinyBase Cell and Value data does not exceed the (128 KiB) limit.
93
+ *
87
94
  * As well as providing a reference to the MergeableStore to persist, you must
88
95
  * provide a `storage` parameter which identifies the Durable Object storage to
89
96
  * persist it to.
@@ -2,6 +2,7 @@
2
2
  * The persister-durable-object-storage module of the TinyBase project lets you
3
3
  * save and load Store data to and from Cloudflare Durable Object storage (in an
4
4
  * appropriate environment).
5
+ * @see Cloudflare Durable Objects guide
5
6
  * @see Persistence guides
6
7
  * @packageDocumentation
7
8
  * @module persister-durable-object-storage
@@ -84,6 +85,12 @@ export interface DurableObjectStoragePersister<Schemas extends OptionalSchemas>
84
85
  * A DurableObjectStoragePersister only supports MergeableStore objects, and
85
86
  * cannot be used to persist a regular Store.
86
87
  *
88
+ * Durable Objects have limitations on the data that can be stored in each key
89
+ * of their key-value structure. The DurableObjectStoragePersister uses one key
90
+ * per TinyBase Value, one key per Cell, one key per Row, and one key per Table.
91
+ * Mostly this is CRDT metadata, but the main caution is to ensure that each
92
+ * individual TinyBase Cell and Value data does not exceed the (128 KiB) limit.
93
+ *
87
94
  * As well as providing a reference to the MergeableStore to persist, you must
88
95
  * provide a `storage` parameter which identifies the Durable Object storage to
89
96
  * persist it to.
@@ -234,7 +234,7 @@ export type ResultTableCallback = (
234
234
  * that you can do something based on every ResultRow in a ResultTable. See that
235
235
  * method for specific examples.
236
236
  * @param rowId The Id of the ResultRow that the callback can operate on.
237
- * @param forEachRow A function that will let you iterate over the ResultCell
237
+ * @param forEachCell A function that will let you iterate over the ResultCell
238
238
  * values in this ResultRow.
239
239
  * @category Callback
240
240
  * @since v2.0.0
@@ -234,7 +234,7 @@ export type ResultTableCallback = (
234
234
  * that you can do something based on every ResultRow in a ResultTable. See that
235
235
  * method for specific examples.
236
236
  * @param rowId The Id of the ResultRow that the callback can operate on.
237
- * @param forEachRow A function that will let you iterate over the ResultCell
237
+ * @param forEachCell A function that will let you iterate over the ResultCell
238
238
  * values in this ResultRow.
239
239
  * @category Callback
240
240
  * @since v2.0.0
@@ -245,7 +245,7 @@ export type ResultTableCallback = (
245
245
  * that you can do something based on every ResultRow in a ResultTable. See that
246
246
  * method for specific examples.
247
247
  * @param rowId The Id of the ResultRow that the callback can operate on.
248
- * @param forEachRow A function that will let you iterate over the ResultCell
248
+ * @param forEachCell A function that will let you iterate over the ResultCell
249
249
  * values in this ResultRow.
250
250
  * @category Callback
251
251
  * @since v2.0.0
@@ -245,7 +245,7 @@ export type ResultTableCallback = (
245
245
  * that you can do something based on every ResultRow in a ResultTable. See that
246
246
  * method for specific examples.
247
247
  * @param rowId The Id of the ResultRow that the callback can operate on.
248
- * @param forEachRow A function that will let you iterate over the ResultCell
248
+ * @param forEachCell A function that will let you iterate over the ResultCell
249
249
  * values in this ResultRow.
250
250
  * @category Callback
251
251
  * @since v2.0.0
@@ -394,7 +394,7 @@ export type TableCellCallback = (cellId: Id, count: number) => void;
394
394
  * do something based on every Row in a Table. See that method for specific
395
395
  * examples.
396
396
  * @param rowId The Id of the Row that the callback can operate on.
397
- * @param forEachRow A function that will let you iterate over the Cell values
397
+ * @param forEachCell A function that will let you iterate over the Cell values
398
398
  * in this Row.
399
399
  * @category Callback
400
400
  * @since v1.0.0
@@ -394,7 +394,7 @@ export type TableCellCallback = (cellId: Id, count: number) => void;
394
394
  * do something based on every Row in a Table. See that method for specific
395
395
  * examples.
396
396
  * @param rowId The Id of the Row that the callback can operate on.
397
- * @param forEachRow A function that will let you iterate over the Cell values
397
+ * @param forEachCell A function that will let you iterate over the Cell values
398
398
  * in this Row.
399
399
  * @category Callback
400
400
  * @since v1.0.0
@@ -588,7 +588,7 @@ export type TableCellCallback<
588
588
  * do something based on every Row in a Table. See that method for specific
589
589
  * examples.
590
590
  * @param rowId The Id of the Row that the callback can operate on.
591
- * @param forEachRow A function that will let you iterate over the Cell values
591
+ * @param forEachCell A function that will let you iterate over the Cell values
592
592
  * in this Row.
593
593
  * @category Callback
594
594
  * @since v1.0.0
@@ -588,7 +588,7 @@ export type TableCellCallback<
588
588
  * do something based on every Row in a Table. See that method for specific
589
589
  * examples.
590
590
  * @param rowId The Id of the Row that the callback can operate on.
591
- * @param forEachRow A function that will let you iterate over the Cell values
591
+ * @param forEachCell A function that will let you iterate over the Cell values
592
592
  * in this Row.
593
593
  * @category Callback
594
594
  * @since v1.0.0
@@ -2,6 +2,7 @@
2
2
  * The synchronizer-ws-server-durable-object module of the TinyBase project lets
3
3
  * you create a server that facilitates synchronization between clients, running
4
4
  * as a Cloudflare Durable Object.
5
+ * @see Cloudflare Durable Objects guide
5
6
  * @see Synchronization guide
6
7
  * @see Todo App v6 (collaboration) demo
7
8
  * @packageDocumentation
@@ -17,6 +18,16 @@ import {DurableObject} from 'cloudflare:workers';
17
18
  * A WsServerDurableObject is the server component (running as a Cloudflare
18
19
  * Durable Object) for synchronization between clients that are using
19
20
  * WsSynchronizer instances.
21
+ *
22
+ * The WsServerDurableObject is an overridden implementation of the
23
+ * DurableObject class, so you can have access to its members as well as the
24
+ * TinyBase-specific methods. If you are using the storage for other data, you
25
+ * may want to configure a `prefix` parameter to ensure you don't accidentally
26
+ * collide with TinyBase data.
27
+ *
28
+ * Always remember to call the `super` implementations of the methods that
29
+ * TinyBase uses (the constructor, `fetch`, `webSocketMessage`, and
30
+ * `webSocketClose`) if you further override them.
20
31
  * @category Creation
21
32
  * @since v5.4.0
22
33
  */
@@ -26,12 +37,16 @@ export class WsServerDurableObject<Env = unknown> extends DurableObject<Env> {
26
37
  * the TinyBase clients.
27
38
  *
28
39
  * For basic TinyBase synchronization and persistence, you don't need to
29
- * override this method, but if you do, ensure you call the super constructor.
40
+ * override this method, but if you do, ensure you call the `super`
41
+ * constructor
42
+ * with the two parameters.
43
+ * @param ctx The DurableObjectState context.
44
+ * @param env The DurableObjectState environment.
30
45
  * @returns A new instance of the WsServerDurableObject.
31
46
  * @category Creation
32
47
  * @since v5.4.0
33
48
  */
34
- constructor();
49
+ constructor(ctx: DurableObjectState, env: Env);
35
50
 
36
51
  /**
37
52
  * The createPersister method is used to return a persister for the Durable
@@ -2,6 +2,7 @@
2
2
  * The synchronizer-ws-server-durable-object module of the TinyBase project lets
3
3
  * you create a server that facilitates synchronization between clients, running
4
4
  * as a Cloudflare Durable Object.
5
+ * @see Cloudflare Durable Objects guide
5
6
  * @see Synchronization guide
6
7
  * @see Todo App v6 (collaboration) demo
7
8
  * @packageDocumentation
@@ -17,6 +18,16 @@ import {DurableObject} from 'cloudflare:workers';
17
18
  * A WsServerDurableObject is the server component (running as a Cloudflare
18
19
  * Durable Object) for synchronization between clients that are using
19
20
  * WsSynchronizer instances.
21
+ *
22
+ * The WsServerDurableObject is an overridden implementation of the
23
+ * DurableObject class, so you can have access to its members as well as the
24
+ * TinyBase-specific methods. If you are using the storage for other data, you
25
+ * may want to configure a `prefix` parameter to ensure you don't accidentally
26
+ * collide with TinyBase data.
27
+ *
28
+ * Always remember to call the `super` implementations of the methods that
29
+ * TinyBase uses (the constructor, `fetch`, `webSocketMessage`, and
30
+ * `webSocketClose`) if you further override them.
20
31
  * @category Creation
21
32
  * @since v5.4.0
22
33
  */
@@ -26,12 +37,16 @@ export class WsServerDurableObject<Env = unknown> extends DurableObject<Env> {
26
37
  * the TinyBase clients.
27
38
  *
28
39
  * For basic TinyBase synchronization and persistence, you don't need to
29
- * override this method, but if you do, ensure you call the super constructor.
40
+ * override this method, but if you do, ensure you call the `super`
41
+ * constructor
42
+ * with the two parameters.
43
+ * @param ctx The DurableObjectState context.
44
+ * @param env The DurableObjectState environment.
30
45
  * @returns A new instance of the WsServerDurableObject.
31
46
  * @category Creation
32
47
  * @since v5.4.0
33
48
  */
34
- constructor();
49
+ constructor(ctx: DurableObjectState, env: Env);
35
50
 
36
51
  /**
37
52
  * The createPersister method is used to return a persister for the Durable
@@ -2,6 +2,7 @@
2
2
  * The synchronizer-ws-server-durable-object module of the TinyBase project lets
3
3
  * you create a server that facilitates synchronization between clients, running
4
4
  * as a Cloudflare Durable Object.
5
+ * @see Cloudflare Durable Objects guide
5
6
  * @see Synchronization guide
6
7
  * @see Todo App v6 (collaboration) demo
7
8
  * @packageDocumentation
@@ -25,6 +26,16 @@ import {DurableObject} from 'cloudflare:workers';
25
26
  * A WsServerDurableObject is the server component (running as a Cloudflare
26
27
  * Durable Object) for synchronization between clients that are using
27
28
  * WsSynchronizer instances.
29
+ *
30
+ * The WsServerDurableObject is an overridden implementation of the
31
+ * DurableObject class, so you can have access to its members as well as the
32
+ * TinyBase-specific methods. If you are using the storage for other data, you
33
+ * may want to configure a `prefix` parameter to ensure you don't accidentally
34
+ * collide with TinyBase data.
35
+ *
36
+ * Always remember to call the `super` implementations of the methods that
37
+ * TinyBase uses (the constructor, `fetch`, `webSocketMessage`, and
38
+ * `webSocketClose`) if you further override them.
28
39
  * @category Creation
29
40
  * @since v5.4.0
30
41
  */
@@ -37,12 +48,16 @@ export class WsServerDurableObject<
37
48
  * the TinyBase clients.
38
49
  *
39
50
  * For basic TinyBase synchronization and persistence, you don't need to
40
- * override this method, but if you do, ensure you call the super constructor.
51
+ * override this method, but if you do, ensure you call the `super`
52
+ * constructor
53
+ * with the two parameters.
54
+ * @param ctx The DurableObjectState context.
55
+ * @param env The DurableObjectState environment.
41
56
  * @returns A new instance of the WsServerDurableObject.
42
57
  * @category Creation
43
58
  * @since v5.4.0
44
59
  */
45
- constructor();
60
+ constructor(ctx: DurableObjectState, env: Env);
46
61
 
47
62
  /**
48
63
  * The createPersister method is used to return a persister for the Durable
@@ -2,6 +2,7 @@
2
2
  * The synchronizer-ws-server-durable-object module of the TinyBase project lets
3
3
  * you create a server that facilitates synchronization between clients, running
4
4
  * as a Cloudflare Durable Object.
5
+ * @see Cloudflare Durable Objects guide
5
6
  * @see Synchronization guide
6
7
  * @see Todo App v6 (collaboration) demo
7
8
  * @packageDocumentation
@@ -25,6 +26,16 @@ import {DurableObject} from 'cloudflare:workers';
25
26
  * A WsServerDurableObject is the server component (running as a Cloudflare
26
27
  * Durable Object) for synchronization between clients that are using
27
28
  * WsSynchronizer instances.
29
+ *
30
+ * The WsServerDurableObject is an overridden implementation of the
31
+ * DurableObject class, so you can have access to its members as well as the
32
+ * TinyBase-specific methods. If you are using the storage for other data, you
33
+ * may want to configure a `prefix` parameter to ensure you don't accidentally
34
+ * collide with TinyBase data.
35
+ *
36
+ * Always remember to call the `super` implementations of the methods that
37
+ * TinyBase uses (the constructor, `fetch`, `webSocketMessage`, and
38
+ * `webSocketClose`) if you further override them.
28
39
  * @category Creation
29
40
  * @since v5.4.0
30
41
  */
@@ -37,12 +48,16 @@ export class WsServerDurableObject<
37
48
  * the TinyBase clients.
38
49
  *
39
50
  * For basic TinyBase synchronization and persistence, you don't need to
40
- * override this method, but if you do, ensure you call the super constructor.
51
+ * override this method, but if you do, ensure you call the `super`
52
+ * constructor
53
+ * with the two parameters.
54
+ * @param ctx The DurableObjectState context.
55
+ * @param env The DurableObjectState environment.
41
56
  * @returns A new instance of the WsServerDurableObject.
42
57
  * @category Creation
43
58
  * @since v5.4.0
44
59
  */
45
- constructor();
60
+ constructor(ctx: DurableObjectState, env: Env);
46
61
 
47
62
  /**
48
63
  * The createPersister method is used to return a persister for the Durable
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tinybase",
3
- "version": "5.4.0-beta.5",
3
+ "version": "5.5.0-beta.0",
4
4
  "author": "jamesgpearce",
5
5
  "repository": "github:tinyplex/tinybase",
6
6
  "license": "MIT",