@moicky/dynamodb 2.5.2 → 2.5.4

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.
@@ -100,8 +100,10 @@ class UpdateOperations {
100
100
  this.operation.args = {
101
101
  ...this.operation.args,
102
102
  ConditionExpression: expression,
103
- ExpressionAttributeNames: (0, lib_1.getAttributeNames)(values),
104
- ExpressionAttributeValues: Object.keys(values).reduce((acc, keyName) => {
103
+ ExpressionAttributeNames: (0, lib_1.getAttributeNames)(values, {
104
+ attributesToGet: (0, lib_1.getAttributesFromExpression)(expression),
105
+ }),
106
+ ExpressionAttributeValues: (0, lib_1.getAttributesFromExpression)(expression, ":").reduce((acc, keyName) => {
105
107
  acc[`:${keyName}`] = values[keyName];
106
108
  return acc;
107
109
  }, {}),
@@ -8,11 +8,11 @@ export declare const createCustomReference: (baseItem: DynamoDBItemKey, referenc
8
8
  SK: `${string}-${string}-${string}-${string}-${string}`;
9
9
  item: {
10
10
  SK: string | number;
11
- PK: string;
11
+ PK: string | number;
12
12
  };
13
13
  references: {
14
14
  SK: string | number;
15
- PK: string;
15
+ PK: string | number;
16
16
  };
17
17
  onAttribute: string;
18
18
  }>;
@@ -1,7 +1,7 @@
1
1
  import { ConditionCheck, Delete, Put, Update } from "@aws-sdk/client-dynamodb";
2
2
  import { DynamoDBItem } from "../types";
3
3
  export type DynamoDBItemKey = {
4
- PK: string;
4
+ PK: string | number;
5
5
  SK?: string | number | undefined;
6
6
  };
7
7
  export type ItemWithKey = DynamoDBItem & DynamoDBItemKey;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moicky/dynamodb",
3
- "version": "2.5.2",
3
+ "version": "2.5.4",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "description": "Contains a collection of convenience functions for working with AWS DynamoDB",