@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,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkXREIZ56K_js = require('./chunk-XREIZ56K.js');
4
- var chunkXHVQDEVO_js = require('./chunk-XHVQDEVO.js');
4
+ var chunkH2WXUTMT_js = require('./chunk-H2WXUTMT.js');
5
5
  var chunkAVXA4F6G_js = require('./chunk-AVXA4F6G.js');
6
6
 
7
7
  // src/types/observability.ts
@@ -63,48 +63,47 @@ var PurchaseIntentResolver = class {
63
63
  let pollAttempts = 0;
64
64
  let actionSteps = 0;
65
65
  let termsReviewSteps = 0;
66
+ const requestOptions = { signal: options.signal, timeoutMs: options.requestTimeoutMs };
66
67
  this.ensureActive(options.signal);
67
68
  this.notify(options, chunkAVXA4F6G_js.PURCHASE_INTENT_RESOLVE_STATUS.CONFIRMING);
68
- let responseResult = options.initialResponse ? chunkXHVQDEVO_js.ok(options.initialResponse) : await this.confirmation.confirm(intentId, request, { signal: options.signal });
69
+ let responseResult = options.initialResponse ? chunkH2WXUTMT_js.ok(options.initialResponse) : await this.confirmation.confirm(intentId, request, requestOptions);
69
70
  while (responseResult.ok) {
70
71
  this.ensureActive(options.signal);
71
72
  const response = responseResult.value;
72
73
  switch (response.status) {
73
74
  case chunkAVXA4F6G_js.PURCHASE_INTENT_CONFIRM_STATUS.ORDER_CREATED:
74
75
  this.notify(options, chunkAVXA4F6G_js.PURCHASE_INTENT_RESOLVE_STATUS.COMPLETED, response);
75
- return chunkXHVQDEVO_js.ok({ kind: chunkAVXA4F6G_js.PURCHASE_INTENT_RESOLUTION_KIND.COMPLETED, response });
76
+ return chunkH2WXUTMT_js.ok({ kind: chunkAVXA4F6G_js.PURCHASE_INTENT_RESOLUTION_KIND.COMPLETED, response });
76
77
  case chunkAVXA4F6G_js.PURCHASE_INTENT_CONFIRM_STATUS.PAYMENT_FAILED:
77
78
  this.notify(options, chunkAVXA4F6G_js.PURCHASE_INTENT_RESOLVE_STATUS.FAILED, response);
78
- return chunkXHVQDEVO_js.ok({ kind: chunkAVXA4F6G_js.PURCHASE_INTENT_RESOLUTION_KIND.FAILED, response });
79
+ return chunkH2WXUTMT_js.ok({ kind: chunkAVXA4F6G_js.PURCHASE_INTENT_RESOLUTION_KIND.FAILED, response });
79
80
  case chunkAVXA4F6G_js.PURCHASE_INTENT_CONFIRM_STATUS.PAYMENT_OUTCOME_UNKNOWN:
80
81
  this.notify(options, chunkAVXA4F6G_js.PURCHASE_INTENT_RESOLVE_STATUS.OUTCOME_UNKNOWN, response);
81
- return chunkXHVQDEVO_js.ok({ kind: chunkAVXA4F6G_js.PURCHASE_INTENT_RESOLUTION_KIND.OUTCOME_UNKNOWN, response });
82
+ return chunkH2WXUTMT_js.ok({ kind: chunkAVXA4F6G_js.PURCHASE_INTENT_RESOLUTION_KIND.OUTCOME_UNKNOWN, response });
82
83
  case chunkAVXA4F6G_js.PURCHASE_INTENT_CONFIRM_STATUS.COLLECTION_PROCESSING:
83
84
  if (pollAttempts >= maxPollAttempts) {
84
- return chunkXHVQDEVO_js.ok({ kind: chunkAVXA4F6G_js.PURCHASE_INTENT_RESOLUTION_KIND.TIMED_OUT, response });
85
+ return chunkH2WXUTMT_js.ok({ kind: chunkAVXA4F6G_js.PURCHASE_INTENT_RESOLUTION_KIND.TIMED_OUT, response });
85
86
  }
86
87
  pollAttempts += 1;
87
88
  this.notify(options, chunkAVXA4F6G_js.PURCHASE_INTENT_RESOLVE_STATUS.POLLING, response);
88
89
  await this.wait(pollIntervalMs, options.signal);
89
- responseResult = await this.confirmation.confirm(intentId, request, {
90
- signal: options.signal
91
- });
90
+ responseResult = await this.confirmation.confirm(intentId, request, requestOptions);
92
91
  continue;
93
92
  case chunkAVXA4F6G_js.PURCHASE_INTENT_CONFIRM_STATUS.REDIRECT_REQUIRED:
94
93
  case chunkAVXA4F6G_js.PURCHASE_INTENT_CONFIRM_STATUS.CARD_POPUP_REQUIRED:
95
94
  case chunkAVXA4F6G_js.PURCHASE_INTENT_CONFIRM_STATUS.AUTHORIZATION_REQUIRED: {
96
95
  this.notify(options, chunkAVXA4F6G_js.PURCHASE_INTENT_RESOLVE_STATUS.AWAITING_ACTION, response);
97
96
  if (!options.onActionRequired || actionSteps >= maxActionSteps) {
98
- return chunkXHVQDEVO_js.ok({ kind: chunkAVXA4F6G_js.PURCHASE_INTENT_RESOLUTION_KIND.ACTION_REQUIRED, response });
97
+ return chunkH2WXUTMT_js.ok({ kind: chunkAVXA4F6G_js.PURCHASE_INTENT_RESOLUTION_KIND.ACTION_REQUIRED, response });
99
98
  }
100
99
  actionSteps += 1;
101
100
  const decision = await options.onActionRequired(response);
102
101
  if (decision === chunkAVXA4F6G_js.PURCHASE_INTENT_ACTION_DECISION.STOP) {
103
- return chunkXHVQDEVO_js.ok({ kind: chunkAVXA4F6G_js.PURCHASE_INTENT_RESOLUTION_KIND.ACTION_REQUIRED, response });
102
+ return chunkH2WXUTMT_js.ok({ kind: chunkAVXA4F6G_js.PURCHASE_INTENT_RESOLUTION_KIND.ACTION_REQUIRED, response });
104
103
  }
105
104
  if (typeof decision === "object" && decision.kind === chunkAVXA4F6G_js.PURCHASE_INTENT_ACTION_DECISION.SUBMIT) {
106
105
  if (!this.confirmation.submitAction) {
107
- return chunkXHVQDEVO_js.err(
106
+ return chunkH2WXUTMT_js.err(
108
107
  new chunkAVXA4F6G_js.CimplifyError(
109
108
  chunkAVXA4F6G_js.PURCHASE_INTENT_ERROR_CODE.ACTION_UNSUPPORTED,
110
109
  "This confirmation transport cannot submit purchase-intent actions.",
@@ -116,12 +115,12 @@ var PurchaseIntentResolver = class {
116
115
  intentId,
117
116
  response.attempt_id,
118
117
  decision.request,
119
- { signal: options.signal }
118
+ requestOptions
120
119
  );
121
120
  continue;
122
121
  }
123
122
  if (decision !== chunkAVXA4F6G_js.PURCHASE_INTENT_ACTION_DECISION.CONTINUE) {
124
- return chunkXHVQDEVO_js.err(
123
+ return chunkH2WXUTMT_js.err(
125
124
  new chunkAVXA4F6G_js.CimplifyError(
126
125
  chunkAVXA4F6G_js.PURCHASE_INTENT_ERROR_CODE.ACTION_UNSUPPORTED,
127
126
  "The action callback returned an unsupported decision.",
@@ -130,31 +129,27 @@ var PurchaseIntentResolver = class {
130
129
  );
131
130
  }
132
131
  await this.wait(pollIntervalMs, options.signal);
133
- responseResult = await this.confirmation.confirm(intentId, request, {
134
- signal: options.signal
135
- });
132
+ responseResult = await this.confirmation.confirm(intentId, request, requestOptions);
136
133
  continue;
137
134
  }
138
135
  case chunkAVXA4F6G_js.PURCHASE_INTENT_CONFIRM_STATUS.TERMS_CHANGED: {
139
136
  this.notify(options, chunkAVXA4F6G_js.PURCHASE_INTENT_RESOLVE_STATUS.REVIEWING_TERMS, response);
140
137
  if (!options.onTermsChanged || termsReviewSteps >= maxTermsReviewSteps) {
141
- return chunkXHVQDEVO_js.ok({ kind: chunkAVXA4F6G_js.PURCHASE_INTENT_RESOLUTION_KIND.REVIEW_REQUIRED, response });
138
+ return chunkH2WXUTMT_js.ok({ kind: chunkAVXA4F6G_js.PURCHASE_INTENT_RESOLUTION_KIND.REVIEW_REQUIRED, response });
142
139
  }
143
140
  termsReviewSteps += 1;
144
141
  const replacementRequest = await options.onTermsChanged(response);
145
142
  if (!replacementRequest) {
146
- return chunkXHVQDEVO_js.ok({ kind: chunkAVXA4F6G_js.PURCHASE_INTENT_RESOLUTION_KIND.REVIEW_REQUIRED, response });
143
+ return chunkH2WXUTMT_js.ok({ kind: chunkAVXA4F6G_js.PURCHASE_INTENT_RESOLUTION_KIND.REVIEW_REQUIRED, response });
147
144
  }
148
145
  request = replacementRequest;
149
- responseResult = await this.confirmation.confirm(intentId, request, {
150
- signal: options.signal
151
- });
146
+ responseResult = await this.confirmation.confirm(intentId, request, requestOptions);
152
147
  continue;
153
148
  }
154
149
  case chunkAVXA4F6G_js.PURCHASE_INTENT_CONFIRM_STATUS.SELECTION_UNAVAILABLE:
155
150
  case chunkAVXA4F6G_js.PURCHASE_INTENT_CONFIRM_STATUS.OFFER_ENDED:
156
151
  case chunkAVXA4F6G_js.PURCHASE_INTENT_CONFIRM_STATUS.SOURCE_UNAVAILABLE:
157
- return chunkXHVQDEVO_js.ok({ kind: chunkAVXA4F6G_js.PURCHASE_INTENT_RESOLUTION_KIND.REVIEW_REQUIRED, response });
152
+ return chunkH2WXUTMT_js.ok({ kind: chunkAVXA4F6G_js.PURCHASE_INTENT_RESOLUTION_KIND.REVIEW_REQUIRED, response });
158
153
  }
159
154
  }
160
155
  return responseResult;
@@ -197,7 +192,7 @@ var PurchaseIntentService = class {
197
192
  this.resolver = new PurchaseIntentResolver({ confirmation: this });
198
193
  }
199
194
  mint(request, options) {
200
- return chunkXHVQDEVO_js.safe(
195
+ return chunkH2WXUTMT_js.safe(
201
196
  this.transport.post(PURCHASE_INTENT_ROUTE.DIRECT_COLLECTION, request, {
202
197
  idempotencyKey: request.client_intent_key,
203
198
  signal: options?.signal,
@@ -206,7 +201,7 @@ var PurchaseIntentService = class {
206
201
  );
207
202
  }
208
203
  get(intentId, options) {
209
- return chunkXHVQDEVO_js.safe(
204
+ return chunkH2WXUTMT_js.safe(
210
205
  this.transport.get(this.intentPath(intentId), {
211
206
  signal: options?.signal,
212
207
  timeoutMs: options?.timeoutMs
@@ -217,7 +212,7 @@ var PurchaseIntentService = class {
217
212
  const request = {
218
213
  expected_intent_revision: expectedRevision
219
214
  };
220
- return chunkXHVQDEVO_js.safe(
215
+ return chunkH2WXUTMT_js.safe(
221
216
  this.transport.post(
222
217
  `${this.intentPath(intentId)}/${PURCHASE_INTENT_ROUTE.REFRESH}`,
223
218
  request,
@@ -229,7 +224,7 @@ var PurchaseIntentService = class {
229
224
  );
230
225
  }
231
226
  confirm(intentId, request, options) {
232
- return chunkXHVQDEVO_js.safe(
227
+ return chunkH2WXUTMT_js.safe(
233
228
  this.transport.post(
234
229
  `${this.intentPath(intentId)}/${PURCHASE_INTENT_ROUTE.CONFIRM}`,
235
230
  request,
@@ -244,7 +239,7 @@ var PurchaseIntentService = class {
244
239
  submitAction(intentId, attemptId, request, options) {
245
240
  const normalizedAttemptId = attemptId.trim();
246
241
  if (!normalizedAttemptId) throw new TypeError("attemptId must not be empty");
247
- return chunkXHVQDEVO_js.safe(
242
+ return chunkH2WXUTMT_js.safe(
248
243
  this.transport.post(
249
244
  `${this.intentPath(intentId)}/${PURCHASE_INTENT_ROUTE.ATTEMPTS}/${encodeURIComponent(normalizedAttemptId)}/${PURCHASE_INTENT_ROUTE.ACTIONS}`,
250
245
  request,
@@ -276,7 +271,7 @@ var HostedPurchaseIntentService = class {
276
271
  this.resolver = new PurchaseIntentResolver({ confirmation: this });
277
272
  }
278
273
  prepare(request, options) {
279
- return chunkXHVQDEVO_js.safe(
274
+ return chunkH2WXUTMT_js.safe(
280
275
  this.transport.post(
281
276
  `${this.sessionPath}/${PURCHASE_INTENT_ROUTE.PREPARE}`,
282
277
  request,
@@ -289,7 +284,7 @@ var HostedPurchaseIntentService = class {
289
284
  );
290
285
  }
291
286
  confirm(_intentId, request, options) {
292
- return chunkXHVQDEVO_js.safe(
287
+ return chunkH2WXUTMT_js.safe(
293
288
  this.transport.post(
294
289
  `${this.sessionPath}/${PURCHASE_INTENT_ROUTE.CONFIRM}`,
295
290
  request,
@@ -302,7 +297,7 @@ var HostedPurchaseIntentService = class {
302
297
  );
303
298
  }
304
299
  replay(options) {
305
- return chunkXHVQDEVO_js.safe(
300
+ return chunkH2WXUTMT_js.safe(
306
301
  this.transport.get(
307
302
  `${this.sessionPath}/${PURCHASE_INTENT_ROUTE.REPLAY}`,
308
303
  {
@@ -315,7 +310,7 @@ var HostedPurchaseIntentService = class {
315
310
  submitAction(_intentId, attemptId, request, options) {
316
311
  const normalized = attemptId.trim();
317
312
  if (!normalized) throw new TypeError("attemptId must not be empty");
318
- return chunkXHVQDEVO_js.safe(
313
+ return chunkH2WXUTMT_js.safe(
319
314
  this.transport.post(
320
315
  `${this.sessionPath}/${PURCHASE_INTENT_ROUTE.ATTEMPTS}/${encodeURIComponent(normalized)}/${PURCHASE_INTENT_ROUTE.ACTIONS}`,
321
316
  request,
@@ -341,7 +336,7 @@ var StoreCreditQueries = class {
341
336
  * currency. Requires a signed-in customer; returns an error otherwise.
342
337
  */
343
338
  async balance() {
344
- return chunkXHVQDEVO_js.safe(this.client.get("/api/v1/store-credit/balance"));
339
+ return chunkH2WXUTMT_js.safe(this.client.get("/api/v1/store-credit/balance"));
345
340
  }
346
341
  };
347
342
 
@@ -717,7 +712,7 @@ var ActivityService = class {
717
712
  this.sendEvents([event]);
718
713
  }
719
714
  async getState() {
720
- return chunkXHVQDEVO_js.safe(this.client.get("/api/v1/activity/state"));
715
+ return chunkH2WXUTMT_js.safe(this.client.get("/api/v1/activity/state"));
721
716
  }
722
717
  async getRecommendations(options) {
723
718
  const params = new URLSearchParams();
@@ -725,10 +720,10 @@ var ActivityService = class {
725
720
  if (options?.limit) params.set("limit", String(options.limit));
726
721
  const query = params.toString();
727
722
  const path = query ? `/api/v1/activity/recommendations?${query}` : "/api/v1/activity/recommendations";
728
- return chunkXHVQDEVO_js.safe(this.client.get(path));
723
+ return chunkH2WXUTMT_js.safe(this.client.get(path));
729
724
  }
730
725
  async dismissMessage(code) {
731
- return chunkXHVQDEVO_js.safe(
726
+ return chunkH2WXUTMT_js.safe(
732
727
  this.client.post("/api/v1/activity/messages/dismiss", { code })
733
728
  );
734
729
  }
@@ -834,16 +829,16 @@ var SubscriptionService = class {
834
829
  this.client = client;
835
830
  }
836
831
  async list() {
837
- return chunkXHVQDEVO_js.safe(this.client.get("/api/v1/subscriptions"));
832
+ return chunkH2WXUTMT_js.safe(this.client.get("/api/v1/subscriptions"));
838
833
  }
839
834
  async get(id) {
840
835
  const encodedId = encodeURIComponent(id);
841
- return chunkXHVQDEVO_js.safe(this.client.get(`/api/v1/subscriptions/${encodedId}`));
836
+ return chunkH2WXUTMT_js.safe(this.client.get(`/api/v1/subscriptions/${encodedId}`));
842
837
  }
843
838
  async cancel(id, reason, opts) {
844
839
  const encodedId = encodeURIComponent(id);
845
- const idempotencyKey = opts?.idempotencyKey ?? chunkXHVQDEVO_js.generateIdempotencyKey();
846
- return chunkXHVQDEVO_js.safe(
840
+ const idempotencyKey = opts?.idempotencyKey ?? chunkH2WXUTMT_js.generateIdempotencyKey();
841
+ return chunkH2WXUTMT_js.safe(
847
842
  this.client.post(
848
843
  `/api/v1/subscriptions/${encodedId}/cancel`,
849
844
  { reason },
@@ -853,20 +848,20 @@ var SubscriptionService = class {
853
848
  }
854
849
  async pause(id) {
855
850
  const encodedId = encodeURIComponent(id);
856
- return chunkXHVQDEVO_js.safe(
851
+ return chunkH2WXUTMT_js.safe(
857
852
  this.client.post(`/api/v1/subscriptions/${encodedId}/pause`)
858
853
  );
859
854
  }
860
855
  async resume(id) {
861
856
  const encodedId = encodeURIComponent(id);
862
- return chunkXHVQDEVO_js.safe(
857
+ return chunkH2WXUTMT_js.safe(
863
858
  this.client.post(`/api/v1/subscriptions/${encodedId}/resume`)
864
859
  );
865
860
  }
866
861
  async skipNextRenewal(id, opts) {
867
862
  const encodedId = encodeURIComponent(id);
868
- const idempotencyKey = opts?.idempotencyKey ?? chunkXHVQDEVO_js.generateIdempotencyKey();
869
- return chunkXHVQDEVO_js.safe(
863
+ const idempotencyKey = opts?.idempotencyKey ?? chunkH2WXUTMT_js.generateIdempotencyKey();
864
+ return chunkH2WXUTMT_js.safe(
870
865
  this.client.post(
871
866
  `/api/v1/subscriptions/${encodedId}/skip`,
872
867
  void 0,
@@ -882,8 +877,8 @@ var UploadService = class {
882
877
  this.client = client;
883
878
  }
884
879
  async init(filename, contentType2, sizeBytes, opts) {
885
- const idempotencyKey = opts?.idempotencyKey ?? chunkXHVQDEVO_js.generateIdempotencyKey();
886
- return chunkXHVQDEVO_js.safe(
880
+ const idempotencyKey = opts?.idempotencyKey ?? chunkH2WXUTMT_js.generateIdempotencyKey();
881
+ return chunkH2WXUTMT_js.safe(
887
882
  this.client.post(
888
883
  "/api/v1/uploads/init",
889
884
  {
@@ -896,7 +891,7 @@ var UploadService = class {
896
891
  );
897
892
  }
898
893
  async confirm(uploadId) {
899
- return chunkXHVQDEVO_js.safe(
894
+ return chunkH2WXUTMT_js.safe(
900
895
  this.client.post("/api/v1/uploads/confirm", {
901
896
  upload_id: uploadId
902
897
  })
@@ -942,7 +937,7 @@ var PlacesService = class {
942
937
  this.client = client;
943
938
  }
944
939
  async autocomplete(input, sessionToken) {
945
- return chunkXHVQDEVO_js.safe(
940
+ return chunkH2WXUTMT_js.safe(
946
941
  this.client.post("/api/v1/places/autocomplete", {
947
942
  input,
948
943
  sessionToken
@@ -950,7 +945,7 @@ var PlacesService = class {
950
945
  );
951
946
  }
952
947
  async details(placeId, sessionToken) {
953
- return chunkXHVQDEVO_js.safe(
948
+ return chunkH2WXUTMT_js.safe(
954
949
  this.client.post("/api/v1/places/details", {
955
950
  place_id: placeId,
956
951
  sessionToken
@@ -969,7 +964,7 @@ var DeliveryService = class {
969
964
  params.set("dropoff_lat", String(dropoffLat));
970
965
  params.set("dropoff_lng", String(dropoffLng));
971
966
  if (country) params.set("country", country);
972
- return chunkXHVQDEVO_js.safe(this.client.get(`/api/v1/delivery/fee?${params.toString()}`));
967
+ return chunkH2WXUTMT_js.safe(this.client.get(`/api/v1/delivery/fee?${params.toString()}`));
973
968
  }
974
969
  async getOptions(queryOrLatitude, longitude, legacyOptions) {
975
970
  const query = typeof queryOrLatitude === "number" ? {
@@ -983,7 +978,7 @@ var DeliveryService = class {
983
978
  if (query.country) params.set("country", query.country);
984
979
  if (query.currency) params.set("currency", query.currency);
985
980
  if (query.orderValue != null) params.set("order_value", String(query.orderValue));
986
- return chunkXHVQDEVO_js.safe(
981
+ return chunkH2WXUTMT_js.safe(
987
982
  this.client.get(`/api/v1/delivery/options?${params.toString()}`)
988
983
  );
989
984
  }
@@ -1155,7 +1150,7 @@ var SupportService = class {
1155
1150
  async claimConversation() {
1156
1151
  const accessToken = this.client.getAccessToken();
1157
1152
  if (!accessToken) {
1158
- return chunkXHVQDEVO_js.err(new chunkAVXA4F6G_js.CimplifyError("not_authenticated", "No access token to claim with"));
1153
+ return chunkH2WXUTMT_js.err(new chunkAVXA4F6G_js.CimplifyError("not_authenticated", "No access token to claim with"));
1159
1154
  }
1160
1155
  if (this.claimInFlight) {
1161
1156
  if (this.claimInFlightToken === accessToken) return this.claimInFlight;
@@ -1163,12 +1158,12 @@ var SupportService = class {
1163
1158
  return this.claimConversation();
1164
1159
  }
1165
1160
  if (this.lastClaimedAccessToken === accessToken) {
1166
- return chunkXHVQDEVO_js.err(new chunkAVXA4F6G_js.CimplifyError("already_claimed", "Session already claimed for this token"));
1161
+ return chunkH2WXUTMT_js.err(new chunkAVXA4F6G_js.CimplifyError("already_claimed", "Session already claimed for this token"));
1167
1162
  }
1168
1163
  const epoch = this.client.getSessionEpoch();
1169
1164
  this.claimInFlightToken = accessToken;
1170
1165
  this.claimInFlight = (async () => {
1171
- const result = await chunkXHVQDEVO_js.safe(
1166
+ const result = await chunkH2WXUTMT_js.safe(
1172
1167
  this.client.post(
1173
1168
  "/api/v1/support/conversation/claim",
1174
1169
  { access_token: accessToken },
@@ -1177,7 +1172,7 @@ var SupportService = class {
1177
1172
  );
1178
1173
  if (result.ok) {
1179
1174
  if (this.client.getSessionEpoch() !== epoch) {
1180
- return chunkXHVQDEVO_js.err(
1175
+ return chunkH2WXUTMT_js.err(
1181
1176
  new chunkAVXA4F6G_js.CimplifyError("session_cleared", "Session was cleared during the claim")
1182
1177
  );
1183
1178
  }
@@ -1208,9 +1203,9 @@ var SupportService = class {
1208
1203
  */
1209
1204
  async claimExternalChats() {
1210
1205
  if (!this.client.getAccessToken()) {
1211
- return chunkXHVQDEVO_js.err(new chunkAVXA4F6G_js.CimplifyError("not_authenticated", "No access token to claim with"));
1206
+ return chunkH2WXUTMT_js.err(new chunkAVXA4F6G_js.CimplifyError("not_authenticated", "No access token to claim with"));
1212
1207
  }
1213
- return chunkXHVQDEVO_js.safe(
1208
+ return chunkH2WXUTMT_js.safe(
1214
1209
  (async () => {
1215
1210
  const businessId = await this.client.resolveBusinessId();
1216
1211
  return this.client.post("/v1/me/chats/external-claims", {
@@ -1225,26 +1220,26 @@ var SupportService = class {
1225
1220
  * the inbox with empty threads.
1226
1221
  */
1227
1222
  async peekConversation() {
1228
- const result = await chunkXHVQDEVO_js.safe(
1223
+ const result = await chunkH2WXUTMT_js.safe(
1229
1224
  this.client.get("/api/v1/support/conversation")
1230
1225
  );
1231
1226
  if (!result.ok) return result;
1232
- if (!result.value.conversation) return chunkXHVQDEVO_js.ok(null);
1233
- return chunkXHVQDEVO_js.ok({
1227
+ if (!result.value.conversation) return chunkH2WXUTMT_js.ok(null);
1228
+ return chunkH2WXUTMT_js.ok({
1234
1229
  conversation: result.value.conversation,
1235
1230
  messages: chatMessagesFromWire(result.value.messages)
1236
1231
  });
1237
1232
  }
1238
1233
  /** Open (or resume) the customer's widget conversation. */
1239
1234
  async openConversation(opts) {
1240
- const idempotencyKey = opts?.idempotencyKey ?? chunkXHVQDEVO_js.generateIdempotencyKey();
1241
- const result = await chunkXHVQDEVO_js.safe(
1235
+ const idempotencyKey = opts?.idempotencyKey ?? chunkH2WXUTMT_js.generateIdempotencyKey();
1236
+ const result = await chunkH2WXUTMT_js.safe(
1242
1237
  this.client.post("/api/v1/support/conversation", void 0, {
1243
1238
  idempotencyKey
1244
1239
  })
1245
1240
  );
1246
1241
  if (!result.ok) return result;
1247
- return chunkXHVQDEVO_js.ok({
1242
+ return chunkH2WXUTMT_js.ok({
1248
1243
  conversation: result.value.conversation,
1249
1244
  messages: chatMessagesFromWire(result.value.messages)
1250
1245
  });
@@ -1258,8 +1253,8 @@ var SupportService = class {
1258
1253
  * server resolves it thread-scoped and echoes the quote as `reply_to`.
1259
1254
  */
1260
1255
  async sendMessage(content, opts) {
1261
- const idempotencyKey = opts?.idempotencyKey ?? chunkXHVQDEVO_js.generateIdempotencyKey();
1262
- const result = await chunkXHVQDEVO_js.safe(
1256
+ const idempotencyKey = opts?.idempotencyKey ?? chunkH2WXUTMT_js.generateIdempotencyKey();
1257
+ const result = await chunkH2WXUTMT_js.safe(
1263
1258
  this.client.post(
1264
1259
  "/api/v1/support/conversation/messages",
1265
1260
  {
@@ -1271,7 +1266,7 @@ var SupportService = class {
1271
1266
  { idempotencyKey }
1272
1267
  )
1273
1268
  );
1274
- return result.ok ? chunkXHVQDEVO_js.ok(chatMessageFromWire(result.value.message)) : result;
1269
+ return result.ok ? chunkH2WXUTMT_js.ok(chatMessageFromWire(result.value.message)) : result;
1275
1270
  }
1276
1271
  /**
1277
1272
  * Poll for messages. `after` pages forward (live updates); `before` pages
@@ -1286,25 +1281,25 @@ var SupportService = class {
1286
1281
  if (options.limit) params.set("limit", String(options.limit));
1287
1282
  const query = params.toString();
1288
1283
  const path = query ? `/api/v1/support/conversation/messages?${query}` : "/api/v1/support/conversation/messages";
1289
- const result = await chunkXHVQDEVO_js.safe(this.client.get(path));
1290
- return result.ok ? chunkXHVQDEVO_js.ok(chatMessagesFromWire(result.value)) : result;
1284
+ const result = await chunkH2WXUTMT_js.safe(this.client.get(path));
1285
+ return result.ok ? chunkH2WXUTMT_js.ok(chatMessagesFromWire(result.value)) : result;
1291
1286
  }
1292
1287
  /** React to a message in the active conversation by its `ChatMessage.id`. */
1293
1288
  async reactToMessage(messageId, emoji) {
1294
- const clientId = chunkXHVQDEVO_js.generateIdempotencyKey();
1295
- const result = await chunkXHVQDEVO_js.safe(
1289
+ const clientId = chunkH2WXUTMT_js.generateIdempotencyKey();
1290
+ const result = await chunkH2WXUTMT_js.safe(
1296
1291
  this.client.post(
1297
1292
  `/api/v1/support/conversation/messages/${messageId}/reactions`,
1298
1293
  { emoji, client_id: clientId },
1299
1294
  { idempotencyKey: clientId }
1300
1295
  )
1301
1296
  );
1302
- return result.ok ? chunkXHVQDEVO_js.ok(chatMessageFromWire(result.value.message)) : result;
1297
+ return result.ok ? chunkH2WXUTMT_js.ok(chatMessageFromWire(result.value.message)) : result;
1303
1298
  }
1304
1299
  /** Ask for a person: flags the thread for the merchant's inbox. */
1305
1300
  async requestHuman(opts) {
1306
- const idempotencyKey = opts?.idempotencyKey ?? chunkXHVQDEVO_js.generateIdempotencyKey();
1307
- return chunkXHVQDEVO_js.safe(
1301
+ const idempotencyKey = opts?.idempotencyKey ?? chunkH2WXUTMT_js.generateIdempotencyKey();
1302
+ return chunkH2WXUTMT_js.safe(
1308
1303
  this.client.post(
1309
1304
  "/api/v1/support/conversation/handoff",
1310
1305
  void 0,
@@ -1588,7 +1583,7 @@ var CimplifyClient = class {
1588
1583
  this.maxRetries = config.maxRetries ?? DEFAULT_MAX_RETRIES;
1589
1584
  this.retryDelay = config.retryDelay ?? DEFAULT_RETRY_DELAY_MS;
1590
1585
  this.hooks = config.hooks ?? {};
1591
- this.authorizationAdapters = config.authorizationAdapterRegistry ?? chunkXHVQDEVO_js.createDefaultPaymentAuthorizationAdapterRegistry();
1586
+ this.authorizationAdapters = config.authorizationAdapterRegistry ?? chunkH2WXUTMT_js.createDefaultPaymentAuthorizationAdapterRegistry();
1592
1587
  this.fetchImpl = (config.fetch ?? globalThis.fetch).bind(globalThis);
1593
1588
  this.sessionToken = this.loadSessionToken() ?? this.mintSessionToken();
1594
1589
  const persistedSessionSync = this.loadSessionSyncPayload();
@@ -2303,19 +2298,19 @@ var CimplifyClient = class {
2303
2298
  }
2304
2299
  get catalogue() {
2305
2300
  if (!this._catalogue) {
2306
- this._catalogue = new chunkXHVQDEVO_js.CatalogueQueries(this);
2301
+ this._catalogue = new chunkH2WXUTMT_js.CatalogueQueries(this);
2307
2302
  }
2308
2303
  return this._catalogue;
2309
2304
  }
2310
2305
  get cart() {
2311
2306
  if (!this._cart) {
2312
- this._cart = new chunkXHVQDEVO_js.CartOperations(this);
2307
+ this._cart = new chunkH2WXUTMT_js.CartOperations(this);
2313
2308
  }
2314
2309
  return this._cart;
2315
2310
  }
2316
2311
  get checkout() {
2317
2312
  if (!this._checkout) {
2318
- this._checkout = new chunkXHVQDEVO_js.CheckoutService(this);
2313
+ this._checkout = new chunkH2WXUTMT_js.CheckoutService(this);
2319
2314
  }
2320
2315
  return this._checkout;
2321
2316
  }
@@ -2327,7 +2322,7 @@ var CimplifyClient = class {
2327
2322
  }
2328
2323
  get orders() {
2329
2324
  if (!this._orders) {
2330
- this._orders = new chunkXHVQDEVO_js.OrderQueries(this);
2325
+ this._orders = new chunkH2WXUTMT_js.OrderQueries(this);
2331
2326
  }
2332
2327
  return this._orders;
2333
2328
  }
@@ -2357,43 +2352,43 @@ var CimplifyClient = class {
2357
2352
  }
2358
2353
  get link() {
2359
2354
  if (!this._link) {
2360
- this._link = new chunkXHVQDEVO_js.LinkService(this);
2355
+ this._link = new chunkH2WXUTMT_js.LinkService(this);
2361
2356
  }
2362
2357
  return this._link;
2363
2358
  }
2364
2359
  get auth() {
2365
2360
  if (!this._auth) {
2366
- this._auth = new chunkXHVQDEVO_js.AuthService(this);
2361
+ this._auth = new chunkH2WXUTMT_js.AuthService(this);
2367
2362
  }
2368
2363
  return this._auth;
2369
2364
  }
2370
2365
  get business() {
2371
2366
  if (!this._business) {
2372
- this._business = new chunkXHVQDEVO_js.BusinessService(this);
2367
+ this._business = new chunkH2WXUTMT_js.BusinessService(this);
2373
2368
  }
2374
2369
  return this._business;
2375
2370
  }
2376
2371
  get inventory() {
2377
2372
  if (!this._inventory) {
2378
- this._inventory = new chunkXHVQDEVO_js.InventoryService(this);
2373
+ this._inventory = new chunkH2WXUTMT_js.InventoryService(this);
2379
2374
  }
2380
2375
  return this._inventory;
2381
2376
  }
2382
2377
  get scheduling() {
2383
2378
  if (!this._scheduling) {
2384
- this._scheduling = new chunkXHVQDEVO_js.SchedulingService(this);
2379
+ this._scheduling = new chunkH2WXUTMT_js.SchedulingService(this);
2385
2380
  }
2386
2381
  return this._scheduling;
2387
2382
  }
2388
2383
  get lite() {
2389
2384
  if (!this._lite) {
2390
- this._lite = new chunkXHVQDEVO_js.LiteService(this);
2385
+ this._lite = new chunkH2WXUTMT_js.LiteService(this);
2391
2386
  }
2392
2387
  return this._lite;
2393
2388
  }
2394
2389
  get fx() {
2395
2390
  if (!this._fx) {
2396
- this._fx = new chunkXHVQDEVO_js.FxService(this);
2391
+ this._fx = new chunkH2WXUTMT_js.FxService(this);
2397
2392
  }
2398
2393
  return this._fx;
2399
2394
  }
@@ -2428,7 +2423,7 @@ var CimplifyClient = class {
2428
2423
  if (businessId) {
2429
2424
  this.setBusinessId(businessId);
2430
2425
  }
2431
- return chunkXHVQDEVO_js.createElements(this, businessId ?? this.businessId ?? void 0, options);
2426
+ return chunkH2WXUTMT_js.createElements(this, businessId ?? this.businessId ?? void 0, options);
2432
2427
  }
2433
2428
  };
2434
2429
  function createCimplifyClient(config = {}) {
@@ -1,5 +1,5 @@
1
- import { C as CimplifyClient } from './catalogue-D1jkpGcr.js';
2
- import { A as AppHandle, C as CreateAppOptions } from './server-C_RIDnHU.js';
1
+ import { C as CimplifyClient } from './catalogue-lUdp-1hu.js';
2
+ import { A as AppHandle, C as CreateAppOptions } from './server-7soMMUgP.js';
3
3
 
4
4
  /**
5
5
  * Test client + fixtures.
@@ -71,6 +71,16 @@ declare const fixtures: {
71
71
  name: string;
72
72
  email: string;
73
73
  phone: string;
74
+ save_details: boolean;
75
+ };
76
+ deliveryAddress(overrides?: Partial<{
77
+ street_address: string;
78
+ city: string;
79
+ region: string;
80
+ }>): {
81
+ street_address: string;
82
+ city: string;
83
+ region: string;
74
84
  };
75
85
  /**
76
86
  * Run the full guest auth flow (request OTP → verify) and return
@@ -1,5 +1,5 @@
1
- import { C as CimplifyClient } from './catalogue-DjutZ0FC.mjs';
2
- import { A as AppHandle, C as CreateAppOptions } from './server-Byr4d0hL.mjs';
1
+ import { C as CimplifyClient } from './catalogue-CB44dO-g.mjs';
2
+ import { A as AppHandle, C as CreateAppOptions } from './server-DDEJ7e9s.mjs';
3
3
 
4
4
  /**
5
5
  * Test client + fixtures.
@@ -71,6 +71,16 @@ declare const fixtures: {
71
71
  name: string;
72
72
  email: string;
73
73
  phone: string;
74
+ save_details: boolean;
75
+ };
76
+ deliveryAddress(overrides?: Partial<{
77
+ street_address: string;
78
+ city: string;
79
+ region: string;
80
+ }>): {
81
+ street_address: string;
82
+ city: string;
83
+ region: string;
74
84
  };
75
85
  /**
76
86
  * Run the full guest auth flow (request OTP → verify) and return
@@ -1,4 +1,4 @@
1
- import './catalogue-D1jkpGcr.js';
1
+ import './catalogue-lUdp-1hu.js';
2
2
  import './checkout-XoV4HNg2.js';
3
3
 
4
4
  declare function generateIdempotencyKey(prefix?: string): string;
@@ -1,4 +1,4 @@
1
- import './catalogue-DjutZ0FC.mjs';
1
+ import './catalogue-CB44dO-g.mjs';
2
2
  import './checkout-XoV4HNg2.mjs';
3
3
 
4
4
  declare function generateIdempotencyKey(prefix?: string): string;