@exabugs/dynamodb-client 1.7.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 +28 -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/scripts/operations/bulkRecordRepair.js +2 -1
- package/dist/scripts/operations/bulkRecordRepair.js.map +1 -1
- package/dist/server/handler.cjs +359 -237
- package/dist/server/handler.cjs.map +4 -4
- package/dist/server/media-handler.cjs +2 -2
- package/dist/server/media-process-handler-dlq.cjs +331 -209
- package/dist/server/media-process-handler-dlq.cjs.map +4 -4
- package/dist/server/media-process-handler.cjs +330 -208
- 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 +75 -43
- 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-
|
|
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,
|
|
@@ -34659,7 +34712,14 @@ async function executeInQuery(resource, targetIds, sort, requestId) {
|
|
|
34659
34712
|
}
|
|
34660
34713
|
async function executeAllRecordsQuery(resource, sort, perPage, nextToken, parsedFilters, requestId) {
|
|
34661
34714
|
if (parsedFilters.length > 0) {
|
|
34662
|
-
return executeAllRecordsQueryFullScan(
|
|
34715
|
+
return executeAllRecordsQueryFullScan(
|
|
34716
|
+
resource,
|
|
34717
|
+
sort,
|
|
34718
|
+
perPage,
|
|
34719
|
+
nextToken,
|
|
34720
|
+
parsedFilters,
|
|
34721
|
+
requestId
|
|
34722
|
+
);
|
|
34663
34723
|
}
|
|
34664
34724
|
const dbClient2 = getDBClient();
|
|
34665
34725
|
const tableName = getTableName();
|
|
@@ -34711,7 +34771,7 @@ async function executeAllRecordsQuery(resource, sort, perPage, nextToken, parsed
|
|
|
34711
34771
|
queryResult.LastEvaluatedKey.PK,
|
|
34712
34772
|
queryResult.LastEvaluatedKey.SK
|
|
34713
34773
|
) : void 0;
|
|
34714
|
-
|
|
34774
|
+
logger7.info("ID all records query succeeded", {
|
|
34715
34775
|
requestId,
|
|
34716
34776
|
resource,
|
|
34717
34777
|
count: items.length,
|
|
@@ -34731,25 +34791,36 @@ async function executeAllRecordsQueryFullScan(resource, sort, perPage, nextToken
|
|
|
34731
34791
|
const dbClient2 = getDBClient();
|
|
34732
34792
|
const tableName = getTableName();
|
|
34733
34793
|
const costTracker = new CostTracker();
|
|
34734
|
-
|
|
34735
|
-
|
|
34794
|
+
let exclusiveStartKey;
|
|
34795
|
+
if (nextToken) {
|
|
34796
|
+
const decoded = decodeNextToken(nextToken);
|
|
34797
|
+
exclusiveStartKey = { PK: decoded.PK, SK: decoded.SK };
|
|
34798
|
+
}
|
|
34799
|
+
const page = [];
|
|
34800
|
+
let lastReturned;
|
|
34801
|
+
let hasNextPage = false;
|
|
34802
|
+
let scanned = 0;
|
|
34803
|
+
let iterations = 0;
|
|
34804
|
+
let previousKeySignature;
|
|
34805
|
+
let chunkSize = SCAN_CHUNK_INITIAL;
|
|
34806
|
+
const watcher = new ScanWatcher({
|
|
34736
34807
|
requestId,
|
|
34737
34808
|
resource,
|
|
34738
|
-
|
|
34809
|
+
path: "id-filtered-scan",
|
|
34810
|
+
sortField: sort.field,
|
|
34811
|
+
filters: parsedFilters.map((f4) => `${f4.parsed.field}:${f4.parsed.operator}`)
|
|
34739
34812
|
});
|
|
34740
|
-
|
|
34741
|
-
|
|
34742
|
-
|
|
34743
|
-
const MAX_ITERATIONS = 1e4;
|
|
34744
|
-
let iterations = 0;
|
|
34745
|
-
do {
|
|
34746
|
-
if (++iterations > MAX_ITERATIONS) {
|
|
34747
|
-
logger6.error("executeAllRecordsQueryFullScan: \u6700\u5927\u53CD\u5FA9\u56DE\u6570\u3092\u8D85\u904E\u3057\u305F\u305F\u3081\u4E2D\u65AD", {
|
|
34813
|
+
scan: while (true) {
|
|
34814
|
+
if (++iterations > SCAN_MAX_ITERATIONS) {
|
|
34815
|
+
logger7.error("executeAllRecordsQueryFullScan: \u6700\u5927\u53CD\u5FA9\u56DE\u6570\u3092\u8D85\u904E", {
|
|
34748
34816
|
requestId,
|
|
34749
34817
|
resource,
|
|
34750
34818
|
iterations
|
|
34751
34819
|
});
|
|
34752
|
-
|
|
34820
|
+
throw new AppError("INTERNAL_ERROR" /* INTERNAL_ERROR */, "ID scan exceeded the iteration limit", 500, {
|
|
34821
|
+
resource,
|
|
34822
|
+
iterations
|
|
34823
|
+
});
|
|
34753
34824
|
}
|
|
34754
34825
|
const queryResult = await executeDynamoDBOperation(
|
|
34755
34826
|
() => dbClient2.send(
|
|
@@ -34761,8 +34832,7 @@ async function executeAllRecordsQueryFullScan(resource, sort, perPage, nextToken
|
|
|
34761
34832
|
":skPrefix": "id#"
|
|
34762
34833
|
},
|
|
34763
34834
|
ScanIndexForward: sort.order === "ASC",
|
|
34764
|
-
Limit:
|
|
34765
|
-
// 大きめの Limit でループ回数を最小化
|
|
34835
|
+
Limit: chunkSize,
|
|
34766
34836
|
ExclusiveStartKey: exclusiveStartKey,
|
|
34767
34837
|
ConsistentRead: true,
|
|
34768
34838
|
ReturnConsumedCapacity: "TOTAL"
|
|
@@ -34771,41 +34841,57 @@ async function executeAllRecordsQueryFullScan(resource, sort, perPage, nextToken
|
|
|
34771
34841
|
"Query"
|
|
34772
34842
|
);
|
|
34773
34843
|
costTracker.add(queryResult.ConsumedCapacity);
|
|
34774
|
-
|
|
34844
|
+
watcher.add((queryResult.Items || []).length);
|
|
34845
|
+
for (const row of queryResult.Items || []) {
|
|
34846
|
+
scanned++;
|
|
34847
|
+
if (!matchesAllFilters(extractCleanRecord(row), parsedFilters)) {
|
|
34848
|
+
continue;
|
|
34849
|
+
}
|
|
34850
|
+
if (page.length >= perPage) {
|
|
34851
|
+
hasNextPage = true;
|
|
34852
|
+
break scan;
|
|
34853
|
+
}
|
|
34854
|
+
page.push(extractCleanRecord(row));
|
|
34855
|
+
lastReturned = { PK: row.PK, SK: row.SK };
|
|
34856
|
+
}
|
|
34775
34857
|
const nextKey = queryResult.LastEvaluatedKey;
|
|
34776
|
-
|
|
34777
|
-
|
|
34778
|
-
|
|
34858
|
+
if (!nextKey) {
|
|
34859
|
+
break;
|
|
34860
|
+
}
|
|
34861
|
+
const nextKeySignature = `${nextKey.PK}#${nextKey.SK}`;
|
|
34862
|
+
if (nextKeySignature === previousKeySignature) {
|
|
34863
|
+
logger7.error("executeAllRecordsQueryFullScan: \u540C\u4E00\u306ELastEvaluatedKey\u304C\u8FD4\u5374\u3055\u308C\u305F", {
|
|
34779
34864
|
requestId,
|
|
34780
34865
|
resource,
|
|
34781
34866
|
iterations
|
|
34782
34867
|
});
|
|
34783
|
-
|
|
34868
|
+
throw new AppError(
|
|
34869
|
+
"INTERNAL_ERROR" /* INTERNAL_ERROR */,
|
|
34870
|
+
"ID scan received the same LastEvaluatedKey repeatedly",
|
|
34871
|
+
500,
|
|
34872
|
+
{ resource, iterations }
|
|
34873
|
+
);
|
|
34784
34874
|
}
|
|
34785
34875
|
previousKeySignature = nextKeySignature;
|
|
34786
34876
|
exclusiveStartKey = nextKey;
|
|
34787
|
-
|
|
34788
|
-
|
|
34789
|
-
|
|
34790
|
-
|
|
34791
|
-
const hasNextPage = offset + perPage < items.length;
|
|
34792
|
-
const nextTokenValue = hasNextPage ? encodeOffsetToken(offset + perPage) : void 0;
|
|
34793
|
-
logger6.info("ID full scan query succeeded", {
|
|
34877
|
+
chunkSize = Math.min(chunkSize * 2, SCAN_CHUNK_MAX);
|
|
34878
|
+
}
|
|
34879
|
+
const nextTokenValue = hasNextPage && lastReturned ? encodeNextToken(lastReturned.PK, lastReturned.SK) : void 0;
|
|
34880
|
+
logger7.info("ID filtered scan query succeeded", {
|
|
34794
34881
|
requestId,
|
|
34795
34882
|
resource,
|
|
34796
|
-
|
|
34797
|
-
offset,
|
|
34883
|
+
scanned,
|
|
34798
34884
|
returned: page.length,
|
|
34799
34885
|
hasNextPage
|
|
34800
34886
|
});
|
|
34801
34887
|
return {
|
|
34802
34888
|
items: page,
|
|
34803
|
-
pageInfo: { hasNextPage, hasPreviousPage:
|
|
34889
|
+
pageInfo: { hasNextPage, hasPreviousPage: !!nextToken },
|
|
34804
34890
|
...nextTokenValue && { nextToken: nextTokenValue },
|
|
34805
34891
|
consumedCapacity: costTracker.getAggregated()
|
|
34806
34892
|
};
|
|
34807
34893
|
}
|
|
34808
|
-
var import_lib_dynamodb2,
|
|
34894
|
+
var import_lib_dynamodb2, logger7, SCAN_CHUNK_INITIAL, SCAN_CHUNK_MAX, SCAN_MAX_ITERATIONS;
|
|
34809
34895
|
var init_idQuery = __esm({
|
|
34810
34896
|
"src/server/operations/find/idQuery.ts"() {
|
|
34811
34897
|
"use strict";
|
|
@@ -34814,8 +34900,9 @@ var init_idQuery = __esm({
|
|
|
34814
34900
|
init_cost_tracker();
|
|
34815
34901
|
init_dynamodb3();
|
|
34816
34902
|
init_pagination();
|
|
34903
|
+
init_scanWarning();
|
|
34817
34904
|
init_utils5();
|
|
34818
|
-
|
|
34905
|
+
logger7 = createLogger({
|
|
34819
34906
|
service: "id-query",
|
|
34820
34907
|
level: process.env.LOG_LEVEL || "info"
|
|
34821
34908
|
});
|
|
@@ -34823,13 +34910,16 @@ var init_idQuery = __esm({
|
|
|
34823
34910
|
__name(executeSpecificIdQuery, "executeSpecificIdQuery");
|
|
34824
34911
|
__name(executeInQuery, "executeInQuery");
|
|
34825
34912
|
__name(executeAllRecordsQuery, "executeAllRecordsQuery");
|
|
34913
|
+
SCAN_CHUNK_INITIAL = 100;
|
|
34914
|
+
SCAN_CHUNK_MAX = 1e3;
|
|
34915
|
+
SCAN_MAX_ITERATIONS = 1e4;
|
|
34826
34916
|
__name(executeAllRecordsQueryFullScan, "executeAllRecordsQueryFullScan");
|
|
34827
34917
|
}
|
|
34828
34918
|
});
|
|
34829
34919
|
|
|
34830
34920
|
// src/server/operations/find/nearQuery.ts
|
|
34831
34921
|
async function executeNearQuery(resource, fieldName, nearQuery, limit, requestId) {
|
|
34832
|
-
|
|
34922
|
+
logger8.debug("Executing $near query", {
|
|
34833
34923
|
requestId,
|
|
34834
34924
|
resource,
|
|
34835
34925
|
fieldName,
|
|
@@ -34840,7 +34930,7 @@ async function executeNearQuery(resource, fieldName, nearQuery, limit, requestId
|
|
|
34840
34930
|
const searchFunction = /* @__PURE__ */ __name(async (geohashPrefix) => {
|
|
34841
34931
|
const dbClient2 = getDBClient();
|
|
34842
34932
|
const tableName = getTableName();
|
|
34843
|
-
|
|
34933
|
+
logger8.debug("Searching shadow records", {
|
|
34844
34934
|
requestId,
|
|
34845
34935
|
resource,
|
|
34846
34936
|
fieldName,
|
|
@@ -34865,7 +34955,7 @@ async function executeNearQuery(resource, fieldName, nearQuery, limit, requestId
|
|
|
34865
34955
|
);
|
|
34866
34956
|
costTracker.add(queryResult.ConsumedCapacity);
|
|
34867
34957
|
const shadowRecords = queryResult.Items || [];
|
|
34868
|
-
|
|
34958
|
+
logger8.debug("Shadow records found", {
|
|
34869
34959
|
requestId,
|
|
34870
34960
|
resource,
|
|
34871
34961
|
geohashPrefix,
|
|
@@ -34876,7 +34966,7 @@ async function executeNearQuery(resource, fieldName, nearQuery, limit, requestId
|
|
|
34876
34966
|
const parts = sk.split("#id#");
|
|
34877
34967
|
return parts.length === 2 ? parts[1] : null;
|
|
34878
34968
|
}).filter((id) => id !== null);
|
|
34879
|
-
|
|
34969
|
+
logger8.debug("Main record IDs extracted", {
|
|
34880
34970
|
requestId,
|
|
34881
34971
|
resource,
|
|
34882
34972
|
geohashPrefix,
|
|
@@ -34910,14 +35000,14 @@ async function executeNearQuery(resource, fieldName, nearQuery, limit, requestId
|
|
|
34910
35000
|
}
|
|
34911
35001
|
validRecords.push(...batchGetResult.Responses?.[tableName] || []);
|
|
34912
35002
|
}
|
|
34913
|
-
|
|
35003
|
+
logger8.debug("Main records retrieved", {
|
|
34914
35004
|
requestId,
|
|
34915
35005
|
resource,
|
|
34916
35006
|
geohashPrefix,
|
|
34917
35007
|
count: validRecords.length
|
|
34918
35008
|
});
|
|
34919
35009
|
const cleanRecords = validRecords.map((record) => extractCleanRecord(record));
|
|
34920
|
-
|
|
35010
|
+
logger8.debug("Clean records extracted", {
|
|
34921
35011
|
requestId,
|
|
34922
35012
|
resource,
|
|
34923
35013
|
geohashPrefix,
|
|
@@ -34936,7 +35026,7 @@ async function executeNearQuery(resource, fieldName, nearQuery, limit, requestId
|
|
|
34936
35026
|
config
|
|
34937
35027
|
);
|
|
34938
35028
|
const items = result.documents;
|
|
34939
|
-
|
|
35029
|
+
logger8.info("$near query succeeded", {
|
|
34940
35030
|
requestId,
|
|
34941
35031
|
resource,
|
|
34942
35032
|
fieldName,
|
|
@@ -34954,7 +35044,7 @@ async function executeNearQuery(resource, fieldName, nearQuery, limit, requestId
|
|
|
34954
35044
|
consumedCapacity: costTracker.getAggregated()
|
|
34955
35045
|
};
|
|
34956
35046
|
}
|
|
34957
|
-
var import_lib_dynamodb3,
|
|
35047
|
+
var import_lib_dynamodb3, logger8;
|
|
34958
35048
|
var init_nearQuery = __esm({
|
|
34959
35049
|
"src/server/operations/find/nearQuery.ts"() {
|
|
34960
35050
|
"use strict";
|
|
@@ -34964,7 +35054,7 @@ var init_nearQuery = __esm({
|
|
|
34964
35054
|
init_nearSearch();
|
|
34965
35055
|
init_cost_tracker();
|
|
34966
35056
|
init_dynamodb3();
|
|
34967
|
-
|
|
35057
|
+
logger8 = createLogger({
|
|
34968
35058
|
service: "near-query",
|
|
34969
35059
|
level: process.env.LOG_LEVEL || "info"
|
|
34970
35060
|
});
|
|
@@ -34994,7 +35084,7 @@ async function executeShadowQuery(resource, normalizedParams, requestId) {
|
|
|
34994
35084
|
(f4) => !(isKeyConditionOptimized && f4 === optimizableFilter)
|
|
34995
35085
|
);
|
|
34996
35086
|
if (residualFilters.length > 0) {
|
|
34997
|
-
|
|
35087
|
+
logger9.debug("Residual filters detected, falling back to full scan", {
|
|
34998
35088
|
requestId,
|
|
34999
35089
|
resource,
|
|
35000
35090
|
sortField: sort.field,
|
|
@@ -35002,7 +35092,7 @@ async function executeShadowQuery(resource, normalizedParams, requestId) {
|
|
|
35002
35092
|
});
|
|
35003
35093
|
return executeFullScanQuery(resource, normalizedParams, costTracker, requestId);
|
|
35004
35094
|
}
|
|
35005
|
-
|
|
35095
|
+
logger9.debug("Executing shadow query", {
|
|
35006
35096
|
requestId,
|
|
35007
35097
|
resource,
|
|
35008
35098
|
sortField: sort.field,
|
|
@@ -35050,7 +35140,7 @@ async function executeShadowQuery(resource, normalizedParams, requestId) {
|
|
|
35050
35140
|
shadowRecords.LastEvaluatedKey.PK,
|
|
35051
35141
|
shadowRecords.LastEvaluatedKey.SK
|
|
35052
35142
|
) : void 0;
|
|
35053
|
-
|
|
35143
|
+
logger9.info("Shadow query succeeded", {
|
|
35054
35144
|
requestId,
|
|
35055
35145
|
resource,
|
|
35056
35146
|
sortField: sort.field,
|
|
@@ -35075,7 +35165,7 @@ async function executeFilterFirstQuery(resource, normalizedParams, filterCandida
|
|
|
35075
35165
|
const offset = nextToken ? decodeOffsetToken(nextToken) ?? 0 : 0;
|
|
35076
35166
|
const filterSort = { field: filterCandidate.parsed.field, order: "ASC" };
|
|
35077
35167
|
const remainingFilters = parsedFilters.filter((f4) => f4 !== filterCandidate);
|
|
35078
|
-
|
|
35168
|
+
logger9.debug("Executing filter-first query", {
|
|
35079
35169
|
requestId,
|
|
35080
35170
|
resource,
|
|
35081
35171
|
filterField: filterCandidate.parsed.field,
|
|
@@ -35087,7 +35177,9 @@ async function executeFilterFirstQuery(resource, normalizedParams, filterCandida
|
|
|
35087
35177
|
filterSort,
|
|
35088
35178
|
filterCandidate,
|
|
35089
35179
|
costTracker,
|
|
35090
|
-
requestId
|
|
35180
|
+
requestId,
|
|
35181
|
+
"shadow-filter-first",
|
|
35182
|
+
parsedFilters
|
|
35091
35183
|
);
|
|
35092
35184
|
if (remainingFilters.length > 0) {
|
|
35093
35185
|
items = items.filter((r4) => matchesAllFilters(r4, remainingFilters));
|
|
@@ -35096,7 +35188,7 @@ async function executeFilterFirstQuery(resource, normalizedParams, filterCandida
|
|
|
35096
35188
|
const page = items.slice(offset, offset + perPage);
|
|
35097
35189
|
const hasNextPage = offset + perPage < items.length;
|
|
35098
35190
|
const nextTokenValue = hasNextPage ? encodeOffsetToken(offset + perPage) : void 0;
|
|
35099
|
-
|
|
35191
|
+
logger9.info("Filter-first query succeeded", {
|
|
35100
35192
|
requestId,
|
|
35101
35193
|
resource,
|
|
35102
35194
|
filterField: filterCandidate.parsed.field,
|
|
@@ -35117,20 +35209,28 @@ async function executeFullScanQuery(resource, normalizedParams, costTracker, req
|
|
|
35117
35209
|
const { sort, pagination, parsedFilters } = normalizedParams;
|
|
35118
35210
|
const { perPage, nextToken } = pagination;
|
|
35119
35211
|
const offset = nextToken ? decodeOffsetToken(nextToken) ?? 0 : 0;
|
|
35120
|
-
|
|
35212
|
+
logger9.debug("Executing full scan query", {
|
|
35121
35213
|
requestId,
|
|
35122
35214
|
resource,
|
|
35123
35215
|
sortField: sort.field,
|
|
35124
35216
|
offset
|
|
35125
35217
|
});
|
|
35126
|
-
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
|
+
);
|
|
35127
35227
|
if (parsedFilters.length > 0) {
|
|
35128
35228
|
items = items.filter((r4) => matchesAllFilters(r4, parsedFilters));
|
|
35129
35229
|
}
|
|
35130
35230
|
const page = items.slice(offset, offset + perPage);
|
|
35131
35231
|
const hasNextPage = offset + perPage < items.length;
|
|
35132
35232
|
const nextTokenValue = hasNextPage ? encodeOffsetToken(offset + perPage) : void 0;
|
|
35133
|
-
|
|
35233
|
+
logger9.info("Full scan query succeeded", {
|
|
35134
35234
|
requestId,
|
|
35135
35235
|
resource,
|
|
35136
35236
|
sortField: sort.field,
|
|
@@ -35146,20 +35246,35 @@ async function executeFullScanQuery(resource, normalizedParams, costTracker, req
|
|
|
35146
35246
|
consumedCapacity: costTracker.getAggregated()
|
|
35147
35247
|
};
|
|
35148
35248
|
}
|
|
35149
|
-
async function fetchAllRecordsViaShadowIndex(resource, indexSort, indexFilter, costTracker, requestId) {
|
|
35249
|
+
async function fetchAllRecordsViaShadowIndex(resource, indexSort, indexFilter, costTracker, requestId, scanPath, parsedFilters) {
|
|
35150
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
|
+
});
|
|
35151
35258
|
let lastKey;
|
|
35152
35259
|
let previousKeySignature;
|
|
35153
35260
|
const MAX_ITERATIONS = 1e4;
|
|
35154
35261
|
let iterations = 0;
|
|
35155
35262
|
do {
|
|
35156
35263
|
if (++iterations > MAX_ITERATIONS) {
|
|
35157
|
-
|
|
35264
|
+
logger9.error("fetchAllRecordsViaShadowIndex: \u6700\u5927\u53CD\u5FA9\u56DE\u6570\u3092\u8D85\u904E", {
|
|
35158
35265
|
requestId,
|
|
35159
35266
|
resource,
|
|
35160
35267
|
iterations
|
|
35161
35268
|
});
|
|
35162
|
-
|
|
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
|
+
);
|
|
35163
35278
|
}
|
|
35164
35279
|
const result = await executeShadowRecordQuery(
|
|
35165
35280
|
resource,
|
|
@@ -35172,15 +35287,21 @@ async function fetchAllRecordsViaShadowIndex(resource, indexSort, indexFilter, c
|
|
|
35172
35287
|
requestId
|
|
35173
35288
|
);
|
|
35174
35289
|
allShadowItems.push(...result.Items || []);
|
|
35290
|
+
watcher.add((result.Items || []).length);
|
|
35175
35291
|
const nextKey = result.LastEvaluatedKey;
|
|
35176
35292
|
const nextKeySignature = nextKey ? `${nextKey.PK}#${nextKey.SK}` : void 0;
|
|
35177
35293
|
if (nextKeySignature && nextKeySignature === previousKeySignature) {
|
|
35178
|
-
|
|
35294
|
+
logger9.error("fetchAllRecordsViaShadowIndex: \u540C\u4E00\u306ELastEvaluatedKey\u304C\u8FD4\u5374\u3055\u308C\u305F", {
|
|
35179
35295
|
requestId,
|
|
35180
35296
|
resource,
|
|
35181
35297
|
iterations
|
|
35182
35298
|
});
|
|
35183
|
-
|
|
35299
|
+
throw new AppError(
|
|
35300
|
+
"INTERNAL_ERROR" /* INTERNAL_ERROR */,
|
|
35301
|
+
"Shadow index scan received the same LastEvaluatedKey repeatedly",
|
|
35302
|
+
500,
|
|
35303
|
+
{ resource, iterations }
|
|
35304
|
+
);
|
|
35184
35305
|
}
|
|
35185
35306
|
previousKeySignature = nextKeySignature;
|
|
35186
35307
|
lastKey = nextKey;
|
|
@@ -35386,7 +35507,7 @@ async function fetchMainRecords(resource, recordIds, costTracker, requestId) {
|
|
|
35386
35507
|
}
|
|
35387
35508
|
allRecords.push(...batchGetResult.Responses?.[tableName] || []);
|
|
35388
35509
|
}
|
|
35389
|
-
|
|
35510
|
+
logger9.debug("Main records fetched", {
|
|
35390
35511
|
requestId,
|
|
35391
35512
|
resource,
|
|
35392
35513
|
requestedCount: uniqueRecordIds.length,
|
|
@@ -35394,7 +35515,7 @@ async function fetchMainRecords(resource, recordIds, costTracker, requestId) {
|
|
|
35394
35515
|
});
|
|
35395
35516
|
return allRecords;
|
|
35396
35517
|
}
|
|
35397
|
-
var import_lib_dynamodb4,
|
|
35518
|
+
var import_lib_dynamodb4, logger9, KEY_CONDITION_OPERATORS;
|
|
35398
35519
|
var init_shadowQuery = __esm({
|
|
35399
35520
|
"src/server/operations/find/shadowQuery.ts"() {
|
|
35400
35521
|
"use strict";
|
|
@@ -35404,8 +35525,9 @@ var init_shadowQuery = __esm({
|
|
|
35404
35525
|
init_cost_tracker();
|
|
35405
35526
|
init_dynamodb3();
|
|
35406
35527
|
init_pagination();
|
|
35528
|
+
init_scanWarning();
|
|
35407
35529
|
init_utils5();
|
|
35408
|
-
|
|
35530
|
+
logger9 = createLogger({
|
|
35409
35531
|
service: "shadow-query",
|
|
35410
35532
|
level: process.env.LOG_LEVEL || "info"
|
|
35411
35533
|
});
|
|
@@ -35426,14 +35548,14 @@ var init_shadowQuery = __esm({
|
|
|
35426
35548
|
|
|
35427
35549
|
// src/server/operations/find/handler.ts
|
|
35428
35550
|
async function handleFind(resource, params, requestId) {
|
|
35429
|
-
|
|
35551
|
+
logger10.debug("Executing find", {
|
|
35430
35552
|
requestId,
|
|
35431
35553
|
resource,
|
|
35432
35554
|
params
|
|
35433
35555
|
});
|
|
35434
35556
|
const nearDetection = detectNearQuery(params.filter);
|
|
35435
35557
|
if (nearDetection) {
|
|
35436
|
-
|
|
35558
|
+
logger10.debug("$near operator detected, executing near search", {
|
|
35437
35559
|
requestId,
|
|
35438
35560
|
resource,
|
|
35439
35561
|
fieldName: nearDetection.fieldName
|
|
@@ -35450,7 +35572,7 @@ async function handleFind(resource, params, requestId) {
|
|
|
35450
35572
|
const config = initializeFindConfig();
|
|
35451
35573
|
const normalizedParams = normalizeFindParams(config, resource, params);
|
|
35452
35574
|
validateSortField(config, resource, normalizedParams.sort);
|
|
35453
|
-
|
|
35575
|
+
logger10.debug("Find parameters normalized", {
|
|
35454
35576
|
requestId,
|
|
35455
35577
|
resource,
|
|
35456
35578
|
sort: normalizedParams.sort,
|
|
@@ -35465,7 +35587,7 @@ async function handleFind(resource, params, requestId) {
|
|
|
35465
35587
|
}
|
|
35466
35588
|
return executeShadowQuery(resource, normalizedParams, requestId);
|
|
35467
35589
|
}
|
|
35468
|
-
var
|
|
35590
|
+
var logger10;
|
|
35469
35591
|
var init_handler = __esm({
|
|
35470
35592
|
"src/server/operations/find/handler.ts"() {
|
|
35471
35593
|
"use strict";
|
|
@@ -35475,7 +35597,7 @@ var init_handler = __esm({
|
|
|
35475
35597
|
init_nearQuery();
|
|
35476
35598
|
init_shadowQuery();
|
|
35477
35599
|
init_utils5();
|
|
35478
|
-
|
|
35600
|
+
logger10 = createLogger({
|
|
35479
35601
|
service: "find-handler",
|
|
35480
35602
|
level: process.env.LOG_LEVEL || "info"
|
|
35481
35603
|
});
|
|
@@ -35506,13 +35628,13 @@ async function handleDeleteMany(resource, params, requestId) {
|
|
|
35506
35628
|
let ids;
|
|
35507
35629
|
if ("ids" in params) {
|
|
35508
35630
|
ids = params.ids;
|
|
35509
|
-
|
|
35631
|
+
logger11.debug("Executing deleteMany with ids", {
|
|
35510
35632
|
requestId,
|
|
35511
35633
|
resource,
|
|
35512
35634
|
count: ids.length
|
|
35513
35635
|
});
|
|
35514
35636
|
} else {
|
|
35515
|
-
|
|
35637
|
+
logger11.debug("Executing deleteMany with filter", {
|
|
35516
35638
|
requestId,
|
|
35517
35639
|
resource,
|
|
35518
35640
|
filter: params.filter
|
|
@@ -35520,7 +35642,7 @@ async function handleDeleteMany(resource, params, requestId) {
|
|
|
35520
35642
|
const { handleFind: handleFind2 } = await Promise.resolve().then(() => (init_find(), find_exports));
|
|
35521
35643
|
const findResult = await handleFind2(resource, { filter: params.filter }, requestId);
|
|
35522
35644
|
ids = findResult.items.map((item) => item.id);
|
|
35523
|
-
|
|
35645
|
+
logger11.debug("Found records with filter", {
|
|
35524
35646
|
requestId,
|
|
35525
35647
|
resource,
|
|
35526
35648
|
count: ids.length
|
|
@@ -35584,7 +35706,7 @@ async function handleDeleteMany(resource, params, requestId) {
|
|
|
35584
35706
|
message: `Record not found: ${id}`
|
|
35585
35707
|
}));
|
|
35586
35708
|
if (preparedRecords.length === 0) {
|
|
35587
|
-
|
|
35709
|
+
logger11.info("deleteMany completed - no records found", {
|
|
35588
35710
|
requestId,
|
|
35589
35711
|
resource,
|
|
35590
35712
|
requested: ids.length,
|
|
@@ -35743,7 +35865,7 @@ async function handleDeleteMany(resource, params, requestId) {
|
|
|
35743
35865
|
consumedCapacity: costTracker.getAggregated()
|
|
35744
35866
|
};
|
|
35745
35867
|
}
|
|
35746
|
-
var import_lib_dynamodb5,
|
|
35868
|
+
var import_lib_dynamodb5, logger11;
|
|
35747
35869
|
var init_deleteMany = __esm({
|
|
35748
35870
|
"src/server/operations/deleteMany.ts"() {
|
|
35749
35871
|
"use strict";
|
|
@@ -35754,7 +35876,7 @@ var init_deleteMany = __esm({
|
|
|
35754
35876
|
init_chunking();
|
|
35755
35877
|
init_cost_tracker();
|
|
35756
35878
|
init_dynamodb3();
|
|
35757
|
-
|
|
35879
|
+
logger11 = createLogger({ service: "records-lambda" });
|
|
35758
35880
|
__name(handleDeleteMany, "handleDeleteMany");
|
|
35759
35881
|
}
|
|
35760
35882
|
});
|
|
@@ -35763,7 +35885,7 @@ var init_deleteMany = __esm({
|
|
|
35763
35885
|
async function handleFindMany(resource, params, requestId) {
|
|
35764
35886
|
if ("ids" in params) {
|
|
35765
35887
|
const { ids } = params;
|
|
35766
|
-
|
|
35888
|
+
logger13.debug("Executing findMany by ids", {
|
|
35767
35889
|
requestId,
|
|
35768
35890
|
resource,
|
|
35769
35891
|
count: ids.length
|
|
@@ -35792,7 +35914,7 @@ async function handleFindMany(resource, params, requestId) {
|
|
|
35792
35914
|
);
|
|
35793
35915
|
const items = result.Responses?.[tableName] || [];
|
|
35794
35916
|
const records = items.map((item) => extractCleanRecord(item));
|
|
35795
|
-
|
|
35917
|
+
logger13.info("findMany by ids succeeded", {
|
|
35796
35918
|
requestId,
|
|
35797
35919
|
resource,
|
|
35798
35920
|
requested: ids.length,
|
|
@@ -35802,7 +35924,7 @@ async function handleFindMany(resource, params, requestId) {
|
|
|
35802
35924
|
}
|
|
35803
35925
|
if ("filter" in params) {
|
|
35804
35926
|
const { filter } = params;
|
|
35805
|
-
|
|
35927
|
+
logger13.debug("Executing findMany by filter", {
|
|
35806
35928
|
requestId,
|
|
35807
35929
|
resource,
|
|
35808
35930
|
filter
|
|
@@ -35814,7 +35936,7 @@ async function handleFindMany(resource, params, requestId) {
|
|
|
35814
35936
|
},
|
|
35815
35937
|
requestId
|
|
35816
35938
|
);
|
|
35817
|
-
|
|
35939
|
+
logger13.info("findMany by filter succeeded", {
|
|
35818
35940
|
requestId,
|
|
35819
35941
|
resource,
|
|
35820
35942
|
filter,
|
|
@@ -35824,7 +35946,7 @@ async function handleFindMany(resource, params, requestId) {
|
|
|
35824
35946
|
}
|
|
35825
35947
|
throw new Error("findMany requires either ids or filter");
|
|
35826
35948
|
}
|
|
35827
|
-
var import_lib_dynamodb6,
|
|
35949
|
+
var import_lib_dynamodb6, logger13;
|
|
35828
35950
|
var init_findMany = __esm({
|
|
35829
35951
|
"src/server/operations/findMany.ts"() {
|
|
35830
35952
|
"use strict";
|
|
@@ -35833,7 +35955,7 @@ var init_findMany = __esm({
|
|
|
35833
35955
|
init_shadow();
|
|
35834
35956
|
init_dynamodb3();
|
|
35835
35957
|
init_find();
|
|
35836
|
-
|
|
35958
|
+
logger13 = createLogger({ service: "records-lambda" });
|
|
35837
35959
|
__name(handleFindMany, "handleFindMany");
|
|
35838
35960
|
}
|
|
35839
35961
|
});
|
|
@@ -35846,7 +35968,7 @@ __export(findOne_exports, {
|
|
|
35846
35968
|
async function handleFindOne(resource, params, requestId) {
|
|
35847
35969
|
if ("id" in params) {
|
|
35848
35970
|
const { id } = params;
|
|
35849
|
-
|
|
35971
|
+
logger15.debug("Executing findOne by id (using findMany)", {
|
|
35850
35972
|
requestId,
|
|
35851
35973
|
resource,
|
|
35852
35974
|
id
|
|
@@ -35855,7 +35977,7 @@ async function handleFindOne(resource, params, requestId) {
|
|
|
35855
35977
|
if (results.length === 0) {
|
|
35856
35978
|
throw new ItemNotFoundError(`Record not found: ${id}`, { resource, id });
|
|
35857
35979
|
}
|
|
35858
|
-
|
|
35980
|
+
logger15.info("findOne by id succeeded", {
|
|
35859
35981
|
requestId,
|
|
35860
35982
|
resource,
|
|
35861
35983
|
id
|
|
@@ -35864,7 +35986,7 @@ async function handleFindOne(resource, params, requestId) {
|
|
|
35864
35986
|
}
|
|
35865
35987
|
if ("filter" in params) {
|
|
35866
35988
|
const { filter } = params;
|
|
35867
|
-
|
|
35989
|
+
logger15.debug("Executing findOne by filter (using findMany)", {
|
|
35868
35990
|
requestId,
|
|
35869
35991
|
resource,
|
|
35870
35992
|
filter
|
|
@@ -35873,7 +35995,7 @@ async function handleFindOne(resource, params, requestId) {
|
|
|
35873
35995
|
if (results.length === 0) {
|
|
35874
35996
|
throw new ItemNotFoundError(`Record not found with filter`, { resource, filter });
|
|
35875
35997
|
}
|
|
35876
|
-
|
|
35998
|
+
logger15.info("findOne by filter succeeded", {
|
|
35877
35999
|
requestId,
|
|
35878
36000
|
resource,
|
|
35879
36001
|
filter
|
|
@@ -35882,13 +36004,13 @@ async function handleFindOne(resource, params, requestId) {
|
|
|
35882
36004
|
}
|
|
35883
36005
|
throw new Error("findOne requires either id or filter");
|
|
35884
36006
|
}
|
|
35885
|
-
var
|
|
36007
|
+
var logger15;
|
|
35886
36008
|
var init_findOne = __esm({
|
|
35887
36009
|
"src/server/operations/findOne.ts"() {
|
|
35888
36010
|
"use strict";
|
|
35889
36011
|
init_shared();
|
|
35890
36012
|
init_findMany();
|
|
35891
|
-
|
|
36013
|
+
logger15 = createLogger({ service: "records-lambda" });
|
|
35892
36014
|
__name(handleFindOne, "handleFindOne");
|
|
35893
36015
|
}
|
|
35894
36016
|
});
|
|
@@ -35949,13 +36071,13 @@ function calculateTTL(resource, createdAt) {
|
|
|
35949
36071
|
}
|
|
35950
36072
|
const ttlDays = parseInt(ttlDaysStr, 10);
|
|
35951
36073
|
if (isNaN(ttlDays) || ttlDays <= 0) {
|
|
35952
|
-
|
|
36074
|
+
logger16.warn("Invalid TTL_DAYS value", { resource, envKey, value: ttlDaysStr });
|
|
35953
36075
|
return void 0;
|
|
35954
36076
|
}
|
|
35955
36077
|
const createdAtMs = new Date(createdAt).getTime();
|
|
35956
36078
|
const ttlMs = createdAtMs + ttlDays * 24 * 60 * 60 * 1e3;
|
|
35957
36079
|
const ttl = Math.floor(ttlMs / 1e3);
|
|
35958
|
-
|
|
36080
|
+
logger16.debug("TTL calculated", {
|
|
35959
36081
|
resource,
|
|
35960
36082
|
ttlDays,
|
|
35961
36083
|
createdAt,
|
|
@@ -35967,7 +36089,7 @@ function calculateTTL(resource, createdAt) {
|
|
|
35967
36089
|
function addTTL(resource, recordData) {
|
|
35968
36090
|
const createdAt = recordData.createdAt;
|
|
35969
36091
|
if (!createdAt) {
|
|
35970
|
-
|
|
36092
|
+
logger16.warn("createdAt not found, skipping TTL calculation", { resource });
|
|
35971
36093
|
return recordData;
|
|
35972
36094
|
}
|
|
35973
36095
|
const ttl = calculateTTL(resource, createdAt);
|
|
@@ -35979,12 +36101,12 @@ function addTTL(resource, recordData) {
|
|
|
35979
36101
|
ttl
|
|
35980
36102
|
};
|
|
35981
36103
|
}
|
|
35982
|
-
var
|
|
36104
|
+
var logger16;
|
|
35983
36105
|
var init_ttl = __esm({
|
|
35984
36106
|
"src/server/utils/ttl.ts"() {
|
|
35985
36107
|
"use strict";
|
|
35986
36108
|
init_index2();
|
|
35987
|
-
|
|
36109
|
+
logger16 = createLogger({ service: "records-lambda" });
|
|
35988
36110
|
__name(calculateTTL, "calculateTTL");
|
|
35989
36111
|
__name(addTTL, "addTTL");
|
|
35990
36112
|
}
|
|
@@ -35999,7 +36121,7 @@ async function handleInsertMany(resource, params, requestId) {
|
|
|
35999
36121
|
const { data: recordsData } = params;
|
|
36000
36122
|
const startTime = Date.now();
|
|
36001
36123
|
const costTracker = new CostTracker();
|
|
36002
|
-
|
|
36124
|
+
logger17.debug("Executing insertMany", {
|
|
36003
36125
|
requestId,
|
|
36004
36126
|
resource,
|
|
36005
36127
|
count: recordsData.length
|
|
@@ -36042,7 +36164,7 @@ async function handleInsertMany(resource, params, requestId) {
|
|
|
36042
36164
|
const failedId = recordData.id || `temp-id-${i4}`;
|
|
36043
36165
|
const errorMessage = error2 instanceof Error ? error2.message : "Unknown preparation error";
|
|
36044
36166
|
const errorCode = getPreparationErrorCode(error2);
|
|
36045
|
-
|
|
36167
|
+
logger17.error("Failed to prepare record for creation", {
|
|
36046
36168
|
requestId,
|
|
36047
36169
|
recordId: failedId,
|
|
36048
36170
|
error: errorMessage,
|
|
@@ -36207,7 +36329,7 @@ function getPreparationErrorCode(error2) {
|
|
|
36207
36329
|
}
|
|
36208
36330
|
return "VALIDATION_ERROR" /* VALIDATION_ERROR */;
|
|
36209
36331
|
}
|
|
36210
|
-
var import_lib_dynamodb8,
|
|
36332
|
+
var import_lib_dynamodb8, logger17;
|
|
36211
36333
|
var init_insertMany = __esm({
|
|
36212
36334
|
"src/server/operations/insertMany.ts"() {
|
|
36213
36335
|
"use strict";
|
|
@@ -36221,7 +36343,7 @@ var init_insertMany = __esm({
|
|
|
36221
36343
|
init_dynamodb3();
|
|
36222
36344
|
init_timestamps();
|
|
36223
36345
|
init_ttl();
|
|
36224
|
-
|
|
36346
|
+
logger17 = createLogger({ service: "records-lambda" });
|
|
36225
36347
|
__name(handleInsertMany, "handleInsertMany");
|
|
36226
36348
|
__name(getPreparationErrorCode, "getPreparationErrorCode");
|
|
36227
36349
|
}
|
|
@@ -36344,7 +36466,7 @@ async function handleUpdateMany(resource, params, requestId) {
|
|
|
36344
36466
|
const upsert = options?.upsert ?? false;
|
|
36345
36467
|
const startTime = Date.now();
|
|
36346
36468
|
const costTracker = new CostTracker();
|
|
36347
|
-
|
|
36469
|
+
logger19.debug("Executing updateMany", {
|
|
36348
36470
|
requestId,
|
|
36349
36471
|
resource,
|
|
36350
36472
|
upsert
|
|
@@ -36352,13 +36474,13 @@ async function handleUpdateMany(resource, params, requestId) {
|
|
|
36352
36474
|
let ids;
|
|
36353
36475
|
if ("ids" in params) {
|
|
36354
36476
|
ids = params.ids;
|
|
36355
|
-
|
|
36477
|
+
logger19.debug("Executing updateMany with ids", {
|
|
36356
36478
|
requestId,
|
|
36357
36479
|
resource,
|
|
36358
36480
|
count: ids.length
|
|
36359
36481
|
});
|
|
36360
36482
|
} else {
|
|
36361
|
-
|
|
36483
|
+
logger19.debug("Executing updateMany with filter", {
|
|
36362
36484
|
requestId,
|
|
36363
36485
|
resource,
|
|
36364
36486
|
filter: params.filter
|
|
@@ -36366,7 +36488,7 @@ async function handleUpdateMany(resource, params, requestId) {
|
|
|
36366
36488
|
const { handleFind: handleFind2 } = await Promise.resolve().then(() => (init_find(), find_exports));
|
|
36367
36489
|
const findResult = await handleFind2(resource, { filter: params.filter }, requestId);
|
|
36368
36490
|
ids = findResult.items.map((item) => item.id);
|
|
36369
|
-
|
|
36491
|
+
logger19.debug("Found records with filter", {
|
|
36370
36492
|
requestId,
|
|
36371
36493
|
resource,
|
|
36372
36494
|
count: ids.length
|
|
@@ -36375,7 +36497,7 @@ async function handleUpdateMany(resource, params, requestId) {
|
|
|
36375
36497
|
if (upsert) {
|
|
36376
36498
|
const newId = ulid2();
|
|
36377
36499
|
ids = [newId];
|
|
36378
|
-
|
|
36500
|
+
logger19.info("Creating new record with filter (upsert: true)", {
|
|
36379
36501
|
requestId,
|
|
36380
36502
|
resource,
|
|
36381
36503
|
newId,
|
|
@@ -36439,7 +36561,7 @@ async function handleUpdateMany(resource, params, requestId) {
|
|
|
36439
36561
|
);
|
|
36440
36562
|
const notFoundIds = ids.filter((id) => !existingIds.has(id));
|
|
36441
36563
|
if (!upsert && notFoundIds.length > 0) {
|
|
36442
|
-
|
|
36564
|
+
logger19.warn("Records not found (upsert: false)", {
|
|
36443
36565
|
requestId,
|
|
36444
36566
|
resource,
|
|
36445
36567
|
notFoundCount: notFoundIds.length,
|
|
@@ -36448,7 +36570,7 @@ async function handleUpdateMany(resource, params, requestId) {
|
|
|
36448
36570
|
});
|
|
36449
36571
|
}
|
|
36450
36572
|
if (upsert && notFoundIds.length > 0) {
|
|
36451
|
-
|
|
36573
|
+
logger19.info("Creating new records (upsert: true)", {
|
|
36452
36574
|
requestId,
|
|
36453
36575
|
resource,
|
|
36454
36576
|
notFoundCount: notFoundIds.length,
|
|
@@ -36484,7 +36606,7 @@ async function handleUpdateMany(resource, params, requestId) {
|
|
|
36484
36606
|
const failedId = existingData.id || "unknown-id";
|
|
36485
36607
|
const errorMessage = error2 instanceof Error ? error2.message : "Unknown preparation error";
|
|
36486
36608
|
const errorCode = getPreparationErrorCode2(error2);
|
|
36487
|
-
|
|
36609
|
+
logger19.error("Failed to prepare record for update", {
|
|
36488
36610
|
requestId,
|
|
36489
36611
|
recordId: failedId,
|
|
36490
36612
|
error: errorMessage,
|
|
@@ -36524,7 +36646,7 @@ async function handleUpdateMany(resource, params, requestId) {
|
|
|
36524
36646
|
} catch (error2) {
|
|
36525
36647
|
const errorMessage = error2 instanceof Error ? error2.message : "Unknown preparation error";
|
|
36526
36648
|
const errorCode = getPreparationErrorCode2(error2);
|
|
36527
|
-
|
|
36649
|
+
logger19.error("Failed to prepare new record for upsert", {
|
|
36528
36650
|
requestId,
|
|
36529
36651
|
recordId: id,
|
|
36530
36652
|
error: errorMessage,
|
|
@@ -36737,7 +36859,7 @@ function getPreparationErrorCode2(error2) {
|
|
|
36737
36859
|
}
|
|
36738
36860
|
return "VALIDATION_ERROR" /* VALIDATION_ERROR */;
|
|
36739
36861
|
}
|
|
36740
|
-
var import_lib_dynamodb9,
|
|
36862
|
+
var import_lib_dynamodb9, logger19;
|
|
36741
36863
|
var init_updateMany = __esm({
|
|
36742
36864
|
"src/server/operations/updateMany.ts"() {
|
|
36743
36865
|
"use strict";
|
|
@@ -36751,7 +36873,7 @@ var init_updateMany = __esm({
|
|
|
36751
36873
|
init_dynamodb3();
|
|
36752
36874
|
init_mergePatch();
|
|
36753
36875
|
init_timestamps();
|
|
36754
|
-
|
|
36876
|
+
logger19 = createLogger({ service: "records-lambda" });
|
|
36755
36877
|
__name(handleUpdateMany, "handleUpdateMany");
|
|
36756
36878
|
__name(getPreparationErrorCode2, "getPreparationErrorCode");
|
|
36757
36879
|
}
|
|
@@ -36772,13 +36894,13 @@ init_deleteMany();
|
|
|
36772
36894
|
|
|
36773
36895
|
// src/server/operations/deleteOne.ts
|
|
36774
36896
|
init_shared();
|
|
36775
|
-
var
|
|
36897
|
+
var logger12 = createLogger({ service: "records-lambda" });
|
|
36776
36898
|
async function handleDeleteOne(resource, params, requestId) {
|
|
36777
36899
|
const { handleDeleteMany: handleDeleteMany2 } = await Promise.resolve().then(() => (init_deleteMany(), deleteMany_exports));
|
|
36778
36900
|
let targetId;
|
|
36779
36901
|
if ("id" in params) {
|
|
36780
36902
|
targetId = params.id;
|
|
36781
|
-
|
|
36903
|
+
logger12.debug("Executing deleteOne with id", {
|
|
36782
36904
|
requestId,
|
|
36783
36905
|
resource,
|
|
36784
36906
|
id: targetId
|
|
@@ -36805,7 +36927,7 @@ async function handleDeleteOne(resource, params, requestId) {
|
|
|
36805
36927
|
consumedCapacity: deleteManyResult.consumedCapacity
|
|
36806
36928
|
};
|
|
36807
36929
|
} else {
|
|
36808
|
-
|
|
36930
|
+
logger12.debug("Executing deleteOne with filter", {
|
|
36809
36931
|
requestId,
|
|
36810
36932
|
resource,
|
|
36811
36933
|
filter: params.filter
|
|
@@ -36829,7 +36951,7 @@ async function handleDeleteOne(resource, params, requestId) {
|
|
|
36829
36951
|
if (!deletedId) {
|
|
36830
36952
|
throw new Error("Failed to get deleted record ID");
|
|
36831
36953
|
}
|
|
36832
|
-
|
|
36954
|
+
logger12.info("deleteOne succeeded", {
|
|
36833
36955
|
requestId,
|
|
36834
36956
|
resource,
|
|
36835
36957
|
id: deletedId
|
|
@@ -36855,10 +36977,10 @@ init_shadow();
|
|
|
36855
36977
|
init_dynamodb3();
|
|
36856
36978
|
init_pagination();
|
|
36857
36979
|
init_validation2();
|
|
36858
|
-
var
|
|
36980
|
+
var logger14 = createLogger({ service: "records-lambda" });
|
|
36859
36981
|
async function handleFindManyReference(resource, params, requestId) {
|
|
36860
36982
|
const { target, id, filter, sort: sortParam, pagination } = params;
|
|
36861
|
-
|
|
36983
|
+
logger14.debug("Executing findManyReference", {
|
|
36862
36984
|
requestId,
|
|
36863
36985
|
resource,
|
|
36864
36986
|
target,
|
|
@@ -36948,7 +37070,7 @@ async function handleFindManyReference(resource, params, requestId) {
|
|
|
36948
37070
|
queryResult.LastEvaluatedKey.PK,
|
|
36949
37071
|
queryResult.LastEvaluatedKey.SK
|
|
36950
37072
|
) : void 0;
|
|
36951
|
-
|
|
37073
|
+
logger14.info("findManyReference succeeded", {
|
|
36952
37074
|
requestId,
|
|
36953
37075
|
resource,
|
|
36954
37076
|
target,
|
|
@@ -36973,9 +37095,9 @@ init_insertMany();
|
|
|
36973
37095
|
|
|
36974
37096
|
// src/server/operations/insertOne.ts
|
|
36975
37097
|
init_shared();
|
|
36976
|
-
var
|
|
37098
|
+
var logger18 = createLogger({ service: "records-lambda" });
|
|
36977
37099
|
async function handleInsertOne(resource, params, requestId) {
|
|
36978
|
-
|
|
37100
|
+
logger18.debug("Executing insertOne", {
|
|
36979
37101
|
requestId,
|
|
36980
37102
|
resource
|
|
36981
37103
|
});
|
|
@@ -37001,7 +37123,7 @@ async function handleInsertOne(resource, params, requestId) {
|
|
|
37001
37123
|
}
|
|
37002
37124
|
const { handleFindOne: handleFindOne2 } = await Promise.resolve().then(() => (init_findOne(), findOne_exports));
|
|
37003
37125
|
const createdRecord = await handleFindOne2(resource, { id: createdId }, requestId);
|
|
37004
|
-
|
|
37126
|
+
logger18.info("insertOne succeeded", {
|
|
37005
37127
|
requestId,
|
|
37006
37128
|
resource,
|
|
37007
37129
|
id: createdId
|
|
@@ -37163,13 +37285,13 @@ init_updateMany();
|
|
|
37163
37285
|
|
|
37164
37286
|
// src/server/operations/updateOne.ts
|
|
37165
37287
|
init_shared();
|
|
37166
|
-
var
|
|
37288
|
+
var logger20 = createLogger({ service: "records-lambda" });
|
|
37167
37289
|
async function handleUpdateOne(resource, params, requestId) {
|
|
37168
37290
|
const { data: patchData, options } = params;
|
|
37169
37291
|
const { handleUpdateMany: handleUpdateMany2 } = await Promise.resolve().then(() => (init_updateMany(), updateMany_exports));
|
|
37170
37292
|
if ("id" in params) {
|
|
37171
37293
|
const targetId = params.id;
|
|
37172
|
-
|
|
37294
|
+
logger20.debug("Executing updateOne with id", {
|
|
37173
37295
|
requestId,
|
|
37174
37296
|
resource,
|
|
37175
37297
|
id: targetId,
|
|
@@ -37211,7 +37333,7 @@ async function handleUpdateOne(resource, params, requestId) {
|
|
|
37211
37333
|
consumedCapacity: updateManyResult.consumedCapacity
|
|
37212
37334
|
};
|
|
37213
37335
|
} else {
|
|
37214
|
-
|
|
37336
|
+
logger20.debug("Executing updateOne with filter", {
|
|
37215
37337
|
requestId,
|
|
37216
37338
|
resource,
|
|
37217
37339
|
filter: params.filter,
|
|
@@ -37261,13 +37383,13 @@ async function handleUpdateOne(resource, params, requestId) {
|
|
|
37261
37383
|
__name(handleUpdateOne, "handleUpdateOne");
|
|
37262
37384
|
|
|
37263
37385
|
// src/server/operations/operationDispatcher.ts
|
|
37264
|
-
var
|
|
37386
|
+
var logger21 = createLogger({
|
|
37265
37387
|
service: "operation-dispatcher",
|
|
37266
37388
|
level: process.env.LOG_LEVEL || "info"
|
|
37267
37389
|
});
|
|
37268
37390
|
async function executeOperation(request2, requestId) {
|
|
37269
37391
|
const { op: op2, resource } = request2;
|
|
37270
|
-
|
|
37392
|
+
logger21.debug("Executing operation", {
|
|
37271
37393
|
requestId,
|
|
37272
37394
|
operation: op2,
|
|
37273
37395
|
resource
|
|
@@ -38490,13 +38612,13 @@ CognitoJwtVerifier.USER_POOL_ID_REGEX = /^(?<region>[a-z]{2}-(gov-)?[a-z]+-\d)_[
|
|
|
38490
38612
|
|
|
38491
38613
|
// src/server/utils/auth.ts
|
|
38492
38614
|
init_index2();
|
|
38493
|
-
var
|
|
38615
|
+
var logger22 = createLogger({ service: "records-lambda" });
|
|
38494
38616
|
var verifierInstance = null;
|
|
38495
38617
|
function getVerifier(userPoolId, clientId) {
|
|
38496
38618
|
if (!verifierInstance) {
|
|
38497
|
-
|
|
38619
|
+
logger22.debug("Creating JWT verifier instance", { userPoolId, clientId });
|
|
38498
38620
|
if (!clientId) {
|
|
38499
|
-
|
|
38621
|
+
logger22.warn(
|
|
38500
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",
|
|
38501
38623
|
{ userPoolId }
|
|
38502
38624
|
);
|
|
@@ -38513,18 +38635,18 @@ function getVerifier(userPoolId, clientId) {
|
|
|
38513
38635
|
}
|
|
38514
38636
|
__name(getVerifier, "getVerifier");
|
|
38515
38637
|
async function verifyJwt(token, userPoolId, clientId) {
|
|
38516
|
-
|
|
38638
|
+
logger22.debug("Verifying JWT token with signature validation");
|
|
38517
38639
|
try {
|
|
38518
38640
|
const verifier = getVerifier(userPoolId, clientId);
|
|
38519
38641
|
const payload2 = await verifier.verify(token);
|
|
38520
|
-
|
|
38642
|
+
logger22.debug("JWT token verified successfully", {
|
|
38521
38643
|
sub: payload2.sub,
|
|
38522
38644
|
email: payload2.email,
|
|
38523
38645
|
tokenUse: payload2.token_use
|
|
38524
38646
|
});
|
|
38525
38647
|
return payload2;
|
|
38526
38648
|
} catch (error2) {
|
|
38527
|
-
|
|
38649
|
+
logger22.error("JWT verification failed", {
|
|
38528
38650
|
error: error2 instanceof Error ? error2.message : String(error2)
|
|
38529
38651
|
});
|
|
38530
38652
|
let message = "JWT verification failed";
|
|
@@ -38565,7 +38687,7 @@ async function verifyAuthHeader(authHeader, userPoolId, clientId) {
|
|
|
38565
38687
|
__name(verifyAuthHeader, "verifyAuthHeader");
|
|
38566
38688
|
|
|
38567
38689
|
// src/server/utils/authHandler.ts
|
|
38568
|
-
var
|
|
38690
|
+
var logger23 = createLogger({
|
|
38569
38691
|
service: "auth-handler",
|
|
38570
38692
|
level: process.env.LOG_LEVEL || "info"
|
|
38571
38693
|
});
|
|
@@ -38580,7 +38702,7 @@ async function handleAuthentication(event, requestId) {
|
|
|
38580
38702
|
}
|
|
38581
38703
|
__name(handleAuthentication, "handleAuthentication");
|
|
38582
38704
|
function handleIAMAuthentication(iam, requestId) {
|
|
38583
|
-
|
|
38705
|
+
logger23.info("IAM authenticated request", {
|
|
38584
38706
|
requestId,
|
|
38585
38707
|
userArn: iam.userArn,
|
|
38586
38708
|
accountId: iam.accountId,
|
|
@@ -38595,7 +38717,7 @@ async function handleCognitoAuthentication(authHeader, requestId) {
|
|
|
38595
38717
|
throw new Error("COGNITO_USER_POOL_ID environment variable is required");
|
|
38596
38718
|
}
|
|
38597
38719
|
const jwtPayload = await verifyAuthHeader(authHeader, userPoolId, clientId);
|
|
38598
|
-
|
|
38720
|
+
logger23.debug("Cognito JWT verified", {
|
|
38599
38721
|
requestId,
|
|
38600
38722
|
sub: jwtPayload.sub
|
|
38601
38723
|
});
|
|
@@ -38610,7 +38732,7 @@ init_shared();
|
|
|
38610
38732
|
// src/server/utils/responseBuilder.ts
|
|
38611
38733
|
init_http();
|
|
38612
38734
|
init_shared();
|
|
38613
|
-
var
|
|
38735
|
+
var logger24 = createLogger({
|
|
38614
38736
|
service: "response-builder",
|
|
38615
38737
|
level: process.env.LOG_LEVEL || "info"
|
|
38616
38738
|
});
|
|
@@ -38620,7 +38742,7 @@ function createSuccessResponse(data, requestId) {
|
|
|
38620
38742
|
success: true,
|
|
38621
38743
|
data
|
|
38622
38744
|
};
|
|
38623
|
-
|
|
38745
|
+
logger24.info("Request succeeded", { requestId });
|
|
38624
38746
|
return {
|
|
38625
38747
|
statusCode: HTTP_STATUS.OK,
|
|
38626
38748
|
headers: {
|
|
@@ -38641,7 +38763,7 @@ function createErrorResponse(code, message, statusCode, requestId, details) {
|
|
|
38641
38763
|
details
|
|
38642
38764
|
}
|
|
38643
38765
|
};
|
|
38644
|
-
|
|
38766
|
+
logger24.error("Request failed", {
|
|
38645
38767
|
requestId,
|
|
38646
38768
|
code,
|
|
38647
38769
|
message,
|
|
@@ -38667,7 +38789,7 @@ function createCorsResponse(statusCode) {
|
|
|
38667
38789
|
__name(createCorsResponse, "createCorsResponse");
|
|
38668
38790
|
|
|
38669
38791
|
// src/server/utils/errorHandler.ts
|
|
38670
|
-
var
|
|
38792
|
+
var logger25 = createLogger({
|
|
38671
38793
|
service: "error-handler",
|
|
38672
38794
|
level: process.env.LOG_LEVEL || "info"
|
|
38673
38795
|
});
|
|
@@ -38682,7 +38804,7 @@ function handleError(error2, requestId) {
|
|
|
38682
38804
|
);
|
|
38683
38805
|
}
|
|
38684
38806
|
if (error2 instanceof Error) {
|
|
38685
|
-
|
|
38807
|
+
logger25.error("Error stack trace", {
|
|
38686
38808
|
requestId,
|
|
38687
38809
|
stack: error2.stack,
|
|
38688
38810
|
message: error2.message
|
|
@@ -38767,14 +38889,14 @@ function parseRequestBody(body) {
|
|
|
38767
38889
|
__name(parseRequestBody, "parseRequestBody");
|
|
38768
38890
|
|
|
38769
38891
|
// src/server/handler.ts
|
|
38770
|
-
var
|
|
38892
|
+
var logger26 = createLogger({
|
|
38771
38893
|
service: "records-lambda",
|
|
38772
38894
|
level: process.env.LOG_LEVEL || "info"
|
|
38773
38895
|
});
|
|
38774
|
-
|
|
38896
|
+
logger26.info("Records Lambda started with automatic shadow field detection");
|
|
38775
38897
|
async function handler(event) {
|
|
38776
38898
|
const requestId = event.requestContext.requestId;
|
|
38777
|
-
|
|
38899
|
+
logger26.info("Received request", {
|
|
38778
38900
|
requestId,
|
|
38779
38901
|
method: event.requestContext.http.method,
|
|
38780
38902
|
path: event.requestContext.http.path
|
|
@@ -38784,7 +38906,7 @@ async function handler(event) {
|
|
|
38784
38906
|
return createCorsResponse(HTTP_STATUS.OK);
|
|
38785
38907
|
}
|
|
38786
38908
|
if (event.requestContext.http.method === "GET" && event.requestContext.http.path === "/version") {
|
|
38787
|
-
const version = "1.
|
|
38909
|
+
const version = "1.9.0";
|
|
38788
38910
|
return createSuccessResponse({ version, timestamp: (/* @__PURE__ */ new Date()).toISOString() }, requestId);
|
|
38789
38911
|
}
|
|
38790
38912
|
if (event.requestContext.http.method !== "POST") {
|
|
@@ -38792,7 +38914,7 @@ async function handler(event) {
|
|
|
38792
38914
|
}
|
|
38793
38915
|
await handleAuthentication(event, requestId);
|
|
38794
38916
|
const request2 = parseRequestBody(event.body);
|
|
38795
|
-
|
|
38917
|
+
logger26.info("Parsed request", {
|
|
38796
38918
|
requestId,
|
|
38797
38919
|
operation: request2.op,
|
|
38798
38920
|
resource: request2.resource
|