@lafken/dynamo 0.11.13 → 0.11.15
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/lib/service/query-builder/base/base.js +1 -1
- package/lib/service/query-builder/bulk-create/bulk-create.js +1 -1
- package/lib/service/query-builder/bulk-delete/bulk-delete.js +1 -1
- package/lib/service/query-builder/delete/delete.js +3 -1
- package/lib/service/query-builder/find/find.js +3 -1
- package/lib/service/query-builder/scan/scan.js +3 -1
- package/lib/service/query-builder/update/update.js +1 -1
- package/lib/service/query-builder/upsert/upsert.js +1 -1
- package/package.json +4 -4
|
@@ -134,7 +134,7 @@ class QueryBuilderBase {
|
|
|
134
134
|
return {
|
|
135
135
|
ExpressionAttributeNames: Object.keys(this.attributeNames).length > 0 ? this.attributeNames : undefined,
|
|
136
136
|
ExpressionAttributeValues: Object.keys(this.attributeValues).length > 0
|
|
137
|
-
? (0, util_dynamodb_1.marshall)(this.attributeValues)
|
|
137
|
+
? (0, util_dynamodb_1.marshall)(this.attributeValues, { removeUndefinedValues: true })
|
|
138
138
|
: undefined,
|
|
139
139
|
};
|
|
140
140
|
}
|
|
@@ -13,7 +13,7 @@ class BulkCreateBuilder extends batch_write_1.BatchWriteBuilder {
|
|
|
13
13
|
[queryOptions.modelProps.name]: items.map((item) => {
|
|
14
14
|
return {
|
|
15
15
|
PutRequest: {
|
|
16
|
-
Item: (0, util_dynamodb_1.marshall)(item),
|
|
16
|
+
Item: (0, util_dynamodb_1.marshall)(item, { removeUndefinedValues: true }),
|
|
17
17
|
},
|
|
18
18
|
};
|
|
19
19
|
}),
|
|
@@ -14,7 +14,7 @@ class BulkDeleteBuilder extends batch_write_1.BatchWriteBuilder {
|
|
|
14
14
|
[queryOptions.modelProps.name]: items.map((item) => {
|
|
15
15
|
return {
|
|
16
16
|
DeleteRequest: {
|
|
17
|
-
Key: (0, util_dynamodb_1.marshall)(item),
|
|
17
|
+
Key: (0, util_dynamodb_1.marshall)(item, { removeUndefinedValues: true }),
|
|
18
18
|
},
|
|
19
19
|
};
|
|
20
20
|
}),
|
|
@@ -26,7 +26,9 @@ class DeleteBuilder extends base_1.QueryBuilderBase {
|
|
|
26
26
|
prepare() {
|
|
27
27
|
this.command = {
|
|
28
28
|
TableName: this.queryOptions.modelProps.name,
|
|
29
|
-
Key: (0, util_dynamodb_1.marshall)(this.queryOptions.key
|
|
29
|
+
Key: (0, util_dynamodb_1.marshall)(this.queryOptions.key, {
|
|
30
|
+
removeUndefinedValues: true,
|
|
31
|
+
}),
|
|
30
32
|
};
|
|
31
33
|
}
|
|
32
34
|
}
|
|
@@ -29,7 +29,9 @@ class FindBuilder extends base_1.QueryBuilderBase {
|
|
|
29
29
|
IndexName: index?.name,
|
|
30
30
|
KeyConditionExpression: keyConditionExpression,
|
|
31
31
|
FilterExpression: filterExpression,
|
|
32
|
-
ExclusiveStartKey: cursor
|
|
32
|
+
ExclusiveStartKey: cursor
|
|
33
|
+
? (0, util_dynamodb_1.marshall)(cursor, { removeUndefinedValues: true })
|
|
34
|
+
: undefined,
|
|
33
35
|
Limit: limit,
|
|
34
36
|
ScanIndexForward: sortDirection === 'asc',
|
|
35
37
|
ProjectionExpression: projection === 'ALL' ? undefined : projection.join(', '),
|
|
@@ -30,7 +30,9 @@ class ScanBuilder extends base_1.QueryBuilderBase {
|
|
|
30
30
|
this.command = {
|
|
31
31
|
TableName: this.queryOptions.modelProps.name,
|
|
32
32
|
FilterExpression: filterExpression,
|
|
33
|
-
ExclusiveStartKey: cursor
|
|
33
|
+
ExclusiveStartKey: cursor
|
|
34
|
+
? (0, util_dynamodb_1.marshall)(cursor, { removeUndefinedValues: true })
|
|
35
|
+
: undefined,
|
|
34
36
|
Limit: limit,
|
|
35
37
|
ProjectionExpression: projection === 'ALL' ? undefined : projection.join(', '),
|
|
36
38
|
...this.getAttributesAndNames(),
|
|
@@ -46,7 +46,7 @@ class UpdateBuilder extends base_1.QueryBuilderBase {
|
|
|
46
46
|
const keyCondition = this.queryOptions.inputProps.keyCondition;
|
|
47
47
|
this.command = {
|
|
48
48
|
TableName: this.queryOptions.modelProps.name,
|
|
49
|
-
Key: (0, util_dynamodb_1.marshall)(keyCondition),
|
|
49
|
+
Key: (0, util_dynamodb_1.marshall)(keyCondition, { removeUndefinedValues: true }),
|
|
50
50
|
ConditionExpression: condition
|
|
51
51
|
? this.getFilterExpression(condition, [], 'and', this.expressionGroupCounter++)
|
|
52
52
|
: undefined,
|
|
@@ -31,7 +31,7 @@ class UpsertBuilder extends base_1.QueryBuilderBase {
|
|
|
31
31
|
}
|
|
32
32
|
this.command = {
|
|
33
33
|
TableName: this.queryOptions.modelProps.name,
|
|
34
|
-
Item: (0, util_dynamodb_1.marshall)(this.queryOptions.item),
|
|
34
|
+
Item: (0, util_dynamodb_1.marshall)(this.queryOptions.item, { removeUndefinedValues: true }),
|
|
35
35
|
ConditionExpression: conditionExpression,
|
|
36
36
|
...this.getAttributesAndNames(),
|
|
37
37
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lafken/dynamo",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.15",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Define DynamoDB tables using TypeScript decorators - type-safe, declarative infrastructure with Lafken",
|
|
6
6
|
"keywords": [
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@aws-sdk/util-dynamodb": "^3.996.2",
|
|
61
61
|
"aws-xray-sdk": "^3.12.0",
|
|
62
62
|
"reflect-metadata": "^0.2.2",
|
|
63
|
-
"@lafken/resolver": "0.11.
|
|
63
|
+
"@lafken/resolver": "0.11.15"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@cdktn/provider-aws": "^23.9.0",
|
|
@@ -75,13 +75,13 @@
|
|
|
75
75
|
"typescript": "6.0.3",
|
|
76
76
|
"unplugin-swc": "^1.5.9",
|
|
77
77
|
"vitest": "^4.1.5",
|
|
78
|
-
"@lafken/common": "0.11.
|
|
78
|
+
"@lafken/common": "0.11.15"
|
|
79
79
|
},
|
|
80
80
|
"peerDependencies": {
|
|
81
81
|
"@cdktn/provider-aws": ">=23.0.0",
|
|
82
82
|
"cdktn": ">=0.22.0",
|
|
83
83
|
"constructs": "^10.4.5",
|
|
84
|
-
"@lafken/common": "0.11.
|
|
84
|
+
"@lafken/common": "0.11.15"
|
|
85
85
|
},
|
|
86
86
|
"engines": {
|
|
87
87
|
"node": ">=20.19"
|