@kyro-cms/core 0.9.0 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -593
- package/dist/{WebhookService-AefJfqX0.d.cts → WebhookService-BKszZlG0.d.cts} +1 -1
- package/dist/{WebhookService-118ZTFis.d.ts → WebhookService-Ccf1j-IN.d.ts} +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 +33 -99
- 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 +21 -97
- package/dist/api-handler.js.map +1 -1
- package/dist/{tenant-B1YB0Jy8.d.ts → base-CIuXkrH4.d.cts} +7 -15
- package/dist/{tenant-Cpeveji6.d.cts → base-fFo4lqER.d.ts} +7 -15
- package/dist/bootstrap-3PV3GJ3S.js +7 -0
- package/dist/{bootstrap-JCML6NFO.js.map → bootstrap-3PV3GJ3S.js.map} +1 -1
- package/dist/bootstrap-4CELFLJO.cjs +32 -0
- package/dist/{bootstrap-AKAUP6F6.cjs.map → bootstrap-4CELFLJO.cjs.map} +1 -1
- 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-Z6ZWNWWR.js → chunk-4CV4JOE5.js} +3 -9
- package/dist/{chunk-Z6ZWNWWR.js.map → chunk-4CV4JOE5.js.map} +1 -1
- package/dist/chunk-4M7X5HAB.cjs +173 -0
- package/dist/chunk-4M7X5HAB.cjs.map +1 -0
- package/dist/chunk-53NYVYVX.js +3243 -0
- package/dist/chunk-53NYVYVX.js.map +1 -0
- package/dist/{chunk-35U3FROB.js → chunk-5H3MWQJS.js} +714 -184
- package/dist/chunk-5H3MWQJS.js.map +1 -0
- package/dist/{chunk-YVUJBEXE.cjs → chunk-5PMQQFRE.cjs} +16 -7
- package/dist/chunk-5PMQQFRE.cjs.map +1 -0
- package/dist/{chunk-57P6MJKC.js → chunk-6UNONDW7.js} +94 -10
- package/dist/chunk-6UNONDW7.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-2OL4O2TH.cjs → chunk-7OS7TX2Q.cjs} +68 -62
- package/dist/chunk-7OS7TX2Q.cjs.map +1 -0
- package/dist/{chunk-3TPQ2BU6.js → chunk-BYBMTIMT.js} +2 -6
- package/dist/chunk-BYBMTIMT.js.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-OHVB4AJ7.js → chunk-CJX74IYK.js} +24 -18
- package/dist/chunk-CJX74IYK.js.map +1 -0
- package/dist/{chunk-5KVM3WEY.cjs → chunk-CNKT4PME.cjs} +1592 -868
- package/dist/chunk-CNKT4PME.cjs.map +1 -0
- package/dist/{chunk-G7VZBCD6.cjs → chunk-CZLDE2OZ.cjs} +2 -9
- package/dist/{chunk-G7VZBCD6.cjs.map → chunk-CZLDE2OZ.cjs.map} +1 -1
- package/dist/{chunk-WQBRWOQT.cjs → chunk-DPA3KWPY.cjs} +4 -3
- package/dist/chunk-DPA3KWPY.cjs.map +1 -0
- package/dist/{chunk-LINKCEG4.cjs → chunk-E2763JUP.cjs} +726 -196
- package/dist/chunk-E2763JUP.cjs.map +1 -0
- package/dist/chunk-E5UJBLQ7.js +220 -0
- package/dist/chunk-E5UJBLQ7.js.map +1 -0
- package/dist/{chunk-DVD5P72E.cjs → chunk-EEJUFDMF.cjs} +2 -6
- package/dist/chunk-EEJUFDMF.cjs.map +1 -0
- package/dist/chunk-FSKONGCX.cjs +253 -0
- package/dist/chunk-FSKONGCX.cjs.map +1 -0
- package/dist/{chunk-Y3QQN7PN.js → chunk-GAAHG2Z4.js} +13 -4
- package/dist/chunk-GAAHG2Z4.js.map +1 -0
- package/dist/chunk-GAOXD3XT.js +175 -0
- package/dist/chunk-GAOXD3XT.js.map +1 -0
- package/dist/{chunk-SA7NSSIQ.cjs → chunk-GUUB5EAG.cjs} +13 -187
- package/dist/chunk-GUUB5EAG.cjs.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-HXRD4B37.js → chunk-IPTZM3VE.js} +1423 -704
- package/dist/chunk-IPTZM3VE.js.map +1 -0
- package/dist/chunk-KC2GDBLS.cjs +84 -0
- package/dist/chunk-KC2GDBLS.cjs.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-NWUEVLQT.cjs +99 -0
- package/dist/chunk-NWUEVLQT.cjs.map +1 -0
- package/dist/{chunk-3AJE4SEG.js → chunk-OHC6UHFY.js} +208 -76
- package/dist/chunk-OHC6UHFY.js.map +1 -0
- package/dist/chunk-PHJRNPHY.cjs +3291 -0
- package/dist/chunk-PHJRNPHY.cjs.map +1 -0
- package/dist/{chunk-DXHRBMGB.js → chunk-PQ72Z6WC.js} +67 -112
- package/dist/chunk-PQ72Z6WC.js.map +1 -0
- package/dist/{chunk-K7JPTH3G.cjs → chunk-PV2I2KMI.cjs} +214 -82
- package/dist/chunk-PV2I2KMI.cjs.map +1 -0
- package/dist/{chunk-PDYFVNUX.cjs → chunk-Q23GAMLE.cjs} +71 -116
- package/dist/chunk-Q23GAMLE.cjs.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-2KVHZE6O.cjs → chunk-RFFSZSCL.cjs} +282 -190
- package/dist/chunk-RFFSZSCL.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-WOWUL7ZY.js → chunk-UUDTPZX6.js} +5 -4
- package/dist/chunk-UUDTPZX6.js.map +1 -0
- package/dist/{chunk-QPPDLRNR.js → chunk-V7KZQIZ6.js} +277 -185
- package/dist/chunk-V7KZQIZ6.js.map +1 -0
- package/dist/{chunk-3ZFYL34R.js → chunk-WXVB364T.js} +12 -185
- package/dist/chunk-WXVB364T.js.map +1 -0
- package/dist/chunk-XEB7PH2E.js +81 -0
- package/dist/chunk-XEB7PH2E.js.map +1 -0
- package/dist/{chunk-IA6AU5PI.cjs → chunk-Y7AQK4R4.cjs} +94 -10
- package/dist/chunk-Y7AQK4R4.cjs.map +1 -0
- package/dist/chunk-YFAVQQTU.js +92 -0
- package/dist/chunk-YFAVQQTU.js.map +1 -0
- package/dist/cli/index.cjs +6 -6
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.js +6 -6
- package/dist/cli/index.js.map +1 -1
- package/dist/client.cjs +4 -4
- package/dist/client.d.cts +3 -3
- package/dist/client.d.ts +3 -3
- package/dist/client.js +2 -2
- package/dist/drizzle/index.cjs +15 -14
- package/dist/drizzle/index.d.cts +10 -14
- package/dist/drizzle/index.d.ts +10 -14
- package/dist/drizzle/index.js +6 -5
- package/dist/fields/index.cjs +22 -38
- package/dist/fields/index.d.cts +2 -22
- package/dist/fields/index.d.ts +2 -22
- package/dist/fields/index.js +2 -2
- package/dist/graphql/index.cjs +6 -5
- package/dist/graphql/index.d.cts +5 -3
- package/dist/graphql/index.d.ts +5 -3
- package/dist/graphql/index.js +4 -3
- package/dist/index-BKta3cBH.d.cts +277 -0
- package/dist/index-ClOqnkTO.d.ts +277 -0
- package/dist/index.cjs +310 -168
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +130 -211
- package/dist/index.d.ts +130 -211
- package/dist/index.js +174 -35
- package/dist/index.js.map +1 -1
- package/dist/integration.cjs +3 -3
- package/dist/integration.js +2 -2
- package/dist/media-7WDX4BDJ.js +4 -0
- package/dist/{media-GPPTZ43E.js.map → media-7WDX4BDJ.js.map} +1 -1
- package/dist/{media-XNTUFJZR.cjs → media-TUSLVRQ6.cjs} +3 -3
- package/dist/{media-XNTUFJZR.cjs.map → media-TUSLVRQ6.cjs.map} +1 -1
- package/dist/mongo-auth-adapter-GT4S7SCU.cjs +17 -0
- package/dist/{mongo-auth-adapter-NHHUJHVH.cjs.map → mongo-auth-adapter-GT4S7SCU.cjs.map} +1 -1
- package/dist/mongo-auth-adapter-M7VV4LNB.js +4 -0
- package/dist/{mongo-auth-adapter-NJQUUCTP.js.map → mongo-auth-adapter-M7VV4LNB.js.map} +1 -1
- package/dist/mongodb/index.cjs +9 -8
- package/dist/mongodb/index.d.cts +6 -13
- package/dist/mongodb/index.d.ts +6 -13
- package/dist/mongodb/index.js +5 -4
- package/dist/postgres-auth-adapter-AFAPISH7.js +5 -0
- package/dist/{postgres-auth-adapter-3T2NKTSE.js.map → postgres-auth-adapter-AFAPISH7.js.map} +1 -1
- package/dist/postgres-auth-adapter-SFDTLONT.cjs +14 -0
- package/dist/{postgres-auth-adapter-7IEENCKQ.cjs.map → postgres-auth-adapter-SFDTLONT.cjs.map} +1 -1
- package/dist/redis-adapter-UQX4EE3B.cjs +13 -0
- package/dist/{redis-adapter-D2E2S3GB.cjs.map → redis-adapter-UQX4EE3B.cjs.map} +1 -1
- package/dist/redis-adapter-XALOGWY3.js +4 -0
- package/dist/{redis-adapter-VQXD7ESY.js.map → redis-adapter-XALOGWY3.js.map} +1 -1
- package/dist/rest/index.cjs +16 -15
- package/dist/rest/index.d.cts +4 -4
- package/dist/rest/index.d.ts +4 -4
- package/dist/rest/index.js +14 -13
- package/dist/{schema-37SE2F4B.cjs → schema-6QL3USNB.cjs} +15 -15
- package/dist/{schema-37SE2F4B.cjs.map → schema-6QL3USNB.cjs.map} +1 -1
- package/dist/{schema-5PHL5IVB.js → schema-FNNWEAAW.js} +4 -4
- package/dist/{schema-5PHL5IVB.js.map → schema-FNNWEAAW.js.map} +1 -1
- package/dist/sqlite-adapter-AQB5TCGV.cjs +13 -0
- package/dist/{sqlite-adapter-LVK5PS4T.cjs.map → sqlite-adapter-AQB5TCGV.cjs.map} +1 -1
- package/dist/sqlite-adapter-N5H6IM2X.js +4 -0
- package/dist/{sqlite-adapter-TR3U3W6Q.js.map → sqlite-adapter-N5H6IM2X.js.map} +1 -1
- package/dist/templates/index.cjs +134 -32
- package/dist/templates/index.d.cts +52 -9
- package/dist/templates/index.d.ts +52 -9
- package/dist/templates/index.js +4 -2
- package/dist/trpc/index.cjs +14 -13
- package/dist/trpc/index.d.cts +55 -49
- package/dist/trpc/index.d.ts +55 -49
- package/dist/trpc/index.js +5 -4
- 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-VtjUxIMp.d.cts → types-DeSApf9T.d.cts} +36 -14
- package/dist/{types-VtjUxIMp.d.ts → types-DeSApf9T.d.ts} +36 -14
- package/dist/{types-J3R9nVsZ.d.cts → types-Dgzlftb7.d.ts} +32 -28
- package/dist/{types-Bs1up4yP.d.ts → types-Ds0tCA3L.d.cts} +32 -28
- package/dist/ws/index.cjs +6 -6
- package/dist/ws/index.js +2 -2
- 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-3TPQ2BU6.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-DVD5P72E.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/media-GPPTZ43E.js +0 -4
- 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,
|
|
2
|
-
import { i as createWebhookService } from '../WebhookService-
|
|
3
|
-
import '../types-
|
|
1
|
+
import { B as BaseAdapter, R as Request, i as User, b as FindResult } from '../types-Dgzlftb7.js';
|
|
2
|
+
import { i as createWebhookService } from '../WebhookService-Ccf1j-IN.js';
|
|
3
|
+
import '../types-DeSApf9T.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-
|
|
4
|
-
import '../chunk-
|
|
1
|
+
export { createContext, createCountProcedure, createCreateProcedure, createDeleteProcedure, createDynamicRouter, createFindByIDProcedure, createFindProcedure, createKyroServer, createUpdateProcedure } from '../chunk-OHC6UHFY.js';
|
|
2
|
+
import '../chunk-3UK5XBVJ.js';
|
|
3
|
+
import '../chunk-CJONKRHJ.js';
|
|
4
|
+
import '../chunk-L4EZKIEX.js';
|
|
5
|
+
import '../chunk-4CV4JOE5.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,15 +1,31 @@
|
|
|
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
|
-
|
|
27
|
+
pickerMode?: "drawer" | "dropdown";
|
|
28
|
+
condition?: ((data: Record<string, any>, siblingData: Record<string, any>) => boolean) | DeclarativeCondition;
|
|
13
29
|
}
|
|
14
30
|
interface BaseField {
|
|
15
31
|
name: string;
|
|
@@ -77,10 +93,11 @@ interface TextareaField extends BaseField {
|
|
|
77
93
|
}
|
|
78
94
|
interface SelectField extends BaseField {
|
|
79
95
|
type: "select";
|
|
80
|
-
options
|
|
96
|
+
options?: Array<{
|
|
81
97
|
label: string;
|
|
82
98
|
value: string;
|
|
83
99
|
}>;
|
|
100
|
+
dynamicOptions?: string;
|
|
84
101
|
hasMany?: boolean;
|
|
85
102
|
defaultValue?: string | string[];
|
|
86
103
|
}
|
|
@@ -104,16 +121,10 @@ interface ImageField extends BaseField {
|
|
|
104
121
|
allowedTypes?: string[];
|
|
105
122
|
maxSize?: number;
|
|
106
123
|
}
|
|
107
|
-
|
|
108
|
-
type: string;
|
|
109
|
-
data: Record<string, any>;
|
|
110
|
-
children?: RichTextBlock[];
|
|
111
|
-
}
|
|
124
|
+
type RichTextBlock = Record<string, any>;
|
|
112
125
|
interface RichTextField extends BaseField {
|
|
113
126
|
type: "richtext";
|
|
114
|
-
|
|
115
|
-
hasBlocks?: boolean;
|
|
116
|
-
defaultValue?: RichTextBlock[];
|
|
127
|
+
defaultValue?: Record<string, any>;
|
|
117
128
|
localized?: boolean;
|
|
118
129
|
}
|
|
119
130
|
interface JSONField extends BaseField {
|
|
@@ -174,6 +185,7 @@ interface BlockImage {
|
|
|
174
185
|
}
|
|
175
186
|
interface BlockAdmin {
|
|
176
187
|
group?: string;
|
|
188
|
+
description?: string;
|
|
177
189
|
images?: {
|
|
178
190
|
icon?: BlockImage | string;
|
|
179
191
|
thumbnail?: BlockImage | string;
|
|
@@ -223,7 +235,17 @@ interface ButtonField extends BaseField {
|
|
|
223
235
|
method?: string;
|
|
224
236
|
inline?: boolean;
|
|
225
237
|
}
|
|
226
|
-
|
|
238
|
+
interface ActionField extends BaseField {
|
|
239
|
+
type: "action";
|
|
240
|
+
label: string;
|
|
241
|
+
action?: string;
|
|
242
|
+
method?: string;
|
|
243
|
+
inline?: boolean;
|
|
244
|
+
}
|
|
245
|
+
interface SecretField extends BaseField {
|
|
246
|
+
type: "secret";
|
|
247
|
+
}
|
|
248
|
+
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
249
|
type FieldType = Field["type"];
|
|
228
250
|
declare function isTextField(field: Field): field is TextField;
|
|
229
251
|
declare function isNumberField(field: Field): field is NumberField;
|
|
@@ -243,4 +265,4 @@ declare const LAYOUT_FIELD_TYPES: readonly ["row", "collapsible", "tabs"];
|
|
|
243
265
|
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
266
|
declare function createRelationshipFieldConfig(name: string, relationTo: string | string[], options?: Partial<Omit<RelationshipField, "type" | "name" | "relationTo">>): RelationshipField;
|
|
245
267
|
|
|
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,
|
|
268
|
+
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,31 @@
|
|
|
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
|
-
|
|
27
|
+
pickerMode?: "drawer" | "dropdown";
|
|
28
|
+
condition?: ((data: Record<string, any>, siblingData: Record<string, any>) => boolean) | DeclarativeCondition;
|
|
13
29
|
}
|
|
14
30
|
interface BaseField {
|
|
15
31
|
name: string;
|
|
@@ -77,10 +93,11 @@ interface TextareaField extends BaseField {
|
|
|
77
93
|
}
|
|
78
94
|
interface SelectField extends BaseField {
|
|
79
95
|
type: "select";
|
|
80
|
-
options
|
|
96
|
+
options?: Array<{
|
|
81
97
|
label: string;
|
|
82
98
|
value: string;
|
|
83
99
|
}>;
|
|
100
|
+
dynamicOptions?: string;
|
|
84
101
|
hasMany?: boolean;
|
|
85
102
|
defaultValue?: string | string[];
|
|
86
103
|
}
|
|
@@ -104,16 +121,10 @@ interface ImageField extends BaseField {
|
|
|
104
121
|
allowedTypes?: string[];
|
|
105
122
|
maxSize?: number;
|
|
106
123
|
}
|
|
107
|
-
|
|
108
|
-
type: string;
|
|
109
|
-
data: Record<string, any>;
|
|
110
|
-
children?: RichTextBlock[];
|
|
111
|
-
}
|
|
124
|
+
type RichTextBlock = Record<string, any>;
|
|
112
125
|
interface RichTextField extends BaseField {
|
|
113
126
|
type: "richtext";
|
|
114
|
-
|
|
115
|
-
hasBlocks?: boolean;
|
|
116
|
-
defaultValue?: RichTextBlock[];
|
|
127
|
+
defaultValue?: Record<string, any>;
|
|
117
128
|
localized?: boolean;
|
|
118
129
|
}
|
|
119
130
|
interface JSONField extends BaseField {
|
|
@@ -174,6 +185,7 @@ interface BlockImage {
|
|
|
174
185
|
}
|
|
175
186
|
interface BlockAdmin {
|
|
176
187
|
group?: string;
|
|
188
|
+
description?: string;
|
|
177
189
|
images?: {
|
|
178
190
|
icon?: BlockImage | string;
|
|
179
191
|
thumbnail?: BlockImage | string;
|
|
@@ -223,7 +235,17 @@ interface ButtonField extends BaseField {
|
|
|
223
235
|
method?: string;
|
|
224
236
|
inline?: boolean;
|
|
225
237
|
}
|
|
226
|
-
|
|
238
|
+
interface ActionField extends BaseField {
|
|
239
|
+
type: "action";
|
|
240
|
+
label: string;
|
|
241
|
+
action?: string;
|
|
242
|
+
method?: string;
|
|
243
|
+
inline?: boolean;
|
|
244
|
+
}
|
|
245
|
+
interface SecretField extends BaseField {
|
|
246
|
+
type: "secret";
|
|
247
|
+
}
|
|
248
|
+
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
249
|
type FieldType = Field["type"];
|
|
228
250
|
declare function isTextField(field: Field): field is TextField;
|
|
229
251
|
declare function isNumberField(field: Field): field is NumberField;
|
|
@@ -243,4 +265,4 @@ declare const LAYOUT_FIELD_TYPES: readonly ["row", "collapsible", "tabs"];
|
|
|
243
265
|
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
266
|
declare function createRelationshipFieldConfig(name: string, relationTo: string | string[], options?: Partial<Omit<RelationshipField, "type" | "name" | "relationTo">>): RelationshipField;
|
|
245
267
|
|
|
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,
|
|
268
|
+
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,4 +1,4 @@
|
|
|
1
|
-
import { F as Field } from './types-
|
|
1
|
+
import { F as Field } from './types-DeSApf9T.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;
|
|
@@ -287,29 +307,6 @@ interface FindResult<T = any> {
|
|
|
287
307
|
prevPage: number | null;
|
|
288
308
|
nextPage: number | null;
|
|
289
309
|
}
|
|
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
|
-
}
|
|
313
310
|
interface CreateResult<T = any> {
|
|
314
311
|
doc: T;
|
|
315
312
|
errors?: Array<{
|
|
@@ -329,6 +326,7 @@ interface VersionRecord<T = Record<string, any>> {
|
|
|
329
326
|
updatedAt: string;
|
|
330
327
|
publishedAt?: string | null;
|
|
331
328
|
changeDescription?: string;
|
|
329
|
+
autosave?: boolean;
|
|
332
330
|
}
|
|
333
331
|
interface CreateVersionArgs<T = Record<string, any>> {
|
|
334
332
|
collection: string;
|
|
@@ -338,6 +336,8 @@ interface CreateVersionArgs<T = Record<string, any>> {
|
|
|
338
336
|
createdBy?: string;
|
|
339
337
|
changeDescription?: string;
|
|
340
338
|
tenantID?: string;
|
|
339
|
+
/** When true, reuses a single version slot (find existing + update) */
|
|
340
|
+
autosave?: boolean;
|
|
341
341
|
}
|
|
342
342
|
interface FindVersionsArgs {
|
|
343
343
|
collection: string;
|
|
@@ -378,14 +378,14 @@ interface BaseAdapter {
|
|
|
378
378
|
keepLatest?: number;
|
|
379
379
|
tenantID?: string;
|
|
380
380
|
}): Promise<void>;
|
|
381
|
-
|
|
382
|
-
upsertDraft<T = Record<string, any>>(args: DraftUpsertArgs<T>): Promise<DraftSnapshot<T>>;
|
|
383
|
-
deleteDraft(args: DraftDeleteArgs): Promise<void>;
|
|
381
|
+
updateLatestVersion<T = Record<string, any>>(args: CreateVersionArgs<T>): Promise<VersionRecord<T>>;
|
|
384
382
|
migrate?(): Promise<void>;
|
|
385
383
|
rollback?(): Promise<void>;
|
|
386
384
|
connect(): Promise<void>;
|
|
387
385
|
disconnect(): Promise<void>;
|
|
388
386
|
transaction?<T>(fn: (tx: any) => Promise<T>): Promise<T>;
|
|
387
|
+
setTenantContext(context: TenantContext | undefined): void;
|
|
388
|
+
getTenantContext(): TenantContext | undefined;
|
|
389
389
|
}
|
|
390
390
|
interface AdapterConfig {
|
|
391
391
|
type: "drizzle" | "mongodb";
|
|
@@ -396,6 +396,7 @@ interface AdapterConfig {
|
|
|
396
396
|
interface PluginConfig {
|
|
397
397
|
name: string;
|
|
398
398
|
version?: string;
|
|
399
|
+
description?: string;
|
|
399
400
|
init?: (kyro: any) => void | Promise<void>;
|
|
400
401
|
extendCollection?: (slug: string, config: CollectionConfig) => CollectionConfig;
|
|
401
402
|
extendGlobal?: (slug: string, config: GlobalConfig) => GlobalConfig;
|
|
@@ -434,6 +435,9 @@ interface KyroConfig {
|
|
|
434
435
|
disable?: boolean;
|
|
435
436
|
indexRoute?: string;
|
|
436
437
|
components?: Record<string, any>;
|
|
438
|
+
collectionOverrides?: Record<string, Partial<AdminConfig> & {
|
|
439
|
+
fields?: FieldOverrides;
|
|
440
|
+
}>;
|
|
437
441
|
};
|
|
438
442
|
upload?: {
|
|
439
443
|
limits?: {
|
|
@@ -458,4 +462,4 @@ interface KyroConfig {
|
|
|
458
462
|
debug?: boolean;
|
|
459
463
|
}
|
|
460
464
|
|
|
461
|
-
export { type AdminConfig as A, type BaseAdapter as B, type CollectionConfig as C, type DeleteArgs as D,
|
|
465
|
+
export { type AdminConfig as A, type BaseAdapter as B, type CollectionConfig as C, type DeleteArgs as D, type FindArgs as F, type GlobalConfig as G, type Hook as H, type ImageSize as I, type KyroConfig as K, 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 User as i, type AccessArgs as j, type AccessControl as k, type AdapterConfig as l, type CollectionAccess as m, type CollectionHooks as n, type CreateResult as o, type FieldAccess as p, type FieldHooks as q, type GlobalAccess as r, type GlobalHooks as s, type HookArgs as t, evaluateAccess as u, getWhereClause as v, mergeWhereClauses as w, runFieldHooks as x, runHooks as y };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as Field } from './types-
|
|
1
|
+
import { F as Field } from './types-DeSApf9T.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;
|
|
@@ -287,29 +307,6 @@ interface FindResult<T = any> {
|
|
|
287
307
|
prevPage: number | null;
|
|
288
308
|
nextPage: number | null;
|
|
289
309
|
}
|
|
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
|
-
}
|
|
313
310
|
interface CreateResult<T = any> {
|
|
314
311
|
doc: T;
|
|
315
312
|
errors?: Array<{
|
|
@@ -329,6 +326,7 @@ interface VersionRecord<T = Record<string, any>> {
|
|
|
329
326
|
updatedAt: string;
|
|
330
327
|
publishedAt?: string | null;
|
|
331
328
|
changeDescription?: string;
|
|
329
|
+
autosave?: boolean;
|
|
332
330
|
}
|
|
333
331
|
interface CreateVersionArgs<T = Record<string, any>> {
|
|
334
332
|
collection: string;
|
|
@@ -338,6 +336,8 @@ interface CreateVersionArgs<T = Record<string, any>> {
|
|
|
338
336
|
createdBy?: string;
|
|
339
337
|
changeDescription?: string;
|
|
340
338
|
tenantID?: string;
|
|
339
|
+
/** When true, reuses a single version slot (find existing + update) */
|
|
340
|
+
autosave?: boolean;
|
|
341
341
|
}
|
|
342
342
|
interface FindVersionsArgs {
|
|
343
343
|
collection: string;
|
|
@@ -378,14 +378,14 @@ interface BaseAdapter {
|
|
|
378
378
|
keepLatest?: number;
|
|
379
379
|
tenantID?: string;
|
|
380
380
|
}): Promise<void>;
|
|
381
|
-
|
|
382
|
-
upsertDraft<T = Record<string, any>>(args: DraftUpsertArgs<T>): Promise<DraftSnapshot<T>>;
|
|
383
|
-
deleteDraft(args: DraftDeleteArgs): Promise<void>;
|
|
381
|
+
updateLatestVersion<T = Record<string, any>>(args: CreateVersionArgs<T>): Promise<VersionRecord<T>>;
|
|
384
382
|
migrate?(): Promise<void>;
|
|
385
383
|
rollback?(): Promise<void>;
|
|
386
384
|
connect(): Promise<void>;
|
|
387
385
|
disconnect(): Promise<void>;
|
|
388
386
|
transaction?<T>(fn: (tx: any) => Promise<T>): Promise<T>;
|
|
387
|
+
setTenantContext(context: TenantContext | undefined): void;
|
|
388
|
+
getTenantContext(): TenantContext | undefined;
|
|
389
389
|
}
|
|
390
390
|
interface AdapterConfig {
|
|
391
391
|
type: "drizzle" | "mongodb";
|
|
@@ -396,6 +396,7 @@ interface AdapterConfig {
|
|
|
396
396
|
interface PluginConfig {
|
|
397
397
|
name: string;
|
|
398
398
|
version?: string;
|
|
399
|
+
description?: string;
|
|
399
400
|
init?: (kyro: any) => void | Promise<void>;
|
|
400
401
|
extendCollection?: (slug: string, config: CollectionConfig) => CollectionConfig;
|
|
401
402
|
extendGlobal?: (slug: string, config: GlobalConfig) => GlobalConfig;
|
|
@@ -434,6 +435,9 @@ interface KyroConfig {
|
|
|
434
435
|
disable?: boolean;
|
|
435
436
|
indexRoute?: string;
|
|
436
437
|
components?: Record<string, any>;
|
|
438
|
+
collectionOverrides?: Record<string, Partial<AdminConfig> & {
|
|
439
|
+
fields?: FieldOverrides;
|
|
440
|
+
}>;
|
|
437
441
|
};
|
|
438
442
|
upload?: {
|
|
439
443
|
limits?: {
|
|
@@ -458,4 +462,4 @@ interface KyroConfig {
|
|
|
458
462
|
debug?: boolean;
|
|
459
463
|
}
|
|
460
464
|
|
|
461
|
-
export { type AdminConfig as A, type BaseAdapter as B, type CollectionConfig as C, type DeleteArgs as D,
|
|
465
|
+
export { type AdminConfig as A, type BaseAdapter as B, type CollectionConfig as C, type DeleteArgs as D, type FindArgs as F, type GlobalConfig as G, type Hook as H, type ImageSize as I, type KyroConfig as K, 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 User as i, type AccessArgs as j, type AccessControl as k, type AdapterConfig as l, type CollectionAccess as m, type CollectionHooks as n, type CreateResult as o, type FieldAccess as p, type FieldHooks as q, type GlobalAccess as r, type GlobalHooks as s, type HookArgs as t, evaluateAccess as u, getWhereClause as v, mergeWhereClauses as w, runFieldHooks as x, runHooks as y };
|