@cimplify/sdk 0.52.1 → 0.53.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 (60) hide show
  1. package/dist/{ads-BxbWrwqp.d.mts → ads-C2c2Aald.d.mts} +1 -1
  2. package/dist/{ads-BxbWrwqp.d.ts → ads-C2c2Aald.d.ts} +1 -1
  3. package/dist/advanced.d.mts +3 -3
  4. package/dist/advanced.d.ts +3 -3
  5. package/dist/advanced.js +20 -20
  6. package/dist/advanced.mjs +1 -1
  7. package/dist/{chunk-R3F55BRN.mjs → chunk-3G4QCENX.mjs} +42 -22
  8. package/dist/{chunk-4QDCMYYB.mjs → chunk-6QZQQRBB.mjs} +21 -10
  9. package/dist/{chunk-GLAVTDDE.mjs → chunk-B3Y4C4A7.mjs} +56 -53
  10. package/dist/{chunk-7A3D3LFI.js → chunk-EJUKGJTZ.js} +4 -4
  11. package/dist/{chunk-Q5VGDCQF.js → chunk-HCZTBWU4.js} +42 -22
  12. package/dist/{chunk-W6CCBNGL.js → chunk-IJ32BXKZ.js} +55 -44
  13. package/dist/{chunk-RDORJT7Y.mjs → chunk-NEK7CVE2.mjs} +2 -2
  14. package/dist/{chunk-EQLT46ZR.js → chunk-YJLOOC3L.js} +56 -53
  15. package/dist/{client-C6J_RGlr.d.mts → client-306peWZ0.d.ts} +47 -29
  16. package/dist/{client-CX7IFIkL.d.ts → client-Bj2apl_y.d.mts} +47 -29
  17. package/dist/{client-Lt7uGLmT.d.ts → client-C2bKMy5g.d.ts} +2 -2
  18. package/dist/{client-DdefKjcs.d.mts → client-D1Gknspz.d.mts} +2 -2
  19. package/dist/{index-Bo0NjgR6.d.mts → index-D8vnKlOQ.d.mts} +4 -4
  20. package/dist/{index-BAohYhdg.d.ts → index-DIIlPUOC.d.ts} +4 -4
  21. package/dist/index.d.mts +7 -7
  22. package/dist/index.d.ts +7 -7
  23. package/dist/index.js +61 -61
  24. package/dist/index.mjs +2 -2
  25. package/dist/mock/cli.mjs +42 -22
  26. package/dist/mock/library.js +42 -22
  27. package/dist/mock/library.mjs +42 -22
  28. package/dist/mock/msw.js +42 -22
  29. package/dist/mock/msw.mjs +42 -22
  30. package/dist/{payment-_e99nSRj.d.ts → payment-DVS7ZUEp.d.mts} +2 -2
  31. package/dist/{payment-9L_-GWqQ.d.mts → payment-sn-yGL7v.d.ts} +2 -2
  32. package/dist/{price-BjehlIhG.d.mts → price-9T1Y47oS.d.ts} +2 -2
  33. package/dist/{price-CWQ5TQmk.d.ts → price-Cm0tU0V5.d.mts} +2 -2
  34. package/dist/{product-C-xLzh7Q.d.mts → product-B_kS4Oxa.d.mts} +1 -1
  35. package/dist/{product-C-xLzh7Q.d.ts → product-B_kS4Oxa.d.ts} +1 -1
  36. package/dist/react.d.mts +6 -6
  37. package/dist/react.d.ts +6 -6
  38. package/dist/react.js +16 -16
  39. package/dist/react.mjs +2 -2
  40. package/dist/{server-72rzvJ4Y.d.ts → server-BQzz921M.d.ts} +1 -1
  41. package/dist/{server-BgccqOLT.d.mts → server-D8rwqZQ6.d.mts} +1 -1
  42. package/dist/server.d.mts +20 -12
  43. package/dist/server.d.ts +20 -12
  44. package/dist/server.js +3 -3
  45. package/dist/server.mjs +2 -2
  46. package/dist/testing/msw.d.mts +2 -2
  47. package/dist/testing/msw.d.ts +2 -2
  48. package/dist/testing/msw.js +2 -2
  49. package/dist/testing/msw.mjs +1 -1
  50. package/dist/testing/suite.d.mts +6 -6
  51. package/dist/testing/suite.d.ts +6 -6
  52. package/dist/testing/suite.js +23 -23
  53. package/dist/testing/suite.mjs +4 -4
  54. package/dist/testing.d.mts +5 -5
  55. package/dist/testing.d.ts +5 -5
  56. package/dist/testing.js +79 -79
  57. package/dist/testing.mjs +5 -5
  58. package/dist/utils.d.mts +4 -4
  59. package/dist/utils.d.ts +4 -4
  60. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkQ5VGDCQF_js = require('./chunk-Q5VGDCQF.js');
4
- var chunkW6CCBNGL_js = require('./chunk-W6CCBNGL.js');
3
+ var chunkHCZTBWU4_js = require('./chunk-HCZTBWU4.js');
4
+ var chunkIJ32BXKZ_js = require('./chunk-IJ32BXKZ.js');
5
5
  var zod = require('zod');
6
6
 
7
7
  var cimplifyRegistry = zod.z.registry();
@@ -595,7 +595,7 @@ async function toForwardedRequest(input, init) {
595
595
  };
596
596
  }
597
597
  function createTestClient(options = {}) {
598
- const mock = chunkQ5VGDCQF_js.createMockApp(options);
598
+ const mock = chunkHCZTBWU4_js.createMockApp(options);
599
599
  let sessionToken;
600
600
  const fetchImpl = async (input, init) => {
601
601
  const url = typeof input === "string" ? input : input instanceof URL ? input.toString() : input.url;
@@ -614,7 +614,7 @@ function createTestClient(options = {}) {
614
614
  if (echoed) sessionToken = echoed;
615
615
  return res;
616
616
  };
617
- const client = chunkW6CCBNGL_js.createCimplifyClient({
617
+ const client = chunkIJ32BXKZ_js.createCimplifyClient({
618
618
  baseUrl: TEST_BASE_URL,
619
619
  // Link mock lives at /v1/link on the same Hono app, so point the SDK's
620
620
  // separate Link transport at the same TEST_BASE_URL.
@@ -3,7 +3,7 @@
3
3
  var chunkXA3ZNR75_js = require('./chunk-XA3ZNR75.js');
4
4
  var chunkOWW5GUSB_js = require('./chunk-OWW5GUSB.js');
5
5
 
6
- // ../node_modules/.bun/hono@4.12.16/node_modules/hono/dist/compose.js
6
+ // ../node_modules/.bun/hono@4.12.22/node_modules/hono/dist/compose.js
7
7
  var compose = (middleware, onError, onNotFound) => {
8
8
  return (context, next) => {
9
9
  let index = -1;
@@ -47,10 +47,10 @@ var compose = (middleware, onError, onNotFound) => {
47
47
  };
48
48
  };
49
49
 
50
- // ../node_modules/.bun/hono@4.12.16/node_modules/hono/dist/request/constants.js
50
+ // ../node_modules/.bun/hono@4.12.22/node_modules/hono/dist/request/constants.js
51
51
  var GET_MATCH_RESULT = /* @__PURE__ */ Symbol();
52
52
 
53
- // ../node_modules/.bun/hono@4.12.16/node_modules/hono/dist/utils/body.js
53
+ // ../node_modules/.bun/hono@4.12.22/node_modules/hono/dist/utils/body.js
54
54
  var parseBody = async (request, options = /* @__PURE__ */ Object.create(null)) => {
55
55
  const { all = false, dot = false } = options;
56
56
  const headers = request instanceof HonoRequest ? request.raw.headers : request.headers;
@@ -121,7 +121,7 @@ var handleParsingNestedValues = (form, key, value) => {
121
121
  });
122
122
  };
123
123
 
124
- // ../node_modules/.bun/hono@4.12.16/node_modules/hono/dist/utils/url.js
124
+ // ../node_modules/.bun/hono@4.12.22/node_modules/hono/dist/utils/url.js
125
125
  var splitPath = (path) => {
126
126
  const paths = path.split("/");
127
127
  if (paths[0] === "") {
@@ -324,7 +324,7 @@ var getQueryParams = (url, key) => {
324
324
  };
325
325
  var decodeURIComponent_ = decodeURIComponent;
326
326
 
327
- // ../node_modules/.bun/hono@4.12.16/node_modules/hono/dist/request.js
327
+ // ../node_modules/.bun/hono@4.12.22/node_modules/hono/dist/request.js
328
328
  var tryDecodeURIComponent = (str) => tryDecode(str, decodeURIComponent_);
329
329
  var _validatedData, _matchResult, _HonoRequest_instances, getDecodedParam_fn, getAllDecodedParams_fn, getParamValue_fn, _cachedBody, _a;
330
330
  var HonoRequest = (_a = class {
@@ -452,6 +452,21 @@ var HonoRequest = (_a = class {
452
452
  arrayBuffer() {
453
453
  return chunkOWW5GUSB_js.__privateGet(this, _cachedBody).call(this, "arrayBuffer");
454
454
  }
455
+ /**
456
+ * `.bytes()` parses the request body as a `Uint8Array`.
457
+ *
458
+ * @see {@link https://hono.dev/docs/api/request#bytes}
459
+ *
460
+ * @example
461
+ * ```ts
462
+ * app.post('/entry', async (c) => {
463
+ * const body = await c.req.bytes()
464
+ * })
465
+ * ```
466
+ */
467
+ bytes() {
468
+ return chunkOWW5GUSB_js.__privateGet(this, _cachedBody).call(this, "arrayBuffer").then((buffer) => new Uint8Array(buffer));
469
+ }
455
470
  /**
456
471
  * Parses the request body as a `Blob`.
457
472
  * @example
@@ -591,7 +606,7 @@ var HonoRequest = (_a = class {
591
606
  return chunkOWW5GUSB_js.__privateGet(this, _matchResult)[1] ? chunkOWW5GUSB_js.__privateGet(this, _matchResult)[1][paramKey] : paramKey;
592
607
  }, _cachedBody = new WeakMap(), _a);
593
608
 
594
- // ../node_modules/.bun/hono@4.12.16/node_modules/hono/dist/utils/html.js
609
+ // ../node_modules/.bun/hono@4.12.22/node_modules/hono/dist/utils/html.js
595
610
  var HtmlEscapedCallbackPhase = {
596
611
  Stringify: 1};
597
612
  var resolveCallback = async (str, phase, preserveCallbacks, context, buffer) => {
@@ -622,7 +637,7 @@ var resolveCallback = async (str, phase, preserveCallbacks, context, buffer) =>
622
637
  }
623
638
  };
624
639
 
625
- // ../node_modules/.bun/hono@4.12.16/node_modules/hono/dist/context.js
640
+ // ../node_modules/.bun/hono@4.12.22/node_modules/hono/dist/context.js
626
641
  var TEXT_PLAIN = "text/plain; charset=UTF-8";
627
642
  var setDefaultContentType = (contentType, headers) => {
628
643
  return {
@@ -1022,7 +1037,7 @@ var Context = (_a2 = class {
1022
1037
  return createResponseInstance(data, { status, headers: responseHeaders });
1023
1038
  }, _a2);
1024
1039
 
1025
- // ../node_modules/.bun/hono@4.12.16/node_modules/hono/dist/router.js
1040
+ // ../node_modules/.bun/hono@4.12.22/node_modules/hono/dist/router.js
1026
1041
  var METHOD_NAME_ALL = "ALL";
1027
1042
  var METHOD_NAME_ALL_LOWERCASE = "all";
1028
1043
  var METHODS = ["get", "post", "put", "delete", "options", "patch"];
@@ -1030,10 +1045,10 @@ var MESSAGE_MATCHER_IS_ALREADY_BUILT = "Can not add a route since the matcher is
1030
1045
  var UnsupportedPathError = class extends Error {
1031
1046
  };
1032
1047
 
1033
- // ../node_modules/.bun/hono@4.12.16/node_modules/hono/dist/utils/constants.js
1048
+ // ../node_modules/.bun/hono@4.12.22/node_modules/hono/dist/utils/constants.js
1034
1049
  var COMPOSED_HANDLER = "__COMPOSED_HANDLER";
1035
1050
 
1036
- // ../node_modules/.bun/hono@4.12.16/node_modules/hono/dist/hono-base.js
1051
+ // ../node_modules/.bun/hono@4.12.22/node_modules/hono/dist/hono-base.js
1037
1052
  var notFoundHandler = (c) => {
1038
1053
  return c.text("404 Not Found", 404);
1039
1054
  };
@@ -1242,7 +1257,7 @@ var Hono = (_a3 = class {
1242
1257
  handler = async (c, next) => (await compose([], app.errorHandler)(c, () => r.handler(c, next))).res;
1243
1258
  handler[COMPOSED_HANDLER] = r.handler;
1244
1259
  }
1245
- chunkOWW5GUSB_js.__privateMethod(_a10 = subApp, __Hono_instances, addRoute_fn).call(_a10, r.method, r.path, handler);
1260
+ chunkOWW5GUSB_js.__privateMethod(_a10 = subApp, __Hono_instances, addRoute_fn).call(_a10, r.method, r.path, handler, r.basePath);
1246
1261
  });
1247
1262
  return this;
1248
1263
  }
@@ -1327,7 +1342,7 @@ var Hono = (_a3 = class {
1327
1342
  const pathPrefixLength = mergedPath === "/" ? 0 : mergedPath.length;
1328
1343
  return (request) => {
1329
1344
  const url = new URL(request.url);
1330
- url.pathname = url.pathname.slice(pathPrefixLength) || "/";
1345
+ url.pathname = this.getPath(request).slice(pathPrefixLength) || "/";
1331
1346
  return new Request(url, request);
1332
1347
  };
1333
1348
  })());
@@ -1350,10 +1365,15 @@ var Hono = (_a3 = class {
1350
1365
  chunkOWW5GUSB_js.__privateSet(clone, _notFoundHandler2, chunkOWW5GUSB_js.__privateGet(this, _notFoundHandler2));
1351
1366
  clone.routes = this.routes;
1352
1367
  return clone;
1353
- }, _notFoundHandler2 = new WeakMap(), addRoute_fn = function(method, path, handler) {
1368
+ }, _notFoundHandler2 = new WeakMap(), addRoute_fn = function(method, path, handler, baseRoutePath) {
1354
1369
  method = method.toUpperCase();
1355
1370
  path = mergePath(this._basePath, path);
1356
- const r = { basePath: this._basePath, path, method, handler };
1371
+ const r = {
1372
+ basePath: baseRoutePath !== void 0 ? mergePath(this._basePath, baseRoutePath) : this._basePath,
1373
+ path,
1374
+ method,
1375
+ handler
1376
+ };
1357
1377
  this.router.add(method, path, [handler, r]);
1358
1378
  this.routes.push(r);
1359
1379
  }, handleError_fn = function(err, c) {
@@ -1403,7 +1423,7 @@ var Hono = (_a3 = class {
1403
1423
  })();
1404
1424
  }, _a3);
1405
1425
 
1406
- // ../node_modules/.bun/hono@4.12.16/node_modules/hono/dist/router/reg-exp-router/matcher.js
1426
+ // ../node_modules/.bun/hono@4.12.22/node_modules/hono/dist/router/reg-exp-router/matcher.js
1407
1427
  var emptyParam = [];
1408
1428
  function match(method, path) {
1409
1429
  const matchers = this.buildAllMatchers();
@@ -1424,7 +1444,7 @@ function match(method, path) {
1424
1444
  return match2(method, path);
1425
1445
  }
1426
1446
 
1427
- // ../node_modules/.bun/hono@4.12.16/node_modules/hono/dist/router/reg-exp-router/node.js
1447
+ // ../node_modules/.bun/hono@4.12.22/node_modules/hono/dist/router/reg-exp-router/node.js
1428
1448
  var LABEL_REG_EXP_STR = "[^/]+";
1429
1449
  var ONLY_WILDCARD_REG_EXP_STR = ".*";
1430
1450
  var TAIL_WILDCARD_REG_EXP_STR = "(?:|/.*)";
@@ -1535,7 +1555,7 @@ var Node = (_a4 = class {
1535
1555
  }
1536
1556
  }, _index = new WeakMap(), _varIndex = new WeakMap(), _children = new WeakMap(), _a4);
1537
1557
 
1538
- // ../node_modules/.bun/hono@4.12.16/node_modules/hono/dist/router/reg-exp-router/trie.js
1558
+ // ../node_modules/.bun/hono@4.12.22/node_modules/hono/dist/router/reg-exp-router/trie.js
1539
1559
  var _context, _root, _a5;
1540
1560
  var Trie = (_a5 = class {
1541
1561
  constructor() {
@@ -1594,7 +1614,7 @@ var Trie = (_a5 = class {
1594
1614
  }
1595
1615
  }, _context = new WeakMap(), _root = new WeakMap(), _a5);
1596
1616
 
1597
- // ../node_modules/.bun/hono@4.12.16/node_modules/hono/dist/router/reg-exp-router/router.js
1617
+ // ../node_modules/.bun/hono@4.12.22/node_modules/hono/dist/router/reg-exp-router/router.js
1598
1618
  var nullMatcher = [/^$/, [], /* @__PURE__ */ Object.create(null)];
1599
1619
  var wildcardRegExpCache = /* @__PURE__ */ Object.create(null);
1600
1620
  function buildWildcardRegExp(path) {
@@ -1776,7 +1796,7 @@ var RegExpRouter = (_a6 = class {
1776
1796
  }
1777
1797
  }, _a6);
1778
1798
 
1779
- // ../node_modules/.bun/hono@4.12.16/node_modules/hono/dist/router/smart-router/router.js
1799
+ // ../node_modules/.bun/hono@4.12.22/node_modules/hono/dist/router/smart-router/router.js
1780
1800
  var _routers, _routes2, _a7;
1781
1801
  var SmartRouter = (_a7 = class {
1782
1802
  constructor(init) {
@@ -1832,7 +1852,7 @@ var SmartRouter = (_a7 = class {
1832
1852
  }
1833
1853
  }, _routers = new WeakMap(), _routes2 = new WeakMap(), _a7);
1834
1854
 
1835
- // ../node_modules/.bun/hono@4.12.16/node_modules/hono/dist/router/trie-router/node.js
1855
+ // ../node_modules/.bun/hono@4.12.22/node_modules/hono/dist/router/trie-router/node.js
1836
1856
  var emptyParams = /* @__PURE__ */ Object.create(null);
1837
1857
  var hasChildren = (children) => {
1838
1858
  for (const _ in children) {
@@ -2002,7 +2022,7 @@ var Node2 = (_a8 = class {
2002
2022
  }
2003
2023
  }, _a8);
2004
2024
 
2005
- // ../node_modules/.bun/hono@4.12.16/node_modules/hono/dist/router/trie-router/router.js
2025
+ // ../node_modules/.bun/hono@4.12.22/node_modules/hono/dist/router/trie-router/router.js
2006
2026
  var _node, _a9;
2007
2027
  var TrieRouter = (_a9 = class {
2008
2028
  constructor() {
@@ -2025,7 +2045,7 @@ var TrieRouter = (_a9 = class {
2025
2045
  }
2026
2046
  }, _node = new WeakMap(), _a9);
2027
2047
 
2028
- // ../node_modules/.bun/hono@4.12.16/node_modules/hono/dist/hono.js
2048
+ // ../node_modules/.bun/hono@4.12.22/node_modules/hono/dist/hono.js
2029
2049
  var Hono2 = class extends Hono {
2030
2050
  /**
2031
2051
  * Creates an instance of the Hono class.
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkEQLT46ZR_js = require('./chunk-EQLT46ZR.js');
3
+ var chunkYJLOOC3L_js = require('./chunk-YJLOOC3L.js');
4
4
  var chunkXA3ZNR75_js = require('./chunk-XA3ZNR75.js');
5
5
 
6
6
  // src/activity.ts
@@ -29,7 +29,7 @@ var ActivityService = class {
29
29
  this.sendEvents([event]);
30
30
  }
31
31
  async getState() {
32
- return chunkEQLT46ZR_js.safe(this.client.get("/api/v1/activity/state"));
32
+ return chunkYJLOOC3L_js.safe(this.client.get("/api/v1/activity/state"));
33
33
  }
34
34
  async getRecommendations(options) {
35
35
  const params = new URLSearchParams();
@@ -37,10 +37,10 @@ var ActivityService = class {
37
37
  if (options?.limit) params.set("limit", String(options.limit));
38
38
  const query = params.toString();
39
39
  const path = query ? `/api/v1/activity/recommendations?${query}` : "/api/v1/activity/recommendations";
40
- return chunkEQLT46ZR_js.safe(this.client.get(path));
40
+ return chunkYJLOOC3L_js.safe(this.client.get(path));
41
41
  }
42
42
  async dismissMessage(code) {
43
- return chunkEQLT46ZR_js.safe(
43
+ return chunkYJLOOC3L_js.safe(
44
44
  this.client.post("/api/v1/activity/messages/dismiss", { code })
45
45
  );
46
46
  }
@@ -62,16 +62,16 @@ var SubscriptionService = class {
62
62
  this.client = client;
63
63
  }
64
64
  async list() {
65
- return chunkEQLT46ZR_js.safe(this.client.get("/api/v1/subscriptions"));
65
+ return chunkYJLOOC3L_js.safe(this.client.get("/api/v1/subscriptions"));
66
66
  }
67
67
  async get(id) {
68
68
  const encodedId = encodeURIComponent(id);
69
- return chunkEQLT46ZR_js.safe(this.client.get(`/api/v1/subscriptions/${encodedId}`));
69
+ return chunkYJLOOC3L_js.safe(this.client.get(`/api/v1/subscriptions/${encodedId}`));
70
70
  }
71
71
  async cancel(id, reason, opts) {
72
72
  const encodedId = encodeURIComponent(id);
73
- const idempotencyKey = opts?.idempotencyKey ?? chunkEQLT46ZR_js.generateIdempotencyKey();
74
- return chunkEQLT46ZR_js.safe(
73
+ const idempotencyKey = opts?.idempotencyKey ?? chunkYJLOOC3L_js.generateIdempotencyKey();
74
+ return chunkYJLOOC3L_js.safe(
75
75
  this.client.post(
76
76
  `/api/v1/subscriptions/${encodedId}/cancel`,
77
77
  { reason },
@@ -81,20 +81,20 @@ var SubscriptionService = class {
81
81
  }
82
82
  async pause(id) {
83
83
  const encodedId = encodeURIComponent(id);
84
- return chunkEQLT46ZR_js.safe(
84
+ return chunkYJLOOC3L_js.safe(
85
85
  this.client.post(`/api/v1/subscriptions/${encodedId}/pause`)
86
86
  );
87
87
  }
88
88
  async resume(id) {
89
89
  const encodedId = encodeURIComponent(id);
90
- return chunkEQLT46ZR_js.safe(
90
+ return chunkYJLOOC3L_js.safe(
91
91
  this.client.post(`/api/v1/subscriptions/${encodedId}/resume`)
92
92
  );
93
93
  }
94
94
  async skipNextRenewal(id, opts) {
95
95
  const encodedId = encodeURIComponent(id);
96
- const idempotencyKey = opts?.idempotencyKey ?? chunkEQLT46ZR_js.generateIdempotencyKey();
97
- return chunkEQLT46ZR_js.safe(
96
+ const idempotencyKey = opts?.idempotencyKey ?? chunkYJLOOC3L_js.generateIdempotencyKey();
97
+ return chunkYJLOOC3L_js.safe(
98
98
  this.client.post(
99
99
  `/api/v1/subscriptions/${encodedId}/skip`,
100
100
  void 0,
@@ -110,8 +110,8 @@ var UploadService = class {
110
110
  this.client = client;
111
111
  }
112
112
  async init(filename, contentType, sizeBytes, opts) {
113
- const idempotencyKey = opts?.idempotencyKey ?? chunkEQLT46ZR_js.generateIdempotencyKey();
114
- return chunkEQLT46ZR_js.safe(
113
+ const idempotencyKey = opts?.idempotencyKey ?? chunkYJLOOC3L_js.generateIdempotencyKey();
114
+ return chunkYJLOOC3L_js.safe(
115
115
  this.client.post(
116
116
  "/api/v1/uploads/init",
117
117
  {
@@ -124,7 +124,7 @@ var UploadService = class {
124
124
  );
125
125
  }
126
126
  async confirm(uploadId) {
127
- return chunkEQLT46ZR_js.safe(
127
+ return chunkYJLOOC3L_js.safe(
128
128
  this.client.post("/api/v1/uploads/confirm", {
129
129
  upload_id: uploadId
130
130
  })
@@ -170,7 +170,7 @@ var PlacesService = class {
170
170
  this.client = client;
171
171
  }
172
172
  async autocomplete(input, sessionToken) {
173
- return chunkEQLT46ZR_js.safe(
173
+ return chunkYJLOOC3L_js.safe(
174
174
  this.client.post("/api/v1/places/autocomplete", {
175
175
  input,
176
176
  sessionToken
@@ -178,7 +178,7 @@ var PlacesService = class {
178
178
  );
179
179
  }
180
180
  async details(placeId, sessionToken) {
181
- return chunkEQLT46ZR_js.safe(
181
+ return chunkYJLOOC3L_js.safe(
182
182
  this.client.post("/api/v1/places/details", {
183
183
  place_id: placeId,
184
184
  sessionToken
@@ -197,7 +197,7 @@ var DeliveryService = class {
197
197
  params.set("dropoff_lat", String(dropoffLat));
198
198
  params.set("dropoff_lng", String(dropoffLng));
199
199
  if (country) params.set("country", country);
200
- return chunkEQLT46ZR_js.safe(
200
+ return chunkYJLOOC3L_js.safe(
201
201
  this.client.get(`/api/v1/delivery/fee?${params.toString()}`)
202
202
  );
203
203
  }
@@ -210,8 +210,8 @@ var SupportService = class {
210
210
  }
211
211
  /** Open (or resume) the customer's widget conversation. */
212
212
  async openConversation(opts) {
213
- const idempotencyKey = opts?.idempotencyKey ?? chunkEQLT46ZR_js.generateIdempotencyKey();
214
- return chunkEQLT46ZR_js.safe(
213
+ const idempotencyKey = opts?.idempotencyKey ?? chunkYJLOOC3L_js.generateIdempotencyKey();
214
+ return chunkYJLOOC3L_js.safe(
215
215
  this.client.post("/api/v1/support/conversation", void 0, {
216
216
  idempotencyKey
217
217
  })
@@ -219,8 +219,8 @@ var SupportService = class {
219
219
  }
220
220
  /** Send a message in the active conversation. */
221
221
  async sendMessage(content, opts) {
222
- const idempotencyKey = opts?.idempotencyKey ?? chunkEQLT46ZR_js.generateIdempotencyKey();
223
- return chunkEQLT46ZR_js.safe(
222
+ const idempotencyKey = opts?.idempotencyKey ?? chunkYJLOOC3L_js.generateIdempotencyKey();
223
+ return chunkYJLOOC3L_js.safe(
224
224
  this.client.post(
225
225
  "/api/v1/support/conversation/messages",
226
226
  { content },
@@ -235,7 +235,7 @@ var SupportService = class {
235
235
  if (options.limit) params.set("limit", String(options.limit));
236
236
  const query = params.toString();
237
237
  const path = query ? `/api/v1/support/conversation/messages?${query}` : "/api/v1/support/conversation/messages";
238
- return chunkEQLT46ZR_js.safe(this.client.get(path));
238
+ return chunkYJLOOC3L_js.safe(this.client.get(path));
239
239
  }
240
240
  };
241
241
 
@@ -278,12 +278,20 @@ var SESSION_TOKEN_STORAGE_KEY = "cimplify_session_token";
278
278
  var ORDER_TOKEN_PREFIX = "cimplify_ot_";
279
279
  var SESSION_TOKEN_HEADER = "x-session-token";
280
280
  var ORDER_TOKEN_TTL_MS = 24 * 60 * 60 * 1e3;
281
- var DEFAULT_TIMEOUT_MS = 3e4;
281
+ var DEFAULT_TIMEOUT_MS = 5e3;
282
282
  var DEFAULT_MAX_RETRIES = 3;
283
283
  var DEFAULT_RETRY_DELAY_MS = 1e3;
284
284
  function sleep(ms) {
285
285
  return new Promise((resolve) => setTimeout(resolve, ms));
286
286
  }
287
+ function nextInit(cacheOptions) {
288
+ if (!cacheOptions) return {};
289
+ const next = {};
290
+ if (cacheOptions.revalidate !== void 0) next.revalidate = cacheOptions.revalidate;
291
+ if (cacheOptions.tags && cacheOptions.tags.length > 0) next.tags = [...cacheOptions.tags];
292
+ if (next.revalidate === void 0 && !next.tags) return {};
293
+ return { next };
294
+ }
287
295
  function mergeOptionHeaders(base, opts) {
288
296
  if (!opts) return base;
289
297
  const merged = { ...base };
@@ -700,8 +708,9 @@ var CimplifyClient = class {
700
708
  });
701
709
  throw finalError;
702
710
  }
703
- getDedupeKey(type, payload) {
704
- return `${type}:${JSON.stringify(payload)}`;
711
+ getDedupeKey(type, payload, cacheOptions) {
712
+ const cacheKey = cacheOptions ? `|${JSON.stringify(cacheOptions)}` : "";
713
+ return `${type}:${JSON.stringify(payload)}${cacheKey}`;
705
714
  }
706
715
  async deduplicatedRequest(key, requestFn) {
707
716
  const existing = this.inflightRequests.get(key);
@@ -714,13 +723,14 @@ var CimplifyClient = class {
714
723
  this.inflightRequests.set(key, request);
715
724
  return request;
716
725
  }
717
- async get(path) {
718
- const key = this.getDedupeKey("get", path);
726
+ async get(path, opts) {
727
+ const key = this.getDedupeKey("get", path, opts?.cacheOptions);
719
728
  return this.deduplicatedRequest(key, async () => {
720
729
  const response = await this.resilientFetch(this.buildUrl(this.baseUrl, path), {
721
730
  method: "GET",
722
731
  credentials: this.credentials,
723
- headers: this.getHeaders()
732
+ headers: this.getHeaders(),
733
+ ...nextInit(opts?.cacheOptions)
724
734
  });
725
735
  return this.handleRestResponse(response);
726
736
  });
@@ -751,13 +761,14 @@ var CimplifyClient = class {
751
761
  });
752
762
  return this.handleRestResponse(response);
753
763
  }
754
- async linkGet(path) {
755
- const key = this.getDedupeKey("linkGet", path);
764
+ async linkGet(path, opts) {
765
+ const key = this.getDedupeKey("linkGet", path, opts?.cacheOptions);
756
766
  return this.deduplicatedRequest(key, async () => {
757
767
  const response = await this.resilientFetch(`${this.linkApiUrl}${path}`, {
758
768
  method: "GET",
759
769
  credentials: this.credentials,
760
- headers: this.getHeaders()
770
+ headers: this.getHeaders(),
771
+ ...nextInit(opts?.cacheOptions)
761
772
  });
762
773
  return this.handleRestResponse(response);
763
774
  });
@@ -822,25 +833,25 @@ var CimplifyClient = class {
822
833
  }
823
834
  get catalogue() {
824
835
  if (!this._catalogue) {
825
- this._catalogue = new chunkEQLT46ZR_js.CatalogueQueries(this);
836
+ this._catalogue = new chunkYJLOOC3L_js.CatalogueQueries(this);
826
837
  }
827
838
  return this._catalogue;
828
839
  }
829
840
  get cart() {
830
841
  if (!this._cart) {
831
- this._cart = new chunkEQLT46ZR_js.CartOperations(this);
842
+ this._cart = new chunkYJLOOC3L_js.CartOperations(this);
832
843
  }
833
844
  return this._cart;
834
845
  }
835
846
  get checkout() {
836
847
  if (!this._checkout) {
837
- this._checkout = new chunkEQLT46ZR_js.CheckoutService(this);
848
+ this._checkout = new chunkYJLOOC3L_js.CheckoutService(this);
838
849
  }
839
850
  return this._checkout;
840
851
  }
841
852
  get orders() {
842
853
  if (!this._orders) {
843
- this._orders = new chunkEQLT46ZR_js.OrderQueries(this);
854
+ this._orders = new chunkYJLOOC3L_js.OrderQueries(this);
844
855
  }
845
856
  return this._orders;
846
857
  }
@@ -864,43 +875,43 @@ var CimplifyClient = class {
864
875
  }
865
876
  get link() {
866
877
  if (!this._link) {
867
- this._link = new chunkEQLT46ZR_js.LinkService(this);
878
+ this._link = new chunkYJLOOC3L_js.LinkService(this);
868
879
  }
869
880
  return this._link;
870
881
  }
871
882
  get auth() {
872
883
  if (!this._auth) {
873
- this._auth = new chunkEQLT46ZR_js.AuthService(this);
884
+ this._auth = new chunkYJLOOC3L_js.AuthService(this);
874
885
  }
875
886
  return this._auth;
876
887
  }
877
888
  get business() {
878
889
  if (!this._business) {
879
- this._business = new chunkEQLT46ZR_js.BusinessService(this);
890
+ this._business = new chunkYJLOOC3L_js.BusinessService(this);
880
891
  }
881
892
  return this._business;
882
893
  }
883
894
  get inventory() {
884
895
  if (!this._inventory) {
885
- this._inventory = new chunkEQLT46ZR_js.InventoryService(this);
896
+ this._inventory = new chunkYJLOOC3L_js.InventoryService(this);
886
897
  }
887
898
  return this._inventory;
888
899
  }
889
900
  get scheduling() {
890
901
  if (!this._scheduling) {
891
- this._scheduling = new chunkEQLT46ZR_js.SchedulingService(this);
902
+ this._scheduling = new chunkYJLOOC3L_js.SchedulingService(this);
892
903
  }
893
904
  return this._scheduling;
894
905
  }
895
906
  get lite() {
896
907
  if (!this._lite) {
897
- this._lite = new chunkEQLT46ZR_js.LiteService(this);
908
+ this._lite = new chunkYJLOOC3L_js.LiteService(this);
898
909
  }
899
910
  return this._lite;
900
911
  }
901
912
  get fx() {
902
913
  if (!this._fx) {
903
- this._fx = new chunkEQLT46ZR_js.FxService(this);
914
+ this._fx = new chunkYJLOOC3L_js.FxService(this);
904
915
  }
905
916
  return this._fx;
906
917
  }
@@ -935,7 +946,7 @@ var CimplifyClient = class {
935
946
  if (businessId) {
936
947
  this.setBusinessId(businessId);
937
948
  }
938
- return chunkEQLT46ZR_js.createElements(this, businessId ?? this.businessId ?? void 0, options);
949
+ return chunkYJLOOC3L_js.createElements(this, businessId ?? this.businessId ?? void 0, options);
939
950
  }
940
951
  };
941
952
  function createCimplifyClient(config = {}) {
@@ -1,5 +1,5 @@
1
- import { createMockApp } from './chunk-R3F55BRN.mjs';
2
- import { createCimplifyClient } from './chunk-4QDCMYYB.mjs';
1
+ import { createMockApp } from './chunk-3G4QCENX.mjs';
2
+ import { createCimplifyClient } from './chunk-6QZQQRBB.mjs';
3
3
  import { z } from 'zod';
4
4
 
5
5
  var cimplifyRegistry = z.registry();