dyna-record 0.4.11 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -6
- package/dist/src/DynaRecord.d.ts +28 -19
- package/dist/src/DynaRecord.d.ts.map +1 -1
- package/dist/src/DynaRecord.js +24 -6
- package/dist/src/Logger.d.ts.map +1 -1
- package/dist/src/Logger.js +0 -1
- package/dist/src/decorators/Entity.d.ts +1 -1
- package/dist/src/decorators/Entity.d.ts.map +1 -1
- package/dist/src/decorators/Entity.js +3 -5
- package/dist/src/decorators/Table.d.ts +1 -1
- package/dist/src/decorators/Table.d.ts.map +1 -1
- package/dist/src/decorators/Table.js +2 -4
- package/dist/src/decorators/attributes/BooleanAttribute.d.ts.map +1 -1
- package/dist/src/decorators/attributes/BooleanAttribute.js +7 -9
- package/dist/src/decorators/attributes/DateAttribute.d.ts.map +1 -1
- package/dist/src/decorators/attributes/DateAttribute.js +8 -10
- package/dist/src/decorators/attributes/EnumAttribute.d.ts.map +1 -1
- package/dist/src/decorators/attributes/EnumAttribute.js +7 -9
- package/dist/src/decorators/attributes/ForeignKeyAttribute.d.ts.map +1 -1
- package/dist/src/decorators/attributes/ForeignKeyAttribute.js +9 -11
- package/dist/src/decorators/attributes/NumberAttribute.d.ts.map +1 -1
- package/dist/src/decorators/attributes/NumberAttribute.js +7 -9
- package/dist/src/decorators/attributes/ObjectAttribute.d.ts +40 -17
- package/dist/src/decorators/attributes/ObjectAttribute.d.ts.map +1 -1
- package/dist/src/decorators/attributes/ObjectAttribute.js +80 -29
- package/dist/src/decorators/attributes/PartitionKeyAttribute.d.ts.map +1 -1
- package/dist/src/decorators/attributes/PartitionKeyAttribute.js +6 -8
- package/dist/src/decorators/attributes/SortKeyAttribute.d.ts.map +1 -1
- package/dist/src/decorators/attributes/SortKeyAttribute.js +6 -8
- package/dist/src/decorators/attributes/StringAttribute.d.ts.map +1 -1
- package/dist/src/decorators/attributes/StringAttribute.js +7 -9
- package/dist/src/decorators/attributes/serializers.d.ts +4 -3
- package/dist/src/decorators/attributes/serializers.d.ts.map +1 -1
- package/dist/src/decorators/attributes/serializers.js +2 -1
- package/dist/src/decorators/attributes/types.d.ts +20 -6
- package/dist/src/decorators/attributes/types.d.ts.map +1 -1
- package/dist/src/decorators/relationships/BelongsTo.d.ts.map +1 -1
- package/dist/src/decorators/relationships/BelongsTo.js +7 -9
- package/dist/src/decorators/relationships/HasAndBelongsToMany.d.ts.map +1 -1
- package/dist/src/decorators/relationships/HasAndBelongsToMany.js +13 -15
- package/dist/src/decorators/relationships/HasMany.d.ts.map +1 -1
- package/dist/src/decorators/relationships/HasMany.js +15 -17
- package/dist/src/decorators/relationships/HasOne.d.ts.map +1 -1
- package/dist/src/decorators/relationships/HasOne.js +7 -9
- package/dist/src/metadata/AttributeMetadata.d.ts +3 -0
- package/dist/src/metadata/AttributeMetadata.d.ts.map +1 -1
- package/dist/src/metadata/AttributeMetadata.js +5 -0
- package/dist/src/metadata/EntityMetadata.d.ts +2 -2
- package/dist/src/metadata/EntityMetadata.d.ts.map +1 -1
- package/dist/src/metadata/EntityMetadata.js +8 -1
- package/dist/src/metadata/MetadataStorage.d.ts.map +1 -1
- package/dist/src/metadata/MetadataStorage.js +6 -6
- package/dist/src/metadata/TableMetadata.d.ts.map +1 -1
- package/dist/src/metadata/TableMetadata.js +7 -1
- package/dist/src/metadata/relationship-metadata/BelongsToRelationship.d.ts.map +1 -1
- package/dist/src/metadata/relationship-metadata/BelongsToRelationship.js +1 -3
- package/dist/src/metadata/relationship-metadata/HasAndBelongsToManyRelationship.d.ts.map +1 -1
- package/dist/src/metadata/relationship-metadata/HasAndBelongsToManyRelationship.js +1 -3
- package/dist/src/metadata/relationship-metadata/HasManyRelationship.d.ts.map +1 -1
- package/dist/src/metadata/relationship-metadata/HasManyRelationship.js +1 -3
- package/dist/src/metadata/relationship-metadata/HasOneRelationship.d.ts.map +1 -1
- package/dist/src/metadata/relationship-metadata/HasOneRelationship.js +1 -3
- package/dist/src/metadata/relationship-metadata/OwnedByRelationship.d.ts.map +1 -1
- package/dist/src/metadata/relationship-metadata/OwnedByRelationship.js +1 -3
- package/dist/src/metadata/types.d.ts +14 -3
- package/dist/src/metadata/types.d.ts.map +1 -1
- package/dist/src/metadata/utils.js +4 -4
- package/dist/src/operations/Create/Create.js +3 -5
- package/dist/src/operations/Delete/Delete.d.ts.map +1 -1
- package/dist/src/operations/Delete/Delete.js +3 -2
- package/dist/src/operations/FindById/FindById.d.ts.map +1 -1
- package/dist/src/operations/FindById/FindById.js +4 -4
- package/dist/src/operations/Query/Query.d.ts.map +1 -1
- package/dist/src/operations/Query/Query.js +2 -1
- package/dist/src/operations/Update/Update.d.ts +6 -1
- package/dist/src/operations/Update/Update.d.ts.map +1 -1
- package/dist/src/operations/Update/Update.js +41 -17
- package/dist/src/operations/Update/types.d.ts +14 -4
- package/dist/src/operations/Update/types.d.ts.map +1 -1
- package/dist/src/operations/types.d.ts +1 -1
- package/dist/src/operations/types.d.ts.map +1 -1
- package/dist/src/operations/utils/expressionBuilder.d.ts +4 -3
- package/dist/src/operations/utils/expressionBuilder.d.ts.map +1 -1
- package/dist/src/operations/utils/expressionBuilder.js +66 -2
- package/dist/src/operations/utils/flattenObjectForUpdate.d.ts +19 -0
- package/dist/src/operations/utils/flattenObjectForUpdate.d.ts.map +1 -0
- package/dist/src/operations/utils/flattenObjectForUpdate.js +45 -0
- package/dist/src/operations/utils/index.d.ts +2 -0
- package/dist/src/operations/utils/index.d.ts.map +1 -1
- package/dist/src/operations/utils/index.js +2 -0
- package/dist/src/operations/utils/mergePartialObjectAttributes.d.ts +8 -0
- package/dist/src/operations/utils/mergePartialObjectAttributes.d.ts.map +1 -0
- package/dist/src/operations/utils/mergePartialObjectAttributes.js +60 -0
- package/dist/src/operations/utils/types.d.ts +16 -0
- package/dist/src/operations/utils/types.d.ts.map +1 -1
- package/dist/src/operations/utils/utils.d.ts +2 -2
- package/dist/src/operations/utils/utils.d.ts.map +1 -1
- package/dist/src/query-utils/QueryBuilder.d.ts.map +1 -1
- package/dist/src/query-utils/QueryBuilder.js +11 -7
- package/dist/src/query-utils/types.d.ts.map +1 -1
- package/dist/src/relationships/JoinTable.d.ts.map +1 -1
- package/dist/src/relationships/JoinTable.js +4 -3
- package/dist/src/utils.d.ts +4 -4
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +13 -11
- package/package.json +10 -12
|
@@ -84,7 +84,7 @@ class Update extends OperationBase_1.default {
|
|
|
84
84
|
getBelongsToRelMetaAndKeyForUpdatedKeys(attributes) {
|
|
85
85
|
return this.entityMetadata.belongsToRelationships.reduce((acc, meta) => {
|
|
86
86
|
const foreignKeyVal = (0, utils_2.extractForeignKeyFromEntity)(meta, attributes);
|
|
87
|
-
if (foreignKeyVal
|
|
87
|
+
if (foreignKeyVal != null)
|
|
88
88
|
acc.push({ meta, foreignKeyVal });
|
|
89
89
|
return acc;
|
|
90
90
|
}, []);
|
|
@@ -143,15 +143,13 @@ class Update extends OperationBase_1.default {
|
|
|
143
143
|
const transactionBuilder = new dynamo_utils_1.TransactGetBuilder();
|
|
144
144
|
// Get the new BelongsTo relationship entities that are being updated
|
|
145
145
|
belongsToRelFkAndMetas.forEach(({ meta, foreignKeyVal }) => {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
});
|
|
154
|
-
}
|
|
146
|
+
transactionBuilder.addGet({
|
|
147
|
+
TableName: tableName,
|
|
148
|
+
Key: {
|
|
149
|
+
[this.partitionKeyAlias]: meta.target.partitionKeyValue(foreignKeyVal),
|
|
150
|
+
[this.sortKeyAlias]: meta.target.name
|
|
151
|
+
}
|
|
152
|
+
});
|
|
155
153
|
});
|
|
156
154
|
const typeAlias = this.tableMetadata.defaultAttributes.type.alias;
|
|
157
155
|
// Get linked items from entity being updates partition as well as new foreign entities if adding or updating an FK
|
|
@@ -210,7 +208,12 @@ class Update extends OperationBase_1.default {
|
|
|
210
208
|
*
|
|
211
209
|
* **What it does:**
|
|
212
210
|
* - Merges the provided attributes with `updatedAt` (automatically set to the current time).
|
|
213
|
-
* -
|
|
211
|
+
* - For `@ObjectAttribute` fields with non-null values, flattens the partial object into
|
|
212
|
+
* {@link DocumentPathOperation | document path operations} (e.g., `SET #address.#street = :address_street`)
|
|
213
|
+
* instead of replacing the entire map. Nested objects are recursively flattened.
|
|
214
|
+
* - For regular attributes and `@ObjectAttribute` fields set to `null`, uses the standard
|
|
215
|
+
* expression builder (existing full-replacement / REMOVE behavior).
|
|
216
|
+
* - Combines both regular and document path expressions into a single DynamoDB update expression.
|
|
214
217
|
*
|
|
215
218
|
* @param attributes - The partial attributes to be updated on the entity.
|
|
216
219
|
* @returns An object containing:
|
|
@@ -223,8 +226,29 @@ class Update extends OperationBase_1.default {
|
|
|
223
226
|
...attributes,
|
|
224
227
|
updatedAt: new Date()
|
|
225
228
|
};
|
|
226
|
-
const
|
|
227
|
-
|
|
229
|
+
const entityAttrs = metadata_1.default.getEntityAttributes(this.EntityClass.name);
|
|
230
|
+
// Separate ObjectAttribute fields (non-null) for document path handling
|
|
231
|
+
const regularAttrs = {};
|
|
232
|
+
const allDocumentPathOps = [];
|
|
233
|
+
for (const [key, val] of Object.entries(updatedAttrs)) {
|
|
234
|
+
if (!(key in entityAttrs)) {
|
|
235
|
+
regularAttrs[key] = val;
|
|
236
|
+
continue;
|
|
237
|
+
}
|
|
238
|
+
const attrMeta = entityAttrs[key];
|
|
239
|
+
if (attrMeta.objectSchema !== undefined) {
|
|
240
|
+
// ObjectAttribute → flatten for document path updates (objects are never nullable)
|
|
241
|
+
const alias = attrMeta.alias;
|
|
242
|
+
const ops = (0, utils_2.flattenObjectForUpdate)([alias], attrMeta.objectSchema, val);
|
|
243
|
+
allDocumentPathOps.push(...ops);
|
|
244
|
+
}
|
|
245
|
+
else {
|
|
246
|
+
// Regular attribute → existing behavior
|
|
247
|
+
regularAttrs[key] = val;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
const tableAttrs = (0, utils_1.entityToTableItem)(this.EntityClass, regularAttrs);
|
|
251
|
+
const expression = (0, utils_2.expressionBuilder)(tableAttrs, allDocumentPathOps);
|
|
228
252
|
return { updatedAttrs, expression };
|
|
229
253
|
}
|
|
230
254
|
/**
|
|
@@ -287,7 +311,7 @@ class Update extends OperationBase_1.default {
|
|
|
287
311
|
else if (isRemovingForeignKey) {
|
|
288
312
|
this.removeForeignKeysTransactions(entityId, relMeta, oldFk);
|
|
289
313
|
}
|
|
290
|
-
else if (isUpdatingForeignKey) {
|
|
314
|
+
else if (isUpdatingForeignKey && foreignKey !== null) {
|
|
291
315
|
this.updateForeignKeyTransactions(updatedEntity, relMeta, foreignKey, oldFk, newBelongsToEntityLookup, referentialIntegrityCheck);
|
|
292
316
|
}
|
|
293
317
|
else if (foreignKey !== null) {
|
|
@@ -386,10 +410,10 @@ class Update extends OperationBase_1.default {
|
|
|
386
410
|
* @param persistToSelfConditionErrMessage
|
|
387
411
|
*/
|
|
388
412
|
buildAddForeignEntityToSelfTransaction(updatedEntity, relMeta, foreignKey, newBelongsToEntityLookup, persistToSelfCondition, persistToSelfConditionErrMessage) {
|
|
389
|
-
|
|
390
|
-
if (linkedEntity === undefined) {
|
|
413
|
+
if (!(foreignKey in newBelongsToEntityLookup)) {
|
|
391
414
|
throw new errors_1.NotFoundError(`${relMeta.target.name} does not exist: ${foreignKey}`);
|
|
392
415
|
}
|
|
416
|
+
const linkedEntity = newBelongsToEntityLookup[foreignKey];
|
|
393
417
|
const key = {
|
|
394
418
|
[this.partitionKeyAlias]: this.EntityClass.partitionKeyValue(updatedEntity.id),
|
|
395
419
|
[this.sortKeyAlias]: relMeta.target.name
|
|
@@ -481,7 +505,7 @@ class Update extends OperationBase_1.default {
|
|
|
481
505
|
* @returns
|
|
482
506
|
*/
|
|
483
507
|
buildUpdatedRelatedEntityLinkKey(id, entity, relLookup) {
|
|
484
|
-
const isHasAndBelongsToManyRel =
|
|
508
|
+
const isHasAndBelongsToManyRel = entity.type in relLookup;
|
|
485
509
|
const sortKey = isHasAndBelongsToManyRel
|
|
486
510
|
? this.EntityClass.partitionKeyValue(id)
|
|
487
511
|
: this.EntityClass.name;
|
|
@@ -13,12 +13,14 @@ type NullableProperties<T> = {
|
|
|
13
13
|
* Recursively resolves the value type for `AllowNullForNullable`.
|
|
14
14
|
*
|
|
15
15
|
* For plain object types (not `Date`, arrays, primitives, or functions),
|
|
16
|
-
* recurses via {@link AllowNullForNullable} so that
|
|
17
|
-
*
|
|
16
|
+
* wraps with `Partial<>` and recurses via {@link AllowNullForNullable} so that:
|
|
17
|
+
* - All fields within `@ObjectAttribute` objects are optional in update payloads,
|
|
18
|
+
* matching the partial update semantics (only provided fields are modified).
|
|
19
|
+
* - Nullable fields at any nesting depth receive `| null` during updates.
|
|
18
20
|
*
|
|
19
21
|
* Primitives, `Date`, arrays, and functions pass through unchanged.
|
|
20
22
|
*/
|
|
21
|
-
type AllowNullForNullableValue<T> = T extends Date | readonly unknown[] | string | number | boolean | null | undefined | ((...args: unknown[]) => unknown) ? T : T extends Record<string, unknown> ? AllowNullForNullable<T
|
|
23
|
+
type AllowNullForNullableValue<T> = T extends Date | readonly unknown[] | string | number | boolean | null | undefined | ((...args: unknown[]) => unknown) ? T : T extends Record<string, unknown> ? Partial<AllowNullForNullable<T>> : T;
|
|
22
24
|
/**
|
|
23
25
|
* Transforms a type `T` by allowing `null` as an additional type for its nullable properties.
|
|
24
26
|
*
|
|
@@ -33,13 +35,21 @@ type AllowNullForNullable<T> = {
|
|
|
33
35
|
[K in keyof T]: K extends NullableProperties<T> ? AllowNullForNullableValue<NonNullable<T[K]>> | null | undefined : AllowNullForNullableValue<T[K]>;
|
|
34
36
|
};
|
|
35
37
|
/**
|
|
36
|
-
* Attributes of an entity to update. Not all properties are required. Setting a nullable property to null will remove the attribute from the item
|
|
38
|
+
* Attributes of an entity to update. Not all properties are required. Setting a nullable property to null will remove the attribute from the item.
|
|
39
|
+
*
|
|
40
|
+
* For `@ObjectAttribute` fields, all nested fields are `Partial` — you only need to provide the
|
|
41
|
+
* fields you want to change. Omitted fields are preserved in DynamoDB via document path expressions.
|
|
37
42
|
*
|
|
38
43
|
* @example
|
|
39
44
|
* await MockModel.update("123", {
|
|
40
45
|
* nonNullableAttr: "new val", // Sets new value
|
|
41
46
|
* nullableAttr: null // Remove the value. This will throw a compile time error if the property is not nullable
|
|
42
47
|
* })
|
|
48
|
+
*
|
|
49
|
+
* @example Partial ObjectAttribute update
|
|
50
|
+
* await MockModel.update("123", {
|
|
51
|
+
* address: { street: "456 Oak Ave" } // Only updates street, preserves other fields
|
|
52
|
+
* })
|
|
43
53
|
*/
|
|
44
54
|
export type UpdateOptions<T extends DynaRecord> = Partial<AllowNullForNullable<EntityDefinedAttributes<T>>>;
|
|
45
55
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/operations/Update/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAExD;;;;;GAKG;AACH,KAAK,kBAAkB,CAAC,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,CAAC,GAAG,SAAS,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK;CACnD,CAAC,MAAM,CAAC,CAAC,CAAC;AAEX
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/operations/Update/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAExD;;;;;GAKG;AACH,KAAK,kBAAkB,CAAC,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,CAAC,GAAG,SAAS,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK;CACnD,CAAC,MAAM,CAAC,CAAC,CAAC;AAEX;;;;;;;;;;GAUG;AACH,KAAK,yBAAyB,CAAC,CAAC,IAAI,CAAC,SACjC,IAAI,GACJ,SAAS,OAAO,EAAE,GAClB,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,SAAS,GACT,CAAC,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,GACjC,CAAC,GACD,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,GAChC,CAAC,CAAC;AAER;;;;;;;;;GASG;AACH,KAAK,oBAAoB,CAAC,CAAC,IAAI;KAC5B,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,SAAS,kBAAkB,CAAC,CAAC,CAAC,GAC3C,yBAAyB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,GAC/D,yBAAyB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACpC,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,UAAU,IAAI,OAAO,CACvD,oBAAoB,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC,CACjD,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;;;OAKG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,UAAU,IAAI,IAAI,CACxD,OAAO,CAAC,CAAC,CAAC,EACV,WAAW,CACZ,CAAC"}
|
|
@@ -26,7 +26,7 @@ export type SortKeyAttribute<T> = {
|
|
|
26
26
|
* @returns The names of the function properties as strings if any exist; otherwise, the result is `never`.
|
|
27
27
|
*/
|
|
28
28
|
export type FunctionFields<T> = {
|
|
29
|
-
[K in keyof T]: T[K] extends (...args:
|
|
29
|
+
[K in keyof T]: T[K] extends (...args: never[]) => unknown ? K : never;
|
|
30
30
|
}[keyof T];
|
|
31
31
|
/**
|
|
32
32
|
* Allow ForeignKey attributes to be passes to the create method by using their inferred primitive type
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/operations/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EACV,UAAU,EACV,kBAAkB,EAClB,QAAQ,EACR,YAAY,EACZ,OAAO,EACR,MAAM,UAAU,CAAC;AAElB;;;;;GAKG;AACH,MAAM,MAAM,qBAAqB,CAAC,CAAC,IAAI;KACpC,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,YAAY,GAAG,CAAC,GAAG,KAAK;CACtD,CAAC,MAAM,CAAC,CAAC,CAAC;AAEX;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI;KAC/B,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,OAAO,GAAG,CAAC,GAAG,KAAK;CACjD,CAAC,MAAM,CAAC,CAAC,CAAC;AAEX;;;;;GAKG;AACH,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI;KAC7B,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/operations/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,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AAwB,CAAC,CAAC,SAAS,UAAU,IAAI,IAAI,CAC/D,CAAC,EACD,0BAA0B,CAAC,CAAC,CAAC,CAC9B,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,UAAU,IAAI,IAAI,CAC3D,CAAC,EACD,0BAA0B,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAClD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,4BAA4B,GAAG,IAAI,CAC7C,UAAU,EACV,OAAO,CAAC,MAAM,UAAU,EAAE,aAAa,CAAC,CACzC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,uBAAuB,CAAC,CAAC,SAAS,UAAU,IAAI,IAAI,CAC9D,iBAAiB,CAAC,CAAC,CAAC,EAClB,MAAM,UAAU,GAChB,0BAA0B,CAAC,CAAC,CAAC,GAC7B,cAAc,CAAC,CAAC,CAAC,GACjB,qBAAqB,CAAC,CAAC,CAAC,GACxB,gBAAgB,CAAC,CAAC,CAAC,CACtB,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { DynamoTableItem } from "../../types";
|
|
2
|
-
import type { UpdateExpression } from "./types";
|
|
2
|
+
import type { UpdateExpression, DocumentPathOperation } from "./types";
|
|
3
3
|
/**
|
|
4
|
-
* Builds a dynamo expression given the table attributes
|
|
4
|
+
* Builds a dynamo expression given the table attributes and optional document path operations
|
|
5
5
|
* @param tableAttrs The table aliases of the entity attributes
|
|
6
|
+
* @param documentPathOps Optional document path operations for partial ObjectAttribute updates
|
|
6
7
|
* @returns
|
|
7
8
|
*/
|
|
8
|
-
export declare const expressionBuilder: (tableAttrs: DynamoTableItem) => UpdateExpression;
|
|
9
|
+
export declare const expressionBuilder: (tableAttrs: DynamoTableItem, documentPathOps?: DocumentPathOperation[]) => UpdateExpression;
|
|
9
10
|
//# sourceMappingURL=expressionBuilder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expressionBuilder.d.ts","sourceRoot":"","sources":["../../../../src/operations/utils/expressionBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EACV,gBAAgB,
|
|
1
|
+
{"version":3,"file":"expressionBuilder.d.ts","sourceRoot":"","sources":["../../../../src/operations/utils/expressionBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EACV,gBAAgB,EAGhB,qBAAqB,EACtB,MAAM,SAAS,CAAC;AAyBjB;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,eAChB,eAAe,oBACT,qBAAqB,EAAE,KACxC,gBAiEF,CAAC"}
|
|
@@ -2,14 +2,46 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.expressionBuilder = void 0;
|
|
4
4
|
/**
|
|
5
|
-
* Builds a dynamo expression given the table attributes
|
|
5
|
+
* Builds a dynamo expression given the table attributes and optional document path operations
|
|
6
6
|
* @param tableAttrs The table aliases of the entity attributes
|
|
7
|
+
* @param documentPathOps Optional document path operations for partial ObjectAttribute updates
|
|
7
8
|
* @returns
|
|
8
9
|
*/
|
|
9
|
-
const expressionBuilder = (tableAttrs) => {
|
|
10
|
+
const expressionBuilder = (tableAttrs, documentPathOps) => {
|
|
10
11
|
const sorted = sortAttributesByOperand(tableAttrs);
|
|
11
12
|
const setExpression = buildUpdateSetExpression(sorted.set);
|
|
12
13
|
const removeExpression = buildUpdateRemoveExpression(sorted.remove);
|
|
14
|
+
// Merge document path operations into the expressions
|
|
15
|
+
if (documentPathOps !== undefined && documentPathOps.length > 0) {
|
|
16
|
+
const docPathResult = buildDocumentPathExpressions(documentPathOps);
|
|
17
|
+
// Merge SET items
|
|
18
|
+
if (docPathResult.setItems.length > 0) {
|
|
19
|
+
Object.assign(setExpression.ExpressionAttributeNames, docPathResult.expressionAttributeNames);
|
|
20
|
+
Object.assign(setExpression.ExpressionAttributeValues, docPathResult.expressionAttributeValues);
|
|
21
|
+
const existingSet = setExpression.UpdateExpression;
|
|
22
|
+
const docSetClause = docPathResult.setItems.join(", ");
|
|
23
|
+
if (existingSet !== "") {
|
|
24
|
+
// Append to existing SET clause
|
|
25
|
+
setExpression.UpdateExpression = `${existingSet}, ${docSetClause}`;
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
setExpression.UpdateExpression = `SET ${docSetClause}`;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
// Merge REMOVE items
|
|
32
|
+
if (docPathResult.removeItems.length > 0) {
|
|
33
|
+
// Add names used in REMOVE paths
|
|
34
|
+
Object.assign(removeExpression.ExpressionAttributeNames, docPathResult.expressionAttributeNames);
|
|
35
|
+
const existingRemove = removeExpression.UpdateExpression;
|
|
36
|
+
const docRemoveClause = docPathResult.removeItems.join(", ");
|
|
37
|
+
if (existingRemove !== "") {
|
|
38
|
+
removeExpression.UpdateExpression = `${existingRemove}, ${docRemoveClause}`;
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
removeExpression.UpdateExpression = `REMOVE ${docRemoveClause}`;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
13
45
|
return {
|
|
14
46
|
// If the operation has only REMOVE actions, it will not have expression attribute values
|
|
15
47
|
ExpressionAttributeValues: setExpression.ExpressionAttributeValues,
|
|
@@ -26,6 +58,35 @@ const expressionBuilder = (tableAttrs) => {
|
|
|
26
58
|
};
|
|
27
59
|
};
|
|
28
60
|
exports.expressionBuilder = expressionBuilder;
|
|
61
|
+
/**
|
|
62
|
+
* Build document path expressions from DocumentPathOperations
|
|
63
|
+
*/
|
|
64
|
+
const buildDocumentPathExpressions = (ops) => {
|
|
65
|
+
const result = {
|
|
66
|
+
setItems: [],
|
|
67
|
+
removeItems: [],
|
|
68
|
+
expressionAttributeNames: {},
|
|
69
|
+
expressionAttributeValues: {}
|
|
70
|
+
};
|
|
71
|
+
for (const op of ops) {
|
|
72
|
+
// Build the document path expression: #segment1.#segment2.#segment3
|
|
73
|
+
const pathExpr = op.path.map(seg => `#${seg}`).join(".");
|
|
74
|
+
// Build the value placeholder: :segment1_segment2_segment3
|
|
75
|
+
const valuePlaceholder = `:${op.path.join("_")}`;
|
|
76
|
+
// Register all path segment names
|
|
77
|
+
for (const seg of op.path) {
|
|
78
|
+
result.expressionAttributeNames[`#${seg}`] = seg;
|
|
79
|
+
}
|
|
80
|
+
if (op.type === "set") {
|
|
81
|
+
result.setItems.push(`${pathExpr} = ${valuePlaceholder}`);
|
|
82
|
+
result.expressionAttributeValues[valuePlaceholder] = op.value;
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
result.removeItems.push(pathExpr);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return result;
|
|
89
|
+
};
|
|
29
90
|
/**
|
|
30
91
|
* Sort attributes based on their operand
|
|
31
92
|
* @param tableAttrs
|
|
@@ -35,9 +96,11 @@ const sortAttributesByOperand = (tableAttrs) => {
|
|
|
35
96
|
return Object.entries(tableAttrs).reduce((acc, [key, value]) => {
|
|
36
97
|
const isRemovingAttr = value === null;
|
|
37
98
|
if (isRemovingAttr) {
|
|
99
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- DynamoTableItem values are NativeAttributeValue (any) from AWS SDK
|
|
38
100
|
acc.remove[key] = value;
|
|
39
101
|
}
|
|
40
102
|
else {
|
|
103
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- DynamoTableItem values are NativeAttributeValue (any) from AWS SDK
|
|
41
104
|
acc.set[key] = value;
|
|
42
105
|
}
|
|
43
106
|
return acc;
|
|
@@ -59,6 +122,7 @@ const buildUpdateSetExpression = (tableAttrs) => {
|
|
|
59
122
|
const attrVal = `:${key}`;
|
|
60
123
|
const expression = ` ${attrName} = ${attrVal},`;
|
|
61
124
|
acc.ExpressionAttributeNames[attrName] = key;
|
|
125
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- DynamoTableItem values are NativeAttributeValue (any) from AWS SDK
|
|
62
126
|
acc.ExpressionAttributeValues[attrVal] = val;
|
|
63
127
|
acc.UpdateExpression = acc.UpdateExpression.concat(expression);
|
|
64
128
|
// For the first element, add the operand
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ObjectSchema } from "../../decorators/attributes/types";
|
|
2
|
+
import type { DocumentPathOperation } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Flattens a partial object value into document path operations for DynamoDB
|
|
5
|
+
* update expressions.
|
|
6
|
+
*
|
|
7
|
+
* For each field in the partial value:
|
|
8
|
+
* - `undefined` → skip (not being updated)
|
|
9
|
+
* - `null` → REMOVE operation
|
|
10
|
+
* - Nested object (`fieldDef.type === "object"`) → recurse, prepending parent path
|
|
11
|
+
* - Everything else (primitives, arrays, dates, enums) → serialize and SET
|
|
12
|
+
*
|
|
13
|
+
* @param parentPath Path segments leading to this object (e.g. ["address"] or ["address", "geo"])
|
|
14
|
+
* @param schema The ObjectSchema describing the object shape
|
|
15
|
+
* @param partialValue The partial object value to flatten
|
|
16
|
+
* @returns Array of DocumentPathOperation for use in expressionBuilder
|
|
17
|
+
*/
|
|
18
|
+
export declare function flattenObjectForUpdate(parentPath: string[], schema: ObjectSchema, partialValue: Record<string, unknown>): DocumentPathOperation[];
|
|
19
|
+
//# sourceMappingURL=flattenObjectForUpdate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flattenObjectForUpdate.d.ts","sourceRoot":"","sources":["../../../../src/operations/utils/flattenObjectForUpdate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAErD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,MAAM,EAAE,EACpB,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACpC,qBAAqB,EAAE,CAmCzB"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.flattenObjectForUpdate = flattenObjectForUpdate;
|
|
4
|
+
const serializers_1 = require("../../decorators/attributes/serializers");
|
|
5
|
+
/**
|
|
6
|
+
* Flattens a partial object value into document path operations for DynamoDB
|
|
7
|
+
* update expressions.
|
|
8
|
+
*
|
|
9
|
+
* For each field in the partial value:
|
|
10
|
+
* - `undefined` → skip (not being updated)
|
|
11
|
+
* - `null` → REMOVE operation
|
|
12
|
+
* - Nested object (`fieldDef.type === "object"`) → recurse, prepending parent path
|
|
13
|
+
* - Everything else (primitives, arrays, dates, enums) → serialize and SET
|
|
14
|
+
*
|
|
15
|
+
* @param parentPath Path segments leading to this object (e.g. ["address"] or ["address", "geo"])
|
|
16
|
+
* @param schema The ObjectSchema describing the object shape
|
|
17
|
+
* @param partialValue The partial object value to flatten
|
|
18
|
+
* @returns Array of DocumentPathOperation for use in expressionBuilder
|
|
19
|
+
*/
|
|
20
|
+
function flattenObjectForUpdate(parentPath, schema, partialValue) {
|
|
21
|
+
const ops = [];
|
|
22
|
+
for (const [key, val] of Object.entries(partialValue)) {
|
|
23
|
+
if (!(key in schema))
|
|
24
|
+
continue;
|
|
25
|
+
const fieldDef = schema[key];
|
|
26
|
+
const fieldPath = [...parentPath, key];
|
|
27
|
+
if (val === undefined) {
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
if (val === null) {
|
|
31
|
+
ops.push({ type: "remove", path: fieldPath });
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
if (fieldDef.type === "object") {
|
|
35
|
+
// Recurse into nested objects
|
|
36
|
+
const nestedOps = flattenObjectForUpdate(fieldPath, fieldDef.fields, val);
|
|
37
|
+
ops.push(...nestedOps);
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
// Primitives, arrays, dates, enums → serialize and SET
|
|
41
|
+
const serialized = (0, serializers_1.convertFieldToTableItem)(fieldDef, val);
|
|
42
|
+
ops.push({ type: "set", path: fieldPath, value: serialized });
|
|
43
|
+
}
|
|
44
|
+
return ops;
|
|
45
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/operations/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/operations/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|
|
@@ -15,5 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./expressionBuilder"), exports);
|
|
18
|
+
__exportStar(require("./flattenObjectForUpdate"), exports);
|
|
19
|
+
__exportStar(require("./mergePartialObjectAttributes"), exports);
|
|
18
20
|
__exportStar(require("./types"), exports);
|
|
19
21
|
__exportStar(require("./utils"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AttributeMetadataStorage } from "../../metadata";
|
|
2
|
+
/**
|
|
3
|
+
* Deep merges partial ObjectAttribute updates into the target object.
|
|
4
|
+
* For ObjectAttribute fields: recursively merges using the schema, removing null fields.
|
|
5
|
+
* For regular fields: shallow assigns (existing behavior).
|
|
6
|
+
*/
|
|
7
|
+
export declare function mergePartialObjectAttributes(target: Record<string, unknown>, partial: Record<string, unknown>, entityAttrs: AttributeMetadataStorage): void;
|
|
8
|
+
//# sourceMappingURL=mergePartialObjectAttributes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mergePartialObjectAttributes.d.ts","sourceRoot":"","sources":["../../../../src/operations/utils/mergePartialObjectAttributes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAG/D;;;;GAIG;AACH,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,WAAW,EAAE,wBAAwB,GACpC,IAAI,CAqBN"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mergePartialObjectAttributes = mergePartialObjectAttributes;
|
|
4
|
+
/**
|
|
5
|
+
* Deep merges partial ObjectAttribute updates into the target object.
|
|
6
|
+
* For ObjectAttribute fields: recursively merges using the schema, removing null fields.
|
|
7
|
+
* For regular fields: shallow assigns (existing behavior).
|
|
8
|
+
*/
|
|
9
|
+
function mergePartialObjectAttributes(target, partial, entityAttrs) {
|
|
10
|
+
for (const [key, val] of Object.entries(partial)) {
|
|
11
|
+
if (!(key in entityAttrs)) {
|
|
12
|
+
target[key] = val;
|
|
13
|
+
continue;
|
|
14
|
+
}
|
|
15
|
+
const attrMeta = entityAttrs[key];
|
|
16
|
+
if (attrMeta.objectSchema !== undefined) {
|
|
17
|
+
// Deep merge for ObjectAttribute (objects are never nullable)
|
|
18
|
+
const existing = target[key] ?? {};
|
|
19
|
+
target[key] = deepMergeObject(existing, val, attrMeta.objectSchema);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
target[key] = val;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Recursively deep merges a partial object into an existing object using the schema
|
|
28
|
+
* to determine which fields are nested objects (and should be recursed) vs leaf values
|
|
29
|
+
* (which should be overwritten).
|
|
30
|
+
* - null values cause the key to be deleted
|
|
31
|
+
* - object-type fields per the schema are recursed
|
|
32
|
+
* - everything else (primitives, arrays, dates, enums) is overwritten
|
|
33
|
+
*/
|
|
34
|
+
function deepMergeObject(existing, partial, schema) {
|
|
35
|
+
const result = {};
|
|
36
|
+
// Copy existing keys, skipping those being nulled
|
|
37
|
+
for (const [key, val] of Object.entries(existing)) {
|
|
38
|
+
if (partial[key] !== null) {
|
|
39
|
+
result[key] = val;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
// Apply updates in a single pass
|
|
43
|
+
for (const [key, val] of Object.entries(partial)) {
|
|
44
|
+
if (val === null || val === undefined) {
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
if (!(key in schema)) {
|
|
48
|
+
result[key] = val;
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
const fieldDef = schema[key];
|
|
52
|
+
if (fieldDef.type === "object" && typeof existing[key] === "object") {
|
|
53
|
+
result[key] = deepMergeObject(existing[key], val, fieldDef.fields);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
result[key] = val;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return result;
|
|
60
|
+
}
|
|
@@ -18,4 +18,20 @@ export interface UpdateRemoveExpression {
|
|
|
18
18
|
* Represents either an update expression for setting new or modifying existing attributes of an item (UpdateSetExpression) or an update expression for removing attributes from an item (UpdateRemoveExpression) in DynamoDB.
|
|
19
19
|
*/
|
|
20
20
|
export type UpdateExpression = UpdateSetExpression | UpdateRemoveExpression;
|
|
21
|
+
/**
|
|
22
|
+
* Represents a single document path operation for partial ObjectAttribute updates.
|
|
23
|
+
* Used to build DynamoDB document path expressions like `SET #addr.#street = :addr_street`
|
|
24
|
+
* or `REMOVE #addr.#zip`.
|
|
25
|
+
*/
|
|
26
|
+
export type DocumentPathOperation = {
|
|
27
|
+
type: "set";
|
|
28
|
+
/** Path segments, e.g. ["address", "street"] or ["address", "geo", "lat"] */
|
|
29
|
+
path: string[];
|
|
30
|
+
/** The serialized value */
|
|
31
|
+
value: unknown;
|
|
32
|
+
} | {
|
|
33
|
+
type: "remove";
|
|
34
|
+
/** Path segments, e.g. ["address", "zip"] */
|
|
35
|
+
path: string[];
|
|
36
|
+
};
|
|
21
37
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/operations/utils/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEhE;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,gBAAgB,EAAE,WAAW,CAAC,kBAAkB,CAAC,kBAAkB,CAAC,CAAC,CAAC;IACtE,wBAAwB,EAAE,WAAW,CACnC,kBAAkB,CAAC,0BAA0B,CAAC,CAC/C,CAAC;IACF,yBAAyB,EAAE,WAAW,CACpC,kBAAkB,CAAC,2BAA2B,CAAC,CAChD,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,gBAAgB,EAAE,WAAW,CAAC,kBAAkB,CAAC,kBAAkB,CAAC,CAAC,CAAC;IACtE,wBAAwB,EAAE,WAAW,CACnC,kBAAkB,CAAC,0BAA0B,CAAC,CAC/C,CAAC;CACH;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,mBAAmB,GAAG,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/operations/utils/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEhE;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,gBAAgB,EAAE,WAAW,CAAC,kBAAkB,CAAC,kBAAkB,CAAC,CAAC,CAAC;IACtE,wBAAwB,EAAE,WAAW,CACnC,kBAAkB,CAAC,0BAA0B,CAAC,CAC/C,CAAC;IACF,yBAAyB,EAAE,WAAW,CACpC,kBAAkB,CAAC,2BAA2B,CAAC,CAChD,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,gBAAgB,EAAE,WAAW,CAAC,kBAAkB,CAAC,kBAAkB,CAAC,CAAC,CAAC;IACtE,wBAAwB,EAAE,WAAW,CACnC,kBAAkB,CAAC,0BAA0B,CAAC,CAC/C,CAAC;CACH;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,mBAAmB,GAAG,sBAAsB,CAAC;AAE5E;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAC7B;IACE,IAAI,EAAE,KAAK,CAAC;IACZ,6EAA6E;IAC7E,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,2BAA2B;IAC3B,KAAK,EAAE,OAAO,CAAC;CAChB,GACD;IACE,IAAI,EAAE,QAAQ,CAAC;IACf,6CAA6C;IAC7C,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type DynaRecord from "../../DynaRecord";
|
|
2
2
|
import type { BelongsToOrOwnedByRelationship, RelationshipMetadata } from "../../metadata";
|
|
3
|
-
import type { DynamoTableItem, EntityClass, ForeignKey,
|
|
3
|
+
import type { DynamoTableItem, EntityClass, ForeignKey, RelationshipMetaObj } from "../../types";
|
|
4
4
|
import { type EntityAttributesOnly } from "../types";
|
|
5
5
|
/**
|
|
6
6
|
* Creates an object including
|
|
@@ -16,7 +16,7 @@ export declare const buildEntityRelationshipMetaObj: (relationships: Relationshi
|
|
|
16
16
|
* @param entity - instance of DynaRecord
|
|
17
17
|
* @returns
|
|
18
18
|
*/
|
|
19
|
-
export declare const extractForeignKeyFromEntity:
|
|
19
|
+
export declare const extractForeignKeyFromEntity: (relMeta: RelationshipMetadata, entity: Partial<EntityAttributesOnly<DynaRecord>>) => ForeignKey | null | undefined;
|
|
20
20
|
/**
|
|
21
21
|
* Creates the PK and SK (key) for a table item that BelongsTo another as HasMany or HasOne
|
|
22
22
|
* @param entityClass
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/operations/utils/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,EACV,8BAA8B,EAC9B,oBAAoB,EACrB,MAAM,gBAAgB,CAAC;AAQxB,OAAO,KAAK,EACV,eAAe,EACf,WAAW,EACX,UAAU,EACV,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/operations/utils/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,EACV,8BAA8B,EAC9B,oBAAoB,EACrB,MAAM,gBAAgB,CAAC;AAQxB,OAAO,KAAK,EACV,eAAe,EACf,WAAW,EACX,UAAU,EACV,mBAAmB,EACpB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAErD;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B,kBAC1B,oBAAoB,EAAE,KACpC,mBAaF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,YAC7B,oBAAoB,UACrB,OAAO,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC,KAChD,UAAU,GAAG,IAAI,GAAG,SAKtB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,gBACnB,WAAW,CAAC,UAAU,CAAC,YAC1B,MAAM,WACP,8BAA8B,cAC3B,MAAM,KACjB,eAqBF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,SAAU,OAAO,KAAG,OAEjD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryBuilder.d.ts","sourceRoot":"","sources":["../../../src/query-utils/QueryBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAO/D,OAAO,KAAK,EAUV,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAgBjB;;;;GAIG;AACH,cAAM,YAAY;;gBASJ,KAAK,EAAE,iBAAiB;IAmBpC;;;OAGG;IACI,KAAK,IAAI,iBAAiB;IAwBjC;;;;;OAKG;IACH,OAAO,CAAC,8BAA8B;
|
|
1
|
+
{"version":3,"file":"QueryBuilder.d.ts","sourceRoot":"","sources":["../../../src/query-utils/QueryBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAO/D,OAAO,KAAK,EAUV,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAgBjB;;;;GAIG;AACH,cAAM,YAAY;;gBASJ,KAAK,EAAE,iBAAiB;IAmBpC;;;OAGG;IACI,KAAK,IAAI,iBAAiB;IAwBjC;;;;;OAKG;IACH,OAAO,CAAC,8BAA8B;IAgBtC;;;OAGG;IACH,OAAO,CAAC,wBAAwB;IAgChC;;;;;;;;;OASG;IACH,OAAO,CAAC,YAAY;IAWpB;;;;OAIG;IACH,OAAO,CAAC,WAAW;IASnB;;;;OAIG;IACH,OAAO,CAAC,SAAS;IAejB;;;;;;;OAOG;IACH,OAAO,CAAC,YAAY;IAkCpB;;;;;;;;;OASG;IACH,OAAO,CAAC,eAAe;IA0BvB;;;;OAIG;IACH,OAAO,CAAC,QAAQ;IAehB;;;;OAIG;IACH,OAAO,CAAC,WAAW;IAUnB;;;;OAIG;IACH,OAAO,CAAC,kBAAkB;IAI1B;;;;OAIG;IACH,OAAO,CAAC,gBAAgB;IAIxB;;;;OAIG;IACH,OAAO,CAAC,aAAa;IAIrB;;;;OAIG;IACH,OAAO,CAAC,UAAU;CAGnB;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -61,7 +61,9 @@ class QueryBuilder {
|
|
|
61
61
|
const valueParams = hasFilter
|
|
62
62
|
? { ...keyParams.values, ...filterParams?.values }
|
|
63
63
|
: keyParams.values;
|
|
64
|
-
return Object.entries(valueParams).reduce(
|
|
64
|
+
return Object.entries(valueParams).reduce(
|
|
65
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- NativeAttributeValue is 'any' from AWS SDK
|
|
66
|
+
(params, [attrName, value]) => ({ ...params, [`:${attrName}`]: value }), {});
|
|
65
67
|
}
|
|
66
68
|
/**
|
|
67
69
|
* Build ExpressionAttributeNames
|
|
@@ -149,25 +151,28 @@ class QueryBuilder {
|
|
|
149
151
|
let values = {};
|
|
150
152
|
if (Array.isArray(value)) {
|
|
151
153
|
const mappings = value.reduce((acc, val) => {
|
|
152
|
-
const placeholder = `${resolved.placeholderKey}${++this.#attrCounter}`;
|
|
154
|
+
const placeholder = `${resolved.placeholderKey}${String(++this.#attrCounter)}`;
|
|
153
155
|
values[placeholder] = val;
|
|
154
156
|
return acc.concat(`:${placeholder}`);
|
|
155
157
|
}, []);
|
|
156
158
|
condition = `${resolved.expressionPath} IN (${mappings.join()})`;
|
|
157
159
|
}
|
|
158
160
|
else if (this.isBeginsWithFilter(value)) {
|
|
159
|
-
const placeholder = `${resolved.placeholderKey}${++this.#attrCounter}`;
|
|
161
|
+
const placeholder = `${resolved.placeholderKey}${String(++this.#attrCounter)}`;
|
|
160
162
|
condition = `begins_with(${resolved.expressionPath}, :${placeholder})`;
|
|
163
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- NativeAttributeValue is 'any' from AWS SDK
|
|
161
164
|
values = { [placeholder]: value.$beginsWith };
|
|
162
165
|
}
|
|
163
166
|
else if (this.isContainsFilter(value)) {
|
|
164
|
-
const placeholder = `${resolved.placeholderKey}${++this.#attrCounter}`;
|
|
167
|
+
const placeholder = `${resolved.placeholderKey}${String(++this.#attrCounter)}`;
|
|
165
168
|
condition = `contains(${resolved.expressionPath}, :${placeholder})`;
|
|
169
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- NativeAttributeValue is 'any' from AWS SDK
|
|
166
170
|
values = { [placeholder]: value.$contains };
|
|
167
171
|
}
|
|
168
172
|
else {
|
|
169
|
-
const placeholder = `${resolved.placeholderKey}${++this.#attrCounter}`;
|
|
173
|
+
const placeholder = `${resolved.placeholderKey}${String(++this.#attrCounter)}`;
|
|
170
174
|
condition = `${resolved.expressionPath} = :${placeholder}`;
|
|
175
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- NativeAttributeValue is 'any' from AWS SDK
|
|
171
176
|
values = { [placeholder]: value };
|
|
172
177
|
}
|
|
173
178
|
return { expression: `${condition} AND `, values };
|
|
@@ -229,8 +234,7 @@ class QueryBuilder {
|
|
|
229
234
|
const expression = multipleVals
|
|
230
235
|
? `(${andParams.expression}) OR `
|
|
231
236
|
: `${andParams.expression} OR `;
|
|
232
|
-
|
|
233
|
-
return { expression, values };
|
|
237
|
+
return { expression, values: andParams.values };
|
|
234
238
|
}
|
|
235
239
|
/**
|
|
236
240
|
* Type guard to check if its a BeginsWithFilter
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/query-utils/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAEnE;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,IAAI,CAC9B,iBAAiB,CAAC,eAAe,CAAC,EAClC,WAAW,CACZ,CAAC;AAEF;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;IAC7C,UAAU,EAA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