@cimplify/sdk 0.67.0 → 0.68.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.
- package/dist/advanced.d.mts +1 -1
- package/dist/advanced.d.ts +1 -1
- package/dist/advanced.js +20 -20
- package/dist/advanced.mjs +1 -1
- package/dist/{chunk-SSLFZPAI.js → chunk-5HAUJBOK.js} +35 -35
- package/dist/{chunk-JAPCAZN4.mjs → chunk-KNPE4WCQ.mjs} +1 -1
- package/dist/{chunk-SH6HJW4A.js → chunk-NGQCWFKF.js} +2 -2
- package/dist/{chunk-QQMDEGAK.mjs → chunk-SOV4H6PQ.mjs} +177 -50
- package/dist/{chunk-FNK6UZOE.mjs → chunk-TAKORJP4.mjs} +1 -1
- package/dist/{chunk-3QSW33RG.js → chunk-WCSAZRNC.js} +179 -49
- package/dist/{client-Dd82KQ_G.d.mts → client-CBE7ksYC.d.mts} +1 -1
- package/dist/{client-DVFQoDtI.d.ts → client-CfeQRwhl.d.ts} +24 -2
- package/dist/{client-CQlEWH5j.d.ts → client-DlXfZy7N.d.ts} +1 -1
- package/dist/{client-ByI_3jfL.d.mts → client-Dyo3dvNy.d.mts} +24 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +89 -72
- package/dist/index.mjs +15 -10
- package/dist/react.d.mts +43 -40
- package/dist/react.d.ts +43 -40
- package/dist/react.js +251 -120
- package/dist/react.mjs +237 -106
- package/dist/server.d.mts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.js +7 -7
- package/dist/server.mjs +2 -2
- package/dist/{sign-in-RFuWZOgF.d.mts → sign-in-DQlIdqsi.d.mts} +8 -0
- package/dist/{sign-in-RFuWZOgF.d.ts → sign-in-DQlIdqsi.d.ts} +8 -0
- package/dist/styles.css +1 -1
- package/dist/testing/suite.d.mts +2 -2
- package/dist/testing/suite.d.ts +2 -2
- package/dist/testing/suite.js +22 -22
- package/dist/testing/suite.mjs +3 -3
- package/dist/testing.d.mts +17 -17
- package/dist/testing.d.ts +17 -17
- package/dist/testing.js +78 -78
- package/dist/testing.mjs +4 -4
- package/package.json +1 -1
- package/registry/index.json +0 -9
- package/registry/account.json +0 -15
package/dist/testing.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { $ZodType } from 'zod/v4/core';
|
|
3
|
-
export { A as AddFirstProductOptions, a as AddFirstProductResult, P as ProductSummary, T as TestClientHandle, c as createTestClient, f as fixtures } from './client-
|
|
4
|
-
import './client-
|
|
3
|
+
export { A as AddFirstProductOptions, a as AddFirstProductResult, P as ProductSummary, T as TestClientHandle, c as createTestClient, f as fixtures } from './client-DlXfZy7N.js';
|
|
4
|
+
import './client-CfeQRwhl.js';
|
|
5
5
|
import './product-B_kS4Oxa.js';
|
|
6
6
|
import './payment-sn-yGL7v.js';
|
|
7
7
|
import './server-BQzz921M.js';
|
|
@@ -54,8 +54,8 @@ declare const CountryCodeSchema: z.ZodString;
|
|
|
54
54
|
declare const LocaleSchema: z.ZodString;
|
|
55
55
|
declare const PhoneE164Schema: z.ZodString;
|
|
56
56
|
declare const SeedNameSchema: z.ZodEnum<{
|
|
57
|
-
default: "default";
|
|
58
57
|
empty: "empty";
|
|
58
|
+
default: "default";
|
|
59
59
|
"reesa-storefront": "reesa-storefront";
|
|
60
60
|
restaurant: "restaurant";
|
|
61
61
|
retail: "retail";
|
|
@@ -71,11 +71,11 @@ declare const ProductTypeSchema: z.ZodEnum<{
|
|
|
71
71
|
composite: "composite";
|
|
72
72
|
}>;
|
|
73
73
|
declare const LineTypeSchema: z.ZodEnum<{
|
|
74
|
+
simple: "simple";
|
|
74
75
|
service: "service";
|
|
75
76
|
digital: "digital";
|
|
76
77
|
bundle: "bundle";
|
|
77
78
|
composite: "composite";
|
|
78
|
-
simple: "simple";
|
|
79
79
|
}>;
|
|
80
80
|
declare const ServiceStatusSchema: z.ZodEnum<{
|
|
81
81
|
pending: "pending";
|
|
@@ -365,8 +365,8 @@ declare const BrandSchema: z.ZodObject<{
|
|
|
365
365
|
}, z.core.$strip>;
|
|
366
366
|
mock: z.ZodObject<{
|
|
367
367
|
seed: z.ZodEnum<{
|
|
368
|
-
default: "default";
|
|
369
368
|
empty: "empty";
|
|
369
|
+
default: "default";
|
|
370
370
|
"reesa-storefront": "reesa-storefront";
|
|
371
371
|
restaurant: "restaurant";
|
|
372
372
|
retail: "retail";
|
|
@@ -531,7 +531,7 @@ declare const assertBrand: (value: unknown) => asserts value is {
|
|
|
531
531
|
summary: string;
|
|
532
532
|
};
|
|
533
533
|
mock: {
|
|
534
|
-
seed: "
|
|
534
|
+
seed: "empty" | "default" | "reesa-storefront" | "restaurant" | "retail" | "services" | "grocery" | "fashion";
|
|
535
535
|
businessId: string;
|
|
536
536
|
};
|
|
537
537
|
trustItems?: {
|
|
@@ -780,11 +780,11 @@ declare const CartItemSchema: z.ZodObject<{
|
|
|
780
780
|
quantity: z.ZodNumber;
|
|
781
781
|
line_key: z.ZodString;
|
|
782
782
|
line_type: z.ZodEnum<{
|
|
783
|
+
simple: "simple";
|
|
783
784
|
service: "service";
|
|
784
785
|
digital: "digital";
|
|
785
786
|
bundle: "bundle";
|
|
786
787
|
composite: "composite";
|
|
787
|
-
simple: "simple";
|
|
788
788
|
}>;
|
|
789
789
|
name: z.ZodString;
|
|
790
790
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -926,7 +926,7 @@ declare const assertCartItem: (value: unknown) => asserts value is {
|
|
|
926
926
|
item_id: string;
|
|
927
927
|
quantity: number;
|
|
928
928
|
line_key: string;
|
|
929
|
-
line_type: "
|
|
929
|
+
line_type: "simple" | "service" | "digital" | "bundle" | "composite";
|
|
930
930
|
name: string;
|
|
931
931
|
is_available: boolean;
|
|
932
932
|
base_price: string;
|
|
@@ -1076,11 +1076,11 @@ declare const CartSchema: z.ZodObject<{
|
|
|
1076
1076
|
quantity: z.ZodNumber;
|
|
1077
1077
|
line_key: z.ZodString;
|
|
1078
1078
|
line_type: z.ZodEnum<{
|
|
1079
|
+
simple: "simple";
|
|
1079
1080
|
service: "service";
|
|
1080
1081
|
digital: "digital";
|
|
1081
1082
|
bundle: "bundle";
|
|
1082
1083
|
composite: "composite";
|
|
1083
|
-
simple: "simple";
|
|
1084
1084
|
}>;
|
|
1085
1085
|
name: z.ZodString;
|
|
1086
1086
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -1249,7 +1249,7 @@ declare const assertCart: (value: unknown) => asserts value is {
|
|
|
1249
1249
|
item_id: string;
|
|
1250
1250
|
quantity: number;
|
|
1251
1251
|
line_key: string;
|
|
1252
|
-
line_type: "
|
|
1252
|
+
line_type: "simple" | "service" | "digital" | "bundle" | "composite";
|
|
1253
1253
|
name: string;
|
|
1254
1254
|
is_available: boolean;
|
|
1255
1255
|
base_price: string;
|
|
@@ -1462,10 +1462,10 @@ declare const assertCheckoutBody: (value: unknown) => asserts value is {
|
|
|
1462
1462
|
};
|
|
1463
1463
|
declare const AuthorizationTypeSchema: z.ZodEnum<{
|
|
1464
1464
|
phone: "phone";
|
|
1465
|
-
address: "address";
|
|
1466
1465
|
otp: "otp";
|
|
1467
1466
|
pin: "pin";
|
|
1468
1467
|
birthday: "birthday";
|
|
1468
|
+
address: "address";
|
|
1469
1469
|
}>;
|
|
1470
1470
|
declare const NextActionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1471
1471
|
type: z.ZodLiteral<"none">;
|
|
@@ -1485,10 +1485,10 @@ declare const CheckoutResponseSchema: z.ZodObject<{
|
|
|
1485
1485
|
requires_authorization: z.ZodBoolean;
|
|
1486
1486
|
authorization_type: z.ZodOptional<z.ZodEnum<{
|
|
1487
1487
|
phone: "phone";
|
|
1488
|
-
address: "address";
|
|
1489
1488
|
otp: "otp";
|
|
1490
1489
|
pin: "pin";
|
|
1491
1490
|
birthday: "birthday";
|
|
1491
|
+
address: "address";
|
|
1492
1492
|
}>>;
|
|
1493
1493
|
next_action: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1494
1494
|
type: z.ZodLiteral<"none">;
|
|
@@ -1525,7 +1525,7 @@ declare const assertCheckoutResponse: (value: unknown) => asserts value is {
|
|
|
1525
1525
|
display_text?: string | undefined;
|
|
1526
1526
|
};
|
|
1527
1527
|
payment_reference?: string | undefined;
|
|
1528
|
-
authorization_type?: "phone" | "
|
|
1528
|
+
authorization_type?: "phone" | "otp" | "pin" | "birthday" | "address" | undefined;
|
|
1529
1529
|
provider?: string | undefined;
|
|
1530
1530
|
authorization_url?: string | undefined;
|
|
1531
1531
|
display_text?: string | undefined;
|
|
@@ -1724,8 +1724,8 @@ declare const PUBLIC_SCHEMAS: {
|
|
|
1724
1724
|
}, z.core.$strip>;
|
|
1725
1725
|
mock: z.ZodObject<{
|
|
1726
1726
|
seed: z.ZodEnum<{
|
|
1727
|
-
default: "default";
|
|
1728
1727
|
empty: "empty";
|
|
1728
|
+
default: "default";
|
|
1729
1729
|
"reesa-storefront": "reesa-storefront";
|
|
1730
1730
|
restaurant: "restaurant";
|
|
1731
1731
|
retail: "retail";
|
|
@@ -1785,11 +1785,11 @@ declare const PUBLIC_SCHEMAS: {
|
|
|
1785
1785
|
quantity: z.ZodNumber;
|
|
1786
1786
|
line_key: z.ZodString;
|
|
1787
1787
|
line_type: z.ZodEnum<{
|
|
1788
|
+
simple: "simple";
|
|
1788
1789
|
service: "service";
|
|
1789
1790
|
digital: "digital";
|
|
1790
1791
|
bundle: "bundle";
|
|
1791
1792
|
composite: "composite";
|
|
1792
|
-
simple: "simple";
|
|
1793
1793
|
}>;
|
|
1794
1794
|
name: z.ZodString;
|
|
1795
1795
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -1953,11 +1953,11 @@ declare const PUBLIC_SCHEMAS: {
|
|
|
1953
1953
|
quantity: z.ZodNumber;
|
|
1954
1954
|
line_key: z.ZodString;
|
|
1955
1955
|
line_type: z.ZodEnum<{
|
|
1956
|
+
simple: "simple";
|
|
1956
1957
|
service: "service";
|
|
1957
1958
|
digital: "digital";
|
|
1958
1959
|
bundle: "bundle";
|
|
1959
1960
|
composite: "composite";
|
|
1960
|
-
simple: "simple";
|
|
1961
1961
|
}>;
|
|
1962
1962
|
name: z.ZodString;
|
|
1963
1963
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -2131,10 +2131,10 @@ declare const PUBLIC_SCHEMAS: {
|
|
|
2131
2131
|
requires_authorization: z.ZodBoolean;
|
|
2132
2132
|
authorization_type: z.ZodOptional<z.ZodEnum<{
|
|
2133
2133
|
phone: "phone";
|
|
2134
|
-
address: "address";
|
|
2135
2134
|
otp: "otp";
|
|
2136
2135
|
pin: "pin";
|
|
2137
2136
|
birthday: "birthday";
|
|
2137
|
+
address: "address";
|
|
2138
2138
|
}>>;
|
|
2139
2139
|
next_action: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
2140
2140
|
type: z.ZodLiteral<"none">;
|
package/dist/testing.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkNGQCWFKF_js = require('./chunk-NGQCWFKF.js');
|
|
4
4
|
require('./chunk-SXGFJEME.js');
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
5
|
+
require('./chunk-5HAUJBOK.js');
|
|
6
|
+
require('./chunk-WCSAZRNC.js');
|
|
7
7
|
require('./chunk-7Y2O3E4D.js');
|
|
8
8
|
require('./chunk-XA3ZNR75.js');
|
|
9
9
|
require('./chunk-OWW5GUSB.js');
|
|
10
10
|
var zod = require('zod');
|
|
11
11
|
|
|
12
12
|
var PUBLIC_SCHEMAS = {
|
|
13
|
-
Brand:
|
|
14
|
-
AddItemPayload:
|
|
15
|
-
Cart:
|
|
16
|
-
CartItem:
|
|
17
|
-
CartPricing:
|
|
18
|
-
CheckoutBody:
|
|
19
|
-
CheckoutResponse:
|
|
20
|
-
VariantInfo:
|
|
13
|
+
Brand: chunkNGQCWFKF_js.BrandSchema,
|
|
14
|
+
AddItemPayload: chunkNGQCWFKF_js.AddItemPayloadSchema,
|
|
15
|
+
Cart: chunkNGQCWFKF_js.CartSchema,
|
|
16
|
+
CartItem: chunkNGQCWFKF_js.CartItemSchema,
|
|
17
|
+
CartPricing: chunkNGQCWFKF_js.CartPricingSchema,
|
|
18
|
+
CheckoutBody: chunkNGQCWFKF_js.CheckoutBodySchema,
|
|
19
|
+
CheckoutResponse: chunkNGQCWFKF_js.CheckoutResponseSchema,
|
|
20
|
+
VariantInfo: chunkNGQCWFKF_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 =
|
|
26
|
-
const json = zod.z.toJSONSchema(schema, { metadata:
|
|
25
|
+
const meta = chunkNGQCWFKF_js.cimplifyRegistry.get(schema);
|
|
26
|
+
const json = zod.z.toJSONSchema(schema, { metadata: chunkNGQCWFKF_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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
38
|
+
chunkNGQCWFKF_js.BrandSchema,
|
|
39
|
+
chunkNGQCWFKF_js.AddItemPayloadSchema,
|
|
40
|
+
chunkNGQCWFKF_js.CartSchema,
|
|
41
|
+
chunkNGQCWFKF_js.CartItemSchema,
|
|
42
|
+
chunkNGQCWFKF_js.CartPricingSchema,
|
|
43
|
+
chunkNGQCWFKF_js.CheckoutBodySchema,
|
|
44
|
+
chunkNGQCWFKF_js.CheckoutResponseSchema,
|
|
45
|
+
chunkNGQCWFKF_js.VariantInfoSchema
|
|
46
46
|
]) {
|
|
47
|
-
const meta =
|
|
47
|
+
const meta = chunkNGQCWFKF_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
|
|
55
|
+
get: function () { return chunkNGQCWFKF_js.AddItemPayloadSchema; }
|
|
56
56
|
});
|
|
57
57
|
Object.defineProperty(exports, "AddOnDetailsSchema", {
|
|
58
58
|
enumerable: true,
|
|
59
|
-
get: function () { return
|
|
59
|
+
get: function () { return chunkNGQCWFKF_js.AddOnDetailsSchema; }
|
|
60
60
|
});
|
|
61
61
|
Object.defineProperty(exports, "AddOnGroupDetailsSchema", {
|
|
62
62
|
enumerable: true,
|
|
63
|
-
get: function () { return
|
|
63
|
+
get: function () { return chunkNGQCWFKF_js.AddOnGroupDetailsSchema; }
|
|
64
64
|
});
|
|
65
65
|
Object.defineProperty(exports, "AddOnInDetailsSchema", {
|
|
66
66
|
enumerable: true,
|
|
67
|
-
get: function () { return
|
|
67
|
+
get: function () { return chunkNGQCWFKF_js.AddOnInDetailsSchema; }
|
|
68
68
|
});
|
|
69
69
|
Object.defineProperty(exports, "AddOnOptionDetailsSchema", {
|
|
70
70
|
enumerable: true,
|
|
71
|
-
get: function () { return
|
|
71
|
+
get: function () { return chunkNGQCWFKF_js.AddOnOptionDetailsSchema; }
|
|
72
72
|
});
|
|
73
73
|
Object.defineProperty(exports, "AuthorizationTypeSchema", {
|
|
74
74
|
enumerable: true,
|
|
75
|
-
get: function () { return
|
|
75
|
+
get: function () { return chunkNGQCWFKF_js.AuthorizationTypeSchema; }
|
|
76
76
|
});
|
|
77
77
|
Object.defineProperty(exports, "BrandContactSchema", {
|
|
78
78
|
enumerable: true,
|
|
79
|
-
get: function () { return
|
|
79
|
+
get: function () { return chunkNGQCWFKF_js.BrandContactSchema; }
|
|
80
80
|
});
|
|
81
81
|
Object.defineProperty(exports, "BrandFaqSchema", {
|
|
82
82
|
enumerable: true,
|
|
83
|
-
get: function () { return
|
|
83
|
+
get: function () { return chunkNGQCWFKF_js.BrandFaqSchema; }
|
|
84
84
|
});
|
|
85
85
|
Object.defineProperty(exports, "BrandHeroSchema", {
|
|
86
86
|
enumerable: true,
|
|
87
|
-
get: function () { return
|
|
87
|
+
get: function () { return chunkNGQCWFKF_js.BrandHeroSchema; }
|
|
88
88
|
});
|
|
89
89
|
Object.defineProperty(exports, "BrandNavLinkSchema", {
|
|
90
90
|
enumerable: true,
|
|
91
|
-
get: function () { return
|
|
91
|
+
get: function () { return chunkNGQCWFKF_js.BrandNavLinkSchema; }
|
|
92
92
|
});
|
|
93
93
|
Object.defineProperty(exports, "BrandPolicyPageSchema", {
|
|
94
94
|
enumerable: true,
|
|
95
|
-
get: function () { return
|
|
95
|
+
get: function () { return chunkNGQCWFKF_js.BrandPolicyPageSchema; }
|
|
96
96
|
});
|
|
97
97
|
Object.defineProperty(exports, "BrandPolicySectionSchema", {
|
|
98
98
|
enumerable: true,
|
|
99
|
-
get: function () { return
|
|
99
|
+
get: function () { return chunkNGQCWFKF_js.BrandPolicySectionSchema; }
|
|
100
100
|
});
|
|
101
101
|
Object.defineProperty(exports, "BrandSchema", {
|
|
102
102
|
enumerable: true,
|
|
103
|
-
get: function () { return
|
|
103
|
+
get: function () { return chunkNGQCWFKF_js.BrandSchema; }
|
|
104
104
|
});
|
|
105
105
|
Object.defineProperty(exports, "BrandSocialSchema", {
|
|
106
106
|
enumerable: true,
|
|
107
|
-
get: function () { return
|
|
107
|
+
get: function () { return chunkNGQCWFKF_js.BrandSocialSchema; }
|
|
108
108
|
});
|
|
109
109
|
Object.defineProperty(exports, "BundleResolvedSchema", {
|
|
110
110
|
enumerable: true,
|
|
111
|
-
get: function () { return
|
|
111
|
+
get: function () { return chunkNGQCWFKF_js.BundleResolvedSchema; }
|
|
112
112
|
});
|
|
113
113
|
Object.defineProperty(exports, "BundleSelectionInputSchema", {
|
|
114
114
|
enumerable: true,
|
|
115
|
-
get: function () { return
|
|
115
|
+
get: function () { return chunkNGQCWFKF_js.BundleSelectionInputSchema; }
|
|
116
116
|
});
|
|
117
117
|
Object.defineProperty(exports, "CartItemSchema", {
|
|
118
118
|
enumerable: true,
|
|
119
|
-
get: function () { return
|
|
119
|
+
get: function () { return chunkNGQCWFKF_js.CartItemSchema; }
|
|
120
120
|
});
|
|
121
121
|
Object.defineProperty(exports, "CartPricingSchema", {
|
|
122
122
|
enumerable: true,
|
|
123
|
-
get: function () { return
|
|
123
|
+
get: function () { return chunkNGQCWFKF_js.CartPricingSchema; }
|
|
124
124
|
});
|
|
125
125
|
Object.defineProperty(exports, "CartSchema", {
|
|
126
126
|
enumerable: true,
|
|
127
|
-
get: function () { return
|
|
127
|
+
get: function () { return chunkNGQCWFKF_js.CartSchema; }
|
|
128
128
|
});
|
|
129
129
|
Object.defineProperty(exports, "CheckoutBodySchema", {
|
|
130
130
|
enumerable: true,
|
|
131
|
-
get: function () { return
|
|
131
|
+
get: function () { return chunkNGQCWFKF_js.CheckoutBodySchema; }
|
|
132
132
|
});
|
|
133
133
|
Object.defineProperty(exports, "CheckoutCustomerSchema", {
|
|
134
134
|
enumerable: true,
|
|
135
|
-
get: function () { return
|
|
135
|
+
get: function () { return chunkNGQCWFKF_js.CheckoutCustomerSchema; }
|
|
136
136
|
});
|
|
137
137
|
Object.defineProperty(exports, "CheckoutResponseSchema", {
|
|
138
138
|
enumerable: true,
|
|
139
|
-
get: function () { return
|
|
139
|
+
get: function () { return chunkNGQCWFKF_js.CheckoutResponseSchema; }
|
|
140
140
|
});
|
|
141
141
|
Object.defineProperty(exports, "ChosenPriceSchema", {
|
|
142
142
|
enumerable: true,
|
|
143
|
-
get: function () { return
|
|
143
|
+
get: function () { return chunkNGQCWFKF_js.ChosenPriceSchema; }
|
|
144
144
|
});
|
|
145
145
|
Object.defineProperty(exports, "CompositeResolvedSchema", {
|
|
146
146
|
enumerable: true,
|
|
147
|
-
get: function () { return
|
|
147
|
+
get: function () { return chunkNGQCWFKF_js.CompositeResolvedSchema; }
|
|
148
148
|
});
|
|
149
149
|
Object.defineProperty(exports, "CompositeSelectionInputSchema", {
|
|
150
150
|
enumerable: true,
|
|
151
|
-
get: function () { return
|
|
151
|
+
get: function () { return chunkNGQCWFKF_js.CompositeSelectionInputSchema; }
|
|
152
152
|
});
|
|
153
153
|
Object.defineProperty(exports, "CountryCodeSchema", {
|
|
154
154
|
enumerable: true,
|
|
155
|
-
get: function () { return
|
|
155
|
+
get: function () { return chunkNGQCWFKF_js.CountryCodeSchema; }
|
|
156
156
|
});
|
|
157
157
|
Object.defineProperty(exports, "CurrencyCodeSchema", {
|
|
158
158
|
enumerable: true,
|
|
159
|
-
get: function () { return
|
|
159
|
+
get: function () { return chunkNGQCWFKF_js.CurrencyCodeSchema; }
|
|
160
160
|
});
|
|
161
161
|
Object.defineProperty(exports, "CustomerInputValueSchema", {
|
|
162
162
|
enumerable: true,
|
|
163
|
-
get: function () { return
|
|
163
|
+
get: function () { return chunkNGQCWFKF_js.CustomerInputValueSchema; }
|
|
164
164
|
});
|
|
165
165
|
Object.defineProperty(exports, "DiscountDetailsSchema", {
|
|
166
166
|
enumerable: true,
|
|
167
|
-
get: function () { return
|
|
167
|
+
get: function () { return chunkNGQCWFKF_js.DiscountDetailsSchema; }
|
|
168
168
|
});
|
|
169
169
|
Object.defineProperty(exports, "IsoDateTimeSchema", {
|
|
170
170
|
enumerable: true,
|
|
171
|
-
get: function () { return
|
|
171
|
+
get: function () { return chunkNGQCWFKF_js.IsoDateTimeSchema; }
|
|
172
172
|
});
|
|
173
173
|
Object.defineProperty(exports, "LineTypeSchema", {
|
|
174
174
|
enumerable: true,
|
|
175
|
-
get: function () { return
|
|
175
|
+
get: function () { return chunkNGQCWFKF_js.LineTypeSchema; }
|
|
176
176
|
});
|
|
177
177
|
Object.defineProperty(exports, "LocaleSchema", {
|
|
178
178
|
enumerable: true,
|
|
179
|
-
get: function () { return
|
|
179
|
+
get: function () { return chunkNGQCWFKF_js.LocaleSchema; }
|
|
180
180
|
});
|
|
181
181
|
Object.defineProperty(exports, "MoneyLooseSchema", {
|
|
182
182
|
enumerable: true,
|
|
183
|
-
get: function () { return
|
|
183
|
+
get: function () { return chunkNGQCWFKF_js.MoneyLooseSchema; }
|
|
184
184
|
});
|
|
185
185
|
Object.defineProperty(exports, "MoneySchema", {
|
|
186
186
|
enumerable: true,
|
|
187
|
-
get: function () { return
|
|
187
|
+
get: function () { return chunkNGQCWFKF_js.MoneySchema; }
|
|
188
188
|
});
|
|
189
189
|
Object.defineProperty(exports, "NextActionSchema", {
|
|
190
190
|
enumerable: true,
|
|
191
|
-
get: function () { return
|
|
191
|
+
get: function () { return chunkNGQCWFKF_js.NextActionSchema; }
|
|
192
192
|
});
|
|
193
193
|
Object.defineProperty(exports, "PhoneE164Schema", {
|
|
194
194
|
enumerable: true,
|
|
195
|
-
get: function () { return
|
|
195
|
+
get: function () { return chunkNGQCWFKF_js.PhoneE164Schema; }
|
|
196
196
|
});
|
|
197
197
|
Object.defineProperty(exports, "ProductTypeSchema", {
|
|
198
198
|
enumerable: true,
|
|
199
|
-
get: function () { return
|
|
199
|
+
get: function () { return chunkNGQCWFKF_js.ProductTypeSchema; }
|
|
200
200
|
});
|
|
201
201
|
Object.defineProperty(exports, "SchemaViolationError", {
|
|
202
202
|
enumerable: true,
|
|
203
|
-
get: function () { return
|
|
203
|
+
get: function () { return chunkNGQCWFKF_js.SchemaViolationError; }
|
|
204
204
|
});
|
|
205
205
|
Object.defineProperty(exports, "SeedNameSchema", {
|
|
206
206
|
enumerable: true,
|
|
207
|
-
get: function () { return
|
|
207
|
+
get: function () { return chunkNGQCWFKF_js.SeedNameSchema; }
|
|
208
208
|
});
|
|
209
209
|
Object.defineProperty(exports, "SelectedAddOnOptionSchema", {
|
|
210
210
|
enumerable: true,
|
|
211
|
-
get: function () { return
|
|
211
|
+
get: function () { return chunkNGQCWFKF_js.SelectedAddOnOptionSchema; }
|
|
212
212
|
});
|
|
213
213
|
Object.defineProperty(exports, "ServiceStatusSchema", {
|
|
214
214
|
enumerable: true,
|
|
215
|
-
get: function () { return
|
|
215
|
+
get: function () { return chunkNGQCWFKF_js.ServiceStatusSchema; }
|
|
216
216
|
});
|
|
217
217
|
Object.defineProperty(exports, "TimestampSchema", {
|
|
218
218
|
enumerable: true,
|
|
219
|
-
get: function () { return
|
|
219
|
+
get: function () { return chunkNGQCWFKF_js.TimestampSchema; }
|
|
220
220
|
});
|
|
221
221
|
Object.defineProperty(exports, "VariantDetailsSchema", {
|
|
222
222
|
enumerable: true,
|
|
223
|
-
get: function () { return
|
|
223
|
+
get: function () { return chunkNGQCWFKF_js.VariantDetailsSchema; }
|
|
224
224
|
});
|
|
225
225
|
Object.defineProperty(exports, "VariantDisplayAttributeSchema", {
|
|
226
226
|
enumerable: true,
|
|
227
|
-
get: function () { return
|
|
227
|
+
get: function () { return chunkNGQCWFKF_js.VariantDisplayAttributeSchema; }
|
|
228
228
|
});
|
|
229
229
|
Object.defineProperty(exports, "VariantInfoSchema", {
|
|
230
230
|
enumerable: true,
|
|
231
|
-
get: function () { return
|
|
231
|
+
get: function () { return chunkNGQCWFKF_js.VariantInfoSchema; }
|
|
232
232
|
});
|
|
233
233
|
Object.defineProperty(exports, "assertAddItemPayload", {
|
|
234
234
|
enumerable: true,
|
|
235
|
-
get: function () { return
|
|
235
|
+
get: function () { return chunkNGQCWFKF_js.assertAddItemPayload; }
|
|
236
236
|
});
|
|
237
237
|
Object.defineProperty(exports, "assertBrand", {
|
|
238
238
|
enumerable: true,
|
|
239
|
-
get: function () { return
|
|
239
|
+
get: function () { return chunkNGQCWFKF_js.assertBrand; }
|
|
240
240
|
});
|
|
241
241
|
Object.defineProperty(exports, "assertCart", {
|
|
242
242
|
enumerable: true,
|
|
243
|
-
get: function () { return
|
|
243
|
+
get: function () { return chunkNGQCWFKF_js.assertCart; }
|
|
244
244
|
});
|
|
245
245
|
Object.defineProperty(exports, "assertCartItem", {
|
|
246
246
|
enumerable: true,
|
|
247
|
-
get: function () { return
|
|
247
|
+
get: function () { return chunkNGQCWFKF_js.assertCartItem; }
|
|
248
248
|
});
|
|
249
249
|
Object.defineProperty(exports, "assertCheckoutBody", {
|
|
250
250
|
enumerable: true,
|
|
251
|
-
get: function () { return
|
|
251
|
+
get: function () { return chunkNGQCWFKF_js.assertCheckoutBody; }
|
|
252
252
|
});
|
|
253
253
|
Object.defineProperty(exports, "assertCheckoutResponse", {
|
|
254
254
|
enumerable: true,
|
|
255
|
-
get: function () { return
|
|
255
|
+
get: function () { return chunkNGQCWFKF_js.assertCheckoutResponse; }
|
|
256
256
|
});
|
|
257
257
|
Object.defineProperty(exports, "cimplifyRegistry", {
|
|
258
258
|
enumerable: true,
|
|
259
|
-
get: function () { return
|
|
259
|
+
get: function () { return chunkNGQCWFKF_js.cimplifyRegistry; }
|
|
260
260
|
});
|
|
261
261
|
Object.defineProperty(exports, "createTestClient", {
|
|
262
262
|
enumerable: true,
|
|
263
|
-
get: function () { return
|
|
263
|
+
get: function () { return chunkNGQCWFKF_js.createTestClient; }
|
|
264
264
|
});
|
|
265
265
|
Object.defineProperty(exports, "fixtures", {
|
|
266
266
|
enumerable: true,
|
|
267
|
-
get: function () { return
|
|
267
|
+
get: function () { return chunkNGQCWFKF_js.fixtures; }
|
|
268
268
|
});
|
|
269
269
|
Object.defineProperty(exports, "makeAssertion", {
|
|
270
270
|
enumerable: true,
|
|
271
|
-
get: function () { return
|
|
271
|
+
get: function () { return chunkNGQCWFKF_js.makeAssertion; }
|
|
272
272
|
});
|
|
273
273
|
Object.defineProperty(exports, "registerSchema", {
|
|
274
274
|
enumerable: true,
|
|
275
|
-
get: function () { return
|
|
275
|
+
get: function () { return chunkNGQCWFKF_js.registerSchema; }
|
|
276
276
|
});
|
|
277
277
|
exports.exportJsonSchemas = exportJsonSchemas;
|
|
278
278
|
exports.listRegisteredSchemas = listRegisteredSchemas;
|
package/dist/testing.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { VariantInfoSchema, CheckoutResponseSchema, CheckoutBodySchema, CartPricingSchema, CartItemSchema, CartSchema, AddItemPayloadSchema, BrandSchema, cimplifyRegistry } from './chunk-
|
|
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-
|
|
1
|
+
import { VariantInfoSchema, CheckoutResponseSchema, CheckoutBodySchema, CartPricingSchema, CartItemSchema, CartSchema, AddItemPayloadSchema, BrandSchema, cimplifyRegistry } from './chunk-TAKORJP4.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-TAKORJP4.mjs';
|
|
3
3
|
import './chunk-FVGVJ4TC.mjs';
|
|
4
|
-
import './chunk-
|
|
5
|
-
import './chunk-
|
|
4
|
+
import './chunk-KNPE4WCQ.mjs';
|
|
5
|
+
import './chunk-SOV4H6PQ.mjs';
|
|
6
6
|
import './chunk-TD3AY34U.mjs';
|
|
7
7
|
import './chunk-AMZXALF6.mjs';
|
|
8
8
|
import './chunk-3G6RQLXK.mjs';
|
package/package.json
CHANGED
package/registry/index.json
CHANGED
|
@@ -660,15 +660,6 @@
|
|
|
660
660
|
"cn"
|
|
661
661
|
]
|
|
662
662
|
},
|
|
663
|
-
{
|
|
664
|
-
"name": "account",
|
|
665
|
-
"title": "CimplifyAccount",
|
|
666
|
-
"description": "Iframe wrapper for the Cimplify account portal — sign-in, orders, addresses, settings.",
|
|
667
|
-
"type": "component",
|
|
668
|
-
"registryDependencies": [
|
|
669
|
-
"cn"
|
|
670
|
-
]
|
|
671
|
-
},
|
|
672
663
|
{
|
|
673
664
|
"name": "billing-plan-selector",
|
|
674
665
|
"title": "BillingPlanSelector",
|
package/registry/account.json
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "account",
|
|
3
|
-
"title": "CimplifyAccount",
|
|
4
|
-
"description": "Iframe wrapper for the Cimplify account portal — sign-in, orders, addresses, settings.",
|
|
5
|
-
"type": "component",
|
|
6
|
-
"registryDependencies": [
|
|
7
|
-
"cn"
|
|
8
|
-
],
|
|
9
|
-
"files": [
|
|
10
|
-
{
|
|
11
|
-
"path": "account.tsx",
|
|
12
|
-
"content": "\"use client\";\n\nimport React, { useEffect, useRef, useState, useMemo } from \"react\";\nimport type { CimplifyClient } from \"../client\";\nimport { useOptionalCimplify } from \"@cimplify/sdk/react\";\nimport { cn } from \"@cimplify/sdk/react\";\n\nexport interface CimplifyAccountProps {\n /** CimplifyClient instance. Falls back to provider context. */\n client?: CimplifyClient;\n /** Override the Link base URL. */\n linkUrl?: string;\n /** Initial section to show: \"dashboard\" | \"orders\" | \"addresses\" | \"payment-methods\" | \"sessions\" | \"settings\". */\n section?: string;\n /**\n * Per-merchant scope for the embedded account widget. When set, the\n * widget filters orders/subs/sessions to this business and hides\n * cross-merchant surfaces. Defaults to the client's configured\n * business ID so storefronts get scoping for free.\n */\n businessId?: string;\n /**\n * Display name of the embedding merchant — shown in the widget's\n * scoping footer (\"Showing your account with Acme Threads only.\").\n * Optional but recommended for trust signal.\n */\n merchantName?: string;\n /** Appearance variables — passed to Link for theming. */\n appearance?: {\n theme?: \"light\" | \"dark\";\n variables?: {\n primaryColor?: string;\n fontFamily?: string;\n borderRadius?: string;\n };\n };\n /** Called when the user logs out from the account portal. */\n onLogout?: () => void;\n /** Additional CSS class for the container. */\n className?: string;\n}\n\nconst DEFAULT_LINK_URL = \"https://link.cimplify.io\";\n\nexport function CimplifyAccount({\n client: clientProp,\n linkUrl,\n section,\n businessId: businessIdProp,\n merchantName,\n appearance,\n onLogout,\n className,\n}: CimplifyAccountProps): React.ReactElement {\n const context = useOptionalCimplify();\n const client = clientProp ?? context?.client;\n const resolvedLinkUrl = linkUrl || DEFAULT_LINK_URL;\n const resolvedBusinessId = businessIdProp || client?.getBusinessId?.() || \"\";\n\n const iframeRef = useRef<HTMLIFrameElement | null>(null);\n const [height, setHeight] = useState(400);\n const [isReady, setIsReady] = useState(false);\n\n const iframeSrc = useMemo(() => {\n const path = section ? `/elements/account/${section}` : \"/elements/account\";\n const url = new URL(path, resolvedLinkUrl);\n if (resolvedBusinessId) url.searchParams.set(\"businessId\", resolvedBusinessId);\n return url.toString();\n }, [resolvedLinkUrl, section, resolvedBusinessId]);\n\n // Listen for messages from the iframe\n useEffect(() => {\n function handleMessage(event: MessageEvent) {\n if (!event.data || typeof event.data !== \"object\") return;\n\n // Only accept messages from our iframe\n if (iframeRef.current?.contentWindow && event.source !== iframeRef.current.contentWindow) {\n return;\n }\n\n switch (event.data.type) {\n case \"ready\":\n setIsReady(true);\n if (typeof event.data.height === \"number\") {\n setHeight(event.data.height);\n }\n // Send init with token + appearance\n sendInit();\n break;\n\n case \"height_change\":\n if (typeof event.data.height === \"number\") {\n setHeight(event.data.height);\n }\n break;\n\n case \"logout_complete\":\n onLogout?.();\n break;\n }\n }\n\n window.addEventListener(\"message\", handleMessage);\n return () => window.removeEventListener(\"message\", handleMessage);\n }, [appearance, client, onLogout]);\n\n function sendInit() {\n const contentWindow = iframeRef.current?.contentWindow;\n if (!contentWindow) return;\n\n const token = client?.getAccessToken?.();\n contentWindow.postMessage(\n {\n type: \"init\",\n token: token ?? undefined,\n appearance: appearance ?? undefined,\n businessId: resolvedBusinessId || undefined,\n merchantName: merchantName ?? undefined,\n },\n resolvedLinkUrl,\n );\n }\n\n return (\n <div\n data-cimplify-account\n className={cn(\"relative overflow-hidden\", className)}\n >\n {!isReady && (\n <div className=\"flex items-center justify-center py-16\">\n <div className=\"w-6 h-6 border-2 border-border border-t-foreground rounded-full animate-spin\" />\n </div>\n )}\n <iframe\n ref={iframeRef}\n src={iframeSrc}\n style={{\n border: \"none\",\n width: \"100%\",\n height: `${height}px`,\n display: isReady ? \"block\" : \"none\",\n overflow: \"hidden\",\n background: \"transparent\",\n }}\n allow=\"geolocation\"\n sandbox=\"allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox\"\n />\n </div>\n );\n}\n"
|
|
13
|
-
}
|
|
14
|
-
]
|
|
15
|
-
}
|