@infra-blocks/aws-dynamodb 0.39.0 → 0.40.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/lib/cjs/client.d.ts +34 -5
- package/lib/cjs/client.js +70 -17
- package/lib/cjs/client.js.map +1 -1
- package/lib/cjs/commands/query.d.ts +19 -8
- package/lib/cjs/commands/query.js +25 -13
- package/lib/cjs/commands/query.js.map +1 -1
- package/lib/esm/client.d.ts +34 -5
- package/lib/esm/client.js +70 -17
- package/lib/esm/client.js.map +1 -1
- package/lib/esm/commands/query.d.ts +19 -8
- package/lib/esm/commands/query.js +26 -14
- package/lib/esm/commands/query.js.map +1 -1
- package/package.json +2 -2
package/lib/cjs/client.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { type DeleteTableParams } from "./commands/delete.table.js";
|
|
|
8
8
|
import { type DeleteItemParams } from "./commands/delete-item.js";
|
|
9
9
|
import { type GetItemParams } from "./commands/get-item.js";
|
|
10
10
|
import { type PutItemParams, type PutItemResult } from "./commands/put-item.js";
|
|
11
|
-
import { type QueryParams } from "./commands/query.js";
|
|
11
|
+
import { type QueryParams, type QueryResult } from "./commands/query.js";
|
|
12
12
|
import { type UpdateItemParams } from "./commands/update-item.js";
|
|
13
13
|
import { type UpdateTimeToLiveParams } from "./commands/update-time-to-live.js";
|
|
14
14
|
import { type WriteTransactionParams } from "./commands/write-transaction.js";
|
|
@@ -93,11 +93,40 @@ export declare class DynamoDbClient {
|
|
|
93
93
|
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_PutItem.html
|
|
94
94
|
*/
|
|
95
95
|
putItem(params: PutItemParams): Promise<PutItemResult>;
|
|
96
|
+
/**
|
|
97
|
+
* Iterates the items produced querying a table, or an index, using the Query API.
|
|
98
|
+
*
|
|
99
|
+
* It uses {@link paginateQuery} to handle pagination automatically, and yields
|
|
100
|
+
* every item produced by every page.
|
|
101
|
+
*
|
|
102
|
+
* @param params - The parameters to use to query the table or index.
|
|
103
|
+
*
|
|
104
|
+
* @returns An async generator that yields items matching the query, one
|
|
105
|
+
* at a time, and that handles pagination automatically.
|
|
106
|
+
*
|
|
107
|
+
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Query.html
|
|
108
|
+
*/
|
|
109
|
+
iterateQuery<T extends Attributes = Attributes>(params: QueryParams): AsyncGenerator<T>;
|
|
110
|
+
/**
|
|
111
|
+
* Paginates the result of querying a table, or an index, using the Query API.
|
|
112
|
+
*
|
|
113
|
+
* It uses {@link query} to produce pages, and yields them one after the other
|
|
114
|
+
* through the generator.
|
|
115
|
+
*
|
|
116
|
+
* @param params - The parameters to use to query the table or index.
|
|
117
|
+
*
|
|
118
|
+
* @returns An async generator that yields items matching the query, one
|
|
119
|
+
* at a time, and that handles pagination automatically.
|
|
120
|
+
*
|
|
121
|
+
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Query.html
|
|
122
|
+
*/
|
|
123
|
+
paginateQuery<T extends Attributes = Attributes>(params: QueryParams): AsyncGenerator<QueryResult<T>>;
|
|
96
124
|
/**
|
|
97
125
|
* Queries a table, or an index, using the Query API.
|
|
98
126
|
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
127
|
+
* It produces a single page of results, which may or may not contain all the
|
|
128
|
+
* items of the query. If the result is incomplete, the {@link QueryResult.lastEvaluatedKey}
|
|
129
|
+
* will be set, and should be used in a follow up query as the {@link QueryParams.exclusiveStartKey}.
|
|
101
130
|
*
|
|
102
131
|
* @param params - The parameters to use to query the table or index.
|
|
103
132
|
*
|
|
@@ -106,9 +135,9 @@ export declare class DynamoDbClient {
|
|
|
106
135
|
*
|
|
107
136
|
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Query.html
|
|
108
137
|
*/
|
|
109
|
-
query<T extends Attributes = Attributes>(params: QueryParams):
|
|
138
|
+
query<T extends Attributes = Attributes>(params: QueryParams): Promise<QueryResult<T>>;
|
|
110
139
|
/**
|
|
111
|
-
* Convenience method over the {@link
|
|
140
|
+
* Convenience method over the {@link iterateQuery} method enforcing that the query
|
|
112
141
|
* matches at most one item.
|
|
113
142
|
*
|
|
114
143
|
* If the query doesn't match any item, then `undefined` is returned. If there are
|
package/lib/cjs/client.js
CHANGED
|
@@ -141,10 +141,10 @@ class DynamoDbClient {
|
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
/**
|
|
144
|
-
*
|
|
144
|
+
* Iterates the items produced querying a table, or an index, using the Query API.
|
|
145
145
|
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
146
|
+
* It uses {@link paginateQuery} to handle pagination automatically, and yields
|
|
147
|
+
* every item produced by every page.
|
|
148
148
|
*
|
|
149
149
|
* @param params - The parameters to use to query the table or index.
|
|
150
150
|
*
|
|
@@ -153,25 +153,78 @@ class DynamoDbClient {
|
|
|
153
153
|
*
|
|
154
154
|
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Query.html
|
|
155
155
|
*/
|
|
156
|
-
async *
|
|
156
|
+
async *iterateQuery(params) {
|
|
157
157
|
if (this.logger.isDebugEnabled()) {
|
|
158
|
-
this.logger.debug("
|
|
158
|
+
this.logger.debug("iterateQuery(%s)", JSON.stringify(params));
|
|
159
159
|
}
|
|
160
160
|
try {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
yield item;
|
|
164
|
-
}
|
|
165
|
-
while (response.LastEvaluatedKey != null) {
|
|
166
|
-
response = await this.client.send(query_js_1.Query.from({
|
|
167
|
-
...params,
|
|
168
|
-
exclusiveStartKey: response.LastEvaluatedKey,
|
|
169
|
-
}).toAwsCommand());
|
|
170
|
-
for (const item of response.Items || []) {
|
|
161
|
+
for await (const page of this.paginateQuery(params)) {
|
|
162
|
+
for (const item of page.items) {
|
|
171
163
|
yield item;
|
|
172
164
|
}
|
|
173
165
|
}
|
|
174
166
|
}
|
|
167
|
+
catch (err) {
|
|
168
|
+
throw new error_js_1.DynamoDbClientError("error while iterating table query", {
|
|
169
|
+
cause: err,
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Paginates the result of querying a table, or an index, using the Query API.
|
|
175
|
+
*
|
|
176
|
+
* It uses {@link query} to produce pages, and yields them one after the other
|
|
177
|
+
* through the generator.
|
|
178
|
+
*
|
|
179
|
+
* @param params - The parameters to use to query the table or index.
|
|
180
|
+
*
|
|
181
|
+
* @returns An async generator that yields items matching the query, one
|
|
182
|
+
* at a time, and that handles pagination automatically.
|
|
183
|
+
*
|
|
184
|
+
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Query.html
|
|
185
|
+
*/
|
|
186
|
+
async *paginateQuery(params) {
|
|
187
|
+
if (this.logger.isDebugEnabled()) {
|
|
188
|
+
this.logger.debug("paginateQuery(%s)", JSON.stringify(params));
|
|
189
|
+
}
|
|
190
|
+
try {
|
|
191
|
+
let page = await this.query(params);
|
|
192
|
+
yield page;
|
|
193
|
+
while (page.lastEvaluatedKey != null) {
|
|
194
|
+
page = await this.query({
|
|
195
|
+
...params,
|
|
196
|
+
exclusiveStartKey: page.lastEvaluatedKey,
|
|
197
|
+
});
|
|
198
|
+
yield page;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
catch (err) {
|
|
202
|
+
throw new error_js_1.DynamoDbClientError("error while paginating table query", {
|
|
203
|
+
cause: err,
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Queries a table, or an index, using the Query API.
|
|
209
|
+
*
|
|
210
|
+
* It produces a single page of results, which may or may not contain all the
|
|
211
|
+
* items of the query. If the result is incomplete, the {@link QueryResult.lastEvaluatedKey}
|
|
212
|
+
* will be set, and should be used in a follow up query as the {@link QueryParams.exclusiveStartKey}.
|
|
213
|
+
*
|
|
214
|
+
* @param params - The parameters to use to query the table or index.
|
|
215
|
+
*
|
|
216
|
+
* @returns An async generator that yields items matching the query, one
|
|
217
|
+
* at a time, and that handles pagination automatically.
|
|
218
|
+
*
|
|
219
|
+
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Query.html
|
|
220
|
+
*/
|
|
221
|
+
async query(params) {
|
|
222
|
+
if (this.logger.isDebugEnabled()) {
|
|
223
|
+
this.logger.debug("query(%s)", JSON.stringify(params));
|
|
224
|
+
}
|
|
225
|
+
try {
|
|
226
|
+
return await query_js_1.Query.from(params).execute({ client: this.client });
|
|
227
|
+
}
|
|
175
228
|
catch (err) {
|
|
176
229
|
throw new error_js_1.DynamoDbClientError("error while querying table", {
|
|
177
230
|
cause: err,
|
|
@@ -179,7 +232,7 @@ class DynamoDbClient {
|
|
|
179
232
|
}
|
|
180
233
|
}
|
|
181
234
|
/**
|
|
182
|
-
* Convenience method over the {@link
|
|
235
|
+
* Convenience method over the {@link iterateQuery} method enforcing that the query
|
|
183
236
|
* matches at most one item.
|
|
184
237
|
*
|
|
185
238
|
* If the query doesn't match any item, then `undefined` is returned. If there are
|
|
@@ -192,7 +245,7 @@ class DynamoDbClient {
|
|
|
192
245
|
async queryOne(params) {
|
|
193
246
|
try {
|
|
194
247
|
let item;
|
|
195
|
-
for await (const queryItem of this.
|
|
248
|
+
for await (const queryItem of this.iterateQuery(params)) {
|
|
196
249
|
if (item != null) {
|
|
197
250
|
throw new error_js_1.DynamoDbClientError("expected one item in query but found at least 2");
|
|
198
251
|
}
|
package/lib/cjs/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":";;;AACA,8DAA6E;AAE7E,wDAA+D;AAE/D,2DAAuD;AACvD,+CAA0E;AAC1E,gEAGoC;AACpC,gEAGoC;AACpC,8DAA8E;AAC9E,wDAAqE;AACrE,wDAIgC;AAChC,
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":";;;AACA,8DAA6E;AAE7E,wDAA+D;AAE/D,2DAAuD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MAAM,CAAC,CAAC,CAAC;QACtE,CAAC;QAED,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,uCAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC;QACvE,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,IAAI,8BAAmB,CAC3B,uDAAuD,EACvD;gBACE,KAAK,EAAE,GAAG;aACX,CACF,CAAC;QACJ,CAAC;IACH,CAAC;IAED;;OAEG;IACH,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC;IAEtB;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,IAAI,CAAC,MAGX;QACC,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,wBAAU,CAAC,MAAM,EAAE,EAAE,GAAG,MAAM,CAAC;QACxD,OAAO,IAAI,cAAc,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAChD,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,MAAM,CAAC,MAAM,CAAC,MAAqB;QACjC,MAAM,CAAC,GAAG,MAAM,IAAI,EAAE,CAAC;QACvB,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;QACrB,MAAM,QAAQ,GAAG,IAAI,gCAAc,CAAC,CAAC,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC;QACtD,MAAM,MAAM,GAAG,qCAAsB,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC;QACjE,OAAO,cAAc,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACjD,CAAC;CACF;AAlbD,wCAkbC"}
|
|
@@ -1,20 +1,31 @@
|
|
|
1
|
+
import type { DynamoDBClient } from "@aws-sdk/client-dynamodb";
|
|
1
2
|
import { QueryCommand, type QueryCommandInput } from "@aws-sdk/lib-dynamodb";
|
|
2
|
-
import type {
|
|
3
|
+
import type { Attributes } from "../types.js";
|
|
3
4
|
import type { KeyConditionExpression } from "./expressions/key-condition.js";
|
|
4
5
|
import type { Command } from "./types.js";
|
|
5
|
-
export
|
|
6
|
+
export type QueryParams = {
|
|
6
7
|
table: string;
|
|
7
8
|
index?: string;
|
|
8
9
|
condition: KeyConditionExpression;
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
consistentRead?: boolean;
|
|
11
|
+
exclusiveStartKey?: Attributes;
|
|
12
|
+
limit?: number;
|
|
13
|
+
scanIndexForward?: boolean;
|
|
14
|
+
};
|
|
15
|
+
export type QueryResult<T> = {
|
|
16
|
+
count: number;
|
|
17
|
+
items: Array<T>;
|
|
18
|
+
scannedCount: number;
|
|
19
|
+
lastEvaluatedKey?: Attributes;
|
|
20
|
+
};
|
|
11
21
|
export declare class Query implements Command<QueryCommandInput, QueryCommand> {
|
|
12
|
-
private readonly
|
|
13
|
-
private readonly index?;
|
|
14
|
-
private readonly condition;
|
|
15
|
-
private readonly exclusiveStartKey?;
|
|
22
|
+
private readonly params;
|
|
16
23
|
private constructor();
|
|
17
24
|
toAwsCommandInput(): QueryCommandInput;
|
|
18
25
|
toAwsCommand(): QueryCommand;
|
|
26
|
+
private transformResult;
|
|
27
|
+
execute<T extends Attributes>(params: {
|
|
28
|
+
client: DynamoDBClient;
|
|
29
|
+
}): Promise<QueryResult<T>>;
|
|
19
30
|
static from(params: QueryParams): Query;
|
|
20
31
|
}
|
|
@@ -2,40 +2,52 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Query = void 0;
|
|
4
4
|
const lib_dynamodb_1 = require("@aws-sdk/lib-dynamodb");
|
|
5
|
+
const checks_1 = require("@infra-blocks/checks");
|
|
5
6
|
const names_js_1 = require("./attributes/names.js");
|
|
6
7
|
const values_js_1 = require("./attributes/values.js");
|
|
7
8
|
const expression_js_1 = require("./expressions/condition/expression.js");
|
|
8
9
|
class Query {
|
|
9
|
-
|
|
10
|
-
index;
|
|
11
|
-
condition;
|
|
12
|
-
exclusiveStartKey;
|
|
10
|
+
params;
|
|
13
11
|
constructor(params) {
|
|
14
|
-
|
|
15
|
-
this.table = table;
|
|
16
|
-
this.index = index;
|
|
17
|
-
this.condition = condition;
|
|
18
|
-
this.exclusiveStartKey = exclusiveStartKey;
|
|
12
|
+
this.params = params;
|
|
19
13
|
}
|
|
20
14
|
toAwsCommandInput() {
|
|
15
|
+
const { table, index, condition, consistentRead, exclusiveStartKey, limit, scanIndexForward, } = this.params;
|
|
21
16
|
const names = names_js_1.AttributeNames.create();
|
|
22
17
|
const values = values_js_1.AttributeValues.create();
|
|
23
|
-
const expression = (0, expression_js_1.conditionExpression)(
|
|
18
|
+
const expression = (0, expression_js_1.conditionExpression)(condition).stringify({
|
|
24
19
|
names,
|
|
25
20
|
values,
|
|
26
21
|
});
|
|
27
22
|
return {
|
|
28
|
-
TableName:
|
|
29
|
-
IndexName:
|
|
23
|
+
TableName: table,
|
|
24
|
+
IndexName: index,
|
|
25
|
+
ConsistentRead: consistentRead,
|
|
30
26
|
KeyConditionExpression: expression,
|
|
31
27
|
ExpressionAttributeNames: names.getSubstitutions(),
|
|
32
28
|
ExpressionAttributeValues: values.getSubstitutions(),
|
|
33
|
-
ExclusiveStartKey:
|
|
29
|
+
ExclusiveStartKey: exclusiveStartKey,
|
|
30
|
+
Limit: limit,
|
|
31
|
+
ScanIndexForward: scanIndexForward,
|
|
34
32
|
};
|
|
35
33
|
}
|
|
36
34
|
toAwsCommand() {
|
|
37
35
|
return new lib_dynamodb_1.QueryCommand(this.toAwsCommandInput());
|
|
38
36
|
}
|
|
37
|
+
transformResult(result) {
|
|
38
|
+
const items = (result.Items ?? []);
|
|
39
|
+
return {
|
|
40
|
+
items,
|
|
41
|
+
lastEvaluatedKey: result.LastEvaluatedKey,
|
|
42
|
+
count: (0, checks_1.checkNotNull)(result.Count, "count"),
|
|
43
|
+
scannedCount: (0, checks_1.checkNotNull)(result.ScannedCount, "scannedCount"),
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
async execute(params) {
|
|
47
|
+
const { client } = params;
|
|
48
|
+
const response = await client.send(this.toAwsCommand());
|
|
49
|
+
return this.transformResult(response);
|
|
50
|
+
}
|
|
39
51
|
static from(params) {
|
|
40
52
|
return new Query(params);
|
|
41
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../../src/commands/query.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../../src/commands/query.ts"],"names":[],"mappings":";;;AACA,wDAI+B;AAC/B,iDAAoD;AAEpD,oDAAuD;AACvD,sDAAyD;AACzD,yEAA4E;AAqB5E,MAAa,KAAK;IACC,MAAM,CAAc;IAErC,YAAoB,MAAmB;QACrC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,iBAAiB;QACf,MAAM,EACJ,KAAK,EACL,KAAK,EACL,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,KAAK,EACL,gBAAgB,GACjB,GAAG,IAAI,CAAC,MAAM,CAAC;QAEhB,MAAM,KAAK,GAAG,yBAAc,CAAC,MAAM,EAAE,CAAC;QACtC,MAAM,MAAM,GAAG,2BAAe,CAAC,MAAM,EAAE,CAAC;QACxC,MAAM,UAAU,GAAG,IAAA,mCAAmB,EAAC,SAAS,CAAC,CAAC,SAAS,CAAC;YAC1D,KAAK;YACL,MAAM;SACP,CAAC,CAAC;QACH,OAAO;YACL,SAAS,EAAE,KAAK;YAChB,SAAS,EAAE,KAAK;YAChB,cAAc,EAAE,cAAc;YAC9B,sBAAsB,EAAE,UAAU;YAClC,wBAAwB,EAAE,KAAK,CAAC,gBAAgB,EAAE;YAClD,yBAAyB,EAAE,MAAM,CAAC,gBAAgB,EAAE;YACpD,iBAAiB,EAAE,iBAAiB;YACpC,KAAK,EAAE,KAAK;YACZ,gBAAgB,EAAE,gBAAgB;SACnC,CAAC;IACJ,CAAC;IAED,YAAY;QACV,OAAO,IAAI,2BAAY,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC;IACpD,CAAC;IAEO,eAAe,CACrB,MAA0B;QAE1B,MAAM,KAAK,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAa,CAAC;QAC/C,OAAO;YACL,KAAK;YACL,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;YACzC,KAAK,EAAE,IAAA,qBAAY,EAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC;YAC1C,YAAY,EAAE,IAAA,qBAAY,EAAC,MAAM,CAAC,YAAY,EAAE,cAAc,CAAC;SAChE,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,OAAO,CAAuB,MAEnC;QACC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;QAE1B,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;QAExD,OAAO,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;IACxC,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,MAAmB;QAC7B,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC;IAC3B,CAAC;CACF;AAlED,sBAkEC"}
|
package/lib/esm/client.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { type DeleteTableParams } from "./commands/delete.table.js";
|
|
|
8
8
|
import { type DeleteItemParams } from "./commands/delete-item.js";
|
|
9
9
|
import { type GetItemParams } from "./commands/get-item.js";
|
|
10
10
|
import { type PutItemParams, type PutItemResult } from "./commands/put-item.js";
|
|
11
|
-
import { type QueryParams } from "./commands/query.js";
|
|
11
|
+
import { type QueryParams, type QueryResult } from "./commands/query.js";
|
|
12
12
|
import { type UpdateItemParams } from "./commands/update-item.js";
|
|
13
13
|
import { type UpdateTimeToLiveParams } from "./commands/update-time-to-live.js";
|
|
14
14
|
import { type WriteTransactionParams } from "./commands/write-transaction.js";
|
|
@@ -93,11 +93,40 @@ export declare class DynamoDbClient {
|
|
|
93
93
|
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_PutItem.html
|
|
94
94
|
*/
|
|
95
95
|
putItem(params: PutItemParams): Promise<PutItemResult>;
|
|
96
|
+
/**
|
|
97
|
+
* Iterates the items produced querying a table, or an index, using the Query API.
|
|
98
|
+
*
|
|
99
|
+
* It uses {@link paginateQuery} to handle pagination automatically, and yields
|
|
100
|
+
* every item produced by every page.
|
|
101
|
+
*
|
|
102
|
+
* @param params - The parameters to use to query the table or index.
|
|
103
|
+
*
|
|
104
|
+
* @returns An async generator that yields items matching the query, one
|
|
105
|
+
* at a time, and that handles pagination automatically.
|
|
106
|
+
*
|
|
107
|
+
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Query.html
|
|
108
|
+
*/
|
|
109
|
+
iterateQuery<T extends Attributes = Attributes>(params: QueryParams): AsyncGenerator<T>;
|
|
110
|
+
/**
|
|
111
|
+
* Paginates the result of querying a table, or an index, using the Query API.
|
|
112
|
+
*
|
|
113
|
+
* It uses {@link query} to produce pages, and yields them one after the other
|
|
114
|
+
* through the generator.
|
|
115
|
+
*
|
|
116
|
+
* @param params - The parameters to use to query the table or index.
|
|
117
|
+
*
|
|
118
|
+
* @returns An async generator that yields items matching the query, one
|
|
119
|
+
* at a time, and that handles pagination automatically.
|
|
120
|
+
*
|
|
121
|
+
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Query.html
|
|
122
|
+
*/
|
|
123
|
+
paginateQuery<T extends Attributes = Attributes>(params: QueryParams): AsyncGenerator<QueryResult<T>>;
|
|
96
124
|
/**
|
|
97
125
|
* Queries a table, or an index, using the Query API.
|
|
98
126
|
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
127
|
+
* It produces a single page of results, which may or may not contain all the
|
|
128
|
+
* items of the query. If the result is incomplete, the {@link QueryResult.lastEvaluatedKey}
|
|
129
|
+
* will be set, and should be used in a follow up query as the {@link QueryParams.exclusiveStartKey}.
|
|
101
130
|
*
|
|
102
131
|
* @param params - The parameters to use to query the table or index.
|
|
103
132
|
*
|
|
@@ -106,9 +135,9 @@ export declare class DynamoDbClient {
|
|
|
106
135
|
*
|
|
107
136
|
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Query.html
|
|
108
137
|
*/
|
|
109
|
-
query<T extends Attributes = Attributes>(params: QueryParams):
|
|
138
|
+
query<T extends Attributes = Attributes>(params: QueryParams): Promise<QueryResult<T>>;
|
|
110
139
|
/**
|
|
111
|
-
* Convenience method over the {@link
|
|
140
|
+
* Convenience method over the {@link iterateQuery} method enforcing that the query
|
|
112
141
|
* matches at most one item.
|
|
113
142
|
*
|
|
114
143
|
* If the query doesn't match any item, then `undefined` is returned. If there are
|
package/lib/esm/client.js
CHANGED
|
@@ -138,10 +138,10 @@ export class DynamoDbClient {
|
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
/**
|
|
141
|
-
*
|
|
141
|
+
* Iterates the items produced querying a table, or an index, using the Query API.
|
|
142
142
|
*
|
|
143
|
-
*
|
|
144
|
-
*
|
|
143
|
+
* It uses {@link paginateQuery} to handle pagination automatically, and yields
|
|
144
|
+
* every item produced by every page.
|
|
145
145
|
*
|
|
146
146
|
* @param params - The parameters to use to query the table or index.
|
|
147
147
|
*
|
|
@@ -150,25 +150,78 @@ export class DynamoDbClient {
|
|
|
150
150
|
*
|
|
151
151
|
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Query.html
|
|
152
152
|
*/
|
|
153
|
-
async *
|
|
153
|
+
async *iterateQuery(params) {
|
|
154
154
|
if (this.logger.isDebugEnabled()) {
|
|
155
|
-
this.logger.debug("
|
|
155
|
+
this.logger.debug("iterateQuery(%s)", JSON.stringify(params));
|
|
156
156
|
}
|
|
157
157
|
try {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
yield item;
|
|
161
|
-
}
|
|
162
|
-
while (response.LastEvaluatedKey != null) {
|
|
163
|
-
response = await this.client.send(Query.from({
|
|
164
|
-
...params,
|
|
165
|
-
exclusiveStartKey: response.LastEvaluatedKey,
|
|
166
|
-
}).toAwsCommand());
|
|
167
|
-
for (const item of response.Items || []) {
|
|
158
|
+
for await (const page of this.paginateQuery(params)) {
|
|
159
|
+
for (const item of page.items) {
|
|
168
160
|
yield item;
|
|
169
161
|
}
|
|
170
162
|
}
|
|
171
163
|
}
|
|
164
|
+
catch (err) {
|
|
165
|
+
throw new DynamoDbClientError("error while iterating table query", {
|
|
166
|
+
cause: err,
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Paginates the result of querying a table, or an index, using the Query API.
|
|
172
|
+
*
|
|
173
|
+
* It uses {@link query} to produce pages, and yields them one after the other
|
|
174
|
+
* through the generator.
|
|
175
|
+
*
|
|
176
|
+
* @param params - The parameters to use to query the table or index.
|
|
177
|
+
*
|
|
178
|
+
* @returns An async generator that yields items matching the query, one
|
|
179
|
+
* at a time, and that handles pagination automatically.
|
|
180
|
+
*
|
|
181
|
+
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Query.html
|
|
182
|
+
*/
|
|
183
|
+
async *paginateQuery(params) {
|
|
184
|
+
if (this.logger.isDebugEnabled()) {
|
|
185
|
+
this.logger.debug("paginateQuery(%s)", JSON.stringify(params));
|
|
186
|
+
}
|
|
187
|
+
try {
|
|
188
|
+
let page = await this.query(params);
|
|
189
|
+
yield page;
|
|
190
|
+
while (page.lastEvaluatedKey != null) {
|
|
191
|
+
page = await this.query({
|
|
192
|
+
...params,
|
|
193
|
+
exclusiveStartKey: page.lastEvaluatedKey,
|
|
194
|
+
});
|
|
195
|
+
yield page;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
catch (err) {
|
|
199
|
+
throw new DynamoDbClientError("error while paginating table query", {
|
|
200
|
+
cause: err,
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Queries a table, or an index, using the Query API.
|
|
206
|
+
*
|
|
207
|
+
* It produces a single page of results, which may or may not contain all the
|
|
208
|
+
* items of the query. If the result is incomplete, the {@link QueryResult.lastEvaluatedKey}
|
|
209
|
+
* will be set, and should be used in a follow up query as the {@link QueryParams.exclusiveStartKey}.
|
|
210
|
+
*
|
|
211
|
+
* @param params - The parameters to use to query the table or index.
|
|
212
|
+
*
|
|
213
|
+
* @returns An async generator that yields items matching the query, one
|
|
214
|
+
* at a time, and that handles pagination automatically.
|
|
215
|
+
*
|
|
216
|
+
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Query.html
|
|
217
|
+
*/
|
|
218
|
+
async query(params) {
|
|
219
|
+
if (this.logger.isDebugEnabled()) {
|
|
220
|
+
this.logger.debug("query(%s)", JSON.stringify(params));
|
|
221
|
+
}
|
|
222
|
+
try {
|
|
223
|
+
return await Query.from(params).execute({ client: this.client });
|
|
224
|
+
}
|
|
172
225
|
catch (err) {
|
|
173
226
|
throw new DynamoDbClientError("error while querying table", {
|
|
174
227
|
cause: err,
|
|
@@ -176,7 +229,7 @@ export class DynamoDbClient {
|
|
|
176
229
|
}
|
|
177
230
|
}
|
|
178
231
|
/**
|
|
179
|
-
* Convenience method over the {@link
|
|
232
|
+
* Convenience method over the {@link iterateQuery} method enforcing that the query
|
|
180
233
|
* matches at most one item.
|
|
181
234
|
*
|
|
182
235
|
* If the query doesn't match any item, then `undefined` is returned. If there are
|
|
@@ -189,7 +242,7 @@ export class DynamoDbClient {
|
|
|
189
242
|
async queryOne(params) {
|
|
190
243
|
try {
|
|
191
244
|
let item;
|
|
192
|
-
for await (const queryItem of this.
|
|
245
|
+
for await (const queryItem of this.iterateQuery(params)) {
|
|
193
246
|
if (item != null) {
|
|
194
247
|
throw new DynamoDbClientError("expected one item in query but found at least 2");
|
|
195
248
|
}
|
package/lib/esm/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAgC,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EACL,WAAW,GAEZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,WAAW,GAEZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,UAAU,EAAyB,MAAM,2BAA2B,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAsB,MAAM,wBAAwB,CAAC;AACrE,OAAO,EACL,OAAO,GAGR,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAgC,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EACL,WAAW,GAEZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,WAAW,GAEZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,UAAU,EAAyB,MAAM,2BAA2B,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAsB,MAAM,wBAAwB,CAAC;AACrE,OAAO,EACL,OAAO,GAGR,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,KAAK,EAAsC,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,UAAU,EAAyB,MAAM,2BAA2B,CAAC;AAC9E,OAAO,EACL,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AC;QAED,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC;QACvE,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,IAAI,mBAAmB,CAC3B,uDAAuD,EACvD;gBACE,KAAK,EAAE,GAAG;aACX,CACF,CAAC;QACJ,CAAC;IACH,CAAC;IAED;;OAEG;IACH,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC;IAEtB;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,IAAI,CAAC,MAGX;QACC,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,UAAU,CAAC,MAAM,EAAE,EAAE,GAAG,MAAM,CAAC;QACxD,OAAO,IAAI,cAAc,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAChD,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,MAAM,CAAC,MAAM,CAAC,MAAqB;QACjC,MAAM,CAAC,GAAG,MAAM,IAAI,EAAE,CAAC;QACvB,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;QACrB,MAAM,QAAQ,GAAG,IAAI,cAAc,CAAC,CAAC,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC;QACtD,MAAM,MAAM,GAAG,sBAAsB,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC;QACjE,OAAO,cAAc,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACjD,CAAC;CACF"}
|
|
@@ -1,20 +1,31 @@
|
|
|
1
|
+
import type { DynamoDBClient } from "@aws-sdk/client-dynamodb";
|
|
1
2
|
import { QueryCommand, type QueryCommandInput } from "@aws-sdk/lib-dynamodb";
|
|
2
|
-
import type {
|
|
3
|
+
import type { Attributes } from "../types.js";
|
|
3
4
|
import type { KeyConditionExpression } from "./expressions/key-condition.js";
|
|
4
5
|
import type { Command } from "./types.js";
|
|
5
|
-
export
|
|
6
|
+
export type QueryParams = {
|
|
6
7
|
table: string;
|
|
7
8
|
index?: string;
|
|
8
9
|
condition: KeyConditionExpression;
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
consistentRead?: boolean;
|
|
11
|
+
exclusiveStartKey?: Attributes;
|
|
12
|
+
limit?: number;
|
|
13
|
+
scanIndexForward?: boolean;
|
|
14
|
+
};
|
|
15
|
+
export type QueryResult<T> = {
|
|
16
|
+
count: number;
|
|
17
|
+
items: Array<T>;
|
|
18
|
+
scannedCount: number;
|
|
19
|
+
lastEvaluatedKey?: Attributes;
|
|
20
|
+
};
|
|
11
21
|
export declare class Query implements Command<QueryCommandInput, QueryCommand> {
|
|
12
|
-
private readonly
|
|
13
|
-
private readonly index?;
|
|
14
|
-
private readonly condition;
|
|
15
|
-
private readonly exclusiveStartKey?;
|
|
22
|
+
private readonly params;
|
|
16
23
|
private constructor();
|
|
17
24
|
toAwsCommandInput(): QueryCommandInput;
|
|
18
25
|
toAwsCommand(): QueryCommand;
|
|
26
|
+
private transformResult;
|
|
27
|
+
execute<T extends Attributes>(params: {
|
|
28
|
+
client: DynamoDBClient;
|
|
29
|
+
}): Promise<QueryResult<T>>;
|
|
19
30
|
static from(params: QueryParams): Query;
|
|
20
31
|
}
|
|
@@ -1,38 +1,50 @@
|
|
|
1
|
-
import { QueryCommand } from "@aws-sdk/lib-dynamodb";
|
|
1
|
+
import { QueryCommand, } from "@aws-sdk/lib-dynamodb";
|
|
2
|
+
import { checkNotNull } from "@infra-blocks/checks";
|
|
2
3
|
import { AttributeNames } from "./attributes/names.js";
|
|
3
4
|
import { AttributeValues } from "./attributes/values.js";
|
|
4
5
|
import { conditionExpression } from "./expressions/condition/expression.js";
|
|
5
6
|
export class Query {
|
|
6
|
-
|
|
7
|
-
index;
|
|
8
|
-
condition;
|
|
9
|
-
exclusiveStartKey;
|
|
7
|
+
params;
|
|
10
8
|
constructor(params) {
|
|
11
|
-
|
|
12
|
-
this.table = table;
|
|
13
|
-
this.index = index;
|
|
14
|
-
this.condition = condition;
|
|
15
|
-
this.exclusiveStartKey = exclusiveStartKey;
|
|
9
|
+
this.params = params;
|
|
16
10
|
}
|
|
17
11
|
toAwsCommandInput() {
|
|
12
|
+
const { table, index, condition, consistentRead, exclusiveStartKey, limit, scanIndexForward, } = this.params;
|
|
18
13
|
const names = AttributeNames.create();
|
|
19
14
|
const values = AttributeValues.create();
|
|
20
|
-
const expression = conditionExpression(
|
|
15
|
+
const expression = conditionExpression(condition).stringify({
|
|
21
16
|
names,
|
|
22
17
|
values,
|
|
23
18
|
});
|
|
24
19
|
return {
|
|
25
|
-
TableName:
|
|
26
|
-
IndexName:
|
|
20
|
+
TableName: table,
|
|
21
|
+
IndexName: index,
|
|
22
|
+
ConsistentRead: consistentRead,
|
|
27
23
|
KeyConditionExpression: expression,
|
|
28
24
|
ExpressionAttributeNames: names.getSubstitutions(),
|
|
29
25
|
ExpressionAttributeValues: values.getSubstitutions(),
|
|
30
|
-
ExclusiveStartKey:
|
|
26
|
+
ExclusiveStartKey: exclusiveStartKey,
|
|
27
|
+
Limit: limit,
|
|
28
|
+
ScanIndexForward: scanIndexForward,
|
|
31
29
|
};
|
|
32
30
|
}
|
|
33
31
|
toAwsCommand() {
|
|
34
32
|
return new QueryCommand(this.toAwsCommandInput());
|
|
35
33
|
}
|
|
34
|
+
transformResult(result) {
|
|
35
|
+
const items = (result.Items ?? []);
|
|
36
|
+
return {
|
|
37
|
+
items,
|
|
38
|
+
lastEvaluatedKey: result.LastEvaluatedKey,
|
|
39
|
+
count: checkNotNull(result.Count, "count"),
|
|
40
|
+
scannedCount: checkNotNull(result.ScannedCount, "scannedCount"),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
async execute(params) {
|
|
44
|
+
const { client } = params;
|
|
45
|
+
const response = await client.send(this.toAwsCommand());
|
|
46
|
+
return this.transformResult(response);
|
|
47
|
+
}
|
|
36
48
|
static from(params) {
|
|
37
49
|
return new Query(params);
|
|
38
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../../src/commands/query.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../../src/commands/query.ts"],"names":[],"mappings":"AACA,OAAO,EACL,YAAY,GAGb,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAqB5E,MAAM,OAAO,KAAK;IACC,MAAM,CAAc;IAErC,YAAoB,MAAmB;QACrC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,iBAAiB;QACf,MAAM,EACJ,KAAK,EACL,KAAK,EACL,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,KAAK,EACL,gBAAgB,GACjB,GAAG,IAAI,CAAC,MAAM,CAAC;QAEhB,MAAM,KAAK,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC;QACtC,MAAM,MAAM,GAAG,eAAe,CAAC,MAAM,EAAE,CAAC;QACxC,MAAM,UAAU,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC;YAC1D,KAAK;YACL,MAAM;SACP,CAAC,CAAC;QACH,OAAO;YACL,SAAS,EAAE,KAAK;YAChB,SAAS,EAAE,KAAK;YAChB,cAAc,EAAE,cAAc;YAC9B,sBAAsB,EAAE,UAAU;YAClC,wBAAwB,EAAE,KAAK,CAAC,gBAAgB,EAAE;YAClD,yBAAyB,EAAE,MAAM,CAAC,gBAAgB,EAAE;YACpD,iBAAiB,EAAE,iBAAiB;YACpC,KAAK,EAAE,KAAK;YACZ,gBAAgB,EAAE,gBAAgB;SACnC,CAAC;IACJ,CAAC;IAED,YAAY;QACV,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC;IACpD,CAAC;IAEO,eAAe,CACrB,MAA0B;QAE1B,MAAM,KAAK,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAa,CAAC;QAC/C,OAAO;YACL,KAAK;YACL,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;YACzC,KAAK,EAAE,YAAY,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC;YAC1C,YAAY,EAAE,YAAY,CAAC,MAAM,CAAC,YAAY,EAAE,cAAc,CAAC;SAChE,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,OAAO,CAAuB,MAEnC;QACC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;QAE1B,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;QAExD,OAAO,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;IACxC,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,MAAmB;QAC7B,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC;IAC3B,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infra-blocks/aws-dynamodb",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.40.0",
|
|
4
4
|
"description": "A convenience wrapper over @aws-sdk/client-dynamodb and @aws-sdk/lib-dynamodb.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"aws",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@biomejs/biome": "^2.1.2",
|
|
44
|
-
"@infra-blocks/checks": "^0.
|
|
44
|
+
"@infra-blocks/checks": "^0.4.0",
|
|
45
45
|
"@infra-blocks/iter": "^0.2.7",
|
|
46
46
|
"@infra-blocks/node-console-logger": "^0.3.1",
|
|
47
47
|
"@infra-blocks/test": "^0.4.0",
|