@exabugs/dynamodb-client 1.4.9 → 1.4.10
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/server/handler.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// @exabugs/dynamodb-client v1.4.
|
|
2
|
-
// Built: 2026-04-05T13:
|
|
1
|
+
// @exabugs/dynamodb-client v1.4.10
|
|
2
|
+
// Built: 2026-04-05T13:26:07.424Z
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
@@ -31146,36 +31146,41 @@ async function fetchMainRecords(resource, recordIds, costTracker, requestId) {
|
|
|
31146
31146
|
const dbClient2 = getDBClient();
|
|
31147
31147
|
const tableName = getTableName();
|
|
31148
31148
|
const uniqueRecordIds = Array.from(new Set(recordIds));
|
|
31149
|
-
const
|
|
31150
|
-
|
|
31151
|
-
|
|
31152
|
-
|
|
31153
|
-
|
|
31154
|
-
|
|
31155
|
-
|
|
31156
|
-
|
|
31157
|
-
|
|
31158
|
-
|
|
31159
|
-
|
|
31160
|
-
|
|
31161
|
-
|
|
31162
|
-
|
|
31163
|
-
|
|
31164
|
-
|
|
31165
|
-
|
|
31166
|
-
|
|
31167
|
-
|
|
31168
|
-
|
|
31149
|
+
const BATCH_SIZE = 100;
|
|
31150
|
+
const allRecords = [];
|
|
31151
|
+
for (let i4 = 0; i4 < uniqueRecordIds.length; i4 += BATCH_SIZE) {
|
|
31152
|
+
const chunk = uniqueRecordIds.slice(i4, i4 + BATCH_SIZE);
|
|
31153
|
+
const batchGetResult = await executeDynamoDBOperation(
|
|
31154
|
+
() => dbClient2.send(
|
|
31155
|
+
new import_lib_dynamodb4.BatchGetCommand({
|
|
31156
|
+
RequestItems: {
|
|
31157
|
+
[tableName]: {
|
|
31158
|
+
Keys: chunk.map((id) => ({
|
|
31159
|
+
PK: resource,
|
|
31160
|
+
SK: `id#${id}`
|
|
31161
|
+
})),
|
|
31162
|
+
ConsistentRead: true
|
|
31163
|
+
}
|
|
31164
|
+
},
|
|
31165
|
+
ReturnConsumedCapacity: "TOTAL"
|
|
31166
|
+
})
|
|
31167
|
+
),
|
|
31168
|
+
"BatchGetItem"
|
|
31169
|
+
);
|
|
31170
|
+
if (batchGetResult.ConsumedCapacity) {
|
|
31171
|
+
for (const capacity of batchGetResult.ConsumedCapacity) {
|
|
31172
|
+
costTracker.add(capacity);
|
|
31173
|
+
}
|
|
31169
31174
|
}
|
|
31175
|
+
allRecords.push(...batchGetResult.Responses?.[tableName] || []);
|
|
31170
31176
|
}
|
|
31171
|
-
const mainRecords = batchGetResult.Responses?.[tableName] || [];
|
|
31172
31177
|
logger8.debug("Main records fetched", {
|
|
31173
31178
|
requestId,
|
|
31174
31179
|
resource,
|
|
31175
31180
|
requestedCount: uniqueRecordIds.length,
|
|
31176
|
-
fetchedCount:
|
|
31181
|
+
fetchedCount: allRecords.length
|
|
31177
31182
|
});
|
|
31178
|
-
return
|
|
31183
|
+
return allRecords;
|
|
31179
31184
|
}
|
|
31180
31185
|
var import_lib_dynamodb4, logger8;
|
|
31181
31186
|
var init_shadowQuery = __esm({
|
|
@@ -34495,7 +34500,7 @@ async function handler(event) {
|
|
|
34495
34500
|
return createCorsResponse(HTTP_STATUS.OK);
|
|
34496
34501
|
}
|
|
34497
34502
|
if (event.requestContext.http.method === "GET" && event.requestContext.http.path === "/version") {
|
|
34498
|
-
const version = "1.4.
|
|
34503
|
+
const version = "1.4.10";
|
|
34499
34504
|
return createSuccessResponse({ version, timestamp: (/* @__PURE__ */ new Date()).toISOString() }, requestId);
|
|
34500
34505
|
}
|
|
34501
34506
|
if (event.requestContext.http.method !== "POST") {
|