@cimplify/sdk 0.44.16 → 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.
- 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-53J2WE4S.js +657 -0
- package/dist/{chunk-UXLQ7WXI.mjs → chunk-5OK3YDZC.mjs} +2 -2
- package/dist/{chunk-MNIKXG7W.js → chunk-BN2CXGMO.js} +5 -272
- package/dist/{chunk-XL4CX75J.js → chunk-CCSONJCO.js} +235 -781
- package/dist/{chunk-CFD4J32N.js → chunk-HBRCVJL4.js} +22 -21
- package/dist/{chunk-ZLEFMQC6.mjs → chunk-MJBSVUHO.mjs} +2 -498
- package/dist/{chunk-6AZZ6AOF.mjs → chunk-NRT6PVW5.mjs} +4 -251
- package/dist/chunk-QBQCMQ4F.js +271 -0
- package/dist/chunk-VDH3O7UB.mjs +604 -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/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 +643 -117
- package/dist/testing.d.ts +643 -117
- package/dist/testing.js +107 -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,261 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
7
|
-
|
|
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');
|
|
8
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
|
+
}
|
|
9
51
|
|
|
10
52
|
Object.defineProperty(exports, "AddItemPayloadSchema", {
|
|
11
53
|
enumerable: true,
|
|
12
|
-
get: function () { return
|
|
54
|
+
get: function () { return chunk53J2WE4S_js.AddItemPayloadSchema; }
|
|
13
55
|
});
|
|
14
56
|
Object.defineProperty(exports, "AddOnDetailsSchema", {
|
|
15
57
|
enumerable: true,
|
|
16
|
-
get: function () { return
|
|
58
|
+
get: function () { return chunk53J2WE4S_js.AddOnDetailsSchema; }
|
|
17
59
|
});
|
|
18
60
|
Object.defineProperty(exports, "AuthorizationTypeSchema", {
|
|
19
61
|
enumerable: true,
|
|
20
|
-
get: function () { return
|
|
62
|
+
get: function () { return chunk53J2WE4S_js.AuthorizationTypeSchema; }
|
|
21
63
|
});
|
|
22
64
|
Object.defineProperty(exports, "BrandContactSchema", {
|
|
23
65
|
enumerable: true,
|
|
24
|
-
get: function () { return
|
|
66
|
+
get: function () { return chunk53J2WE4S_js.BrandContactSchema; }
|
|
25
67
|
});
|
|
26
68
|
Object.defineProperty(exports, "BrandFaqSchema", {
|
|
27
69
|
enumerable: true,
|
|
28
|
-
get: function () { return
|
|
70
|
+
get: function () { return chunk53J2WE4S_js.BrandFaqSchema; }
|
|
29
71
|
});
|
|
30
72
|
Object.defineProperty(exports, "BrandHeroSchema", {
|
|
31
73
|
enumerable: true,
|
|
32
|
-
get: function () { return
|
|
74
|
+
get: function () { return chunk53J2WE4S_js.BrandHeroSchema; }
|
|
33
75
|
});
|
|
34
76
|
Object.defineProperty(exports, "BrandNavLinkSchema", {
|
|
35
77
|
enumerable: true,
|
|
36
|
-
get: function () { return
|
|
78
|
+
get: function () { return chunk53J2WE4S_js.BrandNavLinkSchema; }
|
|
37
79
|
});
|
|
38
80
|
Object.defineProperty(exports, "BrandPolicyPageSchema", {
|
|
39
81
|
enumerable: true,
|
|
40
|
-
get: function () { return
|
|
82
|
+
get: function () { return chunk53J2WE4S_js.BrandPolicyPageSchema; }
|
|
41
83
|
});
|
|
42
84
|
Object.defineProperty(exports, "BrandPolicySectionSchema", {
|
|
43
85
|
enumerable: true,
|
|
44
|
-
get: function () { return
|
|
86
|
+
get: function () { return chunk53J2WE4S_js.BrandPolicySectionSchema; }
|
|
45
87
|
});
|
|
46
88
|
Object.defineProperty(exports, "BrandSchema", {
|
|
47
89
|
enumerable: true,
|
|
48
|
-
get: function () { return
|
|
90
|
+
get: function () { return chunk53J2WE4S_js.BrandSchema; }
|
|
49
91
|
});
|
|
50
92
|
Object.defineProperty(exports, "BrandSocialSchema", {
|
|
51
93
|
enumerable: true,
|
|
52
|
-
get: function () { return
|
|
94
|
+
get: function () { return chunk53J2WE4S_js.BrandSocialSchema; }
|
|
53
95
|
});
|
|
54
96
|
Object.defineProperty(exports, "BundleResolvedSchema", {
|
|
55
97
|
enumerable: true,
|
|
56
|
-
get: function () { return
|
|
98
|
+
get: function () { return chunk53J2WE4S_js.BundleResolvedSchema; }
|
|
57
99
|
});
|
|
58
100
|
Object.defineProperty(exports, "BundleSelectionInputSchema", {
|
|
59
101
|
enumerable: true,
|
|
60
|
-
get: function () { return
|
|
102
|
+
get: function () { return chunk53J2WE4S_js.BundleSelectionInputSchema; }
|
|
61
103
|
});
|
|
62
104
|
Object.defineProperty(exports, "CartItemSchema", {
|
|
63
105
|
enumerable: true,
|
|
64
|
-
get: function () { return
|
|
106
|
+
get: function () { return chunk53J2WE4S_js.CartItemSchema; }
|
|
65
107
|
});
|
|
66
108
|
Object.defineProperty(exports, "CartPricingSchema", {
|
|
67
109
|
enumerable: true,
|
|
68
|
-
get: function () { return
|
|
110
|
+
get: function () { return chunk53J2WE4S_js.CartPricingSchema; }
|
|
69
111
|
});
|
|
70
112
|
Object.defineProperty(exports, "CartSchema", {
|
|
71
113
|
enumerable: true,
|
|
72
|
-
get: function () { return
|
|
114
|
+
get: function () { return chunk53J2WE4S_js.CartSchema; }
|
|
73
115
|
});
|
|
74
116
|
Object.defineProperty(exports, "CheckoutBodySchema", {
|
|
75
117
|
enumerable: true,
|
|
76
|
-
get: function () { return
|
|
118
|
+
get: function () { return chunk53J2WE4S_js.CheckoutBodySchema; }
|
|
77
119
|
});
|
|
78
120
|
Object.defineProperty(exports, "CheckoutCustomerSchema", {
|
|
79
121
|
enumerable: true,
|
|
80
|
-
get: function () { return
|
|
122
|
+
get: function () { return chunk53J2WE4S_js.CheckoutCustomerSchema; }
|
|
81
123
|
});
|
|
82
124
|
Object.defineProperty(exports, "CheckoutResponseSchema", {
|
|
83
125
|
enumerable: true,
|
|
84
|
-
get: function () { return
|
|
126
|
+
get: function () { return chunk53J2WE4S_js.CheckoutResponseSchema; }
|
|
85
127
|
});
|
|
86
128
|
Object.defineProperty(exports, "ChosenPriceSchema", {
|
|
87
129
|
enumerable: true,
|
|
88
|
-
get: function () { return
|
|
130
|
+
get: function () { return chunk53J2WE4S_js.ChosenPriceSchema; }
|
|
89
131
|
});
|
|
90
132
|
Object.defineProperty(exports, "CompositeResolvedSchema", {
|
|
91
133
|
enumerable: true,
|
|
92
|
-
get: function () { return
|
|
134
|
+
get: function () { return chunk53J2WE4S_js.CompositeResolvedSchema; }
|
|
93
135
|
});
|
|
94
136
|
Object.defineProperty(exports, "CompositeSelectionInputSchema", {
|
|
95
137
|
enumerable: true,
|
|
96
|
-
get: function () { return
|
|
138
|
+
get: function () { return chunk53J2WE4S_js.CompositeSelectionInputSchema; }
|
|
97
139
|
});
|
|
98
140
|
Object.defineProperty(exports, "CountryCodeSchema", {
|
|
99
141
|
enumerable: true,
|
|
100
|
-
get: function () { return
|
|
142
|
+
get: function () { return chunk53J2WE4S_js.CountryCodeSchema; }
|
|
101
143
|
});
|
|
102
144
|
Object.defineProperty(exports, "CurrencyCodeSchema", {
|
|
103
145
|
enumerable: true,
|
|
104
|
-
get: function () { return
|
|
146
|
+
get: function () { return chunk53J2WE4S_js.CurrencyCodeSchema; }
|
|
105
147
|
});
|
|
106
148
|
Object.defineProperty(exports, "CustomerInputValueSchema", {
|
|
107
149
|
enumerable: true,
|
|
108
|
-
get: function () { return
|
|
150
|
+
get: function () { return chunk53J2WE4S_js.CustomerInputValueSchema; }
|
|
109
151
|
});
|
|
110
152
|
Object.defineProperty(exports, "DiscountDetailsSchema", {
|
|
111
153
|
enumerable: true,
|
|
112
|
-
get: function () { return
|
|
154
|
+
get: function () { return chunk53J2WE4S_js.DiscountDetailsSchema; }
|
|
113
155
|
});
|
|
114
156
|
Object.defineProperty(exports, "IsoDateTimeSchema", {
|
|
115
157
|
enumerable: true,
|
|
116
|
-
get: function () { return
|
|
158
|
+
get: function () { return chunk53J2WE4S_js.IsoDateTimeSchema; }
|
|
117
159
|
});
|
|
118
160
|
Object.defineProperty(exports, "LineTypeSchema", {
|
|
119
161
|
enumerable: true,
|
|
120
|
-
get: function () { return
|
|
162
|
+
get: function () { return chunk53J2WE4S_js.LineTypeSchema; }
|
|
121
163
|
});
|
|
122
164
|
Object.defineProperty(exports, "LocaleSchema", {
|
|
123
165
|
enumerable: true,
|
|
124
|
-
get: function () { return
|
|
166
|
+
get: function () { return chunk53J2WE4S_js.LocaleSchema; }
|
|
125
167
|
});
|
|
126
168
|
Object.defineProperty(exports, "MoneyLooseSchema", {
|
|
127
169
|
enumerable: true,
|
|
128
|
-
get: function () { return
|
|
170
|
+
get: function () { return chunk53J2WE4S_js.MoneyLooseSchema; }
|
|
129
171
|
});
|
|
130
172
|
Object.defineProperty(exports, "MoneySchema", {
|
|
131
173
|
enumerable: true,
|
|
132
|
-
get: function () { return
|
|
174
|
+
get: function () { return chunk53J2WE4S_js.MoneySchema; }
|
|
133
175
|
});
|
|
134
176
|
Object.defineProperty(exports, "NextActionSchema", {
|
|
135
177
|
enumerable: true,
|
|
136
|
-
get: function () { return
|
|
178
|
+
get: function () { return chunk53J2WE4S_js.NextActionSchema; }
|
|
137
179
|
});
|
|
138
180
|
Object.defineProperty(exports, "PhoneE164Schema", {
|
|
139
181
|
enumerable: true,
|
|
140
|
-
get: function () { return
|
|
182
|
+
get: function () { return chunk53J2WE4S_js.PhoneE164Schema; }
|
|
141
183
|
});
|
|
142
184
|
Object.defineProperty(exports, "ProductTypeSchema", {
|
|
143
185
|
enumerable: true,
|
|
144
|
-
get: function () { return
|
|
145
|
-
});
|
|
146
|
-
Object.defineProperty(exports, "SCHEMA_VERSION", {
|
|
147
|
-
enumerable: true,
|
|
148
|
-
get: function () { return chunkXL4CX75J_js.SCHEMA_VERSION; }
|
|
186
|
+
get: function () { return chunk53J2WE4S_js.ProductTypeSchema; }
|
|
149
187
|
});
|
|
150
188
|
Object.defineProperty(exports, "SchemaViolationError", {
|
|
151
189
|
enumerable: true,
|
|
152
|
-
get: function () { return
|
|
190
|
+
get: function () { return chunk53J2WE4S_js.SchemaViolationError; }
|
|
153
191
|
});
|
|
154
192
|
Object.defineProperty(exports, "SeedNameSchema", {
|
|
155
193
|
enumerable: true,
|
|
156
|
-
get: function () { return
|
|
194
|
+
get: function () { return chunk53J2WE4S_js.SeedNameSchema; }
|
|
157
195
|
});
|
|
158
196
|
Object.defineProperty(exports, "ServiceStatusSchema", {
|
|
159
197
|
enumerable: true,
|
|
160
|
-
get: function () { return
|
|
198
|
+
get: function () { return chunk53J2WE4S_js.ServiceStatusSchema; }
|
|
161
199
|
});
|
|
162
200
|
Object.defineProperty(exports, "TimestampSchema", {
|
|
163
201
|
enumerable: true,
|
|
164
|
-
get: function () { return
|
|
202
|
+
get: function () { return chunk53J2WE4S_js.TimestampSchema; }
|
|
165
203
|
});
|
|
166
204
|
Object.defineProperty(exports, "VariantDetailsSchema", {
|
|
167
205
|
enumerable: true,
|
|
168
|
-
get: function () { return
|
|
206
|
+
get: function () { return chunk53J2WE4S_js.VariantDetailsSchema; }
|
|
169
207
|
});
|
|
170
208
|
Object.defineProperty(exports, "VariantDisplayAttributeSchema", {
|
|
171
209
|
enumerable: true,
|
|
172
|
-
get: function () { return
|
|
210
|
+
get: function () { return chunk53J2WE4S_js.VariantDisplayAttributeSchema; }
|
|
173
211
|
});
|
|
174
212
|
Object.defineProperty(exports, "VariantInfoSchema", {
|
|
175
213
|
enumerable: true,
|
|
176
|
-
get: function () { return
|
|
214
|
+
get: function () { return chunk53J2WE4S_js.VariantInfoSchema; }
|
|
177
215
|
});
|
|
178
216
|
Object.defineProperty(exports, "assertAddItemPayload", {
|
|
179
217
|
enumerable: true,
|
|
180
|
-
get: function () { return
|
|
218
|
+
get: function () { return chunk53J2WE4S_js.assertAddItemPayload; }
|
|
181
219
|
});
|
|
182
220
|
Object.defineProperty(exports, "assertBrand", {
|
|
183
221
|
enumerable: true,
|
|
184
|
-
get: function () { return
|
|
222
|
+
get: function () { return chunk53J2WE4S_js.assertBrand; }
|
|
185
223
|
});
|
|
186
224
|
Object.defineProperty(exports, "assertCart", {
|
|
187
225
|
enumerable: true,
|
|
188
|
-
get: function () { return
|
|
226
|
+
get: function () { return chunk53J2WE4S_js.assertCart; }
|
|
189
227
|
});
|
|
190
228
|
Object.defineProperty(exports, "assertCartItem", {
|
|
191
229
|
enumerable: true,
|
|
192
|
-
get: function () { return
|
|
230
|
+
get: function () { return chunk53J2WE4S_js.assertCartItem; }
|
|
193
231
|
});
|
|
194
232
|
Object.defineProperty(exports, "assertCheckoutBody", {
|
|
195
233
|
enumerable: true,
|
|
196
|
-
get: function () { return
|
|
234
|
+
get: function () { return chunk53J2WE4S_js.assertCheckoutBody; }
|
|
197
235
|
});
|
|
198
236
|
Object.defineProperty(exports, "assertCheckoutResponse", {
|
|
199
237
|
enumerable: true,
|
|
200
|
-
get: function () { return
|
|
238
|
+
get: function () { return chunk53J2WE4S_js.assertCheckoutResponse; }
|
|
239
|
+
});
|
|
240
|
+
Object.defineProperty(exports, "cimplifyRegistry", {
|
|
241
|
+
enumerable: true,
|
|
242
|
+
get: function () { return chunk53J2WE4S_js.cimplifyRegistry; }
|
|
201
243
|
});
|
|
202
244
|
Object.defineProperty(exports, "createTestClient", {
|
|
203
245
|
enumerable: true,
|
|
204
|
-
get: function () { return
|
|
246
|
+
get: function () { return chunk53J2WE4S_js.createTestClient; }
|
|
205
247
|
});
|
|
206
248
|
Object.defineProperty(exports, "fixtures", {
|
|
207
249
|
enumerable: true,
|
|
208
|
-
get: function () { return
|
|
250
|
+
get: function () { return chunk53J2WE4S_js.fixtures; }
|
|
209
251
|
});
|
|
210
252
|
Object.defineProperty(exports, "makeAssertion", {
|
|
211
253
|
enumerable: true,
|
|
212
|
-
get: function () { return
|
|
254
|
+
get: function () { return chunk53J2WE4S_js.makeAssertion; }
|
|
255
|
+
});
|
|
256
|
+
Object.defineProperty(exports, "registerSchema", {
|
|
257
|
+
enumerable: true,
|
|
258
|
+
get: function () { return chunk53J2WE4S_js.registerSchema; }
|
|
213
259
|
});
|
|
260
|
+
exports.exportJsonSchemas = exportJsonSchemas;
|
|
261
|
+
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-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
|
|
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.18",
|
|
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",
|