@roc-db/test-utils 0.2.0-pre.48 → 0.2.0-pre.49
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 +17 -5
- package/dist/types/schemas/DraftSchema.d.ts +12 -12
- package/dist/types/schemas/index.d.ts +12 -12
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -97,8 +97,8 @@ var DraftRefSchema = refSchemaGenerator6("Draft");
|
|
|
97
97
|
// src/schemas/DraftSchema.ts
|
|
98
98
|
var DraftSchema = entitySchemaGenerator5("Draft", {
|
|
99
99
|
ref: DraftRefSchema,
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
parents: z6.object({
|
|
101
|
+
post: PostRefSchema
|
|
102
102
|
})
|
|
103
103
|
});
|
|
104
104
|
|
|
@@ -207,7 +207,13 @@ var createBlockParagrah = writeOperation3("createBlockParagraph", z14.object({ p
|
|
|
207
207
|
return QueryChain2(Query3(() => txn.readEntity(parentRef, true)), Query3((parent) => txn.patchEntity(parentRef, {
|
|
208
208
|
children: { blocks: [...parent.children.blocks, ref] }
|
|
209
209
|
})), Query3(() => txn.createEntity(ref, { parents: { parent: parentRef } })), Query3((block, updatedParent) => ({ block, updatedParent })));
|
|
210
|
-
}, {
|
|
210
|
+
}, {
|
|
211
|
+
changeSetOnly: true,
|
|
212
|
+
outputSchema: z14.object({
|
|
213
|
+
block: z14.any(),
|
|
214
|
+
updatedParent: z14.any()
|
|
215
|
+
})
|
|
216
|
+
});
|
|
211
217
|
|
|
212
218
|
// src/operations/createBlockRow.ts
|
|
213
219
|
import { Query as Query4, QueryChain as QueryChain3, writeOperation as writeOperation4 } from "roc-db";
|
|
@@ -223,7 +229,13 @@ var createBlockRow = writeOperation4("createBlockRow", z15.object({ parentRef: z
|
|
|
223
229
|
children: { blocks: [] },
|
|
224
230
|
parents: { parent: parentRef }
|
|
225
231
|
})), Query4((block, updatedParent) => ({ block, updatedParent })));
|
|
226
|
-
}, {
|
|
232
|
+
}, {
|
|
233
|
+
changeSetOnly: true,
|
|
234
|
+
outputSchema: z15.object({
|
|
235
|
+
block: z15.any(),
|
|
236
|
+
updatedParent: z15.any()
|
|
237
|
+
})
|
|
238
|
+
});
|
|
227
239
|
|
|
228
240
|
// src/operations/createBlockTitle.ts
|
|
229
241
|
import { Query as Query5, writeOperation as writeOperation5 } from "roc-db";
|
|
@@ -286,7 +298,7 @@ var deleteBlocks = writeOperation8("deleteBlocks", z19.array(z19.union([
|
|
|
286
298
|
])), (txn) => {
|
|
287
299
|
const refs = txn.payload;
|
|
288
300
|
return QueryChain4(...refs.map((ref) => DeleteBlockQuery(txn, ref)));
|
|
289
|
-
}, { changeSetOnly: true
|
|
301
|
+
}, { changeSetOnly: true });
|
|
290
302
|
|
|
291
303
|
// src/operations/deleteDraft.ts
|
|
292
304
|
import { Query as Query9, QueryChain as QueryChain5, writeOperation as writeOperation9 } from "roc-db";
|
|
@@ -22,22 +22,22 @@ export declare const DraftSchema: z.ZodObject<{
|
|
|
22
22
|
mutationRef: `Mutation/${string}`;
|
|
23
23
|
timestamp: string;
|
|
24
24
|
}>;
|
|
25
|
-
data: z.ZodObject<{
|
|
26
|
-
|
|
25
|
+
data: z.ZodObject<{}, z.UnknownKeysParam, z.ZodTypeAny, {}, {}>;
|
|
26
|
+
children: z.ZodObject<{}, z.UnknownKeysParam, z.ZodTypeAny, {}, {}>;
|
|
27
|
+
parents: z.ZodObject<{
|
|
28
|
+
post: z.ZodType<`Post/${string}`, z.ZodTypeDef, `Post/${string}`>;
|
|
27
29
|
}, "strip", z.ZodTypeAny, {
|
|
28
|
-
|
|
30
|
+
post: `Post/${string}`;
|
|
29
31
|
}, {
|
|
30
|
-
|
|
32
|
+
post: `Post/${string}`;
|
|
31
33
|
}>;
|
|
32
|
-
children: z.ZodObject<{}, z.UnknownKeysParam, z.ZodTypeAny, {}, {}>;
|
|
33
|
-
parents: z.ZodObject<{}, z.UnknownKeysParam, z.ZodTypeAny, {}, {}>;
|
|
34
34
|
ancestors: z.ZodObject<{}, z.UnknownKeysParam, z.ZodTypeAny, {}, {}>;
|
|
35
35
|
}, "strict", z.ZodTypeAny, {
|
|
36
36
|
ref: `Draft/${string}`;
|
|
37
|
-
data: {
|
|
38
|
-
|
|
37
|
+
data: {};
|
|
38
|
+
parents: {
|
|
39
|
+
post: `Post/${string}`;
|
|
39
40
|
};
|
|
40
|
-
parents: {};
|
|
41
41
|
entity: "Draft";
|
|
42
42
|
created: {
|
|
43
43
|
mutationRef: `Mutation/${string}`;
|
|
@@ -51,10 +51,10 @@ export declare const DraftSchema: z.ZodObject<{
|
|
|
51
51
|
ancestors: {};
|
|
52
52
|
}, {
|
|
53
53
|
ref: `Draft/${string}`;
|
|
54
|
-
data: {
|
|
55
|
-
|
|
54
|
+
data: {};
|
|
55
|
+
parents: {
|
|
56
|
+
post: `Post/${string}`;
|
|
56
57
|
};
|
|
57
|
-
parents: {};
|
|
58
58
|
entity: "Draft";
|
|
59
59
|
created: {
|
|
60
60
|
mutationRef: `Mutation/${string}`;
|
|
@@ -340,22 +340,22 @@ export declare const entities: (import("zod").ZodObject<{
|
|
|
340
340
|
mutationRef: `Mutation/${string}`;
|
|
341
341
|
timestamp: string;
|
|
342
342
|
}>;
|
|
343
|
-
data: import("zod").ZodObject<{
|
|
344
|
-
|
|
343
|
+
data: import("zod").ZodObject<{}, import("zod").UnknownKeysParam, import("zod").ZodTypeAny, {}, {}>;
|
|
344
|
+
children: import("zod").ZodObject<{}, import("zod").UnknownKeysParam, import("zod").ZodTypeAny, {}, {}>;
|
|
345
|
+
parents: import("zod").ZodObject<{
|
|
346
|
+
post: import("zod").ZodType<`Post/${string}`, import("zod").ZodTypeDef, `Post/${string}`>;
|
|
345
347
|
}, "strip", import("zod").ZodTypeAny, {
|
|
346
|
-
|
|
348
|
+
post: `Post/${string}`;
|
|
347
349
|
}, {
|
|
348
|
-
|
|
350
|
+
post: `Post/${string}`;
|
|
349
351
|
}>;
|
|
350
|
-
children: import("zod").ZodObject<{}, import("zod").UnknownKeysParam, import("zod").ZodTypeAny, {}, {}>;
|
|
351
|
-
parents: import("zod").ZodObject<{}, import("zod").UnknownKeysParam, import("zod").ZodTypeAny, {}, {}>;
|
|
352
352
|
ancestors: import("zod").ZodObject<{}, import("zod").UnknownKeysParam, import("zod").ZodTypeAny, {}, {}>;
|
|
353
353
|
}, "strict", import("zod").ZodTypeAny, {
|
|
354
354
|
ref: `Draft/${string}`;
|
|
355
|
-
data: {
|
|
356
|
-
|
|
355
|
+
data: {};
|
|
356
|
+
parents: {
|
|
357
|
+
post: `Post/${string}`;
|
|
357
358
|
};
|
|
358
|
-
parents: {};
|
|
359
359
|
entity: "Draft";
|
|
360
360
|
created: {
|
|
361
361
|
mutationRef: `Mutation/${string}`;
|
|
@@ -369,10 +369,10 @@ export declare const entities: (import("zod").ZodObject<{
|
|
|
369
369
|
ancestors: {};
|
|
370
370
|
}, {
|
|
371
371
|
ref: `Draft/${string}`;
|
|
372
|
-
data: {
|
|
373
|
-
|
|
372
|
+
data: {};
|
|
373
|
+
parents: {
|
|
374
|
+
post: `Post/${string}`;
|
|
374
375
|
};
|
|
375
|
-
parents: {};
|
|
376
376
|
entity: "Draft";
|
|
377
377
|
created: {
|
|
378
378
|
mutationRef: `Mutation/${string}`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@roc-db/test-utils",
|
|
3
|
-
"version": "0.2.0-pre.
|
|
3
|
+
"version": "0.2.0-pre.49",
|
|
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.
|
|
20
|
+
"roc-db": "0.2.0-pre.49",
|
|
21
21
|
"zod": "3.24.2"
|
|
22
22
|
},
|
|
23
23
|
"keywords": [],
|