inlaweb-lib-dynamodb 1.0.8 → 1.0.10

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 (3) hide show
  1. package/index.d.ts +1 -1
  2. package/index.js +3 -2
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -6,7 +6,7 @@ export declare class DynamoLib {
6
6
  constructor();
7
7
  putItem(tableName: string, item: KeyValue): Promise<void>;
8
8
  getItem<T>(tableName: string, key: KeyValue, projectionExpression?: string): Promise<T>;
9
- updateItem(params: InputUpdate): Promise<boolean>;
9
+ updateItem<T>(params: InputUpdate): Promise<T>;
10
10
  query<T>(params: {
11
11
  tableName: string;
12
12
  searchParameters: SearchParameters;
package/index.js CHANGED
@@ -64,7 +64,7 @@ class DynamoLib {
64
64
  this.logger.debug(`UpdateItem: ${JSON.stringify(itemUpdate.Update)}`);
65
65
  const result = await this.docClient.send(new lib_dynamodb_1.UpdateCommand(itemUpdate.Update));
66
66
  this.logger.debug(`UpdateItem Result: ${JSON.stringify(result)}`);
67
- return true;
67
+ return result.Attributes;
68
68
  }
69
69
  catch (error) {
70
70
  this.logger.error(error.message);
@@ -257,7 +257,7 @@ class DynamoLib {
257
257
  }
258
258
  items.forEach((item, index) => {
259
259
  const currentIndex = Math.ceil((index + 1) / limit);
260
- executions[currentIndex - 1].push({ Put: { Item: item } });
260
+ executions[currentIndex - 1].push(item);
261
261
  });
262
262
  return executions;
263
263
  }
@@ -272,6 +272,7 @@ class DynamoLib {
272
272
  ExpressionAttributeNames: {},
273
273
  ExpressionAttributeValues: {},
274
274
  ReturnConsumedCapacity: "TOTAL",
275
+ ReturnValues: "ALL_NEW",
275
276
  },
276
277
  };
277
278
  // Se agregan los campos a modificar
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inlaweb-lib-dynamodb",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/types/index.d.ts",
6
6
  "scripts": {