@secondlayer/cli 22.2.1 → 22.2.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/dist/cli.js CHANGED
@@ -2552,9 +2552,11 @@ var init_output = __esm(() => {
2552
2552
 
2553
2553
  // src/lib/api-client.ts
2554
2554
  import { ApiError, SecondLayer } from "@secondlayer/sdk";
2555
- function nextStepHint(status) {
2555
+ function nextStepHint(status, detail) {
2556
2556
  if (status === undefined)
2557
2557
  return;
2558
+ if (status === 402)
2559
+ return detail === "spend_cap_reached" ? `You reached your monthly spend cap. Raise it: ${CREDITS_URL}` : `Add credits to create webhooks and deploy subgraphs: ${CREDITS_URL}`;
2558
2560
  if (status === 403)
2559
2561
  return "You may not have access — check your active project with `secondlayer whoami`.";
2560
2562
  if (status === 404)
@@ -2591,7 +2593,9 @@ function handleApiError(err, action) {
2591
2593
  process.exit(1);
2592
2594
  }
2593
2595
  const detail = err instanceof Error ? err.message : String(err);
2594
- printError(`Failed to ${action}: ${detail}`, { hint: nextStepHint(status) });
2596
+ printError(`Failed to ${action}: ${detail}`, {
2597
+ hint: nextStepHint(status, detail)
2598
+ });
2595
2599
  process.exit(1);
2596
2600
  }
2597
2601
  function withErrorHandling(fn, options) {
@@ -2671,6 +2675,7 @@ async function getContractPrintSchema(contractId) {
2671
2675
  }
2672
2676
  return client.index.printSchema(contractId);
2673
2677
  }
2678
+ var CREDITS_URL = "https://www.secondlayer.tools/account/credits";
2674
2679
  var init_api_client = __esm(() => {
2675
2680
  init_http();
2676
2681
  init_output();
@@ -29488,7 +29493,7 @@ var init_git_status = () => {};
29488
29493
 
29489
29494
  // ../../node_modules/typescript/lib/typescript.js
29490
29495
  var require_typescript = __commonJS(function(exports, module) {
29491
- var __dirname = "/private/tmp/claude-501/-Users-ryan-projects-secondlayer/4f1ff871-fdfe-4888-bbdd-00bea3291e94/scratchpad/wt-check/node_modules/typescript/lib", __filename = "/private/tmp/claude-501/-Users-ryan-projects-secondlayer/4f1ff871-fdfe-4888-bbdd-00bea3291e94/scratchpad/wt-check/node_modules/typescript/lib/typescript.js";
29496
+ var __dirname = "/Users/ryan/projects/secondlayer/node_modules/typescript/lib", __filename = "/Users/ryan/projects/secondlayer/node_modules/typescript/lib/typescript.js";
29492
29497
  /*! *****************************************************************************
29493
29498
  Copyright (c) Microsoft Corporation. All rights reserved.
29494
29499
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use
@@ -202711,7 +202716,7 @@ var {
202711
202716
  // package.json
202712
202717
  var package_default = {
202713
202718
  name: "@secondlayer/cli",
202714
- version: "22.2.1",
202719
+ version: "22.2.2",
202715
202720
  description: "Run a Stacks index on your own hardware — set it up, restore verified history, and keep it current.",
202716
202721
  repository: {
202717
202722
  type: "git",
@@ -208927,5 +208932,5 @@ registerCreditsCommand(program);
208927
208932
  registerArchiveCommand(program);
208928
208933
  program.parse();
208929
208934
 
208930
- //# debugId=4A210BBAEC45C4F264756E2164756E21
208935
+ //# debugId=A8D3C98CA784D75764756E2164756E21
208931
208936
  //# sourceMappingURL=cli.js.map