@cimplify/sdk 0.105.0 → 0.106.0

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 (50) hide show
  1. package/dist/advanced.d.mts +2 -2
  2. package/dist/advanced.d.ts +2 -2
  3. package/dist/advanced.js +20 -20
  4. package/dist/advanced.mjs +1 -1
  5. package/dist/{catalogue-DjutZ0FC.d.mts → catalogue-CB44dO-g.d.mts} +3 -0
  6. package/dist/{catalogue-D1jkpGcr.d.ts → catalogue-lUdp-1hu.d.ts} +3 -0
  7. package/dist/{chunk-TINYV5E2.mjs → chunk-3BTMAWL7.mjs} +28 -14
  8. package/dist/{chunk-PDTXSUHZ.js → chunk-7SEOB5UW.js} +30 -16
  9. package/dist/{chunk-37ZZCE7P.mjs → chunk-DPVDLMLI.mjs} +7 -12
  10. package/dist/{chunk-XHVQDEVO.js → chunk-H2WXUTMT.js} +34 -12
  11. package/dist/{chunk-Q5HX7LVE.mjs → chunk-L4XKIMUO.mjs} +1 -0
  12. package/dist/{chunk-7PMMV5X4.js → chunk-NJK3THWT.js} +1 -0
  13. package/dist/{chunk-X7RPMALQ.mjs → chunk-RQT5BZ2Y.mjs} +34 -12
  14. package/dist/{chunk-3IMPJEUI.js → chunk-YARZTZTB.js} +81 -86
  15. package/dist/{client-BBZj15JJ.d.ts → client-BQ_8FtA4.d.ts} +12 -2
  16. package/dist/{client-CZ8MjJ_o.d.mts → client-BWe1KWMf.d.mts} +12 -2
  17. package/dist/{index-CZjNWbQf.d.ts → index-C0k9om1S.d.ts} +1 -1
  18. package/dist/{index-DNxWfRHF.d.mts → index-aIQzSiP_.d.mts} +1 -1
  19. package/dist/index.d.mts +3 -3
  20. package/dist/index.d.ts +3 -3
  21. package/dist/index.js +67 -67
  22. package/dist/index.mjs +3 -3
  23. package/dist/mock/cli.mjs +1 -0
  24. package/dist/mock/library.js +1 -0
  25. package/dist/mock/library.mjs +1 -0
  26. package/dist/mock/msw.js +1 -0
  27. package/dist/mock/msw.mjs +1 -0
  28. package/dist/react.d.mts +1 -1
  29. package/dist/react.d.ts +1 -1
  30. package/dist/react.js +31 -31
  31. package/dist/react.mjs +2 -2
  32. package/dist/{server-C_RIDnHU.d.ts → server-7soMMUgP.d.ts} +2 -1
  33. package/dist/{server-Byr4d0hL.d.mts → server-DDEJ7e9s.d.mts} +2 -1
  34. package/dist/server.d.mts +2 -2
  35. package/dist/server.d.ts +2 -2
  36. package/dist/server.js +7 -7
  37. package/dist/server.mjs +2 -2
  38. package/dist/testing/msw.d.mts +1 -1
  39. package/dist/testing/msw.d.ts +1 -1
  40. package/dist/testing/msw.js +2 -2
  41. package/dist/testing/msw.mjs +1 -1
  42. package/dist/testing/suite.d.mts +4 -4
  43. package/dist/testing/suite.d.ts +4 -4
  44. package/dist/testing/suite.js +24 -23
  45. package/dist/testing/suite.mjs +5 -4
  46. package/dist/testing.d.mts +10 -4
  47. package/dist/testing.d.ts +10 -4
  48. package/dist/testing.js +116 -116
  49. package/dist/testing.mjs +5 -5
  50. package/package.json +1 -1
@@ -1,3 +1,3 @@
1
- export { j as AuthService, y as BusinessService, J as CartOperations, K as CatalogueQueries, _ as CheckoutOperations, _ as CheckoutService, a0 as CimplifyElement, a1 as CimplifyElements, ao as FetchQuoteInput, ax as FxService, aB as GetProductsOptions, aE as InventoryService, aI as LinkService, aM as LiteService, bb as OrderQueries, bs as PriceQuote, bC as QuoteBundleSelectionInput, bD as QuoteCompositeSelectionInput, bE as QuoteDynamicBuckets, bF as QuoteStatus, bG as QuoteUiMessage, bH as RefreshQuoteInput, bI as RefreshQuoteResult, c6 as SchedulingService, cL as createElements } from './catalogue-DjutZ0FC.mjs';
1
+ export { j as AuthService, y as BusinessService, J as CartOperations, K as CatalogueQueries, _ as CheckoutOperations, _ as CheckoutService, a0 as CimplifyElement, a1 as CimplifyElements, ao as FetchQuoteInput, ax as FxService, aB as GetProductsOptions, aE as InventoryService, aI as LinkService, aM as LiteService, bb as OrderQueries, bs as PriceQuote, bC as QuoteBundleSelectionInput, bD as QuoteCompositeSelectionInput, bE as QuoteDynamicBuckets, bF as QuoteStatus, bG as QuoteUiMessage, bH as RefreshQuoteInput, bI as RefreshQuoteResult, c6 as SchedulingService, cL as createElements } from './catalogue-CB44dO-g.mjs';
2
2
  export { bQ as ELEMENT_TYPES, bS as EVENT_TYPES, bV as ElementEventType, bW as ElementOptions, bX as ElementType, c0 as ElementsCheckoutData, c1 as ElementsCheckoutResult, c3 as ElementsOptions, cg as IframeToParentMessage, cy as MESSAGE_TYPES, df as ParentToIframeMessage } from './checkout-XoV4HNg2.mjs';
3
- export { g as generateIdempotencyKey } from './index-DNxWfRHF.mjs';
3
+ export { g as generateIdempotencyKey } from './index-aIQzSiP_.mjs';
@@ -1,3 +1,3 @@
1
- export { j as AuthService, y as BusinessService, J as CartOperations, K as CatalogueQueries, _ as CheckoutOperations, _ as CheckoutService, a0 as CimplifyElement, a1 as CimplifyElements, ao as FetchQuoteInput, ax as FxService, aB as GetProductsOptions, aE as InventoryService, aI as LinkService, aM as LiteService, bb as OrderQueries, bs as PriceQuote, bC as QuoteBundleSelectionInput, bD as QuoteCompositeSelectionInput, bE as QuoteDynamicBuckets, bF as QuoteStatus, bG as QuoteUiMessage, bH as RefreshQuoteInput, bI as RefreshQuoteResult, c6 as SchedulingService, cL as createElements } from './catalogue-D1jkpGcr.js';
1
+ export { j as AuthService, y as BusinessService, J as CartOperations, K as CatalogueQueries, _ as CheckoutOperations, _ as CheckoutService, a0 as CimplifyElement, a1 as CimplifyElements, ao as FetchQuoteInput, ax as FxService, aB as GetProductsOptions, aE as InventoryService, aI as LinkService, aM as LiteService, bb as OrderQueries, bs as PriceQuote, bC as QuoteBundleSelectionInput, bD as QuoteCompositeSelectionInput, bE as QuoteDynamicBuckets, bF as QuoteStatus, bG as QuoteUiMessage, bH as RefreshQuoteInput, bI as RefreshQuoteResult, c6 as SchedulingService, cL as createElements } from './catalogue-lUdp-1hu.js';
2
2
  export { bQ as ELEMENT_TYPES, bS as EVENT_TYPES, bV as ElementEventType, bW as ElementOptions, bX as ElementType, c0 as ElementsCheckoutData, c1 as ElementsCheckoutResult, c3 as ElementsOptions, cg as IframeToParentMessage, cy as MESSAGE_TYPES, df as ParentToIframeMessage } from './checkout-XoV4HNg2.js';
3
- export { g as generateIdempotencyKey } from './index-CZjNWbQf.js';
3
+ export { g as generateIdempotencyKey } from './index-C0k9om1S.js';
package/dist/advanced.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkXHVQDEVO_js = require('./chunk-XHVQDEVO.js');
3
+ var chunkH2WXUTMT_js = require('./chunk-H2WXUTMT.js');
4
4
  require('./chunk-EV2EVOYS.js');
5
5
  require('./chunk-UYFTOIFW.js');
6
6
  require('./chunk-AVXA4F6G.js');
@@ -10,77 +10,77 @@ require('./chunk-OWW5GUSB.js');
10
10
 
11
11
  Object.defineProperty(exports, "AuthService", {
12
12
  enumerable: true,
13
- get: function () { return chunkXHVQDEVO_js.AuthService; }
13
+ get: function () { return chunkH2WXUTMT_js.AuthService; }
14
14
  });
15
15
  Object.defineProperty(exports, "BusinessService", {
16
16
  enumerable: true,
17
- get: function () { return chunkXHVQDEVO_js.BusinessService; }
17
+ get: function () { return chunkH2WXUTMT_js.BusinessService; }
18
18
  });
19
19
  Object.defineProperty(exports, "CartOperations", {
20
20
  enumerable: true,
21
- get: function () { return chunkXHVQDEVO_js.CartOperations; }
21
+ get: function () { return chunkH2WXUTMT_js.CartOperations; }
22
22
  });
23
23
  Object.defineProperty(exports, "CatalogueQueries", {
24
24
  enumerable: true,
25
- get: function () { return chunkXHVQDEVO_js.CatalogueQueries; }
25
+ get: function () { return chunkH2WXUTMT_js.CatalogueQueries; }
26
26
  });
27
27
  Object.defineProperty(exports, "CheckoutOperations", {
28
28
  enumerable: true,
29
- get: function () { return chunkXHVQDEVO_js.CheckoutService; }
29
+ get: function () { return chunkH2WXUTMT_js.CheckoutService; }
30
30
  });
31
31
  Object.defineProperty(exports, "CheckoutService", {
32
32
  enumerable: true,
33
- get: function () { return chunkXHVQDEVO_js.CheckoutService; }
33
+ get: function () { return chunkH2WXUTMT_js.CheckoutService; }
34
34
  });
35
35
  Object.defineProperty(exports, "CimplifyElement", {
36
36
  enumerable: true,
37
- get: function () { return chunkXHVQDEVO_js.CimplifyElement; }
37
+ get: function () { return chunkH2WXUTMT_js.CimplifyElement; }
38
38
  });
39
39
  Object.defineProperty(exports, "CimplifyElements", {
40
40
  enumerable: true,
41
- get: function () { return chunkXHVQDEVO_js.CimplifyElements; }
41
+ get: function () { return chunkH2WXUTMT_js.CimplifyElements; }
42
42
  });
43
43
  Object.defineProperty(exports, "ELEMENT_TYPES", {
44
44
  enumerable: true,
45
- get: function () { return chunkXHVQDEVO_js.ELEMENT_TYPES; }
45
+ get: function () { return chunkH2WXUTMT_js.ELEMENT_TYPES; }
46
46
  });
47
47
  Object.defineProperty(exports, "EVENT_TYPES", {
48
48
  enumerable: true,
49
- get: function () { return chunkXHVQDEVO_js.EVENT_TYPES; }
49
+ get: function () { return chunkH2WXUTMT_js.EVENT_TYPES; }
50
50
  });
51
51
  Object.defineProperty(exports, "FxService", {
52
52
  enumerable: true,
53
- get: function () { return chunkXHVQDEVO_js.FxService; }
53
+ get: function () { return chunkH2WXUTMT_js.FxService; }
54
54
  });
55
55
  Object.defineProperty(exports, "InventoryService", {
56
56
  enumerable: true,
57
- get: function () { return chunkXHVQDEVO_js.InventoryService; }
57
+ get: function () { return chunkH2WXUTMT_js.InventoryService; }
58
58
  });
59
59
  Object.defineProperty(exports, "LinkService", {
60
60
  enumerable: true,
61
- get: function () { return chunkXHVQDEVO_js.LinkService; }
61
+ get: function () { return chunkH2WXUTMT_js.LinkService; }
62
62
  });
63
63
  Object.defineProperty(exports, "LiteService", {
64
64
  enumerable: true,
65
- get: function () { return chunkXHVQDEVO_js.LiteService; }
65
+ get: function () { return chunkH2WXUTMT_js.LiteService; }
66
66
  });
67
67
  Object.defineProperty(exports, "MESSAGE_TYPES", {
68
68
  enumerable: true,
69
- get: function () { return chunkXHVQDEVO_js.MESSAGE_TYPES; }
69
+ get: function () { return chunkH2WXUTMT_js.MESSAGE_TYPES; }
70
70
  });
71
71
  Object.defineProperty(exports, "OrderQueries", {
72
72
  enumerable: true,
73
- get: function () { return chunkXHVQDEVO_js.OrderQueries; }
73
+ get: function () { return chunkH2WXUTMT_js.OrderQueries; }
74
74
  });
75
75
  Object.defineProperty(exports, "SchedulingService", {
76
76
  enumerable: true,
77
- get: function () { return chunkXHVQDEVO_js.SchedulingService; }
77
+ get: function () { return chunkH2WXUTMT_js.SchedulingService; }
78
78
  });
79
79
  Object.defineProperty(exports, "createElements", {
80
80
  enumerable: true,
81
- get: function () { return chunkXHVQDEVO_js.createElements; }
81
+ get: function () { return chunkH2WXUTMT_js.createElements; }
82
82
  });
83
83
  Object.defineProperty(exports, "generateIdempotencyKey", {
84
84
  enumerable: true,
85
- get: function () { return chunkXHVQDEVO_js.generateIdempotencyKey; }
85
+ get: function () { return chunkH2WXUTMT_js.generateIdempotencyKey; }
86
86
  });
package/dist/advanced.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { AuthService, BusinessService, CartOperations, CatalogueQueries, CheckoutService as CheckoutOperations, CheckoutService, CimplifyElement, CimplifyElements, ELEMENT_TYPES, EVENT_TYPES, FxService, InventoryService, LinkService, LiteService, MESSAGE_TYPES, OrderQueries, SchedulingService, createElements, generateIdempotencyKey } from './chunk-X7RPMALQ.mjs';
1
+ export { AuthService, BusinessService, CartOperations, CatalogueQueries, CheckoutService as CheckoutOperations, CheckoutService, CimplifyElement, CimplifyElements, ELEMENT_TYPES, EVENT_TYPES, FxService, InventoryService, LinkService, LiteService, MESSAGE_TYPES, OrderQueries, SchedulingService, createElements, generateIdempotencyKey } from './chunk-RQT5BZ2Y.mjs';
2
2
  import './chunk-33VCYWVL.mjs';
3
3
  import './chunk-NYDVVNZI.mjs';
4
4
  import './chunk-NJYR6GGM.mjs';
@@ -695,6 +695,7 @@ interface PurchaseIntentResolveOptions {
695
695
  maxActionSteps?: number;
696
696
  maxTermsReviewSteps?: number;
697
697
  signal?: AbortSignal;
698
+ requestTimeoutMs?: number;
698
699
  onStatusChange?: (status: PurchaseIntentResolveStatus, response?: ConfirmPurchaseIntentResponse) => void;
699
700
  /**
700
701
  * Run provider-owned UI, then return `continue` to replay the same durable
@@ -711,9 +712,11 @@ interface PurchaseIntentResolveOptions {
711
712
  interface PurchaseIntentConfirmationPort {
712
713
  confirm(intentId: string, request: ConfirmPurchaseIntentRequest, options?: {
713
714
  signal?: AbortSignal;
715
+ timeoutMs?: number;
714
716
  }): Promise<Result<ConfirmPurchaseIntentResponse, CimplifyError>>;
715
717
  submitAction?(intentId: string, attemptId: string, request: SubmitPurchaseIntentActionRequest, options?: {
716
718
  signal?: AbortSignal;
719
+ timeoutMs?: number;
717
720
  }): Promise<Result<ConfirmPurchaseIntentResponse, CimplifyError>>;
718
721
  }
719
722
  interface PurchaseIntentResolverDependencies {
@@ -695,6 +695,7 @@ interface PurchaseIntentResolveOptions {
695
695
  maxActionSteps?: number;
696
696
  maxTermsReviewSteps?: number;
697
697
  signal?: AbortSignal;
698
+ requestTimeoutMs?: number;
698
699
  onStatusChange?: (status: PurchaseIntentResolveStatus, response?: ConfirmPurchaseIntentResponse) => void;
699
700
  /**
700
701
  * Run provider-owned UI, then return `continue` to replay the same durable
@@ -711,9 +712,11 @@ interface PurchaseIntentResolveOptions {
711
712
  interface PurchaseIntentConfirmationPort {
712
713
  confirm(intentId: string, request: ConfirmPurchaseIntentRequest, options?: {
713
714
  signal?: AbortSignal;
715
+ timeoutMs?: number;
714
716
  }): Promise<Result<ConfirmPurchaseIntentResponse, CimplifyError>>;
715
717
  submitAction?(intentId: string, attemptId: string, request: SubmitPurchaseIntentActionRequest, options?: {
716
718
  signal?: AbortSignal;
719
+ timeoutMs?: number;
717
720
  }): Promise<Result<ConfirmPurchaseIntentResponse, CimplifyError>>;
718
721
  }
719
722
  interface PurchaseIntentResolverDependencies {
@@ -1,9 +1,24 @@
1
- import { createMockApp } from './chunk-Q5HX7LVE.mjs';
2
- import { createCimplifyClient } from './chunk-37ZZCE7P.mjs';
1
+ import { createMockApp } from './chunk-L4XKIMUO.mjs';
2
+ import { createCimplifyClient } from './chunk-DPVDLMLI.mjs';
3
3
  import { PAYMENT_METHOD, ORDER_TYPE, AUTHORIZATION_TYPE, CHECKOUT_NEXT_ACTION } from './chunk-33VCYWVL.mjs';
4
4
  import { PURCHASE_INTENT_SOURCE_KIND, PURCHASE_INTENT_SELLABLE_KIND, PURCHASE_INTENT_OFFER_KIND, PURCHASE_INTENT_LINE_CONFIGURATION_KIND, PURCHASE_INTENT_PAYMENT_METHOD, PURCHASE_INTENT_MOBILE_MONEY_NETWORK, MOBILE_MONEY_TENDER_AUTHORITY_KIND, CHECKOUT_COMPLIANCE_REASON, CHECKOUT_COMPLIANCE_LANE, PURCHASE_SURFACE, PURCHASE_DISPOSITION, PAYMENT_INSTRUMENT_DISPLAY_KIND, CHECKOUT_PROTECTION_STATUS, PAYMENT_OPTION_NEXT_ACTION, PAYMENT_OPTION_STATUS, PURCHASE_INTENT_PAYMENT_PROVIDER, PAYMENT_COLLECTION_MODE, PURCHASING_PRINCIPAL_KIND, CHECKOUT_PURCHASE_SURFACE, NATIVE_PURCHASE_PLATFORM, PURCHASE_INTENT_STATUS, CHECKOUT_TERMS_COMPONENT, CHECKOUT_TERMS_DELTA_KIND, CHECKOUT_MATERIAL_TERMS_COMPONENT, PURCHASE_INTENT_CONFIRM_STATUS, CHECKOUT_INVALIDATION_REASON } from './chunk-NJYR6GGM.mjs';
5
5
  import { z } from 'zod';
6
6
 
7
+ // src/mock/seeds/names.ts
8
+ var SEED_NAMES = [
9
+ "default",
10
+ "empty",
11
+ "reesa-storefront",
12
+ "restaurant",
13
+ "retail",
14
+ "services",
15
+ "grocery",
16
+ "fashion",
17
+ "pharmacy",
18
+ "auto"
19
+ ];
20
+
21
+ // src/testing/schemas/common.ts
7
22
  var cimplifyRegistry = z.registry();
8
23
  function registerSchema(schema, meta) {
9
24
  cimplifyRegistry.add(schema, meta);
@@ -47,17 +62,8 @@ var PhoneE164Schema = registerSchema(
47
62
  { id: "PhoneE164", description: "E.164-ish phone number", version: "1.0.0" }
48
63
  );
49
64
  var SeedNameSchema = registerSchema(
50
- z.enum([
51
- "default",
52
- "empty",
53
- "reesa-storefront",
54
- "restaurant",
55
- "retail",
56
- "services",
57
- "grocery",
58
- "fashion"
59
- ]),
60
- { id: "SeedName", description: "Mock seed identifier", version: "1.0.0" }
65
+ z.enum(SEED_NAMES),
66
+ { id: "SeedName", description: "Mock seed identifier", version: "1.1.0" }
61
67
  );
62
68
  var ProductTypeSchema = registerSchema(
63
69
  z.enum(["product", "service", "digital", "bundle", "composite"]),
@@ -1259,7 +1265,15 @@ var fixtures = {
1259
1265
  return {
1260
1266
  name: overrides.name ?? "Test Customer",
1261
1267
  email: overrides.email ?? "test@example.com",
1262
- phone: overrides.phone ?? "+233244000000"
1268
+ phone: overrides.phone ?? "+233244000000",
1269
+ save_details: false
1270
+ };
1271
+ },
1272
+ deliveryAddress(overrides = {}) {
1273
+ return {
1274
+ street_address: overrides.street_address ?? "1 Independence Avenue",
1275
+ city: overrides.city ?? "Accra",
1276
+ region: overrides.region ?? "Greater Accra"
1263
1277
  };
1264
1278
  },
1265
1279
  /**
@@ -1,11 +1,26 @@
1
1
  'use strict';
2
2
 
3
- var chunk7PMMV5X4_js = require('./chunk-7PMMV5X4.js');
4
- var chunk3IMPJEUI_js = require('./chunk-3IMPJEUI.js');
3
+ var chunkNJK3THWT_js = require('./chunk-NJK3THWT.js');
4
+ var chunkYARZTZTB_js = require('./chunk-YARZTZTB.js');
5
5
  var chunkEV2EVOYS_js = require('./chunk-EV2EVOYS.js');
6
6
  var chunkAVXA4F6G_js = require('./chunk-AVXA4F6G.js');
7
7
  var zod = require('zod');
8
8
 
9
+ // src/mock/seeds/names.ts
10
+ var SEED_NAMES = [
11
+ "default",
12
+ "empty",
13
+ "reesa-storefront",
14
+ "restaurant",
15
+ "retail",
16
+ "services",
17
+ "grocery",
18
+ "fashion",
19
+ "pharmacy",
20
+ "auto"
21
+ ];
22
+
23
+ // src/testing/schemas/common.ts
9
24
  var cimplifyRegistry = zod.z.registry();
10
25
  function registerSchema(schema, meta) {
11
26
  cimplifyRegistry.add(schema, meta);
@@ -49,17 +64,8 @@ var PhoneE164Schema = registerSchema(
49
64
  { id: "PhoneE164", description: "E.164-ish phone number", version: "1.0.0" }
50
65
  );
51
66
  var SeedNameSchema = registerSchema(
52
- zod.z.enum([
53
- "default",
54
- "empty",
55
- "reesa-storefront",
56
- "restaurant",
57
- "retail",
58
- "services",
59
- "grocery",
60
- "fashion"
61
- ]),
62
- { id: "SeedName", description: "Mock seed identifier", version: "1.0.0" }
67
+ zod.z.enum(SEED_NAMES),
68
+ { id: "SeedName", description: "Mock seed identifier", version: "1.1.0" }
63
69
  );
64
70
  var ProductTypeSchema = registerSchema(
65
71
  zod.z.enum(["product", "service", "digital", "bundle", "composite"]),
@@ -1179,7 +1185,7 @@ async function toForwardedRequest(input, init) {
1179
1185
  };
1180
1186
  }
1181
1187
  function createTestClient(options = {}) {
1182
- const mock = chunk7PMMV5X4_js.createMockApp(options);
1188
+ const mock = chunkNJK3THWT_js.createMockApp(options);
1183
1189
  let sessionToken;
1184
1190
  const fetchImpl = async (input, init) => {
1185
1191
  const url = typeof input === "string" ? input : input instanceof URL ? input.toString() : input.url;
@@ -1198,7 +1204,7 @@ function createTestClient(options = {}) {
1198
1204
  if (echoed) sessionToken = echoed;
1199
1205
  return res;
1200
1206
  };
1201
- const client = chunk3IMPJEUI_js.createCimplifyClient({
1207
+ const client = chunkYARZTZTB_js.createCimplifyClient({
1202
1208
  baseUrl: TEST_BASE_URL,
1203
1209
  // Link mock lives at /v1/link on the same Hono app, so point the SDK's
1204
1210
  // separate Link transport at the same TEST_BASE_URL.
@@ -1261,7 +1267,15 @@ var fixtures = {
1261
1267
  return {
1262
1268
  name: overrides.name ?? "Test Customer",
1263
1269
  email: overrides.email ?? "test@example.com",
1264
- phone: overrides.phone ?? "+233244000000"
1270
+ phone: overrides.phone ?? "+233244000000",
1271
+ save_details: false
1272
+ };
1273
+ },
1274
+ deliveryAddress(overrides = {}) {
1275
+ return {
1276
+ street_address: overrides.street_address ?? "1 Independence Avenue",
1277
+ city: overrides.city ?? "Accra",
1278
+ region: overrides.region ?? "Greater Accra"
1265
1279
  };
1266
1280
  },
1267
1281
  /**
@@ -1,5 +1,5 @@
1
1
  import { messagePreview } from './chunk-U4MW6PYU.mjs';
2
- import { ok, err, safe, generateIdempotencyKey, createDefaultPaymentAuthorizationAdapterRegistry, CatalogueQueries, CartOperations, CheckoutService, OrderQueries, LinkService, AuthService, BusinessService, InventoryService, SchedulingService, LiteService, FxService, createElements } from './chunk-X7RPMALQ.mjs';
2
+ import { ok, err, safe, generateIdempotencyKey, createDefaultPaymentAuthorizationAdapterRegistry, CatalogueQueries, CartOperations, CheckoutService, OrderQueries, LinkService, AuthService, BusinessService, InventoryService, SchedulingService, LiteService, FxService, createElements } from './chunk-RQT5BZ2Y.mjs';
3
3
  import { PURCHASE_INTENT_RESOLVE_STATUS, PURCHASE_INTENT_CONFIRM_STATUS, PURCHASE_INTENT_RESOLUTION_KIND, PURCHASE_INTENT_ACTION_DECISION, CimplifyError, PURCHASE_INTENT_ERROR_CODE, ErrorCode, IdempotencyMismatchError, enrichError } from './chunk-NJYR6GGM.mjs';
4
4
 
5
5
  // src/types/observability.ts
@@ -61,9 +61,10 @@ var PurchaseIntentResolver = class {
61
61
  let pollAttempts = 0;
62
62
  let actionSteps = 0;
63
63
  let termsReviewSteps = 0;
64
+ const requestOptions = { signal: options.signal, timeoutMs: options.requestTimeoutMs };
64
65
  this.ensureActive(options.signal);
65
66
  this.notify(options, PURCHASE_INTENT_RESOLVE_STATUS.CONFIRMING);
66
- let responseResult = options.initialResponse ? ok(options.initialResponse) : await this.confirmation.confirm(intentId, request, { signal: options.signal });
67
+ let responseResult = options.initialResponse ? ok(options.initialResponse) : await this.confirmation.confirm(intentId, request, requestOptions);
67
68
  while (responseResult.ok) {
68
69
  this.ensureActive(options.signal);
69
70
  const response = responseResult.value;
@@ -84,9 +85,7 @@ var PurchaseIntentResolver = class {
84
85
  pollAttempts += 1;
85
86
  this.notify(options, PURCHASE_INTENT_RESOLVE_STATUS.POLLING, response);
86
87
  await this.wait(pollIntervalMs, options.signal);
87
- responseResult = await this.confirmation.confirm(intentId, request, {
88
- signal: options.signal
89
- });
88
+ responseResult = await this.confirmation.confirm(intentId, request, requestOptions);
90
89
  continue;
91
90
  case PURCHASE_INTENT_CONFIRM_STATUS.REDIRECT_REQUIRED:
92
91
  case PURCHASE_INTENT_CONFIRM_STATUS.CARD_POPUP_REQUIRED:
@@ -114,7 +113,7 @@ var PurchaseIntentResolver = class {
114
113
  intentId,
115
114
  response.attempt_id,
116
115
  decision.request,
117
- { signal: options.signal }
116
+ requestOptions
118
117
  );
119
118
  continue;
120
119
  }
@@ -128,9 +127,7 @@ var PurchaseIntentResolver = class {
128
127
  );
129
128
  }
130
129
  await this.wait(pollIntervalMs, options.signal);
131
- responseResult = await this.confirmation.confirm(intentId, request, {
132
- signal: options.signal
133
- });
130
+ responseResult = await this.confirmation.confirm(intentId, request, requestOptions);
134
131
  continue;
135
132
  }
136
133
  case PURCHASE_INTENT_CONFIRM_STATUS.TERMS_CHANGED: {
@@ -144,9 +141,7 @@ var PurchaseIntentResolver = class {
144
141
  return ok({ kind: PURCHASE_INTENT_RESOLUTION_KIND.REVIEW_REQUIRED, response });
145
142
  }
146
143
  request = replacementRequest;
147
- responseResult = await this.confirmation.confirm(intentId, request, {
148
- signal: options.signal
149
- });
144
+ responseResult = await this.confirmation.confirm(intentId, request, requestOptions);
150
145
  continue;
151
146
  }
152
147
  case PURCHASE_INTENT_CONFIRM_STATUS.SELECTION_UNAVAILABLE:
@@ -1612,7 +1612,7 @@ var CHECKOUT_CONFIRMATION_SCOPE_PREFIX = "checkout-confirm:";
1612
1612
  var CHECKOUT_INTENT_RECOVERY_FINGERPRINT = "cart-intent-v1";
1613
1613
  var ABORT_ERROR_NAME = "AbortError";
1614
1614
  var AUTHORIZATION_POPUP_NAME = "cimplify-auth";
1615
- var AUTHORIZATION_POPUP_FEATURES = "width=520,height=760,noopener,noreferrer";
1615
+ var AUTHORIZATION_POPUP_FEATURES = "width=520,height=760";
1616
1616
  var ORDER_TOKEN_QUERY_PARAMETER = "token";
1617
1617
  var CHECKOUT_API_ROUTE = {
1618
1618
  COLLECTION_OPTIONS: "/api/v1/payments/collection-options",
@@ -2146,7 +2146,7 @@ var CheckoutService = class {
2146
2146
  window.location.assign(authorizationUrl);
2147
2147
  } else {
2148
2148
  const popup = window.open(
2149
- authorizationUrl,
2149
+ "",
2150
2150
  AUTHORIZATION_POPUP_NAME,
2151
2151
  AUTHORIZATION_POPUP_FEATURES
2152
2152
  );
@@ -2158,6 +2158,8 @@ var CheckoutService = class {
2158
2158
  };
2159
2159
  return chunkAVXA4F6G_js.PURCHASE_INTENT_ACTION_DECISION.STOP;
2160
2160
  }
2161
+ popup.opener = null;
2162
+ popup.location.replace(authorizationUrl);
2161
2163
  }
2162
2164
  }
2163
2165
  actionFailure = {
@@ -3642,9 +3644,14 @@ var CimplifyElements = class {
3642
3644
  account_id: this.accountId ?? void 0,
3643
3645
  customer_id: this.customerId ?? void 0
3644
3646
  };
3645
- const timeoutMs = options.timeout_ms ?? 18e4;
3647
+ const inactivityTimeoutMs = options.timeout_ms ?? 18e4;
3648
+ const shopperPendingStatuses = /* @__PURE__ */ new Set([
3649
+ chunkEV2EVOYS_js.CHECKOUT_STATUS.REVIEWING_TERMS,
3650
+ chunkEV2EVOYS_js.CHECKOUT_STATUS.AWAITING_AUTHORIZATION
3651
+ ]);
3646
3652
  return new Promise((resolve) => {
3647
3653
  let settled = false;
3654
+ let timeout;
3648
3655
  const cleanup = () => {
3649
3656
  if (typeof window !== "undefined") {
3650
3657
  window.removeEventListener("message", handleCheckoutMessage);
@@ -3661,15 +3668,23 @@ var CimplifyElements = class {
3661
3668
  cleanup();
3662
3669
  resolve(result);
3663
3670
  };
3664
- const timeout = setTimeout(() => {
3665
- settle(
3666
- toCheckoutError(
3667
- chunkAVXA4F6G_js.ErrorCode.TIMEOUT,
3668
- "Checkout timed out before receiving a terminal response.",
3669
- true
3670
- )
3671
- );
3672
- }, timeoutMs);
3671
+ const armTimeout = () => {
3672
+ clearTimeout(timeout);
3673
+ timeout = setTimeout(() => {
3674
+ settle(
3675
+ toCheckoutError(
3676
+ chunkAVXA4F6G_js.ErrorCode.TIMEOUT,
3677
+ "Checkout timed out before receiving a terminal response.",
3678
+ true
3679
+ )
3680
+ );
3681
+ }, inactivityTimeoutMs);
3682
+ };
3683
+ const suspendTimeout = () => {
3684
+ clearTimeout(timeout);
3685
+ timeout = void 0;
3686
+ };
3687
+ armTimeout();
3673
3688
  const handleCheckoutMessage = (event) => {
3674
3689
  if (!isAllowedOrigin(event.origin)) {
3675
3690
  return;
@@ -3682,10 +3697,16 @@ var CimplifyElements = class {
3682
3697
  return;
3683
3698
  }
3684
3699
  if (message.type === MESSAGE_TYPES.CHECKOUT_STATUS) {
3700
+ if (shopperPendingStatuses.has(message.status)) {
3701
+ suspendTimeout();
3702
+ } else {
3703
+ armTimeout();
3704
+ }
3685
3705
  options.on_status_change?.(message.status, message.context);
3686
3706
  return;
3687
3707
  }
3688
3708
  if (message.type === MESSAGE_TYPES.TERMS_CHANGED) {
3709
+ suspendTimeout();
3689
3710
  options.on_status_change?.(chunkEV2EVOYS_js.CHECKOUT_STATUS.REVIEWING_TERMS, {
3690
3711
  intent_id: message.intent_id,
3691
3712
  replacement_terms: message.replacement,
@@ -3694,6 +3715,7 @@ var CimplifyElements = class {
3694
3715
  return;
3695
3716
  }
3696
3717
  if (message.type === MESSAGE_TYPES.SELECTION_UNAVAILABLE) {
3718
+ suspendTimeout();
3697
3719
  options.on_status_change?.(chunkEV2EVOYS_js.CHECKOUT_STATUS.REVIEWING_TERMS, {
3698
3720
  intent_id: message.intent_id,
3699
3721
  unavailable_lines: message.lines
@@ -5752,6 +5752,7 @@ function createPurchaseIntentMockService(options) {
5752
5752
  }
5753
5753
  const checkoutInput = request.checkout;
5754
5754
  if (!checkoutInput) throw validation("Cart checkout input is required");
5755
+ if (!checkoutInput.address_info) throw validation("Checkout address_info is required");
5755
5756
  assertSupportedTenderPreference(request);
5756
5757
  const cart = registry.carts.get(request.source.cart_id);
5757
5758
  if (!cart) throw notFound(`Cart ${request.source.cart_id} not found`);
@@ -5754,6 +5754,7 @@ function createPurchaseIntentMockService(options) {
5754
5754
  }
5755
5755
  const checkoutInput = request.checkout;
5756
5756
  if (!checkoutInput) throw validation("Cart checkout input is required");
5757
+ if (!checkoutInput.address_info) throw validation("Checkout address_info is required");
5757
5758
  assertSupportedTenderPreference(request);
5758
5759
  const cart = registry.carts.get(request.source.cart_id);
5759
5760
  if (!cart) throw notFound(`Cart ${request.source.cart_id} not found`);
@@ -1610,7 +1610,7 @@ var CHECKOUT_CONFIRMATION_SCOPE_PREFIX = "checkout-confirm:";
1610
1610
  var CHECKOUT_INTENT_RECOVERY_FINGERPRINT = "cart-intent-v1";
1611
1611
  var ABORT_ERROR_NAME = "AbortError";
1612
1612
  var AUTHORIZATION_POPUP_NAME = "cimplify-auth";
1613
- var AUTHORIZATION_POPUP_FEATURES = "width=520,height=760,noopener,noreferrer";
1613
+ var AUTHORIZATION_POPUP_FEATURES = "width=520,height=760";
1614
1614
  var ORDER_TOKEN_QUERY_PARAMETER = "token";
1615
1615
  var CHECKOUT_API_ROUTE = {
1616
1616
  COLLECTION_OPTIONS: "/api/v1/payments/collection-options",
@@ -2144,7 +2144,7 @@ var CheckoutService = class {
2144
2144
  window.location.assign(authorizationUrl);
2145
2145
  } else {
2146
2146
  const popup = window.open(
2147
- authorizationUrl,
2147
+ "",
2148
2148
  AUTHORIZATION_POPUP_NAME,
2149
2149
  AUTHORIZATION_POPUP_FEATURES
2150
2150
  );
@@ -2156,6 +2156,8 @@ var CheckoutService = class {
2156
2156
  };
2157
2157
  return PURCHASE_INTENT_ACTION_DECISION.STOP;
2158
2158
  }
2159
+ popup.opener = null;
2160
+ popup.location.replace(authorizationUrl);
2159
2161
  }
2160
2162
  }
2161
2163
  actionFailure = {
@@ -3640,9 +3642,14 @@ var CimplifyElements = class {
3640
3642
  account_id: this.accountId ?? void 0,
3641
3643
  customer_id: this.customerId ?? void 0
3642
3644
  };
3643
- const timeoutMs = options.timeout_ms ?? 18e4;
3645
+ const inactivityTimeoutMs = options.timeout_ms ?? 18e4;
3646
+ const shopperPendingStatuses = /* @__PURE__ */ new Set([
3647
+ CHECKOUT_STATUS.REVIEWING_TERMS,
3648
+ CHECKOUT_STATUS.AWAITING_AUTHORIZATION
3649
+ ]);
3644
3650
  return new Promise((resolve) => {
3645
3651
  let settled = false;
3652
+ let timeout;
3646
3653
  const cleanup = () => {
3647
3654
  if (typeof window !== "undefined") {
3648
3655
  window.removeEventListener("message", handleCheckoutMessage);
@@ -3659,15 +3666,23 @@ var CimplifyElements = class {
3659
3666
  cleanup();
3660
3667
  resolve(result);
3661
3668
  };
3662
- const timeout = setTimeout(() => {
3663
- settle(
3664
- toCheckoutError(
3665
- ErrorCode.TIMEOUT,
3666
- "Checkout timed out before receiving a terminal response.",
3667
- true
3668
- )
3669
- );
3670
- }, timeoutMs);
3669
+ const armTimeout = () => {
3670
+ clearTimeout(timeout);
3671
+ timeout = setTimeout(() => {
3672
+ settle(
3673
+ toCheckoutError(
3674
+ ErrorCode.TIMEOUT,
3675
+ "Checkout timed out before receiving a terminal response.",
3676
+ true
3677
+ )
3678
+ );
3679
+ }, inactivityTimeoutMs);
3680
+ };
3681
+ const suspendTimeout = () => {
3682
+ clearTimeout(timeout);
3683
+ timeout = void 0;
3684
+ };
3685
+ armTimeout();
3671
3686
  const handleCheckoutMessage = (event) => {
3672
3687
  if (!isAllowedOrigin(event.origin)) {
3673
3688
  return;
@@ -3680,10 +3695,16 @@ var CimplifyElements = class {
3680
3695
  return;
3681
3696
  }
3682
3697
  if (message.type === MESSAGE_TYPES.CHECKOUT_STATUS) {
3698
+ if (shopperPendingStatuses.has(message.status)) {
3699
+ suspendTimeout();
3700
+ } else {
3701
+ armTimeout();
3702
+ }
3683
3703
  options.on_status_change?.(message.status, message.context);
3684
3704
  return;
3685
3705
  }
3686
3706
  if (message.type === MESSAGE_TYPES.TERMS_CHANGED) {
3707
+ suspendTimeout();
3687
3708
  options.on_status_change?.(CHECKOUT_STATUS.REVIEWING_TERMS, {
3688
3709
  intent_id: message.intent_id,
3689
3710
  replacement_terms: message.replacement,
@@ -3692,6 +3713,7 @@ var CimplifyElements = class {
3692
3713
  return;
3693
3714
  }
3694
3715
  if (message.type === MESSAGE_TYPES.SELECTION_UNAVAILABLE) {
3716
+ suspendTimeout();
3695
3717
  options.on_status_change?.(CHECKOUT_STATUS.REVIEWING_TERMS, {
3696
3718
  intent_id: message.intent_id,
3697
3719
  unavailable_lines: message.lines