@webstudio-is/sdk 0.111.0 → 0.111.1-0d68965.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/lib/index.js +12 -1
- package/lib/types/schema/pages.d.ts +238 -6
- package/package.json +5 -5
package/lib/index.js
CHANGED
|
@@ -41,7 +41,12 @@ var commonPageFields = {
|
|
|
41
41
|
id: z2.string(),
|
|
42
42
|
name: PageName,
|
|
43
43
|
title: PageTitle,
|
|
44
|
-
meta: z2.
|
|
44
|
+
meta: z2.object({
|
|
45
|
+
description: z2.string().optional(),
|
|
46
|
+
title: z2.string().optional(),
|
|
47
|
+
excludePageFromSearch: z2.boolean().optional(),
|
|
48
|
+
socialImageAssetId: z2.string().optional()
|
|
49
|
+
}),
|
|
45
50
|
rootInstanceId: z2.string()
|
|
46
51
|
};
|
|
47
52
|
var HomePagePath = z2.string().refine((path) => path === "", "Home page path must be empty");
|
|
@@ -73,7 +78,13 @@ var Page = z2.object({
|
|
|
73
78
|
...commonPageFields,
|
|
74
79
|
path: PagePath
|
|
75
80
|
});
|
|
81
|
+
var SiteMeta = z2.object({
|
|
82
|
+
siteName: z2.string().optional(),
|
|
83
|
+
faviconAssetId: z2.string().optional(),
|
|
84
|
+
code: z2.string().optional()
|
|
85
|
+
});
|
|
76
86
|
var Pages = z2.object({
|
|
87
|
+
meta: SiteMeta.optional(),
|
|
77
88
|
homePage: HomePage,
|
|
78
89
|
pages: z2.array(Page).refine(
|
|
79
90
|
(array) => new Set(array.map((page) => page.path)).size === array.length,
|
|
@@ -9,27 +9,259 @@ declare const Page: z.ZodObject<{
|
|
|
9
9
|
id: z.ZodString;
|
|
10
10
|
name: z.ZodEffects<z.ZodString, string, string>;
|
|
11
11
|
title: z.ZodEffects<z.ZodString, string, string>;
|
|
12
|
-
meta: z.
|
|
12
|
+
meta: z.ZodObject<{
|
|
13
|
+
description: z.ZodOptional<z.ZodString>;
|
|
14
|
+
title: z.ZodOptional<z.ZodString>;
|
|
15
|
+
excludePageFromSearch: z.ZodOptional<z.ZodBoolean>;
|
|
16
|
+
socialImageAssetId: z.ZodOptional<z.ZodString>;
|
|
17
|
+
}, "strip", z.ZodTypeAny, {
|
|
18
|
+
description?: string | undefined;
|
|
19
|
+
title?: string | undefined;
|
|
20
|
+
excludePageFromSearch?: boolean | undefined;
|
|
21
|
+
socialImageAssetId?: string | undefined;
|
|
22
|
+
}, {
|
|
23
|
+
description?: string | undefined;
|
|
24
|
+
title?: string | undefined;
|
|
25
|
+
excludePageFromSearch?: boolean | undefined;
|
|
26
|
+
socialImageAssetId?: string | undefined;
|
|
27
|
+
}>;
|
|
13
28
|
rootInstanceId: z.ZodString;
|
|
14
29
|
}, "strip", z.ZodTypeAny, {
|
|
15
30
|
path: string;
|
|
16
31
|
name: string;
|
|
17
|
-
meta:
|
|
32
|
+
meta: {
|
|
33
|
+
description?: string | undefined;
|
|
34
|
+
title?: string | undefined;
|
|
35
|
+
excludePageFromSearch?: boolean | undefined;
|
|
36
|
+
socialImageAssetId?: string | undefined;
|
|
37
|
+
};
|
|
18
38
|
id: string;
|
|
19
39
|
title: string;
|
|
20
40
|
rootInstanceId: string;
|
|
21
41
|
}, {
|
|
22
42
|
path: string;
|
|
23
43
|
name: string;
|
|
24
|
-
meta:
|
|
44
|
+
meta: {
|
|
45
|
+
description?: string | undefined;
|
|
46
|
+
title?: string | undefined;
|
|
47
|
+
excludePageFromSearch?: boolean | undefined;
|
|
48
|
+
socialImageAssetId?: string | undefined;
|
|
49
|
+
};
|
|
25
50
|
id: string;
|
|
26
51
|
title: string;
|
|
27
52
|
rootInstanceId: string;
|
|
28
53
|
}>;
|
|
54
|
+
declare const SiteMeta: z.ZodObject<{
|
|
55
|
+
siteName: z.ZodOptional<z.ZodString>;
|
|
56
|
+
faviconAssetId: z.ZodOptional<z.ZodString>;
|
|
57
|
+
code: z.ZodOptional<z.ZodString>;
|
|
58
|
+
}, "strip", z.ZodTypeAny, {
|
|
59
|
+
siteName?: string | undefined;
|
|
60
|
+
faviconAssetId?: string | undefined;
|
|
61
|
+
code?: string | undefined;
|
|
62
|
+
}, {
|
|
63
|
+
siteName?: string | undefined;
|
|
64
|
+
faviconAssetId?: string | undefined;
|
|
65
|
+
code?: string | undefined;
|
|
66
|
+
}>;
|
|
67
|
+
export type SiteMeta = z.infer<typeof SiteMeta>;
|
|
29
68
|
export type Page = z.infer<typeof Page>;
|
|
30
|
-
export declare const Pages: z.
|
|
31
|
-
|
|
32
|
-
|
|
69
|
+
export declare const Pages: z.ZodObject<{
|
|
70
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
71
|
+
siteName: z.ZodOptional<z.ZodString>;
|
|
72
|
+
faviconAssetId: z.ZodOptional<z.ZodString>;
|
|
73
|
+
code: z.ZodOptional<z.ZodString>;
|
|
74
|
+
}, "strip", z.ZodTypeAny, {
|
|
75
|
+
siteName?: string | undefined;
|
|
76
|
+
faviconAssetId?: string | undefined;
|
|
77
|
+
code?: string | undefined;
|
|
78
|
+
}, {
|
|
79
|
+
siteName?: string | undefined;
|
|
80
|
+
faviconAssetId?: string | undefined;
|
|
81
|
+
code?: string | undefined;
|
|
82
|
+
}>>;
|
|
83
|
+
homePage: z.ZodObject<{
|
|
84
|
+
path: z.ZodEffects<z.ZodString, string, string>;
|
|
85
|
+
id: z.ZodString;
|
|
86
|
+
name: z.ZodEffects<z.ZodString, string, string>;
|
|
87
|
+
title: z.ZodEffects<z.ZodString, string, string>;
|
|
88
|
+
meta: z.ZodObject<{
|
|
89
|
+
description: z.ZodOptional<z.ZodString>;
|
|
90
|
+
title: z.ZodOptional<z.ZodString>;
|
|
91
|
+
excludePageFromSearch: z.ZodOptional<z.ZodBoolean>;
|
|
92
|
+
socialImageAssetId: z.ZodOptional<z.ZodString>;
|
|
93
|
+
}, "strip", z.ZodTypeAny, {
|
|
94
|
+
description?: string | undefined;
|
|
95
|
+
title?: string | undefined;
|
|
96
|
+
excludePageFromSearch?: boolean | undefined;
|
|
97
|
+
socialImageAssetId?: string | undefined;
|
|
98
|
+
}, {
|
|
99
|
+
description?: string | undefined;
|
|
100
|
+
title?: string | undefined;
|
|
101
|
+
excludePageFromSearch?: boolean | undefined;
|
|
102
|
+
socialImageAssetId?: string | undefined;
|
|
103
|
+
}>;
|
|
104
|
+
rootInstanceId: z.ZodString;
|
|
105
|
+
}, "strip", z.ZodTypeAny, {
|
|
106
|
+
path: string;
|
|
107
|
+
name: string;
|
|
108
|
+
meta: {
|
|
109
|
+
description?: string | undefined;
|
|
110
|
+
title?: string | undefined;
|
|
111
|
+
excludePageFromSearch?: boolean | undefined;
|
|
112
|
+
socialImageAssetId?: string | undefined;
|
|
113
|
+
};
|
|
114
|
+
id: string;
|
|
115
|
+
title: string;
|
|
116
|
+
rootInstanceId: string;
|
|
117
|
+
}, {
|
|
118
|
+
path: string;
|
|
119
|
+
name: string;
|
|
120
|
+
meta: {
|
|
121
|
+
description?: string | undefined;
|
|
122
|
+
title?: string | undefined;
|
|
123
|
+
excludePageFromSearch?: boolean | undefined;
|
|
124
|
+
socialImageAssetId?: string | undefined;
|
|
125
|
+
};
|
|
126
|
+
id: string;
|
|
127
|
+
title: string;
|
|
128
|
+
rootInstanceId: string;
|
|
129
|
+
}>;
|
|
130
|
+
pages: z.ZodEffects<z.ZodArray<z.ZodObject<{
|
|
131
|
+
path: z.ZodType<string, z.ZodTypeDef, string>;
|
|
132
|
+
id: z.ZodString;
|
|
133
|
+
name: z.ZodEffects<z.ZodString, string, string>;
|
|
134
|
+
title: z.ZodEffects<z.ZodString, string, string>;
|
|
135
|
+
meta: z.ZodObject<{
|
|
136
|
+
description: z.ZodOptional<z.ZodString>;
|
|
137
|
+
title: z.ZodOptional<z.ZodString>;
|
|
138
|
+
excludePageFromSearch: z.ZodOptional<z.ZodBoolean>;
|
|
139
|
+
socialImageAssetId: z.ZodOptional<z.ZodString>;
|
|
140
|
+
}, "strip", z.ZodTypeAny, {
|
|
141
|
+
description?: string | undefined;
|
|
142
|
+
title?: string | undefined;
|
|
143
|
+
excludePageFromSearch?: boolean | undefined;
|
|
144
|
+
socialImageAssetId?: string | undefined;
|
|
145
|
+
}, {
|
|
146
|
+
description?: string | undefined;
|
|
147
|
+
title?: string | undefined;
|
|
148
|
+
excludePageFromSearch?: boolean | undefined;
|
|
149
|
+
socialImageAssetId?: string | undefined;
|
|
150
|
+
}>;
|
|
151
|
+
rootInstanceId: z.ZodString;
|
|
152
|
+
}, "strip", z.ZodTypeAny, {
|
|
153
|
+
path: string;
|
|
154
|
+
name: string;
|
|
155
|
+
meta: {
|
|
156
|
+
description?: string | undefined;
|
|
157
|
+
title?: string | undefined;
|
|
158
|
+
excludePageFromSearch?: boolean | undefined;
|
|
159
|
+
socialImageAssetId?: string | undefined;
|
|
160
|
+
};
|
|
161
|
+
id: string;
|
|
162
|
+
title: string;
|
|
163
|
+
rootInstanceId: string;
|
|
164
|
+
}, {
|
|
165
|
+
path: string;
|
|
166
|
+
name: string;
|
|
167
|
+
meta: {
|
|
168
|
+
description?: string | undefined;
|
|
169
|
+
title?: string | undefined;
|
|
170
|
+
excludePageFromSearch?: boolean | undefined;
|
|
171
|
+
socialImageAssetId?: string | undefined;
|
|
172
|
+
};
|
|
173
|
+
id: string;
|
|
174
|
+
title: string;
|
|
175
|
+
rootInstanceId: string;
|
|
176
|
+
}>, "many">, {
|
|
177
|
+
path: string;
|
|
178
|
+
name: string;
|
|
179
|
+
meta: {
|
|
180
|
+
description?: string | undefined;
|
|
181
|
+
title?: string | undefined;
|
|
182
|
+
excludePageFromSearch?: boolean | undefined;
|
|
183
|
+
socialImageAssetId?: string | undefined;
|
|
184
|
+
};
|
|
185
|
+
id: string;
|
|
186
|
+
title: string;
|
|
187
|
+
rootInstanceId: string;
|
|
188
|
+
}[], {
|
|
189
|
+
path: string;
|
|
190
|
+
name: string;
|
|
191
|
+
meta: {
|
|
192
|
+
description?: string | undefined;
|
|
193
|
+
title?: string | undefined;
|
|
194
|
+
excludePageFromSearch?: boolean | undefined;
|
|
195
|
+
socialImageAssetId?: string | undefined;
|
|
196
|
+
};
|
|
197
|
+
id: string;
|
|
198
|
+
title: string;
|
|
199
|
+
rootInstanceId: string;
|
|
200
|
+
}[]>;
|
|
201
|
+
}, "strip", z.ZodTypeAny, {
|
|
202
|
+
homePage: {
|
|
203
|
+
path: string;
|
|
204
|
+
name: string;
|
|
205
|
+
meta: {
|
|
206
|
+
description?: string | undefined;
|
|
207
|
+
title?: string | undefined;
|
|
208
|
+
excludePageFromSearch?: boolean | undefined;
|
|
209
|
+
socialImageAssetId?: string | undefined;
|
|
210
|
+
};
|
|
211
|
+
id: string;
|
|
212
|
+
title: string;
|
|
213
|
+
rootInstanceId: string;
|
|
214
|
+
};
|
|
215
|
+
pages: {
|
|
216
|
+
path: string;
|
|
217
|
+
name: string;
|
|
218
|
+
meta: {
|
|
219
|
+
description?: string | undefined;
|
|
220
|
+
title?: string | undefined;
|
|
221
|
+
excludePageFromSearch?: boolean | undefined;
|
|
222
|
+
socialImageAssetId?: string | undefined;
|
|
223
|
+
};
|
|
224
|
+
id: string;
|
|
225
|
+
title: string;
|
|
226
|
+
rootInstanceId: string;
|
|
227
|
+
}[];
|
|
228
|
+
meta?: {
|
|
229
|
+
siteName?: string | undefined;
|
|
230
|
+
faviconAssetId?: string | undefined;
|
|
231
|
+
code?: string | undefined;
|
|
232
|
+
} | undefined;
|
|
233
|
+
}, {
|
|
234
|
+
homePage: {
|
|
235
|
+
path: string;
|
|
236
|
+
name: string;
|
|
237
|
+
meta: {
|
|
238
|
+
description?: string | undefined;
|
|
239
|
+
title?: string | undefined;
|
|
240
|
+
excludePageFromSearch?: boolean | undefined;
|
|
241
|
+
socialImageAssetId?: string | undefined;
|
|
242
|
+
};
|
|
243
|
+
id: string;
|
|
244
|
+
title: string;
|
|
245
|
+
rootInstanceId: string;
|
|
246
|
+
};
|
|
247
|
+
pages: {
|
|
248
|
+
path: string;
|
|
249
|
+
name: string;
|
|
250
|
+
meta: {
|
|
251
|
+
description?: string | undefined;
|
|
252
|
+
title?: string | undefined;
|
|
253
|
+
excludePageFromSearch?: boolean | undefined;
|
|
254
|
+
socialImageAssetId?: string | undefined;
|
|
255
|
+
};
|
|
256
|
+
id: string;
|
|
257
|
+
title: string;
|
|
258
|
+
rootInstanceId: string;
|
|
259
|
+
}[];
|
|
260
|
+
meta?: {
|
|
261
|
+
siteName?: string | undefined;
|
|
262
|
+
faviconAssetId?: string | undefined;
|
|
263
|
+
code?: string | undefined;
|
|
264
|
+
} | undefined;
|
|
33
265
|
}>;
|
|
34
266
|
export type Pages = z.infer<typeof Pages>;
|
|
35
267
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webstudio-is/sdk",
|
|
3
|
-
"version": "0.111.0",
|
|
3
|
+
"version": "0.111.1-0d68965.0",
|
|
4
4
|
"description": "Webstudio site data schema",
|
|
5
5
|
"author": "Webstudio <github@webstudio.is>",
|
|
6
6
|
"homepage": "https://webstudio.is",
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
"sideEffects": false,
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"zod": "^3.21.4",
|
|
22
|
-
"@webstudio-is/css-engine": "0.111.0",
|
|
23
|
-
"@webstudio-is/fonts": "0.111.0"
|
|
22
|
+
"@webstudio-is/css-engine": "0.111.1-0d68965.0",
|
|
23
|
+
"@webstudio-is/fonts": "0.111.1-0d68965.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@jest/globals": "^29.7.0",
|
|
27
|
-
"@webstudio-is/jest-config": "1.0.
|
|
28
|
-
"@webstudio-is/tsconfig": "1.0.
|
|
27
|
+
"@webstudio-is/jest-config": "1.0.8-0d68965.0",
|
|
28
|
+
"@webstudio-is/tsconfig": "1.0.8-0d68965.0"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
31
|
"typecheck": "tsc",
|