@vladimirdev635/gql-codegen 0.0.69 → 0.0.71

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/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export { Actor, ActorContext, Config } from './config.js';
2
2
  export { run } from './main.js';
3
- export { loadSchemaFromFile } from './schema/utils.js';
3
+ export { loadClientSchemaFromFile, loadServerSchemaFromFile } from './schema/utils.js';
4
4
  export * as actors from './actors/index.js';
package/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  export { run } from './main.js';
2
- export { loadSchemaFromFile } from './schema/utils.js';
2
+ export { loadClientSchemaFromFile, loadServerSchemaFromFile } from './schema/utils.js';
3
3
  export * as actors from './actors/index.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vladimirdev635/gql-codegen",
3
- "version": "0.0.69",
3
+ "version": "0.0.71",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -110,3 +110,4 @@ export declare const clientSchema: z.ZodObject<{
110
110
  }>>;
111
111
  }, z.core.$strip>>;
112
112
  }, z.core.$strip>;
113
+ export type ClientSchema = z.infer<typeof clientSchema>;
package/schema/root.d.ts CHANGED
@@ -1,312 +1,6 @@
1
- import { z } from 'zod/v4';
2
- export declare const rootSchema: z.ZodObject<{
3
- server: z.ZodObject<{
4
- objects: z.ZodRecord<z.ZodString, z.ZodObject<{
5
- name: z.ZodString;
6
- implements: z.ZodRecord<z.ZodString, z.ZodString>;
7
- fields: z.ZodRecord<z.ZodString, z.ZodObject<{
8
- nullable: z.ZodBoolean;
9
- spec: z.ZodDiscriminatedUnion<[z.ZodObject<{
10
- _type: z.ZodLiteral<"literal">;
11
- type: z.ZodDiscriminatedUnion<[z.ZodObject<{
12
- _type: z.ZodLiteral<"ObjectType">;
13
- name: z.ZodString;
14
- $ref: z.ZodString;
15
- }, z.core.$strip>, z.ZodObject<{
16
- _type: z.ZodLiteral<"InterfaceType">;
17
- name: z.ZodString;
18
- $ref: z.ZodString;
19
- }, z.core.$strip>, z.ZodObject<{
20
- _type: z.ZodLiteral<"Scalar">;
21
- name: z.ZodString;
22
- }, z.core.$strip>, z.ZodObject<{
23
- _type: z.ZodLiteral<"Union">;
24
- name: z.ZodString;
25
- $ref: z.ZodString;
26
- }, z.core.$strip>, z.ZodObject<{
27
- _type: z.ZodLiteral<"Enum">;
28
- name: z.ZodString;
29
- $ref: z.ZodString;
30
- }, z.core.$strip>]>;
31
- }, z.core.$strip>, z.ZodObject<{
32
- _type: z.ZodLiteral<"array">;
33
- nullable: z.ZodBoolean;
34
- type: z.ZodDiscriminatedUnion<[z.ZodObject<{
35
- _type: z.ZodLiteral<"ObjectType">;
36
- name: z.ZodString;
37
- $ref: z.ZodString;
38
- }, z.core.$strip>, z.ZodObject<{
39
- _type: z.ZodLiteral<"InterfaceType">;
40
- name: z.ZodString;
41
- $ref: z.ZodString;
42
- }, z.core.$strip>, z.ZodObject<{
43
- _type: z.ZodLiteral<"Scalar">;
44
- name: z.ZodString;
45
- }, z.core.$strip>, z.ZodObject<{
46
- _type: z.ZodLiteral<"Union">;
47
- name: z.ZodString;
48
- $ref: z.ZodString;
49
- }, z.core.$strip>, z.ZodObject<{
50
- _type: z.ZodLiteral<"Enum">;
51
- name: z.ZodString;
52
- $ref: z.ZodString;
53
- }, z.core.$strip>]>;
54
- }, z.core.$strip>, z.ZodObject<{
55
- _type: z.ZodLiteral<"callable">;
56
- returnType: z.ZodDiscriminatedUnion<[z.ZodObject<{
57
- _type: z.ZodLiteral<"literal">;
58
- type: z.ZodDiscriminatedUnion<[z.ZodObject<{
59
- _type: z.ZodLiteral<"ObjectType">;
60
- name: z.ZodString;
61
- $ref: z.ZodString;
62
- }, z.core.$strip>, z.ZodObject<{
63
- _type: z.ZodLiteral<"InterfaceType">;
64
- name: z.ZodString;
65
- $ref: z.ZodString;
66
- }, z.core.$strip>, z.ZodObject<{
67
- _type: z.ZodLiteral<"Scalar">;
68
- name: z.ZodString;
69
- }, z.core.$strip>, z.ZodObject<{
70
- _type: z.ZodLiteral<"Union">;
71
- name: z.ZodString;
72
- $ref: z.ZodString;
73
- }, z.core.$strip>, z.ZodObject<{
74
- _type: z.ZodLiteral<"Enum">;
75
- name: z.ZodString;
76
- $ref: z.ZodString;
77
- }, z.core.$strip>]>;
78
- }, z.core.$strip>, z.ZodObject<{
79
- _type: z.ZodLiteral<"array">;
80
- nullable: z.ZodBoolean;
81
- type: z.ZodDiscriminatedUnion<[z.ZodObject<{
82
- _type: z.ZodLiteral<"ObjectType">;
83
- name: z.ZodString;
84
- $ref: z.ZodString;
85
- }, z.core.$strip>, z.ZodObject<{
86
- _type: z.ZodLiteral<"InterfaceType">;
87
- name: z.ZodString;
88
- $ref: z.ZodString;
89
- }, z.core.$strip>, z.ZodObject<{
90
- _type: z.ZodLiteral<"Scalar">;
91
- name: z.ZodString;
92
- }, z.core.$strip>, z.ZodObject<{
93
- _type: z.ZodLiteral<"Union">;
94
- name: z.ZodString;
95
- $ref: z.ZodString;
96
- }, z.core.$strip>, z.ZodObject<{
97
- _type: z.ZodLiteral<"Enum">;
98
- name: z.ZodString;
99
- $ref: z.ZodString;
100
- }, z.core.$strip>]>;
101
- }, z.core.$strip>]>;
102
- arguments: z.ZodRecord<z.ZodString, z.ZodObject<{
103
- nullable: z.ZodBoolean;
104
- spec: z.ZodDiscriminatedUnion<[z.ZodObject<{
105
- _type: z.ZodLiteral<"literal">;
106
- type: z.ZodDiscriminatedUnion<[z.ZodObject<{
107
- _type: z.ZodLiteral<"InputType">;
108
- name: z.ZodString;
109
- $ref: z.ZodString;
110
- }, z.core.$strip>, z.ZodObject<{
111
- _type: z.ZodLiteral<"Scalar">;
112
- name: z.ZodString;
113
- }, z.core.$strip>, z.ZodObject<{
114
- _type: z.ZodLiteral<"Enum">;
115
- name: z.ZodString;
116
- $ref: z.ZodString;
117
- }, z.core.$strip>]>;
118
- }, z.core.$strip>, z.ZodObject<{
119
- _type: z.ZodLiteral<"array">;
120
- nullable: z.ZodBoolean;
121
- type: z.ZodDiscriminatedUnion<[z.ZodObject<{
122
- _type: z.ZodLiteral<"InputType">;
123
- name: z.ZodString;
124
- $ref: z.ZodString;
125
- }, z.core.$strip>, z.ZodObject<{
126
- _type: z.ZodLiteral<"Scalar">;
127
- name: z.ZodString;
128
- }, z.core.$strip>, z.ZodObject<{
129
- _type: z.ZodLiteral<"Enum">;
130
- name: z.ZodString;
131
- $ref: z.ZodString;
132
- }, z.core.$strip>]>;
133
- }, z.core.$strip>]>;
134
- }, z.core.$strip>>;
135
- }, z.core.$strip>]>;
136
- }, z.core.$strip>>;
137
- }, z.core.$strip>>;
138
- directives: z.ZodRecord<z.ZodString, z.ZodObject<{
139
- name: z.ZodString;
140
- locations: z.ZodArray<z.ZodEnum<{
141
- SCHEMA: "SCHEMA";
142
- SCALAR: "SCALAR";
143
- OBJECT: "OBJECT";
144
- FIELD_DEFINITION: "FIELD_DEFINITION";
145
- ARGUMENT_DEFINITION: "ARGUMENT_DEFINITION";
146
- INTERFACE: "INTERFACE";
147
- UNION: "UNION";
148
- ENUM: "ENUM";
149
- ENUM_VALUE: "ENUM_VALUE";
150
- INPUT_OBJECT: "INPUT_OBJECT";
151
- INPUT_FIELD_DEFINITION: "INPUT_FIELD_DEFINITION";
152
- }>>;
153
- }, z.core.$strip>>;
154
- unions: z.ZodRecord<z.ZodString, z.ZodObject<{
155
- name: z.ZodString;
156
- items: z.ZodRecord<z.ZodString, z.ZodString>;
157
- }, z.core.$strip>>;
158
- enums: z.ZodRecord<z.ZodString, z.ZodObject<{
159
- name: z.ZodString;
160
- values: z.ZodArray<z.ZodString>;
161
- }, z.core.$strip>>;
162
- scalars: z.ZodArray<z.ZodString>;
163
- inputs: z.ZodRecord<z.ZodString, z.ZodObject<{
164
- name: z.ZodString;
165
- fields: z.ZodRecord<z.ZodString, z.ZodObject<{
166
- nullable: z.ZodBoolean;
167
- spec: z.ZodDiscriminatedUnion<[z.ZodObject<{
168
- _type: z.ZodLiteral<"literal">;
169
- type: z.ZodDiscriminatedUnion<[z.ZodObject<{
170
- _type: z.ZodLiteral<"InputType">;
171
- name: z.ZodString;
172
- $ref: z.ZodString;
173
- }, z.core.$strip>, z.ZodObject<{
174
- _type: z.ZodLiteral<"Scalar">;
175
- name: z.ZodString;
176
- }, z.core.$strip>, z.ZodObject<{
177
- _type: z.ZodLiteral<"Enum">;
178
- name: z.ZodString;
179
- $ref: z.ZodString;
180
- }, z.core.$strip>]>;
181
- }, z.core.$strip>, z.ZodObject<{
182
- _type: z.ZodLiteral<"array">;
183
- nullable: z.ZodBoolean;
184
- type: z.ZodDiscriminatedUnion<[z.ZodObject<{
185
- _type: z.ZodLiteral<"InputType">;
186
- name: z.ZodString;
187
- $ref: z.ZodString;
188
- }, z.core.$strip>, z.ZodObject<{
189
- _type: z.ZodLiteral<"Scalar">;
190
- name: z.ZodString;
191
- }, z.core.$strip>, z.ZodObject<{
192
- _type: z.ZodLiteral<"Enum">;
193
- name: z.ZodString;
194
- $ref: z.ZodString;
195
- }, z.core.$strip>]>;
196
- }, z.core.$strip>]>;
197
- }, z.core.$strip>>;
198
- }, z.core.$strip>>;
199
- }, z.core.$strip>;
200
- client: z.ZodObject<{
201
- fragments: z.ZodRecord<z.ZodString, z.ZodObject<{
202
- sourceText: z.ZodString;
203
- spec: z.ZodDiscriminatedUnion<[z.ZodObject<{
204
- _type: z.ZodLiteral<"object">;
205
- name: z.ZodString;
206
- selections: z.ZodArray<typeof import("./client/fragment.js").objectSelection>;
207
- }, z.core.$strip>, z.ZodObject<{
208
- _type: z.ZodLiteral<"union">;
209
- unionName: z.ZodString;
210
- selections: z.ZodArray<import("./client/fragment.js").UnionSelectionZodType>;
211
- }, z.core.$strip>]>;
212
- }, z.core.$strip>>;
213
- operations: z.ZodRecord<z.ZodString, z.ZodObject<{
214
- name: z.ZodString;
215
- type: z.ZodEnum<{
216
- MUTATION: "MUTATION";
217
- QUERY: "QUERY";
218
- SUBSCRIPTION: "SUBSCRIPTION";
219
- }>;
220
- parameters: z.ZodRecord<z.ZodString, z.ZodObject<{
221
- nullable: z.ZodBoolean;
222
- spec: z.ZodDiscriminatedUnion<[z.ZodObject<{
223
- _type: z.ZodLiteral<"literal">;
224
- type: z.ZodDiscriminatedUnion<[z.ZodObject<{
225
- _type: z.ZodLiteral<"InputType">;
226
- name: z.ZodString;
227
- $ref: z.ZodString;
228
- }, z.core.$strip>, z.ZodObject<{
229
- _type: z.ZodLiteral<"Scalar">;
230
- name: z.ZodString;
231
- }, z.core.$strip>, z.ZodObject<{
232
- _type: z.ZodLiteral<"Enum">;
233
- name: z.ZodString;
234
- $ref: z.ZodString;
235
- }, z.core.$strip>]>;
236
- }, z.core.$strip>, z.ZodObject<{
237
- _type: z.ZodLiteral<"array">;
238
- nullable: z.ZodBoolean;
239
- type: z.ZodDiscriminatedUnion<[z.ZodObject<{
240
- _type: z.ZodLiteral<"InputType">;
241
- name: z.ZodString;
242
- $ref: z.ZodString;
243
- }, z.core.$strip>, z.ZodObject<{
244
- _type: z.ZodLiteral<"Scalar">;
245
- name: z.ZodString;
246
- }, z.core.$strip>, z.ZodObject<{
247
- _type: z.ZodLiteral<"Enum">;
248
- name: z.ZodString;
249
- $ref: z.ZodString;
250
- }, z.core.$strip>]>;
251
- }, z.core.$strip>]>;
252
- }, z.core.$strip>>;
253
- fragmentSpec: z.ZodDiscriminatedUnion<[z.ZodObject<{
254
- _type: z.ZodLiteral<"object">;
255
- name: z.ZodString;
256
- selections: z.ZodArray<typeof import("./client/fragment.js").objectSelection>;
257
- }, z.core.$strip>, z.ZodObject<{
258
- _type: z.ZodLiteral<"union">;
259
- unionName: z.ZodString;
260
- selections: z.ZodArray<import("./client/fragment.js").UnionSelectionZodType>;
261
- }, z.core.$strip>]>;
262
- sourceText: z.ZodString;
263
- }, z.core.$strip>>;
264
- directives: z.ZodRecord<z.ZodString, z.ZodObject<{
265
- name: z.ZodString;
266
- arguments: z.ZodRecord<z.ZodString, z.ZodObject<{
267
- nullable: z.ZodBoolean;
268
- spec: z.ZodDiscriminatedUnion<[z.ZodObject<{
269
- _type: z.ZodLiteral<"literal">;
270
- type: z.ZodDiscriminatedUnion<[z.ZodObject<{
271
- _type: z.ZodLiteral<"InputType">;
272
- name: z.ZodString;
273
- $ref: z.ZodString;
274
- }, z.core.$strip>, z.ZodObject<{
275
- _type: z.ZodLiteral<"Scalar">;
276
- name: z.ZodString;
277
- }, z.core.$strip>, z.ZodObject<{
278
- _type: z.ZodLiteral<"Enum">;
279
- name: z.ZodString;
280
- $ref: z.ZodString;
281
- }, z.core.$strip>]>;
282
- }, z.core.$strip>, z.ZodObject<{
283
- _type: z.ZodLiteral<"array">;
284
- nullable: z.ZodBoolean;
285
- type: z.ZodDiscriminatedUnion<[z.ZodObject<{
286
- _type: z.ZodLiteral<"InputType">;
287
- name: z.ZodString;
288
- $ref: z.ZodString;
289
- }, z.core.$strip>, z.ZodObject<{
290
- _type: z.ZodLiteral<"Scalar">;
291
- name: z.ZodString;
292
- }, z.core.$strip>, z.ZodObject<{
293
- _type: z.ZodLiteral<"Enum">;
294
- name: z.ZodString;
295
- $ref: z.ZodString;
296
- }, z.core.$strip>]>;
297
- }, z.core.$strip>]>;
298
- }, z.core.$strip>>;
299
- locations: z.ZodArray<z.ZodEnum<{
300
- MUTATION: "MUTATION";
301
- QUERY: "QUERY";
302
- SUBSCRIPTION: "SUBSCRIPTION";
303
- FIELD: "FIELD";
304
- FRAGMENT_DEFINITION: "FRAGMENT_DEFINITION";
305
- FRAGMENT_SPREAD: "FRAGMENT_SPREAD";
306
- INLINE_FRAGMENT: "INLINE_FRAGMENT";
307
- VARIABLE_DEFINITION: "VARIABLE_DEFINITION";
308
- }>>;
309
- }, z.core.$strip>>;
310
- }, z.core.$strip>;
311
- }, z.core.$strict>;
312
- export type RootSchema = z.infer<typeof rootSchema>;
1
+ import { ClientSchema } from './client/root.js';
2
+ import { ServerSchema } from './server.js';
3
+ export interface RootSchema {
4
+ server: ServerSchema;
5
+ client: ClientSchema;
6
+ }
package/schema/root.js CHANGED
@@ -1,7 +1 @@
1
- import { z } from 'zod/v4';
2
- import { serverSchema } from './server.js';
3
- import { clientSchema } from './client/root.js';
4
- export const rootSchema = z.object({
5
- server: serverSchema,
6
- client: clientSchema
7
- }).strict();
1
+ export {};
@@ -1,9 +1,17 @@
1
1
  import { describe, it, expect } from 'vitest';
2
- import testJSON from './test.json' with { type: 'json' };
3
- import { rootSchema } from './root.js';
4
- describe('Schema', () => {
2
+ import testServerJSON from './test-server.json' with { type: 'json' };
3
+ import testClientJSON from './test-client.json' with { type: 'json' };
4
+ import { serverSchema } from './server.js';
5
+ import { clientSchema } from './client/root.js';
6
+ describe('Server schema', () => {
5
7
  it('Should parse ok', () => {
6
- const result = rootSchema.safeParse(testJSON);
8
+ const result = serverSchema.safeParse(testServerJSON);
9
+ expect(result.success, result.error?.message || '').toBe(true);
10
+ });
11
+ });
12
+ describe('Client schema', () => {
13
+ it('Should parse ok', () => {
14
+ const result = clientSchema.safeParse(testClientJSON);
7
15
  expect(result.success, result.error?.message || '').toBe(true);
8
16
  });
9
17
  });
@@ -855,3 +855,4 @@ export declare const serverSchema: z.ZodObject<{
855
855
  }, z.core.$strip>>;
856
856
  }, z.core.$strip>>;
857
857
  }, z.core.$strip>;
858
+ export type ServerSchema = z.infer<typeof serverSchema>;