@cronvello/shop-sdk 0.2.0 → 0.2.3

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/CONTRACT_SHA256 CHANGED
@@ -1 +1 @@
1
- 335eed391a2786a4f7f010b056d2a6a5b49d9e1244960a15516a5d77b93693b5
1
+ 32f132210ee188c28a330c9db5c6db6eaf5b7c3a65ecc041e029aca6e1335a60
package/dist/browser.cjs CHANGED
@@ -498,7 +498,7 @@ var apiRoutes_b2b = {
498
498
  meta: {
499
499
  tags: ["b2b"],
500
500
  summary: "Create B2B dynamic checkout session",
501
- description: "Creates a Stripe checkout session with dynamic price_data for trusted external apps. Supports mixed carts (one-time + recurring). Auth: Bearer BACKEND_TO_BACKEND_API_KEY.",
501
+ description: "Creates a Stripe checkout session with dynamic price_data for trusted external apps. Supports mixed carts (one-time + recurring). Auth: Bearer BACKEND_TO_BACKEND_API_KEY or App-Scoped API Key.",
502
502
  bodyContentType: "application/json",
503
503
  validated: { "params": false, "query": false, "body": true }
504
504
  },
@@ -1710,6 +1710,19 @@ var apiRoutes_external_apps = {
1710
1710
  },
1711
1711
  types: null
1712
1712
  },
1713
+ "external_apps_service_rotate_key": {
1714
+ method: "POST",
1715
+ path: "/external-apps/service/rotate-key/:appId",
1716
+ auth: { "type": "x_api_key_https" },
1717
+ meta: {
1718
+ tags: ["external-apps"],
1719
+ summary: "Rotate external app api key (B2B zero-downtime)",
1720
+ description: "Rotates the API key of an external app. The previous key remains valid during the specified gracePeriodHours (default: 2h) to prevent downtime during deployments. Authenticated via backend-to-backend API key.",
1721
+ bodyContentType: "application/json",
1722
+ validated: { "params": true, "query": true, "body": true }
1723
+ },
1724
+ types: null
1725
+ },
1713
1726
  "external_apps_service_delete": {
1714
1727
  method: "DELETE",
1715
1728
  path: "/external-apps/service/delete/:appId",
@@ -1729,7 +1742,7 @@ var apiRoutes_external_apps = {
1729
1742
  meta: {
1730
1743
  tags: ["external-apps"],
1731
1744
  summary: "Get external app registration status (B2B)",
1732
- description: "Returns registration status for an app identified by its string appId. Used by AMP to discover existing connections."
1745
+ description: "Returns registration status for an app identified by its string appId. Used by AMP to discover existing connections. Includes authMethod and, for OAuth apps, the oauth client_id we will present to that app plus a truncated SHA-256 fingerprint of the stored client secret, so the other side can prove a rotation actually landed here. Never the secret itself. `credentialFingerprints` lists one such fingerprint per credential we hold for that app (api_key, previous_api_key during a rotation grace period, public_api_key, oauth_client_secret). It lets the caller locate the value in the app's runtime environment by equality instead of guessing a variable name - the name differs per app, the value does not. Also reports the entitlement paths we have stored, because registration is an upsert: a caller that only wants to hand us new credentials must send these back unchanged, or it silently repoints where we fetch entitlements from."
1733
1746
  },
1734
1747
  types: null
1735
1748
  },
@@ -5372,10 +5385,10 @@ function createShopClient(options = {}) {
5372
5385
  }
5373
5386
 
5374
5387
  // src/contract-hash.ts
5375
- var CONTRACT_SHA256 = "335eed391a2786a4f7f010b056d2a6a5b49d9e1244960a15516a5d77b93693b5";
5388
+ var CONTRACT_SHA256 = "32f132210ee188c28a330c9db5c6db6eaf5b7c3a65ecc041e029aca6e1335a60";
5376
5389
 
5377
5390
  // src/client/diagnose.ts
5378
- var SDK_VERSION = "0.2.0" ;
5391
+ var SDK_VERSION = "0.2.3" ;
5379
5392
  async function resolveBaseUrl(options) {
5380
5393
  const provider = options.client?.baseUrl ?? options.baseUrl ?? SHOP_API_URL;
5381
5394
  const value = typeof provider === "function" ? await provider() : provider;