@kyro-cms/core 0.13.2 → 0.13.5
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-BOJMgjBm.d.cts → WebhookService-BJTCP3cU.d.cts} +1 -1
- package/dist/{WebhookService-BLi5Rz2m.d.ts → WebhookService-Bqr_66lK.d.ts} +1 -1
- package/dist/api-handler-graphql.cjs +1 -1
- package/dist/api-handler-graphql.js +1 -1
- package/dist/api-handler-trpc.cjs +1 -1
- package/dist/api-handler-trpc.js +1 -1
- package/dist/api-handler.cjs +1 -1
- package/dist/api-handler.js +1 -1
- package/dist/{base-OYfoYPYP.d.ts → base-A9AJPCG5.d.ts} +1 -0
- package/dist/{base-BCgFt3Yx.d.ts → base-C2DOe8wD.d.ts} +3 -2
- package/dist/{base-BaOJ5uWd.d.cts → base-C6wyX2nC.d.cts} +1 -0
- package/dist/{base-B-i-tjm1.d.ts → base-DIpT2Vuz.d.cts} +3 -2
- package/dist/{bootstrap-QQ6D3OYG.js → bootstrap-PG2LGDLB.js} +1 -1
- package/dist/bootstrap-YD3GLTWX.cjs +1 -0
- package/dist/chunk-2SPWRQ5O.js +122 -0
- package/dist/chunk-2TYITUOC.js +122 -0
- package/dist/{chunk-GV2IB4WQ.cjs → chunk-3CIMGC2F.cjs} +3 -3
- package/dist/{chunk-S5HTTLN7.cjs → chunk-4NTIK6DF.cjs} +1 -1
- package/dist/chunk-6E44MQQ5.js +115 -0
- package/dist/{chunk-PTPVFLET.js → chunk-6LWF5MPL.js} +1 -1
- package/dist/chunk-6YS6XLOD.cjs +121 -0
- package/dist/{chunk-2OS5Y4LE.cjs → chunk-7KLEANTO.cjs} +1 -1
- package/dist/{chunk-3GXLOYM3.js → chunk-ALTU3FDG.js} +1 -1
- package/dist/{chunk-OPTVCCQQ.cjs → chunk-EQN3HDES.cjs} +7 -6
- package/dist/{chunk-3O3AVMWM.cjs → chunk-EW424IBO.cjs} +1 -1
- package/dist/{chunk-JZ7Z6WC2.cjs → chunk-GTR7JAKP.cjs} +2 -2
- package/dist/{chunk-M75VGFCI.js → chunk-HPIJI7TM.js} +1 -1
- package/dist/chunk-J6V573PE.cjs +1 -0
- package/dist/{chunk-3LAWUINR.cjs → chunk-LKRI5X2V.cjs} +1 -1
- package/dist/{chunk-6MNLRAKM.cjs → chunk-NRE6VKL6.cjs} +12 -12
- package/dist/{chunk-MYHNTJLR.cjs → chunk-OOVNTOZC.cjs} +6 -6
- package/dist/{chunk-SMQ6736Y.js → chunk-PYUWSKKP.js} +1 -1
- package/dist/{chunk-XBQ6HV3T.cjs → chunk-QYN6C3FZ.cjs} +4 -4
- package/dist/{chunk-ATI2UZ7U.js → chunk-RYXLEFS5.js} +1 -1
- package/dist/{chunk-E4H3ZZ7U.js → chunk-SRIXRJHL.js} +1 -1
- package/dist/chunk-V4FAL7AG.js +2 -0
- package/dist/{chunk-6DD4J7LI.js → chunk-WAVGRSE6.js} +1 -1
- package/dist/{chunk-N6MNQIQU.js → chunk-WNU76M2C.js} +7 -6
- package/dist/chunk-XDQVYCIR.cjs +1 -0
- package/dist/{chunk-K5XGP57D.cjs → chunk-XOR64WUQ.cjs} +1 -1
- package/dist/chunk-YGI5W4RS.js +2 -0
- package/dist/{chunk-I6UJVO2P.js → chunk-YIFKTA5N.js} +6 -6
- package/dist/cli/index.cjs +86 -86
- package/dist/cli/index.js +87 -87
- package/dist/client.d.cts +26 -0
- package/dist/client.d.ts +26 -0
- package/dist/drizzle/index.cjs +1 -1
- package/dist/drizzle/index.d.cts +3 -3
- package/dist/drizzle/index.d.ts +3 -3
- package/dist/drizzle/index.js +1 -1
- package/dist/fields/index.d.cts +2 -2
- package/dist/fields/index.d.ts +2 -2
- package/dist/graphql/index.d.cts +3 -3
- package/dist/graphql/index.d.ts +3 -3
- package/dist/{index-BttsFZDa.d.ts → index-C9uBoJtm.d.ts} +2 -2
- package/dist/{index-8Ino7vKq.d.ts → index-Ci7aUrmN.d.cts} +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.d.cts +13 -10
- package/dist/index.d.ts +13 -10
- package/dist/index.js +4 -4
- package/dist/{local-DPLKZQA3.js → local-6UUGBZ4M.js} +1 -1
- package/dist/{local-KR3AIGVA.cjs → local-ZYHV3J2K.cjs} +1 -1
- package/dist/{mongo-auth-adapter-EUHAYWJ6.cjs → mongo-auth-adapter-2H2AXDRH.cjs} +1 -1
- package/dist/{mongo-auth-adapter-FW7ATYQ6.js → mongo-auth-adapter-YWMEOC42.js} +1 -1
- package/dist/mongodb/index.cjs +1 -1
- package/dist/mongodb/index.d.cts +3 -3
- package/dist/mongodb/index.d.ts +3 -3
- package/dist/mongodb/index.js +1 -1
- package/dist/{postgres-auth-adapter-SK3N3OSS.js → postgres-auth-adapter-QKBNXVPT.js} +1 -1
- package/dist/{postgres-auth-adapter-ZO6HK5AK.cjs → postgres-auth-adapter-WMLM4UUC.cjs} +1 -1
- package/dist/{redis-adapter-EGMUN65D.cjs → redis-adapter-EVK2SMKH.cjs} +1 -1
- package/dist/{redis-adapter-QPCTMF55.js → redis-adapter-LY2NBSAG.js} +1 -1
- package/dist/rest/index.cjs +1 -1
- package/dist/rest/index.d.cts +4 -4
- package/dist/rest/index.d.ts +4 -4
- package/dist/rest/index.js +1 -1
- package/dist/{sqlite-adapter-MNNZZXGX.cjs → sqlite-adapter-KPSISY6E.cjs} +1 -1
- package/dist/{sqlite-adapter-52PL52VU.js → sqlite-adapter-PI6SIY7O.js} +1 -1
- package/dist/templates/index.cjs +1 -1
- package/dist/templates/index.d.cts +2 -2
- package/dist/templates/index.d.ts +2 -2
- package/dist/templates/index.js +1 -1
- package/dist/trpc/index.d.cts +3 -3
- package/dist/trpc/index.d.ts +3 -3
- package/dist/{types-Bii0bhUV.d.ts → types-C3QFX0l6.d.cts} +5 -0
- package/dist/{types-B9oXBEKI.d.cts → types-C3QFX0l6.d.ts} +5 -1
- package/dist/{types-Cdssrcbz.d.cts → types-CKWnrUAh.d.ts} +23 -2
- package/dist/{types-BRDBNacn.d.ts → types-CdwfDpyW.d.cts} +23 -2
- package/package.json +2 -2
- package/dist/WebhookService-BcuD8tnn.d.cts +0 -143
- package/dist/WebhookService-CFe6Zd0_.d.cts +0 -143
- package/dist/WebhookService-CVXmjbtQ.d.cts +0 -143
- package/dist/WebhookService-D5PSI5t6.d.cts +0 -143
- package/dist/WebhookService-DPCCn_12.d.ts +0 -143
- package/dist/WebhookService-Dk1lzSrG.d.cts +0 -143
- package/dist/WebhookService-Dncnbgm9.d.cts +0 -143
- package/dist/WebhookService-I6hdue2Y.d.ts +0 -143
- package/dist/WebhookService-KnQ2UDlW.d.ts +0 -143
- package/dist/WebhookService-UY5p89Bj.d.ts +0 -143
- package/dist/WebhookService-YZXBCRXA.d.ts +0 -143
- package/dist/WebhookService-fk0FGRlk.d.ts +0 -143
- package/dist/WebhookService-vsFnWrOh.d.ts +0 -143
- package/dist/WebhookService-zrDmAx7L.d.cts +0 -143
- package/dist/base-B--L0lCn.d.cts +0 -218
- package/dist/base-B-siit_y.d.cts +0 -218
- package/dist/base-B8SyZI4D.d.ts +0 -218
- package/dist/base-BHRGJ40F.d.cts +0 -218
- package/dist/base-BVoDPNjJ.d.cts +0 -218
- package/dist/base-BfPaVEAE.d.cts +0 -218
- package/dist/base-BxrX5EPU.d.cts +0 -218
- package/dist/base-CAb9EYQs.d.ts +0 -218
- package/dist/base-CcZIEll-.d.ts +0 -218
- package/dist/base-CyG7aF1e.d.cts +0 -218
- package/dist/base-DOImeJ-F.d.ts +0 -218
- package/dist/base-DbnwE42-.d.cts +0 -218
- package/dist/base-NyiSsD-n.d.ts +0 -218
- package/dist/base-xflndGDO.d.ts +0 -218
- package/dist/bootstrap-E24SGUJP.cjs +0 -1
- package/dist/bootstrap-QVKSKXJF.cjs +0 -1
- package/dist/bootstrap-RILR44UM.cjs +0 -1
- package/dist/bootstrap-YFVE7MRG.js +0 -1
- package/dist/bootstrap-ZRRUPRUR.js +0 -1
- package/dist/chunk-2FSOHXOU.cjs +0 -56
- package/dist/chunk-2PXXQKN3.cjs +0 -3
- package/dist/chunk-355R4LS5.cjs +0 -56
- package/dist/chunk-35IVNLMA.js +0 -122
- package/dist/chunk-3U6MKWET.cjs +0 -120
- package/dist/chunk-4YCI3HBD.js +0 -3
- package/dist/chunk-4ZWLNGLS.js +0 -2
- package/dist/chunk-5A7E7N4B.cjs +0 -431
- package/dist/chunk-5ZEYOFAK.js +0 -2
- package/dist/chunk-6GGPY7U2.js +0 -4
- package/dist/chunk-73Y63IPP.js +0 -57
- package/dist/chunk-7DUKWHRN.cjs +0 -1
- package/dist/chunk-7K6ZUNJM.js +0 -4
- package/dist/chunk-7LLCXY5O.cjs +0 -19
- package/dist/chunk-A35ZP72D.cjs +0 -132
- package/dist/chunk-A3IOQOV6.js +0 -2
- package/dist/chunk-A3XVL6ED.cjs +0 -3
- package/dist/chunk-APDQ6ZTG.cjs +0 -120
- package/dist/chunk-AWQGDMOE.js +0 -3
- package/dist/chunk-B3BSVEFC.cjs +0 -3
- package/dist/chunk-B4AC23SG.js +0 -122
- package/dist/chunk-BD6XHMMM.cjs +0 -2
- package/dist/chunk-CHYVUWZ3.js +0 -2
- package/dist/chunk-CIVA6SKW.js +0 -2
- package/dist/chunk-CNHUCCQJ.js +0 -121
- package/dist/chunk-CRP6PSCE.js +0 -2
- package/dist/chunk-DI6TCZSE.js +0 -122
- package/dist/chunk-DORUYZQV.cjs +0 -1
- package/dist/chunk-EFKEVWAD.js +0 -4
- package/dist/chunk-EI7FRSNY.js +0 -57
- package/dist/chunk-EON4XLKQ.cjs +0 -1
- package/dist/chunk-EUQAOYEO.cjs +0 -121
- package/dist/chunk-EVAUBT7H.js +0 -57
- package/dist/chunk-EYHD7HZE.cjs +0 -1
- package/dist/chunk-EYYIPA5N.js +0 -432
- package/dist/chunk-FBWLSWZ4.js +0 -122
- package/dist/chunk-FDKU7HJX.js +0 -2
- package/dist/chunk-FG3IFGJP.cjs +0 -1
- package/dist/chunk-FGN6IMPY.cjs +0 -3
- package/dist/chunk-FLS2FJM6.cjs +0 -431
- package/dist/chunk-FP5UK272.cjs +0 -1
- package/dist/chunk-FSL3NLRT.cjs +0 -2
- package/dist/chunk-FUFS65Q5.js +0 -133
- package/dist/chunk-GWIZT2P5.js +0 -57
- package/dist/chunk-H3FJ54KB.cjs +0 -121
- package/dist/chunk-HY3EAWB2.js +0 -4
- package/dist/chunk-IQSF6XRV.js +0 -57
- package/dist/chunk-IXGDTAES.js +0 -4
- package/dist/chunk-JCEJ4VTN.js +0 -20
- package/dist/chunk-LPFRMQFQ.js +0 -121
- package/dist/chunk-LYU44UNN.cjs +0 -56
- package/dist/chunk-MFNN5DYG.cjs +0 -1
- package/dist/chunk-MJAODEFC.cjs +0 -121
- package/dist/chunk-MSC4G2HF.cjs +0 -2
- package/dist/chunk-N2YHO2WI.cjs +0 -3
- package/dist/chunk-NPBXLPOP.js +0 -3
- package/dist/chunk-ON5XJEPO.cjs +0 -3
- package/dist/chunk-OT2Z4XBD.cjs +0 -1
- package/dist/chunk-PFKVHUOT.js +0 -432
- package/dist/chunk-PFTBTWSC.cjs +0 -1
- package/dist/chunk-PZDLPRJF.js +0 -4
- package/dist/chunk-QC4YXUBT.cjs +0 -383
- package/dist/chunk-QUTYCUST.js +0 -4
- package/dist/chunk-REKKBAQX.cjs +0 -56
- package/dist/chunk-RTNQP6BV.js +0 -2
- package/dist/chunk-RUJW47ZJ.js +0 -2
- package/dist/chunk-RXYCFZJC.cjs +0 -121
- package/dist/chunk-S2MZNEBQ.cjs +0 -1
- package/dist/chunk-S73YERS2.js +0 -57
- package/dist/chunk-T3DJ3UTP.cjs +0 -121
- package/dist/chunk-TJZO7ZSX.cjs +0 -3
- package/dist/chunk-TKUNRCRH.js +0 -4
- package/dist/chunk-TQLCOMKC.js +0 -4
- package/dist/chunk-TRXYDWGE.cjs +0 -1
- package/dist/chunk-TS55CUNJ.js +0 -57
- package/dist/chunk-UFBJ3WOZ.js +0 -2
- package/dist/chunk-UQRVQUVR.js +0 -2
- package/dist/chunk-UW5W35NP.js +0 -122
- package/dist/chunk-VI7WCO2J.cjs +0 -3
- package/dist/chunk-VTOL3URF.js +0 -4
- package/dist/chunk-VVVCCB6R.js +0 -2
- package/dist/chunk-W2GPP6RB.js +0 -122
- package/dist/chunk-WHOA7YJU.cjs +0 -1
- package/dist/chunk-WNRUPL26.js +0 -2
- package/dist/chunk-XIAJQLGS.js +0 -2
- package/dist/chunk-XK6UB77Q.js +0 -4
- package/dist/chunk-Y2VHO66Q.cjs +0 -3
- package/dist/chunk-Y5O2OD7J.cjs +0 -3
- package/dist/chunk-YARB43JG.cjs +0 -56
- package/dist/chunk-YLCEMVYY.cjs +0 -56
- package/dist/chunk-YSOM57GK.cjs +0 -3
- package/dist/chunk-Z3UVDGYS.cjs +0 -56
- package/dist/chunk-ZO3YB5DK.cjs +0 -1
- package/dist/chunk-ZOVH6QT5.cjs +0 -1
- package/dist/chunk-ZRIBWDYJ.js +0 -384
- package/dist/chunk-ZWDBPEXL.js +0 -115
- package/dist/index-B9BFNOHd.d.cts +0 -105
- package/dist/index-BMcYFpTv.d.cts +0 -105
- package/dist/index-ByOM1Y5x.d.ts +0 -105
- package/dist/index-C6xmtRio.d.cts +0 -105
- package/dist/index-CTI3K_uq.d.cts +0 -105
- package/dist/index-CTL4zv_u.d.ts +0 -105
- package/dist/index-CaDbioSg.d.ts +0 -105
- package/dist/index-CxA9uOv0.d.ts +0 -105
- package/dist/index-D6AXbuPI.d.ts +0 -105
- package/dist/index-DF0KDBaM.d.cts +0 -105
- package/dist/index-DG4Xu7gA.d.cts +0 -105
- package/dist/index-DS3DpJli.d.cts +0 -105
- package/dist/index-eHex8Iwj.d.ts +0 -105
- package/dist/index-rm7uyOK1.d.cts +0 -105
- package/dist/lib-5QYYN6ML.cjs +0 -12
- package/dist/lib-XXYYUPMW.js +0 -13
- package/dist/local-S5VA7IXE.cjs +0 -1
- package/dist/local-T7GISZBL.js +0 -1
- package/dist/mongo-auth-adapter-GR2CFFEA.js +0 -1
- package/dist/mongo-auth-adapter-UOO2LZUJ.cjs +0 -1
- package/dist/nodemailer-transport-CHO2WKIY.js +0 -1
- package/dist/nodemailer-transport-ED2IXNGW.cjs +0 -1
- package/dist/types-6ShQp2EM.d.cts +0 -839
- package/dist/types-B5Qz1svz.d.cts +0 -822
- package/dist/types-B9oXBEKI.d.ts +0 -330
- package/dist/types-Bii0bhUV.d.cts +0 -329
- package/dist/types-Bt2_ycUO.d.ts +0 -811
- package/dist/types-C4wXHImf.d.ts +0 -822
- package/dist/types-C8yIAV6K.d.cts +0 -839
- package/dist/types-CORUQhY-.d.ts +0 -839
- package/dist/types-CjGqxBd3.d.cts +0 -330
- package/dist/types-CjGqxBd3.d.ts +0 -330
- package/dist/types-DBGR-eQl.d.cts +0 -839
- package/dist/types-DCWgPFmi.d.cts +0 -822
- package/dist/types-DROqAsr0.d.cts +0 -330
- package/dist/types-DROqAsr0.d.ts +0 -330
- package/dist/types-DlGSbh7I.d.cts +0 -297
- package/dist/types-DlGSbh7I.d.ts +0 -297
- package/dist/types-DsF64Wrc.d.cts +0 -811
- package/dist/types-IeKFn7Ky.d.ts +0 -839
- package/dist/types-ZrjEVWfi.d.ts +0 -811
- package/dist/types-dEy5JxvN.d.ts +0 -822
- package/dist/types-tVJc9YbX.d.cts +0 -811
- package/dist/types-zt5qIvje.d.ts +0 -839
|
@@ -1,839 +0,0 @@
|
|
|
1
|
-
import { F as Field } from './types-CjGqxBd3.cjs';
|
|
2
|
-
|
|
3
|
-
interface Request {
|
|
4
|
-
body?: any;
|
|
5
|
-
headers: Record<string, string>;
|
|
6
|
-
method?: string;
|
|
7
|
-
url?: string;
|
|
8
|
-
cookies?: Record<string, string>;
|
|
9
|
-
query?: Record<string, any>;
|
|
10
|
-
}
|
|
11
|
-
interface User {
|
|
12
|
-
id: string;
|
|
13
|
-
email: string;
|
|
14
|
-
role: string;
|
|
15
|
-
tenantId?: string;
|
|
16
|
-
[key: string]: any;
|
|
17
|
-
}
|
|
18
|
-
interface HookArgs<T = any> {
|
|
19
|
-
collection?: string;
|
|
20
|
-
global?: string;
|
|
21
|
-
data?: T;
|
|
22
|
-
originalDoc?: T;
|
|
23
|
-
doc?: T;
|
|
24
|
-
req: Request;
|
|
25
|
-
user?: User;
|
|
26
|
-
operation: 'create' | 'read' | 'update' | 'delete';
|
|
27
|
-
tenantId?: string;
|
|
28
|
-
field?: string;
|
|
29
|
-
siblingData?: Record<string, any>;
|
|
30
|
-
value?: any;
|
|
31
|
-
previousValue?: any;
|
|
32
|
-
context?: Record<string, any>;
|
|
33
|
-
}
|
|
34
|
-
type Hook<T = any> = (args: HookArgs<T>) => Promise<T | void> | T | void;
|
|
35
|
-
interface CollectionHooks {
|
|
36
|
-
beforeValidate?: Hook[];
|
|
37
|
-
beforeChange?: Hook[];
|
|
38
|
-
afterChange?: Hook[];
|
|
39
|
-
beforeRead?: Hook[];
|
|
40
|
-
afterRead?: Hook[];
|
|
41
|
-
beforeDelete?: Hook[];
|
|
42
|
-
afterDelete?: Hook[];
|
|
43
|
-
beforeLogin?: Hook[];
|
|
44
|
-
afterLogin?: Hook[];
|
|
45
|
-
afterLogout?: Hook[];
|
|
46
|
-
afterRefresh?: Hook[];
|
|
47
|
-
afterForgotPassword?: Hook[];
|
|
48
|
-
}
|
|
49
|
-
interface FieldHooks {
|
|
50
|
-
beforeValidate?: Hook[];
|
|
51
|
-
beforeChange?: Hook[];
|
|
52
|
-
afterChange?: Hook[];
|
|
53
|
-
afterRead?: Hook[];
|
|
54
|
-
}
|
|
55
|
-
interface GlobalHooks {
|
|
56
|
-
beforeValidate?: Hook[];
|
|
57
|
-
beforeChange?: Hook[];
|
|
58
|
-
afterChange?: Hook[];
|
|
59
|
-
beforeRead?: Hook[];
|
|
60
|
-
afterRead?: Hook[];
|
|
61
|
-
}
|
|
62
|
-
declare function runHooks(hooks: Hook[], args: HookArgs): Promise<any>;
|
|
63
|
-
declare function runFieldHooks(hooks: Hook[], args: HookArgs): Promise<any>;
|
|
64
|
-
|
|
65
|
-
interface PluginHooks {
|
|
66
|
-
beforeInit?: Hook[];
|
|
67
|
-
afterInit?: Hook[];
|
|
68
|
-
beforeRegisterCollections?: Hook[];
|
|
69
|
-
afterRegisterCollections?: Hook[];
|
|
70
|
-
beforeRegisterGlobals?: Hook[];
|
|
71
|
-
afterRegisterGlobals?: Hook[];
|
|
72
|
-
beforeServerStart?: Hook[];
|
|
73
|
-
afterServerStart?: Hook[];
|
|
74
|
-
beforeServerStop?: Hook[];
|
|
75
|
-
afterServerStop?: Hook[];
|
|
76
|
-
}
|
|
77
|
-
interface PluginCollectionExtension {
|
|
78
|
-
slug: string;
|
|
79
|
-
config: Partial<CollectionConfig>;
|
|
80
|
-
}
|
|
81
|
-
interface PluginGlobalExtension {
|
|
82
|
-
slug: string;
|
|
83
|
-
config: Partial<GlobalConfig>;
|
|
84
|
-
}
|
|
85
|
-
interface PluginFieldExtension {
|
|
86
|
-
collectionSlug: string;
|
|
87
|
-
field: Field;
|
|
88
|
-
}
|
|
89
|
-
interface PluginAPI {
|
|
90
|
-
registry: {
|
|
91
|
-
getCollection: (slug: string) => CollectionConfig | undefined;
|
|
92
|
-
getCollections: () => CollectionConfig[];
|
|
93
|
-
getGlobal: (slug: string) => GlobalConfig | undefined;
|
|
94
|
-
addCollection: (config: CollectionConfig) => void;
|
|
95
|
-
addGlobal: (config: GlobalConfig) => void;
|
|
96
|
-
extendCollection: (slug: string, extension: Partial<CollectionConfig>) => void;
|
|
97
|
-
extendGlobal: (slug: string, extension: Partial<GlobalConfig>) => void;
|
|
98
|
-
addField: (collectionSlug: string, field: Field, position?: number) => void;
|
|
99
|
-
};
|
|
100
|
-
hooks: {
|
|
101
|
-
register: (event: string, handler: Hook) => void;
|
|
102
|
-
unregister: (event: string, handler: Hook) => void;
|
|
103
|
-
};
|
|
104
|
-
config: {
|
|
105
|
-
get: (key: string) => any;
|
|
106
|
-
set: (key: string, value: any) => void;
|
|
107
|
-
};
|
|
108
|
-
db: any;
|
|
109
|
-
}
|
|
110
|
-
declare abstract class KyroPlugin {
|
|
111
|
-
name: string;
|
|
112
|
-
displayName?: string;
|
|
113
|
-
adminEntry?: string;
|
|
114
|
-
version?: string;
|
|
115
|
-
description?: string;
|
|
116
|
-
hooks: PluginHooks;
|
|
117
|
-
collections: Partial<CollectionConfig>[];
|
|
118
|
-
globals: Partial<GlobalConfig>[];
|
|
119
|
-
fields: PluginFieldExtension[];
|
|
120
|
-
extensions: {
|
|
121
|
-
collections: PluginCollectionExtension[];
|
|
122
|
-
globals: PluginGlobalExtension[];
|
|
123
|
-
};
|
|
124
|
-
adminComponents: Record<string, any>;
|
|
125
|
-
adminStyles: string[];
|
|
126
|
-
serverMiddleware?: (app: any) => void;
|
|
127
|
-
clientMiddleware?: (req: any) => any;
|
|
128
|
-
constructor(name: string);
|
|
129
|
-
init?(api: PluginAPI): Promise<void>;
|
|
130
|
-
beforeInit?(api: PluginAPI): Promise<void>;
|
|
131
|
-
afterInit?(api: PluginAPI): Promise<void>;
|
|
132
|
-
getCollections?(): Partial<CollectionConfig>[];
|
|
133
|
-
getGlobals?(): Partial<GlobalConfig>[];
|
|
134
|
-
getHooks?(): PluginHooks;
|
|
135
|
-
}
|
|
136
|
-
declare class PluginManager {
|
|
137
|
-
private plugins;
|
|
138
|
-
private hooks;
|
|
139
|
-
register(plugin: KyroPlugin): void;
|
|
140
|
-
unregister(name: string): void;
|
|
141
|
-
get(name: string): KyroPlugin | undefined;
|
|
142
|
-
getAll(): KyroPlugin[];
|
|
143
|
-
has(name: string): boolean;
|
|
144
|
-
registerHook(event: string, handler: Hook): void;
|
|
145
|
-
unregisterHook(event: string, handler: Hook): void;
|
|
146
|
-
executeHook(event: string, args?: any): Promise<any>;
|
|
147
|
-
getAllCollections(): Partial<CollectionConfig>[];
|
|
148
|
-
getAllGlobals(): Partial<GlobalConfig>[];
|
|
149
|
-
getAllFields(): PluginFieldExtension[];
|
|
150
|
-
getAdminComponents(): Record<string, any>;
|
|
151
|
-
getAdminStyles(): string[];
|
|
152
|
-
}
|
|
153
|
-
declare class SEOPlugin extends KyroPlugin {
|
|
154
|
-
constructor();
|
|
155
|
-
}
|
|
156
|
-
declare class AnalyticsPlugin extends KyroPlugin {
|
|
157
|
-
constructor();
|
|
158
|
-
}
|
|
159
|
-
declare class CommentsPlugin extends KyroPlugin {
|
|
160
|
-
constructor();
|
|
161
|
-
}
|
|
162
|
-
declare class ReviewsPlugin extends KyroPlugin {
|
|
163
|
-
constructor();
|
|
164
|
-
}
|
|
165
|
-
declare class WishlistPlugin extends KyroPlugin {
|
|
166
|
-
constructor();
|
|
167
|
-
}
|
|
168
|
-
declare const presetPlugins: {
|
|
169
|
-
SEO: typeof SEOPlugin;
|
|
170
|
-
Analytics: typeof AnalyticsPlugin;
|
|
171
|
-
Comments: typeof CommentsPlugin;
|
|
172
|
-
Reviews: typeof ReviewsPlugin;
|
|
173
|
-
Wishlist: typeof WishlistPlugin;
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
interface WhereClause {
|
|
177
|
-
[field: string]: any;
|
|
178
|
-
}
|
|
179
|
-
interface AccessArgs {
|
|
180
|
-
req: Request;
|
|
181
|
-
user?: User;
|
|
182
|
-
data?: unknown;
|
|
183
|
-
doc?: unknown;
|
|
184
|
-
id?: string;
|
|
185
|
-
tenantId?: string;
|
|
186
|
-
context?: Record<string, unknown>;
|
|
187
|
-
}
|
|
188
|
-
type AccessControl = boolean | ((args: AccessArgs) => Promise<boolean | WhereClause> | boolean | WhereClause);
|
|
189
|
-
interface CollectionAccess {
|
|
190
|
-
create?: AccessControl;
|
|
191
|
-
read?: AccessControl;
|
|
192
|
-
update?: AccessControl;
|
|
193
|
-
delete?: AccessControl;
|
|
194
|
-
admin?: AccessControl;
|
|
195
|
-
unlock?: AccessControl;
|
|
196
|
-
readVersions?: AccessControl;
|
|
197
|
-
}
|
|
198
|
-
interface GlobalAccess {
|
|
199
|
-
read?: AccessControl;
|
|
200
|
-
update?: AccessControl;
|
|
201
|
-
}
|
|
202
|
-
interface FieldAccess {
|
|
203
|
-
create?: AccessControl;
|
|
204
|
-
read?: AccessControl;
|
|
205
|
-
update?: AccessControl;
|
|
206
|
-
}
|
|
207
|
-
declare function evaluateAccess(access: AccessControl, args: AccessArgs): Promise<boolean | WhereClause>;
|
|
208
|
-
declare function mergeWhereClauses(...whereClauses: (WhereClause | boolean | undefined)[]): WhereClause;
|
|
209
|
-
declare function getWhereClause(access: AccessControl, args: AccessArgs): Promise<WhereClause | undefined>;
|
|
210
|
-
|
|
211
|
-
interface TenantContext {
|
|
212
|
-
tenantId: string;
|
|
213
|
-
userId: string;
|
|
214
|
-
role?: string;
|
|
215
|
-
roles?: string[];
|
|
216
|
-
permissions?: string[];
|
|
217
|
-
isSuperAdmin?: boolean;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
interface S3CompatibleConfig {
|
|
221
|
-
bucket?: string;
|
|
222
|
-
region?: string;
|
|
223
|
-
accessKeyId?: string;
|
|
224
|
-
secretAccessKey?: string;
|
|
225
|
-
endpoint?: string;
|
|
226
|
-
cdnUrl?: string;
|
|
227
|
-
prefix?: string;
|
|
228
|
-
}
|
|
229
|
-
interface R2Config {
|
|
230
|
-
accountId?: string;
|
|
231
|
-
accessKeyId?: string;
|
|
232
|
-
secretAccessKey?: string;
|
|
233
|
-
bucket?: string;
|
|
234
|
-
cdnUrl?: string;
|
|
235
|
-
prefix?: string;
|
|
236
|
-
publicDevUrl?: string;
|
|
237
|
-
}
|
|
238
|
-
interface GCSConfig {
|
|
239
|
-
bucket?: string;
|
|
240
|
-
projectId?: string;
|
|
241
|
-
clientEmail?: string;
|
|
242
|
-
privateKey?: string;
|
|
243
|
-
cdnUrl?: string;
|
|
244
|
-
prefix?: string;
|
|
245
|
-
}
|
|
246
|
-
interface BackblazeConfig {
|
|
247
|
-
bucket?: string;
|
|
248
|
-
accountId?: string;
|
|
249
|
-
applicationKeyId?: string;
|
|
250
|
-
applicationKey?: string;
|
|
251
|
-
cdnUrl?: string;
|
|
252
|
-
prefix?: string;
|
|
253
|
-
}
|
|
254
|
-
interface BunnyConfig {
|
|
255
|
-
storageZone?: string;
|
|
256
|
-
apiKey?: string;
|
|
257
|
-
cdnUrl?: string;
|
|
258
|
-
prefix?: string;
|
|
259
|
-
}
|
|
260
|
-
interface FTPConfig {
|
|
261
|
-
host?: string;
|
|
262
|
-
port?: number;
|
|
263
|
-
user?: string;
|
|
264
|
-
password?: string;
|
|
265
|
-
secure?: boolean;
|
|
266
|
-
baseUrl?: string;
|
|
267
|
-
prefix?: string;
|
|
268
|
-
}
|
|
269
|
-
interface StorageConfig {
|
|
270
|
-
type: string;
|
|
271
|
-
s3: S3CompatibleConfig;
|
|
272
|
-
r2: R2Config;
|
|
273
|
-
gcs: GCSConfig;
|
|
274
|
-
digitalocean: S3CompatibleConfig;
|
|
275
|
-
backblaze: BackblazeConfig;
|
|
276
|
-
wasabi: S3CompatibleConfig;
|
|
277
|
-
bunny: BunnyConfig;
|
|
278
|
-
ftp: FTPConfig;
|
|
279
|
-
cloudinary: {
|
|
280
|
-
cloudName?: string;
|
|
281
|
-
apiKey?: string;
|
|
282
|
-
apiSecret?: string;
|
|
283
|
-
folder?: string;
|
|
284
|
-
};
|
|
285
|
-
imgix: {
|
|
286
|
-
domain?: string;
|
|
287
|
-
signKey?: string;
|
|
288
|
-
};
|
|
289
|
-
local: {
|
|
290
|
-
uploadDir?: string;
|
|
291
|
-
baseUrl?: string;
|
|
292
|
-
};
|
|
293
|
-
}
|
|
294
|
-
interface EmailConfig {
|
|
295
|
-
provider?: string;
|
|
296
|
-
host?: string;
|
|
297
|
-
port?: number;
|
|
298
|
-
secure?: boolean;
|
|
299
|
-
user?: string;
|
|
300
|
-
pass?: string;
|
|
301
|
-
from?: string;
|
|
302
|
-
fromName?: string;
|
|
303
|
-
replyTo?: string;
|
|
304
|
-
}
|
|
305
|
-
declare class ConfigService {
|
|
306
|
-
private db;
|
|
307
|
-
private cache;
|
|
308
|
-
private loaded;
|
|
309
|
-
private static readonly SENSITIVE_KEYS;
|
|
310
|
-
constructor(db: any);
|
|
311
|
-
/**
|
|
312
|
-
* Initialize the service by loading all settings from the database
|
|
313
|
-
*/
|
|
314
|
-
load(): Promise<void>;
|
|
315
|
-
private ensureSettingsTable;
|
|
316
|
-
/**
|
|
317
|
-
* Load settings from the _globals_storage-settings table (SQLite fallback)
|
|
318
|
-
* Maps nested global structure to flat key-value cache
|
|
319
|
-
*/
|
|
320
|
-
private loadFromGlobals;
|
|
321
|
-
/**
|
|
322
|
-
* Get a settings value with environment fallback
|
|
323
|
-
*/
|
|
324
|
-
get(key: string, envKey?: string, defaultValue?: string): string | undefined;
|
|
325
|
-
/**
|
|
326
|
-
* Get storage configuration
|
|
327
|
-
*/
|
|
328
|
-
getStorageConfig(): StorageConfig;
|
|
329
|
-
/**
|
|
330
|
-
* Get email configuration
|
|
331
|
-
*/
|
|
332
|
-
getEmailConfig(): EmailConfig;
|
|
333
|
-
/**
|
|
334
|
-
* Mask sensitive values for display
|
|
335
|
-
*/
|
|
336
|
-
maskSensitive(key: string, value: string | undefined): string | undefined;
|
|
337
|
-
/**
|
|
338
|
-
* Update a setting in the database
|
|
339
|
-
*/
|
|
340
|
-
set(key: string, value: string, description?: string): Promise<void>;
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
interface UploadOptions {
|
|
344
|
-
folder?: string;
|
|
345
|
-
filename?: string;
|
|
346
|
-
mimeType?: string;
|
|
347
|
-
metadata?: Record<string, unknown>;
|
|
348
|
-
}
|
|
349
|
-
interface UploadedFile {
|
|
350
|
-
id: string;
|
|
351
|
-
filename: string;
|
|
352
|
-
originalName: string;
|
|
353
|
-
mimeType: string;
|
|
354
|
-
size: number;
|
|
355
|
-
url: string;
|
|
356
|
-
thumbnailUrl?: string;
|
|
357
|
-
width?: number;
|
|
358
|
-
height?: number;
|
|
359
|
-
folder?: string;
|
|
360
|
-
provider: string;
|
|
361
|
-
metadata?: Record<string, unknown>;
|
|
362
|
-
createdAt: string;
|
|
363
|
-
}
|
|
364
|
-
interface ImageTransforms {
|
|
365
|
-
width?: number;
|
|
366
|
-
height?: number;
|
|
367
|
-
fit?: "clip" | "crop" | "fill" | "fillmax" | "scale" | "max" | "min";
|
|
368
|
-
format?: "webp" | "avif" | "jpeg" | "jpg" | "png" | "gif";
|
|
369
|
-
quality?: number;
|
|
370
|
-
blur?: number;
|
|
371
|
-
sharpen?: number;
|
|
372
|
-
/** Crop region as percentages (0-100) of the original image */
|
|
373
|
-
cropX?: number;
|
|
374
|
-
cropY?: number;
|
|
375
|
-
cropWidth?: number;
|
|
376
|
-
cropHeight?: number;
|
|
377
|
-
}
|
|
378
|
-
interface StorageProvider {
|
|
379
|
-
name: string;
|
|
380
|
-
displayName: string;
|
|
381
|
-
supportsDynamicResize: boolean;
|
|
382
|
-
upload(file: File, options?: UploadOptions): Promise<UploadedFile>;
|
|
383
|
-
uploadFromUrl(url: string, options?: UploadOptions): Promise<UploadedFile>;
|
|
384
|
-
delete(url: string): Promise<void>;
|
|
385
|
-
rename(oldUrl: string, newKey: string): Promise<string>;
|
|
386
|
-
getImageUrl(url: string, transforms?: ImageTransforms): string;
|
|
387
|
-
generateThumbnail(file: UploadedFile, size: {
|
|
388
|
-
width: number;
|
|
389
|
-
height: number;
|
|
390
|
-
}): Promise<string>;
|
|
391
|
-
list(prefix?: string): Promise<UploadedFile[]>;
|
|
392
|
-
exists(url: string): Promise<boolean>;
|
|
393
|
-
createFolder?(folder: string): Promise<void>;
|
|
394
|
-
deleteFolder?(folder: string): Promise<void>;
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
declare function resolveProvider(configService: ConfigService): Promise<StorageProvider>;
|
|
398
|
-
|
|
399
|
-
interface AdminConfig {
|
|
400
|
-
/** Field to display as the title/name of the document in list and relation dropdowns (e.g. "title", "name", "orderNumber") */
|
|
401
|
-
useAsTitle?: string;
|
|
402
|
-
/** Array of field names to display as default table columns in the collection list view */
|
|
403
|
-
defaultColumns?: string[];
|
|
404
|
-
/** Hide this collection completely from the sidebar navigation */
|
|
405
|
-
hidden?: boolean;
|
|
406
|
-
/** Subtitle or description shown under the collection header in the admin UI */
|
|
407
|
-
description?: string;
|
|
408
|
-
/** Hide the quick API endpoint URL badge from the admin collection view */
|
|
409
|
-
hideAPIURL?: boolean;
|
|
410
|
-
/** Sidebar navigation category section name (e.g. "Commerce", "Restaurant Menu", "Content") */
|
|
411
|
-
group?: string;
|
|
412
|
-
/** Alias for `group`. Organizes collection under a specific sidebar group/folder */
|
|
413
|
-
folder?: string;
|
|
414
|
-
/** Sub-folder for nested navigation grouping */
|
|
415
|
-
parentFolder?: string;
|
|
416
|
-
/** Enable tree hierarchy view for nested hierarchical collections (e.g. parent/child pages) */
|
|
417
|
-
treeHierarchy?: boolean;
|
|
418
|
-
/** Icon name from Lucide (e.g. "lucide:Utensils", "Utensils") or Heroicons (e.g. "hero:Sparkles", "hero-solid:Fire") */
|
|
419
|
-
icon?: string;
|
|
420
|
-
/** Sort order index within its sidebar navigation group (lower numbers appear first) */
|
|
421
|
-
order?: number;
|
|
422
|
-
/** Function returning live frontend preview URL with draft tokens */
|
|
423
|
-
preview?: (doc: Record<string, unknown>, options: {
|
|
424
|
-
req: unknown;
|
|
425
|
-
token?: string;
|
|
426
|
-
}) => string | Promise<string>;
|
|
427
|
-
/** Disable the duplicate document button */
|
|
428
|
-
disableDuplicate?: boolean;
|
|
429
|
-
/** Disable the live preview split panel */
|
|
430
|
-
disablePreview?: boolean;
|
|
431
|
-
/** Pagination settings for list view */
|
|
432
|
-
pagination?: {
|
|
433
|
-
defaultLimit?: number;
|
|
434
|
-
limits?: number[];
|
|
435
|
-
};
|
|
436
|
-
/** Form layout mode: "split" (with sidebar fields) or "single" column */
|
|
437
|
-
layout?: "split" | "single";
|
|
438
|
-
/** Custom smart view filters configured for this collection */
|
|
439
|
-
smartViews?: SmartViewConfig[];
|
|
440
|
-
}
|
|
441
|
-
interface HierarchyConfig {
|
|
442
|
-
parentField?: string;
|
|
443
|
-
maxDepth?: number;
|
|
444
|
-
slugPrefix?: boolean;
|
|
445
|
-
}
|
|
446
|
-
interface ProjectConfig {
|
|
447
|
-
id: string;
|
|
448
|
-
name: string;
|
|
449
|
-
slug: string;
|
|
450
|
-
description?: string;
|
|
451
|
-
environment?: 'development' | 'staging' | 'production' | string;
|
|
452
|
-
collections?: string[];
|
|
453
|
-
globals?: string[];
|
|
454
|
-
settings?: Record<string, unknown>;
|
|
455
|
-
}
|
|
456
|
-
interface SmartViewConfig {
|
|
457
|
-
id: string;
|
|
458
|
-
name: string;
|
|
459
|
-
icon?: string;
|
|
460
|
-
color?: string;
|
|
461
|
-
filter: Record<string, any>;
|
|
462
|
-
collections?: string[];
|
|
463
|
-
description?: string;
|
|
464
|
-
}
|
|
465
|
-
interface OrganizationConfig {
|
|
466
|
-
id: string;
|
|
467
|
-
name: string;
|
|
468
|
-
slug: string;
|
|
469
|
-
billingEmail?: string;
|
|
470
|
-
projects?: ProjectConfig[];
|
|
471
|
-
roles?: Array<{
|
|
472
|
-
name: string;
|
|
473
|
-
description?: string;
|
|
474
|
-
permissions?: string[];
|
|
475
|
-
}>;
|
|
476
|
-
}
|
|
477
|
-
interface FieldOverrides {
|
|
478
|
-
[fieldPath: string]: any;
|
|
479
|
-
}
|
|
480
|
-
interface CollectionOverrideConfig extends Partial<AdminConfig> {
|
|
481
|
-
label?: string;
|
|
482
|
-
singularLabel?: string;
|
|
483
|
-
labelPlural?: string;
|
|
484
|
-
labels?: {
|
|
485
|
-
singular?: string;
|
|
486
|
-
plural?: string;
|
|
487
|
-
};
|
|
488
|
-
hidden?: boolean;
|
|
489
|
-
timestamps?: boolean;
|
|
490
|
-
versions?: {
|
|
491
|
-
drafts?: boolean;
|
|
492
|
-
maxPerDoc?: number;
|
|
493
|
-
autosave?: boolean;
|
|
494
|
-
};
|
|
495
|
-
seo?: boolean | Record<string, any>;
|
|
496
|
-
access?: CollectionAccess;
|
|
497
|
-
hooks?: CollectionHooks;
|
|
498
|
-
fields?: FieldOverrides;
|
|
499
|
-
blocks?: Record<string, any> | any[];
|
|
500
|
-
tabs?: Record<string, any> | any[];
|
|
501
|
-
[key: string]: any;
|
|
502
|
-
}
|
|
503
|
-
interface GlobalOverrideConfig extends Partial<AdminConfig> {
|
|
504
|
-
label?: string;
|
|
505
|
-
hidden?: boolean;
|
|
506
|
-
access?: GlobalAccess;
|
|
507
|
-
hooks?: GlobalHooks;
|
|
508
|
-
fields?: FieldOverrides;
|
|
509
|
-
blocks?: Record<string, any> | any[];
|
|
510
|
-
tabs?: Record<string, any> | any[];
|
|
511
|
-
[key: string]: any;
|
|
512
|
-
}
|
|
513
|
-
interface UploadConfig {
|
|
514
|
-
staticDir?: string;
|
|
515
|
-
staticURL?: string;
|
|
516
|
-
mimeTypes?: string[];
|
|
517
|
-
fileSize?: number;
|
|
518
|
-
imageSizes?: ImageSize[];
|
|
519
|
-
crop?: boolean;
|
|
520
|
-
focalPoint?: boolean;
|
|
521
|
-
formatOptions?: {
|
|
522
|
-
format: "webp" | "png" | "jpg" | "avif";
|
|
523
|
-
options?: Record<string, unknown>;
|
|
524
|
-
};
|
|
525
|
-
resizeOptions?: Record<string, any>;
|
|
526
|
-
adminThumbnail?: string;
|
|
527
|
-
}
|
|
528
|
-
interface ImageSize {
|
|
529
|
-
name: string;
|
|
530
|
-
width?: number;
|
|
531
|
-
height?: number;
|
|
532
|
-
crop?: string;
|
|
533
|
-
position?: string;
|
|
534
|
-
formatOptions?: {
|
|
535
|
-
format: "webp" | "png" | "jpg" | "avif";
|
|
536
|
-
};
|
|
537
|
-
generateImageName?: (doc: any) => string;
|
|
538
|
-
}
|
|
539
|
-
interface VersionConfig {
|
|
540
|
-
maxPerDoc?: number;
|
|
541
|
-
drafts?: boolean;
|
|
542
|
-
retainDeleted?: boolean;
|
|
543
|
-
}
|
|
544
|
-
type DocumentStatus = 'draft' | 'published' | 'archived';
|
|
545
|
-
interface AuthConfig {
|
|
546
|
-
tokenExpiration?: number;
|
|
547
|
-
verify?: boolean | {
|
|
548
|
-
generateEmailHTML?: (args: any) => string;
|
|
549
|
-
};
|
|
550
|
-
maxLoginAttempts?: number;
|
|
551
|
-
lockTime?: number;
|
|
552
|
-
cookies?: {
|
|
553
|
-
secure?: boolean;
|
|
554
|
-
sameSite?: "strict" | "lax" | "none";
|
|
555
|
-
domain?: string;
|
|
556
|
-
};
|
|
557
|
-
forgotPassword?: {
|
|
558
|
-
generateEmailHTML?: (args: any) => string;
|
|
559
|
-
generateEmailSubject?: (args: any) => string;
|
|
560
|
-
};
|
|
561
|
-
strategies?: Array<{
|
|
562
|
-
name: string;
|
|
563
|
-
authenticate: (args: any) => Promise<any>;
|
|
564
|
-
}>;
|
|
565
|
-
}
|
|
566
|
-
interface CollectionConfig {
|
|
567
|
-
slug: string;
|
|
568
|
-
label?: string;
|
|
569
|
-
labelPlural?: string;
|
|
570
|
-
singularLabel?: string;
|
|
571
|
-
admin?: AdminConfig;
|
|
572
|
-
fields: Field[];
|
|
573
|
-
access?: CollectionAccess;
|
|
574
|
-
hooks?: CollectionHooks;
|
|
575
|
-
timestamps?: boolean;
|
|
576
|
-
tenantScoped?: boolean;
|
|
577
|
-
tenantField?: string;
|
|
578
|
-
upload?: UploadConfig;
|
|
579
|
-
versions?: VersionConfig;
|
|
580
|
-
folder?: string;
|
|
581
|
-
hierarchy?: HierarchyConfig;
|
|
582
|
-
auth?: boolean | AuthConfig;
|
|
583
|
-
graphQL?: {
|
|
584
|
-
singularName?: string;
|
|
585
|
-
pluralName?: string;
|
|
586
|
-
};
|
|
587
|
-
indexes?: Array<{
|
|
588
|
-
fields: Record<string, number | "text">;
|
|
589
|
-
options?: Record<string, any>;
|
|
590
|
-
}>;
|
|
591
|
-
seo?: boolean | Record<string, any>;
|
|
592
|
-
custom?: Record<string, any>;
|
|
593
|
-
tabs?: Array<{
|
|
594
|
-
label: string;
|
|
595
|
-
fields: Field[];
|
|
596
|
-
name?: string;
|
|
597
|
-
}>;
|
|
598
|
-
}
|
|
599
|
-
interface GlobalConfig {
|
|
600
|
-
slug: string;
|
|
601
|
-
label?: string;
|
|
602
|
-
folder?: string;
|
|
603
|
-
admin?: AdminConfig;
|
|
604
|
-
fields: Field[];
|
|
605
|
-
access?: GlobalAccess;
|
|
606
|
-
hooks?: GlobalHooks;
|
|
607
|
-
versions?: VersionConfig;
|
|
608
|
-
graphQL?: {
|
|
609
|
-
name?: string;
|
|
610
|
-
};
|
|
611
|
-
typescript?: {
|
|
612
|
-
interface?: string;
|
|
613
|
-
};
|
|
614
|
-
custom?: Record<string, any>;
|
|
615
|
-
tabs?: Array<{
|
|
616
|
-
label: string;
|
|
617
|
-
fields: Field[];
|
|
618
|
-
name?: string;
|
|
619
|
-
}>;
|
|
620
|
-
}
|
|
621
|
-
interface FindArgs {
|
|
622
|
-
collection: string;
|
|
623
|
-
where?: Record<string, any>;
|
|
624
|
-
sort?: string;
|
|
625
|
-
limit?: number;
|
|
626
|
-
page?: number;
|
|
627
|
-
depth?: number;
|
|
628
|
-
tenantId?: string;
|
|
629
|
-
select?: string[];
|
|
630
|
-
user?: any;
|
|
631
|
-
context?: Record<string, any>;
|
|
632
|
-
overrideAccess?: boolean;
|
|
633
|
-
/** If true, returns draft docs (admin view). If false/omitted, only published docs are returned (public API). */
|
|
634
|
-
draft?: boolean;
|
|
635
|
-
}
|
|
636
|
-
interface FindOneArgs {
|
|
637
|
-
collection: string;
|
|
638
|
-
where: Record<string, any>;
|
|
639
|
-
tenantId?: string;
|
|
640
|
-
draft?: boolean;
|
|
641
|
-
depth?: number;
|
|
642
|
-
select?: string[];
|
|
643
|
-
}
|
|
644
|
-
interface FindByIDArgs {
|
|
645
|
-
collection: string;
|
|
646
|
-
id: string;
|
|
647
|
-
depth?: number;
|
|
648
|
-
tenantId?: string;
|
|
649
|
-
select?: string[];
|
|
650
|
-
user?: any;
|
|
651
|
-
context?: Record<string, any>;
|
|
652
|
-
overrideAccess?: boolean;
|
|
653
|
-
/** If true, returns document regardless of status (admin view). */
|
|
654
|
-
draft?: boolean;
|
|
655
|
-
}
|
|
656
|
-
interface CreateArgs {
|
|
657
|
-
collection: string;
|
|
658
|
-
data: Record<string, any>;
|
|
659
|
-
depth?: number;
|
|
660
|
-
tenantId?: string;
|
|
661
|
-
select?: string[];
|
|
662
|
-
user?: any;
|
|
663
|
-
context?: Record<string, any>;
|
|
664
|
-
overrideAccess?: boolean;
|
|
665
|
-
}
|
|
666
|
-
interface UpdateArgs {
|
|
667
|
-
collection: string;
|
|
668
|
-
id: string;
|
|
669
|
-
data: Record<string, any>;
|
|
670
|
-
depth?: number;
|
|
671
|
-
tenantId?: string;
|
|
672
|
-
select?: string[];
|
|
673
|
-
user?: any;
|
|
674
|
-
context?: Record<string, any>;
|
|
675
|
-
overrideAccess?: boolean;
|
|
676
|
-
}
|
|
677
|
-
interface DeleteArgs {
|
|
678
|
-
collection: string;
|
|
679
|
-
id: string;
|
|
680
|
-
tenantId?: string;
|
|
681
|
-
user?: any;
|
|
682
|
-
context?: Record<string, any>;
|
|
683
|
-
overrideAccess?: boolean;
|
|
684
|
-
}
|
|
685
|
-
interface FindResult<T = any> {
|
|
686
|
-
docs: T[];
|
|
687
|
-
totalDocs: number;
|
|
688
|
-
limit: number;
|
|
689
|
-
totalPages: number;
|
|
690
|
-
page: number;
|
|
691
|
-
pagingCounter: number;
|
|
692
|
-
hasPrevPage: boolean;
|
|
693
|
-
hasNextPage: boolean;
|
|
694
|
-
prevPage: number | null;
|
|
695
|
-
nextPage: number | null;
|
|
696
|
-
}
|
|
697
|
-
interface CreateResult<T = any> {
|
|
698
|
-
doc: T;
|
|
699
|
-
errors?: Array<{
|
|
700
|
-
field: string;
|
|
701
|
-
message: string;
|
|
702
|
-
}>;
|
|
703
|
-
}
|
|
704
|
-
interface VersionRecord<T = Record<string, any>> {
|
|
705
|
-
id: string;
|
|
706
|
-
collection: string;
|
|
707
|
-
documentId: string;
|
|
708
|
-
version: number;
|
|
709
|
-
status: DocumentStatus;
|
|
710
|
-
data: T;
|
|
711
|
-
createdBy?: string;
|
|
712
|
-
createdAt: string;
|
|
713
|
-
updatedAt: string;
|
|
714
|
-
publishedAt?: string | null;
|
|
715
|
-
changeDescription?: string;
|
|
716
|
-
autosave?: boolean;
|
|
717
|
-
}
|
|
718
|
-
interface CreateVersionArgs<T = Record<string, any>> {
|
|
719
|
-
collection: string;
|
|
720
|
-
documentId: string;
|
|
721
|
-
data: T;
|
|
722
|
-
status: DocumentStatus;
|
|
723
|
-
createdBy?: string;
|
|
724
|
-
changeDescription?: string;
|
|
725
|
-
tenantId?: string;
|
|
726
|
-
/** When true, reuses a single version slot (find existing + update) */
|
|
727
|
-
autosave?: boolean;
|
|
728
|
-
}
|
|
729
|
-
interface FindVersionsArgs {
|
|
730
|
-
collection: string;
|
|
731
|
-
documentId: string;
|
|
732
|
-
tenantId?: string;
|
|
733
|
-
limit?: number;
|
|
734
|
-
page?: number;
|
|
735
|
-
sort?: string;
|
|
736
|
-
}
|
|
737
|
-
interface BaseAdapter {
|
|
738
|
-
init(collections: CollectionConfig[], globals: GlobalConfig[]): Promise<void>;
|
|
739
|
-
find<T = Record<string, any>>(args: FindArgs): Promise<FindResult<T>>;
|
|
740
|
-
findByID<T = Record<string, any>>(args: FindByIDArgs): Promise<T | null>;
|
|
741
|
-
create<T = Record<string, any>>(args: CreateArgs): Promise<T>;
|
|
742
|
-
update<T = Record<string, any>>(args: UpdateArgs): Promise<T>;
|
|
743
|
-
delete<T = Record<string, any>>(args: DeleteArgs): Promise<T>;
|
|
744
|
-
count(args: {
|
|
745
|
-
collection: string;
|
|
746
|
-
where?: Record<string, any>;
|
|
747
|
-
tenantId?: string;
|
|
748
|
-
}): Promise<number>;
|
|
749
|
-
findOne(args: FindOneArgs): Promise<any>;
|
|
750
|
-
findVersions(args: FindVersionsArgs): Promise<FindResult<VersionRecord>>;
|
|
751
|
-
findVersionByID(args: {
|
|
752
|
-
collection: string;
|
|
753
|
-
versionId: string;
|
|
754
|
-
tenantId?: string;
|
|
755
|
-
}): Promise<VersionRecord | null>;
|
|
756
|
-
createVersion<T = Record<string, any>>(args: CreateVersionArgs<T>): Promise<VersionRecord<T>>;
|
|
757
|
-
deleteVersions(args: {
|
|
758
|
-
collection: string;
|
|
759
|
-
documentId: string;
|
|
760
|
-
keepLatest?: number;
|
|
761
|
-
tenantId?: string;
|
|
762
|
-
}): Promise<void>;
|
|
763
|
-
updateLatestVersion<T = Record<string, any>>(args: CreateVersionArgs<T>): Promise<VersionRecord<T>>;
|
|
764
|
-
migrate?(): Promise<void>;
|
|
765
|
-
rollback?(): Promise<void>;
|
|
766
|
-
connect(): Promise<void>;
|
|
767
|
-
disconnect(): Promise<void>;
|
|
768
|
-
transaction?<T>(fn: (tx: any) => Promise<T>): Promise<T>;
|
|
769
|
-
setTenantContext(context: TenantContext | undefined): void;
|
|
770
|
-
getTenantContext(): TenantContext | undefined;
|
|
771
|
-
}
|
|
772
|
-
interface AdapterConfig {
|
|
773
|
-
type: "drizzle" | "mongodb";
|
|
774
|
-
client: any;
|
|
775
|
-
schema?: any;
|
|
776
|
-
connectionOptions?: Record<string, any>;
|
|
777
|
-
}
|
|
778
|
-
interface KyroConfig {
|
|
779
|
-
collections?: CollectionConfig[];
|
|
780
|
-
globals?: GlobalConfig[];
|
|
781
|
-
projects?: ProjectConfig[];
|
|
782
|
-
organizations?: OrganizationConfig[];
|
|
783
|
-
adapter: BaseAdapter;
|
|
784
|
-
storage?: StorageProvider;
|
|
785
|
-
plugins?: KyroPlugin[];
|
|
786
|
-
auth?: boolean | {
|
|
787
|
-
secret?: string;
|
|
788
|
-
tokenExpiration?: number;
|
|
789
|
-
cookie?: {
|
|
790
|
-
secure?: boolean;
|
|
791
|
-
sameSite?: "strict" | "lax" | "none";
|
|
792
|
-
domain?: string;
|
|
793
|
-
};
|
|
794
|
-
checkSession?: boolean;
|
|
795
|
-
};
|
|
796
|
-
authAdapter?: any;
|
|
797
|
-
cors?: {
|
|
798
|
-
origins?: string[];
|
|
799
|
-
credentials?: boolean;
|
|
800
|
-
};
|
|
801
|
-
admin?: {
|
|
802
|
-
meta?: {
|
|
803
|
-
title?: string;
|
|
804
|
-
description?: string;
|
|
805
|
-
ogImage?: string;
|
|
806
|
-
};
|
|
807
|
-
dateFormat?: string;
|
|
808
|
-
avatar?: "default" | "gravatar";
|
|
809
|
-
disable?: boolean;
|
|
810
|
-
indexRoute?: string;
|
|
811
|
-
components?: Record<string, any>;
|
|
812
|
-
collectionOverrides?: Record<string, CollectionOverrideConfig>;
|
|
813
|
-
globalOverrides?: Record<string, GlobalOverrideConfig>;
|
|
814
|
-
smartViews?: SmartViewConfig[];
|
|
815
|
-
};
|
|
816
|
-
upload?: {
|
|
817
|
-
limits?: {
|
|
818
|
-
fileSize?: number;
|
|
819
|
-
};
|
|
820
|
-
};
|
|
821
|
-
graphQL?: {
|
|
822
|
-
maxComplexity?: number;
|
|
823
|
-
disablePlayground?: boolean;
|
|
824
|
-
};
|
|
825
|
-
typescript?: {
|
|
826
|
-
outputFile?: string;
|
|
827
|
-
};
|
|
828
|
-
localization?: {
|
|
829
|
-
locales: string[];
|
|
830
|
-
defaultLocale: string;
|
|
831
|
-
};
|
|
832
|
-
rateLimit?: {
|
|
833
|
-
window?: number;
|
|
834
|
-
max?: number;
|
|
835
|
-
};
|
|
836
|
-
debug?: boolean;
|
|
837
|
-
}
|
|
838
|
-
|
|
839
|
-
export { getWhereClause as $, type AccessArgs as A, type BaseAdapter as B, type CollectionConfig as C, type DeleteArgs as D, type EmailConfig as E, type FindArgs as F, type GlobalConfig as G, type HierarchyConfig as H, type ImageSize as I, type PluginHooks as J, KyroPlugin as K, type ProjectConfig as L, ReviewsPlugin as M, SEOPlugin as N, type OrganizationConfig as O, PluginManager as P, type SmartViewConfig as Q, type Request as R, type StorageConfig as S, type TenantContext as T, type UpdateArgs as U, type VersionRecord as V, type UploadConfig as W, type VersionConfig as X, type WhereClause as Y, WishlistPlugin as Z, evaluateAccess as _, type StorageProvider as a, mergeWhereClauses as a0, presetPlugins as a1, resolveProvider as a2, runFieldHooks as a3, runHooks as a4, type FindResult as b, type FindByIDArgs as c, type CreateArgs as d, type FindOneArgs as e, type FindVersionsArgs as f, type CreateVersionArgs as g, type KyroConfig as h, type User as i, type AccessControl as j, type AdapterConfig as k, type AdminConfig as l, AnalyticsPlugin as m, type AuthConfig as n, type CollectionAccess as o, type CollectionHooks as p, CommentsPlugin as q, ConfigService as r, type CreateResult as s, type FieldAccess as t, type FieldHooks as u, type GlobalAccess as v, type GlobalHooks as w, type Hook as x, type HookArgs as y, type PluginAPI as z };
|