@cimplify/sdk 0.44.14 → 0.44.18

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 (85) hide show
  1. package/dist/advanced.d.mts +1 -1
  2. package/dist/advanced.d.ts +1 -1
  3. package/dist/advanced.js +22 -21
  4. package/dist/advanced.mjs +3 -2
  5. package/dist/{chunk-OMAP327U.js → chunk-3FS3ZDKX.js} +62 -61
  6. package/dist/chunk-53J2WE4S.js +657 -0
  7. package/dist/{chunk-3WD6U5RD.mjs → chunk-5OK3YDZC.mjs} +4 -3
  8. package/dist/{chunk-V2O5AO7I.js → chunk-BN2CXGMO.js} +5 -246
  9. package/dist/chunk-CCSONJCO.js +8824 -0
  10. package/dist/{chunk-BAWKQRIB.js → chunk-HBRCVJL4.js} +22 -21
  11. package/dist/chunk-MJBSVUHO.mjs +8822 -0
  12. package/dist/{chunk-6TVQQYQ5.mjs → chunk-NRT6PVW5.mjs} +4 -231
  13. package/dist/chunk-QBQCMQ4F.js +271 -0
  14. package/dist/chunk-VDH3O7UB.mjs +604 -0
  15. package/dist/chunk-XPXAZXF2.mjs +250 -0
  16. package/dist/{chunk-EZK2FXTM.mjs → chunk-XZPO5GEM.mjs} +2 -1
  17. package/dist/cli/commands/deploy.mjs +9 -1
  18. package/dist/client-B_Ei3ENB.d.mts +86 -0
  19. package/dist/client-Bep2FooI.d.ts +86 -0
  20. package/dist/{client-lvLvB1_K.d.ts → client-D6ZisKco.d.ts} +7 -0
  21. package/dist/{client-CkGlXZRd.d.mts → client-Dh-bHyhU.d.mts} +7 -0
  22. package/dist/index.d.mts +1 -1
  23. package/dist/index.d.ts +1 -1
  24. package/dist/index.js +145 -144
  25. package/dist/index.mjs +4 -3
  26. package/dist/mock/cli.mjs +2 -1
  27. package/dist/mock/library.js +2 -1
  28. package/dist/mock/library.mjs +2 -1
  29. package/dist/mock/msw.js +2 -1
  30. package/dist/mock/msw.mjs +2 -1
  31. package/dist/react.d.mts +1 -1
  32. package/dist/react.d.ts +1 -1
  33. package/dist/react.js +81 -80
  34. package/dist/react.mjs +4 -3
  35. package/dist/server-CWpUlLOQ.d.mts +1003 -0
  36. package/dist/server-CWpUlLOQ.d.ts +1003 -0
  37. package/dist/server.d.mts +2 -2
  38. package/dist/server.d.ts +2 -2
  39. package/dist/server.js +6 -5
  40. package/dist/server.mjs +4 -3
  41. package/dist/testing/msw.d.mts +17 -0
  42. package/dist/testing/msw.d.ts +17 -0
  43. package/dist/testing/msw.js +42 -0
  44. package/dist/testing/msw.mjs +40 -0
  45. package/dist/testing/suite.d.mts +85 -0
  46. package/dist/testing/suite.d.ts +85 -0
  47. package/dist/testing/suite.js +174 -0
  48. package/dist/testing/suite.mjs +170 -0
  49. package/dist/testing.d.mts +1885 -0
  50. package/dist/testing.d.ts +1885 -0
  51. package/dist/testing.js +261 -0
  52. package/dist/testing.mjs +51 -0
  53. package/dist/utils.js +29 -28
  54. package/dist/utils.mjs +2 -1
  55. package/package.json +28 -4
  56. package/templates/storefront-bakery/__tests__/brand.test.ts +4 -0
  57. package/templates/storefront-bakery/__tests__/cart-flow.test.ts +4 -0
  58. package/templates/storefront-bakery/__tests__/contract.test.ts +4 -0
  59. package/templates/storefront-bakery/package.json +11 -3
  60. package/templates/storefront-bakery/vitest.config.ts +9 -0
  61. package/templates/storefront-fashion/__tests__/brand.test.ts +4 -0
  62. package/templates/storefront-fashion/__tests__/cart-flow.test.ts +4 -0
  63. package/templates/storefront-fashion/__tests__/contract.test.ts +4 -0
  64. package/templates/storefront-fashion/package.json +11 -3
  65. package/templates/storefront-fashion/vitest.config.ts +9 -0
  66. package/templates/storefront-grocery/__tests__/brand.test.ts +4 -0
  67. package/templates/storefront-grocery/__tests__/cart-flow.test.ts +4 -0
  68. package/templates/storefront-grocery/__tests__/contract.test.ts +4 -0
  69. package/templates/storefront-grocery/package.json +11 -3
  70. package/templates/storefront-grocery/vitest.config.ts +9 -0
  71. package/templates/storefront-restaurant/__tests__/brand.test.ts +4 -0
  72. package/templates/storefront-restaurant/__tests__/cart-flow.test.ts +4 -0
  73. package/templates/storefront-restaurant/__tests__/contract.test.ts +4 -0
  74. package/templates/storefront-restaurant/package.json +11 -3
  75. package/templates/storefront-restaurant/vitest.config.ts +9 -0
  76. package/templates/storefront-retail/__tests__/brand.test.ts +4 -0
  77. package/templates/storefront-retail/__tests__/cart-flow.test.ts +4 -0
  78. package/templates/storefront-retail/__tests__/contract.test.ts +4 -0
  79. package/templates/storefront-retail/package.json +11 -3
  80. package/templates/storefront-retail/vitest.config.ts +9 -0
  81. package/templates/storefront-services/__tests__/brand.test.ts +4 -0
  82. package/templates/storefront-services/__tests__/cart-flow.test.ts +4 -0
  83. package/templates/storefront-services/__tests__/contract.test.ts +4 -0
  84. package/templates/storefront-services/package.json +11 -3
  85. package/templates/storefront-services/vitest.config.ts +9 -0
@@ -0,0 +1,261 @@
1
+ 'use strict';
2
+
3
+ var chunk53J2WE4S_js = require('./chunk-53J2WE4S.js');
4
+ require('./chunk-3FS3ZDKX.js');
5
+ require('./chunk-HBRCVJL4.js');
6
+ require('./chunk-BN2CXGMO.js');
7
+ require('./chunk-CCSONJCO.js');
8
+ require('./chunk-QBQCMQ4F.js');
9
+ var zod = require('zod');
10
+
11
+ var PUBLIC_SCHEMAS = {
12
+ Brand: chunk53J2WE4S_js.BrandSchema,
13
+ AddItemPayload: chunk53J2WE4S_js.AddItemPayloadSchema,
14
+ Cart: chunk53J2WE4S_js.CartSchema,
15
+ CartItem: chunk53J2WE4S_js.CartItemSchema,
16
+ CartPricing: chunk53J2WE4S_js.CartPricingSchema,
17
+ CheckoutBody: chunk53J2WE4S_js.CheckoutBodySchema,
18
+ CheckoutResponse: chunk53J2WE4S_js.CheckoutResponseSchema,
19
+ VariantInfo: chunk53J2WE4S_js.VariantInfoSchema
20
+ };
21
+ function exportJsonSchemas() {
22
+ const out = {};
23
+ for (const [name, schema] of Object.entries(PUBLIC_SCHEMAS)) {
24
+ const meta = chunk53J2WE4S_js.cimplifyRegistry.get(schema);
25
+ const json = zod.z.toJSONSchema(schema, { metadata: chunk53J2WE4S_js.cimplifyRegistry });
26
+ if (meta) {
27
+ json.$id = meta.id;
28
+ json["x-cimplify-version"] = meta.version;
29
+ }
30
+ out[name] = json;
31
+ }
32
+ return out;
33
+ }
34
+ function listRegisteredSchemas() {
35
+ const entries = [];
36
+ for (const schema of [
37
+ chunk53J2WE4S_js.BrandSchema,
38
+ chunk53J2WE4S_js.AddItemPayloadSchema,
39
+ chunk53J2WE4S_js.CartSchema,
40
+ chunk53J2WE4S_js.CartItemSchema,
41
+ chunk53J2WE4S_js.CartPricingSchema,
42
+ chunk53J2WE4S_js.CheckoutBodySchema,
43
+ chunk53J2WE4S_js.CheckoutResponseSchema,
44
+ chunk53J2WE4S_js.VariantInfoSchema
45
+ ]) {
46
+ const meta = chunk53J2WE4S_js.cimplifyRegistry.get(schema);
47
+ if (meta) entries.push({ schema, meta });
48
+ }
49
+ return entries;
50
+ }
51
+
52
+ Object.defineProperty(exports, "AddItemPayloadSchema", {
53
+ enumerable: true,
54
+ get: function () { return chunk53J2WE4S_js.AddItemPayloadSchema; }
55
+ });
56
+ Object.defineProperty(exports, "AddOnDetailsSchema", {
57
+ enumerable: true,
58
+ get: function () { return chunk53J2WE4S_js.AddOnDetailsSchema; }
59
+ });
60
+ Object.defineProperty(exports, "AuthorizationTypeSchema", {
61
+ enumerable: true,
62
+ get: function () { return chunk53J2WE4S_js.AuthorizationTypeSchema; }
63
+ });
64
+ Object.defineProperty(exports, "BrandContactSchema", {
65
+ enumerable: true,
66
+ get: function () { return chunk53J2WE4S_js.BrandContactSchema; }
67
+ });
68
+ Object.defineProperty(exports, "BrandFaqSchema", {
69
+ enumerable: true,
70
+ get: function () { return chunk53J2WE4S_js.BrandFaqSchema; }
71
+ });
72
+ Object.defineProperty(exports, "BrandHeroSchema", {
73
+ enumerable: true,
74
+ get: function () { return chunk53J2WE4S_js.BrandHeroSchema; }
75
+ });
76
+ Object.defineProperty(exports, "BrandNavLinkSchema", {
77
+ enumerable: true,
78
+ get: function () { return chunk53J2WE4S_js.BrandNavLinkSchema; }
79
+ });
80
+ Object.defineProperty(exports, "BrandPolicyPageSchema", {
81
+ enumerable: true,
82
+ get: function () { return chunk53J2WE4S_js.BrandPolicyPageSchema; }
83
+ });
84
+ Object.defineProperty(exports, "BrandPolicySectionSchema", {
85
+ enumerable: true,
86
+ get: function () { return chunk53J2WE4S_js.BrandPolicySectionSchema; }
87
+ });
88
+ Object.defineProperty(exports, "BrandSchema", {
89
+ enumerable: true,
90
+ get: function () { return chunk53J2WE4S_js.BrandSchema; }
91
+ });
92
+ Object.defineProperty(exports, "BrandSocialSchema", {
93
+ enumerable: true,
94
+ get: function () { return chunk53J2WE4S_js.BrandSocialSchema; }
95
+ });
96
+ Object.defineProperty(exports, "BundleResolvedSchema", {
97
+ enumerable: true,
98
+ get: function () { return chunk53J2WE4S_js.BundleResolvedSchema; }
99
+ });
100
+ Object.defineProperty(exports, "BundleSelectionInputSchema", {
101
+ enumerable: true,
102
+ get: function () { return chunk53J2WE4S_js.BundleSelectionInputSchema; }
103
+ });
104
+ Object.defineProperty(exports, "CartItemSchema", {
105
+ enumerable: true,
106
+ get: function () { return chunk53J2WE4S_js.CartItemSchema; }
107
+ });
108
+ Object.defineProperty(exports, "CartPricingSchema", {
109
+ enumerable: true,
110
+ get: function () { return chunk53J2WE4S_js.CartPricingSchema; }
111
+ });
112
+ Object.defineProperty(exports, "CartSchema", {
113
+ enumerable: true,
114
+ get: function () { return chunk53J2WE4S_js.CartSchema; }
115
+ });
116
+ Object.defineProperty(exports, "CheckoutBodySchema", {
117
+ enumerable: true,
118
+ get: function () { return chunk53J2WE4S_js.CheckoutBodySchema; }
119
+ });
120
+ Object.defineProperty(exports, "CheckoutCustomerSchema", {
121
+ enumerable: true,
122
+ get: function () { return chunk53J2WE4S_js.CheckoutCustomerSchema; }
123
+ });
124
+ Object.defineProperty(exports, "CheckoutResponseSchema", {
125
+ enumerable: true,
126
+ get: function () { return chunk53J2WE4S_js.CheckoutResponseSchema; }
127
+ });
128
+ Object.defineProperty(exports, "ChosenPriceSchema", {
129
+ enumerable: true,
130
+ get: function () { return chunk53J2WE4S_js.ChosenPriceSchema; }
131
+ });
132
+ Object.defineProperty(exports, "CompositeResolvedSchema", {
133
+ enumerable: true,
134
+ get: function () { return chunk53J2WE4S_js.CompositeResolvedSchema; }
135
+ });
136
+ Object.defineProperty(exports, "CompositeSelectionInputSchema", {
137
+ enumerable: true,
138
+ get: function () { return chunk53J2WE4S_js.CompositeSelectionInputSchema; }
139
+ });
140
+ Object.defineProperty(exports, "CountryCodeSchema", {
141
+ enumerable: true,
142
+ get: function () { return chunk53J2WE4S_js.CountryCodeSchema; }
143
+ });
144
+ Object.defineProperty(exports, "CurrencyCodeSchema", {
145
+ enumerable: true,
146
+ get: function () { return chunk53J2WE4S_js.CurrencyCodeSchema; }
147
+ });
148
+ Object.defineProperty(exports, "CustomerInputValueSchema", {
149
+ enumerable: true,
150
+ get: function () { return chunk53J2WE4S_js.CustomerInputValueSchema; }
151
+ });
152
+ Object.defineProperty(exports, "DiscountDetailsSchema", {
153
+ enumerable: true,
154
+ get: function () { return chunk53J2WE4S_js.DiscountDetailsSchema; }
155
+ });
156
+ Object.defineProperty(exports, "IsoDateTimeSchema", {
157
+ enumerable: true,
158
+ get: function () { return chunk53J2WE4S_js.IsoDateTimeSchema; }
159
+ });
160
+ Object.defineProperty(exports, "LineTypeSchema", {
161
+ enumerable: true,
162
+ get: function () { return chunk53J2WE4S_js.LineTypeSchema; }
163
+ });
164
+ Object.defineProperty(exports, "LocaleSchema", {
165
+ enumerable: true,
166
+ get: function () { return chunk53J2WE4S_js.LocaleSchema; }
167
+ });
168
+ Object.defineProperty(exports, "MoneyLooseSchema", {
169
+ enumerable: true,
170
+ get: function () { return chunk53J2WE4S_js.MoneyLooseSchema; }
171
+ });
172
+ Object.defineProperty(exports, "MoneySchema", {
173
+ enumerable: true,
174
+ get: function () { return chunk53J2WE4S_js.MoneySchema; }
175
+ });
176
+ Object.defineProperty(exports, "NextActionSchema", {
177
+ enumerable: true,
178
+ get: function () { return chunk53J2WE4S_js.NextActionSchema; }
179
+ });
180
+ Object.defineProperty(exports, "PhoneE164Schema", {
181
+ enumerable: true,
182
+ get: function () { return chunk53J2WE4S_js.PhoneE164Schema; }
183
+ });
184
+ Object.defineProperty(exports, "ProductTypeSchema", {
185
+ enumerable: true,
186
+ get: function () { return chunk53J2WE4S_js.ProductTypeSchema; }
187
+ });
188
+ Object.defineProperty(exports, "SchemaViolationError", {
189
+ enumerable: true,
190
+ get: function () { return chunk53J2WE4S_js.SchemaViolationError; }
191
+ });
192
+ Object.defineProperty(exports, "SeedNameSchema", {
193
+ enumerable: true,
194
+ get: function () { return chunk53J2WE4S_js.SeedNameSchema; }
195
+ });
196
+ Object.defineProperty(exports, "ServiceStatusSchema", {
197
+ enumerable: true,
198
+ get: function () { return chunk53J2WE4S_js.ServiceStatusSchema; }
199
+ });
200
+ Object.defineProperty(exports, "TimestampSchema", {
201
+ enumerable: true,
202
+ get: function () { return chunk53J2WE4S_js.TimestampSchema; }
203
+ });
204
+ Object.defineProperty(exports, "VariantDetailsSchema", {
205
+ enumerable: true,
206
+ get: function () { return chunk53J2WE4S_js.VariantDetailsSchema; }
207
+ });
208
+ Object.defineProperty(exports, "VariantDisplayAttributeSchema", {
209
+ enumerable: true,
210
+ get: function () { return chunk53J2WE4S_js.VariantDisplayAttributeSchema; }
211
+ });
212
+ Object.defineProperty(exports, "VariantInfoSchema", {
213
+ enumerable: true,
214
+ get: function () { return chunk53J2WE4S_js.VariantInfoSchema; }
215
+ });
216
+ Object.defineProperty(exports, "assertAddItemPayload", {
217
+ enumerable: true,
218
+ get: function () { return chunk53J2WE4S_js.assertAddItemPayload; }
219
+ });
220
+ Object.defineProperty(exports, "assertBrand", {
221
+ enumerable: true,
222
+ get: function () { return chunk53J2WE4S_js.assertBrand; }
223
+ });
224
+ Object.defineProperty(exports, "assertCart", {
225
+ enumerable: true,
226
+ get: function () { return chunk53J2WE4S_js.assertCart; }
227
+ });
228
+ Object.defineProperty(exports, "assertCartItem", {
229
+ enumerable: true,
230
+ get: function () { return chunk53J2WE4S_js.assertCartItem; }
231
+ });
232
+ Object.defineProperty(exports, "assertCheckoutBody", {
233
+ enumerable: true,
234
+ get: function () { return chunk53J2WE4S_js.assertCheckoutBody; }
235
+ });
236
+ Object.defineProperty(exports, "assertCheckoutResponse", {
237
+ enumerable: true,
238
+ get: function () { return chunk53J2WE4S_js.assertCheckoutResponse; }
239
+ });
240
+ Object.defineProperty(exports, "cimplifyRegistry", {
241
+ enumerable: true,
242
+ get: function () { return chunk53J2WE4S_js.cimplifyRegistry; }
243
+ });
244
+ Object.defineProperty(exports, "createTestClient", {
245
+ enumerable: true,
246
+ get: function () { return chunk53J2WE4S_js.createTestClient; }
247
+ });
248
+ Object.defineProperty(exports, "fixtures", {
249
+ enumerable: true,
250
+ get: function () { return chunk53J2WE4S_js.fixtures; }
251
+ });
252
+ Object.defineProperty(exports, "makeAssertion", {
253
+ enumerable: true,
254
+ get: function () { return chunk53J2WE4S_js.makeAssertion; }
255
+ });
256
+ Object.defineProperty(exports, "registerSchema", {
257
+ enumerable: true,
258
+ get: function () { return chunk53J2WE4S_js.registerSchema; }
259
+ });
260
+ exports.exportJsonSchemas = exportJsonSchemas;
261
+ exports.listRegisteredSchemas = listRegisteredSchemas;
@@ -0,0 +1,51 @@
1
+ import { VariantInfoSchema, CheckoutResponseSchema, CheckoutBodySchema, CartPricingSchema, CartItemSchema, CartSchema, AddItemPayloadSchema, BrandSchema, cimplifyRegistry } from './chunk-VDH3O7UB.mjs';
2
+ export { AddItemPayloadSchema, AddOnDetailsSchema, 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, ServiceStatusSchema, TimestampSchema, VariantDetailsSchema, VariantDisplayAttributeSchema, VariantInfoSchema, assertAddItemPayload, assertBrand, assertCart, assertCartItem, assertCheckoutBody, assertCheckoutResponse, cimplifyRegistry, createTestClient, fixtures, makeAssertion, registerSchema } from './chunk-VDH3O7UB.mjs';
3
+ import './chunk-5OK3YDZC.mjs';
4
+ import './chunk-XZPO5GEM.mjs';
5
+ import './chunk-NRT6PVW5.mjs';
6
+ import './chunk-MJBSVUHO.mjs';
7
+ import './chunk-XPXAZXF2.mjs';
8
+ import { z } from 'zod';
9
+
10
+ var PUBLIC_SCHEMAS = {
11
+ Brand: BrandSchema,
12
+ AddItemPayload: AddItemPayloadSchema,
13
+ Cart: CartSchema,
14
+ CartItem: CartItemSchema,
15
+ CartPricing: CartPricingSchema,
16
+ CheckoutBody: CheckoutBodySchema,
17
+ CheckoutResponse: CheckoutResponseSchema,
18
+ VariantInfo: VariantInfoSchema
19
+ };
20
+ function exportJsonSchemas() {
21
+ const out = {};
22
+ for (const [name, schema] of Object.entries(PUBLIC_SCHEMAS)) {
23
+ const meta = cimplifyRegistry.get(schema);
24
+ const json = z.toJSONSchema(schema, { metadata: cimplifyRegistry });
25
+ if (meta) {
26
+ json.$id = meta.id;
27
+ json["x-cimplify-version"] = meta.version;
28
+ }
29
+ out[name] = json;
30
+ }
31
+ return out;
32
+ }
33
+ function listRegisteredSchemas() {
34
+ const entries = [];
35
+ for (const schema of [
36
+ BrandSchema,
37
+ AddItemPayloadSchema,
38
+ CartSchema,
39
+ CartItemSchema,
40
+ CartPricingSchema,
41
+ CheckoutBodySchema,
42
+ CheckoutResponseSchema,
43
+ VariantInfoSchema
44
+ ]) {
45
+ const meta = cimplifyRegistry.get(schema);
46
+ if (meta) entries.push({ schema, meta });
47
+ }
48
+ return entries;
49
+ }
50
+
51
+ export { exportJsonSchemas, listRegisteredSchemas };
package/dist/utils.js CHANGED
@@ -1,7 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkL5GKVQVJ_js = require('./chunk-L5GKVQVJ.js');
4
- var chunkV2O5AO7I_js = require('./chunk-V2O5AO7I.js');
4
+ var chunkBN2CXGMO_js = require('./chunk-BN2CXGMO.js');
5
+ require('./chunk-QBQCMQ4F.js');
5
6
 
6
7
 
7
8
 
@@ -19,109 +20,109 @@ Object.defineProperty(exports, "resolvePhoneCountryCode", {
19
20
  });
20
21
  Object.defineProperty(exports, "CURRENCY_SYMBOLS", {
21
22
  enumerable: true,
22
- get: function () { return chunkV2O5AO7I_js.CURRENCY_SYMBOLS; }
23
+ get: function () { return chunkBN2CXGMO_js.CURRENCY_SYMBOLS; }
23
24
  });
24
25
  Object.defineProperty(exports, "MOBILE_MONEY_PROVIDERS", {
25
26
  enumerable: true,
26
- get: function () { return chunkV2O5AO7I_js.MOBILE_MONEY_PROVIDERS; }
27
+ get: function () { return chunkBN2CXGMO_js.MOBILE_MONEY_PROVIDERS; }
27
28
  });
28
29
  Object.defineProperty(exports, "categorizePaymentError", {
29
30
  enumerable: true,
30
- get: function () { return chunkV2O5AO7I_js.categorizePaymentError; }
31
+ get: function () { return chunkBN2CXGMO_js.categorizePaymentError; }
31
32
  });
32
33
  Object.defineProperty(exports, "detectMobileMoneyProvider", {
33
34
  enumerable: true,
34
- get: function () { return chunkV2O5AO7I_js.detectMobileMoneyProvider; }
35
+ get: function () { return chunkBN2CXGMO_js.detectMobileMoneyProvider; }
35
36
  });
36
37
  Object.defineProperty(exports, "formatMoney", {
37
38
  enumerable: true,
38
- get: function () { return chunkV2O5AO7I_js.formatMoney; }
39
+ get: function () { return chunkBN2CXGMO_js.formatMoney; }
39
40
  });
40
41
  Object.defineProperty(exports, "formatNumberCompact", {
41
42
  enumerable: true,
42
- get: function () { return chunkV2O5AO7I_js.formatNumberCompact; }
43
+ get: function () { return chunkBN2CXGMO_js.formatNumberCompact; }
43
44
  });
44
45
  Object.defineProperty(exports, "formatPrice", {
45
46
  enumerable: true,
46
- get: function () { return chunkV2O5AO7I_js.formatPrice; }
47
+ get: function () { return chunkBN2CXGMO_js.formatPrice; }
47
48
  });
48
49
  Object.defineProperty(exports, "formatPriceAdjustment", {
49
50
  enumerable: true,
50
- get: function () { return chunkV2O5AO7I_js.formatPriceAdjustment; }
51
+ get: function () { return chunkBN2CXGMO_js.formatPriceAdjustment; }
51
52
  });
52
53
  Object.defineProperty(exports, "formatPriceCompact", {
53
54
  enumerable: true,
54
- get: function () { return chunkV2O5AO7I_js.formatPriceCompact; }
55
+ get: function () { return chunkBN2CXGMO_js.formatPriceCompact; }
55
56
  });
56
57
  Object.defineProperty(exports, "formatPriceWithTax", {
57
58
  enumerable: true,
58
- get: function () { return chunkV2O5AO7I_js.formatPriceWithTax; }
59
+ get: function () { return chunkBN2CXGMO_js.formatPriceWithTax; }
59
60
  });
60
61
  Object.defineProperty(exports, "formatProductPrice", {
61
62
  enumerable: true,
62
- get: function () { return chunkV2O5AO7I_js.formatProductPrice; }
63
+ get: function () { return chunkBN2CXGMO_js.formatProductPrice; }
63
64
  });
64
65
  Object.defineProperty(exports, "getBasePrice", {
65
66
  enumerable: true,
66
- get: function () { return chunkV2O5AO7I_js.getBasePrice; }
67
+ get: function () { return chunkBN2CXGMO_js.getBasePrice; }
67
68
  });
68
69
  Object.defineProperty(exports, "getCurrencySymbol", {
69
70
  enumerable: true,
70
- get: function () { return chunkV2O5AO7I_js.getCurrencySymbol; }
71
+ get: function () { return chunkBN2CXGMO_js.getCurrencySymbol; }
71
72
  });
72
73
  Object.defineProperty(exports, "getDiscountPercentage", {
73
74
  enumerable: true,
74
- get: function () { return chunkV2O5AO7I_js.getDiscountPercentage; }
75
+ get: function () { return chunkBN2CXGMO_js.getDiscountPercentage; }
75
76
  });
76
77
  Object.defineProperty(exports, "getDisplayPrice", {
77
78
  enumerable: true,
78
- get: function () { return chunkV2O5AO7I_js.getDisplayPrice; }
79
+ get: function () { return chunkBN2CXGMO_js.getDisplayPrice; }
79
80
  });
80
81
  Object.defineProperty(exports, "getMarkupPercentage", {
81
82
  enumerable: true,
82
- get: function () { return chunkV2O5AO7I_js.getMarkupPercentage; }
83
+ get: function () { return chunkBN2CXGMO_js.getMarkupPercentage; }
83
84
  });
84
85
  Object.defineProperty(exports, "getProductCurrency", {
85
86
  enumerable: true,
86
- get: function () { return chunkV2O5AO7I_js.getProductCurrency; }
87
+ get: function () { return chunkBN2CXGMO_js.getProductCurrency; }
87
88
  });
88
89
  Object.defineProperty(exports, "getTaxAmount", {
89
90
  enumerable: true,
90
- get: function () { return chunkV2O5AO7I_js.getTaxAmount; }
91
+ get: function () { return chunkBN2CXGMO_js.getTaxAmount; }
91
92
  });
92
93
  Object.defineProperty(exports, "hasTaxInfo", {
93
94
  enumerable: true,
94
- get: function () { return chunkV2O5AO7I_js.hasTaxInfo; }
95
+ get: function () { return chunkBN2CXGMO_js.hasTaxInfo; }
95
96
  });
96
97
  Object.defineProperty(exports, "isOnSale", {
97
98
  enumerable: true,
98
- get: function () { return chunkV2O5AO7I_js.isOnSale; }
99
+ get: function () { return chunkBN2CXGMO_js.isOnSale; }
99
100
  });
100
101
  Object.defineProperty(exports, "isPaymentStatusFailure", {
101
102
  enumerable: true,
102
- get: function () { return chunkV2O5AO7I_js.isPaymentStatusFailure; }
103
+ get: function () { return chunkBN2CXGMO_js.isPaymentStatusFailure; }
103
104
  });
104
105
  Object.defineProperty(exports, "isPaymentStatusRequiresAction", {
105
106
  enumerable: true,
106
- get: function () { return chunkV2O5AO7I_js.isPaymentStatusRequiresAction; }
107
+ get: function () { return chunkBN2CXGMO_js.isPaymentStatusRequiresAction; }
107
108
  });
108
109
  Object.defineProperty(exports, "isPaymentStatusSuccess", {
109
110
  enumerable: true,
110
- get: function () { return chunkV2O5AO7I_js.isPaymentStatusSuccess; }
111
+ get: function () { return chunkBN2CXGMO_js.isPaymentStatusSuccess; }
111
112
  });
112
113
  Object.defineProperty(exports, "isTaxInclusive", {
113
114
  enumerable: true,
114
- get: function () { return chunkV2O5AO7I_js.isTaxInclusive; }
115
+ get: function () { return chunkBN2CXGMO_js.isTaxInclusive; }
115
116
  });
116
117
  Object.defineProperty(exports, "normalizePaymentResponse", {
117
118
  enumerable: true,
118
- get: function () { return chunkV2O5AO7I_js.normalizePaymentResponse; }
119
+ get: function () { return chunkBN2CXGMO_js.normalizePaymentResponse; }
119
120
  });
120
121
  Object.defineProperty(exports, "normalizeStatusResponse", {
121
122
  enumerable: true,
122
- get: function () { return chunkV2O5AO7I_js.normalizeStatusResponse; }
123
+ get: function () { return chunkBN2CXGMO_js.normalizeStatusResponse; }
123
124
  });
124
125
  Object.defineProperty(exports, "parsePrice", {
125
126
  enumerable: true,
126
- get: function () { return chunkV2O5AO7I_js.parsePrice; }
127
+ get: function () { return chunkBN2CXGMO_js.parsePrice; }
127
128
  });
package/dist/utils.mjs CHANGED
@@ -1,2 +1,3 @@
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-6TVQQYQ5.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-NRT6PVW5.mjs';
3
+ import './chunk-XPXAZXF2.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cimplify/sdk",
3
- "version": "0.44.14",
3
+ "version": "0.44.18",
4
4
  "description": "Cimplify Commerce SDK for storefronts",
5
5
  "keywords": [
6
6
  "cimplify",
@@ -61,6 +61,21 @@
61
61
  "import": "./dist/mock/msw.mjs",
62
62
  "require": "./dist/mock/msw.js"
63
63
  },
64
+ "./testing": {
65
+ "types": "./dist/testing.d.ts",
66
+ "import": "./dist/testing.mjs",
67
+ "require": "./dist/testing.js"
68
+ },
69
+ "./testing/suite": {
70
+ "types": "./dist/testing/suite.d.ts",
71
+ "import": "./dist/testing/suite.mjs",
72
+ "require": "./dist/testing/suite.js"
73
+ },
74
+ "./testing/msw": {
75
+ "types": "./dist/testing/msw.d.ts",
76
+ "import": "./dist/testing/msw.mjs",
77
+ "require": "./dist/testing/msw.js"
78
+ },
64
79
  "./styles.css": "./dist/styles.css"
65
80
  },
66
81
  "scripts": {
@@ -76,12 +91,17 @@
76
91
  "format:check": "oxfmt . --check",
77
92
  "test": "vitest",
78
93
  "test:run": "vitest run",
79
- "test:coverage": "vitest run --coverage"
94
+ "test:coverage": "vitest run --coverage",
95
+ "contracts:emit": "bun scripts/emit-contracts.ts",
96
+ "contracts:diff": "bun scripts/diff-contracts.ts",
97
+ "contracts:smoke": "bun scripts/diff-contracts.ts --smoke",
98
+ "contracts": "bun run contracts:emit && bun run contracts:diff"
80
99
  },
81
100
  "peerDependencies": {
82
101
  "@paystack/inline-js": "^2.22.8",
83
102
  "react": ">=17.0.0",
84
- "msw": ">=2.0.0"
103
+ "msw": ">=2.0.0",
104
+ "vitest": ">=2.0.0"
85
105
  },
86
106
  "peerDependenciesMeta": {
87
107
  "@paystack/inline-js": {
@@ -92,6 +112,9 @@
92
112
  },
93
113
  "msw": {
94
114
  "optional": true
115
+ },
116
+ "vitest": {
117
+ "optional": true
95
118
  }
96
119
  },
97
120
  "devDependencies": {
@@ -116,6 +139,7 @@
116
139
  "@base-ui/react": "^1.4.1",
117
140
  "clsx": "^2.1.1",
118
141
  "libphonenumber-js": "1.12.41",
119
- "tailwind-merge": "^3.5.0"
142
+ "tailwind-merge": "^3.5.0",
143
+ "zod": "^4.4.3"
120
144
  }
121
145
  }
@@ -0,0 +1,4 @@
1
+ import { createBrandSuite } from "@cimplify/sdk/testing/suite";
2
+ import { brand } from "../lib/brand";
3
+
4
+ createBrandSuite({ brand });
@@ -0,0 +1,4 @@
1
+ import { createCartFlowSuite } from "@cimplify/sdk/testing/suite";
2
+ import { brand } from "../lib/brand";
3
+
4
+ createCartFlowSuite({ seed: brand.mock.seed, businessId: brand.mock.businessId });
@@ -0,0 +1,4 @@
1
+ import { createContractSuite } from "@cimplify/sdk/testing/suite";
2
+ import { brand } from "../lib/brand";
3
+
4
+ createContractSuite({ seed: brand.mock.seed });
@@ -8,10 +8,17 @@
8
8
  "dev:mock": "bunx @cimplify/sdk --seed default",
9
9
  "build": "next build",
10
10
  "start": "next start",
11
- "lint": "next lint"
11
+ "lint": "next lint",
12
+ "typecheck": "tsc --noEmit",
13
+ "test": "vitest",
14
+ "test:run": "vitest run",
15
+ "check:brand": "vitest run __tests__/brand.test.ts",
16
+ "check:cart": "vitest run __tests__/cart-flow.test.ts",
17
+ "check:contract": "vitest run __tests__/contract.test.ts",
18
+ "check": "bun run typecheck && bun run lint && bun run test:run"
12
19
  },
13
20
  "dependencies": {
14
- "@cimplify/sdk": "^0.44.4",
21
+ "@cimplify/sdk": "^0.44.14",
15
22
  "next": "^16.2.4",
16
23
  "react": "^19.0.0",
17
24
  "react-dom": "^19.0.0"
@@ -23,6 +30,7 @@
23
30
  "@types/react-dom": "^19.0.0",
24
31
  "concurrently": "^9.0.0",
25
32
  "tailwindcss": "^4.2.4",
26
- "typescript": "^5.9.3"
33
+ "typescript": "^5.9.3",
34
+ "vitest": "^4.1.5"
27
35
  }
28
36
  }
@@ -0,0 +1,9 @@
1
+ import { defineConfig } from "vitest/config";
2
+
3
+ export default defineConfig({
4
+ test: {
5
+ environment: "node",
6
+ include: ["__tests__/**/*.test.ts"],
7
+ globals: false,
8
+ },
9
+ });
@@ -0,0 +1,4 @@
1
+ import { createBrandSuite } from "@cimplify/sdk/testing/suite";
2
+ import { brand } from "../lib/brand";
3
+
4
+ createBrandSuite({ brand });
@@ -0,0 +1,4 @@
1
+ import { createCartFlowSuite } from "@cimplify/sdk/testing/suite";
2
+ import { brand } from "../lib/brand";
3
+
4
+ createCartFlowSuite({ seed: brand.mock.seed, businessId: brand.mock.businessId });
@@ -0,0 +1,4 @@
1
+ import { createContractSuite } from "@cimplify/sdk/testing/suite";
2
+ import { brand } from "../lib/brand";
3
+
4
+ createContractSuite({ seed: brand.mock.seed });
@@ -8,10 +8,17 @@
8
8
  "dev:mock": "bunx @cimplify/sdk --seed fashion",
9
9
  "build": "next build",
10
10
  "start": "next start",
11
- "lint": "next lint"
11
+ "lint": "next lint",
12
+ "typecheck": "tsc --noEmit",
13
+ "test": "vitest",
14
+ "test:run": "vitest run",
15
+ "check:brand": "vitest run __tests__/brand.test.ts",
16
+ "check:cart": "vitest run __tests__/cart-flow.test.ts",
17
+ "check:contract": "vitest run __tests__/contract.test.ts",
18
+ "check": "bun run typecheck && bun run lint && bun run test:run"
12
19
  },
13
20
  "dependencies": {
14
- "@cimplify/sdk": "^0.44.4",
21
+ "@cimplify/sdk": "^0.44.14",
15
22
  "next": "^16.2.4",
16
23
  "react": "^19.0.0",
17
24
  "react-dom": "^19.0.0"
@@ -23,6 +30,7 @@
23
30
  "@types/react-dom": "^19.0.0",
24
31
  "concurrently": "^9.0.0",
25
32
  "tailwindcss": "^4.2.4",
26
- "typescript": "^5.9.3"
33
+ "typescript": "^5.9.3",
34
+ "vitest": "^4.1.5"
27
35
  }
28
36
  }
@@ -0,0 +1,9 @@
1
+ import { defineConfig } from "vitest/config";
2
+
3
+ export default defineConfig({
4
+ test: {
5
+ environment: "node",
6
+ include: ["__tests__/**/*.test.ts"],
7
+ globals: false,
8
+ },
9
+ });
@@ -0,0 +1,4 @@
1
+ import { createBrandSuite } from "@cimplify/sdk/testing/suite";
2
+ import { brand } from "../lib/brand";
3
+
4
+ createBrandSuite({ brand });
@@ -0,0 +1,4 @@
1
+ import { createCartFlowSuite } from "@cimplify/sdk/testing/suite";
2
+ import { brand } from "../lib/brand";
3
+
4
+ createCartFlowSuite({ seed: brand.mock.seed, businessId: brand.mock.businessId });
@@ -0,0 +1,4 @@
1
+ import { createContractSuite } from "@cimplify/sdk/testing/suite";
2
+ import { brand } from "../lib/brand";
3
+
4
+ createContractSuite({ seed: brand.mock.seed });