@roc-db/test-utils 0.2.0-pre.70 → 0.2.0-pre.72

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.
Files changed (51) hide show
  1. package/dist/index.js +213 -183
  2. package/dist/types/entities/BlockImageEntity.d.ts +3 -11
  3. package/dist/types/entities/BlockParagraph.d.ts +3 -11
  4. package/dist/types/entities/BlockRow.d.ts +5 -13
  5. package/dist/types/entities/Draft.d.ts +3 -11
  6. package/dist/types/entities/PostEntity.d.ts +6 -24
  7. package/dist/types/entities/PostVersion.d.ts +4 -14
  8. package/dist/types/entities/UserEntity.d.ts +1 -5
  9. package/dist/types/entities/index.d.ts +24 -88
  10. package/dist/types/operations/applyDraft.d.ts +1 -1
  11. package/dist/types/operations/createBlockImage.d.ts +2 -8
  12. package/dist/types/operations/createBlockParagraph.d.ts +2 -6
  13. package/dist/types/operations/createBlockRow.d.ts +2 -6
  14. package/dist/types/operations/createBlockTitle.d.ts +2 -6
  15. package/dist/types/operations/createDraft.d.ts +2 -6
  16. package/dist/types/operations/createImage.d.ts +5 -0
  17. package/dist/types/operations/createPost.d.ts +2 -10
  18. package/dist/types/operations/createUser.d.ts +1 -5
  19. package/dist/types/operations/crudBySlug.d.ts +1 -7
  20. package/dist/types/operations/deleteBlocks.d.ts +1 -1
  21. package/dist/types/operations/deleteDraft.d.ts +1 -1
  22. package/dist/types/operations/deletePost.d.ts +1 -1
  23. package/dist/types/operations/moveBlocks.d.ts +2 -8
  24. package/dist/types/operations/testTransactionalEdits.d.ts +3 -11
  25. package/dist/types/operations/updateBlockParagraph.d.ts +2 -8
  26. package/dist/types/operations/updatePost.d.ts +4 -14
  27. package/dist/types/operations/updatePostDescription.d.ts +2 -8
  28. package/dist/types/operations/updatePostSlug.d.ts +2 -8
  29. package/dist/types/operations/updatePostTags.d.ts +3 -9
  30. package/dist/types/operations/updatePostTitle.d.ts +2 -8
  31. package/dist/types/schemas/BlockImageRefSchema.d.ts +1 -1
  32. package/dist/types/schemas/BlockImageSchema.d.ts +18 -76
  33. package/dist/types/schemas/BlockParagraphRefSchema.d.ts +1 -1
  34. package/dist/types/schemas/BlockParagraphSchema.d.ts +18 -76
  35. package/dist/types/schemas/BlockRefSchema.d.ts +1 -1
  36. package/dist/types/schemas/BlockRowRefSchema.d.ts +1 -1
  37. package/dist/types/schemas/BlockRowSchema.d.ts +20 -82
  38. package/dist/types/schemas/BlockTitleRefSchema.d.ts +1 -1
  39. package/dist/types/schemas/BlockTitleSchema.d.ts +18 -76
  40. package/dist/types/schemas/CreatePostMutationSchema.d.ts +8 -62
  41. package/dist/types/schemas/CreateUserMutationSchema.d.ts +7 -53
  42. package/dist/types/schemas/DraftRefSchema.d.ts +1 -1
  43. package/dist/types/schemas/DraftSchema.d.ts +17 -67
  44. package/dist/types/schemas/ImageSchema.d.ts +23 -0
  45. package/dist/types/schemas/PostRefSchema.d.ts +1 -1
  46. package/dist/types/schemas/PostSchema.d.ts +21 -99
  47. package/dist/types/schemas/UpdatePostMutationSchema.d.ts +10 -68
  48. package/dist/types/schemas/UpdatePostTitleMutationSchema.d.ts +8 -58
  49. package/dist/types/schemas/UserRefSchema.d.ts +1 -1
  50. package/dist/types/schemas/index.d.ts +2 -1
  51. package/package.json +3 -3
@@ -0,0 +1,23 @@
1
+ import { z } from "zod";
2
+ export declare const ImageSchema: z.ZodObject<{
3
+ ref: z.ZodNonOptional<z.ZodTemplateLiteral<`Image/${number}`>>;
4
+ entity: z.ZodNonOptional<z.ZodLiteral<"Image">>;
5
+ created: z.ZodNonOptional<z.ZodObject<{
6
+ mutationRef: z.ZodNonOptional<z.ZodTemplateLiteral<`Mutation/${number}`>>;
7
+ timestamp: z.ZodNonOptional<z.ZodString>;
8
+ }, z.core.$strict>>;
9
+ updated: z.ZodNonOptional<z.ZodObject<{
10
+ mutationRef: z.ZodNonOptional<z.ZodTemplateLiteral<`Mutation/${number}`>>;
11
+ timestamp: z.ZodNonOptional<z.ZodString>;
12
+ }, z.core.$strict>>;
13
+ data: z.ZodNonOptional<z.ZodObject<{
14
+ title: z.ZodString;
15
+ text: z.ZodOptional<z.ZodString>;
16
+ tags: z.ZodArray<z.ZodString>;
17
+ slug: z.ZodOptional<z.ZodString>;
18
+ }, z.core.$strip>>;
19
+ children: z.ZodNonOptional<z.ZodObject<{}, z.core.$strip>>;
20
+ parents: z.ZodNonOptional<z.ZodObject<{}, z.core.$strip>>;
21
+ ancestors: z.ZodNonOptional<z.ZodObject<{}, z.core.$strip>>;
22
+ }, z.core.$strict>;
23
+ export type Image = z.infer<typeof ImageSchema>;
@@ -1 +1 @@
1
- export declare const PostRefSchema: import("zod").ZodType<`Post/${string}`, import("zod").ZodTypeDef, `Post/${string}`>;
1
+ export declare const PostRefSchema: import("zod").ZodTemplateLiteral<`Post/${number}`>;
@@ -1,105 +1,27 @@
1
1
  import { z } from "zod";
2
2
  export declare const PostSchema: z.ZodObject<{
3
- ref: z.ZodType<`Post/${string}`, z.ZodTypeDef, `Post/${string}`>;
4
- entity: z.ZodLiteral<"Post">;
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<{
3
+ ref: z.ZodNonOptional<z.ZodTemplateLiteral<`Post/${number}`>>;
4
+ entity: z.ZodNonOptional<z.ZodLiteral<"Post">>;
5
+ created: z.ZodNonOptional<z.ZodObject<{
6
+ mutationRef: z.ZodNonOptional<z.ZodTemplateLiteral<`Mutation/${number}`>>;
7
+ timestamp: z.ZodNonOptional<z.ZodString>;
8
+ }, z.core.$strict>>;
9
+ updated: z.ZodNonOptional<z.ZodObject<{
10
+ mutationRef: z.ZodNonOptional<z.ZodTemplateLiteral<`Mutation/${number}`>>;
11
+ timestamp: z.ZodNonOptional<z.ZodString>;
12
+ }, z.core.$strict>>;
13
+ data: z.ZodNonOptional<z.ZodObject<{
26
14
  title: z.ZodString;
27
15
  text: z.ZodOptional<z.ZodString>;
28
- tags: z.ZodArray<z.ZodString, "many">;
16
+ tags: z.ZodArray<z.ZodString>;
29
17
  slug: z.ZodOptional<z.ZodString>;
30
- }, "strip", z.ZodTypeAny, {
31
- title: string;
32
- tags: string[];
33
- text?: string | undefined;
34
- slug?: string | undefined;
35
- }, {
36
- title: string;
37
- tags: string[];
38
- text?: string | undefined;
39
- slug?: string | undefined;
40
- }>;
41
- children: z.ZodObject<{
42
- blocks: z.ZodArray<z.ZodString, "many">;
43
- }, "strip", z.ZodTypeAny, {
44
- blocks: string[];
45
- }, {
46
- blocks: string[];
47
- }>;
48
- parents: z.ZodObject<{
49
- author: z.ZodOptional<z.ZodType<`User/${string}`, z.ZodTypeDef, `User/${string}`>>;
50
- }, "strip", z.ZodTypeAny, {
51
- author?: `User/${string}` | undefined;
52
- }, {
53
- author?: `User/${string}` | undefined;
54
- }>;
55
- ancestors: z.ZodObject<{}, z.UnknownKeysParam, z.ZodTypeAny, {}, {}>;
56
- }, "strict", z.ZodTypeAny, {
57
- ref: `Post/${string}`;
58
- data: {
59
- title: string;
60
- tags: string[];
61
- text?: string | undefined;
62
- slug?: string | undefined;
63
- };
64
- parents: {
65
- author?: `User/${string}` | undefined;
66
- };
67
- entity: "Post";
68
- created: {
69
- mutationRef: `Mutation/${string}`;
70
- timestamp: string;
71
- };
72
- updated: {
73
- mutationRef: `Mutation/${string}`;
74
- timestamp: string;
75
- };
76
- children: {
77
- blocks: string[];
78
- };
79
- ancestors: {};
80
- }, {
81
- ref: `Post/${string}`;
82
- data: {
83
- title: string;
84
- tags: string[];
85
- text?: string | undefined;
86
- slug?: string | undefined;
87
- };
88
- parents: {
89
- author?: `User/${string}` | undefined;
90
- };
91
- entity: "Post";
92
- created: {
93
- mutationRef: `Mutation/${string}`;
94
- timestamp: string;
95
- };
96
- updated: {
97
- mutationRef: `Mutation/${string}`;
98
- timestamp: string;
99
- };
100
- children: {
101
- blocks: string[];
102
- };
103
- ancestors: {};
104
- }>;
18
+ }, z.core.$strip>>;
19
+ children: z.ZodNonOptional<z.ZodObject<{
20
+ blocks: z.ZodArray<z.ZodString>;
21
+ }, z.core.$strip>>;
22
+ parents: z.ZodNonOptional<z.ZodObject<{
23
+ author: z.ZodOptional<z.ZodTemplateLiteral<`User/${number}`>>;
24
+ }, z.core.$strip>>;
25
+ ancestors: z.ZodNonOptional<z.ZodObject<{}, z.core.$strip>>;
26
+ }, z.core.$strict>;
105
27
  export type Post = z.infer<typeof PostSchema>;
@@ -1,79 +1,21 @@
1
1
  import { z } from "zod";
2
- export declare const UpdatePostMutationSchema: z.ZodObject<z.objectUtil.extendShape<{
3
- ref: z.ZodType<`Mutation/${string}`, z.ZodTypeDef, `Mutation/${string}`>;
2
+ export declare const UpdatePostMutationSchema: z.ZodObject<{
3
+ ref: z.ZodTemplateLiteral<`Mutation/${number}`>;
4
4
  timestamp: z.ZodString;
5
- changeSetRef: z.ZodNullable<z.ZodType<never, z.ZodTypeDef, never>>;
6
- payload: z.ZodAny;
7
- log: z.ZodArray<z.ZodAny, "many">;
8
5
  debounceCount: z.ZodNumber;
9
6
  identityRef: z.ZodString;
10
7
  sessionRef: z.ZodOptional<z.ZodNullable<z.ZodString>>;
11
8
  persistedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
12
- }, {
13
9
  operation: z.ZodObject<{
14
10
  name: z.ZodLiteral<"updatePost">;
15
11
  version: z.ZodDefault<z.ZodNumber>;
16
- }, "strip", z.ZodTypeAny, {
17
- name: "updatePost";
18
- version: number;
19
- }, {
20
- name: "updatePost";
21
- version?: number | undefined;
22
- }>;
23
- changeSetRef: z.ZodType<never, z.ZodTypeDef, never> | z.ZodNullable<z.ZodType<never, z.ZodTypeDef, never>>;
12
+ }, z.core.$strip>;
13
+ changeSetRef: z.ZodTemplateLiteral<never> | z.ZodNullable<z.ZodTemplateLiteral<never>>;
24
14
  payload: z.ZodObject<{
25
- ref: z.ZodType<`Post/${string}`, z.ZodTypeDef, `Post/${string}`>;
15
+ ref: z.ZodTemplateLiteral<`Post/${number}`>;
26
16
  title: z.ZodOptional<z.ZodString>;
27
- tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
28
- authorRef: z.ZodOptional<z.ZodType<`User/${string}`, z.ZodTypeDef, `User/${string}`>>;
29
- }, "strip", z.ZodTypeAny, {
30
- ref: `Post/${string}`;
31
- tags: string[];
32
- title?: string | undefined;
33
- authorRef?: `User/${string}` | undefined;
34
- }, {
35
- ref: `Post/${string}`;
36
- title?: string | undefined;
37
- tags?: string[] | undefined;
38
- authorRef?: `User/${string}` | undefined;
39
- }>;
40
- log: z.ZodType<any[], z.ZodTypeDef, any[]>;
41
- }>, "strict", z.ZodTypeAny, {
42
- ref: `Mutation/${string}`;
43
- timestamp: string;
44
- changeSetRef: null;
45
- payload: {
46
- ref: `Post/${string}`;
47
- tags: string[];
48
- title?: string | undefined;
49
- authorRef?: `User/${string}` | undefined;
50
- };
51
- log: any[];
52
- debounceCount: number;
53
- identityRef: string;
54
- operation: {
55
- name: "updatePost";
56
- version: number;
57
- };
58
- sessionRef?: string | null | undefined;
59
- persistedAt?: string | null | undefined;
60
- }, {
61
- ref: `Mutation/${string}`;
62
- timestamp: string;
63
- changeSetRef: null;
64
- payload: {
65
- ref: `Post/${string}`;
66
- title?: string | undefined;
67
- tags?: string[] | undefined;
68
- authorRef?: `User/${string}` | undefined;
69
- };
70
- log: any[];
71
- debounceCount: number;
72
- identityRef: string;
73
- operation: {
74
- name: "updatePost";
75
- version?: number | undefined;
76
- };
77
- sessionRef?: string | null | undefined;
78
- persistedAt?: string | null | undefined;
79
- }>;
17
+ tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
18
+ authorRef: z.ZodOptional<z.ZodTemplateLiteral<`User/${number}`>>;
19
+ }, z.core.$strip>;
20
+ log: z.ZodType<any[], unknown, z.core.$ZodTypeInternals<any[], unknown>>;
21
+ }, z.core.$strict>;
@@ -1,69 +1,19 @@
1
1
  import { z } from "zod";
2
- export declare const UpdatePostTitleMutationSchema: z.ZodObject<z.objectUtil.extendShape<{
3
- ref: z.ZodType<`Mutation/${string}`, z.ZodTypeDef, `Mutation/${string}`>;
2
+ export declare const UpdatePostTitleMutationSchema: z.ZodObject<{
3
+ ref: z.ZodTemplateLiteral<`Mutation/${number}`>;
4
4
  timestamp: z.ZodString;
5
- changeSetRef: z.ZodNullable<z.ZodType<never, z.ZodTypeDef, never>>;
6
- payload: z.ZodAny;
7
- log: z.ZodArray<z.ZodAny, "many">;
8
5
  debounceCount: z.ZodNumber;
9
6
  identityRef: z.ZodString;
10
7
  sessionRef: z.ZodOptional<z.ZodNullable<z.ZodString>>;
11
8
  persistedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
12
- }, {
13
9
  operation: z.ZodObject<{
14
10
  name: z.ZodLiteral<"updatePostTitle">;
15
11
  version: z.ZodDefault<z.ZodNumber>;
16
- }, "strip", z.ZodTypeAny, {
17
- name: "updatePostTitle";
18
- version: number;
19
- }, {
20
- name: "updatePostTitle";
21
- version?: number | undefined;
22
- }>;
23
- changeSetRef: z.ZodType<never, z.ZodTypeDef, never> | z.ZodNullable<z.ZodType<never, z.ZodTypeDef, never>>;
12
+ }, z.core.$strip>;
13
+ changeSetRef: z.ZodTemplateLiteral<never> | z.ZodNullable<z.ZodTemplateLiteral<never>>;
24
14
  payload: z.ZodObject<{
25
- ref: z.ZodType<`Post/${string}`, z.ZodTypeDef, `Post/${string}`>;
15
+ ref: z.ZodTemplateLiteral<`Post/${number}`>;
26
16
  title: z.ZodString;
27
- }, "strip", z.ZodTypeAny, {
28
- ref: `Post/${string}`;
29
- title: string;
30
- }, {
31
- ref: `Post/${string}`;
32
- title: string;
33
- }>;
34
- log: z.ZodType<any[], z.ZodTypeDef, any[]>;
35
- }>, "strict", z.ZodTypeAny, {
36
- ref: `Mutation/${string}`;
37
- timestamp: string;
38
- changeSetRef: null;
39
- payload: {
40
- ref: `Post/${string}`;
41
- title: string;
42
- };
43
- log: any[];
44
- debounceCount: number;
45
- identityRef: string;
46
- operation: {
47
- name: "updatePostTitle";
48
- version: number;
49
- };
50
- sessionRef?: string | null | undefined;
51
- persistedAt?: string | null | undefined;
52
- }, {
53
- ref: `Mutation/${string}`;
54
- timestamp: string;
55
- changeSetRef: null;
56
- payload: {
57
- ref: `Post/${string}`;
58
- title: string;
59
- };
60
- log: any[];
61
- debounceCount: number;
62
- identityRef: string;
63
- operation: {
64
- name: "updatePostTitle";
65
- version?: number | undefined;
66
- };
67
- sessionRef?: string | null | undefined;
68
- persistedAt?: string | null | undefined;
69
- }>;
17
+ }, z.core.$strip>;
18
+ log: z.ZodType<any[], unknown, z.core.$ZodTypeInternals<any[], unknown>>;
19
+ }, z.core.$strict>;
@@ -1 +1 @@
1
- export declare const UserRefSchema: import("zod").ZodType<`User/${string}`, import("zod").ZodTypeDef, `User/${string}`>;
1
+ export declare const UserRefSchema: import("zod").ZodTemplateLiteral<`User/${number}`>;
@@ -2,8 +2,9 @@ import { BlockImageSchema } from "./BlockImageSchema";
2
2
  import { BlockParagraphSchema } from "./BlockParagraphSchema";
3
3
  import { BlockTitleSchema } from "./BlockTitleSchema";
4
4
  import { DraftSchema } from "./DraftSchema";
5
+ import { ImageSchema } from "./ImageSchema";
5
6
  import { PostSchema } from "./PostSchema";
6
- export { BlockImageSchema, BlockParagraphSchema, BlockTitleSchema, DraftSchema, PostSchema, };
7
+ export { BlockImageSchema, BlockParagraphSchema, BlockTitleSchema, DraftSchema, ImageSchema, PostSchema, };
7
8
  export { DraftRefSchema } from "./DraftRefSchema";
8
9
  export { PostRefSchema } from "./PostRefSchema";
9
10
  export { UserRefSchema } from "./UserRefSchema";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roc-db/test-utils",
3
- "version": "0.2.0-pre.70",
3
+ "version": "0.2.0-pre.72",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -17,8 +17,8 @@
17
17
  ],
18
18
  "sideEffects": false,
19
19
  "peerDependencies": {
20
- "roc-db": "0.2.0-pre.70",
21
- "zod": "3.24.2"
20
+ "roc-db": "0.2.0-pre.72",
21
+ "zod": "^4.0.0"
22
22
  },
23
23
  "keywords": [],
24
24
  "author": "Eigil Sagafos",