@exabugs/dynamodb-client 1.3.40 → 1.3.41

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,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.3.41] - 2026-01-11
11
+
12
+ ### Added
13
+
14
+ - **updateOne filter版 upsert: true サポート**: filterで検索して存在しない場合に新規作成する機能を実装
15
+ - filter版で`upsert: true`オプションをサポート
16
+ - filterの条件を`$setOnInsert`に自動マージ
17
+ - 新規IDを自動生成(UUID)
18
+ - サーバー側ユニットテスト追加(8テスト)
19
+
20
+ ### Fixed
21
+
22
+ - **updateOne filter版 upsert: true バグ修正**: filterで検索して存在しない場合に`No records found matching filter`エラーが発生していた問題を修正
23
+ - `updateMany`のfilter版でレコードが見つからない場合の処理を実装
24
+ - 新規レコード作成時にfilterの条件を`$setOnInsert`にマージ
25
+ - FCMトークン登録(`{ token: "..." }`でupsert)が正常に動作するように修正
26
+
27
+ ### Changed
28
+
29
+ - **テストカバレッジ向上**: サーバー側の`updateOne`ユニットテストを追加(全707テスト成功)
30
+
10
31
  ## [1.3.40] - 2026-01-11
11
32
 
12
33
  ### Added
@@ -1,5 +1,5 @@
1
- // @exabugs/dynamodb-client v1.3.40
2
- // Built: 2026-01-11T00:55:44.277Z
1
+ // @exabugs/dynamodb-client v1.3.41
2
+ // Built: 2026-01-11T01:29:54.903Z
3
3
  "use strict";
4
4
  var __create = Object.create;
5
5
  var __defProp = Object.defineProperty;
@@ -31717,14 +31717,36 @@ async function handleUpdateMany(resource, params, requestId) {
31717
31717
  resource,
31718
31718
  count: ids.length
31719
31719
  });
31720
- }
31721
- if (ids.length === 0) {
31722
- return {
31723
- count: 0,
31724
- successIds: {},
31725
- failedIds: {},
31726
- errors: {}
31727
- };
31720
+ if (ids.length === 0) {
31721
+ if (upsert) {
31722
+ const { randomUUID } = await import("crypto");
31723
+ const newId = randomUUID();
31724
+ ids = [newId];
31725
+ logger18.info("Creating new record with filter (upsert: true)", {
31726
+ requestId,
31727
+ resource,
31728
+ newId,
31729
+ filter: params.filter
31730
+ });
31731
+ if (patchData.$setOnInsert) {
31732
+ patchData.$setOnInsert = {
31733
+ ...params.filter,
31734
+ ...patchData.$setOnInsert
31735
+ };
31736
+ } else if (patchData.$set) {
31737
+ patchData.$setOnInsert = params.filter;
31738
+ } else {
31739
+ patchData.$setOnInsert = params.filter;
31740
+ }
31741
+ } else {
31742
+ return {
31743
+ count: 0,
31744
+ successIds: {},
31745
+ failedIds: {},
31746
+ errors: {}
31747
+ };
31748
+ }
31749
+ }
31728
31750
  }
31729
31751
  logLargeBatchWarning("updateMany", ids.length, requestId, resource);
31730
31752
  const dbClient2 = getDBClient();
@@ -33998,7 +34020,7 @@ async function handler(event) {
33998
34020
  return createCorsResponse(HTTP_STATUS.OK);
33999
34021
  }
34000
34022
  if (event.requestContext.http.method === "GET" && event.requestContext.http.path === "/version") {
34001
- const version = "1.3.40";
34023
+ const version = "1.3.41";
34002
34024
  return createSuccessResponse({ version, timestamp: (/* @__PURE__ */ new Date()).toISOString() }, requestId);
34003
34025
  }
34004
34026
  if (event.requestContext.http.method !== "POST") {