b23-lib 1.2.12 → 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;
@@ -896,7 +900,7 @@ var Fetch = async (baseURL, endpoint, method = "GET", headers = {}, payload) =>
896
900
  };
897
901
  }
898
902
  const body = await response.json();
899
- Logger_default.logMessage("Fetch", `API call successful: URL-${baseURL}/${endpoint}, Status- ${response.status}}`);
903
+ Logger_default.logMessage("Fetch", `API call successful: URL-${baseURL}/${endpoint}, Status- ${response.status}`);
900
904
  return {
901
905
  status: response.status,
902
906
  statusText: response.statusText,
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;
@@ -867,7 +871,7 @@ var Fetch = async (baseURL, endpoint, method = "GET", headers = {}, payload) =>
867
871
  };
868
872
  }
869
873
  const body = await response.json();
870
- Logger_default.logMessage("Fetch", `API call successful: URL-${baseURL}/${endpoint}, Status- ${response.status}}`);
874
+ Logger_default.logMessage("Fetch", `API call successful: URL-${baseURL}/${endpoint}, Status- ${response.status}`);
871
875
  return {
872
876
  status: response.status,
873
877
  statusText: response.statusText,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "b23-lib",
3
- "version": "1.2.12",
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",