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