@powerhousedao/vetra 5.1.0-dev.4 → 5.1.0-dev.41
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/document-models/app-module/gen/document-schema.d.ts +24 -170
- package/dist/document-models/app-module/gen/document-schema.d.ts.map +1 -1
- package/dist/document-models/app-module/gen/schema/types.d.ts +15 -3
- package/dist/document-models/app-module/gen/schema/types.d.ts.map +1 -1
- package/dist/document-models/app-module/gen/schema/zod.d.ts +7 -4
- package/dist/document-models/app-module/gen/schema/zod.d.ts.map +1 -1
- package/dist/document-models/app-module/gen/schema/zod.js +2 -2
- package/dist/document-models/app-module/hooks.d.ts +5 -2
- package/dist/document-models/app-module/hooks.d.ts.map +1 -1
- package/dist/document-models/app-module/hooks.js +3 -4
- package/dist/document-models/app-module/src/tests/base-operations.test.js +52 -1
- package/dist/document-models/document-editor/gen/document-schema.d.ts +21 -151
- package/dist/document-models/document-editor/gen/document-schema.d.ts.map +1 -1
- package/dist/document-models/document-editor/gen/schema/types.d.ts +15 -3
- package/dist/document-models/document-editor/gen/schema/types.d.ts.map +1 -1
- package/dist/document-models/document-editor/gen/schema/zod.d.ts +7 -4
- package/dist/document-models/document-editor/gen/schema/zod.d.ts.map +1 -1
- package/dist/document-models/document-editor/gen/schema/zod.js +2 -2
- package/dist/document-models/document-editor/hooks.d.ts +5 -2
- package/dist/document-models/document-editor/hooks.d.ts.map +1 -1
- package/dist/document-models/document-editor/hooks.js +3 -4
- package/dist/document-models/document-editor/src/tests/base-operations.test.js +42 -1
- package/dist/document-models/processor-module/gen/document-schema.d.ts +24 -170
- package/dist/document-models/processor-module/gen/document-schema.d.ts.map +1 -1
- package/dist/document-models/processor-module/gen/schema/types.d.ts +15 -3
- package/dist/document-models/processor-module/gen/schema/types.d.ts.map +1 -1
- package/dist/document-models/processor-module/gen/schema/zod.d.ts +7 -4
- package/dist/document-models/processor-module/gen/schema/zod.d.ts.map +1 -1
- package/dist/document-models/processor-module/gen/schema/zod.js +2 -2
- package/dist/document-models/processor-module/hooks.d.ts +5 -2
- package/dist/document-models/processor-module/hooks.d.ts.map +1 -1
- package/dist/document-models/processor-module/hooks.js +3 -4
- package/dist/document-models/processor-module/src/tests/base-operations.test.js +52 -1
- package/dist/document-models/subgraph-module/gen/document-schema.d.ts +18 -132
- package/dist/document-models/subgraph-module/gen/document-schema.d.ts.map +1 -1
- package/dist/document-models/subgraph-module/gen/schema/types.d.ts +15 -3
- package/dist/document-models/subgraph-module/gen/schema/types.d.ts.map +1 -1
- package/dist/document-models/subgraph-module/gen/schema/zod.d.ts +7 -4
- package/dist/document-models/subgraph-module/gen/schema/zod.d.ts.map +1 -1
- package/dist/document-models/subgraph-module/gen/schema/zod.js +1 -1
- package/dist/document-models/subgraph-module/hooks.d.ts +5 -2
- package/dist/document-models/subgraph-module/hooks.d.ts.map +1 -1
- package/dist/document-models/subgraph-module/hooks.js +3 -4
- package/dist/document-models/subgraph-module/src/tests/base-operations.test.js +22 -1
- package/dist/document-models/vetra-package/gen/document-schema.d.ts +33 -227
- package/dist/document-models/vetra-package/gen/document-schema.d.ts.map +1 -1
- package/dist/document-models/vetra-package/gen/schema/types.d.ts +17 -1
- package/dist/document-models/vetra-package/gen/schema/types.d.ts.map +1 -1
- package/dist/document-models/vetra-package/gen/schema/zod.d.ts +3 -3
- package/dist/document-models/vetra-package/gen/schema/zod.d.ts.map +1 -1
- package/dist/document-models/vetra-package/gen/schema/zod.js +10 -10
- package/dist/document-models/vetra-package/hooks.d.ts +5 -2
- package/dist/document-models/vetra-package/hooks.d.ts.map +1 -1
- package/dist/document-models/vetra-package/hooks.js +3 -4
- package/dist/document-models/vetra-package/src/tests/base-operations.test.js +127 -28
- package/dist/editors/app-editor/components/AppEditorForm.js +1 -1
- package/dist/editors/app-editor/editor.test.js +3 -2
- package/dist/editors/document-editor/components/DocumentEditorForm.d.ts.map +1 -1
- package/dist/editors/document-editor/components/DocumentEditorForm.js +32 -26
- package/dist/editors/document-editor/editor.js +1 -1
- package/dist/editors/document-editor/editor.test.js +2 -2
- package/dist/processors/codegen/__tests__/codegen-processor-e2e.test.js +98 -47
- package/dist/processors/codegen/document-handlers/generators/app-generator.js +2 -2
- package/dist/processors/codegen/document-handlers/generators/constants.d.ts +2 -1
- package/dist/processors/codegen/document-handlers/generators/constants.d.ts.map +1 -1
- package/dist/processors/codegen/document-handlers/generators/constants.js +2 -1
- package/dist/processors/codegen/document-handlers/generators/document-editor-generator.js +2 -2
- package/dist/processors/codegen/document-handlers/generators/document-model-generator.d.ts.map +1 -1
- package/dist/processors/codegen/document-handlers/generators/document-model-generator.js +8 -5
- package/dist/processors/codegen/factory.d.ts.map +1 -1
- package/dist/processors/codegen/factory.js +3 -0
- package/dist/processors/codegen/index.js +1 -1
- package/dist/setupTests.js +1 -0
- package/dist/subgraphs/app-module/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/app-module/resolvers.js +4 -4
- package/dist/subgraphs/app-module/schema.d.ts.map +1 -1
- package/dist/subgraphs/app-module/schema.js +2 -17
- package/dist/subgraphs/document-editor/index.d.ts +3 -2
- package/dist/subgraphs/document-editor/index.d.ts.map +1 -1
- package/dist/subgraphs/document-editor/index.js +1 -1
- package/dist/subgraphs/document-editor/resolvers.d.ts +1 -1
- package/dist/subgraphs/document-editor/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/document-editor/resolvers.js +12 -16
- package/dist/subgraphs/document-editor/schema.d.ts.map +1 -1
- package/dist/subgraphs/document-editor/schema.js +2 -21
- package/dist/subgraphs/index.d.ts +4 -4
- package/dist/subgraphs/index.d.ts.map +1 -1
- package/dist/subgraphs/index.js +4 -4
- package/dist/subgraphs/processor-module/index.d.ts +1 -1
- package/dist/subgraphs/processor-module/index.d.ts.map +1 -1
- package/dist/subgraphs/processor-module/resolvers.d.ts +1 -1
- package/dist/subgraphs/processor-module/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/processor-module/resolvers.js +12 -16
- package/dist/subgraphs/processor-module/schema.d.ts.map +1 -1
- package/dist/subgraphs/processor-module/schema.js +2 -22
- package/dist/subgraphs/subgraph-module/index.d.ts +1 -1
- package/dist/subgraphs/subgraph-module/index.d.ts.map +1 -1
- package/dist/subgraphs/subgraph-module/resolvers.d.ts +1 -1
- package/dist/subgraphs/subgraph-module/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/subgraph-module/resolvers.js +12 -16
- package/dist/subgraphs/subgraph-module/schema.d.ts.map +1 -1
- package/dist/subgraphs/subgraph-module/schema.js +2 -15
- package/dist/subgraphs/vetra-package/index.d.ts +1 -1
- package/dist/subgraphs/vetra-package/index.d.ts.map +1 -1
- package/dist/subgraphs/vetra-package/resolvers.d.ts +1 -1
- package/dist/subgraphs/vetra-package/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/vetra-package/resolvers.js +137 -94
- package/dist/subgraphs/vetra-package/schema.d.ts.map +1 -1
- package/dist/subgraphs/vetra-package/schema.js +3 -26
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +17 -17
|
@@ -6,169 +6,39 @@ export declare const DocumentEditorDocumentHeaderSchema: z.ZodObject<{
|
|
|
6
6
|
name: z.ZodString;
|
|
7
7
|
createdAtUtcIso: z.ZodString;
|
|
8
8
|
lastModifiedAtUtcIso: z.ZodString;
|
|
9
|
-
} & {
|
|
10
9
|
documentType: z.ZodLiteral<"powerhouse/document-editor">;
|
|
11
|
-
},
|
|
12
|
-
documentType: "powerhouse/document-editor";
|
|
13
|
-
name: string;
|
|
14
|
-
id: string;
|
|
15
|
-
createdAtUtcIso: string;
|
|
16
|
-
lastModifiedAtUtcIso: string;
|
|
17
|
-
}, {
|
|
18
|
-
documentType: "powerhouse/document-editor";
|
|
19
|
-
name: string;
|
|
20
|
-
id: string;
|
|
21
|
-
createdAtUtcIso: string;
|
|
22
|
-
lastModifiedAtUtcIso: string;
|
|
23
|
-
}>;
|
|
10
|
+
}, z.core.$strip>;
|
|
24
11
|
/** Schema for validating the state object of a DocumentEditor document */
|
|
25
|
-
export declare const DocumentEditorPHStateSchema: z.ZodObject<{
|
|
12
|
+
export declare const DocumentEditorPHStateSchema: z.ZodObject<{
|
|
26
13
|
global: z.ZodObject<Required<{
|
|
27
|
-
documentTypes: z.ZodType<import("./types.js").DocumentTypeItem[],
|
|
28
|
-
name: z.ZodType<string,
|
|
29
|
-
status: z.ZodType<import("./types.js").StatusType,
|
|
30
|
-
}>, z.
|
|
31
|
-
|
|
32
|
-
name: import("./types.js").Scalars["String"]["output"];
|
|
33
|
-
documentTypes: Array<import("./types.js").DocumentTypeItem>;
|
|
34
|
-
}, {
|
|
35
|
-
status: import("./types.js").StatusType | `${import("./types.js").StatusType}`;
|
|
36
|
-
name: import("./types.js").Scalars["String"]["output"];
|
|
37
|
-
documentTypes: Array<import("./types.js").DocumentTypeItem>;
|
|
38
|
-
}>;
|
|
39
|
-
}, "strip", z.ZodTypeAny, {
|
|
40
|
-
global: {
|
|
41
|
-
status: import("./types.js").StatusType | `${import("./types.js").StatusType}`;
|
|
42
|
-
name: import("./types.js").Scalars["String"]["output"];
|
|
43
|
-
documentTypes: Array<import("./types.js").DocumentTypeItem>;
|
|
44
|
-
};
|
|
45
|
-
}, {
|
|
46
|
-
global: {
|
|
47
|
-
status: import("./types.js").StatusType | `${import("./types.js").StatusType}`;
|
|
48
|
-
name: import("./types.js").Scalars["String"]["output"];
|
|
49
|
-
documentTypes: Array<import("./types.js").DocumentTypeItem>;
|
|
50
|
-
};
|
|
51
|
-
}>;
|
|
14
|
+
documentTypes: z.ZodType<import("./types.js").DocumentTypeItem[], unknown, z.core.$ZodTypeInternals<import("./types.js").DocumentTypeItem[], unknown>>;
|
|
15
|
+
name: z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>;
|
|
16
|
+
status: z.ZodType<import("./types.js").StatusType, unknown, z.core.$ZodTypeInternals<import("./types.js").StatusType, unknown>>;
|
|
17
|
+
}>, z.core.$strip>;
|
|
18
|
+
}, z.core.$strip>;
|
|
52
19
|
export declare const DocumentEditorDocumentSchema: z.ZodObject<{
|
|
53
20
|
header: z.ZodObject<{
|
|
54
21
|
id: z.ZodString;
|
|
55
22
|
name: z.ZodString;
|
|
56
23
|
createdAtUtcIso: z.ZodString;
|
|
57
24
|
lastModifiedAtUtcIso: z.ZodString;
|
|
58
|
-
} & {
|
|
59
25
|
documentType: z.ZodLiteral<"powerhouse/document-editor">;
|
|
60
|
-
},
|
|
61
|
-
|
|
62
|
-
name: string;
|
|
63
|
-
id: string;
|
|
64
|
-
createdAtUtcIso: string;
|
|
65
|
-
lastModifiedAtUtcIso: string;
|
|
66
|
-
}, {
|
|
67
|
-
documentType: "powerhouse/document-editor";
|
|
68
|
-
name: string;
|
|
69
|
-
id: string;
|
|
70
|
-
createdAtUtcIso: string;
|
|
71
|
-
lastModifiedAtUtcIso: string;
|
|
72
|
-
}>;
|
|
73
|
-
state: z.ZodObject<{} & {
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
state: z.ZodObject<{
|
|
74
28
|
global: z.ZodObject<Required<{
|
|
75
|
-
documentTypes: z.ZodType<import("./types.js").DocumentTypeItem[],
|
|
76
|
-
name: z.ZodType<string,
|
|
77
|
-
status: z.ZodType<import("./types.js").StatusType,
|
|
78
|
-
}>, z.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
documentTypes: Array<import("./types.js").DocumentTypeItem>;
|
|
82
|
-
}, {
|
|
83
|
-
status: import("./types.js").StatusType | `${import("./types.js").StatusType}`;
|
|
84
|
-
name: import("./types.js").Scalars["String"]["output"];
|
|
85
|
-
documentTypes: Array<import("./types.js").DocumentTypeItem>;
|
|
86
|
-
}>;
|
|
87
|
-
}, "strip", z.ZodTypeAny, {
|
|
88
|
-
global: {
|
|
89
|
-
status: import("./types.js").StatusType | `${import("./types.js").StatusType}`;
|
|
90
|
-
name: import("./types.js").Scalars["String"]["output"];
|
|
91
|
-
documentTypes: Array<import("./types.js").DocumentTypeItem>;
|
|
92
|
-
};
|
|
93
|
-
}, {
|
|
94
|
-
global: {
|
|
95
|
-
status: import("./types.js").StatusType | `${import("./types.js").StatusType}`;
|
|
96
|
-
name: import("./types.js").Scalars["String"]["output"];
|
|
97
|
-
documentTypes: Array<import("./types.js").DocumentTypeItem>;
|
|
98
|
-
};
|
|
99
|
-
}>;
|
|
100
|
-
initialState: z.ZodObject<{} & {
|
|
29
|
+
documentTypes: z.ZodType<import("./types.js").DocumentTypeItem[], unknown, z.core.$ZodTypeInternals<import("./types.js").DocumentTypeItem[], unknown>>;
|
|
30
|
+
name: z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>;
|
|
31
|
+
status: z.ZodType<import("./types.js").StatusType, unknown, z.core.$ZodTypeInternals<import("./types.js").StatusType, unknown>>;
|
|
32
|
+
}>, z.core.$strip>;
|
|
33
|
+
}, z.core.$strip>;
|
|
34
|
+
initialState: z.ZodObject<{
|
|
101
35
|
global: z.ZodObject<Required<{
|
|
102
|
-
documentTypes: z.ZodType<import("./types.js").DocumentTypeItem[],
|
|
103
|
-
name: z.ZodType<string,
|
|
104
|
-
status: z.ZodType<import("./types.js").StatusType,
|
|
105
|
-
}>, z.
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
documentTypes: Array<import("./types.js").DocumentTypeItem>;
|
|
109
|
-
}, {
|
|
110
|
-
status: import("./types.js").StatusType | `${import("./types.js").StatusType}`;
|
|
111
|
-
name: import("./types.js").Scalars["String"]["output"];
|
|
112
|
-
documentTypes: Array<import("./types.js").DocumentTypeItem>;
|
|
113
|
-
}>;
|
|
114
|
-
}, "strip", z.ZodTypeAny, {
|
|
115
|
-
global: {
|
|
116
|
-
status: import("./types.js").StatusType | `${import("./types.js").StatusType}`;
|
|
117
|
-
name: import("./types.js").Scalars["String"]["output"];
|
|
118
|
-
documentTypes: Array<import("./types.js").DocumentTypeItem>;
|
|
119
|
-
};
|
|
120
|
-
}, {
|
|
121
|
-
global: {
|
|
122
|
-
status: import("./types.js").StatusType | `${import("./types.js").StatusType}`;
|
|
123
|
-
name: import("./types.js").Scalars["String"]["output"];
|
|
124
|
-
documentTypes: Array<import("./types.js").DocumentTypeItem>;
|
|
125
|
-
};
|
|
126
|
-
}>;
|
|
127
|
-
}, "strip", z.ZodTypeAny, {
|
|
128
|
-
header: {
|
|
129
|
-
documentType: "powerhouse/document-editor";
|
|
130
|
-
name: string;
|
|
131
|
-
id: string;
|
|
132
|
-
createdAtUtcIso: string;
|
|
133
|
-
lastModifiedAtUtcIso: string;
|
|
134
|
-
};
|
|
135
|
-
state: {
|
|
136
|
-
global: {
|
|
137
|
-
status: import("./types.js").StatusType | `${import("./types.js").StatusType}`;
|
|
138
|
-
name: import("./types.js").Scalars["String"]["output"];
|
|
139
|
-
documentTypes: Array<import("./types.js").DocumentTypeItem>;
|
|
140
|
-
};
|
|
141
|
-
};
|
|
142
|
-
initialState: {
|
|
143
|
-
global: {
|
|
144
|
-
status: import("./types.js").StatusType | `${import("./types.js").StatusType}`;
|
|
145
|
-
name: import("./types.js").Scalars["String"]["output"];
|
|
146
|
-
documentTypes: Array<import("./types.js").DocumentTypeItem>;
|
|
147
|
-
};
|
|
148
|
-
};
|
|
149
|
-
}, {
|
|
150
|
-
header: {
|
|
151
|
-
documentType: "powerhouse/document-editor";
|
|
152
|
-
name: string;
|
|
153
|
-
id: string;
|
|
154
|
-
createdAtUtcIso: string;
|
|
155
|
-
lastModifiedAtUtcIso: string;
|
|
156
|
-
};
|
|
157
|
-
state: {
|
|
158
|
-
global: {
|
|
159
|
-
status: import("./types.js").StatusType | `${import("./types.js").StatusType}`;
|
|
160
|
-
name: import("./types.js").Scalars["String"]["output"];
|
|
161
|
-
documentTypes: Array<import("./types.js").DocumentTypeItem>;
|
|
162
|
-
};
|
|
163
|
-
};
|
|
164
|
-
initialState: {
|
|
165
|
-
global: {
|
|
166
|
-
status: import("./types.js").StatusType | `${import("./types.js").StatusType}`;
|
|
167
|
-
name: import("./types.js").Scalars["String"]["output"];
|
|
168
|
-
documentTypes: Array<import("./types.js").DocumentTypeItem>;
|
|
169
|
-
};
|
|
170
|
-
};
|
|
171
|
-
}>;
|
|
36
|
+
documentTypes: z.ZodType<import("./types.js").DocumentTypeItem[], unknown, z.core.$ZodTypeInternals<import("./types.js").DocumentTypeItem[], unknown>>;
|
|
37
|
+
name: z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>;
|
|
38
|
+
status: z.ZodType<import("./types.js").StatusType, unknown, z.core.$ZodTypeInternals<import("./types.js").StatusType, unknown>>;
|
|
39
|
+
}>, z.core.$strip>;
|
|
40
|
+
}, z.core.$strip>;
|
|
41
|
+
}, z.core.$strip>;
|
|
172
42
|
/** Simple helper function to check if a state object is a DocumentEditor document state object */
|
|
173
43
|
export declare function isDocumentEditorState(state: unknown): state is DocumentEditorPHState;
|
|
174
44
|
/** Simple helper function to assert that a document state object is a DocumentEditor document state object */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document-schema.d.ts","sourceRoot":"","sources":["../../../../document-models/document-editor/gen/document-schema.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAEhF,2EAA2E;AAC3E,eAAO,MAAM,kCAAkC
|
|
1
|
+
{"version":3,"file":"document-schema.d.ts","sourceRoot":"","sources":["../../../../document-models/document-editor/gen/document-schema.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAEhF,2EAA2E;AAC3E,eAAO,MAAM,kCAAkC;;;;;;iBAG3C,CAAC;AAEL,0EAA0E;AAC1E,eAAO,MAAM,2BAA2B;;;;;;iBAEtC,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;iBAIvC,CAAC;AAEH,kGAAkG;AAClG,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,qBAAqB,CAEhC;AAED,8GAA8G;AAC9G,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,OAAO,GACb,OAAO,CAAC,KAAK,IAAI,qBAAqB,CAExC;AAED,iFAAiF;AACjF,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,OAAO,GAChB,QAAQ,IAAI,sBAAsB,CAEpC;AAED,oFAAoF;AACpF,wBAAgB,8BAA8B,CAC5C,QAAQ,EAAE,OAAO,GAChB,OAAO,CAAC,QAAQ,IAAI,sBAAsB,CAE5C"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type Maybe<T> = T | null;
|
|
1
|
+
export type Maybe<T> = T | null | undefined;
|
|
2
2
|
export type InputMaybe<T> = T | null | undefined;
|
|
3
3
|
export type Exact<T extends {
|
|
4
4
|
[key: string]: unknown;
|
|
@@ -41,6 +41,10 @@ export type Scalars = {
|
|
|
41
41
|
input: number;
|
|
42
42
|
output: number;
|
|
43
43
|
};
|
|
44
|
+
Address: {
|
|
45
|
+
input: `${string}:0x${string}`;
|
|
46
|
+
output: `${string}:0x${string}`;
|
|
47
|
+
};
|
|
44
48
|
Amount: {
|
|
45
49
|
input: {
|
|
46
50
|
unit?: string;
|
|
@@ -93,6 +97,10 @@ export type Scalars = {
|
|
|
93
97
|
input: number;
|
|
94
98
|
output: number;
|
|
95
99
|
};
|
|
100
|
+
Attachment: {
|
|
101
|
+
input: string;
|
|
102
|
+
output: string;
|
|
103
|
+
};
|
|
96
104
|
Currency: {
|
|
97
105
|
input: string;
|
|
98
106
|
output: string;
|
|
@@ -129,6 +137,10 @@ export type Scalars = {
|
|
|
129
137
|
input: string;
|
|
130
138
|
output: string;
|
|
131
139
|
};
|
|
140
|
+
Unknown: {
|
|
141
|
+
input: unknown;
|
|
142
|
+
output: unknown;
|
|
143
|
+
};
|
|
132
144
|
Upload: {
|
|
133
145
|
input: File;
|
|
134
146
|
output: File;
|
|
@@ -141,7 +153,7 @@ export type AddDocumentTypeInput = {
|
|
|
141
153
|
export type DocumentEditorState = {
|
|
142
154
|
documentTypes: Array<DocumentTypeItem>;
|
|
143
155
|
name: Scalars["String"]["output"];
|
|
144
|
-
status: StatusType
|
|
156
|
+
status: StatusType;
|
|
145
157
|
};
|
|
146
158
|
export type DocumentTypeItem = {
|
|
147
159
|
documentType: Scalars["String"]["output"];
|
|
@@ -154,7 +166,7 @@ export type SetEditorNameInput = {
|
|
|
154
166
|
name: Scalars["String"]["input"];
|
|
155
167
|
};
|
|
156
168
|
export type SetEditorStatusInput = {
|
|
157
|
-
status: StatusType
|
|
169
|
+
status: StatusType;
|
|
158
170
|
};
|
|
159
171
|
export type StatusType = "CONFIRMED" | "DRAFT";
|
|
160
172
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../document-models/document-editor/gen/schema/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../document-models/document-editor/gen/schema/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;AAC5C,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;AACjD,MAAM,MAAM,KAAK,CAAC,CAAC,SAAS;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,IAAI;KACvD,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACrB,CAAC;AACF,MAAM,MAAM,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAA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AO,CAAC,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,aAAa,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;IACvC,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC;IAClC,MAAM,EAAE,UAAU,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,YAAY,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC1C,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,UAAU,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,OAAO,CAAC"}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as z from "zod";
|
|
2
2
|
import type { AddDocumentTypeInput, DocumentEditorState, DocumentTypeItem, RemoveDocumentTypeInput, SetEditorNameInput, SetEditorStatusInput } from "./types.js";
|
|
3
3
|
type Properties<T> = Required<{
|
|
4
|
-
[K in keyof T]: z.ZodType<T[K]
|
|
4
|
+
[K in keyof T]: z.ZodType<T[K]>;
|
|
5
5
|
}>;
|
|
6
6
|
type definedNonNullAny = {};
|
|
7
7
|
export declare const isDefinedNonNullAny: (v: any) => v is definedNonNullAny;
|
|
8
|
-
export declare const definedNonNullAnySchema: z.
|
|
9
|
-
export declare const StatusTypeSchema: z.ZodEnum<
|
|
8
|
+
export declare const definedNonNullAnySchema: z.ZodAny;
|
|
9
|
+
export declare const StatusTypeSchema: z.ZodEnum<{
|
|
10
|
+
CONFIRMED: "CONFIRMED";
|
|
11
|
+
DRAFT: "DRAFT";
|
|
12
|
+
}>;
|
|
10
13
|
export declare function AddDocumentTypeInputSchema(): z.ZodObject<Properties<AddDocumentTypeInput>>;
|
|
11
14
|
export declare function DocumentEditorStateSchema(): z.ZodObject<Properties<DocumentEditorState>>;
|
|
12
15
|
export declare function DocumentTypeItemSchema(): z.ZodObject<Properties<DocumentTypeItem>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zod.d.ts","sourceRoot":"","sources":["../../../../../document-models/document-editor/gen/schema/zod.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"zod.d.ts","sourceRoot":"","sources":["../../../../../document-models/document-editor/gen/schema/zod.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,KAAK,EACV,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,EAErB,MAAM,YAAY,CAAC;AAEpB,KAAK,UAAU,CAAC,CAAC,IAAI,QAAQ,CAAC;KAC3B,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAChC,CAAC,CAAC;AAEH,KAAK,iBAAiB,GAAG,EAAE,CAAC;AAE5B,eAAO,MAAM,mBAAmB,GAAI,GAAG,GAAG,KAAG,CAAC,IAAI,iBACnB,CAAC;AAEhC,eAAO,MAAM,uBAAuB,UAEI,CAAC;AAEzC,eAAO,MAAM,gBAAgB;;;EAAiC,CAAC;AAE/D,wBAAgB,0BAA0B,IAAI,CAAC,CAAC,SAAS,CACvD,UAAU,CAAC,oBAAoB,CAAC,CACjC,CAKA;AAED,wBAAgB,yBAAyB,IAAI,CAAC,CAAC,SAAS,CACtD,UAAU,CAAC,mBAAmB,CAAC,CAChC,CAOA;AAED,wBAAgB,sBAAsB,IAAI,CAAC,CAAC,SAAS,CACnD,UAAU,CAAC,gBAAgB,CAAC,CAC7B,CAMA;AAED,wBAAgB,6BAA6B,IAAI,CAAC,CAAC,SAAS,CAC1D,UAAU,CAAC,uBAAuB,CAAC,CACpC,CAIA;AAED,wBAAgB,wBAAwB,IAAI,CAAC,CAAC,SAAS,CACrD,UAAU,CAAC,kBAAkB,CAAC,CAC/B,CAIA;AAED,wBAAgB,0BAA0B,IAAI,CAAC,CAAC,SAAS,CACvD,UAAU,CAAC,oBAAoB,CAAC,CACjC,CAIA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as z from "zod";
|
|
2
2
|
export const isDefinedNonNullAny = (v) => v !== undefined && v !== null;
|
|
3
3
|
export const definedNonNullAnySchema = z
|
|
4
4
|
.any()
|
|
@@ -13,7 +13,7 @@ export function AddDocumentTypeInputSchema() {
|
|
|
13
13
|
export function DocumentEditorStateSchema() {
|
|
14
14
|
return z.object({
|
|
15
15
|
__typename: z.literal("DocumentEditorState").optional(),
|
|
16
|
-
documentTypes: z.array(DocumentTypeItemSchema()),
|
|
16
|
+
documentTypes: z.array(z.lazy(() => DocumentTypeItemSchema())),
|
|
17
17
|
name: z.string(),
|
|
18
18
|
status: StatusTypeSchema,
|
|
19
19
|
});
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { DocumentDispatch } from "@powerhousedao/reactor-browser";
|
|
2
|
-
import type {
|
|
2
|
+
import type { DocumentEditorAction, DocumentEditorDocument } from "@powerhousedao/vetra/document-models/document-editor";
|
|
3
3
|
/** Hook to get a DocumentEditor document by its id */
|
|
4
4
|
export declare function useDocumentEditorDocumentById(documentId: string | null | undefined): [DocumentEditorDocument, DocumentDispatch<DocumentEditorAction>] | [undefined, undefined];
|
|
5
5
|
/** Hook to get the selected DocumentEditor document */
|
|
6
|
-
export declare function useSelectedDocumentEditorDocument(): [
|
|
6
|
+
export declare function useSelectedDocumentEditorDocument(): [
|
|
7
|
+
DocumentEditorDocument,
|
|
8
|
+
DocumentDispatch<DocumentEditorAction>
|
|
9
|
+
];
|
|
7
10
|
/** Hook to get all DocumentEditor documents in the selected drive */
|
|
8
11
|
export declare function useDocumentEditorDocumentsInSelectedDrive(): DocumentEditorDocument[] | undefined;
|
|
9
12
|
/** Hook to get all DocumentEditor documents in the selected folder */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../document-models/document-editor/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAOvE,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../document-models/document-editor/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAOvE,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,sDAAsD,CAAC;AAM9D,sDAAsD;AACtD,wBAAgB,6BAA6B,CAC3C,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAEnC,CAAC,sBAAsB,EAAE,gBAAgB,CAAC,oBAAoB,CAAC,CAAC,GAChE,CAAC,SAAS,EAAE,SAAS,CAAC,CAIzB;AAED,uDAAuD;AACvD,wBAAgB,iCAAiC,IAAI;IACnD,sBAAsB;IACtB,gBAAgB,CAAC,oBAAoB,CAAC;CACvC,CAIA;AAED,qEAAqE;AACrE,wBAAgB,yCAAyC,yCAGxD;AAED,sEAAsE;AACtE,wBAAgB,0CAA0C,yCAGzD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useDocumentsInSelectedDrive, useDocumentsInSelectedFolder,
|
|
2
|
-
import { isDocumentEditorDocument } from "./gen/document-schema.js";
|
|
1
|
+
import { useDocumentById, useDocumentsInSelectedDrive, useDocumentsInSelectedFolder, useSelectedDocument, } from "@powerhousedao/reactor-browser";
|
|
2
|
+
import { assertIsDocumentEditorDocument, isDocumentEditorDocument, } from "./gen/document-schema.js";
|
|
3
3
|
/** Hook to get a DocumentEditor document by its id */
|
|
4
4
|
export function useDocumentEditorDocumentById(documentId) {
|
|
5
5
|
const [document, dispatch] = useDocumentById(documentId);
|
|
@@ -10,8 +10,7 @@ export function useDocumentEditorDocumentById(documentId) {
|
|
|
10
10
|
/** Hook to get the selected DocumentEditor document */
|
|
11
11
|
export function useSelectedDocumentEditorDocument() {
|
|
12
12
|
const [document, dispatch] = useSelectedDocument();
|
|
13
|
-
|
|
14
|
-
return [undefined, undefined];
|
|
13
|
+
assertIsDocumentEditorDocument(document);
|
|
15
14
|
return [document, dispatch];
|
|
16
15
|
}
|
|
17
16
|
/** Hook to get all DocumentEditor documents in the selected drive */
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
* This is a scaffold file meant for customization:
|
|
3
3
|
* - change it by adding new tests or modifying the existing ones
|
|
4
4
|
*/
|
|
5
|
-
import { addDocumentType, reducer, removeDocumentType, setEditorName, setEditorStatus, utils, } from "@powerhousedao/vetra/document-models/document-editor";
|
|
5
|
+
import { addDocumentType, reducer, removeDocumentType, setEditorName, setEditorStatus, utils, isDocumentEditorDocument, SetEditorNameInputSchema, AddDocumentTypeInputSchema, RemoveDocumentTypeInputSchema, SetEditorStatusInputSchema, } from "@powerhousedao/vetra/document-models/document-editor";
|
|
6
6
|
import { beforeEach, describe, expect, it } from "vitest";
|
|
7
|
+
import { generateMock } from "@powerhousedao/codegen";
|
|
7
8
|
describe("BaseOperations Operations", () => {
|
|
8
9
|
let document;
|
|
9
10
|
beforeEach(() => {
|
|
@@ -149,4 +150,44 @@ describe("BaseOperations Operations", () => {
|
|
|
149
150
|
expect(updatedDoc.operations.global).toHaveLength(2);
|
|
150
151
|
});
|
|
151
152
|
});
|
|
153
|
+
it("should handle setEditorName operation", () => {
|
|
154
|
+
const document = utils.createDocument();
|
|
155
|
+
const input = generateMock(SetEditorNameInputSchema());
|
|
156
|
+
const updatedDocument = reducer(document, setEditorName(input));
|
|
157
|
+
expect(isDocumentEditorDocument(updatedDocument)).toBe(true);
|
|
158
|
+
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
159
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("SET_EDITOR_NAME");
|
|
160
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
161
|
+
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
162
|
+
});
|
|
163
|
+
it("should handle addDocumentType operation", () => {
|
|
164
|
+
const document = utils.createDocument();
|
|
165
|
+
const input = generateMock(AddDocumentTypeInputSchema());
|
|
166
|
+
const updatedDocument = reducer(document, addDocumentType(input));
|
|
167
|
+
expect(isDocumentEditorDocument(updatedDocument)).toBe(true);
|
|
168
|
+
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
169
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("ADD_DOCUMENT_TYPE");
|
|
170
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
171
|
+
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
172
|
+
});
|
|
173
|
+
it("should handle removeDocumentType operation", () => {
|
|
174
|
+
const document = utils.createDocument();
|
|
175
|
+
const input = generateMock(RemoveDocumentTypeInputSchema());
|
|
176
|
+
const updatedDocument = reducer(document, removeDocumentType(input));
|
|
177
|
+
expect(isDocumentEditorDocument(updatedDocument)).toBe(true);
|
|
178
|
+
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
179
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("REMOVE_DOCUMENT_TYPE");
|
|
180
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
181
|
+
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
182
|
+
});
|
|
183
|
+
it("should handle setEditorStatus operation", () => {
|
|
184
|
+
const document = utils.createDocument();
|
|
185
|
+
const input = generateMock(SetEditorStatusInputSchema());
|
|
186
|
+
const updatedDocument = reducer(document, setEditorStatus(input));
|
|
187
|
+
expect(isDocumentEditorDocument(updatedDocument)).toBe(true);
|
|
188
|
+
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
189
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("SET_EDITOR_STATUS");
|
|
190
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
191
|
+
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
192
|
+
});
|
|
152
193
|
});
|
|
@@ -6,188 +6,42 @@ export declare const ProcessorModuleDocumentHeaderSchema: z.ZodObject<{
|
|
|
6
6
|
name: z.ZodString;
|
|
7
7
|
createdAtUtcIso: z.ZodString;
|
|
8
8
|
lastModifiedAtUtcIso: z.ZodString;
|
|
9
|
-
} & {
|
|
10
9
|
documentType: z.ZodLiteral<"powerhouse/processor">;
|
|
11
|
-
},
|
|
12
|
-
documentType: "powerhouse/processor";
|
|
13
|
-
name: string;
|
|
14
|
-
id: string;
|
|
15
|
-
createdAtUtcIso: string;
|
|
16
|
-
lastModifiedAtUtcIso: string;
|
|
17
|
-
}, {
|
|
18
|
-
documentType: "powerhouse/processor";
|
|
19
|
-
name: string;
|
|
20
|
-
id: string;
|
|
21
|
-
createdAtUtcIso: string;
|
|
22
|
-
lastModifiedAtUtcIso: string;
|
|
23
|
-
}>;
|
|
10
|
+
}, z.core.$strip>;
|
|
24
11
|
/** Schema for validating the state object of a ProcessorModule document */
|
|
25
|
-
export declare const ProcessorModulePHStateSchema: z.ZodObject<{
|
|
12
|
+
export declare const ProcessorModulePHStateSchema: z.ZodObject<{
|
|
26
13
|
global: z.ZodObject<Required<{
|
|
27
|
-
documentTypes: z.ZodType<import("./types.js").DocumentTypeItem[],
|
|
28
|
-
name: z.ZodType<string,
|
|
29
|
-
status: z.ZodType<import("./types.js").StatusType,
|
|
30
|
-
type: z.ZodType<string,
|
|
31
|
-
}>, z.
|
|
32
|
-
|
|
33
|
-
status: import("./types.js").StatusType | `${import("./types.js").StatusType}`;
|
|
34
|
-
name: import("./types.js").Scalars["String"]["output"];
|
|
35
|
-
documentTypes: Array<import("./types.js").DocumentTypeItem>;
|
|
36
|
-
}, {
|
|
37
|
-
type: import("./types.js").Scalars["String"]["output"];
|
|
38
|
-
status: import("./types.js").StatusType | `${import("./types.js").StatusType}`;
|
|
39
|
-
name: import("./types.js").Scalars["String"]["output"];
|
|
40
|
-
documentTypes: Array<import("./types.js").DocumentTypeItem>;
|
|
41
|
-
}>;
|
|
42
|
-
}, "strip", z.ZodTypeAny, {
|
|
43
|
-
global: {
|
|
44
|
-
type: import("./types.js").Scalars["String"]["output"];
|
|
45
|
-
status: import("./types.js").StatusType | `${import("./types.js").StatusType}`;
|
|
46
|
-
name: import("./types.js").Scalars["String"]["output"];
|
|
47
|
-
documentTypes: Array<import("./types.js").DocumentTypeItem>;
|
|
48
|
-
};
|
|
49
|
-
}, {
|
|
50
|
-
global: {
|
|
51
|
-
type: import("./types.js").Scalars["String"]["output"];
|
|
52
|
-
status: import("./types.js").StatusType | `${import("./types.js").StatusType}`;
|
|
53
|
-
name: import("./types.js").Scalars["String"]["output"];
|
|
54
|
-
documentTypes: Array<import("./types.js").DocumentTypeItem>;
|
|
55
|
-
};
|
|
56
|
-
}>;
|
|
14
|
+
documentTypes: z.ZodType<import("./types.js").DocumentTypeItem[], unknown, z.core.$ZodTypeInternals<import("./types.js").DocumentTypeItem[], unknown>>;
|
|
15
|
+
name: z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>;
|
|
16
|
+
status: z.ZodType<import("./types.js").StatusType, unknown, z.core.$ZodTypeInternals<import("./types.js").StatusType, unknown>>;
|
|
17
|
+
type: z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>;
|
|
18
|
+
}>, z.core.$strip>;
|
|
19
|
+
}, z.core.$strip>;
|
|
57
20
|
export declare const ProcessorModuleDocumentSchema: z.ZodObject<{
|
|
58
21
|
header: z.ZodObject<{
|
|
59
22
|
id: z.ZodString;
|
|
60
23
|
name: z.ZodString;
|
|
61
24
|
createdAtUtcIso: z.ZodString;
|
|
62
25
|
lastModifiedAtUtcIso: z.ZodString;
|
|
63
|
-
} & {
|
|
64
26
|
documentType: z.ZodLiteral<"powerhouse/processor">;
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
-
name: string;
|
|
68
|
-
id: string;
|
|
69
|
-
createdAtUtcIso: string;
|
|
70
|
-
lastModifiedAtUtcIso: string;
|
|
71
|
-
}, {
|
|
72
|
-
documentType: "powerhouse/processor";
|
|
73
|
-
name: string;
|
|
74
|
-
id: string;
|
|
75
|
-
createdAtUtcIso: string;
|
|
76
|
-
lastModifiedAtUtcIso: string;
|
|
77
|
-
}>;
|
|
78
|
-
state: z.ZodObject<{} & {
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
state: z.ZodObject<{
|
|
79
29
|
global: z.ZodObject<Required<{
|
|
80
|
-
documentTypes: z.ZodType<import("./types.js").DocumentTypeItem[],
|
|
81
|
-
name: z.ZodType<string,
|
|
82
|
-
status: z.ZodType<import("./types.js").StatusType,
|
|
83
|
-
type: z.ZodType<string,
|
|
84
|
-
}>, z.
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
name: import("./types.js").Scalars["String"]["output"];
|
|
88
|
-
documentTypes: Array<import("./types.js").DocumentTypeItem>;
|
|
89
|
-
}, {
|
|
90
|
-
type: import("./types.js").Scalars["String"]["output"];
|
|
91
|
-
status: import("./types.js").StatusType | `${import("./types.js").StatusType}`;
|
|
92
|
-
name: import("./types.js").Scalars["String"]["output"];
|
|
93
|
-
documentTypes: Array<import("./types.js").DocumentTypeItem>;
|
|
94
|
-
}>;
|
|
95
|
-
}, "strip", z.ZodTypeAny, {
|
|
96
|
-
global: {
|
|
97
|
-
type: import("./types.js").Scalars["String"]["output"];
|
|
98
|
-
status: import("./types.js").StatusType | `${import("./types.js").StatusType}`;
|
|
99
|
-
name: import("./types.js").Scalars["String"]["output"];
|
|
100
|
-
documentTypes: Array<import("./types.js").DocumentTypeItem>;
|
|
101
|
-
};
|
|
102
|
-
}, {
|
|
103
|
-
global: {
|
|
104
|
-
type: import("./types.js").Scalars["String"]["output"];
|
|
105
|
-
status: import("./types.js").StatusType | `${import("./types.js").StatusType}`;
|
|
106
|
-
name: import("./types.js").Scalars["String"]["output"];
|
|
107
|
-
documentTypes: Array<import("./types.js").DocumentTypeItem>;
|
|
108
|
-
};
|
|
109
|
-
}>;
|
|
110
|
-
initialState: z.ZodObject<{} & {
|
|
30
|
+
documentTypes: z.ZodType<import("./types.js").DocumentTypeItem[], unknown, z.core.$ZodTypeInternals<import("./types.js").DocumentTypeItem[], unknown>>;
|
|
31
|
+
name: z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>;
|
|
32
|
+
status: z.ZodType<import("./types.js").StatusType, unknown, z.core.$ZodTypeInternals<import("./types.js").StatusType, unknown>>;
|
|
33
|
+
type: z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>;
|
|
34
|
+
}>, z.core.$strip>;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
initialState: z.ZodObject<{
|
|
111
37
|
global: z.ZodObject<Required<{
|
|
112
|
-
documentTypes: z.ZodType<import("./types.js").DocumentTypeItem[],
|
|
113
|
-
name: z.ZodType<string,
|
|
114
|
-
status: z.ZodType<import("./types.js").StatusType,
|
|
115
|
-
type: z.ZodType<string,
|
|
116
|
-
}>, z.
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
name: import("./types.js").Scalars["String"]["output"];
|
|
120
|
-
documentTypes: Array<import("./types.js").DocumentTypeItem>;
|
|
121
|
-
}, {
|
|
122
|
-
type: import("./types.js").Scalars["String"]["output"];
|
|
123
|
-
status: import("./types.js").StatusType | `${import("./types.js").StatusType}`;
|
|
124
|
-
name: import("./types.js").Scalars["String"]["output"];
|
|
125
|
-
documentTypes: Array<import("./types.js").DocumentTypeItem>;
|
|
126
|
-
}>;
|
|
127
|
-
}, "strip", z.ZodTypeAny, {
|
|
128
|
-
global: {
|
|
129
|
-
type: import("./types.js").Scalars["String"]["output"];
|
|
130
|
-
status: import("./types.js").StatusType | `${import("./types.js").StatusType}`;
|
|
131
|
-
name: import("./types.js").Scalars["String"]["output"];
|
|
132
|
-
documentTypes: Array<import("./types.js").DocumentTypeItem>;
|
|
133
|
-
};
|
|
134
|
-
}, {
|
|
135
|
-
global: {
|
|
136
|
-
type: import("./types.js").Scalars["String"]["output"];
|
|
137
|
-
status: import("./types.js").StatusType | `${import("./types.js").StatusType}`;
|
|
138
|
-
name: import("./types.js").Scalars["String"]["output"];
|
|
139
|
-
documentTypes: Array<import("./types.js").DocumentTypeItem>;
|
|
140
|
-
};
|
|
141
|
-
}>;
|
|
142
|
-
}, "strip", z.ZodTypeAny, {
|
|
143
|
-
header: {
|
|
144
|
-
documentType: "powerhouse/processor";
|
|
145
|
-
name: string;
|
|
146
|
-
id: string;
|
|
147
|
-
createdAtUtcIso: string;
|
|
148
|
-
lastModifiedAtUtcIso: string;
|
|
149
|
-
};
|
|
150
|
-
state: {
|
|
151
|
-
global: {
|
|
152
|
-
type: import("./types.js").Scalars["String"]["output"];
|
|
153
|
-
status: import("./types.js").StatusType | `${import("./types.js").StatusType}`;
|
|
154
|
-
name: import("./types.js").Scalars["String"]["output"];
|
|
155
|
-
documentTypes: Array<import("./types.js").DocumentTypeItem>;
|
|
156
|
-
};
|
|
157
|
-
};
|
|
158
|
-
initialState: {
|
|
159
|
-
global: {
|
|
160
|
-
type: import("./types.js").Scalars["String"]["output"];
|
|
161
|
-
status: import("./types.js").StatusType | `${import("./types.js").StatusType}`;
|
|
162
|
-
name: import("./types.js").Scalars["String"]["output"];
|
|
163
|
-
documentTypes: Array<import("./types.js").DocumentTypeItem>;
|
|
164
|
-
};
|
|
165
|
-
};
|
|
166
|
-
}, {
|
|
167
|
-
header: {
|
|
168
|
-
documentType: "powerhouse/processor";
|
|
169
|
-
name: string;
|
|
170
|
-
id: string;
|
|
171
|
-
createdAtUtcIso: string;
|
|
172
|
-
lastModifiedAtUtcIso: string;
|
|
173
|
-
};
|
|
174
|
-
state: {
|
|
175
|
-
global: {
|
|
176
|
-
type: import("./types.js").Scalars["String"]["output"];
|
|
177
|
-
status: import("./types.js").StatusType | `${import("./types.js").StatusType}`;
|
|
178
|
-
name: import("./types.js").Scalars["String"]["output"];
|
|
179
|
-
documentTypes: Array<import("./types.js").DocumentTypeItem>;
|
|
180
|
-
};
|
|
181
|
-
};
|
|
182
|
-
initialState: {
|
|
183
|
-
global: {
|
|
184
|
-
type: import("./types.js").Scalars["String"]["output"];
|
|
185
|
-
status: import("./types.js").StatusType | `${import("./types.js").StatusType}`;
|
|
186
|
-
name: import("./types.js").Scalars["String"]["output"];
|
|
187
|
-
documentTypes: Array<import("./types.js").DocumentTypeItem>;
|
|
188
|
-
};
|
|
189
|
-
};
|
|
190
|
-
}>;
|
|
38
|
+
documentTypes: z.ZodType<import("./types.js").DocumentTypeItem[], unknown, z.core.$ZodTypeInternals<import("./types.js").DocumentTypeItem[], unknown>>;
|
|
39
|
+
name: z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>;
|
|
40
|
+
status: z.ZodType<import("./types.js").StatusType, unknown, z.core.$ZodTypeInternals<import("./types.js").StatusType, unknown>>;
|
|
41
|
+
type: z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>;
|
|
42
|
+
}>, z.core.$strip>;
|
|
43
|
+
}, z.core.$strip>;
|
|
44
|
+
}, z.core.$strip>;
|
|
191
45
|
/** Simple helper function to check if a state object is a ProcessorModule document state object */
|
|
192
46
|
export declare function isProcessorModuleState(state: unknown): state is ProcessorModulePHState;
|
|
193
47
|
/** Simple helper function to assert that a document state object is a ProcessorModule document state object */
|