quidproquo-actionprocessor-awslambda 0.0.191 → 0.0.193

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.
@@ -6,5 +6,5 @@ export declare const isKvsQueryCondition: (query: KvsQueryOperation) => query is
6
6
  export declare const isKvsLogicalOperator: (query: KvsQueryOperation) => query is KvsLogicalOperator;
7
7
  export declare const buildAttributeValue: (value: KvsAdvancedDataType) => AttributeValue;
8
8
  export declare const buildDynamoQueryExpression: (query?: KvsQueryOperation) => string | undefined;
9
- export declare const buildExpressionAttributeValues: (queries: (KvsQueryOperation | undefined)[]) => Record<string, AttributeValue>;
10
- export declare const buildExpressionAttributeNames: (queries: (KvsQueryOperation | undefined)[]) => Record<string, string>;
9
+ export declare const buildExpressionAttributeValues: (queries: (KvsQueryOperation | undefined)[]) => Record<string, AttributeValue> | undefined;
10
+ export declare const buildExpressionAttributeNames: (queries: (KvsQueryOperation | undefined)[]) => Record<string, string> | undefined;
@@ -179,7 +179,7 @@ const buildExpressionAttributeValues = (queries) => {
179
179
  }
180
180
  };
181
181
  queries.filter((q) => !!q).forEach((q) => traverse(q));
182
- return values;
182
+ return Object.keys(values).length > 0 ? values : undefined;
183
183
  };
184
184
  exports.buildExpressionAttributeValues = buildExpressionAttributeValues;
185
185
  const buildExpressionAttributeNames = (queries) => {
@@ -196,6 +196,6 @@ const buildExpressionAttributeNames = (queries) => {
196
196
  }
197
197
  };
198
198
  queries.filter((q) => !!q).forEach((q) => traverse(q));
199
- return names;
199
+ return Object.keys(names).length > 0 ? names : undefined;
200
200
  };
201
201
  exports.buildExpressionAttributeNames = buildExpressionAttributeNames;
@@ -31,7 +31,7 @@ exports.buildUpdateExpressionAttributeNames = buildUpdateExpressionAttributeName
31
31
  const buildUpdateExpressionAttributeValues = (updates) => {
32
32
  let attributeValues = {};
33
33
  for (let update of updates) {
34
- if (update.value !== undefined) {
34
+ if (update.value !== undefined && update.value !== null) {
35
35
  const valuePlaceholder = (0, buildDynamoQuery_1.getValueName)(update.value);
36
36
  attributeValues[valuePlaceholder] = (0, buildDynamoQuery_1.buildAttributeValue)(update.value);
37
37
  }
@@ -40,7 +40,7 @@ const buildUpdateExpressionAttributeValues = (updates) => {
40
40
  };
41
41
  exports.buildUpdateExpressionAttributeValues = buildUpdateExpressionAttributeValues;
42
42
  const buildDynamoUpdateExpressionSet = (update) => {
43
- if (!update.value) {
43
+ if (update.value === undefined || update.value === null) {
44
44
  throw new Error("Value must be provided for 'SET' action");
45
45
  }
46
46
  return `${getNestedItemName(update.attributePath)} = ${(0, buildDynamoQuery_1.getValueName)(update.value)}`;
@@ -49,13 +49,13 @@ const buildDynamoUpdateExpressionRemove = (update) => {
49
49
  return `${getNestedItemName(update.attributePath)}`;
50
50
  };
51
51
  const buildDynamoUpdateExpressionAdd = (update) => {
52
- if (!update.value) {
52
+ if (update.value === undefined || update.value === null) {
53
53
  throw new Error("Value must be provided for 'ADD' action");
54
54
  }
55
55
  return `${getNestedItemName(update.attributePath)} ${(0, buildDynamoQuery_1.getValueName)(update.value)}`;
56
56
  };
57
57
  const buildDynamoUpdateExpressionDelete = (update) => {
58
- if (update.value) {
58
+ if (update.value !== undefined && update.value !== null) {
59
59
  return `${getNestedItemName(update.attributePath)} ${(0, buildDynamoQuery_1.getValueName)(update.value)}`;
60
60
  }
61
61
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quidproquo-actionprocessor-awslambda",
3
- "version": "0.0.191",
3
+ "version": "0.0.193",
4
4
  "description": "",
5
5
  "main": "./lib/commonjs/index.js",
6
6
  "types": "./lib/commonjs/index.d.ts",
@@ -47,9 +47,9 @@
47
47
  "lodash": "^4.17.21",
48
48
  "node-cache": "^5.1.2",
49
49
  "node-match-path": "^0.6.3",
50
- "quidproquo-config-aws": "0.0.191",
51
- "quidproquo-core": "0.0.191",
52
- "quidproquo-webserver": "0.0.191"
50
+ "quidproquo-config-aws": "0.0.193",
51
+ "quidproquo-core": "0.0.193",
52
+ "quidproquo-webserver": "0.0.193"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@types/aws-lambda": "^8.10.109",
@@ -57,7 +57,7 @@
57
57
  "@types/jsonwebtoken": "^9.0.2",
58
58
  "@types/lodash": "^4.14.194",
59
59
  "@types/node": "^18.11.9",
60
- "quidproquo-tsconfig": "0.0.191",
60
+ "quidproquo-tsconfig": "0.0.193",
61
61
  "typescript": "^4.9.3"
62
62
  }
63
63
  }