@visual-platform/contracts 0.0.0-stage → 0.1.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/classes.d.ts +11 -0
- package/dist/classes.d.ts.map +1 -0
- package/dist/classes.js +34 -0
- package/dist/classes.js.map +1 -0
- package/dist/component.d.ts +135 -0
- package/dist/component.d.ts.map +1 -0
- package/dist/component.js +176 -0
- package/dist/component.js.map +1 -0
- package/dist/data.d.ts +152 -0
- package/dist/data.d.ts.map +1 -0
- package/dist/data.js +336 -0
- package/dist/data.js.map +1 -0
- package/dist/design.d.ts +139 -0
- package/dist/design.d.ts.map +1 -0
- package/dist/design.js +226 -0
- package/dist/design.js.map +1 -0
- package/dist/events.d.ts +36 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +46 -0
- package/dist/events.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/locales.d.ts +37 -0
- package/dist/locales.d.ts.map +1 -0
- package/dist/locales.js +36 -0
- package/dist/locales.js.map +1 -0
- package/dist/page-document.d.ts +202 -0
- package/dist/page-document.d.ts.map +1 -0
- package/dist/page-document.js +71 -0
- package/dist/page-document.js.map +1 -0
- package/dist/published.d.ts +353 -0
- package/dist/published.d.ts.map +1 -0
- package/dist/published.js +66 -0
- package/dist/published.js.map +1 -0
- package/dist/references.d.ts +51 -0
- package/dist/references.d.ts.map +1 -0
- package/dist/references.js +35 -0
- package/dist/references.js.map +1 -0
- package/dist/responsive.d.ts +19 -0
- package/dist/responsive.d.ts.map +1 -0
- package/dist/responsive.js +18 -0
- package/dist/responsive.js.map +1 -0
- package/dist/section.d.ts +33 -0
- package/dist/section.d.ts.map +1 -0
- package/dist/section.js +53 -0
- package/dist/section.js.map +1 -0
- package/dist/seo.d.ts +98 -0
- package/dist/seo.d.ts.map +1 -0
- package/dist/seo.js +71 -0
- package/dist/seo.js.map +1 -0
- package/dist/tables.d.ts +134 -0
- package/dist/tables.d.ts.map +1 -0
- package/dist/tables.js +438 -0
- package/dist/tables.js.map +1 -0
- package/package.json +31 -3
- package/README.md +0 -3
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type DataInput, type NodeBindings } from "./data.js";
|
|
3
|
+
/** Current canonical document schema version. Bump only through an RFC + migration. */
|
|
4
|
+
export declare const PAGE_DOCUMENT_SCHEMA_VERSION: 1;
|
|
5
|
+
/** Stable node id assigned by the server: `n_` + nanoid (blueprint 31 §5). */
|
|
6
|
+
export declare const NodeIdSchema: z.ZodString;
|
|
7
|
+
/**
|
|
8
|
+
* Plugin-owned data, namespaced by plugin id, each with its own schema version `v`
|
|
9
|
+
* (blueprint 35 §4). Stripped from published documents.
|
|
10
|
+
*/
|
|
11
|
+
export declare const ExtensionDataSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
12
|
+
v: z.ZodNumber;
|
|
13
|
+
}, z.core.$loose>>;
|
|
14
|
+
export type ExtensionData = z.infer<typeof ExtensionDataSchema>;
|
|
15
|
+
export declare const NodeMetaSchema: z.ZodObject<{
|
|
16
|
+
origin: z.ZodOptional<z.ZodEnum<{
|
|
17
|
+
ai: "ai";
|
|
18
|
+
migration: "migration";
|
|
19
|
+
user: "user";
|
|
20
|
+
}>>;
|
|
21
|
+
}, z.core.$strict>;
|
|
22
|
+
export type ComponentNode = {
|
|
23
|
+
id: string;
|
|
24
|
+
type: string;
|
|
25
|
+
props: Record<string, unknown>;
|
|
26
|
+
/** Tailwind utility classes applied to the block's root element (ADR-029). */
|
|
27
|
+
className?: string | undefined;
|
|
28
|
+
/** Element events bound to app event names, e.g. { submit: "onSubscribe" } (ADR-032). */
|
|
29
|
+
events?: Partial<Record<"click" | "change" | "blur" | "enter" | "submit" | "reset" | "toggle", string>> | undefined;
|
|
30
|
+
/** Props bound to data fields, e.g. { title: { path: "item.name" } }; props keep the fallback (ADR-034). */
|
|
31
|
+
bind?: NodeBindings | undefined;
|
|
32
|
+
slots?: Record<string, ComponentNode[]> | undefined;
|
|
33
|
+
dataBinding?: Record<string, unknown> | undefined;
|
|
34
|
+
ext?: ExtensionData | undefined;
|
|
35
|
+
meta?: z.infer<typeof NodeMetaSchema> | undefined;
|
|
36
|
+
};
|
|
37
|
+
export declare const ComponentNodeSchema: z.ZodType<ComponentNode>;
|
|
38
|
+
export declare const RootPropsSchema: z.ZodObject<{
|
|
39
|
+
seo: z.ZodObject<{
|
|
40
|
+
slug: z.ZodString;
|
|
41
|
+
title: z.ZodString;
|
|
42
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
43
|
+
canonical: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
44
|
+
robots: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
45
|
+
index: z.ZodBoolean;
|
|
46
|
+
follow: z.ZodBoolean;
|
|
47
|
+
}, z.core.$strict>>>;
|
|
48
|
+
og: z.ZodOptional<z.ZodObject<{
|
|
49
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
50
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
51
|
+
image: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
|
|
52
|
+
url: z.ZodString;
|
|
53
|
+
alt: z.ZodOptional<z.ZodString>;
|
|
54
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
55
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
56
|
+
assetId: z.ZodOptional<z.ZodString>;
|
|
57
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
58
|
+
assetId: z.ZodString;
|
|
59
|
+
alt: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
60
|
+
decorative: z.ZodOptional<z.ZodBoolean>;
|
|
61
|
+
focal: z.ZodOptional<z.ZodObject<{
|
|
62
|
+
x: z.ZodNumber;
|
|
63
|
+
y: z.ZodNumber;
|
|
64
|
+
}, z.core.$strict>>;
|
|
65
|
+
}, z.core.$strict>]>>>;
|
|
66
|
+
}, z.core.$strict>>;
|
|
67
|
+
structuredData: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
68
|
+
template: z.ZodEnum<{
|
|
69
|
+
Article: "Article";
|
|
70
|
+
BreadcrumbList: "BreadcrumbList";
|
|
71
|
+
Event: "Event";
|
|
72
|
+
FAQPage: "FAQPage";
|
|
73
|
+
Offer: "Offer";
|
|
74
|
+
Organization: "Organization";
|
|
75
|
+
Product: "Product";
|
|
76
|
+
}>;
|
|
77
|
+
fields: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
78
|
+
}, z.core.$strict>>>;
|
|
79
|
+
}, z.core.$strict>;
|
|
80
|
+
theme: z.ZodOptional<z.ZodString>;
|
|
81
|
+
data: z.ZodOptional<z.ZodLazy<z.ZodArray<z.ZodObject<{
|
|
82
|
+
name: z.ZodString;
|
|
83
|
+
label: z.ZodOptional<z.ZodString>;
|
|
84
|
+
source: z.ZodDefault<z.ZodEnum<{
|
|
85
|
+
app: "app";
|
|
86
|
+
table: "table";
|
|
87
|
+
}>>;
|
|
88
|
+
shape: z.ZodEnum<{
|
|
89
|
+
list: "list";
|
|
90
|
+
object: "object";
|
|
91
|
+
}>;
|
|
92
|
+
fields: z.ZodArray<z.ZodType<import("./data.js").DataField, unknown, z.core.$ZodTypeInternals<import("./data.js").DataField, unknown>>>;
|
|
93
|
+
sample: z.ZodOptional<z.ZodUnknown>;
|
|
94
|
+
query: z.ZodOptional<z.ZodLazy<z.ZodObject<{
|
|
95
|
+
table: z.ZodString;
|
|
96
|
+
where: z.ZodOptional<z.ZodType<import("./tables.js").Filter, unknown, z.core.$ZodTypeInternals<import("./tables.js").Filter, unknown>>>;
|
|
97
|
+
sort: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
98
|
+
field: z.ZodString;
|
|
99
|
+
dir: z.ZodDefault<z.ZodEnum<{
|
|
100
|
+
asc: "asc";
|
|
101
|
+
desc: "desc";
|
|
102
|
+
}>>;
|
|
103
|
+
}, z.core.$strict>>>;
|
|
104
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
105
|
+
offset: z.ZodDefault<z.ZodNumber>;
|
|
106
|
+
include: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
107
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
108
|
+
}, z.core.$strict>>>;
|
|
109
|
+
single: z.ZodOptional<z.ZodBoolean>;
|
|
110
|
+
}, z.core.$strict>>>>;
|
|
111
|
+
}, z.core.$catchall<z.ZodUnknown>>;
|
|
112
|
+
export declare const PageDocumentSchema: z.ZodObject<{
|
|
113
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
114
|
+
locale: z.ZodString;
|
|
115
|
+
root: z.ZodObject<{
|
|
116
|
+
props: z.ZodObject<{
|
|
117
|
+
seo: z.ZodObject<{
|
|
118
|
+
slug: z.ZodString;
|
|
119
|
+
title: z.ZodString;
|
|
120
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
121
|
+
canonical: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
122
|
+
robots: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
123
|
+
index: z.ZodBoolean;
|
|
124
|
+
follow: z.ZodBoolean;
|
|
125
|
+
}, z.core.$strict>>>;
|
|
126
|
+
og: z.ZodOptional<z.ZodObject<{
|
|
127
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
128
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
129
|
+
image: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
|
|
130
|
+
url: z.ZodString;
|
|
131
|
+
alt: z.ZodOptional<z.ZodString>;
|
|
132
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
133
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
134
|
+
assetId: z.ZodOptional<z.ZodString>;
|
|
135
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
136
|
+
assetId: z.ZodString;
|
|
137
|
+
alt: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
138
|
+
decorative: z.ZodOptional<z.ZodBoolean>;
|
|
139
|
+
focal: z.ZodOptional<z.ZodObject<{
|
|
140
|
+
x: z.ZodNumber;
|
|
141
|
+
y: z.ZodNumber;
|
|
142
|
+
}, z.core.$strict>>;
|
|
143
|
+
}, z.core.$strict>]>>>;
|
|
144
|
+
}, z.core.$strict>>;
|
|
145
|
+
structuredData: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
146
|
+
template: z.ZodEnum<{
|
|
147
|
+
Article: "Article";
|
|
148
|
+
BreadcrumbList: "BreadcrumbList";
|
|
149
|
+
Event: "Event";
|
|
150
|
+
FAQPage: "FAQPage";
|
|
151
|
+
Offer: "Offer";
|
|
152
|
+
Organization: "Organization";
|
|
153
|
+
Product: "Product";
|
|
154
|
+
}>;
|
|
155
|
+
fields: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
156
|
+
}, z.core.$strict>>>;
|
|
157
|
+
}, z.core.$strict>;
|
|
158
|
+
theme: z.ZodOptional<z.ZodString>;
|
|
159
|
+
data: z.ZodOptional<z.ZodLazy<z.ZodArray<z.ZodObject<{
|
|
160
|
+
name: z.ZodString;
|
|
161
|
+
label: z.ZodOptional<z.ZodString>;
|
|
162
|
+
source: z.ZodDefault<z.ZodEnum<{
|
|
163
|
+
app: "app";
|
|
164
|
+
table: "table";
|
|
165
|
+
}>>;
|
|
166
|
+
shape: z.ZodEnum<{
|
|
167
|
+
list: "list";
|
|
168
|
+
object: "object";
|
|
169
|
+
}>;
|
|
170
|
+
fields: z.ZodArray<z.ZodType<import("./data.js").DataField, unknown, z.core.$ZodTypeInternals<import("./data.js").DataField, unknown>>>;
|
|
171
|
+
sample: z.ZodOptional<z.ZodUnknown>;
|
|
172
|
+
query: z.ZodOptional<z.ZodLazy<z.ZodObject<{
|
|
173
|
+
table: z.ZodString;
|
|
174
|
+
where: z.ZodOptional<z.ZodType<import("./tables.js").Filter, unknown, z.core.$ZodTypeInternals<import("./tables.js").Filter, unknown>>>;
|
|
175
|
+
sort: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
176
|
+
field: z.ZodString;
|
|
177
|
+
dir: z.ZodDefault<z.ZodEnum<{
|
|
178
|
+
asc: "asc";
|
|
179
|
+
desc: "desc";
|
|
180
|
+
}>>;
|
|
181
|
+
}, z.core.$strict>>>;
|
|
182
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
183
|
+
offset: z.ZodDefault<z.ZodNumber>;
|
|
184
|
+
include: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
185
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
186
|
+
}, z.core.$strict>>>;
|
|
187
|
+
single: z.ZodOptional<z.ZodBoolean>;
|
|
188
|
+
}, z.core.$strict>>>>;
|
|
189
|
+
}, z.core.$catchall<z.ZodUnknown>>;
|
|
190
|
+
ext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
191
|
+
v: z.ZodNumber;
|
|
192
|
+
}, z.core.$loose>>>;
|
|
193
|
+
}, z.core.$strict>;
|
|
194
|
+
nodes: z.ZodArray<z.ZodType<ComponentNode, unknown, z.core.$ZodTypeInternals<ComponentNode, unknown>>>;
|
|
195
|
+
}, z.core.$strict>;
|
|
196
|
+
export type PageDocument = z.infer<typeof PageDocumentSchema>;
|
|
197
|
+
export type { DataInput };
|
|
198
|
+
/** Depth-first walk over every node, including nodes inside slots. */
|
|
199
|
+
export declare function walkNodes(nodes: readonly ComponentNode[]): Generator<ComponentNode>;
|
|
200
|
+
/** Remove all plugin `ext` data — used when building published documents (blueprint 52 Prepare step 10). */
|
|
201
|
+
export declare function stripExtensions(doc: PageDocument): PageDocument;
|
|
202
|
+
//# sourceMappingURL=page-document.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-document.d.ts","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C;AAEF,eAAO,MAAM,mBAAmB,EAAE,CAAC,CAAC,OAAO,CAAC,aAAa,CAexD,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCAOJ,CAAC;AAEzB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAOpB,CAAC;AACZ,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,YAAY,EAAE,SAAS,EAAE,CAAC;AAE1B,sEAAsE;AACtE,wBAAiB,SAAS,CAAC,KAAK,EAAE,SAAS,aAAa,EAAE,GAAG,SAAS,CAAC,aAAa,CAAC,CAKpF;AAED,4GAA4G;AAC5G,wBAAgB,eAAe,CAAC,GAAG,EAAE,YAAY,GAAG,YAAY,CAW/D"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { PageSeoSchema } from "./seo.js";
|
|
3
|
+
import { ClassNameSchema } from "./classes.js";
|
|
4
|
+
import { EventBindingsSchema } from "./events.js";
|
|
5
|
+
import { DataInputsSchema, NodeBindingsSchema } from "./data.js";
|
|
6
|
+
/** Current canonical document schema version. Bump only through an RFC + migration. */
|
|
7
|
+
export const PAGE_DOCUMENT_SCHEMA_VERSION = 1;
|
|
8
|
+
/** Stable node id assigned by the server: `n_` + nanoid (blueprint 31 §5). */
|
|
9
|
+
export const NodeIdSchema = z.string().regex(/^n_[A-Za-z0-9_-]{6,}$/, "node id must look like n_xxxxxx");
|
|
10
|
+
/**
|
|
11
|
+
* Plugin-owned data, namespaced by plugin id, each with its own schema version `v`
|
|
12
|
+
* (blueprint 35 §4). Stripped from published documents.
|
|
13
|
+
*/
|
|
14
|
+
export const ExtensionDataSchema = z.record(z.string().regex(/^[a-z][a-z0-9-]*(\.[a-z][a-z0-9-]*)+$/, "ext key must be a plugin id like group.name"), z.looseObject({ v: z.number().int().positive() }));
|
|
15
|
+
export const NodeMetaSchema = z
|
|
16
|
+
.object({ origin: z.enum(["user", "ai", "migration"]).optional() })
|
|
17
|
+
.strict();
|
|
18
|
+
export const ComponentNodeSchema = z.lazy(() => z
|
|
19
|
+
.object({
|
|
20
|
+
id: NodeIdSchema,
|
|
21
|
+
type: z.string().regex(/^[A-Z][A-Za-z0-9]*$/, "component type must be PascalCase"),
|
|
22
|
+
props: z.record(z.string(), z.unknown()),
|
|
23
|
+
className: z.lazy(() => ClassNameSchema).optional(),
|
|
24
|
+
events: z.lazy(() => EventBindingsSchema).optional(),
|
|
25
|
+
bind: z.lazy(() => NodeBindingsSchema).optional(),
|
|
26
|
+
slots: z.record(z.string(), z.array(ComponentNodeSchema)).optional(),
|
|
27
|
+
dataBinding: z.record(z.string(), z.unknown()).optional(),
|
|
28
|
+
ext: ExtensionDataSchema.optional(),
|
|
29
|
+
meta: NodeMetaSchema.optional(),
|
|
30
|
+
})
|
|
31
|
+
.strict());
|
|
32
|
+
export const RootPropsSchema = z
|
|
33
|
+
.object({
|
|
34
|
+
seo: PageSeoSchema,
|
|
35
|
+
theme: z.string().optional(),
|
|
36
|
+
/** Data inputs this page reads (ADR-034). */
|
|
37
|
+
data: z.lazy(() => DataInputsSchema).optional(),
|
|
38
|
+
})
|
|
39
|
+
.catchall(z.unknown());
|
|
40
|
+
export const PageDocumentSchema = z
|
|
41
|
+
.object({
|
|
42
|
+
schemaVersion: z.literal(PAGE_DOCUMENT_SCHEMA_VERSION),
|
|
43
|
+
locale: z.string().regex(/^[a-z]{2,3}(-[A-Z]{2})?$/, "locale must look like vi or en-SG"),
|
|
44
|
+
root: z.object({ props: RootPropsSchema, ext: ExtensionDataSchema.optional() }).strict(),
|
|
45
|
+
nodes: z.array(ComponentNodeSchema),
|
|
46
|
+
})
|
|
47
|
+
.strict();
|
|
48
|
+
/** Depth-first walk over every node, including nodes inside slots. */
|
|
49
|
+
export function* walkNodes(nodes) {
|
|
50
|
+
for (const node of nodes) {
|
|
51
|
+
yield node;
|
|
52
|
+
if (node.slots)
|
|
53
|
+
for (const children of Object.values(node.slots))
|
|
54
|
+
yield* walkNodes(children);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/** Remove all plugin `ext` data — used when building published documents (blueprint 52 Prepare step 10). */
|
|
58
|
+
export function stripExtensions(doc) {
|
|
59
|
+
const strip = (n) => {
|
|
60
|
+
const { ext: _ext, slots, ...rest } = n;
|
|
61
|
+
return slots
|
|
62
|
+
? { ...rest, slots: Object.fromEntries(Object.entries(slots).map(([k, v]) => [k, v.map(strip)])) }
|
|
63
|
+
: rest;
|
|
64
|
+
};
|
|
65
|
+
const { ext: _rootExt, ...root } = doc.root;
|
|
66
|
+
// Data samples are for the editor only (ADR-034).
|
|
67
|
+
if (Array.isArray(root.props.data))
|
|
68
|
+
root.props = { ...root.props, data: root.props.data.map(({ sample: _s, ...d }) => d) };
|
|
69
|
+
return { ...doc, root, nodes: doc.nodes.map(strip) };
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=page-document.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-document.js","sourceRoot":"","sources":["../src/page-document.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAqC,MAAM,WAAW,CAAC;AAEpG,uFAAuF;AACvF,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAU,CAAC;AAEvD,8EAA8E;AAC9E,MAAM,CAAC,MAAM,YAAY,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vD,CAAC"}
|
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** Published API contract `/v1` (blueprint 71 §3). Shared by apps/delivery-api and the SDK. */
|
|
3
|
+
export declare const PUBLISHED_API_VERSION: "v1";
|
|
4
|
+
export declare const ReleaseRefSchema: z.ZodObject<{
|
|
5
|
+
id: z.ZodString;
|
|
6
|
+
sequence: z.ZodNumber;
|
|
7
|
+
manifestHash: z.ZodString;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
export declare const ResolvedPageSchema: z.ZodObject<{
|
|
10
|
+
project: z.ZodObject<{
|
|
11
|
+
id: z.ZodString;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
release: z.ZodObject<{
|
|
14
|
+
id: z.ZodString;
|
|
15
|
+
sequence: z.ZodNumber;
|
|
16
|
+
manifestHash: z.ZodString;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
locale: z.ZodObject<{
|
|
19
|
+
requested: z.ZodString;
|
|
20
|
+
content: z.ZodString;
|
|
21
|
+
dir: z.ZodOptional<z.ZodEnum<{
|
|
22
|
+
ltr: "ltr";
|
|
23
|
+
rtl: "rtl";
|
|
24
|
+
}>>;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
page: z.ZodObject<{
|
|
27
|
+
pageKey: z.ZodString;
|
|
28
|
+
slug: z.ZodString;
|
|
29
|
+
artifactId: z.ZodString;
|
|
30
|
+
versionId: z.ZodString;
|
|
31
|
+
versionNumber: z.ZodNumber;
|
|
32
|
+
schemaVersion: z.ZodNumber;
|
|
33
|
+
document: z.ZodObject<{
|
|
34
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
35
|
+
locale: z.ZodString;
|
|
36
|
+
root: z.ZodObject<{
|
|
37
|
+
props: z.ZodObject<{
|
|
38
|
+
seo: z.ZodObject<{
|
|
39
|
+
slug: z.ZodString;
|
|
40
|
+
title: z.ZodString;
|
|
41
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
42
|
+
canonical: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
43
|
+
robots: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
44
|
+
index: z.ZodBoolean;
|
|
45
|
+
follow: z.ZodBoolean;
|
|
46
|
+
}, z.core.$strict>>>;
|
|
47
|
+
og: z.ZodOptional<z.ZodObject<{
|
|
48
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
49
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
50
|
+
image: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
|
|
51
|
+
url: z.ZodString;
|
|
52
|
+
alt: z.ZodOptional<z.ZodString>;
|
|
53
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
54
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
55
|
+
assetId: z.ZodOptional<z.ZodString>;
|
|
56
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
57
|
+
assetId: z.ZodString;
|
|
58
|
+
alt: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
59
|
+
decorative: z.ZodOptional<z.ZodBoolean>;
|
|
60
|
+
focal: z.ZodOptional<z.ZodObject<{
|
|
61
|
+
x: z.ZodNumber;
|
|
62
|
+
y: z.ZodNumber;
|
|
63
|
+
}, z.core.$strict>>;
|
|
64
|
+
}, z.core.$strict>]>>>;
|
|
65
|
+
}, z.core.$strict>>;
|
|
66
|
+
structuredData: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
67
|
+
template: z.ZodEnum<{
|
|
68
|
+
Article: "Article";
|
|
69
|
+
BreadcrumbList: "BreadcrumbList";
|
|
70
|
+
Event: "Event";
|
|
71
|
+
FAQPage: "FAQPage";
|
|
72
|
+
Offer: "Offer";
|
|
73
|
+
Organization: "Organization";
|
|
74
|
+
Product: "Product";
|
|
75
|
+
}>;
|
|
76
|
+
fields: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
77
|
+
}, z.core.$strict>>>;
|
|
78
|
+
}, z.core.$strict>;
|
|
79
|
+
theme: z.ZodOptional<z.ZodString>;
|
|
80
|
+
data: z.ZodOptional<z.ZodLazy<z.ZodArray<z.ZodObject<{
|
|
81
|
+
name: z.ZodString;
|
|
82
|
+
label: z.ZodOptional<z.ZodString>;
|
|
83
|
+
source: z.ZodDefault<z.ZodEnum<{
|
|
84
|
+
app: "app";
|
|
85
|
+
table: "table";
|
|
86
|
+
}>>;
|
|
87
|
+
shape: z.ZodEnum<{
|
|
88
|
+
list: "list";
|
|
89
|
+
object: "object";
|
|
90
|
+
}>;
|
|
91
|
+
fields: z.ZodArray<z.ZodType<import("./data.js").DataField, unknown, z.core.$ZodTypeInternals<import("./data.js").DataField, unknown>>>;
|
|
92
|
+
sample: z.ZodOptional<z.ZodUnknown>;
|
|
93
|
+
query: z.ZodOptional<z.ZodLazy<z.ZodObject<{
|
|
94
|
+
table: z.ZodString;
|
|
95
|
+
where: z.ZodOptional<z.ZodType<import("./tables.js").Filter, unknown, z.core.$ZodTypeInternals<import("./tables.js").Filter, unknown>>>;
|
|
96
|
+
sort: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
97
|
+
field: z.ZodString;
|
|
98
|
+
dir: z.ZodDefault<z.ZodEnum<{
|
|
99
|
+
asc: "asc";
|
|
100
|
+
desc: "desc";
|
|
101
|
+
}>>;
|
|
102
|
+
}, z.core.$strict>>>;
|
|
103
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
104
|
+
offset: z.ZodDefault<z.ZodNumber>;
|
|
105
|
+
include: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
106
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
107
|
+
}, z.core.$strict>>>;
|
|
108
|
+
single: z.ZodOptional<z.ZodBoolean>;
|
|
109
|
+
}, z.core.$strict>>>>;
|
|
110
|
+
}, z.core.$catchall<z.ZodUnknown>>;
|
|
111
|
+
ext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
112
|
+
v: z.ZodNumber;
|
|
113
|
+
}, z.core.$loose>>>;
|
|
114
|
+
}, z.core.$strict>;
|
|
115
|
+
nodes: z.ZodArray<z.ZodType<import("./page-document.js").ComponentNode, unknown, z.core.$ZodTypeInternals<import("./page-document.js").ComponentNode, unknown>>>;
|
|
116
|
+
}, z.core.$strict>;
|
|
117
|
+
}, z.core.$strip>;
|
|
118
|
+
seo: z.ZodObject<{
|
|
119
|
+
slug: z.ZodString;
|
|
120
|
+
title: z.ZodString;
|
|
121
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
122
|
+
canonical: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
123
|
+
robots: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
124
|
+
index: z.ZodBoolean;
|
|
125
|
+
follow: z.ZodBoolean;
|
|
126
|
+
}, z.core.$strict>>>;
|
|
127
|
+
og: z.ZodOptional<z.ZodObject<{
|
|
128
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
129
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
130
|
+
image: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
|
|
131
|
+
url: z.ZodString;
|
|
132
|
+
alt: z.ZodOptional<z.ZodString>;
|
|
133
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
134
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
135
|
+
assetId: z.ZodOptional<z.ZodString>;
|
|
136
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
137
|
+
assetId: z.ZodString;
|
|
138
|
+
alt: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
139
|
+
decorative: z.ZodOptional<z.ZodBoolean>;
|
|
140
|
+
focal: z.ZodOptional<z.ZodObject<{
|
|
141
|
+
x: z.ZodNumber;
|
|
142
|
+
y: z.ZodNumber;
|
|
143
|
+
}, z.core.$strict>>;
|
|
144
|
+
}, z.core.$strict>]>>>;
|
|
145
|
+
}, z.core.$strict>>;
|
|
146
|
+
structuredData: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
147
|
+
template: z.ZodEnum<{
|
|
148
|
+
Article: "Article";
|
|
149
|
+
BreadcrumbList: "BreadcrumbList";
|
|
150
|
+
Event: "Event";
|
|
151
|
+
FAQPage: "FAQPage";
|
|
152
|
+
Offer: "Offer";
|
|
153
|
+
Organization: "Organization";
|
|
154
|
+
Product: "Product";
|
|
155
|
+
}>;
|
|
156
|
+
fields: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
157
|
+
}, z.core.$strict>>>;
|
|
158
|
+
}, z.core.$strict>;
|
|
159
|
+
alternates: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
160
|
+
locale: z.ZodString;
|
|
161
|
+
slug: z.ZodString;
|
|
162
|
+
}, z.core.$strip>>>;
|
|
163
|
+
defaultLocale: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
164
|
+
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
165
|
+
design: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
166
|
+
vars: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
167
|
+
themes: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
168
|
+
fonts: z.ZodArray<z.ZodObject<{
|
|
169
|
+
family: z.ZodString;
|
|
170
|
+
faces: z.ZodArray<z.ZodObject<{
|
|
171
|
+
weight: z.ZodNumber;
|
|
172
|
+
style: z.ZodEnum<{
|
|
173
|
+
italic: "italic";
|
|
174
|
+
normal: "normal";
|
|
175
|
+
}>;
|
|
176
|
+
url: z.ZodString;
|
|
177
|
+
format: z.ZodEnum<{
|
|
178
|
+
opentype: "opentype";
|
|
179
|
+
truetype: "truetype";
|
|
180
|
+
woff: "woff";
|
|
181
|
+
woff2: "woff2";
|
|
182
|
+
}>;
|
|
183
|
+
unicodeRange: z.ZodOptional<z.ZodString>;
|
|
184
|
+
}, z.core.$strict>>;
|
|
185
|
+
}, z.core.$strip>>;
|
|
186
|
+
}, z.core.$strip>>>;
|
|
187
|
+
styles: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
188
|
+
compatibility: z.ZodObject<{
|
|
189
|
+
schemaVersion: z.ZodNumber;
|
|
190
|
+
minimumSdkVersion: z.ZodString;
|
|
191
|
+
}, z.core.$strip>;
|
|
192
|
+
}, z.core.$strip>;
|
|
193
|
+
export type ResolvedPage = z.infer<typeof ResolvedPageSchema>;
|
|
194
|
+
export declare const PageListSchema: z.ZodObject<{
|
|
195
|
+
release: z.ZodObject<{
|
|
196
|
+
id: z.ZodString;
|
|
197
|
+
sequence: z.ZodNumber;
|
|
198
|
+
manifestHash: z.ZodString;
|
|
199
|
+
}, z.core.$strip>;
|
|
200
|
+
pages: z.ZodArray<z.ZodObject<{
|
|
201
|
+
pageKey: z.ZodString;
|
|
202
|
+
locale: z.ZodString;
|
|
203
|
+
slug: z.ZodString;
|
|
204
|
+
}, z.core.$strip>>;
|
|
205
|
+
}, z.core.$strip>;
|
|
206
|
+
export type PageList = z.infer<typeof PageListSchema>;
|
|
207
|
+
export declare const ApiErrorSchema: z.ZodObject<{
|
|
208
|
+
error: z.ZodObject<{
|
|
209
|
+
code: z.ZodString;
|
|
210
|
+
message: z.ZodString;
|
|
211
|
+
}, z.core.$strip>;
|
|
212
|
+
}, z.core.$strip>;
|
|
213
|
+
/** `GET /v1/projects/:projectId/components/:id/resolved` — a composed component pinned by the current release (ADR-028). */
|
|
214
|
+
export declare const ResolvedComponentSchema: z.ZodObject<{
|
|
215
|
+
project: z.ZodObject<{
|
|
216
|
+
id: z.ZodString;
|
|
217
|
+
}, z.core.$strip>;
|
|
218
|
+
release: z.ZodObject<{
|
|
219
|
+
id: z.ZodString;
|
|
220
|
+
sequence: z.ZodNumber;
|
|
221
|
+
manifestHash: z.ZodString;
|
|
222
|
+
}, z.core.$strip>;
|
|
223
|
+
component: z.ZodObject<{
|
|
224
|
+
id: z.ZodString;
|
|
225
|
+
versionId: z.ZodString;
|
|
226
|
+
versionNumber: z.ZodNumber;
|
|
227
|
+
document: z.ZodObject<{
|
|
228
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
229
|
+
nodes: z.ZodArray<z.ZodType<import("./page-document.js").ComponentNode, unknown, z.core.$ZodTypeInternals<import("./page-document.js").ComponentNode, unknown>>>;
|
|
230
|
+
props: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
231
|
+
name: z.ZodString;
|
|
232
|
+
label: z.ZodString;
|
|
233
|
+
type: z.ZodEnum<{
|
|
234
|
+
boolean: "boolean";
|
|
235
|
+
icon: "icon";
|
|
236
|
+
image: "image";
|
|
237
|
+
link: "link";
|
|
238
|
+
number: "number";
|
|
239
|
+
select: "select";
|
|
240
|
+
text: "text";
|
|
241
|
+
textarea: "textarea";
|
|
242
|
+
}>;
|
|
243
|
+
binds: z.ZodArray<z.ZodObject<{
|
|
244
|
+
nodeId: z.ZodString;
|
|
245
|
+
prop: z.ZodString;
|
|
246
|
+
}, z.core.$strict>>;
|
|
247
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
248
|
+
options: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
249
|
+
}, z.core.$strict>>>;
|
|
250
|
+
defaultLocale: z.ZodString;
|
|
251
|
+
translations: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
252
|
+
theme: z.ZodOptional<z.ZodString>;
|
|
253
|
+
data: z.ZodOptional<z.ZodLazy<z.ZodArray<z.ZodObject<{
|
|
254
|
+
name: z.ZodString;
|
|
255
|
+
label: z.ZodOptional<z.ZodString>;
|
|
256
|
+
source: z.ZodDefault<z.ZodEnum<{
|
|
257
|
+
app: "app";
|
|
258
|
+
table: "table";
|
|
259
|
+
}>>;
|
|
260
|
+
shape: z.ZodEnum<{
|
|
261
|
+
list: "list";
|
|
262
|
+
object: "object";
|
|
263
|
+
}>;
|
|
264
|
+
fields: z.ZodArray<z.ZodType<import("./data.js").DataField, unknown, z.core.$ZodTypeInternals<import("./data.js").DataField, unknown>>>;
|
|
265
|
+
sample: z.ZodOptional<z.ZodUnknown>;
|
|
266
|
+
query: z.ZodOptional<z.ZodLazy<z.ZodObject<{
|
|
267
|
+
table: z.ZodString;
|
|
268
|
+
where: z.ZodOptional<z.ZodType<import("./tables.js").Filter, unknown, z.core.$ZodTypeInternals<import("./tables.js").Filter, unknown>>>;
|
|
269
|
+
sort: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
270
|
+
field: z.ZodString;
|
|
271
|
+
dir: z.ZodDefault<z.ZodEnum<{
|
|
272
|
+
asc: "asc";
|
|
273
|
+
desc: "desc";
|
|
274
|
+
}>>;
|
|
275
|
+
}, z.core.$strict>>>;
|
|
276
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
277
|
+
offset: z.ZodDefault<z.ZodNumber>;
|
|
278
|
+
include: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
279
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
280
|
+
}, z.core.$strict>>>;
|
|
281
|
+
single: z.ZodOptional<z.ZodBoolean>;
|
|
282
|
+
}, z.core.$strict>>>>;
|
|
283
|
+
disabledLocales: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
284
|
+
childrenSlot: z.ZodOptional<z.ZodObject<{
|
|
285
|
+
nodeId: z.ZodString;
|
|
286
|
+
slot: z.ZodString;
|
|
287
|
+
}, z.core.$strict>>;
|
|
288
|
+
}, z.core.$strict>;
|
|
289
|
+
}, z.core.$strip>;
|
|
290
|
+
design: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
291
|
+
vars: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
292
|
+
themes: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
293
|
+
fonts: z.ZodArray<z.ZodObject<{
|
|
294
|
+
family: z.ZodString;
|
|
295
|
+
faces: z.ZodArray<z.ZodObject<{
|
|
296
|
+
weight: z.ZodNumber;
|
|
297
|
+
style: z.ZodEnum<{
|
|
298
|
+
italic: "italic";
|
|
299
|
+
normal: "normal";
|
|
300
|
+
}>;
|
|
301
|
+
url: z.ZodString;
|
|
302
|
+
format: z.ZodEnum<{
|
|
303
|
+
opentype: "opentype";
|
|
304
|
+
truetype: "truetype";
|
|
305
|
+
woff: "woff";
|
|
306
|
+
woff2: "woff2";
|
|
307
|
+
}>;
|
|
308
|
+
unicodeRange: z.ZodOptional<z.ZodString>;
|
|
309
|
+
}, z.core.$strict>>;
|
|
310
|
+
}, z.core.$strip>>;
|
|
311
|
+
}, z.core.$strip>>>;
|
|
312
|
+
styles: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
313
|
+
locales: z.ZodOptional<z.ZodNullable<z.ZodLazy<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
314
|
+
name: z.ZodString;
|
|
315
|
+
nativeName: z.ZodString;
|
|
316
|
+
dir: z.ZodEnum<{
|
|
317
|
+
ltr: "ltr";
|
|
318
|
+
rtl: "rtl";
|
|
319
|
+
}>;
|
|
320
|
+
}, z.core.$strip>>>>>;
|
|
321
|
+
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
322
|
+
}, z.core.$strip>;
|
|
323
|
+
export type ResolvedComponent = z.infer<typeof ResolvedComponentSchema>;
|
|
324
|
+
/** `GET /v1/projects/:projectId/classes` — Tailwind classes used by the current release (for apps that build their own CSS). */
|
|
325
|
+
export declare const ReleaseClassesSchema: z.ZodObject<{
|
|
326
|
+
release: z.ZodObject<{
|
|
327
|
+
id: z.ZodString;
|
|
328
|
+
sequence: z.ZodNumber;
|
|
329
|
+
manifestHash: z.ZodString;
|
|
330
|
+
}, z.core.$strip>;
|
|
331
|
+
classes: z.ZodArray<z.ZodString>;
|
|
332
|
+
}, z.core.$strip>;
|
|
333
|
+
export type ReleaseClasses = z.infer<typeof ReleaseClassesSchema>;
|
|
334
|
+
/** `GET /v1/projects/:projectId/locales` — languages of the current release (ADR-035). */
|
|
335
|
+
export declare const LocaleListSchema: z.ZodObject<{
|
|
336
|
+
release: z.ZodObject<{
|
|
337
|
+
id: z.ZodString;
|
|
338
|
+
sequence: z.ZodNumber;
|
|
339
|
+
manifestHash: z.ZodString;
|
|
340
|
+
}, z.core.$strip>;
|
|
341
|
+
defaultLocale: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
342
|
+
locales: z.ZodArray<z.ZodObject<{
|
|
343
|
+
code: z.ZodString;
|
|
344
|
+
name: z.ZodString;
|
|
345
|
+
nativeName: z.ZodString;
|
|
346
|
+
dir: z.ZodEnum<{
|
|
347
|
+
ltr: "ltr";
|
|
348
|
+
rtl: "rtl";
|
|
349
|
+
}>;
|
|
350
|
+
}, z.core.$strip>>;
|
|
351
|
+
}, z.core.$strip>;
|
|
352
|
+
export type LocaleList = z.infer<typeof LocaleListSchema>;
|
|
353
|
+
//# sourceMappingURL=published.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"published.d.ts","sourceRoot":"","sources":["../src/published.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,+FAA+F;AAC/F,eAAO,MAAM,qBAAqB,EAAG,IAAa,CAAC;AAEnD,eAAO,MAAM,gBAAgB;;;;iBAI3B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0B7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAA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