@cronvello/shop-sdk 0.2.0 → 0.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.
@@ -1,6 +1,6 @@
1
- import { S as ShopClientOptions, H as HeaderProvider, a as ShopClient } from './error-C5_qRXMp.cjs';
2
- export { B as BaseUrlProvider, C as CONTRACT_SHA256, M as MaybePromise, b as SHOP_API_URL, c as ShopApiError, d as ShopAuthType, e as ShopConfigurationError, f as ShopContractStatus, g as ShopDiagnoseOptions, h as ShopDiagnosis, i as ShopRequestContext, j as ShopRequestOptions, k as ShopRoute, l as ShopRouteAuth, m as ShopRouteBody, n as ShopRouteInput, o as ShopRouteKey, p as ShopRouteMethod, q as ShopRouteParams, r as ShopRouteQuery, s as ShopRouteResponse, t as ShopRouteResponseData, u as diagnoseShop } from './error-C5_qRXMp.cjs';
3
- import './index-CIpUb0vL.cjs';
1
+ import { S as ShopClientOptions, H as HeaderProvider, a as ShopClient } from './error-1WqH-FhJ.cjs';
2
+ export { B as BaseUrlProvider, C as CONTRACT_SHA256, M as MaybePromise, b as SHOP_API_URL, c as ShopApiError, d as ShopAuthType, e as ShopConfigurationError, f as ShopContractStatus, g as ShopDiagnoseOptions, h as ShopDiagnosis, i as ShopRequestContext, j as ShopRequestOptions, k as ShopRoute, l as ShopRouteAuth, m as ShopRouteBody, n as ShopRouteInput, o as ShopRouteKey, p as ShopRouteMethod, q as ShopRouteParams, r as ShopRouteQuery, s as ShopRouteResponse, t as ShopRouteResponseData, u as diagnoseShop } from './error-1WqH-FhJ.cjs';
3
+ import './index-DC6jGVkP.cjs';
4
4
 
5
5
  type ShopBrowserClientOptions = Omit<ShopClientOptions, "headers"> & {
6
6
  headers?: HeadersInit | HeaderProvider;
package/dist/browser.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { S as ShopClientOptions, H as HeaderProvider, a as ShopClient } from './error-Do0kyiZ6.js';
2
- export { B as BaseUrlProvider, C as CONTRACT_SHA256, M as MaybePromise, b as SHOP_API_URL, c as ShopApiError, d as ShopAuthType, e as ShopConfigurationError, f as ShopContractStatus, g as ShopDiagnoseOptions, h as ShopDiagnosis, i as ShopRequestContext, j as ShopRequestOptions, k as ShopRoute, l as ShopRouteAuth, m as ShopRouteBody, n as ShopRouteInput, o as ShopRouteKey, p as ShopRouteMethod, q as ShopRouteParams, r as ShopRouteQuery, s as ShopRouteResponse, t as ShopRouteResponseData, u as diagnoseShop } from './error-Do0kyiZ6.js';
3
- import './index-CIpUb0vL.js';
1
+ import { S as ShopClientOptions, H as HeaderProvider, a as ShopClient } from './error-D3Jrcd-j.js';
2
+ export { B as BaseUrlProvider, C as CONTRACT_SHA256, M as MaybePromise, b as SHOP_API_URL, c as ShopApiError, d as ShopAuthType, e as ShopConfigurationError, f as ShopContractStatus, g as ShopDiagnoseOptions, h as ShopDiagnosis, i as ShopRequestContext, j as ShopRequestOptions, k as ShopRoute, l as ShopRouteAuth, m as ShopRouteBody, n as ShopRouteInput, o as ShopRouteKey, p as ShopRouteMethod, q as ShopRouteParams, r as ShopRouteQuery, s as ShopRouteResponse, t as ShopRouteResponseData, u as diagnoseShop } from './error-D3Jrcd-j.js';
3
+ import './index-DC6jGVkP.js';
4
4
 
5
5
  type ShopBrowserClientOptions = Omit<ShopClientOptions, "headers"> & {
6
6
  headers?: HeadersInit | HeaderProvider;
package/dist/browser.js CHANGED
@@ -496,7 +496,7 @@ var apiRoutes_b2b = {
496
496
  meta: {
497
497
  tags: ["b2b"],
498
498
  summary: "Create B2B dynamic checkout session",
499
- 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.",
499
+ 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.",
500
500
  bodyContentType: "application/json",
501
501
  validated: { "params": false, "query": false, "body": true }
502
502
  },
@@ -1708,6 +1708,19 @@ var apiRoutes_external_apps = {
1708
1708
  },
1709
1709
  types: null
1710
1710
  },
1711
+ "external_apps_service_rotate_key": {
1712
+ method: "POST",
1713
+ path: "/external-apps/service/rotate-key/:appId",
1714
+ auth: { "type": "x_api_key_https" },
1715
+ meta: {
1716
+ tags: ["external-apps"],
1717
+ summary: "Rotate external app api key (B2B zero-downtime)",
1718
+ 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.",
1719
+ bodyContentType: "application/json",
1720
+ validated: { "params": true, "query": true, "body": true }
1721
+ },
1722
+ types: null
1723
+ },
1711
1724
  "external_apps_service_delete": {
1712
1725
  method: "DELETE",
1713
1726
  path: "/external-apps/service/delete/:appId",
@@ -1727,7 +1740,7 @@ var apiRoutes_external_apps = {
1727
1740
  meta: {
1728
1741
  tags: ["external-apps"],
1729
1742
  summary: "Get external app registration status (B2B)",
1730
- description: "Returns registration status for an app identified by its string appId. Used by AMP to discover existing connections."
1743
+ 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. 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."
1731
1744
  },
1732
1745
  types: null
1733
1746
  },
@@ -5370,10 +5383,10 @@ function createShopClient(options = {}) {
5370
5383
  }
5371
5384
 
5372
5385
  // src/contract-hash.ts
5373
- var CONTRACT_SHA256 = "335eed391a2786a4f7f010b056d2a6a5b49d9e1244960a15516a5d77b93693b5";
5386
+ var CONTRACT_SHA256 = "05f34929e71fb2fcb3a4c04707facca22ee46f8960a4cc47ce0a3f1a6df36056";
5374
5387
 
5375
5388
  // src/client/diagnose.ts
5376
- var SDK_VERSION = "0.2.0" ;
5389
+ var SDK_VERSION = "0.2.2" ;
5377
5390
  async function resolveBaseUrl(options) {
5378
5391
  const provider = options.client?.baseUrl ?? options.baseUrl ?? SHOP_API_URL;
5379
5392
  const value = typeof provider === "function" ? await provider() : provider;