PluginProbe
Extendify / 3.1.1
Extendify v3.1.1
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.1, at src/AutoLaunch/fetchers/shape.js

123 lines 3.0 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 });
12 export const homeTemplateShape = z.looseObject({
13 id: z.string(),
14 slug: z.string(),
15 headerCode: z.string().optional(),
16 footerCode: z.string().optional(),
17 patterns: z.array(patternShape),
18 });
19 export const getHomeShape = z.looseObject({
20 home: homeTemplateShape,
21 });
22
23 // get-images
24 export const getImagesShape = z.looseObject({
25 siteImages: z.array(z.string()),
26 });
27
28 // get-logo
29 export const getLogoShape = z.looseObject({
30 logoUrl: z.url(),
31 });
32
33 // get-pages
34 export const pageTemplateShape = z.looseObject({
35 id: z.string(),
36 slug: z.string(),
37 name: z.string(),
38 patterns: z.array(patternShape),
39 siteStyle: z.object(),
40 });
41 export const getPagesShape = z.looseObject({
42 pages: z.array(pageTemplateShape),
43 });
44
45 // get-plugins
46 export const pluginShape = z.looseObject({
47 name: z.string(),
48 wordpressSlug: z.string(),
49 });
50 export const getPluginsShape = z.object({
51 sitePlugins: z.array(pluginShape),
52 });
53
54 // get-profile
55 export const getProfileShape = z.looseObject({
56 type: z.string(),
57 title: z.string(),
58 description: z.string(),
59 descriptionRaw: z.string().optional(),
60 objective: z.string(),
61 category: z.string().optional(),
62 structure: z.string(),
63 imageSearchTerms: z.array(z.string()),
64 tone: z.array(z.string()),
65 logoObjectName: z.string(),
66 products: z.union([z.string(), z.literal(false)]),
67 appointments: z.boolean(),
68 events: z.boolean(),
69 donations: z.boolean(),
70 multilingual: z.boolean(),
71 contact: z.boolean(),
72 address: z.union([z.boolean(), z.string()]),
73 blog: z.boolean(),
74 landingPage: z.boolean(),
75 landingPageCTALink: z.union([z.literal(false), z.string()]),
76 phoneNumber: z.union([z.boolean(), z.string()]).optional(),
77 });
78
79 // get-launch-decisions
80 export const getLaunchDecisionsShape = z.looseObject({
81 navExtras: z.string().optional(),
82 navButtonLabel: z.string().optional(),
83 });
84
85 // get-strings
86 export const getStringsShape = z.looseObject({
87 aiHeaders: z.array(z.string()),
88 aiBlogTitles: z.array(z.string()),
89 heroDescription: z.string().optional(),
90 });
91
92 // get-style
93 export const styleShape = z.looseObject({
94 vibe: z.string(),
95 fonts: z.looseObject(),
96 variation: z.looseObject(),
97 colorPalette: z.string(),
98 animation: z.string(),
99 });
100 export const getStyleShape = z.object({
101 siteStyle: styleShape.extend({ variation: z.looseObject().optional() }),
102 });
103
104 // get-design-build
105 const designBuildShape = z.looseObject({
106 siteProfile: getProfileShape,
107 pages: z.array(
108 z.object({
109 slug: z.string(),
110 name: z.string(),
111 description: z.string().optional(),
112 }),
113 ),
114 patternId: z.string(),
115 headerCode: z.string(),
116 siteStyle: styleShape.omit({ variation: true }),
117 selectedPlugins: z.array(pluginShape),
118 html: z.string(),
119 patternCode: z.string(),
120 logoUrl: z.url().nullish(),
121 });
122 export const getDesignBuildShape = designBuildShape;
123