b23-lib 1.2.13 → 1.3.1

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/index.d.mts CHANGED
@@ -50,8 +50,9 @@ declare class DynamoDBUtility {
50
50
  }>;
51
51
  updateItem(TableName: string, key: object, condition: string, update: string, attributeName?: Record<string, string>, attributeValue?: Record<string, AttributeValue>, ReturnValues?: ReturnValue, ReturnValuesOnFailure?: ReturnValuesOnConditionCheckFailure): Promise<Record<string, any>>;
52
52
  deleteItem(TableName: string, key: object, condition: string, attributeName?: Record<string, string>, attributeValue?: Record<string, AttributeValue>, ReturnValues?: ReturnValue, ReturnValuesOnFailure?: ReturnValuesOnConditionCheckFailure): Promise<Record<string, any>>;
53
- getItemByIndex(TableName: string, index: string, keyCondition: string, consistent?: boolean, projection?: string, attributeName?: Record<string, string>, attributeValue?: Record<string, AttributeValue>): Promise<{
53
+ getItemByIndex(TableName: string, index: string, keyCondition: string, consistent?: boolean, projection?: string, attributeName?: Record<string, string>, attributeValue?: Record<string, AttributeValue>, lastEvaluatedKey?: Record<string, AttributeValue>): Promise<{
54
54
  Items: Record<string, any>[];
55
+ lastEvaluatedKey: Record<string, AttributeValue> | undefined;
55
56
  }>;
56
57
  }
57
58
 
package/dist/index.d.ts CHANGED
@@ -50,8 +50,9 @@ declare class DynamoDBUtility {
50
50
  }>;
51
51
  updateItem(TableName: string, key: object, condition: string, update: string, attributeName?: Record<string, string>, attributeValue?: Record<string, AttributeValue>, ReturnValues?: ReturnValue, ReturnValuesOnFailure?: ReturnValuesOnConditionCheckFailure): Promise<Record<string, any>>;
52
52
  deleteItem(TableName: string, key: object, condition: string, attributeName?: Record<string, string>, attributeValue?: Record<string, AttributeValue>, ReturnValues?: ReturnValue, ReturnValuesOnFailure?: ReturnValuesOnConditionCheckFailure): Promise<Record<string, any>>;
53
- getItemByIndex(TableName: string, index: string, keyCondition: string, consistent?: boolean, projection?: string, attributeName?: Record<string, string>, attributeValue?: Record<string, AttributeValue>): Promise<{
53
+ getItemByIndex(TableName: string, index: string, keyCondition: string, consistent?: boolean, projection?: string, attributeName?: Record<string, string>, attributeValue?: Record<string, AttributeValue>, lastEvaluatedKey?: Record<string, AttributeValue>): Promise<{
54
54
  Items: Record<string, any>[];
55
+ lastEvaluatedKey: Record<string, AttributeValue> | undefined;
55
56
  }>;
56
57
  }
57
58
 
package/dist/index.js CHANGED
@@ -231,12 +231,13 @@ var DynamoDBUtility = class {
231
231
  this.log("Delete", result.ConsumedCapacity, result.ItemCollectionMetrics);
232
232
  return (0, import_util_dynamodb.unmarshall)(result.Attributes || {});
233
233
  }
234
- async getItemByIndex(TableName, index, keyCondition, consistent = false, projection, attributeName, attributeValue) {
234
+ async getItemByIndex(TableName, index, keyCondition, consistent = false, projection, attributeName, attributeValue, lastEvaluatedKey) {
235
235
  const input = {
236
236
  TableName,
237
237
  IndexName: index,
238
238
  KeyConditionExpression: keyCondition,
239
239
  ExpressionAttributeValues: attributeValue,
240
+ ExclusiveStartKey: lastEvaluatedKey,
240
241
  ConsistentRead: consistent,
241
242
  ProjectionExpression: projection,
242
243
  ExpressionAttributeNames: attributeName,
@@ -244,8 +245,11 @@ var DynamoDBUtility = class {
244
245
  };
245
246
  const command = new import_client_dynamodb.QueryCommand(input);
246
247
  const result = await this.client.send(command);
247
- this.log("Query", result.ConsumedCapacity);
248
- return { Items: result.Items?.map((item) => (0, import_util_dynamodb.unmarshall)(item)) || [] };
248
+ this.log("GetItemByIndex", result.ConsumedCapacity);
249
+ return {
250
+ Items: result.Items?.map((item) => (0, import_util_dynamodb.unmarshall)(item)) || [],
251
+ lastEvaluatedKey: result.LastEvaluatedKey
252
+ };
249
253
  }
250
254
  };
251
255
  var Dynamodb_default = DynamoDBUtility;
package/dist/index.mjs CHANGED
@@ -202,12 +202,13 @@ var DynamoDBUtility = class {
202
202
  this.log("Delete", result.ConsumedCapacity, result.ItemCollectionMetrics);
203
203
  return unmarshall(result.Attributes || {});
204
204
  }
205
- async getItemByIndex(TableName, index, keyCondition, consistent = false, projection, attributeName, attributeValue) {
205
+ async getItemByIndex(TableName, index, keyCondition, consistent = false, projection, attributeName, attributeValue, lastEvaluatedKey) {
206
206
  const input = {
207
207
  TableName,
208
208
  IndexName: index,
209
209
  KeyConditionExpression: keyCondition,
210
210
  ExpressionAttributeValues: attributeValue,
211
+ ExclusiveStartKey: lastEvaluatedKey,
211
212
  ConsistentRead: consistent,
212
213
  ProjectionExpression: projection,
213
214
  ExpressionAttributeNames: attributeName,
@@ -215,8 +216,11 @@ var DynamoDBUtility = class {
215
216
  };
216
217
  const command = new QueryCommand(input);
217
218
  const result = await this.client.send(command);
218
- this.log("Query", result.ConsumedCapacity);
219
- return { Items: result.Items?.map((item) => unmarshall(item)) || [] };
219
+ this.log("GetItemByIndex", result.ConsumedCapacity);
220
+ return {
221
+ Items: result.Items?.map((item) => unmarshall(item)) || [],
222
+ lastEvaluatedKey: result.LastEvaluatedKey
223
+ };
220
224
  }
221
225
  };
222
226
  var Dynamodb_default = DynamoDBUtility;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "b23-lib",
3
- "version": "1.2.13",
3
+ "version": "1.3.1",
4
4
  "description": "This repo hold common classes, type and util functiona",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",