@etainabl/nodejs-sdk 1.3.186 → 1.3.187
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/dist/esm/index.js +42 -31
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.cts +18 -24
- package/dist/index.d.ts +18 -24
- package/dist/index.js +113 -102
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -5665,28 +5665,42 @@ function getBetterStackToken() {
|
|
|
5665
5665
|
})();
|
|
5666
5666
|
return tokenFetchPromise;
|
|
5667
5667
|
}
|
|
5668
|
-
|
|
5668
|
+
function createBaseLogger(namespace, options) {
|
|
5669
5669
|
const transports = [new winston.transports.Console()];
|
|
5670
|
-
const
|
|
5670
|
+
const defaultMeta = {
|
|
5671
|
+
service: process.env.AWS_LAMBDA_FUNCTION_NAME,
|
|
5672
|
+
script: namespace
|
|
5673
|
+
};
|
|
5674
|
+
if (options?.feature) {
|
|
5675
|
+
defaultMeta.feature = options.feature;
|
|
5676
|
+
}
|
|
5677
|
+
const logger2 = winston.createLogger({
|
|
5671
5678
|
level: "debug",
|
|
5672
5679
|
format: process.env.ENV === "local" ? localFormat : winston.format.combine(winston.format.timestamp(), winston.format.json()),
|
|
5673
|
-
defaultMeta
|
|
5680
|
+
defaultMeta,
|
|
5674
5681
|
transports
|
|
5675
5682
|
});
|
|
5676
|
-
|
|
5677
|
-
|
|
5678
|
-
|
|
5679
|
-
|
|
5680
|
-
|
|
5681
|
-
|
|
5682
|
-
|
|
5683
|
-
|
|
5684
|
-
|
|
5685
|
-
|
|
5686
|
-
|
|
5687
|
-
|
|
5688
|
-
|
|
5689
|
-
};
|
|
5683
|
+
logger2.logtail = void 0;
|
|
5684
|
+
return logger2;
|
|
5685
|
+
}
|
|
5686
|
+
function logger(namespace, options) {
|
|
5687
|
+
return createBaseLogger(namespace, options);
|
|
5688
|
+
}
|
|
5689
|
+
async function loggerWithBetterStack(namespace, options) {
|
|
5690
|
+
const baseLogger2 = createBaseLogger(namespace, options);
|
|
5691
|
+
const betterStackHost = process.env.BETTERSTACK_HOST;
|
|
5692
|
+
if (betterStackHost && (process.env.ENV === "prod" || process.env.ENV === "dev")) {
|
|
5693
|
+
const token = await getBetterStackToken();
|
|
5694
|
+
if (token) {
|
|
5695
|
+
const endpoint = betterStackHost.startsWith("https://") ? betterStackHost : `https://${betterStackHost}`;
|
|
5696
|
+
const logtail = new Logtail(token, { endpoint });
|
|
5697
|
+
baseLogger2.logtail = logtail;
|
|
5698
|
+
baseLogger2.add(new LogtailTransport(logtail));
|
|
5699
|
+
}
|
|
5700
|
+
}
|
|
5701
|
+
return baseLogger2;
|
|
5702
|
+
}
|
|
5703
|
+
var logger_default = logger;
|
|
5690
5704
|
|
|
5691
5705
|
// src/api.ts
|
|
5692
5706
|
var log = logger_default("etainablApi");
|
|
@@ -6620,9 +6634,6 @@ var slack_default = {
|
|
|
6620
6634
|
postMessage
|
|
6621
6635
|
};
|
|
6622
6636
|
|
|
6623
|
-
// src/notification.ts
|
|
6624
|
-
var notification_exports = {};
|
|
6625
|
-
|
|
6626
6637
|
// src/notificationQueue.ts
|
|
6627
6638
|
var notificationQueue_exports = {};
|
|
6628
6639
|
__export(notificationQueue_exports, {
|
|
@@ -6763,7 +6774,7 @@ var ByteArrayCollector = class {
|
|
|
6763
6774
|
};
|
|
6764
6775
|
|
|
6765
6776
|
// node_modules/@smithy/util-stream/dist-es/createBufferedReadableStream.js
|
|
6766
|
-
function createBufferedReadableStream(upstream, size,
|
|
6777
|
+
function createBufferedReadableStream(upstream, size, logger2) {
|
|
6767
6778
|
const reader = upstream.getReader();
|
|
6768
6779
|
let streamBufferingLoggedWarning = false;
|
|
6769
6780
|
let bytesSeen = 0;
|
|
@@ -6801,7 +6812,7 @@ function createBufferedReadableStream(upstream, size, logger) {
|
|
|
6801
6812
|
const newSize = merge(buffers, mode, chunk3);
|
|
6802
6813
|
if (!streamBufferingLoggedWarning && bytesSeen > size * 2) {
|
|
6803
6814
|
streamBufferingLoggedWarning = true;
|
|
6804
|
-
|
|
6815
|
+
logger2?.warn(`@smithy/util-stream - stream chunk size ${chunkSize} is below threshold of ${size}, automatically buffering.`);
|
|
6805
6816
|
}
|
|
6806
6817
|
if (newSize >= size) {
|
|
6807
6818
|
controller.enqueue(flush(buffers, mode));
|
|
@@ -6855,9 +6866,9 @@ function modeOf(chunk3, allowBuffer = true) {
|
|
|
6855
6866
|
}
|
|
6856
6867
|
|
|
6857
6868
|
// node_modules/@smithy/util-stream/dist-es/createBufferedReadable.js
|
|
6858
|
-
function createBufferedReadable(upstream, size,
|
|
6869
|
+
function createBufferedReadable(upstream, size, logger2) {
|
|
6859
6870
|
if (isReadableStream(upstream)) {
|
|
6860
|
-
return createBufferedReadableStream(upstream, size,
|
|
6871
|
+
return createBufferedReadableStream(upstream, size, logger2);
|
|
6861
6872
|
}
|
|
6862
6873
|
const downstream = new Readable({ read() {
|
|
6863
6874
|
} });
|
|
@@ -6890,7 +6901,7 @@ function createBufferedReadable(upstream, size, logger) {
|
|
|
6890
6901
|
const newSize = merge(buffers, mode, chunk3);
|
|
6891
6902
|
if (!streamBufferingLoggedWarning && bytesSeen > size * 2) {
|
|
6892
6903
|
streamBufferingLoggedWarning = true;
|
|
6893
|
-
|
|
6904
|
+
logger2?.warn(`@smithy/util-stream - stream chunk size ${chunkSize} is below threshold of ${size}, automatically buffering.`);
|
|
6894
6905
|
}
|
|
6895
6906
|
if (newSize >= size) {
|
|
6896
6907
|
downstream.push(flush(buffers, mode));
|
|
@@ -7050,12 +7061,12 @@ function queueUrlMiddleware({ useQueueUrlAsEndpoint, endpoint }) {
|
|
|
7050
7061
|
const { input } = args;
|
|
7051
7062
|
const resolvedEndpoint = context.endpointV2;
|
|
7052
7063
|
if (!endpoint && input.QueueUrl && resolvedEndpoint && useQueueUrlAsEndpoint) {
|
|
7053
|
-
const
|
|
7064
|
+
const logger2 = context.logger instanceof NoOpLogger || !context.logger?.warn ? console : context.logger;
|
|
7054
7065
|
try {
|
|
7055
7066
|
const queueUrl = new URL(input.QueueUrl);
|
|
7056
7067
|
const queueUrlOrigin = new URL(queueUrl.origin);
|
|
7057
7068
|
if (resolvedEndpoint.url.origin !== queueUrlOrigin.origin) {
|
|
7058
|
-
|
|
7069
|
+
logger2.warn(`QueueUrl=${input.QueueUrl} differs from SQSClient resolved endpoint=${resolvedEndpoint.url.toString()}, using QueueUrl host as endpoint.
|
|
7059
7070
|
Set [endpoint=string] or [useQueueUrlAsEndpoint=false] on the SQSClient.`);
|
|
7060
7071
|
context.endpointV2 = {
|
|
7061
7072
|
...resolvedEndpoint,
|
|
@@ -7063,7 +7074,7 @@ Set [endpoint=string] or [useQueueUrlAsEndpoint=false] on the SQSClient.`);
|
|
|
7063
7074
|
};
|
|
7064
7075
|
}
|
|
7065
7076
|
} catch (e4) {
|
|
7066
|
-
|
|
7077
|
+
logger2.warn(e4);
|
|
7067
7078
|
}
|
|
7068
7079
|
}
|
|
7069
7080
|
return next(args);
|
|
@@ -10444,7 +10455,7 @@ var isChecksumWithPartNumber = (checksum) => {
|
|
|
10444
10455
|
var getChecksum = async (body, { checksumAlgorithmFn, base64Encoder }) => base64Encoder(await stringHasher(checksumAlgorithmFn, body));
|
|
10445
10456
|
|
|
10446
10457
|
// node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/validateChecksumFromResponse.js
|
|
10447
|
-
var validateChecksumFromResponse = async (response, { config, responseAlgorithms, logger }) => {
|
|
10458
|
+
var validateChecksumFromResponse = async (response, { config, responseAlgorithms, logger: logger2 }) => {
|
|
10448
10459
|
const checksumAlgorithms = getChecksumAlgorithmListForResponse(responseAlgorithms);
|
|
10449
10460
|
const { body: responseBody, headers: responseHeaders } = response;
|
|
10450
10461
|
for (const algorithm of checksumAlgorithms) {
|
|
@@ -10456,7 +10467,7 @@ var validateChecksumFromResponse = async (response, { config, responseAlgorithms
|
|
|
10456
10467
|
checksumAlgorithmFn = selectChecksumAlgorithmFunction(algorithm, config);
|
|
10457
10468
|
} catch (error) {
|
|
10458
10469
|
if (algorithm === ChecksumAlgorithm.CRC64NVME) {
|
|
10459
|
-
|
|
10470
|
+
logger2?.warn(`Skipping ${ChecksumAlgorithm.CRC64NVME} checksum validation: ${error.message}`);
|
|
10460
10471
|
continue;
|
|
10461
10472
|
}
|
|
10462
10473
|
throw error;
|
|
@@ -16075,8 +16086,8 @@ export {
|
|
|
16075
16086
|
emailTemplate_default as emailTemplate,
|
|
16076
16087
|
integrations_exports as integrations,
|
|
16077
16088
|
logger_default as logger,
|
|
16089
|
+
loggerWithBetterStack,
|
|
16078
16090
|
monitoring_exports as monitoring,
|
|
16079
|
-
notification_exports as notification,
|
|
16080
16091
|
notificationEmailTemplate_default as notificationEmailTemplate,
|
|
16081
16092
|
notificationQueue_exports as notificationQueue,
|
|
16082
16093
|
openai_exports as openai,
|