@cimplify/sdk 0.107.0 → 0.107.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 (64) hide show
  1. package/dist/advanced.d.mts +3 -3
  2. package/dist/advanced.d.ts +3 -3
  3. package/dist/advanced.js +22 -22
  4. package/dist/advanced.mjs +3 -3
  5. package/dist/{catalogue-C4xKpirp.d.ts → catalogue-AmW4XjaN.d.ts} +2 -1
  6. package/dist/{catalogue-BohD-jU_.d.mts → catalogue-rWd71Xi-.d.mts} +2 -1
  7. package/dist/{chunk-AVXA4F6G.js → chunk-ANT574FD.js} +29 -0
  8. package/dist/{chunk-W4ZFZPPY.js → chunk-CEML2737.js} +152 -147
  9. package/dist/{chunk-NYDVVNZI.mjs → chunk-JRGK3NXR.mjs} +1 -1
  10. package/dist/{chunk-NJYR6GGM.mjs → chunk-KG3WT4PR.mjs} +29 -1
  11. package/dist/{chunk-IWZKCL3P.mjs → chunk-NZMU7UUA.mjs} +3 -3
  12. package/dist/{chunk-HKCB73AJ.js → chunk-ONII7K3T.js} +177 -177
  13. package/dist/{chunk-2I6YKE6Q.mjs → chunk-OTPLI3JY.mjs} +2 -2
  14. package/dist/{chunk-P4HYAV3L.mjs → chunk-T4OU77DM.mjs} +7 -2
  15. package/dist/{chunk-73HY36Z7.js → chunk-THSYGWUA.js} +70 -70
  16. package/dist/{chunk-NX5YBQZP.js → chunk-UVRPC2P7.js} +73 -62
  17. package/dist/{chunk-UYFTOIFW.js → chunk-V32BCG7M.js} +6 -6
  18. package/dist/{chunk-MKZXZDHE.mjs → chunk-XBL3TMPC.mjs} +14 -3
  19. package/dist/{client-BBFfAtn4.d.mts → client-DlTJ2hUM.d.mts} +2 -2
  20. package/dist/{client-ByURQZM9.d.ts → client-ni-CfOSO.d.ts} +2 -2
  21. package/dist/{elements-Dtqe9Ekd.d.mts → elements-BF1Y4aOi.d.mts} +92 -6
  22. package/dist/{elements-Dtqe9Ekd.d.ts → elements-BF1Y4aOi.d.ts} +92 -6
  23. package/dist/{index-DFqDU6yU.d.ts → index-CZ0bJm6k.d.ts} +2 -2
  24. package/dist/{index-B6mukQYB.d.mts → index-DML_W635.d.mts} +2 -2
  25. package/dist/{index-CvLuAMjQ.d.ts → index-DU7vffby.d.ts} +2 -2
  26. package/dist/{index-7oz-hVVA.d.mts → index-DopYJKDL.d.mts} +2 -2
  27. package/dist/index.d.mts +7 -7
  28. package/dist/index.d.ts +7 -7
  29. package/dist/index.js +156 -152
  30. package/dist/index.mjs +5 -5
  31. package/dist/mock/cli.mjs +16 -2
  32. package/dist/mock/library.js +16 -2
  33. package/dist/mock/library.mjs +16 -2
  34. package/dist/mock/msw.js +16 -2
  35. package/dist/mock/msw.mjs +16 -2
  36. package/dist/{price-B4jL81ef.d.ts → price-B5t2mpsE.d.ts} +1 -1
  37. package/dist/{price-Pyq-vlrm.d.mts → price-DI_U5oXU.d.mts} +1 -1
  38. package/dist/react.d.mts +3 -3
  39. package/dist/react.d.ts +3 -3
  40. package/dist/react.js +151 -151
  41. package/dist/react.mjs +4 -4
  42. package/dist/{server-Cowuvfbr.d.ts → server-BItJAUTD.d.ts} +1 -1
  43. package/dist/{server-KilvZJU0.d.mts → server-Dq70vD7z.d.mts} +1 -1
  44. package/dist/server.d.mts +3 -3
  45. package/dist/server.d.ts +3 -3
  46. package/dist/server.js +10 -10
  47. package/dist/server.mjs +4 -4
  48. package/dist/testing/msw.d.mts +2 -2
  49. package/dist/testing/msw.d.ts +2 -2
  50. package/dist/testing/msw.js +3 -3
  51. package/dist/testing/msw.mjs +2 -2
  52. package/dist/testing/suite.d.mts +5 -5
  53. package/dist/testing/suite.d.ts +5 -5
  54. package/dist/testing/suite.js +26 -26
  55. package/dist/testing/suite.mjs +6 -6
  56. package/dist/testing.d.mts +4 -4
  57. package/dist/testing.d.ts +4 -4
  58. package/dist/testing.js +118 -118
  59. package/dist/testing.mjs +7 -7
  60. package/dist/utils.d.mts +3 -3
  61. package/dist/utils.d.ts +3 -3
  62. package/dist/utils.js +32 -32
  63. package/dist/utils.mjs +2 -2
  64. package/package.json +1 -1
package/dist/react.mjs CHANGED
@@ -1,13 +1,13 @@
1
1
  "use client";
2
2
  import { DURATION_UNIT, getVariantDisplayName, INPUT_FIELD_TYPE, isMultiDayService, serviceBillingMultiplier, PRODUCT_TYPE, BOUNDARY_KIND, resolveGallery, chatMessageCards, RENDER_HINT, displaysGrossPrices, DEFAULT_CDN_BASE_URL } from './chunk-3V4DVXV3.mjs';
3
3
  export { getVariantDisplayName } from './chunk-3V4DVXV3.mjs';
4
- import { chatRealtimeUpdateFromWire, createCimplifyClient } from './chunk-P4HYAV3L.mjs';
4
+ import { chatRealtimeUpdateFromWire, createCimplifyClient } from './chunk-T4OU77DM.mjs';
5
5
  import { splitGenUIContent, messagePreview } from './chunk-U4MW6PYU.mjs';
6
6
  export { messagePreview, splitGenUIContent } from './chunk-U4MW6PYU.mjs';
7
- import { ELEMENT_TYPES, EVENT_TYPES, SESSION_CLAIMED, SESSION_CLEARED, generateIdempotencyKey, startSignIn, AUTH_TOKEN_CHANGED, MUTATION_ERROR } from './chunk-2I6YKE6Q.mjs';
7
+ import { ELEMENT_TYPES, EVENT_TYPES, SESSION_CLAIMED, SESSION_CLEARED, generateIdempotencyKey, startSignIn, AUTH_TOKEN_CHANGED, MUTATION_ERROR } from './chunk-OTPLI3JY.mjs';
8
8
  import { ORDER_TYPE, CHECKOUT_STATUS } from './chunk-33VCYWVL.mjs';
9
- import { parsePrice, formatMoney, formatPrice, getVariantUnitPrice, getProductCurrency, getUnitPriceAtQuantity, isOnSale, getDiscountPercentage, getBasePrice, getPriceRange, formatPriceRange } from './chunk-NYDVVNZI.mjs';
10
- import { isSupportedCurrency, ErrorCode, currencyCode, CimplifyError } from './chunk-NJYR6GGM.mjs';
9
+ import { parsePrice, formatMoney, formatPrice, getVariantUnitPrice, getProductCurrency, getUnitPriceAtQuantity, isOnSale, getDiscountPercentage, getBasePrice, getPriceRange, formatPriceRange } from './chunk-JRGK3NXR.mjs';
10
+ import { isSupportedCurrency, ErrorCode, currencyCode, CimplifyError } from './chunk-KG3WT4PR.mjs';
11
11
  import './chunk-3G6RQLXK.mjs';
12
12
  import React14, { createContext, lazy, memo, Suspense, useMemo, useContext, useRef, useCallback, useState, useEffect, useId, useSyncExternalStore } from 'react';
13
13
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -1,5 +1,5 @@
1
1
  import { Hono } from 'hono';
2
- import { dR as ProductInputField, ee as PurchaseIntentView, cD as MintPurchaseIntentRequest, bi as ConfirmPurchaseIntentResponse, ey as SubmitAuthorizationInput, ab as CHECKOUT_NEXT_ACTION, i as ConfirmPurchaseIntentRequest, ez as SubmitPurchaseIntentActionRequest } from './elements-Dtqe9Ekd.js';
2
+ import { dR as ProductInputField, ee as PurchaseIntentView, cD as MintPurchaseIntentRequest, bi as ConfirmPurchaseIntentResponse, eA as SubmitAuthorizationInput, ab as CHECKOUT_NEXT_ACTION, i as ConfirmPurchaseIntentRequest, eB as SubmitPurchaseIntentActionRequest } from './elements-BF1Y4aOi.js';
3
3
 
4
4
  interface Clock {
5
5
  now(): Date;
@@ -1,5 +1,5 @@
1
1
  import { Hono } from 'hono';
2
- import { dR as ProductInputField, ee as PurchaseIntentView, cD as MintPurchaseIntentRequest, bi as ConfirmPurchaseIntentResponse, ey as SubmitAuthorizationInput, ab as CHECKOUT_NEXT_ACTION, i as ConfirmPurchaseIntentRequest, ez as SubmitPurchaseIntentActionRequest } from './elements-Dtqe9Ekd.mjs';
2
+ import { dR as ProductInputField, ee as PurchaseIntentView, cD as MintPurchaseIntentRequest, bi as ConfirmPurchaseIntentResponse, eA as SubmitAuthorizationInput, ab as CHECKOUT_NEXT_ACTION, i as ConfirmPurchaseIntentRequest, eB as SubmitPurchaseIntentActionRequest } from './elements-BF1Y4aOi.mjs';
3
3
 
4
4
  interface Clock {
5
5
  now(): Date;
package/dist/server.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- import { C as CimplifyClient } from './catalogue-BohD-jU_.mjs';
2
- export { a as CacheOptions, R as ReadRequestOptions, b as Result } from './catalogue-BohD-jU_.mjs';
3
- export { b as Category, c as CimplifyError, d as Collection, P as Product, e as ProductWithDetails } from './elements-Dtqe9Ekd.mjs';
1
+ import { C as CimplifyClient } from './catalogue-rWd71Xi-.mjs';
2
+ export { a as CacheOptions, R as ReadRequestOptions, b as Result } from './catalogue-rWd71Xi-.mjs';
3
+ export { b as Category, c as CimplifyError, d as Collection, P as Product, e as ProductWithDetails } from './elements-BF1Y4aOi.mjs';
4
4
  import { JWTVerifyResult } from 'jose';
5
5
 
6
6
  interface ServerClientOptions {
package/dist/server.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { C as CimplifyClient } from './catalogue-C4xKpirp.js';
2
- export { a as CacheOptions, R as ReadRequestOptions, b as Result } from './catalogue-C4xKpirp.js';
3
- export { b as Category, c as CimplifyError, d as Collection, P as Product, e as ProductWithDetails } from './elements-Dtqe9Ekd.js';
1
+ import { C as CimplifyClient } from './catalogue-AmW4XjaN.js';
2
+ export { a as CacheOptions, R as ReadRequestOptions, b as Result } from './catalogue-AmW4XjaN.js';
3
+ export { b as Category, c as CimplifyError, d as Collection, P as Product, e as ProductWithDetails } from './elements-BF1Y4aOi.js';
4
4
  import { JWTVerifyResult } from 'jose';
5
5
 
6
6
  interface ServerClientOptions {
package/dist/server.js CHANGED
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- var chunkW4ZFZPPY_js = require('./chunk-W4ZFZPPY.js');
3
+ var chunkCEML2737_js = require('./chunk-CEML2737.js');
4
4
  require('./chunk-XREIZ56K.js');
5
- var chunkHKCB73AJ_js = require('./chunk-HKCB73AJ.js');
5
+ var chunkONII7K3T_js = require('./chunk-ONII7K3T.js');
6
6
  require('./chunk-EV2EVOYS.js');
7
- require('./chunk-UYFTOIFW.js');
8
- var chunkAVXA4F6G_js = require('./chunk-AVXA4F6G.js');
7
+ require('./chunk-V32BCG7M.js');
8
+ var chunkANT574FD_js = require('./chunk-ANT574FD.js');
9
9
  require('./chunk-OWW5GUSB.js');
10
10
  var react = require('react');
11
11
  var jose = require('jose');
@@ -28,7 +28,7 @@ function readEnv(...keys) {
28
28
  var getServerClient = react.cache((opts = {}) => {
29
29
  const baseUrl = opts.apiUrl ?? readEnv("CIMPLIFY_API_URL", "NEXT_PUBLIC_CIMPLIFY_API_URL") ?? defaultBaseUrl();
30
30
  const publicKey = opts.secretKey ?? readEnv("CIMPLIFY_SECRET_KEY", "NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY") ?? "mock-dev";
31
- const client = chunkW4ZFZPPY_js.createCimplifyClient({
31
+ const client = chunkCEML2737_js.createCimplifyClient({
32
32
  baseUrl,
33
33
  publicKey,
34
34
  suppressPublicKeyWarning: true
@@ -252,7 +252,7 @@ var QUERY_AUTH_ERROR = "cimplify_auth_error";
252
252
  var discoveryCache = /* @__PURE__ */ new Map();
253
253
  var jwksCache = /* @__PURE__ */ new Map();
254
254
  function issuerBase(cfg) {
255
- return (cfg.issuer ?? cfg.authUrl ?? chunkHKCB73AJ_js.DEFAULT_ISSUER).replace(/\/$/, "");
255
+ return (cfg.issuer ?? cfg.authUrl ?? chunkONII7K3T_js.DEFAULT_ISSUER).replace(/\/$/, "");
256
256
  }
257
257
  function cookieName(cfg) {
258
258
  return cfg.cookieName ?? SESSION_COOKIE;
@@ -467,12 +467,12 @@ async function handleOidcCallback(req, opts) {
467
467
  }
468
468
  function readPkceCookie(cookieHeader) {
469
469
  if (!cookieHeader) return null;
470
- const match = cookieHeader.split(/;\s*/).find((p) => p.startsWith(`${chunkHKCB73AJ_js.PKCE_COOKIE}=`));
470
+ const match = cookieHeader.split(/;\s*/).find((p) => p.startsWith(`${chunkONII7K3T_js.PKCE_COOKIE}=`));
471
471
  if (!match) return null;
472
- return chunkHKCB73AJ_js.decodePkceState(match.slice(chunkHKCB73AJ_js.PKCE_COOKIE.length + 1));
472
+ return chunkONII7K3T_js.decodePkceState(match.slice(chunkONII7K3T_js.PKCE_COOKIE.length + 1));
473
473
  }
474
474
  function buildPkceClearCookie() {
475
- return `${chunkHKCB73AJ_js.PKCE_COOKIE}=; Path=${chunkHKCB73AJ_js.PKCE_COOKIE_PATH}; Max-Age=0; Secure; SameSite=Lax`;
475
+ return `${chunkONII7K3T_js.PKCE_COOKIE}=; Path=${chunkONII7K3T_js.PKCE_COOKIE_PATH}; Max-Age=0; Secure; SameSite=Lax`;
476
476
  }
477
477
  function safeReturnPath(returnTo, fallback) {
478
478
  if (returnTo && returnTo.startsWith("/") && !returnTo.startsWith("//")) return returnTo;
@@ -644,7 +644,7 @@ async function handleTokenRefresh(req, cfg) {
644
644
 
645
645
  Object.defineProperty(exports, "CimplifyError", {
646
646
  enumerable: true,
647
- get: function () { return chunkAVXA4F6G_js.CimplifyError; }
647
+ get: function () { return chunkANT574FD_js.CimplifyError; }
648
648
  });
649
649
  exports.CACHE_LIFE_DEFAULT = CACHE_LIFE_DEFAULT;
650
650
  exports.CACHE_LIFE_PROBE = CACHE_LIFE_PROBE;
package/dist/server.mjs CHANGED
@@ -1,9 +1,9 @@
1
- import { createCimplifyClient } from './chunk-P4HYAV3L.mjs';
1
+ import { createCimplifyClient } from './chunk-T4OU77DM.mjs';
2
2
  import './chunk-U4MW6PYU.mjs';
3
- import { PKCE_COOKIE, decodePkceState, PKCE_COOKIE_PATH, DEFAULT_ISSUER } from './chunk-2I6YKE6Q.mjs';
3
+ import { PKCE_COOKIE, decodePkceState, PKCE_COOKIE_PATH, DEFAULT_ISSUER } from './chunk-OTPLI3JY.mjs';
4
4
  import './chunk-33VCYWVL.mjs';
5
- import './chunk-NYDVVNZI.mjs';
6
- export { CimplifyError } from './chunk-NJYR6GGM.mjs';
5
+ import './chunk-JRGK3NXR.mjs';
6
+ export { CimplifyError } from './chunk-KG3WT4PR.mjs';
7
7
  import './chunk-3G6RQLXK.mjs';
8
8
  import { cache } from 'react';
9
9
  import { jwtVerify, createRemoteJWKSet } from 'jose';
@@ -1,6 +1,6 @@
1
- import { A as AppHandle, C as CreateAppOptions } from '../server-KilvZJU0.mjs';
1
+ import { A as AppHandle, C as CreateAppOptions } from '../server-Dq70vD7z.mjs';
2
2
  import 'hono';
3
- import '../elements-Dtqe9Ekd.mjs';
3
+ import '../elements-BF1Y4aOi.mjs';
4
4
 
5
5
  interface MswHandlerSetup {
6
6
  handlers: unknown[];
@@ -1,6 +1,6 @@
1
- import { A as AppHandle, C as CreateAppOptions } from '../server-Cowuvfbr.js';
1
+ import { A as AppHandle, C as CreateAppOptions } from '../server-BItJAUTD.js';
2
2
  import 'hono';
3
- import '../elements-Dtqe9Ekd.js';
3
+ import '../elements-BF1Y4aOi.js';
4
4
 
5
5
  interface MswHandlerSetup {
6
6
  handlers: unknown[];
@@ -1,15 +1,15 @@
1
1
  'use strict';
2
2
 
3
- var chunkNX5YBQZP_js = require('../chunk-NX5YBQZP.js');
3
+ var chunkUVRPC2P7_js = require('../chunk-UVRPC2P7.js');
4
4
  require('../chunk-XREIZ56K.js');
5
5
  require('../chunk-EV2EVOYS.js');
6
- require('../chunk-AVXA4F6G.js');
6
+ require('../chunk-ANT574FD.js');
7
7
  require('../chunk-OWW5GUSB.js');
8
8
 
9
9
  // src/mock/msw.ts
10
10
  async function createMswHandlers(options = {}) {
11
11
  const baseUrl = options.baseUrl ?? "http://localhost:8787";
12
- const handle = chunkNX5YBQZP_js.createMockApp(options);
12
+ const handle = chunkUVRPC2P7_js.createMockApp(options);
13
13
  const msw = await import('msw').catch(() => {
14
14
  throw new Error("msw is required to use @cimplify/sdk/mock/msw \u2014 install it as a peer dependency");
15
15
  });
@@ -1,7 +1,7 @@
1
- import { createMockApp } from '../chunk-MKZXZDHE.mjs';
1
+ import { createMockApp } from '../chunk-XBL3TMPC.mjs';
2
2
  import '../chunk-U4MW6PYU.mjs';
3
3
  import '../chunk-33VCYWVL.mjs';
4
- import '../chunk-NJYR6GGM.mjs';
4
+ import '../chunk-KG3WT4PR.mjs';
5
5
  import '../chunk-3G6RQLXK.mjs';
6
6
 
7
7
  // src/mock/msw.ts
@@ -1,9 +1,9 @@
1
1
  import { TestAPI } from 'vitest';
2
- import { T as TestClientHandle } from '../client-BBFfAtn4.mjs';
3
- import { C as CreateAppOptions } from '../server-KilvZJU0.mjs';
4
- export { S as SeedName } from '../server-KilvZJU0.mjs';
5
- import '../catalogue-BohD-jU_.mjs';
6
- import '../elements-Dtqe9Ekd.mjs';
2
+ import { T as TestClientHandle } from '../client-DlTJ2hUM.mjs';
3
+ import { C as CreateAppOptions } from '../server-Dq70vD7z.mjs';
4
+ export { S as SeedName } from '../server-Dq70vD7z.mjs';
5
+ import '../catalogue-rWd71Xi-.mjs';
6
+ import '../elements-BF1Y4aOi.mjs';
7
7
  import 'hono';
8
8
 
9
9
  /**
@@ -1,9 +1,9 @@
1
1
  import { TestAPI } from 'vitest';
2
- import { T as TestClientHandle } from '../client-ByURQZM9.js';
3
- import { C as CreateAppOptions } from '../server-Cowuvfbr.js';
4
- export { S as SeedName } from '../server-Cowuvfbr.js';
5
- import '../catalogue-C4xKpirp.js';
6
- import '../elements-Dtqe9Ekd.js';
2
+ import { T as TestClientHandle } from '../client-ni-CfOSO.js';
3
+ import { C as CreateAppOptions } from '../server-BItJAUTD.js';
4
+ export { S as SeedName } from '../server-BItJAUTD.js';
5
+ import '../catalogue-AmW4XjaN.js';
6
+ import '../elements-BF1Y4aOi.js';
7
7
  import 'hono';
8
8
 
9
9
  /**
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var chunk73HY36Z7_js = require('../chunk-73HY36Z7.js');
4
- require('../chunk-NX5YBQZP.js');
5
- require('../chunk-W4ZFZPPY.js');
3
+ var chunkTHSYGWUA_js = require('../chunk-THSYGWUA.js');
4
+ require('../chunk-UVRPC2P7.js');
5
+ require('../chunk-CEML2737.js');
6
6
  require('../chunk-XREIZ56K.js');
7
- require('../chunk-HKCB73AJ.js');
7
+ require('../chunk-ONII7K3T.js');
8
8
  require('../chunk-EV2EVOYS.js');
9
- require('../chunk-UYFTOIFW.js');
10
- require('../chunk-AVXA4F6G.js');
9
+ require('../chunk-V32BCG7M.js');
10
+ require('../chunk-ANT574FD.js');
11
11
  require('../chunk-OWW5GUSB.js');
12
12
  var vitest = require('vitest');
13
13
 
@@ -22,11 +22,11 @@ var PLACEHOLDER_PHRASES = [
22
22
  function createBrandSuite(opts) {
23
23
  vitest.describe(opts.label ?? "brand schema", () => {
24
24
  vitest.it("conforms to the Cimplify brand contract", () => {
25
- vitest.expect(() => chunk73HY36Z7_js.assertBrand(opts.brand)).not.toThrow();
25
+ vitest.expect(() => chunkTHSYGWUA_js.assertBrand(opts.brand)).not.toThrow();
26
26
  });
27
27
  vitest.it("declares a known mock seed", () => {
28
28
  const b = opts.brand;
29
- vitest.expect(chunk73HY36Z7_js.SeedNameSchema.safeParse(b.mock?.seed).success).toBe(true);
29
+ vitest.expect(chunkTHSYGWUA_js.SeedNameSchema.safeParse(b.mock?.seed).success).toBe(true);
30
30
  });
31
31
  vitest.it("has no placeholder copy left in", () => {
32
32
  const offenders = [];
@@ -58,7 +58,7 @@ ${msg}`);
58
58
  vitest.expect(b.mock?.businessId).toMatch(/^bus_/);
59
59
  });
60
60
  vitest.it("zod-parses cleanly", () => {
61
- const result = chunk73HY36Z7_js.BrandSchema.safeParse(opts.brand);
61
+ const result = chunkTHSYGWUA_js.BrandSchema.safeParse(opts.brand);
62
62
  if (!result.success) {
63
63
  throw new Error(
64
64
  "Brand schema violations:\n" + result.error.issues.map((i) => ` \u2022 brand.${i.path.join(".")}: ${i.message}`).join("\n")
@@ -73,23 +73,23 @@ function createCartFlowSuite(opts = {}) {
73
73
  vitest.describe(opts.label ?? "cart flow against in-process mock", () => {
74
74
  let h;
75
75
  vitest.beforeEach(() => {
76
- h = chunk73HY36Z7_js.createTestClient(opts);
76
+ h = chunkTHSYGWUA_js.createTestClient(opts);
77
77
  });
78
78
  vitest.afterEach(() => h.dispose());
79
79
  vitest.it("starts with an empty cart matching the canonical shape", async () => {
80
80
  const res = await h.client.cart.get();
81
81
  vitest.expect(res.ok).toBe(true);
82
82
  if (!res.ok) return;
83
- vitest.expect(() => chunk73HY36Z7_js.assertCart(res.value)).not.toThrow();
83
+ vitest.expect(() => chunkTHSYGWUA_js.assertCart(res.value)).not.toThrow();
84
84
  vitest.expect(res.value.items).toHaveLength(0);
85
85
  });
86
86
  vitest.it("adds the first product, persists it, and returns a shape-valid cart", async () => {
87
- const { product, variantId } = await chunk73HY36Z7_js.fixtures.addFirstProduct(h.client);
87
+ const { product, variantId } = await chunkTHSYGWUA_js.fixtures.addFirstProduct(h.client);
88
88
  vitest.expect(product.id).toBeTruthy();
89
89
  const get = await h.client.cart.get();
90
90
  vitest.expect(get.ok).toBe(true);
91
91
  if (!get.ok) return;
92
- vitest.expect(() => chunk73HY36Z7_js.assertCart(get.value)).not.toThrow();
92
+ vitest.expect(() => chunkTHSYGWUA_js.assertCart(get.value)).not.toThrow();
93
93
  vitest.expect(get.value.items).toHaveLength(1);
94
94
  vitest.expect(get.value.items[0]?.item_id).toBe(product.id);
95
95
  if (variantId) {
@@ -100,8 +100,8 @@ function createCartFlowSuite(opts = {}) {
100
100
  vitest.expect(parseFloat(String(get.value.pricing.subtotal))).toBeGreaterThan(0);
101
101
  });
102
102
  vitest.it("dedupes by line_key when adding the same product twice", async () => {
103
- await chunk73HY36Z7_js.fixtures.addFirstProduct(h.client);
104
- await chunk73HY36Z7_js.fixtures.addFirstProduct(h.client);
103
+ await chunkTHSYGWUA_js.fixtures.addFirstProduct(h.client);
104
+ await chunkTHSYGWUA_js.fixtures.addFirstProduct(h.client);
105
105
  const res = await h.client.cart.get();
106
106
  vitest.expect(res.ok).toBe(true);
107
107
  if (!res.ok) return;
@@ -109,7 +109,7 @@ function createCartFlowSuite(opts = {}) {
109
109
  vitest.expect(res.value.items[0]?.quantity).toBe(2);
110
110
  });
111
111
  vitest.it("removes items and zeroes the subtotal", async () => {
112
- await chunk73HY36Z7_js.fixtures.addFirstProduct(h.client);
112
+ await chunkTHSYGWUA_js.fixtures.addFirstProduct(h.client);
113
113
  const before = await h.client.cart.get();
114
114
  if (!before.ok) throw before.error;
115
115
  const itemId = before.value.items[0]?.id;
@@ -135,28 +135,28 @@ function createContractSuite(opts = {}) {
135
135
  vitest.describe(opts.label ?? "SDK \u2194 mock contract", () => {
136
136
  let h;
137
137
  vitest.beforeEach(() => {
138
- h = chunk73HY36Z7_js.createTestClient(opts);
138
+ h = chunkTHSYGWUA_js.createTestClient(opts);
139
139
  });
140
140
  vitest.afterEach(() => h.dispose());
141
141
  vitest.it("AddItemPayload schema accepts a minimal valid body", () => {
142
- const result = chunk73HY36Z7_js.AddItemPayloadSchema.safeParse({ item_id: "prod_x", quantity: 1 });
142
+ const result = chunkTHSYGWUA_js.AddItemPayloadSchema.safeParse({ item_id: "prod_x", quantity: 1 });
143
143
  vitest.expect(result.success).toBe(true);
144
144
  });
145
145
  vitest.it("AddItemPayload schema rejects negative quantity", () => {
146
- const result = chunk73HY36Z7_js.AddItemPayloadSchema.safeParse({ item_id: "prod_x", quantity: -1 });
146
+ const result = chunkTHSYGWUA_js.AddItemPayloadSchema.safeParse({ item_id: "prod_x", quantity: -1 });
147
147
  vitest.expect(result.success).toBe(false);
148
148
  });
149
149
  vitest.it("AddItemPayload schema rejects empty item_id", () => {
150
- const result = chunk73HY36Z7_js.AddItemPayloadSchema.safeParse({ item_id: "", quantity: 1 });
150
+ const result = chunkTHSYGWUA_js.AddItemPayloadSchema.safeParse({ item_id: "", quantity: 1 });
151
151
  vitest.expect(result.success).toBe(false);
152
152
  });
153
153
  vitest.it("Cart line items returned by the mock match CartItemSchema", async () => {
154
- const { product } = await chunk73HY36Z7_js.fixtures.addFirstProduct(h.client);
154
+ const { product } = await chunkTHSYGWUA_js.fixtures.addFirstProduct(h.client);
155
155
  const get = await h.client.cart.get();
156
156
  if (!get.ok) throw get.error;
157
157
  vitest.expect(get.value.items.length).toBeGreaterThan(0);
158
158
  for (const item of get.value.items) {
159
- const result = chunk73HY36Z7_js.CartItemSchema.safeParse(item);
159
+ const result = chunkTHSYGWUA_js.CartItemSchema.safeParse(item);
160
160
  if (!result.success) {
161
161
  const issues = result.error.issues.map((i) => ` \u2022 ${i.path.join(".")}: ${i.message}`).join("\n");
162
162
  throw new Error(`Cart item shape mismatch for ${product.name}:
@@ -166,20 +166,20 @@ ${issues}`);
166
166
  }
167
167
  });
168
168
  vitest.it("CheckoutResponse projects purchase-intent authority without fabricating a bill token", async () => {
169
- await chunk73HY36Z7_js.fixtures.addFirstProduct(h.client);
169
+ await chunkTHSYGWUA_js.fixtures.addFirstProduct(h.client);
170
170
  const cartRes = await h.client.cart.get();
171
171
  if (!cartRes.ok) throw cartRes.error;
172
172
  const checkout = await h.client.checkout.process({
173
173
  cart_id: cartRes.value.id,
174
- customer: chunk73HY36Z7_js.fixtures.customer(),
174
+ customer: chunkTHSYGWUA_js.fixtures.customer(),
175
175
  order_type: "delivery",
176
- address_info: chunk73HY36Z7_js.fixtures.deliveryAddress(),
176
+ address_info: chunkTHSYGWUA_js.fixtures.deliveryAddress(),
177
177
  payment_method: "mobile_money",
178
178
  mobile_money_details: { phone_number: "+233244000000", provider: "mtn" }
179
179
  });
180
180
  vitest.expect(checkout.ok).toBe(true);
181
181
  if (!checkout.ok) return;
182
- const result = chunk73HY36Z7_js.CheckoutResponseSchema.safeParse(checkout.value);
182
+ const result = chunkTHSYGWUA_js.CheckoutResponseSchema.safeParse(checkout.value);
183
183
  if (!result.success) {
184
184
  const issues = result.error.issues.map((i) => ` \u2022 ${i.path.join(".")}: ${i.message}`).join("\n");
185
185
  throw new Error(`CheckoutResponse shape mismatch:
@@ -1,11 +1,11 @@
1
- import { assertBrand, SeedNameSchema, BrandSchema, createTestClient, assertCart, fixtures, AddItemPayloadSchema, CartItemSchema, CheckoutResponseSchema } from '../chunk-IWZKCL3P.mjs';
2
- import '../chunk-MKZXZDHE.mjs';
3
- import '../chunk-P4HYAV3L.mjs';
1
+ import { assertBrand, SeedNameSchema, BrandSchema, createTestClient, assertCart, fixtures, AddItemPayloadSchema, CartItemSchema, CheckoutResponseSchema } from '../chunk-NZMU7UUA.mjs';
2
+ import '../chunk-XBL3TMPC.mjs';
3
+ import '../chunk-T4OU77DM.mjs';
4
4
  import '../chunk-U4MW6PYU.mjs';
5
- import '../chunk-2I6YKE6Q.mjs';
5
+ import '../chunk-OTPLI3JY.mjs';
6
6
  import '../chunk-33VCYWVL.mjs';
7
- import '../chunk-NYDVVNZI.mjs';
8
- import '../chunk-NJYR6GGM.mjs';
7
+ import '../chunk-JRGK3NXR.mjs';
8
+ import '../chunk-KG3WT4PR.mjs';
9
9
  import '../chunk-3G6RQLXK.mjs';
10
10
  import { describe, it, expect, beforeEach, afterEach } from 'vitest';
11
11
 
@@ -1,9 +1,9 @@
1
1
  import { z } from 'zod';
2
2
  import { $ZodType } from 'zod/v4/core';
3
- export { A as AddFirstProductOptions, a as AddFirstProductResult, P as ProductSummary, T as TestClientHandle, c as createTestClient, f as fixtures } from './client-BBFfAtn4.mjs';
4
- import './catalogue-BohD-jU_.mjs';
5
- import './elements-Dtqe9Ekd.mjs';
6
- import './server-KilvZJU0.mjs';
3
+ export { A as AddFirstProductOptions, a as AddFirstProductResult, P as ProductSummary, T as TestClientHandle, c as createTestClient, f as fixtures } from './client-DlTJ2hUM.mjs';
4
+ import './catalogue-rWd71Xi-.mjs';
5
+ import './elements-BF1Y4aOi.mjs';
6
+ import './server-Dq70vD7z.mjs';
7
7
  import 'hono';
8
8
 
9
9
  /**
package/dist/testing.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { z } from 'zod';
2
2
  import { $ZodType } from 'zod/v4/core';
3
- export { A as AddFirstProductOptions, a as AddFirstProductResult, P as ProductSummary, T as TestClientHandle, c as createTestClient, f as fixtures } from './client-ByURQZM9.js';
4
- import './catalogue-C4xKpirp.js';
5
- import './elements-Dtqe9Ekd.js';
6
- import './server-Cowuvfbr.js';
3
+ export { A as AddFirstProductOptions, a as AddFirstProductResult, P as ProductSummary, T as TestClientHandle, c as createTestClient, f as fixtures } from './client-ni-CfOSO.js';
4
+ import './catalogue-AmW4XjaN.js';
5
+ import './elements-BF1Y4aOi.js';
6
+ import './server-BItJAUTD.js';
7
7
  import 'hono';
8
8
 
9
9
  /**