@roc-db/test-utils 0.2.0-pre.77 → 0.2.0-pre.79
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
|
@@ -264,12 +264,18 @@ var createBlockImage = writeOperation2("createBlockImage", z18.object({ parentRe
|
|
|
264
264
|
// src/operations/createBlockParagraph.ts
|
|
265
265
|
import { Query as Query3, QueryChain as QueryChain2, writeOperation as writeOperation3 } from "roc-db";
|
|
266
266
|
import { z as z19 } from "zod";
|
|
267
|
-
var createBlockParagrah = writeOperation3("createBlockParagraph", z19.object({
|
|
267
|
+
var createBlockParagrah = writeOperation3("createBlockParagraph", z19.object({
|
|
268
|
+
parentRef: z19.union([PostRefSchema, BlockRowRefSchema]),
|
|
269
|
+
content: z19.string().optional()
|
|
270
|
+
}).strict(), (txn) => {
|
|
268
271
|
const ref = txn.createRef("BlockParagraph");
|
|
269
|
-
const { parentRef } = txn.payload;
|
|
272
|
+
const { parentRef, content } = txn.payload;
|
|
270
273
|
return QueryChain2(Query3(() => txn.readEntity(parentRef, true)), Query3((parent) => txn.patchEntity(parentRef, {
|
|
271
274
|
children: { blocks: [...parent.children.blocks, ref] }
|
|
272
|
-
})), Query3(() => txn.createEntity(ref, {
|
|
275
|
+
})), Query3(() => txn.createEntity(ref, {
|
|
276
|
+
parents: { parent: parentRef },
|
|
277
|
+
data: { content }
|
|
278
|
+
})), Query3((block, updatedParent) => ({ block, updatedParent })));
|
|
273
279
|
}, {
|
|
274
280
|
changeSetOnly: true,
|
|
275
281
|
outputSchema: z19.object({
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export declare const createBlockParagrah: import("roc-db").WriteOperation<"createBlockParagraph", z.ZodObject<{
|
|
3
3
|
parentRef: z.ZodUnion<readonly [z.ZodTemplateLiteral<`${string}/${number}`>, z.ZodTemplateLiteral<`${string}/${number}`>]>;
|
|
4
|
+
content: z.ZodOptional<z.ZodString>;
|
|
4
5
|
}, z.core.$strict>>;
|
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.79",
|
|
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.79",
|
|
21
21
|
"zod": "^4.0.0"
|
|
22
22
|
},
|
|
23
23
|
"keywords": [],
|