@exabugs/dynamodb-client 1.8.0 → 1.9.0
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 +16 -0
- package/README.md +1 -0
- package/dist/client/FindCursor.d.ts +11 -6
- package/dist/client/FindCursor.d.ts.map +1 -1
- package/dist/client/FindCursor.js +30 -11
- package/dist/client/FindCursor.js.map +1 -1
- package/dist/integrations/react-admin/components/ReferenceManyToMany/ReferenceManyToManyField.d.ts.map +1 -1
- package/dist/integrations/react-admin/components/ReferenceManyToMany/ReferenceManyToManyField.js +5 -4
- package/dist/integrations/react-admin/components/ReferenceManyToMany/ReferenceManyToManyField.js.map +1 -1
- package/dist/integrations/react-admin/components/ReferenceManyToMany/ReferenceManyToManyInput.d.ts.map +1 -1
- package/dist/integrations/react-admin/components/ReferenceManyToMany/ReferenceManyToManyInput.js +5 -4
- package/dist/integrations/react-admin/components/ReferenceManyToMany/ReferenceManyToManyInput.js.map +1 -1
- package/dist/integrations/react-admin/components/ReferenceManyToMany/useGetListAll.d.ts +19 -0
- package/dist/integrations/react-admin/components/ReferenceManyToMany/useGetListAll.d.ts.map +1 -0
- package/dist/integrations/react-admin/components/ReferenceManyToMany/useGetListAll.js +36 -0
- package/dist/integrations/react-admin/components/ReferenceManyToMany/useGetListAll.js.map +1 -0
- package/dist/integrations/react-admin/dataProvider.d.ts +15 -1
- package/dist/integrations/react-admin/dataProvider.d.ts.map +1 -1
- package/dist/integrations/react-admin/dataProvider.js +84 -4
- package/dist/integrations/react-admin/dataProvider.js.map +1 -1
- package/dist/integrations/react-admin/index.d.ts +1 -0
- package/dist/integrations/react-admin/index.d.ts.map +1 -1
- package/dist/integrations/react-admin/index.js.map +1 -1
- package/dist/server/handler.cjs +314 -212
- package/dist/server/handler.cjs.map +4 -4
- package/dist/server/media-handler.cjs +2 -2
- package/dist/server/media-process-handler-dlq.cjs +286 -184
- package/dist/server/media-process-handler-dlq.cjs.map +4 -4
- package/dist/server/media-process-handler.cjs +285 -183
- package/dist/server/media-process-handler.cjs.map +4 -4
- package/dist/server/operations/find/idQuery.d.ts.map +1 -1
- package/dist/server/operations/find/idQuery.js +23 -9
- package/dist/server/operations/find/idQuery.js.map +1 -1
- package/dist/server/operations/find/shadowQuery.d.ts.map +1 -1
- package/dist/server/operations/find/shadowQuery.js +24 -8
- package/dist/server/operations/find/shadowQuery.js.map +1 -1
- package/dist/server/utils/scanWarning.d.ts +30 -0
- package/dist/server/utils/scanWarning.d.ts.map +1 -0
- package/dist/server/utils/scanWarning.js +63 -0
- package/dist/server/utils/scanWarning.js.map +1 -0
- package/dist/sharp-layer.zip +0 -0
- package/docs/README.md +286 -0
- package/docs/SCAN_WARNING.md +81 -0
- package/package.json +2 -1
- package/terraform/README.md +8 -6
- package/terraform/main.tf +40 -1
- package/terraform/outputs.tf +13 -0
- package/terraform/variables.tf +17 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// @exabugs/dynamodb-client v1.
|
|
2
|
-
// Built: 2026-10-11T23:
|
|
1
|
+
// @exabugs/dynamodb-client v1.9.0
|
|
2
|
+
// Built: 2026-10-11T23:33:20.708Z
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
@@ -2041,19 +2041,19 @@ var init_ProviderError = __esm({
|
|
|
2041
2041
|
name = "ProviderError";
|
|
2042
2042
|
tryNextLink;
|
|
2043
2043
|
constructor(message, options = true) {
|
|
2044
|
-
let
|
|
2044
|
+
let logger15;
|
|
2045
2045
|
let tryNextLink = true;
|
|
2046
2046
|
if (typeof options === "boolean") {
|
|
2047
|
-
|
|
2047
|
+
logger15 = void 0;
|
|
2048
2048
|
tryNextLink = options;
|
|
2049
2049
|
} else if (options != null && typeof options === "object") {
|
|
2050
|
-
|
|
2050
|
+
logger15 = options.logger;
|
|
2051
2051
|
tryNextLink = options.tryNextLink ?? true;
|
|
2052
2052
|
}
|
|
2053
2053
|
super(message);
|
|
2054
2054
|
this.tryNextLink = tryNextLink;
|
|
2055
2055
|
Object.setPrototypeOf(this, _ProviderError.prototype);
|
|
2056
|
-
|
|
2056
|
+
logger15?.debug?.(`@smithy/property-provider ${tryNextLink ? "->" : "(!)"} ${message}`);
|
|
2057
2057
|
}
|
|
2058
2058
|
static from(error2, options = true) {
|
|
2059
2059
|
return Object.assign(new this(error2.message, options), error2);
|
|
@@ -2486,8 +2486,8 @@ var init_configLoader = __esm({
|
|
|
2486
2486
|
init_fromSharedConfigFiles();
|
|
2487
2487
|
init_fromStatic();
|
|
2488
2488
|
loadConfig = /* @__PURE__ */ __name(({ environmentVariableSelector, configFileSelector, default: defaultValue }, configuration = {}) => {
|
|
2489
|
-
const { signingName, logger:
|
|
2490
|
-
const envOptions = { signingName, logger:
|
|
2489
|
+
const { signingName, logger: logger15 } = configuration;
|
|
2490
|
+
const envOptions = { signingName, logger: logger15 };
|
|
2491
2491
|
return memoize(chain(fromEnv(environmentVariableSelector, envOptions), fromSharedConfigFiles(configFileSelector, configuration), fromStatic(defaultValue)));
|
|
2492
2492
|
}, "loadConfig");
|
|
2493
2493
|
}
|
|
@@ -4106,7 +4106,7 @@ var init_ByteArrayCollector = __esm({
|
|
|
4106
4106
|
});
|
|
4107
4107
|
|
|
4108
4108
|
// node_modules/@smithy/core/dist-es/submodules/serde/util-stream/createBufferedReadable.browser.js
|
|
4109
|
-
function createBufferedReadableStream(upstream, size,
|
|
4109
|
+
function createBufferedReadableStream(upstream, size, logger15) {
|
|
4110
4110
|
const reader = upstream.getReader();
|
|
4111
4111
|
let streamBufferingLoggedWarning = false;
|
|
4112
4112
|
let bytesSeen = 0;
|
|
@@ -4144,7 +4144,7 @@ function createBufferedReadableStream(upstream, size, logger14) {
|
|
|
4144
4144
|
const newSize = merge(buffers, mode, chunk);
|
|
4145
4145
|
if (!streamBufferingLoggedWarning && bytesSeen > size * 2) {
|
|
4146
4146
|
streamBufferingLoggedWarning = true;
|
|
4147
|
-
|
|
4147
|
+
logger15?.warn(`@smithy/util-stream - stream chunk size ${chunkSize} is below threshold of ${size}, automatically buffering.`);
|
|
4148
4148
|
}
|
|
4149
4149
|
if (newSize >= size) {
|
|
4150
4150
|
controller.enqueue(flush(buffers, mode));
|
|
@@ -4208,9 +4208,9 @@ var init_createBufferedReadable_browser = __esm({
|
|
|
4208
4208
|
});
|
|
4209
4209
|
|
|
4210
4210
|
// node_modules/@smithy/core/dist-es/submodules/serde/util-stream/createBufferedReadable.js
|
|
4211
|
-
function createBufferedReadable(upstream, size,
|
|
4211
|
+
function createBufferedReadable(upstream, size, logger15) {
|
|
4212
4212
|
if (isReadableStream(upstream)) {
|
|
4213
|
-
return createBufferedReadableStream(upstream, size,
|
|
4213
|
+
return createBufferedReadableStream(upstream, size, logger15);
|
|
4214
4214
|
}
|
|
4215
4215
|
const downstream = new import_node_stream2.Readable({ read() {
|
|
4216
4216
|
} });
|
|
@@ -4243,7 +4243,7 @@ function createBufferedReadable(upstream, size, logger14) {
|
|
|
4243
4243
|
const newSize = merge(buffers, mode, chunk);
|
|
4244
4244
|
if (!streamBufferingLoggedWarning && bytesSeen > size * 2) {
|
|
4245
4245
|
streamBufferingLoggedWarning = true;
|
|
4246
|
-
|
|
4246
|
+
logger15?.warn(`@smithy/util-stream - stream chunk size ${chunkSize} is below threshold of ${size}, automatically buffering.`);
|
|
4247
4247
|
}
|
|
4248
4248
|
if (newSize >= size) {
|
|
4249
4249
|
downstream.push(flush(buffers, mode));
|
|
@@ -8281,19 +8281,19 @@ var require_dist_cjs4 = __commonJS({
|
|
|
8281
8281
|
name = "ProviderError";
|
|
8282
8282
|
tryNextLink;
|
|
8283
8283
|
constructor(message, options = true) {
|
|
8284
|
-
let
|
|
8284
|
+
let logger15;
|
|
8285
8285
|
let tryNextLink = true;
|
|
8286
8286
|
if (typeof options === "boolean") {
|
|
8287
|
-
|
|
8287
|
+
logger15 = void 0;
|
|
8288
8288
|
tryNextLink = options;
|
|
8289
8289
|
} else if (options != null && typeof options === "object") {
|
|
8290
|
-
|
|
8290
|
+
logger15 = options.logger;
|
|
8291
8291
|
tryNextLink = options.tryNextLink ?? true;
|
|
8292
8292
|
}
|
|
8293
8293
|
super(message);
|
|
8294
8294
|
this.tryNextLink = tryNextLink;
|
|
8295
8295
|
Object.setPrototypeOf(this, _ProviderError.prototype);
|
|
8296
|
-
|
|
8296
|
+
logger15?.debug?.(`@smithy/property-provider ${tryNextLink ? "->" : "(!)"} ${message}`);
|
|
8297
8297
|
}
|
|
8298
8298
|
static from(error2, options = true) {
|
|
8299
8299
|
return Object.assign(new this(error2.message, options), error2);
|
|
@@ -11106,9 +11106,9 @@ var require_dist_cjs13 = __commonJS({
|
|
|
11106
11106
|
this.middlewareStack.use(mw);
|
|
11107
11107
|
}
|
|
11108
11108
|
const stack = clientStack.concat(this.middlewareStack);
|
|
11109
|
-
const { logger:
|
|
11109
|
+
const { logger: logger15 } = configuration;
|
|
11110
11110
|
const handlerExecutionContext = {
|
|
11111
|
-
logger:
|
|
11111
|
+
logger: logger15,
|
|
11112
11112
|
clientName,
|
|
11113
11113
|
commandName,
|
|
11114
11114
|
inputFilterSensitiveLog,
|
|
@@ -14922,7 +14922,7 @@ var require_createBufferedReadableStream = __commonJS({
|
|
|
14922
14922
|
exports2.sizeOf = sizeOf2;
|
|
14923
14923
|
exports2.modeOf = modeOf2;
|
|
14924
14924
|
var ByteArrayCollector_1 = require_ByteArrayCollector();
|
|
14925
|
-
function createBufferedReadableStream2(upstream, size,
|
|
14925
|
+
function createBufferedReadableStream2(upstream, size, logger15) {
|
|
14926
14926
|
const reader = upstream.getReader();
|
|
14927
14927
|
let streamBufferingLoggedWarning = false;
|
|
14928
14928
|
let bytesSeen = 0;
|
|
@@ -14960,7 +14960,7 @@ var require_createBufferedReadableStream = __commonJS({
|
|
|
14960
14960
|
const newSize = merge2(buffers, mode, chunk);
|
|
14961
14961
|
if (!streamBufferingLoggedWarning && bytesSeen > size * 2) {
|
|
14962
14962
|
streamBufferingLoggedWarning = true;
|
|
14963
|
-
|
|
14963
|
+
logger15?.warn(`@smithy/util-stream - stream chunk size ${chunkSize} is below threshold of ${size}, automatically buffering.`);
|
|
14964
14964
|
}
|
|
14965
14965
|
if (newSize >= size) {
|
|
14966
14966
|
controller.enqueue(flush2(buffers, mode));
|
|
@@ -15031,9 +15031,9 @@ var require_createBufferedReadable = __commonJS({
|
|
|
15031
15031
|
var ByteArrayCollector_1 = require_ByteArrayCollector();
|
|
15032
15032
|
var createBufferedReadableStream_1 = require_createBufferedReadableStream();
|
|
15033
15033
|
var stream_type_check_1 = require_stream_type_check();
|
|
15034
|
-
function createBufferedReadable2(upstream, size,
|
|
15034
|
+
function createBufferedReadable2(upstream, size, logger15) {
|
|
15035
15035
|
if ((0, stream_type_check_1.isReadableStream)(upstream)) {
|
|
15036
|
-
return (0, createBufferedReadableStream_1.createBufferedReadableStream)(upstream, size,
|
|
15036
|
+
return (0, createBufferedReadableStream_1.createBufferedReadableStream)(upstream, size, logger15);
|
|
15037
15037
|
}
|
|
15038
15038
|
const downstream = new node_stream_1.Readable({ read() {
|
|
15039
15039
|
} });
|
|
@@ -15066,7 +15066,7 @@ var require_createBufferedReadable = __commonJS({
|
|
|
15066
15066
|
const newSize = (0, createBufferedReadableStream_1.merge)(buffers, mode, chunk);
|
|
15067
15067
|
if (!streamBufferingLoggedWarning && bytesSeen > size * 2) {
|
|
15068
15068
|
streamBufferingLoggedWarning = true;
|
|
15069
|
-
|
|
15069
|
+
logger15?.warn(`@smithy/util-stream - stream chunk size ${chunkSize} is below threshold of ${size}, automatically buffering.`);
|
|
15070
15070
|
}
|
|
15071
15071
|
if (newSize >= size) {
|
|
15072
15072
|
downstream.push((0, createBufferedReadableStream_1.flush)(buffers, mode));
|
|
@@ -15474,7 +15474,7 @@ var require_dist_cjs18 = __commonJS({
|
|
|
15474
15474
|
}
|
|
15475
15475
|
return timing.setTimeout(registerTimeout.bind(null, DEFER_EVENT_LISTENER_TIME$2), DEFER_EVENT_LISTENER_TIME$2);
|
|
15476
15476
|
}, "setConnectionTimeout");
|
|
15477
|
-
var setRequestTimeout = /* @__PURE__ */ __name((req, reject, timeoutInMs = 0, throwOnRequestTimeout,
|
|
15477
|
+
var setRequestTimeout = /* @__PURE__ */ __name((req, reject, timeoutInMs = 0, throwOnRequestTimeout, logger15) => {
|
|
15478
15478
|
if (timeoutInMs) {
|
|
15479
15479
|
return timing.setTimeout(() => {
|
|
15480
15480
|
let msg = `@smithy/node-http-handler - [${throwOnRequestTimeout ? "ERROR" : "WARN"}] a request has exceeded the configured ${timeoutInMs} ms requestTimeout.`;
|
|
@@ -15487,7 +15487,7 @@ var require_dist_cjs18 = __commonJS({
|
|
|
15487
15487
|
reject(error2);
|
|
15488
15488
|
} else {
|
|
15489
15489
|
msg += ` Init client requestHandler with throwOnRequestTimeout=true to turn this into an error.`;
|
|
15490
|
-
|
|
15490
|
+
logger15?.warn?.(msg);
|
|
15491
15491
|
}
|
|
15492
15492
|
}, timeoutInMs);
|
|
15493
15493
|
}
|
|
@@ -15603,7 +15603,7 @@ var require_dist_cjs18 = __commonJS({
|
|
|
15603
15603
|
}
|
|
15604
15604
|
return new _NodeHttpHandler(instanceOrOptions);
|
|
15605
15605
|
}
|
|
15606
|
-
static checkSocketUsage(agent, socketWarningTimestamp,
|
|
15606
|
+
static checkSocketUsage(agent, socketWarningTimestamp, logger15 = console) {
|
|
15607
15607
|
const { sockets, requests, maxSockets } = agent;
|
|
15608
15608
|
if (typeof maxSockets !== "number" || maxSockets === Infinity) {
|
|
15609
15609
|
return socketWarningTimestamp;
|
|
@@ -15617,7 +15617,7 @@ var require_dist_cjs18 = __commonJS({
|
|
|
15617
15617
|
const socketsInUse = sockets[origin]?.length ?? 0;
|
|
15618
15618
|
const requestsEnqueued = requests[origin]?.length ?? 0;
|
|
15619
15619
|
if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) {
|
|
15620
|
-
|
|
15620
|
+
logger15?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${socketsInUse} and ${requestsEnqueued} additional requests are enqueued.
|
|
15621
15621
|
See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
|
|
15622
15622
|
or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`);
|
|
15623
15623
|
return Date.now();
|
|
@@ -18642,7 +18642,7 @@ For more information please go to https://github.com/aws/aws-sdk-js-v3#functiona
|
|
|
18642
18642
|
return false;
|
|
18643
18643
|
}, "isChecksumWithPartNumber");
|
|
18644
18644
|
var getChecksum = /* @__PURE__ */ __name(async (body, { checksumAlgorithmFn, base64Encoder }) => base64Encoder(await stringHasher(checksumAlgorithmFn, body)), "getChecksum");
|
|
18645
|
-
var validateChecksumFromResponse = /* @__PURE__ */ __name(async (response, { config, responseAlgorithms, logger:
|
|
18645
|
+
var validateChecksumFromResponse = /* @__PURE__ */ __name(async (response, { config, responseAlgorithms, logger: logger15 }) => {
|
|
18646
18646
|
const checksumAlgorithms = getChecksumAlgorithmListForResponse(responseAlgorithms);
|
|
18647
18647
|
const { body: responseBody, headers: responseHeaders } = response;
|
|
18648
18648
|
for (const algorithm of checksumAlgorithms) {
|
|
@@ -18654,7 +18654,7 @@ For more information please go to https://github.com/aws/aws-sdk-js-v3#functiona
|
|
|
18654
18654
|
checksumAlgorithmFn = selectChecksumAlgorithmFunction(algorithm, config);
|
|
18655
18655
|
} catch (error2) {
|
|
18656
18656
|
if (algorithm === exports2.ChecksumAlgorithm.CRC64NVME) {
|
|
18657
|
-
|
|
18657
|
+
logger15?.warn(`Skipping ${exports2.ChecksumAlgorithm.CRC64NVME} checksum validation: ${error2.message}`);
|
|
18658
18658
|
continue;
|
|
18659
18659
|
}
|
|
18660
18660
|
throw error2;
|
|
@@ -18796,12 +18796,12 @@ var require_dist_cjs27 = __commonJS({
|
|
|
18796
18796
|
var loggerMiddleware = /* @__PURE__ */ __name(() => (next, context) => async (args) => {
|
|
18797
18797
|
try {
|
|
18798
18798
|
const response = await next(args);
|
|
18799
|
-
const { clientName, commandName, logger:
|
|
18799
|
+
const { clientName, commandName, logger: logger15, dynamoDbDocumentClientOptions = {} } = context;
|
|
18800
18800
|
const { overrideInputFilterSensitiveLog, overrideOutputFilterSensitiveLog } = dynamoDbDocumentClientOptions;
|
|
18801
18801
|
const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog;
|
|
18802
18802
|
const outputFilterSensitiveLog = overrideOutputFilterSensitiveLog ?? context.outputFilterSensitiveLog;
|
|
18803
18803
|
const { $metadata, ...outputWithoutMetadata } = response.output;
|
|
18804
|
-
|
|
18804
|
+
logger15?.info?.({
|
|
18805
18805
|
clientName,
|
|
18806
18806
|
commandName,
|
|
18807
18807
|
input: inputFilterSensitiveLog(args.input),
|
|
@@ -18810,10 +18810,10 @@ var require_dist_cjs27 = __commonJS({
|
|
|
18810
18810
|
});
|
|
18811
18811
|
return response;
|
|
18812
18812
|
} catch (error2) {
|
|
18813
|
-
const { clientName, commandName, logger:
|
|
18813
|
+
const { clientName, commandName, logger: logger15, dynamoDbDocumentClientOptions = {} } = context;
|
|
18814
18814
|
const { overrideInputFilterSensitiveLog } = dynamoDbDocumentClientOptions;
|
|
18815
18815
|
const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog;
|
|
18816
|
-
|
|
18816
|
+
logger15?.error?.({
|
|
18817
18817
|
clientName,
|
|
18818
18818
|
commandName,
|
|
18819
18819
|
input: inputFilterSensitiveLog(args.input),
|
|
@@ -20104,7 +20104,7 @@ var require_dist_cjs32 = __commonJS({
|
|
|
20104
20104
|
evaluateTreeRule
|
|
20105
20105
|
};
|
|
20106
20106
|
var resolveEndpoint4 = /* @__PURE__ */ __name((ruleSetObject, options) => {
|
|
20107
|
-
const { endpointParams, logger:
|
|
20107
|
+
const { endpointParams, logger: logger15 } = options;
|
|
20108
20108
|
const { parameters, rules } = ruleSetObject;
|
|
20109
20109
|
options.logger?.debug?.(`${debugId} Initial EndpointParams: ${toDebugString(endpointParams)}`);
|
|
20110
20110
|
const paramsWithDefault = Object.entries(parameters).filter(([, v5]) => v5.default != null).map(([k4, v5]) => [k4, v5.default]);
|
|
@@ -20119,7 +20119,7 @@ var require_dist_cjs32 = __commonJS({
|
|
|
20119
20119
|
throw new EndpointError(`Missing required parameter: '${requiredParam}'`);
|
|
20120
20120
|
}
|
|
20121
20121
|
}
|
|
20122
|
-
const endpoint = evaluateRules(rules, { endpointParams, logger:
|
|
20122
|
+
const endpoint = evaluateRules(rules, { endpointParams, logger: logger15, referenceRecord: {} });
|
|
20123
20123
|
options.logger?.debug?.(`${debugId} Resolved endpoint: ${toDebugString(endpoint)}`);
|
|
20124
20124
|
return endpoint;
|
|
20125
20125
|
}, "resolveEndpoint");
|
|
@@ -20628,11 +20628,11 @@ var require_dist_cjs36 = __commonJS({
|
|
|
20628
20628
|
userAgentAppId: /* @__PURE__ */ __name(async () => {
|
|
20629
20629
|
const appId = await normalizedAppIdProvider();
|
|
20630
20630
|
if (!isValidUserAgentAppId(appId)) {
|
|
20631
|
-
const
|
|
20631
|
+
const logger15 = input.logger?.constructor?.name === "NoOpLogger" || !input.logger ? console : input.logger;
|
|
20632
20632
|
if (typeof appId !== "string") {
|
|
20633
|
-
|
|
20633
|
+
logger15?.warn("userAgentAppId must be a string or undefined.");
|
|
20634
20634
|
} else if (appId.length > 50) {
|
|
20635
|
-
|
|
20635
|
+
logger15?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.");
|
|
20636
20636
|
}
|
|
20637
20637
|
}
|
|
20638
20638
|
return appId;
|
|
@@ -21500,8 +21500,8 @@ var require_dist_cjs42 = __commonJS({
|
|
|
21500
21500
|
var isFunction2 = /* @__PURE__ */ __name((func) => typeof func === "function", "isFunction");
|
|
21501
21501
|
var fromStatic2 = /* @__PURE__ */ __name((defaultValue) => isFunction2(defaultValue) ? async () => await defaultValue() : propertyProvider.fromStatic(defaultValue), "fromStatic");
|
|
21502
21502
|
var loadConfig2 = /* @__PURE__ */ __name(({ environmentVariableSelector, configFileSelector, default: defaultValue }, configuration = {}) => {
|
|
21503
|
-
const { signingName, logger:
|
|
21504
|
-
const envOptions = { signingName, logger:
|
|
21503
|
+
const { signingName, logger: logger15 } = configuration;
|
|
21504
|
+
const envOptions = { signingName, logger: logger15 };
|
|
21505
21505
|
return propertyProvider.memoize(propertyProvider.chain(fromEnv2(environmentVariableSelector, envOptions), fromSharedConfigFiles2(configFileSelector, configuration), fromStatic2(defaultValue)));
|
|
21506
21506
|
}, "loadConfig");
|
|
21507
21507
|
exports2.loadConfig = loadConfig2;
|
|
@@ -23737,7 +23737,7 @@ var require_dist_cjs53 = __commonJS({
|
|
|
23737
23737
|
"http:": true,
|
|
23738
23738
|
"https:": true
|
|
23739
23739
|
};
|
|
23740
|
-
var getCmdsUri = /* @__PURE__ */ __name(async ({ logger:
|
|
23740
|
+
var getCmdsUri = /* @__PURE__ */ __name(async ({ logger: logger15 }) => {
|
|
23741
23741
|
if (process.env[ENV_CMDS_RELATIVE_URI]) {
|
|
23742
23742
|
return {
|
|
23743
23743
|
hostname: CMDS_IP,
|
|
@@ -23749,13 +23749,13 @@ var require_dist_cjs53 = __commonJS({
|
|
|
23749
23749
|
if (!parsed.hostname || !(parsed.hostname in GREENGRASS_HOSTS)) {
|
|
23750
23750
|
throw new propertyProvider.CredentialsProviderError(`${parsed.hostname} is not a valid container metadata service hostname`, {
|
|
23751
23751
|
tryNextLink: false,
|
|
23752
|
-
logger:
|
|
23752
|
+
logger: logger15
|
|
23753
23753
|
});
|
|
23754
23754
|
}
|
|
23755
23755
|
if (!parsed.protocol || !(parsed.protocol in GREENGRASS_PROTOCOLS)) {
|
|
23756
23756
|
throw new propertyProvider.CredentialsProviderError(`${parsed.protocol} is not a valid container metadata service protocol`, {
|
|
23757
23757
|
tryNextLink: false,
|
|
23758
|
-
logger:
|
|
23758
|
+
logger: logger15
|
|
23759
23759
|
});
|
|
23760
23760
|
}
|
|
23761
23761
|
return {
|
|
@@ -23765,7 +23765,7 @@ var require_dist_cjs53 = __commonJS({
|
|
|
23765
23765
|
}
|
|
23766
23766
|
throw new propertyProvider.CredentialsProviderError(`The container metadata credential provider cannot be used unless the ${ENV_CMDS_RELATIVE_URI} or ${ENV_CMDS_FULL_URI} environment variable is set`, {
|
|
23767
23767
|
tryNextLink: false,
|
|
23768
|
-
logger:
|
|
23768
|
+
logger: logger15
|
|
23769
23769
|
});
|
|
23770
23770
|
}, "getCmdsUri");
|
|
23771
23771
|
var InstanceMetadataV1FallbackError = class _InstanceMetadataV1FallbackError extends propertyProvider.CredentialsProviderError {
|
|
@@ -23820,10 +23820,10 @@ var require_dist_cjs53 = __commonJS({
|
|
|
23820
23820
|
var STATIC_STABILITY_REFRESH_INTERVAL_SECONDS = 5 * 60;
|
|
23821
23821
|
var STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS = 5 * 60;
|
|
23822
23822
|
var STATIC_STABILITY_DOC_URL = "https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html";
|
|
23823
|
-
var getExtendedInstanceMetadataCredentials = /* @__PURE__ */ __name((credentials,
|
|
23823
|
+
var getExtendedInstanceMetadataCredentials = /* @__PURE__ */ __name((credentials, logger15) => {
|
|
23824
23824
|
const refreshInterval = STATIC_STABILITY_REFRESH_INTERVAL_SECONDS + Math.floor(Math.random() * STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS);
|
|
23825
23825
|
const newExpiration = new Date(Date.now() + refreshInterval * 1e3);
|
|
23826
|
-
|
|
23826
|
+
logger15.warn(`Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(newExpiration)}.
|
|
23827
23827
|
For more information, please visit: ` + STATIC_STABILITY_DOC_URL);
|
|
23828
23828
|
const originalExpiration = credentials.originalExpiration ?? credentials.expiration;
|
|
23829
23829
|
return {
|
|
@@ -23833,19 +23833,19 @@ For more information, please visit: ` + STATIC_STABILITY_DOC_URL);
|
|
|
23833
23833
|
};
|
|
23834
23834
|
}, "getExtendedInstanceMetadataCredentials");
|
|
23835
23835
|
var staticStabilityProvider = /* @__PURE__ */ __name((provider, options = {}) => {
|
|
23836
|
-
const
|
|
23836
|
+
const logger15 = options?.logger || console;
|
|
23837
23837
|
let pastCredentials;
|
|
23838
23838
|
return async () => {
|
|
23839
23839
|
let credentials;
|
|
23840
23840
|
try {
|
|
23841
23841
|
credentials = await provider();
|
|
23842
23842
|
if (credentials.expiration && credentials.expiration.getTime() < Date.now()) {
|
|
23843
|
-
credentials = getExtendedInstanceMetadataCredentials(credentials,
|
|
23843
|
+
credentials = getExtendedInstanceMetadataCredentials(credentials, logger15);
|
|
23844
23844
|
}
|
|
23845
23845
|
} catch (e4) {
|
|
23846
23846
|
if (pastCredentials) {
|
|
23847
|
-
|
|
23848
|
-
credentials = getExtendedInstanceMetadataCredentials(pastCredentials,
|
|
23847
|
+
logger15.warn("Credential renew failed: ", e4);
|
|
23848
|
+
credentials = getExtendedInstanceMetadataCredentials(pastCredentials, logger15);
|
|
23849
23849
|
} else {
|
|
23850
23850
|
throw e4;
|
|
23851
23851
|
}
|
|
@@ -23862,7 +23862,7 @@ For more information, please visit: ` + STATIC_STABILITY_DOC_URL);
|
|
|
23862
23862
|
var fromInstanceMetadata = /* @__PURE__ */ __name((init = {}) => staticStabilityProvider(getInstanceMetadataProvider(init), { logger: init.logger }), "fromInstanceMetadata");
|
|
23863
23863
|
var getInstanceMetadataProvider = /* @__PURE__ */ __name((init = {}) => {
|
|
23864
23864
|
let disableFetchToken = false;
|
|
23865
|
-
const { logger:
|
|
23865
|
+
const { logger: logger15, profile } = init;
|
|
23866
23866
|
const { timeout, maxRetries } = providerConfigFromInit(init);
|
|
23867
23867
|
const getCredentials = /* @__PURE__ */ __name(async (maxRetries2, options) => {
|
|
23868
23868
|
const isImdsV1Fallback = disableFetchToken || options.headers?.[X_AWS_EC2_METADATA_TOKEN] == null;
|
|
@@ -23926,7 +23926,7 @@ For more information, please visit: ` + STATIC_STABILITY_DOC_URL);
|
|
|
23926
23926
|
return async () => {
|
|
23927
23927
|
const endpoint = await getInstanceMetadataEndpoint();
|
|
23928
23928
|
if (disableFetchToken) {
|
|
23929
|
-
|
|
23929
|
+
logger15?.debug("AWS SDK Instance Metadata", "using v1 fallback (no token fetch)");
|
|
23930
23930
|
return getCredentials(maxRetries, { ...endpoint, timeout });
|
|
23931
23931
|
} else {
|
|
23932
23932
|
let token;
|
|
@@ -23940,7 +23940,7 @@ For more information, please visit: ` + STATIC_STABILITY_DOC_URL);
|
|
|
23940
23940
|
} else if (error2.message === "TimeoutError" || [403, 404, 405].includes(error2.statusCode)) {
|
|
23941
23941
|
disableFetchToken = true;
|
|
23942
23942
|
}
|
|
23943
|
-
|
|
23943
|
+
logger15?.debug("AWS SDK Instance Metadata", "using v1 fallback (initial)");
|
|
23944
23944
|
return getCredentials(maxRetries, { ...endpoint, timeout });
|
|
23945
23945
|
}
|
|
23946
23946
|
return getCredentials(maxRetries, {
|
|
@@ -23997,7 +23997,7 @@ var require_checkUrl = __commonJS({
|
|
|
23997
23997
|
var ECS_CONTAINER_HOST = "169.254.170.2";
|
|
23998
23998
|
var EKS_CONTAINER_HOST_IPv4 = "169.254.170.23";
|
|
23999
23999
|
var EKS_CONTAINER_HOST_IPv6 = "[fd00:ec2::23]";
|
|
24000
|
-
var checkUrl = /* @__PURE__ */ __name((url,
|
|
24000
|
+
var checkUrl = /* @__PURE__ */ __name((url, logger15) => {
|
|
24001
24001
|
if (url.protocol === "https:") {
|
|
24002
24002
|
return;
|
|
24003
24003
|
}
|
|
@@ -24024,7 +24024,7 @@ var require_checkUrl = __commonJS({
|
|
|
24024
24024
|
throw new property_provider_1.CredentialsProviderError(`URL not accepted. It must either be HTTPS or match one of the following:
|
|
24025
24025
|
- loopback CIDR 127.0.0.0/8 or [::1/128]
|
|
24026
24026
|
- ECS container host 169.254.170.2
|
|
24027
|
-
- EKS container host 169.254.170.23 or [fd00:ec2::23]`, { logger:
|
|
24027
|
+
- EKS container host 169.254.170.23 or [fd00:ec2::23]`, { logger: logger15 });
|
|
24028
24028
|
}, "checkUrl");
|
|
24029
24029
|
exports2.checkUrl = checkUrl;
|
|
24030
24030
|
}
|
|
@@ -24055,13 +24055,13 @@ var require_requestHelpers = __commonJS({
|
|
|
24055
24055
|
});
|
|
24056
24056
|
}
|
|
24057
24057
|
__name(createGetRequest, "createGetRequest");
|
|
24058
|
-
async function getCredentials(response,
|
|
24058
|
+
async function getCredentials(response, logger15) {
|
|
24059
24059
|
const stream = (0, util_stream_1.sdkStreamMixin)(response.body);
|
|
24060
24060
|
const str = await stream.transformToString();
|
|
24061
24061
|
if (response.statusCode === 200) {
|
|
24062
24062
|
const parsed = JSON.parse(str);
|
|
24063
24063
|
if (typeof parsed.AccessKeyId !== "string" || typeof parsed.SecretAccessKey !== "string" || typeof parsed.Token !== "string" || typeof parsed.Expiration !== "string") {
|
|
24064
|
-
throw new property_provider_1.CredentialsProviderError("HTTP credential provider response not of the required format, an object matching: { AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }", { logger:
|
|
24064
|
+
throw new property_provider_1.CredentialsProviderError("HTTP credential provider response not of the required format, an object matching: { AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }", { logger: logger15 });
|
|
24065
24065
|
}
|
|
24066
24066
|
return {
|
|
24067
24067
|
accessKeyId: parsed.AccessKeyId,
|
|
@@ -24076,12 +24076,12 @@ var require_requestHelpers = __commonJS({
|
|
|
24076
24076
|
parsedBody = JSON.parse(str);
|
|
24077
24077
|
} catch (e4) {
|
|
24078
24078
|
}
|
|
24079
|
-
throw Object.assign(new property_provider_1.CredentialsProviderError(`Server responded with status: ${response.statusCode}`, { logger:
|
|
24079
|
+
throw Object.assign(new property_provider_1.CredentialsProviderError(`Server responded with status: ${response.statusCode}`, { logger: logger15 }), {
|
|
24080
24080
|
Code: parsedBody.Code,
|
|
24081
24081
|
Message: parsedBody.Message
|
|
24082
24082
|
});
|
|
24083
24083
|
}
|
|
24084
|
-
throw new property_provider_1.CredentialsProviderError(`Server responded with status: ${response.statusCode}`, { logger:
|
|
24084
|
+
throw new property_provider_1.CredentialsProviderError(`Server responded with status: ${response.statusCode}`, { logger: logger15 });
|
|
24085
24085
|
}
|
|
24086
24086
|
__name(getCredentials, "getCredentials");
|
|
24087
24087
|
}
|
|
@@ -25445,14 +25445,14 @@ var require_dist_cjs60 = __commonJS({
|
|
|
25445
25445
|
var propertyProvider = require_dist_cjs4();
|
|
25446
25446
|
var sharedIniFileLoader = require_dist_cjs41();
|
|
25447
25447
|
var fs = require("fs");
|
|
25448
|
-
var fromEnvSigningName = /* @__PURE__ */ __name(({ logger:
|
|
25449
|
-
|
|
25448
|
+
var fromEnvSigningName = /* @__PURE__ */ __name(({ logger: logger15, signingName } = {}) => async () => {
|
|
25449
|
+
logger15?.debug?.("@aws-sdk/token-providers - fromEnvSigningName");
|
|
25450
25450
|
if (!signingName) {
|
|
25451
|
-
throw new propertyProvider.TokenProviderError("Please pass 'signingName' to compute environment variable key", { logger:
|
|
25451
|
+
throw new propertyProvider.TokenProviderError("Please pass 'signingName' to compute environment variable key", { logger: logger15 });
|
|
25452
25452
|
}
|
|
25453
25453
|
const bearerTokenKey = httpAuthSchemes.getBearerTokenEnvKey(signingName);
|
|
25454
25454
|
if (!(bearerTokenKey in process.env)) {
|
|
25455
|
-
throw new propertyProvider.TokenProviderError(`Token not present in '${bearerTokenKey}' environment variable`, { logger:
|
|
25455
|
+
throw new propertyProvider.TokenProviderError(`Token not present in '${bearerTokenKey}' environment variable`, { logger: logger15 });
|
|
25456
25456
|
}
|
|
25457
25457
|
const token = { token: process.env[bearerTokenKey] };
|
|
25458
25458
|
client.setTokenFeature(token, "BEARER_SERVICE_ENV_VARS", "3");
|
|
@@ -25573,8 +25573,8 @@ var require_dist_cjs60 = __commonJS({
|
|
|
25573
25573
|
return existingToken;
|
|
25574
25574
|
}
|
|
25575
25575
|
}, "fromSso");
|
|
25576
|
-
var fromStatic2 = /* @__PURE__ */ __name(({ token, logger:
|
|
25577
|
-
|
|
25576
|
+
var fromStatic2 = /* @__PURE__ */ __name(({ token, logger: logger15 }) => async () => {
|
|
25577
|
+
logger15?.debug("@aws-sdk/token-providers - fromStatic");
|
|
25578
25578
|
if (!token || !token.token) {
|
|
25579
25579
|
throw new propertyProvider.TokenProviderError(`Please pass a valid token to fromStatic`, false);
|
|
25580
25580
|
}
|
|
@@ -26363,7 +26363,7 @@ var require_dist_cjs62 = __commonJS({
|
|
|
26363
26363
|
var tokenProviders = require_dist_cjs60();
|
|
26364
26364
|
var isSsoProfile = /* @__PURE__ */ __name((arg) => arg && (typeof arg.sso_start_url === "string" || typeof arg.sso_account_id === "string" || typeof arg.sso_session === "string" || typeof arg.sso_region === "string" || typeof arg.sso_role_name === "string"), "isSsoProfile");
|
|
26365
26365
|
var SHOULD_FAIL_CREDENTIAL_CHAIN = false;
|
|
26366
|
-
var resolveSSOCredentials = /* @__PURE__ */ __name(async ({ ssoStartUrl, ssoSession, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, clientConfig, parentClientConfig, profile, filepath, configFilepath, ignoreCache, logger:
|
|
26366
|
+
var resolveSSOCredentials = /* @__PURE__ */ __name(async ({ ssoStartUrl, ssoSession, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, clientConfig, parentClientConfig, profile, filepath, configFilepath, ignoreCache, logger: logger15 }) => {
|
|
26367
26367
|
let token;
|
|
26368
26368
|
const refreshMessage = `To refresh this SSO session run aws sso login with the corresponding profile.`;
|
|
26369
26369
|
if (ssoSession) {
|
|
@@ -26381,7 +26381,7 @@ var require_dist_cjs62 = __commonJS({
|
|
|
26381
26381
|
} catch (e4) {
|
|
26382
26382
|
throw new propertyProvider.CredentialsProviderError(e4.message, {
|
|
26383
26383
|
tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
|
|
26384
|
-
logger:
|
|
26384
|
+
logger: logger15
|
|
26385
26385
|
});
|
|
26386
26386
|
}
|
|
26387
26387
|
} else {
|
|
@@ -26390,14 +26390,14 @@ var require_dist_cjs62 = __commonJS({
|
|
|
26390
26390
|
} catch (e4) {
|
|
26391
26391
|
throw new propertyProvider.CredentialsProviderError(`The SSO session associated with this profile is invalid. ${refreshMessage}`, {
|
|
26392
26392
|
tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
|
|
26393
|
-
logger:
|
|
26393
|
+
logger: logger15
|
|
26394
26394
|
});
|
|
26395
26395
|
}
|
|
26396
26396
|
}
|
|
26397
26397
|
if (new Date(token.expiresAt).getTime() - Date.now() <= 0) {
|
|
26398
26398
|
throw new propertyProvider.CredentialsProviderError(`The SSO session associated with this profile has expired. ${refreshMessage}`, {
|
|
26399
26399
|
tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
|
|
26400
|
-
logger:
|
|
26400
|
+
logger: logger15
|
|
26401
26401
|
});
|
|
26402
26402
|
}
|
|
26403
26403
|
const { accessToken } = token;
|
|
@@ -26419,14 +26419,14 @@ var require_dist_cjs62 = __commonJS({
|
|
|
26419
26419
|
} catch (e4) {
|
|
26420
26420
|
throw new propertyProvider.CredentialsProviderError(e4, {
|
|
26421
26421
|
tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
|
|
26422
|
-
logger:
|
|
26422
|
+
logger: logger15
|
|
26423
26423
|
});
|
|
26424
26424
|
}
|
|
26425
26425
|
const { roleCredentials: { accessKeyId, secretAccessKey, sessionToken, expiration, credentialScope, accountId } = {} } = ssoResp;
|
|
26426
26426
|
if (!accessKeyId || !secretAccessKey || !sessionToken || !expiration) {
|
|
26427
26427
|
throw new propertyProvider.CredentialsProviderError("SSO returns an invalid temporary credential.", {
|
|
26428
26428
|
tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
|
|
26429
|
-
logger:
|
|
26429
|
+
logger: logger15
|
|
26430
26430
|
});
|
|
26431
26431
|
}
|
|
26432
26432
|
const credentials = {
|
|
@@ -26444,11 +26444,11 @@ var require_dist_cjs62 = __commonJS({
|
|
|
26444
26444
|
}
|
|
26445
26445
|
return credentials;
|
|
26446
26446
|
}, "resolveSSOCredentials");
|
|
26447
|
-
var validateSsoProfile = /* @__PURE__ */ __name((profile,
|
|
26447
|
+
var validateSsoProfile = /* @__PURE__ */ __name((profile, logger15) => {
|
|
26448
26448
|
const { sso_start_url, sso_account_id, sso_region, sso_role_name } = profile;
|
|
26449
26449
|
if (!sso_start_url || !sso_account_id || !sso_region || !sso_role_name) {
|
|
26450
26450
|
throw new propertyProvider.CredentialsProviderError(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(profile).join(", ")}
|
|
26451
|
-
Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`, { tryNextLink: false, logger:
|
|
26451
|
+
Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`, { tryNextLink: false, logger: logger15 });
|
|
26452
26452
|
}
|
|
26453
26453
|
return profile;
|
|
26454
26454
|
}, "validateSsoProfile");
|
|
@@ -27231,7 +27231,7 @@ var require_dist_cjs63 = __commonJS({
|
|
|
27231
27231
|
}
|
|
27232
27232
|
async refresh(token) {
|
|
27233
27233
|
const { SigninClient: SigninClient2, CreateOAuth2TokenCommand: CreateOAuth2TokenCommand2 } = await Promise.resolve().then(() => (init_signin(), signin_exports));
|
|
27234
|
-
const { logger:
|
|
27234
|
+
const { logger: logger15, userAgentAppId } = this.callerClientConfig ?? {};
|
|
27235
27235
|
const isH22 = /* @__PURE__ */ __name((requestHandler2) => {
|
|
27236
27236
|
return requestHandler2?.metadata?.handlerProtocol === "h2";
|
|
27237
27237
|
}, "isH2");
|
|
@@ -27244,7 +27244,7 @@ var require_dist_cjs63 = __commonJS({
|
|
|
27244
27244
|
},
|
|
27245
27245
|
region,
|
|
27246
27246
|
requestHandler,
|
|
27247
|
-
logger:
|
|
27247
|
+
logger: logger15,
|
|
27248
27248
|
userAgentAppId,
|
|
27249
27249
|
...this.init?.clientConfig
|
|
27250
27250
|
});
|
|
@@ -28262,9 +28262,9 @@ var init_defaultStsRoleAssumers = __esm({
|
|
|
28262
28262
|
return async (sourceCreds, params) => {
|
|
28263
28263
|
closureSourceCreds = sourceCreds;
|
|
28264
28264
|
if (!stsClient) {
|
|
28265
|
-
const { logger:
|
|
28265
|
+
const { logger: logger15 = stsOptions?.parentClientConfig?.logger, profile = stsOptions?.parentClientConfig?.profile, region, requestHandler = stsOptions?.parentClientConfig?.requestHandler, credentialProviderLogger, userAgentAppId = stsOptions?.parentClientConfig?.userAgentAppId } = stsOptions;
|
|
28266
28266
|
const resolvedRegion = await resolveRegion(region, stsOptions?.parentClientConfig?.region, credentialProviderLogger, {
|
|
28267
|
-
logger:
|
|
28267
|
+
logger: logger15,
|
|
28268
28268
|
profile
|
|
28269
28269
|
});
|
|
28270
28270
|
const isCompatibleRequestHandler = !isH2(requestHandler);
|
|
@@ -28275,7 +28275,7 @@ var init_defaultStsRoleAssumers = __esm({
|
|
|
28275
28275
|
credentialDefaultProvider: /* @__PURE__ */ __name(() => async () => closureSourceCreds, "credentialDefaultProvider"),
|
|
28276
28276
|
region: resolvedRegion,
|
|
28277
28277
|
requestHandler: isCompatibleRequestHandler ? requestHandler : void 0,
|
|
28278
|
-
logger:
|
|
28278
|
+
logger: logger15
|
|
28279
28279
|
});
|
|
28280
28280
|
}
|
|
28281
28281
|
const { Credentials: Credentials2, AssumedRoleUser: AssumedRoleUser2 } = await stsClient.send(new AssumeRoleCommand(params));
|
|
@@ -28299,9 +28299,9 @@ var init_defaultStsRoleAssumers = __esm({
|
|
|
28299
28299
|
let stsClient;
|
|
28300
28300
|
return async (params) => {
|
|
28301
28301
|
if (!stsClient) {
|
|
28302
|
-
const { logger:
|
|
28302
|
+
const { logger: logger15 = stsOptions?.parentClientConfig?.logger, profile = stsOptions?.parentClientConfig?.profile, region, requestHandler = stsOptions?.parentClientConfig?.requestHandler, credentialProviderLogger, userAgentAppId = stsOptions?.parentClientConfig?.userAgentAppId } = stsOptions;
|
|
28303
28303
|
const resolvedRegion = await resolveRegion(region, stsOptions?.parentClientConfig?.region, credentialProviderLogger, {
|
|
28304
|
-
logger:
|
|
28304
|
+
logger: logger15,
|
|
28305
28305
|
profile
|
|
28306
28306
|
});
|
|
28307
28307
|
const isCompatibleRequestHandler = !isH2(requestHandler);
|
|
@@ -28311,7 +28311,7 @@ var init_defaultStsRoleAssumers = __esm({
|
|
|
28311
28311
|
profile,
|
|
28312
28312
|
region: resolvedRegion,
|
|
28313
28313
|
requestHandler: isCompatibleRequestHandler ? requestHandler : void 0,
|
|
28314
|
-
logger:
|
|
28314
|
+
logger: logger15
|
|
28315
28315
|
});
|
|
28316
28316
|
}
|
|
28317
28317
|
const { Credentials: Credentials2, AssumedRoleUser: AssumedRoleUser2 } = await stsClient.send(new AssumeRoleWithWebIdentityCommand(params));
|
|
@@ -28441,7 +28441,7 @@ var require_dist_cjs64 = __commonJS({
|
|
|
28441
28441
|
client.setCredentialFeature(credentials, "CREDENTIALS_PROCESS", "w");
|
|
28442
28442
|
return credentials;
|
|
28443
28443
|
}, "getValidatedProcessCredentials");
|
|
28444
|
-
var resolveProcessCredentials = /* @__PURE__ */ __name(async (profileName, profiles,
|
|
28444
|
+
var resolveProcessCredentials = /* @__PURE__ */ __name(async (profileName, profiles, logger15) => {
|
|
28445
28445
|
const profile = profiles[profileName];
|
|
28446
28446
|
if (profiles[profileName]) {
|
|
28447
28447
|
const credentialProcess = profile["credential_process"];
|
|
@@ -28457,14 +28457,14 @@ var require_dist_cjs64 = __commonJS({
|
|
|
28457
28457
|
}
|
|
28458
28458
|
return getValidatedProcessCredentials(profileName, data, profiles);
|
|
28459
28459
|
} catch (error2) {
|
|
28460
|
-
throw new propertyProvider.CredentialsProviderError(error2.message, { logger:
|
|
28460
|
+
throw new propertyProvider.CredentialsProviderError(error2.message, { logger: logger15 });
|
|
28461
28461
|
}
|
|
28462
28462
|
} else {
|
|
28463
|
-
throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} did not contain credential_process.`, { logger:
|
|
28463
|
+
throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} did not contain credential_process.`, { logger: logger15 });
|
|
28464
28464
|
}
|
|
28465
28465
|
} else {
|
|
28466
28466
|
throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} could not be found in shared credentials file.`, {
|
|
28467
|
-
logger:
|
|
28467
|
+
logger: logger15
|
|
28468
28468
|
});
|
|
28469
28469
|
}
|
|
28470
28470
|
}, "resolveProcessCredentials");
|
|
@@ -28623,21 +28623,21 @@ var require_dist_cjs66 = __commonJS({
|
|
|
28623
28623
|
var propertyProvider = require_dist_cjs4();
|
|
28624
28624
|
var client = (init_client(), __toCommonJS(client_exports));
|
|
28625
28625
|
var credentialProviderLogin = require_dist_cjs63();
|
|
28626
|
-
var resolveCredentialSource = /* @__PURE__ */ __name((credentialSource, profileName,
|
|
28626
|
+
var resolveCredentialSource = /* @__PURE__ */ __name((credentialSource, profileName, logger15) => {
|
|
28627
28627
|
const sourceProvidersMap = {
|
|
28628
28628
|
EcsContainer: /* @__PURE__ */ __name(async (options) => {
|
|
28629
28629
|
const { fromHttp } = await Promise.resolve().then(() => __toESM(require_dist_cjs54()));
|
|
28630
28630
|
const { fromContainerMetadata } = await Promise.resolve().then(() => __toESM(require_dist_cjs53()));
|
|
28631
|
-
|
|
28631
|
+
logger15?.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer");
|
|
28632
28632
|
return async () => propertyProvider.chain(fromHttp(options ?? {}), fromContainerMetadata(options))().then(setNamedProvider);
|
|
28633
28633
|
}, "EcsContainer"),
|
|
28634
28634
|
Ec2InstanceMetadata: /* @__PURE__ */ __name(async (options) => {
|
|
28635
|
-
|
|
28635
|
+
logger15?.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata");
|
|
28636
28636
|
const { fromInstanceMetadata } = await Promise.resolve().then(() => __toESM(require_dist_cjs53()));
|
|
28637
28637
|
return async () => fromInstanceMetadata(options)().then(setNamedProvider);
|
|
28638
28638
|
}, "Ec2InstanceMetadata"),
|
|
28639
28639
|
Environment: /* @__PURE__ */ __name(async (options) => {
|
|
28640
|
-
|
|
28640
|
+
logger15?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment");
|
|
28641
28641
|
const { fromEnv: fromEnv2 } = await Promise.resolve().then(() => __toESM(require_dist_cjs52()));
|
|
28642
28642
|
return async () => fromEnv2(options)().then(setNamedProvider);
|
|
28643
28643
|
}, "Environment")
|
|
@@ -28645,24 +28645,24 @@ var require_dist_cjs66 = __commonJS({
|
|
|
28645
28645
|
if (credentialSource in sourceProvidersMap) {
|
|
28646
28646
|
return sourceProvidersMap[credentialSource];
|
|
28647
28647
|
} else {
|
|
28648
|
-
throw new propertyProvider.CredentialsProviderError(`Unsupported credential source in profile ${profileName}. Got ${credentialSource}, expected EcsContainer or Ec2InstanceMetadata or Environment.`, { logger:
|
|
28648
|
+
throw new propertyProvider.CredentialsProviderError(`Unsupported credential source in profile ${profileName}. Got ${credentialSource}, expected EcsContainer or Ec2InstanceMetadata or Environment.`, { logger: logger15 });
|
|
28649
28649
|
}
|
|
28650
28650
|
}, "resolveCredentialSource");
|
|
28651
28651
|
var setNamedProvider = /* @__PURE__ */ __name((creds) => client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_NAMED_PROVIDER", "p"), "setNamedProvider");
|
|
28652
|
-
var isAssumeRoleProfile = /* @__PURE__ */ __name((arg, { profile = "default", logger:
|
|
28653
|
-
return Boolean(arg) && typeof arg === "object" && typeof arg.role_arn === "string" && ["undefined", "string"].indexOf(typeof arg.role_session_name) > -1 && ["undefined", "string"].indexOf(typeof arg.external_id) > -1 && ["undefined", "string"].indexOf(typeof arg.mfa_serial) > -1 && (isAssumeRoleWithSourceProfile(arg, { profile, logger:
|
|
28652
|
+
var isAssumeRoleProfile = /* @__PURE__ */ __name((arg, { profile = "default", logger: logger15 } = {}) => {
|
|
28653
|
+
return Boolean(arg) && typeof arg === "object" && typeof arg.role_arn === "string" && ["undefined", "string"].indexOf(typeof arg.role_session_name) > -1 && ["undefined", "string"].indexOf(typeof arg.external_id) > -1 && ["undefined", "string"].indexOf(typeof arg.mfa_serial) > -1 && (isAssumeRoleWithSourceProfile(arg, { profile, logger: logger15 }) || isCredentialSourceProfile(arg, { profile, logger: logger15 }));
|
|
28654
28654
|
}, "isAssumeRoleProfile");
|
|
28655
|
-
var isAssumeRoleWithSourceProfile = /* @__PURE__ */ __name((arg, { profile, logger:
|
|
28655
|
+
var isAssumeRoleWithSourceProfile = /* @__PURE__ */ __name((arg, { profile, logger: logger15 }) => {
|
|
28656
28656
|
const withSourceProfile = typeof arg.source_profile === "string" && typeof arg.credential_source === "undefined";
|
|
28657
28657
|
if (withSourceProfile) {
|
|
28658
|
-
|
|
28658
|
+
logger15?.debug?.(` ${profile} isAssumeRoleWithSourceProfile source_profile=${arg.source_profile}`);
|
|
28659
28659
|
}
|
|
28660
28660
|
return withSourceProfile;
|
|
28661
28661
|
}, "isAssumeRoleWithSourceProfile");
|
|
28662
|
-
var isCredentialSourceProfile = /* @__PURE__ */ __name((arg, { profile, logger:
|
|
28662
|
+
var isCredentialSourceProfile = /* @__PURE__ */ __name((arg, { profile, logger: logger15 }) => {
|
|
28663
28663
|
const withProviderProfile = typeof arg.credential_source === "string" && typeof arg.source_profile === "undefined";
|
|
28664
28664
|
if (withProviderProfile) {
|
|
28665
|
-
|
|
28665
|
+
logger15?.debug?.(` ${profile} isCredentialSourceProfile credential_source=${arg.credential_source}`);
|
|
28666
28666
|
}
|
|
28667
28667
|
return withProviderProfile;
|
|
28668
28668
|
}, "isCredentialSourceProfile");
|
|
@@ -46003,6 +46003,59 @@ var init_pagination = __esm({
|
|
|
46003
46003
|
}
|
|
46004
46004
|
});
|
|
46005
46005
|
|
|
46006
|
+
// src/server/utils/scanWarning.ts
|
|
46007
|
+
function getScanWarnThreshold() {
|
|
46008
|
+
const raw = process.env.SCAN_WARN_THRESHOLD;
|
|
46009
|
+
if (raw === void 0 || raw === "") {
|
|
46010
|
+
return DEFAULT_SCAN_WARN_THRESHOLD;
|
|
46011
|
+
}
|
|
46012
|
+
const value = Number(raw);
|
|
46013
|
+
return Number.isInteger(value) && value >= 1 ? value : DEFAULT_SCAN_WARN_THRESHOLD;
|
|
46014
|
+
}
|
|
46015
|
+
var logger3, SPARSE_SCAN_EVENT, DEFAULT_SCAN_WARN_THRESHOLD, ScanWatcher;
|
|
46016
|
+
var init_scanWarning = __esm({
|
|
46017
|
+
"src/server/utils/scanWarning.ts"() {
|
|
46018
|
+
"use strict";
|
|
46019
|
+
init_shared();
|
|
46020
|
+
logger3 = createLogger({ service: "scan-warning", level: "warn" });
|
|
46021
|
+
SPARSE_SCAN_EVENT = "SPARSE_SCAN";
|
|
46022
|
+
DEFAULT_SCAN_WARN_THRESHOLD = 5e3;
|
|
46023
|
+
__name(getScanWarnThreshold, "getScanWarnThreshold");
|
|
46024
|
+
ScanWatcher = class {
|
|
46025
|
+
constructor(context) {
|
|
46026
|
+
this.context = context;
|
|
46027
|
+
}
|
|
46028
|
+
static {
|
|
46029
|
+
__name(this, "ScanWatcher");
|
|
46030
|
+
}
|
|
46031
|
+
scanned = 0;
|
|
46032
|
+
warned = false;
|
|
46033
|
+
threshold = getScanWarnThreshold();
|
|
46034
|
+
/** 読んだ件数を加える */
|
|
46035
|
+
add(count) {
|
|
46036
|
+
this.scanned += count;
|
|
46037
|
+
if (!this.warned && this.scanned >= this.threshold) {
|
|
46038
|
+
this.warned = true;
|
|
46039
|
+
logger3.warn(
|
|
46040
|
+
`${SPARSE_SCAN_EVENT}: 1\u30EA\u30AF\u30A8\u30B9\u30C8\u3067 ${this.scanned} \u4EF6\u4EE5\u4E0A\u3092\u8AAD\u307F\u307E\u3057\u305F\u3002\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u30FB\u30B9\u30AD\u30FC\u30DE\u30FB\u30ED\u30B8\u30C3\u30AF\u306E\u898B\u76F4\u3057\u3092\u691C\u8A0E\u3057\u3066\u304F\u3060\u3055\u3044\uFF08docs/SCAN_WARNING.md\uFF09`,
|
|
46041
|
+
{
|
|
46042
|
+
event: SPARSE_SCAN_EVENT,
|
|
46043
|
+
...this.context,
|
|
46044
|
+
scanned: this.scanned,
|
|
46045
|
+
threshold: this.threshold,
|
|
46046
|
+
actions: [
|
|
46047
|
+
"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9: \u7D5E\u308A\u8FBC\u307F\u306B\u4F7F\u3046\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30B7\u30E3\u30C9\u30FC\u8A2D\u5B9A\u306B\u8FFD\u52A0\u3057\u3001$eq \u306A\u3069\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u3067\u89E3\u6C7A\u3067\u304D\u308B\u6761\u4EF6\u306B\u3059\u308B",
|
|
46048
|
+
"\u30B9\u30AD\u30FC\u30DE: \u7D5E\u308A\u8FBC\u307F\u6761\u4EF6\u3092\u30AD\u30FC\u306B\u3067\u304D\u308B\u3088\u3046\u3001\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u306E\u5206\u5272\u30FB\u975E\u6B63\u898F\u5316\u3092\u691C\u8A0E\u3059\u308B",
|
|
46049
|
+
"\u30ED\u30B8\u30C3\u30AF: \u7D5E\u308A\u8FBC\u307F\u3092\u6BCE\u56DE\u884C\u3046\u5FC5\u8981\u304C\u3042\u308B\u304B\u3001\u6761\u4EF6\u3092\u5909\u3048\u3089\u308C\u306A\u3044\u304B\u3001\u7D50\u679C\u3092\u30AD\u30E3\u30C3\u30B7\u30E5\u3067\u304D\u306A\u3044\u304B\u3092\u898B\u76F4\u3059"
|
|
46050
|
+
]
|
|
46051
|
+
}
|
|
46052
|
+
);
|
|
46053
|
+
}
|
|
46054
|
+
}
|
|
46055
|
+
};
|
|
46056
|
+
}
|
|
46057
|
+
});
|
|
46058
|
+
|
|
46006
46059
|
// src/server/utils/filter.ts
|
|
46007
46060
|
function parseFilterField(fieldKey) {
|
|
46008
46061
|
const parts = fieldKey.split(":");
|
|
@@ -46091,7 +46144,7 @@ function parseFilters(filter) {
|
|
|
46091
46144
|
parsedFilters.push({ parsed, value });
|
|
46092
46145
|
}
|
|
46093
46146
|
} catch (error2) {
|
|
46094
|
-
|
|
46147
|
+
logger4.error("Invalid filter field syntax", {
|
|
46095
46148
|
fieldKey,
|
|
46096
46149
|
error: error2 instanceof Error ? error2.message : String(error2)
|
|
46097
46150
|
});
|
|
@@ -46160,7 +46213,7 @@ function detectNearQuery(filter) {
|
|
|
46160
46213
|
}
|
|
46161
46214
|
return null;
|
|
46162
46215
|
}
|
|
46163
|
-
var
|
|
46216
|
+
var logger4;
|
|
46164
46217
|
var init_utils5 = __esm({
|
|
46165
46218
|
"src/server/operations/find/utils.ts"() {
|
|
46166
46219
|
"use strict";
|
|
@@ -46169,7 +46222,7 @@ var init_utils5 = __esm({
|
|
|
46169
46222
|
init_shadow();
|
|
46170
46223
|
init_filter();
|
|
46171
46224
|
init_validation2();
|
|
46172
|
-
|
|
46225
|
+
logger4 = createLogger({
|
|
46173
46226
|
service: "find-utils",
|
|
46174
46227
|
level: process.env.LOG_LEVEL || "info"
|
|
46175
46228
|
});
|
|
@@ -46186,7 +46239,7 @@ var init_utils5 = __esm({
|
|
|
46186
46239
|
async function executeIdQuery(resource, normalizedParams, requestId) {
|
|
46187
46240
|
const { sort, pagination, parsedFilters } = normalizedParams;
|
|
46188
46241
|
const { perPage, nextToken } = pagination;
|
|
46189
|
-
|
|
46242
|
+
logger5.debug("Executing ID optimized query", {
|
|
46190
46243
|
requestId,
|
|
46191
46244
|
resource,
|
|
46192
46245
|
sort,
|
|
@@ -46223,7 +46276,7 @@ async function executeSpecificIdQuery(resource, targetId, requestId) {
|
|
|
46223
46276
|
costTracker.add(queryResult.ConsumedCapacity);
|
|
46224
46277
|
const mainRecords = queryResult.Items || [];
|
|
46225
46278
|
const items = mainRecords.map((item) => extractCleanRecord(item));
|
|
46226
|
-
|
|
46279
|
+
logger5.info("ID specific query succeeded", {
|
|
46227
46280
|
requestId,
|
|
46228
46281
|
resource,
|
|
46229
46282
|
targetId,
|
|
@@ -46270,7 +46323,7 @@ async function executeInQuery(resource, targetIds, sort, requestId) {
|
|
|
46270
46323
|
const bVal = String(b4.id ?? "");
|
|
46271
46324
|
return sort.order === "ASC" ? aVal.localeCompare(bVal) : bVal.localeCompare(aVal);
|
|
46272
46325
|
});
|
|
46273
|
-
|
|
46326
|
+
logger5.info("ID $in query succeeded", {
|
|
46274
46327
|
requestId,
|
|
46275
46328
|
resource,
|
|
46276
46329
|
requestedCount: targetIds.length,
|
|
@@ -46346,7 +46399,7 @@ async function executeAllRecordsQuery(resource, sort, perPage, nextToken, parsed
|
|
|
46346
46399
|
queryResult.LastEvaluatedKey.PK,
|
|
46347
46400
|
queryResult.LastEvaluatedKey.SK
|
|
46348
46401
|
) : void 0;
|
|
46349
|
-
|
|
46402
|
+
logger5.info("ID all records query succeeded", {
|
|
46350
46403
|
requestId,
|
|
46351
46404
|
resource,
|
|
46352
46405
|
count: items.length,
|
|
@@ -46378,14 +46431,24 @@ async function executeAllRecordsQueryFullScan(resource, sort, perPage, nextToken
|
|
|
46378
46431
|
let iterations = 0;
|
|
46379
46432
|
let previousKeySignature;
|
|
46380
46433
|
let chunkSize = SCAN_CHUNK_INITIAL;
|
|
46434
|
+
const watcher = new ScanWatcher({
|
|
46435
|
+
requestId,
|
|
46436
|
+
resource,
|
|
46437
|
+
path: "id-filtered-scan",
|
|
46438
|
+
sortField: sort.field,
|
|
46439
|
+
filters: parsedFilters.map((f4) => `${f4.parsed.field}:${f4.parsed.operator}`)
|
|
46440
|
+
});
|
|
46381
46441
|
scan: while (true) {
|
|
46382
46442
|
if (++iterations > SCAN_MAX_ITERATIONS) {
|
|
46383
|
-
|
|
46443
|
+
logger5.error("executeAllRecordsQueryFullScan: \u6700\u5927\u53CD\u5FA9\u56DE\u6570\u3092\u8D85\u904E", {
|
|
46384
46444
|
requestId,
|
|
46385
46445
|
resource,
|
|
46386
46446
|
iterations
|
|
46387
46447
|
});
|
|
46388
|
-
|
|
46448
|
+
throw new AppError("INTERNAL_ERROR" /* INTERNAL_ERROR */, "ID scan exceeded the iteration limit", 500, {
|
|
46449
|
+
resource,
|
|
46450
|
+
iterations
|
|
46451
|
+
});
|
|
46389
46452
|
}
|
|
46390
46453
|
const queryResult = await executeDynamoDBOperation(
|
|
46391
46454
|
() => dbClient2.send(
|
|
@@ -46406,6 +46469,7 @@ async function executeAllRecordsQueryFullScan(resource, sort, perPage, nextToken
|
|
|
46406
46469
|
"Query"
|
|
46407
46470
|
);
|
|
46408
46471
|
costTracker.add(queryResult.ConsumedCapacity);
|
|
46472
|
+
watcher.add((queryResult.Items || []).length);
|
|
46409
46473
|
for (const row of queryResult.Items || []) {
|
|
46410
46474
|
scanned++;
|
|
46411
46475
|
if (!matchesAllFilters(extractCleanRecord(row), parsedFilters)) {
|
|
@@ -46424,19 +46488,24 @@ async function executeAllRecordsQueryFullScan(resource, sort, perPage, nextToken
|
|
|
46424
46488
|
}
|
|
46425
46489
|
const nextKeySignature = `${nextKey.PK}#${nextKey.SK}`;
|
|
46426
46490
|
if (nextKeySignature === previousKeySignature) {
|
|
46427
|
-
|
|
46491
|
+
logger5.error("executeAllRecordsQueryFullScan: \u540C\u4E00\u306ELastEvaluatedKey\u304C\u8FD4\u5374\u3055\u308C\u305F", {
|
|
46428
46492
|
requestId,
|
|
46429
46493
|
resource,
|
|
46430
46494
|
iterations
|
|
46431
46495
|
});
|
|
46432
|
-
|
|
46496
|
+
throw new AppError(
|
|
46497
|
+
"INTERNAL_ERROR" /* INTERNAL_ERROR */,
|
|
46498
|
+
"ID scan received the same LastEvaluatedKey repeatedly",
|
|
46499
|
+
500,
|
|
46500
|
+
{ resource, iterations }
|
|
46501
|
+
);
|
|
46433
46502
|
}
|
|
46434
46503
|
previousKeySignature = nextKeySignature;
|
|
46435
46504
|
exclusiveStartKey = nextKey;
|
|
46436
46505
|
chunkSize = Math.min(chunkSize * 2, SCAN_CHUNK_MAX);
|
|
46437
46506
|
}
|
|
46438
46507
|
const nextTokenValue = hasNextPage && lastReturned ? encodeNextToken(lastReturned.PK, lastReturned.SK) : void 0;
|
|
46439
|
-
|
|
46508
|
+
logger5.info("ID filtered scan query succeeded", {
|
|
46440
46509
|
requestId,
|
|
46441
46510
|
resource,
|
|
46442
46511
|
scanned,
|
|
@@ -46450,7 +46519,7 @@ async function executeAllRecordsQueryFullScan(resource, sort, perPage, nextToken
|
|
|
46450
46519
|
consumedCapacity: costTracker.getAggregated()
|
|
46451
46520
|
};
|
|
46452
46521
|
}
|
|
46453
|
-
var import_lib_dynamodb2,
|
|
46522
|
+
var import_lib_dynamodb2, logger5, SCAN_CHUNK_INITIAL, SCAN_CHUNK_MAX, SCAN_MAX_ITERATIONS;
|
|
46454
46523
|
var init_idQuery = __esm({
|
|
46455
46524
|
"src/server/operations/find/idQuery.ts"() {
|
|
46456
46525
|
"use strict";
|
|
@@ -46459,8 +46528,9 @@ var init_idQuery = __esm({
|
|
|
46459
46528
|
init_cost_tracker();
|
|
46460
46529
|
init_dynamodb3();
|
|
46461
46530
|
init_pagination();
|
|
46531
|
+
init_scanWarning();
|
|
46462
46532
|
init_utils5();
|
|
46463
|
-
|
|
46533
|
+
logger5 = createLogger({
|
|
46464
46534
|
service: "id-query",
|
|
46465
46535
|
level: process.env.LOG_LEVEL || "info"
|
|
46466
46536
|
});
|
|
@@ -46477,7 +46547,7 @@ var init_idQuery = __esm({
|
|
|
46477
46547
|
|
|
46478
46548
|
// src/server/operations/find/nearQuery.ts
|
|
46479
46549
|
async function executeNearQuery(resource, fieldName, nearQuery, limit, requestId) {
|
|
46480
|
-
|
|
46550
|
+
logger6.debug("Executing $near query", {
|
|
46481
46551
|
requestId,
|
|
46482
46552
|
resource,
|
|
46483
46553
|
fieldName,
|
|
@@ -46488,7 +46558,7 @@ async function executeNearQuery(resource, fieldName, nearQuery, limit, requestId
|
|
|
46488
46558
|
const searchFunction = /* @__PURE__ */ __name(async (geohashPrefix) => {
|
|
46489
46559
|
const dbClient2 = getDBClient();
|
|
46490
46560
|
const tableName = getTableName();
|
|
46491
|
-
|
|
46561
|
+
logger6.debug("Searching shadow records", {
|
|
46492
46562
|
requestId,
|
|
46493
46563
|
resource,
|
|
46494
46564
|
fieldName,
|
|
@@ -46513,7 +46583,7 @@ async function executeNearQuery(resource, fieldName, nearQuery, limit, requestId
|
|
|
46513
46583
|
);
|
|
46514
46584
|
costTracker.add(queryResult.ConsumedCapacity);
|
|
46515
46585
|
const shadowRecords = queryResult.Items || [];
|
|
46516
|
-
|
|
46586
|
+
logger6.debug("Shadow records found", {
|
|
46517
46587
|
requestId,
|
|
46518
46588
|
resource,
|
|
46519
46589
|
geohashPrefix,
|
|
@@ -46524,7 +46594,7 @@ async function executeNearQuery(resource, fieldName, nearQuery, limit, requestId
|
|
|
46524
46594
|
const parts = sk.split("#id#");
|
|
46525
46595
|
return parts.length === 2 ? parts[1] : null;
|
|
46526
46596
|
}).filter((id) => id !== null);
|
|
46527
|
-
|
|
46597
|
+
logger6.debug("Main record IDs extracted", {
|
|
46528
46598
|
requestId,
|
|
46529
46599
|
resource,
|
|
46530
46600
|
geohashPrefix,
|
|
@@ -46558,14 +46628,14 @@ async function executeNearQuery(resource, fieldName, nearQuery, limit, requestId
|
|
|
46558
46628
|
}
|
|
46559
46629
|
validRecords.push(...batchGetResult.Responses?.[tableName] || []);
|
|
46560
46630
|
}
|
|
46561
|
-
|
|
46631
|
+
logger6.debug("Main records retrieved", {
|
|
46562
46632
|
requestId,
|
|
46563
46633
|
resource,
|
|
46564
46634
|
geohashPrefix,
|
|
46565
46635
|
count: validRecords.length
|
|
46566
46636
|
});
|
|
46567
46637
|
const cleanRecords = validRecords.map((record) => extractCleanRecord(record));
|
|
46568
|
-
|
|
46638
|
+
logger6.debug("Clean records extracted", {
|
|
46569
46639
|
requestId,
|
|
46570
46640
|
resource,
|
|
46571
46641
|
geohashPrefix,
|
|
@@ -46584,7 +46654,7 @@ async function executeNearQuery(resource, fieldName, nearQuery, limit, requestId
|
|
|
46584
46654
|
config
|
|
46585
46655
|
);
|
|
46586
46656
|
const items = result.documents;
|
|
46587
|
-
|
|
46657
|
+
logger6.info("$near query succeeded", {
|
|
46588
46658
|
requestId,
|
|
46589
46659
|
resource,
|
|
46590
46660
|
fieldName,
|
|
@@ -46602,7 +46672,7 @@ async function executeNearQuery(resource, fieldName, nearQuery, limit, requestId
|
|
|
46602
46672
|
consumedCapacity: costTracker.getAggregated()
|
|
46603
46673
|
};
|
|
46604
46674
|
}
|
|
46605
|
-
var import_lib_dynamodb3,
|
|
46675
|
+
var import_lib_dynamodb3, logger6;
|
|
46606
46676
|
var init_nearQuery = __esm({
|
|
46607
46677
|
"src/server/operations/find/nearQuery.ts"() {
|
|
46608
46678
|
"use strict";
|
|
@@ -46612,7 +46682,7 @@ var init_nearQuery = __esm({
|
|
|
46612
46682
|
init_nearSearch();
|
|
46613
46683
|
init_cost_tracker();
|
|
46614
46684
|
init_dynamodb3();
|
|
46615
|
-
|
|
46685
|
+
logger6 = createLogger({
|
|
46616
46686
|
service: "near-query",
|
|
46617
46687
|
level: process.env.LOG_LEVEL || "info"
|
|
46618
46688
|
});
|
|
@@ -46642,7 +46712,7 @@ async function executeShadowQuery(resource, normalizedParams, requestId) {
|
|
|
46642
46712
|
(f4) => !(isKeyConditionOptimized && f4 === optimizableFilter)
|
|
46643
46713
|
);
|
|
46644
46714
|
if (residualFilters.length > 0) {
|
|
46645
|
-
|
|
46715
|
+
logger7.debug("Residual filters detected, falling back to full scan", {
|
|
46646
46716
|
requestId,
|
|
46647
46717
|
resource,
|
|
46648
46718
|
sortField: sort.field,
|
|
@@ -46650,7 +46720,7 @@ async function executeShadowQuery(resource, normalizedParams, requestId) {
|
|
|
46650
46720
|
});
|
|
46651
46721
|
return executeFullScanQuery(resource, normalizedParams, costTracker, requestId);
|
|
46652
46722
|
}
|
|
46653
|
-
|
|
46723
|
+
logger7.debug("Executing shadow query", {
|
|
46654
46724
|
requestId,
|
|
46655
46725
|
resource,
|
|
46656
46726
|
sortField: sort.field,
|
|
@@ -46698,7 +46768,7 @@ async function executeShadowQuery(resource, normalizedParams, requestId) {
|
|
|
46698
46768
|
shadowRecords.LastEvaluatedKey.PK,
|
|
46699
46769
|
shadowRecords.LastEvaluatedKey.SK
|
|
46700
46770
|
) : void 0;
|
|
46701
|
-
|
|
46771
|
+
logger7.info("Shadow query succeeded", {
|
|
46702
46772
|
requestId,
|
|
46703
46773
|
resource,
|
|
46704
46774
|
sortField: sort.field,
|
|
@@ -46723,7 +46793,7 @@ async function executeFilterFirstQuery(resource, normalizedParams, filterCandida
|
|
|
46723
46793
|
const offset = nextToken ? decodeOffsetToken(nextToken) ?? 0 : 0;
|
|
46724
46794
|
const filterSort = { field: filterCandidate.parsed.field, order: "ASC" };
|
|
46725
46795
|
const remainingFilters = parsedFilters.filter((f4) => f4 !== filterCandidate);
|
|
46726
|
-
|
|
46796
|
+
logger7.debug("Executing filter-first query", {
|
|
46727
46797
|
requestId,
|
|
46728
46798
|
resource,
|
|
46729
46799
|
filterField: filterCandidate.parsed.field,
|
|
@@ -46735,7 +46805,9 @@ async function executeFilterFirstQuery(resource, normalizedParams, filterCandida
|
|
|
46735
46805
|
filterSort,
|
|
46736
46806
|
filterCandidate,
|
|
46737
46807
|
costTracker,
|
|
46738
|
-
requestId
|
|
46808
|
+
requestId,
|
|
46809
|
+
"shadow-filter-first",
|
|
46810
|
+
parsedFilters
|
|
46739
46811
|
);
|
|
46740
46812
|
if (remainingFilters.length > 0) {
|
|
46741
46813
|
items = items.filter((r4) => matchesAllFilters(r4, remainingFilters));
|
|
@@ -46744,7 +46816,7 @@ async function executeFilterFirstQuery(resource, normalizedParams, filterCandida
|
|
|
46744
46816
|
const page = items.slice(offset, offset + perPage);
|
|
46745
46817
|
const hasNextPage = offset + perPage < items.length;
|
|
46746
46818
|
const nextTokenValue = hasNextPage ? encodeOffsetToken(offset + perPage) : void 0;
|
|
46747
|
-
|
|
46819
|
+
logger7.info("Filter-first query succeeded", {
|
|
46748
46820
|
requestId,
|
|
46749
46821
|
resource,
|
|
46750
46822
|
filterField: filterCandidate.parsed.field,
|
|
@@ -46765,20 +46837,28 @@ async function executeFullScanQuery(resource, normalizedParams, costTracker, req
|
|
|
46765
46837
|
const { sort, pagination, parsedFilters } = normalizedParams;
|
|
46766
46838
|
const { perPage, nextToken } = pagination;
|
|
46767
46839
|
const offset = nextToken ? decodeOffsetToken(nextToken) ?? 0 : 0;
|
|
46768
|
-
|
|
46840
|
+
logger7.debug("Executing full scan query", {
|
|
46769
46841
|
requestId,
|
|
46770
46842
|
resource,
|
|
46771
46843
|
sortField: sort.field,
|
|
46772
46844
|
offset
|
|
46773
46845
|
});
|
|
46774
|
-
let items = await fetchAllRecordsViaShadowIndex(
|
|
46846
|
+
let items = await fetchAllRecordsViaShadowIndex(
|
|
46847
|
+
resource,
|
|
46848
|
+
sort,
|
|
46849
|
+
void 0,
|
|
46850
|
+
costTracker,
|
|
46851
|
+
requestId,
|
|
46852
|
+
"shadow-full-scan",
|
|
46853
|
+
parsedFilters
|
|
46854
|
+
);
|
|
46775
46855
|
if (parsedFilters.length > 0) {
|
|
46776
46856
|
items = items.filter((r4) => matchesAllFilters(r4, parsedFilters));
|
|
46777
46857
|
}
|
|
46778
46858
|
const page = items.slice(offset, offset + perPage);
|
|
46779
46859
|
const hasNextPage = offset + perPage < items.length;
|
|
46780
46860
|
const nextTokenValue = hasNextPage ? encodeOffsetToken(offset + perPage) : void 0;
|
|
46781
|
-
|
|
46861
|
+
logger7.info("Full scan query succeeded", {
|
|
46782
46862
|
requestId,
|
|
46783
46863
|
resource,
|
|
46784
46864
|
sortField: sort.field,
|
|
@@ -46794,20 +46874,35 @@ async function executeFullScanQuery(resource, normalizedParams, costTracker, req
|
|
|
46794
46874
|
consumedCapacity: costTracker.getAggregated()
|
|
46795
46875
|
};
|
|
46796
46876
|
}
|
|
46797
|
-
async function fetchAllRecordsViaShadowIndex(resource, indexSort, indexFilter, costTracker, requestId) {
|
|
46877
|
+
async function fetchAllRecordsViaShadowIndex(resource, indexSort, indexFilter, costTracker, requestId, scanPath, parsedFilters) {
|
|
46798
46878
|
const allShadowItems = [];
|
|
46879
|
+
const watcher = new ScanWatcher({
|
|
46880
|
+
requestId,
|
|
46881
|
+
resource,
|
|
46882
|
+
path: scanPath,
|
|
46883
|
+
sortField: indexSort.field,
|
|
46884
|
+
filters: parsedFilters.map((f4) => `${f4.parsed.field}:${f4.parsed.operator}`)
|
|
46885
|
+
});
|
|
46799
46886
|
let lastKey;
|
|
46800
46887
|
let previousKeySignature;
|
|
46801
46888
|
const MAX_ITERATIONS = 1e4;
|
|
46802
46889
|
let iterations = 0;
|
|
46803
46890
|
do {
|
|
46804
46891
|
if (++iterations > MAX_ITERATIONS) {
|
|
46805
|
-
|
|
46892
|
+
logger7.error("fetchAllRecordsViaShadowIndex: \u6700\u5927\u53CD\u5FA9\u56DE\u6570\u3092\u8D85\u904E", {
|
|
46806
46893
|
requestId,
|
|
46807
46894
|
resource,
|
|
46808
46895
|
iterations
|
|
46809
46896
|
});
|
|
46810
|
-
|
|
46897
|
+
throw new AppError(
|
|
46898
|
+
"INTERNAL_ERROR" /* INTERNAL_ERROR */,
|
|
46899
|
+
"Shadow index scan exceeded the iteration limit",
|
|
46900
|
+
500,
|
|
46901
|
+
{
|
|
46902
|
+
resource,
|
|
46903
|
+
iterations
|
|
46904
|
+
}
|
|
46905
|
+
);
|
|
46811
46906
|
}
|
|
46812
46907
|
const result = await executeShadowRecordQuery(
|
|
46813
46908
|
resource,
|
|
@@ -46820,15 +46915,21 @@ async function fetchAllRecordsViaShadowIndex(resource, indexSort, indexFilter, c
|
|
|
46820
46915
|
requestId
|
|
46821
46916
|
);
|
|
46822
46917
|
allShadowItems.push(...result.Items || []);
|
|
46918
|
+
watcher.add((result.Items || []).length);
|
|
46823
46919
|
const nextKey = result.LastEvaluatedKey;
|
|
46824
46920
|
const nextKeySignature = nextKey ? `${nextKey.PK}#${nextKey.SK}` : void 0;
|
|
46825
46921
|
if (nextKeySignature && nextKeySignature === previousKeySignature) {
|
|
46826
|
-
|
|
46922
|
+
logger7.error("fetchAllRecordsViaShadowIndex: \u540C\u4E00\u306ELastEvaluatedKey\u304C\u8FD4\u5374\u3055\u308C\u305F", {
|
|
46827
46923
|
requestId,
|
|
46828
46924
|
resource,
|
|
46829
46925
|
iterations
|
|
46830
46926
|
});
|
|
46831
|
-
|
|
46927
|
+
throw new AppError(
|
|
46928
|
+
"INTERNAL_ERROR" /* INTERNAL_ERROR */,
|
|
46929
|
+
"Shadow index scan received the same LastEvaluatedKey repeatedly",
|
|
46930
|
+
500,
|
|
46931
|
+
{ resource, iterations }
|
|
46932
|
+
);
|
|
46832
46933
|
}
|
|
46833
46934
|
previousKeySignature = nextKeySignature;
|
|
46834
46935
|
lastKey = nextKey;
|
|
@@ -47034,7 +47135,7 @@ async function fetchMainRecords(resource, recordIds, costTracker, requestId) {
|
|
|
47034
47135
|
}
|
|
47035
47136
|
allRecords.push(...batchGetResult.Responses?.[tableName] || []);
|
|
47036
47137
|
}
|
|
47037
|
-
|
|
47138
|
+
logger7.debug("Main records fetched", {
|
|
47038
47139
|
requestId,
|
|
47039
47140
|
resource,
|
|
47040
47141
|
requestedCount: uniqueRecordIds.length,
|
|
@@ -47042,7 +47143,7 @@ async function fetchMainRecords(resource, recordIds, costTracker, requestId) {
|
|
|
47042
47143
|
});
|
|
47043
47144
|
return allRecords;
|
|
47044
47145
|
}
|
|
47045
|
-
var import_lib_dynamodb4,
|
|
47146
|
+
var import_lib_dynamodb4, logger7, KEY_CONDITION_OPERATORS;
|
|
47046
47147
|
var init_shadowQuery = __esm({
|
|
47047
47148
|
"src/server/operations/find/shadowQuery.ts"() {
|
|
47048
47149
|
"use strict";
|
|
@@ -47052,8 +47153,9 @@ var init_shadowQuery = __esm({
|
|
|
47052
47153
|
init_cost_tracker();
|
|
47053
47154
|
init_dynamodb3();
|
|
47054
47155
|
init_pagination();
|
|
47156
|
+
init_scanWarning();
|
|
47055
47157
|
init_utils5();
|
|
47056
|
-
|
|
47158
|
+
logger7 = createLogger({
|
|
47057
47159
|
service: "shadow-query",
|
|
47058
47160
|
level: process.env.LOG_LEVEL || "info"
|
|
47059
47161
|
});
|
|
@@ -47074,14 +47176,14 @@ var init_shadowQuery = __esm({
|
|
|
47074
47176
|
|
|
47075
47177
|
// src/server/operations/find/handler.ts
|
|
47076
47178
|
async function handleFind(resource, params, requestId) {
|
|
47077
|
-
|
|
47179
|
+
logger8.debug("Executing find", {
|
|
47078
47180
|
requestId,
|
|
47079
47181
|
resource,
|
|
47080
47182
|
params
|
|
47081
47183
|
});
|
|
47082
47184
|
const nearDetection = detectNearQuery(params.filter);
|
|
47083
47185
|
if (nearDetection) {
|
|
47084
|
-
|
|
47186
|
+
logger8.debug("$near operator detected, executing near search", {
|
|
47085
47187
|
requestId,
|
|
47086
47188
|
resource,
|
|
47087
47189
|
fieldName: nearDetection.fieldName
|
|
@@ -47098,7 +47200,7 @@ async function handleFind(resource, params, requestId) {
|
|
|
47098
47200
|
const config = initializeFindConfig();
|
|
47099
47201
|
const normalizedParams = normalizeFindParams(config, resource, params);
|
|
47100
47202
|
validateSortField(config, resource, normalizedParams.sort);
|
|
47101
|
-
|
|
47203
|
+
logger8.debug("Find parameters normalized", {
|
|
47102
47204
|
requestId,
|
|
47103
47205
|
resource,
|
|
47104
47206
|
sort: normalizedParams.sort,
|
|
@@ -47113,7 +47215,7 @@ async function handleFind(resource, params, requestId) {
|
|
|
47113
47215
|
}
|
|
47114
47216
|
return executeShadowQuery(resource, normalizedParams, requestId);
|
|
47115
47217
|
}
|
|
47116
|
-
var
|
|
47218
|
+
var logger8;
|
|
47117
47219
|
var init_handler = __esm({
|
|
47118
47220
|
"src/server/operations/find/handler.ts"() {
|
|
47119
47221
|
"use strict";
|
|
@@ -47123,7 +47225,7 @@ var init_handler = __esm({
|
|
|
47123
47225
|
init_nearQuery();
|
|
47124
47226
|
init_shadowQuery();
|
|
47125
47227
|
init_utils5();
|
|
47126
|
-
|
|
47228
|
+
logger8 = createLogger({
|
|
47127
47229
|
service: "find-handler",
|
|
47128
47230
|
level: process.env.LOG_LEVEL || "info"
|
|
47129
47231
|
});
|
|
@@ -47146,7 +47248,7 @@ var init_find = __esm({
|
|
|
47146
47248
|
// src/server/utils/bulkOperations.ts
|
|
47147
47249
|
function logLargeBatchWarning(operation2, recordCount, requestId, resource) {
|
|
47148
47250
|
if (recordCount > LARGE_BATCH_WARNING_THRESHOLD) {
|
|
47149
|
-
|
|
47251
|
+
logger10.warn(`Large batch ${operation2} operation detected`, {
|
|
47150
47252
|
requestId,
|
|
47151
47253
|
resource,
|
|
47152
47254
|
recordCount,
|
|
@@ -47169,7 +47271,7 @@ function calculateTimeoutRisk(startTime) {
|
|
|
47169
47271
|
};
|
|
47170
47272
|
}
|
|
47171
47273
|
function logPreparationTimeoutRisk(requestId, resource, totalRecords, chunkCount, riskInfo) {
|
|
47172
|
-
|
|
47274
|
+
logger10.info("Records prepared for chunk execution", {
|
|
47173
47275
|
requestId,
|
|
47174
47276
|
resource,
|
|
47175
47277
|
totalRecords,
|
|
@@ -47179,7 +47281,7 @@ function logPreparationTimeoutRisk(requestId, resource, totalRecords, chunkCount
|
|
|
47179
47281
|
timeoutRisk: riskInfo.risk
|
|
47180
47282
|
});
|
|
47181
47283
|
if (riskInfo.risk === "high") {
|
|
47182
|
-
|
|
47284
|
+
logger10.warn("High timeout risk detected during preparation phase", {
|
|
47183
47285
|
requestId,
|
|
47184
47286
|
resource,
|
|
47185
47287
|
preparationElapsedMs: riskInfo.elapsedMs,
|
|
@@ -47191,7 +47293,7 @@ function logPreparationTimeoutRisk(requestId, resource, totalRecords, chunkCount
|
|
|
47191
47293
|
}
|
|
47192
47294
|
function logBulkOperationComplete(operation2, requestId, resource, requested, succeeded, failed, riskInfo, additionalInfo) {
|
|
47193
47295
|
const totalElapsedSeconds = Math.round(riskInfo.elapsedMs / 1e3);
|
|
47194
|
-
|
|
47296
|
+
logger10.info(`${operation2} completed`, {
|
|
47195
47297
|
requestId,
|
|
47196
47298
|
resource,
|
|
47197
47299
|
requested,
|
|
@@ -47206,7 +47308,7 @@ function logBulkOperationComplete(operation2, requestId, resource, requested, su
|
|
|
47206
47308
|
}
|
|
47207
47309
|
function logPartialFailure(operation2, requestId, resource, requested, succeeded, failed, errorCodes, additionalInfo) {
|
|
47208
47310
|
const failureRate = Math.round(failed / requested * 100);
|
|
47209
|
-
|
|
47311
|
+
logger10.warn(`Partial failure in ${operation2} operation`, {
|
|
47210
47312
|
requestId,
|
|
47211
47313
|
resource,
|
|
47212
47314
|
totalRequested: requested,
|
|
@@ -47217,12 +47319,12 @@ function logPartialFailure(operation2, requestId, resource, requested, succeeded
|
|
|
47217
47319
|
...additionalInfo
|
|
47218
47320
|
});
|
|
47219
47321
|
}
|
|
47220
|
-
var
|
|
47322
|
+
var logger10;
|
|
47221
47323
|
var init_bulkOperations = __esm({
|
|
47222
47324
|
"src/server/utils/bulkOperations.ts"() {
|
|
47223
47325
|
"use strict";
|
|
47224
47326
|
init_shared();
|
|
47225
|
-
|
|
47327
|
+
logger10 = createLogger({ service: "records-lambda" });
|
|
47226
47328
|
__name(logLargeBatchWarning, "logLargeBatchWarning");
|
|
47227
47329
|
__name(calculateTimeoutRisk, "calculateTimeoutRisk");
|
|
47228
47330
|
__name(logPreparationTimeoutRisk, "logPreparationTimeoutRisk");
|
|
@@ -47241,7 +47343,7 @@ function calculateChunks(records, getItemCount) {
|
|
|
47241
47343
|
const itemCount = getItemCount(record);
|
|
47242
47344
|
if (itemCount > DYNAMODB_TRANSACT_WRITE_MAX_ITEMS) {
|
|
47243
47345
|
const errorMsg = `Single record exceeds ${DYNAMODB_TRANSACT_WRITE_MAX_ITEMS} items limit: ${itemCount} items`;
|
|
47244
|
-
|
|
47346
|
+
logger11.error("Chunk validation failed", {
|
|
47245
47347
|
itemCount,
|
|
47246
47348
|
limit: DYNAMODB_TRANSACT_WRITE_MAX_ITEMS
|
|
47247
47349
|
});
|
|
@@ -47263,7 +47365,7 @@ function calculateChunks(records, getItemCount) {
|
|
|
47263
47365
|
chunks.push(currentChunk);
|
|
47264
47366
|
itemCounts.push(currentItemCount);
|
|
47265
47367
|
}
|
|
47266
|
-
|
|
47368
|
+
logger11.info("Chunk calculation completed", {
|
|
47267
47369
|
totalRecords: records.length,
|
|
47268
47370
|
chunkCount: chunks.length,
|
|
47269
47371
|
itemCounts,
|
|
@@ -47279,7 +47381,7 @@ async function executeChunks(chunks, executeChunk, getRecordId) {
|
|
|
47279
47381
|
const errors = [];
|
|
47280
47382
|
const totalRecords = chunks.reduce((sum, chunk) => sum + chunk.length, 0);
|
|
47281
47383
|
const executionStartTime = Date.now();
|
|
47282
|
-
|
|
47384
|
+
logger11.info("Starting chunk execution", {
|
|
47283
47385
|
totalChunks: chunks.length,
|
|
47284
47386
|
totalRecords
|
|
47285
47387
|
});
|
|
@@ -47287,14 +47389,14 @@ async function executeChunks(chunks, executeChunk, getRecordId) {
|
|
|
47287
47389
|
const chunk = chunks[i4];
|
|
47288
47390
|
const chunkStartTime = Date.now();
|
|
47289
47391
|
try {
|
|
47290
|
-
|
|
47392
|
+
logger11.debug(`Executing chunk ${i4 + 1}/${chunks.length}`, {
|
|
47291
47393
|
chunkIndex: i4,
|
|
47292
47394
|
recordCount: chunk.length
|
|
47293
47395
|
});
|
|
47294
47396
|
const successfulRecords = await executeChunk(chunk);
|
|
47295
47397
|
successRecords.push(...successfulRecords);
|
|
47296
47398
|
const chunkDuration = Date.now() - chunkStartTime;
|
|
47297
|
-
|
|
47399
|
+
logger11.info(`Chunk ${i4 + 1}/${chunks.length} succeeded`, {
|
|
47298
47400
|
chunkIndex: i4,
|
|
47299
47401
|
recordCount: chunk.length,
|
|
47300
47402
|
durationMs: chunkDuration
|
|
@@ -47303,7 +47405,7 @@ async function executeChunks(chunks, executeChunk, getRecordId) {
|
|
|
47303
47405
|
const chunkDuration = Date.now() - chunkStartTime;
|
|
47304
47406
|
const errorMessage = error2 instanceof Error ? error2.message : "Unknown error";
|
|
47305
47407
|
const errorCode = getErrorCode(error2);
|
|
47306
|
-
|
|
47408
|
+
logger11.error(`Chunk ${i4 + 1}/${chunks.length} failed`, {
|
|
47307
47409
|
chunkIndex: i4,
|
|
47308
47410
|
recordCount: chunk.length,
|
|
47309
47411
|
durationMs: chunkDuration,
|
|
@@ -47322,7 +47424,7 @@ async function executeChunks(chunks, executeChunk, getRecordId) {
|
|
|
47322
47424
|
}
|
|
47323
47425
|
}
|
|
47324
47426
|
const totalExecutionTime = Date.now() - executionStartTime;
|
|
47325
|
-
|
|
47427
|
+
logger11.info("Chunk execution completed", {
|
|
47326
47428
|
totalChunks: chunks.length,
|
|
47327
47429
|
totalRecords,
|
|
47328
47430
|
successCount: successRecords.length,
|
|
@@ -47331,7 +47433,7 @@ async function executeChunks(chunks, executeChunk, getRecordId) {
|
|
|
47331
47433
|
avgTimePerChunkMs: chunks.length > 0 ? Math.round(totalExecutionTime / chunks.length) : 0
|
|
47332
47434
|
});
|
|
47333
47435
|
if (failedIds.length > 0) {
|
|
47334
|
-
|
|
47436
|
+
logger11.warn("Partial failure detected in chunk execution", {
|
|
47335
47437
|
totalRecords,
|
|
47336
47438
|
successCount: successRecords.length,
|
|
47337
47439
|
failedCount: failedIds.length,
|
|
@@ -47363,12 +47465,12 @@ function getErrorCode(error2) {
|
|
|
47363
47465
|
}
|
|
47364
47466
|
return "TRANSACTION_FAILED";
|
|
47365
47467
|
}
|
|
47366
|
-
var
|
|
47468
|
+
var logger11;
|
|
47367
47469
|
var init_chunking = __esm({
|
|
47368
47470
|
"src/server/utils/chunking.ts"() {
|
|
47369
47471
|
"use strict";
|
|
47370
47472
|
init_shared();
|
|
47371
|
-
|
|
47473
|
+
logger11 = createLogger({ service: "records-lambda" });
|
|
47372
47474
|
__name(calculateChunks, "calculateChunks");
|
|
47373
47475
|
__name(executeChunks, "executeChunks");
|
|
47374
47476
|
__name(getErrorCode, "getErrorCode");
|
|
@@ -47539,7 +47641,7 @@ async function handleUpdateMany(resource, params, requestId) {
|
|
|
47539
47641
|
const upsert = options?.upsert ?? false;
|
|
47540
47642
|
const startTime = Date.now();
|
|
47541
47643
|
const costTracker = new CostTracker();
|
|
47542
|
-
|
|
47644
|
+
logger12.debug("Executing updateMany", {
|
|
47543
47645
|
requestId,
|
|
47544
47646
|
resource,
|
|
47545
47647
|
upsert
|
|
@@ -47547,13 +47649,13 @@ async function handleUpdateMany(resource, params, requestId) {
|
|
|
47547
47649
|
let ids;
|
|
47548
47650
|
if ("ids" in params) {
|
|
47549
47651
|
ids = params.ids;
|
|
47550
|
-
|
|
47652
|
+
logger12.debug("Executing updateMany with ids", {
|
|
47551
47653
|
requestId,
|
|
47552
47654
|
resource,
|
|
47553
47655
|
count: ids.length
|
|
47554
47656
|
});
|
|
47555
47657
|
} else {
|
|
47556
|
-
|
|
47658
|
+
logger12.debug("Executing updateMany with filter", {
|
|
47557
47659
|
requestId,
|
|
47558
47660
|
resource,
|
|
47559
47661
|
filter: params.filter
|
|
@@ -47561,7 +47663,7 @@ async function handleUpdateMany(resource, params, requestId) {
|
|
|
47561
47663
|
const { handleFind: handleFind2 } = await Promise.resolve().then(() => (init_find(), find_exports));
|
|
47562
47664
|
const findResult = await handleFind2(resource, { filter: params.filter }, requestId);
|
|
47563
47665
|
ids = findResult.items.map((item) => item.id);
|
|
47564
|
-
|
|
47666
|
+
logger12.debug("Found records with filter", {
|
|
47565
47667
|
requestId,
|
|
47566
47668
|
resource,
|
|
47567
47669
|
count: ids.length
|
|
@@ -47570,7 +47672,7 @@ async function handleUpdateMany(resource, params, requestId) {
|
|
|
47570
47672
|
if (upsert) {
|
|
47571
47673
|
const newId = ulid2();
|
|
47572
47674
|
ids = [newId];
|
|
47573
|
-
|
|
47675
|
+
logger12.info("Creating new record with filter (upsert: true)", {
|
|
47574
47676
|
requestId,
|
|
47575
47677
|
resource,
|
|
47576
47678
|
newId,
|
|
@@ -47634,7 +47736,7 @@ async function handleUpdateMany(resource, params, requestId) {
|
|
|
47634
47736
|
);
|
|
47635
47737
|
const notFoundIds = ids.filter((id) => !existingIds.has(id));
|
|
47636
47738
|
if (!upsert && notFoundIds.length > 0) {
|
|
47637
|
-
|
|
47739
|
+
logger12.warn("Records not found (upsert: false)", {
|
|
47638
47740
|
requestId,
|
|
47639
47741
|
resource,
|
|
47640
47742
|
notFoundCount: notFoundIds.length,
|
|
@@ -47643,7 +47745,7 @@ async function handleUpdateMany(resource, params, requestId) {
|
|
|
47643
47745
|
});
|
|
47644
47746
|
}
|
|
47645
47747
|
if (upsert && notFoundIds.length > 0) {
|
|
47646
|
-
|
|
47748
|
+
logger12.info("Creating new records (upsert: true)", {
|
|
47647
47749
|
requestId,
|
|
47648
47750
|
resource,
|
|
47649
47751
|
notFoundCount: notFoundIds.length,
|
|
@@ -47679,7 +47781,7 @@ async function handleUpdateMany(resource, params, requestId) {
|
|
|
47679
47781
|
const failedId = existingData.id || "unknown-id";
|
|
47680
47782
|
const errorMessage = error2 instanceof Error ? error2.message : "Unknown preparation error";
|
|
47681
47783
|
const errorCode = getPreparationErrorCode(error2);
|
|
47682
|
-
|
|
47784
|
+
logger12.error("Failed to prepare record for update", {
|
|
47683
47785
|
requestId,
|
|
47684
47786
|
recordId: failedId,
|
|
47685
47787
|
error: errorMessage,
|
|
@@ -47719,7 +47821,7 @@ async function handleUpdateMany(resource, params, requestId) {
|
|
|
47719
47821
|
} catch (error2) {
|
|
47720
47822
|
const errorMessage = error2 instanceof Error ? error2.message : "Unknown preparation error";
|
|
47721
47823
|
const errorCode = getPreparationErrorCode(error2);
|
|
47722
|
-
|
|
47824
|
+
logger12.error("Failed to prepare new record for upsert", {
|
|
47723
47825
|
requestId,
|
|
47724
47826
|
recordId: id,
|
|
47725
47827
|
error: errorMessage,
|
|
@@ -47932,7 +48034,7 @@ function getPreparationErrorCode(error2) {
|
|
|
47932
48034
|
}
|
|
47933
48035
|
return "VALIDATION_ERROR" /* VALIDATION_ERROR */;
|
|
47934
48036
|
}
|
|
47935
|
-
var import_lib_dynamodb6,
|
|
48037
|
+
var import_lib_dynamodb6, logger12;
|
|
47936
48038
|
var init_updateMany = __esm({
|
|
47937
48039
|
"src/server/operations/updateMany.ts"() {
|
|
47938
48040
|
"use strict";
|
|
@@ -47946,7 +48048,7 @@ var init_updateMany = __esm({
|
|
|
47946
48048
|
init_dynamodb3();
|
|
47947
48049
|
init_mergePatch();
|
|
47948
48050
|
init_timestamps();
|
|
47949
|
-
|
|
48051
|
+
logger12 = createLogger({ service: "records-lambda" });
|
|
47950
48052
|
__name(handleUpdateMany, "handleUpdateMany");
|
|
47951
48053
|
__name(getPreparationErrorCode, "getPreparationErrorCode");
|
|
47952
48054
|
}
|
|
@@ -47989,11 +48091,11 @@ init_shared();
|
|
|
47989
48091
|
init_shadow();
|
|
47990
48092
|
init_dynamodb3();
|
|
47991
48093
|
init_find();
|
|
47992
|
-
var
|
|
48094
|
+
var logger9 = createLogger({ service: "records-lambda" });
|
|
47993
48095
|
async function handleFindMany(resource, params, requestId) {
|
|
47994
48096
|
if ("ids" in params) {
|
|
47995
48097
|
const { ids } = params;
|
|
47996
|
-
|
|
48098
|
+
logger9.debug("Executing findMany by ids", {
|
|
47997
48099
|
requestId,
|
|
47998
48100
|
resource,
|
|
47999
48101
|
count: ids.length
|
|
@@ -48022,7 +48124,7 @@ async function handleFindMany(resource, params, requestId) {
|
|
|
48022
48124
|
);
|
|
48023
48125
|
const items = result.Responses?.[tableName] || [];
|
|
48024
48126
|
const records = items.map((item) => extractCleanRecord(item));
|
|
48025
|
-
|
|
48127
|
+
logger9.info("findMany by ids succeeded", {
|
|
48026
48128
|
requestId,
|
|
48027
48129
|
resource,
|
|
48028
48130
|
requested: ids.length,
|
|
@@ -48032,7 +48134,7 @@ async function handleFindMany(resource, params, requestId) {
|
|
|
48032
48134
|
}
|
|
48033
48135
|
if ("filter" in params) {
|
|
48034
48136
|
const { filter } = params;
|
|
48035
|
-
|
|
48137
|
+
logger9.debug("Executing findMany by filter", {
|
|
48036
48138
|
requestId,
|
|
48037
48139
|
resource,
|
|
48038
48140
|
filter
|
|
@@ -48044,7 +48146,7 @@ async function handleFindMany(resource, params, requestId) {
|
|
|
48044
48146
|
},
|
|
48045
48147
|
requestId
|
|
48046
48148
|
);
|
|
48047
|
-
|
|
48149
|
+
logger9.info("findMany by filter succeeded", {
|
|
48048
48150
|
requestId,
|
|
48049
48151
|
resource,
|
|
48050
48152
|
filter,
|
|
@@ -48058,13 +48160,13 @@ __name(handleFindMany, "handleFindMany");
|
|
|
48058
48160
|
|
|
48059
48161
|
// src/server/operations/updateOne.ts
|
|
48060
48162
|
init_shared();
|
|
48061
|
-
var
|
|
48163
|
+
var logger13 = createLogger({ service: "records-lambda" });
|
|
48062
48164
|
async function handleUpdateOne(resource, params, requestId) {
|
|
48063
48165
|
const { data: patchData, options } = params;
|
|
48064
48166
|
const { handleUpdateMany: handleUpdateMany2 } = await Promise.resolve().then(() => (init_updateMany(), updateMany_exports));
|
|
48065
48167
|
if ("id" in params) {
|
|
48066
48168
|
const targetId = params.id;
|
|
48067
|
-
|
|
48169
|
+
logger13.debug("Executing updateOne with id", {
|
|
48068
48170
|
requestId,
|
|
48069
48171
|
resource,
|
|
48070
48172
|
id: targetId,
|
|
@@ -48106,7 +48208,7 @@ async function handleUpdateOne(resource, params, requestId) {
|
|
|
48106
48208
|
consumedCapacity: updateManyResult.consumedCapacity
|
|
48107
48209
|
};
|
|
48108
48210
|
} else {
|
|
48109
|
-
|
|
48211
|
+
logger13.debug("Executing updateOne with filter", {
|
|
48110
48212
|
requestId,
|
|
48111
48213
|
resource,
|
|
48112
48214
|
filter: params.filter,
|
|
@@ -48156,7 +48258,7 @@ async function handleUpdateOne(resource, params, requestId) {
|
|
|
48156
48258
|
__name(handleUpdateOne, "handleUpdateOne");
|
|
48157
48259
|
|
|
48158
48260
|
// src/server/media/process-handler-dlq.ts
|
|
48159
|
-
var
|
|
48261
|
+
var logger14 = createLogger({ service: "media-process-handler-dlq" });
|
|
48160
48262
|
var s3Client = new import_client_s3.S3Client({ region: process.env.AWS_REGION });
|
|
48161
48263
|
function extractS3Ref(envelope) {
|
|
48162
48264
|
const record = envelope.requestPayload?.Records?.[0];
|
|
@@ -48172,12 +48274,12 @@ async function processMessage(body) {
|
|
|
48172
48274
|
try {
|
|
48173
48275
|
envelope = JSON.parse(body);
|
|
48174
48276
|
} catch {
|
|
48175
|
-
|
|
48277
|
+
logger14.error("DLQ message is not valid JSON", { body });
|
|
48176
48278
|
return;
|
|
48177
48279
|
}
|
|
48178
48280
|
const ref = extractS3Ref(envelope);
|
|
48179
48281
|
if (!ref) {
|
|
48180
|
-
|
|
48282
|
+
logger14.error("Could not extract S3 reference from DLQ message", { envelope });
|
|
48181
48283
|
return;
|
|
48182
48284
|
}
|
|
48183
48285
|
const { bucket, key, fileId } = ref;
|
|
@@ -48185,7 +48287,7 @@ async function processMessage(body) {
|
|
|
48185
48287
|
const existing = await handleFindMany("media", { ids: [fileId] }, requestId);
|
|
48186
48288
|
const existingRecord = existing[0];
|
|
48187
48289
|
if (existingRecord?.status === "completed") {
|
|
48188
|
-
|
|
48290
|
+
logger14.info("Media already completed, skipping DLQ failure write", { requestId, fileId });
|
|
48189
48291
|
return;
|
|
48190
48292
|
}
|
|
48191
48293
|
let appMetadata = {};
|
|
@@ -48196,7 +48298,7 @@ async function processMessage(body) {
|
|
|
48196
48298
|
appMetadata = extractAppMetadata(metadata);
|
|
48197
48299
|
originalFilename = decodeOriginalFilename(metadata["original-filename"]);
|
|
48198
48300
|
} catch (error2) {
|
|
48199
|
-
|
|
48301
|
+
logger14.warn("Failed to re-fetch metadata for DLQ failure record", {
|
|
48200
48302
|
requestId,
|
|
48201
48303
|
fileId,
|
|
48202
48304
|
error: error2 instanceof Error ? error2.message : String(error2)
|
|
@@ -48221,7 +48323,7 @@ async function processMessage(body) {
|
|
|
48221
48323
|
},
|
|
48222
48324
|
requestId
|
|
48223
48325
|
);
|
|
48224
|
-
|
|
48326
|
+
logger14.warn("Media marked as failed via DLQ", { requestId, fileId });
|
|
48225
48327
|
}
|
|
48226
48328
|
__name(processMessage, "processMessage");
|
|
48227
48329
|
var handler = /* @__PURE__ */ __name(async (event) => {
|