@autter/runtime-node 1.9.1 → 1.10.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/README.md +30 -6
- package/dist/chunk-3UODRQBD.js +878 -0
- package/dist/chunk-HBH64LWQ.cjs +878 -0
- package/dist/{chunk-VIP2EL47.js → chunk-KWAJIELR.js} +304 -201
- package/dist/{chunk-3P573RHA.cjs → chunk-S6WJ5YLP.cjs} +304 -201
- package/dist/{chunk-FV64SIRQ.cjs → chunk-STOXJZ7Z.cjs} +21 -10
- package/dist/{chunk-D3PJ7TQ4.js → chunk-V65UY6LU.js} +13 -2
- package/dist/cli.cjs +36 -9
- package/dist/cli.js +32 -5
- package/dist/index.cjs +622 -281
- package/dist/index.d.cts +152 -11
- package/dist/index.d.ts +152 -11
- package/dist/index.js +403 -62
- package/dist/testing.cjs +8 -8
- package/dist/testing.js +2 -2
- package/package.json +2 -1
- package/dist/chunk-FYMEBULO.js +0 -203
- package/dist/chunk-LYXQC4FI.cjs +0 -203
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
+
authHeaders,
|
|
2
3
|
noteCompatFeature,
|
|
4
|
+
noteIngestRefusal,
|
|
3
5
|
observeIngesterResponse,
|
|
6
|
+
resolveIngestKey,
|
|
4
7
|
sharedSlot
|
|
5
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-KWAJIELR.js";
|
|
6
9
|
|
|
7
10
|
// ../runtime-core/dist/index.js
|
|
8
11
|
var SENSITIVE_KEY_PATTERNS = [
|
|
@@ -1556,7 +1559,7 @@ function otlpSink(options = {}) {
|
|
|
1556
1559
|
method: "POST",
|
|
1557
1560
|
headers: {
|
|
1558
1561
|
"content-type": "application/json",
|
|
1559
|
-
|
|
1562
|
+
...authHeaders(resolveIngestKey(apiKey, {}))
|
|
1560
1563
|
},
|
|
1561
1564
|
body,
|
|
1562
1565
|
signal: AbortSignal.timeout(
|
|
@@ -1566,6 +1569,14 @@ function otlpSink(options = {}) {
|
|
|
1566
1569
|
observeIngesterResponse({ status: response.status, headers: response.headers, route: "/v1/logs" });
|
|
1567
1570
|
if (!response.ok) {
|
|
1568
1571
|
failure = new Error(`Runtime log export failed (${response.status})`);
|
|
1572
|
+
if (response.status !== 429 && response.status < 500) {
|
|
1573
|
+
noteIngestRefusal({
|
|
1574
|
+
status: response.status,
|
|
1575
|
+
route: "/v1/logs",
|
|
1576
|
+
endpoint,
|
|
1577
|
+
body: await response.text().catch(() => "")
|
|
1578
|
+
});
|
|
1579
|
+
}
|
|
1569
1580
|
if (response.status !== 429 && response.status < 500) break;
|
|
1570
1581
|
retryAfter = response.headers.get("retry-after");
|
|
1571
1582
|
} else {
|
package/dist/cli.cjs
CHANGED
|
@@ -4,14 +4,25 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
var _chunkHBH64LWQcjs = require('./chunk-HBH64LWQ.cjs');
|
|
12
|
+
require('./chunk-S6WJ5YLP.cjs');
|
|
9
13
|
|
|
10
14
|
// src/cli.ts
|
|
11
15
|
var _child_process = require('child_process');
|
|
12
16
|
var _fs = require('fs');
|
|
13
17
|
var _module = require('module');
|
|
14
18
|
var _path = require('path');
|
|
19
|
+
var USAGE = `Usage: npx @autter/runtime-node <command> [options]
|
|
20
|
+
|
|
21
|
+
Commands:
|
|
22
|
+
doctor Versions, storage, features and the key, in one report
|
|
23
|
+
verify Send a test event end to end and name the first failing step
|
|
24
|
+
|
|
25
|
+
Run a command with --help for its options.`;
|
|
15
26
|
function delegateToRuntimeCli(argv) {
|
|
16
27
|
try {
|
|
17
28
|
const manifest = _module.createRequire.call(void 0, _path.join.call(void 0, process.cwd(), "package.json")).resolve("@autter/runtime-cli/package.json");
|
|
@@ -30,23 +41,39 @@ async function main(argv) {
|
|
|
30
41
|
console.error("autter-runtime sourcemaps is part of @autter/runtime-cli: npm install -D @autter/runtime-cli");
|
|
31
42
|
return 64;
|
|
32
43
|
}
|
|
44
|
+
if (command === "verify") {
|
|
45
|
+
const parsed2 = _chunkHBH64LWQcjs.parseVerifyArgs.call(void 0, rest);
|
|
46
|
+
if ("help" in parsed2) {
|
|
47
|
+
console.log(_chunkHBH64LWQcjs.VERIFY_USAGE);
|
|
48
|
+
return 0;
|
|
49
|
+
}
|
|
50
|
+
if ("error" in parsed2) {
|
|
51
|
+
console.error(`${parsed2.error}
|
|
52
|
+
|
|
53
|
+
${_chunkHBH64LWQcjs.VERIFY_USAGE}`);
|
|
54
|
+
return 64;
|
|
55
|
+
}
|
|
56
|
+
const report2 = await _chunkHBH64LWQcjs.runVerify.call(void 0, parsed2);
|
|
57
|
+
console.log(parsed2.json ? JSON.stringify(report2, null, 2) : _chunkHBH64LWQcjs.formatVerifyReport.call(void 0, report2));
|
|
58
|
+
return report2.exitCode;
|
|
59
|
+
}
|
|
33
60
|
if (command !== "doctor") {
|
|
34
|
-
console.log(
|
|
61
|
+
console.log(USAGE);
|
|
35
62
|
return command === void 0 || command === "--help" || command === "-h" ? 0 : 64;
|
|
36
63
|
}
|
|
37
|
-
const parsed =
|
|
64
|
+
const parsed = _chunkHBH64LWQcjs.parseDoctorArgs.call(void 0, rest);
|
|
38
65
|
if ("help" in parsed) {
|
|
39
|
-
console.log(
|
|
66
|
+
console.log(_chunkHBH64LWQcjs.DOCTOR_USAGE);
|
|
40
67
|
return 0;
|
|
41
68
|
}
|
|
42
69
|
if ("error" in parsed) {
|
|
43
70
|
console.error(`${parsed.error}
|
|
44
71
|
|
|
45
|
-
${
|
|
72
|
+
${_chunkHBH64LWQcjs.DOCTOR_USAGE}`);
|
|
46
73
|
return 64;
|
|
47
74
|
}
|
|
48
|
-
const report = await
|
|
49
|
-
console.log(parsed.json ? JSON.stringify(report, null, 2) :
|
|
75
|
+
const report = await _chunkHBH64LWQcjs.runDoctor.call(void 0, parsed);
|
|
76
|
+
console.log(parsed.json ? JSON.stringify(report, null, 2) : _chunkHBH64LWQcjs.formatDoctorReport.call(void 0, report));
|
|
50
77
|
return report.exitCode;
|
|
51
78
|
}
|
|
52
79
|
main(process.argv.slice(2)).then(
|
|
@@ -54,7 +81,7 @@ main(process.argv.slice(2)).then(
|
|
|
54
81
|
process.exitCode = code;
|
|
55
82
|
},
|
|
56
83
|
(err) => {
|
|
57
|
-
console.error("autter
|
|
84
|
+
console.error("autter-runtime failed:", err instanceof Error ? err.message : err);
|
|
58
85
|
process.exitCode = 2;
|
|
59
86
|
}
|
|
60
87
|
);
|
package/dist/cli.js
CHANGED
|
@@ -1,17 +1,28 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
DOCTOR_USAGE,
|
|
4
|
+
VERIFY_USAGE,
|
|
4
5
|
formatDoctorReport,
|
|
6
|
+
formatVerifyReport,
|
|
5
7
|
parseDoctorArgs,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
parseVerifyArgs,
|
|
9
|
+
runDoctor,
|
|
10
|
+
runVerify
|
|
11
|
+
} from "./chunk-3UODRQBD.js";
|
|
12
|
+
import "./chunk-KWAJIELR.js";
|
|
9
13
|
|
|
10
14
|
// src/cli.ts
|
|
11
15
|
import { spawnSync } from "child_process";
|
|
12
16
|
import { readFileSync } from "fs";
|
|
13
17
|
import { createRequire } from "module";
|
|
14
18
|
import { dirname, join, resolve } from "path";
|
|
19
|
+
var USAGE = `Usage: npx @autter/runtime-node <command> [options]
|
|
20
|
+
|
|
21
|
+
Commands:
|
|
22
|
+
doctor Versions, storage, features and the key, in one report
|
|
23
|
+
verify Send a test event end to end and name the first failing step
|
|
24
|
+
|
|
25
|
+
Run a command with --help for its options.`;
|
|
15
26
|
function delegateToRuntimeCli(argv) {
|
|
16
27
|
try {
|
|
17
28
|
const manifest = createRequire(join(process.cwd(), "package.json")).resolve("@autter/runtime-cli/package.json");
|
|
@@ -30,8 +41,24 @@ async function main(argv) {
|
|
|
30
41
|
console.error("autter-runtime sourcemaps is part of @autter/runtime-cli: npm install -D @autter/runtime-cli");
|
|
31
42
|
return 64;
|
|
32
43
|
}
|
|
44
|
+
if (command === "verify") {
|
|
45
|
+
const parsed2 = parseVerifyArgs(rest);
|
|
46
|
+
if ("help" in parsed2) {
|
|
47
|
+
console.log(VERIFY_USAGE);
|
|
48
|
+
return 0;
|
|
49
|
+
}
|
|
50
|
+
if ("error" in parsed2) {
|
|
51
|
+
console.error(`${parsed2.error}
|
|
52
|
+
|
|
53
|
+
${VERIFY_USAGE}`);
|
|
54
|
+
return 64;
|
|
55
|
+
}
|
|
56
|
+
const report2 = await runVerify(parsed2);
|
|
57
|
+
console.log(parsed2.json ? JSON.stringify(report2, null, 2) : formatVerifyReport(report2));
|
|
58
|
+
return report2.exitCode;
|
|
59
|
+
}
|
|
33
60
|
if (command !== "doctor") {
|
|
34
|
-
console.log(
|
|
61
|
+
console.log(USAGE);
|
|
35
62
|
return command === void 0 || command === "--help" || command === "-h" ? 0 : 64;
|
|
36
63
|
}
|
|
37
64
|
const parsed = parseDoctorArgs(rest);
|
|
@@ -54,7 +81,7 @@ main(process.argv.slice(2)).then(
|
|
|
54
81
|
process.exitCode = code;
|
|
55
82
|
},
|
|
56
83
|
(err) => {
|
|
57
|
-
console.error("autter
|
|
84
|
+
console.error("autter-runtime failed:", err instanceof Error ? err.message : err);
|
|
58
85
|
process.exitCode = 2;
|
|
59
86
|
}
|
|
60
87
|
);
|