@rozoai/checkout 0.1.7 → 0.1.11

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.
@@ -116,6 +116,9 @@ function maskAddress(address) {
116
116
  return `${s.slice(0, 6)}...${s.slice(-4)}`;
117
117
  }
118
118
 
119
+ // scripts/src/lib/api.mjs
120
+ import { createRequire } from "node:module";
121
+
119
122
  // scripts/src/lib/http.mjs
120
123
  var DEFAULT_TIMEOUT_MS = 2e4;
121
124
  var USER_AGENT = "rozo-checkout-skill/1.0";
@@ -182,7 +185,20 @@ function getJson(url, opts) {
182
185
  }
183
186
 
184
187
  // scripts/src/lib/api.mjs
188
+ var PKG_VERSION = (() => {
189
+ const requireFrom = createRequire(import.meta.url);
190
+ for (const candidate of ["../../package.json", "../../../package.json"]) {
191
+ try {
192
+ const pkg = requireFrom(candidate);
193
+ if (pkg?.name === "@rozoai/checkout" && pkg.version) return pkg.version;
194
+ } catch {
195
+ }
196
+ }
197
+ return "0.0.0";
198
+ })();
185
199
  var MPP_BASE = process.env.ROZO_CHECKOUT_MPP_BASE || "https://apiserver.mpprouter.dev/v1/services/rozo-agent-api";
200
+ var CLIENT_LABEL = `rozo-checkout-cli/${PKG_VERSION}`;
201
+ var ATTRIBUTION_CLIENT = `rozo-checkout-skill/${PKG_VERSION}`;
186
202
  var INTENTS_BASE = process.env.ROZO_CHECKOUT_INTENTS_BASE || "https://intentapiv4.rozo.ai/functions/v1/payment-api";
187
203
  async function invoiceStatus({ linkId, rozoPaymentId }) {
188
204
  const qs = new URLSearchParams();