@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");
|
|
@@ -58394,6 +58394,59 @@ var init_pagination = __esm({
|
|
|
58394
58394
|
}
|
|
58395
58395
|
});
|
|
58396
58396
|
|
|
58397
|
+
// src/server/utils/scanWarning.ts
|
|
58398
|
+
function getScanWarnThreshold() {
|
|
58399
|
+
const raw = process.env.SCAN_WARN_THRESHOLD;
|
|
58400
|
+
if (raw === void 0 || raw === "") {
|
|
58401
|
+
return DEFAULT_SCAN_WARN_THRESHOLD;
|
|
58402
|
+
}
|
|
58403
|
+
const value = Number(raw);
|
|
58404
|
+
return Number.isInteger(value) && value >= 1 ? value : DEFAULT_SCAN_WARN_THRESHOLD;
|
|
58405
|
+
}
|
|
58406
|
+
var logger3, SPARSE_SCAN_EVENT, DEFAULT_SCAN_WARN_THRESHOLD, ScanWatcher;
|
|
58407
|
+
var init_scanWarning = __esm({
|
|
58408
|
+
"src/server/utils/scanWarning.ts"() {
|
|
58409
|
+
"use strict";
|
|
58410
|
+
init_shared();
|
|
58411
|
+
logger3 = createLogger({ service: "scan-warning", level: "warn" });
|
|
58412
|
+
SPARSE_SCAN_EVENT = "SPARSE_SCAN";
|
|
58413
|
+
DEFAULT_SCAN_WARN_THRESHOLD = 5e3;
|
|
58414
|
+
__name(getScanWarnThreshold, "getScanWarnThreshold");
|
|
58415
|
+
ScanWatcher = class {
|
|
58416
|
+
constructor(context) {
|
|
58417
|
+
this.context = context;
|
|
58418
|
+
}
|
|
58419
|
+
static {
|
|
58420
|
+
__name(this, "ScanWatcher");
|
|
58421
|
+
}
|
|
58422
|
+
scanned = 0;
|
|
58423
|
+
warned = false;
|
|
58424
|
+
threshold = getScanWarnThreshold();
|
|
58425
|
+
/** 読んだ件数を加える */
|
|
58426
|
+
add(count) {
|
|
58427
|
+
this.scanned += count;
|
|
58428
|
+
if (!this.warned && this.scanned >= this.threshold) {
|
|
58429
|
+
this.warned = true;
|
|
58430
|
+
logger3.warn(
|
|
58431
|
+
`${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`,
|
|
58432
|
+
{
|
|
58433
|
+
event: SPARSE_SCAN_EVENT,
|
|
58434
|
+
...this.context,
|
|
58435
|
+
scanned: this.scanned,
|
|
58436
|
+
threshold: this.threshold,
|
|
58437
|
+
actions: [
|
|
58438
|
+
"\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",
|
|
58439
|
+
"\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",
|
|
58440
|
+
"\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"
|
|
58441
|
+
]
|
|
58442
|
+
}
|
|
58443
|
+
);
|
|
58444
|
+
}
|
|
58445
|
+
}
|
|
58446
|
+
};
|
|
58447
|
+
}
|
|
58448
|
+
});
|
|
58449
|
+
|
|
58397
58450
|
// src/server/utils/filter.ts
|
|
58398
58451
|
function parseFilterField(fieldKey) {
|
|
58399
58452
|
const parts = fieldKey.split(":");
|
|
@@ -58482,7 +58535,7 @@ function parseFilters(filter) {
|
|
|
58482
58535
|
parsedFilters.push({ parsed, value });
|
|
58483
58536
|
}
|
|
58484
58537
|
} catch (error2) {
|
|
58485
|
-
|
|
58538
|
+
logger4.error("Invalid filter field syntax", {
|
|
58486
58539
|
fieldKey,
|
|
58487
58540
|
error: error2 instanceof Error ? error2.message : String(error2)
|
|
58488
58541
|
});
|
|
@@ -58551,7 +58604,7 @@ function detectNearQuery(filter) {
|
|
|
58551
58604
|
}
|
|
58552
58605
|
return null;
|
|
58553
58606
|
}
|
|
58554
|
-
var
|
|
58607
|
+
var logger4;
|
|
58555
58608
|
var init_utils5 = __esm({
|
|
58556
58609
|
"src/server/operations/find/utils.ts"() {
|
|
58557
58610
|
"use strict";
|
|
@@ -58560,7 +58613,7 @@ var init_utils5 = __esm({
|
|
|
58560
58613
|
init_shadow();
|
|
58561
58614
|
init_filter();
|
|
58562
58615
|
init_validation2();
|
|
58563
|
-
|
|
58616
|
+
logger4 = createLogger({
|
|
58564
58617
|
service: "find-utils",
|
|
58565
58618
|
level: process.env.LOG_LEVEL || "info"
|
|
58566
58619
|
});
|
|
@@ -58577,7 +58630,7 @@ var init_utils5 = __esm({
|
|
|
58577
58630
|
async function executeIdQuery(resource, normalizedParams, requestId) {
|
|
58578
58631
|
const { sort, pagination, parsedFilters } = normalizedParams;
|
|
58579
58632
|
const { perPage, nextToken } = pagination;
|
|
58580
|
-
|
|
58633
|
+
logger5.debug("Executing ID optimized query", {
|
|
58581
58634
|
requestId,
|
|
58582
58635
|
resource,
|
|
58583
58636
|
sort,
|
|
@@ -58614,7 +58667,7 @@ async function executeSpecificIdQuery(resource, targetId, requestId) {
|
|
|
58614
58667
|
costTracker.add(queryResult.ConsumedCapacity);
|
|
58615
58668
|
const mainRecords = queryResult.Items || [];
|
|
58616
58669
|
const items = mainRecords.map((item) => extractCleanRecord(item));
|
|
58617
|
-
|
|
58670
|
+
logger5.info("ID specific query succeeded", {
|
|
58618
58671
|
requestId,
|
|
58619
58672
|
resource,
|
|
58620
58673
|
targetId,
|
|
@@ -58661,7 +58714,7 @@ async function executeInQuery(resource, targetIds, sort, requestId) {
|
|
|
58661
58714
|
const bVal = String(b4.id ?? "");
|
|
58662
58715
|
return sort.order === "ASC" ? aVal.localeCompare(bVal) : bVal.localeCompare(aVal);
|
|
58663
58716
|
});
|
|
58664
|
-
|
|
58717
|
+
logger5.info("ID $in query succeeded", {
|
|
58665
58718
|
requestId,
|
|
58666
58719
|
resource,
|
|
58667
58720
|
requestedCount: targetIds.length,
|
|
@@ -58737,7 +58790,7 @@ async function executeAllRecordsQuery(resource, sort, perPage, nextToken, parsed
|
|
|
58737
58790
|
queryResult.LastEvaluatedKey.PK,
|
|
58738
58791
|
queryResult.LastEvaluatedKey.SK
|
|
58739
58792
|
) : void 0;
|
|
58740
|
-
|
|
58793
|
+
logger5.info("ID all records query succeeded", {
|
|
58741
58794
|
requestId,
|
|
58742
58795
|
resource,
|
|
58743
58796
|
count: items.length,
|
|
@@ -58769,14 +58822,24 @@ async function executeAllRecordsQueryFullScan(resource, sort, perPage, nextToken
|
|
|
58769
58822
|
let iterations = 0;
|
|
58770
58823
|
let previousKeySignature;
|
|
58771
58824
|
let chunkSize = SCAN_CHUNK_INITIAL;
|
|
58825
|
+
const watcher = new ScanWatcher({
|
|
58826
|
+
requestId,
|
|
58827
|
+
resource,
|
|
58828
|
+
path: "id-filtered-scan",
|
|
58829
|
+
sortField: sort.field,
|
|
58830
|
+
filters: parsedFilters.map((f4) => `${f4.parsed.field}:${f4.parsed.operator}`)
|
|
58831
|
+
});
|
|
58772
58832
|
scan: while (true) {
|
|
58773
58833
|
if (++iterations > SCAN_MAX_ITERATIONS) {
|
|
58774
|
-
|
|
58834
|
+
logger5.error("executeAllRecordsQueryFullScan: \u6700\u5927\u53CD\u5FA9\u56DE\u6570\u3092\u8D85\u904E", {
|
|
58775
58835
|
requestId,
|
|
58776
58836
|
resource,
|
|
58777
58837
|
iterations
|
|
58778
58838
|
});
|
|
58779
|
-
|
|
58839
|
+
throw new AppError("INTERNAL_ERROR" /* INTERNAL_ERROR */, "ID scan exceeded the iteration limit", 500, {
|
|
58840
|
+
resource,
|
|
58841
|
+
iterations
|
|
58842
|
+
});
|
|
58780
58843
|
}
|
|
58781
58844
|
const queryResult = await executeDynamoDBOperation(
|
|
58782
58845
|
() => dbClient2.send(
|
|
@@ -58797,6 +58860,7 @@ async function executeAllRecordsQueryFullScan(resource, sort, perPage, nextToken
|
|
|
58797
58860
|
"Query"
|
|
58798
58861
|
);
|
|
58799
58862
|
costTracker.add(queryResult.ConsumedCapacity);
|
|
58863
|
+
watcher.add((queryResult.Items || []).length);
|
|
58800
58864
|
for (const row of queryResult.Items || []) {
|
|
58801
58865
|
scanned++;
|
|
58802
58866
|
if (!matchesAllFilters(extractCleanRecord(row), parsedFilters)) {
|
|
@@ -58815,19 +58879,24 @@ async function executeAllRecordsQueryFullScan(resource, sort, perPage, nextToken
|
|
|
58815
58879
|
}
|
|
58816
58880
|
const nextKeySignature = `${nextKey.PK}#${nextKey.SK}`;
|
|
58817
58881
|
if (nextKeySignature === previousKeySignature) {
|
|
58818
|
-
|
|
58882
|
+
logger5.error("executeAllRecordsQueryFullScan: \u540C\u4E00\u306ELastEvaluatedKey\u304C\u8FD4\u5374\u3055\u308C\u305F", {
|
|
58819
58883
|
requestId,
|
|
58820
58884
|
resource,
|
|
58821
58885
|
iterations
|
|
58822
58886
|
});
|
|
58823
|
-
|
|
58887
|
+
throw new AppError(
|
|
58888
|
+
"INTERNAL_ERROR" /* INTERNAL_ERROR */,
|
|
58889
|
+
"ID scan received the same LastEvaluatedKey repeatedly",
|
|
58890
|
+
500,
|
|
58891
|
+
{ resource, iterations }
|
|
58892
|
+
);
|
|
58824
58893
|
}
|
|
58825
58894
|
previousKeySignature = nextKeySignature;
|
|
58826
58895
|
exclusiveStartKey = nextKey;
|
|
58827
58896
|
chunkSize = Math.min(chunkSize * 2, SCAN_CHUNK_MAX);
|
|
58828
58897
|
}
|
|
58829
58898
|
const nextTokenValue = hasNextPage && lastReturned ? encodeNextToken(lastReturned.PK, lastReturned.SK) : void 0;
|
|
58830
|
-
|
|
58899
|
+
logger5.info("ID filtered scan query succeeded", {
|
|
58831
58900
|
requestId,
|
|
58832
58901
|
resource,
|
|
58833
58902
|
scanned,
|
|
@@ -58841,7 +58910,7 @@ async function executeAllRecordsQueryFullScan(resource, sort, perPage, nextToken
|
|
|
58841
58910
|
consumedCapacity: costTracker.getAggregated()
|
|
58842
58911
|
};
|
|
58843
58912
|
}
|
|
58844
|
-
var import_lib_dynamodb2,
|
|
58913
|
+
var import_lib_dynamodb2, logger5, SCAN_CHUNK_INITIAL, SCAN_CHUNK_MAX, SCAN_MAX_ITERATIONS;
|
|
58845
58914
|
var init_idQuery = __esm({
|
|
58846
58915
|
"src/server/operations/find/idQuery.ts"() {
|
|
58847
58916
|
"use strict";
|
|
@@ -58850,8 +58919,9 @@ var init_idQuery = __esm({
|
|
|
58850
58919
|
init_cost_tracker();
|
|
58851
58920
|
init_dynamodb3();
|
|
58852
58921
|
init_pagination();
|
|
58922
|
+
init_scanWarning();
|
|
58853
58923
|
init_utils5();
|
|
58854
|
-
|
|
58924
|
+
logger5 = createLogger({
|
|
58855
58925
|
service: "id-query",
|
|
58856
58926
|
level: process.env.LOG_LEVEL || "info"
|
|
58857
58927
|
});
|
|
@@ -58868,7 +58938,7 @@ var init_idQuery = __esm({
|
|
|
58868
58938
|
|
|
58869
58939
|
// src/server/operations/find/nearQuery.ts
|
|
58870
58940
|
async function executeNearQuery(resource, fieldName, nearQuery, limit, requestId) {
|
|
58871
|
-
|
|
58941
|
+
logger6.debug("Executing $near query", {
|
|
58872
58942
|
requestId,
|
|
58873
58943
|
resource,
|
|
58874
58944
|
fieldName,
|
|
@@ -58879,7 +58949,7 @@ async function executeNearQuery(resource, fieldName, nearQuery, limit, requestId
|
|
|
58879
58949
|
const searchFunction = /* @__PURE__ */ __name(async (geohashPrefix) => {
|
|
58880
58950
|
const dbClient2 = getDBClient();
|
|
58881
58951
|
const tableName = getTableName();
|
|
58882
|
-
|
|
58952
|
+
logger6.debug("Searching shadow records", {
|
|
58883
58953
|
requestId,
|
|
58884
58954
|
resource,
|
|
58885
58955
|
fieldName,
|
|
@@ -58904,7 +58974,7 @@ async function executeNearQuery(resource, fieldName, nearQuery, limit, requestId
|
|
|
58904
58974
|
);
|
|
58905
58975
|
costTracker.add(queryResult.ConsumedCapacity);
|
|
58906
58976
|
const shadowRecords = queryResult.Items || [];
|
|
58907
|
-
|
|
58977
|
+
logger6.debug("Shadow records found", {
|
|
58908
58978
|
requestId,
|
|
58909
58979
|
resource,
|
|
58910
58980
|
geohashPrefix,
|
|
@@ -58915,7 +58985,7 @@ async function executeNearQuery(resource, fieldName, nearQuery, limit, requestId
|
|
|
58915
58985
|
const parts = sk.split("#id#");
|
|
58916
58986
|
return parts.length === 2 ? parts[1] : null;
|
|
58917
58987
|
}).filter((id) => id !== null);
|
|
58918
|
-
|
|
58988
|
+
logger6.debug("Main record IDs extracted", {
|
|
58919
58989
|
requestId,
|
|
58920
58990
|
resource,
|
|
58921
58991
|
geohashPrefix,
|
|
@@ -58949,14 +59019,14 @@ async function executeNearQuery(resource, fieldName, nearQuery, limit, requestId
|
|
|
58949
59019
|
}
|
|
58950
59020
|
validRecords.push(...batchGetResult.Responses?.[tableName] || []);
|
|
58951
59021
|
}
|
|
58952
|
-
|
|
59022
|
+
logger6.debug("Main records retrieved", {
|
|
58953
59023
|
requestId,
|
|
58954
59024
|
resource,
|
|
58955
59025
|
geohashPrefix,
|
|
58956
59026
|
count: validRecords.length
|
|
58957
59027
|
});
|
|
58958
59028
|
const cleanRecords = validRecords.map((record) => extractCleanRecord(record));
|
|
58959
|
-
|
|
59029
|
+
logger6.debug("Clean records extracted", {
|
|
58960
59030
|
requestId,
|
|
58961
59031
|
resource,
|
|
58962
59032
|
geohashPrefix,
|
|
@@ -58975,7 +59045,7 @@ async function executeNearQuery(resource, fieldName, nearQuery, limit, requestId
|
|
|
58975
59045
|
config
|
|
58976
59046
|
);
|
|
58977
59047
|
const items = result.documents;
|
|
58978
|
-
|
|
59048
|
+
logger6.info("$near query succeeded", {
|
|
58979
59049
|
requestId,
|
|
58980
59050
|
resource,
|
|
58981
59051
|
fieldName,
|
|
@@ -58993,7 +59063,7 @@ async function executeNearQuery(resource, fieldName, nearQuery, limit, requestId
|
|
|
58993
59063
|
consumedCapacity: costTracker.getAggregated()
|
|
58994
59064
|
};
|
|
58995
59065
|
}
|
|
58996
|
-
var import_lib_dynamodb3,
|
|
59066
|
+
var import_lib_dynamodb3, logger6;
|
|
58997
59067
|
var init_nearQuery = __esm({
|
|
58998
59068
|
"src/server/operations/find/nearQuery.ts"() {
|
|
58999
59069
|
"use strict";
|
|
@@ -59003,7 +59073,7 @@ var init_nearQuery = __esm({
|
|
|
59003
59073
|
init_nearSearch();
|
|
59004
59074
|
init_cost_tracker();
|
|
59005
59075
|
init_dynamodb3();
|
|
59006
|
-
|
|
59076
|
+
logger6 = createLogger({
|
|
59007
59077
|
service: "near-query",
|
|
59008
59078
|
level: process.env.LOG_LEVEL || "info"
|
|
59009
59079
|
});
|
|
@@ -59033,7 +59103,7 @@ async function executeShadowQuery(resource, normalizedParams, requestId) {
|
|
|
59033
59103
|
(f4) => !(isKeyConditionOptimized && f4 === optimizableFilter)
|
|
59034
59104
|
);
|
|
59035
59105
|
if (residualFilters.length > 0) {
|
|
59036
|
-
|
|
59106
|
+
logger7.debug("Residual filters detected, falling back to full scan", {
|
|
59037
59107
|
requestId,
|
|
59038
59108
|
resource,
|
|
59039
59109
|
sortField: sort.field,
|
|
@@ -59041,7 +59111,7 @@ async function executeShadowQuery(resource, normalizedParams, requestId) {
|
|
|
59041
59111
|
});
|
|
59042
59112
|
return executeFullScanQuery(resource, normalizedParams, costTracker, requestId);
|
|
59043
59113
|
}
|
|
59044
|
-
|
|
59114
|
+
logger7.debug("Executing shadow query", {
|
|
59045
59115
|
requestId,
|
|
59046
59116
|
resource,
|
|
59047
59117
|
sortField: sort.field,
|
|
@@ -59089,7 +59159,7 @@ async function executeShadowQuery(resource, normalizedParams, requestId) {
|
|
|
59089
59159
|
shadowRecords.LastEvaluatedKey.PK,
|
|
59090
59160
|
shadowRecords.LastEvaluatedKey.SK
|
|
59091
59161
|
) : void 0;
|
|
59092
|
-
|
|
59162
|
+
logger7.info("Shadow query succeeded", {
|
|
59093
59163
|
requestId,
|
|
59094
59164
|
resource,
|
|
59095
59165
|
sortField: sort.field,
|
|
@@ -59114,7 +59184,7 @@ async function executeFilterFirstQuery(resource, normalizedParams, filterCandida
|
|
|
59114
59184
|
const offset = nextToken ? decodeOffsetToken(nextToken) ?? 0 : 0;
|
|
59115
59185
|
const filterSort = { field: filterCandidate.parsed.field, order: "ASC" };
|
|
59116
59186
|
const remainingFilters = parsedFilters.filter((f4) => f4 !== filterCandidate);
|
|
59117
|
-
|
|
59187
|
+
logger7.debug("Executing filter-first query", {
|
|
59118
59188
|
requestId,
|
|
59119
59189
|
resource,
|
|
59120
59190
|
filterField: filterCandidate.parsed.field,
|
|
@@ -59126,7 +59196,9 @@ async function executeFilterFirstQuery(resource, normalizedParams, filterCandida
|
|
|
59126
59196
|
filterSort,
|
|
59127
59197
|
filterCandidate,
|
|
59128
59198
|
costTracker,
|
|
59129
|
-
requestId
|
|
59199
|
+
requestId,
|
|
59200
|
+
"shadow-filter-first",
|
|
59201
|
+
parsedFilters
|
|
59130
59202
|
);
|
|
59131
59203
|
if (remainingFilters.length > 0) {
|
|
59132
59204
|
items = items.filter((r4) => matchesAllFilters(r4, remainingFilters));
|
|
@@ -59135,7 +59207,7 @@ async function executeFilterFirstQuery(resource, normalizedParams, filterCandida
|
|
|
59135
59207
|
const page = items.slice(offset, offset + perPage);
|
|
59136
59208
|
const hasNextPage = offset + perPage < items.length;
|
|
59137
59209
|
const nextTokenValue = hasNextPage ? encodeOffsetToken(offset + perPage) : void 0;
|
|
59138
|
-
|
|
59210
|
+
logger7.info("Filter-first query succeeded", {
|
|
59139
59211
|
requestId,
|
|
59140
59212
|
resource,
|
|
59141
59213
|
filterField: filterCandidate.parsed.field,
|
|
@@ -59156,20 +59228,28 @@ async function executeFullScanQuery(resource, normalizedParams, costTracker, req
|
|
|
59156
59228
|
const { sort, pagination, parsedFilters } = normalizedParams;
|
|
59157
59229
|
const { perPage, nextToken } = pagination;
|
|
59158
59230
|
const offset = nextToken ? decodeOffsetToken(nextToken) ?? 0 : 0;
|
|
59159
|
-
|
|
59231
|
+
logger7.debug("Executing full scan query", {
|
|
59160
59232
|
requestId,
|
|
59161
59233
|
resource,
|
|
59162
59234
|
sortField: sort.field,
|
|
59163
59235
|
offset
|
|
59164
59236
|
});
|
|
59165
|
-
let items = await fetchAllRecordsViaShadowIndex(
|
|
59237
|
+
let items = await fetchAllRecordsViaShadowIndex(
|
|
59238
|
+
resource,
|
|
59239
|
+
sort,
|
|
59240
|
+
void 0,
|
|
59241
|
+
costTracker,
|
|
59242
|
+
requestId,
|
|
59243
|
+
"shadow-full-scan",
|
|
59244
|
+
parsedFilters
|
|
59245
|
+
);
|
|
59166
59246
|
if (parsedFilters.length > 0) {
|
|
59167
59247
|
items = items.filter((r4) => matchesAllFilters(r4, parsedFilters));
|
|
59168
59248
|
}
|
|
59169
59249
|
const page = items.slice(offset, offset + perPage);
|
|
59170
59250
|
const hasNextPage = offset + perPage < items.length;
|
|
59171
59251
|
const nextTokenValue = hasNextPage ? encodeOffsetToken(offset + perPage) : void 0;
|
|
59172
|
-
|
|
59252
|
+
logger7.info("Full scan query succeeded", {
|
|
59173
59253
|
requestId,
|
|
59174
59254
|
resource,
|
|
59175
59255
|
sortField: sort.field,
|
|
@@ -59185,20 +59265,35 @@ async function executeFullScanQuery(resource, normalizedParams, costTracker, req
|
|
|
59185
59265
|
consumedCapacity: costTracker.getAggregated()
|
|
59186
59266
|
};
|
|
59187
59267
|
}
|
|
59188
|
-
async function fetchAllRecordsViaShadowIndex(resource, indexSort, indexFilter, costTracker, requestId) {
|
|
59268
|
+
async function fetchAllRecordsViaShadowIndex(resource, indexSort, indexFilter, costTracker, requestId, scanPath, parsedFilters) {
|
|
59189
59269
|
const allShadowItems = [];
|
|
59270
|
+
const watcher = new ScanWatcher({
|
|
59271
|
+
requestId,
|
|
59272
|
+
resource,
|
|
59273
|
+
path: scanPath,
|
|
59274
|
+
sortField: indexSort.field,
|
|
59275
|
+
filters: parsedFilters.map((f4) => `${f4.parsed.field}:${f4.parsed.operator}`)
|
|
59276
|
+
});
|
|
59190
59277
|
let lastKey;
|
|
59191
59278
|
let previousKeySignature;
|
|
59192
59279
|
const MAX_ITERATIONS = 1e4;
|
|
59193
59280
|
let iterations = 0;
|
|
59194
59281
|
do {
|
|
59195
59282
|
if (++iterations > MAX_ITERATIONS) {
|
|
59196
|
-
|
|
59283
|
+
logger7.error("fetchAllRecordsViaShadowIndex: \u6700\u5927\u53CD\u5FA9\u56DE\u6570\u3092\u8D85\u904E", {
|
|
59197
59284
|
requestId,
|
|
59198
59285
|
resource,
|
|
59199
59286
|
iterations
|
|
59200
59287
|
});
|
|
59201
|
-
|
|
59288
|
+
throw new AppError(
|
|
59289
|
+
"INTERNAL_ERROR" /* INTERNAL_ERROR */,
|
|
59290
|
+
"Shadow index scan exceeded the iteration limit",
|
|
59291
|
+
500,
|
|
59292
|
+
{
|
|
59293
|
+
resource,
|
|
59294
|
+
iterations
|
|
59295
|
+
}
|
|
59296
|
+
);
|
|
59202
59297
|
}
|
|
59203
59298
|
const result = await executeShadowRecordQuery(
|
|
59204
59299
|
resource,
|
|
@@ -59211,15 +59306,21 @@ async function fetchAllRecordsViaShadowIndex(resource, indexSort, indexFilter, c
|
|
|
59211
59306
|
requestId
|
|
59212
59307
|
);
|
|
59213
59308
|
allShadowItems.push(...result.Items || []);
|
|
59309
|
+
watcher.add((result.Items || []).length);
|
|
59214
59310
|
const nextKey = result.LastEvaluatedKey;
|
|
59215
59311
|
const nextKeySignature = nextKey ? `${nextKey.PK}#${nextKey.SK}` : void 0;
|
|
59216
59312
|
if (nextKeySignature && nextKeySignature === previousKeySignature) {
|
|
59217
|
-
|
|
59313
|
+
logger7.error("fetchAllRecordsViaShadowIndex: \u540C\u4E00\u306ELastEvaluatedKey\u304C\u8FD4\u5374\u3055\u308C\u305F", {
|
|
59218
59314
|
requestId,
|
|
59219
59315
|
resource,
|
|
59220
59316
|
iterations
|
|
59221
59317
|
});
|
|
59222
|
-
|
|
59318
|
+
throw new AppError(
|
|
59319
|
+
"INTERNAL_ERROR" /* INTERNAL_ERROR */,
|
|
59320
|
+
"Shadow index scan received the same LastEvaluatedKey repeatedly",
|
|
59321
|
+
500,
|
|
59322
|
+
{ resource, iterations }
|
|
59323
|
+
);
|
|
59223
59324
|
}
|
|
59224
59325
|
previousKeySignature = nextKeySignature;
|
|
59225
59326
|
lastKey = nextKey;
|
|
@@ -59425,7 +59526,7 @@ async function fetchMainRecords(resource, recordIds, costTracker, requestId) {
|
|
|
59425
59526
|
}
|
|
59426
59527
|
allRecords.push(...batchGetResult.Responses?.[tableName] || []);
|
|
59427
59528
|
}
|
|
59428
|
-
|
|
59529
|
+
logger7.debug("Main records fetched", {
|
|
59429
59530
|
requestId,
|
|
59430
59531
|
resource,
|
|
59431
59532
|
requestedCount: uniqueRecordIds.length,
|
|
@@ -59433,7 +59534,7 @@ async function fetchMainRecords(resource, recordIds, costTracker, requestId) {
|
|
|
59433
59534
|
});
|
|
59434
59535
|
return allRecords;
|
|
59435
59536
|
}
|
|
59436
|
-
var import_lib_dynamodb4,
|
|
59537
|
+
var import_lib_dynamodb4, logger7, KEY_CONDITION_OPERATORS;
|
|
59437
59538
|
var init_shadowQuery = __esm({
|
|
59438
59539
|
"src/server/operations/find/shadowQuery.ts"() {
|
|
59439
59540
|
"use strict";
|
|
@@ -59443,8 +59544,9 @@ var init_shadowQuery = __esm({
|
|
|
59443
59544
|
init_cost_tracker();
|
|
59444
59545
|
init_dynamodb3();
|
|
59445
59546
|
init_pagination();
|
|
59547
|
+
init_scanWarning();
|
|
59446
59548
|
init_utils5();
|
|
59447
|
-
|
|
59549
|
+
logger7 = createLogger({
|
|
59448
59550
|
service: "shadow-query",
|
|
59449
59551
|
level: process.env.LOG_LEVEL || "info"
|
|
59450
59552
|
});
|
|
@@ -59465,14 +59567,14 @@ var init_shadowQuery = __esm({
|
|
|
59465
59567
|
|
|
59466
59568
|
// src/server/operations/find/handler.ts
|
|
59467
59569
|
async function handleFind(resource, params, requestId) {
|
|
59468
|
-
|
|
59570
|
+
logger8.debug("Executing find", {
|
|
59469
59571
|
requestId,
|
|
59470
59572
|
resource,
|
|
59471
59573
|
params
|
|
59472
59574
|
});
|
|
59473
59575
|
const nearDetection = detectNearQuery(params.filter);
|
|
59474
59576
|
if (nearDetection) {
|
|
59475
|
-
|
|
59577
|
+
logger8.debug("$near operator detected, executing near search", {
|
|
59476
59578
|
requestId,
|
|
59477
59579
|
resource,
|
|
59478
59580
|
fieldName: nearDetection.fieldName
|
|
@@ -59489,7 +59591,7 @@ async function handleFind(resource, params, requestId) {
|
|
|
59489
59591
|
const config = initializeFindConfig();
|
|
59490
59592
|
const normalizedParams = normalizeFindParams(config, resource, params);
|
|
59491
59593
|
validateSortField(config, resource, normalizedParams.sort);
|
|
59492
|
-
|
|
59594
|
+
logger8.debug("Find parameters normalized", {
|
|
59493
59595
|
requestId,
|
|
59494
59596
|
resource,
|
|
59495
59597
|
sort: normalizedParams.sort,
|
|
@@ -59504,7 +59606,7 @@ async function handleFind(resource, params, requestId) {
|
|
|
59504
59606
|
}
|
|
59505
59607
|
return executeShadowQuery(resource, normalizedParams, requestId);
|
|
59506
59608
|
}
|
|
59507
|
-
var
|
|
59609
|
+
var logger8;
|
|
59508
59610
|
var init_handler = __esm({
|
|
59509
59611
|
"src/server/operations/find/handler.ts"() {
|
|
59510
59612
|
"use strict";
|
|
@@ -59514,7 +59616,7 @@ var init_handler = __esm({
|
|
|
59514
59616
|
init_nearQuery();
|
|
59515
59617
|
init_shadowQuery();
|
|
59516
59618
|
init_utils5();
|
|
59517
|
-
|
|
59619
|
+
logger8 = createLogger({
|
|
59518
59620
|
service: "find-handler",
|
|
59519
59621
|
level: process.env.LOG_LEVEL || "info"
|
|
59520
59622
|
});
|
|
@@ -59537,7 +59639,7 @@ var init_find = __esm({
|
|
|
59537
59639
|
// src/server/utils/bulkOperations.ts
|
|
59538
59640
|
function logLargeBatchWarning(operation2, recordCount, requestId, resource) {
|
|
59539
59641
|
if (recordCount > LARGE_BATCH_WARNING_THRESHOLD) {
|
|
59540
|
-
|
|
59642
|
+
logger10.warn(`Large batch ${operation2} operation detected`, {
|
|
59541
59643
|
requestId,
|
|
59542
59644
|
resource,
|
|
59543
59645
|
recordCount,
|
|
@@ -59560,7 +59662,7 @@ function calculateTimeoutRisk(startTime) {
|
|
|
59560
59662
|
};
|
|
59561
59663
|
}
|
|
59562
59664
|
function logPreparationTimeoutRisk(requestId, resource, totalRecords, chunkCount, riskInfo) {
|
|
59563
|
-
|
|
59665
|
+
logger10.info("Records prepared for chunk execution", {
|
|
59564
59666
|
requestId,
|
|
59565
59667
|
resource,
|
|
59566
59668
|
totalRecords,
|
|
@@ -59570,7 +59672,7 @@ function logPreparationTimeoutRisk(requestId, resource, totalRecords, chunkCount
|
|
|
59570
59672
|
timeoutRisk: riskInfo.risk
|
|
59571
59673
|
});
|
|
59572
59674
|
if (riskInfo.risk === "high") {
|
|
59573
|
-
|
|
59675
|
+
logger10.warn("High timeout risk detected during preparation phase", {
|
|
59574
59676
|
requestId,
|
|
59575
59677
|
resource,
|
|
59576
59678
|
preparationElapsedMs: riskInfo.elapsedMs,
|
|
@@ -59582,7 +59684,7 @@ function logPreparationTimeoutRisk(requestId, resource, totalRecords, chunkCount
|
|
|
59582
59684
|
}
|
|
59583
59685
|
function logBulkOperationComplete(operation2, requestId, resource, requested, succeeded, failed, riskInfo, additionalInfo) {
|
|
59584
59686
|
const totalElapsedSeconds = Math.round(riskInfo.elapsedMs / 1e3);
|
|
59585
|
-
|
|
59687
|
+
logger10.info(`${operation2} completed`, {
|
|
59586
59688
|
requestId,
|
|
59587
59689
|
resource,
|
|
59588
59690
|
requested,
|
|
@@ -59597,7 +59699,7 @@ function logBulkOperationComplete(operation2, requestId, resource, requested, su
|
|
|
59597
59699
|
}
|
|
59598
59700
|
function logPartialFailure(operation2, requestId, resource, requested, succeeded, failed, errorCodes, additionalInfo) {
|
|
59599
59701
|
const failureRate = Math.round(failed / requested * 100);
|
|
59600
|
-
|
|
59702
|
+
logger10.warn(`Partial failure in ${operation2} operation`, {
|
|
59601
59703
|
requestId,
|
|
59602
59704
|
resource,
|
|
59603
59705
|
totalRequested: requested,
|
|
@@ -59608,12 +59710,12 @@ function logPartialFailure(operation2, requestId, resource, requested, succeeded
|
|
|
59608
59710
|
...additionalInfo
|
|
59609
59711
|
});
|
|
59610
59712
|
}
|
|
59611
|
-
var
|
|
59713
|
+
var logger10;
|
|
59612
59714
|
var init_bulkOperations = __esm({
|
|
59613
59715
|
"src/server/utils/bulkOperations.ts"() {
|
|
59614
59716
|
"use strict";
|
|
59615
59717
|
init_shared();
|
|
59616
|
-
|
|
59718
|
+
logger10 = createLogger({ service: "records-lambda" });
|
|
59617
59719
|
__name(logLargeBatchWarning, "logLargeBatchWarning");
|
|
59618
59720
|
__name(calculateTimeoutRisk, "calculateTimeoutRisk");
|
|
59619
59721
|
__name(logPreparationTimeoutRisk, "logPreparationTimeoutRisk");
|
|
@@ -59632,7 +59734,7 @@ function calculateChunks(records, getItemCount) {
|
|
|
59632
59734
|
const itemCount = getItemCount(record);
|
|
59633
59735
|
if (itemCount > DYNAMODB_TRANSACT_WRITE_MAX_ITEMS) {
|
|
59634
59736
|
const errorMsg = `Single record exceeds ${DYNAMODB_TRANSACT_WRITE_MAX_ITEMS} items limit: ${itemCount} items`;
|
|
59635
|
-
|
|
59737
|
+
logger11.error("Chunk validation failed", {
|
|
59636
59738
|
itemCount,
|
|
59637
59739
|
limit: DYNAMODB_TRANSACT_WRITE_MAX_ITEMS
|
|
59638
59740
|
});
|
|
@@ -59654,7 +59756,7 @@ function calculateChunks(records, getItemCount) {
|
|
|
59654
59756
|
chunks.push(currentChunk);
|
|
59655
59757
|
itemCounts.push(currentItemCount);
|
|
59656
59758
|
}
|
|
59657
|
-
|
|
59759
|
+
logger11.info("Chunk calculation completed", {
|
|
59658
59760
|
totalRecords: records.length,
|
|
59659
59761
|
chunkCount: chunks.length,
|
|
59660
59762
|
itemCounts,
|
|
@@ -59670,7 +59772,7 @@ async function executeChunks(chunks, executeChunk, getRecordId) {
|
|
|
59670
59772
|
const errors = [];
|
|
59671
59773
|
const totalRecords = chunks.reduce((sum, chunk) => sum + chunk.length, 0);
|
|
59672
59774
|
const executionStartTime = Date.now();
|
|
59673
|
-
|
|
59775
|
+
logger11.info("Starting chunk execution", {
|
|
59674
59776
|
totalChunks: chunks.length,
|
|
59675
59777
|
totalRecords
|
|
59676
59778
|
});
|
|
@@ -59678,14 +59780,14 @@ async function executeChunks(chunks, executeChunk, getRecordId) {
|
|
|
59678
59780
|
const chunk = chunks[i4];
|
|
59679
59781
|
const chunkStartTime = Date.now();
|
|
59680
59782
|
try {
|
|
59681
|
-
|
|
59783
|
+
logger11.debug(`Executing chunk ${i4 + 1}/${chunks.length}`, {
|
|
59682
59784
|
chunkIndex: i4,
|
|
59683
59785
|
recordCount: chunk.length
|
|
59684
59786
|
});
|
|
59685
59787
|
const successfulRecords = await executeChunk(chunk);
|
|
59686
59788
|
successRecords.push(...successfulRecords);
|
|
59687
59789
|
const chunkDuration = Date.now() - chunkStartTime;
|
|
59688
|
-
|
|
59790
|
+
logger11.info(`Chunk ${i4 + 1}/${chunks.length} succeeded`, {
|
|
59689
59791
|
chunkIndex: i4,
|
|
59690
59792
|
recordCount: chunk.length,
|
|
59691
59793
|
durationMs: chunkDuration
|
|
@@ -59694,7 +59796,7 @@ async function executeChunks(chunks, executeChunk, getRecordId) {
|
|
|
59694
59796
|
const chunkDuration = Date.now() - chunkStartTime;
|
|
59695
59797
|
const errorMessage = error2 instanceof Error ? error2.message : "Unknown error";
|
|
59696
59798
|
const errorCode = getErrorCode(error2);
|
|
59697
|
-
|
|
59799
|
+
logger11.error(`Chunk ${i4 + 1}/${chunks.length} failed`, {
|
|
59698
59800
|
chunkIndex: i4,
|
|
59699
59801
|
recordCount: chunk.length,
|
|
59700
59802
|
durationMs: chunkDuration,
|
|
@@ -59713,7 +59815,7 @@ async function executeChunks(chunks, executeChunk, getRecordId) {
|
|
|
59713
59815
|
}
|
|
59714
59816
|
}
|
|
59715
59817
|
const totalExecutionTime = Date.now() - executionStartTime;
|
|
59716
|
-
|
|
59818
|
+
logger11.info("Chunk execution completed", {
|
|
59717
59819
|
totalChunks: chunks.length,
|
|
59718
59820
|
totalRecords,
|
|
59719
59821
|
successCount: successRecords.length,
|
|
@@ -59722,7 +59824,7 @@ async function executeChunks(chunks, executeChunk, getRecordId) {
|
|
|
59722
59824
|
avgTimePerChunkMs: chunks.length > 0 ? Math.round(totalExecutionTime / chunks.length) : 0
|
|
59723
59825
|
});
|
|
59724
59826
|
if (failedIds.length > 0) {
|
|
59725
|
-
|
|
59827
|
+
logger11.warn("Partial failure detected in chunk execution", {
|
|
59726
59828
|
totalRecords,
|
|
59727
59829
|
successCount: successRecords.length,
|
|
59728
59830
|
failedCount: failedIds.length,
|
|
@@ -59754,12 +59856,12 @@ function getErrorCode(error2) {
|
|
|
59754
59856
|
}
|
|
59755
59857
|
return "TRANSACTION_FAILED";
|
|
59756
59858
|
}
|
|
59757
|
-
var
|
|
59859
|
+
var logger11;
|
|
59758
59860
|
var init_chunking = __esm({
|
|
59759
59861
|
"src/server/utils/chunking.ts"() {
|
|
59760
59862
|
"use strict";
|
|
59761
59863
|
init_shared();
|
|
59762
|
-
|
|
59864
|
+
logger11 = createLogger({ service: "records-lambda" });
|
|
59763
59865
|
__name(calculateChunks, "calculateChunks");
|
|
59764
59866
|
__name(executeChunks, "executeChunks");
|
|
59765
59867
|
__name(getErrorCode, "getErrorCode");
|
|
@@ -59930,7 +60032,7 @@ async function handleUpdateMany(resource, params, requestId) {
|
|
|
59930
60032
|
const upsert = options?.upsert ?? false;
|
|
59931
60033
|
const startTime = Date.now();
|
|
59932
60034
|
const costTracker = new CostTracker();
|
|
59933
|
-
|
|
60035
|
+
logger12.debug("Executing updateMany", {
|
|
59934
60036
|
requestId,
|
|
59935
60037
|
resource,
|
|
59936
60038
|
upsert
|
|
@@ -59938,13 +60040,13 @@ async function handleUpdateMany(resource, params, requestId) {
|
|
|
59938
60040
|
let ids;
|
|
59939
60041
|
if ("ids" in params) {
|
|
59940
60042
|
ids = params.ids;
|
|
59941
|
-
|
|
60043
|
+
logger12.debug("Executing updateMany with ids", {
|
|
59942
60044
|
requestId,
|
|
59943
60045
|
resource,
|
|
59944
60046
|
count: ids.length
|
|
59945
60047
|
});
|
|
59946
60048
|
} else {
|
|
59947
|
-
|
|
60049
|
+
logger12.debug("Executing updateMany with filter", {
|
|
59948
60050
|
requestId,
|
|
59949
60051
|
resource,
|
|
59950
60052
|
filter: params.filter
|
|
@@ -59952,7 +60054,7 @@ async function handleUpdateMany(resource, params, requestId) {
|
|
|
59952
60054
|
const { handleFind: handleFind2 } = await Promise.resolve().then(() => (init_find(), find_exports));
|
|
59953
60055
|
const findResult = await handleFind2(resource, { filter: params.filter }, requestId);
|
|
59954
60056
|
ids = findResult.items.map((item) => item.id);
|
|
59955
|
-
|
|
60057
|
+
logger12.debug("Found records with filter", {
|
|
59956
60058
|
requestId,
|
|
59957
60059
|
resource,
|
|
59958
60060
|
count: ids.length
|
|
@@ -59961,7 +60063,7 @@ async function handleUpdateMany(resource, params, requestId) {
|
|
|
59961
60063
|
if (upsert) {
|
|
59962
60064
|
const newId = ulid2();
|
|
59963
60065
|
ids = [newId];
|
|
59964
|
-
|
|
60066
|
+
logger12.info("Creating new record with filter (upsert: true)", {
|
|
59965
60067
|
requestId,
|
|
59966
60068
|
resource,
|
|
59967
60069
|
newId,
|
|
@@ -60025,7 +60127,7 @@ async function handleUpdateMany(resource, params, requestId) {
|
|
|
60025
60127
|
);
|
|
60026
60128
|
const notFoundIds = ids.filter((id) => !existingIds.has(id));
|
|
60027
60129
|
if (!upsert && notFoundIds.length > 0) {
|
|
60028
|
-
|
|
60130
|
+
logger12.warn("Records not found (upsert: false)", {
|
|
60029
60131
|
requestId,
|
|
60030
60132
|
resource,
|
|
60031
60133
|
notFoundCount: notFoundIds.length,
|
|
@@ -60034,7 +60136,7 @@ async function handleUpdateMany(resource, params, requestId) {
|
|
|
60034
60136
|
});
|
|
60035
60137
|
}
|
|
60036
60138
|
if (upsert && notFoundIds.length > 0) {
|
|
60037
|
-
|
|
60139
|
+
logger12.info("Creating new records (upsert: true)", {
|
|
60038
60140
|
requestId,
|
|
60039
60141
|
resource,
|
|
60040
60142
|
notFoundCount: notFoundIds.length,
|
|
@@ -60070,7 +60172,7 @@ async function handleUpdateMany(resource, params, requestId) {
|
|
|
60070
60172
|
const failedId = existingData.id || "unknown-id";
|
|
60071
60173
|
const errorMessage = error2 instanceof Error ? error2.message : "Unknown preparation error";
|
|
60072
60174
|
const errorCode = getPreparationErrorCode(error2);
|
|
60073
|
-
|
|
60175
|
+
logger12.error("Failed to prepare record for update", {
|
|
60074
60176
|
requestId,
|
|
60075
60177
|
recordId: failedId,
|
|
60076
60178
|
error: errorMessage,
|
|
@@ -60110,7 +60212,7 @@ async function handleUpdateMany(resource, params, requestId) {
|
|
|
60110
60212
|
} catch (error2) {
|
|
60111
60213
|
const errorMessage = error2 instanceof Error ? error2.message : "Unknown preparation error";
|
|
60112
60214
|
const errorCode = getPreparationErrorCode(error2);
|
|
60113
|
-
|
|
60215
|
+
logger12.error("Failed to prepare new record for upsert", {
|
|
60114
60216
|
requestId,
|
|
60115
60217
|
recordId: id,
|
|
60116
60218
|
error: errorMessage,
|
|
@@ -60323,7 +60425,7 @@ function getPreparationErrorCode(error2) {
|
|
|
60323
60425
|
}
|
|
60324
60426
|
return "VALIDATION_ERROR" /* VALIDATION_ERROR */;
|
|
60325
60427
|
}
|
|
60326
|
-
var import_lib_dynamodb6,
|
|
60428
|
+
var import_lib_dynamodb6, logger12;
|
|
60327
60429
|
var init_updateMany = __esm({
|
|
60328
60430
|
"src/server/operations/updateMany.ts"() {
|
|
60329
60431
|
"use strict";
|
|
@@ -60337,7 +60439,7 @@ var init_updateMany = __esm({
|
|
|
60337
60439
|
init_dynamodb3();
|
|
60338
60440
|
init_mergePatch();
|
|
60339
60441
|
init_timestamps();
|
|
60340
|
-
|
|
60442
|
+
logger12 = createLogger({ service: "records-lambda" });
|
|
60341
60443
|
__name(handleUpdateMany, "handleUpdateMany");
|
|
60342
60444
|
__name(getPreparationErrorCode, "getPreparationErrorCode");
|
|
60343
60445
|
}
|
|
@@ -60360,11 +60462,11 @@ init_shared();
|
|
|
60360
60462
|
init_shadow();
|
|
60361
60463
|
init_dynamodb3();
|
|
60362
60464
|
init_find();
|
|
60363
|
-
var
|
|
60465
|
+
var logger9 = createLogger({ service: "records-lambda" });
|
|
60364
60466
|
async function handleFindMany(resource, params, requestId) {
|
|
60365
60467
|
if ("ids" in params) {
|
|
60366
60468
|
const { ids } = params;
|
|
60367
|
-
|
|
60469
|
+
logger9.debug("Executing findMany by ids", {
|
|
60368
60470
|
requestId,
|
|
60369
60471
|
resource,
|
|
60370
60472
|
count: ids.length
|
|
@@ -60393,7 +60495,7 @@ async function handleFindMany(resource, params, requestId) {
|
|
|
60393
60495
|
);
|
|
60394
60496
|
const items = result.Responses?.[tableName] || [];
|
|
60395
60497
|
const records = items.map((item) => extractCleanRecord(item));
|
|
60396
|
-
|
|
60498
|
+
logger9.info("findMany by ids succeeded", {
|
|
60397
60499
|
requestId,
|
|
60398
60500
|
resource,
|
|
60399
60501
|
requested: ids.length,
|
|
@@ -60403,7 +60505,7 @@ async function handleFindMany(resource, params, requestId) {
|
|
|
60403
60505
|
}
|
|
60404
60506
|
if ("filter" in params) {
|
|
60405
60507
|
const { filter } = params;
|
|
60406
|
-
|
|
60508
|
+
logger9.debug("Executing findMany by filter", {
|
|
60407
60509
|
requestId,
|
|
60408
60510
|
resource,
|
|
60409
60511
|
filter
|
|
@@ -60415,7 +60517,7 @@ async function handleFindMany(resource, params, requestId) {
|
|
|
60415
60517
|
},
|
|
60416
60518
|
requestId
|
|
60417
60519
|
);
|
|
60418
|
-
|
|
60520
|
+
logger9.info("findMany by filter succeeded", {
|
|
60419
60521
|
requestId,
|
|
60420
60522
|
resource,
|
|
60421
60523
|
filter,
|
|
@@ -60429,13 +60531,13 @@ __name(handleFindMany, "handleFindMany");
|
|
|
60429
60531
|
|
|
60430
60532
|
// src/server/operations/updateOne.ts
|
|
60431
60533
|
init_shared();
|
|
60432
|
-
var
|
|
60534
|
+
var logger13 = createLogger({ service: "records-lambda" });
|
|
60433
60535
|
async function handleUpdateOne(resource, params, requestId) {
|
|
60434
60536
|
const { data: patchData, options } = params;
|
|
60435
60537
|
const { handleUpdateMany: handleUpdateMany2 } = await Promise.resolve().then(() => (init_updateMany(), updateMany_exports));
|
|
60436
60538
|
if ("id" in params) {
|
|
60437
60539
|
const targetId = params.id;
|
|
60438
|
-
|
|
60540
|
+
logger13.debug("Executing updateOne with id", {
|
|
60439
60541
|
requestId,
|
|
60440
60542
|
resource,
|
|
60441
60543
|
id: targetId,
|
|
@@ -60477,7 +60579,7 @@ async function handleUpdateOne(resource, params, requestId) {
|
|
|
60477
60579
|
consumedCapacity: updateManyResult.consumedCapacity
|
|
60478
60580
|
};
|
|
60479
60581
|
} else {
|
|
60480
|
-
|
|
60582
|
+
logger13.debug("Executing updateOne with filter", {
|
|
60481
60583
|
requestId,
|
|
60482
60584
|
resource,
|
|
60483
60585
|
filter: params.filter,
|
|
@@ -60625,7 +60727,7 @@ async function getImagePolicy(ssmClient2, paramName) {
|
|
|
60625
60727
|
__name(getImagePolicy, "getImagePolicy");
|
|
60626
60728
|
|
|
60627
60729
|
// src/server/media/process-handler.ts
|
|
60628
|
-
var
|
|
60730
|
+
var logger14 = createLogger({ service: "media-process-handler" });
|
|
60629
60731
|
var s3Client = new import_client_s3.S3Client({ region: process.env.AWS_REGION });
|
|
60630
60732
|
var ssmClient = new import_client_ssm2.SSMClient({ region: process.env.AWS_REGION });
|
|
60631
60733
|
var MAX_INPUT_PIXELS = 1e8;
|
|
@@ -60665,7 +60767,7 @@ async function processRecord(bucket, rawKey) {
|
|
|
60665
60767
|
const existing = await handleFindMany("media", { ids: [fileId] }, requestId);
|
|
60666
60768
|
const existingRecord = existing[0];
|
|
60667
60769
|
if (existingRecord?.status === "completed") {
|
|
60668
|
-
|
|
60770
|
+
logger14.warn("Media already completed, ignoring re-upload to the same fileId", {
|
|
60669
60771
|
requestId,
|
|
60670
60772
|
fileId
|
|
60671
60773
|
});
|
|
@@ -60677,7 +60779,7 @@ async function processRecord(bucket, rawKey) {
|
|
|
60677
60779
|
const originalFilename = decodeOriginalFilename(metadata["original-filename"]);
|
|
60678
60780
|
const headBytes = await getHeadBytes(bucket, key);
|
|
60679
60781
|
if (!verifyMagicBytes(contentType, headBytes)) {
|
|
60680
|
-
|
|
60782
|
+
logger14.warn("Content type does not match file signature", { requestId, fileId, contentType });
|
|
60681
60783
|
await writeMediaRecord(
|
|
60682
60784
|
fileId,
|
|
60683
60785
|
{
|
|
@@ -60752,7 +60854,7 @@ async function processRecord(bucket, rawKey) {
|
|
|
60752
60854
|
requestId
|
|
60753
60855
|
);
|
|
60754
60856
|
}
|
|
60755
|
-
|
|
60857
|
+
logger14.info("Media processed", { requestId, fileId, contentType });
|
|
60756
60858
|
}
|
|
60757
60859
|
__name(processRecord, "processRecord");
|
|
60758
60860
|
var handler = /* @__PURE__ */ __name(async (event) => {
|
|
@@ -60762,7 +60864,7 @@ var handler = /* @__PURE__ */ __name(async (event) => {
|
|
|
60762
60864
|
try {
|
|
60763
60865
|
await processRecord(bucket, key);
|
|
60764
60866
|
} catch (error2) {
|
|
60765
|
-
|
|
60867
|
+
logger14.error("Failed to process media", {
|
|
60766
60868
|
bucket,
|
|
60767
60869
|
key,
|
|
60768
60870
|
error: error2 instanceof Error ? error2.message : String(error2)
|