idea-aws 4.0.4 → 4.0.6
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/dist/src/dynamoDB.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as DDB from '@aws-sdk/lib-dynamodb';
|
|
2
|
-
import {
|
|
2
|
+
import { TransactWriteItem } from '@aws-sdk/client-dynamodb';
|
|
3
3
|
import * as DDBUtils from '@aws-sdk/util-dynamodb';
|
|
4
4
|
import { Logger } from './logger';
|
|
5
5
|
/**
|
|
@@ -16,7 +16,7 @@ export declare class DynamoDB {
|
|
|
16
16
|
* @data the data in DynamoDB's original format to convert in plain objects
|
|
17
17
|
* @options the options to use to convert the data
|
|
18
18
|
*/
|
|
19
|
-
unmarshall(data: Record<string,
|
|
19
|
+
unmarshall(data: Record<string, any>, options?: DDBUtils.unmarshallOptions): Record<string, any>;
|
|
20
20
|
/**
|
|
21
21
|
* Returns an IUID: IDEA's Unique IDentifier, which is an id unique through an IDEA's AWS account and region.
|
|
22
22
|
* Note: no need of an auth check for external uses: the permissions depend from the context in which it's executed.
|
|
@@ -72,8 +72,8 @@ export declare class DynamoDB {
|
|
|
72
72
|
* @param keys the keys of the objects to retrieve
|
|
73
73
|
* @param ignoreErr if set, ignore the errors and continue the bulk op.
|
|
74
74
|
*/
|
|
75
|
-
batchGet(table: string, keys: Record<string,
|
|
76
|
-
protected batchGetHelper(table: string, keys: Record<string,
|
|
75
|
+
batchGet(table: string, keys: Record<string, any>[], ignoreErr?: boolean): Promise<any[]>;
|
|
76
|
+
protected batchGetHelper(table: string, keys: Record<string, any>[], resultElements: Record<string, any>[], ignoreErr: boolean, currentChunk?: number, chunkSize?: number): Promise<Record<string, any>[]>;
|
|
77
77
|
/**
|
|
78
78
|
* Put an array of items in a DynamoDB table, avoiding the limits of DynamoDB's BatchWriteItem.
|
|
79
79
|
* In case of errors, it will retry with a random back-off mechanism until the timeout.
|
|
@@ -89,8 +89,8 @@ export declare class DynamoDB {
|
|
|
89
89
|
* @param table the target DynamoDB table
|
|
90
90
|
* @param keys the keys to delete
|
|
91
91
|
*/
|
|
92
|
-
batchDelete(table: string, keys: Record<string,
|
|
93
|
-
protected batchWriteHelper(table: string, itemsOrKeys: Record<string, any>[]
|
|
92
|
+
batchDelete(table: string, keys: Record<string, any>[]): Promise<void>;
|
|
93
|
+
protected batchWriteHelper(table: string, itemsOrKeys: Record<string, any>[], isPut: boolean, currentChunk?: number, chunkSize?: number): Promise<void>;
|
|
94
94
|
protected batchWriteChunkWithRetries(table: string, params: DDB.BatchWriteCommandInput): Promise<void>;
|
|
95
95
|
/**
|
|
96
96
|
* Query a DynamoDB table, avoiding the limits of DynamoDB's Query.
|
|
@@ -410,7 +410,7 @@ class ResourceController extends genericController_1.GenericController {
|
|
|
410
410
|
});
|
|
411
411
|
const client = new Lambda.LambdaClient();
|
|
412
412
|
const { Payload } = await client.send(command);
|
|
413
|
-
const payload = JSON.parse(Payload.
|
|
413
|
+
const payload = JSON.parse(Buffer.from(Payload).toString());
|
|
414
414
|
const body = JSON.parse(payload.body);
|
|
415
415
|
if (Number(payload.statusCode) !== 200)
|
|
416
416
|
throw new Error(body.message);
|