@roc-db/test-utils 0.2.0-pre.1 → 0.2.0-pre.10
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 +98 -30
- package/dist/types/inMemoryAdapter.d.ts +1 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/operations/createBlockImage.d.ts +15 -0
- package/dist/types/operations/createBlockParagraph.d.ts +15 -0
- package/dist/types/operations/createBlockRow.d.ts +15 -0
- package/dist/types/operations/createBlockTitle.d.ts +15 -0
- package/dist/types/operations/createDraft.d.ts +15 -0
- package/dist/types/operations/createPost.d.ts +19 -0
- package/dist/types/operations/deleteBlock.d.ts +11 -0
- package/dist/types/operations/deletePost.d.ts +9 -0
- package/dist/types/operations/index.d.ts +157 -0
- package/dist/types/operations/readEntity.d.ts +1 -0
- package/dist/types/operations/readPost.d.ts +1 -0
- package/dist/types/operations/updateBlockParagraph.d.ts +15 -0
- package/dist/types/operations/updatePost.d.ts +21 -0
- package/dist/types/operations/updatePostTitle.d.ts +17 -0
- package/dist/types/schemas/BlockImageRefSchema.d.ts +1 -0
- package/dist/types/schemas/BlockImageSchema.d.ts +32 -0
- package/dist/types/schemas/BlockParagraphRefSchema.d.ts +1 -0
- package/dist/types/schemas/BlockParagraphSchema.d.ts +33 -0
- package/dist/types/schemas/BlockRefSchema.d.ts +2 -0
- package/dist/types/schemas/BlockRowRefSchema.d.ts +1 -0
- package/dist/types/schemas/BlockRowSchema.d.ts +33 -0
- package/dist/types/schemas/BlockTitleRefSchema.d.ts +1 -0
- package/dist/types/schemas/BlockTitleSchema.d.ts +32 -0
- package/dist/types/schemas/CreateBlockImageMutationSchema.d.ts +40 -0
- package/dist/types/schemas/CreateBlockParagraphMutationSchema.d.ts +40 -0
- package/dist/types/schemas/CreateBlockRowMutationSchema.d.ts +40 -0
- package/dist/types/schemas/CreateBlockTitleMutationSchema.d.ts +40 -0
- package/dist/types/schemas/CreateDraftMutationSchema.d.ts +40 -0
- package/dist/types/schemas/CreatePostMutationSchema.d.ts +50 -0
- package/dist/types/schemas/CreateUserMutationSchema.d.ts +40 -0
- package/dist/types/schemas/DeleteBlockMutationSchema.d.ts +30 -0
- package/dist/types/schemas/DeletePostMutationSchema.d.ts +29 -0
- package/dist/types/schemas/DraftRefSchema.d.ts +1 -0
- package/dist/types/schemas/DraftSchema.d.ts +32 -0
- package/dist/types/schemas/PostRefSchema.d.ts +1 -0
- package/dist/types/schemas/PostSchema.d.ts +33 -0
- package/dist/types/schemas/UpdateBlockParagraphMutationSchema.d.ts +45 -0
- package/dist/types/schemas/UpdatePostMutationSchema.d.ts +55 -0
- package/dist/types/schemas/UpdatePostTitleMutationSchema.d.ts +45 -0
- package/dist/types/schemas/UserRefSchema.d.ts +1 -0
- package/dist/types/schemas/index.d.ts +44 -0
- package/dist/types/testAdapterImplementation.d.ts +1 -0
- package/package.json +10 -17
- package/dist/roc-db-test-utils-0.2.0-pre.1.tgz +0 -0
package/dist/index.js
CHANGED
|
@@ -179,7 +179,6 @@ var createBlockRow = writeOperation3(CreateBlockRowMutationSchema, BlockParagrap
|
|
|
179
179
|
const ref = txn.createRef("BlockRow");
|
|
180
180
|
const { parentRef } = txn.payload;
|
|
181
181
|
return QueryChain2(Query3(() => txn.readEntity(parentRef)), Query3((parent) => {
|
|
182
|
-
console.log("asdfasfd", parent);
|
|
183
182
|
return txn.patchEntity(parentRef, {
|
|
184
183
|
children: { blocks: [...parent.children.blocks, ref] }
|
|
185
184
|
});
|
|
@@ -344,7 +343,7 @@ var operations = [
|
|
|
344
343
|
];
|
|
345
344
|
// src/testAdapterImplementation.ts
|
|
346
345
|
import { beforeAll, describe, expect, test } from "bun:test";
|
|
347
|
-
import { NotFoundError as NotFoundError2 } from "roc-db";
|
|
346
|
+
import { BadRequestError, NotFoundError as NotFoundError2 } from "roc-db";
|
|
348
347
|
var prepareChangeSetTest = async (adapter) => {
|
|
349
348
|
const [post] = await adapter.createPost({
|
|
350
349
|
title: "Title 1",
|
|
@@ -378,54 +377,123 @@ var testAdapterImplementation = (adapterConstructor, engineArgsAdapter1 = {}, en
|
|
|
378
377
|
return async () => {
|
|
379
378
|
const adapter1 = adapterConstructor({ operations, entities, ...engineArgsAdapter1 });
|
|
380
379
|
const adapter2 = adapterConstructor({ operations, entities, ...engineArgsAdapter2 });
|
|
380
|
+
describe("Post CRUD", async () => {
|
|
381
|
+
let postRef;
|
|
382
|
+
let post;
|
|
383
|
+
let createPostMutation;
|
|
384
|
+
beforeAll(async () => {
|
|
385
|
+
const createPostRes = await adapter1.createPost({
|
|
386
|
+
title: "Title 1",
|
|
387
|
+
slug: "title-1",
|
|
388
|
+
tags: ["Foo", "Bar"]
|
|
389
|
+
});
|
|
390
|
+
post = createPostRes[0];
|
|
391
|
+
postRef = createPostRes[0].ref;
|
|
392
|
+
createPostMutation = createPostRes[1];
|
|
393
|
+
});
|
|
394
|
+
test("create (createEntity function)", async () => {
|
|
395
|
+
expect(post).toMatchZodSchema(PostSchema);
|
|
396
|
+
expect(post.data.title).toBe("Title 1");
|
|
397
|
+
expect(post.data.tags).toStrictEqual(["Foo", "Bar"]);
|
|
398
|
+
});
|
|
399
|
+
test("read (readEntity function)", async () => {
|
|
400
|
+
const readPostRes = await adapter1.readPost(postRef);
|
|
401
|
+
expect(readPostRes.data.title).toStrictEqual("Title 1");
|
|
402
|
+
expect(readPostRes.data.tags).toStrictEqual(["Foo", "Bar"]);
|
|
403
|
+
expect(readPostRes).toMatchZodSchema(PostSchema);
|
|
404
|
+
});
|
|
405
|
+
test("update (updateEntity function)", async () => {
|
|
406
|
+
const [post2] = await adapter1.updatePost({
|
|
407
|
+
ref: postRef,
|
|
408
|
+
title: "Title 2",
|
|
409
|
+
tags: ["Foo"]
|
|
410
|
+
});
|
|
411
|
+
expect(post2.data.tags).toStrictEqual(["Foo"]);
|
|
412
|
+
expect(post2.data.title).toBe("Title 2");
|
|
413
|
+
expect(post2).toMatchZodSchema(PostSchema);
|
|
414
|
+
});
|
|
415
|
+
test("updateTitle (patchEntity function + debounce)", async () => {
|
|
416
|
+
const updatePostTitleRes1 = await adapter1.updatePostTitle({
|
|
417
|
+
ref: postRef,
|
|
418
|
+
title: "Title 3"
|
|
419
|
+
});
|
|
420
|
+
expect(updatePostTitleRes1[0]).toMatchZodSchema(PostSchema);
|
|
421
|
+
const updatePostTitleRes2 = await adapter1.updatePostTitle({
|
|
422
|
+
ref: postRef,
|
|
423
|
+
title: "Title 4"
|
|
424
|
+
});
|
|
425
|
+
expect(updatePostTitleRes2[0]).toMatchZodSchema(PostSchema);
|
|
426
|
+
expect(updatePostTitleRes2[1].ref).toBe(updatePostTitleRes1[1].ref);
|
|
427
|
+
expect(updatePostTitleRes2[1].timestamp >= updatePostTitleRes1[1].timestamp).toBeTrue();
|
|
428
|
+
});
|
|
429
|
+
test("delete (deleteEntity function)", async () => {
|
|
430
|
+
const [count, mutation] = await adapter1.deletePost(postRef);
|
|
431
|
+
expect(count).toBe(1);
|
|
432
|
+
expect(mutation.log).toStrictEqual([[postRef, "delete", null]]);
|
|
433
|
+
});
|
|
434
|
+
test("sync mutation", async () => {
|
|
435
|
+
const res = await adapter2.syncOptimisticMutation(createPostMutation);
|
|
436
|
+
expect(res[0]).toStrictEqual(post);
|
|
437
|
+
expect(res[1]).toStrictEqual(createPostMutation);
|
|
438
|
+
expect(() => adapter2.syncOptimisticMutation(createPostMutation)).toThrowError(BadRequestError);
|
|
439
|
+
});
|
|
440
|
+
});
|
|
381
441
|
describe("changeSet", async () => {
|
|
382
|
-
let postRef, draftRef, changeSetAdapter,
|
|
442
|
+
let postRef, draftRef, changeSetAdapter, blockParagraph1, post, blockRow, blockParagraph2;
|
|
383
443
|
beforeAll(async () => {
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
444
|
+
({
|
|
445
|
+
postRef,
|
|
446
|
+
draftRef,
|
|
447
|
+
changeSetAdapter,
|
|
448
|
+
blockParagraph1,
|
|
449
|
+
post,
|
|
450
|
+
blockRow,
|
|
451
|
+
blockParagraph2
|
|
452
|
+
} = await prepareChangeSetTest(adapter1));
|
|
392
453
|
});
|
|
393
454
|
test("create (createEntity function w/changeSetRef)", async () => {
|
|
394
|
-
expect(
|
|
455
|
+
expect(blockParagraph1).toMatchZodSchema(BlockParagraphSchema);
|
|
395
456
|
expect(post).toMatchZodSchema(PostSchema);
|
|
396
457
|
});
|
|
397
458
|
test("read (readEntity function w/changeSetRef)", async () => {
|
|
398
|
-
const read = await changeSetAdapter.readEntity(
|
|
459
|
+
const read = await changeSetAdapter.readEntity(blockParagraph1.ref);
|
|
399
460
|
expect(read).toMatchZodSchema(BlockParagraphSchema);
|
|
400
461
|
});
|
|
462
|
+
test("update (patchEntity function w/changeSetRef)", async () => {
|
|
463
|
+
const [updatedBlock] = await changeSetAdapter.updateBlockParagraph({
|
|
464
|
+
ref: blockParagraph1.ref,
|
|
465
|
+
content: "Hello, world!"
|
|
466
|
+
});
|
|
467
|
+
expect(updatedBlock).toMatchZodSchema(BlockParagraphSchema);
|
|
468
|
+
});
|
|
401
469
|
test("delete (with cascade delete)", async () => {
|
|
402
470
|
const [count, mutation] = await changeSetAdapter.deletePost(postRef);
|
|
403
471
|
expect(count).toBe(4);
|
|
404
472
|
expect(mutation.log).toStrictEqual([
|
|
405
|
-
[
|
|
473
|
+
[blockParagraph1.ref, "delete", draftRef],
|
|
406
474
|
[blockRow.ref, "delete", draftRef],
|
|
407
475
|
[blockParagraph2.ref, "delete", draftRef],
|
|
408
476
|
[postRef, "delete", draftRef]
|
|
409
477
|
]);
|
|
478
|
+
await expect(() => changeSetAdapter.readEntity(blockParagraph1.ref)).toThrow(NotFoundError2);
|
|
479
|
+
await expect(() => changeSetAdapter.updateBlockParagraph({
|
|
480
|
+
ref: blockParagraph1.ref,
|
|
481
|
+
content: "Foo"
|
|
482
|
+
})).toThrow(NotFoundError2);
|
|
410
483
|
});
|
|
411
|
-
test("
|
|
412
|
-
const
|
|
413
|
-
|
|
414
|
-
content: "Hello, world!"
|
|
484
|
+
test("pageMutations", async () => {
|
|
485
|
+
const res = await changeSetAdapter.pageMutations({
|
|
486
|
+
changeSetRef: draftRef
|
|
415
487
|
});
|
|
416
|
-
expect(
|
|
488
|
+
expect(res.length).toBeGreaterThan(0);
|
|
489
|
+
expect(res.every((m) => m.changeSetRef === draftRef)).toBeTrue();
|
|
417
490
|
});
|
|
418
|
-
test
|
|
419
|
-
const
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
expect(() => changeSetAdapter.readEntity(block.ref)).toThrow(NotFoundError2);
|
|
425
|
-
expect(() => changeSetAdapter.updateBlockParagraph({
|
|
426
|
-
ref: block.ref,
|
|
427
|
-
content: "Foo"
|
|
428
|
-
})).toThrow(NotFoundError2);
|
|
491
|
+
test("pageMutations2", async () => {
|
|
492
|
+
const res = await changeSetAdapter.pageMutations({
|
|
493
|
+
changeSetRef: draftRef
|
|
494
|
+
});
|
|
495
|
+
expect(res.length).toBeGreaterThan(0);
|
|
496
|
+
expect(res.every((m) => m.changeSetRef === draftRef)).toBeTrue();
|
|
429
497
|
});
|
|
430
498
|
});
|
|
431
499
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const inMemoryAdapter: any;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const createBlockImage: import("roc-db").WriteOperation<"createBlockImage", {
|
|
2
|
+
ref: `Mutation/${string}`;
|
|
3
|
+
timestamp: string;
|
|
4
|
+
changeSetRef: null;
|
|
5
|
+
payload: {
|
|
6
|
+
postRef: `Post/${string}`;
|
|
7
|
+
};
|
|
8
|
+
log: [never, string, null][];
|
|
9
|
+
debounceCount: number;
|
|
10
|
+
name: "createBlockImage";
|
|
11
|
+
}, {
|
|
12
|
+
postRef: `Post/${string}`;
|
|
13
|
+
}, {
|
|
14
|
+
[x: string]: any;
|
|
15
|
+
}>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const createBlockParagrah: import("roc-db").WriteOperation<"createBlockParagraph", {
|
|
2
|
+
ref: `Mutation/${string}`;
|
|
3
|
+
timestamp: string;
|
|
4
|
+
changeSetRef: null;
|
|
5
|
+
payload: {
|
|
6
|
+
parentRef: `Post/${string}` | `BlockRow/${string}`;
|
|
7
|
+
};
|
|
8
|
+
log: [never, string, null][];
|
|
9
|
+
debounceCount: number;
|
|
10
|
+
name: "createBlockParagraph";
|
|
11
|
+
}, {
|
|
12
|
+
parentRef: `Post/${string}` | `BlockRow/${string}`;
|
|
13
|
+
}, {
|
|
14
|
+
[x: string]: any;
|
|
15
|
+
}>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const createBlockRow: import("roc-db").WriteOperation<"createBlockRow", {
|
|
2
|
+
ref: `Mutation/${string}`;
|
|
3
|
+
timestamp: string;
|
|
4
|
+
changeSetRef: null;
|
|
5
|
+
payload: {
|
|
6
|
+
parentRef: `Post/${string}` | `BlockRow/${string}`;
|
|
7
|
+
};
|
|
8
|
+
log: [never, string, null][];
|
|
9
|
+
debounceCount: number;
|
|
10
|
+
name: "createBlockRow";
|
|
11
|
+
}, {
|
|
12
|
+
parentRef: `Post/${string}` | `BlockRow/${string}`;
|
|
13
|
+
}, {
|
|
14
|
+
[x: string]: any;
|
|
15
|
+
}>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const createBlockTitle: import("roc-db").WriteOperation<"createBlockTitle", {
|
|
2
|
+
ref: `Mutation/${string}`;
|
|
3
|
+
timestamp: string;
|
|
4
|
+
changeSetRef: null;
|
|
5
|
+
payload: {
|
|
6
|
+
parentRef: `Post/${string}` | `BlockRow/${string}`;
|
|
7
|
+
};
|
|
8
|
+
log: [never, string, null][];
|
|
9
|
+
debounceCount: number;
|
|
10
|
+
name: "createBlockTitle";
|
|
11
|
+
}, {
|
|
12
|
+
parentRef: `Post/${string}` | `BlockRow/${string}`;
|
|
13
|
+
}, {
|
|
14
|
+
[x: string]: any;
|
|
15
|
+
}>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const createDraft: import("roc-db").WriteOperation<"createDraft", {
|
|
2
|
+
ref: `Mutation/${string}`;
|
|
3
|
+
timestamp: string;
|
|
4
|
+
changeSetRef: null;
|
|
5
|
+
payload: {
|
|
6
|
+
postRef: `Post/${string}`;
|
|
7
|
+
};
|
|
8
|
+
log: [never, string, null][];
|
|
9
|
+
debounceCount: number;
|
|
10
|
+
name: "createDraft";
|
|
11
|
+
}, {
|
|
12
|
+
postRef: `Post/${string}`;
|
|
13
|
+
}, {
|
|
14
|
+
[x: string]: any;
|
|
15
|
+
}>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const createPost: import("roc-db").WriteOperation<"createPost", {
|
|
2
|
+
ref: `Mutation/${string}`;
|
|
3
|
+
timestamp: string;
|
|
4
|
+
changeSetRef: null;
|
|
5
|
+
payload: {
|
|
6
|
+
title: string;
|
|
7
|
+
tags: string[];
|
|
8
|
+
slug?: string | undefined;
|
|
9
|
+
};
|
|
10
|
+
log: [never, string, null][];
|
|
11
|
+
debounceCount: number;
|
|
12
|
+
name: "createPost";
|
|
13
|
+
}, {
|
|
14
|
+
title: string;
|
|
15
|
+
tags: string[];
|
|
16
|
+
slug?: string | undefined;
|
|
17
|
+
}, {
|
|
18
|
+
[x: string]: any;
|
|
19
|
+
}>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const deleteBlock: import("roc-db").WriteOperation<"deleteBlock", {
|
|
2
|
+
ref: `Mutation/${string}`;
|
|
3
|
+
timestamp: string;
|
|
4
|
+
changeSetRef: null;
|
|
5
|
+
payload: `BlockImage/${string}` | `BlockParagraph/${string}`;
|
|
6
|
+
log: [never, string, null][];
|
|
7
|
+
debounceCount: number;
|
|
8
|
+
name: "deleteBlock";
|
|
9
|
+
}, `BlockImage/${string}` | `BlockParagraph/${string}`, {
|
|
10
|
+
[x: string]: any;
|
|
11
|
+
}>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const deletePost: import("roc-db").WriteOperation<"deletePost", {
|
|
2
|
+
ref: `Mutation/${string}`;
|
|
3
|
+
timestamp: string;
|
|
4
|
+
changeSetRef: null;
|
|
5
|
+
payload: `Post/${string}`;
|
|
6
|
+
log: [never, string, null][];
|
|
7
|
+
debounceCount: number;
|
|
8
|
+
name: "deletePost";
|
|
9
|
+
}, `Post/${string}`, any>;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
export declare const operations: readonly [import("roc-db").WriteOperation<"createBlockImage", {
|
|
2
|
+
ref: `Mutation/${string}`;
|
|
3
|
+
timestamp: string;
|
|
4
|
+
changeSetRef: null;
|
|
5
|
+
payload: {
|
|
6
|
+
postRef: `Post/${string}`;
|
|
7
|
+
};
|
|
8
|
+
log: [never, string, null][];
|
|
9
|
+
debounceCount: number;
|
|
10
|
+
name: "createBlockImage";
|
|
11
|
+
}, {
|
|
12
|
+
postRef: `Post/${string}`;
|
|
13
|
+
}, {
|
|
14
|
+
[x: string]: any;
|
|
15
|
+
}>, import("roc-db").WriteOperation<"createBlockTitle", {
|
|
16
|
+
ref: `Mutation/${string}`;
|
|
17
|
+
timestamp: string;
|
|
18
|
+
changeSetRef: null;
|
|
19
|
+
payload: {
|
|
20
|
+
parentRef: `Post/${string}` | `BlockRow/${string}`;
|
|
21
|
+
};
|
|
22
|
+
log: [never, string, null][];
|
|
23
|
+
debounceCount: number;
|
|
24
|
+
name: "createBlockTitle";
|
|
25
|
+
}, {
|
|
26
|
+
parentRef: `Post/${string}` | `BlockRow/${string}`;
|
|
27
|
+
}, {
|
|
28
|
+
[x: string]: any;
|
|
29
|
+
}>, import("roc-db").WriteOperation<"createBlockParagraph", {
|
|
30
|
+
ref: `Mutation/${string}`;
|
|
31
|
+
timestamp: string;
|
|
32
|
+
changeSetRef: null;
|
|
33
|
+
payload: {
|
|
34
|
+
parentRef: `Post/${string}` | `BlockRow/${string}`;
|
|
35
|
+
};
|
|
36
|
+
log: [never, string, null][];
|
|
37
|
+
debounceCount: number;
|
|
38
|
+
name: "createBlockParagraph";
|
|
39
|
+
}, {
|
|
40
|
+
parentRef: `Post/${string}` | `BlockRow/${string}`;
|
|
41
|
+
}, {
|
|
42
|
+
[x: string]: any;
|
|
43
|
+
}>, import("roc-db").WriteOperation<"createBlockRow", {
|
|
44
|
+
ref: `Mutation/${string}`;
|
|
45
|
+
timestamp: string;
|
|
46
|
+
changeSetRef: null;
|
|
47
|
+
payload: {
|
|
48
|
+
parentRef: `Post/${string}` | `BlockRow/${string}`;
|
|
49
|
+
};
|
|
50
|
+
log: [never, string, null][];
|
|
51
|
+
debounceCount: number;
|
|
52
|
+
name: "createBlockRow";
|
|
53
|
+
}, {
|
|
54
|
+
parentRef: `Post/${string}` | `BlockRow/${string}`;
|
|
55
|
+
}, {
|
|
56
|
+
[x: string]: any;
|
|
57
|
+
}>, import("roc-db").WriteOperation<"createDraft", {
|
|
58
|
+
ref: `Mutation/${string}`;
|
|
59
|
+
timestamp: string;
|
|
60
|
+
changeSetRef: null;
|
|
61
|
+
payload: {
|
|
62
|
+
postRef: `Post/${string}`;
|
|
63
|
+
};
|
|
64
|
+
log: [never, string, null][];
|
|
65
|
+
debounceCount: number;
|
|
66
|
+
name: "createDraft";
|
|
67
|
+
}, {
|
|
68
|
+
postRef: `Post/${string}`;
|
|
69
|
+
}, {
|
|
70
|
+
[x: string]: any;
|
|
71
|
+
}>, import("roc-db").WriteOperation<"createPost", {
|
|
72
|
+
ref: `Mutation/${string}`;
|
|
73
|
+
timestamp: string;
|
|
74
|
+
changeSetRef: null;
|
|
75
|
+
payload: {
|
|
76
|
+
title: string;
|
|
77
|
+
tags: string[];
|
|
78
|
+
slug?: string | undefined;
|
|
79
|
+
};
|
|
80
|
+
log: [never, string, null][];
|
|
81
|
+
debounceCount: number;
|
|
82
|
+
name: "createPost";
|
|
83
|
+
}, {
|
|
84
|
+
title: string;
|
|
85
|
+
tags: string[];
|
|
86
|
+
slug?: string | undefined;
|
|
87
|
+
}, {
|
|
88
|
+
[x: string]: any;
|
|
89
|
+
}>, import("roc-db").WriteOperation<"deleteBlock", {
|
|
90
|
+
ref: `Mutation/${string}`;
|
|
91
|
+
timestamp: string;
|
|
92
|
+
changeSetRef: null;
|
|
93
|
+
payload: `BlockImage/${string}` | `BlockParagraph/${string}`;
|
|
94
|
+
log: [never, string, null][];
|
|
95
|
+
debounceCount: number;
|
|
96
|
+
name: "deleteBlock";
|
|
97
|
+
}, `BlockImage/${string}` | `BlockParagraph/${string}`, {
|
|
98
|
+
[x: string]: any;
|
|
99
|
+
}>, import("roc-db").WriteOperation<"deletePost", {
|
|
100
|
+
ref: `Mutation/${string}`;
|
|
101
|
+
timestamp: string;
|
|
102
|
+
changeSetRef: null;
|
|
103
|
+
payload: `Post/${string}`;
|
|
104
|
+
log: [never, string, null][];
|
|
105
|
+
debounceCount: number;
|
|
106
|
+
name: "deletePost";
|
|
107
|
+
}, `Post/${string}`, any>, any, any, import("roc-db").WriteOperation<"updateBlockParagraph", {
|
|
108
|
+
ref: `Mutation/${string}`;
|
|
109
|
+
timestamp: string;
|
|
110
|
+
changeSetRef: null;
|
|
111
|
+
payload: {
|
|
112
|
+
ref: `BlockParagraph/${string}`;
|
|
113
|
+
content: string;
|
|
114
|
+
};
|
|
115
|
+
log: [never, string, null][];
|
|
116
|
+
debounceCount: number;
|
|
117
|
+
name: "updateBlockParagraph";
|
|
118
|
+
}, {
|
|
119
|
+
ref: `BlockParagraph/${string}`;
|
|
120
|
+
content: string;
|
|
121
|
+
}, `BlockParagraph/${string}`>, import("roc-db").WriteOperation<"updatePost", {
|
|
122
|
+
ref: `Mutation/${string}`;
|
|
123
|
+
timestamp: string;
|
|
124
|
+
changeSetRef: null;
|
|
125
|
+
payload: {
|
|
126
|
+
ref: `Post/${string}`;
|
|
127
|
+
tags: string[];
|
|
128
|
+
title?: string | undefined;
|
|
129
|
+
authorRef?: `User/${string}` | undefined;
|
|
130
|
+
};
|
|
131
|
+
log: [never, string, null][];
|
|
132
|
+
debounceCount: number;
|
|
133
|
+
name: "updatePost";
|
|
134
|
+
}, {
|
|
135
|
+
ref: `Post/${string}`;
|
|
136
|
+
tags: string[];
|
|
137
|
+
title?: string | undefined;
|
|
138
|
+
authorRef?: `User/${string}` | undefined;
|
|
139
|
+
}, {
|
|
140
|
+
[x: string]: any;
|
|
141
|
+
}>, import("roc-db").WriteOperation<"updatePostTitle", {
|
|
142
|
+
ref: `Mutation/${string}`;
|
|
143
|
+
timestamp: string;
|
|
144
|
+
changeSetRef: null;
|
|
145
|
+
payload: {
|
|
146
|
+
ref: `Post/${string}`;
|
|
147
|
+
title: string;
|
|
148
|
+
};
|
|
149
|
+
log: [never, string, null][];
|
|
150
|
+
debounceCount: number;
|
|
151
|
+
name: "updatePostTitle";
|
|
152
|
+
}, {
|
|
153
|
+
ref: `Post/${string}`;
|
|
154
|
+
title: string;
|
|
155
|
+
}, {
|
|
156
|
+
[x: string]: any;
|
|
157
|
+
}>];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const readEntity: any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const readPost: any;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const updateBlockParagraph: import("roc-db").WriteOperation<"updateBlockParagraph", {
|
|
2
|
+
ref: `Mutation/${string}`;
|
|
3
|
+
timestamp: string;
|
|
4
|
+
changeSetRef: null;
|
|
5
|
+
payload: {
|
|
6
|
+
ref: `BlockParagraph/${string}`;
|
|
7
|
+
content: string;
|
|
8
|
+
};
|
|
9
|
+
log: [never, string, null][];
|
|
10
|
+
debounceCount: number;
|
|
11
|
+
name: "updateBlockParagraph";
|
|
12
|
+
}, {
|
|
13
|
+
ref: `BlockParagraph/${string}`;
|
|
14
|
+
content: string;
|
|
15
|
+
}, `BlockParagraph/${string}`>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const updatePost: import("roc-db").WriteOperation<"updatePost", {
|
|
2
|
+
ref: `Mutation/${string}`;
|
|
3
|
+
timestamp: string;
|
|
4
|
+
changeSetRef: null;
|
|
5
|
+
payload: {
|
|
6
|
+
ref: `Post/${string}`;
|
|
7
|
+
tags: string[];
|
|
8
|
+
title?: string | undefined;
|
|
9
|
+
authorRef?: `User/${string}` | undefined;
|
|
10
|
+
};
|
|
11
|
+
log: [never, string, null][];
|
|
12
|
+
debounceCount: number;
|
|
13
|
+
name: "updatePost";
|
|
14
|
+
}, {
|
|
15
|
+
ref: `Post/${string}`;
|
|
16
|
+
tags: string[];
|
|
17
|
+
title?: string | undefined;
|
|
18
|
+
authorRef?: `User/${string}` | undefined;
|
|
19
|
+
}, {
|
|
20
|
+
[x: string]: any;
|
|
21
|
+
}>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const updatePostTitle: import("roc-db").WriteOperation<"updatePostTitle", {
|
|
2
|
+
ref: `Mutation/${string}`;
|
|
3
|
+
timestamp: string;
|
|
4
|
+
changeSetRef: null;
|
|
5
|
+
payload: {
|
|
6
|
+
ref: `Post/${string}`;
|
|
7
|
+
title: string;
|
|
8
|
+
};
|
|
9
|
+
log: [never, string, null][];
|
|
10
|
+
debounceCount: number;
|
|
11
|
+
name: "updatePostTitle";
|
|
12
|
+
}, {
|
|
13
|
+
ref: `Post/${string}`;
|
|
14
|
+
title: string;
|
|
15
|
+
}, {
|
|
16
|
+
[x: string]: any;
|
|
17
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const BlockImageRefSchema: import("zod").ZodType<`BlockImage/${string}`, import("zod").ZodTypeDef, `BlockImage/${string}`>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const BlockImageSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
3
|
+
ref: z.ZodType<never, z.ZodTypeDef, never>;
|
|
4
|
+
entity: z.ZodString;
|
|
5
|
+
created: z.ZodObject<{
|
|
6
|
+
mutationRef: z.ZodType<`Mutation/${string}`, z.ZodTypeDef, `Mutation/${string}`>;
|
|
7
|
+
timestamp: z.ZodString;
|
|
8
|
+
}, "strict", z.ZodTypeAny, {
|
|
9
|
+
mutationRef: `Mutation/${string}`;
|
|
10
|
+
timestamp: string;
|
|
11
|
+
}, {
|
|
12
|
+
mutationRef: `Mutation/${string}`;
|
|
13
|
+
timestamp: string;
|
|
14
|
+
}>;
|
|
15
|
+
updated: z.ZodObject<{
|
|
16
|
+
mutationRef: z.ZodType<`Mutation/${string}`, z.ZodTypeDef, `Mutation/${string}`>;
|
|
17
|
+
timestamp: z.ZodString;
|
|
18
|
+
}, "strict", z.ZodTypeAny, {
|
|
19
|
+
mutationRef: `Mutation/${string}`;
|
|
20
|
+
timestamp: string;
|
|
21
|
+
}, {
|
|
22
|
+
mutationRef: `Mutation/${string}`;
|
|
23
|
+
timestamp: string;
|
|
24
|
+
}>;
|
|
25
|
+
data: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
26
|
+
parents: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
27
|
+
ancestors: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
28
|
+
}, z.ZodRawShape>, "strict", z.ZodTypeAny, {
|
|
29
|
+
[x: string]: any;
|
|
30
|
+
}, {
|
|
31
|
+
[x: string]: any;
|
|
32
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const BlockParagraphRefSchema: import("zod").ZodType<`BlockParagraph/${string}`, import("zod").ZodTypeDef, `BlockParagraph/${string}`>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const BlockParagraphSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
3
|
+
ref: z.ZodType<never, z.ZodTypeDef, never>;
|
|
4
|
+
entity: z.ZodString;
|
|
5
|
+
created: z.ZodObject<{
|
|
6
|
+
mutationRef: z.ZodType<`Mutation/${string}`, z.ZodTypeDef, `Mutation/${string}`>;
|
|
7
|
+
timestamp: z.ZodString;
|
|
8
|
+
}, "strict", z.ZodTypeAny, {
|
|
9
|
+
mutationRef: `Mutation/${string}`;
|
|
10
|
+
timestamp: string;
|
|
11
|
+
}, {
|
|
12
|
+
mutationRef: `Mutation/${string}`;
|
|
13
|
+
timestamp: string;
|
|
14
|
+
}>;
|
|
15
|
+
updated: z.ZodObject<{
|
|
16
|
+
mutationRef: z.ZodType<`Mutation/${string}`, z.ZodTypeDef, `Mutation/${string}`>;
|
|
17
|
+
timestamp: z.ZodString;
|
|
18
|
+
}, "strict", z.ZodTypeAny, {
|
|
19
|
+
mutationRef: `Mutation/${string}`;
|
|
20
|
+
timestamp: string;
|
|
21
|
+
}, {
|
|
22
|
+
mutationRef: `Mutation/${string}`;
|
|
23
|
+
timestamp: string;
|
|
24
|
+
}>;
|
|
25
|
+
data: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
26
|
+
parents: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
27
|
+
ancestors: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
28
|
+
}, z.ZodRawShape>, "strict", z.ZodTypeAny, {
|
|
29
|
+
[x: string]: any;
|
|
30
|
+
}, {
|
|
31
|
+
[x: string]: any;
|
|
32
|
+
}>;
|
|
33
|
+
export type BlockParagraph = z.infer<typeof BlockParagraphSchema>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const BlockRowRefSchema: import("zod").ZodType<`BlockRow/${string}`, import("zod").ZodTypeDef, `BlockRow/${string}`>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const BlockRowSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
3
|
+
ref: z.ZodType<never, z.ZodTypeDef, never>;
|
|
4
|
+
entity: z.ZodString;
|
|
5
|
+
created: z.ZodObject<{
|
|
6
|
+
mutationRef: z.ZodType<`Mutation/${string}`, z.ZodTypeDef, `Mutation/${string}`>;
|
|
7
|
+
timestamp: z.ZodString;
|
|
8
|
+
}, "strict", z.ZodTypeAny, {
|
|
9
|
+
mutationRef: `Mutation/${string}`;
|
|
10
|
+
timestamp: string;
|
|
11
|
+
}, {
|
|
12
|
+
mutationRef: `Mutation/${string}`;
|
|
13
|
+
timestamp: string;
|
|
14
|
+
}>;
|
|
15
|
+
updated: z.ZodObject<{
|
|
16
|
+
mutationRef: z.ZodType<`Mutation/${string}`, z.ZodTypeDef, `Mutation/${string}`>;
|
|
17
|
+
timestamp: z.ZodString;
|
|
18
|
+
}, "strict", z.ZodTypeAny, {
|
|
19
|
+
mutationRef: `Mutation/${string}`;
|
|
20
|
+
timestamp: string;
|
|
21
|
+
}, {
|
|
22
|
+
mutationRef: `Mutation/${string}`;
|
|
23
|
+
timestamp: string;
|
|
24
|
+
}>;
|
|
25
|
+
data: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
26
|
+
parents: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
27
|
+
ancestors: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
28
|
+
}, z.ZodRawShape>, "strict", z.ZodTypeAny, {
|
|
29
|
+
[x: string]: any;
|
|
30
|
+
}, {
|
|
31
|
+
[x: string]: any;
|
|
32
|
+
}>;
|
|
33
|
+
export type BlockRow = z.infer<typeof BlockRowSchema>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const BlockTitleRefSchema: import("zod").ZodType<`BlockTitle/${string}`, import("zod").ZodTypeDef, `BlockTitle/${string}`>;
|