@exabugs/dynamodb-client 1.4.9 → 1.4.11

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.
@@ -1,5 +1,5 @@
1
- // @exabugs/dynamodb-client v1.4.9
2
- // Built: 2026-04-05T13:06:32.256Z
1
+ // @exabugs/dynamodb-client v1.4.11
2
+ // Built: 2026-04-06T23:11:39.347Z
3
3
  "use strict";
4
4
  var __create = Object.create;
5
5
  var __defProp = Object.defineProperty;
@@ -28198,7 +28198,7 @@ var require_dist_cjs66 = __commonJS({
28198
28198
  return async () => handler2(this.clientCommand);
28199
28199
  }
28200
28200
  };
28201
- var BatchGetCommand6 = class extends DynamoDBDocumentClientCommand {
28201
+ var BatchGetCommand7 = class extends DynamoDBDocumentClientCommand {
28202
28202
  static {
28203
28203
  __name(this, "BatchGetCommand");
28204
28204
  }
@@ -28701,7 +28701,7 @@ var require_dist_cjs66 = __commonJS({
28701
28701
  }
28702
28702
  }
28703
28703
  batchGet(args, optionsOrCb, cb) {
28704
- const command = new BatchGetCommand6(args);
28704
+ const command = new BatchGetCommand7(args);
28705
28705
  if (typeof optionsOrCb === "function") {
28706
28706
  this.send(command, optionsOrCb);
28707
28707
  } else if (typeof cb === "function") {
@@ -28878,7 +28878,7 @@ var require_dist_cjs66 = __commonJS({
28878
28878
  }, "get")
28879
28879
  });
28880
28880
  exports2.BatchExecuteStatementCommand = BatchExecuteStatementCommand;
28881
- exports2.BatchGetCommand = BatchGetCommand6;
28881
+ exports2.BatchGetCommand = BatchGetCommand7;
28882
28882
  exports2.BatchWriteCommand = BatchWriteCommand;
28883
28883
  exports2.DeleteCommand = DeleteCommand;
28884
28884
  exports2.DynamoDBDocument = DynamoDBDocument;
@@ -30748,31 +30748,34 @@ async function executeNearQuery(resource, fieldName, nearQuery, limit, requestId
30748
30748
  geohashPrefix,
30749
30749
  ids: mainRecordIds
30750
30750
  });
30751
- const mainRecords = await Promise.all(
30752
- mainRecordIds.map(async (id) => {
30753
- const result2 = await executeDynamoDBOperation(
30754
- () => dbClient2.send(
30755
- new import_lib_dynamodb3.QueryCommand({
30756
- TableName: tableName,
30757
- KeyConditionExpression: "PK = :pk AND SK = :sk",
30758
- ExpressionAttributeValues: {
30759
- ":pk": resource,
30760
- // venues
30761
- ":sk": `id#${id}`
30762
- },
30763
- ConsistentRead: true,
30764
- ReturnConsumedCapacity: "TOTAL"
30765
- })
30766
- ),
30767
- "Query"
30768
- );
30769
- costTracker.add(result2.ConsumedCapacity);
30770
- return result2.Items?.[0];
30771
- })
30772
- );
30773
- const validRecords = mainRecords.filter(
30774
- (item) => item !== void 0
30775
- );
30751
+ const BATCH_SIZE = 100;
30752
+ const validRecords = [];
30753
+ for (let i4 = 0; i4 < mainRecordIds.length; i4 += BATCH_SIZE) {
30754
+ const chunk = mainRecordIds.slice(i4, i4 + BATCH_SIZE);
30755
+ const batchGetResult = await executeDynamoDBOperation(
30756
+ () => dbClient2.send(
30757
+ new import_lib_dynamodb3.BatchGetCommand({
30758
+ RequestItems: {
30759
+ [tableName]: {
30760
+ Keys: chunk.map((id) => ({
30761
+ PK: resource,
30762
+ SK: `id#${id}`
30763
+ })),
30764
+ ConsistentRead: false
30765
+ }
30766
+ },
30767
+ ReturnConsumedCapacity: "TOTAL"
30768
+ })
30769
+ ),
30770
+ "BatchGetItem"
30771
+ );
30772
+ if (batchGetResult.ConsumedCapacity) {
30773
+ for (const capacity of batchGetResult.ConsumedCapacity) {
30774
+ costTracker.add(capacity);
30775
+ }
30776
+ }
30777
+ validRecords.push(...batchGetResult.Responses?.[tableName] || []);
30778
+ }
30776
30779
  logger7.debug("Main records retrieved", {
30777
30780
  requestId,
30778
30781
  resource,
@@ -31146,36 +31149,41 @@ async function fetchMainRecords(resource, recordIds, costTracker, requestId) {
31146
31149
  const dbClient2 = getDBClient();
31147
31150
  const tableName = getTableName();
31148
31151
  const uniqueRecordIds = Array.from(new Set(recordIds));
31149
- const batchGetResult = await executeDynamoDBOperation(
31150
- () => dbClient2.send(
31151
- new import_lib_dynamodb4.BatchGetCommand({
31152
- RequestItems: {
31153
- [tableName]: {
31154
- Keys: uniqueRecordIds.map((id) => ({
31155
- PK: resource,
31156
- SK: `id#${id}`
31157
- })),
31158
- ConsistentRead: true
31159
- }
31160
- },
31161
- ReturnConsumedCapacity: "TOTAL"
31162
- })
31163
- ),
31164
- "BatchGetItem"
31165
- );
31166
- if (batchGetResult.ConsumedCapacity) {
31167
- for (const capacity of batchGetResult.ConsumedCapacity) {
31168
- costTracker.add(capacity);
31152
+ const BATCH_SIZE = 100;
31153
+ const allRecords = [];
31154
+ for (let i4 = 0; i4 < uniqueRecordIds.length; i4 += BATCH_SIZE) {
31155
+ const chunk = uniqueRecordIds.slice(i4, i4 + BATCH_SIZE);
31156
+ const batchGetResult = await executeDynamoDBOperation(
31157
+ () => dbClient2.send(
31158
+ new import_lib_dynamodb4.BatchGetCommand({
31159
+ RequestItems: {
31160
+ [tableName]: {
31161
+ Keys: chunk.map((id) => ({
31162
+ PK: resource,
31163
+ SK: `id#${id}`
31164
+ })),
31165
+ ConsistentRead: true
31166
+ }
31167
+ },
31168
+ ReturnConsumedCapacity: "TOTAL"
31169
+ })
31170
+ ),
31171
+ "BatchGetItem"
31172
+ );
31173
+ if (batchGetResult.ConsumedCapacity) {
31174
+ for (const capacity of batchGetResult.ConsumedCapacity) {
31175
+ costTracker.add(capacity);
31176
+ }
31169
31177
  }
31178
+ allRecords.push(...batchGetResult.Responses?.[tableName] || []);
31170
31179
  }
31171
- const mainRecords = batchGetResult.Responses?.[tableName] || [];
31172
31180
  logger8.debug("Main records fetched", {
31173
31181
  requestId,
31174
31182
  resource,
31175
31183
  requestedCount: uniqueRecordIds.length,
31176
- fetchedCount: mainRecords.length
31184
+ fetchedCount: allRecords.length
31177
31185
  });
31178
- return mainRecords;
31186
+ return allRecords;
31179
31187
  }
31180
31188
  var import_lib_dynamodb4, logger8;
31181
31189
  var init_shadowQuery = __esm({
@@ -34495,7 +34503,7 @@ async function handler(event) {
34495
34503
  return createCorsResponse(HTTP_STATUS.OK);
34496
34504
  }
34497
34505
  if (event.requestContext.http.method === "GET" && event.requestContext.http.path === "/version") {
34498
- const version = "1.4.9";
34506
+ const version = "1.4.11";
34499
34507
  return createSuccessResponse({ version, timestamp: (/* @__PURE__ */ new Date()).toISOString() }, requestId);
34500
34508
  }
34501
34509
  if (event.requestContext.http.method !== "POST") {