@kyro-cms/core 0.3.2 → 0.3.4
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/dist/{WebhookService-BznDc2AT.d.ts → WebhookService-BCpW2dyL.d.ts} +1 -1
- package/dist/{WebhookService-mZZ75syh.d.cts → WebhookService-DxYSFvNg.d.cts} +1 -1
- package/dist/api-handler.cjs +52 -0
- package/dist/api-handler.cjs.map +1 -0
- package/dist/api-handler.d.cts +9 -0
- package/dist/api-handler.d.ts +9 -0
- package/dist/api-handler.js +46 -0
- package/dist/api-handler.js.map +1 -0
- package/dist/{base-Hu6ij8sZ.d.ts → base-DvvNqnM-.d.cts} +16 -5
- package/dist/{base-Db9LkB1N.d.cts → base-eVegJ_Pr.d.ts} +16 -5
- package/dist/bootstrap-DGJ3N7SO.js +6 -0
- package/dist/{bootstrap-LL6O7PWO.js.map → bootstrap-DGJ3N7SO.js.map} +1 -1
- package/dist/bootstrap-O5UGUTYU.cjs +31 -0
- package/dist/{bootstrap-BMWVB2T6.cjs.map → bootstrap-O5UGUTYU.cjs.map} +1 -1
- package/dist/{chunk-QKOFKITP.js → chunk-2HFJUUFZ.js} +3 -11
- package/dist/chunk-2HFJUUFZ.js.map +1 -0
- package/dist/chunk-2SJATAN4.js +5514 -0
- package/dist/chunk-2SJATAN4.js.map +1 -0
- package/dist/{chunk-DIC236EW.js → chunk-342BJNBI.js} +167 -24
- package/dist/chunk-342BJNBI.js.map +1 -0
- package/dist/{chunk-OUGKLCYF.js → chunk-3AJE4SEG.js} +4 -3
- package/dist/chunk-3AJE4SEG.js.map +1 -0
- package/dist/chunk-6LPNEC6D.js +617 -0
- package/dist/chunk-6LPNEC6D.js.map +1 -0
- package/dist/{chunk-BXMWDUED.js → chunk-A4USRVTQ.js} +2 -2
- package/dist/chunk-A4USRVTQ.js.map +1 -0
- package/dist/chunk-ADLJSJSN.cjs +13 -0
- package/dist/chunk-ADLJSJSN.cjs.map +1 -0
- package/dist/chunk-ATBOUGQP.cjs +513 -0
- package/dist/chunk-ATBOUGQP.cjs.map +1 -0
- package/dist/{chunk-KB6QF4HO.js → chunk-B76I67F3.js} +246 -141
- package/dist/chunk-B76I67F3.js.map +1 -0
- package/dist/chunk-BQ2T4WRS.js +140 -0
- package/dist/chunk-BQ2T4WRS.js.map +1 -0
- package/dist/chunk-CZ3HWX2X.cjs +622 -0
- package/dist/chunk-CZ3HWX2X.cjs.map +1 -0
- package/dist/{chunk-PNBZZ76A.cjs → chunk-DAIBBBOL.cjs} +246 -140
- package/dist/chunk-DAIBBBOL.cjs.map +1 -0
- package/dist/{chunk-U74F3YZU.js → chunk-DBUYB32X.js} +15 -3
- package/dist/chunk-DBUYB32X.js.map +1 -0
- package/dist/chunk-DLHUQO25.cjs +1746 -0
- package/dist/chunk-DLHUQO25.cjs.map +1 -0
- package/dist/{chunk-GE5DMB44.js → chunk-E3BZLMX6.js} +55 -49
- package/dist/chunk-E3BZLMX6.js.map +1 -0
- package/dist/{chunk-44BF6ALS.cjs → chunk-H4XCAPA6.cjs} +55 -49
- package/dist/chunk-H4XCAPA6.cjs.map +1 -0
- package/dist/{chunk-VIONYQ2K.cjs → chunk-IBG6V56E.cjs} +16 -32
- package/dist/chunk-IBG6V56E.cjs.map +1 -0
- package/dist/{chunk-LIJVWQKU.cjs → chunk-IX3ABYKZ.cjs} +43 -31
- package/dist/chunk-IX3ABYKZ.cjs.map +1 -0
- package/dist/chunk-JYGIFBBS.cjs +146 -0
- package/dist/chunk-JYGIFBBS.cjs.map +1 -0
- package/dist/{chunk-42JPONZU.cjs → chunk-K7JPTH3G.cjs} +17 -16
- package/dist/chunk-K7JPTH3G.cjs.map +1 -0
- package/dist/{chunk-RLTG4YZM.cjs → chunk-KOCTZKPV.cjs} +2 -2
- package/dist/chunk-KOCTZKPV.cjs.map +1 -0
- package/dist/chunk-MMYAIYHJ.cjs +5538 -0
- package/dist/chunk-MMYAIYHJ.cjs.map +1 -0
- package/dist/{chunk-EWP5AT6A.cjs → chunk-N4H37VN4.cjs} +2 -11
- package/dist/chunk-N4H37VN4.cjs.map +1 -0
- package/dist/chunk-P2YW545G.js +11 -0
- package/dist/chunk-P2YW545G.js.map +1 -0
- package/dist/chunk-Q23JB3KL.js +488 -0
- package/dist/chunk-Q23JB3KL.js.map +1 -0
- package/dist/{chunk-E5X75WNB.js → chunk-QXIQWPAP.js} +14 -30
- package/dist/chunk-QXIQWPAP.js.map +1 -0
- package/dist/chunk-R3XIBBAW.cjs +34 -0
- package/dist/chunk-R3XIBBAW.cjs.map +1 -0
- package/dist/{chunk-KWGNR4HM.js → chunk-REK7AYOC.js} +82 -9
- package/dist/chunk-REK7AYOC.js.map +1 -0
- package/dist/chunk-RGIQKTZ7.js +68 -0
- package/dist/chunk-RGIQKTZ7.js.map +1 -0
- package/dist/chunk-RYDGMBIG.js +1737 -0
- package/dist/chunk-RYDGMBIG.js.map +1 -0
- package/dist/chunk-SDMNUYVU.js +30 -0
- package/dist/chunk-SDMNUYVU.js.map +1 -0
- package/dist/chunk-VEI5KQVC.cjs +1246 -0
- package/dist/chunk-VEI5KQVC.cjs.map +1 -0
- package/dist/{chunk-FTSSDDZQ.cjs → chunk-VJT6P4N6.cjs} +82 -9
- package/dist/chunk-VJT6P4N6.cjs.map +1 -0
- package/dist/{chunk-HT6VE4NW.cjs → chunk-W3KPQX7V.cjs} +168 -25
- package/dist/chunk-W3KPQX7V.cjs.map +1 -0
- package/dist/{chunk-LTRCYJAG.js → chunk-WOWUL7ZY.js} +3 -2
- package/dist/chunk-WOWUL7ZY.js.map +1 -0
- package/dist/{chunk-7YITG2US.cjs → chunk-WQBRWOQT.cjs} +3 -2
- package/dist/chunk-WQBRWOQT.cjs.map +1 -0
- package/dist/chunk-X3CU27OO.cjs +78 -0
- package/dist/chunk-X3CU27OO.cjs.map +1 -0
- package/dist/chunk-XIXGJGQW.js +1228 -0
- package/dist/chunk-XIXGJGQW.js.map +1 -0
- package/dist/cli/index.cjs +2 -2
- package/dist/cli/index.js +2 -2
- package/dist/client.cjs +23 -13
- package/dist/client.d.cts +4 -2
- package/dist/client.d.ts +4 -2
- package/dist/client.js +3 -1
- package/dist/drizzle/index.cjs +20 -19
- package/dist/drizzle/index.d.cts +28 -7
- package/dist/drizzle/index.d.ts +28 -7
- package/dist/drizzle/index.js +5 -4
- package/dist/fields/index.cjs +105 -0
- package/dist/fields/index.cjs.map +1 -0
- package/dist/fields/index.d.cts +27 -0
- package/dist/fields/index.d.ts +27 -0
- package/dist/fields/index.js +4 -0
- package/dist/fields/index.js.map +1 -0
- package/dist/graphql/index.cjs +4 -3
- package/dist/graphql/index.d.cts +3 -2
- package/dist/graphql/index.d.ts +3 -2
- package/dist/graphql/index.js +2 -1
- package/dist/{index-Ci6r4xnN.d.ts → index-CLp-DRKA.d.ts} +2 -1
- package/dist/{index-11MDNKce.d.cts → index-DfO7G4kN.d.cts} +2 -1
- package/dist/index.cjs +2621 -6672
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +136 -47
- package/dist/index.d.ts +136 -47
- package/dist/index.js +2333 -6546
- package/dist/index.js.map +1 -1
- package/dist/integration.cjs +68 -0
- package/dist/integration.cjs.map +1 -0
- package/dist/integration.d.cts +27 -0
- package/dist/integration.d.ts +27 -0
- package/dist/integration.js +61 -0
- package/dist/integration.js.map +1 -0
- package/dist/mongodb/index.cjs +4 -4
- package/dist/mongodb/index.d.cts +20 -6
- package/dist/mongodb/index.d.ts +20 -6
- package/dist/mongodb/index.js +2 -2
- package/dist/postgres-auth-adapter-7F3ECO7I.js +5 -0
- package/dist/{postgres-auth-adapter-OTRWSTT5.js.map → postgres-auth-adapter-7F3ECO7I.js.map} +1 -1
- package/dist/postgres-auth-adapter-Z463NYJZ.cjs +14 -0
- package/dist/{postgres-auth-adapter-EVRPO7BQ.cjs.map → postgres-auth-adapter-Z463NYJZ.cjs.map} +1 -1
- package/dist/redis-adapter-LPUWLE4Y.cjs +13 -0
- package/dist/{redis-adapter-E7PMN5HW.cjs.map → redis-adapter-LPUWLE4Y.cjs.map} +1 -1
- package/dist/redis-adapter-THYDCGQR.js +4 -0
- package/dist/{redis-adapter-HOO67RBQ.js.map → redis-adapter-THYDCGQR.js.map} +1 -1
- package/dist/rest/index.cjs +8 -5
- package/dist/rest/index.d.cts +6 -3
- package/dist/rest/index.d.ts +6 -3
- package/dist/rest/index.js +6 -3
- package/dist/{schema-CNB2DDTX.js → schema-6Q4W6AE6.js} +3 -3
- package/dist/{schema-CNB2DDTX.js.map → schema-6Q4W6AE6.js.map} +1 -1
- package/dist/{schema-Y777CQQS.cjs → schema-TIYTCIKX.cjs} +14 -14
- package/dist/{schema-Y777CQQS.cjs.map → schema-TIYTCIKX.cjs.map} +1 -1
- package/dist/templates/index.cjs +27 -23
- package/dist/templates/index.d.cts +8 -2
- package/dist/templates/index.d.ts +8 -2
- package/dist/templates/index.js +1 -1
- package/dist/trpc/index.cjs +12 -11
- package/dist/trpc/index.d.cts +3 -2
- package/dist/trpc/index.d.ts +3 -2
- package/dist/trpc/index.js +3 -2
- package/dist/{types-kGfsGdos.d.cts → types-Bs1up4yP.d.ts} +76 -244
- package/dist/{types-1u353OHN.d.ts → types-Da83JLDk.d.cts} +6 -2
- package/dist/{types-1u353OHN.d.cts → types-Da83JLDk.d.ts} +6 -2
- package/dist/{types-kGfsGdos.d.ts → types-J3R9nVsZ.d.cts} +76 -244
- package/dist/types-VtjUxIMp.d.cts +246 -0
- package/dist/types-VtjUxIMp.d.ts +246 -0
- package/package.json +16 -9
- package/dist/bootstrap-BMWVB2T6.cjs +0 -31
- package/dist/bootstrap-LL6O7PWO.js +0 -6
- package/dist/chunk-42JPONZU.cjs.map +0 -1
- package/dist/chunk-44BF6ALS.cjs.map +0 -1
- package/dist/chunk-4M5PHMUE.cjs +0 -947
- package/dist/chunk-4M5PHMUE.cjs.map +0 -1
- package/dist/chunk-6MSSF46R.js +0 -941
- package/dist/chunk-6MSSF46R.js.map +0 -1
- package/dist/chunk-7YITG2US.cjs.map +0 -1
- package/dist/chunk-BTOE3VUK.js +0 -330
- package/dist/chunk-BTOE3VUK.js.map +0 -1
- package/dist/chunk-BXMWDUED.js.map +0 -1
- package/dist/chunk-DIC236EW.js.map +0 -1
- package/dist/chunk-E5X75WNB.js.map +0 -1
- package/dist/chunk-E63IF3MD.cjs +0 -951
- package/dist/chunk-E63IF3MD.cjs.map +0 -1
- package/dist/chunk-EWP5AT6A.cjs.map +0 -1
- package/dist/chunk-FTSSDDZQ.cjs.map +0 -1
- package/dist/chunk-GE5DMB44.js.map +0 -1
- package/dist/chunk-GVFB5C6O.cjs +0 -345
- package/dist/chunk-GVFB5C6O.cjs.map +0 -1
- package/dist/chunk-HT6VE4NW.cjs.map +0 -1
- package/dist/chunk-HVSQDZZJ.cjs +0 -765
- package/dist/chunk-HVSQDZZJ.cjs.map +0 -1
- package/dist/chunk-HYC4GNHX.js +0 -758
- package/dist/chunk-HYC4GNHX.js.map +0 -1
- package/dist/chunk-KB6QF4HO.js.map +0 -1
- package/dist/chunk-KWGNR4HM.js.map +0 -1
- package/dist/chunk-LIJVWQKU.cjs.map +0 -1
- package/dist/chunk-LTRCYJAG.js.map +0 -1
- package/dist/chunk-OUGKLCYF.js.map +0 -1
- package/dist/chunk-PNBZZ76A.cjs.map +0 -1
- package/dist/chunk-QKOFKITP.js.map +0 -1
- package/dist/chunk-RLTG4YZM.cjs.map +0 -1
- package/dist/chunk-RRYXQMZG.js +0 -935
- package/dist/chunk-RRYXQMZG.js.map +0 -1
- package/dist/chunk-U74F3YZU.js.map +0 -1
- package/dist/chunk-VIONYQ2K.cjs.map +0 -1
- package/dist/postgres-auth-adapter-EVRPO7BQ.cjs +0 -14
- package/dist/postgres-auth-adapter-OTRWSTT5.js +0 -5
- package/dist/redis-adapter-E7PMN5HW.cjs +0 -13
- package/dist/redis-adapter-HOO67RBQ.js +0 -4
|
@@ -33,6 +33,7 @@ interface AuditLogFilter {
|
|
|
33
33
|
|
|
34
34
|
interface AuthUser {
|
|
35
35
|
id: string;
|
|
36
|
+
name?: string;
|
|
36
37
|
email: string;
|
|
37
38
|
passwordHash?: string;
|
|
38
39
|
role: UserRole;
|
|
@@ -60,8 +61,9 @@ interface JWTPayload {
|
|
|
60
61
|
email: string;
|
|
61
62
|
role: UserRole;
|
|
62
63
|
tenantId?: string;
|
|
63
|
-
iat
|
|
64
|
-
exp
|
|
64
|
+
iat?: number;
|
|
65
|
+
exp?: number;
|
|
66
|
+
sid?: string;
|
|
65
67
|
}
|
|
66
68
|
interface AuthTokenConfig {
|
|
67
69
|
secret: string;
|
|
@@ -92,6 +94,7 @@ interface AuthAdapter {
|
|
|
92
94
|
createUser(data: {
|
|
93
95
|
email: string;
|
|
94
96
|
password: string;
|
|
97
|
+
name?: string;
|
|
95
98
|
role?: UserRole;
|
|
96
99
|
tenantId?: string;
|
|
97
100
|
}): Promise<AuthUser>;
|
|
@@ -108,6 +111,7 @@ interface AuthAdapter {
|
|
|
108
111
|
userAgent?: string;
|
|
109
112
|
}): Promise<Session>;
|
|
110
113
|
findSessionByToken(token: string): Promise<Session | null>;
|
|
114
|
+
findSessionByRefreshToken(refreshToken: string): Promise<Session | null>;
|
|
111
115
|
deleteSession(sessionId: string): Promise<boolean>;
|
|
112
116
|
deleteUserSessions(userId: string): Promise<number>;
|
|
113
117
|
hasAnyUsers?(): Promise<boolean>;
|
|
@@ -33,6 +33,7 @@ interface AuditLogFilter {
|
|
|
33
33
|
|
|
34
34
|
interface AuthUser {
|
|
35
35
|
id: string;
|
|
36
|
+
name?: string;
|
|
36
37
|
email: string;
|
|
37
38
|
passwordHash?: string;
|
|
38
39
|
role: UserRole;
|
|
@@ -60,8 +61,9 @@ interface JWTPayload {
|
|
|
60
61
|
email: string;
|
|
61
62
|
role: UserRole;
|
|
62
63
|
tenantId?: string;
|
|
63
|
-
iat
|
|
64
|
-
exp
|
|
64
|
+
iat?: number;
|
|
65
|
+
exp?: number;
|
|
66
|
+
sid?: string;
|
|
65
67
|
}
|
|
66
68
|
interface AuthTokenConfig {
|
|
67
69
|
secret: string;
|
|
@@ -92,6 +94,7 @@ interface AuthAdapter {
|
|
|
92
94
|
createUser(data: {
|
|
93
95
|
email: string;
|
|
94
96
|
password: string;
|
|
97
|
+
name?: string;
|
|
95
98
|
role?: UserRole;
|
|
96
99
|
tenantId?: string;
|
|
97
100
|
}): Promise<AuthUser>;
|
|
@@ -108,6 +111,7 @@ interface AuthAdapter {
|
|
|
108
111
|
userAgent?: string;
|
|
109
112
|
}): Promise<Session>;
|
|
110
113
|
findSessionByToken(token: string): Promise<Session | null>;
|
|
114
|
+
findSessionByRefreshToken(refreshToken: string): Promise<Session | null>;
|
|
111
115
|
deleteSession(sessionId: string): Promise<boolean>;
|
|
112
116
|
deleteUserSessions(userId: string): Promise<number>;
|
|
113
117
|
hasAnyUsers?(): Promise<boolean>;
|
|
@@ -1,242 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
description?: string;
|
|
3
|
-
placeholder?: string;
|
|
4
|
-
readOnly?: boolean;
|
|
5
|
-
hidden?: boolean;
|
|
6
|
-
width?: string;
|
|
7
|
-
position?: "sidebar" | "main";
|
|
8
|
-
autoGenerate?: string;
|
|
9
|
-
action?: string;
|
|
10
|
-
method?: string;
|
|
11
|
-
inline?: boolean;
|
|
12
|
-
condition?: (data: Record<string, any>, siblingData: Record<string, any>) => boolean;
|
|
13
|
-
}
|
|
14
|
-
interface BaseField {
|
|
15
|
-
name: string;
|
|
16
|
-
label?: string;
|
|
17
|
-
required?: boolean;
|
|
18
|
-
unique?: boolean;
|
|
19
|
-
indexed?: boolean;
|
|
20
|
-
defaultValue?: any;
|
|
21
|
-
admin?: FieldAdmin;
|
|
22
|
-
validate?: (value: any, options: ValidateOptions) => string | true | Promise<string | true>;
|
|
23
|
-
hooks?: {
|
|
24
|
-
beforeValidate?: Hook$1[];
|
|
25
|
-
beforeChange?: Hook$1[];
|
|
26
|
-
afterChange?: Hook$1[];
|
|
27
|
-
afterRead?: Hook$1[];
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
interface ValidateOptions {
|
|
31
|
-
data?: Record<string, any>;
|
|
32
|
-
siblingData?: Record<string, any>;
|
|
33
|
-
user?: any;
|
|
34
|
-
operation?: string;
|
|
35
|
-
required?: boolean;
|
|
36
|
-
}
|
|
37
|
-
type Hook$1 = (args: any) => Promise<any> | any;
|
|
38
|
-
type TextFieldVariant = "text" | "email" | "password" | "url" | "id";
|
|
39
|
-
interface TextField extends BaseField {
|
|
40
|
-
type: "text";
|
|
41
|
-
variant?: TextFieldVariant;
|
|
42
|
-
minLength?: number;
|
|
43
|
-
maxLength?: number;
|
|
44
|
-
pattern?: string;
|
|
45
|
-
hasMany?: boolean;
|
|
46
|
-
localized?: boolean;
|
|
47
|
-
}
|
|
48
|
-
interface NumberField extends BaseField {
|
|
49
|
-
type: "number";
|
|
50
|
-
min?: number;
|
|
51
|
-
max?: number;
|
|
52
|
-
step?: number;
|
|
53
|
-
integer?: boolean;
|
|
54
|
-
hasMany?: boolean;
|
|
55
|
-
}
|
|
56
|
-
interface CheckboxField extends BaseField {
|
|
57
|
-
type: "checkbox";
|
|
58
|
-
}
|
|
59
|
-
interface DateField extends BaseField {
|
|
60
|
-
type: "date";
|
|
61
|
-
minDate?: string;
|
|
62
|
-
maxDate?: string;
|
|
63
|
-
time?: boolean;
|
|
64
|
-
}
|
|
65
|
-
interface EmailField extends BaseField {
|
|
66
|
-
type: "email";
|
|
67
|
-
}
|
|
68
|
-
interface PasswordField extends BaseField {
|
|
69
|
-
type: "password";
|
|
70
|
-
}
|
|
71
|
-
interface TextareaField extends BaseField {
|
|
72
|
-
type: "textarea";
|
|
73
|
-
minLength?: number;
|
|
74
|
-
maxLength?: number;
|
|
75
|
-
rows?: number;
|
|
76
|
-
localized?: boolean;
|
|
77
|
-
}
|
|
78
|
-
interface SelectField extends BaseField {
|
|
79
|
-
type: "select";
|
|
80
|
-
options: Array<{
|
|
81
|
-
label: string;
|
|
82
|
-
value: string;
|
|
83
|
-
}>;
|
|
84
|
-
hasMany?: boolean;
|
|
85
|
-
defaultValue?: string | string[];
|
|
86
|
-
}
|
|
87
|
-
interface RadioField extends BaseField {
|
|
88
|
-
type: "radio";
|
|
89
|
-
options: Array<{
|
|
90
|
-
label: string;
|
|
91
|
-
value: string;
|
|
92
|
-
}>;
|
|
93
|
-
defaultValue?: string;
|
|
94
|
-
}
|
|
95
|
-
interface ColorField extends BaseField {
|
|
96
|
-
type: "color";
|
|
97
|
-
format?: "hex" | "rgb" | "hsl";
|
|
98
|
-
defaultValue?: string;
|
|
99
|
-
}
|
|
100
|
-
interface ImageField extends BaseField {
|
|
101
|
-
type: "image";
|
|
102
|
-
minCount?: number;
|
|
103
|
-
maxCount?: number;
|
|
104
|
-
allowedTypes?: string[];
|
|
105
|
-
maxSize?: number;
|
|
106
|
-
}
|
|
107
|
-
interface RichTextBlock {
|
|
108
|
-
type: string;
|
|
109
|
-
data: Record<string, any>;
|
|
110
|
-
children?: RichTextBlock[];
|
|
111
|
-
}
|
|
112
|
-
interface RichTextField extends BaseField {
|
|
113
|
-
type: "richtext";
|
|
114
|
-
editor?: "lexical" | "slate" | "blocks";
|
|
115
|
-
hasBlocks?: boolean;
|
|
116
|
-
defaultValue?: RichTextBlock[];
|
|
117
|
-
localized?: boolean;
|
|
118
|
-
}
|
|
119
|
-
interface JSONField extends BaseField {
|
|
120
|
-
type: "json";
|
|
121
|
-
defaultValue?: Record<string, any>;
|
|
122
|
-
}
|
|
123
|
-
interface CodeField extends BaseField {
|
|
124
|
-
type: "code";
|
|
125
|
-
language?: string;
|
|
126
|
-
defaultValue?: string;
|
|
127
|
-
}
|
|
128
|
-
interface UploadField extends BaseField {
|
|
129
|
-
type: "upload";
|
|
130
|
-
relationTo: string;
|
|
131
|
-
hasMany?: boolean;
|
|
132
|
-
maxDepth?: number;
|
|
133
|
-
defaultValue?: string;
|
|
134
|
-
}
|
|
135
|
-
interface MarkdownField extends BaseField {
|
|
136
|
-
type: "markdown";
|
|
137
|
-
localized?: boolean;
|
|
138
|
-
defaultValue?: string;
|
|
139
|
-
}
|
|
140
|
-
interface RelationshipField extends BaseField {
|
|
141
|
-
type: "relationship";
|
|
142
|
-
relationTo: string | string[];
|
|
143
|
-
hasMany?: boolean;
|
|
144
|
-
maxDepth?: number;
|
|
145
|
-
filterOptions?: (args: {
|
|
146
|
-
data: any;
|
|
147
|
-
user: any;
|
|
148
|
-
}) => Record<string, any>;
|
|
149
|
-
defaultValue?: string | string[];
|
|
150
|
-
}
|
|
151
|
-
interface ArrayField extends BaseField {
|
|
152
|
-
type: "array";
|
|
153
|
-
fields: Field[];
|
|
154
|
-
minRows?: number;
|
|
155
|
-
maxRows?: number;
|
|
156
|
-
labels?: {
|
|
157
|
-
singular?: string;
|
|
158
|
-
plural?: string;
|
|
159
|
-
};
|
|
160
|
-
defaultValue?: Record<string, any>[];
|
|
161
|
-
}
|
|
162
|
-
interface GroupField extends BaseField {
|
|
163
|
-
type: "group";
|
|
164
|
-
fields: Field[];
|
|
165
|
-
defaultValue?: Record<string, any>;
|
|
166
|
-
}
|
|
167
|
-
interface BlockImage {
|
|
168
|
-
url: string;
|
|
169
|
-
alt?: string;
|
|
170
|
-
}
|
|
171
|
-
interface BlockAdmin {
|
|
172
|
-
group?: string;
|
|
173
|
-
images?: {
|
|
174
|
-
icon?: BlockImage | string;
|
|
175
|
-
thumbnail?: BlockImage | string;
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
interface Block {
|
|
179
|
-
slug: string;
|
|
180
|
-
label: string;
|
|
181
|
-
fields: Field[];
|
|
182
|
-
imageURL?: string;
|
|
183
|
-
admin?: BlockAdmin;
|
|
184
|
-
}
|
|
185
|
-
interface BlocksField extends BaseField {
|
|
186
|
-
type: "blocks";
|
|
187
|
-
blocks?: Block[];
|
|
188
|
-
minRows?: number;
|
|
189
|
-
maxRows?: number;
|
|
190
|
-
defaultValue?: Array<{
|
|
191
|
-
blockType: string;
|
|
192
|
-
[key: string]: any;
|
|
193
|
-
}>;
|
|
194
|
-
}
|
|
195
|
-
interface RowField extends Omit<BaseField, "name"> {
|
|
196
|
-
type: "row";
|
|
197
|
-
fields: Field[];
|
|
198
|
-
name?: string;
|
|
199
|
-
}
|
|
200
|
-
interface CollapsibleField extends Omit<BaseField, "name"> {
|
|
201
|
-
type: "collapsible";
|
|
202
|
-
fields: Field[];
|
|
203
|
-
label: string;
|
|
204
|
-
name?: string;
|
|
205
|
-
}
|
|
206
|
-
interface TabsField extends Omit<BaseField, "name"> {
|
|
207
|
-
type: "tabs";
|
|
208
|
-
tabs: Array<{
|
|
209
|
-
label: string;
|
|
210
|
-
fields: Field[];
|
|
211
|
-
name?: string;
|
|
212
|
-
}>;
|
|
213
|
-
name?: string;
|
|
214
|
-
}
|
|
215
|
-
interface ButtonField extends BaseField {
|
|
216
|
-
type: "button";
|
|
217
|
-
label: string;
|
|
218
|
-
action?: string;
|
|
219
|
-
method?: string;
|
|
220
|
-
inline?: boolean;
|
|
221
|
-
}
|
|
222
|
-
type Field = TextField | NumberField | CheckboxField | DateField | EmailField | PasswordField | TextareaField | SelectField | RadioField | ColorField | ImageField | RichTextField | JSONField | CodeField | UploadField | MarkdownField | RelationshipField | ArrayField | GroupField | BlocksField | RowField | CollapsibleField | TabsField | ButtonField;
|
|
223
|
-
type FieldType = Field["type"];
|
|
224
|
-
declare function isTextField(field: Field): field is TextField;
|
|
225
|
-
declare function isNumberField(field: Field): field is NumberField;
|
|
226
|
-
declare function isRelationshipField(field: Field): field is RelationshipField;
|
|
227
|
-
declare function isArrayField(field: Field): field is ArrayField;
|
|
228
|
-
declare function isGroupField(field: Field): field is GroupField;
|
|
229
|
-
declare function isBlocksField(field: Field): field is BlocksField;
|
|
230
|
-
declare function isUploadField(field: Field): field is UploadField;
|
|
231
|
-
declare function isImageField(field: Field): field is ImageField;
|
|
232
|
-
declare function isRichTextField(field: Field): field is RichTextField;
|
|
233
|
-
declare function isSelectField(field: Field): field is SelectField;
|
|
234
|
-
declare function isLayoutField(field: Field): field is RowField | CollapsibleField | TabsField;
|
|
235
|
-
declare const PRIMITIVE_FIELD_TYPES: readonly ["text", "number", "checkbox", "date", "email", "password", "textarea", "select", "radio", "color"];
|
|
236
|
-
declare const COMPLEX_FIELD_TYPES: readonly ["richtext", "json", "code", "upload", "image", "markdown"];
|
|
237
|
-
declare const RELATIONAL_FIELD_TYPES: readonly ["relationship", "array", "group", "blocks"];
|
|
238
|
-
declare const LAYOUT_FIELD_TYPES: readonly ["row", "collapsible", "tabs"];
|
|
239
|
-
declare const ALL_FIELD_TYPES: readonly ["text", "number", "checkbox", "date", "email", "password", "textarea", "select", "radio", "color", "richtext", "json", "code", "upload", "image", "markdown", "relationship", "array", "group", "blocks", "row", "collapsible", "tabs"];
|
|
1
|
+
import { F as Field } from './types-VtjUxIMp.cjs';
|
|
240
2
|
|
|
241
3
|
interface Request {
|
|
242
4
|
body?: any;
|
|
@@ -384,6 +146,7 @@ interface VersionConfig {
|
|
|
384
146
|
drafts?: boolean;
|
|
385
147
|
retainDeleted?: boolean;
|
|
386
148
|
}
|
|
149
|
+
type DocumentStatus = 'draft' | 'published' | 'archived';
|
|
387
150
|
interface AuthConfig {
|
|
388
151
|
tokenExpiration?: number;
|
|
389
152
|
verify?: boolean | {
|
|
@@ -468,6 +231,8 @@ interface FindArgs {
|
|
|
468
231
|
user?: any;
|
|
469
232
|
context?: Record<string, any>;
|
|
470
233
|
overrideAccess?: boolean;
|
|
234
|
+
/** If true, returns draft docs (admin view). If false/omitted, only published docs are returned (public API). */
|
|
235
|
+
draft?: boolean;
|
|
471
236
|
}
|
|
472
237
|
interface FindByIDArgs {
|
|
473
238
|
collection: string;
|
|
@@ -478,6 +243,8 @@ interface FindByIDArgs {
|
|
|
478
243
|
user?: any;
|
|
479
244
|
context?: Record<string, any>;
|
|
480
245
|
overrideAccess?: boolean;
|
|
246
|
+
/** If true, returns document regardless of status (admin view). */
|
|
247
|
+
draft?: boolean;
|
|
481
248
|
}
|
|
482
249
|
interface CreateArgs {
|
|
483
250
|
collection: string;
|
|
@@ -520,6 +287,29 @@ interface FindResult<T = any> {
|
|
|
520
287
|
prevPage: number | null;
|
|
521
288
|
nextPage: number | null;
|
|
522
289
|
}
|
|
290
|
+
interface DraftSnapshot<T = Record<string, any>> {
|
|
291
|
+
id: string;
|
|
292
|
+
collection: string;
|
|
293
|
+
documentId: string;
|
|
294
|
+
tenantID?: string;
|
|
295
|
+
data: T;
|
|
296
|
+
baseUpdatedAt?: string | null;
|
|
297
|
+
draftUpdatedAt: string;
|
|
298
|
+
createdAt: string;
|
|
299
|
+
updatedAt: string;
|
|
300
|
+
}
|
|
301
|
+
interface DraftFindArgs {
|
|
302
|
+
collection: string;
|
|
303
|
+
documentId: string;
|
|
304
|
+
tenantID?: string;
|
|
305
|
+
}
|
|
306
|
+
interface DraftUpsertArgs<T = Record<string, any>> extends DraftFindArgs {
|
|
307
|
+
data: T;
|
|
308
|
+
baseUpdatedAt?: string | null;
|
|
309
|
+
draftUpdatedAt?: string;
|
|
310
|
+
}
|
|
311
|
+
interface DraftDeleteArgs extends DraftFindArgs {
|
|
312
|
+
}
|
|
523
313
|
interface CreateResult<T = any> {
|
|
524
314
|
doc: T;
|
|
525
315
|
errors?: Array<{
|
|
@@ -527,6 +317,36 @@ interface CreateResult<T = any> {
|
|
|
527
317
|
message: string;
|
|
528
318
|
}>;
|
|
529
319
|
}
|
|
320
|
+
interface VersionRecord<T = Record<string, any>> {
|
|
321
|
+
id: string;
|
|
322
|
+
collection: string;
|
|
323
|
+
documentId: string;
|
|
324
|
+
version: number;
|
|
325
|
+
status: DocumentStatus;
|
|
326
|
+
data: T;
|
|
327
|
+
createdBy?: string;
|
|
328
|
+
createdAt: string;
|
|
329
|
+
updatedAt: string;
|
|
330
|
+
publishedAt?: string | null;
|
|
331
|
+
changeDescription?: string;
|
|
332
|
+
}
|
|
333
|
+
interface CreateVersionArgs<T = Record<string, any>> {
|
|
334
|
+
collection: string;
|
|
335
|
+
documentId: string;
|
|
336
|
+
data: T;
|
|
337
|
+
status: DocumentStatus;
|
|
338
|
+
createdBy?: string;
|
|
339
|
+
changeDescription?: string;
|
|
340
|
+
tenantID?: string;
|
|
341
|
+
}
|
|
342
|
+
interface FindVersionsArgs {
|
|
343
|
+
collection: string;
|
|
344
|
+
documentId: string;
|
|
345
|
+
tenantID?: string;
|
|
346
|
+
limit?: number;
|
|
347
|
+
page?: number;
|
|
348
|
+
sort?: string;
|
|
349
|
+
}
|
|
530
350
|
interface BaseAdapter {
|
|
531
351
|
init(collections: CollectionConfig[], globals: GlobalConfig[]): Promise<void>;
|
|
532
352
|
find<T>(args: FindArgs): Promise<FindResult<T>>;
|
|
@@ -543,14 +363,24 @@ interface BaseAdapter {
|
|
|
543
363
|
collection: string;
|
|
544
364
|
where: Record<string, any>;
|
|
545
365
|
tenantID?: string;
|
|
366
|
+
draft?: boolean;
|
|
546
367
|
}): Promise<any>;
|
|
547
|
-
findVersions(args:
|
|
548
|
-
findVersionByID(args:
|
|
549
|
-
|
|
368
|
+
findVersions(args: FindVersionsArgs): Promise<FindResult<VersionRecord>>;
|
|
369
|
+
findVersionByID(args: {
|
|
370
|
+
collection: string;
|
|
371
|
+
versionId: string;
|
|
372
|
+
tenantID?: string;
|
|
373
|
+
}): Promise<VersionRecord | null>;
|
|
374
|
+
createVersion<T = Record<string, any>>(args: CreateVersionArgs<T>): Promise<VersionRecord<T>>;
|
|
550
375
|
deleteVersions(args: {
|
|
551
376
|
collection: string;
|
|
552
|
-
|
|
377
|
+
documentId: string;
|
|
378
|
+
keepLatest?: number;
|
|
379
|
+
tenantID?: string;
|
|
553
380
|
}): Promise<void>;
|
|
381
|
+
findDraft<T = Record<string, any>>(args: DraftFindArgs): Promise<DraftSnapshot<T> | null>;
|
|
382
|
+
upsertDraft<T = Record<string, any>>(args: DraftUpsertArgs<T>): Promise<DraftSnapshot<T>>;
|
|
383
|
+
deleteDraft(args: DraftDeleteArgs): Promise<void>;
|
|
554
384
|
migrate?(): Promise<void>;
|
|
555
385
|
rollback?(): Promise<void>;
|
|
556
386
|
connect(): Promise<void>;
|
|
@@ -586,7 +416,9 @@ interface KyroConfig {
|
|
|
586
416
|
sameSite?: "strict" | "lax" | "none";
|
|
587
417
|
domain?: string;
|
|
588
418
|
};
|
|
419
|
+
checkSession?: boolean;
|
|
589
420
|
};
|
|
421
|
+
authAdapter?: any;
|
|
590
422
|
cors?: {
|
|
591
423
|
origins?: string[];
|
|
592
424
|
credentials?: boolean;
|
|
@@ -626,4 +458,4 @@ interface KyroConfig {
|
|
|
626
458
|
debug?: boolean;
|
|
627
459
|
}
|
|
628
460
|
|
|
629
|
-
export { type
|
|
461
|
+
export { type AdminConfig as A, type BaseAdapter as B, type CollectionConfig as C, type DeleteArgs as D, mergeWhereClauses as E, type FindArgs as F, type GlobalConfig as G, type Hook as H, type ImageSize as I, runFieldHooks as J, type KyroConfig as K, runHooks as L, type PluginConfig as P, type Request as R, type UploadConfig as U, type VersionConfig as V, type WhereClause as W, type AuthConfig as a, type FindResult as b, type FindByIDArgs as c, type CreateArgs as d, type UpdateArgs as e, type FindVersionsArgs as f, type VersionRecord as g, type CreateVersionArgs as h, type DraftFindArgs as i, type DraftSnapshot as j, type DraftUpsertArgs as k, type DraftDeleteArgs as l, type User as m, type AccessArgs as n, type AccessControl as o, type AdapterConfig as p, type CollectionAccess as q, type CollectionHooks as r, type CreateResult as s, type FieldAccess as t, type FieldHooks as u, type GlobalAccess as v, type GlobalHooks as w, type HookArgs as x, evaluateAccess as y, getWhereClause as z };
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
interface FieldAdmin {
|
|
2
|
+
description?: string;
|
|
3
|
+
placeholder?: string;
|
|
4
|
+
readOnly?: boolean;
|
|
5
|
+
hidden?: boolean;
|
|
6
|
+
width?: string;
|
|
7
|
+
position?: "sidebar" | "main";
|
|
8
|
+
autoGenerate?: string;
|
|
9
|
+
action?: string;
|
|
10
|
+
method?: string;
|
|
11
|
+
inline?: boolean;
|
|
12
|
+
condition?: (data: Record<string, any>, siblingData: Record<string, any>) => boolean;
|
|
13
|
+
}
|
|
14
|
+
interface BaseField {
|
|
15
|
+
name: string;
|
|
16
|
+
label?: string;
|
|
17
|
+
required?: boolean;
|
|
18
|
+
unique?: boolean;
|
|
19
|
+
indexed?: boolean;
|
|
20
|
+
defaultValue?: any;
|
|
21
|
+
admin?: FieldAdmin;
|
|
22
|
+
validate?: (value: any, options: ValidateOptions) => string | true | Promise<string | true>;
|
|
23
|
+
hooks?: {
|
|
24
|
+
beforeValidate?: Hook[];
|
|
25
|
+
beforeChange?: Hook[];
|
|
26
|
+
afterChange?: Hook[];
|
|
27
|
+
afterRead?: Hook[];
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
interface ValidateOptions {
|
|
31
|
+
data?: Record<string, any>;
|
|
32
|
+
siblingData?: Record<string, any>;
|
|
33
|
+
user?: any;
|
|
34
|
+
operation?: string;
|
|
35
|
+
required?: boolean;
|
|
36
|
+
}
|
|
37
|
+
type Hook = (args: any) => Promise<any> | any;
|
|
38
|
+
type TextFieldVariant = "text" | "email" | "password" | "url" | "id";
|
|
39
|
+
interface TextField extends BaseField {
|
|
40
|
+
type: "text";
|
|
41
|
+
variant?: TextFieldVariant;
|
|
42
|
+
minLength?: number;
|
|
43
|
+
maxLength?: number;
|
|
44
|
+
pattern?: string;
|
|
45
|
+
hasMany?: boolean;
|
|
46
|
+
localized?: boolean;
|
|
47
|
+
}
|
|
48
|
+
interface NumberField extends BaseField {
|
|
49
|
+
type: "number";
|
|
50
|
+
min?: number;
|
|
51
|
+
max?: number;
|
|
52
|
+
step?: number;
|
|
53
|
+
integer?: boolean;
|
|
54
|
+
hasMany?: boolean;
|
|
55
|
+
}
|
|
56
|
+
interface CheckboxField extends BaseField {
|
|
57
|
+
type: "checkbox";
|
|
58
|
+
}
|
|
59
|
+
interface DateField extends BaseField {
|
|
60
|
+
type: "date";
|
|
61
|
+
minDate?: string;
|
|
62
|
+
maxDate?: string;
|
|
63
|
+
time?: boolean;
|
|
64
|
+
}
|
|
65
|
+
interface EmailField extends BaseField {
|
|
66
|
+
type: "email";
|
|
67
|
+
}
|
|
68
|
+
interface PasswordField extends BaseField {
|
|
69
|
+
type: "password";
|
|
70
|
+
}
|
|
71
|
+
interface TextareaField extends BaseField {
|
|
72
|
+
type: "textarea";
|
|
73
|
+
minLength?: number;
|
|
74
|
+
maxLength?: number;
|
|
75
|
+
rows?: number;
|
|
76
|
+
localized?: boolean;
|
|
77
|
+
}
|
|
78
|
+
interface SelectField extends BaseField {
|
|
79
|
+
type: "select";
|
|
80
|
+
options: Array<{
|
|
81
|
+
label: string;
|
|
82
|
+
value: string;
|
|
83
|
+
}>;
|
|
84
|
+
hasMany?: boolean;
|
|
85
|
+
defaultValue?: string | string[];
|
|
86
|
+
}
|
|
87
|
+
interface RadioField extends BaseField {
|
|
88
|
+
type: "radio";
|
|
89
|
+
options: Array<{
|
|
90
|
+
label: string;
|
|
91
|
+
value: string;
|
|
92
|
+
}>;
|
|
93
|
+
defaultValue?: string;
|
|
94
|
+
}
|
|
95
|
+
interface ColorField extends BaseField {
|
|
96
|
+
type: "color";
|
|
97
|
+
format?: "hex" | "rgb" | "hsl";
|
|
98
|
+
defaultValue?: string;
|
|
99
|
+
}
|
|
100
|
+
interface ImageField extends BaseField {
|
|
101
|
+
type: "image";
|
|
102
|
+
minCount?: number;
|
|
103
|
+
maxCount?: number;
|
|
104
|
+
allowedTypes?: string[];
|
|
105
|
+
maxSize?: number;
|
|
106
|
+
}
|
|
107
|
+
interface RichTextBlock {
|
|
108
|
+
type: string;
|
|
109
|
+
data: Record<string, any>;
|
|
110
|
+
children?: RichTextBlock[];
|
|
111
|
+
}
|
|
112
|
+
interface RichTextField extends BaseField {
|
|
113
|
+
type: "richtext";
|
|
114
|
+
editor?: "lexical" | "slate" | "blocks";
|
|
115
|
+
hasBlocks?: boolean;
|
|
116
|
+
defaultValue?: RichTextBlock[];
|
|
117
|
+
localized?: boolean;
|
|
118
|
+
}
|
|
119
|
+
interface JSONField extends BaseField {
|
|
120
|
+
type: "json";
|
|
121
|
+
defaultValue?: Record<string, any>;
|
|
122
|
+
}
|
|
123
|
+
interface CodeField extends BaseField {
|
|
124
|
+
type: "code";
|
|
125
|
+
language?: string;
|
|
126
|
+
defaultValue?: string;
|
|
127
|
+
}
|
|
128
|
+
interface UploadField extends BaseField {
|
|
129
|
+
type: "upload";
|
|
130
|
+
relationTo: string;
|
|
131
|
+
hasMany?: boolean;
|
|
132
|
+
maxDepth?: number;
|
|
133
|
+
defaultValue?: string;
|
|
134
|
+
}
|
|
135
|
+
interface MarkdownField extends BaseField {
|
|
136
|
+
type: "markdown";
|
|
137
|
+
localized?: boolean;
|
|
138
|
+
defaultValue?: string;
|
|
139
|
+
}
|
|
140
|
+
interface RelationshipField extends BaseField {
|
|
141
|
+
type: "relationship";
|
|
142
|
+
relationTo: string | string[];
|
|
143
|
+
hasMany?: boolean;
|
|
144
|
+
maxDepth?: number;
|
|
145
|
+
filterOptions?: (args: {
|
|
146
|
+
data: any;
|
|
147
|
+
user: any;
|
|
148
|
+
}) => Record<string, any>;
|
|
149
|
+
defaultValue?: string | string[];
|
|
150
|
+
}
|
|
151
|
+
interface ArrayField extends BaseField {
|
|
152
|
+
type: "array";
|
|
153
|
+
fields: Field[];
|
|
154
|
+
minRows?: number;
|
|
155
|
+
maxRows?: number;
|
|
156
|
+
labels?: {
|
|
157
|
+
singular?: string;
|
|
158
|
+
plural?: string;
|
|
159
|
+
};
|
|
160
|
+
defaultValue?: Record<string, any>[];
|
|
161
|
+
}
|
|
162
|
+
interface ListField extends BaseField {
|
|
163
|
+
type: "list";
|
|
164
|
+
defaultValue?: string[];
|
|
165
|
+
}
|
|
166
|
+
interface GroupField extends BaseField {
|
|
167
|
+
type: "group";
|
|
168
|
+
fields: Field[];
|
|
169
|
+
defaultValue?: Record<string, any>;
|
|
170
|
+
}
|
|
171
|
+
interface BlockImage {
|
|
172
|
+
url: string;
|
|
173
|
+
alt?: string;
|
|
174
|
+
}
|
|
175
|
+
interface BlockAdmin {
|
|
176
|
+
group?: string;
|
|
177
|
+
images?: {
|
|
178
|
+
icon?: BlockImage | string;
|
|
179
|
+
thumbnail?: BlockImage | string;
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
interface Block {
|
|
183
|
+
slug: string;
|
|
184
|
+
label: string;
|
|
185
|
+
fields: Field[];
|
|
186
|
+
imageURL?: string;
|
|
187
|
+
admin?: BlockAdmin;
|
|
188
|
+
}
|
|
189
|
+
interface BlocksField extends BaseField {
|
|
190
|
+
type: "blocks";
|
|
191
|
+
blocks?: Block[];
|
|
192
|
+
minRows?: number;
|
|
193
|
+
maxRows?: number;
|
|
194
|
+
defaultValue?: Array<{
|
|
195
|
+
blockType: string;
|
|
196
|
+
[key: string]: any;
|
|
197
|
+
}>;
|
|
198
|
+
}
|
|
199
|
+
interface RowField extends Omit<BaseField, "name"> {
|
|
200
|
+
type: "row";
|
|
201
|
+
fields: Field[];
|
|
202
|
+
name?: string;
|
|
203
|
+
}
|
|
204
|
+
interface CollapsibleField extends Omit<BaseField, "name"> {
|
|
205
|
+
type: "collapsible";
|
|
206
|
+
fields: Field[];
|
|
207
|
+
label: string;
|
|
208
|
+
name?: string;
|
|
209
|
+
}
|
|
210
|
+
interface TabsField extends Omit<BaseField, "name"> {
|
|
211
|
+
type: "tabs";
|
|
212
|
+
tabs: Array<{
|
|
213
|
+
label: string;
|
|
214
|
+
fields: Field[];
|
|
215
|
+
name?: string;
|
|
216
|
+
}>;
|
|
217
|
+
name?: string;
|
|
218
|
+
}
|
|
219
|
+
interface ButtonField extends BaseField {
|
|
220
|
+
type: "button";
|
|
221
|
+
label: string;
|
|
222
|
+
action?: string;
|
|
223
|
+
method?: string;
|
|
224
|
+
inline?: boolean;
|
|
225
|
+
}
|
|
226
|
+
type Field = TextField | NumberField | CheckboxField | DateField | EmailField | PasswordField | TextareaField | SelectField | RadioField | ColorField | ImageField | RichTextField | JSONField | CodeField | UploadField | MarkdownField | RelationshipField | ArrayField | ListField | GroupField | BlocksField | RowField | CollapsibleField | TabsField | ButtonField;
|
|
227
|
+
type FieldType = Field["type"];
|
|
228
|
+
declare function isTextField(field: Field): field is TextField;
|
|
229
|
+
declare function isNumberField(field: Field): field is NumberField;
|
|
230
|
+
declare function isRelationshipField(field: Field): field is RelationshipField;
|
|
231
|
+
declare function isArrayField(field: Field): field is ArrayField;
|
|
232
|
+
declare function isGroupField(field: Field): field is GroupField;
|
|
233
|
+
declare function isBlocksField(field: Field): field is BlocksField;
|
|
234
|
+
declare function isUploadField(field: Field): field is UploadField;
|
|
235
|
+
declare function isImageField(field: Field): field is ImageField;
|
|
236
|
+
declare function isRichTextField(field: Field): field is RichTextField;
|
|
237
|
+
declare function isSelectField(field: Field): field is SelectField;
|
|
238
|
+
declare function isLayoutField(field: Field): field is RowField | CollapsibleField | TabsField;
|
|
239
|
+
declare const PRIMITIVE_FIELD_TYPES: readonly ["text", "number", "checkbox", "date", "email", "password", "textarea", "select", "radio", "color"];
|
|
240
|
+
declare const COMPLEX_FIELD_TYPES: readonly ["richtext", "json", "code", "upload", "image", "markdown"];
|
|
241
|
+
declare const RELATIONAL_FIELD_TYPES: readonly ["relationship", "array", "group", "blocks"];
|
|
242
|
+
declare const LAYOUT_FIELD_TYPES: readonly ["row", "collapsible", "tabs"];
|
|
243
|
+
declare const ALL_FIELD_TYPES: readonly ["text", "number", "checkbox", "date", "email", "password", "textarea", "select", "radio", "color", "richtext", "json", "code", "upload", "image", "markdown", "relationship", "array", "group", "blocks", "row", "collapsible", "tabs"];
|
|
244
|
+
declare function createRelationshipFieldConfig(name: string, relationTo: string | string[], options?: Partial<Omit<RelationshipField, "type" | "name" | "relationTo">>): RelationshipField;
|
|
245
|
+
|
|
246
|
+
export { type ArrayField as A, type BaseField as B, type CheckboxField as C, type DateField as D, type EmailField as E, type Field as F, type GroupField as G, isRichTextField as H, type ImageField as I, type JSONField as J, isSelectField as K, LAYOUT_FIELD_TYPES as L, type MarkdownField as M, type NumberField as N, isTextField as O, type PasswordField as P, isUploadField as Q, type RadioField as R, type SelectField as S, type TabsField as T, type UploadField as U, type ValidateOptions as V, type ButtonField as W, type Hook as X, type ListField as Y, type TextFieldVariant as Z, createRelationshipFieldConfig as _, type Block as a, type BlockAdmin as b, type BlockImage as c, type BlocksField as d, type CodeField as e, type CollapsibleField as f, type ColorField as g, type FieldAdmin as h, type FieldType as i, type RelationshipField as j, type RichTextBlock as k, type RichTextField as l, type RowField as m, type TextField as n, type TextareaField as o, ALL_FIELD_TYPES as p, COMPLEX_FIELD_TYPES as q, PRIMITIVE_FIELD_TYPES as r, RELATIONAL_FIELD_TYPES as s, isArrayField as t, isBlocksField as u, isGroupField as v, isImageField as w, isLayoutField as x, isNumberField as y, isRelationshipField as z };
|