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