@secondlayer/cli 17.0.2 → 18.0.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/dist/cli.js +101 -52
- 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: "
|
|
202498
|
+
version: "18.0.0",
|
|
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": "^
|
|
202538
|
-
"@secondlayer/shared": "^11.
|
|
202537
|
+
"@secondlayer/sdk": "^13.0.0",
|
|
202538
|
+
"@secondlayer/shared": "^11.14.0",
|
|
202539
202539
|
"@secondlayer/stacks": "^6.1.0",
|
|
202540
202540
|
"@secondlayer/subgraphs": "^6.2.5",
|
|
202541
202541
|
esbuild: "^0.28.2",
|
|
@@ -205255,6 +205255,10 @@ function formatWebhookTarget(sub) {
|
|
|
205255
205255
|
}
|
|
205256
205256
|
return `${sub.subgraphName}.${sub.tableName}`;
|
|
205257
205257
|
}
|
|
205258
|
+
function formatAuthLine(auth) {
|
|
205259
|
+
const scheme = auth.type === "bearer" ? auth.hasSecret ? "bearer token (set, hidden)" : "bearer (no token set)" : auth.type === "basic" ? auth.hasSecret ? "basic auth (set, hidden)" : "basic (no credentials set)" : "none";
|
|
205260
|
+
return auth.headerNames.length > 0 ? `${scheme}, headers: ${auth.headerNames.join(", ")}` : scheme;
|
|
205261
|
+
}
|
|
205258
205262
|
function printWebhookDetail(sub) {
|
|
205259
205263
|
console.log(formatKeyValue([
|
|
205260
205264
|
["ID", sub.id],
|
|
@@ -205264,6 +205268,7 @@ function printWebhookDetail(sub) {
|
|
|
205264
205268
|
["Format", sub.format],
|
|
205265
205269
|
["Runtime", sub.runtime ?? "none"],
|
|
205266
205270
|
["URL", sub.url],
|
|
205271
|
+
["Auth", formatAuthLine(sub.auth)],
|
|
205267
205272
|
["Last Delivery", sub.lastDeliveryAt ?? "none"],
|
|
205268
205273
|
["Last Success", sub.lastSuccessAt ?? "none"],
|
|
205269
205274
|
["Circuit Failures", String(sub.circuitFailures)],
|
|
@@ -205279,60 +205284,104 @@ function printWebhookDetail(sub) {
|
|
|
205279
205284
|
console.log(dim(`
|
|
205280
205285
|
Filter:`));
|
|
205281
205286
|
console.log(JSON.stringify(sub.filter, null, 2));
|
|
205282
|
-
|
|
205283
|
-
|
|
205284
|
-
|
|
205285
|
-
|
|
205287
|
+
}
|
|
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}`);
|
|
205286
205315
|
}
|
|
205316
|
+
return lines.join(`
|
|
205317
|
+
`);
|
|
205287
205318
|
}
|
|
205288
|
-
function
|
|
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=268D1F88F7CF1FDE64756E2164756E21
|
|
209014
209063
|
//# sourceMappingURL=cli.js.map
|