@zeroxyz/cli 1.34.0 → 1.34.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.
Files changed (2) hide show
  1. package/dist/index.js +36 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -93043,7 +93043,7 @@ init_esm_shims();
93043
93043
  // ../sdk/dist/index.js
93044
93044
  init_esm_shims();
93045
93045
 
93046
- // ../sdk/dist/chunk-C5F7JW77.js
93046
+ // ../sdk/dist/chunk-DU665LQG.js
93047
93047
  init_esm_shims();
93048
93048
 
93049
93049
  // ../../node_modules/.pnpm/viem@2.52.2_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@6.0.6_zod@4.3.6/node_modules/viem/_esm/index.js
@@ -166852,7 +166852,7 @@ var redactUrl = (raw) => {
166852
166852
  };
166853
166853
  var truncateError = (raw) => raw.length > ERROR_MAX ? `${raw.slice(0, ERROR_MAX)}\u2026` : raw;
166854
166854
  var package_default = {
166855
- version: "0.27.0"
166855
+ version: "0.27.1"
166856
166856
  };
166857
166857
  var SDK_VERSION2 = package_default.version;
166858
166858
  var ZeroError = class extends Error {
@@ -169677,9 +169677,39 @@ var extractUnrecognizedKeys = (bodyRaw) => {
169677
169677
  visit(parsed);
169678
169678
  return [...new Set(out)].slice(0, 8);
169679
169679
  };
169680
+ var NOT_ACCEPTING_ORDERS_HINT = "this storefront isn't accepting orders yet \u2014 don't pay or retry; pick another capability";
169681
+ var STOREFRONT_GATE_HINTS = /* @__PURE__ */ new Map([
169682
+ [
169683
+ "plan_required",
169684
+ "the seller sells this call on a plan you don't hold \u2014 buy one of the plans listed in this response (POST its `purchase.url` with your identity bearer; a free trial costs nothing), then retry"
169685
+ ],
169686
+ [
169687
+ "verified_email_required",
169688
+ "the seller only serves buyers with a verified email \u2014 changing the request won't help; have the account owner verify their email on their Zero identity, then retry"
169689
+ ],
169690
+ [
169691
+ "usage_not_priced",
169692
+ "the seller hasn't priced this call on any plan, so it can't be bought right now \u2014 pick another capability"
169693
+ ],
169694
+ ["not_accepting_orders", NOT_ACCEPTING_ORDERS_HINT],
169695
+ ["signing_secret_required", NOT_ACCEPTING_ORDERS_HINT]
169696
+ ]);
169697
+ var STOREFRONT_GATE_CODE_RE = /\b(?:bearer|plan|verified_email|signing_secret|payment)_required\b/g;
169698
+ var storefrontGateCode = (bodyRaw) => {
169699
+ if (!bodyRaw) return void 0;
169700
+ try {
169701
+ const code = JSON.parse(bodyRaw)?.error;
169702
+ return typeof code === "string" ? code : void 0;
169703
+ } catch {
169704
+ return void 0;
169705
+ }
169706
+ };
169680
169707
  var computeFixHint = (status, message2, bodyRaw) => {
169681
169708
  if (status < 400 || status >= 500) return void 0;
169709
+ if (status === 402) return void 0;
169682
169710
  const hay = `${message2 ?? ""} ${bodyRaw ?? ""}`.toLowerCase();
169711
+ const gateHint = STOREFRONT_GATE_HINTS.get(storefrontGateCode(bodyRaw) ?? "");
169712
+ if (gateHint) return gateHint;
169683
169713
  if (status === 405 || /method not allowed|method_not_allowed/.test(hay)) {
169684
169714
  const allowed = extractAllowedMethod(`${bodyRaw ?? ""} ${message2 ?? ""}`);
169685
169715
  return allowed ? `the endpoint expects ${allowed}, not the method you used \u2014 retry with -X ${allowed}` : "the endpoint rejected this HTTP method \u2014 check the capability's method (`zero get <slug>`) and retry with the right -X";
@@ -169701,7 +169731,9 @@ var computeFixHint = (status, message2, bodyRaw) => {
169701
169731
  if ((status === 401 || status === 403) && /bearer|identity|unauthorized|credential|agent_auth/.test(hay)) {
169702
169732
  return 'the seller requires an agent identity credential \u2014 run `zero auth identity <host>` and resend with `-H "Authorization: Bearer <token>"`';
169703
169733
  }
169704
- if (/required|missing|must (include|provide|have|contain)|is expected/.test(hay)) {
169734
+ if (/required|missing|must (include|provide|have|contain)|is expected/.test(
169735
+ hay.replace(STOREFRONT_GATE_CODE_RE, "")
169736
+ )) {
169705
169737
  const field = extractFieldName(message2 ?? "");
169706
169738
  return field ? `add the required field '${field}' to the request body, then retry` : "the request is missing one or more required fields \u2014 check the capability schema (`zero get <slug>`), then retry";
169707
169739
  }
@@ -176859,7 +176891,7 @@ var placeholderFor = (fieldName, propSchema) => String(sampleValueFor(fieldName,
176859
176891
  // package.json
176860
176892
  var package_default2 = {
176861
176893
  name: "@zeroxyz/cli",
176862
- version: "1.34.0",
176894
+ version: "1.34.1",
176863
176895
  type: "module",
176864
176896
  bin: {
176865
176897
  zero: "dist/index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeroxyz/cli",
3
- "version": "1.34.0",
3
+ "version": "1.34.1",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "zero": "dist/index.js",