@exabugs/dynamodb-client 1.4.0 → 1.4.2

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/CHANGELOG.md CHANGED
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.4.2] - 2026-03-14
11
+
12
+ ### Fixed
13
+
14
+ - `$starts` フィルターを DynamoDB `KeyConditionExpression` の `begins_with` に最適化(ソートフィールドと一致する場合)
15
+ - 変更前: `begins_with(SK, '{field}#')` → 全件取得後メモリフィルタ
16
+ - 変更後: `begins_with(SK, '{field}#{prefix}')` → プレフィックス一致で DynamoDB レベルで絞り込み
17
+
10
18
  ## [1.3.55] - 2026-03-05
11
19
 
12
20
  ### Changed
@@ -1,5 +1,5 @@
1
- // @exabugs/dynamodb-client v1.4.0
2
- // Built: 2026-03-05T02:45:08.544Z
1
+ // @exabugs/dynamodb-client v1.4.2
2
+ // Built: 2026-03-14T04:13:49.892Z
3
3
  "use strict";
4
4
  var __create = Object.create;
5
5
  var __defProp = Object.defineProperty;
@@ -30978,6 +30978,14 @@ function buildKeyCondition(resource, sortField, optimizableFilter) {
30978
30978
  ":skValue": `${skValue}#id#~`
30979
30979
  }
30980
30980
  };
30981
+ case "$starts":
30982
+ return {
30983
+ keyConditionExpression: "PK = :pk AND begins_with(SK, :skValue)",
30984
+ expressionAttributeValues: {
30985
+ ...expressionAttributeValues,
30986
+ ":skValue": skValue
30987
+ }
30988
+ };
30981
30989
  default:
30982
30990
  return {
30983
30991
  keyConditionExpression: "PK = :pk AND begins_with(SK, :skPrefix)",
@@ -31944,8 +31952,7 @@ async function handleUpdateMany(resource, params, requestId) {
31944
31952
  });
31945
31953
  if (ids.length === 0) {
31946
31954
  if (upsert) {
31947
- const { randomUUID } = await import("crypto");
31948
- const newId = randomUUID();
31955
+ const newId = ulid2();
31949
31956
  ids = [newId];
31950
31957
  logger18.info("Creating new record with filter (upsert: true)", {
31951
31958
  requestId,
@@ -34356,7 +34363,7 @@ async function handler(event) {
34356
34363
  return createCorsResponse(HTTP_STATUS.OK);
34357
34364
  }
34358
34365
  if (event.requestContext.http.method === "GET" && event.requestContext.http.path === "/version") {
34359
- const version = "1.4.0";
34366
+ const version = "1.4.2";
34360
34367
  return createSuccessResponse({ version, timestamp: (/* @__PURE__ */ new Date()).toISOString() }, requestId);
34361
34368
  }
34362
34369
  if (event.requestContext.http.method !== "POST") {