@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.
- package/dist/server/handler.cjs +62 -54
- package/dist/server/handler.cjs.map +3 -3
- package/dist/server/operations/find/nearQuery.d.ts.map +1 -1
- package/dist/server/operations/find/nearQuery.js +24 -16
- package/dist/server/operations/find/nearQuery.js.map +1 -1
- package/dist/server/operations/find/shadowQuery.js +24 -20
- package/dist/server/operations/find/shadowQuery.js.map +1 -1
- package/package.json +1 -1
package/dist/server/handler.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// @exabugs/dynamodb-client v1.4.
|
|
2
|
-
// Built: 2026-04-
|
|
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
|
|
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
|
|
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 =
|
|
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
|
|
30752
|
-
|
|
30753
|
-
|
|
30754
|
-
|
|
30755
|
-
|
|
30756
|
-
|
|
30757
|
-
|
|
30758
|
-
|
|
30759
|
-
|
|
30760
|
-
|
|
30761
|
-
|
|
30762
|
-
|
|
30763
|
-
|
|
30764
|
-
|
|
30765
|
-
|
|
30766
|
-
|
|
30767
|
-
|
|
30768
|
-
|
|
30769
|
-
|
|
30770
|
-
|
|
30771
|
-
|
|
30772
|
-
|
|
30773
|
-
|
|
30774
|
-
|
|
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
|
|
31150
|
-
|
|
31151
|
-
|
|
31152
|
-
|
|
31153
|
-
|
|
31154
|
-
|
|
31155
|
-
|
|
31156
|
-
|
|
31157
|
-
|
|
31158
|
-
|
|
31159
|
-
|
|
31160
|
-
|
|
31161
|
-
|
|
31162
|
-
|
|
31163
|
-
|
|
31164
|
-
|
|
31165
|
-
|
|
31166
|
-
|
|
31167
|
-
|
|
31168
|
-
|
|
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:
|
|
31184
|
+
fetchedCount: allRecords.length
|
|
31177
31185
|
});
|
|
31178
|
-
return
|
|
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.
|
|
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") {
|