@postxl/generator 0.38.2 → 0.40.0

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 (56) hide show
  1. package/dist/generator.js +43 -21
  2. package/dist/generators/enums/types.generator.js +1 -1
  3. package/dist/generators/indices/businesslogic-actiontypes.generator.js +1 -1
  4. package/dist/generators/indices/businesslogic-update-module.generator.js +2 -2
  5. package/dist/generators/indices/businesslogic-update-service.generator.js +1 -1
  6. package/dist/generators/indices/businesslogic-view-module.generator.js +2 -2
  7. package/dist/generators/indices/businesslogic-view-service.generator.js +1 -1
  8. package/dist/generators/indices/{seed-service.generator.d.ts → data-types.generator.d.ts} +2 -2
  9. package/dist/generators/indices/data-types.generator.js +48 -0
  10. package/dist/generators/indices/datamock-module.generator.js +11 -11
  11. package/dist/generators/indices/datamocker.generator.js +1 -1
  12. package/dist/generators/indices/datamodule.generator.js +34 -52
  13. package/dist/generators/indices/dataservice.generator.js +202 -9
  14. package/dist/generators/indices/dispatcher-service.generator.js +20 -10
  15. package/dist/generators/indices/emptydatabasemigration.generator.d.ts +2 -0
  16. package/dist/generators/indices/emptydatabasemigration.generator.js +14 -7
  17. package/dist/generators/indices/importexport-convert-import-functions.generator.d.ts +9 -0
  18. package/dist/generators/indices/importexport-convert-import-functions.generator.js +528 -0
  19. package/dist/generators/indices/importexport-exporter-class.generator.d.ts +9 -0
  20. package/dist/generators/indices/importexport-exporter-class.generator.js +116 -0
  21. package/dist/generators/indices/importexport-import-service.generator.d.ts +9 -0
  22. package/dist/generators/indices/importexport-import-service.generator.js +563 -0
  23. package/dist/generators/indices/{seeddata-type.generator.d.ts → importexport-types.generator.d.ts} +2 -2
  24. package/dist/generators/indices/importexport-types.generator.js +234 -0
  25. package/dist/generators/indices/repositories.generator.js +8 -8
  26. package/dist/generators/indices/seed-migration.generator.js +1 -1
  27. package/dist/generators/indices/seed-template.generator.js +1 -1
  28. package/dist/generators/indices/selectors.generator.d.ts +7 -0
  29. package/dist/generators/indices/selectors.generator.js +82 -0
  30. package/dist/generators/indices/{seed-template-decoder.generator.d.ts → testdata-service.generator.d.ts} +2 -2
  31. package/dist/generators/indices/testdata-service.generator.js +71 -0
  32. package/dist/generators/models/businesslogic-update.generator.js +6 -6
  33. package/dist/generators/models/businesslogic-view.generator.js +4 -4
  34. package/dist/generators/models/importexport-decoder.generator.d.ts +23 -0
  35. package/dist/generators/models/importexport-decoder.generator.js +234 -0
  36. package/dist/generators/models/react.generator/library.generator.js +4 -0
  37. package/dist/generators/models/react.generator/modals.generator.js +35 -8
  38. package/dist/generators/models/repository.generator.js +156 -18
  39. package/dist/generators/models/route.generator.js +2 -2
  40. package/dist/generators/models/stub.generator.js +1 -1
  41. package/dist/generators/models/types.generator.js +1 -1
  42. package/dist/lib/id-collector.d.ts +43 -0
  43. package/dist/lib/id-collector.js +53 -0
  44. package/dist/lib/imports.d.ts +1 -1
  45. package/dist/lib/meta.d.ts +480 -122
  46. package/dist/lib/meta.js +187 -74
  47. package/dist/lib/schema/schema.d.ts +58 -43
  48. package/dist/lib/schema/types.d.ts +63 -12
  49. package/dist/lib/schema/types.js +27 -7
  50. package/dist/lib/utils/string.d.ts +1 -0
  51. package/dist/lib/utils/string.js +1 -0
  52. package/dist/prisma/parse.js +4 -4
  53. package/package.json +2 -2
  54. package/dist/generators/indices/seed-service.generator.js +0 -356
  55. package/dist/generators/indices/seed-template-decoder.generator.js +0 -151
  56. package/dist/generators/indices/seeddata-type.generator.js +0 -42
@@ -13,27 +13,38 @@ export type SchemaMetaData = {
13
13
  * Path that may be used to import from the action module.
14
14
  */
15
15
  importPath: Types.Path;
16
- /**
17
- * Path to the file containing the execution interface definition.
18
- */
19
- actionExecutionInterfaceFilePath: Types.Path;
20
- /**
21
- * The name of the interface that handles the action execution.
22
- */
23
- actionExecutionInterface: Types.ClassName;
24
- /**
25
- * The name of the class that handles the action execution.
26
- */
27
- actionExecutionClass: Types.ClassName;
28
- /**
29
- * The name of the mock for the actionExecution class.
30
- */
31
- actionExecutionMock: Types.ClassName;
32
- /**
33
- * Path to the file containing the dispatcher service class definition.
34
- */
35
- dispatcherServiceFilePath: Types.Path;
16
+ actionExecution: {
17
+ /**
18
+ * Path to the file containing the execution interface definition.
19
+ */
20
+ filePath: Types.Path;
21
+ /**
22
+ * The name of the interface that handles the action execution.
23
+ */
24
+ interface: Types.ClassName;
25
+ /**
26
+ * The name of the class that handles the action execution.
27
+ */
28
+ class: Types.ClassName;
29
+ /**
30
+ * The name of the mock for the actionExecution class.
31
+ */
32
+ mock: Types.ClassName;
33
+ };
34
+ dispatcherService: {
35
+ /**
36
+ * Path to the file containing the dispatcher service class definition.
37
+ */
38
+ filePath: Types.Path;
39
+ /**
40
+ * The name of the dispatcher service class.
41
+ */
42
+ class: Types.ClassName;
43
+ };
36
44
  };
45
+ /**
46
+ * Meta data for the data generators
47
+ */
37
48
  data: {
38
49
  /**
39
50
  * The name of the Module class
@@ -51,22 +62,76 @@ export type SchemaMetaData = {
51
62
  * Path to the file containing the mock data for the database.
52
63
  */
53
64
  dataMockModuleFilePath: Types.Path;
65
+ repository: {
66
+ /**
67
+ * Path to the file containing the repository type definition.
68
+ */
69
+ typeFilePath: Types.Path;
70
+ /**
71
+ * Name of the repository type.
72
+ */
73
+ typeName: Types.TypeName;
74
+ /**
75
+ * Path to the file containing the array with all repositories.
76
+ */
77
+ constFilePath: Types.Path;
78
+ /**
79
+ * Path to the file containing the index file for the repositories.
80
+ */
81
+ indexFilePath: Types.Path;
82
+ };
83
+ types: {
84
+ /**
85
+ * Path to the types definition.
86
+ */
87
+ filePath: Types.Path;
88
+ /**
89
+ * The name of the BulkMutation type.
90
+ */
91
+ bulkMutation: Types.TypeName;
92
+ /**
93
+ * The name of the generic BulkMutation type for a model
94
+ */
95
+ bulkMutationForModel: Types.TypeName;
96
+ };
54
97
  /**
55
- * Path to the file containing data service class definitions.
56
- */
57
- dataServiceFilePath: Types.Path;
58
- /**
59
- * Path to the file containing the repository type definition.
98
+ * Name of the mock data module class.
60
99
  */
61
- repositoryTypeFilePath: Types.Path;
100
+ dataMockModuleName: Types.ClassName;
62
101
  /**
63
- * Name of the repository type.
102
+ * Name of the data mock type/interface.
64
103
  */
65
- repositoryTypeName: Types.TypeName;
104
+ dataMockDataType: Types.TypeName;
105
+ dataService: {
106
+ /**
107
+ * Path to the file containing data service class definitions.
108
+ */
109
+ filePath: Types.Path;
110
+ /**
111
+ * Name of the data service class.
112
+ */
113
+ class: Types.ClassName;
114
+ /**
115
+ * Name of the function that performs BulkMutations.
116
+ */
117
+ executeBulkMutations: Types.FunctionName;
118
+ /**
119
+ * Name of the function that performs BulkMutation.
120
+ */
121
+ executeBulkMutation: Types.FunctionName;
122
+ };
66
123
  /**
67
124
  * Path to the file containing data mocker class definitions.
68
125
  */
69
126
  dataMockerFilePath: Types.Path;
127
+ /**
128
+ * Path to the file containing component selectors for e2e tests.
129
+ */
130
+ selectorsFilePath: Types.Path;
131
+ /**
132
+ * Path to the file containing the testDataService class definition.
133
+ */
134
+ testDataServiceFilePath: Types.Path;
70
135
  /**
71
136
  * Path to the file containing data mocker class definitions.
72
137
  */
@@ -76,17 +141,268 @@ export type SchemaMetaData = {
76
141
  */
77
142
  dataMockerStubImportPath: Types.Path;
78
143
  /**
79
- * Path to the file containing the array with all repositories.
144
+ * Path to the file containing the index file for the subs.
80
145
  */
81
- repositoriesConstFilePath: Types.Path;
146
+ stubIndexFilePath: Types.Path;
147
+ };
148
+ /**
149
+ * Meta data for import/export operations.
150
+ */
151
+ importExport: {
82
152
  /**
83
- * Path to the file containing the index file for the repositories.
153
+ * Path that may be used to import from the import-export module.
84
154
  */
85
- repositoriesIndexFilePath: Types.Path;
155
+ importPath: Types.Path;
86
156
  /**
87
- * Path to the file containing the index file for the subs.
157
+ * Meta data for decoder functions.
88
158
  */
89
- stubIndexFilePath: Types.Path;
159
+ decoder: {
160
+ /**
161
+ * Path to the file containing the import-export decoder index.
162
+ */
163
+ indexFilePath: Types.Path;
164
+ /**
165
+ * Path to the file containing the data decoder
166
+ */
167
+ fullDecoderFilePath: Types.Path;
168
+ /**
169
+ * Name of the data decoder function
170
+ */
171
+ fullDecoderName: Types.FunctionName;
172
+ /**
173
+ * Name of the data encoder function
174
+ */
175
+ fullEncoderFunctionName: Types.FunctionName;
176
+ /**
177
+ * Name of the type that represents the data in encoded Excel format
178
+ */
179
+ encodedExcelDataTypeName: Types.TypeName;
180
+ /**
181
+ * Name of the type that represents the data in the PXL model format
182
+ */
183
+ decodedPXLModelDataTypeName: Types.TypeName;
184
+ };
185
+ /**
186
+ * Meta data for the exporter class.
187
+ */
188
+ exporterClass: {
189
+ /**
190
+ * Path to the file containing the exporter class.
191
+ */
192
+ filePath: Types.Path;
193
+ /**
194
+ * The name of the exporter class.
195
+ */
196
+ name: Types.ClassName;
197
+ };
198
+ exportService: {
199
+ /**
200
+ * Path to the file containing the export service class.
201
+ */
202
+ filePath: Types.Path;
203
+ /**
204
+ * The name of the export service class.
205
+ */
206
+ name: Types.ClassName;
207
+ };
208
+ importService: {
209
+ /**
210
+ * Path to the file containing the import service class.
211
+ */
212
+ filePath: Types.Path;
213
+ /**
214
+ * The name of the import service class.
215
+ */
216
+ name: Types.ClassName;
217
+ /**
218
+ * Name of the instantiated import service as used in other services.
219
+ *
220
+ * Background: Normally, NestJS's dependency injection would be used to inject the import service into other services.
221
+ * However, due to a circular dependency between the import service and the dispatcher service, this is not possible.
222
+ * Instead, the dispatcher service has a public instance of the import service, which is set in the constructor of the import service.
223
+ * The `sharedName` is the name of this public instance.
224
+ */
225
+ sharedName: Types.VariableName;
226
+ };
227
+ /**
228
+ * Meta data for functions that handle the import of Excel data.
229
+ */
230
+ converterFunctions: {
231
+ /**
232
+ * Path to the file containing the import function.
233
+ */
234
+ filePath: Types.Path;
235
+ /**
236
+ * Name of the function that convert import data to BulkMutations.
237
+ */
238
+ importedDataToBulkMutations: Types.FunctionName;
239
+ /**
240
+ * Name of the function that converts a delta to BulkMutations.
241
+ */
242
+ deltaToBulkMutations: Types.FunctionName;
243
+ /**
244
+ * Name of the function that converts mock data to BulkMutations.
245
+ */
246
+ mockDataToBulkMutations: Types.FunctionName;
247
+ };
248
+ /**
249
+ * Meta data for the import export types file.
250
+ */
251
+ types: {
252
+ /**
253
+ * Path to the types definition.
254
+ */
255
+ filePath: Types.Path;
256
+ /**
257
+ * The name of the type that represents the delta of all models.
258
+ */
259
+ delta: Types.TypeName;
260
+ delta_Model: {
261
+ /**
262
+ * The name of the type that represents the delta of a model.
263
+ */
264
+ type: Types.TypeName;
265
+ create: {
266
+ /**
267
+ * The name of the type that represents the items of a model that should be created.
268
+ */
269
+ type: Types.TypeName;
270
+ /**
271
+ * The discriminant for the delta of a model that should be created.
272
+ */
273
+ discriminant: Types.DiscriminantName;
274
+ /**
275
+ * The name of the type guard function that checks if a delta item is a create delta.
276
+ */
277
+ typeGuard: Types.FunctionName;
278
+ };
279
+ update: {
280
+ /**
281
+ * The name of the type that represents the delta of existing model items that should be updated.
282
+ */
283
+ type: Types.TypeName;
284
+ /**
285
+ * The discriminant for the delta of existing model items that should be updated.
286
+ */
287
+ discriminant: Types.DiscriminantName;
288
+ /**
289
+ * The name of the type guard function that checks if a delta item is an update delta.
290
+ */
291
+ typeGuard: Types.FunctionName;
292
+ };
293
+ delete: {
294
+ /**
295
+ * The name of the type that represents the items of a model that should be deleted.
296
+ */
297
+ type: Types.TypeName;
298
+ /**
299
+ * The discriminant for the delta of a model that should be deleted.
300
+ */
301
+ discriminant: Types.DiscriminantName;
302
+ /**
303
+ * The name of the type that represents the items of a model that should be deleted.
304
+ */
305
+ typeGuard: Types.FunctionName;
306
+ };
307
+ unchanged: {
308
+ /**
309
+ * The name of the type that represents unchanged items of model.
310
+ */
311
+ type: Types.TypeName;
312
+ /**
313
+ * The discriminant for unchanged items of a model.
314
+ */
315
+ discriminant: Types.DiscriminantName;
316
+ /**
317
+ * The name of the type that represents unchanged items of a model.
318
+ */
319
+ typeGuard: Types.FunctionName;
320
+ };
321
+ errors: {
322
+ /**
323
+ * The name of the type that represents the items of a model that contain errors.
324
+ */
325
+ type: Types.TypeName;
326
+ /**
327
+ * The discriminant for the items of a model that contain errors.
328
+ */
329
+ discriminant: Types.DiscriminantName;
330
+ /**
331
+ * The name of the type guard function that checks if a delta item is an error.
332
+ */
333
+ typeGuard: Types.FunctionName;
334
+ /**
335
+ * Meta data for the model error type for a missing field.
336
+ */
337
+ missingField: {
338
+ /**
339
+ * The name of the type that represents the error of missing fields.
340
+ */
341
+ type: Types.TypeName;
342
+ /**
343
+ * The discriminant for the error of missing fields.
344
+ */
345
+ discriminant: Types.DiscriminantName;
346
+ };
347
+ /**
348
+ * Meta data for the model error type for an invalid reference.
349
+ */
350
+ invalidReference: {
351
+ /**
352
+ * The name of the type that represents the error of invalid references.
353
+ */
354
+ type: Types.TypeName;
355
+ /**
356
+ * The discriminant for the error of invalid references.
357
+ */
358
+ discriminant: Types.DiscriminantName;
359
+ };
360
+ /**
361
+ * Meta data for the model error type for non-unique fields.
362
+ */
363
+ nonUnique: {
364
+ /**
365
+ * The name of the type that represents the error of non-unique fields.
366
+ */
367
+ type: Types.TypeName;
368
+ /**
369
+ * The discriminant for the error of non-unique fields.
370
+ */
371
+ discriminant: Types.DiscriminantName;
372
+ };
373
+ /**
374
+ * Meta data for the model error type for invalid types.
375
+ */
376
+ invalidType: {
377
+ /**
378
+ * The name of the type that represents the error of invalid types.
379
+ */
380
+ type: Types.TypeName;
381
+ /**
382
+ * The discriminant for the error of invalid types.
383
+ */
384
+ discriminant: Types.DiscriminantName;
385
+ };
386
+ /**
387
+ * Meta data for the model error type where the item is a required dependency of another item.
388
+ */
389
+ isRequiredDependency: {
390
+ /**
391
+ * The name of the type that represents an item to be deleted that is a required dependency of another item.
392
+ */
393
+ type: Types.TypeName;
394
+ /**
395
+ * The discriminant for the error of missing required dependencies.
396
+ */
397
+ discriminant: Types.DiscriminantName;
398
+ };
399
+ };
400
+ };
401
+ /**
402
+ * The name of the type representing modified fields of a model.
403
+ */
404
+ delta_Fields: Types.TypeName;
405
+ };
90
406
  };
91
407
  businessLogic: {
92
408
  /**
@@ -181,24 +497,8 @@ export type SchemaMetaData = {
181
497
  * Path to seed Excel template file.
182
498
  */
183
499
  templateExcelFilePath: Types.Path;
184
- /**
185
- * Path to template decoder **
186
- */
187
- templateDecoderFilePath: Types.Path;
188
- /**
189
- * The name of the template decoder function.
190
- */
191
- templateDecoderName: Types.Fnction;
192
500
  };
193
501
  seed: {
194
- /**
195
- * Path to the seed data type.
196
- */
197
- seedDataTypeFilePath: Types.Path;
198
- /**
199
- * Path to the SeedService file.
200
- */
201
- serviceFilePath: Types.Path;
202
502
  /**
203
503
  * The name of the SeedService class.
204
504
  */
@@ -235,6 +535,14 @@ export type SchemaMetaData = {
235
535
  * Path to the file containing DTO type definitions.
236
536
  */
237
537
  path: Types.Path;
538
+ /**
539
+ * Type for generic models
540
+ */
541
+ genericModel: Types.TypeName;
542
+ /**
543
+ * Generic type for an ID.
544
+ */
545
+ idType: Types.TypeName;
238
546
  /**
239
547
  * Generic type for a Create DTO.
240
548
  */
@@ -294,6 +602,13 @@ export type ModelMetaData = {
294
602
  * (e.g. `reactCreateModalComponentName`)
295
603
  */
296
604
  internalSingularName: Types.VariableName;
605
+ /**
606
+ * The name of the capitalized model in singular form.
607
+ *
608
+ * NOTE: This name is meant to be used in internal types only.
609
+ * For any types, class names, etc. that are exposed, please use a more specific name.
610
+ */
611
+ internalSingularNameCapitalized: Types.VariableName;
297
612
  /**
298
613
  * The name of the model in plural form.
299
614
  *
@@ -302,12 +617,19 @@ export type ModelMetaData = {
302
617
  * (e.g. `reactCreateModalComponentName`)
303
618
  */
304
619
  internalPluralName: Types.VariableName;
620
+ /**
621
+ * The name of the capitalized model in plural form.
622
+ *
623
+ * NOTE: This name is meant to be used in internal types only.
624
+ * For any variables, class names, etc. that are exposed, please use a more specific name.
625
+ */
626
+ internalPluralNameCapitalized: Types.VariableName;
305
627
  /**
306
628
  * Properties provided by the `actions` generators.
307
629
  */
308
630
  actions: {
309
631
  /**
310
- * Each model defines its own action scope as a discriminator for the action execution. (e.g. `aggregation`)
632
+ * Each model defines its own action scope as a discriminant for the action execution. (e.g. `aggregation`)
311
633
  */
312
634
  actionScopeConstType: Types.TypeName;
313
635
  };
@@ -338,52 +660,112 @@ export type ModelMetaData = {
338
660
  /**
339
661
  * The name of the function that adds missing values to the partially populated model value.
340
662
  */
341
- stubGenerationFnName: Types.Fnction;
663
+ stubGenerationFnName: Types.FunctionName;
342
664
  /**
343
- * Name of the file containing the repository definition for this model.
665
+ * The name by which the repository is exposed in the dataService/context. (e.g. aggregations)
344
666
  */
345
- repoFileName: Types.FileName;
667
+ dataServiceName: Types.VariableName;
346
668
  /**
347
- * Path to the file containing the repository definition.
669
+ * The name for internal use of modelIds in data mocker
348
670
  */
349
- repoFilePath: Types.Path;
671
+ dataServiceIdName: Types.VariableName;
672
+ repository: {
673
+ /**
674
+ * Name of the file containing the repository definition for this model.
675
+ */
676
+ fileName: Types.FileName;
677
+ /**
678
+ * Path to the file containing the repository definition.
679
+ */
680
+ filePath: Types.Path;
681
+ /**
682
+ * The name of the class for the repository definition of this model (e.g. AggregationRepository).
683
+ */
684
+ className: Types.ClassName;
685
+ /**
686
+ * The name of the function that decodes a source (database) object to a fully typed object, e.g. `toAggregation`.
687
+ */
688
+ decoderFnName: Types.FunctionName;
689
+ /**
690
+ * The name of the method that should be used to get objects from the database, e.g. `aggregations`.
691
+ */
692
+ getMethodFnName: Types.FunctionName;
693
+ };
694
+ mockRepository: {
695
+ /**
696
+ * Name of the file containing the mock repository definition for this model.
697
+ */
698
+ fileName: Types.FileName;
699
+ /**
700
+ * Path to the file containing the mock repository definition.
701
+ */
702
+ filePath: Types.Path;
703
+ /**
704
+ * The name of the class for the in-memory mock repository definition of this model (e.g. MockAggregationRepository).
705
+ */
706
+ className: Types.ClassName;
707
+ };
708
+ };
709
+ /**
710
+ * Properties provided by the `importExport` generators
711
+ */
712
+ importExport: {
350
713
  /**
351
- * Name of the file containing the mock repository definition for this model.
714
+ * Name of the data exports model property (e.g. `Aggregations`).
352
715
  */
353
- mockRepoFileName: Types.FileName;
716
+ exportDataPropertyName: Types.VariableName;
354
717
  /**
355
- * Path to the file containing the mock repository definition.
718
+ * Name of the data exports model in the full export (e.g. `aggregations`).
356
719
  */
357
- mockRepoFilePath: Types.Path;
720
+ exportDataFullPropertyName: Types.VariableName;
358
721
  /**
359
- * The name of the class for the repository definition of this model (e.g. AggregationRepository).
722
+ * Name of the data export type (e.g. `Aggregations_Export`).
360
723
  */
361
- repositoryClassName: Types.ClassName;
724
+ exportDataTypeName: Types.TypeName;
362
725
  /**
363
- * The name of the class for the in-memory mock repository definition of this model (e.g. MockAggregationRepository).
726
+ * Name of the function that adds an instance of this model to the exporter, e.g. `addAggregation`.
364
727
  */
365
- mockRepositoryClassName: Types.ClassName;
728
+ exportAddFunctionName: Types.FunctionName;
366
729
  /**
367
- * The name by which the repository is exposed in the dataService/context. (e.g. aggregations)
730
+ * The name of the export Excel table (e.g. `Aggregations`).
368
731
  */
369
- dataServiceName: Types.VariableName;
732
+ tableName: string;
370
733
  /**
371
- * The name for internal use of modelIds in data mocker
734
+ * Name of the model specific error type
372
735
  */
373
- dataServiceIdName: Types.VariableName;
736
+ delta_Model_Errors: Types.TypeName;
374
737
  /**
375
- * The name of the export Excel table (e.g. `Aggregations`).
738
+ * Meta data of the model's Excel decoders
376
739
  */
377
- excelExportTableName: string;
378
- repository: {
740
+ decoder: {
379
741
  /**
380
- * The name of the function that decodes a source (database) object to a fully typed object, e.g. `toAggregation`.
742
+ * Name of the file containing the model's Excel decoders.
381
743
  */
382
- decoderFnName: Types.Fnction;
744
+ fileName: Types.FileName;
383
745
  /**
384
- * The name of the method that should be used to get objects from the database, e.g. `aggregations`.
746
+ * Path to the file containing the model's Excel decoders.
747
+ */
748
+ filePath: Types.Path;
749
+ /**
750
+ * Name of the type that represents the model in Excel import/export, e.g. `Aggregation_EncodedExcelData`.
751
+ */
752
+ encodedExcelType: Types.TypeName;
753
+ /**
754
+ * Name of the decoder function that represents the Excel table import type, e.g. `aggregationExcelTableDecoder`.
755
+ */
756
+ tableDecoder: Types.FunctionName;
757
+ /**
758
+ * Name of the function that converts a model item to the Excel format, e.g. `encodeAggregation`.
759
+ */
760
+ itemEncoderFunctionName: Types.FunctionName;
761
+ /**
762
+ * Name of the function that converts an array of model items to the Excel format, e.g. `encodeAggregations`.
385
763
  */
386
- getMethodFnName: Types.Fnction;
764
+ arrayEncoderFunctionName: Types.FunctionName;
765
+ /**
766
+ * Name of the array in the decoded data containing all entities of this model, e.g. `aggregations`.
767
+ */
768
+ decodedModelArrayName: Types.VariableName;
387
769
  };
388
770
  };
389
771
  /**
@@ -442,7 +824,7 @@ export type ModelMetaData = {
442
824
  */
443
825
  serviceFilePath: Types.Path;
444
826
  /**
445
- * The name of the model used as a discriminator for the action execution. (e.g. `aggregation`)
827
+ * The name of the model used as a discriminant for the action execution. (e.g. `aggregation`)
446
828
  */
447
829
  actionModelDiscriminantName: Types.VariableName;
448
830
  /**
@@ -461,35 +843,35 @@ export type ModelMetaData = {
461
843
  /**
462
844
  * Name of the function that creates a `create` action for the model (e.g. `createActionAggregationCreate`)
463
845
  */
464
- createActionFunctionNameCreate: Types.Fnction;
846
+ createActionFunctionNameCreate: Types.FunctionName;
465
847
  /**
466
848
  * Name of the function that creates a `createMany` action for the model (e.g. `createActionAggregationCreateMany`)
467
849
  */
468
- createActionFunctionNameCreateMany: Types.Fnction;
850
+ createActionFunctionNameCreateMany: Types.FunctionName;
469
851
  /**
470
852
  * Name of the function that creates a `update` action for the model (e.g. `createActionAggregationUpdate`)
471
853
  */
472
- createActionFunctionNameUpdate: Types.Fnction;
854
+ createActionFunctionNameUpdate: Types.FunctionName;
473
855
  /**
474
856
  * Name of the function that creates a `updateMany` action for the model (e.g. `createActionAggregationUpdateMany`)
475
857
  */
476
- createActionFunctionNameUpdateMany: Types.Fnction;
858
+ createActionFunctionNameUpdateMany: Types.FunctionName;
477
859
  /**
478
860
  * Name of the function that creates a `upsert` action for the model (e.g. `createActionAggregationUpsert`)
479
861
  */
480
- createActionFunctionNameUpsert: Types.Fnction;
862
+ createActionFunctionNameUpsert: Types.FunctionName;
481
863
  /**
482
864
  * Name of the function that creates a `upsertMany` action for the model (e.g. `createActionAggregationUpsertMany`)
483
865
  */
484
- createActionFunctionNameUpsertMany: Types.Fnction;
866
+ createActionFunctionNameUpsertMany: Types.FunctionName;
485
867
  /**
486
868
  * Name of the function that creates a `delete` action for the model (e.g. `createActionAggregationDelete`)
487
869
  */
488
- createActionFunctionNameDelete: Types.Fnction;
870
+ createActionFunctionNameDelete: Types.FunctionName;
489
871
  /**
490
872
  * Name of the function that creates a `deleteMany` action for the model (e.g. `createActionAggregationDeleteMany`)
491
873
  */
492
- createActionFunctionNameDeleteMany: Types.Fnction;
874
+ createActionFunctionNameDeleteMany: Types.FunctionName;
493
875
  };
494
876
  /**
495
877
  * Name by which the business logic service exposes the data service.
@@ -512,30 +894,6 @@ export type ModelMetaData = {
512
894
  * The file or package name that contains the seed data for this model (e.g. `@d2i/aggregations`).
513
895
  */
514
896
  importPath: Types.Path;
515
- excel: {
516
- /**
517
- * The name of the Excel table, e.g. `Aggregations`.
518
- */
519
- tableName: string;
520
- };
521
- decoder: {
522
- /**
523
- * The name of the Zod schema, e.g. `aggregationSchema`.
524
- */
525
- schemaName: Types.VariableName;
526
- /**
527
- * The name of the decoder, e.g. `aggregationDecoder`.
528
- */
529
- decoderName: Types.VariableName;
530
- /**
531
- * The name of the inferred decoder type, e.g. `AggregationType`.
532
- */
533
- decoderTypeName: Types.TypeName;
534
- /**
535
- * The name of the resulting field in the seed data
536
- */
537
- dataName: Types.VariableName;
538
- };
539
897
  };
540
898
  /**
541
899
  * Properties provided by the `react` generators.
@@ -553,11 +911,11 @@ export type ModelMetaData = {
553
911
  /**
554
912
  * Name of the function that should be used as React hook (e.g. `useAggregationContext`).
555
913
  */
556
- hookFnName: Types.Fnction;
914
+ hookFnName: Types.FunctionName;
557
915
  /**
558
916
  * Name of the function that may be used to get a single instance of this model (e.g. `useAggregation`).
559
917
  */
560
- instanceGetterHookFnName: Types.Fnction;
918
+ instanceGetterHookFnName: Types.FunctionName;
561
919
  };
562
920
  /**
563
921
  * Names of React components that should be generated for this model.
@@ -614,7 +972,7 @@ export type ModelMetaData = {
614
972
  /**
615
973
  * The full method name of the React Query method (e.g. `aggregations.getMap`).
616
974
  */
617
- reactQueryMethod: Types.Fnction;
975
+ reactQueryMethod: Types.FunctionName;
618
976
  };
619
977
  create: {
620
978
  /**
@@ -624,7 +982,7 @@ export type ModelMetaData = {
624
982
  /**
625
983
  * The full method name of the React Query method (e.g. `aggregations.create`).
626
984
  */
627
- reactQueryMethod: Types.Fnction;
985
+ reactQueryMethod: Types.FunctionName;
628
986
  };
629
987
  update: {
630
988
  /**
@@ -634,7 +992,7 @@ export type ModelMetaData = {
634
992
  /**
635
993
  * The full method name of the React Query method (e.g. `aggregations.update`).
636
994
  */
637
- reactQueryMethod: Types.Fnction;
995
+ reactQueryMethod: Types.FunctionName;
638
996
  };
639
997
  delete: {
640
998
  /**
@@ -644,7 +1002,7 @@ export type ModelMetaData = {
644
1002
  /**
645
1003
  * The full method name of the React Query method (e.g. `aggregations.delete`).
646
1004
  */
647
- reactQueryMethod: Types.Fnction;
1005
+ reactQueryMethod: Types.FunctionName;
648
1006
  };
649
1007
  };
650
1008
  /**
@@ -667,28 +1025,28 @@ export type ModelMetaData = {
667
1025
  * Function that may be used to convert a scalar value to a branded ID type,
668
1026
  * e.g. `toAggregationId`.
669
1027
  */
670
- toBrandedIdTypeFnName: Types.Fnction;
1028
+ toBrandedIdTypeFnName: Types.FunctionName;
671
1029
  zodDecoderFnNames: {
672
1030
  /**
673
1031
  * The name of the function that decodes a scalar value to a branded ID type, e.g. `aggregationIdDecoder`.
674
1032
  */
675
- id: Types.Fnction;
1033
+ id: Types.FunctionName;
676
1034
  /**
677
1035
  * The name of the function that decodes a source (database) object to a fully typed object, e.g. `aggregationDatabaseDecoder`.
678
1036
  */
679
- fromDatabase: Types.Fnction;
1037
+ fromDatabase: Types.FunctionName;
680
1038
  /**
681
1039
  * The name of the function that decodes a Create object to a fully typed object, e.g. `aggregationCreateDecoder`.
682
1040
  */
683
- createObject: Types.Fnction;
1041
+ createObject: Types.FunctionName;
684
1042
  /**
685
1043
  * The name of the function that decodes an Update object to a fully typed object, e.g. `aggregationUpdateDecoder`.
686
1044
  */
687
- updateObject: Types.Fnction;
1045
+ updateObject: Types.FunctionName;
688
1046
  /**
689
1047
  * The name of the function that decodes an Upsert object to a fully typed object, e.g. `aggregationUpsertDecoder`.
690
1048
  */
691
- upsertObject: Types.Fnction;
1049
+ upsertObject: Types.FunctionName;
692
1050
  };
693
1051
  /**
694
1052
  * Type definitions for the different Data Transfer Objects (DTOs).
@@ -741,11 +1099,11 @@ export type FieldMetaData = {
741
1099
  /**
742
1100
  * The name of the method that should be used to get all child objects for a given item, e.g. `getItemsForAggregation`.
743
1101
  */
744
- getByForeignKeyMethodFnName: Types.Fnction;
1102
+ getByForeignKeyMethodFnName: Types.FunctionName;
745
1103
  /**
746
1104
  * The name of the method that should be used to get all child Ids for a given item, e.g. `getIdsForAggregation`.
747
1105
  */
748
- getByForeignKeyIdsMethodFnName: Types.Fnction;
1106
+ getByForeignKeyIdsMethodFnName: Types.FunctionName;
749
1107
  /**
750
1108
  * The name of the column in the seed Excel table, e.g. `Aggregation`.
751
1109
  */