@cimplify/sdk 0.85.0 → 0.86.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 (69) hide show
  1. package/dist/advanced.d.mts +3 -3
  2. package/dist/advanced.d.ts +3 -3
  3. package/dist/advanced.js +22 -22
  4. package/dist/advanced.mjs +3 -3
  5. package/dist/{chunk-DU4IX2I2.mjs → chunk-A2GXDCSI.mjs} +2 -2
  6. package/dist/{chunk-XA3ZNR75.js → chunk-AETVRBKI.js} +1 -1
  7. package/dist/{chunk-GIFVSWYJ.mjs → chunk-D6JWYYTG.mjs} +2 -2
  8. package/dist/{chunk-A6J7W6DH.js → chunk-ESGKWRQS.js} +4 -4
  9. package/dist/{chunk-GFM5JW45.js → chunk-HJEKXCG2.js} +62 -62
  10. package/dist/{chunk-AMZXALF6.mjs → chunk-K5EN2W2Q.mjs} +1 -1
  11. package/dist/{chunk-TD3AY34U.mjs → chunk-KFLGQGMC.mjs} +3 -3
  12. package/dist/{chunk-NWUEWUX2.mjs → chunk-MRL53WP6.mjs} +2 -2
  13. package/dist/{chunk-7BM56JET.mjs → chunk-NN3WC7XZ.mjs} +3 -3
  14. package/dist/{chunk-7Y2O3E4D.js → chunk-PTPOQVXS.js} +5 -5
  15. package/dist/{chunk-HPN5R3K2.js → chunk-VUG4HTUM.js} +23 -23
  16. package/dist/{chunk-NWTCBGJ2.js → chunk-X4UNISYG.js} +4 -4
  17. package/dist/{client-WKKxIiF1.d.ts → client-BQSRj4iK.d.mts} +528 -539
  18. package/dist/{client-DLtwQ-jI.d.mts → client-BdI24jUT.d.ts} +528 -539
  19. package/dist/{client-BT5gaiGR.d.ts → client-CMJO_8zo.d.ts} +2 -2
  20. package/dist/{client-BEhIE0Dm.d.mts → client-DowGNrTh.d.mts} +2 -2
  21. package/dist/{index-BrC1x2kK.d.ts → index-BRwHpMY-.d.ts} +3 -3
  22. package/dist/{index-DZz6hdrT.d.mts → index-DLb_Ldl6.d.mts} +3 -3
  23. package/dist/index.d.mts +6 -6
  24. package/dist/index.d.ts +6 -6
  25. package/dist/index.js +117 -117
  26. package/dist/index.mjs +5 -5
  27. package/dist/mock/cli.mjs +2 -2
  28. package/dist/mock/library.js +2 -2
  29. package/dist/mock/library.mjs +2 -2
  30. package/dist/mock/msw.js +2 -2
  31. package/dist/mock/msw.mjs +2 -2
  32. package/dist/{payment-D1f3ZQPC.d.ts → payment-BA7KNBxg.d.ts} +3 -3
  33. package/dist/{payment-Dh-6cRcV.d.mts → payment-CFev-fOE.d.mts} +3 -3
  34. package/dist/{price-CQdOJoX-.d.ts → price-BNhGVB5q.d.ts} +1 -1
  35. package/dist/{price-4T7dlhxM.d.mts → price-nRxqVNGq.d.mts} +1 -1
  36. package/dist/product-BGxIfTqJ.d.mts +5400 -0
  37. package/dist/product-BGxIfTqJ.d.ts +5400 -0
  38. package/dist/react.d.mts +6 -6
  39. package/dist/react.d.ts +6 -6
  40. package/dist/react.js +139 -139
  41. package/dist/react.mjs +19 -19
  42. package/dist/{server-DjK98UW-.d.mts → server-9u0LiG5U.d.mts} +1 -1
  43. package/dist/{server-DvThXldo.d.ts → server-BH7DTaaz.d.ts} +1 -1
  44. package/dist/server.d.mts +4 -4
  45. package/dist/server.d.ts +4 -4
  46. package/dist/server.js +10 -10
  47. package/dist/server.mjs +4 -4
  48. package/dist/testing/msw.d.mts +2 -2
  49. package/dist/testing/msw.d.ts +2 -2
  50. package/dist/testing/msw.js +3 -3
  51. package/dist/testing/msw.mjs +2 -2
  52. package/dist/testing/suite.d.mts +6 -6
  53. package/dist/testing/suite.d.ts +6 -6
  54. package/dist/testing/suite.js +25 -25
  55. package/dist/testing/suite.mjs +6 -6
  56. package/dist/testing.d.mts +5 -5
  57. package/dist/testing.d.ts +5 -5
  58. package/dist/testing.js +81 -81
  59. package/dist/testing.mjs +7 -7
  60. package/dist/utils.d.mts +4 -4
  61. package/dist/utils.d.ts +4 -4
  62. package/dist/utils.js +29 -29
  63. package/dist/utils.mjs +2 -2
  64. package/package.json +5 -2
  65. package/registry/currency-selector.json +1 -1
  66. package/registry/digital-product-card.json +1 -1
  67. package/registry/digital-product-layout.json +1 -1
  68. package/dist/product-RJMIdCAf.d.mts +0 -1582
  69. package/dist/product-RJMIdCAf.d.ts +0 -1582
package/dist/testing.js CHANGED
@@ -1,29 +1,29 @@
1
1
  'use strict';
2
2
 
3
- var chunkA6J7W6DH_js = require('./chunk-A6J7W6DH.js');
4
- require('./chunk-NWTCBGJ2.js');
5
- require('./chunk-GFM5JW45.js');
6
- require('./chunk-HPN5R3K2.js');
7
- require('./chunk-7Y2O3E4D.js');
8
- require('./chunk-XA3ZNR75.js');
3
+ var chunkESGKWRQS_js = require('./chunk-ESGKWRQS.js');
4
+ require('./chunk-X4UNISYG.js');
5
+ require('./chunk-HJEKXCG2.js');
6
+ require('./chunk-VUG4HTUM.js');
7
+ require('./chunk-PTPOQVXS.js');
8
+ require('./chunk-AETVRBKI.js');
9
9
  require('./chunk-OWW5GUSB.js');
10
10
  var zod = require('zod');
11
11
 
12
12
  var PUBLIC_SCHEMAS = {
13
- Brand: chunkA6J7W6DH_js.BrandSchema,
14
- AddItemPayload: chunkA6J7W6DH_js.AddItemPayloadSchema,
15
- Cart: chunkA6J7W6DH_js.CartSchema,
16
- CartItem: chunkA6J7W6DH_js.CartItemSchema,
17
- CartPricing: chunkA6J7W6DH_js.CartPricingSchema,
18
- CheckoutBody: chunkA6J7W6DH_js.CheckoutBodySchema,
19
- CheckoutResponse: chunkA6J7W6DH_js.CheckoutResponseSchema,
20
- VariantInfo: chunkA6J7W6DH_js.VariantInfoSchema
13
+ Brand: chunkESGKWRQS_js.BrandSchema,
14
+ AddItemPayload: chunkESGKWRQS_js.AddItemPayloadSchema,
15
+ Cart: chunkESGKWRQS_js.CartSchema,
16
+ CartItem: chunkESGKWRQS_js.CartItemSchema,
17
+ CartPricing: chunkESGKWRQS_js.CartPricingSchema,
18
+ CheckoutBody: chunkESGKWRQS_js.CheckoutBodySchema,
19
+ CheckoutResponse: chunkESGKWRQS_js.CheckoutResponseSchema,
20
+ VariantInfo: chunkESGKWRQS_js.VariantInfoSchema
21
21
  };
22
22
  function exportJsonSchemas() {
23
23
  const out = {};
24
24
  for (const [name, schema] of Object.entries(PUBLIC_SCHEMAS)) {
25
- const meta = chunkA6J7W6DH_js.cimplifyRegistry.get(schema);
26
- const json = zod.z.toJSONSchema(schema, { metadata: chunkA6J7W6DH_js.cimplifyRegistry });
25
+ const meta = chunkESGKWRQS_js.cimplifyRegistry.get(schema);
26
+ const json = zod.z.toJSONSchema(schema, { metadata: chunkESGKWRQS_js.cimplifyRegistry });
27
27
  if (meta) {
28
28
  json.$id = meta.id;
29
29
  json["x-cimplify-version"] = meta.version;
@@ -35,16 +35,16 @@ function exportJsonSchemas() {
35
35
  function listRegisteredSchemas() {
36
36
  const entries = [];
37
37
  for (const schema of [
38
- chunkA6J7W6DH_js.BrandSchema,
39
- chunkA6J7W6DH_js.AddItemPayloadSchema,
40
- chunkA6J7W6DH_js.CartSchema,
41
- chunkA6J7W6DH_js.CartItemSchema,
42
- chunkA6J7W6DH_js.CartPricingSchema,
43
- chunkA6J7W6DH_js.CheckoutBodySchema,
44
- chunkA6J7W6DH_js.CheckoutResponseSchema,
45
- chunkA6J7W6DH_js.VariantInfoSchema
38
+ chunkESGKWRQS_js.BrandSchema,
39
+ chunkESGKWRQS_js.AddItemPayloadSchema,
40
+ chunkESGKWRQS_js.CartSchema,
41
+ chunkESGKWRQS_js.CartItemSchema,
42
+ chunkESGKWRQS_js.CartPricingSchema,
43
+ chunkESGKWRQS_js.CheckoutBodySchema,
44
+ chunkESGKWRQS_js.CheckoutResponseSchema,
45
+ chunkESGKWRQS_js.VariantInfoSchema
46
46
  ]) {
47
- const meta = chunkA6J7W6DH_js.cimplifyRegistry.get(schema);
47
+ const meta = chunkESGKWRQS_js.cimplifyRegistry.get(schema);
48
48
  if (meta) entries.push({ schema, meta });
49
49
  }
50
50
  return entries;
@@ -52,227 +52,227 @@ function listRegisteredSchemas() {
52
52
 
53
53
  Object.defineProperty(exports, "AddItemPayloadSchema", {
54
54
  enumerable: true,
55
- get: function () { return chunkA6J7W6DH_js.AddItemPayloadSchema; }
55
+ get: function () { return chunkESGKWRQS_js.AddItemPayloadSchema; }
56
56
  });
57
57
  Object.defineProperty(exports, "AddOnDetailsSchema", {
58
58
  enumerable: true,
59
- get: function () { return chunkA6J7W6DH_js.AddOnDetailsSchema; }
59
+ get: function () { return chunkESGKWRQS_js.AddOnDetailsSchema; }
60
60
  });
61
61
  Object.defineProperty(exports, "AddOnGroupDetailsSchema", {
62
62
  enumerable: true,
63
- get: function () { return chunkA6J7W6DH_js.AddOnGroupDetailsSchema; }
63
+ get: function () { return chunkESGKWRQS_js.AddOnGroupDetailsSchema; }
64
64
  });
65
65
  Object.defineProperty(exports, "AddOnInDetailsSchema", {
66
66
  enumerable: true,
67
- get: function () { return chunkA6J7W6DH_js.AddOnInDetailsSchema; }
67
+ get: function () { return chunkESGKWRQS_js.AddOnInDetailsSchema; }
68
68
  });
69
69
  Object.defineProperty(exports, "AddOnOptionDetailsSchema", {
70
70
  enumerable: true,
71
- get: function () { return chunkA6J7W6DH_js.AddOnOptionDetailsSchema; }
71
+ get: function () { return chunkESGKWRQS_js.AddOnOptionDetailsSchema; }
72
72
  });
73
73
  Object.defineProperty(exports, "AuthorizationTypeSchema", {
74
74
  enumerable: true,
75
- get: function () { return chunkA6J7W6DH_js.AuthorizationTypeSchema; }
75
+ get: function () { return chunkESGKWRQS_js.AuthorizationTypeSchema; }
76
76
  });
77
77
  Object.defineProperty(exports, "BrandContactSchema", {
78
78
  enumerable: true,
79
- get: function () { return chunkA6J7W6DH_js.BrandContactSchema; }
79
+ get: function () { return chunkESGKWRQS_js.BrandContactSchema; }
80
80
  });
81
81
  Object.defineProperty(exports, "BrandFaqSchema", {
82
82
  enumerable: true,
83
- get: function () { return chunkA6J7W6DH_js.BrandFaqSchema; }
83
+ get: function () { return chunkESGKWRQS_js.BrandFaqSchema; }
84
84
  });
85
85
  Object.defineProperty(exports, "BrandHeroSchema", {
86
86
  enumerable: true,
87
- get: function () { return chunkA6J7W6DH_js.BrandHeroSchema; }
87
+ get: function () { return chunkESGKWRQS_js.BrandHeroSchema; }
88
88
  });
89
89
  Object.defineProperty(exports, "BrandNavLinkSchema", {
90
90
  enumerable: true,
91
- get: function () { return chunkA6J7W6DH_js.BrandNavLinkSchema; }
91
+ get: function () { return chunkESGKWRQS_js.BrandNavLinkSchema; }
92
92
  });
93
93
  Object.defineProperty(exports, "BrandPolicyPageSchema", {
94
94
  enumerable: true,
95
- get: function () { return chunkA6J7W6DH_js.BrandPolicyPageSchema; }
95
+ get: function () { return chunkESGKWRQS_js.BrandPolicyPageSchema; }
96
96
  });
97
97
  Object.defineProperty(exports, "BrandPolicySectionSchema", {
98
98
  enumerable: true,
99
- get: function () { return chunkA6J7W6DH_js.BrandPolicySectionSchema; }
99
+ get: function () { return chunkESGKWRQS_js.BrandPolicySectionSchema; }
100
100
  });
101
101
  Object.defineProperty(exports, "BrandSchema", {
102
102
  enumerable: true,
103
- get: function () { return chunkA6J7W6DH_js.BrandSchema; }
103
+ get: function () { return chunkESGKWRQS_js.BrandSchema; }
104
104
  });
105
105
  Object.defineProperty(exports, "BrandSocialSchema", {
106
106
  enumerable: true,
107
- get: function () { return chunkA6J7W6DH_js.BrandSocialSchema; }
107
+ get: function () { return chunkESGKWRQS_js.BrandSocialSchema; }
108
108
  });
109
109
  Object.defineProperty(exports, "BundleResolvedSchema", {
110
110
  enumerable: true,
111
- get: function () { return chunkA6J7W6DH_js.BundleResolvedSchema; }
111
+ get: function () { return chunkESGKWRQS_js.BundleResolvedSchema; }
112
112
  });
113
113
  Object.defineProperty(exports, "BundleSelectionInputSchema", {
114
114
  enumerable: true,
115
- get: function () { return chunkA6J7W6DH_js.BundleSelectionInputSchema; }
115
+ get: function () { return chunkESGKWRQS_js.BundleSelectionInputSchema; }
116
116
  });
117
117
  Object.defineProperty(exports, "CartItemSchema", {
118
118
  enumerable: true,
119
- get: function () { return chunkA6J7W6DH_js.CartItemSchema; }
119
+ get: function () { return chunkESGKWRQS_js.CartItemSchema; }
120
120
  });
121
121
  Object.defineProperty(exports, "CartPricingSchema", {
122
122
  enumerable: true,
123
- get: function () { return chunkA6J7W6DH_js.CartPricingSchema; }
123
+ get: function () { return chunkESGKWRQS_js.CartPricingSchema; }
124
124
  });
125
125
  Object.defineProperty(exports, "CartSchema", {
126
126
  enumerable: true,
127
- get: function () { return chunkA6J7W6DH_js.CartSchema; }
127
+ get: function () { return chunkESGKWRQS_js.CartSchema; }
128
128
  });
129
129
  Object.defineProperty(exports, "CheckoutBodySchema", {
130
130
  enumerable: true,
131
- get: function () { return chunkA6J7W6DH_js.CheckoutBodySchema; }
131
+ get: function () { return chunkESGKWRQS_js.CheckoutBodySchema; }
132
132
  });
133
133
  Object.defineProperty(exports, "CheckoutCustomerSchema", {
134
134
  enumerable: true,
135
- get: function () { return chunkA6J7W6DH_js.CheckoutCustomerSchema; }
135
+ get: function () { return chunkESGKWRQS_js.CheckoutCustomerSchema; }
136
136
  });
137
137
  Object.defineProperty(exports, "CheckoutResponseSchema", {
138
138
  enumerable: true,
139
- get: function () { return chunkA6J7W6DH_js.CheckoutResponseSchema; }
139
+ get: function () { return chunkESGKWRQS_js.CheckoutResponseSchema; }
140
140
  });
141
141
  Object.defineProperty(exports, "ChosenPriceSchema", {
142
142
  enumerable: true,
143
- get: function () { return chunkA6J7W6DH_js.ChosenPriceSchema; }
143
+ get: function () { return chunkESGKWRQS_js.ChosenPriceSchema; }
144
144
  });
145
145
  Object.defineProperty(exports, "CompositeResolvedSchema", {
146
146
  enumerable: true,
147
- get: function () { return chunkA6J7W6DH_js.CompositeResolvedSchema; }
147
+ get: function () { return chunkESGKWRQS_js.CompositeResolvedSchema; }
148
148
  });
149
149
  Object.defineProperty(exports, "CompositeSelectionInputSchema", {
150
150
  enumerable: true,
151
- get: function () { return chunkA6J7W6DH_js.CompositeSelectionInputSchema; }
151
+ get: function () { return chunkESGKWRQS_js.CompositeSelectionInputSchema; }
152
152
  });
153
153
  Object.defineProperty(exports, "CountryCodeSchema", {
154
154
  enumerable: true,
155
- get: function () { return chunkA6J7W6DH_js.CountryCodeSchema; }
155
+ get: function () { return chunkESGKWRQS_js.CountryCodeSchema; }
156
156
  });
157
157
  Object.defineProperty(exports, "CurrencyCodeSchema", {
158
158
  enumerable: true,
159
- get: function () { return chunkA6J7W6DH_js.CurrencyCodeSchema; }
159
+ get: function () { return chunkESGKWRQS_js.CurrencyCodeSchema; }
160
160
  });
161
161
  Object.defineProperty(exports, "CustomerInputValueSchema", {
162
162
  enumerable: true,
163
- get: function () { return chunkA6J7W6DH_js.CustomerInputValueSchema; }
163
+ get: function () { return chunkESGKWRQS_js.CustomerInputValueSchema; }
164
164
  });
165
165
  Object.defineProperty(exports, "DiscountDetailsSchema", {
166
166
  enumerable: true,
167
- get: function () { return chunkA6J7W6DH_js.DiscountDetailsSchema; }
167
+ get: function () { return chunkESGKWRQS_js.DiscountDetailsSchema; }
168
168
  });
169
169
  Object.defineProperty(exports, "IsoDateTimeSchema", {
170
170
  enumerable: true,
171
- get: function () { return chunkA6J7W6DH_js.IsoDateTimeSchema; }
171
+ get: function () { return chunkESGKWRQS_js.IsoDateTimeSchema; }
172
172
  });
173
173
  Object.defineProperty(exports, "LineTypeSchema", {
174
174
  enumerable: true,
175
- get: function () { return chunkA6J7W6DH_js.LineTypeSchema; }
175
+ get: function () { return chunkESGKWRQS_js.LineTypeSchema; }
176
176
  });
177
177
  Object.defineProperty(exports, "LocaleSchema", {
178
178
  enumerable: true,
179
- get: function () { return chunkA6J7W6DH_js.LocaleSchema; }
179
+ get: function () { return chunkESGKWRQS_js.LocaleSchema; }
180
180
  });
181
181
  Object.defineProperty(exports, "MoneyLooseSchema", {
182
182
  enumerable: true,
183
- get: function () { return chunkA6J7W6DH_js.MoneyLooseSchema; }
183
+ get: function () { return chunkESGKWRQS_js.MoneyLooseSchema; }
184
184
  });
185
185
  Object.defineProperty(exports, "MoneySchema", {
186
186
  enumerable: true,
187
- get: function () { return chunkA6J7W6DH_js.MoneySchema; }
187
+ get: function () { return chunkESGKWRQS_js.MoneySchema; }
188
188
  });
189
189
  Object.defineProperty(exports, "NextActionSchema", {
190
190
  enumerable: true,
191
- get: function () { return chunkA6J7W6DH_js.NextActionSchema; }
191
+ get: function () { return chunkESGKWRQS_js.NextActionSchema; }
192
192
  });
193
193
  Object.defineProperty(exports, "PhoneE164Schema", {
194
194
  enumerable: true,
195
- get: function () { return chunkA6J7W6DH_js.PhoneE164Schema; }
195
+ get: function () { return chunkESGKWRQS_js.PhoneE164Schema; }
196
196
  });
197
197
  Object.defineProperty(exports, "ProductTypeSchema", {
198
198
  enumerable: true,
199
- get: function () { return chunkA6J7W6DH_js.ProductTypeSchema; }
199
+ get: function () { return chunkESGKWRQS_js.ProductTypeSchema; }
200
200
  });
201
201
  Object.defineProperty(exports, "SchemaViolationError", {
202
202
  enumerable: true,
203
- get: function () { return chunkA6J7W6DH_js.SchemaViolationError; }
203
+ get: function () { return chunkESGKWRQS_js.SchemaViolationError; }
204
204
  });
205
205
  Object.defineProperty(exports, "SeedNameSchema", {
206
206
  enumerable: true,
207
- get: function () { return chunkA6J7W6DH_js.SeedNameSchema; }
207
+ get: function () { return chunkESGKWRQS_js.SeedNameSchema; }
208
208
  });
209
209
  Object.defineProperty(exports, "SelectedAddOnOptionSchema", {
210
210
  enumerable: true,
211
- get: function () { return chunkA6J7W6DH_js.SelectedAddOnOptionSchema; }
211
+ get: function () { return chunkESGKWRQS_js.SelectedAddOnOptionSchema; }
212
212
  });
213
213
  Object.defineProperty(exports, "ServiceStatusSchema", {
214
214
  enumerable: true,
215
- get: function () { return chunkA6J7W6DH_js.ServiceStatusSchema; }
215
+ get: function () { return chunkESGKWRQS_js.ServiceStatusSchema; }
216
216
  });
217
217
  Object.defineProperty(exports, "TimestampSchema", {
218
218
  enumerable: true,
219
- get: function () { return chunkA6J7W6DH_js.TimestampSchema; }
219
+ get: function () { return chunkESGKWRQS_js.TimestampSchema; }
220
220
  });
221
221
  Object.defineProperty(exports, "VariantDetailsSchema", {
222
222
  enumerable: true,
223
- get: function () { return chunkA6J7W6DH_js.VariantDetailsSchema; }
223
+ get: function () { return chunkESGKWRQS_js.VariantDetailsSchema; }
224
224
  });
225
225
  Object.defineProperty(exports, "VariantDisplayAttributeSchema", {
226
226
  enumerable: true,
227
- get: function () { return chunkA6J7W6DH_js.VariantDisplayAttributeSchema; }
227
+ get: function () { return chunkESGKWRQS_js.VariantDisplayAttributeSchema; }
228
228
  });
229
229
  Object.defineProperty(exports, "VariantInfoSchema", {
230
230
  enumerable: true,
231
- get: function () { return chunkA6J7W6DH_js.VariantInfoSchema; }
231
+ get: function () { return chunkESGKWRQS_js.VariantInfoSchema; }
232
232
  });
233
233
  Object.defineProperty(exports, "assertAddItemPayload", {
234
234
  enumerable: true,
235
- get: function () { return chunkA6J7W6DH_js.assertAddItemPayload; }
235
+ get: function () { return chunkESGKWRQS_js.assertAddItemPayload; }
236
236
  });
237
237
  Object.defineProperty(exports, "assertBrand", {
238
238
  enumerable: true,
239
- get: function () { return chunkA6J7W6DH_js.assertBrand; }
239
+ get: function () { return chunkESGKWRQS_js.assertBrand; }
240
240
  });
241
241
  Object.defineProperty(exports, "assertCart", {
242
242
  enumerable: true,
243
- get: function () { return chunkA6J7W6DH_js.assertCart; }
243
+ get: function () { return chunkESGKWRQS_js.assertCart; }
244
244
  });
245
245
  Object.defineProperty(exports, "assertCartItem", {
246
246
  enumerable: true,
247
- get: function () { return chunkA6J7W6DH_js.assertCartItem; }
247
+ get: function () { return chunkESGKWRQS_js.assertCartItem; }
248
248
  });
249
249
  Object.defineProperty(exports, "assertCheckoutBody", {
250
250
  enumerable: true,
251
- get: function () { return chunkA6J7W6DH_js.assertCheckoutBody; }
251
+ get: function () { return chunkESGKWRQS_js.assertCheckoutBody; }
252
252
  });
253
253
  Object.defineProperty(exports, "assertCheckoutResponse", {
254
254
  enumerable: true,
255
- get: function () { return chunkA6J7W6DH_js.assertCheckoutResponse; }
255
+ get: function () { return chunkESGKWRQS_js.assertCheckoutResponse; }
256
256
  });
257
257
  Object.defineProperty(exports, "cimplifyRegistry", {
258
258
  enumerable: true,
259
- get: function () { return chunkA6J7W6DH_js.cimplifyRegistry; }
259
+ get: function () { return chunkESGKWRQS_js.cimplifyRegistry; }
260
260
  });
261
261
  Object.defineProperty(exports, "createTestClient", {
262
262
  enumerable: true,
263
- get: function () { return chunkA6J7W6DH_js.createTestClient; }
263
+ get: function () { return chunkESGKWRQS_js.createTestClient; }
264
264
  });
265
265
  Object.defineProperty(exports, "fixtures", {
266
266
  enumerable: true,
267
- get: function () { return chunkA6J7W6DH_js.fixtures; }
267
+ get: function () { return chunkESGKWRQS_js.fixtures; }
268
268
  });
269
269
  Object.defineProperty(exports, "makeAssertion", {
270
270
  enumerable: true,
271
- get: function () { return chunkA6J7W6DH_js.makeAssertion; }
271
+ get: function () { return chunkESGKWRQS_js.makeAssertion; }
272
272
  });
273
273
  Object.defineProperty(exports, "registerSchema", {
274
274
  enumerable: true,
275
- get: function () { return chunkA6J7W6DH_js.registerSchema; }
275
+ get: function () { return chunkESGKWRQS_js.registerSchema; }
276
276
  });
277
277
  exports.exportJsonSchemas = exportJsonSchemas;
278
278
  exports.listRegisteredSchemas = listRegisteredSchemas;
package/dist/testing.mjs CHANGED
@@ -1,10 +1,10 @@
1
- import { VariantInfoSchema, CheckoutResponseSchema, CheckoutBodySchema, CartPricingSchema, CartItemSchema, CartSchema, AddItemPayloadSchema, BrandSchema, cimplifyRegistry } from './chunk-DU4IX2I2.mjs';
2
- export { AddItemPayloadSchema, AddOnDetailsSchema, AddOnGroupDetailsSchema, AddOnInDetailsSchema, AddOnOptionDetailsSchema, AuthorizationTypeSchema, BrandContactSchema, BrandFaqSchema, BrandHeroSchema, BrandNavLinkSchema, BrandPolicyPageSchema, BrandPolicySectionSchema, BrandSchema, BrandSocialSchema, BundleResolvedSchema, BundleSelectionInputSchema, CartItemSchema, CartPricingSchema, CartSchema, CheckoutBodySchema, CheckoutCustomerSchema, CheckoutResponseSchema, ChosenPriceSchema, CompositeResolvedSchema, CompositeSelectionInputSchema, CountryCodeSchema, CurrencyCodeSchema, CustomerInputValueSchema, DiscountDetailsSchema, IsoDateTimeSchema, LineTypeSchema, LocaleSchema, MoneyLooseSchema, MoneySchema, NextActionSchema, PhoneE164Schema, ProductTypeSchema, SchemaViolationError, SeedNameSchema, SelectedAddOnOptionSchema, ServiceStatusSchema, TimestampSchema, VariantDetailsSchema, VariantDisplayAttributeSchema, VariantInfoSchema, assertAddItemPayload, assertBrand, assertCart, assertCartItem, assertCheckoutBody, assertCheckoutResponse, cimplifyRegistry, createTestClient, fixtures, makeAssertion, registerSchema } from './chunk-DU4IX2I2.mjs';
3
- import './chunk-GIFVSWYJ.mjs';
4
- import './chunk-NWUEWUX2.mjs';
5
- import './chunk-7BM56JET.mjs';
6
- import './chunk-TD3AY34U.mjs';
7
- import './chunk-AMZXALF6.mjs';
1
+ import { VariantInfoSchema, CheckoutResponseSchema, CheckoutBodySchema, CartPricingSchema, CartItemSchema, CartSchema, AddItemPayloadSchema, BrandSchema, cimplifyRegistry } from './chunk-A2GXDCSI.mjs';
2
+ export { AddItemPayloadSchema, AddOnDetailsSchema, AddOnGroupDetailsSchema, AddOnInDetailsSchema, AddOnOptionDetailsSchema, AuthorizationTypeSchema, BrandContactSchema, BrandFaqSchema, BrandHeroSchema, BrandNavLinkSchema, BrandPolicyPageSchema, BrandPolicySectionSchema, BrandSchema, BrandSocialSchema, BundleResolvedSchema, BundleSelectionInputSchema, CartItemSchema, CartPricingSchema, CartSchema, CheckoutBodySchema, CheckoutCustomerSchema, CheckoutResponseSchema, ChosenPriceSchema, CompositeResolvedSchema, CompositeSelectionInputSchema, CountryCodeSchema, CurrencyCodeSchema, CustomerInputValueSchema, DiscountDetailsSchema, IsoDateTimeSchema, LineTypeSchema, LocaleSchema, MoneyLooseSchema, MoneySchema, NextActionSchema, PhoneE164Schema, ProductTypeSchema, SchemaViolationError, SeedNameSchema, SelectedAddOnOptionSchema, ServiceStatusSchema, TimestampSchema, VariantDetailsSchema, VariantDisplayAttributeSchema, VariantInfoSchema, assertAddItemPayload, assertBrand, assertCart, assertCartItem, assertCheckoutBody, assertCheckoutResponse, cimplifyRegistry, createTestClient, fixtures, makeAssertion, registerSchema } from './chunk-A2GXDCSI.mjs';
3
+ import './chunk-D6JWYYTG.mjs';
4
+ import './chunk-MRL53WP6.mjs';
5
+ import './chunk-NN3WC7XZ.mjs';
6
+ import './chunk-KFLGQGMC.mjs';
7
+ import './chunk-K5EN2W2Q.mjs';
8
8
  import './chunk-3G6RQLXK.mjs';
9
9
  import { z } from 'zod';
10
10
 
package/dist/utils.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- 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, i as formatPriceWithTax, j as formatProductPrice, k as getBasePrice, l as getCurrencySymbol, m as getDiscountPercentage, n as getDisplayPrice, o as getMarkupPercentage, q as getProductCurrency, r as getTaxAmount, 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-DZz6hdrT.mjs';
2
- import './product-RJMIdCAf.mjs';
3
- import './price-4T7dlhxM.mjs';
4
- import './payment-Dh-6cRcV.mjs';
1
+ 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, i as formatPriceWithTax, j as formatProductPrice, k as getBasePrice, l as getCurrencySymbol, m as getDiscountPercentage, n as getDisplayPrice, o as getMarkupPercentage, q as getProductCurrency, r as getTaxAmount, 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-DLb_Ldl6.mjs';
2
+ import './product-BGxIfTqJ.mjs';
3
+ import './price-nRxqVNGq.mjs';
4
+ import './payment-CFev-fOE.mjs';
5
5
  import 'libphonenumber-js';
package/dist/utils.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- 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, i as formatPriceWithTax, j as formatProductPrice, k as getBasePrice, l as getCurrencySymbol, m as getDiscountPercentage, n as getDisplayPrice, o as getMarkupPercentage, q as getProductCurrency, r as getTaxAmount, 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-BrC1x2kK.js';
2
- import './product-RJMIdCAf.js';
3
- import './price-CQdOJoX-.js';
4
- import './payment-D1f3ZQPC.js';
1
+ 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, i as formatPriceWithTax, j as formatProductPrice, k as getBasePrice, l as getCurrencySymbol, m as getDiscountPercentage, n as getDisplayPrice, o as getMarkupPercentage, q as getProductCurrency, r as getTaxAmount, 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-BRwHpMY-.js';
2
+ import './product-BGxIfTqJ.js';
3
+ import './price-BNhGVB5q.js';
4
+ import './payment-BA7KNBxg.js';
5
5
  import 'libphonenumber-js';
package/dist/utils.js CHANGED
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkL5GKVQVJ_js = require('./chunk-L5GKVQVJ.js');
4
- var chunk7Y2O3E4D_js = require('./chunk-7Y2O3E4D.js');
5
- require('./chunk-XA3ZNR75.js');
4
+ var chunkPTPOQVXS_js = require('./chunk-PTPOQVXS.js');
5
+ require('./chunk-AETVRBKI.js');
6
6
  require('./chunk-OWW5GUSB.js');
7
7
 
8
8
 
@@ -21,109 +21,109 @@ Object.defineProperty(exports, "resolvePhoneCountryCode", {
21
21
  });
22
22
  Object.defineProperty(exports, "CURRENCY_SYMBOLS", {
23
23
  enumerable: true,
24
- get: function () { return chunk7Y2O3E4D_js.CURRENCY_SYMBOLS; }
24
+ get: function () { return chunkPTPOQVXS_js.CURRENCY_SYMBOLS; }
25
25
  });
26
26
  Object.defineProperty(exports, "MOBILE_MONEY_PROVIDERS", {
27
27
  enumerable: true,
28
- get: function () { return chunk7Y2O3E4D_js.MOBILE_MONEY_PROVIDERS; }
28
+ get: function () { return chunkPTPOQVXS_js.MOBILE_MONEY_PROVIDERS; }
29
29
  });
30
30
  Object.defineProperty(exports, "categorizePaymentError", {
31
31
  enumerable: true,
32
- get: function () { return chunk7Y2O3E4D_js.categorizePaymentError; }
32
+ get: function () { return chunkPTPOQVXS_js.categorizePaymentError; }
33
33
  });
34
34
  Object.defineProperty(exports, "detectMobileMoneyProvider", {
35
35
  enumerable: true,
36
- get: function () { return chunk7Y2O3E4D_js.detectMobileMoneyProvider; }
36
+ get: function () { return chunkPTPOQVXS_js.detectMobileMoneyProvider; }
37
37
  });
38
38
  Object.defineProperty(exports, "formatMoney", {
39
39
  enumerable: true,
40
- get: function () { return chunk7Y2O3E4D_js.formatMoney; }
40
+ get: function () { return chunkPTPOQVXS_js.formatMoney; }
41
41
  });
42
42
  Object.defineProperty(exports, "formatNumberCompact", {
43
43
  enumerable: true,
44
- get: function () { return chunk7Y2O3E4D_js.formatNumberCompact; }
44
+ get: function () { return chunkPTPOQVXS_js.formatNumberCompact; }
45
45
  });
46
46
  Object.defineProperty(exports, "formatPrice", {
47
47
  enumerable: true,
48
- get: function () { return chunk7Y2O3E4D_js.formatPrice; }
48
+ get: function () { return chunkPTPOQVXS_js.formatPrice; }
49
49
  });
50
50
  Object.defineProperty(exports, "formatPriceAdjustment", {
51
51
  enumerable: true,
52
- get: function () { return chunk7Y2O3E4D_js.formatPriceAdjustment; }
52
+ get: function () { return chunkPTPOQVXS_js.formatPriceAdjustment; }
53
53
  });
54
54
  Object.defineProperty(exports, "formatPriceCompact", {
55
55
  enumerable: true,
56
- get: function () { return chunk7Y2O3E4D_js.formatPriceCompact; }
56
+ get: function () { return chunkPTPOQVXS_js.formatPriceCompact; }
57
57
  });
58
58
  Object.defineProperty(exports, "formatPriceWithTax", {
59
59
  enumerable: true,
60
- get: function () { return chunk7Y2O3E4D_js.formatPriceWithTax; }
60
+ get: function () { return chunkPTPOQVXS_js.formatPriceWithTax; }
61
61
  });
62
62
  Object.defineProperty(exports, "formatProductPrice", {
63
63
  enumerable: true,
64
- get: function () { return chunk7Y2O3E4D_js.formatProductPrice; }
64
+ get: function () { return chunkPTPOQVXS_js.formatProductPrice; }
65
65
  });
66
66
  Object.defineProperty(exports, "getBasePrice", {
67
67
  enumerable: true,
68
- get: function () { return chunk7Y2O3E4D_js.getBasePrice; }
68
+ get: function () { return chunkPTPOQVXS_js.getBasePrice; }
69
69
  });
70
70
  Object.defineProperty(exports, "getCurrencySymbol", {
71
71
  enumerable: true,
72
- get: function () { return chunk7Y2O3E4D_js.getCurrencySymbol; }
72
+ get: function () { return chunkPTPOQVXS_js.getCurrencySymbol; }
73
73
  });
74
74
  Object.defineProperty(exports, "getDiscountPercentage", {
75
75
  enumerable: true,
76
- get: function () { return chunk7Y2O3E4D_js.getDiscountPercentage; }
76
+ get: function () { return chunkPTPOQVXS_js.getDiscountPercentage; }
77
77
  });
78
78
  Object.defineProperty(exports, "getDisplayPrice", {
79
79
  enumerable: true,
80
- get: function () { return chunk7Y2O3E4D_js.getDisplayPrice; }
80
+ get: function () { return chunkPTPOQVXS_js.getDisplayPrice; }
81
81
  });
82
82
  Object.defineProperty(exports, "getMarkupPercentage", {
83
83
  enumerable: true,
84
- get: function () { return chunk7Y2O3E4D_js.getMarkupPercentage; }
84
+ get: function () { return chunkPTPOQVXS_js.getMarkupPercentage; }
85
85
  });
86
86
  Object.defineProperty(exports, "getProductCurrency", {
87
87
  enumerable: true,
88
- get: function () { return chunk7Y2O3E4D_js.getProductCurrency; }
88
+ get: function () { return chunkPTPOQVXS_js.getProductCurrency; }
89
89
  });
90
90
  Object.defineProperty(exports, "getTaxAmount", {
91
91
  enumerable: true,
92
- get: function () { return chunk7Y2O3E4D_js.getTaxAmount; }
92
+ get: function () { return chunkPTPOQVXS_js.getTaxAmount; }
93
93
  });
94
94
  Object.defineProperty(exports, "hasTaxInfo", {
95
95
  enumerable: true,
96
- get: function () { return chunk7Y2O3E4D_js.hasTaxInfo; }
96
+ get: function () { return chunkPTPOQVXS_js.hasTaxInfo; }
97
97
  });
98
98
  Object.defineProperty(exports, "isOnSale", {
99
99
  enumerable: true,
100
- get: function () { return chunk7Y2O3E4D_js.isOnSale; }
100
+ get: function () { return chunkPTPOQVXS_js.isOnSale; }
101
101
  });
102
102
  Object.defineProperty(exports, "isPaymentStatusFailure", {
103
103
  enumerable: true,
104
- get: function () { return chunk7Y2O3E4D_js.isPaymentStatusFailure; }
104
+ get: function () { return chunkPTPOQVXS_js.isPaymentStatusFailure; }
105
105
  });
106
106
  Object.defineProperty(exports, "isPaymentStatusRequiresAction", {
107
107
  enumerable: true,
108
- get: function () { return chunk7Y2O3E4D_js.isPaymentStatusRequiresAction; }
108
+ get: function () { return chunkPTPOQVXS_js.isPaymentStatusRequiresAction; }
109
109
  });
110
110
  Object.defineProperty(exports, "isPaymentStatusSuccess", {
111
111
  enumerable: true,
112
- get: function () { return chunk7Y2O3E4D_js.isPaymentStatusSuccess; }
112
+ get: function () { return chunkPTPOQVXS_js.isPaymentStatusSuccess; }
113
113
  });
114
114
  Object.defineProperty(exports, "isTaxInclusive", {
115
115
  enumerable: true,
116
- get: function () { return chunk7Y2O3E4D_js.isTaxInclusive; }
116
+ get: function () { return chunkPTPOQVXS_js.isTaxInclusive; }
117
117
  });
118
118
  Object.defineProperty(exports, "normalizePaymentResponse", {
119
119
  enumerable: true,
120
- get: function () { return chunk7Y2O3E4D_js.normalizePaymentResponse; }
120
+ get: function () { return chunkPTPOQVXS_js.normalizePaymentResponse; }
121
121
  });
122
122
  Object.defineProperty(exports, "normalizeStatusResponse", {
123
123
  enumerable: true,
124
- get: function () { return chunk7Y2O3E4D_js.normalizeStatusResponse; }
124
+ get: function () { return chunkPTPOQVXS_js.normalizeStatusResponse; }
125
125
  });
126
126
  Object.defineProperty(exports, "parsePrice", {
127
127
  enumerable: true,
128
- get: function () { return chunk7Y2O3E4D_js.parsePrice; }
128
+ get: function () { return chunkPTPOQVXS_js.parsePrice; }
129
129
  });
package/dist/utils.mjs CHANGED
@@ -1,4 +1,4 @@
1
1
  export { isValidPhoneForContext, normalizePhoneToE164, resolvePhoneCountryCode } from './chunk-YOIVZ6OA.mjs';
2
- export { CURRENCY_SYMBOLS, MOBILE_MONEY_PROVIDERS, categorizePaymentError, detectMobileMoneyProvider, formatMoney, formatNumberCompact, formatPrice, formatPriceAdjustment, formatPriceCompact, formatPriceWithTax, formatProductPrice, getBasePrice, getCurrencySymbol, getDiscountPercentage, getDisplayPrice, getMarkupPercentage, getProductCurrency, getTaxAmount, hasTaxInfo, isOnSale, isPaymentStatusFailure, isPaymentStatusRequiresAction, isPaymentStatusSuccess, isTaxInclusive, normalizePaymentResponse, normalizeStatusResponse, parsePrice } from './chunk-TD3AY34U.mjs';
3
- import './chunk-AMZXALF6.mjs';
2
+ export { CURRENCY_SYMBOLS, MOBILE_MONEY_PROVIDERS, categorizePaymentError, detectMobileMoneyProvider, formatMoney, formatNumberCompact, formatPrice, formatPriceAdjustment, formatPriceCompact, formatPriceWithTax, formatProductPrice, getBasePrice, getCurrencySymbol, getDiscountPercentage, getDisplayPrice, getMarkupPercentage, getProductCurrency, getTaxAmount, hasTaxInfo, isOnSale, isPaymentStatusFailure, isPaymentStatusRequiresAction, isPaymentStatusSuccess, isTaxInclusive, normalizePaymentResponse, normalizeStatusResponse, parsePrice } from './chunk-KFLGQGMC.mjs';
3
+ import './chunk-K5EN2W2Q.mjs';
4
4
  import './chunk-3G6RQLXK.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cimplify/sdk",
3
- "version": "0.85.0",
3
+ "version": "0.86.0",
4
4
  "description": "Cimplify Commerce SDK for storefronts",
5
5
  "keywords": [
6
6
  "cimplify",
@@ -107,7 +107,9 @@
107
107
  "contracts:diff": "bun scripts/diff-contracts.ts",
108
108
  "contracts:smoke": "bun scripts/diff-contracts.ts --smoke",
109
109
  "contracts": "bun run contracts:emit && bun run contracts:diff",
110
- "schema:add": "bun scripts/schema-add.ts"
110
+ "schema:add": "bun scripts/schema-add.ts",
111
+ "gen:api": "openapi-typescript ../../contracts/storefront-openapi.json -o src/types/generated.ts",
112
+ "gen:api:check": "bun run gen:api && git diff --exit-code src/types/generated.ts"
111
113
  },
112
114
  "peerDependencies": {
113
115
  "@paystack/inline-js": "^2.23.0",
@@ -148,6 +150,7 @@
148
150
  "hono": "^4.12.25",
149
151
  "jsdom": "^29.1.1",
150
152
  "msw": "^2.14.6",
153
+ "openapi-typescript": "^7.13.0",
151
154
  "react": "^19.2.7",
152
155
  "react-dom": "^19.2.7",
153
156
  "tailwindcss": "4.3.1",
@@ -9,7 +9,7 @@
9
9
  "files": [
10
10
  {
11
11
  "path": "currency-selector.tsx",
12
- "content": "\"use client\";\n\nimport React, { useState, useEffect, useRef } from \"react\";\nimport type { CurrencyCode } from \"@cimplify/sdk\";\nimport type { CimplifyError } from \"@cimplify/sdk\";\nimport type { FxRateResponse } from \"../types/fx\";\nimport { useOptionalCimplifyClient } from \"@cimplify/sdk/react\";\nimport { cn } from \"@cimplify/sdk/react\";\n\nexport interface CurrencySelectorClassNames {\n root?: string;\n option?: string;\n activeOption?: string;\n rate?: string;\n label?: string;\n loading?: string;\n}\n\nexport interface CurrencySelectorProps {\n /** Available currencies to display. */\n currencies: CurrencyCode[];\n /** Currently selected currency. */\n currentCurrency?: CurrencyCode;\n /** Called when a currency is selected. */\n onCurrencyChange?: (currency: CurrencyCode) => void;\n /** Show the exchange rate next to each currency. Requires `baseCurrency`. */\n showRate?: boolean;\n /** Base currency used for rate display. */\n baseCurrency?: CurrencyCode;\n /** Custom currency option renderer. */\n renderCurrency?: (\n currency: CurrencyCode,\n isActive: boolean,\n rate: FxRateResponse | null,\n ) => React.ReactNode;\n className?: string;\n classNames?: CurrencySelectorClassNames;\n}\n\n/**\n * CurrencySelector — currency switcher for international customers.\n *\n * Renders selectable currency options with optional exchange rate display.\n * Returns `null` when there is only one currency (no selector needed).\n */\nexport function CurrencySelector({\n currencies,\n currentCurrency,\n onCurrencyChange,\n showRate = false,\n baseCurrency,\n renderCurrency,\n className,\n classNames,\n}: CurrencySelectorProps): React.ReactElement | null {\n const context = useOptionalCimplifyClient();\n const client = context?.client ?? null;\n\n const [rates, setRates] = useState<Record<string, FxRateResponse>>({});\n const [isLoadingRates, setIsLoadingRates] = useState(false);\n const requestIdRef = useRef(0);\n\n useEffect(() => {\n if (!showRate || !baseCurrency || !client) return;\n\n const targets = currencies.filter((c) => c !== baseCurrency);\n if (targets.length === 0) return;\n\n const nextRequestId = ++requestIdRef.current;\n setIsLoadingRates(true);\n\n void (async () => {\n const fetched: Record<string, FxRateResponse> = {};\n\n await Promise.all(\n targets.map(async (currency) => {\n const res = await client.fx.getRate(baseCurrency, currency);\n if (res.ok) {\n fetched[currency] = res.value;\n }\n }),\n );\n\n if (nextRequestId !== requestIdRef.current) return;\n\n setRates(fetched);\n setIsLoadingRates(false);\n })();\n }, [client, showRate, baseCurrency, currencies]);\n\n if (currencies.length <= 1) {\n return null;\n }\n\n return (\n <div data-cimplify-currency-selector className={cn(className, classNames?.root)}>\n {currencies.map((currency) => {\n const isActive = currentCurrency === currency;\n const rate = rates[currency] ?? null;\n\n return (\n <button\n key={currency}\n type=\"button\"\n onClick={() => onCurrencyChange?.(currency)}\n data-cimplify-currency-option\n data-active={isActive || undefined}\n aria-pressed={isActive}\n className={cn(\n classNames?.option,\n isActive && classNames?.activeOption,\n )}\n >\n {renderCurrency ? (\n renderCurrency(currency, isActive, rate)\n ) : (\n <>\n <span data-cimplify-currency-label className={classNames?.label}>\n {currency}\n </span>\n {showRate && baseCurrency && currency !== baseCurrency && (\n <span data-cimplify-currency-rate className={classNames?.rate}>\n {isLoadingRates\n ? \"...\"\n : rate\n ? `1 ${baseCurrency} = ${rate.rate.toFixed(4)} ${currency}`\n : null}\n </span>\n )}\n </>\n )}\n </button>\n );\n })}\n </div>\n );\n}\n"
12
+ "content": "\"use client\";\n\nimport React, { useState, useEffect, useRef } from \"react\";\nimport type { CurrencyCode } from \"@cimplify/sdk\";\nimport type { CimplifyError } from \"@cimplify/sdk\";\nimport type { FxRateResponse } from \"../types/fx\";\nimport { useOptionalCimplifyClient } from \"@cimplify/sdk/react\";\nimport { cn } from \"@cimplify/sdk/react\";\n\nexport interface CurrencySelectorClassNames {\n root?: string;\n option?: string;\n activeOption?: string;\n rate?: string;\n label?: string;\n loading?: string;\n}\n\nexport interface CurrencySelectorProps {\n /** Available currencies to display. */\n currencies: CurrencyCode[];\n /** Currently selected currency. */\n currentCurrency?: CurrencyCode;\n /** Called when a currency is selected. */\n onCurrencyChange?: (currency: CurrencyCode) => void;\n /** Show the exchange rate next to each currency. Requires `baseCurrency`. */\n showRate?: boolean;\n /** Base currency used for rate display. */\n baseCurrency?: CurrencyCode;\n /** Custom currency option renderer. */\n renderCurrency?: (\n currency: CurrencyCode,\n isActive: boolean,\n rate: FxRateResponse | null,\n ) => React.ReactNode;\n className?: string;\n classNames?: CurrencySelectorClassNames;\n}\n\n/**\n * CurrencySelector — currency switcher for international customers.\n *\n * Renders selectable currency options with optional exchange rate display.\n * Returns `null` when there is only one currency (no selector needed).\n */\nexport function CurrencySelector({\n currencies,\n currentCurrency,\n onCurrencyChange,\n showRate = false,\n baseCurrency,\n renderCurrency,\n className,\n classNames,\n}: CurrencySelectorProps): React.ReactElement | null {\n const context = useOptionalCimplifyClient();\n const client = context?.client ?? null;\n\n const [rates, setRates] = useState<Record<string, FxRateResponse>>({});\n const [isLoadingRates, setIsLoadingRates] = useState(false);\n const requestIdRef = useRef(0);\n\n useEffect(() => {\n if (!showRate || !baseCurrency || !client) return;\n\n const targets = currencies.filter((c) => c !== baseCurrency);\n if (targets.length === 0) return;\n\n const nextRequestId = ++requestIdRef.current;\n setIsLoadingRates(true);\n\n void (async () => {\n const fetched: Record<string, FxRateResponse> = {};\n\n await Promise.all(\n targets.map(async (currency) => {\n const res = await client.fx.getRate(baseCurrency, currency);\n if (res.ok) {\n fetched[currency] = res.value;\n }\n }),\n );\n\n if (nextRequestId !== requestIdRef.current) return;\n\n setRates(fetched);\n setIsLoadingRates(false);\n })();\n }, [client, showRate, baseCurrency, currencies]);\n\n if (currencies.length <= 1) {\n return null;\n }\n\n return (\n <div data-cimplify-currency-selector className={cn(className, classNames?.root)}>\n {currencies.map((currency) => {\n const isActive = currentCurrency === currency;\n const rate = rates[currency] ?? null;\n\n return (\n <button\n key={currency}\n type=\"button\"\n onClick={() => onCurrencyChange?.(currency)}\n data-cimplify-currency-option\n data-active={isActive || undefined}\n aria-pressed={isActive}\n className={cn(\n classNames?.option,\n isActive && classNames?.activeOption,\n )}\n >\n {renderCurrency ? (\n renderCurrency(currency, isActive, rate)\n ) : (\n <>\n <span data-cimplify-currency-label className={classNames?.label}>\n {currency}\n </span>\n {showRate && baseCurrency && currency !== baseCurrency && (\n <span data-cimplify-currency-rate className={classNames?.rate}>\n {isLoadingRates\n ? \"...\"\n : rate\n ? `1 ${baseCurrency} = ${Number(rate.rate).toFixed(4)} ${currency}`\n : null}\n </span>\n )}\n </>\n )}\n </button>\n );\n })}\n </div>\n );\n}\n"
13
13
  }
14
14
  ]
15
15
  }
@@ -11,7 +11,7 @@
11
11
  "files": [
12
12
  {
13
13
  "path": "cards/digital-product-card.tsx",
14
- "content": "\"use client\";\n\nimport React from \"react\";\nimport { stripHtmlToText } from \"@cimplify/sdk/react\";\nimport type { CardLayoutProps } from \"@cimplify/sdk/react\";\nimport { CardShell, CardImage } from \"@cimplify/sdk/react\";\nimport { Price } from \"@cimplify/sdk/react\";\nimport { getProductCurrency } from \"@cimplify/sdk\";\n\nconst TYPE_BADGES: Record<string, { label: string; color: string }> = {\n download: { label: \"Download\", color: \"bg-sky-50 text-sky-700 border-sky-200/60\" },\n license: { label: \"License\", color: \"bg-blue-50 text-blue-700 border-blue-200/60\" },\n event_ticket: { label: \"Event\", color: \"bg-violet-50 text-violet-700 border-violet-200/60\" },\n access_pass: { label: \"Access\", color: \"bg-emerald-50 text-emerald-700 border-emerald-200/60\" },\n gift_card: { label: \"Gift Card\", color: \"bg-amber-50 text-amber-700 border-amber-200/60\" },\n};\n\nexport function DigitalProductCard({\n product,\n renderImage,\n renderLink,\n className,\n}: CardLayoutProps): React.ReactElement {\n const image = product.image_url || product.images?.[0] || \"\";\n const currency = getProductCurrency(product);\n const typeBadge = product.digital_type ? TYPE_BADGES[product.digital_type] : null;\n const isTicket = product.digital_type === \"event_ticket\";\n\n return (\n <CardShell product={product} renderLink={renderLink} className={className}>\n <CardImage src={image} alt={product.name} aspectRatio=\"4/3\" renderImage={renderImage}>\n {typeBadge && (\n <span className={`absolute top-3 left-3 text-[11px] font-semibold tracking-wide border px-2 py-0.5 rounded-md ${typeBadge.color}`}>\n {typeBadge.label}\n </span>\n )}\n </CardImage>\n\n <div className=\"p-3.5\">\n <h3 className=\"text-[14.5px] font-semibold text-foreground leading-snug tracking-tight truncate\">\n {product.name}\n </h3>\n\n {/* Event: date + venue */}\n {isTicket && (product.event_date || product.venue) && (\n <p className=\"text-[12px] text-muted-foreground mt-1 truncate\">\n {product.event_date && new Date(product.event_date).toLocaleDateString(undefined, { month: \"short\", day: \"numeric\" })}\n {product.event_date && product.venue && \" · \"}\n {product.venue}\n </p>\n )}\n\n {/* Non-event: description */}\n {!isTicket && product.description && (\n <p className=\"text-[12px] text-muted-foreground mt-1 line-clamp-1\">\n {stripHtmlToText(product.description)}\n </p>\n )}\n\n <div className=\"flex items-center justify-between mt-2.5\">\n <Price amount={product.default_price} currency={currency} className=\"text-sm font-bold\" />\n\n {/* File info pill */}\n {product.file_type && (\n <span className=\"text-[10px] text-muted-foreground bg-muted px-1.5 py-0.5 rounded\">\n {product.file_type.toUpperCase()}\n {product.file_size_mb != null && ` · ${product.file_size_mb >= 1024 ? `${(product.file_size_mb / 1024).toFixed(1)}GB` : `${product.file_size_mb}MB`}`}\n </span>\n )}\n </div>\n </div>\n </CardShell>\n );\n}\n"
14
+ "content": "\"use client\";\n\nimport React from \"react\";\nimport { stripHtmlToText } from \"@cimplify/sdk/react\";\nimport type { CardLayoutProps } from \"@cimplify/sdk/react\";\nimport { CardShell, CardImage } from \"@cimplify/sdk/react\";\nimport { Price } from \"@cimplify/sdk/react\";\nimport { getProductCurrency } from \"@cimplify/sdk\";\n\nconst TYPE_BADGES: Record<string, { label: string; color: string }> = {\n download: { label: \"Download\", color: \"bg-sky-50 text-sky-700 border-sky-200/60\" },\n license_key: { label: \"License\", color: \"bg-blue-50 text-blue-700 border-blue-200/60\" },\n ticket: { label: \"Event\", color: \"bg-violet-50 text-violet-700 border-violet-200/60\" },\n access_grant: { label: \"Access\", color: \"bg-emerald-50 text-emerald-700 border-emerald-200/60\" },\n redemption_code: { label: \"Code\", color: \"bg-amber-50 text-amber-700 border-amber-200/60\" },\n};\n\nexport function DigitalProductCard({\n product,\n renderImage,\n renderLink,\n className,\n}: CardLayoutProps): React.ReactElement {\n const image = product.image_url || product.images?.[0] || \"\";\n const currency = getProductCurrency(product);\n const typeBadge = product.digital_type ? TYPE_BADGES[product.digital_type] : null;\n const isTicket = product.digital_type === \"ticket\";\n\n return (\n <CardShell product={product} renderLink={renderLink} className={className}>\n <CardImage src={image} alt={product.name} aspectRatio=\"4/3\" renderImage={renderImage}>\n {typeBadge && (\n <span className={`absolute top-3 left-3 text-[11px] font-semibold tracking-wide border px-2 py-0.5 rounded-md ${typeBadge.color}`}>\n {typeBadge.label}\n </span>\n )}\n </CardImage>\n\n <div className=\"p-3.5\">\n <h3 className=\"text-[14.5px] font-semibold text-foreground leading-snug tracking-tight truncate\">\n {product.name}\n </h3>\n\n {/* Event: date + venue */}\n {isTicket && (product.event_date || product.venue) && (\n <p className=\"text-[12px] text-muted-foreground mt-1 truncate\">\n {product.event_date && new Date(product.event_date).toLocaleDateString(undefined, { month: \"short\", day: \"numeric\" })}\n {product.event_date && product.venue && \" · \"}\n {product.venue}\n </p>\n )}\n\n {/* Non-event: description */}\n {!isTicket && product.description && (\n <p className=\"text-[12px] text-muted-foreground mt-1 line-clamp-1\">\n {stripHtmlToText(product.description)}\n </p>\n )}\n\n <div className=\"flex items-center justify-between mt-2.5\">\n <Price amount={product.default_price} currency={currency} className=\"text-sm font-bold\" />\n\n {/* File info pill */}\n {product.file_type && (\n <span className=\"text-[10px] text-muted-foreground bg-muted px-1.5 py-0.5 rounded\">\n {product.file_type.toUpperCase()}\n {product.file_size_mb != null && ` · ${product.file_size_mb >= 1024 ? `${(product.file_size_mb / 1024).toFixed(1)}GB` : `${product.file_size_mb}MB`}`}\n </span>\n )}\n </div>\n </div>\n </CardShell>\n );\n}\n"
15
15
  }
16
16
  ]
17
17
  }