@goatlab/fluent 0.7.5 → 0.7.10

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 (85) hide show
  1. package/dist/BaseConnector.d.ts +8 -31
  2. package/dist/BaseConnector.js +11 -104
  3. package/dist/FluentConnectorInterface.d.ts +17 -0
  4. package/dist/FluentConnectorInterface.js +2 -0
  5. package/dist/TypeOrmConnector/TypeOrmConnector.d.ts +8 -12
  6. package/dist/TypeOrmConnector/TypeOrmConnector.js +183 -546
  7. package/dist/TypeOrmConnector/queryBuilder/mongodb/getMongoBaseAggregations.d.ts +7 -0
  8. package/dist/TypeOrmConnector/queryBuilder/mongodb/getMongoBaseAggregations.js +148 -0
  9. package/dist/TypeOrmConnector/queryBuilder/mongodb/getMongoFindAggregatedQuery.d.ts +6 -0
  10. package/dist/TypeOrmConnector/queryBuilder/mongodb/getMongoFindAggregatedQuery.js +34 -0
  11. package/dist/TypeOrmConnector/queryBuilder/mongodb/getMongoSelect.d.ts +4 -0
  12. package/dist/TypeOrmConnector/queryBuilder/mongodb/getMongoSelect.js +12 -0
  13. package/dist/TypeOrmConnector/queryBuilder/mongodb/getMongoWhere.d.ts +6 -0
  14. package/dist/TypeOrmConnector/queryBuilder/mongodb/getMongoWhere.js +166 -0
  15. package/dist/TypeOrmConnector/queryBuilder/sql/getQueryBuilderWhere.d.ts +8 -0
  16. package/dist/TypeOrmConnector/queryBuilder/sql/getQueryBuilderWhere.js +200 -0
  17. package/dist/TypeOrmConnector/queryBuilder/sql/getTypeOrmWhere.d.ts +6 -0
  18. package/dist/TypeOrmConnector/queryBuilder/sql/getTypeOrmWhere.js +207 -0
  19. package/dist/TypeOrmConnector/test/basic/goat.entity.d.ts +3 -3
  20. package/dist/TypeOrmConnector/test/basic/goat.entity.js +1 -1
  21. package/dist/TypeOrmConnector/test/docker/docker.d.ts +1 -1
  22. package/dist/TypeOrmConnector/test/docker/docker.js +3 -4
  23. package/dist/TypeOrmConnector/test/docker/mongo.d.ts +16 -0
  24. package/dist/TypeOrmConnector/test/docker/mongo.js +93 -0
  25. package/dist/TypeOrmConnector/test/docker/mysql.js +1 -1
  26. package/dist/TypeOrmConnector/test/mongo/car.mongo.repository.d.ts +4 -2
  27. package/dist/TypeOrmConnector/test/mongo/car.mongo.repository.js +6 -1
  28. package/dist/TypeOrmConnector/test/mongo/roles.mongo.repository.d.ts +3 -2
  29. package/dist/TypeOrmConnector/test/mongo/roles.mongo.repository.js +3 -1
  30. package/dist/TypeOrmConnector/test/mongo/user.mongo.repository.d.ts +2 -2
  31. package/dist/TypeOrmConnector/test/mongo/user.mongo.repository.js +2 -1
  32. package/dist/TypeOrmConnector/test/mysql/car.mysql.repository.d.ts +6 -2
  33. package/dist/TypeOrmConnector/test/mysql/car.mysql.repository.js +10 -1
  34. package/dist/TypeOrmConnector/test/mysql/mysqlDataSource.js +1 -1
  35. package/dist/TypeOrmConnector/test/mysql/roles.mysql.repository.d.ts +3 -2
  36. package/dist/TypeOrmConnector/test/mysql/roles.mysql.repository.js +3 -1
  37. package/dist/TypeOrmConnector/test/mysql/user.mysql.repository.d.ts +2 -2
  38. package/dist/TypeOrmConnector/test/mysql/user.mysql.repository.js +2 -1
  39. package/dist/TypeOrmConnector/test/relations/car/car.entity.d.ts +0 -1
  40. package/dist/TypeOrmConnector/test/relations/car/car.entity.js +0 -8
  41. package/dist/TypeOrmConnector/test/relations/car/car.output.schema.d.ts +511 -0
  42. package/dist/TypeOrmConnector/test/relations/car/car.output.schema.js +8 -0
  43. package/dist/TypeOrmConnector/test/relations/car/car.repositoryTypeOrm.d.ts +4 -2
  44. package/dist/TypeOrmConnector/test/relations/car/car.repositoryTypeOrm.js +6 -1
  45. package/dist/TypeOrmConnector/test/relations/car/car.schema.d.ts +2 -25
  46. package/dist/TypeOrmConnector/test/relations/car/car.schema.js +3 -8
  47. package/dist/TypeOrmConnector/test/relations/relationsTestsSuite.d.ts +1 -1
  48. package/dist/TypeOrmConnector/test/relations/relationsTestsSuite.js +435 -35
  49. package/dist/TypeOrmConnector/test/relations/roles/role.output.schema.d.ts +152 -0
  50. package/dist/TypeOrmConnector/test/relations/roles/role.output.schema.js +14 -0
  51. package/dist/TypeOrmConnector/test/relations/roles/role.schema.d.ts +2 -25
  52. package/dist/TypeOrmConnector/test/relations/roles/role.schema.js +2 -10
  53. package/dist/TypeOrmConnector/test/relations/roles/roles.repositoryTypeOrm.d.ts +3 -2
  54. package/dist/TypeOrmConnector/test/relations/roles/roles.repositoryTypeOrm.js +3 -1
  55. package/dist/TypeOrmConnector/test/relations/user/user.repositoryTypeOrm.d.ts +2 -2
  56. package/dist/TypeOrmConnector/test/relations/user/user.repositoryTypeOrm.js +2 -1
  57. package/dist/TypeOrmConnector/test/relations/user/user.schema.d.ts +465 -69
  58. package/dist/TypeOrmConnector/test/relations/user/user.schema.js +54 -5
  59. package/dist/TypeOrmConnector/util/clearEmpties.d.ts +1 -0
  60. package/dist/TypeOrmConnector/util/clearEmpties.js +25 -0
  61. package/dist/TypeOrmConnector/util/extractConditions.d.ts +6 -0
  62. package/dist/TypeOrmConnector/util/extractConditions.js +80 -0
  63. package/dist/TypeOrmConnector/util/extractInclude.d.ts +2 -0
  64. package/dist/TypeOrmConnector/util/extractInclude.js +25 -0
  65. package/dist/TypeOrmConnector/util/extractMetadataFromKeys.d.ts +12 -0
  66. package/dist/TypeOrmConnector/util/extractMetadataFromKeys.js +42 -0
  67. package/dist/TypeOrmConnector/util/extractOrderBy.d.ts +4 -0
  68. package/dist/TypeOrmConnector/util/extractOrderBy.js +18 -0
  69. package/dist/TypeOrmConnector/util/getRelationsFromModelGenerator.d.ts +19 -0
  70. package/dist/TypeOrmConnector/util/getRelationsFromModelGenerator.js +26 -0
  71. package/dist/TypeOrmConnector/util/getSelectedKeysFromRawSql.d.ts +1 -0
  72. package/dist/TypeOrmConnector/util/getSelectedKeysFromRawSql.js +20 -0
  73. package/dist/TypeOrmConnector/util/isAnyObject.d.ts +1 -0
  74. package/dist/TypeOrmConnector/util/isAnyObject.js +7 -0
  75. package/dist/TypeOrmConnector/util/nestQueryResults.d.ts +2 -0
  76. package/dist/TypeOrmConnector/util/nestQueryResults.js +31 -0
  77. package/dist/index.d.ts +5 -4
  78. package/dist/index.js +2 -1
  79. package/dist/loadRelations.js +8 -10
  80. package/dist/tsconfig.tsbuildinfo +1 -1
  81. package/dist/types.d.ts +37 -20
  82. package/package.json +4 -3
  83. package/CHANGELOG.md +0 -1072
  84. package/dist/TypeOrmConnector/test/mongo/mongo.memory.d.ts +0 -4
  85. package/dist/TypeOrmConnector/test/mongo/mongo.memory.js +0 -43
@@ -9,7 +9,7 @@ export declare const BreedSchema: z.ZodObject<{
9
9
  family?: string | undefined;
10
10
  members?: number | undefined;
11
11
  }>;
12
- export declare const UsersEntitySchema: z.ZodObject<{
12
+ export declare const userInputSchema: z.ZodObject<{
13
13
  id: z.ZodOptional<z.ZodString>;
14
14
  name: z.ZodString;
15
15
  age: z.ZodOptional<z.ZodNumber>;
@@ -23,84 +23,444 @@ export declare const UsersEntitySchema: z.ZodObject<{
23
23
  family?: string | undefined;
24
24
  members?: number | undefined;
25
25
  }>>;
26
- cars: z.ZodOptional<z.ZodArray<z.ZodObject<{
26
+ }, "strip", z.ZodTypeAny, {
27
+ id?: string | undefined;
28
+ age?: number | undefined;
29
+ breed?: {
30
+ family?: string | undefined;
31
+ members?: number | undefined;
32
+ } | undefined;
33
+ name: string;
34
+ }, {
35
+ id?: string | undefined;
36
+ age?: number | undefined;
37
+ breed?: {
38
+ family?: string | undefined;
39
+ members?: number | undefined;
40
+ } | undefined;
41
+ name: string;
42
+ }>;
43
+ export declare const rolesWithPivot: z.ZodObject<z.extendShape<{
44
+ id: z.ZodOptional<z.ZodString>;
45
+ name: z.ZodString;
46
+ }, {
47
+ pivot: z.ZodOptional<z.ZodObject<{
48
+ id: z.ZodOptional<z.ZodString>;
49
+ userId: z.ZodString;
50
+ roleId: z.ZodString;
51
+ }, "strip", z.ZodTypeAny, {
52
+ id?: string | undefined;
53
+ roleId: string;
54
+ userId: string;
55
+ }, {
56
+ id?: string | undefined;
57
+ roleId: string;
58
+ userId: string;
59
+ }>>;
60
+ }>, "strip", z.ZodTypeAny, {
61
+ pivot?: {
62
+ id?: string | undefined;
63
+ roleId: string;
64
+ userId: string;
65
+ } | undefined;
66
+ id?: string | undefined;
67
+ name: string;
68
+ }, {
69
+ pivot?: {
70
+ id?: string | undefined;
71
+ roleId: string;
72
+ userId: string;
73
+ } | undefined;
74
+ id?: string | undefined;
75
+ name: string;
76
+ }>;
77
+ export declare const userWithRoles: z.ZodObject<z.extendShape<{
78
+ id: z.ZodOptional<z.ZodString>;
79
+ name: z.ZodString;
80
+ age: z.ZodOptional<z.ZodNumber>;
81
+ breed: z.ZodOptional<z.ZodObject<{
82
+ family: z.ZodOptional<z.ZodString>;
83
+ members: z.ZodOptional<z.ZodNumber>;
84
+ }, "strip", z.ZodTypeAny, {
85
+ family?: string | undefined;
86
+ members?: number | undefined;
87
+ }, {
88
+ family?: string | undefined;
89
+ members?: number | undefined;
90
+ }>>;
91
+ }, {
92
+ id: z.ZodString;
93
+ roles: z.ZodOptional<z.ZodArray<z.ZodObject<z.extendShape<{
27
94
  id: z.ZodOptional<z.ZodString>;
28
95
  name: z.ZodString;
29
- userId: z.ZodOptional<z.ZodString>;
30
- user: z.ZodOptional<z.ZodObject<{
96
+ }, {
97
+ pivot: z.ZodOptional<z.ZodObject<{
31
98
  id: z.ZodOptional<z.ZodString>;
32
- name: z.ZodString;
33
- age: z.ZodOptional<z.ZodNumber>;
99
+ userId: z.ZodString;
100
+ roleId: z.ZodString;
34
101
  }, "strip", z.ZodTypeAny, {
35
102
  id?: string | undefined;
36
- age?: number | undefined;
37
- name: string;
103
+ roleId: string;
104
+ userId: string;
38
105
  }, {
39
106
  id?: string | undefined;
40
- age?: number | undefined;
41
- name: string;
107
+ roleId: string;
108
+ userId: string;
42
109
  }>>;
43
- }, "strip", z.ZodTypeAny, {
44
- id?: string | undefined;
45
- userId?: string | undefined;
46
- user?: {
110
+ }>, "strip", z.ZodTypeAny, {
111
+ pivot?: {
47
112
  id?: string | undefined;
48
- age?: number | undefined;
49
- name: string;
113
+ roleId: string;
114
+ userId: string;
50
115
  } | undefined;
116
+ id?: string | undefined;
51
117
  name: string;
52
118
  }, {
53
- id?: string | undefined;
54
- userId?: string | undefined;
55
- user?: {
119
+ pivot?: {
56
120
  id?: string | undefined;
57
- age?: number | undefined;
58
- name: string;
121
+ roleId: string;
122
+ userId: string;
59
123
  } | undefined;
124
+ id?: string | undefined;
60
125
  name: string;
61
126
  }>, "many">>;
62
- roles: z.ZodOptional<z.ZodArray<z.ZodObject<{
127
+ }>, "strip", z.ZodTypeAny, {
128
+ roles?: any;
129
+ age?: any;
130
+ breed?: any;
131
+ id: any;
132
+ name: any;
133
+ }, {
134
+ roles?: any;
135
+ age?: any;
136
+ breed?: any;
137
+ id: any;
138
+ name: any;
139
+ }>;
140
+ export declare const userOutputSchema: z.ZodObject<z.extendShape<z.extendShape<{
141
+ id: z.ZodOptional<z.ZodString>;
142
+ name: z.ZodString;
143
+ age: z.ZodOptional<z.ZodNumber>;
144
+ breed: z.ZodOptional<z.ZodObject<{
145
+ family: z.ZodOptional<z.ZodString>;
146
+ members: z.ZodOptional<z.ZodNumber>;
147
+ }, "strip", z.ZodTypeAny, {
148
+ family?: string | undefined;
149
+ members?: number | undefined;
150
+ }, {
151
+ family?: string | undefined;
152
+ members?: number | undefined;
153
+ }>>;
154
+ }, {
155
+ id: z.ZodString;
156
+ roles: z.ZodOptional<z.ZodArray<z.ZodObject<z.extendShape<{
63
157
  id: z.ZodOptional<z.ZodString>;
64
158
  name: z.ZodString;
65
- users: z.ZodOptional<z.ZodArray<z.ZodObject<{
159
+ }, {
160
+ pivot: z.ZodOptional<z.ZodObject<{
66
161
  id: z.ZodOptional<z.ZodString>;
67
- name: z.ZodString;
68
- age: z.ZodOptional<z.ZodNumber>;
162
+ userId: z.ZodString;
163
+ roleId: z.ZodString;
69
164
  }, "strip", z.ZodTypeAny, {
70
165
  id?: string | undefined;
71
- age?: number | undefined;
72
- name: string;
166
+ roleId: string;
167
+ userId: string;
73
168
  }, {
74
169
  id?: string | undefined;
75
- age?: number | undefined;
76
- name: string;
77
- }>, "many">>;
78
- }, "strip", z.ZodTypeAny, {
79
- id?: string | undefined;
80
- users?: {
170
+ roleId: string;
171
+ userId: string;
172
+ }>>;
173
+ }>, "strip", z.ZodTypeAny, {
174
+ pivot?: {
81
175
  id?: string | undefined;
82
- age?: number | undefined;
83
- name: string;
84
- }[] | undefined;
176
+ roleId: string;
177
+ userId: string;
178
+ } | undefined;
179
+ id?: string | undefined;
85
180
  name: string;
86
181
  }, {
87
- id?: string | undefined;
88
- users?: {
182
+ pivot?: {
89
183
  id?: string | undefined;
90
- age?: number | undefined;
91
- name: string;
92
- }[] | undefined;
184
+ roleId: string;
185
+ userId: string;
186
+ } | undefined;
187
+ id?: string | undefined;
93
188
  name: string;
94
189
  }>, "many">>;
95
- }, "strip", z.ZodTypeAny, {
96
- id?: string | undefined;
190
+ }>, {
191
+ cars: z.ZodOptional<z.ZodArray<z.ZodObject<z.extendShape<any, {
192
+ [x: string]: z.ZodOptional<z.ZodObject<z.extendShape<any, {
193
+ [x: string]: z.ZodArray<z.ZodOptional<z.ZodObject<z.extendShape<any, {
194
+ [x: string]: z.ZodOptional<z.ZodObject<z.extendShape<any, {
195
+ [x: string]: z.ZodOptional<z.ZodArray<z.ZodObject<z.extendShape<any, {
196
+ [x: string]: z.ZodObject<z.extendShape<any, {
197
+ [x: string]: z.ZodArray<z.ZodOptional<z.ZodObject<z.extendShape<any, {
198
+ [x: string]: z.ZodOptional<z.ZodObject<z.extendShape<any, {
199
+ [x: string]: z.ZodArray<z.ZodOptional<z.AnyZodObject>, "many">;
200
+ }>, any, any, {
201
+ [x: symbol]: any;
202
+ [x: string]: ({
203
+ [x: string]: any;
204
+ } | undefined)[];
205
+ }, {
206
+ [x: symbol]: any;
207
+ [x: string]: ({
208
+ [x: string]: any;
209
+ } | undefined)[];
210
+ }>>;
211
+ }>, any, any, {
212
+ [x: string]: {
213
+ [x: symbol]: any;
214
+ [x: string]: ({
215
+ [x: string]: any;
216
+ } | undefined)[];
217
+ } | undefined;
218
+ [x: symbol]: any;
219
+ }, {
220
+ [x: string]: {
221
+ [x: symbol]: any;
222
+ [x: string]: ({
223
+ [x: string]: any;
224
+ } | undefined)[];
225
+ } | undefined;
226
+ [x: symbol]: any;
227
+ }>>, "many">;
228
+ }>, any, any, {
229
+ [x: symbol]: any;
230
+ [x: string]: ({
231
+ [x: string]: {
232
+ [x: symbol]: any;
233
+ [x: string]: ({
234
+ [x: string]: any;
235
+ } | undefined)[];
236
+ } | undefined;
237
+ [x: symbol]: any;
238
+ } | undefined)[];
239
+ }, {
240
+ [x: symbol]: any;
241
+ [x: string]: ({
242
+ [x: string]: {
243
+ [x: symbol]: any;
244
+ [x: string]: ({
245
+ [x: string]: any;
246
+ } | undefined)[];
247
+ } | undefined;
248
+ [x: symbol]: any;
249
+ } | undefined)[];
250
+ }>;
251
+ }>, any, any, {
252
+ [x: symbol]: any;
253
+ [x: string]: {
254
+ [x: symbol]: any;
255
+ [x: string]: ({
256
+ [x: string]: {
257
+ [x: symbol]: any;
258
+ [x: string]: ({
259
+ [x: string]: any;
260
+ } | undefined)[];
261
+ } | undefined;
262
+ [x: symbol]: any;
263
+ } | undefined)[];
264
+ };
265
+ }, {
266
+ [x: symbol]: any;
267
+ [x: string]: {
268
+ [x: symbol]: any;
269
+ [x: string]: ({
270
+ [x: string]: {
271
+ [x: symbol]: any;
272
+ [x: string]: ({
273
+ [x: string]: any;
274
+ } | undefined)[];
275
+ } | undefined;
276
+ [x: symbol]: any;
277
+ } | undefined)[];
278
+ };
279
+ }>, "many">>;
280
+ }>, any, any, {
281
+ [x: string]: {
282
+ [x: symbol]: any;
283
+ [x: string]: {
284
+ [x: symbol]: any;
285
+ [x: string]: ({
286
+ [x: string]: {
287
+ [x: symbol]: any;
288
+ [x: string]: ({
289
+ [x: string]: any;
290
+ } | undefined)[];
291
+ } | undefined;
292
+ [x: symbol]: any;
293
+ } | undefined)[];
294
+ };
295
+ }[] | undefined;
296
+ [x: symbol]: any;
297
+ }, {
298
+ [x: string]: {
299
+ [x: symbol]: any;
300
+ [x: string]: {
301
+ [x: symbol]: any;
302
+ [x: string]: ({
303
+ [x: string]: {
304
+ [x: symbol]: any;
305
+ [x: string]: ({
306
+ [x: string]: any;
307
+ } | undefined)[];
308
+ } | undefined;
309
+ [x: symbol]: any;
310
+ } | undefined)[];
311
+ };
312
+ }[] | undefined;
313
+ [x: symbol]: any;
314
+ }>>;
315
+ }>, any, any, {
316
+ [x: string]: {
317
+ [x: string]: {
318
+ [x: symbol]: any;
319
+ [x: string]: {
320
+ [x: symbol]: any;
321
+ [x: string]: ({
322
+ [x: string]: {
323
+ [x: symbol]: any;
324
+ [x: string]: ({
325
+ [x: string]: any;
326
+ } | undefined)[];
327
+ } | undefined;
328
+ [x: symbol]: any;
329
+ } | undefined)[];
330
+ };
331
+ }[] | undefined;
332
+ [x: symbol]: any;
333
+ } | undefined;
334
+ [x: symbol]: any;
335
+ }, {
336
+ [x: string]: {
337
+ [x: string]: {
338
+ [x: symbol]: any;
339
+ [x: string]: {
340
+ [x: symbol]: any;
341
+ [x: string]: ({
342
+ [x: string]: {
343
+ [x: symbol]: any;
344
+ [x: string]: ({
345
+ [x: string]: any;
346
+ } | undefined)[];
347
+ } | undefined;
348
+ [x: symbol]: any;
349
+ } | undefined)[];
350
+ };
351
+ }[] | undefined;
352
+ [x: symbol]: any;
353
+ } | undefined;
354
+ [x: symbol]: any;
355
+ }>>, "many">;
356
+ }>, any, any, {
357
+ [x: symbol]: any;
358
+ [x: string]: ({
359
+ [x: string]: {
360
+ [x: string]: {
361
+ [x: symbol]: any;
362
+ [x: string]: {
363
+ [x: symbol]: any;
364
+ [x: string]: ({
365
+ [x: string]: {
366
+ [x: symbol]: any;
367
+ [x: string]: ({
368
+ [x: string]: any;
369
+ } | undefined)[];
370
+ } | undefined;
371
+ [x: symbol]: any;
372
+ } | undefined)[];
373
+ };
374
+ }[] | undefined;
375
+ [x: symbol]: any;
376
+ } | undefined;
377
+ [x: symbol]: any;
378
+ } | undefined)[];
379
+ }, {
380
+ [x: symbol]: any;
381
+ [x: string]: ({
382
+ [x: string]: {
383
+ [x: string]: {
384
+ [x: symbol]: any;
385
+ [x: string]: {
386
+ [x: symbol]: any;
387
+ [x: string]: ({
388
+ [x: string]: {
389
+ [x: symbol]: any;
390
+ [x: string]: ({
391
+ [x: string]: any;
392
+ } | undefined)[];
393
+ } | undefined;
394
+ [x: symbol]: any;
395
+ } | undefined)[];
396
+ };
397
+ }[] | undefined;
398
+ [x: symbol]: any;
399
+ } | undefined;
400
+ [x: symbol]: any;
401
+ } | undefined)[];
402
+ }>>;
403
+ }>, any, any, {
404
+ [x: string]: {
405
+ [x: symbol]: any;
406
+ [x: string]: ({
407
+ [x: string]: {
408
+ [x: string]: {
409
+ [x: symbol]: any;
410
+ [x: string]: {
411
+ [x: symbol]: any;
412
+ [x: string]: ({
413
+ [x: string]: {
414
+ [x: symbol]: any;
415
+ [x: string]: ({
416
+ [x: string]: any;
417
+ } | undefined)[];
418
+ } | undefined;
419
+ [x: symbol]: any;
420
+ } | undefined)[];
421
+ };
422
+ }[] | undefined;
423
+ [x: symbol]: any;
424
+ } | undefined;
425
+ [x: symbol]: any;
426
+ } | undefined)[];
427
+ } | undefined;
428
+ [x: symbol]: any;
429
+ }, {
430
+ [x: string]: {
431
+ [x: symbol]: any;
432
+ [x: string]: ({
433
+ [x: string]: {
434
+ [x: string]: {
435
+ [x: symbol]: any;
436
+ [x: string]: {
437
+ [x: symbol]: any;
438
+ [x: string]: ({
439
+ [x: string]: {
440
+ [x: symbol]: any;
441
+ [x: string]: ({
442
+ [x: string]: any;
443
+ } | undefined)[];
444
+ } | undefined;
445
+ [x: symbol]: any;
446
+ } | undefined)[];
447
+ };
448
+ }[] | undefined;
449
+ [x: symbol]: any;
450
+ } | undefined;
451
+ [x: symbol]: any;
452
+ } | undefined)[];
453
+ } | undefined;
454
+ [x: symbol]: any;
455
+ }>, "many">>;
456
+ }>, "strip", z.ZodTypeAny, {
97
457
  roles?: {
98
- id?: string | undefined;
99
- users?: {
458
+ pivot?: {
100
459
  id?: string | undefined;
101
- age?: number | undefined;
102
- name: string;
103
- }[] | undefined;
460
+ roleId: string;
461
+ userId: string;
462
+ } | undefined;
463
+ id?: string | undefined;
104
464
  name: string;
105
465
  }[] | undefined;
106
466
  age?: number | undefined;
@@ -109,25 +469,42 @@ export declare const UsersEntitySchema: z.ZodObject<{
109
469
  members?: number | undefined;
110
470
  } | undefined;
111
471
  cars?: {
112
- id?: string | undefined;
113
- userId?: string | undefined;
114
- user?: {
115
- id?: string | undefined;
116
- age?: number | undefined;
117
- name: string;
472
+ [x: string]: {
473
+ [x: symbol]: any;
474
+ [x: string]: ({
475
+ [x: string]: {
476
+ [x: string]: {
477
+ [x: symbol]: any;
478
+ [x: string]: {
479
+ [x: symbol]: any;
480
+ [x: string]: ({
481
+ [x: string]: {
482
+ [x: symbol]: any;
483
+ [x: string]: ({
484
+ [x: string]: any;
485
+ } | undefined)[];
486
+ } | undefined;
487
+ [x: symbol]: any;
488
+ } | undefined)[];
489
+ };
490
+ }[] | undefined;
491
+ [x: symbol]: any;
492
+ } | undefined;
493
+ [x: symbol]: any;
494
+ } | undefined)[];
118
495
  } | undefined;
119
- name: string;
496
+ [x: symbol]: any;
120
497
  }[] | undefined;
498
+ id: string;
121
499
  name: string;
122
500
  }, {
123
- id?: string | undefined;
124
501
  roles?: {
125
- id?: string | undefined;
126
- users?: {
502
+ pivot?: {
127
503
  id?: string | undefined;
128
- age?: number | undefined;
129
- name: string;
130
- }[] | undefined;
504
+ roleId: string;
505
+ userId: string;
506
+ } | undefined;
507
+ id?: string | undefined;
131
508
  name: string;
132
509
  }[] | undefined;
133
510
  age?: number | undefined;
@@ -136,15 +513,34 @@ export declare const UsersEntitySchema: z.ZodObject<{
136
513
  members?: number | undefined;
137
514
  } | undefined;
138
515
  cars?: {
139
- id?: string | undefined;
140
- userId?: string | undefined;
141
- user?: {
142
- id?: string | undefined;
143
- age?: number | undefined;
144
- name: string;
516
+ [x: string]: {
517
+ [x: symbol]: any;
518
+ [x: string]: ({
519
+ [x: string]: {
520
+ [x: string]: {
521
+ [x: symbol]: any;
522
+ [x: string]: {
523
+ [x: symbol]: any;
524
+ [x: string]: ({
525
+ [x: string]: {
526
+ [x: symbol]: any;
527
+ [x: string]: ({
528
+ [x: string]: any;
529
+ } | undefined)[];
530
+ } | undefined;
531
+ [x: symbol]: any;
532
+ } | undefined)[];
533
+ };
534
+ }[] | undefined;
535
+ [x: symbol]: any;
536
+ } | undefined;
537
+ [x: symbol]: any;
538
+ } | undefined)[];
145
539
  } | undefined;
146
- name: string;
540
+ [x: symbol]: any;
147
541
  }[] | undefined;
542
+ id: string;
148
543
  name: string;
149
544
  }>;
150
- export declare type UsersEntityInputSchema = z.infer<typeof UsersEntitySchema>;
545
+ export declare type UsersDtoIn = z.infer<typeof userInputSchema>;
546
+ export declare type UsersDtoOut = z.infer<typeof userOutputSchema>;
@@ -1,18 +1,67 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UsersEntitySchema = exports.BreedSchema = void 0;
3
+ exports.userOutputSchema = exports.userWithRoles = exports.rolesWithPivot = exports.userInputSchema = exports.BreedSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const car_schema_1 = require("../car/car.schema");
6
6
  const role_schema_1 = require("../roles/role.schema");
7
+ const roles_user_schema_1 = require("../roles/roles_user.schema");
8
+ const ZodManyToOne = ({ manySchema, oneSchema, manyKey, oneKey }) => {
9
+ return manySchema
10
+ .extend({
11
+ [oneKey]: oneSchema.extend({
12
+ [manyKey]: manySchema
13
+ .extend({
14
+ [oneKey]: oneSchema
15
+ .extend({
16
+ [manyKey]: manySchema
17
+ .extend({
18
+ [oneKey]: oneSchema.extend({
19
+ [manyKey]: manySchema
20
+ .extend({
21
+ [oneKey]: oneSchema
22
+ .extend({
23
+ [manyKey]: manySchema.optional().array()
24
+ })
25
+ .optional()
26
+ })
27
+ .optional()
28
+ .array()
29
+ })
30
+ })
31
+ .array()
32
+ .optional()
33
+ })
34
+ .optional()
35
+ })
36
+ .optional()
37
+ .array()
38
+ }).optional()
39
+ })
40
+ .array()
41
+ .optional();
42
+ };
7
43
  exports.BreedSchema = zod_1.z.object({
8
44
  family: zod_1.z.string().optional(),
9
45
  members: zod_1.z.number().optional()
10
46
  });
11
- exports.UsersEntitySchema = zod_1.z.object({
47
+ exports.userInputSchema = zod_1.z.object({
12
48
  id: zod_1.z.string().optional(),
13
49
  name: zod_1.z.string(),
14
50
  age: zod_1.z.number().optional(),
15
- breed: exports.BreedSchema.optional(),
16
- cars: car_schema_1.CarsEntitySchema.array().optional(),
17
- roles: role_schema_1.RoleEntitySchema.array().optional()
51
+ breed: exports.BreedSchema.optional()
52
+ });
53
+ exports.rolesWithPivot = role_schema_1.RoleInputSchema.extend({
54
+ pivot: roles_user_schema_1.RolesUserSchema.optional()
55
+ });
56
+ exports.userWithRoles = exports.userInputSchema.extend({
57
+ id: zod_1.z.string(),
58
+ roles: exports.rolesWithPivot.array().optional()
59
+ });
60
+ exports.userOutputSchema = exports.userWithRoles.extend({
61
+ cars: ZodManyToOne({
62
+ manySchema: car_schema_1.carInputSchema,
63
+ oneSchema: exports.userWithRoles,
64
+ manyKey: 'cars',
65
+ oneKey: 'user'
66
+ })
18
67
  });
@@ -0,0 +1 @@
1
+ export declare const clearEmpties: (object: any) => any;