@roc-db/test-utils 0.2.0-pre.41 → 0.2.0-pre.43

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/index.js CHANGED
@@ -328,21 +328,34 @@ var readEntity = readOperation("readEntity", z18.string(), z18.union([PostSchema
328
328
  }));
329
329
  });
330
330
 
331
+ // src/operations/readMutation.ts
332
+ import { NotFoundError as NotFoundError2, Query as Query12, QueryChain as QueryChain7, readOperation as readOperation2 } from "roc-db";
333
+ import { z as z19 } from "zod";
334
+ var readMutation = readOperation2("readMutation", z19.string(), z19.any(), (txn) => {
335
+ const ref = txn.payload;
336
+ return QueryChain7(Query12(() => txn.readMutation(ref)), Query12((entity) => {
337
+ if (!entity) {
338
+ throw new NotFoundError2(ref);
339
+ }
340
+ return entity;
341
+ }));
342
+ });
343
+
331
344
  // src/operations/readPost.ts
332
- import { Query as Query12, readOperation as readOperation2 } from "roc-db";
333
- var readPost = readOperation2("readPost", PostRefSchema, PostSchema, (txn) => {
345
+ import { Query as Query13, readOperation as readOperation3 } from "roc-db";
346
+ var readPost = readOperation3("readPost", PostRefSchema, PostSchema, (txn) => {
334
347
  const ref = txn.payload;
335
- return Query12(() => txn.readEntity(ref, true));
348
+ return Query13(() => txn.readEntity(ref, true));
336
349
  });
337
350
 
338
351
  // src/operations/testTransactionalEdits.ts
339
- import { Query as Query13, QueryChain as QueryChain7, writeOperation as writeOperation11 } from "roc-db";
352
+ import { Query as Query14, QueryChain as QueryChain8, writeOperation as writeOperation11 } from "roc-db";
340
353
 
341
354
  // src/schemas/TestTransactionalEditsMutationSchema.ts
342
355
  import { mutationSchemaGenerator as mutationSchemaGenerator14 } from "roc-db";
343
- import { z as z19 } from "zod";
344
- var TestTransactionalEditsMutationSchema = mutationSchemaGenerator14("testTransactionalEdits", z19.object({
345
- name: z19.string().optional(),
356
+ import { z as z20 } from "zod";
357
+ var TestTransactionalEditsMutationSchema = mutationSchemaGenerator14("testTransactionalEdits", z20.object({
358
+ name: z20.string().optional(),
346
359
  post1ref: PostRefSchema.optional(),
347
360
  post2ref: PostRefSchema.optional()
348
361
  }).strict());
@@ -351,29 +364,29 @@ var TestTransactionalEditsMutationSchema = mutationSchemaGenerator14("testTransa
351
364
  import { expect } from "bun:test";
352
365
  var TestCreatePatchDeleteInSameTransaction = (txn, name) => {
353
366
  const postRef = txn.createRef("Post");
354
- QueryChain7(Query13(() => txn.createEntity(postRef, { data: { name } })), Query13(() => txn.patchEntity(postRef, { data: { foo: "bar" } })), Query13((post) => {
367
+ QueryChain8(Query14(() => txn.createEntity(postRef, { data: { name } })), Query14(() => txn.patchEntity(postRef, { data: { foo: "bar" } })), Query14((post) => {
355
368
  expect(post.data.name).toBe(name);
356
369
  expect(post.data.foo).toBe("bar");
357
- }), Query13(() => txn.patchEntity(postRef, { data: { foo: null, bar: "foo" } })), Query13((post) => {
370
+ }), Query14(() => txn.patchEntity(postRef, { data: { foo: null, bar: "foo" } })), Query14((post) => {
358
371
  expect(post.data.name).toBe(name);
359
372
  expect(post.data.foo).toBeUndefined();
360
373
  expect(post.data.bar).toBe("foo");
361
374
  expect(txn.log).toHaveLength(1);
362
375
  expect(txn.log.get(postRef)[0]).toBe("create");
363
- }), Query13((post) => txn.deleteEntity(postRef)), Query13((res) => {
376
+ }), Query14((post) => txn.deleteEntity(postRef)), Query14((res) => {
364
377
  expect(res).toBe(1);
365
378
  expect(txn.log).toHaveLength(0);
366
379
  }));
367
380
  };
368
381
  var TestUpdateAndDeleteInSameTransaction = (txn, ref) => {
369
- return QueryChain7(Query13(() => txn.patchEntity(ref, { data: { foo: "bar" } })), Query13((post) => {
382
+ return QueryChain8(Query14(() => txn.patchEntity(ref, { data: { foo: "bar" } })), Query14((post) => {
370
383
  expect(post.data.foo).toBe("bar");
371
- }), Query13(() => txn.patchEntity(ref, { data: { foo: null, bar: "foo" } })), Query13((post) => {
384
+ }), Query14(() => txn.patchEntity(ref, { data: { foo: null, bar: "foo" } })), Query14((post) => {
372
385
  expect(post.data.foo).toBeUndefined();
373
386
  expect(post.data.bar).toBe("foo");
374
387
  expect(txn.log).toHaveLength(1);
375
388
  expect(txn.log.get(ref)[0]).toBe("update");
376
- }), Query13((post) => txn.deleteEntity(ref)), Query13((res) => {
389
+ }), Query14((post) => txn.deleteEntity(ref)), Query14((res) => {
377
390
  expect(res).toBe(1);
378
391
  expect(txn.log).toHaveLength(1);
379
392
  expect(txn.log.get(ref)[0]).toBe("delete");
@@ -381,7 +394,7 @@ var TestUpdateAndDeleteInSameTransaction = (txn, ref) => {
381
394
  };
382
395
  var TestCreateOnExistingRef = (txn) => {
383
396
  const ref = txn.createRef("Post");
384
- return QueryChain7(Query13(() => txn.createEntity(ref, { data: { foo: "bar" } })), Query13(() => txn.createEntity(ref, { data: { foo: "bar" } })));
397
+ return QueryChain8(Query14(() => txn.createEntity(ref, { data: { foo: "bar" } })), Query14(() => txn.createEntity(ref, { data: { foo: "bar" } })));
385
398
  };
386
399
  var testTransactionalEdits = writeOperation11(TestTransactionalEditsMutationSchema, PostSchema, (txn) => {
387
400
  const { name, post1ref, post2ref } = txn.payload;
@@ -394,29 +407,29 @@ var testTransactionalEdits = writeOperation11(TestTransactionalEditsMutationSche
394
407
  }, {});
395
408
 
396
409
  // src/operations/updateBlockParagraph.ts
397
- import { Query as Query14, writeOperation as writeOperation12 } from "roc-db";
410
+ import { Query as Query15, writeOperation as writeOperation12 } from "roc-db";
398
411
 
399
412
  // src/schemas/UpdateBlockParagraphMutationSchema.ts
400
413
  import { mutationSchemaGenerator as mutationSchemaGenerator15 } from "roc-db";
401
- import { z as z20 } from "zod";
402
- var UpdateBlockParagraphMutationSchema = mutationSchemaGenerator15("updateBlockParagraph", z20.object({
414
+ import { z as z21 } from "zod";
415
+ var UpdateBlockParagraphMutationSchema = mutationSchemaGenerator15("updateBlockParagraph", z21.object({
403
416
  ref: BlockParagraphRefSchema,
404
- content: z20.string()
417
+ content: z21.string()
405
418
  }));
406
419
 
407
420
  // src/operations/updateBlockParagraph.ts
408
421
  var updateBlockParagraph = writeOperation12(UpdateBlockParagraphMutationSchema, BlockParagraphRefSchema, (txn) => {
409
422
  const { ref, content } = txn.payload;
410
- return Query14(() => txn.patchEntity(ref, {
423
+ return Query15(() => txn.patchEntity(ref, {
411
424
  data: { content }
412
425
  }));
413
426
  });
414
427
 
415
428
  // src/operations/updatePost.ts
416
- import { Query as Query15, writeOperation as writeOperation13 } from "roc-db";
429
+ import { Query as Query16, writeOperation as writeOperation13 } from "roc-db";
417
430
  var updatePost = writeOperation13(UpdatePostMutationSchema, PostSchema, (txn) => {
418
431
  const { ref, authorRef, ...data } = txn.payload;
419
- return Query15(() => txn.updateEntity(ref, {
432
+ return Query16(() => txn.updateEntity(ref, {
420
433
  data,
421
434
  parents: { author: authorRef },
422
435
  children: { blocks: [] }
@@ -424,24 +437,24 @@ var updatePost = writeOperation13(UpdatePostMutationSchema, PostSchema, (txn) =>
424
437
  });
425
438
 
426
439
  // src/operations/updatePostDescription.ts
427
- import { Query as Query16, writeOperation as writeOperation14 } from "roc-db";
440
+ import { Query as Query17, writeOperation as writeOperation14 } from "roc-db";
428
441
 
429
442
  // src/schemas/UpdatePostDescriptionMutationSchema.ts
430
443
  import { mutationSchemaGenerator as mutationSchemaGenerator16 } from "roc-db";
431
- import { z as z21 } from "zod";
432
- var UpdatePostDescriptionMutationSchema = mutationSchemaGenerator16("updatePostDescription", z21.object({ ref: PostRefSchema, description: z21.string() }));
444
+ import { z as z22 } from "zod";
445
+ var UpdatePostDescriptionMutationSchema = mutationSchemaGenerator16("updatePostDescription", z22.object({ ref: PostRefSchema, description: z22.string() }));
433
446
 
434
447
  // src/operations/updatePostDescription.ts
435
448
  var updatePostDescription = writeOperation14(UpdatePostDescriptionMutationSchema, PostSchema, (txn) => {
436
449
  const { ref, description } = txn.payload;
437
- return Query16(() => txn.patchEntity(ref, { data: { description } }));
450
+ return Query17(() => txn.patchEntity(ref, { data: { description } }));
438
451
  }, { debounce: 10, changeSetOnly: true });
439
452
 
440
453
  // src/operations/updatePostTitle.ts
441
- import { Query as Query17, writeOperation as writeOperation15 } from "roc-db";
454
+ import { Query as Query18, writeOperation as writeOperation15 } from "roc-db";
442
455
  var updatePostTitle = writeOperation15(UpdatePostTitleMutationSchema, PostSchema, (txn) => {
443
456
  const { ref, title } = txn.payload;
444
- return Query17(() => txn.patchEntity(ref, { data: { title } }));
457
+ return Query18(() => txn.patchEntity(ref, { data: { title } }));
445
458
  }, { debounce: 10 });
446
459
 
447
460
  // src/operations/index.ts
@@ -457,6 +470,7 @@ var operations = [
457
470
  deletePost,
458
471
  moveBlocks,
459
472
  readEntity,
473
+ readMutation,
460
474
  readPost,
461
475
  testTransactionalEdits,
462
476
  updateBlockParagraph,
@@ -466,7 +480,7 @@ var operations = [
466
480
  ];
467
481
  // src/testAdapterImplementation.ts
468
482
  import { beforeAll, describe, expect as expect2, test } from "bun:test";
469
- import { BadRequestError, NotFoundError as NotFoundError2, Snowflake } from "roc-db";
483
+ import { BadRequestError, NotFoundError as NotFoundError3, Snowflake } from "roc-db";
470
484
  var snowflake = new Snowflake(10, 10);
471
485
  var prepareChangeSetTest = async (adapter, adapter2) => {
472
486
  const [post, createPostMutation] = await adapter.createPost({
@@ -556,7 +570,7 @@ var testAdapterImplementation = async (adapterConstructor, generateArgs) => {
556
570
  expect2(readPostRes).toMatchZodSchema(PostSchema);
557
571
  });
558
572
  test("read not found (readEntity function)", async () => {
559
- expect2(() => adapter1.readPost("Post/999")).toThrow(NotFoundError2);
573
+ expect2(() => adapter1.readPost("Post/999")).toThrow(NotFoundError3);
560
574
  });
561
575
  test.todo("update (updateEntity function)", async () => {
562
576
  const [post2] = await adapter1.updatePost({
@@ -598,7 +612,7 @@ var testAdapterImplementation = async (adapterConstructor, generateArgs) => {
598
612
  expect2(mutation.log).toStrictEqual([
599
613
  [postRef, "delete", currentPost]
600
614
  ]);
601
- expect2(() => adapter1.readPost(postRef)).toThrow(NotFoundError2);
615
+ expect2(() => adapter1.readPost(postRef)).toThrow(NotFoundError3);
602
616
  });
603
617
  test("sync mutation", async () => {
604
618
  const [{ persistedAt, ...mutation }] = await adapter2.persistOptimisticMutations([createPostMutation]);
@@ -668,11 +682,11 @@ var testAdapterImplementation = async (adapterConstructor, generateArgs) => {
668
682
  [blockRow.ref, "delete", blockRowUpdated],
669
683
  [postRef, "delete", postUpdated]
670
684
  ]);
671
- await expect2(() => changeSetAdapter.readEntity(blockParagraph1.ref)).toThrow(NotFoundError2);
685
+ await expect2(() => changeSetAdapter.readEntity(blockParagraph1.ref)).toThrow(NotFoundError3);
672
686
  await expect2(() => changeSetAdapter.updateBlockParagraph({
673
687
  ref: blockParagraph1.ref,
674
688
  content: "Foo"
675
- })).toThrow(NotFoundError2);
689
+ })).toThrow(NotFoundError3);
676
690
  });
677
691
  test("pageMutations", async () => {
678
692
  const res = await changeSetAdapter.pageMutations({
@@ -752,7 +766,7 @@ var testAdapterImplementation = async (adapterConstructor, generateArgs) => {
752
766
  const optimisticAdapter = await createAdapter({ optimistic: true });
753
767
  expect2(persistedAdapter.persistOptimisticMutations).toBeDefined();
754
768
  expect2(optimisticAdapter.loadMutations).toBeDefined();
755
- const [, createPostMutation] = await optimisticAdapter.createPost({
769
+ const [post2, createPostMutation] = await optimisticAdapter.createPost({
756
770
  title: "Foo",
757
771
  tags: []
758
772
  });
@@ -760,6 +774,19 @@ var testAdapterImplementation = async (adapterConstructor, generateArgs) => {
760
774
  createPostMutation
761
775
  ]);
762
776
  expect2(persistCratePostMutation.persistedAt >= createPostMutation.timestamp).toBeTrue();
777
+ const readMutation2 = await persistedAdapter.readMutation(persistCratePostMutation.ref);
778
+ expect2(readMutation2).toStrictEqual(persistCratePostMutation);
779
+ const [draft2, createDraftMutation] = await optimisticAdapter.createDraft({
780
+ postRef: post2.ref
781
+ });
782
+ const [{ persistedAt, ...persistedCreateDraftMutation }] = await persistedAdapter.persistOptimisticMutations([
783
+ createDraftMutation
784
+ ]);
785
+ expect2(persistedCreateDraftMutation).toStrictEqual(createDraftMutation);
786
+ const changeSetAdapter2 = optimisticAdapter.changeSet(draft2.ref);
787
+ const [res] = await changeSetAdapter2.createBlockParagraph({
788
+ parentRef: post2.ref
789
+ });
763
790
  });
764
791
  });
765
792
  };
@@ -52,7 +52,7 @@ export declare const operations: readonly [import("roc-db").WriteOperation<strin
52
52
  debounceCount: number;
53
53
  name: string;
54
54
  payload?: any;
55
- }, any, any>, any, any, import("roc-db").WriteOperation<string, {
55
+ }, any, any>, any, any, any, import("roc-db").WriteOperation<string, {
56
56
  debounceCount: number;
57
57
  name: string;
58
58
  payload?: any;
@@ -0,0 +1 @@
1
+ export declare const readMutation: any;
@@ -7,7 +7,7 @@ export declare const ApplyDraftMutationSchema: z.ZodObject<z.objectUtil.extendSh
7
7
  log: z.ZodArray<z.ZodAny, "many">;
8
8
  debounceCount: z.ZodNumber;
9
9
  identityRef: z.ZodString;
10
- sessionRef: z.ZodOptional<z.ZodString>;
10
+ sessionRef: z.ZodOptional<z.ZodNullable<z.ZodString>>;
11
11
  persistedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
12
12
  }, {
13
13
  operation: z.ZodObject<{
@@ -43,7 +43,7 @@ export declare const ApplyDraftMutationSchema: z.ZodObject<z.objectUtil.extendSh
43
43
  name: "applyDraft";
44
44
  version: number;
45
45
  };
46
- sessionRef?: string | undefined;
46
+ sessionRef?: string | null | undefined;
47
47
  persistedAt?: string | null | undefined;
48
48
  }, {
49
49
  ref: `Mutation/${string}`;
@@ -59,6 +59,6 @@ export declare const ApplyDraftMutationSchema: z.ZodObject<z.objectUtil.extendSh
59
59
  name: "applyDraft";
60
60
  version?: number | undefined;
61
61
  };
62
- sessionRef?: string | undefined;
62
+ sessionRef?: string | null | undefined;
63
63
  persistedAt?: string | null | undefined;
64
64
  }>;
@@ -7,7 +7,7 @@ export declare const CreateBlockImageMutationSchema: z.ZodObject<z.objectUtil.ex
7
7
  log: z.ZodArray<z.ZodAny, "many">;
8
8
  debounceCount: z.ZodNumber;
9
9
  identityRef: z.ZodString;
10
- sessionRef: z.ZodOptional<z.ZodString>;
10
+ sessionRef: z.ZodOptional<z.ZodNullable<z.ZodString>>;
11
11
  persistedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
12
12
  }, {
13
13
  operation: z.ZodObject<{
@@ -43,7 +43,7 @@ export declare const CreateBlockImageMutationSchema: z.ZodObject<z.objectUtil.ex
43
43
  name: "createBlockImage";
44
44
  version: number;
45
45
  };
46
- sessionRef?: string | undefined;
46
+ sessionRef?: string | null | undefined;
47
47
  persistedAt?: string | null | undefined;
48
48
  }, {
49
49
  ref: `Mutation/${string}`;
@@ -59,6 +59,6 @@ export declare const CreateBlockImageMutationSchema: z.ZodObject<z.objectUtil.ex
59
59
  name: "createBlockImage";
60
60
  version?: number | undefined;
61
61
  };
62
- sessionRef?: string | undefined;
62
+ sessionRef?: string | null | undefined;
63
63
  persistedAt?: string | null | undefined;
64
64
  }>;
@@ -7,7 +7,7 @@ export declare const CreateBlockParagraphMutationSchema: z.ZodObject<z.objectUti
7
7
  log: z.ZodArray<z.ZodAny, "many">;
8
8
  debounceCount: z.ZodNumber;
9
9
  identityRef: z.ZodString;
10
- sessionRef: z.ZodOptional<z.ZodString>;
10
+ sessionRef: z.ZodOptional<z.ZodNullable<z.ZodString>>;
11
11
  persistedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
12
12
  }, {
13
13
  operation: z.ZodObject<{
@@ -43,7 +43,7 @@ export declare const CreateBlockParagraphMutationSchema: z.ZodObject<z.objectUti
43
43
  name: "createBlockParagraph";
44
44
  version: number;
45
45
  };
46
- sessionRef?: string | undefined;
46
+ sessionRef?: string | null | undefined;
47
47
  persistedAt?: string | null | undefined;
48
48
  }, {
49
49
  ref: `Mutation/${string}`;
@@ -59,6 +59,6 @@ export declare const CreateBlockParagraphMutationSchema: z.ZodObject<z.objectUti
59
59
  name: "createBlockParagraph";
60
60
  version?: number | undefined;
61
61
  };
62
- sessionRef?: string | undefined;
62
+ sessionRef?: string | null | undefined;
63
63
  persistedAt?: string | null | undefined;
64
64
  }>;
@@ -7,7 +7,7 @@ export declare const CreateBlockRowMutationSchema: z.ZodObject<z.objectUtil.exte
7
7
  log: z.ZodArray<z.ZodAny, "many">;
8
8
  debounceCount: z.ZodNumber;
9
9
  identityRef: z.ZodString;
10
- sessionRef: z.ZodOptional<z.ZodString>;
10
+ sessionRef: z.ZodOptional<z.ZodNullable<z.ZodString>>;
11
11
  persistedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
12
12
  }, {
13
13
  operation: z.ZodObject<{
@@ -43,7 +43,7 @@ export declare const CreateBlockRowMutationSchema: z.ZodObject<z.objectUtil.exte
43
43
  name: "createBlockRow";
44
44
  version: number;
45
45
  };
46
- sessionRef?: string | undefined;
46
+ sessionRef?: string | null | undefined;
47
47
  persistedAt?: string | null | undefined;
48
48
  }, {
49
49
  ref: `Mutation/${string}`;
@@ -59,6 +59,6 @@ export declare const CreateBlockRowMutationSchema: z.ZodObject<z.objectUtil.exte
59
59
  name: "createBlockRow";
60
60
  version?: number | undefined;
61
61
  };
62
- sessionRef?: string | undefined;
62
+ sessionRef?: string | null | undefined;
63
63
  persistedAt?: string | null | undefined;
64
64
  }>;
@@ -7,7 +7,7 @@ export declare const CreateBlockTitleMutationSchema: z.ZodObject<z.objectUtil.ex
7
7
  log: z.ZodArray<z.ZodAny, "many">;
8
8
  debounceCount: z.ZodNumber;
9
9
  identityRef: z.ZodString;
10
- sessionRef: z.ZodOptional<z.ZodString>;
10
+ sessionRef: z.ZodOptional<z.ZodNullable<z.ZodString>>;
11
11
  persistedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
12
12
  }, {
13
13
  operation: z.ZodObject<{
@@ -43,7 +43,7 @@ export declare const CreateBlockTitleMutationSchema: z.ZodObject<z.objectUtil.ex
43
43
  name: "createBlockTitle";
44
44
  version: number;
45
45
  };
46
- sessionRef?: string | undefined;
46
+ sessionRef?: string | null | undefined;
47
47
  persistedAt?: string | null | undefined;
48
48
  }, {
49
49
  ref: `Mutation/${string}`;
@@ -59,6 +59,6 @@ export declare const CreateBlockTitleMutationSchema: z.ZodObject<z.objectUtil.ex
59
59
  name: "createBlockTitle";
60
60
  version?: number | undefined;
61
61
  };
62
- sessionRef?: string | undefined;
62
+ sessionRef?: string | null | undefined;
63
63
  persistedAt?: string | null | undefined;
64
64
  }>;
@@ -7,7 +7,7 @@ export declare const CreateDraftMutationSchema: z.ZodObject<z.objectUtil.extendS
7
7
  log: z.ZodArray<z.ZodAny, "many">;
8
8
  debounceCount: z.ZodNumber;
9
9
  identityRef: z.ZodString;
10
- sessionRef: z.ZodOptional<z.ZodString>;
10
+ sessionRef: z.ZodOptional<z.ZodNullable<z.ZodString>>;
11
11
  persistedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
12
12
  }, {
13
13
  operation: z.ZodObject<{
@@ -43,7 +43,7 @@ export declare const CreateDraftMutationSchema: z.ZodObject<z.objectUtil.extendS
43
43
  name: "createDraft";
44
44
  version: number;
45
45
  };
46
- sessionRef?: string | undefined;
46
+ sessionRef?: string | null | undefined;
47
47
  persistedAt?: string | null | undefined;
48
48
  }, {
49
49
  ref: `Mutation/${string}`;
@@ -59,6 +59,6 @@ export declare const CreateDraftMutationSchema: z.ZodObject<z.objectUtil.extendS
59
59
  name: "createDraft";
60
60
  version?: number | undefined;
61
61
  };
62
- sessionRef?: string | undefined;
62
+ sessionRef?: string | null | undefined;
63
63
  persistedAt?: string | null | undefined;
64
64
  }>;
@@ -7,7 +7,7 @@ export declare const CreatePostMutationSchema: z.ZodObject<z.objectUtil.extendSh
7
7
  log: z.ZodArray<z.ZodAny, "many">;
8
8
  debounceCount: z.ZodNumber;
9
9
  identityRef: z.ZodString;
10
- sessionRef: z.ZodOptional<z.ZodString>;
10
+ sessionRef: z.ZodOptional<z.ZodNullable<z.ZodString>>;
11
11
  persistedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
12
12
  }, {
13
13
  operation: z.ZodObject<{
@@ -51,7 +51,7 @@ export declare const CreatePostMutationSchema: z.ZodObject<z.objectUtil.extendSh
51
51
  name: "createPost";
52
52
  version: number;
53
53
  };
54
- sessionRef?: string | undefined;
54
+ sessionRef?: string | null | undefined;
55
55
  persistedAt?: string | null | undefined;
56
56
  }, {
57
57
  ref: `Mutation/${string}`;
@@ -69,6 +69,6 @@ export declare const CreatePostMutationSchema: z.ZodObject<z.objectUtil.extendSh
69
69
  name: "createPost";
70
70
  version?: number | undefined;
71
71
  };
72
- sessionRef?: string | undefined;
72
+ sessionRef?: string | null | undefined;
73
73
  persistedAt?: string | null | undefined;
74
74
  }>;
@@ -7,7 +7,7 @@ export declare const CreateUserMutationSchema: z.ZodObject<z.objectUtil.extendSh
7
7
  log: z.ZodArray<z.ZodAny, "many">;
8
8
  debounceCount: z.ZodNumber;
9
9
  identityRef: z.ZodString;
10
- sessionRef: z.ZodOptional<z.ZodString>;
10
+ sessionRef: z.ZodOptional<z.ZodNullable<z.ZodString>>;
11
11
  persistedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
12
12
  }, {
13
13
  operation: z.ZodObject<{
@@ -43,7 +43,7 @@ export declare const CreateUserMutationSchema: z.ZodObject<z.objectUtil.extendSh
43
43
  name: "createUser";
44
44
  version: number;
45
45
  };
46
- sessionRef?: string | undefined;
46
+ sessionRef?: string | null | undefined;
47
47
  persistedAt?: string | null | undefined;
48
48
  }, {
49
49
  ref: `Mutation/${string}`;
@@ -59,6 +59,6 @@ export declare const CreateUserMutationSchema: z.ZodObject<z.objectUtil.extendSh
59
59
  name: "createUser";
60
60
  version?: number | undefined;
61
61
  };
62
- sessionRef?: string | undefined;
62
+ sessionRef?: string | null | undefined;
63
63
  persistedAt?: string | null | undefined;
64
64
  }>;
@@ -7,7 +7,7 @@ export declare const DeleteBlocksMutationSchema: z.ZodObject<z.objectUtil.extend
7
7
  log: z.ZodArray<z.ZodAny, "many">;
8
8
  debounceCount: z.ZodNumber;
9
9
  identityRef: z.ZodString;
10
- sessionRef: z.ZodOptional<z.ZodString>;
10
+ sessionRef: z.ZodOptional<z.ZodNullable<z.ZodString>>;
11
11
  persistedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
12
12
  }, {
13
13
  operation: z.ZodObject<{
@@ -35,7 +35,7 @@ export declare const DeleteBlocksMutationSchema: z.ZodObject<z.objectUtil.extend
35
35
  name: "deleteBlocks";
36
36
  version: number;
37
37
  };
38
- sessionRef?: string | undefined;
38
+ sessionRef?: string | null | undefined;
39
39
  persistedAt?: string | null | undefined;
40
40
  }, {
41
41
  ref: `Mutation/${string}`;
@@ -49,6 +49,6 @@ export declare const DeleteBlocksMutationSchema: z.ZodObject<z.objectUtil.extend
49
49
  name: "deleteBlocks";
50
50
  version?: number | undefined;
51
51
  };
52
- sessionRef?: string | undefined;
52
+ sessionRef?: string | null | undefined;
53
53
  persistedAt?: string | null | undefined;
54
54
  }>;
@@ -6,7 +6,7 @@ export declare const DeletePostMutationSchema: import("zod").ZodObject<import("z
6
6
  log: import("zod").ZodArray<import("zod").ZodAny, "many">;
7
7
  debounceCount: import("zod").ZodNumber;
8
8
  identityRef: import("zod").ZodString;
9
- sessionRef: import("zod").ZodOptional<import("zod").ZodString>;
9
+ sessionRef: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
10
10
  persistedAt: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
11
11
  }, {
12
12
  operation: import("zod").ZodObject<{
@@ -34,7 +34,7 @@ export declare const DeletePostMutationSchema: import("zod").ZodObject<import("z
34
34
  name: "deletePost";
35
35
  version: number;
36
36
  };
37
- sessionRef?: string | undefined;
37
+ sessionRef?: string | null | undefined;
38
38
  persistedAt?: string | null | undefined;
39
39
  }, {
40
40
  ref: `Mutation/${string}`;
@@ -48,6 +48,6 @@ export declare const DeletePostMutationSchema: import("zod").ZodObject<import("z
48
48
  name: "deletePost";
49
49
  version?: number | undefined;
50
50
  };
51
- sessionRef?: string | undefined;
51
+ sessionRef?: string | null | undefined;
52
52
  persistedAt?: string | null | undefined;
53
53
  }>;
@@ -7,7 +7,7 @@ export declare const MoveBlocksMutationSchema: z.ZodObject<z.objectUtil.extendSh
7
7
  log: z.ZodArray<z.ZodAny, "many">;
8
8
  debounceCount: z.ZodNumber;
9
9
  identityRef: z.ZodString;
10
- sessionRef: z.ZodOptional<z.ZodString>;
10
+ sessionRef: z.ZodOptional<z.ZodNullable<z.ZodString>>;
11
11
  persistedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
12
12
  }, {
13
13
  operation: z.ZodObject<{
@@ -47,7 +47,7 @@ export declare const MoveBlocksMutationSchema: z.ZodObject<z.objectUtil.extendSh
47
47
  name: "moveBlocks";
48
48
  version: number;
49
49
  };
50
- sessionRef?: string | undefined;
50
+ sessionRef?: string | null | undefined;
51
51
  persistedAt?: string | null | undefined;
52
52
  }, {
53
53
  ref: `Mutation/${string}`;
@@ -64,6 +64,6 @@ export declare const MoveBlocksMutationSchema: z.ZodObject<z.objectUtil.extendSh
64
64
  name: "moveBlocks";
65
65
  version?: number | undefined;
66
66
  };
67
- sessionRef?: string | undefined;
67
+ sessionRef?: string | null | undefined;
68
68
  persistedAt?: string | null | undefined;
69
69
  }>;
@@ -7,7 +7,7 @@ export declare const TestTransactionalEditsMutationSchema: z.ZodObject<z.objectU
7
7
  log: z.ZodArray<z.ZodAny, "many">;
8
8
  debounceCount: z.ZodNumber;
9
9
  identityRef: z.ZodString;
10
- sessionRef: z.ZodOptional<z.ZodString>;
10
+ sessionRef: z.ZodOptional<z.ZodNullable<z.ZodString>>;
11
11
  persistedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
12
12
  }, {
13
13
  operation: z.ZodObject<{
@@ -51,7 +51,7 @@ export declare const TestTransactionalEditsMutationSchema: z.ZodObject<z.objectU
51
51
  name: "testTransactionalEdits";
52
52
  version: number;
53
53
  };
54
- sessionRef?: string | undefined;
54
+ sessionRef?: string | null | undefined;
55
55
  persistedAt?: string | null | undefined;
56
56
  }, {
57
57
  ref: `Mutation/${string}`;
@@ -69,6 +69,6 @@ export declare const TestTransactionalEditsMutationSchema: z.ZodObject<z.objectU
69
69
  name: "testTransactionalEdits";
70
70
  version?: number | undefined;
71
71
  };
72
- sessionRef?: string | undefined;
72
+ sessionRef?: string | null | undefined;
73
73
  persistedAt?: string | null | undefined;
74
74
  }>;
@@ -7,7 +7,7 @@ export declare const UpdateBlockParagraphMutationSchema: z.ZodObject<z.objectUti
7
7
  log: z.ZodArray<z.ZodAny, "many">;
8
8
  debounceCount: z.ZodNumber;
9
9
  identityRef: z.ZodString;
10
- sessionRef: z.ZodOptional<z.ZodString>;
10
+ sessionRef: z.ZodOptional<z.ZodNullable<z.ZodString>>;
11
11
  persistedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
12
12
  }, {
13
13
  operation: z.ZodObject<{
@@ -47,7 +47,7 @@ export declare const UpdateBlockParagraphMutationSchema: z.ZodObject<z.objectUti
47
47
  name: "updateBlockParagraph";
48
48
  version: number;
49
49
  };
50
- sessionRef?: string | undefined;
50
+ sessionRef?: string | null | undefined;
51
51
  persistedAt?: string | null | undefined;
52
52
  }, {
53
53
  ref: `Mutation/${string}`;
@@ -64,6 +64,6 @@ export declare const UpdateBlockParagraphMutationSchema: z.ZodObject<z.objectUti
64
64
  name: "updateBlockParagraph";
65
65
  version?: number | undefined;
66
66
  };
67
- sessionRef?: string | undefined;
67
+ sessionRef?: string | null | undefined;
68
68
  persistedAt?: string | null | undefined;
69
69
  }>;
@@ -7,7 +7,7 @@ export declare const UpdatePostDescriptionMutationSchema: z.ZodObject<z.objectUt
7
7
  log: z.ZodArray<z.ZodAny, "many">;
8
8
  debounceCount: z.ZodNumber;
9
9
  identityRef: z.ZodString;
10
- sessionRef: z.ZodOptional<z.ZodString>;
10
+ sessionRef: z.ZodOptional<z.ZodNullable<z.ZodString>>;
11
11
  persistedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
12
12
  }, {
13
13
  operation: z.ZodObject<{
@@ -47,7 +47,7 @@ export declare const UpdatePostDescriptionMutationSchema: z.ZodObject<z.objectUt
47
47
  name: "updatePostDescription";
48
48
  version: number;
49
49
  };
50
- sessionRef?: string | undefined;
50
+ sessionRef?: string | null | undefined;
51
51
  persistedAt?: string | null | undefined;
52
52
  }, {
53
53
  ref: `Mutation/${string}`;
@@ -64,6 +64,6 @@ export declare const UpdatePostDescriptionMutationSchema: z.ZodObject<z.objectUt
64
64
  name: "updatePostDescription";
65
65
  version?: number | undefined;
66
66
  };
67
- sessionRef?: string | undefined;
67
+ sessionRef?: string | null | undefined;
68
68
  persistedAt?: string | null | undefined;
69
69
  }>;
@@ -7,7 +7,7 @@ export declare const UpdatePostMutationSchema: z.ZodObject<z.objectUtil.extendSh
7
7
  log: z.ZodArray<z.ZodAny, "many">;
8
8
  debounceCount: z.ZodNumber;
9
9
  identityRef: z.ZodString;
10
- sessionRef: z.ZodOptional<z.ZodString>;
10
+ sessionRef: z.ZodOptional<z.ZodNullable<z.ZodString>>;
11
11
  persistedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
12
12
  }, {
13
13
  operation: z.ZodObject<{
@@ -55,7 +55,7 @@ export declare const UpdatePostMutationSchema: z.ZodObject<z.objectUtil.extendSh
55
55
  name: "updatePost";
56
56
  version: number;
57
57
  };
58
- sessionRef?: string | undefined;
58
+ sessionRef?: string | null | undefined;
59
59
  persistedAt?: string | null | undefined;
60
60
  }, {
61
61
  ref: `Mutation/${string}`;
@@ -74,6 +74,6 @@ export declare const UpdatePostMutationSchema: z.ZodObject<z.objectUtil.extendSh
74
74
  name: "updatePost";
75
75
  version?: number | undefined;
76
76
  };
77
- sessionRef?: string | undefined;
77
+ sessionRef?: string | null | undefined;
78
78
  persistedAt?: string | null | undefined;
79
79
  }>;
@@ -7,7 +7,7 @@ export declare const UpdatePostTitleMutationSchema: z.ZodObject<z.objectUtil.ext
7
7
  log: z.ZodArray<z.ZodAny, "many">;
8
8
  debounceCount: z.ZodNumber;
9
9
  identityRef: z.ZodString;
10
- sessionRef: z.ZodOptional<z.ZodString>;
10
+ sessionRef: z.ZodOptional<z.ZodNullable<z.ZodString>>;
11
11
  persistedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
12
12
  }, {
13
13
  operation: z.ZodObject<{
@@ -47,7 +47,7 @@ export declare const UpdatePostTitleMutationSchema: z.ZodObject<z.objectUtil.ext
47
47
  name: "updatePostTitle";
48
48
  version: number;
49
49
  };
50
- sessionRef?: string | undefined;
50
+ sessionRef?: string | null | undefined;
51
51
  persistedAt?: string | null | undefined;
52
52
  }, {
53
53
  ref: `Mutation/${string}`;
@@ -64,6 +64,6 @@ export declare const UpdatePostTitleMutationSchema: z.ZodObject<z.objectUtil.ext
64
64
  name: "updatePostTitle";
65
65
  version?: number | undefined;
66
66
  };
67
- sessionRef?: string | undefined;
67
+ sessionRef?: string | null | undefined;
68
68
  persistedAt?: string | null | undefined;
69
69
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roc-db/test-utils",
3
- "version": "0.2.0-pre.41",
3
+ "version": "0.2.0-pre.43",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -17,7 +17,7 @@
17
17
  ],
18
18
  "sideEffects": false,
19
19
  "peerDependencies": {
20
- "roc-db": "0.2.0-pre.41",
20
+ "roc-db": "0.2.0-pre.43",
21
21
  "zod": "3.24.2"
22
22
  },
23
23
  "keywords": [],