@cimplify/sdk 0.90.0 → 0.93.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 (67) hide show
  1. package/dist/advanced.d.mts +3 -3
  2. package/dist/advanced.d.ts +3 -3
  3. package/dist/advanced.js +20 -20
  4. package/dist/advanced.mjs +1 -1
  5. package/dist/{chunk-KJP4U6L3.js → chunk-6Y7KC5YZ.js} +23 -0
  6. package/dist/{chunk-JVWFIFQ7.js → chunk-AWNWP5J3.js} +4 -4
  7. package/dist/{chunk-2UDEWILL.mjs → chunk-FKARGZK3.mjs} +307 -90
  8. package/dist/{chunk-T7Z25EY4.js → chunk-HKN3YG76.js} +84 -0
  9. package/dist/{chunk-BN4V4ONE.js → chunk-QLGZIBRO.js} +348 -128
  10. package/dist/{chunk-NGE37REW.mjs → chunk-QXWX7CD2.mjs} +2 -2
  11. package/dist/{chunk-OZDDHSIB.mjs → chunk-RRBY35TJ.mjs} +80 -1
  12. package/dist/{chunk-GHFDYM5K.js → chunk-VEOAMBEX.js} +11 -4
  13. package/dist/{chunk-ZU4ZRYUR.mjs → chunk-VUSHG3HA.mjs} +11 -4
  14. package/dist/{chunk-NNGKC3MM.mjs → chunk-X36FZZT6.mjs} +23 -0
  15. package/dist/{client-YiSelM7x.d.mts → client-BTL9d_nN.d.mts} +117 -11
  16. package/dist/{client-CR1f94wY.d.ts → client-BX30FAWZ.d.ts} +117 -11
  17. package/dist/{client-DMttx1xk.d.mts → client-Bhe2TnFW.d.mts} +2 -2
  18. package/dist/{client-CqpOcbin.d.ts → client-DrkuEK_I.d.ts} +2 -2
  19. package/dist/{index-DD9z396M.d.mts → index-BuNjyfaV.d.mts} +3 -3
  20. package/dist/{index-CxTVu0HZ.d.ts → index-D-w5h82t.d.ts} +3 -3
  21. package/dist/index.d.mts +49 -7
  22. package/dist/index.d.ts +49 -7
  23. package/dist/index.js +103 -83
  24. package/dist/index.mjs +5 -5
  25. package/dist/mock/cli.mjs +23 -0
  26. package/dist/mock/library.js +23 -0
  27. package/dist/mock/library.mjs +23 -0
  28. package/dist/mock/msw.js +23 -0
  29. package/dist/mock/msw.mjs +23 -0
  30. package/dist/{payment-BX7ccIKY.d.ts → payment-By0JidTe.d.ts} +1 -1
  31. package/dist/{payment-5d8FTA1q.d.mts → payment-pKPpaORI.d.mts} +1 -1
  32. package/dist/{price-DtfP_Xfq.d.ts → price-23RNXftz.d.ts} +1 -1
  33. package/dist/{price-arl_4Rzn.d.mts → price-BvRtp6ak.d.mts} +1 -1
  34. package/dist/{product-DZX4QuKS.d.ts → product-O8-wcHSe.d.mts} +49 -0
  35. package/dist/{product-DZX4QuKS.d.mts → product-O8-wcHSe.d.ts} +49 -0
  36. package/dist/react.d.mts +79 -6
  37. package/dist/react.d.ts +79 -6
  38. package/dist/react.js +607 -379
  39. package/dist/react.mjs +539 -315
  40. package/dist/{server-BceZMxcK.d.mts → server-BN9ZCAKT.d.mts} +5 -1
  41. package/dist/{server-DoJGSC7L.d.ts → server-DDGbfW_S.d.ts} +5 -1
  42. package/dist/server.d.mts +4 -4
  43. package/dist/server.d.ts +4 -4
  44. package/dist/server.js +7 -7
  45. package/dist/server.mjs +2 -2
  46. package/dist/styles.css +1 -1
  47. package/dist/testing/msw.d.mts +2 -2
  48. package/dist/testing/msw.d.ts +2 -2
  49. package/dist/testing/msw.js +2 -2
  50. package/dist/testing/msw.mjs +1 -1
  51. package/dist/testing/suite.d.mts +6 -6
  52. package/dist/testing/suite.d.ts +6 -6
  53. package/dist/testing/suite.js +23 -23
  54. package/dist/testing/suite.mjs +4 -4
  55. package/dist/testing.d.mts +5 -5
  56. package/dist/testing.d.ts +5 -5
  57. package/dist/testing.js +79 -79
  58. package/dist/testing.mjs +5 -5
  59. package/dist/utils.d.mts +4 -4
  60. package/dist/utils.d.ts +4 -4
  61. package/package.json +1 -1
  62. package/registry/booking-page.json +1 -1
  63. package/registry/chat-widget.json +1 -1
  64. package/registry/customer-input-fields.json +1 -1
  65. package/registry/date-slot-picker.json +1 -1
  66. package/registry/product-customizer.json +1 -1
  67. package/registry/rental-service-card.json +1 -1
@@ -1,6 +1,6 @@
1
- export { k as AuthService, C as BusinessService, O as CartOperations, P as CatalogueQueries, ab as CheckoutOperations, ab as CheckoutService, ah as CimplifyElement, ai as CimplifyElements, aJ as ELEMENT_TYPES, aK as EVENT_TYPES, aN as ElementEventType, aO as ElementOptions, aP as ElementType, aX as ElementsOptions, b3 as FetchQuoteInput, bc as FxService, bg as GetProductsOptions, bj as InventoryService, br as LinkService, bx as LiteService, bE as MESSAGE_TYPES, c4 as OrderQueries, cq as PriceQuote, cw as QuoteBundleSelectionInput, cx as QuoteCompositeSelectionInput, cy as QuoteDynamicBuckets, cz as QuoteStatus, cA as QuoteUiMessage, cC as RefreshQuoteInput, cD as RefreshQuoteResult, d3 as SchedulingService, dK as createElements } from './client-YiSelM7x.mjs';
2
- import './product-DZX4QuKS.mjs';
3
- import './payment-5d8FTA1q.mjs';
1
+ export { k as AuthService, C as BusinessService, O as CartOperations, P as CatalogueQueries, ab as CheckoutOperations, ab as CheckoutService, ah as CimplifyElement, ai as CimplifyElements, aK as ELEMENT_TYPES, aL as EVENT_TYPES, aO as ElementEventType, aP as ElementOptions, aQ as ElementType, aY as ElementsOptions, b4 as FetchQuoteInput, bd as FxService, bh as GetProductsOptions, bk as InventoryService, bs as LinkService, by as LiteService, bF as MESSAGE_TYPES, c5 as OrderQueries, cr as PriceQuote, cx as QuoteBundleSelectionInput, cy as QuoteCompositeSelectionInput, cz as QuoteDynamicBuckets, cA as QuoteStatus, cB as QuoteUiMessage, cD as RefreshQuoteInput, cE as RefreshQuoteResult, d4 as SchedulingService, dK as createElements } from './client-BTL9d_nN.mjs';
2
+ import './product-O8-wcHSe.mjs';
3
+ import './payment-pKPpaORI.mjs';
4
4
 
5
5
  declare function generateIdempotencyKey(prefix?: string): string;
6
6
 
@@ -1,6 +1,6 @@
1
- export { k as AuthService, C as BusinessService, O as CartOperations, P as CatalogueQueries, ab as CheckoutOperations, ab as CheckoutService, ah as CimplifyElement, ai as CimplifyElements, aJ as ELEMENT_TYPES, aK as EVENT_TYPES, aN as ElementEventType, aO as ElementOptions, aP as ElementType, aX as ElementsOptions, b3 as FetchQuoteInput, bc as FxService, bg as GetProductsOptions, bj as InventoryService, br as LinkService, bx as LiteService, bE as MESSAGE_TYPES, c4 as OrderQueries, cq as PriceQuote, cw as QuoteBundleSelectionInput, cx as QuoteCompositeSelectionInput, cy as QuoteDynamicBuckets, cz as QuoteStatus, cA as QuoteUiMessage, cC as RefreshQuoteInput, cD as RefreshQuoteResult, d3 as SchedulingService, dK as createElements } from './client-CR1f94wY.js';
2
- import './product-DZX4QuKS.js';
3
- import './payment-BX7ccIKY.js';
1
+ export { k as AuthService, C as BusinessService, O as CartOperations, P as CatalogueQueries, ab as CheckoutOperations, ab as CheckoutService, ah as CimplifyElement, ai as CimplifyElements, aK as ELEMENT_TYPES, aL as EVENT_TYPES, aO as ElementEventType, aP as ElementOptions, aQ as ElementType, aY as ElementsOptions, b4 as FetchQuoteInput, bd as FxService, bh as GetProductsOptions, bk as InventoryService, bs as LinkService, by as LiteService, bF as MESSAGE_TYPES, c5 as OrderQueries, cr as PriceQuote, cx as QuoteBundleSelectionInput, cy as QuoteCompositeSelectionInput, cz as QuoteDynamicBuckets, cA as QuoteStatus, cB as QuoteUiMessage, cD as RefreshQuoteInput, cE as RefreshQuoteResult, d4 as SchedulingService, dK as createElements } from './client-BX30FAWZ.js';
2
+ import './product-O8-wcHSe.js';
3
+ import './payment-By0JidTe.js';
4
4
 
5
5
  declare function generateIdempotencyKey(prefix?: string): string;
6
6
 
package/dist/advanced.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkGHFDYM5K_js = require('./chunk-GHFDYM5K.js');
3
+ var chunkVEOAMBEX_js = require('./chunk-VEOAMBEX.js');
4
4
  require('./chunk-PTPOQVXS.js');
5
5
  require('./chunk-AETVRBKI.js');
6
6
  require('./chunk-OWW5GUSB.js');
@@ -9,77 +9,77 @@ require('./chunk-OWW5GUSB.js');
9
9
 
10
10
  Object.defineProperty(exports, "AuthService", {
11
11
  enumerable: true,
12
- get: function () { return chunkGHFDYM5K_js.AuthService; }
12
+ get: function () { return chunkVEOAMBEX_js.AuthService; }
13
13
  });
14
14
  Object.defineProperty(exports, "BusinessService", {
15
15
  enumerable: true,
16
- get: function () { return chunkGHFDYM5K_js.BusinessService; }
16
+ get: function () { return chunkVEOAMBEX_js.BusinessService; }
17
17
  });
18
18
  Object.defineProperty(exports, "CartOperations", {
19
19
  enumerable: true,
20
- get: function () { return chunkGHFDYM5K_js.CartOperations; }
20
+ get: function () { return chunkVEOAMBEX_js.CartOperations; }
21
21
  });
22
22
  Object.defineProperty(exports, "CatalogueQueries", {
23
23
  enumerable: true,
24
- get: function () { return chunkGHFDYM5K_js.CatalogueQueries; }
24
+ get: function () { return chunkVEOAMBEX_js.CatalogueQueries; }
25
25
  });
26
26
  Object.defineProperty(exports, "CheckoutOperations", {
27
27
  enumerable: true,
28
- get: function () { return chunkGHFDYM5K_js.CheckoutService; }
28
+ get: function () { return chunkVEOAMBEX_js.CheckoutService; }
29
29
  });
30
30
  Object.defineProperty(exports, "CheckoutService", {
31
31
  enumerable: true,
32
- get: function () { return chunkGHFDYM5K_js.CheckoutService; }
32
+ get: function () { return chunkVEOAMBEX_js.CheckoutService; }
33
33
  });
34
34
  Object.defineProperty(exports, "CimplifyElement", {
35
35
  enumerable: true,
36
- get: function () { return chunkGHFDYM5K_js.CimplifyElement; }
36
+ get: function () { return chunkVEOAMBEX_js.CimplifyElement; }
37
37
  });
38
38
  Object.defineProperty(exports, "CimplifyElements", {
39
39
  enumerable: true,
40
- get: function () { return chunkGHFDYM5K_js.CimplifyElements; }
40
+ get: function () { return chunkVEOAMBEX_js.CimplifyElements; }
41
41
  });
42
42
  Object.defineProperty(exports, "ELEMENT_TYPES", {
43
43
  enumerable: true,
44
- get: function () { return chunkGHFDYM5K_js.ELEMENT_TYPES; }
44
+ get: function () { return chunkVEOAMBEX_js.ELEMENT_TYPES; }
45
45
  });
46
46
  Object.defineProperty(exports, "EVENT_TYPES", {
47
47
  enumerable: true,
48
- get: function () { return chunkGHFDYM5K_js.EVENT_TYPES; }
48
+ get: function () { return chunkVEOAMBEX_js.EVENT_TYPES; }
49
49
  });
50
50
  Object.defineProperty(exports, "FxService", {
51
51
  enumerable: true,
52
- get: function () { return chunkGHFDYM5K_js.FxService; }
52
+ get: function () { return chunkVEOAMBEX_js.FxService; }
53
53
  });
54
54
  Object.defineProperty(exports, "InventoryService", {
55
55
  enumerable: true,
56
- get: function () { return chunkGHFDYM5K_js.InventoryService; }
56
+ get: function () { return chunkVEOAMBEX_js.InventoryService; }
57
57
  });
58
58
  Object.defineProperty(exports, "LinkService", {
59
59
  enumerable: true,
60
- get: function () { return chunkGHFDYM5K_js.LinkService; }
60
+ get: function () { return chunkVEOAMBEX_js.LinkService; }
61
61
  });
62
62
  Object.defineProperty(exports, "LiteService", {
63
63
  enumerable: true,
64
- get: function () { return chunkGHFDYM5K_js.LiteService; }
64
+ get: function () { return chunkVEOAMBEX_js.LiteService; }
65
65
  });
66
66
  Object.defineProperty(exports, "MESSAGE_TYPES", {
67
67
  enumerable: true,
68
- get: function () { return chunkGHFDYM5K_js.MESSAGE_TYPES; }
68
+ get: function () { return chunkVEOAMBEX_js.MESSAGE_TYPES; }
69
69
  });
70
70
  Object.defineProperty(exports, "OrderQueries", {
71
71
  enumerable: true,
72
- get: function () { return chunkGHFDYM5K_js.OrderQueries; }
72
+ get: function () { return chunkVEOAMBEX_js.OrderQueries; }
73
73
  });
74
74
  Object.defineProperty(exports, "SchedulingService", {
75
75
  enumerable: true,
76
- get: function () { return chunkGHFDYM5K_js.SchedulingService; }
76
+ get: function () { return chunkVEOAMBEX_js.SchedulingService; }
77
77
  });
78
78
  Object.defineProperty(exports, "createElements", {
79
79
  enumerable: true,
80
- get: function () { return chunkGHFDYM5K_js.createElements; }
80
+ get: function () { return chunkVEOAMBEX_js.createElements; }
81
81
  });
82
82
  Object.defineProperty(exports, "generateIdempotencyKey", {
83
83
  enumerable: true,
84
- get: function () { return chunkGHFDYM5K_js.generateIdempotencyKey; }
84
+ get: function () { return chunkVEOAMBEX_js.generateIdempotencyKey; }
85
85
  });
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-ZU4ZRYUR.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-VUSHG3HA.mjs';
2
2
  import './chunk-KFLGQGMC.mjs';
3
3
  import './chunk-K5EN2W2Q.mjs';
4
4
  import './chunk-3G6RQLXK.mjs';
@@ -2482,6 +2482,10 @@ function buildV1(deps) {
2482
2482
  "/support/conversation",
2483
2483
  (c) => tryRoute(c, () => deps.support.openConversation(deps.defaultBusinessId, c.var.session.customer_id))
2484
2484
  );
2485
+ app.get(
2486
+ "/support/conversation",
2487
+ (c) => tryRoute(c, () => deps.support.peekConversation(deps.defaultBusinessId, c.var.session.customer_id))
2488
+ );
2485
2489
  app.post("/support/conversation/messages", async (c) => {
2486
2490
  const body = await c.req.json().catch(() => ({}));
2487
2491
  return tryRoute(
@@ -2498,6 +2502,18 @@ function buildV1(deps) {
2498
2502
  return tryRoute(c, () => deps.support.react(c.req.param("messageId"), body.emoji ?? ""));
2499
2503
  });
2500
2504
  app.post("/support/conversation/handoff", (c) => c.json({ data: { requested: true } }));
2505
+ app.post("/support/conversation/claim", async (c) => {
2506
+ const body = await c.req.json().catch(() => ({}));
2507
+ if (!body.access_token) return c.json({ error: "access_token is required" }, 400);
2508
+ const session = c.var.session;
2509
+ return c.json({
2510
+ data: {
2511
+ session_token: session.token,
2512
+ thread_id: null,
2513
+ customer_name: session.customer_name ?? "Test User"
2514
+ }
2515
+ });
2516
+ });
2501
2517
  app.get(
2502
2518
  "/support/conversation/ws",
2503
2519
  (c) => c.json({ note: "WebSocket connection \u2014 connect via ws:// at the same path", supported: false }, 426)
@@ -5468,6 +5484,13 @@ function createSupportService(opts) {
5468
5484
  registry.conversations.put(id, conv);
5469
5485
  return conv;
5470
5486
  },
5487
+ peekConversation(businessId, customerId) {
5488
+ const matches = registry.conversations.list(
5489
+ (c) => c.business_id === businessId && c.customer_id === customerId
5490
+ );
5491
+ const conv = matches[matches.length - 1];
5492
+ return conv ? { conversation: conv, messages: conv.messages } : { conversation: null, messages: [] };
5493
+ },
5471
5494
  sendMessage(conversationId, body) {
5472
5495
  const conv = registry.conversations.get(conversationId);
5473
5496
  if (!conv) throw notFound(`Conversation ${conversationId} not found`);
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkKJP4U6L3_js = require('./chunk-KJP4U6L3.js');
4
- var chunkBN4V4ONE_js = require('./chunk-BN4V4ONE.js');
3
+ var chunk6Y7KC5YZ_js = require('./chunk-6Y7KC5YZ.js');
4
+ var chunkQLGZIBRO_js = require('./chunk-QLGZIBRO.js');
5
5
  var zod = require('zod');
6
6
 
7
7
  var cimplifyRegistry = zod.z.registry();
@@ -600,7 +600,7 @@ async function toForwardedRequest(input, init) {
600
600
  };
601
601
  }
602
602
  function createTestClient(options = {}) {
603
- const mock = chunkKJP4U6L3_js.createMockApp(options);
603
+ const mock = chunk6Y7KC5YZ_js.createMockApp(options);
604
604
  let sessionToken;
605
605
  const fetchImpl = async (input, init) => {
606
606
  const url = typeof input === "string" ? input : input instanceof URL ? input.toString() : input.url;
@@ -619,7 +619,7 @@ function createTestClient(options = {}) {
619
619
  if (echoed) sessionToken = echoed;
620
620
  return res;
621
621
  };
622
- const client = chunkBN4V4ONE_js.createCimplifyClient({
622
+ const client = chunkQLGZIBRO_js.createCimplifyClient({
623
623
  baseUrl: TEST_BASE_URL,
624
624
  // Link mock lives at /v1/link on the same Hono app, so point the SDK's
625
625
  // separate Link transport at the same TEST_BASE_URL.