dyna-record 0.5.0 → 0.5.2

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 (89) hide show
  1. package/dist/src/DynaRecord.d.ts +11 -18
  2. package/dist/src/DynaRecord.d.ts.map +1 -1
  3. package/dist/src/Logger.d.ts.map +1 -1
  4. package/dist/src/Logger.js +0 -1
  5. package/dist/src/decorators/Entity.d.ts +1 -1
  6. package/dist/src/decorators/Entity.d.ts.map +1 -1
  7. package/dist/src/decorators/Entity.js +3 -5
  8. package/dist/src/decorators/Table.d.ts +1 -1
  9. package/dist/src/decorators/Table.d.ts.map +1 -1
  10. package/dist/src/decorators/Table.js +2 -4
  11. package/dist/src/decorators/attributes/BooleanAttribute.d.ts.map +1 -1
  12. package/dist/src/decorators/attributes/BooleanAttribute.js +7 -9
  13. package/dist/src/decorators/attributes/DateAttribute.d.ts.map +1 -1
  14. package/dist/src/decorators/attributes/DateAttribute.js +8 -10
  15. package/dist/src/decorators/attributes/EnumAttribute.d.ts.map +1 -1
  16. package/dist/src/decorators/attributes/EnumAttribute.js +7 -9
  17. package/dist/src/decorators/attributes/ForeignKeyAttribute.d.ts.map +1 -1
  18. package/dist/src/decorators/attributes/ForeignKeyAttribute.js +9 -11
  19. package/dist/src/decorators/attributes/NumberAttribute.d.ts.map +1 -1
  20. package/dist/src/decorators/attributes/NumberAttribute.js +7 -9
  21. package/dist/src/decorators/attributes/ObjectAttribute.d.ts.map +1 -1
  22. package/dist/src/decorators/attributes/ObjectAttribute.js +14 -17
  23. package/dist/src/decorators/attributes/PartitionKeyAttribute.d.ts.map +1 -1
  24. package/dist/src/decorators/attributes/PartitionKeyAttribute.js +6 -8
  25. package/dist/src/decorators/attributes/SortKeyAttribute.d.ts.map +1 -1
  26. package/dist/src/decorators/attributes/SortKeyAttribute.js +6 -8
  27. package/dist/src/decorators/attributes/StringAttribute.d.ts.map +1 -1
  28. package/dist/src/decorators/attributes/StringAttribute.js +7 -9
  29. package/dist/src/decorators/attributes/serializers.d.ts +2 -2
  30. package/dist/src/decorators/attributes/serializers.d.ts.map +1 -1
  31. package/dist/src/decorators/attributes/serializers.js +1 -1
  32. package/dist/src/decorators/relationships/BelongsTo.d.ts.map +1 -1
  33. package/dist/src/decorators/relationships/BelongsTo.js +7 -9
  34. package/dist/src/decorators/relationships/HasAndBelongsToMany.d.ts.map +1 -1
  35. package/dist/src/decorators/relationships/HasAndBelongsToMany.js +13 -15
  36. package/dist/src/decorators/relationships/HasMany.d.ts.map +1 -1
  37. package/dist/src/decorators/relationships/HasMany.js +15 -17
  38. package/dist/src/decorators/relationships/HasOne.d.ts.map +1 -1
  39. package/dist/src/decorators/relationships/HasOne.js +7 -9
  40. package/dist/src/metadata/EntityMetadata.d.ts +7 -2
  41. package/dist/src/metadata/EntityMetadata.d.ts.map +1 -1
  42. package/dist/src/metadata/EntityMetadata.js +17 -2
  43. package/dist/src/metadata/MetadataStorage.d.ts.map +1 -1
  44. package/dist/src/metadata/MetadataStorage.js +6 -6
  45. package/dist/src/metadata/TableMetadata.d.ts.map +1 -1
  46. package/dist/src/metadata/TableMetadata.js +7 -1
  47. package/dist/src/metadata/relationship-metadata/BelongsToRelationship.d.ts.map +1 -1
  48. package/dist/src/metadata/relationship-metadata/BelongsToRelationship.js +1 -3
  49. package/dist/src/metadata/relationship-metadata/HasAndBelongsToManyRelationship.d.ts.map +1 -1
  50. package/dist/src/metadata/relationship-metadata/HasAndBelongsToManyRelationship.js +1 -3
  51. package/dist/src/metadata/relationship-metadata/HasManyRelationship.d.ts.map +1 -1
  52. package/dist/src/metadata/relationship-metadata/HasManyRelationship.js +1 -3
  53. package/dist/src/metadata/relationship-metadata/HasOneRelationship.d.ts.map +1 -1
  54. package/dist/src/metadata/relationship-metadata/HasOneRelationship.js +1 -3
  55. package/dist/src/metadata/relationship-metadata/OwnedByRelationship.d.ts.map +1 -1
  56. package/dist/src/metadata/relationship-metadata/OwnedByRelationship.js +1 -3
  57. package/dist/src/metadata/schemas.d.ts +40 -262
  58. package/dist/src/metadata/schemas.d.ts.map +1 -1
  59. package/dist/src/metadata/schemas.js +6 -6
  60. package/dist/src/metadata/types.d.ts +3 -3
  61. package/dist/src/metadata/types.d.ts.map +1 -1
  62. package/dist/src/metadata/utils.js +4 -4
  63. package/dist/src/operations/Create/Create.js +3 -5
  64. package/dist/src/operations/Delete/Delete.d.ts.map +1 -1
  65. package/dist/src/operations/Delete/Delete.js +3 -2
  66. package/dist/src/operations/FindById/FindById.d.ts.map +1 -1
  67. package/dist/src/operations/FindById/FindById.js +4 -4
  68. package/dist/src/operations/Query/Query.d.ts.map +1 -1
  69. package/dist/src/operations/Query/Query.js +2 -1
  70. package/dist/src/operations/Update/Update.d.ts.map +1 -1
  71. package/dist/src/operations/Update/Update.js +17 -15
  72. package/dist/src/operations/types.d.ts +1 -1
  73. package/dist/src/operations/types.d.ts.map +1 -1
  74. package/dist/src/operations/utils/expressionBuilder.js +3 -0
  75. package/dist/src/operations/utils/flattenObjectForUpdate.d.ts.map +1 -1
  76. package/dist/src/operations/utils/flattenObjectForUpdate.js +2 -2
  77. package/dist/src/operations/utils/mergePartialObjectAttributes.d.ts.map +1 -1
  78. package/dist/src/operations/utils/mergePartialObjectAttributes.js +11 -3
  79. package/dist/src/operations/utils/utils.d.ts +2 -2
  80. package/dist/src/operations/utils/utils.d.ts.map +1 -1
  81. package/dist/src/query-utils/QueryBuilder.d.ts.map +1 -1
  82. package/dist/src/query-utils/QueryBuilder.js +11 -7
  83. package/dist/src/query-utils/types.d.ts.map +1 -1
  84. package/dist/src/relationships/JoinTable.d.ts.map +1 -1
  85. package/dist/src/relationships/JoinTable.js +4 -3
  86. package/dist/src/utils.d.ts +4 -4
  87. package/dist/src/utils.d.ts.map +1 -1
  88. package/dist/src/utils.js +13 -11
  89. package/package.json +11 -13
@@ -25,186 +25,112 @@ import type DynaRecord from "../DynaRecord";
25
25
  export declare const TableMetadataTransform: z.ZodObject<{
26
26
  name: z.ZodString;
27
27
  delimiter: z.ZodString;
28
- defaultAttributes: z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodObject<{
28
+ defaultAttributes: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodObject<{
29
29
  name: z.ZodString;
30
30
  alias: z.ZodString;
31
31
  nullable: z.ZodBoolean;
32
- foreignKeyTarget: z.ZodOptional<z.ZodType<EntityClass<DynaRecord>, z.ZodTypeDef, EntityClass<DynaRecord>>>;
33
- }, "strip", z.ZodTypeAny, {
34
- name: string;
35
- nullable: boolean;
36
- alias: string;
37
- foreignKeyTarget?: EntityClass<DynaRecord> | undefined;
38
- }, {
39
- name: string;
40
- nullable: boolean;
41
- alias: string;
42
- foreignKeyTarget?: EntityClass<DynaRecord> | undefined;
43
- }>, {
32
+ foreignKeyTarget: z.ZodOptional<z.ZodCustom<EntityClass<DynaRecord>, EntityClass<DynaRecord>>>;
33
+ }, z.core.$strip>, z.ZodTransform<{
44
34
  foreignKeyTarget?: string | undefined;
45
35
  name: string;
46
36
  alias: string;
47
37
  nullable: boolean;
48
38
  }, {
49
39
  name: string;
50
- nullable: boolean;
51
40
  alias: string;
41
+ nullable: boolean;
52
42
  foreignKeyTarget?: EntityClass<DynaRecord> | undefined;
53
- }>>;
54
- defaultTableAttributes: z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodObject<{
43
+ }>>>;
44
+ defaultTableAttributes: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodObject<{
55
45
  name: z.ZodString;
56
46
  alias: z.ZodString;
57
47
  nullable: z.ZodBoolean;
58
- foreignKeyTarget: z.ZodOptional<z.ZodType<EntityClass<DynaRecord>, z.ZodTypeDef, EntityClass<DynaRecord>>>;
59
- }, "strip", z.ZodTypeAny, {
60
- name: string;
61
- nullable: boolean;
62
- alias: string;
63
- foreignKeyTarget?: EntityClass<DynaRecord> | undefined;
64
- }, {
65
- name: string;
66
- nullable: boolean;
67
- alias: string;
68
- foreignKeyTarget?: EntityClass<DynaRecord> | undefined;
69
- }>, {
48
+ foreignKeyTarget: z.ZodOptional<z.ZodCustom<EntityClass<DynaRecord>, EntityClass<DynaRecord>>>;
49
+ }, z.core.$strip>, z.ZodTransform<{
70
50
  foreignKeyTarget?: string | undefined;
71
51
  name: string;
72
52
  alias: string;
73
53
  nullable: boolean;
74
54
  }, {
75
55
  name: string;
76
- nullable: boolean;
77
56
  alias: string;
57
+ nullable: boolean;
78
58
  foreignKeyTarget?: EntityClass<DynaRecord> | undefined;
79
- }>>;
80
- partitionKeyAttribute: z.ZodEffects<z.ZodObject<{
59
+ }>>>;
60
+ partitionKeyAttribute: z.ZodPipe<z.ZodObject<{
81
61
  name: z.ZodString;
82
62
  alias: z.ZodString;
83
63
  nullable: z.ZodBoolean;
84
- foreignKeyTarget: z.ZodOptional<z.ZodType<EntityClass<DynaRecord>, z.ZodTypeDef, EntityClass<DynaRecord>>>;
85
- }, "strip", z.ZodTypeAny, {
86
- name: string;
87
- nullable: boolean;
88
- alias: string;
89
- foreignKeyTarget?: EntityClass<DynaRecord> | undefined;
90
- }, {
91
- name: string;
92
- nullable: boolean;
93
- alias: string;
94
- foreignKeyTarget?: EntityClass<DynaRecord> | undefined;
95
- }>, {
64
+ foreignKeyTarget: z.ZodOptional<z.ZodCustom<EntityClass<DynaRecord>, EntityClass<DynaRecord>>>;
65
+ }, z.core.$strip>, z.ZodTransform<{
96
66
  foreignKeyTarget?: string | undefined;
97
67
  name: string;
98
68
  alias: string;
99
69
  nullable: boolean;
100
70
  }, {
101
71
  name: string;
102
- nullable: boolean;
103
72
  alias: string;
73
+ nullable: boolean;
104
74
  foreignKeyTarget?: EntityClass<DynaRecord> | undefined;
105
- }>;
106
- sortKeyAttribute: z.ZodEffects<z.ZodObject<{
75
+ }>>;
76
+ sortKeyAttribute: z.ZodPipe<z.ZodObject<{
107
77
  name: z.ZodString;
108
78
  alias: z.ZodString;
109
79
  nullable: z.ZodBoolean;
110
- foreignKeyTarget: z.ZodOptional<z.ZodType<EntityClass<DynaRecord>, z.ZodTypeDef, EntityClass<DynaRecord>>>;
111
- }, "strip", z.ZodTypeAny, {
112
- name: string;
113
- nullable: boolean;
114
- alias: string;
115
- foreignKeyTarget?: EntityClass<DynaRecord> | undefined;
116
- }, {
117
- name: string;
118
- nullable: boolean;
119
- alias: string;
120
- foreignKeyTarget?: EntityClass<DynaRecord> | undefined;
121
- }>, {
80
+ foreignKeyTarget: z.ZodOptional<z.ZodCustom<EntityClass<DynaRecord>, EntityClass<DynaRecord>>>;
81
+ }, z.core.$strip>, z.ZodTransform<{
122
82
  foreignKeyTarget?: string | undefined;
123
83
  name: string;
124
84
  alias: string;
125
85
  nullable: boolean;
126
86
  }, {
127
87
  name: string;
128
- nullable: boolean;
129
88
  alias: string;
89
+ nullable: boolean;
130
90
  foreignKeyTarget?: EntityClass<DynaRecord> | undefined;
131
- }>;
132
- entities: z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodObject<{
91
+ }>>;
92
+ entities: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodObject<{
133
93
  tableClassName: z.ZodString;
134
- attributes: z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodObject<{
94
+ attributes: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodObject<{
135
95
  name: z.ZodString;
136
96
  alias: z.ZodString;
137
97
  nullable: z.ZodBoolean;
138
- foreignKeyTarget: z.ZodOptional<z.ZodType<EntityClass<DynaRecord>, z.ZodTypeDef, EntityClass<DynaRecord>>>;
139
- }, "strip", z.ZodTypeAny, {
140
- name: string;
141
- nullable: boolean;
142
- alias: string;
143
- foreignKeyTarget?: EntityClass<DynaRecord> | undefined;
144
- }, {
145
- name: string;
146
- nullable: boolean;
147
- alias: string;
148
- foreignKeyTarget?: EntityClass<DynaRecord> | undefined;
149
- }>, {
98
+ foreignKeyTarget: z.ZodOptional<z.ZodCustom<EntityClass<DynaRecord>, EntityClass<DynaRecord>>>;
99
+ }, z.core.$strip>, z.ZodTransform<{
150
100
  foreignKeyTarget?: string | undefined;
151
101
  name: string;
152
102
  alias: string;
153
103
  nullable: boolean;
154
104
  }, {
155
105
  name: string;
156
- nullable: boolean;
157
106
  alias: string;
107
+ nullable: boolean;
158
108
  foreignKeyTarget?: EntityClass<DynaRecord> | undefined;
159
- }>>;
160
- tableAttributes: z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodObject<{
109
+ }>>>;
110
+ tableAttributes: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodObject<{
161
111
  name: z.ZodString;
162
112
  alias: z.ZodString;
163
113
  nullable: z.ZodBoolean;
164
- foreignKeyTarget: z.ZodOptional<z.ZodType<EntityClass<DynaRecord>, z.ZodTypeDef, EntityClass<DynaRecord>>>;
165
- }, "strip", z.ZodTypeAny, {
166
- name: string;
167
- nullable: boolean;
168
- alias: string;
169
- foreignKeyTarget?: EntityClass<DynaRecord> | undefined;
170
- }, {
171
- name: string;
172
- nullable: boolean;
173
- alias: string;
174
- foreignKeyTarget?: EntityClass<DynaRecord> | undefined;
175
- }>, {
114
+ foreignKeyTarget: z.ZodOptional<z.ZodCustom<EntityClass<DynaRecord>, EntityClass<DynaRecord>>>;
115
+ }, z.core.$strip>, z.ZodTransform<{
176
116
  foreignKeyTarget?: string | undefined;
177
117
  name: string;
178
118
  alias: string;
179
119
  nullable: boolean;
180
120
  }, {
181
121
  name: string;
182
- nullable: boolean;
183
122
  alias: string;
123
+ nullable: boolean;
184
124
  foreignKeyTarget?: EntityClass<DynaRecord> | undefined;
185
- }>>;
186
- relationships: z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodObject<{
125
+ }>>>;
126
+ relationships: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodObject<{
187
127
  type: z.ZodString;
188
128
  propertyName: z.ZodString;
189
- target: z.ZodOptional<z.ZodType<EntityClass<DynaRecord>, z.ZodTypeDef, EntityClass<DynaRecord>>>;
129
+ target: z.ZodOptional<z.ZodCustom<EntityClass<DynaRecord>, EntityClass<DynaRecord>>>;
190
130
  foreignKey: z.ZodOptional<z.ZodString>;
191
131
  joinTableName: z.ZodOptional<z.ZodString>;
192
132
  uniDirectional: z.ZodOptional<z.ZodBoolean>;
193
- }, "strip", z.ZodTypeAny, {
194
- type: string;
195
- propertyName: string;
196
- foreignKey?: string | undefined;
197
- uniDirectional?: boolean | undefined;
198
- joinTableName?: string | undefined;
199
- target?: EntityClass<DynaRecord> | undefined;
200
- }, {
201
- type: string;
202
- propertyName: string;
203
- foreignKey?: string | undefined;
204
- uniDirectional?: boolean | undefined;
205
- joinTableName?: string | undefined;
206
- target?: EntityClass<DynaRecord> | undefined;
207
- }>, {
133
+ }, z.core.$strip>, z.ZodTransform<{
208
134
  uniDirectional?: boolean | undefined;
209
135
  joinTableName?: string | undefined;
210
136
  foreignKey?: string | undefined;
@@ -214,59 +140,13 @@ export declare const TableMetadataTransform: z.ZodObject<{
214
140
  }, {
215
141
  type: string;
216
142
  propertyName: string;
217
- foreignKey?: string | undefined;
218
- uniDirectional?: boolean | undefined;
219
- joinTableName?: string | undefined;
220
143
  target?: EntityClass<DynaRecord> | undefined;
221
- }>>;
222
- idField: z.ZodOptional<z.ZodString>;
223
- }, "strip", z.ZodTypeAny, {
224
- tableClassName: string;
225
- attributes: Record<string, {
226
- foreignKeyTarget?: string | undefined;
227
- name: string;
228
- alias: string;
229
- nullable: boolean;
230
- }>;
231
- tableAttributes: Record<string, {
232
- foreignKeyTarget?: string | undefined;
233
- name: string;
234
- alias: string;
235
- nullable: boolean;
236
- }>;
237
- relationships: Record<string, {
238
- uniDirectional?: boolean | undefined;
239
- joinTableName?: string | undefined;
240
144
  foreignKey?: string | undefined;
241
- target?: string | undefined;
242
- type: string;
243
- propertyName: string;
244
- }>;
245
- idField?: string | undefined;
246
- }, {
247
- tableClassName: string;
248
- attributes: Record<string, {
249
- name: string;
250
- nullable: boolean;
251
- alias: string;
252
- foreignKeyTarget?: EntityClass<DynaRecord> | undefined;
253
- }>;
254
- tableAttributes: Record<string, {
255
- name: string;
256
- nullable: boolean;
257
- alias: string;
258
- foreignKeyTarget?: EntityClass<DynaRecord> | undefined;
259
- }>;
260
- relationships: Record<string, {
261
- type: string;
262
- propertyName: string;
263
- foreignKey?: string | undefined;
264
- uniDirectional?: boolean | undefined;
265
145
  joinTableName?: string | undefined;
266
- target?: EntityClass<DynaRecord> | undefined;
267
- }>;
268
- idField?: string | undefined;
269
- }>, {
146
+ uniDirectional?: boolean | undefined;
147
+ }>>>;
148
+ idField: z.ZodOptional<z.ZodString>;
149
+ }, z.core.$strip>, z.ZodTransform<{
270
150
  idField?: string | undefined;
271
151
  tableClassName: string;
272
152
  attributes: Record<string, {
@@ -290,58 +170,6 @@ export declare const TableMetadataTransform: z.ZodObject<{
290
170
  propertyName: string;
291
171
  }>;
292
172
  }, {
293
- tableClassName: string;
294
- attributes: Record<string, {
295
- name: string;
296
- nullable: boolean;
297
- alias: string;
298
- foreignKeyTarget?: EntityClass<DynaRecord> | undefined;
299
- }>;
300
- tableAttributes: Record<string, {
301
- name: string;
302
- nullable: boolean;
303
- alias: string;
304
- foreignKeyTarget?: EntityClass<DynaRecord> | undefined;
305
- }>;
306
- relationships: Record<string, {
307
- type: string;
308
- propertyName: string;
309
- foreignKey?: string | undefined;
310
- uniDirectional?: boolean | undefined;
311
- joinTableName?: string | undefined;
312
- target?: EntityClass<DynaRecord> | undefined;
313
- }>;
314
- idField?: string | undefined;
315
- }>>;
316
- }, "strip", z.ZodTypeAny, {
317
- name: string;
318
- delimiter: string;
319
- defaultAttributes: Record<string, {
320
- foreignKeyTarget?: string | undefined;
321
- name: string;
322
- alias: string;
323
- nullable: boolean;
324
- }>;
325
- defaultTableAttributes: Record<string, {
326
- foreignKeyTarget?: string | undefined;
327
- name: string;
328
- alias: string;
329
- nullable: boolean;
330
- }>;
331
- partitionKeyAttribute: {
332
- foreignKeyTarget?: string | undefined;
333
- name: string;
334
- alias: string;
335
- nullable: boolean;
336
- };
337
- sortKeyAttribute: {
338
- foreignKeyTarget?: string | undefined;
339
- name: string;
340
- alias: string;
341
- nullable: boolean;
342
- };
343
- entities: Record<string, {
344
- idField?: string | undefined;
345
173
  tableClassName: string;
346
174
  attributes: Record<string, {
347
175
  foreignKeyTarget?: string | undefined;
@@ -363,59 +191,9 @@ export declare const TableMetadataTransform: z.ZodObject<{
363
191
  type: string;
364
192
  propertyName: string;
365
193
  }>;
366
- }>;
367
- }, {
368
- name: string;
369
- delimiter: string;
370
- defaultAttributes: Record<string, {
371
- name: string;
372
- nullable: boolean;
373
- alias: string;
374
- foreignKeyTarget?: EntityClass<DynaRecord> | undefined;
375
- }>;
376
- defaultTableAttributes: Record<string, {
377
- name: string;
378
- nullable: boolean;
379
- alias: string;
380
- foreignKeyTarget?: EntityClass<DynaRecord> | undefined;
381
- }>;
382
- partitionKeyAttribute: {
383
- name: string;
384
- nullable: boolean;
385
- alias: string;
386
- foreignKeyTarget?: EntityClass<DynaRecord> | undefined;
387
- };
388
- sortKeyAttribute: {
389
- name: string;
390
- nullable: boolean;
391
- alias: string;
392
- foreignKeyTarget?: EntityClass<DynaRecord> | undefined;
393
- };
394
- entities: Record<string, {
395
- tableClassName: string;
396
- attributes: Record<string, {
397
- name: string;
398
- nullable: boolean;
399
- alias: string;
400
- foreignKeyTarget?: EntityClass<DynaRecord> | undefined;
401
- }>;
402
- tableAttributes: Record<string, {
403
- name: string;
404
- nullable: boolean;
405
- alias: string;
406
- foreignKeyTarget?: EntityClass<DynaRecord> | undefined;
407
- }>;
408
- relationships: Record<string, {
409
- type: string;
410
- propertyName: string;
411
- foreignKey?: string | undefined;
412
- uniDirectional?: boolean | undefined;
413
- joinTableName?: string | undefined;
414
- target?: EntityClass<DynaRecord> | undefined;
415
- }>;
416
194
  idField?: string | undefined;
417
- }>;
418
- }>;
195
+ }>>>;
196
+ }, z.core.$strip>;
419
197
  /**
420
198
  * Type representing the serialized output of table metadata.
421
199
  * This type is inferred from the {@link TableMetadataTransform} schema and represents
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQjC,CAAC;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
@@ -76,9 +76,9 @@ const RelationshipMetadataTransform = zod_1.z
76
76
  const EntityMetadataTransform = zod_1.z
77
77
  .object({
78
78
  tableClassName: zod_1.z.string(),
79
- attributes: zod_1.z.record(AttributeMetadataTransform),
80
- tableAttributes: zod_1.z.record(AttributeMetadataTransform),
81
- relationships: zod_1.z.record(RelationshipMetadataTransform),
79
+ attributes: zod_1.z.record(zod_1.z.string(), AttributeMetadataTransform),
80
+ tableAttributes: zod_1.z.record(zod_1.z.string(), AttributeMetadataTransform),
81
+ relationships: zod_1.z.record(zod_1.z.string(), RelationshipMetadataTransform),
82
82
  idField: zod_1.z.string().optional()
83
83
  })
84
84
  .transform(entity => ({
@@ -113,9 +113,9 @@ const EntityMetadataTransform = zod_1.z
113
113
  exports.TableMetadataTransform = zod_1.z.object({
114
114
  name: zod_1.z.string(),
115
115
  delimiter: zod_1.z.string(),
116
- defaultAttributes: zod_1.z.record(AttributeMetadataTransform),
117
- defaultTableAttributes: zod_1.z.record(AttributeMetadataTransform),
116
+ defaultAttributes: zod_1.z.record(zod_1.z.string(), AttributeMetadataTransform),
117
+ defaultTableAttributes: zod_1.z.record(zod_1.z.string(), AttributeMetadataTransform),
118
118
  partitionKeyAttribute: AttributeMetadataTransform,
119
119
  sortKeyAttribute: AttributeMetadataTransform,
120
- entities: zod_1.z.record(EntityMetadataTransform)
120
+ entities: zod_1.z.record(zod_1.z.string(), EntityMetadataTransform)
121
121
  });
@@ -38,7 +38,7 @@ export type DefaultDateFields = "createdAt" | "updatedAt";
38
38
  * Specifies the default fields used in entities, including fields from `DynaRecord`. Instance methods are excluded
39
39
  */
40
40
  export type DefaultFields = {
41
- [K in keyof DynaRecord]: DynaRecord[K] extends (...args: any[]) => any ? never : K;
41
+ [K in keyof DynaRecord]: DynaRecord[K] extends (...args: never[]) => unknown ? never : K;
42
42
  }[keyof DynaRecord];
43
43
  /**
44
44
  * Defines the structure for default fields within a table, mapping field names to their `AttributeMetadata` aliases.
@@ -62,11 +62,11 @@ export type KeysAttributeMetadataOptions = MakeOptional<Omit<AttributeMetadataOp
62
62
  /**
63
63
  * Function that takes a attribute from a Dynamo table item, and serialize it to a non-Dynamo native type (EX: Date)
64
64
  */
65
- export type EntitySerializer = (param: NativeAttributeValue) => any;
65
+ export type EntitySerializer = (param: NativeAttributeValue) => unknown;
66
66
  /**
67
67
  * Function that takes a attribute from an Entity which is not a native Dynamo type and serializes it a type that is supported by Dynamo
68
68
  */
69
- export type TableSerializer = (param: any) => NativeAttributeValue;
69
+ export type TableSerializer = (param: unknown) => NativeAttributeValue;
70
70
  /**
71
71
  * Functions for serializing attribute types that are not native to Dynamo from table item -> entity and entity -> table item
72
72
  * EX: See DateAttribute decorator
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/metadata/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACpB,aAAa,EACd,MAAM,GAAG,CAAC;AACX,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACnC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAEnE;;GAEG;AACH,MAAM,MAAM,kCAAkC,GAAG,OAAO,CACtD,oBAAoB,EACpB;IAAE,UAAU,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guard to check if the relationship is a HasMany
10
10
  */
11
11
  const isHasManyRelationship = (rel) => {
12
- return rel.type === "HasMany" && rel.foreignKey !== undefined;
12
+ return rel.type === "HasMany" && "foreignKey" in rel;
13
13
  };
14
14
  exports.isHasManyRelationship = isHasManyRelationship;
15
15
  /**
16
16
  * Type guard to check if the relationship is a BelongsTo
17
17
  */
18
18
  const isBelongsToRelationship = (rel) => {
19
- return rel.type === "BelongsTo" && rel.foreignKey !== undefined;
19
+ return rel.type === "BelongsTo" && "foreignKey" in rel;
20
20
  };
21
21
  exports.isBelongsToRelationship = isBelongsToRelationship;
22
22
  /**
23
23
  * Type guard to check if the relationship is a HasOne
24
24
  */
25
25
  const isHasOneRelationship = (rel) => {
26
- return rel.type === "HasOne" && rel.foreignKey !== undefined;
26
+ return rel.type === "HasOne" && "foreignKey" in rel;
27
27
  };
28
28
  exports.isHasOneRelationship = isHasOneRelationship;
29
29
  /**
30
30
  * Type guard to check if the relationship is a HasOne
31
31
  */
32
32
  const isHasAndBelongsToManyRelationship = (rel) => {
33
- return rel.type === "HasAndBelongsToMany" && rel.joinTableName !== undefined;
33
+ return rel.type === "HasAndBelongsToMany" && "joinTableName" in rel;
34
34
  };
35
35
  exports.isHasAndBelongsToManyRelationship = isHasAndBelongsToManyRelationship;
36
36
  /**
@@ -137,7 +137,7 @@ class Create extends OperationBase_1.default {
137
137
  const relMetadata = this.entityMetadata.belongsToOrOwnedByRelationships;
138
138
  for (const relMeta of relMetadata) {
139
139
  const foreignKey = (0, utils_2.extractForeignKeyFromEntity)(relMeta, entityData);
140
- if (foreignKey !== undefined) {
140
+ if (foreignKey != null) {
141
141
  // Ensure referenced entity exists before linking
142
142
  if (referentialIntegrityCheck) {
143
143
  this.buildRelationshipExistsConditionTransaction(relMeta, foreignKey);
@@ -201,7 +201,7 @@ class Create extends OperationBase_1.default {
201
201
  const belongsToRelMetas = Object.values(relMetas).filter(relMeta => (0, utils_3.isBelongsToRelationship)(relMeta));
202
202
  belongsToRelMetas.forEach(relMeta => {
203
203
  const fk = (0, utils_2.extractForeignKeyFromEntity)(relMeta, entityData);
204
- if (fk !== undefined) {
204
+ if (fk != null) {
205
205
  transactionBuilder.addGet({
206
206
  TableName: tableName,
207
207
  Key: {
@@ -270,9 +270,7 @@ class Create extends OperationBase_1.default {
270
270
  TableName: this.tableMetadata.name,
271
271
  Item: { ...tableItem, ...key },
272
272
  ConditionExpression: `attribute_not_exists(${this.partitionKeyAlias})`
273
- },
274
- // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
275
- `${this.EntityClass.name} already has an associated ${relationshipType}`);
273
+ }, `${this.EntityClass.name} already has an associated ${relationshipType}`);
276
274
  });
277
275
  }
278
276
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Delete.d.ts","sourceRoot":"","sources":["../../../../src/operations/Delete/Delete.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAY/C,OAAO,KAAK,EAEV,WAAW,EAEZ,MAAM,aAAa,CAAC;AAErB,OAAO,aAAa,MAAM,kBAAkB,CAAC;AA2B7C;;;;;;;;;GASG;AACH,cAAM,MAAM,CAAC,CAAC,SAAS,UAAU,CAAE,SAAQ,aAAa,CAAC,CAAC,CAAC;;gBAS7C,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;IAiBlC;;;;;;;OAOG;IACU,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAgC3C;;;;OAIG;YACW,QAAQ;IAiCtB;;;;OAIG;IACH,OAAO,CAAC,iCAAiC;IASzC;;;OAGG;IACH,OAAO,CAAC,2BAA2B;IAOnC;;;OAGG;IACH,OAAO,CAAC,0BAA0B;IAalC;;;OAGG;IACH,OAAO,CAAC,4BAA4B;IAkBpC;;;;OAIG;YACW,iCAAiC;IA2B/C;;;;OAIG;IACH,OAAO,CAAC,uCAAuC;IA2B/C;;;OAGG;IACH,OAAO,CAAC,mCAAmC;IAiB3C;;;OAGG;IACH,OAAO,CAAC,+BAA+B;IAqBvC;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IAI5B,OAAO,CAAC,cAAc;CAcvB;AAED,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"Delete.d.ts","sourceRoot":"","sources":["../../../../src/operations/Delete/Delete.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAY/C,OAAO,KAAK,EAEV,WAAW,EAEZ,MAAM,aAAa,CAAC;AAErB,OAAO,aAAa,MAAM,kBAAkB,CAAC;AA2B7C;;;;;;;;;GASG;AACH,cAAM,MAAM,CAAC,CAAC,SAAS,UAAU,CAAE,SAAQ,aAAa,CAAC,CAAC,CAAC;;gBAS7C,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;IAiBlC;;;;;;;OAOG;IACU,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAgC3C;;;;OAIG;YACW,QAAQ;IAiCtB;;;;OAIG;IACH,OAAO,CAAC,iCAAiC;IASzC;;;OAGG;IACH,OAAO,CAAC,2BAA2B;IAOnC;;;OAGG;IACH,OAAO,CAAC,0BAA0B;IAalC;;;OAGG;IACH,OAAO,CAAC,4BAA4B;IAkBpC;;;;OAIG;YACW,iCAAiC;IA2B/C;;;;OAIG;IACH,OAAO,CAAC,uCAAuC;IAyB/C;;;OAGG;IACH,OAAO,CAAC,mCAAmC;IAiB3C;;;OAGG;IACH,OAAO,CAAC,+BAA+B;IAqBvC;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IAI5B,OAAO,CAAC,cAAc;CAcvB;AAED,eAAe,MAAM,CAAC"}
@@ -168,9 +168,10 @@ class Delete extends OperationBase_1.default {
168
168
  */
169
169
  buildDeleteAssociatedBelongsTransaction(entityId, item) {
170
170
  this.#belongsToRelationships.forEach(relMeta => {
171
- if ((0, utils_2.isKeyOfObject)(item, relMeta.foreignKey) &&
172
- item[relMeta.foreignKey] !== undefined) {
171
+ if ((0, utils_2.isKeyOfObject)(item, relMeta.foreignKey)) {
173
172
  const foreignKeyValue = item[relMeta.foreignKey];
173
+ if (foreignKeyValue === undefined)
174
+ return;
174
175
  const belongsToLinksKeys = (0, utils_3.buildBelongsToLinkKey)(this.EntityClass, entityId, relMeta, foreignKeyValue);
175
176
  this.buildDeleteItemTransaction(belongsToLinksKeys, {
176
177
  errorMessage: `Failed to delete denormalized record with keys: ${JSON.stringify(belongsToLinksKeys)}`
@@ -1 +1 @@
1
- {"version":3,"file":"FindById.d.ts","sourceRoot":"","sources":["../../../../src/operations/FindById/FindById.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAI/C,OAAO,KAAK,EAAE,QAAQ,EAAsB,MAAM,aAAa,CAAC;AAEhE,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EAErB,MAAM,SAAS,CAAC;AAQjB;;;;;;GAMG;AACH,cAAM,QAAQ,CAAC,CAAC,SAAS,UAAU,CAAE,SAAQ,aAAa,CAAC,CAAC,CAAC;IAC3D;;;;;;;OAOG;IACU,GAAG,CAAC,GAAG,SAAS,oBAAoB,CAAC,CAAC,CAAC,GAAG,EAAE,EACvD,EAAE,EAAE,MAAM,EACV,OAAO,CAAC,EAAE,eAAe,CAAC,CAAC,EAAE,GAAG,CAAC,GAChC,OAAO,CAAC,QAAQ,CAAC,CAAC,GAAG,mBAAmB,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;IAarD;;;;OAIG;YACW,YAAY;IAsB1B;;;;;;OAMG;YACW,oBAAoB;IAiClC;;;;;OAKG;IACH,OAAO,CAAC,kBAAkB;IAkB1B;;;;OAIG;IACH,OAAO,CAAC,wBAAwB;IAchC;;;;;;OAMG;IACH,OAAO,CAAC,8BAA8B;IA4BtC;;;;;;;OAOG;IACH,OAAO,CAAC,+BAA+B;CAaxC;AAED,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"FindById.d.ts","sourceRoot":"","sources":["../../../../src/operations/FindById/FindById.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAI/C,OAAO,KAAK,EAAE,QAAQ,EAAsB,MAAM,aAAa,CAAC;AAEhE,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EAErB,MAAM,SAAS,CAAC;AAQjB;;;;;;GAMG;AACH,cAAM,QAAQ,CAAC,CAAC,SAAS,UAAU,CAAE,SAAQ,aAAa,CAAC,CAAC,CAAC;IAC3D;;;;;;;OAOG;IACU,GAAG,CAAC,GAAG,SAAS,oBAAoB,CAAC,CAAC,CAAC,GAAG,EAAE,EACvD,EAAE,EAAE,MAAM,EACV,OAAO,CAAC,EAAE,eAAe,CAAC,CAAC,EAAE,GAAG,CAAC,GAChC,OAAO,CAAC,QAAQ,CAAC,CAAC,GAAG,mBAAmB,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;IAarD;;;;OAIG;YACW,YAAY;IAsB1B;;;;;;OAMG;YACW,oBAAoB;IAiClC;;;;;OAKG;IACH,OAAO,CAAC,kBAAkB;IAkB1B;;;;OAIG;IACH,OAAO,CAAC,wBAAwB;IAehC;;;;;;OAMG;IACH,OAAO,CAAC,8BAA8B;IA4BtC;;;;;;;OAOG;IACH,OAAO,CAAC,+BAA+B;CAaxC;AAED,eAAe,QAAQ,CAAC"}
@@ -34,7 +34,7 @@ class FindById extends OperationBase_1.default {
34
34
  else {
35
35
  return await this.findByIdWithIncludes(id, {
36
36
  includedAssociations: options.include,
37
- consistentRead: options?.consistentRead
37
+ consistentRead: options.consistentRead
38
38
  });
39
39
  }
40
40
  }
@@ -106,9 +106,9 @@ class FindById extends OperationBase_1.default {
106
106
  getIncludedRelationships(includedAssociations) {
107
107
  return includedAssociations.reduce((acc, includedRel) => {
108
108
  const key = includedRel.association;
109
- const included = this.entityMetadata.relationships[key];
110
- if (included !== undefined)
111
- acc.push(included);
109
+ if (key in this.entityMetadata.relationships) {
110
+ acc.push(this.entityMetadata.relationships[key]);
111
+ }
112
112
  return acc;
113
113
  }, []);
114
114
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Query.d.ts","sourceRoot":"","sources":["../../../../src/operations/Query/Query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAEL,KAAK,YAAY,IAAI,mBAAmB,EACzC,MAAM,mBAAmB,CAAC;AAI3B,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EACV,wBAAwB,EACxB,YAAY,EAEZ,YAAY,EACb,MAAM,SAAS,CAAC;AAEjB;;;;;;GAMG;AACH,cAAM,KAAK,CAAC,CAAC,SAAS,UAAU,CAAE,SAAQ,aAAa,CAAC,CAAC,CAAC;IACxD;;;;;OAKG;IACU,GAAG,CACd,GAAG,EAAE,MAAM,GAAG,wBAAwB,CAAC,CAAC,CAAC,EACzC,OAAO,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC,YAAY,EAAE,WAAW,CAAC,GAC9D,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAQ3B;;;;;;OAMG;YACW,UAAU;IAexB;;;;;;;OAOG;YACW,WAAW;IAyBzB;;;;OAIG;IACH,OAAO,CAAC,mBAAmB;IAY3B,OAAO,CAAC,uBAAuB;CAchC;AAED,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"Query.d.ts","sourceRoot":"","sources":["../../../../src/operations/Query/Query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAEL,KAAK,YAAY,IAAI,mBAAmB,EACzC,MAAM,mBAAmB,CAAC;AAI3B,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EACV,wBAAwB,EACxB,YAAY,EAEZ,YAAY,EACb,MAAM,SAAS,CAAC;AAEjB;;;;;;GAMG;AACH,cAAM,KAAK,CAAC,CAAC,SAAS,UAAU,CAAE,SAAQ,aAAa,CAAC,CAAC,CAAC;IACxD;;;;;OAKG;IACU,GAAG,CACd,GAAG,EAAE,MAAM,GAAG,wBAAwB,CAAC,CAAC,CAAC,EACzC,OAAO,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC,YAAY,EAAE,WAAW,CAAC,GAC9D,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAQ3B;;;;;;OAMG;YACW,UAAU;IAexB;;;;;;;OAOG;YACW,WAAW;IA0BzB;;;;OAIG;IACH,OAAO,CAAC,mBAAmB;IAY3B,OAAO,CAAC,uBAAuB;CAchC;AAED,eAAe,KAAK,CAAC"}
@@ -60,7 +60,8 @@ class Query extends OperationBase_1.default {
60
60
  const keyCondition = {
61
61
  [modelPk]: this.EntityClass.partitionKeyValue(id),
62
62
  ...(options?.skCondition !== undefined && {
63
- [modelSk]: options?.skCondition
63
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- SortKeyCondition includes NativeAttributeValue (any) from AWS SDK
64
+ [modelSk]: options.skCondition
64
65
  })
65
66
  };
66
67
  const params = new query_utils_1.QueryBuilder({
@@ -1 +1 @@
1
- {"version":3,"file":"Update.d.ts","sourceRoot":"","sources":["../../../../src/operations/Update/Update.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAGL,oBAAoB,EACrB,MAAM,oBAAoB,CAAC;AAqB5B,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EACV,iBAAiB,EACjB,aAAa,EACb,sBAAsB,EACvB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAmB,WAAW,EAAgB,MAAM,aAAa,CAAC;AA4D9E;;;;;;;;;;;;;;;;;GAiBG;AACH,cAAM,MAAM,CAAC,CAAC,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