@cimplify/sdk 0.44.16 → 0.44.19
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.
- package/dist/advanced.js +22 -21
- package/dist/advanced.mjs +3 -2
- package/dist/{chunk-MBGQP6FZ.js → chunk-3FS3ZDKX.js} +60 -60
- package/dist/{chunk-UXLQ7WXI.mjs → chunk-5OK3YDZC.mjs} +2 -2
- package/dist/{chunk-MNIKXG7W.js → chunk-BN2CXGMO.js} +5 -272
- package/dist/chunk-GLOO4HUN.mjs +676 -0
- package/dist/{chunk-CFD4J32N.js → chunk-HBRCVJL4.js} +22 -21
- package/dist/{chunk-ZLEFMQC6.mjs → chunk-KSKZAXG2.mjs} +4 -498
- package/dist/{chunk-6AZZ6AOF.mjs → chunk-NRT6PVW5.mjs} +4 -251
- package/dist/{chunk-XL4CX75J.js → chunk-PGSM3NQ2.js} +237 -781
- package/dist/chunk-Q4I7JRGO.js +733 -0
- package/dist/chunk-QBQCMQ4F.js +271 -0
- package/dist/chunk-XPXAZXF2.mjs +250 -0
- package/dist/{chunk-7NML226B.mjs → chunk-XZPO5GEM.mjs} +2 -1
- package/dist/client-B_Ei3ENB.d.mts +86 -0
- package/dist/client-Bep2FooI.d.ts +86 -0
- package/dist/index.js +145 -144
- package/dist/index.mjs +4 -3
- package/dist/mock/cli.mjs +2 -0
- package/dist/mock/library.js +2 -0
- package/dist/mock/library.mjs +2 -0
- package/dist/mock/msw.js +2 -0
- package/dist/mock/msw.mjs +2 -0
- package/dist/react.js +81 -80
- package/dist/react.mjs +4 -3
- package/dist/server.js +6 -5
- package/dist/server.mjs +4 -3
- package/dist/testing/msw.d.mts +17 -0
- package/dist/testing/msw.d.ts +17 -0
- package/dist/testing/msw.js +42 -0
- package/dist/testing/msw.mjs +40 -0
- package/dist/testing/suite.d.mts +25 -0
- package/dist/testing/suite.d.ts +25 -0
- package/dist/testing/suite.js +28 -23
- package/dist/testing/suite.mjs +9 -4
- package/dist/testing.d.mts +963 -135
- package/dist/testing.d.ts +963 -135
- package/dist/testing.js +123 -59
- package/dist/testing.mjs +51 -4
- package/dist/utils.js +29 -28
- package/dist/utils.mjs +2 -1
- package/package.json +11 -2
package/dist/testing.js
CHANGED
|
@@ -1,213 +1,277 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
7
|
-
|
|
3
|
+
var chunkQ4I7JRGO_js = require('./chunk-Q4I7JRGO.js');
|
|
4
|
+
require('./chunk-3FS3ZDKX.js');
|
|
5
|
+
require('./chunk-HBRCVJL4.js');
|
|
6
|
+
require('./chunk-BN2CXGMO.js');
|
|
7
|
+
require('./chunk-PGSM3NQ2.js');
|
|
8
|
+
require('./chunk-QBQCMQ4F.js');
|
|
9
|
+
var zod = require('zod');
|
|
8
10
|
|
|
11
|
+
var PUBLIC_SCHEMAS = {
|
|
12
|
+
Brand: chunkQ4I7JRGO_js.BrandSchema,
|
|
13
|
+
AddItemPayload: chunkQ4I7JRGO_js.AddItemPayloadSchema,
|
|
14
|
+
Cart: chunkQ4I7JRGO_js.CartSchema,
|
|
15
|
+
CartItem: chunkQ4I7JRGO_js.CartItemSchema,
|
|
16
|
+
CartPricing: chunkQ4I7JRGO_js.CartPricingSchema,
|
|
17
|
+
CheckoutBody: chunkQ4I7JRGO_js.CheckoutBodySchema,
|
|
18
|
+
CheckoutResponse: chunkQ4I7JRGO_js.CheckoutResponseSchema,
|
|
19
|
+
VariantInfo: chunkQ4I7JRGO_js.VariantInfoSchema
|
|
20
|
+
};
|
|
21
|
+
function exportJsonSchemas() {
|
|
22
|
+
const out = {};
|
|
23
|
+
for (const [name, schema] of Object.entries(PUBLIC_SCHEMAS)) {
|
|
24
|
+
const meta = chunkQ4I7JRGO_js.cimplifyRegistry.get(schema);
|
|
25
|
+
const json = zod.z.toJSONSchema(schema, { metadata: chunkQ4I7JRGO_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
|
+
chunkQ4I7JRGO_js.BrandSchema,
|
|
38
|
+
chunkQ4I7JRGO_js.AddItemPayloadSchema,
|
|
39
|
+
chunkQ4I7JRGO_js.CartSchema,
|
|
40
|
+
chunkQ4I7JRGO_js.CartItemSchema,
|
|
41
|
+
chunkQ4I7JRGO_js.CartPricingSchema,
|
|
42
|
+
chunkQ4I7JRGO_js.CheckoutBodySchema,
|
|
43
|
+
chunkQ4I7JRGO_js.CheckoutResponseSchema,
|
|
44
|
+
chunkQ4I7JRGO_js.VariantInfoSchema
|
|
45
|
+
]) {
|
|
46
|
+
const meta = chunkQ4I7JRGO_js.cimplifyRegistry.get(schema);
|
|
47
|
+
if (meta) entries.push({ schema, meta });
|
|
48
|
+
}
|
|
49
|
+
return entries;
|
|
50
|
+
}
|
|
9
51
|
|
|
10
52
|
Object.defineProperty(exports, "AddItemPayloadSchema", {
|
|
11
53
|
enumerable: true,
|
|
12
|
-
get: function () { return
|
|
54
|
+
get: function () { return chunkQ4I7JRGO_js.AddItemPayloadSchema; }
|
|
13
55
|
});
|
|
14
56
|
Object.defineProperty(exports, "AddOnDetailsSchema", {
|
|
15
57
|
enumerable: true,
|
|
16
|
-
get: function () { return
|
|
58
|
+
get: function () { return chunkQ4I7JRGO_js.AddOnDetailsSchema; }
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(exports, "AddOnGroupDetailsSchema", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () { return chunkQ4I7JRGO_js.AddOnGroupDetailsSchema; }
|
|
63
|
+
});
|
|
64
|
+
Object.defineProperty(exports, "AddOnInDetailsSchema", {
|
|
65
|
+
enumerable: true,
|
|
66
|
+
get: function () { return chunkQ4I7JRGO_js.AddOnInDetailsSchema; }
|
|
67
|
+
});
|
|
68
|
+
Object.defineProperty(exports, "AddOnOptionDetailsSchema", {
|
|
69
|
+
enumerable: true,
|
|
70
|
+
get: function () { return chunkQ4I7JRGO_js.AddOnOptionDetailsSchema; }
|
|
17
71
|
});
|
|
18
72
|
Object.defineProperty(exports, "AuthorizationTypeSchema", {
|
|
19
73
|
enumerable: true,
|
|
20
|
-
get: function () { return
|
|
74
|
+
get: function () { return chunkQ4I7JRGO_js.AuthorizationTypeSchema; }
|
|
21
75
|
});
|
|
22
76
|
Object.defineProperty(exports, "BrandContactSchema", {
|
|
23
77
|
enumerable: true,
|
|
24
|
-
get: function () { return
|
|
78
|
+
get: function () { return chunkQ4I7JRGO_js.BrandContactSchema; }
|
|
25
79
|
});
|
|
26
80
|
Object.defineProperty(exports, "BrandFaqSchema", {
|
|
27
81
|
enumerable: true,
|
|
28
|
-
get: function () { return
|
|
82
|
+
get: function () { return chunkQ4I7JRGO_js.BrandFaqSchema; }
|
|
29
83
|
});
|
|
30
84
|
Object.defineProperty(exports, "BrandHeroSchema", {
|
|
31
85
|
enumerable: true,
|
|
32
|
-
get: function () { return
|
|
86
|
+
get: function () { return chunkQ4I7JRGO_js.BrandHeroSchema; }
|
|
33
87
|
});
|
|
34
88
|
Object.defineProperty(exports, "BrandNavLinkSchema", {
|
|
35
89
|
enumerable: true,
|
|
36
|
-
get: function () { return
|
|
90
|
+
get: function () { return chunkQ4I7JRGO_js.BrandNavLinkSchema; }
|
|
37
91
|
});
|
|
38
92
|
Object.defineProperty(exports, "BrandPolicyPageSchema", {
|
|
39
93
|
enumerable: true,
|
|
40
|
-
get: function () { return
|
|
94
|
+
get: function () { return chunkQ4I7JRGO_js.BrandPolicyPageSchema; }
|
|
41
95
|
});
|
|
42
96
|
Object.defineProperty(exports, "BrandPolicySectionSchema", {
|
|
43
97
|
enumerable: true,
|
|
44
|
-
get: function () { return
|
|
98
|
+
get: function () { return chunkQ4I7JRGO_js.BrandPolicySectionSchema; }
|
|
45
99
|
});
|
|
46
100
|
Object.defineProperty(exports, "BrandSchema", {
|
|
47
101
|
enumerable: true,
|
|
48
|
-
get: function () { return
|
|
102
|
+
get: function () { return chunkQ4I7JRGO_js.BrandSchema; }
|
|
49
103
|
});
|
|
50
104
|
Object.defineProperty(exports, "BrandSocialSchema", {
|
|
51
105
|
enumerable: true,
|
|
52
|
-
get: function () { return
|
|
106
|
+
get: function () { return chunkQ4I7JRGO_js.BrandSocialSchema; }
|
|
53
107
|
});
|
|
54
108
|
Object.defineProperty(exports, "BundleResolvedSchema", {
|
|
55
109
|
enumerable: true,
|
|
56
|
-
get: function () { return
|
|
110
|
+
get: function () { return chunkQ4I7JRGO_js.BundleResolvedSchema; }
|
|
57
111
|
});
|
|
58
112
|
Object.defineProperty(exports, "BundleSelectionInputSchema", {
|
|
59
113
|
enumerable: true,
|
|
60
|
-
get: function () { return
|
|
114
|
+
get: function () { return chunkQ4I7JRGO_js.BundleSelectionInputSchema; }
|
|
61
115
|
});
|
|
62
116
|
Object.defineProperty(exports, "CartItemSchema", {
|
|
63
117
|
enumerable: true,
|
|
64
|
-
get: function () { return
|
|
118
|
+
get: function () { return chunkQ4I7JRGO_js.CartItemSchema; }
|
|
65
119
|
});
|
|
66
120
|
Object.defineProperty(exports, "CartPricingSchema", {
|
|
67
121
|
enumerable: true,
|
|
68
|
-
get: function () { return
|
|
122
|
+
get: function () { return chunkQ4I7JRGO_js.CartPricingSchema; }
|
|
69
123
|
});
|
|
70
124
|
Object.defineProperty(exports, "CartSchema", {
|
|
71
125
|
enumerable: true,
|
|
72
|
-
get: function () { return
|
|
126
|
+
get: function () { return chunkQ4I7JRGO_js.CartSchema; }
|
|
73
127
|
});
|
|
74
128
|
Object.defineProperty(exports, "CheckoutBodySchema", {
|
|
75
129
|
enumerable: true,
|
|
76
|
-
get: function () { return
|
|
130
|
+
get: function () { return chunkQ4I7JRGO_js.CheckoutBodySchema; }
|
|
77
131
|
});
|
|
78
132
|
Object.defineProperty(exports, "CheckoutCustomerSchema", {
|
|
79
133
|
enumerable: true,
|
|
80
|
-
get: function () { return
|
|
134
|
+
get: function () { return chunkQ4I7JRGO_js.CheckoutCustomerSchema; }
|
|
81
135
|
});
|
|
82
136
|
Object.defineProperty(exports, "CheckoutResponseSchema", {
|
|
83
137
|
enumerable: true,
|
|
84
|
-
get: function () { return
|
|
138
|
+
get: function () { return chunkQ4I7JRGO_js.CheckoutResponseSchema; }
|
|
85
139
|
});
|
|
86
140
|
Object.defineProperty(exports, "ChosenPriceSchema", {
|
|
87
141
|
enumerable: true,
|
|
88
|
-
get: function () { return
|
|
142
|
+
get: function () { return chunkQ4I7JRGO_js.ChosenPriceSchema; }
|
|
89
143
|
});
|
|
90
144
|
Object.defineProperty(exports, "CompositeResolvedSchema", {
|
|
91
145
|
enumerable: true,
|
|
92
|
-
get: function () { return
|
|
146
|
+
get: function () { return chunkQ4I7JRGO_js.CompositeResolvedSchema; }
|
|
93
147
|
});
|
|
94
148
|
Object.defineProperty(exports, "CompositeSelectionInputSchema", {
|
|
95
149
|
enumerable: true,
|
|
96
|
-
get: function () { return
|
|
150
|
+
get: function () { return chunkQ4I7JRGO_js.CompositeSelectionInputSchema; }
|
|
97
151
|
});
|
|
98
152
|
Object.defineProperty(exports, "CountryCodeSchema", {
|
|
99
153
|
enumerable: true,
|
|
100
|
-
get: function () { return
|
|
154
|
+
get: function () { return chunkQ4I7JRGO_js.CountryCodeSchema; }
|
|
101
155
|
});
|
|
102
156
|
Object.defineProperty(exports, "CurrencyCodeSchema", {
|
|
103
157
|
enumerable: true,
|
|
104
|
-
get: function () { return
|
|
158
|
+
get: function () { return chunkQ4I7JRGO_js.CurrencyCodeSchema; }
|
|
105
159
|
});
|
|
106
160
|
Object.defineProperty(exports, "CustomerInputValueSchema", {
|
|
107
161
|
enumerable: true,
|
|
108
|
-
get: function () { return
|
|
162
|
+
get: function () { return chunkQ4I7JRGO_js.CustomerInputValueSchema; }
|
|
109
163
|
});
|
|
110
164
|
Object.defineProperty(exports, "DiscountDetailsSchema", {
|
|
111
165
|
enumerable: true,
|
|
112
|
-
get: function () { return
|
|
166
|
+
get: function () { return chunkQ4I7JRGO_js.DiscountDetailsSchema; }
|
|
113
167
|
});
|
|
114
168
|
Object.defineProperty(exports, "IsoDateTimeSchema", {
|
|
115
169
|
enumerable: true,
|
|
116
|
-
get: function () { return
|
|
170
|
+
get: function () { return chunkQ4I7JRGO_js.IsoDateTimeSchema; }
|
|
117
171
|
});
|
|
118
172
|
Object.defineProperty(exports, "LineTypeSchema", {
|
|
119
173
|
enumerable: true,
|
|
120
|
-
get: function () { return
|
|
174
|
+
get: function () { return chunkQ4I7JRGO_js.LineTypeSchema; }
|
|
121
175
|
});
|
|
122
176
|
Object.defineProperty(exports, "LocaleSchema", {
|
|
123
177
|
enumerable: true,
|
|
124
|
-
get: function () { return
|
|
178
|
+
get: function () { return chunkQ4I7JRGO_js.LocaleSchema; }
|
|
125
179
|
});
|
|
126
180
|
Object.defineProperty(exports, "MoneyLooseSchema", {
|
|
127
181
|
enumerable: true,
|
|
128
|
-
get: function () { return
|
|
182
|
+
get: function () { return chunkQ4I7JRGO_js.MoneyLooseSchema; }
|
|
129
183
|
});
|
|
130
184
|
Object.defineProperty(exports, "MoneySchema", {
|
|
131
185
|
enumerable: true,
|
|
132
|
-
get: function () { return
|
|
186
|
+
get: function () { return chunkQ4I7JRGO_js.MoneySchema; }
|
|
133
187
|
});
|
|
134
188
|
Object.defineProperty(exports, "NextActionSchema", {
|
|
135
189
|
enumerable: true,
|
|
136
|
-
get: function () { return
|
|
190
|
+
get: function () { return chunkQ4I7JRGO_js.NextActionSchema; }
|
|
137
191
|
});
|
|
138
192
|
Object.defineProperty(exports, "PhoneE164Schema", {
|
|
139
193
|
enumerable: true,
|
|
140
|
-
get: function () { return
|
|
194
|
+
get: function () { return chunkQ4I7JRGO_js.PhoneE164Schema; }
|
|
141
195
|
});
|
|
142
196
|
Object.defineProperty(exports, "ProductTypeSchema", {
|
|
143
197
|
enumerable: true,
|
|
144
|
-
get: function () { return
|
|
145
|
-
});
|
|
146
|
-
Object.defineProperty(exports, "SCHEMA_VERSION", {
|
|
147
|
-
enumerable: true,
|
|
148
|
-
get: function () { return chunkXL4CX75J_js.SCHEMA_VERSION; }
|
|
198
|
+
get: function () { return chunkQ4I7JRGO_js.ProductTypeSchema; }
|
|
149
199
|
});
|
|
150
200
|
Object.defineProperty(exports, "SchemaViolationError", {
|
|
151
201
|
enumerable: true,
|
|
152
|
-
get: function () { return
|
|
202
|
+
get: function () { return chunkQ4I7JRGO_js.SchemaViolationError; }
|
|
153
203
|
});
|
|
154
204
|
Object.defineProperty(exports, "SeedNameSchema", {
|
|
155
205
|
enumerable: true,
|
|
156
|
-
get: function () { return
|
|
206
|
+
get: function () { return chunkQ4I7JRGO_js.SeedNameSchema; }
|
|
207
|
+
});
|
|
208
|
+
Object.defineProperty(exports, "SelectedAddOnOptionSchema", {
|
|
209
|
+
enumerable: true,
|
|
210
|
+
get: function () { return chunkQ4I7JRGO_js.SelectedAddOnOptionSchema; }
|
|
157
211
|
});
|
|
158
212
|
Object.defineProperty(exports, "ServiceStatusSchema", {
|
|
159
213
|
enumerable: true,
|
|
160
|
-
get: function () { return
|
|
214
|
+
get: function () { return chunkQ4I7JRGO_js.ServiceStatusSchema; }
|
|
161
215
|
});
|
|
162
216
|
Object.defineProperty(exports, "TimestampSchema", {
|
|
163
217
|
enumerable: true,
|
|
164
|
-
get: function () { return
|
|
218
|
+
get: function () { return chunkQ4I7JRGO_js.TimestampSchema; }
|
|
165
219
|
});
|
|
166
220
|
Object.defineProperty(exports, "VariantDetailsSchema", {
|
|
167
221
|
enumerable: true,
|
|
168
|
-
get: function () { return
|
|
222
|
+
get: function () { return chunkQ4I7JRGO_js.VariantDetailsSchema; }
|
|
169
223
|
});
|
|
170
224
|
Object.defineProperty(exports, "VariantDisplayAttributeSchema", {
|
|
171
225
|
enumerable: true,
|
|
172
|
-
get: function () { return
|
|
226
|
+
get: function () { return chunkQ4I7JRGO_js.VariantDisplayAttributeSchema; }
|
|
173
227
|
});
|
|
174
228
|
Object.defineProperty(exports, "VariantInfoSchema", {
|
|
175
229
|
enumerable: true,
|
|
176
|
-
get: function () { return
|
|
230
|
+
get: function () { return chunkQ4I7JRGO_js.VariantInfoSchema; }
|
|
177
231
|
});
|
|
178
232
|
Object.defineProperty(exports, "assertAddItemPayload", {
|
|
179
233
|
enumerable: true,
|
|
180
|
-
get: function () { return
|
|
234
|
+
get: function () { return chunkQ4I7JRGO_js.assertAddItemPayload; }
|
|
181
235
|
});
|
|
182
236
|
Object.defineProperty(exports, "assertBrand", {
|
|
183
237
|
enumerable: true,
|
|
184
|
-
get: function () { return
|
|
238
|
+
get: function () { return chunkQ4I7JRGO_js.assertBrand; }
|
|
185
239
|
});
|
|
186
240
|
Object.defineProperty(exports, "assertCart", {
|
|
187
241
|
enumerable: true,
|
|
188
|
-
get: function () { return
|
|
242
|
+
get: function () { return chunkQ4I7JRGO_js.assertCart; }
|
|
189
243
|
});
|
|
190
244
|
Object.defineProperty(exports, "assertCartItem", {
|
|
191
245
|
enumerable: true,
|
|
192
|
-
get: function () { return
|
|
246
|
+
get: function () { return chunkQ4I7JRGO_js.assertCartItem; }
|
|
193
247
|
});
|
|
194
248
|
Object.defineProperty(exports, "assertCheckoutBody", {
|
|
195
249
|
enumerable: true,
|
|
196
|
-
get: function () { return
|
|
250
|
+
get: function () { return chunkQ4I7JRGO_js.assertCheckoutBody; }
|
|
197
251
|
});
|
|
198
252
|
Object.defineProperty(exports, "assertCheckoutResponse", {
|
|
199
253
|
enumerable: true,
|
|
200
|
-
get: function () { return
|
|
254
|
+
get: function () { return chunkQ4I7JRGO_js.assertCheckoutResponse; }
|
|
255
|
+
});
|
|
256
|
+
Object.defineProperty(exports, "cimplifyRegistry", {
|
|
257
|
+
enumerable: true,
|
|
258
|
+
get: function () { return chunkQ4I7JRGO_js.cimplifyRegistry; }
|
|
201
259
|
});
|
|
202
260
|
Object.defineProperty(exports, "createTestClient", {
|
|
203
261
|
enumerable: true,
|
|
204
|
-
get: function () { return
|
|
262
|
+
get: function () { return chunkQ4I7JRGO_js.createTestClient; }
|
|
205
263
|
});
|
|
206
264
|
Object.defineProperty(exports, "fixtures", {
|
|
207
265
|
enumerable: true,
|
|
208
|
-
get: function () { return
|
|
266
|
+
get: function () { return chunkQ4I7JRGO_js.fixtures; }
|
|
209
267
|
});
|
|
210
268
|
Object.defineProperty(exports, "makeAssertion", {
|
|
211
269
|
enumerable: true,
|
|
212
|
-
get: function () { return
|
|
270
|
+
get: function () { return chunkQ4I7JRGO_js.makeAssertion; }
|
|
271
|
+
});
|
|
272
|
+
Object.defineProperty(exports, "registerSchema", {
|
|
273
|
+
enumerable: true,
|
|
274
|
+
get: function () { return chunkQ4I7JRGO_js.registerSchema; }
|
|
213
275
|
});
|
|
276
|
+
exports.exportJsonSchemas = exportJsonSchemas;
|
|
277
|
+
exports.listRegisteredSchemas = listRegisteredSchemas;
|
package/dist/testing.mjs
CHANGED
|
@@ -1,4 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
1
|
+
import { VariantInfoSchema, CheckoutResponseSchema, CheckoutBodySchema, CartPricingSchema, CartItemSchema, CartSchema, AddItemPayloadSchema, BrandSchema, cimplifyRegistry } from './chunk-GLOO4HUN.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-GLOO4HUN.mjs';
|
|
3
|
+
import './chunk-5OK3YDZC.mjs';
|
|
4
|
+
import './chunk-XZPO5GEM.mjs';
|
|
5
|
+
import './chunk-NRT6PVW5.mjs';
|
|
6
|
+
import './chunk-KSKZAXG2.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
|
|
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
|
|
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
|
|
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
|
|
31
|
+
get: function () { return chunkBN2CXGMO_js.categorizePaymentError; }
|
|
31
32
|
});
|
|
32
33
|
Object.defineProperty(exports, "detectMobileMoneyProvider", {
|
|
33
34
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
35
|
+
get: function () { return chunkBN2CXGMO_js.detectMobileMoneyProvider; }
|
|
35
36
|
});
|
|
36
37
|
Object.defineProperty(exports, "formatMoney", {
|
|
37
38
|
enumerable: true,
|
|
38
|
-
get: function () { return
|
|
39
|
+
get: function () { return chunkBN2CXGMO_js.formatMoney; }
|
|
39
40
|
});
|
|
40
41
|
Object.defineProperty(exports, "formatNumberCompact", {
|
|
41
42
|
enumerable: true,
|
|
42
|
-
get: function () { return
|
|
43
|
+
get: function () { return chunkBN2CXGMO_js.formatNumberCompact; }
|
|
43
44
|
});
|
|
44
45
|
Object.defineProperty(exports, "formatPrice", {
|
|
45
46
|
enumerable: true,
|
|
46
|
-
get: function () { return
|
|
47
|
+
get: function () { return chunkBN2CXGMO_js.formatPrice; }
|
|
47
48
|
});
|
|
48
49
|
Object.defineProperty(exports, "formatPriceAdjustment", {
|
|
49
50
|
enumerable: true,
|
|
50
|
-
get: function () { return
|
|
51
|
+
get: function () { return chunkBN2CXGMO_js.formatPriceAdjustment; }
|
|
51
52
|
});
|
|
52
53
|
Object.defineProperty(exports, "formatPriceCompact", {
|
|
53
54
|
enumerable: true,
|
|
54
|
-
get: function () { return
|
|
55
|
+
get: function () { return chunkBN2CXGMO_js.formatPriceCompact; }
|
|
55
56
|
});
|
|
56
57
|
Object.defineProperty(exports, "formatPriceWithTax", {
|
|
57
58
|
enumerable: true,
|
|
58
|
-
get: function () { return
|
|
59
|
+
get: function () { return chunkBN2CXGMO_js.formatPriceWithTax; }
|
|
59
60
|
});
|
|
60
61
|
Object.defineProperty(exports, "formatProductPrice", {
|
|
61
62
|
enumerable: true,
|
|
62
|
-
get: function () { return
|
|
63
|
+
get: function () { return chunkBN2CXGMO_js.formatProductPrice; }
|
|
63
64
|
});
|
|
64
65
|
Object.defineProperty(exports, "getBasePrice", {
|
|
65
66
|
enumerable: true,
|
|
66
|
-
get: function () { return
|
|
67
|
+
get: function () { return chunkBN2CXGMO_js.getBasePrice; }
|
|
67
68
|
});
|
|
68
69
|
Object.defineProperty(exports, "getCurrencySymbol", {
|
|
69
70
|
enumerable: true,
|
|
70
|
-
get: function () { return
|
|
71
|
+
get: function () { return chunkBN2CXGMO_js.getCurrencySymbol; }
|
|
71
72
|
});
|
|
72
73
|
Object.defineProperty(exports, "getDiscountPercentage", {
|
|
73
74
|
enumerable: true,
|
|
74
|
-
get: function () { return
|
|
75
|
+
get: function () { return chunkBN2CXGMO_js.getDiscountPercentage; }
|
|
75
76
|
});
|
|
76
77
|
Object.defineProperty(exports, "getDisplayPrice", {
|
|
77
78
|
enumerable: true,
|
|
78
|
-
get: function () { return
|
|
79
|
+
get: function () { return chunkBN2CXGMO_js.getDisplayPrice; }
|
|
79
80
|
});
|
|
80
81
|
Object.defineProperty(exports, "getMarkupPercentage", {
|
|
81
82
|
enumerable: true,
|
|
82
|
-
get: function () { return
|
|
83
|
+
get: function () { return chunkBN2CXGMO_js.getMarkupPercentage; }
|
|
83
84
|
});
|
|
84
85
|
Object.defineProperty(exports, "getProductCurrency", {
|
|
85
86
|
enumerable: true,
|
|
86
|
-
get: function () { return
|
|
87
|
+
get: function () { return chunkBN2CXGMO_js.getProductCurrency; }
|
|
87
88
|
});
|
|
88
89
|
Object.defineProperty(exports, "getTaxAmount", {
|
|
89
90
|
enumerable: true,
|
|
90
|
-
get: function () { return
|
|
91
|
+
get: function () { return chunkBN2CXGMO_js.getTaxAmount; }
|
|
91
92
|
});
|
|
92
93
|
Object.defineProperty(exports, "hasTaxInfo", {
|
|
93
94
|
enumerable: true,
|
|
94
|
-
get: function () { return
|
|
95
|
+
get: function () { return chunkBN2CXGMO_js.hasTaxInfo; }
|
|
95
96
|
});
|
|
96
97
|
Object.defineProperty(exports, "isOnSale", {
|
|
97
98
|
enumerable: true,
|
|
98
|
-
get: function () { return
|
|
99
|
+
get: function () { return chunkBN2CXGMO_js.isOnSale; }
|
|
99
100
|
});
|
|
100
101
|
Object.defineProperty(exports, "isPaymentStatusFailure", {
|
|
101
102
|
enumerable: true,
|
|
102
|
-
get: function () { return
|
|
103
|
+
get: function () { return chunkBN2CXGMO_js.isPaymentStatusFailure; }
|
|
103
104
|
});
|
|
104
105
|
Object.defineProperty(exports, "isPaymentStatusRequiresAction", {
|
|
105
106
|
enumerable: true,
|
|
106
|
-
get: function () { return
|
|
107
|
+
get: function () { return chunkBN2CXGMO_js.isPaymentStatusRequiresAction; }
|
|
107
108
|
});
|
|
108
109
|
Object.defineProperty(exports, "isPaymentStatusSuccess", {
|
|
109
110
|
enumerable: true,
|
|
110
|
-
get: function () { return
|
|
111
|
+
get: function () { return chunkBN2CXGMO_js.isPaymentStatusSuccess; }
|
|
111
112
|
});
|
|
112
113
|
Object.defineProperty(exports, "isTaxInclusive", {
|
|
113
114
|
enumerable: true,
|
|
114
|
-
get: function () { return
|
|
115
|
+
get: function () { return chunkBN2CXGMO_js.isTaxInclusive; }
|
|
115
116
|
});
|
|
116
117
|
Object.defineProperty(exports, "normalizePaymentResponse", {
|
|
117
118
|
enumerable: true,
|
|
118
|
-
get: function () { return
|
|
119
|
+
get: function () { return chunkBN2CXGMO_js.normalizePaymentResponse; }
|
|
119
120
|
});
|
|
120
121
|
Object.defineProperty(exports, "normalizeStatusResponse", {
|
|
121
122
|
enumerable: true,
|
|
122
|
-
get: function () { return
|
|
123
|
+
get: function () { return chunkBN2CXGMO_js.normalizeStatusResponse; }
|
|
123
124
|
});
|
|
124
125
|
Object.defineProperty(exports, "parsePrice", {
|
|
125
126
|
enumerable: true,
|
|
126
|
-
get: function () { return
|
|
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-
|
|
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.
|
|
3
|
+
"version": "0.44.19",
|
|
4
4
|
"description": "Cimplify Commerce SDK for storefronts",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cimplify",
|
|
@@ -71,6 +71,11 @@
|
|
|
71
71
|
"import": "./dist/testing/suite.mjs",
|
|
72
72
|
"require": "./dist/testing/suite.js"
|
|
73
73
|
},
|
|
74
|
+
"./testing/msw": {
|
|
75
|
+
"types": "./dist/testing/msw.d.ts",
|
|
76
|
+
"import": "./dist/testing/msw.mjs",
|
|
77
|
+
"require": "./dist/testing/msw.js"
|
|
78
|
+
},
|
|
74
79
|
"./styles.css": "./dist/styles.css"
|
|
75
80
|
},
|
|
76
81
|
"scripts": {
|
|
@@ -86,7 +91,11 @@
|
|
|
86
91
|
"format:check": "oxfmt . --check",
|
|
87
92
|
"test": "vitest",
|
|
88
93
|
"test:run": "vitest run",
|
|
89
|
-
"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"
|
|
90
99
|
},
|
|
91
100
|
"peerDependencies": {
|
|
92
101
|
"@paystack/inline-js": "^2.22.8",
|