@exabugs/dynamodb-client 1.3.37 → 1.3.38
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 +15 -0
- package/dist/server/handler.cjs +42 -24
- package/dist/server/handler.cjs.map +3 -3
- package/dist/server/operations/updateMany.d.ts +4 -0
- package/dist/server/operations/updateMany.d.ts.map +1 -1
- package/dist/server/operations/updateMany.js +30 -1
- package/dist/server/operations/updateMany.js.map +1 -1
- package/dist/server/operations/updateOne.d.ts +2 -1
- package/dist/server/operations/updateOne.d.ts.map +1 -1
- package/dist/server/operations/updateOne.js +14 -25
- package/dist/server/operations/updateOne.js.map +1 -1
- package/dist/server/types.d.ts +6 -0
- package/dist/server/types.d.ts.map +1 -1
- package/package.json +3 -1
- package/dist/integrations/react-admin/hooks/useManyToManyTransform.d.ts +0 -19
- package/dist/integrations/react-admin/hooks/useManyToManyTransform.d.ts.map +0 -1
- package/dist/integrations/react-admin/hooks/useManyToManyTransform.js +0 -99
- package/dist/integrations/react-admin/hooks/useManyToManyTransform.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.3.38] - 2026-01-11
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- **テストカバレッジ大幅向上**: 86.37%達成(Phase 2目標80%を超過)
|
|
15
|
+
- dataProviderの完全テスト実装(17テスト、カバレッジ86.37%)
|
|
16
|
+
- react-admin v5 APIに対応(`pageInfo`形式のレスポンス)
|
|
17
|
+
- 全481テスト成功
|
|
18
|
+
|
|
19
|
+
### Removed
|
|
20
|
+
|
|
21
|
+
- **useManyToManyTransformフック削除**: 不要なコード削除
|
|
22
|
+
- Many-to-many関係の処理はdataProvider内で統合済み
|
|
23
|
+
- コードの重複を削減し、保守性を向上
|
|
24
|
+
|
|
10
25
|
## [1.3.37] - 2026-01-09
|
|
11
26
|
|
|
12
27
|
### Security
|
package/dist/server/handler.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// @exabugs/dynamodb-client v1.3.
|
|
2
|
-
// Built: 2026-01-
|
|
1
|
+
// @exabugs/dynamodb-client v1.3.38
|
|
2
|
+
// Built: 2026-01-10T23:33:04.543Z
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
@@ -31681,8 +31681,14 @@ function applyJsonMergePatch(target, patch) {
|
|
|
31681
31681
|
return result;
|
|
31682
31682
|
}
|
|
31683
31683
|
async function handleUpdateMany(resource, params, requestId) {
|
|
31684
|
-
const { data: patchData } = params;
|
|
31684
|
+
const { data: patchData, options } = params;
|
|
31685
|
+
const upsert = options?.upsert ?? false;
|
|
31685
31686
|
const startTime = Date.now();
|
|
31687
|
+
logger18.debug("Executing updateMany", {
|
|
31688
|
+
requestId,
|
|
31689
|
+
resource,
|
|
31690
|
+
upsert
|
|
31691
|
+
});
|
|
31686
31692
|
let ids;
|
|
31687
31693
|
if ("ids" in params) {
|
|
31688
31694
|
ids = params.ids;
|
|
@@ -31742,6 +31748,15 @@ async function handleUpdateMany(resource, params, requestId) {
|
|
|
31742
31748
|
})
|
|
31743
31749
|
);
|
|
31744
31750
|
const notFoundIds = ids.filter((id) => !existingIds.has(id));
|
|
31751
|
+
if (!upsert && notFoundIds.length > 0) {
|
|
31752
|
+
logger18.warn("Records not found (upsert: false)", {
|
|
31753
|
+
requestId,
|
|
31754
|
+
resource,
|
|
31755
|
+
notFoundCount: notFoundIds.length,
|
|
31756
|
+
notFoundIds: notFoundIds.slice(0, 10)
|
|
31757
|
+
// 最初の10件のみログ
|
|
31758
|
+
});
|
|
31759
|
+
}
|
|
31745
31760
|
const shadowConfig = getShadowConfig();
|
|
31746
31761
|
const preparedRecords = [];
|
|
31747
31762
|
const preparationFailedIds = [];
|
|
@@ -31751,8 +31766,8 @@ async function handleUpdateMany(resource, params, requestId) {
|
|
|
31751
31766
|
const existingData = item.data;
|
|
31752
31767
|
const id = existingData.id;
|
|
31753
31768
|
const oldShadowKeys = existingData.__shadowKeys || [];
|
|
31754
|
-
const
|
|
31755
|
-
const mergedData = applyJsonMergePatch(removeShadowKeys(existingData),
|
|
31769
|
+
const actualPatchData2 = patchData.$set ? patchData.$set : patchData;
|
|
31770
|
+
const mergedData = applyJsonMergePatch(removeShadowKeys(existingData), actualPatchData2);
|
|
31756
31771
|
const updatedData = addUpdateTimestamp({
|
|
31757
31772
|
...mergedData,
|
|
31758
31773
|
id
|
|
@@ -31856,13 +31871,19 @@ async function handleUpdateMany(resource, params, requestId) {
|
|
|
31856
31871
|
errors: chunkErrors
|
|
31857
31872
|
} = await executeChunks(chunks, executeChunk, (record) => record.id);
|
|
31858
31873
|
const successIds = {};
|
|
31874
|
+
const items = [];
|
|
31859
31875
|
const failedIdsMap = {};
|
|
31860
31876
|
const errorsMap = {};
|
|
31877
|
+
const actualPatchData = patchData.$set ? patchData.$set : patchData;
|
|
31861
31878
|
const successIdSet = new Set(successRecords.map((r4) => r4.id));
|
|
31862
31879
|
for (let i4 = 0; i4 < ids.length; i4++) {
|
|
31863
31880
|
const id = ids[i4];
|
|
31864
31881
|
if (successIdSet.has(id)) {
|
|
31865
31882
|
successIds[i4] = id;
|
|
31883
|
+
items.push({
|
|
31884
|
+
id,
|
|
31885
|
+
...actualPatchData
|
|
31886
|
+
});
|
|
31866
31887
|
}
|
|
31867
31888
|
}
|
|
31868
31889
|
for (let i4 = 0; i4 < ids.length; i4++) {
|
|
@@ -31938,7 +31959,9 @@ async function handleUpdateMany(resource, params, requestId) {
|
|
|
31938
31959
|
count,
|
|
31939
31960
|
successIds,
|
|
31940
31961
|
failedIds: failedIdsMap,
|
|
31941
|
-
errors: errorsMap
|
|
31962
|
+
errors: errorsMap,
|
|
31963
|
+
items
|
|
31964
|
+
// 更新したフィールドのみを含むレコード配列(ADR 001)
|
|
31942
31965
|
};
|
|
31943
31966
|
}
|
|
31944
31967
|
function getPreparationErrorCode2(error2) {
|
|
@@ -32223,9 +32246,8 @@ var logger19 = createLogger({ service: "records-lambda" });
|
|
|
32223
32246
|
async function handleUpdateOne(resource, params, requestId) {
|
|
32224
32247
|
const { data: patchData, options } = params;
|
|
32225
32248
|
const { handleUpdateMany: handleUpdateMany2 } = await Promise.resolve().then(() => (init_updateMany(), updateMany_exports));
|
|
32226
|
-
let targetId;
|
|
32227
32249
|
if ("id" in params) {
|
|
32228
|
-
targetId = params.id;
|
|
32250
|
+
const targetId = params.id;
|
|
32229
32251
|
logger19.debug("Executing updateOne with id", {
|
|
32230
32252
|
requestId,
|
|
32231
32253
|
resource,
|
|
@@ -32236,7 +32258,8 @@ async function handleUpdateOne(resource, params, requestId) {
|
|
|
32236
32258
|
resource,
|
|
32237
32259
|
{
|
|
32238
32260
|
ids: [targetId],
|
|
32239
|
-
data: patchData
|
|
32261
|
+
data: patchData,
|
|
32262
|
+
options
|
|
32240
32263
|
},
|
|
32241
32264
|
requestId
|
|
32242
32265
|
);
|
|
@@ -32248,11 +32271,10 @@ async function handleUpdateOne(resource, params, requestId) {
|
|
|
32248
32271
|
throw new Error(`Failed to update record: ${targetId}`);
|
|
32249
32272
|
}
|
|
32250
32273
|
}
|
|
32251
|
-
|
|
32252
|
-
|
|
32253
|
-
|
|
32254
|
-
|
|
32255
|
-
};
|
|
32274
|
+
if (!updateManyResult.items || updateManyResult.items.length === 0) {
|
|
32275
|
+
throw new Error("updateMany did not return items");
|
|
32276
|
+
}
|
|
32277
|
+
return updateManyResult.items[0];
|
|
32256
32278
|
} else {
|
|
32257
32279
|
logger19.debug("Executing updateOne with filter", {
|
|
32258
32280
|
requestId,
|
|
@@ -32264,7 +32286,8 @@ async function handleUpdateOne(resource, params, requestId) {
|
|
|
32264
32286
|
resource,
|
|
32265
32287
|
{
|
|
32266
32288
|
filter: params.filter,
|
|
32267
|
-
data: patchData
|
|
32289
|
+
data: patchData,
|
|
32290
|
+
options
|
|
32268
32291
|
},
|
|
32269
32292
|
requestId
|
|
32270
32293
|
);
|
|
@@ -32276,15 +32299,10 @@ async function handleUpdateOne(resource, params, requestId) {
|
|
|
32276
32299
|
throw new Error(`No records found matching filter`);
|
|
32277
32300
|
}
|
|
32278
32301
|
}
|
|
32279
|
-
|
|
32280
|
-
|
|
32281
|
-
throw new Error("Failed to get updated record ID");
|
|
32302
|
+
if (!updateManyResult.items || updateManyResult.items.length === 0) {
|
|
32303
|
+
throw new Error("updateMany did not return items");
|
|
32282
32304
|
}
|
|
32283
|
-
|
|
32284
|
-
return {
|
|
32285
|
-
id: updatedId,
|
|
32286
|
-
...actualPatchData
|
|
32287
|
-
};
|
|
32305
|
+
return updateManyResult.items[0];
|
|
32288
32306
|
}
|
|
32289
32307
|
}
|
|
32290
32308
|
__name(handleUpdateOne, "handleUpdateOne");
|
|
@@ -33909,7 +33927,7 @@ async function handler(event) {
|
|
|
33909
33927
|
return createCorsResponse(HTTP_STATUS.OK);
|
|
33910
33928
|
}
|
|
33911
33929
|
if (event.requestContext.http.method === "GET" && event.requestContext.http.path === "/version") {
|
|
33912
|
-
const version = "1.3.
|
|
33930
|
+
const version = "1.3.38";
|
|
33913
33931
|
return createSuccessResponse({ version, timestamp: (/* @__PURE__ */ new Date()).toISOString() }, requestId);
|
|
33914
33932
|
}
|
|
33915
33933
|
if (event.requestContext.http.method !== "POST") {
|