@cumulus/aws-client 18.0.0 → 18.1.0
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/DynamoDb.d.ts +2 -2
- package/DynamoDbSearchQueue.d.ts +8 -7
- package/DynamoDbSearchQueue.js +2 -2
- package/package.json +5 -5
package/DynamoDb.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @module DynamoDb
|
|
3
3
|
*/
|
|
4
4
|
import pRetry from 'p-retry';
|
|
5
|
-
import { CreateTableInput, DeleteTableInput, ScanInput } from '@aws-sdk/client-dynamodb';
|
|
5
|
+
import { CreateTableInput, DeleteTableInput, ScanInput, Select } from '@aws-sdk/client-dynamodb';
|
|
6
6
|
import { DynamoDBDocument, GetCommandInput, ScanCommandInput, ScanCommandOutput } from '@aws-sdk/lib-dynamodb';
|
|
7
7
|
/**
|
|
8
8
|
* Call DynamoDb client get
|
|
@@ -43,7 +43,7 @@ export declare const scan: (params: {
|
|
|
43
43
|
} | undefined;
|
|
44
44
|
fields?: string | undefined;
|
|
45
45
|
limit?: number | undefined;
|
|
46
|
-
select:
|
|
46
|
+
select: Select;
|
|
47
47
|
startKey?: ScanInput['ExclusiveStartKey'];
|
|
48
48
|
}) => Promise<ScanCommandOutput>;
|
|
49
49
|
/**
|
package/DynamoDbSearchQueue.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { AttributeValue, ScanCommandInput, QueryCommandInput } from '@aws-sdk/client-dynamodb';
|
|
2
2
|
declare type SearchType = 'scan' | 'query';
|
|
3
|
+
declare type SearchParams = ScanCommandInput | QueryCommandInput;
|
|
3
4
|
/**
|
|
4
5
|
* Class to efficiently search all of the items in a DynamoDB table, without loading them all into
|
|
5
6
|
* memory at once. Handles paging.
|
|
@@ -9,14 +10,14 @@ declare class DynamoDbSearchQueue {
|
|
|
9
10
|
private readonly searchType;
|
|
10
11
|
private readonly params;
|
|
11
12
|
private items;
|
|
12
|
-
constructor(params:
|
|
13
|
+
constructor(params: SearchParams, searchType?: SearchType);
|
|
13
14
|
/**
|
|
14
15
|
* Drain all values from the searchQueue, and return to the user.
|
|
15
16
|
* Warning: This can be very memory intensive.
|
|
16
17
|
*
|
|
17
18
|
* @returns {Promise<Array>} array of search results.
|
|
18
19
|
*/
|
|
19
|
-
empty(): Promise<
|
|
20
|
+
empty(): Promise<Record<string, AttributeValue>[]>;
|
|
20
21
|
/**
|
|
21
22
|
* View the next item in the queue
|
|
22
23
|
*
|
|
@@ -25,7 +26,7 @@ declare class DynamoDbSearchQueue {
|
|
|
25
26
|
*
|
|
26
27
|
* @returns {Promise<Object>} an item from the DynamoDB table
|
|
27
28
|
*/
|
|
28
|
-
peek(): Promise<
|
|
29
|
+
peek(): Promise<Record<string, AttributeValue> | null>;
|
|
29
30
|
/**
|
|
30
31
|
* Remove the next item from the queue
|
|
31
32
|
*
|
|
@@ -33,12 +34,12 @@ declare class DynamoDbSearchQueue {
|
|
|
33
34
|
*
|
|
34
35
|
* @returns {Promise<Object>} an item from the DynamoDB table
|
|
35
36
|
*/
|
|
36
|
-
shift(): Promise<
|
|
37
|
+
shift(): Promise<Record<string, AttributeValue> | null | undefined>;
|
|
37
38
|
/**
|
|
38
39
|
* A DynamoDbSearchQueue instance stores the list of items to be returned in
|
|
39
40
|
* the `this.items` array. When that list is empty, the `fetchItems()` method
|
|
40
41
|
* is called to repopulate `this.items`. Typically, the new items are fetched
|
|
41
|
-
* using the
|
|
42
|
+
* using the `DynamoDBDocument.scan()` method.
|
|
42
43
|
*
|
|
43
44
|
* DynamoDB scans up to 1 MB of items at a time and then filters that 1 MB to
|
|
44
45
|
* look for matching items. If there are more items to be search beyond that
|
|
@@ -57,7 +58,7 @@ declare class DynamoDbSearchQueue {
|
|
|
57
58
|
* items. It will continue to call `scan()` until one of those two conditions
|
|
58
59
|
* has been satisfied.
|
|
59
60
|
*
|
|
60
|
-
* Reference: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/
|
|
61
|
+
* Reference: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-lib-dynamodb/Class/DynamoDBDocument/
|
|
61
62
|
*
|
|
62
63
|
* @private
|
|
63
64
|
*/
|
package/DynamoDbSearchQueue.js
CHANGED
|
@@ -57,7 +57,7 @@ class DynamoDbSearchQueue {
|
|
|
57
57
|
* A DynamoDbSearchQueue instance stores the list of items to be returned in
|
|
58
58
|
* the `this.items` array. When that list is empty, the `fetchItems()` method
|
|
59
59
|
* is called to repopulate `this.items`. Typically, the new items are fetched
|
|
60
|
-
* using the
|
|
60
|
+
* using the `DynamoDBDocument.scan()` method.
|
|
61
61
|
*
|
|
62
62
|
* DynamoDB scans up to 1 MB of items at a time and then filters that 1 MB to
|
|
63
63
|
* look for matching items. If there are more items to be search beyond that
|
|
@@ -76,7 +76,7 @@ class DynamoDbSearchQueue {
|
|
|
76
76
|
* items. It will continue to call `scan()` until one of those two conditions
|
|
77
77
|
* has been satisfied.
|
|
78
78
|
*
|
|
79
|
-
* Reference: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/
|
|
79
|
+
* Reference: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-lib-dynamodb/Class/DynamoDBDocument/
|
|
80
80
|
*
|
|
81
81
|
* @private
|
|
82
82
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cumulus/aws-client",
|
|
3
|
-
"version": "18.
|
|
3
|
+
"version": "18.1.0",
|
|
4
4
|
"description": "Utilities for working with AWS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"GIBS",
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
"@aws-sdk/s3-request-presigner": "^3.58.0",
|
|
54
54
|
"@aws-sdk/signature-v4-crt": "^3.58.0",
|
|
55
55
|
"@aws-sdk/types": "^3.58.0",
|
|
56
|
-
"@cumulus/checksum": "18.
|
|
57
|
-
"@cumulus/errors": "18.
|
|
58
|
-
"@cumulus/logger": "18.
|
|
56
|
+
"@cumulus/checksum": "18.1.0",
|
|
57
|
+
"@cumulus/errors": "18.1.0",
|
|
58
|
+
"@cumulus/logger": "18.1.0",
|
|
59
59
|
"aws-sdk": "^2.585.0",
|
|
60
60
|
"jsonpath-plus": "^1.1.0",
|
|
61
61
|
"lodash": "~4.17.21",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@types/uuid": "^8.0.0"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "8428a02e0903d8d303c7dd36215aa6a24906e07b"
|
|
74
74
|
}
|