@secondlayer/cli 17.0.0 → 17.0.1
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 +4 -59
- package/dist/cli.js.map +3 -3
- package/package.json +2 -2
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.1",
|
|
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,7 +202534,7 @@ 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.
|
|
202537
|
+
"@secondlayer/sdk": "^12.1.0",
|
|
202538
202538
|
"@secondlayer/shared": "^11.10.1",
|
|
202539
202539
|
"@secondlayer/stacks": "^6.1.0",
|
|
202540
202540
|
"@secondlayer/subgraphs": "^6.1.0",
|
|
@@ -204801,6 +204801,7 @@ init_api_client();
|
|
|
204801
204801
|
init_filter_params();
|
|
204802
204802
|
init_output();
|
|
204803
204803
|
init_resolve_auth();
|
|
204804
|
+
import { buildDoctorReport, isSuccessDelivery } from "@secondlayer/sdk";
|
|
204804
204805
|
import { sign } from "@secondlayer/shared/crypto/standard-webhooks";
|
|
204805
204806
|
|
|
204806
204807
|
// src/lib/webhook-validation.ts
|
|
@@ -205179,9 +205180,6 @@ function truncate(value, max = 48) {
|
|
|
205179
205180
|
function formatMaybeDate(value) {
|
|
205180
205181
|
return value ? value.replace("T", " ").slice(0, 19) : dim("-");
|
|
205181
205182
|
}
|
|
205182
|
-
function isSuccessDelivery(row) {
|
|
205183
|
-
return row.statusCode !== null && row.statusCode >= 200 && row.statusCode < 300;
|
|
205184
|
-
}
|
|
205185
205183
|
function printJson(value) {
|
|
205186
205184
|
console.log(JSON.stringify(value, null, 2));
|
|
205187
205185
|
}
|
|
@@ -205280,59 +205278,6 @@ Auth config:`));
|
|
|
205280
205278
|
console.log(JSON.stringify(sub.authConfig, null, 2));
|
|
205281
205279
|
}
|
|
205282
205280
|
}
|
|
205283
|
-
function buildDoctorReport(input) {
|
|
205284
|
-
const successful = input.deliveries.filter(isSuccessDelivery).length;
|
|
205285
|
-
const failed = input.deliveries.length - successful;
|
|
205286
|
-
const subgraph = input.subgraph ? {
|
|
205287
|
-
name: input.subgraph.name,
|
|
205288
|
-
status: input.subgraph.status,
|
|
205289
|
-
syncStatus: input.subgraph.sync.status,
|
|
205290
|
-
lastProcessedBlock: input.subgraph.sync.lastProcessedBlock,
|
|
205291
|
-
chainTip: input.subgraph.sync.chainTip,
|
|
205292
|
-
gapCount: input.subgraph.sync.gaps.count,
|
|
205293
|
-
integrity: input.subgraph.sync.integrity
|
|
205294
|
-
} : null;
|
|
205295
|
-
const hints = [];
|
|
205296
|
-
if (input.webhook.warning) {
|
|
205297
|
-
hints.push(input.webhook.warning);
|
|
205298
|
-
}
|
|
205299
|
-
if (input.webhook.status === "paused") {
|
|
205300
|
-
hints.push(`Resume when the receiver is healthy: secondlayer webhooks resume ${input.webhook.id}`);
|
|
205301
|
-
}
|
|
205302
|
-
if (input.webhook.lastError) {
|
|
205303
|
-
hints.push("Run secondlayer webhooks test to reproduce the receiver request.");
|
|
205304
|
-
}
|
|
205305
|
-
if (input.webhook.circuitOpenedAt || input.webhook.circuitFailures > 0) {
|
|
205306
|
-
hints.push("Circuit breaker has failures; inspect receiver logs and delivery status codes.");
|
|
205307
|
-
}
|
|
205308
|
-
if (input.dead.length > 0) {
|
|
205309
|
-
hints.push(`Dead-letter rows exist; inspect with secondlayer webhooks dead ${input.webhook.id} and requeue selected rows.`);
|
|
205310
|
-
}
|
|
205311
|
-
if (subgraph?.gapCount && subgraph.gapCount > 0) {
|
|
205312
|
-
hints.push(`Linked subgraph has gaps; run secondlayer subgraphs gaps ${input.webhook.subgraphName}.`);
|
|
205313
|
-
}
|
|
205314
|
-
if (subgraph?.syncStatus === "catching_up") {
|
|
205315
|
-
hints.push("Linked subgraph is still catching up; new matching rows may arrive later.");
|
|
205316
|
-
}
|
|
205317
|
-
if (input.deliveries.length === 0) {
|
|
205318
|
-
hints.push("No deliveries yet; confirm the table is receiving inserted rows that match the filter.");
|
|
205319
|
-
}
|
|
205320
|
-
if (hints.length === 0) {
|
|
205321
|
-
hints.push("No immediate action needed.");
|
|
205322
|
-
}
|
|
205323
|
-
return {
|
|
205324
|
-
webhook: input.webhook,
|
|
205325
|
-
deliverySummary: {
|
|
205326
|
-
total: input.deliveries.length,
|
|
205327
|
-
successful,
|
|
205328
|
-
failed,
|
|
205329
|
-
last: input.deliveries[0] ?? null
|
|
205330
|
-
},
|
|
205331
|
-
deadCount: input.dead.length,
|
|
205332
|
-
subgraph,
|
|
205333
|
-
hints
|
|
205334
|
-
};
|
|
205335
|
-
}
|
|
205336
205281
|
function printDoctorReport(report) {
|
|
205337
205282
|
const sub = report.webhook;
|
|
205338
205283
|
console.log(formatKeyValue([
|
|
@@ -209058,5 +209003,5 @@ registerCreditsCommand(program);
|
|
|
209058
209003
|
registerArchiveCommand(program);
|
|
209059
209004
|
program.parse();
|
|
209060
209005
|
|
|
209061
|
-
//# debugId=
|
|
209006
|
+
//# debugId=AE6E7533FECA57AE64756E2164756E21
|
|
209062
209007
|
//# sourceMappingURL=cli.js.map
|