PluginProbe
Extendify / 3.1.4
Extendify v3.1.4
3.2.1 3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 0.6.0 All 127 releases
extendify / src / AutoLaunch / fetchers / shape.js

shape.js in Extendify 3.1.4, at src/AutoLaunch/fetchers/shape.js

140 lines 3.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { z } from 'zod';
2
3 // get-home
4 const patternShape = z.looseObject({
5 name: z.string(),
6 code: z.string(),
7 patternTypes: z.array(z.string()),
8 contentGenerated: z.boolean().optional(),
9 navSlug: z.string().optional(),
10 navLabel: z.string().optional(),
11 blogImages: z.array(z.string()).optional(),
12 images: z.array(z.string()).optional(),
13 });
14 export const homeTemplateShape = z.looseObject({
15 id: z.string(),
16 slug: z.string(),
17 headerCode: z.string().optional(),
18 footerCode: z.string().optional(),
19 patterns: z.array(patternShape),
20 });
21 export const getHomeShape = z.looseObject({
22 home: homeTemplateShape,
23 });
24
25 // get-images
26 export const getImagesShape = z.looseObject({
27 siteImages: z.array(z.string()),
28 });
29
30 // get-logo
31 export const getLogoShape = z.looseObject({
32 logoUrl: z.url(),
33 });
34
35 // get-pages
36 export const pageTemplateShape = z.looseObject({
37 id: z.string(),
38 slug: z.string(),
39 name: z.string(),
40 patterns: z.array(patternShape),
41 siteStyle: z.object(),
42 });
43 export const getPagesShape = z.looseObject({
44 pages: z.array(pageTemplateShape),
45 });
46
47 // get-plugins
48 export const pluginShape = z.looseObject({
49 name: z.string(),
50 wordpressSlug: z.string(),
51 });
52 export const getPluginsShape = z.object({
53 sitePlugins: z.array(pluginShape),
54 });
55
56 // get-profile
57 export const socialProfilesShape = z.looseObject({
58 facebook: z.string().nullish(),
59 instagram: z.string().nullish(),
60 x: z.string().nullish(),
61 tiktok: z.string().nullish(),
62 });
63 export const getProfileShape = z.looseObject({
64 type: z.string(),
65 title: z.string(),
66 description: z.string(),
67 descriptionRaw: z.string().optional(),
68 objective: z.string(),
69 category: z.string().optional(),
70 structure: z.string(),
71 imageSearchTerms: z.array(z.string()),
72 tone: z.array(z.string()),
73 logoObjectName: z.string(),
74 products: z.union([z.string(), z.literal(false)]),
75 appointments: z.boolean(),
76 events: z.boolean(),
77 donations: z.boolean(),
78 multilingual: z.boolean(),
79 contact: z.boolean(),
80 address: z.union([z.boolean(), z.string()]),
81 blog: z.boolean(),
82 landingPage: z.boolean(),
83 landingPageCTALink: z.union([z.literal(false), z.string()]),
84 phoneNumber: z.union([z.boolean(), z.string()]).optional(),
85 email: z.string().nullish(),
86 socialProfiles: socialProfilesShape.nullish(),
87 });
88
89 // get-launch-decisions
90 export const getLaunchDecisionsShape = z.looseObject({
91 navExtras: z.string().optional(),
92 navButtonLabel: z.string().optional(),
93 });
94
95 // get-strings
96 export const getStringsShape = z.looseObject({
97 aiHeaders: z.array(z.string()),
98 aiBlogTitles: z.array(z.string()),
99 heroDescription: z.string().optional(),
100 });
101
102 // get-style
103 export const styleShape = z.looseObject({
104 vibe: z.string(),
105 fonts: z.looseObject(),
106 variation: z.looseObject(),
107 colorPalette: z.string(),
108 animation: z.string(),
109 });
110 export const getStyleShape = z.object({
111 siteStyle: styleShape.extend({ variation: z.looseObject().optional() }),
112 });
113
114 // get-design-build
115 const designBuildShape = z.looseObject({
116 siteProfile: getProfileShape,
117 pages: z.array(
118 z.object({
119 slug: z.string(),
120 name: z.string(),
121 description: z.string().optional(),
122 }),
123 ),
124 siteStyle: styleShape.omit({ variation: true }),
125 selectedPlugins: z.array(pluginShape),
126 logoUrl: z.url().nullish(),
127 templateParts: z.looseObject({
128 header: z.string().nullish(),
129 footer: z.string().nullish(),
130 }),
131 builtPages: z.array(
132 z.object({
133 slug: z.string(),
134 fullPage: z.boolean(),
135 patterns: z.array(patternShape),
136 }),
137 ),
138 });
139 export const getDesignBuildShape = designBuildShape;
140