@awsless/cli 0.1.46 → 0.1.48
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/bin.js +38304 -47797
- package/dist/handlers/bundle.js +17 -17
- package/dist/handlers/icon.js +3216 -3216
- package/dist/handlers/on-error-log.js +17 -20
- package/dist/handlers/on-failure.js +1 -1
- package/dist/handlers/pubsub-publisher.js +146 -146
- package/dist/handlers/pubsub-server.js +6315 -6366
- package/dist/handlers/rolldown-worker.js +376 -376
- package/dist/test-global-setup.js +12 -105
- package/package.json +29 -29
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { createRequire } from "node:module";
|
|
2
|
-
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
3
|
-
|
|
4
1
|
// src/feature/on-error-log/server/handle.ts
|
|
5
2
|
import { createHash } from "crypto";
|
|
6
3
|
import * as zlib from "zlib";
|
|
@@ -169,17 +166,17 @@ function makeUrl(scheme, user, host, port, path, query, hash) {
|
|
|
169
166
|
}
|
|
170
167
|
function parseUrl(input) {
|
|
171
168
|
if (isSchemeRelativeUrl(input)) {
|
|
172
|
-
const
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
return
|
|
169
|
+
const url = parseAbsoluteUrl("http:" + input);
|
|
170
|
+
url.scheme = "";
|
|
171
|
+
url.type = 6;
|
|
172
|
+
return url;
|
|
176
173
|
}
|
|
177
174
|
if (isAbsolutePath(input)) {
|
|
178
|
-
const
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
return
|
|
175
|
+
const url = parseAbsoluteUrl("http://foo.com" + input);
|
|
176
|
+
url.scheme = "";
|
|
177
|
+
url.host = "";
|
|
178
|
+
url.type = 5;
|
|
179
|
+
return url;
|
|
183
180
|
}
|
|
184
181
|
if (isFileUrl(input))
|
|
185
182
|
return parseFileUrl(input);
|
|
@@ -420,8 +417,8 @@ var TraceMap = class {
|
|
|
420
417
|
this.sources = sources;
|
|
421
418
|
this.sourcesContent = sourcesContent;
|
|
422
419
|
this.ignoreList = parsed.ignoreList || parsed.x_google_ignoreList || undefined;
|
|
423
|
-
const
|
|
424
|
-
this.resolvedSources = sources.map(
|
|
420
|
+
const resolve = resolver(mapUrl, sourceRoot);
|
|
421
|
+
this.resolvedSources = sources.map(resolve);
|
|
425
422
|
const { mappings } = parsed;
|
|
426
423
|
if (typeof mappings === "string") {
|
|
427
424
|
this._encoded = mappings;
|
|
@@ -747,7 +744,7 @@ var createHandler = (consumer, loaders) => {
|
|
|
747
744
|
message: error.message,
|
|
748
745
|
stackTrace: error.stackTrace
|
|
749
746
|
}),
|
|
750
|
-
new Promise((
|
|
747
|
+
new Promise((resolve) => setTimeout(() => resolve(undefined), 3000))
|
|
751
748
|
]);
|
|
752
749
|
if (mapped) {
|
|
753
750
|
const didMap = mapped.stackTrace !== error.stackTrace;
|
|
@@ -766,9 +763,9 @@ var createHandler = (consumer, loaders) => {
|
|
|
766
763
|
...error,
|
|
767
764
|
date: logEvent.timestamp
|
|
768
765
|
});
|
|
769
|
-
}).catch((
|
|
766
|
+
}).catch((error) => console.error("The on-error-log consumer failed", error));
|
|
770
767
|
const deadline = Math.max(0, context.getRemainingTimeInMillis() - 3000);
|
|
771
|
-
await Promise.race([invoke, new Promise((
|
|
768
|
+
await Promise.race([invoke, new Promise((resolve) => setTimeout(resolve, deadline))]);
|
|
772
769
|
}
|
|
773
770
|
} catch (error) {
|
|
774
771
|
console.warn("Failed to consume the error logs", error);
|
|
@@ -819,15 +816,15 @@ var parseError = (message, origin) => {
|
|
|
819
816
|
}
|
|
820
817
|
const simpleError = safeParse(SimpleErrorSchema, parsed);
|
|
821
818
|
if (simpleError.success) {
|
|
822
|
-
const { requestId, level, message
|
|
823
|
-
const hash = createHash("sha256").update([origin,
|
|
819
|
+
const { requestId, level, message } = simpleError.output;
|
|
820
|
+
const hash = createHash("sha256").update([origin, message].join("-")).digest("hex");
|
|
824
821
|
return {
|
|
825
822
|
hash,
|
|
826
823
|
requestId,
|
|
827
824
|
origin,
|
|
828
825
|
level,
|
|
829
826
|
type: "Error",
|
|
830
|
-
message
|
|
827
|
+
message
|
|
831
828
|
};
|
|
832
829
|
}
|
|
833
830
|
return;
|
|
@@ -100,7 +100,7 @@ var unknownRecord = (record, consumer) => {
|
|
|
100
100
|
var sqsRecord = async (record, consumer) => {
|
|
101
101
|
const s3Records = parseS3Records(record.body);
|
|
102
102
|
if (s3Records) {
|
|
103
|
-
await Promise.all(s3Records.map((
|
|
103
|
+
await Promise.all(s3Records.map((record) => s3Record(record, consumer)));
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
106
|
const payload = {
|