@secondlayer/cli 17.0.1 → 17.0.2

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 CHANGED
@@ -23,6 +23,22 @@ export SECONDLAYER_API_URL=http://127.0.0.1:3800
23
23
  export INSTANCE_TOKEN=<from secondlayer init>
24
24
  ```
25
25
 
26
+ ### Hosted commands (`webhooks`, `subgraphs`) — credential resolution order
27
+
28
+ Against `api.secondlayer.tools`, `resolveHostedAuth()` tries these in order —
29
+ the first one set wins:
30
+
31
+ | Order | Source | Notes |
32
+ |---|---|---|
33
+ | 1 | `SECONDLAYER_API_KEY` (`sk-sl_*`) | Hosted account key |
34
+ | 2 | `INSTANCE_TOKEN` / `--api-key` | Rarely set on the merchant host |
35
+ | 3 | Saved session, `~/.secondlayer/session.json` | Written by `secondlayer login`, scoped per API URL, 0600 |
36
+ | — | none of the above | Fails: `Not logged in — run secondlayer login` |
37
+
38
+ A shell with no `SECONDLAYER_API_KEY` exported can still authenticate against
39
+ the merchant host if this machine ran `secondlayer login` at some point — that's
40
+ #3, a real (if easy to forget) credential, not a bug.
41
+
26
42
  ## Quickstart
27
43
 
28
44
  ```bash
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.1",
202498
+ version: "17.0.2",
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",
@@ -202535,9 +202535,9 @@ var package_default = {
202535
202535
  "@secondlayer/bundler": "^0.6.1",
202536
202536
  "@secondlayer/scaffold": "^1.6.1",
202537
202537
  "@secondlayer/sdk": "^12.1.0",
202538
- "@secondlayer/shared": "^11.10.1",
202538
+ "@secondlayer/shared": "^11.12.3",
202539
202539
  "@secondlayer/stacks": "^6.1.0",
202540
- "@secondlayer/subgraphs": "^6.1.0",
202540
+ "@secondlayer/subgraphs": "^6.2.5",
202541
202541
  esbuild: "^0.28.2",
202542
202542
  "smol-toml": "^1.8.0",
202543
202543
  zod: "^4.3.6"
@@ -205248,12 +205248,19 @@ function buildWebhookUpdatePatch(options) {
205248
205248
  }
205249
205249
  return patch;
205250
205250
  }
205251
+ function formatWebhookTarget(sub) {
205252
+ if (sub.kind === "chain") {
205253
+ const types = sub.triggers?.map((t) => t.type);
205254
+ return types && types.length > 0 ? `chain.${types.join(",")}` : "chain";
205255
+ }
205256
+ return `${sub.subgraphName}.${sub.tableName}`;
205257
+ }
205251
205258
  function printWebhookDetail(sub) {
205252
205259
  console.log(formatKeyValue([
205253
205260
  ["ID", sub.id],
205254
205261
  ["Name", sub.name],
205255
205262
  ["Status", sub.status],
205256
- ["Target", `${sub.subgraphName}.${sub.tableName}`],
205263
+ ["Target", formatWebhookTarget(sub)],
205257
205264
  ["Format", sub.format],
205258
205265
  ["Runtime", sub.runtime ?? "none"],
205259
205266
  ["URL", sub.url],
@@ -205283,7 +205290,7 @@ function printDoctorReport(report) {
205283
205290
  console.log(formatKeyValue([
205284
205291
  ["Webhook", `${sub.name} (${sub.id})`],
205285
205292
  ["Status", sub.status],
205286
- ["Target", `${sub.subgraphName}.${sub.tableName}`],
205293
+ ["Target", formatWebhookTarget(sub)],
205287
205294
  ["Format", sub.format],
205288
205295
  ["Runtime", sub.runtime ?? "none"],
205289
205296
  ["URL", sub.url],
@@ -205475,7 +205482,7 @@ function attachWebhookSubcommands(parent) {
205475
205482
  sub.name,
205476
205483
  sub.id,
205477
205484
  sub.status === "active" ? green(sub.status) : sub.status === "paused" ? yellow(sub.status) : redStatus(sub.status),
205478
- `${sub.subgraphName}.${sub.tableName}`,
205485
+ formatWebhookTarget(sub),
205479
205486
  sub.format,
205480
205487
  formatMaybeDate(sub.lastSuccessAt)
205481
205488
  ])));
@@ -209003,5 +209010,5 @@ registerCreditsCommand(program);
209003
209010
  registerArchiveCommand(program);
209004
209011
  program.parse();
209005
209012
 
209006
- //# debugId=AE6E7533FECA57AE64756E2164756E21
209013
+ //# debugId=3879CF2E258096FC64756E2164756E21
209007
209014
  //# sourceMappingURL=cli.js.map