@exabugs/dynamodb-client 1.4.11 → 1.4.12
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-
|
|
1
|
+
// @exabugs/dynamodb-client v1.4.12
|
|
2
|
+
// Built: 2026-04-08T13:55:48.590Z
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
@@ -30567,6 +30567,9 @@ async function executeIdQuery(resource, normalizedParams, requestId) {
|
|
|
30567
30567
|
if (idFilter && idFilter.parsed.operator === "$eq") {
|
|
30568
30568
|
return await executeSpecificIdQuery(resource, String(idFilter.value), requestId);
|
|
30569
30569
|
}
|
|
30570
|
+
if (idFilter && idFilter.parsed.operator === "$in" && Array.isArray(idFilter.value)) {
|
|
30571
|
+
return await executeInQuery(resource, idFilter.value.map(String), sort, requestId);
|
|
30572
|
+
}
|
|
30570
30573
|
return await executeAllRecordsQuery(resource, sort, perPage, nextToken, parsedFilters, requestId);
|
|
30571
30574
|
}
|
|
30572
30575
|
async function executeSpecificIdQuery(resource, targetId, requestId) {
|
|
@@ -30606,6 +30609,53 @@ async function executeSpecificIdQuery(resource, targetId, requestId) {
|
|
|
30606
30609
|
consumedCapacity: costTracker.getAggregated()
|
|
30607
30610
|
};
|
|
30608
30611
|
}
|
|
30612
|
+
async function executeInQuery(resource, targetIds, sort, requestId) {
|
|
30613
|
+
const dbClient2 = getDBClient();
|
|
30614
|
+
const tableName = getTableName();
|
|
30615
|
+
const costTracker = new CostTracker();
|
|
30616
|
+
const results = await Promise.all(
|
|
30617
|
+
targetIds.map(
|
|
30618
|
+
(id) => executeDynamoDBOperation(
|
|
30619
|
+
() => dbClient2.send(
|
|
30620
|
+
new import_lib_dynamodb2.QueryCommand({
|
|
30621
|
+
TableName: tableName,
|
|
30622
|
+
KeyConditionExpression: "PK = :pk AND SK = :sk",
|
|
30623
|
+
ExpressionAttributeValues: {
|
|
30624
|
+
":pk": resource,
|
|
30625
|
+
":sk": `id#${id}`
|
|
30626
|
+
},
|
|
30627
|
+
ConsistentRead: true,
|
|
30628
|
+
ReturnConsumedCapacity: "TOTAL"
|
|
30629
|
+
})
|
|
30630
|
+
),
|
|
30631
|
+
"Query"
|
|
30632
|
+
).then((result) => {
|
|
30633
|
+
costTracker.add(result.ConsumedCapacity);
|
|
30634
|
+
return result.Items || [];
|
|
30635
|
+
})
|
|
30636
|
+
)
|
|
30637
|
+
);
|
|
30638
|
+
let items = results.flat().map((item) => extractCleanRecord(item));
|
|
30639
|
+
items.sort((a4, b4) => {
|
|
30640
|
+
const aVal = String(a4.id ?? "");
|
|
30641
|
+
const bVal = String(b4.id ?? "");
|
|
30642
|
+
return sort.order === "ASC" ? aVal.localeCompare(bVal) : bVal.localeCompare(aVal);
|
|
30643
|
+
});
|
|
30644
|
+
logger6.info("ID $in query succeeded", {
|
|
30645
|
+
requestId,
|
|
30646
|
+
resource,
|
|
30647
|
+
requestedCount: targetIds.length,
|
|
30648
|
+
foundCount: items.length
|
|
30649
|
+
});
|
|
30650
|
+
return {
|
|
30651
|
+
items,
|
|
30652
|
+
pageInfo: {
|
|
30653
|
+
hasNextPage: false,
|
|
30654
|
+
hasPreviousPage: false
|
|
30655
|
+
},
|
|
30656
|
+
consumedCapacity: costTracker.getAggregated()
|
|
30657
|
+
};
|
|
30658
|
+
}
|
|
30609
30659
|
async function executeAllRecordsQuery(resource, sort, perPage, nextToken, parsedFilters, requestId) {
|
|
30610
30660
|
const dbClient2 = getDBClient();
|
|
30611
30661
|
const tableName = getTableName();
|
|
@@ -30689,6 +30739,7 @@ var init_idQuery = __esm({
|
|
|
30689
30739
|
});
|
|
30690
30740
|
__name(executeIdQuery, "executeIdQuery");
|
|
30691
30741
|
__name(executeSpecificIdQuery, "executeSpecificIdQuery");
|
|
30742
|
+
__name(executeInQuery, "executeInQuery");
|
|
30692
30743
|
__name(executeAllRecordsQuery, "executeAllRecordsQuery");
|
|
30693
30744
|
}
|
|
30694
30745
|
});
|
|
@@ -34503,7 +34554,7 @@ async function handler(event) {
|
|
|
34503
34554
|
return createCorsResponse(HTTP_STATUS.OK);
|
|
34504
34555
|
}
|
|
34505
34556
|
if (event.requestContext.http.method === "GET" && event.requestContext.http.path === "/version") {
|
|
34506
|
-
const version = "1.4.
|
|
34557
|
+
const version = "1.4.12";
|
|
34507
34558
|
return createSuccessResponse({ version, timestamp: (/* @__PURE__ */ new Date()).toISOString() }, requestId);
|
|
34508
34559
|
}
|
|
34509
34560
|
if (event.requestContext.http.method !== "POST") {
|