@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
package/dist/server/handler.cjs
CHANGED
|
@@ -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;
|
|
@@ -1548,12 +1548,12 @@ var require_dist_cjs7 = __commonJS({
|
|
|
1548
1548
|
var loggerMiddleware = /* @__PURE__ */ __name(() => (next, context) => async (args) => {
|
|
1549
1549
|
try {
|
|
1550
1550
|
const response = await next(args);
|
|
1551
|
-
const { clientName, commandName, logger:
|
|
1551
|
+
const { clientName, commandName, logger: logger27, dynamoDbDocumentClientOptions = {} } = context;
|
|
1552
1552
|
const { overrideInputFilterSensitiveLog, overrideOutputFilterSensitiveLog } = dynamoDbDocumentClientOptions;
|
|
1553
1553
|
const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog;
|
|
1554
1554
|
const outputFilterSensitiveLog = overrideOutputFilterSensitiveLog ?? context.outputFilterSensitiveLog;
|
|
1555
1555
|
const { $metadata, ...outputWithoutMetadata } = response.output;
|
|
1556
|
-
|
|
1556
|
+
logger27?.info?.({
|
|
1557
1557
|
clientName,
|
|
1558
1558
|
commandName,
|
|
1559
1559
|
input: inputFilterSensitiveLog(args.input),
|
|
@@ -1562,10 +1562,10 @@ var require_dist_cjs7 = __commonJS({
|
|
|
1562
1562
|
});
|
|
1563
1563
|
return response;
|
|
1564
1564
|
} catch (error2) {
|
|
1565
|
-
const { clientName, commandName, logger:
|
|
1565
|
+
const { clientName, commandName, logger: logger27, dynamoDbDocumentClientOptions = {} } = context;
|
|
1566
1566
|
const { overrideInputFilterSensitiveLog } = dynamoDbDocumentClientOptions;
|
|
1567
1567
|
const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog;
|
|
1568
|
-
|
|
1568
|
+
logger27?.error?.({
|
|
1569
1569
|
clientName,
|
|
1570
1570
|
commandName,
|
|
1571
1571
|
input: inputFilterSensitiveLog(args.input),
|
|
@@ -3191,19 +3191,19 @@ var init_ProviderError = __esm({
|
|
|
3191
3191
|
name = "ProviderError";
|
|
3192
3192
|
tryNextLink;
|
|
3193
3193
|
constructor(message, options = true) {
|
|
3194
|
-
let
|
|
3194
|
+
let logger27;
|
|
3195
3195
|
let tryNextLink = true;
|
|
3196
3196
|
if (typeof options === "boolean") {
|
|
3197
|
-
|
|
3197
|
+
logger27 = void 0;
|
|
3198
3198
|
tryNextLink = options;
|
|
3199
3199
|
} else if (options != null && typeof options === "object") {
|
|
3200
|
-
|
|
3200
|
+
logger27 = options.logger;
|
|
3201
3201
|
tryNextLink = options.tryNextLink ?? true;
|
|
3202
3202
|
}
|
|
3203
3203
|
super(message);
|
|
3204
3204
|
this.tryNextLink = tryNextLink;
|
|
3205
3205
|
Object.setPrototypeOf(this, _ProviderError.prototype);
|
|
3206
|
-
|
|
3206
|
+
logger27?.debug?.(`@smithy/property-provider ${tryNextLink ? "->" : "(!)"} ${message}`);
|
|
3207
3207
|
}
|
|
3208
3208
|
static from(error2, options = true) {
|
|
3209
3209
|
return Object.assign(new this(error2.message, options), error2);
|
|
@@ -3636,8 +3636,8 @@ var init_configLoader = __esm({
|
|
|
3636
3636
|
init_fromSharedConfigFiles();
|
|
3637
3637
|
init_fromStatic();
|
|
3638
3638
|
loadConfig = /* @__PURE__ */ __name(({ environmentVariableSelector, configFileSelector, default: defaultValue }, configuration = {}) => {
|
|
3639
|
-
const { signingName, logger:
|
|
3640
|
-
const envOptions = { signingName, logger:
|
|
3639
|
+
const { signingName, logger: logger27 } = configuration;
|
|
3640
|
+
const envOptions = { signingName, logger: logger27 };
|
|
3641
3641
|
return memoize(chain(fromEnv(environmentVariableSelector, envOptions), fromSharedConfigFiles(configFileSelector, configuration), fromStatic(defaultValue)));
|
|
3642
3642
|
}, "loadConfig");
|
|
3643
3643
|
}
|
|
@@ -5256,7 +5256,7 @@ var init_ByteArrayCollector = __esm({
|
|
|
5256
5256
|
});
|
|
5257
5257
|
|
|
5258
5258
|
// node_modules/@smithy/core/dist-es/submodules/serde/util-stream/createBufferedReadable.browser.js
|
|
5259
|
-
function createBufferedReadableStream(upstream, size,
|
|
5259
|
+
function createBufferedReadableStream(upstream, size, logger27) {
|
|
5260
5260
|
const reader = upstream.getReader();
|
|
5261
5261
|
let streamBufferingLoggedWarning = false;
|
|
5262
5262
|
let bytesSeen = 0;
|
|
@@ -5294,7 +5294,7 @@ function createBufferedReadableStream(upstream, size, logger26) {
|
|
|
5294
5294
|
const newSize = merge(buffers, mode, chunk);
|
|
5295
5295
|
if (!streamBufferingLoggedWarning && bytesSeen > size * 2) {
|
|
5296
5296
|
streamBufferingLoggedWarning = true;
|
|
5297
|
-
|
|
5297
|
+
logger27?.warn(`@smithy/util-stream - stream chunk size ${chunkSize} is below threshold of ${size}, automatically buffering.`);
|
|
5298
5298
|
}
|
|
5299
5299
|
if (newSize >= size) {
|
|
5300
5300
|
controller.enqueue(flush(buffers, mode));
|
|
@@ -5358,9 +5358,9 @@ var init_createBufferedReadable_browser = __esm({
|
|
|
5358
5358
|
});
|
|
5359
5359
|
|
|
5360
5360
|
// node_modules/@smithy/core/dist-es/submodules/serde/util-stream/createBufferedReadable.js
|
|
5361
|
-
function createBufferedReadable(upstream, size,
|
|
5361
|
+
function createBufferedReadable(upstream, size, logger27) {
|
|
5362
5362
|
if (isReadableStream(upstream)) {
|
|
5363
|
-
return createBufferedReadableStream(upstream, size,
|
|
5363
|
+
return createBufferedReadableStream(upstream, size, logger27);
|
|
5364
5364
|
}
|
|
5365
5365
|
const downstream = new import_node_stream2.Readable({ read() {
|
|
5366
5366
|
} });
|
|
@@ -5393,7 +5393,7 @@ function createBufferedReadable(upstream, size, logger26) {
|
|
|
5393
5393
|
const newSize = merge(buffers, mode, chunk);
|
|
5394
5394
|
if (!streamBufferingLoggedWarning && bytesSeen > size * 2) {
|
|
5395
5395
|
streamBufferingLoggedWarning = true;
|
|
5396
|
-
|
|
5396
|
+
logger27?.warn(`@smithy/util-stream - stream chunk size ${chunkSize} is below threshold of ${size}, automatically buffering.`);
|
|
5397
5397
|
}
|
|
5398
5398
|
if (newSize >= size) {
|
|
5399
5399
|
downstream.push(flush(buffers, mode));
|
|
@@ -9159,7 +9159,7 @@ var require_dist_cjs9 = __commonJS({
|
|
|
9159
9159
|
evaluateTreeRule
|
|
9160
9160
|
};
|
|
9161
9161
|
var resolveEndpoint4 = /* @__PURE__ */ __name((ruleSetObject, options) => {
|
|
9162
|
-
const { endpointParams, logger:
|
|
9162
|
+
const { endpointParams, logger: logger27 } = options;
|
|
9163
9163
|
const { parameters, rules } = ruleSetObject;
|
|
9164
9164
|
options.logger?.debug?.(`${debugId} Initial EndpointParams: ${toDebugString(endpointParams)}`);
|
|
9165
9165
|
const paramsWithDefault = Object.entries(parameters).filter(([, v5]) => v5.default != null).map(([k4, v5]) => [k4, v5.default]);
|
|
@@ -9174,7 +9174,7 @@ var require_dist_cjs9 = __commonJS({
|
|
|
9174
9174
|
throw new EndpointError(`Missing required parameter: '${requiredParam}'`);
|
|
9175
9175
|
}
|
|
9176
9176
|
}
|
|
9177
|
-
const endpoint = evaluateRules(rules, { endpointParams, logger:
|
|
9177
|
+
const endpoint = evaluateRules(rules, { endpointParams, logger: logger27, referenceRecord: {} });
|
|
9178
9178
|
options.logger?.debug?.(`${debugId} Resolved endpoint: ${toDebugString(endpoint)}`);
|
|
9179
9179
|
return endpoint;
|
|
9180
9180
|
}, "resolveEndpoint");
|
|
@@ -9961,19 +9961,19 @@ var require_dist_cjs13 = __commonJS({
|
|
|
9961
9961
|
name = "ProviderError";
|
|
9962
9962
|
tryNextLink;
|
|
9963
9963
|
constructor(message, options = true) {
|
|
9964
|
-
let
|
|
9964
|
+
let logger27;
|
|
9965
9965
|
let tryNextLink = true;
|
|
9966
9966
|
if (typeof options === "boolean") {
|
|
9967
|
-
|
|
9967
|
+
logger27 = void 0;
|
|
9968
9968
|
tryNextLink = options;
|
|
9969
9969
|
} else if (options != null && typeof options === "object") {
|
|
9970
|
-
|
|
9970
|
+
logger27 = options.logger;
|
|
9971
9971
|
tryNextLink = options.tryNextLink ?? true;
|
|
9972
9972
|
}
|
|
9973
9973
|
super(message);
|
|
9974
9974
|
this.tryNextLink = tryNextLink;
|
|
9975
9975
|
Object.setPrototypeOf(this, _ProviderError.prototype);
|
|
9976
|
-
|
|
9976
|
+
logger27?.debug?.(`@smithy/property-provider ${tryNextLink ? "->" : "(!)"} ${message}`);
|
|
9977
9977
|
}
|
|
9978
9978
|
static from(error2, options = true) {
|
|
9979
9979
|
return Object.assign(new this(error2.message, options), error2);
|
|
@@ -12769,9 +12769,9 @@ var require_dist_cjs21 = __commonJS({
|
|
|
12769
12769
|
this.middlewareStack.use(mw);
|
|
12770
12770
|
}
|
|
12771
12771
|
const stack = clientStack.concat(this.middlewareStack);
|
|
12772
|
-
const { logger:
|
|
12772
|
+
const { logger: logger27 } = configuration;
|
|
12773
12773
|
const handlerExecutionContext = {
|
|
12774
|
-
logger:
|
|
12774
|
+
logger: logger27,
|
|
12775
12775
|
clientName,
|
|
12776
12776
|
commandName,
|
|
12777
12777
|
inputFilterSensitiveLog,
|
|
@@ -16398,11 +16398,11 @@ var require_dist_cjs24 = __commonJS({
|
|
|
16398
16398
|
userAgentAppId: /* @__PURE__ */ __name(async () => {
|
|
16399
16399
|
const appId = await normalizedAppIdProvider();
|
|
16400
16400
|
if (!isValidUserAgentAppId(appId)) {
|
|
16401
|
-
const
|
|
16401
|
+
const logger27 = input.logger?.constructor?.name === "NoOpLogger" || !input.logger ? console : input.logger;
|
|
16402
16402
|
if (typeof appId !== "string") {
|
|
16403
|
-
|
|
16403
|
+
logger27?.warn("userAgentAppId must be a string or undefined.");
|
|
16404
16404
|
} else if (appId.length > 50) {
|
|
16405
|
-
|
|
16405
|
+
logger27?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.");
|
|
16406
16406
|
}
|
|
16407
16407
|
}
|
|
16408
16408
|
return appId;
|
|
@@ -17289,8 +17289,8 @@ var require_dist_cjs30 = __commonJS({
|
|
|
17289
17289
|
var isFunction2 = /* @__PURE__ */ __name((func) => typeof func === "function", "isFunction");
|
|
17290
17290
|
var fromStatic2 = /* @__PURE__ */ __name((defaultValue) => isFunction2(defaultValue) ? async () => await defaultValue() : propertyProvider.fromStatic(defaultValue), "fromStatic");
|
|
17291
17291
|
var loadConfig2 = /* @__PURE__ */ __name(({ environmentVariableSelector, configFileSelector, default: defaultValue }, configuration = {}) => {
|
|
17292
|
-
const { signingName, logger:
|
|
17293
|
-
const envOptions = { signingName, logger:
|
|
17292
|
+
const { signingName, logger: logger27 } = configuration;
|
|
17293
|
+
const envOptions = { signingName, logger: logger27 };
|
|
17294
17294
|
return propertyProvider.memoize(propertyProvider.chain(fromEnv2(environmentVariableSelector, envOptions), fromSharedConfigFiles2(configFileSelector, configuration), fromStatic2(defaultValue)));
|
|
17295
17295
|
}, "loadConfig");
|
|
17296
17296
|
exports2.loadConfig = loadConfig2;
|
|
@@ -19661,7 +19661,7 @@ var require_dist_cjs40 = __commonJS({
|
|
|
19661
19661
|
"http:": true,
|
|
19662
19662
|
"https:": true
|
|
19663
19663
|
};
|
|
19664
|
-
var getCmdsUri = /* @__PURE__ */ __name(async ({ logger:
|
|
19664
|
+
var getCmdsUri = /* @__PURE__ */ __name(async ({ logger: logger27 }) => {
|
|
19665
19665
|
if (process.env[ENV_CMDS_RELATIVE_URI]) {
|
|
19666
19666
|
return {
|
|
19667
19667
|
hostname: CMDS_IP,
|
|
@@ -19673,13 +19673,13 @@ var require_dist_cjs40 = __commonJS({
|
|
|
19673
19673
|
if (!parsed.hostname || !(parsed.hostname in GREENGRASS_HOSTS)) {
|
|
19674
19674
|
throw new propertyProvider.CredentialsProviderError(`${parsed.hostname} is not a valid container metadata service hostname`, {
|
|
19675
19675
|
tryNextLink: false,
|
|
19676
|
-
logger:
|
|
19676
|
+
logger: logger27
|
|
19677
19677
|
});
|
|
19678
19678
|
}
|
|
19679
19679
|
if (!parsed.protocol || !(parsed.protocol in GREENGRASS_PROTOCOLS)) {
|
|
19680
19680
|
throw new propertyProvider.CredentialsProviderError(`${parsed.protocol} is not a valid container metadata service protocol`, {
|
|
19681
19681
|
tryNextLink: false,
|
|
19682
|
-
logger:
|
|
19682
|
+
logger: logger27
|
|
19683
19683
|
});
|
|
19684
19684
|
}
|
|
19685
19685
|
return {
|
|
@@ -19689,7 +19689,7 @@ var require_dist_cjs40 = __commonJS({
|
|
|
19689
19689
|
}
|
|
19690
19690
|
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`, {
|
|
19691
19691
|
tryNextLink: false,
|
|
19692
|
-
logger:
|
|
19692
|
+
logger: logger27
|
|
19693
19693
|
});
|
|
19694
19694
|
}, "getCmdsUri");
|
|
19695
19695
|
var InstanceMetadataV1FallbackError = class _InstanceMetadataV1FallbackError extends propertyProvider.CredentialsProviderError {
|
|
@@ -19744,10 +19744,10 @@ var require_dist_cjs40 = __commonJS({
|
|
|
19744
19744
|
var STATIC_STABILITY_REFRESH_INTERVAL_SECONDS = 5 * 60;
|
|
19745
19745
|
var STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS = 5 * 60;
|
|
19746
19746
|
var STATIC_STABILITY_DOC_URL = "https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html";
|
|
19747
|
-
var getExtendedInstanceMetadataCredentials = /* @__PURE__ */ __name((credentials,
|
|
19747
|
+
var getExtendedInstanceMetadataCredentials = /* @__PURE__ */ __name((credentials, logger27) => {
|
|
19748
19748
|
const refreshInterval = STATIC_STABILITY_REFRESH_INTERVAL_SECONDS + Math.floor(Math.random() * STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS);
|
|
19749
19749
|
const newExpiration = new Date(Date.now() + refreshInterval * 1e3);
|
|
19750
|
-
|
|
19750
|
+
logger27.warn(`Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(newExpiration)}.
|
|
19751
19751
|
For more information, please visit: ` + STATIC_STABILITY_DOC_URL);
|
|
19752
19752
|
const originalExpiration = credentials.originalExpiration ?? credentials.expiration;
|
|
19753
19753
|
return {
|
|
@@ -19757,19 +19757,19 @@ For more information, please visit: ` + STATIC_STABILITY_DOC_URL);
|
|
|
19757
19757
|
};
|
|
19758
19758
|
}, "getExtendedInstanceMetadataCredentials");
|
|
19759
19759
|
var staticStabilityProvider = /* @__PURE__ */ __name((provider, options = {}) => {
|
|
19760
|
-
const
|
|
19760
|
+
const logger27 = options?.logger || console;
|
|
19761
19761
|
let pastCredentials;
|
|
19762
19762
|
return async () => {
|
|
19763
19763
|
let credentials;
|
|
19764
19764
|
try {
|
|
19765
19765
|
credentials = await provider();
|
|
19766
19766
|
if (credentials.expiration && credentials.expiration.getTime() < Date.now()) {
|
|
19767
|
-
credentials = getExtendedInstanceMetadataCredentials(credentials,
|
|
19767
|
+
credentials = getExtendedInstanceMetadataCredentials(credentials, logger27);
|
|
19768
19768
|
}
|
|
19769
19769
|
} catch (e4) {
|
|
19770
19770
|
if (pastCredentials) {
|
|
19771
|
-
|
|
19772
|
-
credentials = getExtendedInstanceMetadataCredentials(pastCredentials,
|
|
19771
|
+
logger27.warn("Credential renew failed: ", e4);
|
|
19772
|
+
credentials = getExtendedInstanceMetadataCredentials(pastCredentials, logger27);
|
|
19773
19773
|
} else {
|
|
19774
19774
|
throw e4;
|
|
19775
19775
|
}
|
|
@@ -19786,7 +19786,7 @@ For more information, please visit: ` + STATIC_STABILITY_DOC_URL);
|
|
|
19786
19786
|
var fromInstanceMetadata = /* @__PURE__ */ __name((init = {}) => staticStabilityProvider(getInstanceMetadataProvider(init), { logger: init.logger }), "fromInstanceMetadata");
|
|
19787
19787
|
var getInstanceMetadataProvider = /* @__PURE__ */ __name((init = {}) => {
|
|
19788
19788
|
let disableFetchToken = false;
|
|
19789
|
-
const { logger:
|
|
19789
|
+
const { logger: logger27, profile } = init;
|
|
19790
19790
|
const { timeout, maxRetries } = providerConfigFromInit(init);
|
|
19791
19791
|
const getCredentials = /* @__PURE__ */ __name(async (maxRetries2, options) => {
|
|
19792
19792
|
const isImdsV1Fallback = disableFetchToken || options.headers?.[X_AWS_EC2_METADATA_TOKEN] == null;
|
|
@@ -19850,7 +19850,7 @@ For more information, please visit: ` + STATIC_STABILITY_DOC_URL);
|
|
|
19850
19850
|
return async () => {
|
|
19851
19851
|
const endpoint = await getInstanceMetadataEndpoint();
|
|
19852
19852
|
if (disableFetchToken) {
|
|
19853
|
-
|
|
19853
|
+
logger27?.debug("AWS SDK Instance Metadata", "using v1 fallback (no token fetch)");
|
|
19854
19854
|
return getCredentials(maxRetries, { ...endpoint, timeout });
|
|
19855
19855
|
} else {
|
|
19856
19856
|
let token;
|
|
@@ -19864,7 +19864,7 @@ For more information, please visit: ` + STATIC_STABILITY_DOC_URL);
|
|
|
19864
19864
|
} else if (error2.message === "TimeoutError" || [403, 404, 405].includes(error2.statusCode)) {
|
|
19865
19865
|
disableFetchToken = true;
|
|
19866
19866
|
}
|
|
19867
|
-
|
|
19867
|
+
logger27?.debug("AWS SDK Instance Metadata", "using v1 fallback (initial)");
|
|
19868
19868
|
return getCredentials(maxRetries, { ...endpoint, timeout });
|
|
19869
19869
|
}
|
|
19870
19870
|
return getCredentials(maxRetries, {
|
|
@@ -20168,7 +20168,7 @@ var require_dist_cjs43 = __commonJS({
|
|
|
20168
20168
|
}
|
|
20169
20169
|
return timing.setTimeout(registerTimeout.bind(null, DEFER_EVENT_LISTENER_TIME$2), DEFER_EVENT_LISTENER_TIME$2);
|
|
20170
20170
|
}, "setConnectionTimeout");
|
|
20171
|
-
var setRequestTimeout = /* @__PURE__ */ __name((req, reject, timeoutInMs = 0, throwOnRequestTimeout,
|
|
20171
|
+
var setRequestTimeout = /* @__PURE__ */ __name((req, reject, timeoutInMs = 0, throwOnRequestTimeout, logger27) => {
|
|
20172
20172
|
if (timeoutInMs) {
|
|
20173
20173
|
return timing.setTimeout(() => {
|
|
20174
20174
|
let msg = `@smithy/node-http-handler - [${throwOnRequestTimeout ? "ERROR" : "WARN"}] a request has exceeded the configured ${timeoutInMs} ms requestTimeout.`;
|
|
@@ -20181,7 +20181,7 @@ var require_dist_cjs43 = __commonJS({
|
|
|
20181
20181
|
reject(error2);
|
|
20182
20182
|
} else {
|
|
20183
20183
|
msg += ` Init client requestHandler with throwOnRequestTimeout=true to turn this into an error.`;
|
|
20184
|
-
|
|
20184
|
+
logger27?.warn?.(msg);
|
|
20185
20185
|
}
|
|
20186
20186
|
}, timeoutInMs);
|
|
20187
20187
|
}
|
|
@@ -20297,7 +20297,7 @@ var require_dist_cjs43 = __commonJS({
|
|
|
20297
20297
|
}
|
|
20298
20298
|
return new _NodeHttpHandler(instanceOrOptions);
|
|
20299
20299
|
}
|
|
20300
|
-
static checkSocketUsage(agent, socketWarningTimestamp,
|
|
20300
|
+
static checkSocketUsage(agent, socketWarningTimestamp, logger27 = console) {
|
|
20301
20301
|
const { sockets, requests, maxSockets } = agent;
|
|
20302
20302
|
if (typeof maxSockets !== "number" || maxSockets === Infinity) {
|
|
20303
20303
|
return socketWarningTimestamp;
|
|
@@ -20311,7 +20311,7 @@ var require_dist_cjs43 = __commonJS({
|
|
|
20311
20311
|
const socketsInUse = sockets[origin]?.length ?? 0;
|
|
20312
20312
|
const requestsEnqueued = requests[origin]?.length ?? 0;
|
|
20313
20313
|
if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) {
|
|
20314
|
-
|
|
20314
|
+
logger27?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${socketsInUse} and ${requestsEnqueued} additional requests are enqueued.
|
|
20315
20315
|
See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
|
|
20316
20316
|
or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`);
|
|
20317
20317
|
return Date.now();
|
|
@@ -20841,7 +20841,7 @@ var require_checkUrl = __commonJS({
|
|
|
20841
20841
|
var ECS_CONTAINER_HOST = "169.254.170.2";
|
|
20842
20842
|
var EKS_CONTAINER_HOST_IPv4 = "169.254.170.23";
|
|
20843
20843
|
var EKS_CONTAINER_HOST_IPv6 = "[fd00:ec2::23]";
|
|
20844
|
-
var checkUrl = /* @__PURE__ */ __name((url,
|
|
20844
|
+
var checkUrl = /* @__PURE__ */ __name((url, logger27) => {
|
|
20845
20845
|
if (url.protocol === "https:") {
|
|
20846
20846
|
return;
|
|
20847
20847
|
}
|
|
@@ -20868,7 +20868,7 @@ var require_checkUrl = __commonJS({
|
|
|
20868
20868
|
throw new property_provider_1.CredentialsProviderError(`URL not accepted. It must either be HTTPS or match one of the following:
|
|
20869
20869
|
- loopback CIDR 127.0.0.0/8 or [::1/128]
|
|
20870
20870
|
- ECS container host 169.254.170.2
|
|
20871
|
-
- EKS container host 169.254.170.23 or [fd00:ec2::23]`, { logger:
|
|
20871
|
+
- EKS container host 169.254.170.23 or [fd00:ec2::23]`, { logger: logger27 });
|
|
20872
20872
|
}, "checkUrl");
|
|
20873
20873
|
exports2.checkUrl = checkUrl;
|
|
20874
20874
|
}
|
|
@@ -21085,7 +21085,7 @@ var require_createBufferedReadableStream = __commonJS({
|
|
|
21085
21085
|
exports2.sizeOf = sizeOf2;
|
|
21086
21086
|
exports2.modeOf = modeOf2;
|
|
21087
21087
|
var ByteArrayCollector_1 = require_ByteArrayCollector();
|
|
21088
|
-
function createBufferedReadableStream2(upstream, size,
|
|
21088
|
+
function createBufferedReadableStream2(upstream, size, logger27) {
|
|
21089
21089
|
const reader = upstream.getReader();
|
|
21090
21090
|
let streamBufferingLoggedWarning = false;
|
|
21091
21091
|
let bytesSeen = 0;
|
|
@@ -21123,7 +21123,7 @@ var require_createBufferedReadableStream = __commonJS({
|
|
|
21123
21123
|
const newSize = merge2(buffers, mode, chunk);
|
|
21124
21124
|
if (!streamBufferingLoggedWarning && bytesSeen > size * 2) {
|
|
21125
21125
|
streamBufferingLoggedWarning = true;
|
|
21126
|
-
|
|
21126
|
+
logger27?.warn(`@smithy/util-stream - stream chunk size ${chunkSize} is below threshold of ${size}, automatically buffering.`);
|
|
21127
21127
|
}
|
|
21128
21128
|
if (newSize >= size) {
|
|
21129
21129
|
controller.enqueue(flush2(buffers, mode));
|
|
@@ -21194,9 +21194,9 @@ var require_createBufferedReadable = __commonJS({
|
|
|
21194
21194
|
var ByteArrayCollector_1 = require_ByteArrayCollector();
|
|
21195
21195
|
var createBufferedReadableStream_1 = require_createBufferedReadableStream();
|
|
21196
21196
|
var stream_type_check_1 = require_stream_type_check();
|
|
21197
|
-
function createBufferedReadable2(upstream, size,
|
|
21197
|
+
function createBufferedReadable2(upstream, size, logger27) {
|
|
21198
21198
|
if ((0, stream_type_check_1.isReadableStream)(upstream)) {
|
|
21199
|
-
return (0, createBufferedReadableStream_1.createBufferedReadableStream)(upstream, size,
|
|
21199
|
+
return (0, createBufferedReadableStream_1.createBufferedReadableStream)(upstream, size, logger27);
|
|
21200
21200
|
}
|
|
21201
21201
|
const downstream = new node_stream_1.Readable({ read() {
|
|
21202
21202
|
} });
|
|
@@ -21229,7 +21229,7 @@ var require_createBufferedReadable = __commonJS({
|
|
|
21229
21229
|
const newSize = (0, createBufferedReadableStream_1.merge)(buffers, mode, chunk);
|
|
21230
21230
|
if (!streamBufferingLoggedWarning && bytesSeen > size * 2) {
|
|
21231
21231
|
streamBufferingLoggedWarning = true;
|
|
21232
|
-
|
|
21232
|
+
logger27?.warn(`@smithy/util-stream - stream chunk size ${chunkSize} is below threshold of ${size}, automatically buffering.`);
|
|
21233
21233
|
}
|
|
21234
21234
|
if (newSize >= size) {
|
|
21235
21235
|
downstream.push((0, createBufferedReadableStream_1.flush)(buffers, mode));
|
|
@@ -22071,13 +22071,13 @@ var require_requestHelpers = __commonJS({
|
|
|
22071
22071
|
});
|
|
22072
22072
|
}
|
|
22073
22073
|
__name(createGetRequest, "createGetRequest");
|
|
22074
|
-
async function getCredentials(response,
|
|
22074
|
+
async function getCredentials(response, logger27) {
|
|
22075
22075
|
const stream = (0, util_stream_1.sdkStreamMixin)(response.body);
|
|
22076
22076
|
const str = await stream.transformToString();
|
|
22077
22077
|
if (response.statusCode === 200) {
|
|
22078
22078
|
const parsed = JSON.parse(str);
|
|
22079
22079
|
if (typeof parsed.AccessKeyId !== "string" || typeof parsed.SecretAccessKey !== "string" || typeof parsed.Token !== "string" || typeof parsed.Expiration !== "string") {
|
|
22080
|
-
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:
|
|
22080
|
+
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: logger27 });
|
|
22081
22081
|
}
|
|
22082
22082
|
return {
|
|
22083
22083
|
accessKeyId: parsed.AccessKeyId,
|
|
@@ -22092,12 +22092,12 @@ var require_requestHelpers = __commonJS({
|
|
|
22092
22092
|
parsedBody = JSON.parse(str);
|
|
22093
22093
|
} catch (e4) {
|
|
22094
22094
|
}
|
|
22095
|
-
throw Object.assign(new property_provider_1.CredentialsProviderError(`Server responded with status: ${response.statusCode}`, { logger:
|
|
22095
|
+
throw Object.assign(new property_provider_1.CredentialsProviderError(`Server responded with status: ${response.statusCode}`, { logger: logger27 }), {
|
|
22096
22096
|
Code: parsedBody.Code,
|
|
22097
22097
|
Message: parsedBody.Message
|
|
22098
22098
|
});
|
|
22099
22099
|
}
|
|
22100
|
-
throw new property_provider_1.CredentialsProviderError(`Server responded with status: ${response.statusCode}`, { logger:
|
|
22100
|
+
throw new property_provider_1.CredentialsProviderError(`Server responded with status: ${response.statusCode}`, { logger: logger27 });
|
|
22101
22101
|
}
|
|
22102
22102
|
__name(getCredentials, "getCredentials");
|
|
22103
22103
|
}
|
|
@@ -23461,14 +23461,14 @@ var require_dist_cjs53 = __commonJS({
|
|
|
23461
23461
|
var propertyProvider = require_dist_cjs13();
|
|
23462
23462
|
var sharedIniFileLoader = require_dist_cjs29();
|
|
23463
23463
|
var fs = require("fs");
|
|
23464
|
-
var fromEnvSigningName = /* @__PURE__ */ __name(({ logger:
|
|
23465
|
-
|
|
23464
|
+
var fromEnvSigningName = /* @__PURE__ */ __name(({ logger: logger27, signingName } = {}) => async () => {
|
|
23465
|
+
logger27?.debug?.("@aws-sdk/token-providers - fromEnvSigningName");
|
|
23466
23466
|
if (!signingName) {
|
|
23467
|
-
throw new propertyProvider.TokenProviderError("Please pass 'signingName' to compute environment variable key", { logger:
|
|
23467
|
+
throw new propertyProvider.TokenProviderError("Please pass 'signingName' to compute environment variable key", { logger: logger27 });
|
|
23468
23468
|
}
|
|
23469
23469
|
const bearerTokenKey = httpAuthSchemes.getBearerTokenEnvKey(signingName);
|
|
23470
23470
|
if (!(bearerTokenKey in process.env)) {
|
|
23471
|
-
throw new propertyProvider.TokenProviderError(`Token not present in '${bearerTokenKey}' environment variable`, { logger:
|
|
23471
|
+
throw new propertyProvider.TokenProviderError(`Token not present in '${bearerTokenKey}' environment variable`, { logger: logger27 });
|
|
23472
23472
|
}
|
|
23473
23473
|
const token = { token: process.env[bearerTokenKey] };
|
|
23474
23474
|
client.setTokenFeature(token, "BEARER_SERVICE_ENV_VARS", "3");
|
|
@@ -23589,8 +23589,8 @@ var require_dist_cjs53 = __commonJS({
|
|
|
23589
23589
|
return existingToken;
|
|
23590
23590
|
}
|
|
23591
23591
|
}, "fromSso");
|
|
23592
|
-
var fromStatic2 = /* @__PURE__ */ __name(({ token, logger:
|
|
23593
|
-
|
|
23592
|
+
var fromStatic2 = /* @__PURE__ */ __name(({ token, logger: logger27 }) => async () => {
|
|
23593
|
+
logger27?.debug("@aws-sdk/token-providers - fromStatic");
|
|
23594
23594
|
if (!token || !token.token) {
|
|
23595
23595
|
throw new propertyProvider.TokenProviderError(`Please pass a valid token to fromStatic`, false);
|
|
23596
23596
|
}
|
|
@@ -24379,7 +24379,7 @@ var require_dist_cjs55 = __commonJS({
|
|
|
24379
24379
|
var tokenProviders = require_dist_cjs53();
|
|
24380
24380
|
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");
|
|
24381
24381
|
var SHOULD_FAIL_CREDENTIAL_CHAIN = false;
|
|
24382
|
-
var resolveSSOCredentials = /* @__PURE__ */ __name(async ({ ssoStartUrl, ssoSession, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, clientConfig, parentClientConfig, profile, filepath, configFilepath, ignoreCache, logger:
|
|
24382
|
+
var resolveSSOCredentials = /* @__PURE__ */ __name(async ({ ssoStartUrl, ssoSession, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, clientConfig, parentClientConfig, profile, filepath, configFilepath, ignoreCache, logger: logger27 }) => {
|
|
24383
24383
|
let token;
|
|
24384
24384
|
const refreshMessage = `To refresh this SSO session run aws sso login with the corresponding profile.`;
|
|
24385
24385
|
if (ssoSession) {
|
|
@@ -24397,7 +24397,7 @@ var require_dist_cjs55 = __commonJS({
|
|
|
24397
24397
|
} catch (e4) {
|
|
24398
24398
|
throw new propertyProvider.CredentialsProviderError(e4.message, {
|
|
24399
24399
|
tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
|
|
24400
|
-
logger:
|
|
24400
|
+
logger: logger27
|
|
24401
24401
|
});
|
|
24402
24402
|
}
|
|
24403
24403
|
} else {
|
|
@@ -24406,14 +24406,14 @@ var require_dist_cjs55 = __commonJS({
|
|
|
24406
24406
|
} catch (e4) {
|
|
24407
24407
|
throw new propertyProvider.CredentialsProviderError(`The SSO session associated with this profile is invalid. ${refreshMessage}`, {
|
|
24408
24408
|
tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
|
|
24409
|
-
logger:
|
|
24409
|
+
logger: logger27
|
|
24410
24410
|
});
|
|
24411
24411
|
}
|
|
24412
24412
|
}
|
|
24413
24413
|
if (new Date(token.expiresAt).getTime() - Date.now() <= 0) {
|
|
24414
24414
|
throw new propertyProvider.CredentialsProviderError(`The SSO session associated with this profile has expired. ${refreshMessage}`, {
|
|
24415
24415
|
tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
|
|
24416
|
-
logger:
|
|
24416
|
+
logger: logger27
|
|
24417
24417
|
});
|
|
24418
24418
|
}
|
|
24419
24419
|
const { accessToken } = token;
|
|
@@ -24435,14 +24435,14 @@ var require_dist_cjs55 = __commonJS({
|
|
|
24435
24435
|
} catch (e4) {
|
|
24436
24436
|
throw new propertyProvider.CredentialsProviderError(e4, {
|
|
24437
24437
|
tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
|
|
24438
|
-
logger:
|
|
24438
|
+
logger: logger27
|
|
24439
24439
|
});
|
|
24440
24440
|
}
|
|
24441
24441
|
const { roleCredentials: { accessKeyId, secretAccessKey, sessionToken, expiration, credentialScope, accountId } = {} } = ssoResp;
|
|
24442
24442
|
if (!accessKeyId || !secretAccessKey || !sessionToken || !expiration) {
|
|
24443
24443
|
throw new propertyProvider.CredentialsProviderError("SSO returns an invalid temporary credential.", {
|
|
24444
24444
|
tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN,
|
|
24445
|
-
logger:
|
|
24445
|
+
logger: logger27
|
|
24446
24446
|
});
|
|
24447
24447
|
}
|
|
24448
24448
|
const credentials = {
|
|
@@ -24460,11 +24460,11 @@ var require_dist_cjs55 = __commonJS({
|
|
|
24460
24460
|
}
|
|
24461
24461
|
return credentials;
|
|
24462
24462
|
}, "resolveSSOCredentials");
|
|
24463
|
-
var validateSsoProfile = /* @__PURE__ */ __name((profile,
|
|
24463
|
+
var validateSsoProfile = /* @__PURE__ */ __name((profile, logger27) => {
|
|
24464
24464
|
const { sso_start_url, sso_account_id, sso_region, sso_role_name } = profile;
|
|
24465
24465
|
if (!sso_start_url || !sso_account_id || !sso_region || !sso_role_name) {
|
|
24466
24466
|
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(", ")}
|
|
24467
|
-
Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`, { tryNextLink: false, logger:
|
|
24467
|
+
Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`, { tryNextLink: false, logger: logger27 });
|
|
24468
24468
|
}
|
|
24469
24469
|
return profile;
|
|
24470
24470
|
}, "validateSsoProfile");
|
|
@@ -25247,7 +25247,7 @@ var require_dist_cjs56 = __commonJS({
|
|
|
25247
25247
|
}
|
|
25248
25248
|
async refresh(token) {
|
|
25249
25249
|
const { SigninClient: SigninClient2, CreateOAuth2TokenCommand: CreateOAuth2TokenCommand2 } = await Promise.resolve().then(() => (init_signin(), signin_exports));
|
|
25250
|
-
const { logger:
|
|
25250
|
+
const { logger: logger27, userAgentAppId } = this.callerClientConfig ?? {};
|
|
25251
25251
|
const isH22 = /* @__PURE__ */ __name((requestHandler2) => {
|
|
25252
25252
|
return requestHandler2?.metadata?.handlerProtocol === "h2";
|
|
25253
25253
|
}, "isH2");
|
|
@@ -25260,7 +25260,7 @@ var require_dist_cjs56 = __commonJS({
|
|
|
25260
25260
|
},
|
|
25261
25261
|
region,
|
|
25262
25262
|
requestHandler,
|
|
25263
|
-
logger:
|
|
25263
|
+
logger: logger27,
|
|
25264
25264
|
userAgentAppId,
|
|
25265
25265
|
...this.init?.clientConfig
|
|
25266
25266
|
});
|
|
@@ -26278,9 +26278,9 @@ var init_defaultStsRoleAssumers = __esm({
|
|
|
26278
26278
|
return async (sourceCreds, params) => {
|
|
26279
26279
|
closureSourceCreds = sourceCreds;
|
|
26280
26280
|
if (!stsClient) {
|
|
26281
|
-
const { logger:
|
|
26281
|
+
const { logger: logger27 = stsOptions?.parentClientConfig?.logger, profile = stsOptions?.parentClientConfig?.profile, region, requestHandler = stsOptions?.parentClientConfig?.requestHandler, credentialProviderLogger, userAgentAppId = stsOptions?.parentClientConfig?.userAgentAppId } = stsOptions;
|
|
26282
26282
|
const resolvedRegion = await resolveRegion(region, stsOptions?.parentClientConfig?.region, credentialProviderLogger, {
|
|
26283
|
-
logger:
|
|
26283
|
+
logger: logger27,
|
|
26284
26284
|
profile
|
|
26285
26285
|
});
|
|
26286
26286
|
const isCompatibleRequestHandler = !isH2(requestHandler);
|
|
@@ -26291,7 +26291,7 @@ var init_defaultStsRoleAssumers = __esm({
|
|
|
26291
26291
|
credentialDefaultProvider: /* @__PURE__ */ __name(() => async () => closureSourceCreds, "credentialDefaultProvider"),
|
|
26292
26292
|
region: resolvedRegion,
|
|
26293
26293
|
requestHandler: isCompatibleRequestHandler ? requestHandler : void 0,
|
|
26294
|
-
logger:
|
|
26294
|
+
logger: logger27
|
|
26295
26295
|
});
|
|
26296
26296
|
}
|
|
26297
26297
|
const { Credentials: Credentials2, AssumedRoleUser: AssumedRoleUser2 } = await stsClient.send(new AssumeRoleCommand(params));
|
|
@@ -26315,9 +26315,9 @@ var init_defaultStsRoleAssumers = __esm({
|
|
|
26315
26315
|
let stsClient;
|
|
26316
26316
|
return async (params) => {
|
|
26317
26317
|
if (!stsClient) {
|
|
26318
|
-
const { logger:
|
|
26318
|
+
const { logger: logger27 = stsOptions?.parentClientConfig?.logger, profile = stsOptions?.parentClientConfig?.profile, region, requestHandler = stsOptions?.parentClientConfig?.requestHandler, credentialProviderLogger, userAgentAppId = stsOptions?.parentClientConfig?.userAgentAppId } = stsOptions;
|
|
26319
26319
|
const resolvedRegion = await resolveRegion(region, stsOptions?.parentClientConfig?.region, credentialProviderLogger, {
|
|
26320
|
-
logger:
|
|
26320
|
+
logger: logger27,
|
|
26321
26321
|
profile
|
|
26322
26322
|
});
|
|
26323
26323
|
const isCompatibleRequestHandler = !isH2(requestHandler);
|
|
@@ -26327,7 +26327,7 @@ var init_defaultStsRoleAssumers = __esm({
|
|
|
26327
26327
|
profile,
|
|
26328
26328
|
region: resolvedRegion,
|
|
26329
26329
|
requestHandler: isCompatibleRequestHandler ? requestHandler : void 0,
|
|
26330
|
-
logger:
|
|
26330
|
+
logger: logger27
|
|
26331
26331
|
});
|
|
26332
26332
|
}
|
|
26333
26333
|
const { Credentials: Credentials2, AssumedRoleUser: AssumedRoleUser2 } = await stsClient.send(new AssumeRoleWithWebIdentityCommand(params));
|
|
@@ -26457,7 +26457,7 @@ var require_dist_cjs57 = __commonJS({
|
|
|
26457
26457
|
client.setCredentialFeature(credentials, "CREDENTIALS_PROCESS", "w");
|
|
26458
26458
|
return credentials;
|
|
26459
26459
|
}, "getValidatedProcessCredentials");
|
|
26460
|
-
var resolveProcessCredentials = /* @__PURE__ */ __name(async (profileName, profiles,
|
|
26460
|
+
var resolveProcessCredentials = /* @__PURE__ */ __name(async (profileName, profiles, logger27) => {
|
|
26461
26461
|
const profile = profiles[profileName];
|
|
26462
26462
|
if (profiles[profileName]) {
|
|
26463
26463
|
const credentialProcess = profile["credential_process"];
|
|
@@ -26473,14 +26473,14 @@ var require_dist_cjs57 = __commonJS({
|
|
|
26473
26473
|
}
|
|
26474
26474
|
return getValidatedProcessCredentials(profileName, data, profiles);
|
|
26475
26475
|
} catch (error2) {
|
|
26476
|
-
throw new propertyProvider.CredentialsProviderError(error2.message, { logger:
|
|
26476
|
+
throw new propertyProvider.CredentialsProviderError(error2.message, { logger: logger27 });
|
|
26477
26477
|
}
|
|
26478
26478
|
} else {
|
|
26479
|
-
throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} did not contain credential_process.`, { logger:
|
|
26479
|
+
throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} did not contain credential_process.`, { logger: logger27 });
|
|
26480
26480
|
}
|
|
26481
26481
|
} else {
|
|
26482
26482
|
throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} could not be found in shared credentials file.`, {
|
|
26483
|
-
logger:
|
|
26483
|
+
logger: logger27
|
|
26484
26484
|
});
|
|
26485
26485
|
}
|
|
26486
26486
|
}, "resolveProcessCredentials");
|
|
@@ -26639,21 +26639,21 @@ var require_dist_cjs59 = __commonJS({
|
|
|
26639
26639
|
var propertyProvider = require_dist_cjs13();
|
|
26640
26640
|
var client = (init_client(), __toCommonJS(client_exports));
|
|
26641
26641
|
var credentialProviderLogin = require_dist_cjs56();
|
|
26642
|
-
var resolveCredentialSource = /* @__PURE__ */ __name((credentialSource, profileName,
|
|
26642
|
+
var resolveCredentialSource = /* @__PURE__ */ __name((credentialSource, profileName, logger27) => {
|
|
26643
26643
|
const sourceProvidersMap = {
|
|
26644
26644
|
EcsContainer: /* @__PURE__ */ __name(async (options) => {
|
|
26645
26645
|
const { fromHttp } = await Promise.resolve().then(() => __toESM(require_dist_cjs47()));
|
|
26646
26646
|
const { fromContainerMetadata } = await Promise.resolve().then(() => __toESM(require_dist_cjs40()));
|
|
26647
|
-
|
|
26647
|
+
logger27?.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer");
|
|
26648
26648
|
return async () => propertyProvider.chain(fromHttp(options ?? {}), fromContainerMetadata(options))().then(setNamedProvider);
|
|
26649
26649
|
}, "EcsContainer"),
|
|
26650
26650
|
Ec2InstanceMetadata: /* @__PURE__ */ __name(async (options) => {
|
|
26651
|
-
|
|
26651
|
+
logger27?.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata");
|
|
26652
26652
|
const { fromInstanceMetadata } = await Promise.resolve().then(() => __toESM(require_dist_cjs40()));
|
|
26653
26653
|
return async () => fromInstanceMetadata(options)().then(setNamedProvider);
|
|
26654
26654
|
}, "Ec2InstanceMetadata"),
|
|
26655
26655
|
Environment: /* @__PURE__ */ __name(async (options) => {
|
|
26656
|
-
|
|
26656
|
+
logger27?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment");
|
|
26657
26657
|
const { fromEnv: fromEnv2 } = await Promise.resolve().then(() => __toESM(require_dist_cjs39()));
|
|
26658
26658
|
return async () => fromEnv2(options)().then(setNamedProvider);
|
|
26659
26659
|
}, "Environment")
|
|
@@ -26661,24 +26661,24 @@ var require_dist_cjs59 = __commonJS({
|
|
|
26661
26661
|
if (credentialSource in sourceProvidersMap) {
|
|
26662
26662
|
return sourceProvidersMap[credentialSource];
|
|
26663
26663
|
} else {
|
|
26664
|
-
throw new propertyProvider.CredentialsProviderError(`Unsupported credential source in profile ${profileName}. Got ${credentialSource}, expected EcsContainer or Ec2InstanceMetadata or Environment.`, { logger:
|
|
26664
|
+
throw new propertyProvider.CredentialsProviderError(`Unsupported credential source in profile ${profileName}. Got ${credentialSource}, expected EcsContainer or Ec2InstanceMetadata or Environment.`, { logger: logger27 });
|
|
26665
26665
|
}
|
|
26666
26666
|
}, "resolveCredentialSource");
|
|
26667
26667
|
var setNamedProvider = /* @__PURE__ */ __name((creds) => client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_NAMED_PROVIDER", "p"), "setNamedProvider");
|
|
26668
|
-
var isAssumeRoleProfile = /* @__PURE__ */ __name((arg, { profile = "default", logger:
|
|
26669
|
-
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:
|
|
26668
|
+
var isAssumeRoleProfile = /* @__PURE__ */ __name((arg, { profile = "default", logger: logger27 } = {}) => {
|
|
26669
|
+
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: logger27 }) || isCredentialSourceProfile(arg, { profile, logger: logger27 }));
|
|
26670
26670
|
}, "isAssumeRoleProfile");
|
|
26671
|
-
var isAssumeRoleWithSourceProfile = /* @__PURE__ */ __name((arg, { profile, logger:
|
|
26671
|
+
var isAssumeRoleWithSourceProfile = /* @__PURE__ */ __name((arg, { profile, logger: logger27 }) => {
|
|
26672
26672
|
const withSourceProfile = typeof arg.source_profile === "string" && typeof arg.credential_source === "undefined";
|
|
26673
26673
|
if (withSourceProfile) {
|
|
26674
|
-
|
|
26674
|
+
logger27?.debug?.(` ${profile} isAssumeRoleWithSourceProfile source_profile=${arg.source_profile}`);
|
|
26675
26675
|
}
|
|
26676
26676
|
return withSourceProfile;
|
|
26677
26677
|
}, "isAssumeRoleWithSourceProfile");
|
|
26678
|
-
var isCredentialSourceProfile = /* @__PURE__ */ __name((arg, { profile, logger:
|
|
26678
|
+
var isCredentialSourceProfile = /* @__PURE__ */ __name((arg, { profile, logger: logger27 }) => {
|
|
26679
26679
|
const withProviderProfile = typeof arg.credential_source === "string" && typeof arg.source_profile === "undefined";
|
|
26680
26680
|
if (withProviderProfile) {
|
|
26681
|
-
|
|
26681
|
+
logger27?.debug?.(` ${profile} isCredentialSourceProfile credential_source=${arg.credential_source}`);
|
|
26682
26682
|
}
|
|
26683
26683
|
return withProviderProfile;
|
|
26684
26684
|
}, "isCredentialSourceProfile");
|
|
@@ -34375,6 +34375,59 @@ var init_pagination = __esm({
|
|
|
34375
34375
|
}
|
|
34376
34376
|
});
|
|
34377
34377
|
|
|
34378
|
+
// src/server/utils/scanWarning.ts
|
|
34379
|
+
function getScanWarnThreshold() {
|
|
34380
|
+
const raw = process.env.SCAN_WARN_THRESHOLD;
|
|
34381
|
+
if (raw === void 0 || raw === "") {
|
|
34382
|
+
return DEFAULT_SCAN_WARN_THRESHOLD;
|
|
34383
|
+
}
|
|
34384
|
+
const value = Number(raw);
|
|
34385
|
+
return Number.isInteger(value) && value >= 1 ? value : DEFAULT_SCAN_WARN_THRESHOLD;
|
|
34386
|
+
}
|
|
34387
|
+
var logger5, SPARSE_SCAN_EVENT, DEFAULT_SCAN_WARN_THRESHOLD, ScanWatcher;
|
|
34388
|
+
var init_scanWarning = __esm({
|
|
34389
|
+
"src/server/utils/scanWarning.ts"() {
|
|
34390
|
+
"use strict";
|
|
34391
|
+
init_shared();
|
|
34392
|
+
logger5 = createLogger({ service: "scan-warning", level: "warn" });
|
|
34393
|
+
SPARSE_SCAN_EVENT = "SPARSE_SCAN";
|
|
34394
|
+
DEFAULT_SCAN_WARN_THRESHOLD = 5e3;
|
|
34395
|
+
__name(getScanWarnThreshold, "getScanWarnThreshold");
|
|
34396
|
+
ScanWatcher = class {
|
|
34397
|
+
constructor(context) {
|
|
34398
|
+
this.context = context;
|
|
34399
|
+
}
|
|
34400
|
+
static {
|
|
34401
|
+
__name(this, "ScanWatcher");
|
|
34402
|
+
}
|
|
34403
|
+
scanned = 0;
|
|
34404
|
+
warned = false;
|
|
34405
|
+
threshold = getScanWarnThreshold();
|
|
34406
|
+
/** 読んだ件数を加える */
|
|
34407
|
+
add(count) {
|
|
34408
|
+
this.scanned += count;
|
|
34409
|
+
if (!this.warned && this.scanned >= this.threshold) {
|
|
34410
|
+
this.warned = true;
|
|
34411
|
+
logger5.warn(
|
|
34412
|
+
`${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`,
|
|
34413
|
+
{
|
|
34414
|
+
event: SPARSE_SCAN_EVENT,
|
|
34415
|
+
...this.context,
|
|
34416
|
+
scanned: this.scanned,
|
|
34417
|
+
threshold: this.threshold,
|
|
34418
|
+
actions: [
|
|
34419
|
+
"\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",
|
|
34420
|
+
"\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",
|
|
34421
|
+
"\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"
|
|
34422
|
+
]
|
|
34423
|
+
}
|
|
34424
|
+
);
|
|
34425
|
+
}
|
|
34426
|
+
}
|
|
34427
|
+
};
|
|
34428
|
+
}
|
|
34429
|
+
});
|
|
34430
|
+
|
|
34378
34431
|
// src/server/utils/filter.ts
|
|
34379
34432
|
function parseFilterField(fieldKey) {
|
|
34380
34433
|
const parts = fieldKey.split(":");
|
|
@@ -34463,7 +34516,7 @@ function parseFilters(filter) {
|
|
|
34463
34516
|
parsedFilters.push({ parsed, value });
|
|
34464
34517
|
}
|
|
34465
34518
|
} catch (error2) {
|
|
34466
|
-
|
|
34519
|
+
logger6.error("Invalid filter field syntax", {
|
|
34467
34520
|
fieldKey,
|
|
34468
34521
|
error: error2 instanceof Error ? error2.message : String(error2)
|
|
34469
34522
|
});
|
|
@@ -34532,7 +34585,7 @@ function detectNearQuery(filter) {
|
|
|
34532
34585
|
}
|
|
34533
34586
|
return null;
|
|
34534
34587
|
}
|
|
34535
|
-
var
|
|
34588
|
+
var logger6;
|
|
34536
34589
|
var init_utils5 = __esm({
|
|
34537
34590
|
"src/server/operations/find/utils.ts"() {
|
|
34538
34591
|
"use strict";
|
|
@@ -34541,7 +34594,7 @@ var init_utils5 = __esm({
|
|
|
34541
34594
|
init_shadow();
|
|
34542
34595
|
init_filter();
|
|
34543
34596
|
init_validation2();
|
|
34544
|
-
|
|
34597
|
+
logger6 = createLogger({
|
|
34545
34598
|
service: "find-utils",
|
|
34546
34599
|
level: process.env.LOG_LEVEL || "info"
|
|
34547
34600
|
});
|
|
@@ -34558,7 +34611,7 @@ var init_utils5 = __esm({
|
|
|
34558
34611
|
async function executeIdQuery(resource, normalizedParams, requestId) {
|
|
34559
34612
|
const { sort, pagination, parsedFilters } = normalizedParams;
|
|
34560
34613
|
const { perPage, nextToken } = pagination;
|
|
34561
|
-
|
|
34614
|
+
logger7.debug("Executing ID optimized query", {
|
|
34562
34615
|
requestId,
|
|
34563
34616
|
resource,
|
|
34564
34617
|
sort,
|
|
@@ -34595,7 +34648,7 @@ async function executeSpecificIdQuery(resource, targetId, requestId) {
|
|
|
34595
34648
|
costTracker.add(queryResult.ConsumedCapacity);
|
|
34596
34649
|
const mainRecords = queryResult.Items || [];
|
|
34597
34650
|
const items = mainRecords.map((item) => extractCleanRecord(item));
|
|
34598
|
-
|
|
34651
|
+
logger7.info("ID specific query succeeded", {
|
|
34599
34652
|
requestId,
|
|
34600
34653
|
resource,
|
|
34601
34654
|
targetId,
|
|
@@ -34642,7 +34695,7 @@ async function executeInQuery(resource, targetIds, sort, requestId) {
|
|
|
34642
34695
|
const bVal = String(b4.id ?? "");
|
|
34643
34696
|
return sort.order === "ASC" ? aVal.localeCompare(bVal) : bVal.localeCompare(aVal);
|
|
34644
34697
|
});
|
|
34645
|
-
|
|
34698
|
+
logger7.info("ID $in query succeeded", {
|
|
34646
34699
|
requestId,
|
|
34647
34700
|
resource,
|
|
34648
34701
|
requestedCount: targetIds.length,
|
|
@@ -34718,7 +34771,7 @@ async function executeAllRecordsQuery(resource, sort, perPage, nextToken, parsed
|
|
|
34718
34771
|
queryResult.LastEvaluatedKey.PK,
|
|
34719
34772
|
queryResult.LastEvaluatedKey.SK
|
|
34720
34773
|
) : void 0;
|
|
34721
|
-
|
|
34774
|
+
logger7.info("ID all records query succeeded", {
|
|
34722
34775
|
requestId,
|
|
34723
34776
|
resource,
|
|
34724
34777
|
count: items.length,
|
|
@@ -34750,14 +34803,24 @@ async function executeAllRecordsQueryFullScan(resource, sort, perPage, nextToken
|
|
|
34750
34803
|
let iterations = 0;
|
|
34751
34804
|
let previousKeySignature;
|
|
34752
34805
|
let chunkSize = SCAN_CHUNK_INITIAL;
|
|
34806
|
+
const watcher = new ScanWatcher({
|
|
34807
|
+
requestId,
|
|
34808
|
+
resource,
|
|
34809
|
+
path: "id-filtered-scan",
|
|
34810
|
+
sortField: sort.field,
|
|
34811
|
+
filters: parsedFilters.map((f4) => `${f4.parsed.field}:${f4.parsed.operator}`)
|
|
34812
|
+
});
|
|
34753
34813
|
scan: while (true) {
|
|
34754
34814
|
if (++iterations > SCAN_MAX_ITERATIONS) {
|
|
34755
|
-
|
|
34815
|
+
logger7.error("executeAllRecordsQueryFullScan: \u6700\u5927\u53CD\u5FA9\u56DE\u6570\u3092\u8D85\u904E", {
|
|
34756
34816
|
requestId,
|
|
34757
34817
|
resource,
|
|
34758
34818
|
iterations
|
|
34759
34819
|
});
|
|
34760
|
-
|
|
34820
|
+
throw new AppError("INTERNAL_ERROR" /* INTERNAL_ERROR */, "ID scan exceeded the iteration limit", 500, {
|
|
34821
|
+
resource,
|
|
34822
|
+
iterations
|
|
34823
|
+
});
|
|
34761
34824
|
}
|
|
34762
34825
|
const queryResult = await executeDynamoDBOperation(
|
|
34763
34826
|
() => dbClient2.send(
|
|
@@ -34778,6 +34841,7 @@ async function executeAllRecordsQueryFullScan(resource, sort, perPage, nextToken
|
|
|
34778
34841
|
"Query"
|
|
34779
34842
|
);
|
|
34780
34843
|
costTracker.add(queryResult.ConsumedCapacity);
|
|
34844
|
+
watcher.add((queryResult.Items || []).length);
|
|
34781
34845
|
for (const row of queryResult.Items || []) {
|
|
34782
34846
|
scanned++;
|
|
34783
34847
|
if (!matchesAllFilters(extractCleanRecord(row), parsedFilters)) {
|
|
@@ -34796,19 +34860,24 @@ async function executeAllRecordsQueryFullScan(resource, sort, perPage, nextToken
|
|
|
34796
34860
|
}
|
|
34797
34861
|
const nextKeySignature = `${nextKey.PK}#${nextKey.SK}`;
|
|
34798
34862
|
if (nextKeySignature === previousKeySignature) {
|
|
34799
|
-
|
|
34863
|
+
logger7.error("executeAllRecordsQueryFullScan: \u540C\u4E00\u306ELastEvaluatedKey\u304C\u8FD4\u5374\u3055\u308C\u305F", {
|
|
34800
34864
|
requestId,
|
|
34801
34865
|
resource,
|
|
34802
34866
|
iterations
|
|
34803
34867
|
});
|
|
34804
|
-
|
|
34868
|
+
throw new AppError(
|
|
34869
|
+
"INTERNAL_ERROR" /* INTERNAL_ERROR */,
|
|
34870
|
+
"ID scan received the same LastEvaluatedKey repeatedly",
|
|
34871
|
+
500,
|
|
34872
|
+
{ resource, iterations }
|
|
34873
|
+
);
|
|
34805
34874
|
}
|
|
34806
34875
|
previousKeySignature = nextKeySignature;
|
|
34807
34876
|
exclusiveStartKey = nextKey;
|
|
34808
34877
|
chunkSize = Math.min(chunkSize * 2, SCAN_CHUNK_MAX);
|
|
34809
34878
|
}
|
|
34810
34879
|
const nextTokenValue = hasNextPage && lastReturned ? encodeNextToken(lastReturned.PK, lastReturned.SK) : void 0;
|
|
34811
|
-
|
|
34880
|
+
logger7.info("ID filtered scan query succeeded", {
|
|
34812
34881
|
requestId,
|
|
34813
34882
|
resource,
|
|
34814
34883
|
scanned,
|
|
@@ -34822,7 +34891,7 @@ async function executeAllRecordsQueryFullScan(resource, sort, perPage, nextToken
|
|
|
34822
34891
|
consumedCapacity: costTracker.getAggregated()
|
|
34823
34892
|
};
|
|
34824
34893
|
}
|
|
34825
|
-
var import_lib_dynamodb2,
|
|
34894
|
+
var import_lib_dynamodb2, logger7, SCAN_CHUNK_INITIAL, SCAN_CHUNK_MAX, SCAN_MAX_ITERATIONS;
|
|
34826
34895
|
var init_idQuery = __esm({
|
|
34827
34896
|
"src/server/operations/find/idQuery.ts"() {
|
|
34828
34897
|
"use strict";
|
|
@@ -34831,8 +34900,9 @@ var init_idQuery = __esm({
|
|
|
34831
34900
|
init_cost_tracker();
|
|
34832
34901
|
init_dynamodb3();
|
|
34833
34902
|
init_pagination();
|
|
34903
|
+
init_scanWarning();
|
|
34834
34904
|
init_utils5();
|
|
34835
|
-
|
|
34905
|
+
logger7 = createLogger({
|
|
34836
34906
|
service: "id-query",
|
|
34837
34907
|
level: process.env.LOG_LEVEL || "info"
|
|
34838
34908
|
});
|
|
@@ -34849,7 +34919,7 @@ var init_idQuery = __esm({
|
|
|
34849
34919
|
|
|
34850
34920
|
// src/server/operations/find/nearQuery.ts
|
|
34851
34921
|
async function executeNearQuery(resource, fieldName, nearQuery, limit, requestId) {
|
|
34852
|
-
|
|
34922
|
+
logger8.debug("Executing $near query", {
|
|
34853
34923
|
requestId,
|
|
34854
34924
|
resource,
|
|
34855
34925
|
fieldName,
|
|
@@ -34860,7 +34930,7 @@ async function executeNearQuery(resource, fieldName, nearQuery, limit, requestId
|
|
|
34860
34930
|
const searchFunction = /* @__PURE__ */ __name(async (geohashPrefix) => {
|
|
34861
34931
|
const dbClient2 = getDBClient();
|
|
34862
34932
|
const tableName = getTableName();
|
|
34863
|
-
|
|
34933
|
+
logger8.debug("Searching shadow records", {
|
|
34864
34934
|
requestId,
|
|
34865
34935
|
resource,
|
|
34866
34936
|
fieldName,
|
|
@@ -34885,7 +34955,7 @@ async function executeNearQuery(resource, fieldName, nearQuery, limit, requestId
|
|
|
34885
34955
|
);
|
|
34886
34956
|
costTracker.add(queryResult.ConsumedCapacity);
|
|
34887
34957
|
const shadowRecords = queryResult.Items || [];
|
|
34888
|
-
|
|
34958
|
+
logger8.debug("Shadow records found", {
|
|
34889
34959
|
requestId,
|
|
34890
34960
|
resource,
|
|
34891
34961
|
geohashPrefix,
|
|
@@ -34896,7 +34966,7 @@ async function executeNearQuery(resource, fieldName, nearQuery, limit, requestId
|
|
|
34896
34966
|
const parts = sk.split("#id#");
|
|
34897
34967
|
return parts.length === 2 ? parts[1] : null;
|
|
34898
34968
|
}).filter((id) => id !== null);
|
|
34899
|
-
|
|
34969
|
+
logger8.debug("Main record IDs extracted", {
|
|
34900
34970
|
requestId,
|
|
34901
34971
|
resource,
|
|
34902
34972
|
geohashPrefix,
|
|
@@ -34930,14 +35000,14 @@ async function executeNearQuery(resource, fieldName, nearQuery, limit, requestId
|
|
|
34930
35000
|
}
|
|
34931
35001
|
validRecords.push(...batchGetResult.Responses?.[tableName] || []);
|
|
34932
35002
|
}
|
|
34933
|
-
|
|
35003
|
+
logger8.debug("Main records retrieved", {
|
|
34934
35004
|
requestId,
|
|
34935
35005
|
resource,
|
|
34936
35006
|
geohashPrefix,
|
|
34937
35007
|
count: validRecords.length
|
|
34938
35008
|
});
|
|
34939
35009
|
const cleanRecords = validRecords.map((record) => extractCleanRecord(record));
|
|
34940
|
-
|
|
35010
|
+
logger8.debug("Clean records extracted", {
|
|
34941
35011
|
requestId,
|
|
34942
35012
|
resource,
|
|
34943
35013
|
geohashPrefix,
|
|
@@ -34956,7 +35026,7 @@ async function executeNearQuery(resource, fieldName, nearQuery, limit, requestId
|
|
|
34956
35026
|
config
|
|
34957
35027
|
);
|
|
34958
35028
|
const items = result.documents;
|
|
34959
|
-
|
|
35029
|
+
logger8.info("$near query succeeded", {
|
|
34960
35030
|
requestId,
|
|
34961
35031
|
resource,
|
|
34962
35032
|
fieldName,
|
|
@@ -34974,7 +35044,7 @@ async function executeNearQuery(resource, fieldName, nearQuery, limit, requestId
|
|
|
34974
35044
|
consumedCapacity: costTracker.getAggregated()
|
|
34975
35045
|
};
|
|
34976
35046
|
}
|
|
34977
|
-
var import_lib_dynamodb3,
|
|
35047
|
+
var import_lib_dynamodb3, logger8;
|
|
34978
35048
|
var init_nearQuery = __esm({
|
|
34979
35049
|
"src/server/operations/find/nearQuery.ts"() {
|
|
34980
35050
|
"use strict";
|
|
@@ -34984,7 +35054,7 @@ var init_nearQuery = __esm({
|
|
|
34984
35054
|
init_nearSearch();
|
|
34985
35055
|
init_cost_tracker();
|
|
34986
35056
|
init_dynamodb3();
|
|
34987
|
-
|
|
35057
|
+
logger8 = createLogger({
|
|
34988
35058
|
service: "near-query",
|
|
34989
35059
|
level: process.env.LOG_LEVEL || "info"
|
|
34990
35060
|
});
|
|
@@ -35014,7 +35084,7 @@ async function executeShadowQuery(resource, normalizedParams, requestId) {
|
|
|
35014
35084
|
(f4) => !(isKeyConditionOptimized && f4 === optimizableFilter)
|
|
35015
35085
|
);
|
|
35016
35086
|
if (residualFilters.length > 0) {
|
|
35017
|
-
|
|
35087
|
+
logger9.debug("Residual filters detected, falling back to full scan", {
|
|
35018
35088
|
requestId,
|
|
35019
35089
|
resource,
|
|
35020
35090
|
sortField: sort.field,
|
|
@@ -35022,7 +35092,7 @@ async function executeShadowQuery(resource, normalizedParams, requestId) {
|
|
|
35022
35092
|
});
|
|
35023
35093
|
return executeFullScanQuery(resource, normalizedParams, costTracker, requestId);
|
|
35024
35094
|
}
|
|
35025
|
-
|
|
35095
|
+
logger9.debug("Executing shadow query", {
|
|
35026
35096
|
requestId,
|
|
35027
35097
|
resource,
|
|
35028
35098
|
sortField: sort.field,
|
|
@@ -35070,7 +35140,7 @@ async function executeShadowQuery(resource, normalizedParams, requestId) {
|
|
|
35070
35140
|
shadowRecords.LastEvaluatedKey.PK,
|
|
35071
35141
|
shadowRecords.LastEvaluatedKey.SK
|
|
35072
35142
|
) : void 0;
|
|
35073
|
-
|
|
35143
|
+
logger9.info("Shadow query succeeded", {
|
|
35074
35144
|
requestId,
|
|
35075
35145
|
resource,
|
|
35076
35146
|
sortField: sort.field,
|
|
@@ -35095,7 +35165,7 @@ async function executeFilterFirstQuery(resource, normalizedParams, filterCandida
|
|
|
35095
35165
|
const offset = nextToken ? decodeOffsetToken(nextToken) ?? 0 : 0;
|
|
35096
35166
|
const filterSort = { field: filterCandidate.parsed.field, order: "ASC" };
|
|
35097
35167
|
const remainingFilters = parsedFilters.filter((f4) => f4 !== filterCandidate);
|
|
35098
|
-
|
|
35168
|
+
logger9.debug("Executing filter-first query", {
|
|
35099
35169
|
requestId,
|
|
35100
35170
|
resource,
|
|
35101
35171
|
filterField: filterCandidate.parsed.field,
|
|
@@ -35107,7 +35177,9 @@ async function executeFilterFirstQuery(resource, normalizedParams, filterCandida
|
|
|
35107
35177
|
filterSort,
|
|
35108
35178
|
filterCandidate,
|
|
35109
35179
|
costTracker,
|
|
35110
|
-
requestId
|
|
35180
|
+
requestId,
|
|
35181
|
+
"shadow-filter-first",
|
|
35182
|
+
parsedFilters
|
|
35111
35183
|
);
|
|
35112
35184
|
if (remainingFilters.length > 0) {
|
|
35113
35185
|
items = items.filter((r4) => matchesAllFilters(r4, remainingFilters));
|
|
@@ -35116,7 +35188,7 @@ async function executeFilterFirstQuery(resource, normalizedParams, filterCandida
|
|
|
35116
35188
|
const page = items.slice(offset, offset + perPage);
|
|
35117
35189
|
const hasNextPage = offset + perPage < items.length;
|
|
35118
35190
|
const nextTokenValue = hasNextPage ? encodeOffsetToken(offset + perPage) : void 0;
|
|
35119
|
-
|
|
35191
|
+
logger9.info("Filter-first query succeeded", {
|
|
35120
35192
|
requestId,
|
|
35121
35193
|
resource,
|
|
35122
35194
|
filterField: filterCandidate.parsed.field,
|
|
@@ -35137,20 +35209,28 @@ async function executeFullScanQuery(resource, normalizedParams, costTracker, req
|
|
|
35137
35209
|
const { sort, pagination, parsedFilters } = normalizedParams;
|
|
35138
35210
|
const { perPage, nextToken } = pagination;
|
|
35139
35211
|
const offset = nextToken ? decodeOffsetToken(nextToken) ?? 0 : 0;
|
|
35140
|
-
|
|
35212
|
+
logger9.debug("Executing full scan query", {
|
|
35141
35213
|
requestId,
|
|
35142
35214
|
resource,
|
|
35143
35215
|
sortField: sort.field,
|
|
35144
35216
|
offset
|
|
35145
35217
|
});
|
|
35146
|
-
let items = await fetchAllRecordsViaShadowIndex(
|
|
35218
|
+
let items = await fetchAllRecordsViaShadowIndex(
|
|
35219
|
+
resource,
|
|
35220
|
+
sort,
|
|
35221
|
+
void 0,
|
|
35222
|
+
costTracker,
|
|
35223
|
+
requestId,
|
|
35224
|
+
"shadow-full-scan",
|
|
35225
|
+
parsedFilters
|
|
35226
|
+
);
|
|
35147
35227
|
if (parsedFilters.length > 0) {
|
|
35148
35228
|
items = items.filter((r4) => matchesAllFilters(r4, parsedFilters));
|
|
35149
35229
|
}
|
|
35150
35230
|
const page = items.slice(offset, offset + perPage);
|
|
35151
35231
|
const hasNextPage = offset + perPage < items.length;
|
|
35152
35232
|
const nextTokenValue = hasNextPage ? encodeOffsetToken(offset + perPage) : void 0;
|
|
35153
|
-
|
|
35233
|
+
logger9.info("Full scan query succeeded", {
|
|
35154
35234
|
requestId,
|
|
35155
35235
|
resource,
|
|
35156
35236
|
sortField: sort.field,
|
|
@@ -35166,20 +35246,35 @@ async function executeFullScanQuery(resource, normalizedParams, costTracker, req
|
|
|
35166
35246
|
consumedCapacity: costTracker.getAggregated()
|
|
35167
35247
|
};
|
|
35168
35248
|
}
|
|
35169
|
-
async function fetchAllRecordsViaShadowIndex(resource, indexSort, indexFilter, costTracker, requestId) {
|
|
35249
|
+
async function fetchAllRecordsViaShadowIndex(resource, indexSort, indexFilter, costTracker, requestId, scanPath, parsedFilters) {
|
|
35170
35250
|
const allShadowItems = [];
|
|
35251
|
+
const watcher = new ScanWatcher({
|
|
35252
|
+
requestId,
|
|
35253
|
+
resource,
|
|
35254
|
+
path: scanPath,
|
|
35255
|
+
sortField: indexSort.field,
|
|
35256
|
+
filters: parsedFilters.map((f4) => `${f4.parsed.field}:${f4.parsed.operator}`)
|
|
35257
|
+
});
|
|
35171
35258
|
let lastKey;
|
|
35172
35259
|
let previousKeySignature;
|
|
35173
35260
|
const MAX_ITERATIONS = 1e4;
|
|
35174
35261
|
let iterations = 0;
|
|
35175
35262
|
do {
|
|
35176
35263
|
if (++iterations > MAX_ITERATIONS) {
|
|
35177
|
-
|
|
35264
|
+
logger9.error("fetchAllRecordsViaShadowIndex: \u6700\u5927\u53CD\u5FA9\u56DE\u6570\u3092\u8D85\u904E", {
|
|
35178
35265
|
requestId,
|
|
35179
35266
|
resource,
|
|
35180
35267
|
iterations
|
|
35181
35268
|
});
|
|
35182
|
-
|
|
35269
|
+
throw new AppError(
|
|
35270
|
+
"INTERNAL_ERROR" /* INTERNAL_ERROR */,
|
|
35271
|
+
"Shadow index scan exceeded the iteration limit",
|
|
35272
|
+
500,
|
|
35273
|
+
{
|
|
35274
|
+
resource,
|
|
35275
|
+
iterations
|
|
35276
|
+
}
|
|
35277
|
+
);
|
|
35183
35278
|
}
|
|
35184
35279
|
const result = await executeShadowRecordQuery(
|
|
35185
35280
|
resource,
|
|
@@ -35192,15 +35287,21 @@ async function fetchAllRecordsViaShadowIndex(resource, indexSort, indexFilter, c
|
|
|
35192
35287
|
requestId
|
|
35193
35288
|
);
|
|
35194
35289
|
allShadowItems.push(...result.Items || []);
|
|
35290
|
+
watcher.add((result.Items || []).length);
|
|
35195
35291
|
const nextKey = result.LastEvaluatedKey;
|
|
35196
35292
|
const nextKeySignature = nextKey ? `${nextKey.PK}#${nextKey.SK}` : void 0;
|
|
35197
35293
|
if (nextKeySignature && nextKeySignature === previousKeySignature) {
|
|
35198
|
-
|
|
35294
|
+
logger9.error("fetchAllRecordsViaShadowIndex: \u540C\u4E00\u306ELastEvaluatedKey\u304C\u8FD4\u5374\u3055\u308C\u305F", {
|
|
35199
35295
|
requestId,
|
|
35200
35296
|
resource,
|
|
35201
35297
|
iterations
|
|
35202
35298
|
});
|
|
35203
|
-
|
|
35299
|
+
throw new AppError(
|
|
35300
|
+
"INTERNAL_ERROR" /* INTERNAL_ERROR */,
|
|
35301
|
+
"Shadow index scan received the same LastEvaluatedKey repeatedly",
|
|
35302
|
+
500,
|
|
35303
|
+
{ resource, iterations }
|
|
35304
|
+
);
|
|
35204
35305
|
}
|
|
35205
35306
|
previousKeySignature = nextKeySignature;
|
|
35206
35307
|
lastKey = nextKey;
|
|
@@ -35406,7 +35507,7 @@ async function fetchMainRecords(resource, recordIds, costTracker, requestId) {
|
|
|
35406
35507
|
}
|
|
35407
35508
|
allRecords.push(...batchGetResult.Responses?.[tableName] || []);
|
|
35408
35509
|
}
|
|
35409
|
-
|
|
35510
|
+
logger9.debug("Main records fetched", {
|
|
35410
35511
|
requestId,
|
|
35411
35512
|
resource,
|
|
35412
35513
|
requestedCount: uniqueRecordIds.length,
|
|
@@ -35414,7 +35515,7 @@ async function fetchMainRecords(resource, recordIds, costTracker, requestId) {
|
|
|
35414
35515
|
});
|
|
35415
35516
|
return allRecords;
|
|
35416
35517
|
}
|
|
35417
|
-
var import_lib_dynamodb4,
|
|
35518
|
+
var import_lib_dynamodb4, logger9, KEY_CONDITION_OPERATORS;
|
|
35418
35519
|
var init_shadowQuery = __esm({
|
|
35419
35520
|
"src/server/operations/find/shadowQuery.ts"() {
|
|
35420
35521
|
"use strict";
|
|
@@ -35424,8 +35525,9 @@ var init_shadowQuery = __esm({
|
|
|
35424
35525
|
init_cost_tracker();
|
|
35425
35526
|
init_dynamodb3();
|
|
35426
35527
|
init_pagination();
|
|
35528
|
+
init_scanWarning();
|
|
35427
35529
|
init_utils5();
|
|
35428
|
-
|
|
35530
|
+
logger9 = createLogger({
|
|
35429
35531
|
service: "shadow-query",
|
|
35430
35532
|
level: process.env.LOG_LEVEL || "info"
|
|
35431
35533
|
});
|
|
@@ -35446,14 +35548,14 @@ var init_shadowQuery = __esm({
|
|
|
35446
35548
|
|
|
35447
35549
|
// src/server/operations/find/handler.ts
|
|
35448
35550
|
async function handleFind(resource, params, requestId) {
|
|
35449
|
-
|
|
35551
|
+
logger10.debug("Executing find", {
|
|
35450
35552
|
requestId,
|
|
35451
35553
|
resource,
|
|
35452
35554
|
params
|
|
35453
35555
|
});
|
|
35454
35556
|
const nearDetection = detectNearQuery(params.filter);
|
|
35455
35557
|
if (nearDetection) {
|
|
35456
|
-
|
|
35558
|
+
logger10.debug("$near operator detected, executing near search", {
|
|
35457
35559
|
requestId,
|
|
35458
35560
|
resource,
|
|
35459
35561
|
fieldName: nearDetection.fieldName
|
|
@@ -35470,7 +35572,7 @@ async function handleFind(resource, params, requestId) {
|
|
|
35470
35572
|
const config = initializeFindConfig();
|
|
35471
35573
|
const normalizedParams = normalizeFindParams(config, resource, params);
|
|
35472
35574
|
validateSortField(config, resource, normalizedParams.sort);
|
|
35473
|
-
|
|
35575
|
+
logger10.debug("Find parameters normalized", {
|
|
35474
35576
|
requestId,
|
|
35475
35577
|
resource,
|
|
35476
35578
|
sort: normalizedParams.sort,
|
|
@@ -35485,7 +35587,7 @@ async function handleFind(resource, params, requestId) {
|
|
|
35485
35587
|
}
|
|
35486
35588
|
return executeShadowQuery(resource, normalizedParams, requestId);
|
|
35487
35589
|
}
|
|
35488
|
-
var
|
|
35590
|
+
var logger10;
|
|
35489
35591
|
var init_handler = __esm({
|
|
35490
35592
|
"src/server/operations/find/handler.ts"() {
|
|
35491
35593
|
"use strict";
|
|
@@ -35495,7 +35597,7 @@ var init_handler = __esm({
|
|
|
35495
35597
|
init_nearQuery();
|
|
35496
35598
|
init_shadowQuery();
|
|
35497
35599
|
init_utils5();
|
|
35498
|
-
|
|
35600
|
+
logger10 = createLogger({
|
|
35499
35601
|
service: "find-handler",
|
|
35500
35602
|
level: process.env.LOG_LEVEL || "info"
|
|
35501
35603
|
});
|
|
@@ -35526,13 +35628,13 @@ async function handleDeleteMany(resource, params, requestId) {
|
|
|
35526
35628
|
let ids;
|
|
35527
35629
|
if ("ids" in params) {
|
|
35528
35630
|
ids = params.ids;
|
|
35529
|
-
|
|
35631
|
+
logger11.debug("Executing deleteMany with ids", {
|
|
35530
35632
|
requestId,
|
|
35531
35633
|
resource,
|
|
35532
35634
|
count: ids.length
|
|
35533
35635
|
});
|
|
35534
35636
|
} else {
|
|
35535
|
-
|
|
35637
|
+
logger11.debug("Executing deleteMany with filter", {
|
|
35536
35638
|
requestId,
|
|
35537
35639
|
resource,
|
|
35538
35640
|
filter: params.filter
|
|
@@ -35540,7 +35642,7 @@ async function handleDeleteMany(resource, params, requestId) {
|
|
|
35540
35642
|
const { handleFind: handleFind2 } = await Promise.resolve().then(() => (init_find(), find_exports));
|
|
35541
35643
|
const findResult = await handleFind2(resource, { filter: params.filter }, requestId);
|
|
35542
35644
|
ids = findResult.items.map((item) => item.id);
|
|
35543
|
-
|
|
35645
|
+
logger11.debug("Found records with filter", {
|
|
35544
35646
|
requestId,
|
|
35545
35647
|
resource,
|
|
35546
35648
|
count: ids.length
|
|
@@ -35604,7 +35706,7 @@ async function handleDeleteMany(resource, params, requestId) {
|
|
|
35604
35706
|
message: `Record not found: ${id}`
|
|
35605
35707
|
}));
|
|
35606
35708
|
if (preparedRecords.length === 0) {
|
|
35607
|
-
|
|
35709
|
+
logger11.info("deleteMany completed - no records found", {
|
|
35608
35710
|
requestId,
|
|
35609
35711
|
resource,
|
|
35610
35712
|
requested: ids.length,
|
|
@@ -35763,7 +35865,7 @@ async function handleDeleteMany(resource, params, requestId) {
|
|
|
35763
35865
|
consumedCapacity: costTracker.getAggregated()
|
|
35764
35866
|
};
|
|
35765
35867
|
}
|
|
35766
|
-
var import_lib_dynamodb5,
|
|
35868
|
+
var import_lib_dynamodb5, logger11;
|
|
35767
35869
|
var init_deleteMany = __esm({
|
|
35768
35870
|
"src/server/operations/deleteMany.ts"() {
|
|
35769
35871
|
"use strict";
|
|
@@ -35774,7 +35876,7 @@ var init_deleteMany = __esm({
|
|
|
35774
35876
|
init_chunking();
|
|
35775
35877
|
init_cost_tracker();
|
|
35776
35878
|
init_dynamodb3();
|
|
35777
|
-
|
|
35879
|
+
logger11 = createLogger({ service: "records-lambda" });
|
|
35778
35880
|
__name(handleDeleteMany, "handleDeleteMany");
|
|
35779
35881
|
}
|
|
35780
35882
|
});
|
|
@@ -35783,7 +35885,7 @@ var init_deleteMany = __esm({
|
|
|
35783
35885
|
async function handleFindMany(resource, params, requestId) {
|
|
35784
35886
|
if ("ids" in params) {
|
|
35785
35887
|
const { ids } = params;
|
|
35786
|
-
|
|
35888
|
+
logger13.debug("Executing findMany by ids", {
|
|
35787
35889
|
requestId,
|
|
35788
35890
|
resource,
|
|
35789
35891
|
count: ids.length
|
|
@@ -35812,7 +35914,7 @@ async function handleFindMany(resource, params, requestId) {
|
|
|
35812
35914
|
);
|
|
35813
35915
|
const items = result.Responses?.[tableName] || [];
|
|
35814
35916
|
const records = items.map((item) => extractCleanRecord(item));
|
|
35815
|
-
|
|
35917
|
+
logger13.info("findMany by ids succeeded", {
|
|
35816
35918
|
requestId,
|
|
35817
35919
|
resource,
|
|
35818
35920
|
requested: ids.length,
|
|
@@ -35822,7 +35924,7 @@ async function handleFindMany(resource, params, requestId) {
|
|
|
35822
35924
|
}
|
|
35823
35925
|
if ("filter" in params) {
|
|
35824
35926
|
const { filter } = params;
|
|
35825
|
-
|
|
35927
|
+
logger13.debug("Executing findMany by filter", {
|
|
35826
35928
|
requestId,
|
|
35827
35929
|
resource,
|
|
35828
35930
|
filter
|
|
@@ -35834,7 +35936,7 @@ async function handleFindMany(resource, params, requestId) {
|
|
|
35834
35936
|
},
|
|
35835
35937
|
requestId
|
|
35836
35938
|
);
|
|
35837
|
-
|
|
35939
|
+
logger13.info("findMany by filter succeeded", {
|
|
35838
35940
|
requestId,
|
|
35839
35941
|
resource,
|
|
35840
35942
|
filter,
|
|
@@ -35844,7 +35946,7 @@ async function handleFindMany(resource, params, requestId) {
|
|
|
35844
35946
|
}
|
|
35845
35947
|
throw new Error("findMany requires either ids or filter");
|
|
35846
35948
|
}
|
|
35847
|
-
var import_lib_dynamodb6,
|
|
35949
|
+
var import_lib_dynamodb6, logger13;
|
|
35848
35950
|
var init_findMany = __esm({
|
|
35849
35951
|
"src/server/operations/findMany.ts"() {
|
|
35850
35952
|
"use strict";
|
|
@@ -35853,7 +35955,7 @@ var init_findMany = __esm({
|
|
|
35853
35955
|
init_shadow();
|
|
35854
35956
|
init_dynamodb3();
|
|
35855
35957
|
init_find();
|
|
35856
|
-
|
|
35958
|
+
logger13 = createLogger({ service: "records-lambda" });
|
|
35857
35959
|
__name(handleFindMany, "handleFindMany");
|
|
35858
35960
|
}
|
|
35859
35961
|
});
|
|
@@ -35866,7 +35968,7 @@ __export(findOne_exports, {
|
|
|
35866
35968
|
async function handleFindOne(resource, params, requestId) {
|
|
35867
35969
|
if ("id" in params) {
|
|
35868
35970
|
const { id } = params;
|
|
35869
|
-
|
|
35971
|
+
logger15.debug("Executing findOne by id (using findMany)", {
|
|
35870
35972
|
requestId,
|
|
35871
35973
|
resource,
|
|
35872
35974
|
id
|
|
@@ -35875,7 +35977,7 @@ async function handleFindOne(resource, params, requestId) {
|
|
|
35875
35977
|
if (results.length === 0) {
|
|
35876
35978
|
throw new ItemNotFoundError(`Record not found: ${id}`, { resource, id });
|
|
35877
35979
|
}
|
|
35878
|
-
|
|
35980
|
+
logger15.info("findOne by id succeeded", {
|
|
35879
35981
|
requestId,
|
|
35880
35982
|
resource,
|
|
35881
35983
|
id
|
|
@@ -35884,7 +35986,7 @@ async function handleFindOne(resource, params, requestId) {
|
|
|
35884
35986
|
}
|
|
35885
35987
|
if ("filter" in params) {
|
|
35886
35988
|
const { filter } = params;
|
|
35887
|
-
|
|
35989
|
+
logger15.debug("Executing findOne by filter (using findMany)", {
|
|
35888
35990
|
requestId,
|
|
35889
35991
|
resource,
|
|
35890
35992
|
filter
|
|
@@ -35893,7 +35995,7 @@ async function handleFindOne(resource, params, requestId) {
|
|
|
35893
35995
|
if (results.length === 0) {
|
|
35894
35996
|
throw new ItemNotFoundError(`Record not found with filter`, { resource, filter });
|
|
35895
35997
|
}
|
|
35896
|
-
|
|
35998
|
+
logger15.info("findOne by filter succeeded", {
|
|
35897
35999
|
requestId,
|
|
35898
36000
|
resource,
|
|
35899
36001
|
filter
|
|
@@ -35902,13 +36004,13 @@ async function handleFindOne(resource, params, requestId) {
|
|
|
35902
36004
|
}
|
|
35903
36005
|
throw new Error("findOne requires either id or filter");
|
|
35904
36006
|
}
|
|
35905
|
-
var
|
|
36007
|
+
var logger15;
|
|
35906
36008
|
var init_findOne = __esm({
|
|
35907
36009
|
"src/server/operations/findOne.ts"() {
|
|
35908
36010
|
"use strict";
|
|
35909
36011
|
init_shared();
|
|
35910
36012
|
init_findMany();
|
|
35911
|
-
|
|
36013
|
+
logger15 = createLogger({ service: "records-lambda" });
|
|
35912
36014
|
__name(handleFindOne, "handleFindOne");
|
|
35913
36015
|
}
|
|
35914
36016
|
});
|
|
@@ -35969,13 +36071,13 @@ function calculateTTL(resource, createdAt) {
|
|
|
35969
36071
|
}
|
|
35970
36072
|
const ttlDays = parseInt(ttlDaysStr, 10);
|
|
35971
36073
|
if (isNaN(ttlDays) || ttlDays <= 0) {
|
|
35972
|
-
|
|
36074
|
+
logger16.warn("Invalid TTL_DAYS value", { resource, envKey, value: ttlDaysStr });
|
|
35973
36075
|
return void 0;
|
|
35974
36076
|
}
|
|
35975
36077
|
const createdAtMs = new Date(createdAt).getTime();
|
|
35976
36078
|
const ttlMs = createdAtMs + ttlDays * 24 * 60 * 60 * 1e3;
|
|
35977
36079
|
const ttl = Math.floor(ttlMs / 1e3);
|
|
35978
|
-
|
|
36080
|
+
logger16.debug("TTL calculated", {
|
|
35979
36081
|
resource,
|
|
35980
36082
|
ttlDays,
|
|
35981
36083
|
createdAt,
|
|
@@ -35987,7 +36089,7 @@ function calculateTTL(resource, createdAt) {
|
|
|
35987
36089
|
function addTTL(resource, recordData) {
|
|
35988
36090
|
const createdAt = recordData.createdAt;
|
|
35989
36091
|
if (!createdAt) {
|
|
35990
|
-
|
|
36092
|
+
logger16.warn("createdAt not found, skipping TTL calculation", { resource });
|
|
35991
36093
|
return recordData;
|
|
35992
36094
|
}
|
|
35993
36095
|
const ttl = calculateTTL(resource, createdAt);
|
|
@@ -35999,12 +36101,12 @@ function addTTL(resource, recordData) {
|
|
|
35999
36101
|
ttl
|
|
36000
36102
|
};
|
|
36001
36103
|
}
|
|
36002
|
-
var
|
|
36104
|
+
var logger16;
|
|
36003
36105
|
var init_ttl = __esm({
|
|
36004
36106
|
"src/server/utils/ttl.ts"() {
|
|
36005
36107
|
"use strict";
|
|
36006
36108
|
init_index2();
|
|
36007
|
-
|
|
36109
|
+
logger16 = createLogger({ service: "records-lambda" });
|
|
36008
36110
|
__name(calculateTTL, "calculateTTL");
|
|
36009
36111
|
__name(addTTL, "addTTL");
|
|
36010
36112
|
}
|
|
@@ -36019,7 +36121,7 @@ async function handleInsertMany(resource, params, requestId) {
|
|
|
36019
36121
|
const { data: recordsData } = params;
|
|
36020
36122
|
const startTime = Date.now();
|
|
36021
36123
|
const costTracker = new CostTracker();
|
|
36022
|
-
|
|
36124
|
+
logger17.debug("Executing insertMany", {
|
|
36023
36125
|
requestId,
|
|
36024
36126
|
resource,
|
|
36025
36127
|
count: recordsData.length
|
|
@@ -36062,7 +36164,7 @@ async function handleInsertMany(resource, params, requestId) {
|
|
|
36062
36164
|
const failedId = recordData.id || `temp-id-${i4}`;
|
|
36063
36165
|
const errorMessage = error2 instanceof Error ? error2.message : "Unknown preparation error";
|
|
36064
36166
|
const errorCode = getPreparationErrorCode(error2);
|
|
36065
|
-
|
|
36167
|
+
logger17.error("Failed to prepare record for creation", {
|
|
36066
36168
|
requestId,
|
|
36067
36169
|
recordId: failedId,
|
|
36068
36170
|
error: errorMessage,
|
|
@@ -36227,7 +36329,7 @@ function getPreparationErrorCode(error2) {
|
|
|
36227
36329
|
}
|
|
36228
36330
|
return "VALIDATION_ERROR" /* VALIDATION_ERROR */;
|
|
36229
36331
|
}
|
|
36230
|
-
var import_lib_dynamodb8,
|
|
36332
|
+
var import_lib_dynamodb8, logger17;
|
|
36231
36333
|
var init_insertMany = __esm({
|
|
36232
36334
|
"src/server/operations/insertMany.ts"() {
|
|
36233
36335
|
"use strict";
|
|
@@ -36241,7 +36343,7 @@ var init_insertMany = __esm({
|
|
|
36241
36343
|
init_dynamodb3();
|
|
36242
36344
|
init_timestamps();
|
|
36243
36345
|
init_ttl();
|
|
36244
|
-
|
|
36346
|
+
logger17 = createLogger({ service: "records-lambda" });
|
|
36245
36347
|
__name(handleInsertMany, "handleInsertMany");
|
|
36246
36348
|
__name(getPreparationErrorCode, "getPreparationErrorCode");
|
|
36247
36349
|
}
|
|
@@ -36364,7 +36466,7 @@ async function handleUpdateMany(resource, params, requestId) {
|
|
|
36364
36466
|
const upsert = options?.upsert ?? false;
|
|
36365
36467
|
const startTime = Date.now();
|
|
36366
36468
|
const costTracker = new CostTracker();
|
|
36367
|
-
|
|
36469
|
+
logger19.debug("Executing updateMany", {
|
|
36368
36470
|
requestId,
|
|
36369
36471
|
resource,
|
|
36370
36472
|
upsert
|
|
@@ -36372,13 +36474,13 @@ async function handleUpdateMany(resource, params, requestId) {
|
|
|
36372
36474
|
let ids;
|
|
36373
36475
|
if ("ids" in params) {
|
|
36374
36476
|
ids = params.ids;
|
|
36375
|
-
|
|
36477
|
+
logger19.debug("Executing updateMany with ids", {
|
|
36376
36478
|
requestId,
|
|
36377
36479
|
resource,
|
|
36378
36480
|
count: ids.length
|
|
36379
36481
|
});
|
|
36380
36482
|
} else {
|
|
36381
|
-
|
|
36483
|
+
logger19.debug("Executing updateMany with filter", {
|
|
36382
36484
|
requestId,
|
|
36383
36485
|
resource,
|
|
36384
36486
|
filter: params.filter
|
|
@@ -36386,7 +36488,7 @@ async function handleUpdateMany(resource, params, requestId) {
|
|
|
36386
36488
|
const { handleFind: handleFind2 } = await Promise.resolve().then(() => (init_find(), find_exports));
|
|
36387
36489
|
const findResult = await handleFind2(resource, { filter: params.filter }, requestId);
|
|
36388
36490
|
ids = findResult.items.map((item) => item.id);
|
|
36389
|
-
|
|
36491
|
+
logger19.debug("Found records with filter", {
|
|
36390
36492
|
requestId,
|
|
36391
36493
|
resource,
|
|
36392
36494
|
count: ids.length
|
|
@@ -36395,7 +36497,7 @@ async function handleUpdateMany(resource, params, requestId) {
|
|
|
36395
36497
|
if (upsert) {
|
|
36396
36498
|
const newId = ulid2();
|
|
36397
36499
|
ids = [newId];
|
|
36398
|
-
|
|
36500
|
+
logger19.info("Creating new record with filter (upsert: true)", {
|
|
36399
36501
|
requestId,
|
|
36400
36502
|
resource,
|
|
36401
36503
|
newId,
|
|
@@ -36459,7 +36561,7 @@ async function handleUpdateMany(resource, params, requestId) {
|
|
|
36459
36561
|
);
|
|
36460
36562
|
const notFoundIds = ids.filter((id) => !existingIds.has(id));
|
|
36461
36563
|
if (!upsert && notFoundIds.length > 0) {
|
|
36462
|
-
|
|
36564
|
+
logger19.warn("Records not found (upsert: false)", {
|
|
36463
36565
|
requestId,
|
|
36464
36566
|
resource,
|
|
36465
36567
|
notFoundCount: notFoundIds.length,
|
|
@@ -36468,7 +36570,7 @@ async function handleUpdateMany(resource, params, requestId) {
|
|
|
36468
36570
|
});
|
|
36469
36571
|
}
|
|
36470
36572
|
if (upsert && notFoundIds.length > 0) {
|
|
36471
|
-
|
|
36573
|
+
logger19.info("Creating new records (upsert: true)", {
|
|
36472
36574
|
requestId,
|
|
36473
36575
|
resource,
|
|
36474
36576
|
notFoundCount: notFoundIds.length,
|
|
@@ -36504,7 +36606,7 @@ async function handleUpdateMany(resource, params, requestId) {
|
|
|
36504
36606
|
const failedId = existingData.id || "unknown-id";
|
|
36505
36607
|
const errorMessage = error2 instanceof Error ? error2.message : "Unknown preparation error";
|
|
36506
36608
|
const errorCode = getPreparationErrorCode2(error2);
|
|
36507
|
-
|
|
36609
|
+
logger19.error("Failed to prepare record for update", {
|
|
36508
36610
|
requestId,
|
|
36509
36611
|
recordId: failedId,
|
|
36510
36612
|
error: errorMessage,
|
|
@@ -36544,7 +36646,7 @@ async function handleUpdateMany(resource, params, requestId) {
|
|
|
36544
36646
|
} catch (error2) {
|
|
36545
36647
|
const errorMessage = error2 instanceof Error ? error2.message : "Unknown preparation error";
|
|
36546
36648
|
const errorCode = getPreparationErrorCode2(error2);
|
|
36547
|
-
|
|
36649
|
+
logger19.error("Failed to prepare new record for upsert", {
|
|
36548
36650
|
requestId,
|
|
36549
36651
|
recordId: id,
|
|
36550
36652
|
error: errorMessage,
|
|
@@ -36757,7 +36859,7 @@ function getPreparationErrorCode2(error2) {
|
|
|
36757
36859
|
}
|
|
36758
36860
|
return "VALIDATION_ERROR" /* VALIDATION_ERROR */;
|
|
36759
36861
|
}
|
|
36760
|
-
var import_lib_dynamodb9,
|
|
36862
|
+
var import_lib_dynamodb9, logger19;
|
|
36761
36863
|
var init_updateMany = __esm({
|
|
36762
36864
|
"src/server/operations/updateMany.ts"() {
|
|
36763
36865
|
"use strict";
|
|
@@ -36771,7 +36873,7 @@ var init_updateMany = __esm({
|
|
|
36771
36873
|
init_dynamodb3();
|
|
36772
36874
|
init_mergePatch();
|
|
36773
36875
|
init_timestamps();
|
|
36774
|
-
|
|
36876
|
+
logger19 = createLogger({ service: "records-lambda" });
|
|
36775
36877
|
__name(handleUpdateMany, "handleUpdateMany");
|
|
36776
36878
|
__name(getPreparationErrorCode2, "getPreparationErrorCode");
|
|
36777
36879
|
}
|
|
@@ -36792,13 +36894,13 @@ init_deleteMany();
|
|
|
36792
36894
|
|
|
36793
36895
|
// src/server/operations/deleteOne.ts
|
|
36794
36896
|
init_shared();
|
|
36795
|
-
var
|
|
36897
|
+
var logger12 = createLogger({ service: "records-lambda" });
|
|
36796
36898
|
async function handleDeleteOne(resource, params, requestId) {
|
|
36797
36899
|
const { handleDeleteMany: handleDeleteMany2 } = await Promise.resolve().then(() => (init_deleteMany(), deleteMany_exports));
|
|
36798
36900
|
let targetId;
|
|
36799
36901
|
if ("id" in params) {
|
|
36800
36902
|
targetId = params.id;
|
|
36801
|
-
|
|
36903
|
+
logger12.debug("Executing deleteOne with id", {
|
|
36802
36904
|
requestId,
|
|
36803
36905
|
resource,
|
|
36804
36906
|
id: targetId
|
|
@@ -36825,7 +36927,7 @@ async function handleDeleteOne(resource, params, requestId) {
|
|
|
36825
36927
|
consumedCapacity: deleteManyResult.consumedCapacity
|
|
36826
36928
|
};
|
|
36827
36929
|
} else {
|
|
36828
|
-
|
|
36930
|
+
logger12.debug("Executing deleteOne with filter", {
|
|
36829
36931
|
requestId,
|
|
36830
36932
|
resource,
|
|
36831
36933
|
filter: params.filter
|
|
@@ -36849,7 +36951,7 @@ async function handleDeleteOne(resource, params, requestId) {
|
|
|
36849
36951
|
if (!deletedId) {
|
|
36850
36952
|
throw new Error("Failed to get deleted record ID");
|
|
36851
36953
|
}
|
|
36852
|
-
|
|
36954
|
+
logger12.info("deleteOne succeeded", {
|
|
36853
36955
|
requestId,
|
|
36854
36956
|
resource,
|
|
36855
36957
|
id: deletedId
|
|
@@ -36875,10 +36977,10 @@ init_shadow();
|
|
|
36875
36977
|
init_dynamodb3();
|
|
36876
36978
|
init_pagination();
|
|
36877
36979
|
init_validation2();
|
|
36878
|
-
var
|
|
36980
|
+
var logger14 = createLogger({ service: "records-lambda" });
|
|
36879
36981
|
async function handleFindManyReference(resource, params, requestId) {
|
|
36880
36982
|
const { target, id, filter, sort: sortParam, pagination } = params;
|
|
36881
|
-
|
|
36983
|
+
logger14.debug("Executing findManyReference", {
|
|
36882
36984
|
requestId,
|
|
36883
36985
|
resource,
|
|
36884
36986
|
target,
|
|
@@ -36968,7 +37070,7 @@ async function handleFindManyReference(resource, params, requestId) {
|
|
|
36968
37070
|
queryResult.LastEvaluatedKey.PK,
|
|
36969
37071
|
queryResult.LastEvaluatedKey.SK
|
|
36970
37072
|
) : void 0;
|
|
36971
|
-
|
|
37073
|
+
logger14.info("findManyReference succeeded", {
|
|
36972
37074
|
requestId,
|
|
36973
37075
|
resource,
|
|
36974
37076
|
target,
|
|
@@ -36993,9 +37095,9 @@ init_insertMany();
|
|
|
36993
37095
|
|
|
36994
37096
|
// src/server/operations/insertOne.ts
|
|
36995
37097
|
init_shared();
|
|
36996
|
-
var
|
|
37098
|
+
var logger18 = createLogger({ service: "records-lambda" });
|
|
36997
37099
|
async function handleInsertOne(resource, params, requestId) {
|
|
36998
|
-
|
|
37100
|
+
logger18.debug("Executing insertOne", {
|
|
36999
37101
|
requestId,
|
|
37000
37102
|
resource
|
|
37001
37103
|
});
|
|
@@ -37021,7 +37123,7 @@ async function handleInsertOne(resource, params, requestId) {
|
|
|
37021
37123
|
}
|
|
37022
37124
|
const { handleFindOne: handleFindOne2 } = await Promise.resolve().then(() => (init_findOne(), findOne_exports));
|
|
37023
37125
|
const createdRecord = await handleFindOne2(resource, { id: createdId }, requestId);
|
|
37024
|
-
|
|
37126
|
+
logger18.info("insertOne succeeded", {
|
|
37025
37127
|
requestId,
|
|
37026
37128
|
resource,
|
|
37027
37129
|
id: createdId
|
|
@@ -37183,13 +37285,13 @@ init_updateMany();
|
|
|
37183
37285
|
|
|
37184
37286
|
// src/server/operations/updateOne.ts
|
|
37185
37287
|
init_shared();
|
|
37186
|
-
var
|
|
37288
|
+
var logger20 = createLogger({ service: "records-lambda" });
|
|
37187
37289
|
async function handleUpdateOne(resource, params, requestId) {
|
|
37188
37290
|
const { data: patchData, options } = params;
|
|
37189
37291
|
const { handleUpdateMany: handleUpdateMany2 } = await Promise.resolve().then(() => (init_updateMany(), updateMany_exports));
|
|
37190
37292
|
if ("id" in params) {
|
|
37191
37293
|
const targetId = params.id;
|
|
37192
|
-
|
|
37294
|
+
logger20.debug("Executing updateOne with id", {
|
|
37193
37295
|
requestId,
|
|
37194
37296
|
resource,
|
|
37195
37297
|
id: targetId,
|
|
@@ -37231,7 +37333,7 @@ async function handleUpdateOne(resource, params, requestId) {
|
|
|
37231
37333
|
consumedCapacity: updateManyResult.consumedCapacity
|
|
37232
37334
|
};
|
|
37233
37335
|
} else {
|
|
37234
|
-
|
|
37336
|
+
logger20.debug("Executing updateOne with filter", {
|
|
37235
37337
|
requestId,
|
|
37236
37338
|
resource,
|
|
37237
37339
|
filter: params.filter,
|
|
@@ -37281,13 +37383,13 @@ async function handleUpdateOne(resource, params, requestId) {
|
|
|
37281
37383
|
__name(handleUpdateOne, "handleUpdateOne");
|
|
37282
37384
|
|
|
37283
37385
|
// src/server/operations/operationDispatcher.ts
|
|
37284
|
-
var
|
|
37386
|
+
var logger21 = createLogger({
|
|
37285
37387
|
service: "operation-dispatcher",
|
|
37286
37388
|
level: process.env.LOG_LEVEL || "info"
|
|
37287
37389
|
});
|
|
37288
37390
|
async function executeOperation(request2, requestId) {
|
|
37289
37391
|
const { op: op2, resource } = request2;
|
|
37290
|
-
|
|
37392
|
+
logger21.debug("Executing operation", {
|
|
37291
37393
|
requestId,
|
|
37292
37394
|
operation: op2,
|
|
37293
37395
|
resource
|
|
@@ -38510,13 +38612,13 @@ CognitoJwtVerifier.USER_POOL_ID_REGEX = /^(?<region>[a-z]{2}-(gov-)?[a-z]+-\d)_[
|
|
|
38510
38612
|
|
|
38511
38613
|
// src/server/utils/auth.ts
|
|
38512
38614
|
init_index2();
|
|
38513
|
-
var
|
|
38615
|
+
var logger22 = createLogger({ service: "records-lambda" });
|
|
38514
38616
|
var verifierInstance = null;
|
|
38515
38617
|
function getVerifier(userPoolId, clientId) {
|
|
38516
38618
|
if (!verifierInstance) {
|
|
38517
|
-
|
|
38619
|
+
logger22.debug("Creating JWT verifier instance", { userPoolId, clientId });
|
|
38518
38620
|
if (!clientId) {
|
|
38519
|
-
|
|
38621
|
+
logger22.warn(
|
|
38520
38622
|
"COGNITO_CLIENT_ID is not set: JWT audience (aud) verification is DISABLED. Tokens issued to ANY app client of this user pool are accepted. Set cognito_client_id (Terraform) / COGNITO_CLIENT_ID in production. See docs/AUTHORIZATION.md",
|
|
38521
38623
|
{ userPoolId }
|
|
38522
38624
|
);
|
|
@@ -38533,18 +38635,18 @@ function getVerifier(userPoolId, clientId) {
|
|
|
38533
38635
|
}
|
|
38534
38636
|
__name(getVerifier, "getVerifier");
|
|
38535
38637
|
async function verifyJwt(token, userPoolId, clientId) {
|
|
38536
|
-
|
|
38638
|
+
logger22.debug("Verifying JWT token with signature validation");
|
|
38537
38639
|
try {
|
|
38538
38640
|
const verifier = getVerifier(userPoolId, clientId);
|
|
38539
38641
|
const payload2 = await verifier.verify(token);
|
|
38540
|
-
|
|
38642
|
+
logger22.debug("JWT token verified successfully", {
|
|
38541
38643
|
sub: payload2.sub,
|
|
38542
38644
|
email: payload2.email,
|
|
38543
38645
|
tokenUse: payload2.token_use
|
|
38544
38646
|
});
|
|
38545
38647
|
return payload2;
|
|
38546
38648
|
} catch (error2) {
|
|
38547
|
-
|
|
38649
|
+
logger22.error("JWT verification failed", {
|
|
38548
38650
|
error: error2 instanceof Error ? error2.message : String(error2)
|
|
38549
38651
|
});
|
|
38550
38652
|
let message = "JWT verification failed";
|
|
@@ -38585,7 +38687,7 @@ async function verifyAuthHeader(authHeader, userPoolId, clientId) {
|
|
|
38585
38687
|
__name(verifyAuthHeader, "verifyAuthHeader");
|
|
38586
38688
|
|
|
38587
38689
|
// src/server/utils/authHandler.ts
|
|
38588
|
-
var
|
|
38690
|
+
var logger23 = createLogger({
|
|
38589
38691
|
service: "auth-handler",
|
|
38590
38692
|
level: process.env.LOG_LEVEL || "info"
|
|
38591
38693
|
});
|
|
@@ -38600,7 +38702,7 @@ async function handleAuthentication(event, requestId) {
|
|
|
38600
38702
|
}
|
|
38601
38703
|
__name(handleAuthentication, "handleAuthentication");
|
|
38602
38704
|
function handleIAMAuthentication(iam, requestId) {
|
|
38603
|
-
|
|
38705
|
+
logger23.info("IAM authenticated request", {
|
|
38604
38706
|
requestId,
|
|
38605
38707
|
userArn: iam.userArn,
|
|
38606
38708
|
accountId: iam.accountId,
|
|
@@ -38615,7 +38717,7 @@ async function handleCognitoAuthentication(authHeader, requestId) {
|
|
|
38615
38717
|
throw new Error("COGNITO_USER_POOL_ID environment variable is required");
|
|
38616
38718
|
}
|
|
38617
38719
|
const jwtPayload = await verifyAuthHeader(authHeader, userPoolId, clientId);
|
|
38618
|
-
|
|
38720
|
+
logger23.debug("Cognito JWT verified", {
|
|
38619
38721
|
requestId,
|
|
38620
38722
|
sub: jwtPayload.sub
|
|
38621
38723
|
});
|
|
@@ -38630,7 +38732,7 @@ init_shared();
|
|
|
38630
38732
|
// src/server/utils/responseBuilder.ts
|
|
38631
38733
|
init_http();
|
|
38632
38734
|
init_shared();
|
|
38633
|
-
var
|
|
38735
|
+
var logger24 = createLogger({
|
|
38634
38736
|
service: "response-builder",
|
|
38635
38737
|
level: process.env.LOG_LEVEL || "info"
|
|
38636
38738
|
});
|
|
@@ -38640,7 +38742,7 @@ function createSuccessResponse(data, requestId) {
|
|
|
38640
38742
|
success: true,
|
|
38641
38743
|
data
|
|
38642
38744
|
};
|
|
38643
|
-
|
|
38745
|
+
logger24.info("Request succeeded", { requestId });
|
|
38644
38746
|
return {
|
|
38645
38747
|
statusCode: HTTP_STATUS.OK,
|
|
38646
38748
|
headers: {
|
|
@@ -38661,7 +38763,7 @@ function createErrorResponse(code, message, statusCode, requestId, details) {
|
|
|
38661
38763
|
details
|
|
38662
38764
|
}
|
|
38663
38765
|
};
|
|
38664
|
-
|
|
38766
|
+
logger24.error("Request failed", {
|
|
38665
38767
|
requestId,
|
|
38666
38768
|
code,
|
|
38667
38769
|
message,
|
|
@@ -38687,7 +38789,7 @@ function createCorsResponse(statusCode) {
|
|
|
38687
38789
|
__name(createCorsResponse, "createCorsResponse");
|
|
38688
38790
|
|
|
38689
38791
|
// src/server/utils/errorHandler.ts
|
|
38690
|
-
var
|
|
38792
|
+
var logger25 = createLogger({
|
|
38691
38793
|
service: "error-handler",
|
|
38692
38794
|
level: process.env.LOG_LEVEL || "info"
|
|
38693
38795
|
});
|
|
@@ -38702,7 +38804,7 @@ function handleError(error2, requestId) {
|
|
|
38702
38804
|
);
|
|
38703
38805
|
}
|
|
38704
38806
|
if (error2 instanceof Error) {
|
|
38705
|
-
|
|
38807
|
+
logger25.error("Error stack trace", {
|
|
38706
38808
|
requestId,
|
|
38707
38809
|
stack: error2.stack,
|
|
38708
38810
|
message: error2.message
|
|
@@ -38787,14 +38889,14 @@ function parseRequestBody(body) {
|
|
|
38787
38889
|
__name(parseRequestBody, "parseRequestBody");
|
|
38788
38890
|
|
|
38789
38891
|
// src/server/handler.ts
|
|
38790
|
-
var
|
|
38892
|
+
var logger26 = createLogger({
|
|
38791
38893
|
service: "records-lambda",
|
|
38792
38894
|
level: process.env.LOG_LEVEL || "info"
|
|
38793
38895
|
});
|
|
38794
|
-
|
|
38896
|
+
logger26.info("Records Lambda started with automatic shadow field detection");
|
|
38795
38897
|
async function handler(event) {
|
|
38796
38898
|
const requestId = event.requestContext.requestId;
|
|
38797
|
-
|
|
38899
|
+
logger26.info("Received request", {
|
|
38798
38900
|
requestId,
|
|
38799
38901
|
method: event.requestContext.http.method,
|
|
38800
38902
|
path: event.requestContext.http.path
|
|
@@ -38804,7 +38906,7 @@ async function handler(event) {
|
|
|
38804
38906
|
return createCorsResponse(HTTP_STATUS.OK);
|
|
38805
38907
|
}
|
|
38806
38908
|
if (event.requestContext.http.method === "GET" && event.requestContext.http.path === "/version") {
|
|
38807
|
-
const version = "1.
|
|
38909
|
+
const version = "1.9.0";
|
|
38808
38910
|
return createSuccessResponse({ version, timestamp: (/* @__PURE__ */ new Date()).toISOString() }, requestId);
|
|
38809
38911
|
}
|
|
38810
38912
|
if (event.requestContext.http.method !== "POST") {
|
|
@@ -38812,7 +38914,7 @@ async function handler(event) {
|
|
|
38812
38914
|
}
|
|
38813
38915
|
await handleAuthentication(event, requestId);
|
|
38814
38916
|
const request2 = parseRequestBody(event.body);
|
|
38815
|
-
|
|
38917
|
+
logger26.info("Parsed request", {
|
|
38816
38918
|
requestId,
|
|
38817
38919
|
operation: request2.op,
|
|
38818
38920
|
resource: request2.resource
|