@cimplify/sdk 0.65.0 → 0.67.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 (53) 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-AVQL3TSJ.js → chunk-3QSW33RG.js} +389 -78
  6. package/dist/chunk-E6T5VJMG.mjs +156 -0
  7. package/dist/{chunk-WDTFIIY6.mjs → chunk-FNK6UZOE.mjs} +2 -2
  8. package/dist/{chunk-3G4QCENX.mjs → chunk-FVGVJ4TC.mjs} +12 -50
  9. package/dist/chunk-IQLJJW2H.js +168 -0
  10. package/dist/{chunk-PKYZBKZD.mjs → chunk-JAPCAZN4.mjs} +10 -29
  11. package/dist/{chunk-R6363CC7.mjs → chunk-QQMDEGAK.mjs} +382 -79
  12. package/dist/{chunk-VKID3QUE.js → chunk-SH6HJW4A.js} +4 -4
  13. package/dist/{chunk-VAMZPBA4.js → chunk-SSLFZPAI.js} +44 -63
  14. package/dist/{chunk-HCZTBWU4.js → chunk-SXGFJEME.js} +12 -50
  15. package/dist/{client-BS5lNWWH.d.mts → client-ByI_3jfL.d.mts} +33 -20
  16. package/dist/{client-p1Iofyc9.d.ts → client-CQlEWH5j.d.ts} +1 -1
  17. package/dist/{client-QTrsv6Gu.d.ts → client-DVFQoDtI.d.ts} +33 -20
  18. package/dist/{client-XoswXzib.d.mts → client-Dd82KQ_G.d.mts} +1 -1
  19. package/dist/index.d.mts +2 -2
  20. package/dist/index.d.ts +2 -2
  21. package/dist/index.js +80 -81
  22. package/dist/index.mjs +4 -5
  23. package/dist/mock/cli.mjs +12 -50
  24. package/dist/mock/library.js +12 -50
  25. package/dist/mock/library.mjs +12 -50
  26. package/dist/mock/msw.js +12 -50
  27. package/dist/mock/msw.mjs +12 -50
  28. package/dist/react.d.mts +4 -7
  29. package/dist/react.d.ts +4 -7
  30. package/dist/react.js +63 -71
  31. package/dist/react.mjs +5 -13
  32. package/dist/server.d.mts +18 -3
  33. package/dist/server.d.ts +18 -3
  34. package/dist/server.js +175 -29
  35. package/dist/server.mjs +167 -25
  36. package/dist/{sign-in-dr7m09nm.d.ts → sign-in-RFuWZOgF.d.mts} +6 -1
  37. package/dist/{sign-in-dr7m09nm.d.mts → sign-in-RFuWZOgF.d.ts} +6 -1
  38. package/dist/styles.css +1 -1
  39. package/dist/testing/msw.js +2 -2
  40. package/dist/testing/msw.mjs +1 -1
  41. package/dist/testing/suite.d.mts +2 -2
  42. package/dist/testing/suite.d.ts +2 -2
  43. package/dist/testing/suite.js +23 -23
  44. package/dist/testing/suite.mjs +4 -4
  45. package/dist/testing.d.mts +2 -2
  46. package/dist/testing.d.ts +2 -2
  47. package/dist/testing.js +79 -79
  48. package/dist/testing.mjs +5 -5
  49. package/package.json +1 -1
  50. package/dist/chunk-2AU263DK.mjs +0 -323
  51. package/dist/chunk-6DMHVQ42.js +0 -338
  52. package/dist/chunk-DKT62WQW.js +0 -53
  53. package/dist/chunk-XSOYJLMZ.mjs +0 -45
package/dist/index.js CHANGED
@@ -1,10 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var chunk6DMHVQ42_js = require('./chunk-6DMHVQ42.js');
3
+ var chunkIQLJJW2H_js = require('./chunk-IQLJJW2H.js');
4
4
  var chunkL5GKVQVJ_js = require('./chunk-L5GKVQVJ.js');
5
- var chunkDKT62WQW_js = require('./chunk-DKT62WQW.js');
6
- var chunkVAMZPBA4_js = require('./chunk-VAMZPBA4.js');
7
- var chunkAVQL3TSJ_js = require('./chunk-AVQL3TSJ.js');
5
+ var chunkSSLFZPAI_js = require('./chunk-SSLFZPAI.js');
6
+ var chunk3QSW33RG_js = require('./chunk-3QSW33RG.js');
8
7
  var chunk7Y2O3E4D_js = require('./chunk-7Y2O3E4D.js');
9
8
  var chunkXA3ZNR75_js = require('./chunk-XA3ZNR75.js');
10
9
  require('./chunk-OWW5GUSB.js');
@@ -23,9 +22,9 @@ async function signInSilent(opts) {
23
22
  } catch {
24
23
  }
25
24
  const callbackUri = opts.callbackUri ?? "/auth/callback";
26
- const authorizeEndpoint = opts.authUrl ? `${opts.authUrl.replace(/\/$/, "")}/oauth/authorize` : await chunkDKT62WQW_js.getAuthorizationEndpoint(opts.issuer ?? chunkDKT62WQW_js.DEFAULT_ISSUER);
27
- const pkce = await chunk6DMHVQ42_js.generatePkce();
28
- const state = chunk6DMHVQ42_js.generateState();
25
+ const authorizeEndpoint = opts.authUrl ? `${opts.authUrl.replace(/\/$/, "")}/oauth/authorize` : await chunk3QSW33RG_js.getAuthorizationEndpoint(opts.issuer ?? chunk3QSW33RG_js.DEFAULT_ISSUER);
26
+ const pkce = await chunk3QSW33RG_js.generatePkce();
27
+ const state = chunk3QSW33RG_js.generateState();
29
28
  const params = new URLSearchParams({
30
29
  response_type: "code",
31
30
  response_mode: "web_message",
@@ -95,51 +94,47 @@ async function signInSilent(opts) {
95
94
 
96
95
  Object.defineProperty(exports, "CIMPLIFY_CDN_HOSTS", {
97
96
  enumerable: true,
98
- get: function () { return chunk6DMHVQ42_js.CIMPLIFY_CDN_HOSTS; }
97
+ get: function () { return chunkIQLJJW2H_js.CIMPLIFY_CDN_HOSTS; }
99
98
  });
100
99
  Object.defineProperty(exports, "DEFAULT_CDN_BASE_URL", {
101
100
  enumerable: true,
102
- get: function () { return chunk6DMHVQ42_js.DEFAULT_CDN_BASE_URL; }
101
+ get: function () { return chunkIQLJJW2H_js.DEFAULT_CDN_BASE_URL; }
103
102
  });
104
103
  Object.defineProperty(exports, "DURATION_UNIT", {
105
104
  enumerable: true,
106
- get: function () { return chunk6DMHVQ42_js.DURATION_UNIT; }
105
+ get: function () { return chunkIQLJJW2H_js.DURATION_UNIT; }
107
106
  });
108
107
  Object.defineProperty(exports, "INPUT_FIELD_TYPE", {
109
108
  enumerable: true,
110
- get: function () { return chunk6DMHVQ42_js.INPUT_FIELD_TYPE; }
109
+ get: function () { return chunkIQLJJW2H_js.INPUT_FIELD_TYPE; }
111
110
  });
112
111
  Object.defineProperty(exports, "PRODUCT_TYPE", {
113
112
  enumerable: true,
114
- get: function () { return chunk6DMHVQ42_js.PRODUCT_TYPE; }
113
+ get: function () { return chunkIQLJJW2H_js.PRODUCT_TYPE; }
115
114
  });
116
115
  Object.defineProperty(exports, "RENDER_HINT", {
117
116
  enumerable: true,
118
- get: function () { return chunk6DMHVQ42_js.RENDER_HINT; }
117
+ get: function () { return chunkIQLJJW2H_js.RENDER_HINT; }
119
118
  });
120
119
  Object.defineProperty(exports, "allGalleryImages", {
121
120
  enumerable: true,
122
- get: function () { return chunk6DMHVQ42_js.allGalleryImages; }
121
+ get: function () { return chunkIQLJJW2H_js.allGalleryImages; }
123
122
  });
124
123
  Object.defineProperty(exports, "assetUrl", {
125
124
  enumerable: true,
126
- get: function () { return chunk6DMHVQ42_js.assetUrl; }
125
+ get: function () { return chunkIQLJJW2H_js.assetUrl; }
127
126
  });
128
127
  Object.defineProperty(exports, "getVariantDisplayName", {
129
128
  enumerable: true,
130
- get: function () { return chunk6DMHVQ42_js.getVariantDisplayName; }
129
+ get: function () { return chunkIQLJJW2H_js.getVariantDisplayName; }
131
130
  });
132
131
  Object.defineProperty(exports, "isCimplifyAsset", {
133
132
  enumerable: true,
134
- get: function () { return chunk6DMHVQ42_js.isCimplifyAsset; }
133
+ get: function () { return chunkIQLJJW2H_js.isCimplifyAsset; }
135
134
  });
136
135
  Object.defineProperty(exports, "resolveGallery", {
137
136
  enumerable: true,
138
- get: function () { return chunk6DMHVQ42_js.resolveGallery; }
139
- });
140
- Object.defineProperty(exports, "startSignIn", {
141
- enumerable: true,
142
- get: function () { return chunk6DMHVQ42_js.startSignIn; }
137
+ get: function () { return chunkIQLJJW2H_js.resolveGallery; }
143
138
  });
144
139
  Object.defineProperty(exports, "isValidPhoneForContext", {
145
140
  enumerable: true,
@@ -155,239 +150,243 @@ Object.defineProperty(exports, "resolvePhoneCountryCode", {
155
150
  });
156
151
  Object.defineProperty(exports, "ActivityService", {
157
152
  enumerable: true,
158
- get: function () { return chunkVAMZPBA4_js.ActivityService; }
153
+ get: function () { return chunkSSLFZPAI_js.ActivityService; }
159
154
  });
160
155
  Object.defineProperty(exports, "CimplifyClient", {
161
156
  enumerable: true,
162
- get: function () { return chunkVAMZPBA4_js.CimplifyClient; }
157
+ get: function () { return chunkSSLFZPAI_js.CimplifyClient; }
163
158
  });
164
159
  Object.defineProperty(exports, "DeliveryService", {
165
160
  enumerable: true,
166
- get: function () { return chunkVAMZPBA4_js.DeliveryService; }
161
+ get: function () { return chunkSSLFZPAI_js.DeliveryService; }
167
162
  });
168
163
  Object.defineProperty(exports, "PlacesService", {
169
164
  enumerable: true,
170
- get: function () { return chunkVAMZPBA4_js.PlacesService; }
165
+ get: function () { return chunkSSLFZPAI_js.PlacesService; }
171
166
  });
172
167
  Object.defineProperty(exports, "SubscriptionService", {
173
168
  enumerable: true,
174
- get: function () { return chunkVAMZPBA4_js.SubscriptionService; }
169
+ get: function () { return chunkSSLFZPAI_js.SubscriptionService; }
175
170
  });
176
171
  Object.defineProperty(exports, "SupportService", {
177
172
  enumerable: true,
178
- get: function () { return chunkVAMZPBA4_js.SupportService; }
173
+ get: function () { return chunkSSLFZPAI_js.SupportService; }
179
174
  });
180
175
  Object.defineProperty(exports, "UploadService", {
181
176
  enumerable: true,
182
- get: function () { return chunkVAMZPBA4_js.UploadService; }
177
+ get: function () { return chunkSSLFZPAI_js.UploadService; }
183
178
  });
184
179
  Object.defineProperty(exports, "createCimplifyClient", {
185
180
  enumerable: true,
186
- get: function () { return chunkVAMZPBA4_js.createCimplifyClient; }
181
+ get: function () { return chunkSSLFZPAI_js.createCimplifyClient; }
187
182
  });
188
183
  Object.defineProperty(exports, "AUTHORIZATION_TYPE", {
189
184
  enumerable: true,
190
- get: function () { return chunkAVQL3TSJ_js.AUTHORIZATION_TYPE; }
185
+ get: function () { return chunk3QSW33RG_js.AUTHORIZATION_TYPE; }
191
186
  });
192
187
  Object.defineProperty(exports, "AUTH_MUTATION", {
193
188
  enumerable: true,
194
- get: function () { return chunkAVQL3TSJ_js.AUTH_MUTATION; }
189
+ get: function () { return chunk3QSW33RG_js.AUTH_MUTATION; }
195
190
  });
196
191
  Object.defineProperty(exports, "AuthService", {
197
192
  enumerable: true,
198
- get: function () { return chunkAVQL3TSJ_js.AuthService; }
193
+ get: function () { return chunk3QSW33RG_js.AuthService; }
199
194
  });
200
195
  Object.defineProperty(exports, "BusinessService", {
201
196
  enumerable: true,
202
- get: function () { return chunkAVQL3TSJ_js.BusinessService; }
197
+ get: function () { return chunk3QSW33RG_js.BusinessService; }
203
198
  });
204
199
  Object.defineProperty(exports, "CHECKOUT_MODE", {
205
200
  enumerable: true,
206
- get: function () { return chunkAVQL3TSJ_js.CHECKOUT_MODE; }
201
+ get: function () { return chunk3QSW33RG_js.CHECKOUT_MODE; }
207
202
  });
208
203
  Object.defineProperty(exports, "CHECKOUT_MUTATION", {
209
204
  enumerable: true,
210
- get: function () { return chunkAVQL3TSJ_js.CHECKOUT_MUTATION; }
205
+ get: function () { return chunk3QSW33RG_js.CHECKOUT_MUTATION; }
211
206
  });
212
207
  Object.defineProperty(exports, "CHECKOUT_STEP", {
213
208
  enumerable: true,
214
- get: function () { return chunkAVQL3TSJ_js.CHECKOUT_STEP; }
209
+ get: function () { return chunk3QSW33RG_js.CHECKOUT_STEP; }
215
210
  });
216
211
  Object.defineProperty(exports, "CONTACT_TYPE", {
217
212
  enumerable: true,
218
- get: function () { return chunkAVQL3TSJ_js.CONTACT_TYPE; }
213
+ get: function () { return chunk3QSW33RG_js.CONTACT_TYPE; }
219
214
  });
220
215
  Object.defineProperty(exports, "CartOperations", {
221
216
  enumerable: true,
222
- get: function () { return chunkAVQL3TSJ_js.CartOperations; }
217
+ get: function () { return chunk3QSW33RG_js.CartOperations; }
223
218
  });
224
219
  Object.defineProperty(exports, "CatalogueQueries", {
225
220
  enumerable: true,
226
- get: function () { return chunkAVQL3TSJ_js.CatalogueQueries; }
221
+ get: function () { return chunk3QSW33RG_js.CatalogueQueries; }
227
222
  });
228
223
  Object.defineProperty(exports, "CheckoutOperations", {
229
224
  enumerable: true,
230
- get: function () { return chunkAVQL3TSJ_js.CheckoutService; }
225
+ get: function () { return chunk3QSW33RG_js.CheckoutService; }
231
226
  });
232
227
  Object.defineProperty(exports, "CheckoutService", {
233
228
  enumerable: true,
234
- get: function () { return chunkAVQL3TSJ_js.CheckoutService; }
229
+ get: function () { return chunk3QSW33RG_js.CheckoutService; }
235
230
  });
236
231
  Object.defineProperty(exports, "CimplifyElement", {
237
232
  enumerable: true,
238
- get: function () { return chunkAVQL3TSJ_js.CimplifyElement; }
233
+ get: function () { return chunk3QSW33RG_js.CimplifyElement; }
239
234
  });
240
235
  Object.defineProperty(exports, "CimplifyElements", {
241
236
  enumerable: true,
242
- get: function () { return chunkAVQL3TSJ_js.CimplifyElements; }
237
+ get: function () { return chunk3QSW33RG_js.CimplifyElements; }
243
238
  });
244
239
  Object.defineProperty(exports, "DEFAULT_COUNTRY", {
245
240
  enumerable: true,
246
- get: function () { return chunkAVQL3TSJ_js.DEFAULT_COUNTRY; }
241
+ get: function () { return chunk3QSW33RG_js.DEFAULT_COUNTRY; }
247
242
  });
248
243
  Object.defineProperty(exports, "DEFAULT_CURRENCY", {
249
244
  enumerable: true,
250
- get: function () { return chunkAVQL3TSJ_js.DEFAULT_CURRENCY; }
245
+ get: function () { return chunk3QSW33RG_js.DEFAULT_CURRENCY; }
251
246
  });
252
247
  Object.defineProperty(exports, "DEVICE_TYPE", {
253
248
  enumerable: true,
254
- get: function () { return chunkAVQL3TSJ_js.DEVICE_TYPE; }
249
+ get: function () { return chunk3QSW33RG_js.DEVICE_TYPE; }
255
250
  });
256
251
  Object.defineProperty(exports, "ELEMENT_TYPES", {
257
252
  enumerable: true,
258
- get: function () { return chunkAVQL3TSJ_js.ELEMENT_TYPES; }
253
+ get: function () { return chunk3QSW33RG_js.ELEMENT_TYPES; }
259
254
  });
260
255
  Object.defineProperty(exports, "EVENT_TYPES", {
261
256
  enumerable: true,
262
- get: function () { return chunkAVQL3TSJ_js.EVENT_TYPES; }
257
+ get: function () { return chunk3QSW33RG_js.EVENT_TYPES; }
263
258
  });
264
259
  Object.defineProperty(exports, "FxService", {
265
260
  enumerable: true,
266
- get: function () { return chunkAVQL3TSJ_js.FxService; }
261
+ get: function () { return chunk3QSW33RG_js.FxService; }
267
262
  });
268
263
  Object.defineProperty(exports, "InventoryService", {
269
264
  enumerable: true,
270
- get: function () { return chunkAVQL3TSJ_js.InventoryService; }
265
+ get: function () { return chunk3QSW33RG_js.InventoryService; }
271
266
  });
272
267
  Object.defineProperty(exports, "LINK_MUTATION", {
273
268
  enumerable: true,
274
- get: function () { return chunkAVQL3TSJ_js.LINK_MUTATION; }
269
+ get: function () { return chunk3QSW33RG_js.LINK_MUTATION; }
275
270
  });
276
271
  Object.defineProperty(exports, "LINK_QUERY", {
277
272
  enumerable: true,
278
- get: function () { return chunkAVQL3TSJ_js.LINK_QUERY; }
273
+ get: function () { return chunk3QSW33RG_js.LINK_QUERY; }
279
274
  });
280
275
  Object.defineProperty(exports, "LinkService", {
281
276
  enumerable: true,
282
- get: function () { return chunkAVQL3TSJ_js.LinkService; }
277
+ get: function () { return chunk3QSW33RG_js.LinkService; }
283
278
  });
284
279
  Object.defineProperty(exports, "LiteService", {
285
280
  enumerable: true,
286
- get: function () { return chunkAVQL3TSJ_js.LiteService; }
281
+ get: function () { return chunk3QSW33RG_js.LiteService; }
287
282
  });
288
283
  Object.defineProperty(exports, "MESSAGE_TYPES", {
289
284
  enumerable: true,
290
- get: function () { return chunkAVQL3TSJ_js.MESSAGE_TYPES; }
285
+ get: function () { return chunk3QSW33RG_js.MESSAGE_TYPES; }
291
286
  });
292
287
  Object.defineProperty(exports, "MOBILE_MONEY_PROVIDER", {
293
288
  enumerable: true,
294
- get: function () { return chunkAVQL3TSJ_js.MOBILE_MONEY_PROVIDER; }
289
+ get: function () { return chunk3QSW33RG_js.MOBILE_MONEY_PROVIDER; }
295
290
  });
296
291
  Object.defineProperty(exports, "ORDER_MUTATION", {
297
292
  enumerable: true,
298
- get: function () { return chunkAVQL3TSJ_js.ORDER_MUTATION; }
293
+ get: function () { return chunk3QSW33RG_js.ORDER_MUTATION; }
299
294
  });
300
295
  Object.defineProperty(exports, "ORDER_TYPE", {
301
296
  enumerable: true,
302
- get: function () { return chunkAVQL3TSJ_js.ORDER_TYPE; }
297
+ get: function () { return chunk3QSW33RG_js.ORDER_TYPE; }
303
298
  });
304
299
  Object.defineProperty(exports, "OrderQueries", {
305
300
  enumerable: true,
306
- get: function () { return chunkAVQL3TSJ_js.OrderQueries; }
301
+ get: function () { return chunk3QSW33RG_js.OrderQueries; }
307
302
  });
308
303
  Object.defineProperty(exports, "PAYMENT_METHOD", {
309
304
  enumerable: true,
310
- get: function () { return chunkAVQL3TSJ_js.PAYMENT_METHOD; }
305
+ get: function () { return chunk3QSW33RG_js.PAYMENT_METHOD; }
311
306
  });
312
307
  Object.defineProperty(exports, "PAYMENT_MUTATION", {
313
308
  enumerable: true,
314
- get: function () { return chunkAVQL3TSJ_js.PAYMENT_MUTATION; }
309
+ get: function () { return chunk3QSW33RG_js.PAYMENT_MUTATION; }
315
310
  });
316
311
  Object.defineProperty(exports, "PAYMENT_STATE", {
317
312
  enumerable: true,
318
- get: function () { return chunkAVQL3TSJ_js.PAYMENT_STATE; }
313
+ get: function () { return chunk3QSW33RG_js.PAYMENT_STATE; }
319
314
  });
320
315
  Object.defineProperty(exports, "PICKUP_TIME_TYPE", {
321
316
  enumerable: true,
322
- get: function () { return chunkAVQL3TSJ_js.PICKUP_TIME_TYPE; }
317
+ get: function () { return chunk3QSW33RG_js.PICKUP_TIME_TYPE; }
323
318
  });
324
319
  Object.defineProperty(exports, "SchedulingService", {
325
320
  enumerable: true,
326
- get: function () { return chunkAVQL3TSJ_js.SchedulingService; }
321
+ get: function () { return chunk3QSW33RG_js.SchedulingService; }
327
322
  });
328
323
  Object.defineProperty(exports, "combine", {
329
324
  enumerable: true,
330
- get: function () { return chunkAVQL3TSJ_js.combine; }
325
+ get: function () { return chunk3QSW33RG_js.combine; }
331
326
  });
332
327
  Object.defineProperty(exports, "combineObject", {
333
328
  enumerable: true,
334
- get: function () { return chunkAVQL3TSJ_js.combineObject; }
329
+ get: function () { return chunk3QSW33RG_js.combineObject; }
335
330
  });
336
331
  Object.defineProperty(exports, "createElements", {
337
332
  enumerable: true,
338
- get: function () { return chunkAVQL3TSJ_js.createElements; }
333
+ get: function () { return chunk3QSW33RG_js.createElements; }
339
334
  });
340
335
  Object.defineProperty(exports, "err", {
341
336
  enumerable: true,
342
- get: function () { return chunkAVQL3TSJ_js.err; }
337
+ get: function () { return chunk3QSW33RG_js.err; }
343
338
  });
344
339
  Object.defineProperty(exports, "flatMap", {
345
340
  enumerable: true,
346
- get: function () { return chunkAVQL3TSJ_js.flatMap; }
341
+ get: function () { return chunk3QSW33RG_js.flatMap; }
347
342
  });
348
343
  Object.defineProperty(exports, "fromPromise", {
349
344
  enumerable: true,
350
- get: function () { return chunkAVQL3TSJ_js.fromPromise; }
345
+ get: function () { return chunk3QSW33RG_js.fromPromise; }
351
346
  });
352
347
  Object.defineProperty(exports, "generateIdempotencyKey", {
353
348
  enumerable: true,
354
- get: function () { return chunkAVQL3TSJ_js.generateIdempotencyKey; }
349
+ get: function () { return chunk3QSW33RG_js.generateIdempotencyKey; }
355
350
  });
356
351
  Object.defineProperty(exports, "getOrElse", {
357
352
  enumerable: true,
358
- get: function () { return chunkAVQL3TSJ_js.getOrElse; }
353
+ get: function () { return chunk3QSW33RG_js.getOrElse; }
359
354
  });
360
355
  Object.defineProperty(exports, "isErr", {
361
356
  enumerable: true,
362
- get: function () { return chunkAVQL3TSJ_js.isErr; }
357
+ get: function () { return chunk3QSW33RG_js.isErr; }
363
358
  });
364
359
  Object.defineProperty(exports, "isOk", {
365
360
  enumerable: true,
366
- get: function () { return chunkAVQL3TSJ_js.isOk; }
361
+ get: function () { return chunk3QSW33RG_js.isOk; }
367
362
  });
368
363
  Object.defineProperty(exports, "mapError", {
369
364
  enumerable: true,
370
- get: function () { return chunkAVQL3TSJ_js.mapError; }
365
+ get: function () { return chunk3QSW33RG_js.mapError; }
371
366
  });
372
367
  Object.defineProperty(exports, "mapResult", {
373
368
  enumerable: true,
374
- get: function () { return chunkAVQL3TSJ_js.mapResult; }
369
+ get: function () { return chunk3QSW33RG_js.mapResult; }
375
370
  });
376
371
  Object.defineProperty(exports, "ok", {
377
372
  enumerable: true,
378
- get: function () { return chunkAVQL3TSJ_js.ok; }
373
+ get: function () { return chunk3QSW33RG_js.ok; }
374
+ });
375
+ Object.defineProperty(exports, "startSignIn", {
376
+ enumerable: true,
377
+ get: function () { return chunk3QSW33RG_js.startSignIn; }
379
378
  });
380
379
  Object.defineProperty(exports, "toNullable", {
381
380
  enumerable: true,
382
- get: function () { return chunkAVQL3TSJ_js.toNullable; }
381
+ get: function () { return chunk3QSW33RG_js.toNullable; }
383
382
  });
384
383
  Object.defineProperty(exports, "tryCatch", {
385
384
  enumerable: true,
386
- get: function () { return chunkAVQL3TSJ_js.tryCatch; }
385
+ get: function () { return chunk3QSW33RG_js.tryCatch; }
387
386
  });
388
387
  Object.defineProperty(exports, "unwrap", {
389
388
  enumerable: true,
390
- get: function () { return chunkAVQL3TSJ_js.unwrap; }
389
+ get: function () { return chunk3QSW33RG_js.unwrap; }
391
390
  });
392
391
  Object.defineProperty(exports, "CURRENCY_SYMBOLS", {
393
392
  enumerable: true,
package/dist/index.mjs CHANGED
@@ -1,9 +1,8 @@
1
- import { generatePkce, generateState } from './chunk-2AU263DK.mjs';
2
- export { CIMPLIFY_CDN_HOSTS, DEFAULT_CDN_BASE_URL, DURATION_UNIT, INPUT_FIELD_TYPE, PRODUCT_TYPE, RENDER_HINT, allGalleryImages, assetUrl, getVariantDisplayName, isCimplifyAsset, resolveGallery, startSignIn } from './chunk-2AU263DK.mjs';
1
+ export { CIMPLIFY_CDN_HOSTS, DEFAULT_CDN_BASE_URL, DURATION_UNIT, INPUT_FIELD_TYPE, PRODUCT_TYPE, RENDER_HINT, allGalleryImages, assetUrl, getVariantDisplayName, isCimplifyAsset, resolveGallery } from './chunk-E6T5VJMG.mjs';
3
2
  export { isValidPhoneForContext, normalizePhoneToE164, resolvePhoneCountryCode } from './chunk-YOIVZ6OA.mjs';
4
- import { getAuthorizationEndpoint, DEFAULT_ISSUER } from './chunk-XSOYJLMZ.mjs';
5
- export { ActivityService, CimplifyClient, DeliveryService, PlacesService, SubscriptionService, SupportService, UploadService, createCimplifyClient } from './chunk-PKYZBKZD.mjs';
6
- export { AUTHORIZATION_TYPE, AUTH_MUTATION, AuthService, BusinessService, CHECKOUT_MODE, CHECKOUT_MUTATION, CHECKOUT_STEP, CONTACT_TYPE, CartOperations, CatalogueQueries, CheckoutService as CheckoutOperations, CheckoutService, CimplifyElement, CimplifyElements, DEFAULT_COUNTRY, DEFAULT_CURRENCY, DEVICE_TYPE, ELEMENT_TYPES, EVENT_TYPES, FxService, InventoryService, LINK_MUTATION, LINK_QUERY, LinkService, LiteService, MESSAGE_TYPES, MOBILE_MONEY_PROVIDER, ORDER_MUTATION, ORDER_TYPE, OrderQueries, PAYMENT_METHOD, PAYMENT_MUTATION, PAYMENT_STATE, PICKUP_TIME_TYPE, SchedulingService, combine, combineObject, createElements, err, flatMap, fromPromise, generateIdempotencyKey, getOrElse, isErr, isOk, mapError, mapResult, ok, toNullable, tryCatch, unwrap } from './chunk-R6363CC7.mjs';
3
+ export { ActivityService, CimplifyClient, DeliveryService, PlacesService, SubscriptionService, SupportService, UploadService, createCimplifyClient } from './chunk-JAPCAZN4.mjs';
4
+ import { getAuthorizationEndpoint, DEFAULT_ISSUER, generatePkce, generateState } from './chunk-QQMDEGAK.mjs';
5
+ export { AUTHORIZATION_TYPE, AUTH_MUTATION, AuthService, BusinessService, CHECKOUT_MODE, CHECKOUT_MUTATION, CHECKOUT_STEP, CONTACT_TYPE, CartOperations, CatalogueQueries, CheckoutService as CheckoutOperations, CheckoutService, CimplifyElement, CimplifyElements, DEFAULT_COUNTRY, DEFAULT_CURRENCY, DEVICE_TYPE, ELEMENT_TYPES, EVENT_TYPES, FxService, InventoryService, LINK_MUTATION, LINK_QUERY, LinkService, LiteService, MESSAGE_TYPES, MOBILE_MONEY_PROVIDER, ORDER_MUTATION, ORDER_TYPE, OrderQueries, PAYMENT_METHOD, PAYMENT_MUTATION, PAYMENT_STATE, PICKUP_TIME_TYPE, SchedulingService, combine, combineObject, createElements, err, flatMap, fromPromise, generateIdempotencyKey, getOrElse, isErr, isOk, mapError, mapResult, ok, startSignIn, toNullable, tryCatch, unwrap } from './chunk-QQMDEGAK.mjs';
7
6
  export { CURRENCY_SYMBOLS, MOBILE_MONEY_PROVIDERS, categorizePaymentError, detectMobileMoneyProvider, formatMoney, formatNumberCompact, formatPrice, formatPriceAdjustment, formatPriceCompact, formatPriceRange, formatPriceWithTax, formatProductPrice, getBasePrice, getCurrencySymbol, getDiscountPercentage, getDisplayPrice, getMarkupPercentage, getPriceRange, getProductCurrency, getTaxAmount, getUnitPriceAtQuantity, hasTaxInfo, isOnSale, isPaymentStatusFailure, isPaymentStatusRequiresAction, isPaymentStatusSuccess, isTaxInclusive, normalizePaymentResponse, normalizeStatusResponse, parsePrice } from './chunk-TD3AY34U.mjs';
8
7
  export { CimplifyError, ERROR_HINTS, ErrorCode, IdempotencyMismatchError, ZERO, currencyCode, enrichError, getErrorHint, isCimplifyError, isIdempotencyMismatchError, isQuoteConflictRequiringConsent, isQuoteError, isRetryableError, isSupportedCurrency, money, moneyFromNumber } from './chunk-AMZXALF6.mjs';
9
8
  import './chunk-3G6RQLXK.mjs';
package/dist/mock/cli.mjs CHANGED
@@ -3350,10 +3350,10 @@ var ELEMENT_HANDLER_JS = `/* eslint-disable */
3350
3350
  REFRESH_TOKEN: "refresh_token", LOGOUT: "logout",
3351
3351
  PROCESS_CHECKOUT: "process_checkout", ABORT_CHECKOUT: "abort_checkout",
3352
3352
  READY: "ready", HEIGHT_CHANGE: "height_change",
3353
- AUTHENTICATED: "authenticated", REQUIRES_OTP: "requires_otp", ERROR: "error",
3353
+ AUTH_REQUESTED: "auth_requested", ERROR: "error",
3354
3354
  ADDRESS_CHANGED: "address_changed", ADDRESS_SELECTED: "address_selected",
3355
3355
  PAYMENT_METHOD_SELECTED: "payment_method_selected",
3356
- TOKEN_REFRESHED: "token_refreshed", LOGOUT_COMPLETE: "logout_complete",
3356
+ LOGOUT_COMPLETE: "logout_complete",
3357
3357
  CONTACT_PROVIDED: "contact_provided",
3358
3358
  CHECKOUT_STATUS: "checkout_status", CHECKOUT_COMPLETE: "checkout_complete",
3359
3359
  ORDER_TYPE_CHANGED: "order_type_changed", REQUEST_SUBMIT: "request_submit"
@@ -3362,6 +3362,7 @@ var ELEMENT_HANDLER_JS = `/* eslint-disable */
3362
3362
  var AUTO = qs.get("auto") === "true";
3363
3363
  var DEMO_OTP = qs.get("otp") || "123456";
3364
3364
  var ORIGIN = qs.get("origin") || "*";
3365
+ var NONCE = qs.get("nonce");
3365
3366
  var state = {
3366
3367
  businessId: DEFAULT_BUSINESS,
3367
3368
  token: null,
@@ -3376,7 +3377,10 @@ var ELEMENT_HANDLER_JS = `/* eslint-disable */
3376
3377
  var content = document.getElementById("content");
3377
3378
  var title = document.getElementById("title");
3378
3379
 
3379
- function send(msg) { parent.postMessage(msg, ORIGIN); }
3380
+ function send(msg) {
3381
+ if (NONCE) msg.nonce = NONCE;
3382
+ parent.postMessage(msg, ORIGIN);
3383
+ }
3380
3384
  function reportHeight() { send({ type: MSG.HEIGHT_CHANGE, height: document.documentElement.scrollHeight }); }
3381
3385
  function ready() { send({ type: MSG.READY, height: document.documentElement.scrollHeight }); }
3382
3386
 
@@ -3396,54 +3400,13 @@ var ELEMENT_HANDLER_JS = `/* eslint-disable */
3396
3400
  function renderAuth() {
3397
3401
  title.textContent = "Sign in";
3398
3402
  content.innerHTML =
3399
- '<label>Email or phone</label>' +
3400
- '<input id="contact" placeholder="you@example.com or +233..." value="' + (qs.get("contact") || "") + '">' +
3401
- '<button id="send-otp">Send code</button>' +
3402
- '<div id="otp-box" style="display:none">' +
3403
- ' <label>Verification code (mock: ' + DEMO_OTP + ')</label>' +
3404
- ' <input id="otp" maxlength="6" value="' + DEMO_OTP + '">' +
3405
- ' <button id="verify-otp">Verify</button>' +
3406
- '</div>' +
3403
+ '<button id="start-auth">Continue with Cimplify</button>' +
3407
3404
  '<div class="err" id="err"></div>';
3408
- document.getElementById("send-otp").onclick = function () {
3409
- var contact = document.getElementById("contact").value.trim();
3410
- if (!contact) { document.getElementById("err").textContent = "Enter contact"; return; }
3411
- state.contact = contact;
3412
- var contactType = contact.indexOf("@") >= 0 ? "email" : "phone";
3413
- send({ type: MSG.CONTACT_PROVIDED, contact: contact, contactType: contactType });
3414
- send({ type: MSG.REQUIRES_OTP, contactMasked: contact.slice(0, 3) + "***" });
3415
- document.getElementById("otp-box").style.display = "block";
3416
- reportHeight();
3417
- };
3418
- document.getElementById("verify-otp").onclick = function () {
3419
- var code = document.getElementById("otp").value.trim();
3420
- if (code !== DEMO_OTP) { document.getElementById("err").textContent = "Invalid code"; return; }
3421
- fetch("/api/v1/auth/verify-otp", {
3422
- method: "POST",
3423
- headers: { "content-type": "application/json" },
3424
- body: JSON.stringify({ contact: state.contact, code: code })
3425
- }).then(function (r) { return r.json(); }).then(function (body) {
3426
- var session = body.session || {};
3427
- state.token = session.token || body.token;
3428
- state.customer = {
3429
- name: session.customer_name || "Customer",
3430
- email: session.customer_email || (state.contact && state.contact.indexOf("@") >= 0 ? state.contact : null),
3431
- phone: session.customer_phone || (state.contact && state.contact.indexOf("@") < 0 ? state.contact : null)
3432
- };
3433
- send({
3434
- type: MSG.AUTHENTICATED,
3435
- accountId: "acct_mock_" + (session.id || "x"),
3436
- customerId: session.customer_id || "cust_mock",
3437
- token: state.token,
3438
- customer: state.customer
3439
- });
3440
- }).catch(function (e) {
3441
- send({ type: MSG.ERROR, code: "AUTH_FAILED", message: String(e) });
3442
- });
3405
+ document.getElementById("start-auth").onclick = function () {
3406
+ send({ type: MSG.AUTH_REQUESTED });
3443
3407
  };
3444
3408
  if (AUTO) {
3445
- setTimeout(function () { document.getElementById("send-otp").click(); }, 50);
3446
- setTimeout(function () { document.getElementById("verify-otp").click(); }, 150);
3409
+ setTimeout(function () { document.getElementById("start-auth").click(); }, 50);
3447
3410
  }
3448
3411
  }
3449
3412
 
@@ -3620,7 +3583,6 @@ var ELEMENT_HANDLER_JS = `/* eslint-disable */
3620
3583
  break;
3621
3584
  case MSG.SET_TOKEN:
3622
3585
  state.token = msg.token;
3623
- send({ type: MSG.TOKEN_REFRESHED, token: state.token });
3624
3586
  break;
3625
3587
  case MSG.SET_CART:
3626
3588
  state.cart = msg.cart;
@@ -3632,7 +3594,7 @@ var ELEMENT_HANDLER_JS = `/* eslint-disable */
3632
3594
  send({ type: MSG.HEIGHT_CHANGE, height: document.documentElement.scrollHeight });
3633
3595
  break;
3634
3596
  case MSG.REFRESH_TOKEN:
3635
- send({ type: MSG.TOKEN_REFRESHED, token: state.token || "tok_mock_refreshed" });
3597
+ reportHeight();
3636
3598
  break;
3637
3599
  case MSG.LOGOUT:
3638
3600
  state.token = null;
@@ -2718,10 +2718,10 @@ var ELEMENT_HANDLER_JS = `/* eslint-disable */
2718
2718
  REFRESH_TOKEN: "refresh_token", LOGOUT: "logout",
2719
2719
  PROCESS_CHECKOUT: "process_checkout", ABORT_CHECKOUT: "abort_checkout",
2720
2720
  READY: "ready", HEIGHT_CHANGE: "height_change",
2721
- AUTHENTICATED: "authenticated", REQUIRES_OTP: "requires_otp", ERROR: "error",
2721
+ AUTH_REQUESTED: "auth_requested", ERROR: "error",
2722
2722
  ADDRESS_CHANGED: "address_changed", ADDRESS_SELECTED: "address_selected",
2723
2723
  PAYMENT_METHOD_SELECTED: "payment_method_selected",
2724
- TOKEN_REFRESHED: "token_refreshed", LOGOUT_COMPLETE: "logout_complete",
2724
+ LOGOUT_COMPLETE: "logout_complete",
2725
2725
  CONTACT_PROVIDED: "contact_provided",
2726
2726
  CHECKOUT_STATUS: "checkout_status", CHECKOUT_COMPLETE: "checkout_complete",
2727
2727
  ORDER_TYPE_CHANGED: "order_type_changed", REQUEST_SUBMIT: "request_submit"
@@ -2730,6 +2730,7 @@ var ELEMENT_HANDLER_JS = `/* eslint-disable */
2730
2730
  var AUTO = qs.get("auto") === "true";
2731
2731
  var DEMO_OTP = qs.get("otp") || "123456";
2732
2732
  var ORIGIN = qs.get("origin") || "*";
2733
+ var NONCE = qs.get("nonce");
2733
2734
  var state = {
2734
2735
  businessId: DEFAULT_BUSINESS,
2735
2736
  token: null,
@@ -2744,7 +2745,10 @@ var ELEMENT_HANDLER_JS = `/* eslint-disable */
2744
2745
  var content = document.getElementById("content");
2745
2746
  var title = document.getElementById("title");
2746
2747
 
2747
- function send(msg) { parent.postMessage(msg, ORIGIN); }
2748
+ function send(msg) {
2749
+ if (NONCE) msg.nonce = NONCE;
2750
+ parent.postMessage(msg, ORIGIN);
2751
+ }
2748
2752
  function reportHeight() { send({ type: MSG.HEIGHT_CHANGE, height: document.documentElement.scrollHeight }); }
2749
2753
  function ready() { send({ type: MSG.READY, height: document.documentElement.scrollHeight }); }
2750
2754
 
@@ -2764,54 +2768,13 @@ var ELEMENT_HANDLER_JS = `/* eslint-disable */
2764
2768
  function renderAuth() {
2765
2769
  title.textContent = "Sign in";
2766
2770
  content.innerHTML =
2767
- '<label>Email or phone</label>' +
2768
- '<input id="contact" placeholder="you@example.com or +233..." value="' + (qs.get("contact") || "") + '">' +
2769
- '<button id="send-otp">Send code</button>' +
2770
- '<div id="otp-box" style="display:none">' +
2771
- ' <label>Verification code (mock: ' + DEMO_OTP + ')</label>' +
2772
- ' <input id="otp" maxlength="6" value="' + DEMO_OTP + '">' +
2773
- ' <button id="verify-otp">Verify</button>' +
2774
- '</div>' +
2771
+ '<button id="start-auth">Continue with Cimplify</button>' +
2775
2772
  '<div class="err" id="err"></div>';
2776
- document.getElementById("send-otp").onclick = function () {
2777
- var contact = document.getElementById("contact").value.trim();
2778
- if (!contact) { document.getElementById("err").textContent = "Enter contact"; return; }
2779
- state.contact = contact;
2780
- var contactType = contact.indexOf("@") >= 0 ? "email" : "phone";
2781
- send({ type: MSG.CONTACT_PROVIDED, contact: contact, contactType: contactType });
2782
- send({ type: MSG.REQUIRES_OTP, contactMasked: contact.slice(0, 3) + "***" });
2783
- document.getElementById("otp-box").style.display = "block";
2784
- reportHeight();
2785
- };
2786
- document.getElementById("verify-otp").onclick = function () {
2787
- var code = document.getElementById("otp").value.trim();
2788
- if (code !== DEMO_OTP) { document.getElementById("err").textContent = "Invalid code"; return; }
2789
- fetch("/api/v1/auth/verify-otp", {
2790
- method: "POST",
2791
- headers: { "content-type": "application/json" },
2792
- body: JSON.stringify({ contact: state.contact, code: code })
2793
- }).then(function (r) { return r.json(); }).then(function (body) {
2794
- var session = body.session || {};
2795
- state.token = session.token || body.token;
2796
- state.customer = {
2797
- name: session.customer_name || "Customer",
2798
- email: session.customer_email || (state.contact && state.contact.indexOf("@") >= 0 ? state.contact : null),
2799
- phone: session.customer_phone || (state.contact && state.contact.indexOf("@") < 0 ? state.contact : null)
2800
- };
2801
- send({
2802
- type: MSG.AUTHENTICATED,
2803
- accountId: "acct_mock_" + (session.id || "x"),
2804
- customerId: session.customer_id || "cust_mock",
2805
- token: state.token,
2806
- customer: state.customer
2807
- });
2808
- }).catch(function (e) {
2809
- send({ type: MSG.ERROR, code: "AUTH_FAILED", message: String(e) });
2810
- });
2773
+ document.getElementById("start-auth").onclick = function () {
2774
+ send({ type: MSG.AUTH_REQUESTED });
2811
2775
  };
2812
2776
  if (AUTO) {
2813
- setTimeout(function () { document.getElementById("send-otp").click(); }, 50);
2814
- setTimeout(function () { document.getElementById("verify-otp").click(); }, 150);
2777
+ setTimeout(function () { document.getElementById("start-auth").click(); }, 50);
2815
2778
  }
2816
2779
  }
2817
2780
 
@@ -2988,7 +2951,6 @@ var ELEMENT_HANDLER_JS = `/* eslint-disable */
2988
2951
  break;
2989
2952
  case MSG.SET_TOKEN:
2990
2953
  state.token = msg.token;
2991
- send({ type: MSG.TOKEN_REFRESHED, token: state.token });
2992
2954
  break;
2993
2955
  case MSG.SET_CART:
2994
2956
  state.cart = msg.cart;
@@ -3000,7 +2962,7 @@ var ELEMENT_HANDLER_JS = `/* eslint-disable */
3000
2962
  send({ type: MSG.HEIGHT_CHANGE, height: document.documentElement.scrollHeight });
3001
2963
  break;
3002
2964
  case MSG.REFRESH_TOKEN:
3003
- send({ type: MSG.TOKEN_REFRESHED, token: state.token || "tok_mock_refreshed" });
2965
+ reportHeight();
3004
2966
  break;
3005
2967
  case MSG.LOGOUT:
3006
2968
  state.token = null;