@kyro-cms/core 0.9.0 → 0.9.1
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/README.md +57 -589
- package/dist/{WebhookService-118ZTFis.d.ts → WebhookService-CUTb9XOy.d.ts} +1 -1
- package/dist/{WebhookService-AefJfqX0.d.cts → WebhookService-Yg2UEOB4.d.cts} +1 -1
- package/dist/api-handler-graphql.cjs +44 -0
- package/dist/api-handler-graphql.cjs.map +1 -0
- package/dist/api-handler-graphql.d.cts +6 -0
- package/dist/api-handler-graphql.d.ts +6 -0
- package/dist/api-handler-graphql.js +41 -0
- package/dist/api-handler-graphql.js.map +1 -0
- package/dist/api-handler-trpc.cjs +38 -0
- package/dist/api-handler-trpc.cjs.map +1 -0
- package/dist/api-handler-trpc.d.cts +5 -0
- package/dist/api-handler-trpc.d.ts +5 -0
- package/dist/api-handler-trpc.js +36 -0
- package/dist/api-handler-trpc.js.map +1 -0
- package/dist/api-handler.cjs +31 -97
- package/dist/api-handler.cjs.map +1 -1
- package/dist/api-handler.d.cts +2 -1
- package/dist/api-handler.d.ts +2 -1
- package/dist/api-handler.js +19 -95
- package/dist/api-handler.js.map +1 -1
- package/dist/{tenant-B1YB0Jy8.d.ts → base-B71y_EAF.d.cts} +6 -12
- package/dist/{tenant-Cpeveji6.d.cts → base-DaqY2GhA.d.ts} +6 -12
- package/dist/bootstrap-5NLASFOG.cjs +32 -0
- package/dist/{bootstrap-AKAUP6F6.cjs.map → bootstrap-5NLASFOG.cjs.map} +1 -1
- package/dist/bootstrap-T5BK77LD.js +7 -0
- package/dist/{bootstrap-JCML6NFO.js.map → bootstrap-T5BK77LD.js.map} +1 -1
- package/dist/{chunk-35U3FROB.js → chunk-22M4O4ZJ.js} +607 -63
- package/dist/chunk-22M4O4ZJ.js.map +1 -0
- package/dist/chunk-2HZRBATX.cjs +253 -0
- package/dist/chunk-2HZRBATX.cjs.map +1 -0
- package/dist/{chunk-VJT6P4N6.cjs → chunk-3HR772HI.cjs} +199 -32
- package/dist/chunk-3HR772HI.cjs.map +1 -0
- package/dist/chunk-3KTWGODI.cjs +178 -0
- package/dist/chunk-3KTWGODI.cjs.map +1 -0
- package/dist/{chunk-QXIQWPAP.js → chunk-3UK5XBVJ.js} +4 -134
- package/dist/chunk-3UK5XBVJ.js.map +1 -0
- package/dist/{chunk-FXYP2HA6.js → chunk-4AO3A3JM.js} +48 -4
- package/dist/chunk-4AO3A3JM.js.map +1 -0
- package/dist/chunk-4M7X5HAB.cjs +173 -0
- package/dist/chunk-4M7X5HAB.cjs.map +1 -0
- package/dist/chunk-5EPFQUQD.js +3243 -0
- package/dist/chunk-5EPFQUQD.js.map +1 -0
- package/dist/{chunk-Y3N7UUDO.js → chunk-7OGPN7MP.js} +5 -2
- package/dist/chunk-7OGPN7MP.js.map +1 -0
- package/dist/{chunk-WOWUL7ZY.js → chunk-AL5KX63J.js} +4 -3
- package/dist/chunk-AL5KX63J.js.map +1 -0
- package/dist/{chunk-2OL4O2TH.cjs → chunk-C36TMDTY.cjs} +66 -61
- package/dist/chunk-C36TMDTY.cjs.map +1 -0
- package/dist/{chunk-ES5HNFFT.js → chunk-CF7OL6HR.js} +4 -2
- package/dist/chunk-CF7OL6HR.js.map +1 -0
- package/dist/chunk-CJONKRHJ.js +162 -0
- package/dist/chunk-CJONKRHJ.js.map +1 -0
- package/dist/{chunk-2KVHZE6O.cjs → chunk-COIASRDK.cjs} +202 -46
- package/dist/chunk-COIASRDK.cjs.map +1 -0
- package/dist/chunk-DEVFAKCQ.cjs +3291 -0
- package/dist/chunk-DEVFAKCQ.cjs.map +1 -0
- package/dist/{chunk-3ZFYL34R.js → chunk-DYTZ6FQ7.js} +12 -185
- package/dist/chunk-DYTZ6FQ7.js.map +1 -0
- package/dist/{chunk-QPPDLRNR.js → chunk-EJN2PAOE.js} +197 -41
- package/dist/chunk-EJN2PAOE.js.map +1 -0
- package/dist/chunk-FAXU7BMP.js +220 -0
- package/dist/chunk-FAXU7BMP.js.map +1 -0
- package/dist/{chunk-OHVB4AJ7.js → chunk-FOPGUM27.js} +22 -17
- package/dist/chunk-FOPGUM27.js.map +1 -0
- package/dist/chunk-GAOXD3XT.js +175 -0
- package/dist/chunk-GAOXD3XT.js.map +1 -0
- package/dist/{chunk-4DA7QPLA.cjs → chunk-GXFOGU7N.cjs} +5 -2
- package/dist/chunk-GXFOGU7N.cjs.map +1 -0
- package/dist/{chunk-I7HHI6QV.cjs → chunk-IDVRRRAK.cjs} +17 -9
- package/dist/chunk-IDVRRRAK.cjs.map +1 -0
- package/dist/{chunk-WQBRWOQT.cjs → chunk-JOPVMWTM.cjs} +3 -2
- package/dist/chunk-JOPVMWTM.cjs.map +1 -0
- package/dist/chunk-KC2GDBLS.cjs +84 -0
- package/dist/chunk-KC2GDBLS.cjs.map +1 -0
- package/dist/{chunk-K7JPTH3G.cjs → chunk-KNRSROWB.cjs} +132 -74
- package/dist/chunk-KNRSROWB.cjs.map +1 -0
- package/dist/{chunk-3AJE4SEG.js → chunk-KPA4AN4R.js} +125 -67
- package/dist/chunk-KPA4AN4R.js.map +1 -0
- package/dist/{chunk-QUW2RZTM.cjs → chunk-L46ROHUS.cjs} +51 -7
- package/dist/chunk-L46ROHUS.cjs.map +1 -0
- package/dist/chunk-L4EZKIEX.js +185 -0
- package/dist/chunk-L4EZKIEX.js.map +1 -0
- package/dist/{chunk-REK7AYOC.js → chunk-L5UKKZQN.js} +199 -32
- package/dist/chunk-L5UKKZQN.js.map +1 -0
- package/dist/chunk-NKPKR5BW.cjs +188 -0
- package/dist/chunk-NKPKR5BW.cjs.map +1 -0
- package/dist/{chunk-Y3QQN7PN.js → chunk-P2HKJ7P5.js} +13 -4
- package/dist/chunk-P2HKJ7P5.js.map +1 -0
- package/dist/{chunk-SA7NSSIQ.cjs → chunk-PI73NNOK.cjs} +13 -187
- package/dist/chunk-PI73NNOK.cjs.map +1 -0
- package/dist/{chunk-HXRD4B37.js → chunk-PU2Z5VWF.js} +1279 -556
- package/dist/chunk-PU2Z5VWF.js.map +1 -0
- package/dist/{chunk-H727JIG7.js → chunk-Q72BOAPK.js} +16 -8
- package/dist/chunk-Q72BOAPK.js.map +1 -0
- package/dist/{chunk-IBG6V56E.cjs → chunk-QFLB4EIJ.cjs} +2 -139
- package/dist/chunk-QFLB4EIJ.cjs.map +1 -0
- package/dist/{chunk-YVUJBEXE.cjs → chunk-RAMGUDJN.cjs} +16 -7
- package/dist/chunk-RAMGUDJN.cjs.map +1 -0
- package/dist/{chunk-LINKCEG4.cjs → chunk-ROJHKAQ4.cjs} +617 -73
- package/dist/chunk-ROJHKAQ4.cjs.map +1 -0
- package/dist/{chunk-5KVM3WEY.cjs → chunk-RSF3UU7H.cjs} +1330 -602
- package/dist/chunk-RSF3UU7H.cjs.map +1 -0
- package/dist/{chunk-V3LKPM3O.cjs → chunk-SHTTJMLT.cjs} +4 -2
- package/dist/chunk-SHTTJMLT.cjs.map +1 -0
- package/dist/chunk-SPBTLUN6.js +92 -0
- package/dist/chunk-SPBTLUN6.js.map +1 -0
- package/dist/{chunk-57P6MJKC.js → chunk-TXSZFA4G.js} +3 -3
- package/dist/chunk-TXSZFA4G.js.map +1 -0
- package/dist/chunk-UERVXYVK.cjs +99 -0
- package/dist/chunk-UERVXYVK.cjs.map +1 -0
- package/dist/{chunk-PDYFVNUX.cjs → chunk-V2TVSCV5.cjs} +16 -23
- package/dist/chunk-V2TVSCV5.cjs.map +1 -0
- package/dist/{chunk-DXHRBMGB.js → chunk-VO35MNPH.js} +12 -19
- package/dist/chunk-VO35MNPH.js.map +1 -0
- package/dist/{chunk-IA6AU5PI.cjs → chunk-WNCYAKF3.cjs} +3 -3
- package/dist/chunk-WNCYAKF3.cjs.map +1 -0
- package/dist/chunk-XEB7PH2E.js +81 -0
- package/dist/chunk-XEB7PH2E.js.map +1 -0
- package/dist/cli/index.cjs +5 -5
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.js +5 -5
- package/dist/cli/index.js.map +1 -1
- package/dist/client.cjs +3 -3
- package/dist/client.d.cts +3 -3
- package/dist/client.d.ts +3 -3
- package/dist/client.js +1 -1
- package/dist/drizzle/index.cjs +14 -13
- package/dist/drizzle/index.d.cts +9 -7
- package/dist/drizzle/index.d.ts +9 -7
- package/dist/drizzle/index.js +5 -4
- package/dist/fields/index.cjs +21 -37
- package/dist/fields/index.d.cts +2 -22
- package/dist/fields/index.d.ts +2 -22
- package/dist/fields/index.js +1 -1
- package/dist/graphql/index.cjs +5 -4
- package/dist/graphql/index.d.cts +5 -3
- package/dist/graphql/index.d.ts +5 -3
- package/dist/graphql/index.js +3 -2
- package/dist/index-CJXPB_ot.d.ts +276 -0
- package/dist/index-CaTNnLGd.d.cts +276 -0
- package/dist/index.cjs +304 -162
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +129 -205
- package/dist/index.d.ts +129 -205
- package/dist/index.js +172 -33
- package/dist/index.js.map +1 -1
- package/dist/integration.cjs +2 -2
- package/dist/integration.js +1 -1
- package/dist/mongo-auth-adapter-ISOM7FSS.cjs +17 -0
- package/dist/{mongo-auth-adapter-NHHUJHVH.cjs.map → mongo-auth-adapter-ISOM7FSS.cjs.map} +1 -1
- package/dist/mongo-auth-adapter-MO6STCV3.js +4 -0
- package/dist/{mongo-auth-adapter-NJQUUCTP.js.map → mongo-auth-adapter-MO6STCV3.js.map} +1 -1
- package/dist/mongodb/index.cjs +8 -7
- package/dist/mongodb/index.d.cts +5 -7
- package/dist/mongodb/index.d.ts +5 -7
- package/dist/mongodb/index.js +4 -3
- package/dist/postgres-auth-adapter-DWDR7P5G.js +5 -0
- package/dist/{postgres-auth-adapter-3T2NKTSE.js.map → postgres-auth-adapter-DWDR7P5G.js.map} +1 -1
- package/dist/postgres-auth-adapter-WRWSJD4E.cjs +14 -0
- package/dist/{postgres-auth-adapter-7IEENCKQ.cjs.map → postgres-auth-adapter-WRWSJD4E.cjs.map} +1 -1
- package/dist/redis-adapter-HGTPWIGV.js +4 -0
- package/dist/{redis-adapter-VQXD7ESY.js.map → redis-adapter-HGTPWIGV.js.map} +1 -1
- package/dist/redis-adapter-KJ3YOOT6.cjs +13 -0
- package/dist/{redis-adapter-D2E2S3GB.cjs.map → redis-adapter-KJ3YOOT6.cjs.map} +1 -1
- package/dist/rest/index.cjs +15 -14
- package/dist/rest/index.d.cts +4 -4
- package/dist/rest/index.d.ts +4 -4
- package/dist/rest/index.js +13 -12
- package/dist/{schema-5PHL5IVB.js → schema-6I5OFR4Z.js} +3 -3
- package/dist/{schema-5PHL5IVB.js.map → schema-6I5OFR4Z.js.map} +1 -1
- package/dist/{schema-37SE2F4B.cjs → schema-TTFE4467.cjs} +14 -14
- package/dist/{schema-37SE2F4B.cjs.map → schema-TTFE4467.cjs.map} +1 -1
- package/dist/sqlite-adapter-6GEUSVXQ.js +4 -0
- package/dist/{sqlite-adapter-TR3U3W6Q.js.map → sqlite-adapter-6GEUSVXQ.js.map} +1 -1
- package/dist/sqlite-adapter-CSIZE5SX.cjs +13 -0
- package/dist/{sqlite-adapter-LVK5PS4T.cjs.map → sqlite-adapter-CSIZE5SX.cjs.map} +1 -1
- package/dist/templates/index.cjs +133 -31
- package/dist/templates/index.d.cts +52 -9
- package/dist/templates/index.d.ts +52 -9
- package/dist/templates/index.js +3 -1
- package/dist/trpc/index.cjs +13 -12
- package/dist/trpc/index.d.cts +55 -49
- package/dist/trpc/index.d.ts +55 -49
- package/dist/trpc/index.js +4 -3
- package/dist/{types-D6ZLRGbH.d.cts → types-CpjuXbe7.d.cts} +2 -0
- package/dist/{types-D6ZLRGbH.d.ts → types-CpjuXbe7.d.ts} +2 -0
- package/dist/{types-Bs1up4yP.d.ts → types-CyCQ6SAI.d.ts} +28 -2
- package/dist/{types-J3R9nVsZ.d.cts → types-DJxD9394.d.cts} +28 -2
- package/dist/{types-VtjUxIMp.d.cts → types-Z6FBiqa2.d.cts} +35 -14
- package/dist/{types-VtjUxIMp.d.ts → types-Z6FBiqa2.d.ts} +35 -14
- package/package.json +22 -4
- package/dist/bootstrap-AKAUP6F6.cjs +0 -32
- package/dist/bootstrap-JCML6NFO.js +0 -7
- package/dist/chunk-2KVHZE6O.cjs.map +0 -1
- package/dist/chunk-2OL4O2TH.cjs.map +0 -1
- package/dist/chunk-35U3FROB.js.map +0 -1
- package/dist/chunk-3AJE4SEG.js.map +0 -1
- package/dist/chunk-3J4MFTI3.js +0 -3872
- package/dist/chunk-3J4MFTI3.js.map +0 -1
- package/dist/chunk-3ZFYL34R.js.map +0 -1
- package/dist/chunk-4DA7QPLA.cjs.map +0 -1
- package/dist/chunk-57P6MJKC.js.map +0 -1
- package/dist/chunk-5KVM3WEY.cjs.map +0 -1
- package/dist/chunk-6IMPH6WV.cjs +0 -3897
- package/dist/chunk-6IMPH6WV.cjs.map +0 -1
- package/dist/chunk-ATBOUGQP.cjs +0 -513
- package/dist/chunk-ATBOUGQP.cjs.map +0 -1
- package/dist/chunk-DXHRBMGB.js.map +0 -1
- package/dist/chunk-ES5HNFFT.js.map +0 -1
- package/dist/chunk-FXYP2HA6.js.map +0 -1
- package/dist/chunk-H727JIG7.js.map +0 -1
- package/dist/chunk-HXRD4B37.js.map +0 -1
- package/dist/chunk-I7HHI6QV.cjs.map +0 -1
- package/dist/chunk-IA6AU5PI.cjs.map +0 -1
- package/dist/chunk-IBG6V56E.cjs.map +0 -1
- package/dist/chunk-K7JPTH3G.cjs.map +0 -1
- package/dist/chunk-LINKCEG4.cjs.map +0 -1
- package/dist/chunk-OHVB4AJ7.js.map +0 -1
- package/dist/chunk-PDYFVNUX.cjs.map +0 -1
- package/dist/chunk-Q23JB3KL.js +0 -488
- package/dist/chunk-Q23JB3KL.js.map +0 -1
- package/dist/chunk-QPPDLRNR.js.map +0 -1
- package/dist/chunk-QUW2RZTM.cjs.map +0 -1
- package/dist/chunk-QXIQWPAP.js.map +0 -1
- package/dist/chunk-R3XIBBAW.cjs +0 -34
- package/dist/chunk-R3XIBBAW.cjs.map +0 -1
- package/dist/chunk-REK7AYOC.js.map +0 -1
- package/dist/chunk-SA7NSSIQ.cjs.map +0 -1
- package/dist/chunk-SDMNUYVU.js +0 -30
- package/dist/chunk-SDMNUYVU.js.map +0 -1
- package/dist/chunk-V3LKPM3O.cjs.map +0 -1
- package/dist/chunk-VJT6P4N6.cjs.map +0 -1
- package/dist/chunk-WOWUL7ZY.js.map +0 -1
- package/dist/chunk-WQBRWOQT.cjs.map +0 -1
- package/dist/chunk-Y3N7UUDO.js.map +0 -1
- package/dist/chunk-Y3QQN7PN.js.map +0 -1
- package/dist/chunk-YVUJBEXE.cjs.map +0 -1
- package/dist/index-CLp-DRKA.d.ts +0 -64
- package/dist/index-DfO7G4kN.d.cts +0 -64
- package/dist/mongo-auth-adapter-NHHUJHVH.cjs +0 -17
- package/dist/mongo-auth-adapter-NJQUUCTP.js +0 -4
- package/dist/postgres-auth-adapter-3T2NKTSE.js +0 -5
- package/dist/postgres-auth-adapter-7IEENCKQ.cjs +0 -14
- package/dist/redis-adapter-D2E2S3GB.cjs +0 -13
- package/dist/redis-adapter-VQXD7ESY.js +0 -4
- package/dist/sqlite-adapter-LVK5PS4T.cjs +0 -13
- package/dist/sqlite-adapter-TR3U3W6Q.js +0 -4
package/dist/trpc/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { B as BaseAdapter, R as Request, m as User, b as FindResult } from '../types-
|
|
2
|
-
import { i as createWebhookService } from '../WebhookService-
|
|
3
|
-
import '../types-
|
|
1
|
+
import { B as BaseAdapter, R as Request, m as User, b as FindResult } from '../types-CyCQ6SAI.js';
|
|
2
|
+
import { i as createWebhookService } from '../WebhookService-CUTb9XOy.js';
|
|
3
|
+
import '../types-Z6FBiqa2.js';
|
|
4
4
|
|
|
5
5
|
interface ApiKeyContext {
|
|
6
6
|
userId: string;
|
|
@@ -30,6 +30,55 @@ declare function createContext(options: {
|
|
|
30
30
|
settings?: Record<string, any>;
|
|
31
31
|
}): Promise<KyroContext>;
|
|
32
32
|
|
|
33
|
+
declare function createFindProcedure(ctx: KyroContext): (input: {
|
|
34
|
+
collection: string;
|
|
35
|
+
where?: Record<string, any>;
|
|
36
|
+
sort?: string;
|
|
37
|
+
limit?: number;
|
|
38
|
+
page?: number;
|
|
39
|
+
depth?: number;
|
|
40
|
+
select?: string[];
|
|
41
|
+
draft?: boolean;
|
|
42
|
+
}) => Promise<FindResult<unknown>>;
|
|
43
|
+
declare function createFindByIDProcedure(ctx: KyroContext): (input: {
|
|
44
|
+
collection: string;
|
|
45
|
+
id: string;
|
|
46
|
+
depth?: number;
|
|
47
|
+
select?: string[];
|
|
48
|
+
draft?: boolean;
|
|
49
|
+
}) => Promise<{}>;
|
|
50
|
+
declare function createCreateProcedure(ctx: KyroContext): (input: {
|
|
51
|
+
collection: string;
|
|
52
|
+
data: Record<string, any>;
|
|
53
|
+
depth?: number;
|
|
54
|
+
select?: string[];
|
|
55
|
+
}) => Promise<{
|
|
56
|
+
doc: unknown;
|
|
57
|
+
}>;
|
|
58
|
+
declare function createUpdateProcedure(ctx: KyroContext): (input: {
|
|
59
|
+
collection: string;
|
|
60
|
+
id: string;
|
|
61
|
+
data: Record<string, any>;
|
|
62
|
+
depth?: number;
|
|
63
|
+
select?: string[];
|
|
64
|
+
baseUpdatedAt?: string;
|
|
65
|
+
}) => Promise<{
|
|
66
|
+
doc: unknown;
|
|
67
|
+
}>;
|
|
68
|
+
declare function createDeleteProcedure(ctx: KyroContext): (input: {
|
|
69
|
+
collection: string;
|
|
70
|
+
id: string;
|
|
71
|
+
}) => Promise<{
|
|
72
|
+
doc: unknown;
|
|
73
|
+
message: string;
|
|
74
|
+
}>;
|
|
75
|
+
declare function createCountProcedure(ctx: KyroContext): (input: {
|
|
76
|
+
collection: string;
|
|
77
|
+
where?: Record<string, any>;
|
|
78
|
+
}) => Promise<{
|
|
79
|
+
totalDocs: number;
|
|
80
|
+
}>;
|
|
81
|
+
|
|
33
82
|
declare function createDynamicRouter(ctx: KyroContext): Record<string, any>;
|
|
34
83
|
interface KyroRouter {
|
|
35
84
|
[collectionSlug: string]: {
|
|
@@ -40,6 +89,7 @@ interface KyroRouter {
|
|
|
40
89
|
page?: number;
|
|
41
90
|
depth?: number;
|
|
42
91
|
select?: string[];
|
|
92
|
+
draft?: boolean;
|
|
43
93
|
}) => Promise<{
|
|
44
94
|
docs: any[];
|
|
45
95
|
totalDocs: number;
|
|
@@ -56,6 +106,7 @@ interface KyroRouter {
|
|
|
56
106
|
id: string;
|
|
57
107
|
depth?: number;
|
|
58
108
|
select?: string[];
|
|
109
|
+
draft?: boolean;
|
|
59
110
|
}) => Promise<any>;
|
|
60
111
|
create: (input: {
|
|
61
112
|
data: Record<string, any>;
|
|
@@ -69,6 +120,7 @@ interface KyroRouter {
|
|
|
69
120
|
data: Record<string, any>;
|
|
70
121
|
depth?: number;
|
|
71
122
|
select?: string[];
|
|
123
|
+
baseUpdatedAt?: string;
|
|
72
124
|
}) => Promise<{
|
|
73
125
|
doc: any;
|
|
74
126
|
}>;
|
|
@@ -87,50 +139,4 @@ interface KyroRouter {
|
|
|
87
139
|
}
|
|
88
140
|
declare function createKyroServer(ctx: KyroContext): KyroRouter;
|
|
89
141
|
|
|
90
|
-
declare function createFindProcedure(ctx: KyroContext): (input: {
|
|
91
|
-
collection: string;
|
|
92
|
-
where?: Record<string, any>;
|
|
93
|
-
sort?: string;
|
|
94
|
-
limit?: number;
|
|
95
|
-
page?: number;
|
|
96
|
-
depth?: number;
|
|
97
|
-
select?: string[];
|
|
98
|
-
}) => Promise<FindResult<unknown>>;
|
|
99
|
-
declare function createFindByIDProcedure(ctx: KyroContext): (input: {
|
|
100
|
-
collection: string;
|
|
101
|
-
id: string;
|
|
102
|
-
depth?: number;
|
|
103
|
-
select?: string[];
|
|
104
|
-
}) => Promise<{}>;
|
|
105
|
-
declare function createCreateProcedure(ctx: KyroContext): (input: {
|
|
106
|
-
collection: string;
|
|
107
|
-
data: Record<string, any>;
|
|
108
|
-
depth?: number;
|
|
109
|
-
select?: string[];
|
|
110
|
-
}) => Promise<{
|
|
111
|
-
doc: unknown;
|
|
112
|
-
}>;
|
|
113
|
-
declare function createUpdateProcedure(ctx: KyroContext): (input: {
|
|
114
|
-
collection: string;
|
|
115
|
-
id: string;
|
|
116
|
-
data: Record<string, any>;
|
|
117
|
-
depth?: number;
|
|
118
|
-
select?: string[];
|
|
119
|
-
}) => Promise<{
|
|
120
|
-
doc: unknown;
|
|
121
|
-
}>;
|
|
122
|
-
declare function createDeleteProcedure(ctx: KyroContext): (input: {
|
|
123
|
-
collection: string;
|
|
124
|
-
id: string;
|
|
125
|
-
}) => Promise<{
|
|
126
|
-
doc: unknown;
|
|
127
|
-
message: string;
|
|
128
|
-
}>;
|
|
129
|
-
declare function createCountProcedure(ctx: KyroContext): (input: {
|
|
130
|
-
collection: string;
|
|
131
|
-
where?: Record<string, any>;
|
|
132
|
-
}) => Promise<{
|
|
133
|
-
totalDocs: number;
|
|
134
|
-
}>;
|
|
135
|
-
|
|
136
142
|
export { type KyroContext, type KyroRouter, createContext, createCountProcedure, createCreateProcedure, createDeleteProcedure, createDynamicRouter, createFindByIDProcedure, createFindProcedure, createKyroServer, createUpdateProcedure };
|
package/dist/trpc/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export { createContext, createCountProcedure, createCreateProcedure, createDeleteProcedure, createDynamicRouter, createFindByIDProcedure, createFindProcedure, createKyroServer, createUpdateProcedure } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import '../chunk-
|
|
1
|
+
export { createContext, createCountProcedure, createCreateProcedure, createDeleteProcedure, createDynamicRouter, createFindByIDProcedure, createFindProcedure, createKyroServer, createUpdateProcedure } from '../chunk-KPA4AN4R.js';
|
|
2
|
+
import '../chunk-3UK5XBVJ.js';
|
|
3
|
+
import '../chunk-CJONKRHJ.js';
|
|
4
|
+
import '../chunk-L4EZKIEX.js';
|
|
4
5
|
import '../chunk-Z6ZWNWWR.js';
|
|
5
6
|
//# sourceMappingURL=index.js.map
|
|
6
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -37,6 +37,7 @@ interface AuthUser {
|
|
|
37
37
|
email: string;
|
|
38
38
|
passwordHash?: string;
|
|
39
39
|
role: UserRole;
|
|
40
|
+
avatar?: string;
|
|
40
41
|
tenantId?: string;
|
|
41
42
|
emailVerified?: boolean;
|
|
42
43
|
locked?: boolean;
|
|
@@ -96,6 +97,7 @@ interface AuthAdapter {
|
|
|
96
97
|
password: string;
|
|
97
98
|
name?: string;
|
|
98
99
|
role?: UserRole;
|
|
100
|
+
avatar?: string;
|
|
99
101
|
tenantId?: string;
|
|
100
102
|
}): Promise<AuthUser>;
|
|
101
103
|
findUserByEmail(email: string): Promise<AuthUser | null>;
|
|
@@ -37,6 +37,7 @@ interface AuthUser {
|
|
|
37
37
|
email: string;
|
|
38
38
|
passwordHash?: string;
|
|
39
39
|
role: UserRole;
|
|
40
|
+
avatar?: string;
|
|
40
41
|
tenantId?: string;
|
|
41
42
|
emailVerified?: boolean;
|
|
42
43
|
locked?: boolean;
|
|
@@ -96,6 +97,7 @@ interface AuthAdapter {
|
|
|
96
97
|
password: string;
|
|
97
98
|
name?: string;
|
|
98
99
|
role?: UserRole;
|
|
100
|
+
avatar?: string;
|
|
99
101
|
tenantId?: string;
|
|
100
102
|
}): Promise<AuthUser>;
|
|
101
103
|
findUserByEmail(email: string): Promise<AuthUser | null>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as Field } from './types-
|
|
1
|
+
import { F as Field } from './types-Z6FBiqa2.js';
|
|
2
2
|
|
|
3
3
|
interface Request {
|
|
4
4
|
body?: any;
|
|
@@ -97,6 +97,15 @@ declare function evaluateAccess(access: AccessControl, args: AccessArgs): Promis
|
|
|
97
97
|
declare function mergeWhereClauses(...whereClauses: (WhereClause | boolean | undefined)[]): WhereClause;
|
|
98
98
|
declare function getWhereClause(access: AccessControl, args: AccessArgs): Promise<WhereClause | undefined>;
|
|
99
99
|
|
|
100
|
+
interface TenantContext {
|
|
101
|
+
tenantId: string;
|
|
102
|
+
userId: string;
|
|
103
|
+
role?: string;
|
|
104
|
+
roles?: string[];
|
|
105
|
+
permissions?: string[];
|
|
106
|
+
isSuperAdmin?: boolean;
|
|
107
|
+
}
|
|
108
|
+
|
|
100
109
|
interface AdminConfig {
|
|
101
110
|
useAsTitle?: string;
|
|
102
111
|
defaultColumns?: string[];
|
|
@@ -115,6 +124,17 @@ interface AdminConfig {
|
|
|
115
124
|
};
|
|
116
125
|
layout?: "split" | "single";
|
|
117
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* Field overrides allow modifying specific field properties by path.
|
|
129
|
+
* Path uses dot notation: "fieldName" or "groupField.arrayField.targetField"
|
|
130
|
+
* Commonly used to extend relationship fields with additional collections.
|
|
131
|
+
*/
|
|
132
|
+
interface FieldOverrides {
|
|
133
|
+
[fieldPath: string]: {
|
|
134
|
+
relationTo?: string | string[];
|
|
135
|
+
[key: string]: any;
|
|
136
|
+
};
|
|
137
|
+
}
|
|
118
138
|
interface UploadConfig {
|
|
119
139
|
staticDir?: string;
|
|
120
140
|
staticURL?: string;
|
|
@@ -386,6 +406,8 @@ interface BaseAdapter {
|
|
|
386
406
|
connect(): Promise<void>;
|
|
387
407
|
disconnect(): Promise<void>;
|
|
388
408
|
transaction?<T>(fn: (tx: any) => Promise<T>): Promise<T>;
|
|
409
|
+
setTenantContext(context: TenantContext | undefined): void;
|
|
410
|
+
getTenantContext(): TenantContext | undefined;
|
|
389
411
|
}
|
|
390
412
|
interface AdapterConfig {
|
|
391
413
|
type: "drizzle" | "mongodb";
|
|
@@ -396,6 +418,7 @@ interface AdapterConfig {
|
|
|
396
418
|
interface PluginConfig {
|
|
397
419
|
name: string;
|
|
398
420
|
version?: string;
|
|
421
|
+
description?: string;
|
|
399
422
|
init?: (kyro: any) => void | Promise<void>;
|
|
400
423
|
extendCollection?: (slug: string, config: CollectionConfig) => CollectionConfig;
|
|
401
424
|
extendGlobal?: (slug: string, config: GlobalConfig) => GlobalConfig;
|
|
@@ -434,6 +457,9 @@ interface KyroConfig {
|
|
|
434
457
|
disable?: boolean;
|
|
435
458
|
indexRoute?: string;
|
|
436
459
|
components?: Record<string, any>;
|
|
460
|
+
collectionOverrides?: Record<string, Partial<AdminConfig> & {
|
|
461
|
+
fields?: FieldOverrides;
|
|
462
|
+
}>;
|
|
437
463
|
};
|
|
438
464
|
upload?: {
|
|
439
465
|
limits?: {
|
|
@@ -458,4 +484,4 @@ interface KyroConfig {
|
|
|
458
484
|
debug?: boolean;
|
|
459
485
|
}
|
|
460
486
|
|
|
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 };
|
|
487
|
+
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 TenantContext as T, 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 };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as Field } from './types-
|
|
1
|
+
import { F as Field } from './types-Z6FBiqa2.cjs';
|
|
2
2
|
|
|
3
3
|
interface Request {
|
|
4
4
|
body?: any;
|
|
@@ -97,6 +97,15 @@ declare function evaluateAccess(access: AccessControl, args: AccessArgs): Promis
|
|
|
97
97
|
declare function mergeWhereClauses(...whereClauses: (WhereClause | boolean | undefined)[]): WhereClause;
|
|
98
98
|
declare function getWhereClause(access: AccessControl, args: AccessArgs): Promise<WhereClause | undefined>;
|
|
99
99
|
|
|
100
|
+
interface TenantContext {
|
|
101
|
+
tenantId: string;
|
|
102
|
+
userId: string;
|
|
103
|
+
role?: string;
|
|
104
|
+
roles?: string[];
|
|
105
|
+
permissions?: string[];
|
|
106
|
+
isSuperAdmin?: boolean;
|
|
107
|
+
}
|
|
108
|
+
|
|
100
109
|
interface AdminConfig {
|
|
101
110
|
useAsTitle?: string;
|
|
102
111
|
defaultColumns?: string[];
|
|
@@ -115,6 +124,17 @@ interface AdminConfig {
|
|
|
115
124
|
};
|
|
116
125
|
layout?: "split" | "single";
|
|
117
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* Field overrides allow modifying specific field properties by path.
|
|
129
|
+
* Path uses dot notation: "fieldName" or "groupField.arrayField.targetField"
|
|
130
|
+
* Commonly used to extend relationship fields with additional collections.
|
|
131
|
+
*/
|
|
132
|
+
interface FieldOverrides {
|
|
133
|
+
[fieldPath: string]: {
|
|
134
|
+
relationTo?: string | string[];
|
|
135
|
+
[key: string]: any;
|
|
136
|
+
};
|
|
137
|
+
}
|
|
118
138
|
interface UploadConfig {
|
|
119
139
|
staticDir?: string;
|
|
120
140
|
staticURL?: string;
|
|
@@ -386,6 +406,8 @@ interface BaseAdapter {
|
|
|
386
406
|
connect(): Promise<void>;
|
|
387
407
|
disconnect(): Promise<void>;
|
|
388
408
|
transaction?<T>(fn: (tx: any) => Promise<T>): Promise<T>;
|
|
409
|
+
setTenantContext(context: TenantContext | undefined): void;
|
|
410
|
+
getTenantContext(): TenantContext | undefined;
|
|
389
411
|
}
|
|
390
412
|
interface AdapterConfig {
|
|
391
413
|
type: "drizzle" | "mongodb";
|
|
@@ -396,6 +418,7 @@ interface AdapterConfig {
|
|
|
396
418
|
interface PluginConfig {
|
|
397
419
|
name: string;
|
|
398
420
|
version?: string;
|
|
421
|
+
description?: string;
|
|
399
422
|
init?: (kyro: any) => void | Promise<void>;
|
|
400
423
|
extendCollection?: (slug: string, config: CollectionConfig) => CollectionConfig;
|
|
401
424
|
extendGlobal?: (slug: string, config: GlobalConfig) => GlobalConfig;
|
|
@@ -434,6 +457,9 @@ interface KyroConfig {
|
|
|
434
457
|
disable?: boolean;
|
|
435
458
|
indexRoute?: string;
|
|
436
459
|
components?: Record<string, any>;
|
|
460
|
+
collectionOverrides?: Record<string, Partial<AdminConfig> & {
|
|
461
|
+
fields?: FieldOverrides;
|
|
462
|
+
}>;
|
|
437
463
|
};
|
|
438
464
|
upload?: {
|
|
439
465
|
limits?: {
|
|
@@ -458,4 +484,4 @@ interface KyroConfig {
|
|
|
458
484
|
debug?: boolean;
|
|
459
485
|
}
|
|
460
486
|
|
|
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 };
|
|
487
|
+
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 TenantContext as T, 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 };
|
|
@@ -1,15 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Serializable condition for conditional field visibility.
|
|
3
|
+
* Unlike function conditions, these survive JSON serialization
|
|
4
|
+
* and can be used in admin configs that are built at compile time.
|
|
5
|
+
*/
|
|
6
|
+
interface DeclarativeCondition {
|
|
7
|
+
/** The field name to evaluate (resolved from root form data) */
|
|
8
|
+
field: string;
|
|
9
|
+
/** Show the field when the target field equals this value */
|
|
10
|
+
equals?: string | number | boolean;
|
|
11
|
+
/** Show the field when the target field does NOT equal this value */
|
|
12
|
+
notEquals?: string | number | boolean;
|
|
13
|
+
/** Show the field when the target field's value is one of these */
|
|
14
|
+
in?: (string | number | boolean)[];
|
|
15
|
+
}
|
|
1
16
|
interface FieldAdmin {
|
|
2
17
|
description?: string;
|
|
3
18
|
placeholder?: string;
|
|
4
|
-
readOnly?: boolean;
|
|
5
|
-
hidden?: boolean;
|
|
19
|
+
readOnly?: boolean | ((data: Record<string, any>, siblingData: Record<string, any>) => boolean);
|
|
20
|
+
hidden?: boolean | ((data: Record<string, any>, siblingData: Record<string, any>) => boolean);
|
|
6
21
|
width?: string;
|
|
7
22
|
position?: "sidebar" | "main";
|
|
8
23
|
autoGenerate?: string;
|
|
9
24
|
action?: string;
|
|
10
25
|
method?: string;
|
|
11
26
|
inline?: boolean;
|
|
12
|
-
condition?: (data: Record<string, any>, siblingData: Record<string, any>) => boolean;
|
|
27
|
+
condition?: ((data: Record<string, any>, siblingData: Record<string, any>) => boolean) | DeclarativeCondition;
|
|
13
28
|
}
|
|
14
29
|
interface BaseField {
|
|
15
30
|
name: string;
|
|
@@ -77,10 +92,11 @@ interface TextareaField extends BaseField {
|
|
|
77
92
|
}
|
|
78
93
|
interface SelectField extends BaseField {
|
|
79
94
|
type: "select";
|
|
80
|
-
options
|
|
95
|
+
options?: Array<{
|
|
81
96
|
label: string;
|
|
82
97
|
value: string;
|
|
83
98
|
}>;
|
|
99
|
+
dynamicOptions?: string;
|
|
84
100
|
hasMany?: boolean;
|
|
85
101
|
defaultValue?: string | string[];
|
|
86
102
|
}
|
|
@@ -104,16 +120,10 @@ interface ImageField extends BaseField {
|
|
|
104
120
|
allowedTypes?: string[];
|
|
105
121
|
maxSize?: number;
|
|
106
122
|
}
|
|
107
|
-
|
|
108
|
-
type: string;
|
|
109
|
-
data: Record<string, any>;
|
|
110
|
-
children?: RichTextBlock[];
|
|
111
|
-
}
|
|
123
|
+
type RichTextBlock = Record<string, any>;
|
|
112
124
|
interface RichTextField extends BaseField {
|
|
113
125
|
type: "richtext";
|
|
114
|
-
|
|
115
|
-
hasBlocks?: boolean;
|
|
116
|
-
defaultValue?: RichTextBlock[];
|
|
126
|
+
defaultValue?: Record<string, any>;
|
|
117
127
|
localized?: boolean;
|
|
118
128
|
}
|
|
119
129
|
interface JSONField extends BaseField {
|
|
@@ -174,6 +184,7 @@ interface BlockImage {
|
|
|
174
184
|
}
|
|
175
185
|
interface BlockAdmin {
|
|
176
186
|
group?: string;
|
|
187
|
+
description?: string;
|
|
177
188
|
images?: {
|
|
178
189
|
icon?: BlockImage | string;
|
|
179
190
|
thumbnail?: BlockImage | string;
|
|
@@ -223,7 +234,17 @@ interface ButtonField extends BaseField {
|
|
|
223
234
|
method?: string;
|
|
224
235
|
inline?: boolean;
|
|
225
236
|
}
|
|
226
|
-
|
|
237
|
+
interface ActionField extends BaseField {
|
|
238
|
+
type: "action";
|
|
239
|
+
label: string;
|
|
240
|
+
action?: string;
|
|
241
|
+
method?: string;
|
|
242
|
+
inline?: boolean;
|
|
243
|
+
}
|
|
244
|
+
interface SecretField extends BaseField {
|
|
245
|
+
type: "secret";
|
|
246
|
+
}
|
|
247
|
+
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 | ActionField | SecretField;
|
|
227
248
|
type FieldType = Field["type"];
|
|
228
249
|
declare function isTextField(field: Field): field is TextField;
|
|
229
250
|
declare function isNumberField(field: Field): field is NumberField;
|
|
@@ -243,4 +264,4 @@ declare const LAYOUT_FIELD_TYPES: readonly ["row", "collapsible", "tabs"];
|
|
|
243
264
|
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
265
|
declare function createRelationshipFieldConfig(name: string, relationTo: string | string[], options?: Partial<Omit<RelationshipField, "type" | "name" | "relationTo">>): RelationshipField;
|
|
245
266
|
|
|
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,
|
|
267
|
+
export { type ListField as $, 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, isNumberField as H, type ImageField as I, type JSONField as J, isRelationshipField as K, LAYOUT_FIELD_TYPES as L, type MarkdownField as M, type NumberField as N, isRichTextField as O, type PasswordField as P, isSelectField as Q, type RadioField as R, type SecretField as S, type TabsField as T, type UploadField as U, type ValidateOptions as V, isTextField as W, isUploadField as X, type ActionField as Y, type ButtonField as Z, type Hook as _, type Block as a, type TextFieldVariant as a0, createRelationshipFieldConfig as a1, 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 DeclarativeCondition as h, type FieldAdmin as i, type FieldType as j, type RelationshipField as k, type RichTextBlock as l, type RichTextField as m, type RowField as n, type SelectField as o, type TextField as p, type TextareaField as q, ALL_FIELD_TYPES as r, COMPLEX_FIELD_TYPES as s, PRIMITIVE_FIELD_TYPES as t, RELATIONAL_FIELD_TYPES as u, isArrayField as v, isBlocksField as w, isGroupField as x, isImageField as y, isLayoutField as z };
|
|
@@ -1,15 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Serializable condition for conditional field visibility.
|
|
3
|
+
* Unlike function conditions, these survive JSON serialization
|
|
4
|
+
* and can be used in admin configs that are built at compile time.
|
|
5
|
+
*/
|
|
6
|
+
interface DeclarativeCondition {
|
|
7
|
+
/** The field name to evaluate (resolved from root form data) */
|
|
8
|
+
field: string;
|
|
9
|
+
/** Show the field when the target field equals this value */
|
|
10
|
+
equals?: string | number | boolean;
|
|
11
|
+
/** Show the field when the target field does NOT equal this value */
|
|
12
|
+
notEquals?: string | number | boolean;
|
|
13
|
+
/** Show the field when the target field's value is one of these */
|
|
14
|
+
in?: (string | number | boolean)[];
|
|
15
|
+
}
|
|
1
16
|
interface FieldAdmin {
|
|
2
17
|
description?: string;
|
|
3
18
|
placeholder?: string;
|
|
4
|
-
readOnly?: boolean;
|
|
5
|
-
hidden?: boolean;
|
|
19
|
+
readOnly?: boolean | ((data: Record<string, any>, siblingData: Record<string, any>) => boolean);
|
|
20
|
+
hidden?: boolean | ((data: Record<string, any>, siblingData: Record<string, any>) => boolean);
|
|
6
21
|
width?: string;
|
|
7
22
|
position?: "sidebar" | "main";
|
|
8
23
|
autoGenerate?: string;
|
|
9
24
|
action?: string;
|
|
10
25
|
method?: string;
|
|
11
26
|
inline?: boolean;
|
|
12
|
-
condition?: (data: Record<string, any>, siblingData: Record<string, any>) => boolean;
|
|
27
|
+
condition?: ((data: Record<string, any>, siblingData: Record<string, any>) => boolean) | DeclarativeCondition;
|
|
13
28
|
}
|
|
14
29
|
interface BaseField {
|
|
15
30
|
name: string;
|
|
@@ -77,10 +92,11 @@ interface TextareaField extends BaseField {
|
|
|
77
92
|
}
|
|
78
93
|
interface SelectField extends BaseField {
|
|
79
94
|
type: "select";
|
|
80
|
-
options
|
|
95
|
+
options?: Array<{
|
|
81
96
|
label: string;
|
|
82
97
|
value: string;
|
|
83
98
|
}>;
|
|
99
|
+
dynamicOptions?: string;
|
|
84
100
|
hasMany?: boolean;
|
|
85
101
|
defaultValue?: string | string[];
|
|
86
102
|
}
|
|
@@ -104,16 +120,10 @@ interface ImageField extends BaseField {
|
|
|
104
120
|
allowedTypes?: string[];
|
|
105
121
|
maxSize?: number;
|
|
106
122
|
}
|
|
107
|
-
|
|
108
|
-
type: string;
|
|
109
|
-
data: Record<string, any>;
|
|
110
|
-
children?: RichTextBlock[];
|
|
111
|
-
}
|
|
123
|
+
type RichTextBlock = Record<string, any>;
|
|
112
124
|
interface RichTextField extends BaseField {
|
|
113
125
|
type: "richtext";
|
|
114
|
-
|
|
115
|
-
hasBlocks?: boolean;
|
|
116
|
-
defaultValue?: RichTextBlock[];
|
|
126
|
+
defaultValue?: Record<string, any>;
|
|
117
127
|
localized?: boolean;
|
|
118
128
|
}
|
|
119
129
|
interface JSONField extends BaseField {
|
|
@@ -174,6 +184,7 @@ interface BlockImage {
|
|
|
174
184
|
}
|
|
175
185
|
interface BlockAdmin {
|
|
176
186
|
group?: string;
|
|
187
|
+
description?: string;
|
|
177
188
|
images?: {
|
|
178
189
|
icon?: BlockImage | string;
|
|
179
190
|
thumbnail?: BlockImage | string;
|
|
@@ -223,7 +234,17 @@ interface ButtonField extends BaseField {
|
|
|
223
234
|
method?: string;
|
|
224
235
|
inline?: boolean;
|
|
225
236
|
}
|
|
226
|
-
|
|
237
|
+
interface ActionField extends BaseField {
|
|
238
|
+
type: "action";
|
|
239
|
+
label: string;
|
|
240
|
+
action?: string;
|
|
241
|
+
method?: string;
|
|
242
|
+
inline?: boolean;
|
|
243
|
+
}
|
|
244
|
+
interface SecretField extends BaseField {
|
|
245
|
+
type: "secret";
|
|
246
|
+
}
|
|
247
|
+
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 | ActionField | SecretField;
|
|
227
248
|
type FieldType = Field["type"];
|
|
228
249
|
declare function isTextField(field: Field): field is TextField;
|
|
229
250
|
declare function isNumberField(field: Field): field is NumberField;
|
|
@@ -243,4 +264,4 @@ declare const LAYOUT_FIELD_TYPES: readonly ["row", "collapsible", "tabs"];
|
|
|
243
264
|
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
265
|
declare function createRelationshipFieldConfig(name: string, relationTo: string | string[], options?: Partial<Omit<RelationshipField, "type" | "name" | "relationTo">>): RelationshipField;
|
|
245
266
|
|
|
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,
|
|
267
|
+
export { type ListField as $, 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, isNumberField as H, type ImageField as I, type JSONField as J, isRelationshipField as K, LAYOUT_FIELD_TYPES as L, type MarkdownField as M, type NumberField as N, isRichTextField as O, type PasswordField as P, isSelectField as Q, type RadioField as R, type SecretField as S, type TabsField as T, type UploadField as U, type ValidateOptions as V, isTextField as W, isUploadField as X, type ActionField as Y, type ButtonField as Z, type Hook as _, type Block as a, type TextFieldVariant as a0, createRelationshipFieldConfig as a1, 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 DeclarativeCondition as h, type FieldAdmin as i, type FieldType as j, type RelationshipField as k, type RichTextBlock as l, type RichTextField as m, type RowField as n, type SelectField as o, type TextField as p, type TextareaField as q, ALL_FIELD_TYPES as r, COMPLEX_FIELD_TYPES as s, PRIMITIVE_FIELD_TYPES as t, RELATIONAL_FIELD_TYPES as u, isArrayField as v, isBlocksField as w, isGroupField as x, isImageField as y, isLayoutField as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kyro-cms/core",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "Astro-native headless CMS with multi-database adapters, multi-protocol APIs, and multi-vendor support",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=22"
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
],
|
|
124
124
|
"scripts": {
|
|
125
125
|
"build": "tsup",
|
|
126
|
-
"dev": "tsup --watch",
|
|
126
|
+
"dev": "NODE_NO_WARNINGS=1 tsup --watch",
|
|
127
127
|
"test": "vitest",
|
|
128
128
|
"test:run": "vitest run",
|
|
129
129
|
"test:smoke": "vitest run test/smoke.test.ts",
|
|
@@ -168,6 +168,18 @@
|
|
|
168
168
|
"@aws-sdk/client-s3": "^3.751.0",
|
|
169
169
|
"@aws-sdk/s3-request-presigner": "^3.751.0",
|
|
170
170
|
"@smithy/node-http-handler": "^4.7.0",
|
|
171
|
+
"@tiptap/core": "^3.23.6",
|
|
172
|
+
"@tiptap/extension-color": "^3.23.6",
|
|
173
|
+
"@tiptap/extension-highlight": "^3.23.6",
|
|
174
|
+
"@tiptap/extension-image": "^3.23.6",
|
|
175
|
+
"@tiptap/extension-link": "^3.23.6",
|
|
176
|
+
"@tiptap/extension-task-item": "^3.23.6",
|
|
177
|
+
"@tiptap/extension-task-list": "^3.23.6",
|
|
178
|
+
"@tiptap/extension-text-align": "^3.23.6",
|
|
179
|
+
"@tiptap/extension-text-style": "^3.23.6",
|
|
180
|
+
"@tiptap/extension-underline": "^3.23.6",
|
|
181
|
+
"@tiptap/html": "^3.23.6",
|
|
182
|
+
"@tiptap/starter-kit": "^3.23.6",
|
|
171
183
|
"@trpc/client": "^11.0.0",
|
|
172
184
|
"@trpc/react-query": "^11.0.0",
|
|
173
185
|
"@trpc/server": "^11.0.0",
|
|
@@ -194,7 +206,8 @@
|
|
|
194
206
|
"ssh2-sftp-client": "^12.1.1",
|
|
195
207
|
"unstorage": "^1.17.5",
|
|
196
208
|
"ws": "^8.18.0",
|
|
197
|
-
"zod": "^3.24.0"
|
|
209
|
+
"zod": "^3.24.0",
|
|
210
|
+
"zod-to-json-schema": "^3.25.2"
|
|
198
211
|
},
|
|
199
212
|
"devDependencies": {
|
|
200
213
|
"@types/better-sqlite3": "^7.6.13",
|
|
@@ -207,12 +220,17 @@
|
|
|
207
220
|
"drizzle-kit": "^0.31.10",
|
|
208
221
|
"eslint": "^9.20.0",
|
|
209
222
|
"prettier": "^3.5.0",
|
|
210
|
-
"tsup": "^8.
|
|
223
|
+
"tsup": "^8.5.1",
|
|
211
224
|
"typescript": "^5.7.3",
|
|
212
225
|
"typescript-eslint": "^8.59.1",
|
|
213
226
|
"vitest": "^3.0.0"
|
|
214
227
|
},
|
|
215
228
|
"optionalDependencies": {
|
|
216
229
|
"pg": ">=8.0.0"
|
|
230
|
+
},
|
|
231
|
+
"pnpm": {
|
|
232
|
+
"overrides": {
|
|
233
|
+
"use-sync-external-store": "1.5.0"
|
|
234
|
+
}
|
|
217
235
|
}
|
|
218
236
|
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkYVUJBEXE_cjs = require('./chunk-YVUJBEXE.cjs');
|
|
4
|
-
require('./chunk-IA6AU5PI.cjs');
|
|
5
|
-
require('./chunk-4PWRCMTQ.cjs');
|
|
6
|
-
require('./chunk-I7HHI6QV.cjs');
|
|
7
|
-
require('./chunk-G7VZBCD6.cjs');
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Object.defineProperty(exports, "autoBootstrap", {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
get: function () { return chunkYVUJBEXE_cjs.autoBootstrap; }
|
|
14
|
-
});
|
|
15
|
-
Object.defineProperty(exports, "bootstrapAdmin", {
|
|
16
|
-
enumerable: true,
|
|
17
|
-
get: function () { return chunkYVUJBEXE_cjs.bootstrapAdmin; }
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports, "bootstrapWithRetry", {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
get: function () { return chunkYVUJBEXE_cjs.bootstrapWithRetry; }
|
|
22
|
-
});
|
|
23
|
-
Object.defineProperty(exports, "checkBootstrapRequired", {
|
|
24
|
-
enumerable: true,
|
|
25
|
-
get: function () { return chunkYVUJBEXE_cjs.checkBootstrapRequired; }
|
|
26
|
-
});
|
|
27
|
-
Object.defineProperty(exports, "getBootstrapFromEnv", {
|
|
28
|
-
enumerable: true,
|
|
29
|
-
get: function () { return chunkYVUJBEXE_cjs.getBootstrapFromEnv; }
|
|
30
|
-
});
|
|
31
|
-
//# sourceMappingURL=bootstrap-AKAUP6F6.cjs.map
|
|
32
|
-
//# sourceMappingURL=bootstrap-AKAUP6F6.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { autoBootstrap, bootstrapAdmin, bootstrapWithRetry, checkBootstrapRequired, getBootstrapFromEnv } from './chunk-Y3QQN7PN.js';
|
|
2
|
-
import './chunk-57P6MJKC.js';
|
|
3
|
-
import './chunk-YT7HXXVN.js';
|
|
4
|
-
import './chunk-H727JIG7.js';
|
|
5
|
-
import './chunk-Z6ZWNWWR.js';
|
|
6
|
-
//# sourceMappingURL=bootstrap-JCML6NFO.js.map
|
|
7
|
-
//# sourceMappingURL=bootstrap-JCML6NFO.js.map
|