@zenith-open/zenithcms-types 0.1.0 → 1.0.0-beta.2

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.
@@ -1,274 +0,0 @@
1
- /**
2
- * Zenith Auto-Generated TypeScript Definitions
3
- * This file is automatically re-compiled on database register & boot.
4
- * DO NOT MODIFY MANUALLY.
5
- */
6
- export interface ZenithDocument {
7
- _id: string;
8
- createdAt: string;
9
- updatedAt: string;
10
- status?: 'draft' | 'published';
11
- }
12
- export interface Posts extends ZenithDocument {
13
- title: string;
14
- slug: string;
15
- content?: any;
16
- coverImage?: any;
17
- tags?: any;
18
- publishedAt?: string | Date;
19
- sections?: ({
20
- blockType: 'hero';
21
- headline?: string;
22
- subheadline?: string;
23
- callToAction?: string;
24
- backgroundImage?: any;
25
- } | {
26
- blockType: 'features';
27
- heading?: string;
28
- featureList?: {
29
- title?: string;
30
- description?: string;
31
- icon?: any;
32
- }[];
33
- } | {
34
- blockType: 'testimonials';
35
- heading?: string;
36
- items?: {
37
- quote?: string;
38
- author?: string;
39
- role?: string;
40
- avatar?: any;
41
- }[];
42
- } | {
43
- blockType: 'pricing';
44
- heading?: string;
45
- plans?: {
46
- name?: string;
47
- price?: string;
48
- features?: string;
49
- buttonText?: string;
50
- isPopular?: boolean;
51
- }[];
52
- } | {
53
- blockType: 'faq';
54
- heading?: string;
55
- questions?: {
56
- question?: string;
57
- answer?: string;
58
- }[];
59
- } | {
60
- blockType: 'cta';
61
- title?: string;
62
- description?: string;
63
- buttonText?: string;
64
- link?: string;
65
- } | {
66
- blockType: 'stats';
67
- items?: {
68
- value?: string;
69
- label?: string;
70
- }[];
71
- } | {
72
- blockType: 'richTextSection';
73
- content?: any;
74
- })[];
75
- seoTitle?: string;
76
- seoDescription?: string;
77
- ogImage?: any;
78
- }
79
- export interface Authors extends ZenithDocument {
80
- name: string;
81
- email: string;
82
- bio?: string;
83
- avatar?: any;
84
- }
85
- export interface Products extends ZenithDocument {
86
- title: string;
87
- price: number;
88
- description?: any;
89
- gallery?: any;
90
- inStock?: boolean;
91
- specs?: {
92
- weight?: number;
93
- color?: string;
94
- sku?: string;
95
- };
96
- category: any;
97
- layout?: ({
98
- blockType: 'hero';
99
- headline?: string;
100
- } | {
101
- blockType: 'features';
102
- items?: {
103
- title?: string;
104
- }[];
105
- } | {
106
- blockType: 'stats';
107
- items?: {
108
- value?: string;
109
- }[];
110
- })[];
111
- slug?: string;
112
- }
113
- export interface Pages extends ZenithDocument {
114
- meta?: any;
115
- title: string;
116
- slug: string;
117
- sections?: ({
118
- blockType: 'hero';
119
- headline?: string;
120
- subheadline?: string;
121
- callToAction?: string;
122
- backgroundImage?: any;
123
- } | {
124
- blockType: 'features';
125
- heading?: string;
126
- featureList?: {
127
- title?: string;
128
- description?: string;
129
- icon?: any;
130
- }[];
131
- } | {
132
- blockType: 'testimonials';
133
- heading?: string;
134
- items?: {
135
- quote?: string;
136
- author?: string;
137
- role?: string;
138
- avatar?: any;
139
- }[];
140
- } | {
141
- blockType: 'pricing';
142
- heading?: string;
143
- plans?: {
144
- name?: string;
145
- price?: string;
146
- features?: string;
147
- buttonText?: string;
148
- isPopular?: boolean;
149
- }[];
150
- } | {
151
- blockType: 'faq';
152
- heading?: string;
153
- questions?: {
154
- question?: string;
155
- answer?: string;
156
- }[];
157
- } | {
158
- blockType: 'cta';
159
- title?: string;
160
- description?: string;
161
- buttonText?: string;
162
- link?: string;
163
- } | {
164
- blockType: 'stats';
165
- items?: {
166
- value?: string;
167
- label?: string;
168
- }[];
169
- } | {
170
- blockType: 'richTextSection';
171
- content?: any;
172
- })[];
173
- seoTitle?: string;
174
- seoDescription?: string;
175
- ogImage?: any;
176
- }
177
- export interface Members extends ZenithDocument {
178
- email: string;
179
- name?: string;
180
- subscriptionStatus?: any;
181
- isSubscribed?: boolean;
182
- activity?: any;
183
- avatar?: any;
184
- bio?: string;
185
- }
186
- export interface Media extends ZenithDocument {
187
- name?: string;
188
- url?: string;
189
- alt?: string;
190
- folder?: string;
191
- mimetype?: string;
192
- size?: number;
193
- }
194
- export interface LandingPage extends ZenithDocument {
195
- title: string;
196
- heroDescription?: any;
197
- sections?: ({
198
- blockType: 'hero';
199
- headline?: string;
200
- subheadline?: string;
201
- callToAction?: string;
202
- backgroundImage?: any;
203
- } | {
204
- blockType: 'features';
205
- heading?: string;
206
- featureList?: {
207
- title?: string;
208
- description?: string;
209
- icon?: any;
210
- }[];
211
- } | {
212
- blockType: 'testimonials';
213
- heading?: string;
214
- items?: {
215
- quote?: string;
216
- author?: string;
217
- role?: string;
218
- avatar?: any;
219
- }[];
220
- } | {
221
- blockType: 'pricing';
222
- heading?: string;
223
- plans?: {
224
- name?: string;
225
- price?: string;
226
- features?: string;
227
- buttonText?: string;
228
- isPopular?: boolean;
229
- }[];
230
- } | {
231
- blockType: 'faq';
232
- heading?: string;
233
- questions?: {
234
- question?: string;
235
- answer?: string;
236
- }[];
237
- } | {
238
- blockType: 'cta';
239
- title?: string;
240
- description?: string;
241
- buttonText?: string;
242
- link?: string;
243
- } | {
244
- blockType: 'stats';
245
- items?: {
246
- value?: string;
247
- label?: string;
248
- }[];
249
- } | {
250
- blockType: 'richTextSection';
251
- content?: any;
252
- })[];
253
- }
254
- export interface ZenithCollections {
255
- posts: Posts;
256
- authors: Authors;
257
- products: Products;
258
- pages: Pages;
259
- members: Members;
260
- media: Media;
261
- 'landing-page': LandingPage;
262
- }
263
- /**
264
- * Fully Typed React SDK Data Hook Mappings
265
- */
266
- export type ZenithQuery<T> = {
267
- where?: Record<string, any>;
268
- sort?: string | Record<string, any>;
269
- limit?: number;
270
- skip?: number;
271
- select?: string[];
272
- populate?: string[];
273
- locale?: string;
274
- };
package/src/generated.js DELETED
@@ -1,7 +0,0 @@
1
- /**
2
- * Zenith Auto-Generated TypeScript Definitions
3
- * This file is automatically re-compiled on database register & boot.
4
- * DO NOT MODIFY MANUALLY.
5
- */
6
- export {};
7
- //# sourceMappingURL=generated.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generated.js","sourceRoot":"","sources":["generated.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
package/src/generated.ts DELETED
@@ -1,143 +0,0 @@
1
- /**
2
- * Zenith Auto-Generated TypeScript Definitions
3
- * This file is automatically re-compiled on database register & boot.
4
- * DO NOT MODIFY MANUALLY.
5
- */
6
-
7
- export interface ZenithDocument {
8
- _id: string;
9
- createdAt: string;
10
- updatedAt: string;
11
- status?: 'draft' | 'published' | 'archived' | string;
12
- }
13
-
14
- export interface Authors extends ZenithDocument {
15
- name: string;
16
- avatar?: { url: string; alt?: string };
17
- bio?: string;
18
- }
19
-
20
- export interface Posts extends ZenithDocument {
21
- title: string;
22
- coverImage?: { url: string; alt?: string };
23
- content?: string;
24
- publishedAt?: string | Date;
25
- author?: Record<string, unknown>;
26
- }
27
-
28
- export interface Categories extends ZenithDocument {
29
- title: string;
30
- slug: string;
31
- }
32
-
33
- export interface Products extends ZenithDocument {
34
- name: string;
35
- slug: string;
36
- price: number;
37
- description?: string;
38
- gallery?: {
39
- image?: { url: string; alt?: string };
40
- }[];
41
- inStock?: boolean;
42
- }
43
-
44
- export interface Pages extends ZenithDocument {
45
- title: string;
46
- slug: string;
47
- layout?: ({
48
- blockType: 'undefined';
49
-
50
- } | {
51
- blockType: 'undefined';
52
-
53
- } | {
54
- blockType: 'undefined';
55
-
56
- } | {
57
- blockType: 'undefined';
58
-
59
- } | {
60
- blockType: 'undefined';
61
-
62
- } | {
63
- blockType: 'undefined';
64
-
65
- } | {
66
- blockType: 'undefined';
67
-
68
- } | {
69
- blockType: 'undefined';
70
-
71
- } | {
72
- blockType: 'undefined';
73
-
74
- } | {
75
- blockType: 'undefined';
76
-
77
- } | {
78
- blockType: 'undefined';
79
-
80
- })[];
81
- }
82
-
83
- export interface AuditTarget1781217670604 extends ZenithDocument {
84
- title: string;
85
- }
86
-
87
- export interface Media extends ZenithDocument {
88
- name?: string;
89
- url?: string;
90
- alt?: string;
91
- folder?: string;
92
- mimetype?: string;
93
- size?: number;
94
- }
95
-
96
- export interface SiteSettings extends ZenithDocument {
97
- siteName: string;
98
- supportEmail?: string;
99
- logo?: { url: string; alt?: string };
100
- favicon?: { url: string; alt?: string };
101
- primaryColor?: string;
102
- metaTitle?: string;
103
- metaDescription?: string;
104
- ogImage?: { url: string; alt?: string };
105
- socialLinks?: {
106
- platform?: ('Twitter' | 'Instagram' | 'Facebook' | 'LinkedIn' | 'GitHub' | 'YouTube');
107
- url?: string;
108
- }[];
109
- copyrightText?: string;
110
- headerLinks?: {
111
- label: string;
112
- url: string;
113
- }[];
114
- footerLinks?: {
115
- label: string;
116
- url: string;
117
- }[];
118
- }
119
-
120
- export interface ZenithCollections {
121
- 'authors': Authors;
122
- 'posts': Posts;
123
- 'categories': Categories;
124
- 'products': Products;
125
- 'pages': Pages;
126
- 'audit-target-1781217670604': AuditTarget1781217670604;
127
- 'media': Media;
128
- 'site-settings': SiteSettings;
129
- }
130
-
131
- /**
132
- * Fully Typed React SDK Data Hook Mappings
133
- */
134
- export type ZenithQuery<T> = {
135
- where?: Record<string, any>;
136
- sort?: string | Record<string, any>;
137
- limit?: number;
138
- skip?: number;
139
- select?: string[];
140
- populate?: string[];
141
- locale?: string;
142
- };
143
-
package/src/index.d.ts DELETED
@@ -1,193 +0,0 @@
1
- /**
2
- * Zenith CMS — Core Type System
3
- * ─────────────────────────────
4
- * Strictly typed configuration schema for collections, fields, and plugins.
5
- * Uses Discriminated Unions for robust field-level validation and IntelliSense.
6
- */
7
- export type FieldType = 'text' | 'number' | 'email' | 'textarea' | 'checkbox' | 'date' | 'select' | 'media' | 'richtext' | 'json' | 'group' | 'tabs' | 'array' | 'relation' | 'blocks' | 'boolean';
8
- export interface BlockDefinition {
9
- slug: string;
10
- labels?: {
11
- singular: string;
12
- plural: string;
13
- };
14
- fields: FieldConfig[];
15
- admin?: {
16
- description?: string;
17
- icon?: string;
18
- };
19
- }
20
- export interface FieldAdminConfig {
21
- placeholder?: string;
22
- description?: string;
23
- hidden?: boolean;
24
- readOnly?: boolean;
25
- width?: string;
26
- condition?: (data: any, siblingData: any) => boolean;
27
- }
28
- export interface BaseFieldConfig {
29
- name: string;
30
- label?: string;
31
- required?: boolean;
32
- unique?: boolean;
33
- localized?: boolean;
34
- virtual?: boolean;
35
- defaultValue?: any;
36
- admin?: FieldAdminConfig;
37
- hooks?: {
38
- beforeChange?: (value: any) => any | Promise<any>;
39
- afterRead?: (value: any) => any | Promise<any>;
40
- validate?: (value: any, data: any) => boolean | string | Promise<boolean | string>;
41
- };
42
- access?: {
43
- read?: (user: any) => boolean;
44
- update?: (user: any) => boolean;
45
- create?: (user: any) => boolean;
46
- };
47
- }
48
- export interface TextFieldConfig extends BaseFieldConfig {
49
- type: 'text' | 'email' | 'textarea';
50
- minLength?: number;
51
- maxLength?: number;
52
- }
53
- export interface NumberFieldConfig extends BaseFieldConfig {
54
- type: 'number';
55
- min?: number;
56
- max?: number;
57
- }
58
- export interface CheckboxFieldConfig extends BaseFieldConfig {
59
- type: 'checkbox' | 'boolean';
60
- }
61
- export interface SelectFieldConfig extends BaseFieldConfig {
62
- type: 'select';
63
- options: (string | {
64
- label: string;
65
- value: string;
66
- })[];
67
- hasMany?: boolean;
68
- }
69
- export interface MediaFieldConfig extends BaseFieldConfig {
70
- type: 'media';
71
- hasMany?: boolean;
72
- }
73
- export interface RelationFieldConfig extends BaseFieldConfig {
74
- type: 'relation';
75
- relationTo: string;
76
- hasMany?: boolean;
77
- }
78
- export interface ArrayFieldConfig extends BaseFieldConfig {
79
- type: 'array';
80
- fields: FieldConfig[];
81
- minRows?: number;
82
- maxRows?: number;
83
- }
84
- export interface GroupFieldConfig extends BaseFieldConfig {
85
- type: 'group';
86
- fields: FieldConfig[];
87
- }
88
- export interface BlocksFieldConfig extends BaseFieldConfig {
89
- type: 'blocks';
90
- blocks: BlockDefinition[];
91
- }
92
- export interface BasicFieldConfig extends BaseFieldConfig {
93
- type: 'date' | 'richtext' | 'json';
94
- }
95
- export type FieldConfig = TextFieldConfig | NumberFieldConfig | CheckboxFieldConfig | SelectFieldConfig | MediaFieldConfig | RelationFieldConfig | ArrayFieldConfig | GroupFieldConfig | BlocksFieldConfig | BasicFieldConfig;
96
- export interface CollectionConfig {
97
- name: string;
98
- slug: string;
99
- labels?: {
100
- singular: string;
101
- plural: string;
102
- };
103
- fields: FieldConfig[];
104
- drafts?: boolean;
105
- seo?: boolean;
106
- timestamps?: boolean;
107
- singleton?: boolean;
108
- versions?: boolean;
109
- scheduling?: boolean;
110
- publicRead?: boolean;
111
- hooks?: {
112
- beforeValidate?: (data: any, user: any, context: {
113
- hookType: string;
114
- }) => any | Promise<any>;
115
- beforeCreate?: (data: any, user: any, context: {
116
- hookType: string;
117
- }) => any | Promise<any>;
118
- afterCreate?: (doc: any, user: any, context: {
119
- hookType: string;
120
- }) => void | Promise<void>;
121
- beforeUpdate?: (data: any, user: any, context: {
122
- hookType: string;
123
- }) => any | Promise<any>;
124
- afterUpdate?: (doc: any, user: any, context: {
125
- hookType: string;
126
- }) => void | Promise<void>;
127
- beforeDelete?: (id: string, user: any, context: {
128
- hookType: string;
129
- }) => void | Promise<void>;
130
- afterDelete?: (id: string, user: any, context: {
131
- hookType: string;
132
- }) => void | Promise<void>;
133
- afterRead?: (doc: any, user: any, context: {
134
- hookType: string;
135
- }) => any | Promise<any>;
136
- afterError?: (error: Error, data: any, user: any) => void | Promise<void>;
137
- };
138
- access?: {
139
- read?: (user: any) => boolean | object;
140
- create?: (user: any) => boolean;
141
- update?: (user: any) => boolean;
142
- delete?: (user: any) => boolean;
143
- };
144
- admin?: {
145
- group?: string;
146
- hidden?: boolean;
147
- useAsTitle?: string;
148
- displayTemplate?: string;
149
- defaultColumns?: string[];
150
- icon?: string;
151
- previewUrl?: string | ((doc: any) => string);
152
- };
153
- endpoints?: {
154
- path: string;
155
- method: 'get' | 'post' | 'put' | 'delete' | 'patch';
156
- handler: (req: any, res: any) => void | Promise<void>;
157
- }[];
158
- }
159
- export type GlobalConfig = CollectionConfig;
160
- export interface ZenithPlugin {
161
- name: string;
162
- version?: string;
163
- description?: string;
164
- author?: string;
165
- downloads?: number;
166
- apply: (config: CMSConfig) => CMSConfig | void;
167
- onInit?: (app: any) => void | Promise<void>;
168
- onReady?: (app: any) => void | Promise<void>;
169
- }
170
- export type DeploymentProvider = 'cloudflare' | 'netlify' | 'vercel' | 'custom';
171
- export interface DeploymentConfig {
172
- provider: DeploymentProvider;
173
- hookUrl: string;
174
- triggerOn?: string[];
175
- autoTrigger?: boolean;
176
- }
177
- export interface WebhookTarget {
178
- url: string;
179
- events: string[];
180
- secret?: string;
181
- }
182
- export interface CMSConfig {
183
- collections: CollectionConfig[];
184
- globals?: GlobalConfig[];
185
- plugins?: ZenithPlugin[];
186
- webhooks?: WebhookTarget[];
187
- deployment?: DeploymentConfig;
188
- cors?: {
189
- origins: string[];
190
- };
191
- }
192
- export * from './generated';
193
- export * from './database';
package/src/index.js DELETED
@@ -1,9 +0,0 @@
1
- /**
2
- * Zenith CMS — Core Type System
3
- * ─────────────────────────────
4
- * Strictly typed configuration schema for collections, fields, and plugins.
5
- * Uses Discriminated Unions for robust field-level validation and IntelliSense.
6
- */
7
- export * from './generated';
8
- export * from './database';
9
- //# sourceMappingURL=index.js.map
package/src/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA+MH,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA"}