@cimplify/sdk 0.64.1 → 0.66.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 (40) hide show
  1. package/dist/advanced.d.mts +1 -1
  2. package/dist/advanced.d.ts +1 -1
  3. package/dist/advanced.js +20 -20
  4. package/dist/advanced.mjs +1 -1
  5. package/dist/{chunk-SQ7U3BWY.mjs → chunk-227XTAEB.mjs} +52 -25
  6. package/dist/{chunk-2AU263DK.mjs → chunk-3Z3FQH7X.mjs} +1 -1
  7. package/dist/{chunk-XSOYJLMZ.mjs → chunk-7BKKBJQM.mjs} +10 -3
  8. package/dist/{chunk-JGBDWEPJ.js → chunk-AVQL3TSJ.js} +3 -0
  9. package/dist/{chunk-6DMHVQ42.js → chunk-GDAGM26J.js} +4 -4
  10. package/dist/{chunk-6W3AH4QW.js → chunk-H6DBPHMZ.js} +2 -2
  11. package/dist/{chunk-MW7ICTVK.js → chunk-J3MGY6AU.js} +86 -59
  12. package/dist/{chunk-DKT62WQW.js → chunk-KWYI2TTA.js} +10 -3
  13. package/dist/{chunk-F4WS3OIF.mjs → chunk-MWI5GAUF.mjs} +1 -1
  14. package/dist/{chunk-I4IXPQIX.mjs → chunk-R6363CC7.mjs} +3 -0
  15. package/dist/{client-Dfg_hmkP.d.ts → client-Bo5rujc2.d.ts} +8 -2
  16. package/dist/{client-Bhvlelij.d.mts → client-CUrA1uQ0.d.mts} +1 -1
  17. package/dist/{client-DlGJqSDd.d.ts → client-DasPHOJh.d.ts} +1 -1
  18. package/dist/{client-DKg-5OWu.d.mts → client-Dka2cGhu.d.mts} +8 -2
  19. package/dist/index.d.mts +1 -1
  20. package/dist/index.d.ts +1 -1
  21. package/dist/index.js +78 -78
  22. package/dist/index.mjs +5 -5
  23. package/dist/react.d.mts +1 -1
  24. package/dist/react.d.ts +1 -1
  25. package/dist/react.js +64 -64
  26. package/dist/react.mjs +5 -5
  27. package/dist/server.d.mts +18 -3
  28. package/dist/server.d.ts +18 -3
  29. package/dist/server.js +167 -28
  30. package/dist/server.mjs +159 -24
  31. package/dist/styles.css +1 -1
  32. package/dist/testing/suite.d.mts +2 -2
  33. package/dist/testing/suite.d.ts +2 -2
  34. package/dist/testing/suite.js +22 -22
  35. package/dist/testing/suite.mjs +3 -3
  36. package/dist/testing.d.mts +2 -2
  37. package/dist/testing.d.ts +2 -2
  38. package/dist/testing.js +78 -78
  39. package/dist/testing.mjs +4 -4
  40. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkJGBDWEPJ_js = require('./chunk-JGBDWEPJ.js');
3
+ var chunkAVQL3TSJ_js = require('./chunk-AVQL3TSJ.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 chunkJGBDWEPJ_js.safe(this.client.get("/api/v1/activity/state"));
32
+ return chunkAVQL3TSJ_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 chunkJGBDWEPJ_js.safe(this.client.get(path));
40
+ return chunkAVQL3TSJ_js.safe(this.client.get(path));
41
41
  }
42
42
  async dismissMessage(code) {
43
- return chunkJGBDWEPJ_js.safe(
43
+ return chunkAVQL3TSJ_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 chunkJGBDWEPJ_js.safe(this.client.get("/api/v1/subscriptions"));
65
+ return chunkAVQL3TSJ_js.safe(this.client.get("/api/v1/subscriptions"));
66
66
  }
67
67
  async get(id) {
68
68
  const encodedId = encodeURIComponent(id);
69
- return chunkJGBDWEPJ_js.safe(this.client.get(`/api/v1/subscriptions/${encodedId}`));
69
+ return chunkAVQL3TSJ_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 ?? chunkJGBDWEPJ_js.generateIdempotencyKey();
74
- return chunkJGBDWEPJ_js.safe(
73
+ const idempotencyKey = opts?.idempotencyKey ?? chunkAVQL3TSJ_js.generateIdempotencyKey();
74
+ return chunkAVQL3TSJ_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 chunkJGBDWEPJ_js.safe(
84
+ return chunkAVQL3TSJ_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 chunkJGBDWEPJ_js.safe(
90
+ return chunkAVQL3TSJ_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 ?? chunkJGBDWEPJ_js.generateIdempotencyKey();
97
- return chunkJGBDWEPJ_js.safe(
96
+ const idempotencyKey = opts?.idempotencyKey ?? chunkAVQL3TSJ_js.generateIdempotencyKey();
97
+ return chunkAVQL3TSJ_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 ?? chunkJGBDWEPJ_js.generateIdempotencyKey();
114
- return chunkJGBDWEPJ_js.safe(
113
+ const idempotencyKey = opts?.idempotencyKey ?? chunkAVQL3TSJ_js.generateIdempotencyKey();
114
+ return chunkAVQL3TSJ_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 chunkJGBDWEPJ_js.safe(
127
+ return chunkAVQL3TSJ_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 chunkJGBDWEPJ_js.safe(
173
+ return chunkAVQL3TSJ_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 chunkJGBDWEPJ_js.safe(
181
+ return chunkAVQL3TSJ_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 chunkJGBDWEPJ_js.safe(
200
+ return chunkAVQL3TSJ_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 ?? chunkJGBDWEPJ_js.generateIdempotencyKey();
214
- return chunkJGBDWEPJ_js.safe(
213
+ const idempotencyKey = opts?.idempotencyKey ?? chunkAVQL3TSJ_js.generateIdempotencyKey();
214
+ return chunkAVQL3TSJ_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 ?? chunkJGBDWEPJ_js.generateIdempotencyKey();
223
- return chunkJGBDWEPJ_js.safe(
222
+ const idempotencyKey = opts?.idempotencyKey ?? chunkAVQL3TSJ_js.generateIdempotencyKey();
223
+ return chunkAVQL3TSJ_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 chunkJGBDWEPJ_js.safe(this.client.get(path));
238
+ return chunkAVQL3TSJ_js.safe(this.client.get(path));
239
239
  }
240
240
  };
241
241
 
@@ -273,10 +273,10 @@ function createClientEvents() {
273
273
  }
274
274
 
275
275
  // src/client.ts
276
- var ACCESS_TOKEN_STORAGE_KEY = "cimplify_access_token";
277
276
  var SESSION_TOKEN_STORAGE_KEY = "cimplify_session_token";
278
277
  var ORDER_TOKEN_PREFIX = "cimplify_ot_";
279
278
  var SESSION_TOKEN_HEADER = "x-session-token";
279
+ var REFRESH_ENDPOINT = "/v1/link/elements/refresh";
280
280
  var ORDER_TOKEN_TTL_MS = 24 * 60 * 60 * 1e3;
281
281
  var DEFAULT_TIMEOUT_MS = 5e3;
282
282
  var DEFAULT_MAX_RETRIES = 3;
@@ -384,6 +384,7 @@ var CimplifyClient = class {
384
384
  this.context = {};
385
385
  this.businessId = null;
386
386
  this.businessIdResolvePromise = null;
387
+ this.refreshInflight = null;
387
388
  this.inflightRequests = /* @__PURE__ */ new Map();
388
389
  /**
389
390
  * App-level event channel. Subscribe to surface mutation rollbacks, outbox
@@ -402,7 +403,6 @@ var CimplifyClient = class {
402
403
  this.retryDelay = config.retryDelay ?? DEFAULT_RETRY_DELAY_MS;
403
404
  this.hooks = config.hooks ?? {};
404
405
  this.fetchImpl = (config.fetch ?? globalThis.fetch).bind(globalThis);
405
- this.accessToken = this.loadAccessToken();
406
406
  this.sessionToken = this.loadSessionToken();
407
407
  if (!this.publicKey && !config.suppressPublicKeyWarning) {
408
408
  console.warn(
@@ -429,7 +429,6 @@ var CimplifyClient = class {
429
429
  setAccessToken(token) {
430
430
  const previous = this.accessToken;
431
431
  this.accessToken = token;
432
- this.saveAccessToken(token);
433
432
  this.hooks.onSessionChange?.({
434
433
  previousToken: previous,
435
434
  newToken: token,
@@ -440,7 +439,6 @@ var CimplifyClient = class {
440
439
  const previous = this.accessToken;
441
440
  this.accessToken = null;
442
441
  this.sessionToken = null;
443
- this.saveAccessToken(null);
444
442
  if (typeof window !== "undefined" && window.localStorage) {
445
443
  localStorage.removeItem(SESSION_TOKEN_STORAGE_KEY);
446
444
  }
@@ -533,23 +531,52 @@ var CimplifyClient = class {
533
531
  this.businessIdResolvePromise = null;
534
532
  }
535
533
  }
536
- loadAccessToken() {
537
- if (typeof window !== "undefined" && window.localStorage) {
538
- return localStorage.getItem(ACCESS_TOKEN_STORAGE_KEY);
539
- }
540
- return null;
541
- }
542
- saveAccessToken(token) {
543
- if (typeof window !== "undefined" && window.localStorage) {
534
+ // Browser-only (the server is handed a token directly). Concurrent 401s share
535
+ // one in-flight refresh so the rotating cookie rotates once, not N times.
536
+ async refreshAccessToken() {
537
+ if (typeof window === "undefined") return false;
538
+ if (this.refreshInflight) return this.refreshInflight;
539
+ this.refreshInflight = (async () => {
544
540
  try {
545
- if (token) {
546
- localStorage.setItem(ACCESS_TOKEN_STORAGE_KEY, token);
547
- } else {
548
- localStorage.removeItem(ACCESS_TOKEN_STORAGE_KEY);
541
+ const headers = { "Content-Type": "application/json" };
542
+ const trimmedPublicKey = this.publicKey.trim();
543
+ if (trimmedPublicKey) headers["X-API-Key"] = trimmedPublicKey;
544
+ const res = await this.fetchImpl(`${this.linkApiUrl}${REFRESH_ENDPOINT}`, {
545
+ method: "POST",
546
+ credentials: this.credentials,
547
+ headers,
548
+ body: "{}"
549
+ });
550
+ if (!res.ok) return false;
551
+ const json = await res.json();
552
+ const token = json?.data?.token ?? json?.token;
553
+ if (typeof token === "string" && token.length > 0) {
554
+ this.setAccessToken(token);
555
+ return true;
549
556
  }
557
+ return false;
550
558
  } catch {
559
+ return false;
560
+ } finally {
561
+ this.refreshInflight = null;
551
562
  }
552
- }
563
+ })();
564
+ return this.refreshInflight;
565
+ }
566
+ // On 401, refresh from the session cookie once and retry — re-establishes a
567
+ // session after a reload without persisting any token.
568
+ async authedFetch(url, options) {
569
+ const response = await this.resilientFetch(url, options);
570
+ if (response.status !== 401 || typeof window === "undefined" || url.includes(REFRESH_ENDPOINT)) {
571
+ return response;
572
+ }
573
+ const refreshed = await this.refreshAccessToken();
574
+ if (!refreshed) return response;
575
+ const retryHeaders = {
576
+ ...options.headers,
577
+ Authorization: `Bearer ${this.accessToken}`
578
+ };
579
+ return this.resilientFetch(url, { ...options, headers: retryHeaders });
553
580
  }
554
581
  loadSessionToken() {
555
582
  if (typeof window !== "undefined" && window.localStorage) {
@@ -726,7 +753,7 @@ var CimplifyClient = class {
726
753
  async get(path, opts) {
727
754
  const key = this.getDedupeKey("get", path, opts?.cacheOptions);
728
755
  return this.deduplicatedRequest(key, async () => {
729
- const response = await this.resilientFetch(this.buildUrl(this.baseUrl, path), {
756
+ const response = await this.authedFetch(this.buildUrl(this.baseUrl, path), {
730
757
  method: "GET",
731
758
  credentials: this.credentials,
732
759
  headers: this.getHeaders(),
@@ -736,7 +763,7 @@ var CimplifyClient = class {
736
763
  });
737
764
  }
738
765
  async post(path, body, opts) {
739
- const response = await this.resilientFetch(this.buildUrl(this.baseUrl, path), {
766
+ const response = await this.authedFetch(this.buildUrl(this.baseUrl, path), {
740
767
  method: "POST",
741
768
  credentials: this.credentials,
742
769
  headers: mergeOptionHeaders(this.getHeaders(), opts),
@@ -745,7 +772,7 @@ var CimplifyClient = class {
745
772
  return this.handleRestResponse(response);
746
773
  }
747
774
  async patch(path, body, opts) {
748
- const response = await this.resilientFetch(this.buildUrl(this.baseUrl, path), {
775
+ const response = await this.authedFetch(this.buildUrl(this.baseUrl, path), {
749
776
  method: "PATCH",
750
777
  credentials: this.credentials,
751
778
  headers: mergeOptionHeaders(this.getHeaders(), opts),
@@ -754,7 +781,7 @@ var CimplifyClient = class {
754
781
  return this.handleRestResponse(response);
755
782
  }
756
783
  async delete(path, opts) {
757
- const response = await this.resilientFetch(this.buildUrl(this.baseUrl, path), {
784
+ const response = await this.authedFetch(this.buildUrl(this.baseUrl, path), {
758
785
  method: "DELETE",
759
786
  credentials: this.credentials,
760
787
  headers: mergeOptionHeaders(this.getHeaders(), opts)
@@ -764,7 +791,7 @@ var CimplifyClient = class {
764
791
  async linkGet(path, opts) {
765
792
  const key = this.getDedupeKey("linkGet", path, opts?.cacheOptions);
766
793
  return this.deduplicatedRequest(key, async () => {
767
- const response = await this.resilientFetch(`${this.linkApiUrl}${path}`, {
794
+ const response = await this.authedFetch(`${this.linkApiUrl}${path}`, {
768
795
  method: "GET",
769
796
  credentials: this.credentials,
770
797
  headers: this.getHeaders(),
@@ -774,7 +801,7 @@ var CimplifyClient = class {
774
801
  });
775
802
  }
776
803
  async linkPost(path, body, opts) {
777
- const response = await this.resilientFetch(`${this.linkApiUrl}${path}`, {
804
+ const response = await this.authedFetch(`${this.linkApiUrl}${path}`, {
778
805
  method: "POST",
779
806
  credentials: this.credentials,
780
807
  headers: mergeOptionHeaders(this.getHeaders(), opts),
@@ -783,7 +810,7 @@ var CimplifyClient = class {
783
810
  return this.handleRestResponse(response);
784
811
  }
785
812
  async linkDelete(path, opts) {
786
- const response = await this.resilientFetch(`${this.linkApiUrl}${path}`, {
813
+ const response = await this.authedFetch(`${this.linkApiUrl}${path}`, {
787
814
  method: "DELETE",
788
815
  credentials: this.credentials,
789
816
  headers: mergeOptionHeaders(this.getHeaders(), opts)
@@ -833,25 +860,25 @@ var CimplifyClient = class {
833
860
  }
834
861
  get catalogue() {
835
862
  if (!this._catalogue) {
836
- this._catalogue = new chunkJGBDWEPJ_js.CatalogueQueries(this);
863
+ this._catalogue = new chunkAVQL3TSJ_js.CatalogueQueries(this);
837
864
  }
838
865
  return this._catalogue;
839
866
  }
840
867
  get cart() {
841
868
  if (!this._cart) {
842
- this._cart = new chunkJGBDWEPJ_js.CartOperations(this);
869
+ this._cart = new chunkAVQL3TSJ_js.CartOperations(this);
843
870
  }
844
871
  return this._cart;
845
872
  }
846
873
  get checkout() {
847
874
  if (!this._checkout) {
848
- this._checkout = new chunkJGBDWEPJ_js.CheckoutService(this);
875
+ this._checkout = new chunkAVQL3TSJ_js.CheckoutService(this);
849
876
  }
850
877
  return this._checkout;
851
878
  }
852
879
  get orders() {
853
880
  if (!this._orders) {
854
- this._orders = new chunkJGBDWEPJ_js.OrderQueries(this);
881
+ this._orders = new chunkAVQL3TSJ_js.OrderQueries(this);
855
882
  }
856
883
  return this._orders;
857
884
  }
@@ -875,43 +902,43 @@ var CimplifyClient = class {
875
902
  }
876
903
  get link() {
877
904
  if (!this._link) {
878
- this._link = new chunkJGBDWEPJ_js.LinkService(this);
905
+ this._link = new chunkAVQL3TSJ_js.LinkService(this);
879
906
  }
880
907
  return this._link;
881
908
  }
882
909
  get auth() {
883
910
  if (!this._auth) {
884
- this._auth = new chunkJGBDWEPJ_js.AuthService(this);
911
+ this._auth = new chunkAVQL3TSJ_js.AuthService(this);
885
912
  }
886
913
  return this._auth;
887
914
  }
888
915
  get business() {
889
916
  if (!this._business) {
890
- this._business = new chunkJGBDWEPJ_js.BusinessService(this);
917
+ this._business = new chunkAVQL3TSJ_js.BusinessService(this);
891
918
  }
892
919
  return this._business;
893
920
  }
894
921
  get inventory() {
895
922
  if (!this._inventory) {
896
- this._inventory = new chunkJGBDWEPJ_js.InventoryService(this);
923
+ this._inventory = new chunkAVQL3TSJ_js.InventoryService(this);
897
924
  }
898
925
  return this._inventory;
899
926
  }
900
927
  get scheduling() {
901
928
  if (!this._scheduling) {
902
- this._scheduling = new chunkJGBDWEPJ_js.SchedulingService(this);
929
+ this._scheduling = new chunkAVQL3TSJ_js.SchedulingService(this);
903
930
  }
904
931
  return this._scheduling;
905
932
  }
906
933
  get lite() {
907
934
  if (!this._lite) {
908
- this._lite = new chunkJGBDWEPJ_js.LiteService(this);
935
+ this._lite = new chunkAVQL3TSJ_js.LiteService(this);
909
936
  }
910
937
  return this._lite;
911
938
  }
912
939
  get fx() {
913
940
  if (!this._fx) {
914
- this._fx = new chunkJGBDWEPJ_js.FxService(this);
941
+ this._fx = new chunkAVQL3TSJ_js.FxService(this);
915
942
  }
916
943
  return this._fx;
917
944
  }
@@ -946,7 +973,7 @@ var CimplifyClient = class {
946
973
  if (businessId) {
947
974
  this.setBusinessId(businessId);
948
975
  }
949
- return chunkJGBDWEPJ_js.createElements(this, businessId ?? this.businessId ?? void 0, options);
976
+ return chunkAVQL3TSJ_js.createElements(this, businessId ?? this.businessId ?? void 0, options);
950
977
  }
951
978
  };
952
979
  function createCimplifyClient(config = {}) {
@@ -20,7 +20,13 @@ function decodePkceState(raw) {
20
20
 
21
21
  // src/internal/discovery.ts
22
22
  var DEFAULT_ISSUER = "https://api.cimplify.io";
23
- var FALLBACK_AUTHORIZATION_ENDPOINT = "https://auth.cimplify.io/oauth/authorize";
23
+ var DEFAULT_AUTHORIZATION_ENDPOINT = "https://auth.cimplify.io/oauth/authorize";
24
+ function fallbackAuthorizationEndpoint(issuerBase) {
25
+ if (issuerBase === DEFAULT_ISSUER) return DEFAULT_AUTHORIZATION_ENDPOINT;
26
+ throw new Error(
27
+ `OIDC discovery for "${issuerBase}" is unreachable and no fallback authorize endpoint is known for it. Make discovery reachable (enable CORS) or pass authUrl.`
28
+ );
29
+ }
24
30
  var cache = /* @__PURE__ */ new Map();
25
31
  function fetchDiscovery(issuer) {
26
32
  const base = issuer.replace(/\/$/, "");
@@ -36,12 +42,13 @@ function fetchDiscovery(issuer) {
36
42
  return pending;
37
43
  }
38
44
  async function getAuthorizationEndpoint(issuer) {
45
+ const base = issuer.replace(/\/$/, "");
39
46
  try {
40
- const doc = await fetchDiscovery(issuer);
47
+ const doc = await fetchDiscovery(base);
41
48
  if (doc.authorization_endpoint) return doc.authorization_endpoint;
42
49
  } catch {
43
50
  }
44
- return FALLBACK_AUTHORIZATION_ENDPOINT;
51
+ return fallbackAuthorizationEndpoint(base);
45
52
  }
46
53
 
47
54
  exports.DEFAULT_ISSUER = DEFAULT_ISSUER;
@@ -1,5 +1,5 @@
1
1
  import { createMockApp } from './chunk-3G4QCENX.mjs';
2
- import { createCimplifyClient } from './chunk-SQ7U3BWY.mjs';
2
+ import { createCimplifyClient } from './chunk-227XTAEB.mjs';
3
3
  import { z } from 'zod';
4
4
 
5
5
  var cimplifyRegistry = z.registry();
@@ -1786,6 +1786,9 @@ var LinkService = class {
1786
1786
  async getPreferences() {
1787
1787
  return safe(this.client.linkGet("/v1/link/preferences"));
1788
1788
  }
1789
+ async updateProfile(input) {
1790
+ return safe(this.client.linkPost("/v1/link/profile", input));
1791
+ }
1789
1792
  async getOrders(options) {
1790
1793
  const params = new URLSearchParams();
1791
1794
  if (options?.status) params.set("status", options.status);
@@ -1245,6 +1245,11 @@ declare class LinkService {
1245
1245
  getAddresses(): Promise<Result<CustomerAddress[], CimplifyError>>;
1246
1246
  getMobileMoney(): Promise<Result<CustomerMobileMoney[], CimplifyError>>;
1247
1247
  getPreferences(): Promise<Result<CustomerLinkPreferences, CimplifyError>>;
1248
+ updateProfile(input: {
1249
+ name?: string;
1250
+ email?: string;
1251
+ phone?: string;
1252
+ }): Promise<Result<Customer, CimplifyError>>;
1248
1253
  getOrders(options?: GetLinkOrdersOptions): Promise<Result<Order[], CimplifyError>>;
1249
1254
  getOrder(orderId: string, options?: GetLinkOrderOptions): Promise<Result<Order, CimplifyError>>;
1250
1255
  enroll(data: EnrollmentData, opts?: IdempotencyOption$6): Promise<Result<LinkEnrollResult, CimplifyError>>;
@@ -2392,6 +2397,7 @@ declare class CimplifyClient {
2392
2397
  private context;
2393
2398
  private businessId;
2394
2399
  private businessIdResolvePromise;
2400
+ private refreshInflight;
2395
2401
  private inflightRequests;
2396
2402
  /**
2397
2403
  * App-level event channel. Subscribe to surface mutation rollbacks, outbox
@@ -2432,8 +2438,8 @@ declare class CimplifyClient {
2432
2438
  setBusinessId(businessId: string): void;
2433
2439
  getBusinessId(): string | null;
2434
2440
  resolveBusinessId(): Promise<string>;
2435
- private loadAccessToken;
2436
- private saveAccessToken;
2441
+ private refreshAccessToken;
2442
+ private authedFetch;
2437
2443
  private loadSessionToken;
2438
2444
  private saveSessionToken;
2439
2445
  private captureSessionToken;
@@ -1,4 +1,4 @@
1
- import { ac as CimplifyClient } from './client-DKg-5OWu.mjs';
1
+ import { ac as CimplifyClient } from './client-Dka2cGhu.mjs';
2
2
  import { A as AppHandle, C as CreateAppOptions } from './server-D8rwqZQ6.mjs';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { ac as CimplifyClient } from './client-Dfg_hmkP.js';
1
+ import { ac as CimplifyClient } from './client-Bo5rujc2.js';
2
2
  import { A as AppHandle, C as CreateAppOptions } from './server-BQzz921M.js';
3
3
 
4
4
  /**
@@ -1245,6 +1245,11 @@ declare class LinkService {
1245
1245
  getAddresses(): Promise<Result<CustomerAddress[], CimplifyError>>;
1246
1246
  getMobileMoney(): Promise<Result<CustomerMobileMoney[], CimplifyError>>;
1247
1247
  getPreferences(): Promise<Result<CustomerLinkPreferences, CimplifyError>>;
1248
+ updateProfile(input: {
1249
+ name?: string;
1250
+ email?: string;
1251
+ phone?: string;
1252
+ }): Promise<Result<Customer, CimplifyError>>;
1248
1253
  getOrders(options?: GetLinkOrdersOptions): Promise<Result<Order[], CimplifyError>>;
1249
1254
  getOrder(orderId: string, options?: GetLinkOrderOptions): Promise<Result<Order, CimplifyError>>;
1250
1255
  enroll(data: EnrollmentData, opts?: IdempotencyOption$6): Promise<Result<LinkEnrollResult, CimplifyError>>;
@@ -2392,6 +2397,7 @@ declare class CimplifyClient {
2392
2397
  private context;
2393
2398
  private businessId;
2394
2399
  private businessIdResolvePromise;
2400
+ private refreshInflight;
2395
2401
  private inflightRequests;
2396
2402
  /**
2397
2403
  * App-level event channel. Subscribe to surface mutation rollbacks, outbox
@@ -2432,8 +2438,8 @@ declare class CimplifyClient {
2432
2438
  setBusinessId(businessId: string): void;
2433
2439
  getBusinessId(): string | null;
2434
2440
  resolveBusinessId(): Promise<string>;
2435
- private loadAccessToken;
2436
- private saveAccessToken;
2441
+ private refreshAccessToken;
2442
+ private authedFetch;
2437
2443
  private loadSessionToken;
2438
2444
  private saveSessionToken;
2439
2445
  private captureSessionToken;
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- export { A as AUTHORIZATION_TYPE, a as AUTH_MUTATION, b as AbortablePromise, c as ActivityRecommendation, d as ActivityRecommendationsResponse, e as ActivityService, f as ActivityStateResponse, g as AddressData, h as AddressInfo, i as AmountToPay, j as AuthResponse, k as AuthService, l as AuthStatus, m as AuthenticatedCustomer, n as AuthenticatedData, o as AutocompletePrediction, p as AutocompleteResponse, q as AvailabilityResult, r as AvailableSlot, B as Booking, s as BookingModificationType, t as BookingStatus, u as BookingWithDetails, v as BufferTimes, w as Business, x as BusinessHours, y as BusinessPreferences, z as BusinessService, C as BusinessSettings, D as BusinessType, E as BusinessWithLocations, F as CHECKOUT_MODE, G as CHECKOUT_MUTATION, H as CHECKOUT_STEP, I as CONTACT_TYPE, J as CacheOptions, K as CancelBookingInput, L as CancelBookingResult, M as CancelOrderInput, N as CancellationPolicy, O as CartOperations, P as CatalogueQueries, Q as CatalogueResult, R as CatalogueSnapshot, S as CategoryInfo, T as ChatAttachment, U as ChatConversation, V as ChatConversationResponse, W as ChatMessage, X as ChatWidgetStarter, Y as CheckSlotAvailabilityInput, Z as CheckSlotAvailabilityResult, _ as CheckoutAddressInfo, $ as CheckoutCartData, a0 as CheckoutCartItem, a1 as CheckoutCustomerInfo, a2 as CheckoutFormData, a3 as CheckoutInput, a4 as CheckoutMode, a8 as CheckoutOperations, a5 as CheckoutOrderType, a6 as CheckoutPaymentMethod, a7 as CheckoutResult, a8 as CheckoutService, a9 as CheckoutStatus, aa as CheckoutStatusContext, ab as CheckoutStep, ac as CimplifyClient, ad as CimplifyConfig, ae as CimplifyElement, af as CimplifyElements, ag as ContactType, ah as ContentType, ai as CreateAddressInput, aj as CreateMobileMoneyInput, ak as Customer, al as CustomerAddress, am as CustomerBooking, an as CustomerBookingServiceItem, ao as CustomerLinkPreferences, ap as CustomerMobileMoney, aq as CustomerServicePreferences, ar as DEFAULT_COUNTRY, as as DEFAULT_CURRENCY, at as DEVICE_TYPE, au as DayAvailability, av as DeliveryFeeDetails, aw as DeliveryFeeResponse, ax as DeliveryService, ay as DepositResult, az as DeviceType, aA as DismissMessageResponse, aB as ELEMENT_TYPES, aC as EVENT_TYPES, aD as ElementAppearance, aE as ElementEventHandler, aF as ElementEventType, aG as ElementOptions, aH as ElementType, aI as ElementsCheckoutData, aJ as ElementsCheckoutResult, aK as ElementsCustomerInfo, aL as ElementsOptions, aM as EnrollAndLinkOrderInput, aN as EnrollAndLinkOrderResult, aO as EnrollmentData, aP as Err, aQ as FeeBearerType, aR as FetchQuoteInput, aS as FulfillmentLink, aT as FulfillmentStatus, aU as FulfillmentType, aV as FxQuote, aW as FxQuoteRequest, aX as FxRateResponse, aY as FxService, aZ as GetAvailableSlotsInput, a_ as GetOrdersOptions, a$ as GetProductsOptions, b0 as IframeToParentMessage, b1 as InventoryService, b2 as LINK_MUTATION, b3 as LINK_QUERY, b4 as LineItem, b5 as LineType, b6 as LinkData, b7 as LinkEnrollResult, b8 as LinkService, b9 as LinkSession, ba as LinkStatusResult, bb as LiteBootstrap, bc as LiteService, bd as Location, be as LocationBooking, bf as LocationTaxBehavior, bg as LocationTaxOverrides, bh as LocationTimeProfile, bi as LocationWithDetails, bj as MESSAGE_TYPES, bk as MOBILE_MONEY_PROVIDER, bl as MobileMoneyData, bm as MobileMoneyDetails, bn as MobileMoneyProvider, bo as NextAction, bp as ORDER_MUTATION, bq as ORDER_TYPE, br as ObservabilityHooks, bs as Ok, bt as Order, bu as OrderChannel, bv as OrderFilter, bw as OrderFulfillmentSummary, bx as OrderGroup, by as OrderGroupDetails, bz as OrderGroupPayment, bA as OrderGroupPaymentState, bB as OrderGroupPaymentStatus, bC as OrderGroupPaymentSummary, bD as OrderGroupStatus, bE as OrderHistory, bF as OrderLineState, bG as OrderLineStatus, bH as OrderPaymentEvent, bI as OrderQueries, bJ as OrderSplitDetail, bK as OrderStatus, bL as OrderType, bM as OtpResult, bN as PAYMENT_METHOD, bO as PAYMENT_MUTATION, bP as PAYMENT_STATE, bQ as PICKUP_TIME_TYPE, bR as ParentToIframeMessage, bS as PaymentMethodInfo, bT as PaymentState, bU as PickupTime, bV as PickupTimeType, bW as PlaceDetailsResponse, bX as PlacesService, bY as PriceQuote, bZ as PricingOverrides, b_ as ProcessAndResolveOptions, b$ as ProcessCheckoutOptions, c0 as ProcessCheckoutResult, c1 as ProviderResolutionSource, c2 as QuoteBundleSelectionInput, c3 as QuoteCompositeSelectionInput, c4 as QuoteDynamicBuckets, c5 as QuoteStatus, c6 as QuoteUiMessage, c7 as ReadRequestOptions, c8 as RefreshQuoteInput, c9 as RefreshQuoteResult, ca as RefundOrderInput, cb as RelatedCandidate, cc as RelatedProduct, cd as RelatedProductsEnrichment, ce as RelationType, cf as ReminderMethod, cg as ReminderSettings, ch as ReorderResult, ci as RequestContext, cj as RequestErrorEvent, ck as RequestOptions, cl as RequestOtpInput, cm as RequestSource, cn as RequestStartEvent, co as RequestSuccessEvent, cp as RescheduleBookingInput, cq as RescheduleBookingResult, cr as RescheduleHistoryRecord, cs as ResourceAssignment, ct as Result, cu as RetryEvent, cv as RevokeAllSessionsResult, cw as RevokeSessionResult, cx as Room, cy as SchedulingMetadata, cz as SchedulingResult, cA as SchedulingService, cB as SenderType, cC as Service, cD as ServiceAvailabilityParams, cE as ServiceAvailabilityResult, cF as ServiceCharge, cG as ServiceNotes, cH as ServiceScheduleRequest, cI as ServiceStatus, cJ as SessionActivityData, cK as SessionChangeEvent, cL as SessionMessage, cM as SlotResourceInfo, cN as SlotStaffInfo, cO as Staff, cP as StaffAssignment, cQ as StaffRole, cR as StaffScheduleItem, cS as StockLevel, cT as StockStatus, cU as StorefrontBootstrap, cV as SubscriptionService, cW as SupportService, cX as Table, cY as TableInfo, cZ as TimeRange, c_ as TimeRanges, c$ as TimeSlot, d0 as TrackCategoryViewOptions, d1 as TrackProductViewOptions, d2 as UpdateAddressInput, d3 as UpdateOrderStatusInput, d4 as UpdateProfileInput, d5 as UploadInitResponse, d6 as UploadResult, d7 as UploadService, d8 as VerifyOtpInput, d9 as combine, da as combineObject, db as createCimplifyClient, dc as createElements, dd as err, de as flatMap, df as fromPromise, dg as getOrElse, dh as isErr, di as isOk, dj as mapError, dk as mapResult, dl as ok, dm as toNullable, dn as tryCatch, dp as unwrap } from './client-DKg-5OWu.mjs';
1
+ export { A as AUTHORIZATION_TYPE, a as AUTH_MUTATION, b as AbortablePromise, c as ActivityRecommendation, d as ActivityRecommendationsResponse, e as ActivityService, f as ActivityStateResponse, g as AddressData, h as AddressInfo, i as AmountToPay, j as AuthResponse, k as AuthService, l as AuthStatus, m as AuthenticatedCustomer, n as AuthenticatedData, o as AutocompletePrediction, p as AutocompleteResponse, q as AvailabilityResult, r as AvailableSlot, B as Booking, s as BookingModificationType, t as BookingStatus, u as BookingWithDetails, v as BufferTimes, w as Business, x as BusinessHours, y as BusinessPreferences, z as BusinessService, C as BusinessSettings, D as BusinessType, E as BusinessWithLocations, F as CHECKOUT_MODE, G as CHECKOUT_MUTATION, H as CHECKOUT_STEP, I as CONTACT_TYPE, J as CacheOptions, K as CancelBookingInput, L as CancelBookingResult, M as CancelOrderInput, N as CancellationPolicy, O as CartOperations, P as CatalogueQueries, Q as CatalogueResult, R as CatalogueSnapshot, S as CategoryInfo, T as ChatAttachment, U as ChatConversation, V as ChatConversationResponse, W as ChatMessage, X as ChatWidgetStarter, Y as CheckSlotAvailabilityInput, Z as CheckSlotAvailabilityResult, _ as CheckoutAddressInfo, $ as CheckoutCartData, a0 as CheckoutCartItem, a1 as CheckoutCustomerInfo, a2 as CheckoutFormData, a3 as CheckoutInput, a4 as CheckoutMode, a8 as CheckoutOperations, a5 as CheckoutOrderType, a6 as CheckoutPaymentMethod, a7 as CheckoutResult, a8 as CheckoutService, a9 as CheckoutStatus, aa as CheckoutStatusContext, ab as CheckoutStep, ac as CimplifyClient, ad as CimplifyConfig, ae as CimplifyElement, af as CimplifyElements, ag as ContactType, ah as ContentType, ai as CreateAddressInput, aj as CreateMobileMoneyInput, ak as Customer, al as CustomerAddress, am as CustomerBooking, an as CustomerBookingServiceItem, ao as CustomerLinkPreferences, ap as CustomerMobileMoney, aq as CustomerServicePreferences, ar as DEFAULT_COUNTRY, as as DEFAULT_CURRENCY, at as DEVICE_TYPE, au as DayAvailability, av as DeliveryFeeDetails, aw as DeliveryFeeResponse, ax as DeliveryService, ay as DepositResult, az as DeviceType, aA as DismissMessageResponse, aB as ELEMENT_TYPES, aC as EVENT_TYPES, aD as ElementAppearance, aE as ElementEventHandler, aF as ElementEventType, aG as ElementOptions, aH as ElementType, aI as ElementsCheckoutData, aJ as ElementsCheckoutResult, aK as ElementsCustomerInfo, aL as ElementsOptions, aM as EnrollAndLinkOrderInput, aN as EnrollAndLinkOrderResult, aO as EnrollmentData, aP as Err, aQ as FeeBearerType, aR as FetchQuoteInput, aS as FulfillmentLink, aT as FulfillmentStatus, aU as FulfillmentType, aV as FxQuote, aW as FxQuoteRequest, aX as FxRateResponse, aY as FxService, aZ as GetAvailableSlotsInput, a_ as GetOrdersOptions, a$ as GetProductsOptions, b0 as IframeToParentMessage, b1 as InventoryService, b2 as LINK_MUTATION, b3 as LINK_QUERY, b4 as LineItem, b5 as LineType, b6 as LinkData, b7 as LinkEnrollResult, b8 as LinkService, b9 as LinkSession, ba as LinkStatusResult, bb as LiteBootstrap, bc as LiteService, bd as Location, be as LocationBooking, bf as LocationTaxBehavior, bg as LocationTaxOverrides, bh as LocationTimeProfile, bi as LocationWithDetails, bj as MESSAGE_TYPES, bk as MOBILE_MONEY_PROVIDER, bl as MobileMoneyData, bm as MobileMoneyDetails, bn as MobileMoneyProvider, bo as NextAction, bp as ORDER_MUTATION, bq as ORDER_TYPE, br as ObservabilityHooks, bs as Ok, bt as Order, bu as OrderChannel, bv as OrderFilter, bw as OrderFulfillmentSummary, bx as OrderGroup, by as OrderGroupDetails, bz as OrderGroupPayment, bA as OrderGroupPaymentState, bB as OrderGroupPaymentStatus, bC as OrderGroupPaymentSummary, bD as OrderGroupStatus, bE as OrderHistory, bF as OrderLineState, bG as OrderLineStatus, bH as OrderPaymentEvent, bI as OrderQueries, bJ as OrderSplitDetail, bK as OrderStatus, bL as OrderType, bM as OtpResult, bN as PAYMENT_METHOD, bO as PAYMENT_MUTATION, bP as PAYMENT_STATE, bQ as PICKUP_TIME_TYPE, bR as ParentToIframeMessage, bS as PaymentMethodInfo, bT as PaymentState, bU as PickupTime, bV as PickupTimeType, bW as PlaceDetailsResponse, bX as PlacesService, bY as PriceQuote, bZ as PricingOverrides, b_ as ProcessAndResolveOptions, b$ as ProcessCheckoutOptions, c0 as ProcessCheckoutResult, c1 as ProviderResolutionSource, c2 as QuoteBundleSelectionInput, c3 as QuoteCompositeSelectionInput, c4 as QuoteDynamicBuckets, c5 as QuoteStatus, c6 as QuoteUiMessage, c7 as ReadRequestOptions, c8 as RefreshQuoteInput, c9 as RefreshQuoteResult, ca as RefundOrderInput, cb as RelatedCandidate, cc as RelatedProduct, cd as RelatedProductsEnrichment, ce as RelationType, cf as ReminderMethod, cg as ReminderSettings, ch as ReorderResult, ci as RequestContext, cj as RequestErrorEvent, ck as RequestOptions, cl as RequestOtpInput, cm as RequestSource, cn as RequestStartEvent, co as RequestSuccessEvent, cp as RescheduleBookingInput, cq as RescheduleBookingResult, cr as RescheduleHistoryRecord, cs as ResourceAssignment, ct as Result, cu as RetryEvent, cv as RevokeAllSessionsResult, cw as RevokeSessionResult, cx as Room, cy as SchedulingMetadata, cz as SchedulingResult, cA as SchedulingService, cB as SenderType, cC as Service, cD as ServiceAvailabilityParams, cE as ServiceAvailabilityResult, cF as ServiceCharge, cG as ServiceNotes, cH as ServiceScheduleRequest, cI as ServiceStatus, cJ as SessionActivityData, cK as SessionChangeEvent, cL as SessionMessage, cM as SlotResourceInfo, cN as SlotStaffInfo, cO as Staff, cP as StaffAssignment, cQ as StaffRole, cR as StaffScheduleItem, cS as StockLevel, cT as StockStatus, cU as StorefrontBootstrap, cV as SubscriptionService, cW as SupportService, cX as Table, cY as TableInfo, cZ as TimeRange, c_ as TimeRanges, c$ as TimeSlot, d0 as TrackCategoryViewOptions, d1 as TrackProductViewOptions, d2 as UpdateAddressInput, d3 as UpdateOrderStatusInput, d4 as UpdateProfileInput, d5 as UploadInitResponse, d6 as UploadResult, d7 as UploadService, d8 as VerifyOtpInput, d9 as combine, da as combineObject, db as createCimplifyClient, dc as createElements, dd as err, de as flatMap, df as fromPromise, dg as getOrElse, dh as isErr, di as isOk, dj as mapError, dk as mapResult, dl as ok, dm as toNullable, dn as tryCatch, dp as unwrap } from './client-Dka2cGhu.mjs';
2
2
  import { b9 as ProductWithDetails, j as ApiError } from './product-B_kS4Oxa.mjs';
3
3
  export { A as AddOn, a as AddOnDetails, b as AddOnGroupDetails, c as AddOnOption, d as AddOnOptionDetails, e as AddOnOptionPrice, f as AddOnWithOptions, g as AddToCartInput, h as AddressValue, i as AdjustmentType, k as AppliedDiscount, l as AttributeAppliesTo, m as AttributeType, n as AttributeValidationRules, o as AttributeVisibility, B as BenefitType, p as BillingFrequency, q as BillingMarkupType, r as BillingPlanType, s as Bundle, t as BundleComponentData, u as BundleComponentInfo, v as BundleComponentVariantView, w as BundleComponentView, x as BundlePriceType, y as BundleProduct, z as BundleSelectionData, C as BundleSelectionInput, D as BundleStoredSelection, E as BundleSummary, F as BundleWithDetails, G as Cart, H as CartAddOn, I as CartChannel, J as CartItem, K as CartItemDetails, L as CartMutationResult, M as CartNotice, N as CartStatus, O as CartSummary, P as CartTotals, Q as Category, R as CategorySummary, S as ChosenPrice, T as CimplifyError, U as Collection, V as CollectionProduct, W as CollectionSummary, X as ComponentGroup, Y as ComponentGroupWithComponents, Z as ComponentPriceBreakdown, _ as ComponentSchedulingData, $ as ComponentSelectionInput, a0 as ComponentSourceType, a1 as Composite, a2 as CompositeComponent, a3 as CompositeComponentView, a4 as CompositeGroupView, a5 as CompositePriceBreakdown, a6 as CompositePriceResult, a7 as CompositePricingMode, a8 as CompositeSelectionData, $ as CompositeSelectionInput, a9 as CompositeStoredSelection, aa as CompositeWithDetails, ab as CurrencyCode, ac as CustomAttributeDefinition, ad as CustomAttributeValue, ae as CustomerInputValue, af as DURATION_UNIT, ag as DateRangeValue, ah as Deal, ai as DealBenefitType, aj as DepositType, ak as DigitalProductType, al as DiscountBreakdown, am as DiscountDetails, an as DiscountValidation, ao as DisplayAddOn, ap as DisplayAddOnOption, aq as DisplayCart, ar as DisplayCartItem, as as DisplayMode, at as DurationUnit, au as ERROR_HINTS, av as EligiblePlansQuery, aw as ErrorCode, ax as ErrorCodeType, ay as ErrorHint, az as FacetValue, aA as FormattedPlanOption, aB as GroupPricingBehavior, aC as INPUT_FIELD_TYPE, aD as IdempotencyMismatchError, aE as InputFieldType, aF as InputFieldValidation, aG as InventoryType, aH as KnowledgeArticle, aI as LineConfiguration, aJ as LocationProductPrice, aK as LocationValue, aL as MeasurementValue, aM as Money, aN as PRODUCT_TYPE, aO as Pagination, aP as PaginationParams, aQ as PhoneValue, aR as Price, aS as PriceAdjustment, aT as PriceDecisionPath, aU as PriceEntryType, aV as PricePathTaxInfo, aW as PriceSource, aX as Product, aY as ProductAddOn, aZ as ProductAvailability, a_ as ProductAvailabilityNow, a$ as ProductBillingPlan, b0 as ProductDealInfo, b1 as ProductInputField, b2 as ProductProperty, b3 as ProductRenderHint, b4 as ProductTaxonomy, b5 as ProductTimeProfile, b6 as ProductType, b7 as ProductVariant, b8 as ProductVariantValue, ba as PropertyFacet, bb as PropertySource, bc as QuantityPricingTier, bd as RENDER_HINT, be as RelatedProductView, bf as SalesChannel, bg as SchedulingMode, bh as SelectedAddOnOption, bi as SemanticKind, bj as SignatureValue, bk as Subscription, bl as SubscriptionInvoice, bm as SubscriptionItem, bn as SubscriptionStatus, bo as SubscriptionWithDetails, bp as Tag, bq as TagsResponse, br as TaxPathComponent, bs as TaxonomyAttributeTemplate, bt as TaxonomyWithChildren, bu as UICart, bv as UICartBusiness, bw as UICartCustomer, bx as UICartLocation, by as UICartPricing, bz as UpdateCartItemInput, bA as VariantAxis, bB as VariantAxisSelection, bC as VariantAxisValue, bD as VariantAxisValueView, bE as VariantAxisView, bF as VariantAxisWithValues, bG as VariantDetails, bH as VariantDetailsDTO, bI as VariantDisplayAttribute, bJ as VariantLocationAvailability, bK as VariantStrategy, bL as VariantView, bM as ZERO, bN as currencyCode, bO as enrichError, bP as getErrorHint, bQ as isCimplifyError, bR as isIdempotencyMismatchError, bS as isQuoteConflictRequiringConsent, bT as isQuoteError, bU as isRetryableError, bV as isSupportedCurrency, bW as money, bX as moneyFromNumber } from './product-B_kS4Oxa.mjs';
4
4
  export { C as CURRENCY_SYMBOLS, M as MOBILE_MONEY_PROVIDERS, c as categorizePaymentError, d as detectMobileMoneyProvider, f as formatMoney, a as formatNumberCompact, b as formatPrice, e as formatPriceAdjustment, g as formatPriceCompact, h as formatPriceRange, i as formatPriceWithTax, j as formatProductPrice, k as getBasePrice, l as getCurrencySymbol, m as getDiscountPercentage, n as getDisplayPrice, o as getMarkupPercentage, p as getPriceRange, q as getProductCurrency, r as getTaxAmount, s as getUnitPriceAtQuantity, t as hasTaxInfo, u as isOnSale, v as isPaymentStatusFailure, w as isPaymentStatusRequiresAction, x as isPaymentStatusSuccess, y as isTaxInclusive, z as isValidPhoneForContext, A as normalizePaymentResponse, B as normalizePhoneToE164, D as normalizeStatusResponse, E as parsePrice, F as resolvePhoneCountryCode } from './index-D8vnKlOQ.mjs';
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { A as AUTHORIZATION_TYPE, a as AUTH_MUTATION, b as AbortablePromise, c as ActivityRecommendation, d as ActivityRecommendationsResponse, e as ActivityService, f as ActivityStateResponse, g as AddressData, h as AddressInfo, i as AmountToPay, j as AuthResponse, k as AuthService, l as AuthStatus, m as AuthenticatedCustomer, n as AuthenticatedData, o as AutocompletePrediction, p as AutocompleteResponse, q as AvailabilityResult, r as AvailableSlot, B as Booking, s as BookingModificationType, t as BookingStatus, u as BookingWithDetails, v as BufferTimes, w as Business, x as BusinessHours, y as BusinessPreferences, z as BusinessService, C as BusinessSettings, D as BusinessType, E as BusinessWithLocations, F as CHECKOUT_MODE, G as CHECKOUT_MUTATION, H as CHECKOUT_STEP, I as CONTACT_TYPE, J as CacheOptions, K as CancelBookingInput, L as CancelBookingResult, M as CancelOrderInput, N as CancellationPolicy, O as CartOperations, P as CatalogueQueries, Q as CatalogueResult, R as CatalogueSnapshot, S as CategoryInfo, T as ChatAttachment, U as ChatConversation, V as ChatConversationResponse, W as ChatMessage, X as ChatWidgetStarter, Y as CheckSlotAvailabilityInput, Z as CheckSlotAvailabilityResult, _ as CheckoutAddressInfo, $ as CheckoutCartData, a0 as CheckoutCartItem, a1 as CheckoutCustomerInfo, a2 as CheckoutFormData, a3 as CheckoutInput, a4 as CheckoutMode, a8 as CheckoutOperations, a5 as CheckoutOrderType, a6 as CheckoutPaymentMethod, a7 as CheckoutResult, a8 as CheckoutService, a9 as CheckoutStatus, aa as CheckoutStatusContext, ab as CheckoutStep, ac as CimplifyClient, ad as CimplifyConfig, ae as CimplifyElement, af as CimplifyElements, ag as ContactType, ah as ContentType, ai as CreateAddressInput, aj as CreateMobileMoneyInput, ak as Customer, al as CustomerAddress, am as CustomerBooking, an as CustomerBookingServiceItem, ao as CustomerLinkPreferences, ap as CustomerMobileMoney, aq as CustomerServicePreferences, ar as DEFAULT_COUNTRY, as as DEFAULT_CURRENCY, at as DEVICE_TYPE, au as DayAvailability, av as DeliveryFeeDetails, aw as DeliveryFeeResponse, ax as DeliveryService, ay as DepositResult, az as DeviceType, aA as DismissMessageResponse, aB as ELEMENT_TYPES, aC as EVENT_TYPES, aD as ElementAppearance, aE as ElementEventHandler, aF as ElementEventType, aG as ElementOptions, aH as ElementType, aI as ElementsCheckoutData, aJ as ElementsCheckoutResult, aK as ElementsCustomerInfo, aL as ElementsOptions, aM as EnrollAndLinkOrderInput, aN as EnrollAndLinkOrderResult, aO as EnrollmentData, aP as Err, aQ as FeeBearerType, aR as FetchQuoteInput, aS as FulfillmentLink, aT as FulfillmentStatus, aU as FulfillmentType, aV as FxQuote, aW as FxQuoteRequest, aX as FxRateResponse, aY as FxService, aZ as GetAvailableSlotsInput, a_ as GetOrdersOptions, a$ as GetProductsOptions, b0 as IframeToParentMessage, b1 as InventoryService, b2 as LINK_MUTATION, b3 as LINK_QUERY, b4 as LineItem, b5 as LineType, b6 as LinkData, b7 as LinkEnrollResult, b8 as LinkService, b9 as LinkSession, ba as LinkStatusResult, bb as LiteBootstrap, bc as LiteService, bd as Location, be as LocationBooking, bf as LocationTaxBehavior, bg as LocationTaxOverrides, bh as LocationTimeProfile, bi as LocationWithDetails, bj as MESSAGE_TYPES, bk as MOBILE_MONEY_PROVIDER, bl as MobileMoneyData, bm as MobileMoneyDetails, bn as MobileMoneyProvider, bo as NextAction, bp as ORDER_MUTATION, bq as ORDER_TYPE, br as ObservabilityHooks, bs as Ok, bt as Order, bu as OrderChannel, bv as OrderFilter, bw as OrderFulfillmentSummary, bx as OrderGroup, by as OrderGroupDetails, bz as OrderGroupPayment, bA as OrderGroupPaymentState, bB as OrderGroupPaymentStatus, bC as OrderGroupPaymentSummary, bD as OrderGroupStatus, bE as OrderHistory, bF as OrderLineState, bG as OrderLineStatus, bH as OrderPaymentEvent, bI as OrderQueries, bJ as OrderSplitDetail, bK as OrderStatus, bL as OrderType, bM as OtpResult, bN as PAYMENT_METHOD, bO as PAYMENT_MUTATION, bP as PAYMENT_STATE, bQ as PICKUP_TIME_TYPE, bR as ParentToIframeMessage, bS as PaymentMethodInfo, bT as PaymentState, bU as PickupTime, bV as PickupTimeType, bW as PlaceDetailsResponse, bX as PlacesService, bY as PriceQuote, bZ as PricingOverrides, b_ as ProcessAndResolveOptions, b$ as ProcessCheckoutOptions, c0 as ProcessCheckoutResult, c1 as ProviderResolutionSource, c2 as QuoteBundleSelectionInput, c3 as QuoteCompositeSelectionInput, c4 as QuoteDynamicBuckets, c5 as QuoteStatus, c6 as QuoteUiMessage, c7 as ReadRequestOptions, c8 as RefreshQuoteInput, c9 as RefreshQuoteResult, ca as RefundOrderInput, cb as RelatedCandidate, cc as RelatedProduct, cd as RelatedProductsEnrichment, ce as RelationType, cf as ReminderMethod, cg as ReminderSettings, ch as ReorderResult, ci as RequestContext, cj as RequestErrorEvent, ck as RequestOptions, cl as RequestOtpInput, cm as RequestSource, cn as RequestStartEvent, co as RequestSuccessEvent, cp as RescheduleBookingInput, cq as RescheduleBookingResult, cr as RescheduleHistoryRecord, cs as ResourceAssignment, ct as Result, cu as RetryEvent, cv as RevokeAllSessionsResult, cw as RevokeSessionResult, cx as Room, cy as SchedulingMetadata, cz as SchedulingResult, cA as SchedulingService, cB as SenderType, cC as Service, cD as ServiceAvailabilityParams, cE as ServiceAvailabilityResult, cF as ServiceCharge, cG as ServiceNotes, cH as ServiceScheduleRequest, cI as ServiceStatus, cJ as SessionActivityData, cK as SessionChangeEvent, cL as SessionMessage, cM as SlotResourceInfo, cN as SlotStaffInfo, cO as Staff, cP as StaffAssignment, cQ as StaffRole, cR as StaffScheduleItem, cS as StockLevel, cT as StockStatus, cU as StorefrontBootstrap, cV as SubscriptionService, cW as SupportService, cX as Table, cY as TableInfo, cZ as TimeRange, c_ as TimeRanges, c$ as TimeSlot, d0 as TrackCategoryViewOptions, d1 as TrackProductViewOptions, d2 as UpdateAddressInput, d3 as UpdateOrderStatusInput, d4 as UpdateProfileInput, d5 as UploadInitResponse, d6 as UploadResult, d7 as UploadService, d8 as VerifyOtpInput, d9 as combine, da as combineObject, db as createCimplifyClient, dc as createElements, dd as err, de as flatMap, df as fromPromise, dg as getOrElse, dh as isErr, di as isOk, dj as mapError, dk as mapResult, dl as ok, dm as toNullable, dn as tryCatch, dp as unwrap } from './client-Dfg_hmkP.js';
1
+ export { A as AUTHORIZATION_TYPE, a as AUTH_MUTATION, b as AbortablePromise, c as ActivityRecommendation, d as ActivityRecommendationsResponse, e as ActivityService, f as ActivityStateResponse, g as AddressData, h as AddressInfo, i as AmountToPay, j as AuthResponse, k as AuthService, l as AuthStatus, m as AuthenticatedCustomer, n as AuthenticatedData, o as AutocompletePrediction, p as AutocompleteResponse, q as AvailabilityResult, r as AvailableSlot, B as Booking, s as BookingModificationType, t as BookingStatus, u as BookingWithDetails, v as BufferTimes, w as Business, x as BusinessHours, y as BusinessPreferences, z as BusinessService, C as BusinessSettings, D as BusinessType, E as BusinessWithLocations, F as CHECKOUT_MODE, G as CHECKOUT_MUTATION, H as CHECKOUT_STEP, I as CONTACT_TYPE, J as CacheOptions, K as CancelBookingInput, L as CancelBookingResult, M as CancelOrderInput, N as CancellationPolicy, O as CartOperations, P as CatalogueQueries, Q as CatalogueResult, R as CatalogueSnapshot, S as CategoryInfo, T as ChatAttachment, U as ChatConversation, V as ChatConversationResponse, W as ChatMessage, X as ChatWidgetStarter, Y as CheckSlotAvailabilityInput, Z as CheckSlotAvailabilityResult, _ as CheckoutAddressInfo, $ as CheckoutCartData, a0 as CheckoutCartItem, a1 as CheckoutCustomerInfo, a2 as CheckoutFormData, a3 as CheckoutInput, a4 as CheckoutMode, a8 as CheckoutOperations, a5 as CheckoutOrderType, a6 as CheckoutPaymentMethod, a7 as CheckoutResult, a8 as CheckoutService, a9 as CheckoutStatus, aa as CheckoutStatusContext, ab as CheckoutStep, ac as CimplifyClient, ad as CimplifyConfig, ae as CimplifyElement, af as CimplifyElements, ag as ContactType, ah as ContentType, ai as CreateAddressInput, aj as CreateMobileMoneyInput, ak as Customer, al as CustomerAddress, am as CustomerBooking, an as CustomerBookingServiceItem, ao as CustomerLinkPreferences, ap as CustomerMobileMoney, aq as CustomerServicePreferences, ar as DEFAULT_COUNTRY, as as DEFAULT_CURRENCY, at as DEVICE_TYPE, au as DayAvailability, av as DeliveryFeeDetails, aw as DeliveryFeeResponse, ax as DeliveryService, ay as DepositResult, az as DeviceType, aA as DismissMessageResponse, aB as ELEMENT_TYPES, aC as EVENT_TYPES, aD as ElementAppearance, aE as ElementEventHandler, aF as ElementEventType, aG as ElementOptions, aH as ElementType, aI as ElementsCheckoutData, aJ as ElementsCheckoutResult, aK as ElementsCustomerInfo, aL as ElementsOptions, aM as EnrollAndLinkOrderInput, aN as EnrollAndLinkOrderResult, aO as EnrollmentData, aP as Err, aQ as FeeBearerType, aR as FetchQuoteInput, aS as FulfillmentLink, aT as FulfillmentStatus, aU as FulfillmentType, aV as FxQuote, aW as FxQuoteRequest, aX as FxRateResponse, aY as FxService, aZ as GetAvailableSlotsInput, a_ as GetOrdersOptions, a$ as GetProductsOptions, b0 as IframeToParentMessage, b1 as InventoryService, b2 as LINK_MUTATION, b3 as LINK_QUERY, b4 as LineItem, b5 as LineType, b6 as LinkData, b7 as LinkEnrollResult, b8 as LinkService, b9 as LinkSession, ba as LinkStatusResult, bb as LiteBootstrap, bc as LiteService, bd as Location, be as LocationBooking, bf as LocationTaxBehavior, bg as LocationTaxOverrides, bh as LocationTimeProfile, bi as LocationWithDetails, bj as MESSAGE_TYPES, bk as MOBILE_MONEY_PROVIDER, bl as MobileMoneyData, bm as MobileMoneyDetails, bn as MobileMoneyProvider, bo as NextAction, bp as ORDER_MUTATION, bq as ORDER_TYPE, br as ObservabilityHooks, bs as Ok, bt as Order, bu as OrderChannel, bv as OrderFilter, bw as OrderFulfillmentSummary, bx as OrderGroup, by as OrderGroupDetails, bz as OrderGroupPayment, bA as OrderGroupPaymentState, bB as OrderGroupPaymentStatus, bC as OrderGroupPaymentSummary, bD as OrderGroupStatus, bE as OrderHistory, bF as OrderLineState, bG as OrderLineStatus, bH as OrderPaymentEvent, bI as OrderQueries, bJ as OrderSplitDetail, bK as OrderStatus, bL as OrderType, bM as OtpResult, bN as PAYMENT_METHOD, bO as PAYMENT_MUTATION, bP as PAYMENT_STATE, bQ as PICKUP_TIME_TYPE, bR as ParentToIframeMessage, bS as PaymentMethodInfo, bT as PaymentState, bU as PickupTime, bV as PickupTimeType, bW as PlaceDetailsResponse, bX as PlacesService, bY as PriceQuote, bZ as PricingOverrides, b_ as ProcessAndResolveOptions, b$ as ProcessCheckoutOptions, c0 as ProcessCheckoutResult, c1 as ProviderResolutionSource, c2 as QuoteBundleSelectionInput, c3 as QuoteCompositeSelectionInput, c4 as QuoteDynamicBuckets, c5 as QuoteStatus, c6 as QuoteUiMessage, c7 as ReadRequestOptions, c8 as RefreshQuoteInput, c9 as RefreshQuoteResult, ca as RefundOrderInput, cb as RelatedCandidate, cc as RelatedProduct, cd as RelatedProductsEnrichment, ce as RelationType, cf as ReminderMethod, cg as ReminderSettings, ch as ReorderResult, ci as RequestContext, cj as RequestErrorEvent, ck as RequestOptions, cl as RequestOtpInput, cm as RequestSource, cn as RequestStartEvent, co as RequestSuccessEvent, cp as RescheduleBookingInput, cq as RescheduleBookingResult, cr as RescheduleHistoryRecord, cs as ResourceAssignment, ct as Result, cu as RetryEvent, cv as RevokeAllSessionsResult, cw as RevokeSessionResult, cx as Room, cy as SchedulingMetadata, cz as SchedulingResult, cA as SchedulingService, cB as SenderType, cC as Service, cD as ServiceAvailabilityParams, cE as ServiceAvailabilityResult, cF as ServiceCharge, cG as ServiceNotes, cH as ServiceScheduleRequest, cI as ServiceStatus, cJ as SessionActivityData, cK as SessionChangeEvent, cL as SessionMessage, cM as SlotResourceInfo, cN as SlotStaffInfo, cO as Staff, cP as StaffAssignment, cQ as StaffRole, cR as StaffScheduleItem, cS as StockLevel, cT as StockStatus, cU as StorefrontBootstrap, cV as SubscriptionService, cW as SupportService, cX as Table, cY as TableInfo, cZ as TimeRange, c_ as TimeRanges, c$ as TimeSlot, d0 as TrackCategoryViewOptions, d1 as TrackProductViewOptions, d2 as UpdateAddressInput, d3 as UpdateOrderStatusInput, d4 as UpdateProfileInput, d5 as UploadInitResponse, d6 as UploadResult, d7 as UploadService, d8 as VerifyOtpInput, d9 as combine, da as combineObject, db as createCimplifyClient, dc as createElements, dd as err, de as flatMap, df as fromPromise, dg as getOrElse, dh as isErr, di as isOk, dj as mapError, dk as mapResult, dl as ok, dm as toNullable, dn as tryCatch, dp as unwrap } from './client-Bo5rujc2.js';
2
2
  import { b9 as ProductWithDetails, j as ApiError } from './product-B_kS4Oxa.js';
3
3
  export { A as AddOn, a as AddOnDetails, b as AddOnGroupDetails, c as AddOnOption, d as AddOnOptionDetails, e as AddOnOptionPrice, f as AddOnWithOptions, g as AddToCartInput, h as AddressValue, i as AdjustmentType, k as AppliedDiscount, l as AttributeAppliesTo, m as AttributeType, n as AttributeValidationRules, o as AttributeVisibility, B as BenefitType, p as BillingFrequency, q as BillingMarkupType, r as BillingPlanType, s as Bundle, t as BundleComponentData, u as BundleComponentInfo, v as BundleComponentVariantView, w as BundleComponentView, x as BundlePriceType, y as BundleProduct, z as BundleSelectionData, C as BundleSelectionInput, D as BundleStoredSelection, E as BundleSummary, F as BundleWithDetails, G as Cart, H as CartAddOn, I as CartChannel, J as CartItem, K as CartItemDetails, L as CartMutationResult, M as CartNotice, N as CartStatus, O as CartSummary, P as CartTotals, Q as Category, R as CategorySummary, S as ChosenPrice, T as CimplifyError, U as Collection, V as CollectionProduct, W as CollectionSummary, X as ComponentGroup, Y as ComponentGroupWithComponents, Z as ComponentPriceBreakdown, _ as ComponentSchedulingData, $ as ComponentSelectionInput, a0 as ComponentSourceType, a1 as Composite, a2 as CompositeComponent, a3 as CompositeComponentView, a4 as CompositeGroupView, a5 as CompositePriceBreakdown, a6 as CompositePriceResult, a7 as CompositePricingMode, a8 as CompositeSelectionData, $ as CompositeSelectionInput, a9 as CompositeStoredSelection, aa as CompositeWithDetails, ab as CurrencyCode, ac as CustomAttributeDefinition, ad as CustomAttributeValue, ae as CustomerInputValue, af as DURATION_UNIT, ag as DateRangeValue, ah as Deal, ai as DealBenefitType, aj as DepositType, ak as DigitalProductType, al as DiscountBreakdown, am as DiscountDetails, an as DiscountValidation, ao as DisplayAddOn, ap as DisplayAddOnOption, aq as DisplayCart, ar as DisplayCartItem, as as DisplayMode, at as DurationUnit, au as ERROR_HINTS, av as EligiblePlansQuery, aw as ErrorCode, ax as ErrorCodeType, ay as ErrorHint, az as FacetValue, aA as FormattedPlanOption, aB as GroupPricingBehavior, aC as INPUT_FIELD_TYPE, aD as IdempotencyMismatchError, aE as InputFieldType, aF as InputFieldValidation, aG as InventoryType, aH as KnowledgeArticle, aI as LineConfiguration, aJ as LocationProductPrice, aK as LocationValue, aL as MeasurementValue, aM as Money, aN as PRODUCT_TYPE, aO as Pagination, aP as PaginationParams, aQ as PhoneValue, aR as Price, aS as PriceAdjustment, aT as PriceDecisionPath, aU as PriceEntryType, aV as PricePathTaxInfo, aW as PriceSource, aX as Product, aY as ProductAddOn, aZ as ProductAvailability, a_ as ProductAvailabilityNow, a$ as ProductBillingPlan, b0 as ProductDealInfo, b1 as ProductInputField, b2 as ProductProperty, b3 as ProductRenderHint, b4 as ProductTaxonomy, b5 as ProductTimeProfile, b6 as ProductType, b7 as ProductVariant, b8 as ProductVariantValue, ba as PropertyFacet, bb as PropertySource, bc as QuantityPricingTier, bd as RENDER_HINT, be as RelatedProductView, bf as SalesChannel, bg as SchedulingMode, bh as SelectedAddOnOption, bi as SemanticKind, bj as SignatureValue, bk as Subscription, bl as SubscriptionInvoice, bm as SubscriptionItem, bn as SubscriptionStatus, bo as SubscriptionWithDetails, bp as Tag, bq as TagsResponse, br as TaxPathComponent, bs as TaxonomyAttributeTemplate, bt as TaxonomyWithChildren, bu as UICart, bv as UICartBusiness, bw as UICartCustomer, bx as UICartLocation, by as UICartPricing, bz as UpdateCartItemInput, bA as VariantAxis, bB as VariantAxisSelection, bC as VariantAxisValue, bD as VariantAxisValueView, bE as VariantAxisView, bF as VariantAxisWithValues, bG as VariantDetails, bH as VariantDetailsDTO, bI as VariantDisplayAttribute, bJ as VariantLocationAvailability, bK as VariantStrategy, bL as VariantView, bM as ZERO, bN as currencyCode, bO as enrichError, bP as getErrorHint, bQ as isCimplifyError, bR as isIdempotencyMismatchError, bS as isQuoteConflictRequiringConsent, bT as isQuoteError, bU as isRetryableError, bV as isSupportedCurrency, bW as money, bX as moneyFromNumber } from './product-B_kS4Oxa.js';
4
4
  export { C as CURRENCY_SYMBOLS, M as MOBILE_MONEY_PROVIDERS, c as categorizePaymentError, d as detectMobileMoneyProvider, f as formatMoney, a as formatNumberCompact, b as formatPrice, e as formatPriceAdjustment, g as formatPriceCompact, h as formatPriceRange, i as formatPriceWithTax, j as formatProductPrice, k as getBasePrice, l as getCurrencySymbol, m as getDiscountPercentage, n as getDisplayPrice, o as getMarkupPercentage, p as getPriceRange, q as getProductCurrency, r as getTaxAmount, s as getUnitPriceAtQuantity, t as hasTaxInfo, u as isOnSale, v as isPaymentStatusFailure, w as isPaymentStatusRequiresAction, x as isPaymentStatusSuccess, y as isTaxInclusive, z as isValidPhoneForContext, A as normalizePaymentResponse, B as normalizePhoneToE164, D as normalizeStatusResponse, E as parsePrice, F as resolvePhoneCountryCode } from './index-DIIlPUOC.js';