@secondlayer/cli 16.2.0 → 16.3.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 CHANGED
@@ -2288,6 +2288,24 @@ function resolveDataPlaneKey() {
2288
2288
  return resolveAccountKey();
2289
2289
  return resolveApiKey();
2290
2290
  }
2291
+ async function resolveHostedAuth() {
2292
+ if (isMerchantUrl()) {
2293
+ const accountKey = resolveAccountKey();
2294
+ if (accountKey) {
2295
+ return {
2296
+ apiUrl: resolveApiUrl(),
2297
+ ephemeralKey: accountKey,
2298
+ fromEnv: true
2299
+ };
2300
+ }
2301
+ }
2302
+ return resolveAuth();
2303
+ }
2304
+ function assertInstanceOrAccountKey(url = resolveApiUrl()) {
2305
+ if (resolveAccountKey())
2306
+ return;
2307
+ assertInstanceUrl(url);
2308
+ }
2291
2309
  var init_resolve_auth = __esm(() => {
2292
2310
  init_session();
2293
2311
  });
@@ -204294,7 +204312,7 @@ var {
204294
204312
  // package.json
204295
204313
  var package_default = {
204296
204314
  name: "@secondlayer/cli",
204297
- version: "16.2.0",
204315
+ version: "16.3.0",
204298
204316
  description: "Run a Stacks index on your own hardware — set it up, restore verified history, and keep it current.",
204299
204317
  repository: {
204300
204318
  type: "git",
@@ -204338,7 +204356,7 @@ var package_default = {
204338
204356
  "@secondlayer/sdk": "^11.0.0",
204339
204357
  "@secondlayer/shared": "^11.8.1",
204340
204358
  "@secondlayer/stacks": "^6.1.0",
204341
- "@secondlayer/subgraphs": "^6.0.0",
204359
+ "@secondlayer/subgraphs": "^6.1.0",
204342
204360
  esbuild: "^0.28.2",
204343
204361
  react: "^19.1.0",
204344
204362
  "smol-toml": "^1.8.0",
@@ -206798,7 +206816,7 @@ async function createChainWebhook(name, opts) {
206798
206816
  secondlayer webhooks get ${name}`);
206799
206817
  }
206800
206818
  async function getWebhookClient() {
206801
- const { apiUrl, ephemeralKey } = await resolveAuth();
206819
+ const { apiUrl, ephemeralKey } = await resolveHostedAuth();
206802
206820
  return new SecondLayer4({ baseUrl: apiUrl, apiKey: ephemeralKey });
206803
206821
  }
206804
206822
  function addWebhookScaffold(parent, commandSpec, opts) {
@@ -207464,7 +207482,7 @@ POST result (client-side, not logged):`));
207464
207482
  }
207465
207483
  function registerWebhooksCommand(program) {
207466
207484
  const webhooks = program.command("webhooks").alias("hooks").description("Manage webhooks: a signed POST to a URL you run");
207467
- webhooks.hook("preAction", () => assertInstanceUrl());
207485
+ webhooks.hook("preAction", () => assertInstanceOrAccountKey());
207468
207486
  attachWebhookSubcommands(webhooks);
207469
207487
  }
207470
207488
  // src/commands/devnet.ts
@@ -209672,5 +209690,5 @@ registerCreditsCommand(program);
209672
209690
  registerArchiveCommand(program);
209673
209691
  program.parse();
209674
209692
 
209675
- //# debugId=8F597010AF7694DA64756E2164756E21
209693
+ //# debugId=0A6B47175E9A5E8864756E2164756E21
209676
209694
  //# sourceMappingURL=cli.js.map