@exabugs/dynamodb-client 1.3.41 → 1.3.42

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,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.3.42] - 2026-01-15
11
+
12
+ ### Added
13
+
14
+ - **ドット記法サポート**: `$set`オペレーターでドット記法(例: `"settings.locationEnabled"`)をサポート
15
+ - ネストされたオブジェクトとして正しく保存される(例: `settings: { locationEnabled: true }`)
16
+ - `expandDotNotation`ヘルパー関数を追加
17
+ - `applyJsonMergePatch`関数を更新してドット記法を展開
18
+ - ユニットテスト追加(10テスト)
19
+
20
+ ### Fixed
21
+
22
+ - **ドット記法の文字列キー問題**: `$set: { "settings.locationEnabled": true }`が文字列キーとして保存されていた問題を修正
23
+ - 以前: `{ "settings.locationEnabled": true }` (文字列キー)
24
+ - 修正後: `{ settings: { locationEnabled: true } }` (ネストされたオブジェクト)
25
+
10
26
  ## [1.3.41] - 2026-01-11
11
27
 
12
28
  ### Added
@@ -1,5 +1,5 @@
1
- // @exabugs/dynamodb-client v1.3.41
2
- // Built: 2026-01-11T01:29:54.903Z
1
+ // @exabugs/dynamodb-client v1.3.42
2
+ // Built: 2026-01-15T00:42:00.085Z
3
3
  "use strict";
4
4
  var __create = Object.create;
5
5
  var __defProp = Object.defineProperty;
@@ -31670,9 +31670,33 @@ var updateMany_exports = {};
31670
31670
  __export(updateMany_exports, {
31671
31671
  handleUpdateMany: () => handleUpdateMany
31672
31672
  });
31673
+ function expandDotNotation(patch) {
31674
+ const result = {};
31675
+ for (const [key, value] of Object.entries(patch)) {
31676
+ if (key.includes(".")) {
31677
+ const keys = key.split(".");
31678
+ let current = result;
31679
+ for (let i4 = 0; i4 < keys.length - 1; i4++) {
31680
+ const k4 = keys[i4];
31681
+ if (!(k4 in current)) {
31682
+ current[k4] = {};
31683
+ } else if (typeof current[k4] !== "object" || Array.isArray(current[k4])) {
31684
+ current[k4] = {};
31685
+ }
31686
+ current = current[k4];
31687
+ }
31688
+ const lastKey = keys[keys.length - 1];
31689
+ current[lastKey] = value;
31690
+ } else {
31691
+ result[key] = value;
31692
+ }
31693
+ }
31694
+ return result;
31695
+ }
31673
31696
  function applyJsonMergePatch(target, patch) {
31697
+ const expandedPatch = expandDotNotation(patch);
31674
31698
  const result = { ...target };
31675
- for (const [key, value] of Object.entries(patch)) {
31699
+ for (const [key, value] of Object.entries(expandedPatch)) {
31676
31700
  if (value === null) {
31677
31701
  delete result[key];
31678
31702
  } else if (typeof value === "object" && !Array.isArray(value) && value !== null && typeof result[key] === "object" && !Array.isArray(result[key]) && result[key] !== null) {
@@ -32081,6 +32105,7 @@ var init_updateMany = __esm({
32081
32105
  init_dynamodb3();
32082
32106
  init_timestamps();
32083
32107
  logger18 = createLogger({ service: "records-lambda" });
32108
+ __name(expandDotNotation, "expandDotNotation");
32084
32109
  __name(applyJsonMergePatch, "applyJsonMergePatch");
32085
32110
  __name(handleUpdateMany, "handleUpdateMany");
32086
32111
  __name(getPreparationErrorCode2, "getPreparationErrorCode");
@@ -34020,7 +34045,7 @@ async function handler(event) {
34020
34045
  return createCorsResponse(HTTP_STATUS.OK);
34021
34046
  }
34022
34047
  if (event.requestContext.http.method === "GET" && event.requestContext.http.path === "/version") {
34023
- const version = "1.3.41";
34048
+ const version = "1.3.42";
34024
34049
  return createSuccessResponse({ version, timestamp: (/* @__PURE__ */ new Date()).toISOString() }, requestId);
34025
34050
  }
34026
34051
  if (event.requestContext.http.method !== "POST") {