@webstudio-is/sdk 0.127.0 → 0.128.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 +18 -1
- package/lib/types/schema/pages.d.ts +38 -0
- package/package.json +3 -3
package/lib/index.js
CHANGED
|
@@ -97,9 +97,24 @@ var ProjectMeta = z2.object({
|
|
|
97
97
|
faviconAssetId: z2.string().optional(),
|
|
98
98
|
code: z2.string().optional()
|
|
99
99
|
});
|
|
100
|
+
var ProjectNewRedirectPathSchema = PagePath.or(
|
|
101
|
+
z2.string().refine((data) => {
|
|
102
|
+
try {
|
|
103
|
+
new URL(data);
|
|
104
|
+
return true;
|
|
105
|
+
} catch {
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
}, "Must be a valid URL")
|
|
109
|
+
);
|
|
110
|
+
var PageRedirectSchema = z2.object({
|
|
111
|
+
old: PagePath,
|
|
112
|
+
new: ProjectNewRedirectPathSchema
|
|
113
|
+
});
|
|
100
114
|
var ProjectSettings = z2.object({
|
|
101
115
|
// All fields are optional to ensure consistency and allow for the addition of new fields without requiring migration
|
|
102
|
-
atomicStyles: z2.boolean().optional()
|
|
116
|
+
atomicStyles: z2.boolean().optional(),
|
|
117
|
+
redirects: z2.array(PageRedirectSchema).optional()
|
|
103
118
|
});
|
|
104
119
|
var Pages = z2.object({
|
|
105
120
|
meta: ProjectMeta.optional(),
|
|
@@ -567,8 +582,10 @@ export {
|
|
|
567
582
|
Instances,
|
|
568
583
|
PageName,
|
|
569
584
|
PagePath,
|
|
585
|
+
PageRedirectSchema,
|
|
570
586
|
PageTitle,
|
|
571
587
|
Pages,
|
|
588
|
+
ProjectNewRedirectPathSchema,
|
|
572
589
|
Prop,
|
|
573
590
|
Props,
|
|
574
591
|
ROOT_FOLDER_ID,
|
|
@@ -110,6 +110,18 @@ declare const ProjectMeta: z.ZodObject<{
|
|
|
110
110
|
faviconAssetId?: string | undefined;
|
|
111
111
|
code?: string | undefined;
|
|
112
112
|
}>;
|
|
113
|
+
export declare const ProjectNewRedirectPathSchema: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>, string, string>, string, string>, string, string>, string, string>, string, string>, z.ZodEffects<z.ZodString, string, string>]>;
|
|
114
|
+
export declare const PageRedirectSchema: z.ZodObject<{
|
|
115
|
+
old: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>, string, string>, string, string>, string, string>, string, string>, string, string>;
|
|
116
|
+
new: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>, string, string>, string, string>, string, string>, string, string>, string, string>, z.ZodEffects<z.ZodString, string, string>]>;
|
|
117
|
+
}, "strip", z.ZodTypeAny, {
|
|
118
|
+
old: string;
|
|
119
|
+
new: string;
|
|
120
|
+
}, {
|
|
121
|
+
old: string;
|
|
122
|
+
new: string;
|
|
123
|
+
}>;
|
|
124
|
+
export type PageRedirect = z.infer<typeof PageRedirectSchema>;
|
|
113
125
|
export type ProjectMeta = z.infer<typeof ProjectMeta>;
|
|
114
126
|
export type Page = z.infer<typeof Page>;
|
|
115
127
|
export declare const Pages: z.ZodObject<{
|
|
@@ -128,10 +140,28 @@ export declare const Pages: z.ZodObject<{
|
|
|
128
140
|
}>>;
|
|
129
141
|
settings: z.ZodOptional<z.ZodObject<{
|
|
130
142
|
atomicStyles: z.ZodOptional<z.ZodBoolean>;
|
|
143
|
+
redirects: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
144
|
+
old: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>, string, string>, string, string>, string, string>, string, string>, string, string>;
|
|
145
|
+
new: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>, string, string>, string, string>, string, string>, string, string>, string, string>, z.ZodEffects<z.ZodString, string, string>]>;
|
|
146
|
+
}, "strip", z.ZodTypeAny, {
|
|
147
|
+
old: string;
|
|
148
|
+
new: string;
|
|
149
|
+
}, {
|
|
150
|
+
old: string;
|
|
151
|
+
new: string;
|
|
152
|
+
}>, "many">>;
|
|
131
153
|
}, "strip", z.ZodTypeAny, {
|
|
132
154
|
atomicStyles?: boolean | undefined;
|
|
155
|
+
redirects?: {
|
|
156
|
+
old: string;
|
|
157
|
+
new: string;
|
|
158
|
+
}[] | undefined;
|
|
133
159
|
}, {
|
|
134
160
|
atomicStyles?: boolean | undefined;
|
|
161
|
+
redirects?: {
|
|
162
|
+
old: string;
|
|
163
|
+
new: string;
|
|
164
|
+
}[] | undefined;
|
|
135
165
|
}>>;
|
|
136
166
|
homePage: z.ZodObject<{
|
|
137
167
|
path: z.ZodEffects<z.ZodString, string, string>;
|
|
@@ -395,6 +425,10 @@ export declare const Pages: z.ZodObject<{
|
|
|
395
425
|
} | undefined;
|
|
396
426
|
settings?: {
|
|
397
427
|
atomicStyles?: boolean | undefined;
|
|
428
|
+
redirects?: {
|
|
429
|
+
old: string;
|
|
430
|
+
new: string;
|
|
431
|
+
}[] | undefined;
|
|
398
432
|
} | undefined;
|
|
399
433
|
}, {
|
|
400
434
|
homePage: {
|
|
@@ -446,6 +480,10 @@ export declare const Pages: z.ZodObject<{
|
|
|
446
480
|
} | undefined;
|
|
447
481
|
settings?: {
|
|
448
482
|
atomicStyles?: boolean | undefined;
|
|
483
|
+
redirects?: {
|
|
484
|
+
old: string;
|
|
485
|
+
new: string;
|
|
486
|
+
}[] | undefined;
|
|
449
487
|
} | undefined;
|
|
450
488
|
}>;
|
|
451
489
|
export type Pages = z.infer<typeof Pages>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webstudio-is/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.128.0",
|
|
4
4
|
"description": "Webstudio project data schema",
|
|
5
5
|
"author": "Webstudio <github@webstudio.is>",
|
|
6
6
|
"homepage": "https://webstudio.is",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"sideEffects": false,
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"zod": "^3.21.4",
|
|
22
|
-
"@webstudio-is/css-engine": "0.
|
|
23
|
-
"@webstudio-is/fonts": "0.
|
|
22
|
+
"@webstudio-is/css-engine": "0.128.0",
|
|
23
|
+
"@webstudio-is/fonts": "0.128.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@jest/globals": "^29.7.0",
|