@cimplify/sdk 0.100.5 → 0.100.6

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.
@@ -726,6 +726,7 @@ var SESSION_TOKEN_STORAGE_KEY = "cimplify_session_token";
726
726
  var SESSION_SYNC_STORAGE_KEY = "cimplify_session_sync";
727
727
  var ORDER_TOKEN_PREFIX = "cimplify_ot_";
728
728
  var SESSION_TOKEN_HEADER = "x-session-token";
729
+ var LOCATION_ID_QUERY_PARAMETER = "location_id";
729
730
  var ORDER_TOKEN_TTL_MS = 24 * 60 * 60 * 1e3;
730
731
  var DEFAULT_TIMEOUT_MS = 5e3;
731
732
  var DEFAULT_MAX_RETRIES = 3;
@@ -878,8 +879,14 @@ var CimplifyClient = class {
878
879
  const url = `${base}${path}`;
879
880
  const locationId = this.context.location_id;
880
881
  if (!locationId) return url;
881
- const separator = url.includes("?") ? "&" : "?";
882
- return `${url}${separator}location_id=${encodeURIComponent(locationId)}`;
882
+ const fragmentIndex = url.indexOf("#");
883
+ const urlWithoutFragment = fragmentIndex === -1 ? url : url.slice(0, fragmentIndex);
884
+ const fragment = fragmentIndex === -1 ? "" : url.slice(fragmentIndex);
885
+ const queryIndex = urlWithoutFragment.indexOf("?");
886
+ const query = queryIndex === -1 ? "" : urlWithoutFragment.slice(queryIndex + 1);
887
+ if (new URLSearchParams(query).has(LOCATION_ID_QUERY_PARAMETER)) return url;
888
+ const separator = queryIndex === -1 ? "?" : "&";
889
+ return `${urlWithoutFragment}${separator}${LOCATION_ID_QUERY_PARAMETER}=${encodeURIComponent(locationId)}${fragment}`;
883
890
  }
884
891
  stopTrackingPageViews() {
885
892
  this.stopPageViewTracking?.();
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkPNTINRAU_js = require('./chunk-PNTINRAU.js');
4
- var chunkJEVCHTKZ_js = require('./chunk-JEVCHTKZ.js');
4
+ var chunkD3FWJB7Y_js = require('./chunk-D3FWJB7Y.js');
5
5
  var zod = require('zod');
6
6
 
7
7
  var cimplifyRegistry = zod.z.registry();
@@ -619,7 +619,7 @@ function createTestClient(options = {}) {
619
619
  if (echoed) sessionToken = echoed;
620
620
  return res;
621
621
  };
622
- const client = chunkJEVCHTKZ_js.createCimplifyClient({
622
+ const client = chunkD3FWJB7Y_js.createCimplifyClient({
623
623
  baseUrl: TEST_BASE_URL,
624
624
  // Link mock lives at /v1/link on the same Hono app, so point the SDK's
625
625
  // separate Link transport at the same TEST_BASE_URL.
@@ -728,6 +728,7 @@ var SESSION_TOKEN_STORAGE_KEY = "cimplify_session_token";
728
728
  var SESSION_SYNC_STORAGE_KEY = "cimplify_session_sync";
729
729
  var ORDER_TOKEN_PREFIX = "cimplify_ot_";
730
730
  var SESSION_TOKEN_HEADER = "x-session-token";
731
+ var LOCATION_ID_QUERY_PARAMETER = "location_id";
731
732
  var ORDER_TOKEN_TTL_MS = 24 * 60 * 60 * 1e3;
732
733
  var DEFAULT_TIMEOUT_MS = 5e3;
733
734
  var DEFAULT_MAX_RETRIES = 3;
@@ -880,8 +881,14 @@ var CimplifyClient = class {
880
881
  const url = `${base}${path}`;
881
882
  const locationId = this.context.location_id;
882
883
  if (!locationId) return url;
883
- const separator = url.includes("?") ? "&" : "?";
884
- return `${url}${separator}location_id=${encodeURIComponent(locationId)}`;
884
+ const fragmentIndex = url.indexOf("#");
885
+ const urlWithoutFragment = fragmentIndex === -1 ? url : url.slice(0, fragmentIndex);
886
+ const fragment = fragmentIndex === -1 ? "" : url.slice(fragmentIndex);
887
+ const queryIndex = urlWithoutFragment.indexOf("?");
888
+ const query = queryIndex === -1 ? "" : urlWithoutFragment.slice(queryIndex + 1);
889
+ if (new URLSearchParams(query).has(LOCATION_ID_QUERY_PARAMETER)) return url;
890
+ const separator = queryIndex === -1 ? "?" : "&";
891
+ return `${urlWithoutFragment}${separator}${LOCATION_ID_QUERY_PARAMETER}=${encodeURIComponent(locationId)}${fragment}`;
885
892
  }
886
893
  stopTrackingPageViews() {
887
894
  this.stopPageViewTracking?.();
@@ -1,5 +1,5 @@
1
1
  import { createMockApp } from './chunk-RQPXLXB2.mjs';
2
- import { createCimplifyClient } from './chunk-RWR7JF7F.mjs';
2
+ import { createCimplifyClient } from './chunk-BMFWQNYZ.mjs';
3
3
  import { z } from 'zod';
4
4
 
5
5
  var cimplifyRegistry = z.registry();
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  var chunkQPRI2NII_js = require('./chunk-QPRI2NII.js');
4
4
  var chunkL5GKVQVJ_js = require('./chunk-L5GKVQVJ.js');
5
- var chunkJEVCHTKZ_js = require('./chunk-JEVCHTKZ.js');
5
+ var chunkD3FWJB7Y_js = require('./chunk-D3FWJB7Y.js');
6
6
  var chunk3HU5I5VG_js = require('./chunk-3HU5I5VG.js');
7
7
  var chunkWMEC5JWN_js = require('./chunk-WMEC5JWN.js');
8
8
  var chunkNIOUSKQQ_js = require('./chunk-NIOUSKQQ.js');
@@ -183,39 +183,39 @@ Object.defineProperty(exports, "resolvePhoneCountryCode", {
183
183
  });
184
184
  Object.defineProperty(exports, "ActivityService", {
185
185
  enumerable: true,
186
- get: function () { return chunkJEVCHTKZ_js.ActivityService; }
186
+ get: function () { return chunkD3FWJB7Y_js.ActivityService; }
187
187
  });
188
188
  Object.defineProperty(exports, "CimplifyClient", {
189
189
  enumerable: true,
190
- get: function () { return chunkJEVCHTKZ_js.CimplifyClient; }
190
+ get: function () { return chunkD3FWJB7Y_js.CimplifyClient; }
191
191
  });
192
192
  Object.defineProperty(exports, "DeliveryService", {
193
193
  enumerable: true,
194
- get: function () { return chunkJEVCHTKZ_js.DeliveryService; }
194
+ get: function () { return chunkD3FWJB7Y_js.DeliveryService; }
195
195
  });
196
196
  Object.defineProperty(exports, "PlacesService", {
197
197
  enumerable: true,
198
- get: function () { return chunkJEVCHTKZ_js.PlacesService; }
198
+ get: function () { return chunkD3FWJB7Y_js.PlacesService; }
199
199
  });
200
200
  Object.defineProperty(exports, "StoreCreditQueries", {
201
201
  enumerable: true,
202
- get: function () { return chunkJEVCHTKZ_js.StoreCreditQueries; }
202
+ get: function () { return chunkD3FWJB7Y_js.StoreCreditQueries; }
203
203
  });
204
204
  Object.defineProperty(exports, "SubscriptionService", {
205
205
  enumerable: true,
206
- get: function () { return chunkJEVCHTKZ_js.SubscriptionService; }
206
+ get: function () { return chunkD3FWJB7Y_js.SubscriptionService; }
207
207
  });
208
208
  Object.defineProperty(exports, "SupportService", {
209
209
  enumerable: true,
210
- get: function () { return chunkJEVCHTKZ_js.SupportService; }
210
+ get: function () { return chunkD3FWJB7Y_js.SupportService; }
211
211
  });
212
212
  Object.defineProperty(exports, "UploadService", {
213
213
  enumerable: true,
214
- get: function () { return chunkJEVCHTKZ_js.UploadService; }
214
+ get: function () { return chunkD3FWJB7Y_js.UploadService; }
215
215
  });
216
216
  Object.defineProperty(exports, "createCimplifyClient", {
217
217
  enumerable: true,
218
- get: function () { return chunkJEVCHTKZ_js.createCimplifyClient; }
218
+ get: function () { return chunkD3FWJB7Y_js.createCimplifyClient; }
219
219
  });
220
220
  Object.defineProperty(exports, "AUTHORIZATION_TYPE", {
221
221
  enumerable: true,
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  export { BOUNDARY_KIND, CIMPLIFY_CDN_HOSTS, DEFAULT_CDN_BASE_URL, DURATION_UNIT, INPUT_FIELD_TYPE, PRODUCT_TYPE, RENDER_HINT, allGalleryImages, assetUrl, chatMessageCards, getVariantDisplayName, isCimplifyAsset, isMultiDayService, priceBasisLabel, resolveGallery, serviceBillingMultiplier, stayLength, stayPeriods } from './chunk-4G5UWFC3.mjs';
2
2
  export { isValidPhoneForContext, normalizePhoneToE164, resolvePhoneCountryCode } from './chunk-YOIVZ6OA.mjs';
3
- export { ActivityService, CimplifyClient, DeliveryService, PlacesService, StoreCreditQueries, SubscriptionService, SupportService, UploadService, createCimplifyClient } from './chunk-RWR7JF7F.mjs';
3
+ export { ActivityService, CimplifyClient, DeliveryService, PlacesService, StoreCreditQueries, SubscriptionService, SupportService, UploadService, createCimplifyClient } from './chunk-BMFWQNYZ.mjs';
4
4
  import { getAuthorizationEndpoint, DEFAULT_ISSUER, generatePkce, generateState } from './chunk-Z7M6GAHS.mjs';
5
5
  export { AUTHORIZATION_TYPE, AUTH_MUTATION, AuthService, BusinessService, CHECKOUT_MODE, CHECKOUT_MUTATION, CHECKOUT_STEP, CONTACT_TYPE, CartOperations, CatalogueQueries, CheckoutService as CheckoutOperations, CheckoutService, CimplifyElement, CimplifyElements, DEFAULT_COUNTRY, DEFAULT_CURRENCY, DEVICE_TYPE, ELEMENTS_AUTH_CONTACT_TYPES, ELEMENTS_AUTH_MODES, ELEMENTS_AUTH_PROMPTS, ELEMENT_TYPES, EVENT_TYPES, FxService, InventoryService, LINK_MUTATION, LINK_QUERY, LinkService, LiteService, MESSAGE_TYPES, MOBILE_MONEY_PROVIDER, ORDER_MUTATION, ORDER_TYPE, OrderQueries, PAYMENT_METHOD, PAYMENT_MUTATION, PAYMENT_STATE, PICKUP_TIME_TYPE, SchedulingService, combine, combineObject, createElements, err, flatMap, fromPromise, generateIdempotencyKey, getOrElse, isErr, isOk, mapError, mapResult, ok, startSignIn, toNullable, tryCatch, unwrap } from './chunk-Z7M6GAHS.mjs';
6
6
  export { CURRENCY_SYMBOLS, MOBILE_MONEY_PROVIDERS, categorizePaymentError, detectMobileMoneyProvider, formatMoney, formatNumberCompact, formatPrice, formatPriceAdjustment, formatPriceCompact, formatPriceRange, formatPriceWithTax, formatProductPrice, getBasePrice, getCurrencySymbol, getDiscountPercentage, getDisplayPrice, getMarkupPercentage, getPriceRange, getProductCurrency, getTaxAmount, getUnitPriceAtQuantity, hasTaxInfo, isOnSale, isPaymentStatusFailure, isPaymentStatusRequiresAction, isPaymentStatusSuccess, isTaxInclusive, normalizePaymentResponse, normalizeStatusResponse, parsePrice } from './chunk-DLW3RWRK.mjs';
package/dist/react.js CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  var chunkXREIZ56K_js = require('./chunk-XREIZ56K.js');
5
5
  var chunkQPRI2NII_js = require('./chunk-QPRI2NII.js');
6
- var chunkJEVCHTKZ_js = require('./chunk-JEVCHTKZ.js');
6
+ var chunkD3FWJB7Y_js = require('./chunk-D3FWJB7Y.js');
7
7
  var chunk3HU5I5VG_js = require('./chunk-3HU5I5VG.js');
8
8
  var chunkWMEC5JWN_js = require('./chunk-WMEC5JWN.js');
9
9
  var chunkNIOUSKQQ_js = require('./chunk-NIOUSKQQ.js');
@@ -845,7 +845,7 @@ async function syncFromServer(entry) {
845
845
  return next;
846
846
  }
847
847
  function emitMutationError(entry, operation, opId, idempotencyKey, error) {
848
- entry.client.events.emit(chunkJEVCHTKZ_js.MUTATION_ERROR, {
848
+ entry.client.events.emit(chunkD3FWJB7Y_js.MUTATION_ERROR, {
849
849
  service: "cart",
850
850
  operation,
851
851
  opId,
@@ -885,10 +885,10 @@ function getOrCreateStore(params) {
885
885
  syncTail: Promise.resolve(),
886
886
  failedOpRemovers: /* @__PURE__ */ new Set()
887
887
  };
888
- client.events.on(chunkJEVCHTKZ_js.SESSION_CLAIMED, () => {
888
+ client.events.on(chunkD3FWJB7Y_js.SESSION_CLAIMED, () => {
889
889
  if (entry.initialized) void syncFromServer(entry);
890
890
  });
891
- client.events.on(chunkJEVCHTKZ_js.SESSION_CLEARED, () => {
891
+ client.events.on(chunkD3FWJB7Y_js.SESSION_CLEARED, () => {
892
892
  if (entry.initialized) void syncFromServer(entry);
893
893
  });
894
894
  cartStores.set(storeKey, entry);
@@ -1192,7 +1192,7 @@ var DEFAULT_COUNTRY = "US";
1192
1192
  function createDefaultClient() {
1193
1193
  const processRef = globalThis.process;
1194
1194
  const envPublicKey = processRef?.env?.NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY || "";
1195
- return chunkJEVCHTKZ_js.createCimplifyClient({ publicKey: envPublicKey });
1195
+ return chunkD3FWJB7Y_js.createCimplifyClient({ publicKey: envPublicKey });
1196
1196
  }
1197
1197
  function getStoredLocationId() {
1198
1198
  if (typeof window === "undefined" || !window.localStorage) {
@@ -4972,9 +4972,9 @@ function useClientSessionEpoch(client) {
4972
4972
  const subscribe = React14.useCallback(
4973
4973
  (notify) => {
4974
4974
  const unsubscribe = [
4975
- client.events.on(chunkJEVCHTKZ_js.AUTH_TOKEN_CHANGED, notify),
4976
- client.events.on(chunkJEVCHTKZ_js.SESSION_CLAIMED, notify),
4977
- client.events.on(chunkJEVCHTKZ_js.SESSION_CLEARED, notify)
4975
+ client.events.on(chunkD3FWJB7Y_js.AUTH_TOKEN_CHANGED, notify),
4976
+ client.events.on(chunkD3FWJB7Y_js.SESSION_CLAIMED, notify),
4977
+ client.events.on(chunkD3FWJB7Y_js.SESSION_CLEARED, notify)
4978
4978
  ];
4979
4979
  return () => {
4980
4980
  for (const stopListening of unsubscribe) {
@@ -6304,7 +6304,7 @@ function useChat(options = {}) {
6304
6304
  const watchSessionClaims = React14.useCallback(() => {
6305
6305
  const c = clientRef.current;
6306
6306
  if (!c || claimUnsubRef.current) return;
6307
- const unsubClaimed = c.events.on(chunkJEVCHTKZ_js.SESSION_CLAIMED, (event) => {
6307
+ const unsubClaimed = c.events.on(chunkD3FWJB7Y_js.SESSION_CLAIMED, (event) => {
6308
6308
  setClaimedAs(event.customerName || c.support.claimedCustomerName || null);
6309
6309
  if (!openedRef.current) {
6310
6310
  void openIfExisting();
@@ -6313,7 +6313,7 @@ function useChat(options = {}) {
6313
6313
  connectWebSocket();
6314
6314
  void resyncConversation();
6315
6315
  });
6316
- const unsubCleared = c.events.on(chunkJEVCHTKZ_js.SESSION_CLEARED, resetConversation);
6316
+ const unsubCleared = c.events.on(chunkD3FWJB7Y_js.SESSION_CLEARED, resetConversation);
6317
6317
  claimUnsubRef.current = () => {
6318
6318
  unsubClaimed();
6319
6319
  unsubCleared();
package/dist/react.mjs CHANGED
@@ -3,7 +3,7 @@ import { splitGenUIContent, messagePreview } from './chunk-U4MW6PYU.mjs';
3
3
  export { messagePreview, splitGenUIContent } from './chunk-U4MW6PYU.mjs';
4
4
  import { DURATION_UNIT, getVariantDisplayName, INPUT_FIELD_TYPE, isMultiDayService, serviceBillingMultiplier, PRODUCT_TYPE, BOUNDARY_KIND, resolveGallery, chatMessageCards, RENDER_HINT, DEFAULT_CDN_BASE_URL } from './chunk-4G5UWFC3.mjs';
5
5
  export { getVariantDisplayName } from './chunk-4G5UWFC3.mjs';
6
- import { SESSION_CLAIMED, SESSION_CLEARED, createCimplifyClient, AUTH_TOKEN_CHANGED, MUTATION_ERROR } from './chunk-RWR7JF7F.mjs';
6
+ import { SESSION_CLAIMED, SESSION_CLEARED, createCimplifyClient, AUTH_TOKEN_CHANGED, MUTATION_ERROR } from './chunk-BMFWQNYZ.mjs';
7
7
  import { generateIdempotencyKey, ELEMENT_TYPES, EVENT_TYPES, startSignIn } from './chunk-Z7M6GAHS.mjs';
8
8
  import { parsePrice, formatMoney, formatPrice, getVariantUnitPrice, getProductCurrency, getUnitPriceAtQuantity, isOnSale, getDiscountPercentage, getBasePrice, getPriceRange, formatPriceRange } from './chunk-DLW3RWRK.mjs';
9
9
  import { isSupportedCurrency, currencyCode, CimplifyError } from './chunk-O3YUHLZL.mjs';
package/dist/server.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkJEVCHTKZ_js = require('./chunk-JEVCHTKZ.js');
3
+ var chunkD3FWJB7Y_js = require('./chunk-D3FWJB7Y.js');
4
4
  var chunk3HU5I5VG_js = require('./chunk-3HU5I5VG.js');
5
5
  require('./chunk-WMEC5JWN.js');
6
6
  var chunkNIOUSKQQ_js = require('./chunk-NIOUSKQQ.js');
@@ -26,7 +26,7 @@ function readEnv(...keys) {
26
26
  var getServerClient = react.cache((opts = {}) => {
27
27
  const baseUrl = opts.apiUrl ?? readEnv("CIMPLIFY_API_URL", "NEXT_PUBLIC_CIMPLIFY_API_URL") ?? defaultBaseUrl();
28
28
  const publicKey = opts.secretKey ?? readEnv("CIMPLIFY_SECRET_KEY", "NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY") ?? "mock-dev";
29
- const client = chunkJEVCHTKZ_js.createCimplifyClient({
29
+ const client = chunkD3FWJB7Y_js.createCimplifyClient({
30
30
  baseUrl,
31
31
  publicKey,
32
32
  suppressPublicKeyWarning: true
package/dist/server.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { createCimplifyClient } from './chunk-RWR7JF7F.mjs';
1
+ import { createCimplifyClient } from './chunk-BMFWQNYZ.mjs';
2
2
  import { PKCE_COOKIE, decodePkceState, PKCE_COOKIE_PATH, DEFAULT_ISSUER } from './chunk-Z7M6GAHS.mjs';
3
3
  import './chunk-DLW3RWRK.mjs';
4
4
  export { CimplifyError } from './chunk-O3YUHLZL.mjs';
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var chunkLMD7B33E_js = require('../chunk-LMD7B33E.js');
3
+ var chunkBSZJSR62_js = require('../chunk-BSZJSR62.js');
4
4
  require('../chunk-PNTINRAU.js');
5
5
  require('../chunk-XREIZ56K.js');
6
- require('../chunk-JEVCHTKZ.js');
6
+ require('../chunk-D3FWJB7Y.js');
7
7
  require('../chunk-3HU5I5VG.js');
8
8
  require('../chunk-WMEC5JWN.js');
9
9
  require('../chunk-NIOUSKQQ.js');
@@ -21,11 +21,11 @@ var PLACEHOLDER_PHRASES = [
21
21
  function createBrandSuite(opts) {
22
22
  vitest.describe(opts.label ?? "brand schema", () => {
23
23
  vitest.it("conforms to the Cimplify brand contract", () => {
24
- vitest.expect(() => chunkLMD7B33E_js.assertBrand(opts.brand)).not.toThrow();
24
+ vitest.expect(() => chunkBSZJSR62_js.assertBrand(opts.brand)).not.toThrow();
25
25
  });
26
26
  vitest.it("declares a known mock seed", () => {
27
27
  const b = opts.brand;
28
- vitest.expect(chunkLMD7B33E_js.SeedNameSchema.safeParse(b.mock?.seed).success).toBe(true);
28
+ vitest.expect(chunkBSZJSR62_js.SeedNameSchema.safeParse(b.mock?.seed).success).toBe(true);
29
29
  });
30
30
  vitest.it("has no placeholder copy left in", () => {
31
31
  const offenders = [];
@@ -57,7 +57,7 @@ ${msg}`);
57
57
  vitest.expect(b.mock?.businessId).toMatch(/^bus_/);
58
58
  });
59
59
  vitest.it("zod-parses cleanly", () => {
60
- const result = chunkLMD7B33E_js.BrandSchema.safeParse(opts.brand);
60
+ const result = chunkBSZJSR62_js.BrandSchema.safeParse(opts.brand);
61
61
  if (!result.success) {
62
62
  throw new Error(
63
63
  "Brand schema violations:\n" + result.error.issues.map((i) => ` \u2022 brand.${i.path.join(".")}: ${i.message}`).join("\n")
@@ -72,23 +72,23 @@ function createCartFlowSuite(opts = {}) {
72
72
  vitest.describe(opts.label ?? "cart flow against in-process mock", () => {
73
73
  let h;
74
74
  vitest.beforeEach(() => {
75
- h = chunkLMD7B33E_js.createTestClient(opts);
75
+ h = chunkBSZJSR62_js.createTestClient(opts);
76
76
  });
77
77
  vitest.afterEach(() => h.dispose());
78
78
  vitest.it("starts with an empty cart matching the canonical shape", async () => {
79
79
  const res = await h.client.cart.get();
80
80
  vitest.expect(res.ok).toBe(true);
81
81
  if (!res.ok) return;
82
- vitest.expect(() => chunkLMD7B33E_js.assertCart(res.value)).not.toThrow();
82
+ vitest.expect(() => chunkBSZJSR62_js.assertCart(res.value)).not.toThrow();
83
83
  vitest.expect(res.value.items).toHaveLength(0);
84
84
  });
85
85
  vitest.it("adds the first product, persists it, and returns a shape-valid cart", async () => {
86
- const { product, variantId } = await chunkLMD7B33E_js.fixtures.addFirstProduct(h.client);
86
+ const { product, variantId } = await chunkBSZJSR62_js.fixtures.addFirstProduct(h.client);
87
87
  vitest.expect(product.id).toBeTruthy();
88
88
  const get = await h.client.cart.get();
89
89
  vitest.expect(get.ok).toBe(true);
90
90
  if (!get.ok) return;
91
- vitest.expect(() => chunkLMD7B33E_js.assertCart(get.value)).not.toThrow();
91
+ vitest.expect(() => chunkBSZJSR62_js.assertCart(get.value)).not.toThrow();
92
92
  vitest.expect(get.value.items).toHaveLength(1);
93
93
  vitest.expect(get.value.items[0]?.item_id).toBe(product.id);
94
94
  if (variantId) {
@@ -99,8 +99,8 @@ function createCartFlowSuite(opts = {}) {
99
99
  vitest.expect(parseFloat(String(get.value.pricing.subtotal))).toBeGreaterThan(0);
100
100
  });
101
101
  vitest.it("dedupes by line_key when adding the same product twice", async () => {
102
- await chunkLMD7B33E_js.fixtures.addFirstProduct(h.client);
103
- await chunkLMD7B33E_js.fixtures.addFirstProduct(h.client);
102
+ await chunkBSZJSR62_js.fixtures.addFirstProduct(h.client);
103
+ await chunkBSZJSR62_js.fixtures.addFirstProduct(h.client);
104
104
  const res = await h.client.cart.get();
105
105
  vitest.expect(res.ok).toBe(true);
106
106
  if (!res.ok) return;
@@ -108,7 +108,7 @@ function createCartFlowSuite(opts = {}) {
108
108
  vitest.expect(res.value.items[0]?.quantity).toBe(2);
109
109
  });
110
110
  vitest.it("removes items and zeroes the subtotal", async () => {
111
- await chunkLMD7B33E_js.fixtures.addFirstProduct(h.client);
111
+ await chunkBSZJSR62_js.fixtures.addFirstProduct(h.client);
112
112
  const before = await h.client.cart.get();
113
113
  if (!before.ok) throw before.error;
114
114
  const itemId = before.value.items[0]?.id;
@@ -134,28 +134,28 @@ function createContractSuite(opts = {}) {
134
134
  vitest.describe(opts.label ?? "SDK \u2194 mock contract", () => {
135
135
  let h;
136
136
  vitest.beforeEach(() => {
137
- h = chunkLMD7B33E_js.createTestClient(opts);
137
+ h = chunkBSZJSR62_js.createTestClient(opts);
138
138
  });
139
139
  vitest.afterEach(() => h.dispose());
140
140
  vitest.it("AddItemPayload schema accepts a minimal valid body", () => {
141
- const result = chunkLMD7B33E_js.AddItemPayloadSchema.safeParse({ item_id: "prod_x", quantity: 1 });
141
+ const result = chunkBSZJSR62_js.AddItemPayloadSchema.safeParse({ item_id: "prod_x", quantity: 1 });
142
142
  vitest.expect(result.success).toBe(true);
143
143
  });
144
144
  vitest.it("AddItemPayload schema rejects negative quantity", () => {
145
- const result = chunkLMD7B33E_js.AddItemPayloadSchema.safeParse({ item_id: "prod_x", quantity: -1 });
145
+ const result = chunkBSZJSR62_js.AddItemPayloadSchema.safeParse({ item_id: "prod_x", quantity: -1 });
146
146
  vitest.expect(result.success).toBe(false);
147
147
  });
148
148
  vitest.it("AddItemPayload schema rejects empty item_id", () => {
149
- const result = chunkLMD7B33E_js.AddItemPayloadSchema.safeParse({ item_id: "", quantity: 1 });
149
+ const result = chunkBSZJSR62_js.AddItemPayloadSchema.safeParse({ item_id: "", quantity: 1 });
150
150
  vitest.expect(result.success).toBe(false);
151
151
  });
152
152
  vitest.it("Cart line items returned by the mock match CartItemSchema", async () => {
153
- const { product } = await chunkLMD7B33E_js.fixtures.addFirstProduct(h.client);
153
+ const { product } = await chunkBSZJSR62_js.fixtures.addFirstProduct(h.client);
154
154
  const get = await h.client.cart.get();
155
155
  if (!get.ok) throw get.error;
156
156
  vitest.expect(get.value.items.length).toBeGreaterThan(0);
157
157
  for (const item of get.value.items) {
158
- const result = chunkLMD7B33E_js.CartItemSchema.safeParse(item);
158
+ const result = chunkBSZJSR62_js.CartItemSchema.safeParse(item);
159
159
  if (!result.success) {
160
160
  const issues = result.error.issues.map((i) => ` \u2022 ${i.path.join(".")}: ${i.message}`).join("\n");
161
161
  throw new Error(`Cart item shape mismatch for ${product.name}:
@@ -165,19 +165,19 @@ ${issues}`);
165
165
  }
166
166
  });
167
167
  vitest.it("CheckoutResponse from the mock includes bill_token", async () => {
168
- await chunkLMD7B33E_js.fixtures.addFirstProduct(h.client);
168
+ await chunkBSZJSR62_js.fixtures.addFirstProduct(h.client);
169
169
  const cartRes = await h.client.cart.get();
170
170
  if (!cartRes.ok) throw cartRes.error;
171
171
  const checkout = await h.client.checkout.process({
172
172
  cart_id: cartRes.value.id,
173
- customer: chunkLMD7B33E_js.fixtures.customer(),
173
+ customer: chunkBSZJSR62_js.fixtures.customer(),
174
174
  order_type: "delivery",
175
175
  payment_method: "mobile_money",
176
176
  mobile_money_details: { phone_number: "+233244000000", provider: "mtn" }
177
177
  });
178
178
  vitest.expect(checkout.ok).toBe(true);
179
179
  if (!checkout.ok) return;
180
- const result = chunkLMD7B33E_js.CheckoutResponseSchema.safeParse(checkout.value);
180
+ const result = chunkBSZJSR62_js.CheckoutResponseSchema.safeParse(checkout.value);
181
181
  if (!result.success) {
182
182
  const issues = result.error.issues.map((i) => ` \u2022 ${i.path.join(".")}: ${i.message}`).join("\n");
183
183
  throw new Error(`CheckoutResponse shape mismatch:
@@ -1,7 +1,7 @@
1
- import { assertBrand, SeedNameSchema, BrandSchema, createTestClient, assertCart, fixtures, AddItemPayloadSchema, CartItemSchema, CheckoutResponseSchema } from '../chunk-HSDQWJLA.mjs';
1
+ import { assertBrand, SeedNameSchema, BrandSchema, createTestClient, assertCart, fixtures, AddItemPayloadSchema, CartItemSchema, CheckoutResponseSchema } from '../chunk-KLJLKT6C.mjs';
2
2
  import '../chunk-RQPXLXB2.mjs';
3
3
  import '../chunk-U4MW6PYU.mjs';
4
- import '../chunk-RWR7JF7F.mjs';
4
+ import '../chunk-BMFWQNYZ.mjs';
5
5
  import '../chunk-Z7M6GAHS.mjs';
6
6
  import '../chunk-DLW3RWRK.mjs';
7
7
  import '../chunk-O3YUHLZL.mjs';
@@ -54,8 +54,8 @@ declare const CountryCodeSchema: z.ZodString;
54
54
  declare const LocaleSchema: z.ZodString;
55
55
  declare const PhoneE164Schema: z.ZodString;
56
56
  declare const SeedNameSchema: z.ZodEnum<{
57
- empty: "empty";
58
57
  default: "default";
58
+ empty: "empty";
59
59
  "reesa-storefront": "reesa-storefront";
60
60
  restaurant: "restaurant";
61
61
  retail: "retail";
@@ -71,11 +71,11 @@ declare const ProductTypeSchema: z.ZodEnum<{
71
71
  composite: "composite";
72
72
  }>;
73
73
  declare const LineTypeSchema: z.ZodEnum<{
74
- simple: "simple";
75
74
  service: "service";
76
75
  digital: "digital";
77
76
  bundle: "bundle";
78
77
  composite: "composite";
78
+ simple: "simple";
79
79
  }>;
80
80
  declare const ServiceStatusSchema: z.ZodEnum<{
81
81
  pending: "pending";
@@ -365,8 +365,8 @@ declare const BrandSchema: z.ZodObject<{
365
365
  }, z.core.$strip>;
366
366
  mock: z.ZodObject<{
367
367
  seed: z.ZodEnum<{
368
- empty: "empty";
369
368
  default: "default";
369
+ empty: "empty";
370
370
  "reesa-storefront": "reesa-storefront";
371
371
  restaurant: "restaurant";
372
372
  retail: "retail";
@@ -531,7 +531,7 @@ declare const assertBrand: (value: unknown) => asserts value is {
531
531
  summary: string;
532
532
  };
533
533
  mock: {
534
- seed: "empty" | "default" | "reesa-storefront" | "restaurant" | "retail" | "services" | "grocery" | "fashion";
534
+ seed: "default" | "empty" | "reesa-storefront" | "restaurant" | "retail" | "services" | "grocery" | "fashion";
535
535
  businessId: string;
536
536
  };
537
537
  trustItems?: {
@@ -780,11 +780,11 @@ declare const CartItemSchema: z.ZodObject<{
780
780
  quantity: z.ZodNumber;
781
781
  line_key: z.ZodString;
782
782
  line_type: z.ZodEnum<{
783
- simple: "simple";
784
783
  service: "service";
785
784
  digital: "digital";
786
785
  bundle: "bundle";
787
786
  composite: "composite";
787
+ simple: "simple";
788
788
  }>;
789
789
  name: z.ZodString;
790
790
  description: z.ZodOptional<z.ZodString>;
@@ -926,7 +926,7 @@ declare const assertCartItem: (value: unknown) => asserts value is {
926
926
  item_id: string;
927
927
  quantity: number;
928
928
  line_key: string;
929
- line_type: "simple" | "service" | "digital" | "bundle" | "composite";
929
+ line_type: "service" | "digital" | "bundle" | "composite" | "simple";
930
930
  name: string;
931
931
  is_available: boolean;
932
932
  base_price: string;
@@ -1079,11 +1079,11 @@ declare const CartSchema: z.ZodObject<{
1079
1079
  quantity: z.ZodNumber;
1080
1080
  line_key: z.ZodString;
1081
1081
  line_type: z.ZodEnum<{
1082
- simple: "simple";
1083
1082
  service: "service";
1084
1083
  digital: "digital";
1085
1084
  bundle: "bundle";
1086
1085
  composite: "composite";
1086
+ simple: "simple";
1087
1087
  }>;
1088
1088
  name: z.ZodString;
1089
1089
  description: z.ZodOptional<z.ZodString>;
@@ -1256,7 +1256,7 @@ declare const assertCart: (value: unknown) => asserts value is {
1256
1256
  item_id: string;
1257
1257
  quantity: number;
1258
1258
  line_key: string;
1259
- line_type: "simple" | "service" | "digital" | "bundle" | "composite";
1259
+ line_type: "service" | "digital" | "bundle" | "composite" | "simple";
1260
1260
  name: string;
1261
1261
  is_available: boolean;
1262
1262
  base_price: string;
@@ -1475,10 +1475,10 @@ declare const assertCheckoutBody: (value: unknown) => asserts value is {
1475
1475
  };
1476
1476
  declare const AuthorizationTypeSchema: z.ZodEnum<{
1477
1477
  phone: "phone";
1478
+ address: "address";
1478
1479
  otp: "otp";
1479
1480
  pin: "pin";
1480
1481
  birthday: "birthday";
1481
- address: "address";
1482
1482
  }>;
1483
1483
  declare const NextActionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1484
1484
  type: z.ZodLiteral<"none">;
@@ -1498,10 +1498,10 @@ declare const CheckoutResponseSchema: z.ZodObject<{
1498
1498
  requires_authorization: z.ZodBoolean;
1499
1499
  authorization_type: z.ZodOptional<z.ZodEnum<{
1500
1500
  phone: "phone";
1501
+ address: "address";
1501
1502
  otp: "otp";
1502
1503
  pin: "pin";
1503
1504
  birthday: "birthday";
1504
- address: "address";
1505
1505
  }>>;
1506
1506
  next_action: z.ZodDiscriminatedUnion<[z.ZodObject<{
1507
1507
  type: z.ZodLiteral<"none">;
@@ -1538,7 +1538,7 @@ declare const assertCheckoutResponse: (value: unknown) => asserts value is {
1538
1538
  display_text?: string | undefined;
1539
1539
  };
1540
1540
  payment_reference?: string | undefined;
1541
- authorization_type?: "phone" | "otp" | "pin" | "birthday" | "address" | undefined;
1541
+ authorization_type?: "phone" | "address" | "otp" | "pin" | "birthday" | undefined;
1542
1542
  provider?: string | undefined;
1543
1543
  authorization_url?: string | undefined;
1544
1544
  display_text?: string | undefined;
@@ -1737,8 +1737,8 @@ declare const PUBLIC_SCHEMAS: {
1737
1737
  }, z.core.$strip>;
1738
1738
  mock: z.ZodObject<{
1739
1739
  seed: z.ZodEnum<{
1740
- empty: "empty";
1741
1740
  default: "default";
1741
+ empty: "empty";
1742
1742
  "reesa-storefront": "reesa-storefront";
1743
1743
  restaurant: "restaurant";
1744
1744
  retail: "retail";
@@ -1798,11 +1798,11 @@ declare const PUBLIC_SCHEMAS: {
1798
1798
  quantity: z.ZodNumber;
1799
1799
  line_key: z.ZodString;
1800
1800
  line_type: z.ZodEnum<{
1801
- simple: "simple";
1802
1801
  service: "service";
1803
1802
  digital: "digital";
1804
1803
  bundle: "bundle";
1805
1804
  composite: "composite";
1805
+ simple: "simple";
1806
1806
  }>;
1807
1807
  name: z.ZodString;
1808
1808
  description: z.ZodOptional<z.ZodString>;
@@ -1970,11 +1970,11 @@ declare const PUBLIC_SCHEMAS: {
1970
1970
  quantity: z.ZodNumber;
1971
1971
  line_key: z.ZodString;
1972
1972
  line_type: z.ZodEnum<{
1973
- simple: "simple";
1974
1973
  service: "service";
1975
1974
  digital: "digital";
1976
1975
  bundle: "bundle";
1977
1976
  composite: "composite";
1977
+ simple: "simple";
1978
1978
  }>;
1979
1979
  name: z.ZodString;
1980
1980
  description: z.ZodOptional<z.ZodString>;
@@ -2152,10 +2152,10 @@ declare const PUBLIC_SCHEMAS: {
2152
2152
  requires_authorization: z.ZodBoolean;
2153
2153
  authorization_type: z.ZodOptional<z.ZodEnum<{
2154
2154
  phone: "phone";
2155
+ address: "address";
2155
2156
  otp: "otp";
2156
2157
  pin: "pin";
2157
2158
  birthday: "birthday";
2158
- address: "address";
2159
2159
  }>>;
2160
2160
  next_action: z.ZodDiscriminatedUnion<[z.ZodObject<{
2161
2161
  type: z.ZodLiteral<"none">;
package/dist/testing.d.ts CHANGED
@@ -54,8 +54,8 @@ declare const CountryCodeSchema: z.ZodString;
54
54
  declare const LocaleSchema: z.ZodString;
55
55
  declare const PhoneE164Schema: z.ZodString;
56
56
  declare const SeedNameSchema: z.ZodEnum<{
57
- empty: "empty";
58
57
  default: "default";
58
+ empty: "empty";
59
59
  "reesa-storefront": "reesa-storefront";
60
60
  restaurant: "restaurant";
61
61
  retail: "retail";
@@ -71,11 +71,11 @@ declare const ProductTypeSchema: z.ZodEnum<{
71
71
  composite: "composite";
72
72
  }>;
73
73
  declare const LineTypeSchema: z.ZodEnum<{
74
- simple: "simple";
75
74
  service: "service";
76
75
  digital: "digital";
77
76
  bundle: "bundle";
78
77
  composite: "composite";
78
+ simple: "simple";
79
79
  }>;
80
80
  declare const ServiceStatusSchema: z.ZodEnum<{
81
81
  pending: "pending";
@@ -365,8 +365,8 @@ declare const BrandSchema: z.ZodObject<{
365
365
  }, z.core.$strip>;
366
366
  mock: z.ZodObject<{
367
367
  seed: z.ZodEnum<{
368
- empty: "empty";
369
368
  default: "default";
369
+ empty: "empty";
370
370
  "reesa-storefront": "reesa-storefront";
371
371
  restaurant: "restaurant";
372
372
  retail: "retail";
@@ -531,7 +531,7 @@ declare const assertBrand: (value: unknown) => asserts value is {
531
531
  summary: string;
532
532
  };
533
533
  mock: {
534
- seed: "empty" | "default" | "reesa-storefront" | "restaurant" | "retail" | "services" | "grocery" | "fashion";
534
+ seed: "default" | "empty" | "reesa-storefront" | "restaurant" | "retail" | "services" | "grocery" | "fashion";
535
535
  businessId: string;
536
536
  };
537
537
  trustItems?: {
@@ -780,11 +780,11 @@ declare const CartItemSchema: z.ZodObject<{
780
780
  quantity: z.ZodNumber;
781
781
  line_key: z.ZodString;
782
782
  line_type: z.ZodEnum<{
783
- simple: "simple";
784
783
  service: "service";
785
784
  digital: "digital";
786
785
  bundle: "bundle";
787
786
  composite: "composite";
787
+ simple: "simple";
788
788
  }>;
789
789
  name: z.ZodString;
790
790
  description: z.ZodOptional<z.ZodString>;
@@ -926,7 +926,7 @@ declare const assertCartItem: (value: unknown) => asserts value is {
926
926
  item_id: string;
927
927
  quantity: number;
928
928
  line_key: string;
929
- line_type: "simple" | "service" | "digital" | "bundle" | "composite";
929
+ line_type: "service" | "digital" | "bundle" | "composite" | "simple";
930
930
  name: string;
931
931
  is_available: boolean;
932
932
  base_price: string;
@@ -1079,11 +1079,11 @@ declare const CartSchema: z.ZodObject<{
1079
1079
  quantity: z.ZodNumber;
1080
1080
  line_key: z.ZodString;
1081
1081
  line_type: z.ZodEnum<{
1082
- simple: "simple";
1083
1082
  service: "service";
1084
1083
  digital: "digital";
1085
1084
  bundle: "bundle";
1086
1085
  composite: "composite";
1086
+ simple: "simple";
1087
1087
  }>;
1088
1088
  name: z.ZodString;
1089
1089
  description: z.ZodOptional<z.ZodString>;
@@ -1256,7 +1256,7 @@ declare const assertCart: (value: unknown) => asserts value is {
1256
1256
  item_id: string;
1257
1257
  quantity: number;
1258
1258
  line_key: string;
1259
- line_type: "simple" | "service" | "digital" | "bundle" | "composite";
1259
+ line_type: "service" | "digital" | "bundle" | "composite" | "simple";
1260
1260
  name: string;
1261
1261
  is_available: boolean;
1262
1262
  base_price: string;
@@ -1475,10 +1475,10 @@ declare const assertCheckoutBody: (value: unknown) => asserts value is {
1475
1475
  };
1476
1476
  declare const AuthorizationTypeSchema: z.ZodEnum<{
1477
1477
  phone: "phone";
1478
+ address: "address";
1478
1479
  otp: "otp";
1479
1480
  pin: "pin";
1480
1481
  birthday: "birthday";
1481
- address: "address";
1482
1482
  }>;
1483
1483
  declare const NextActionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1484
1484
  type: z.ZodLiteral<"none">;
@@ -1498,10 +1498,10 @@ declare const CheckoutResponseSchema: z.ZodObject<{
1498
1498
  requires_authorization: z.ZodBoolean;
1499
1499
  authorization_type: z.ZodOptional<z.ZodEnum<{
1500
1500
  phone: "phone";
1501
+ address: "address";
1501
1502
  otp: "otp";
1502
1503
  pin: "pin";
1503
1504
  birthday: "birthday";
1504
- address: "address";
1505
1505
  }>>;
1506
1506
  next_action: z.ZodDiscriminatedUnion<[z.ZodObject<{
1507
1507
  type: z.ZodLiteral<"none">;
@@ -1538,7 +1538,7 @@ declare const assertCheckoutResponse: (value: unknown) => asserts value is {
1538
1538
  display_text?: string | undefined;
1539
1539
  };
1540
1540
  payment_reference?: string | undefined;
1541
- authorization_type?: "phone" | "otp" | "pin" | "birthday" | "address" | undefined;
1541
+ authorization_type?: "phone" | "address" | "otp" | "pin" | "birthday" | undefined;
1542
1542
  provider?: string | undefined;
1543
1543
  authorization_url?: string | undefined;
1544
1544
  display_text?: string | undefined;
@@ -1737,8 +1737,8 @@ declare const PUBLIC_SCHEMAS: {
1737
1737
  }, z.core.$strip>;
1738
1738
  mock: z.ZodObject<{
1739
1739
  seed: z.ZodEnum<{
1740
- empty: "empty";
1741
1740
  default: "default";
1741
+ empty: "empty";
1742
1742
  "reesa-storefront": "reesa-storefront";
1743
1743
  restaurant: "restaurant";
1744
1744
  retail: "retail";
@@ -1798,11 +1798,11 @@ declare const PUBLIC_SCHEMAS: {
1798
1798
  quantity: z.ZodNumber;
1799
1799
  line_key: z.ZodString;
1800
1800
  line_type: z.ZodEnum<{
1801
- simple: "simple";
1802
1801
  service: "service";
1803
1802
  digital: "digital";
1804
1803
  bundle: "bundle";
1805
1804
  composite: "composite";
1805
+ simple: "simple";
1806
1806
  }>;
1807
1807
  name: z.ZodString;
1808
1808
  description: z.ZodOptional<z.ZodString>;
@@ -1970,11 +1970,11 @@ declare const PUBLIC_SCHEMAS: {
1970
1970
  quantity: z.ZodNumber;
1971
1971
  line_key: z.ZodString;
1972
1972
  line_type: z.ZodEnum<{
1973
- simple: "simple";
1974
1973
  service: "service";
1975
1974
  digital: "digital";
1976
1975
  bundle: "bundle";
1977
1976
  composite: "composite";
1977
+ simple: "simple";
1978
1978
  }>;
1979
1979
  name: z.ZodString;
1980
1980
  description: z.ZodOptional<z.ZodString>;
@@ -2152,10 +2152,10 @@ declare const PUBLIC_SCHEMAS: {
2152
2152
  requires_authorization: z.ZodBoolean;
2153
2153
  authorization_type: z.ZodOptional<z.ZodEnum<{
2154
2154
  phone: "phone";
2155
+ address: "address";
2155
2156
  otp: "otp";
2156
2157
  pin: "pin";
2157
2158
  birthday: "birthday";
2158
- address: "address";
2159
2159
  }>>;
2160
2160
  next_action: z.ZodDiscriminatedUnion<[z.ZodObject<{
2161
2161
  type: z.ZodLiteral<"none">;
package/dist/testing.js CHANGED
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var chunkLMD7B33E_js = require('./chunk-LMD7B33E.js');
3
+ var chunkBSZJSR62_js = require('./chunk-BSZJSR62.js');
4
4
  require('./chunk-PNTINRAU.js');
5
5
  require('./chunk-XREIZ56K.js');
6
- require('./chunk-JEVCHTKZ.js');
6
+ require('./chunk-D3FWJB7Y.js');
7
7
  require('./chunk-3HU5I5VG.js');
8
8
  require('./chunk-WMEC5JWN.js');
9
9
  require('./chunk-NIOUSKQQ.js');
@@ -11,20 +11,20 @@ require('./chunk-OWW5GUSB.js');
11
11
  var zod = require('zod');
12
12
 
13
13
  var PUBLIC_SCHEMAS = {
14
- Brand: chunkLMD7B33E_js.BrandSchema,
15
- AddItemPayload: chunkLMD7B33E_js.AddItemPayloadSchema,
16
- Cart: chunkLMD7B33E_js.CartSchema,
17
- CartItem: chunkLMD7B33E_js.CartItemSchema,
18
- CartPricing: chunkLMD7B33E_js.CartPricingSchema,
19
- CheckoutBody: chunkLMD7B33E_js.CheckoutBodySchema,
20
- CheckoutResponse: chunkLMD7B33E_js.CheckoutResponseSchema,
21
- VariantInfo: chunkLMD7B33E_js.VariantInfoSchema
14
+ Brand: chunkBSZJSR62_js.BrandSchema,
15
+ AddItemPayload: chunkBSZJSR62_js.AddItemPayloadSchema,
16
+ Cart: chunkBSZJSR62_js.CartSchema,
17
+ CartItem: chunkBSZJSR62_js.CartItemSchema,
18
+ CartPricing: chunkBSZJSR62_js.CartPricingSchema,
19
+ CheckoutBody: chunkBSZJSR62_js.CheckoutBodySchema,
20
+ CheckoutResponse: chunkBSZJSR62_js.CheckoutResponseSchema,
21
+ VariantInfo: chunkBSZJSR62_js.VariantInfoSchema
22
22
  };
23
23
  function exportJsonSchemas() {
24
24
  const out = {};
25
25
  for (const [name, schema] of Object.entries(PUBLIC_SCHEMAS)) {
26
- const meta = chunkLMD7B33E_js.cimplifyRegistry.get(schema);
27
- const json = zod.z.toJSONSchema(schema, { metadata: chunkLMD7B33E_js.cimplifyRegistry });
26
+ const meta = chunkBSZJSR62_js.cimplifyRegistry.get(schema);
27
+ const json = zod.z.toJSONSchema(schema, { metadata: chunkBSZJSR62_js.cimplifyRegistry });
28
28
  if (meta) {
29
29
  json.$id = meta.id;
30
30
  json["x-cimplify-version"] = meta.version;
@@ -36,16 +36,16 @@ function exportJsonSchemas() {
36
36
  function listRegisteredSchemas() {
37
37
  const entries = [];
38
38
  for (const schema of [
39
- chunkLMD7B33E_js.BrandSchema,
40
- chunkLMD7B33E_js.AddItemPayloadSchema,
41
- chunkLMD7B33E_js.CartSchema,
42
- chunkLMD7B33E_js.CartItemSchema,
43
- chunkLMD7B33E_js.CartPricingSchema,
44
- chunkLMD7B33E_js.CheckoutBodySchema,
45
- chunkLMD7B33E_js.CheckoutResponseSchema,
46
- chunkLMD7B33E_js.VariantInfoSchema
39
+ chunkBSZJSR62_js.BrandSchema,
40
+ chunkBSZJSR62_js.AddItemPayloadSchema,
41
+ chunkBSZJSR62_js.CartSchema,
42
+ chunkBSZJSR62_js.CartItemSchema,
43
+ chunkBSZJSR62_js.CartPricingSchema,
44
+ chunkBSZJSR62_js.CheckoutBodySchema,
45
+ chunkBSZJSR62_js.CheckoutResponseSchema,
46
+ chunkBSZJSR62_js.VariantInfoSchema
47
47
  ]) {
48
- const meta = chunkLMD7B33E_js.cimplifyRegistry.get(schema);
48
+ const meta = chunkBSZJSR62_js.cimplifyRegistry.get(schema);
49
49
  if (meta) entries.push({ schema, meta });
50
50
  }
51
51
  return entries;
@@ -53,227 +53,227 @@ function listRegisteredSchemas() {
53
53
 
54
54
  Object.defineProperty(exports, "AddItemPayloadSchema", {
55
55
  enumerable: true,
56
- get: function () { return chunkLMD7B33E_js.AddItemPayloadSchema; }
56
+ get: function () { return chunkBSZJSR62_js.AddItemPayloadSchema; }
57
57
  });
58
58
  Object.defineProperty(exports, "AddOnDetailsSchema", {
59
59
  enumerable: true,
60
- get: function () { return chunkLMD7B33E_js.AddOnDetailsSchema; }
60
+ get: function () { return chunkBSZJSR62_js.AddOnDetailsSchema; }
61
61
  });
62
62
  Object.defineProperty(exports, "AddOnGroupDetailsSchema", {
63
63
  enumerable: true,
64
- get: function () { return chunkLMD7B33E_js.AddOnGroupDetailsSchema; }
64
+ get: function () { return chunkBSZJSR62_js.AddOnGroupDetailsSchema; }
65
65
  });
66
66
  Object.defineProperty(exports, "AddOnInDetailsSchema", {
67
67
  enumerable: true,
68
- get: function () { return chunkLMD7B33E_js.AddOnInDetailsSchema; }
68
+ get: function () { return chunkBSZJSR62_js.AddOnInDetailsSchema; }
69
69
  });
70
70
  Object.defineProperty(exports, "AddOnOptionDetailsSchema", {
71
71
  enumerable: true,
72
- get: function () { return chunkLMD7B33E_js.AddOnOptionDetailsSchema; }
72
+ get: function () { return chunkBSZJSR62_js.AddOnOptionDetailsSchema; }
73
73
  });
74
74
  Object.defineProperty(exports, "AuthorizationTypeSchema", {
75
75
  enumerable: true,
76
- get: function () { return chunkLMD7B33E_js.AuthorizationTypeSchema; }
76
+ get: function () { return chunkBSZJSR62_js.AuthorizationTypeSchema; }
77
77
  });
78
78
  Object.defineProperty(exports, "BrandContactSchema", {
79
79
  enumerable: true,
80
- get: function () { return chunkLMD7B33E_js.BrandContactSchema; }
80
+ get: function () { return chunkBSZJSR62_js.BrandContactSchema; }
81
81
  });
82
82
  Object.defineProperty(exports, "BrandFaqSchema", {
83
83
  enumerable: true,
84
- get: function () { return chunkLMD7B33E_js.BrandFaqSchema; }
84
+ get: function () { return chunkBSZJSR62_js.BrandFaqSchema; }
85
85
  });
86
86
  Object.defineProperty(exports, "BrandHeroSchema", {
87
87
  enumerable: true,
88
- get: function () { return chunkLMD7B33E_js.BrandHeroSchema; }
88
+ get: function () { return chunkBSZJSR62_js.BrandHeroSchema; }
89
89
  });
90
90
  Object.defineProperty(exports, "BrandNavLinkSchema", {
91
91
  enumerable: true,
92
- get: function () { return chunkLMD7B33E_js.BrandNavLinkSchema; }
92
+ get: function () { return chunkBSZJSR62_js.BrandNavLinkSchema; }
93
93
  });
94
94
  Object.defineProperty(exports, "BrandPolicyPageSchema", {
95
95
  enumerable: true,
96
- get: function () { return chunkLMD7B33E_js.BrandPolicyPageSchema; }
96
+ get: function () { return chunkBSZJSR62_js.BrandPolicyPageSchema; }
97
97
  });
98
98
  Object.defineProperty(exports, "BrandPolicySectionSchema", {
99
99
  enumerable: true,
100
- get: function () { return chunkLMD7B33E_js.BrandPolicySectionSchema; }
100
+ get: function () { return chunkBSZJSR62_js.BrandPolicySectionSchema; }
101
101
  });
102
102
  Object.defineProperty(exports, "BrandSchema", {
103
103
  enumerable: true,
104
- get: function () { return chunkLMD7B33E_js.BrandSchema; }
104
+ get: function () { return chunkBSZJSR62_js.BrandSchema; }
105
105
  });
106
106
  Object.defineProperty(exports, "BrandSocialSchema", {
107
107
  enumerable: true,
108
- get: function () { return chunkLMD7B33E_js.BrandSocialSchema; }
108
+ get: function () { return chunkBSZJSR62_js.BrandSocialSchema; }
109
109
  });
110
110
  Object.defineProperty(exports, "BundleResolvedSchema", {
111
111
  enumerable: true,
112
- get: function () { return chunkLMD7B33E_js.BundleResolvedSchema; }
112
+ get: function () { return chunkBSZJSR62_js.BundleResolvedSchema; }
113
113
  });
114
114
  Object.defineProperty(exports, "BundleSelectionInputSchema", {
115
115
  enumerable: true,
116
- get: function () { return chunkLMD7B33E_js.BundleSelectionInputSchema; }
116
+ get: function () { return chunkBSZJSR62_js.BundleSelectionInputSchema; }
117
117
  });
118
118
  Object.defineProperty(exports, "CartItemSchema", {
119
119
  enumerable: true,
120
- get: function () { return chunkLMD7B33E_js.CartItemSchema; }
120
+ get: function () { return chunkBSZJSR62_js.CartItemSchema; }
121
121
  });
122
122
  Object.defineProperty(exports, "CartPricingSchema", {
123
123
  enumerable: true,
124
- get: function () { return chunkLMD7B33E_js.CartPricingSchema; }
124
+ get: function () { return chunkBSZJSR62_js.CartPricingSchema; }
125
125
  });
126
126
  Object.defineProperty(exports, "CartSchema", {
127
127
  enumerable: true,
128
- get: function () { return chunkLMD7B33E_js.CartSchema; }
128
+ get: function () { return chunkBSZJSR62_js.CartSchema; }
129
129
  });
130
130
  Object.defineProperty(exports, "CheckoutBodySchema", {
131
131
  enumerable: true,
132
- get: function () { return chunkLMD7B33E_js.CheckoutBodySchema; }
132
+ get: function () { return chunkBSZJSR62_js.CheckoutBodySchema; }
133
133
  });
134
134
  Object.defineProperty(exports, "CheckoutCustomerSchema", {
135
135
  enumerable: true,
136
- get: function () { return chunkLMD7B33E_js.CheckoutCustomerSchema; }
136
+ get: function () { return chunkBSZJSR62_js.CheckoutCustomerSchema; }
137
137
  });
138
138
  Object.defineProperty(exports, "CheckoutResponseSchema", {
139
139
  enumerable: true,
140
- get: function () { return chunkLMD7B33E_js.CheckoutResponseSchema; }
140
+ get: function () { return chunkBSZJSR62_js.CheckoutResponseSchema; }
141
141
  });
142
142
  Object.defineProperty(exports, "ChosenPriceSchema", {
143
143
  enumerable: true,
144
- get: function () { return chunkLMD7B33E_js.ChosenPriceSchema; }
144
+ get: function () { return chunkBSZJSR62_js.ChosenPriceSchema; }
145
145
  });
146
146
  Object.defineProperty(exports, "CompositeResolvedSchema", {
147
147
  enumerable: true,
148
- get: function () { return chunkLMD7B33E_js.CompositeResolvedSchema; }
148
+ get: function () { return chunkBSZJSR62_js.CompositeResolvedSchema; }
149
149
  });
150
150
  Object.defineProperty(exports, "CompositeSelectionInputSchema", {
151
151
  enumerable: true,
152
- get: function () { return chunkLMD7B33E_js.CompositeSelectionInputSchema; }
152
+ get: function () { return chunkBSZJSR62_js.CompositeSelectionInputSchema; }
153
153
  });
154
154
  Object.defineProperty(exports, "CountryCodeSchema", {
155
155
  enumerable: true,
156
- get: function () { return chunkLMD7B33E_js.CountryCodeSchema; }
156
+ get: function () { return chunkBSZJSR62_js.CountryCodeSchema; }
157
157
  });
158
158
  Object.defineProperty(exports, "CurrencyCodeSchema", {
159
159
  enumerable: true,
160
- get: function () { return chunkLMD7B33E_js.CurrencyCodeSchema; }
160
+ get: function () { return chunkBSZJSR62_js.CurrencyCodeSchema; }
161
161
  });
162
162
  Object.defineProperty(exports, "CustomerInputValueSchema", {
163
163
  enumerable: true,
164
- get: function () { return chunkLMD7B33E_js.CustomerInputValueSchema; }
164
+ get: function () { return chunkBSZJSR62_js.CustomerInputValueSchema; }
165
165
  });
166
166
  Object.defineProperty(exports, "DiscountDetailsSchema", {
167
167
  enumerable: true,
168
- get: function () { return chunkLMD7B33E_js.DiscountDetailsSchema; }
168
+ get: function () { return chunkBSZJSR62_js.DiscountDetailsSchema; }
169
169
  });
170
170
  Object.defineProperty(exports, "IsoDateTimeSchema", {
171
171
  enumerable: true,
172
- get: function () { return chunkLMD7B33E_js.IsoDateTimeSchema; }
172
+ get: function () { return chunkBSZJSR62_js.IsoDateTimeSchema; }
173
173
  });
174
174
  Object.defineProperty(exports, "LineTypeSchema", {
175
175
  enumerable: true,
176
- get: function () { return chunkLMD7B33E_js.LineTypeSchema; }
176
+ get: function () { return chunkBSZJSR62_js.LineTypeSchema; }
177
177
  });
178
178
  Object.defineProperty(exports, "LocaleSchema", {
179
179
  enumerable: true,
180
- get: function () { return chunkLMD7B33E_js.LocaleSchema; }
180
+ get: function () { return chunkBSZJSR62_js.LocaleSchema; }
181
181
  });
182
182
  Object.defineProperty(exports, "MoneyLooseSchema", {
183
183
  enumerable: true,
184
- get: function () { return chunkLMD7B33E_js.MoneyLooseSchema; }
184
+ get: function () { return chunkBSZJSR62_js.MoneyLooseSchema; }
185
185
  });
186
186
  Object.defineProperty(exports, "MoneySchema", {
187
187
  enumerable: true,
188
- get: function () { return chunkLMD7B33E_js.MoneySchema; }
188
+ get: function () { return chunkBSZJSR62_js.MoneySchema; }
189
189
  });
190
190
  Object.defineProperty(exports, "NextActionSchema", {
191
191
  enumerable: true,
192
- get: function () { return chunkLMD7B33E_js.NextActionSchema; }
192
+ get: function () { return chunkBSZJSR62_js.NextActionSchema; }
193
193
  });
194
194
  Object.defineProperty(exports, "PhoneE164Schema", {
195
195
  enumerable: true,
196
- get: function () { return chunkLMD7B33E_js.PhoneE164Schema; }
196
+ get: function () { return chunkBSZJSR62_js.PhoneE164Schema; }
197
197
  });
198
198
  Object.defineProperty(exports, "ProductTypeSchema", {
199
199
  enumerable: true,
200
- get: function () { return chunkLMD7B33E_js.ProductTypeSchema; }
200
+ get: function () { return chunkBSZJSR62_js.ProductTypeSchema; }
201
201
  });
202
202
  Object.defineProperty(exports, "SchemaViolationError", {
203
203
  enumerable: true,
204
- get: function () { return chunkLMD7B33E_js.SchemaViolationError; }
204
+ get: function () { return chunkBSZJSR62_js.SchemaViolationError; }
205
205
  });
206
206
  Object.defineProperty(exports, "SeedNameSchema", {
207
207
  enumerable: true,
208
- get: function () { return chunkLMD7B33E_js.SeedNameSchema; }
208
+ get: function () { return chunkBSZJSR62_js.SeedNameSchema; }
209
209
  });
210
210
  Object.defineProperty(exports, "SelectedAddOnOptionSchema", {
211
211
  enumerable: true,
212
- get: function () { return chunkLMD7B33E_js.SelectedAddOnOptionSchema; }
212
+ get: function () { return chunkBSZJSR62_js.SelectedAddOnOptionSchema; }
213
213
  });
214
214
  Object.defineProperty(exports, "ServiceStatusSchema", {
215
215
  enumerable: true,
216
- get: function () { return chunkLMD7B33E_js.ServiceStatusSchema; }
216
+ get: function () { return chunkBSZJSR62_js.ServiceStatusSchema; }
217
217
  });
218
218
  Object.defineProperty(exports, "TimestampSchema", {
219
219
  enumerable: true,
220
- get: function () { return chunkLMD7B33E_js.TimestampSchema; }
220
+ get: function () { return chunkBSZJSR62_js.TimestampSchema; }
221
221
  });
222
222
  Object.defineProperty(exports, "VariantDetailsSchema", {
223
223
  enumerable: true,
224
- get: function () { return chunkLMD7B33E_js.VariantDetailsSchema; }
224
+ get: function () { return chunkBSZJSR62_js.VariantDetailsSchema; }
225
225
  });
226
226
  Object.defineProperty(exports, "VariantDisplayAttributeSchema", {
227
227
  enumerable: true,
228
- get: function () { return chunkLMD7B33E_js.VariantDisplayAttributeSchema; }
228
+ get: function () { return chunkBSZJSR62_js.VariantDisplayAttributeSchema; }
229
229
  });
230
230
  Object.defineProperty(exports, "VariantInfoSchema", {
231
231
  enumerable: true,
232
- get: function () { return chunkLMD7B33E_js.VariantInfoSchema; }
232
+ get: function () { return chunkBSZJSR62_js.VariantInfoSchema; }
233
233
  });
234
234
  Object.defineProperty(exports, "assertAddItemPayload", {
235
235
  enumerable: true,
236
- get: function () { return chunkLMD7B33E_js.assertAddItemPayload; }
236
+ get: function () { return chunkBSZJSR62_js.assertAddItemPayload; }
237
237
  });
238
238
  Object.defineProperty(exports, "assertBrand", {
239
239
  enumerable: true,
240
- get: function () { return chunkLMD7B33E_js.assertBrand; }
240
+ get: function () { return chunkBSZJSR62_js.assertBrand; }
241
241
  });
242
242
  Object.defineProperty(exports, "assertCart", {
243
243
  enumerable: true,
244
- get: function () { return chunkLMD7B33E_js.assertCart; }
244
+ get: function () { return chunkBSZJSR62_js.assertCart; }
245
245
  });
246
246
  Object.defineProperty(exports, "assertCartItem", {
247
247
  enumerable: true,
248
- get: function () { return chunkLMD7B33E_js.assertCartItem; }
248
+ get: function () { return chunkBSZJSR62_js.assertCartItem; }
249
249
  });
250
250
  Object.defineProperty(exports, "assertCheckoutBody", {
251
251
  enumerable: true,
252
- get: function () { return chunkLMD7B33E_js.assertCheckoutBody; }
252
+ get: function () { return chunkBSZJSR62_js.assertCheckoutBody; }
253
253
  });
254
254
  Object.defineProperty(exports, "assertCheckoutResponse", {
255
255
  enumerable: true,
256
- get: function () { return chunkLMD7B33E_js.assertCheckoutResponse; }
256
+ get: function () { return chunkBSZJSR62_js.assertCheckoutResponse; }
257
257
  });
258
258
  Object.defineProperty(exports, "cimplifyRegistry", {
259
259
  enumerable: true,
260
- get: function () { return chunkLMD7B33E_js.cimplifyRegistry; }
260
+ get: function () { return chunkBSZJSR62_js.cimplifyRegistry; }
261
261
  });
262
262
  Object.defineProperty(exports, "createTestClient", {
263
263
  enumerable: true,
264
- get: function () { return chunkLMD7B33E_js.createTestClient; }
264
+ get: function () { return chunkBSZJSR62_js.createTestClient; }
265
265
  });
266
266
  Object.defineProperty(exports, "fixtures", {
267
267
  enumerable: true,
268
- get: function () { return chunkLMD7B33E_js.fixtures; }
268
+ get: function () { return chunkBSZJSR62_js.fixtures; }
269
269
  });
270
270
  Object.defineProperty(exports, "makeAssertion", {
271
271
  enumerable: true,
272
- get: function () { return chunkLMD7B33E_js.makeAssertion; }
272
+ get: function () { return chunkBSZJSR62_js.makeAssertion; }
273
273
  });
274
274
  Object.defineProperty(exports, "registerSchema", {
275
275
  enumerable: true,
276
- get: function () { return chunkLMD7B33E_js.registerSchema; }
276
+ get: function () { return chunkBSZJSR62_js.registerSchema; }
277
277
  });
278
278
  exports.exportJsonSchemas = exportJsonSchemas;
279
279
  exports.listRegisteredSchemas = listRegisteredSchemas;
package/dist/testing.mjs CHANGED
@@ -1,8 +1,8 @@
1
- import { VariantInfoSchema, CheckoutResponseSchema, CheckoutBodySchema, CartPricingSchema, CartItemSchema, CartSchema, AddItemPayloadSchema, BrandSchema, cimplifyRegistry } from './chunk-HSDQWJLA.mjs';
2
- export { AddItemPayloadSchema, AddOnDetailsSchema, AddOnGroupDetailsSchema, AddOnInDetailsSchema, AddOnOptionDetailsSchema, AuthorizationTypeSchema, BrandContactSchema, BrandFaqSchema, BrandHeroSchema, BrandNavLinkSchema, BrandPolicyPageSchema, BrandPolicySectionSchema, BrandSchema, BrandSocialSchema, BundleResolvedSchema, BundleSelectionInputSchema, CartItemSchema, CartPricingSchema, CartSchema, CheckoutBodySchema, CheckoutCustomerSchema, CheckoutResponseSchema, ChosenPriceSchema, CompositeResolvedSchema, CompositeSelectionInputSchema, CountryCodeSchema, CurrencyCodeSchema, CustomerInputValueSchema, DiscountDetailsSchema, IsoDateTimeSchema, LineTypeSchema, LocaleSchema, MoneyLooseSchema, MoneySchema, NextActionSchema, PhoneE164Schema, ProductTypeSchema, SchemaViolationError, SeedNameSchema, SelectedAddOnOptionSchema, ServiceStatusSchema, TimestampSchema, VariantDetailsSchema, VariantDisplayAttributeSchema, VariantInfoSchema, assertAddItemPayload, assertBrand, assertCart, assertCartItem, assertCheckoutBody, assertCheckoutResponse, cimplifyRegistry, createTestClient, fixtures, makeAssertion, registerSchema } from './chunk-HSDQWJLA.mjs';
1
+ import { VariantInfoSchema, CheckoutResponseSchema, CheckoutBodySchema, CartPricingSchema, CartItemSchema, CartSchema, AddItemPayloadSchema, BrandSchema, cimplifyRegistry } from './chunk-KLJLKT6C.mjs';
2
+ export { AddItemPayloadSchema, AddOnDetailsSchema, AddOnGroupDetailsSchema, AddOnInDetailsSchema, AddOnOptionDetailsSchema, AuthorizationTypeSchema, BrandContactSchema, BrandFaqSchema, BrandHeroSchema, BrandNavLinkSchema, BrandPolicyPageSchema, BrandPolicySectionSchema, BrandSchema, BrandSocialSchema, BundleResolvedSchema, BundleSelectionInputSchema, CartItemSchema, CartPricingSchema, CartSchema, CheckoutBodySchema, CheckoutCustomerSchema, CheckoutResponseSchema, ChosenPriceSchema, CompositeResolvedSchema, CompositeSelectionInputSchema, CountryCodeSchema, CurrencyCodeSchema, CustomerInputValueSchema, DiscountDetailsSchema, IsoDateTimeSchema, LineTypeSchema, LocaleSchema, MoneyLooseSchema, MoneySchema, NextActionSchema, PhoneE164Schema, ProductTypeSchema, SchemaViolationError, SeedNameSchema, SelectedAddOnOptionSchema, ServiceStatusSchema, TimestampSchema, VariantDetailsSchema, VariantDisplayAttributeSchema, VariantInfoSchema, assertAddItemPayload, assertBrand, assertCart, assertCartItem, assertCheckoutBody, assertCheckoutResponse, cimplifyRegistry, createTestClient, fixtures, makeAssertion, registerSchema } from './chunk-KLJLKT6C.mjs';
3
3
  import './chunk-RQPXLXB2.mjs';
4
4
  import './chunk-U4MW6PYU.mjs';
5
- import './chunk-RWR7JF7F.mjs';
5
+ import './chunk-BMFWQNYZ.mjs';
6
6
  import './chunk-Z7M6GAHS.mjs';
7
7
  import './chunk-DLW3RWRK.mjs';
8
8
  import './chunk-O3YUHLZL.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cimplify/sdk",
3
- "version": "0.100.5",
3
+ "version": "0.100.6",
4
4
  "description": "Cimplify Commerce SDK for storefronts",
5
5
  "keywords": [
6
6
  "cimplify",