@secondlayer/cli 17.0.2 → 17.0.3
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/cli.js +97 -48
- package/dist/cli.js.map +3 -3
- package/package.json +3 -3
package/dist/cli.js
CHANGED
|
@@ -202495,7 +202495,7 @@ var {
|
|
|
202495
202495
|
// package.json
|
|
202496
202496
|
var package_default = {
|
|
202497
202497
|
name: "@secondlayer/cli",
|
|
202498
|
-
version: "17.0.
|
|
202498
|
+
version: "17.0.3",
|
|
202499
202499
|
description: "Run a Stacks index on your own hardware — set it up, restore verified history, and keep it current.",
|
|
202500
202500
|
repository: {
|
|
202501
202501
|
type: "git",
|
|
@@ -202534,8 +202534,8 @@ var package_default = {
|
|
|
202534
202534
|
"@inquirer/prompts": "^8.2.0",
|
|
202535
202535
|
"@secondlayer/bundler": "^0.6.1",
|
|
202536
202536
|
"@secondlayer/scaffold": "^1.6.1",
|
|
202537
|
-
"@secondlayer/sdk": "^12.
|
|
202538
|
-
"@secondlayer/shared": "^11.12.
|
|
202537
|
+
"@secondlayer/sdk": "^12.3.0",
|
|
202538
|
+
"@secondlayer/shared": "^11.12.4",
|
|
202539
202539
|
"@secondlayer/stacks": "^6.1.0",
|
|
202540
202540
|
"@secondlayer/subgraphs": "^6.2.5",
|
|
202541
202541
|
esbuild: "^0.28.2",
|
|
@@ -205285,54 +205285,103 @@ Auth config:`));
|
|
|
205285
205285
|
console.log(JSON.stringify(sub.authConfig, null, 2));
|
|
205286
205286
|
}
|
|
205287
205287
|
}
|
|
205288
|
-
|
|
205288
|
+
var DOCTOR_ISSUE_TITLES = {
|
|
205289
|
+
warning: "This webhook can't fire yet",
|
|
205290
|
+
paused: "This webhook is paused",
|
|
205291
|
+
last_error: "The last delivery failed",
|
|
205292
|
+
circuit: "Your receiver is failing",
|
|
205293
|
+
dead_letters: "Some events exhausted every retry",
|
|
205294
|
+
subgraph_gaps: "The linked subgraph has gaps",
|
|
205295
|
+
subgraph_catching_up: "The linked subgraph is still catching up",
|
|
205296
|
+
no_deliveries: "No deliveries yet",
|
|
205297
|
+
receiver_rate_limited: "Your receiver is rate-limiting us",
|
|
205298
|
+
receiver_down: "Your receiver looks down",
|
|
205299
|
+
receiver_rejects: "Your receiver is rejecting deliveries",
|
|
205300
|
+
receiver_slow: "Your receiver is slow",
|
|
205301
|
+
delivery_lag: "Deliveries are running behind"
|
|
205302
|
+
};
|
|
205303
|
+
function formatPrimaryInsight(primary) {
|
|
205304
|
+
const severityColor = primary.severity === "bad" ? redStatus : primary.severity === "warn" ? yellow : dim;
|
|
205305
|
+
const lines = [dim(`
|
|
205306
|
+
Insight:`)];
|
|
205307
|
+
lines.push(` ${severityColor(DOCTOR_ISSUE_TITLES[primary.code])} ${dim(`[${primary.severity}]`)}`);
|
|
205308
|
+
for (const evidence of primary.evidence ?? []) {
|
|
205309
|
+
lines.push(` ${dim(`${evidence.label}:`)} ${evidence.value}`);
|
|
205310
|
+
}
|
|
205311
|
+
if (primary.fix) {
|
|
205312
|
+
lines.push(` ${primary.fix.text}`);
|
|
205313
|
+
if (primary.fix.command)
|
|
205314
|
+
lines.push(` $ ${primary.fix.command}`);
|
|
205315
|
+
}
|
|
205316
|
+
return lines.join(`
|
|
205317
|
+
`);
|
|
205318
|
+
}
|
|
205319
|
+
function formatDoctorReport(report) {
|
|
205289
205320
|
const sub = report.webhook;
|
|
205290
|
-
|
|
205291
|
-
[
|
|
205292
|
-
|
|
205293
|
-
|
|
205294
|
-
|
|
205295
|
-
|
|
205296
|
-
|
|
205297
|
-
|
|
205298
|
-
"Circuit",
|
|
205299
|
-
sub.circuitOpenedAt ? `open at ${sub.circuitOpenedAt}` : `${sub.circuitFailures} failures`
|
|
205300
|
-
],
|
|
205301
|
-
["Last Error", sub.lastError ?? "none"],
|
|
205302
|
-
["Last Delivery", sub.lastDeliveryAt ?? "none"],
|
|
205303
|
-
["Last Success", sub.lastSuccessAt ?? "none"]
|
|
205304
|
-
]));
|
|
205305
|
-
console.log(dim(`
|
|
205306
|
-
Delivery summary:`));
|
|
205307
|
-
console.log(formatKeyValue([
|
|
205308
|
-
["Recent Attempts", String(report.deliverySummary.total)],
|
|
205309
|
-
["Successful", String(report.deliverySummary.successful)],
|
|
205310
|
-
["Failed", String(report.deliverySummary.failed)],
|
|
205311
|
-
[
|
|
205312
|
-
"Last Attempt",
|
|
205313
|
-
report.deliverySummary.last ? `${report.deliverySummary.last.statusCode ?? "error"} at ${report.deliverySummary.last.dispatchedAt}` : "none"
|
|
205314
|
-
],
|
|
205315
|
-
["Dead Letter Rows", String(report.deadCount)]
|
|
205316
|
-
]));
|
|
205317
|
-
if (report.subgraph) {
|
|
205318
|
-
console.log(dim(`
|
|
205319
|
-
Linked subgraph:`));
|
|
205320
|
-
console.log(formatKeyValue([
|
|
205321
|
-
["Name", report.subgraph.name],
|
|
205322
|
-
["Status", report.subgraph.status],
|
|
205323
|
-
["Sync", report.subgraph.syncStatus],
|
|
205321
|
+
const sections = [
|
|
205322
|
+
formatKeyValue([
|
|
205323
|
+
["Webhook", `${sub.name} (${sub.id})`],
|
|
205324
|
+
["Status", sub.status],
|
|
205325
|
+
["Target", formatWebhookTarget(sub)],
|
|
205326
|
+
["Format", sub.format],
|
|
205327
|
+
["Runtime", sub.runtime ?? "none"],
|
|
205328
|
+
["URL", sub.url],
|
|
205324
205329
|
[
|
|
205325
|
-
"
|
|
205326
|
-
|
|
205330
|
+
"Circuit",
|
|
205331
|
+
sub.circuitOpenedAt ? `open at ${sub.circuitOpenedAt}` : `${sub.circuitFailures} failures`
|
|
205327
205332
|
],
|
|
205328
|
-
["
|
|
205329
|
-
["
|
|
205330
|
-
|
|
205333
|
+
["Last Error", sub.lastError ?? "none"],
|
|
205334
|
+
["Last Delivery", sub.lastDeliveryAt ?? "none"],
|
|
205335
|
+
["Last Success", sub.lastSuccessAt ?? "none"]
|
|
205336
|
+
]),
|
|
205337
|
+
[
|
|
205338
|
+
dim(`
|
|
205339
|
+
Delivery summary:`),
|
|
205340
|
+
formatKeyValue([
|
|
205341
|
+
["Recent Attempts", String(report.deliverySummary.total)],
|
|
205342
|
+
["Successful", String(report.deliverySummary.successful)],
|
|
205343
|
+
["Failed", String(report.deliverySummary.failed)],
|
|
205344
|
+
[
|
|
205345
|
+
"Last Attempt",
|
|
205346
|
+
report.deliverySummary.last ? `${report.deliverySummary.last.statusCode ?? "error"} at ${report.deliverySummary.last.dispatchedAt}` : "none"
|
|
205347
|
+
],
|
|
205348
|
+
["Dead Letter Rows", String(report.deadCount)]
|
|
205349
|
+
])
|
|
205350
|
+
].join(`
|
|
205351
|
+
`)
|
|
205352
|
+
];
|
|
205353
|
+
if (report.subgraph) {
|
|
205354
|
+
sections.push([
|
|
205355
|
+
dim(`
|
|
205356
|
+
Linked subgraph:`),
|
|
205357
|
+
formatKeyValue([
|
|
205358
|
+
["Name", report.subgraph.name],
|
|
205359
|
+
["Status", report.subgraph.status],
|
|
205360
|
+
["Sync", report.subgraph.syncStatus],
|
|
205361
|
+
[
|
|
205362
|
+
"Blocks",
|
|
205363
|
+
`${report.subgraph.lastProcessedBlock} / ${report.subgraph.chainTip}`
|
|
205364
|
+
],
|
|
205365
|
+
["Integrity", report.subgraph.integrity],
|
|
205366
|
+
["Gaps", String(report.subgraph.gapCount)]
|
|
205367
|
+
])
|
|
205368
|
+
].join(`
|
|
205369
|
+
`));
|
|
205331
205370
|
}
|
|
205332
|
-
|
|
205333
|
-
|
|
205334
|
-
|
|
205335
|
-
|
|
205371
|
+
if (report.primary)
|
|
205372
|
+
sections.push(formatPrimaryInsight(report.primary));
|
|
205373
|
+
const primaryIndex = report.primary ? report.issues.indexOf(report.primary) : -1;
|
|
205374
|
+
const rest = report.hints.filter((_, i) => i !== primaryIndex);
|
|
205375
|
+
if (rest.length > 0) {
|
|
205376
|
+
sections.push([dim(`
|
|
205377
|
+
Next steps:`), ...rest.map((hint) => ` - ${hint}`)].join(`
|
|
205378
|
+
`));
|
|
205379
|
+
}
|
|
205380
|
+
return sections.join(`
|
|
205381
|
+
`);
|
|
205382
|
+
}
|
|
205383
|
+
function printDoctorReport(report) {
|
|
205384
|
+
console.log(formatDoctorReport(report));
|
|
205336
205385
|
}
|
|
205337
205386
|
function syntheticValue(type) {
|
|
205338
205387
|
switch (type) {
|
|
@@ -209010,5 +209059,5 @@ registerCreditsCommand(program);
|
|
|
209010
209059
|
registerArchiveCommand(program);
|
|
209011
209060
|
program.parse();
|
|
209012
209061
|
|
|
209013
|
-
//# debugId=
|
|
209062
|
+
//# debugId=071DD5EE0E04E9D664756E2164756E21
|
|
209014
209063
|
//# sourceMappingURL=cli.js.map
|