@kyro-cms/core 0.13.3 → 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-BCgFt3Yx.d.ts → base-C2DOe8wD.d.ts} +3 -2
- package/dist/{base-B-i-tjm1.d.ts → base-DIpT2Vuz.d.cts} +3 -2
- package/dist/chunk-2TYITUOC.js +122 -0
- package/dist/{chunk-K73HOMQY.cjs → chunk-3CIMGC2F.cjs} +3 -3
- package/dist/{chunk-DSHKQL3R.cjs → chunk-6YS6XLOD.cjs} +13 -13
- package/dist/{chunk-ELFQKQLL.js → chunk-ALTU3FDG.js} +1 -1
- package/dist/{chunk-O7CBGP4N.cjs → chunk-LKRI5X2V.cjs} +1 -1
- package/dist/{chunk-22RXJ442.js → chunk-YIFKTA5N.js} +1 -1
- package/dist/cli/index.cjs +86 -86
- package/dist/cli/index.js +87 -87
- package/dist/client.d.cts +25 -0
- package/dist/client.d.ts +25 -0
- package/dist/drizzle/index.d.cts +3 -3
- package/dist/drizzle/index.d.ts +3 -3
- 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 +10 -10
- package/dist/index.d.ts +10 -10
- package/dist/index.js +3 -3
- package/dist/mongodb/index.d.cts +3 -3
- package/dist/mongodb/index.d.ts +3 -3
- 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/templates/index.d.cts +2 -2
- package/dist/templates/index.d.ts +2 -2
- 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-BaOJ5uWd.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-OYfoYPYP.d.ts +0 -218
- package/dist/base-xflndGDO.d.ts +0 -218
- package/dist/bootstrap-E24SGUJP.cjs +0 -1
- package/dist/bootstrap-QQ6D3OYG.js +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-2OS5Y4LE.cjs +0 -1
- package/dist/chunk-2PXXQKN3.cjs +0 -3
- package/dist/chunk-32QY56XF.js +0 -122
- package/dist/chunk-355R4LS5.cjs +0 -56
- package/dist/chunk-35IVNLMA.js +0 -122
- package/dist/chunk-3GXLOYM3.js +0 -2
- package/dist/chunk-3LAWUINR.cjs +0 -1
- package/dist/chunk-3O3AVMWM.cjs +0 -1
- 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-6DD4J7LI.js +0 -2
- package/dist/chunk-6GGPY7U2.js +0 -4
- package/dist/chunk-6MNLRAKM.cjs +0 -121
- 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-A7LZ6T42.cjs +0 -1
- package/dist/chunk-APDQ6ZTG.cjs +0 -120
- package/dist/chunk-ATI2UZ7U.js +0 -2
- 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-E4H3ZZ7U.js +0 -4
- 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-GV2IB4WQ.cjs +0 -56
- package/dist/chunk-GWIZT2P5.js +0 -57
- package/dist/chunk-H3FJ54KB.cjs +0 -121
- package/dist/chunk-HY3EAWB2.js +0 -4
- package/dist/chunk-I6UJVO2P.js +0 -57
- package/dist/chunk-IQSF6XRV.js +0 -57
- package/dist/chunk-IXGDTAES.js +0 -4
- package/dist/chunk-JB4WG2YJ.cjs +0 -121
- package/dist/chunk-JCEJ4VTN.js +0 -20
- package/dist/chunk-JZ7Z6WC2.cjs +0 -3
- package/dist/chunk-K5XGP57D.cjs +0 -19
- package/dist/chunk-LBLFU6KI.js +0 -57
- package/dist/chunk-LP3HRZGK.js +0 -57
- package/dist/chunk-LPFRMQFQ.js +0 -121
- package/dist/chunk-LYU44UNN.cjs +0 -56
- package/dist/chunk-M75VGFCI.js +0 -3
- package/dist/chunk-MFNN5DYG.cjs +0 -1
- package/dist/chunk-MJAODEFC.cjs +0 -121
- package/dist/chunk-MLCBSEBU.js +0 -2
- package/dist/chunk-MSC4G2HF.cjs +0 -2
- package/dist/chunk-MYHNTJLR.cjs +0 -56
- package/dist/chunk-N2YHO2WI.cjs +0 -3
- package/dist/chunk-N6MNQIQU.js +0 -123
- package/dist/chunk-NPBXLPOP.js +0 -3
- package/dist/chunk-OJ3H4AQ2.cjs +0 -56
- package/dist/chunk-ON5XJEPO.cjs +0 -3
- package/dist/chunk-OPTVCCQQ.cjs +0 -122
- package/dist/chunk-OT2Z4XBD.cjs +0 -1
- package/dist/chunk-PFKVHUOT.js +0 -432
- package/dist/chunk-PFTBTWSC.cjs +0 -1
- package/dist/chunk-PTPVFLET.js +0 -20
- 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-S5HTTLN7.cjs +0 -2
- package/dist/chunk-S73YERS2.js +0 -57
- package/dist/chunk-SMQ6736Y.js +0 -57
- package/dist/chunk-T3DJ3UTP.cjs +0 -121
- package/dist/chunk-TEY5LZ26.cjs +0 -56
- 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-UWVBFRCW.js +0 -2
- package/dist/chunk-UZWYFEUN.js +0 -122
- package/dist/chunk-VI7WCO2J.cjs +0 -3
- package/dist/chunk-VOYPKTID.cjs +0 -1
- 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-XBQ6HV3T.cjs +0 -114
- package/dist/chunk-XIAJQLGS.js +0 -2
- package/dist/chunk-XK6UB77Q.js +0 -4
- package/dist/chunk-XP7BXFXT.cjs +0 -121
- 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-Z2SN2MYP.js +0 -122
- 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-DPLKZQA3.js +0 -1
- package/dist/local-KR3AIGVA.cjs +0 -1
- package/dist/local-S5VA7IXE.cjs +0 -1
- package/dist/local-T7GISZBL.js +0 -1
- package/dist/mongo-auth-adapter-EUHAYWJ6.cjs +0 -1
- package/dist/mongo-auth-adapter-FW7ATYQ6.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/postgres-auth-adapter-SK3N3OSS.js +0 -1
- package/dist/postgres-auth-adapter-ZO6HK5AK.cjs +0 -1
- package/dist/redis-adapter-EGMUN65D.cjs +0 -1
- package/dist/redis-adapter-QPCTMF55.js +0 -1
- package/dist/sqlite-adapter-52PL52VU.js +0 -1
- package/dist/sqlite-adapter-MNNZZXGX.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
package/dist/base-CcZIEll-.d.ts
DELETED
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
import { B as BaseAdapter, C as CollectionConfig, G as GlobalConfig, T as TenantContext, F as FindArgs, b as FindResult, c as FindByIDArgs, d as CreateArgs, U as UpdateArgs, D as DeleteArgs, e as FindOneArgs, f as FindVersionsArgs, V as VersionRecord, g as CreateVersionArgs } from './types-IeKFn7Ky.js';
|
|
2
|
-
import { F as Field, u as RelationshipField, U as UploadField } from './types-B9oXBEKI.js';
|
|
3
|
-
|
|
4
|
-
type AuditAction = "login" | "logout" | "login_failed" | "register" | "verify_email" | "password_change" | "password_reset" | "password_reset_request" | "role_change" | "permission_change" | "document_create" | "document_update" | "document_delete" | "settings_change" | "user_lockout" | "user_unlock" | "user_create" | "user_update" | "user_delete" | "api_request" | "api_key_create" | "api_key_update" | "api_key_rotate" | "api_key_delete" | "tenant_create" | "tenant_delete";
|
|
5
|
-
interface AuditLog {
|
|
6
|
-
id: string;
|
|
7
|
-
timestamp: Date;
|
|
8
|
-
action: AuditAction;
|
|
9
|
-
userId?: string;
|
|
10
|
-
userEmail?: string;
|
|
11
|
-
role?: string;
|
|
12
|
-
resource: string;
|
|
13
|
-
resourceId?: string;
|
|
14
|
-
changes?: {
|
|
15
|
-
field: string;
|
|
16
|
-
old: any;
|
|
17
|
-
new: any;
|
|
18
|
-
}[];
|
|
19
|
-
ipAddress?: string;
|
|
20
|
-
userAgent?: string;
|
|
21
|
-
success: boolean;
|
|
22
|
-
error?: string;
|
|
23
|
-
metadata?: Record<string, any>;
|
|
24
|
-
}
|
|
25
|
-
interface AuditLogFilter {
|
|
26
|
-
userId?: string;
|
|
27
|
-
action?: AuditAction | AuditAction[];
|
|
28
|
-
resource?: string;
|
|
29
|
-
resourceId?: string;
|
|
30
|
-
success?: boolean;
|
|
31
|
-
startDate?: Date;
|
|
32
|
-
endDate?: Date;
|
|
33
|
-
limit?: number;
|
|
34
|
-
offset?: number;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
interface AuthUser {
|
|
38
|
-
id: string;
|
|
39
|
-
name?: string;
|
|
40
|
-
email: string;
|
|
41
|
-
passwordHash?: string;
|
|
42
|
-
role: UserRole;
|
|
43
|
-
avatar?: string;
|
|
44
|
-
tenantId?: string;
|
|
45
|
-
emailVerified?: boolean;
|
|
46
|
-
locked?: boolean;
|
|
47
|
-
lastLogin?: string;
|
|
48
|
-
failedLoginAttempts?: number;
|
|
49
|
-
createdAt: string;
|
|
50
|
-
updatedAt: string;
|
|
51
|
-
}
|
|
52
|
-
type UserRole = "super_admin" | "admin" | "editor" | "author" | "customer" | "guest";
|
|
53
|
-
interface Session {
|
|
54
|
-
id: string;
|
|
55
|
-
userId: string;
|
|
56
|
-
token: string;
|
|
57
|
-
refreshToken?: string;
|
|
58
|
-
expiresAt: string;
|
|
59
|
-
createdAt: string;
|
|
60
|
-
ipAddress?: string;
|
|
61
|
-
userAgent?: string;
|
|
62
|
-
}
|
|
63
|
-
interface JWTPayload {
|
|
64
|
-
sub: string;
|
|
65
|
-
email: string;
|
|
66
|
-
role: UserRole;
|
|
67
|
-
tenantId?: string;
|
|
68
|
-
iat?: number;
|
|
69
|
-
exp?: number;
|
|
70
|
-
sid?: string;
|
|
71
|
-
}
|
|
72
|
-
interface AuthTokenConfig {
|
|
73
|
-
secret: string;
|
|
74
|
-
expiresIn?: string | number;
|
|
75
|
-
refreshExpiresIn?: string | number;
|
|
76
|
-
issuer?: string;
|
|
77
|
-
audience?: string[];
|
|
78
|
-
saltRounds?: number;
|
|
79
|
-
}
|
|
80
|
-
interface LoginCredentials {
|
|
81
|
-
email: string;
|
|
82
|
-
password: string;
|
|
83
|
-
}
|
|
84
|
-
interface RegisterData {
|
|
85
|
-
email: string;
|
|
86
|
-
password: string;
|
|
87
|
-
role?: UserRole;
|
|
88
|
-
tenantId?: string;
|
|
89
|
-
}
|
|
90
|
-
interface AuthResult {
|
|
91
|
-
success: boolean;
|
|
92
|
-
user?: AuthUser;
|
|
93
|
-
session?: Session;
|
|
94
|
-
token?: string;
|
|
95
|
-
error?: string;
|
|
96
|
-
}
|
|
97
|
-
interface AuthAdapter {
|
|
98
|
-
createUser(data: {
|
|
99
|
-
email: string;
|
|
100
|
-
password: string;
|
|
101
|
-
name?: string;
|
|
102
|
-
role?: UserRole;
|
|
103
|
-
avatar?: string;
|
|
104
|
-
tenantId?: string;
|
|
105
|
-
}): Promise<AuthUser>;
|
|
106
|
-
findUserByEmail(email: string): Promise<AuthUser | null>;
|
|
107
|
-
findUserById(id: string): Promise<AuthUser | null>;
|
|
108
|
-
updateUser(id: string, data: Partial<AuthUser> & {
|
|
109
|
-
password?: string;
|
|
110
|
-
}): Promise<AuthUser | null>;
|
|
111
|
-
deleteUser(id: string): Promise<boolean>;
|
|
112
|
-
verifyPassword(email: string, password: string): Promise<AuthUser | null>;
|
|
113
|
-
hashPassword(password: string): Promise<string>;
|
|
114
|
-
createSession(userId: string, data?: {
|
|
115
|
-
ipAddress?: string;
|
|
116
|
-
userAgent?: string;
|
|
117
|
-
}): Promise<Session>;
|
|
118
|
-
findSessionByToken(token: string): Promise<Session | null>;
|
|
119
|
-
findSessionByRefreshToken(refreshToken: string): Promise<Session | null>;
|
|
120
|
-
deleteSession(sessionId: string): Promise<boolean>;
|
|
121
|
-
deleteUserSessions(userId: string): Promise<number>;
|
|
122
|
-
createEmailVerificationToken(userId: string): Promise<{
|
|
123
|
-
token: string;
|
|
124
|
-
expiresAt: Date;
|
|
125
|
-
}>;
|
|
126
|
-
verifyEmailToken(token: string): Promise<{
|
|
127
|
-
success: boolean;
|
|
128
|
-
userId?: string;
|
|
129
|
-
error?: string;
|
|
130
|
-
}>;
|
|
131
|
-
createPasswordResetToken(email: string): Promise<{
|
|
132
|
-
token: string;
|
|
133
|
-
expiresAt: Date;
|
|
134
|
-
error?: string;
|
|
135
|
-
}>;
|
|
136
|
-
resetPasswordWithToken(token: string, newPassword: string): Promise<{
|
|
137
|
-
success: boolean;
|
|
138
|
-
error?: string;
|
|
139
|
-
}>;
|
|
140
|
-
hasAnyUsers?(): Promise<boolean>;
|
|
141
|
-
connect?(): Promise<void>;
|
|
142
|
-
disconnect?(): Promise<void>;
|
|
143
|
-
addPasswordToHistory?(userId: string, passwordHash: string): Promise<void>;
|
|
144
|
-
getPasswordHistory?(userId: string, count?: number): Promise<string[]>;
|
|
145
|
-
isPasswordInHistory?(password: string, userId: string, historyCount?: number): Promise<boolean>;
|
|
146
|
-
findAuditLogs(filter: AuditLogFilter): Promise<{
|
|
147
|
-
logs: AuditLog[];
|
|
148
|
-
total: number;
|
|
149
|
-
}>;
|
|
150
|
-
createAuditLog(data: Omit<AuditLog, "id" | "timestamp">): Promise<AuditLog>;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
declare abstract class AbstractBaseAdapter implements BaseAdapter {
|
|
154
|
-
protected collections: Map<string, CollectionConfig>;
|
|
155
|
-
protected globals: Map<string, GlobalConfig>;
|
|
156
|
-
protected connected: boolean;
|
|
157
|
-
protected tenantContext?: TenantContext;
|
|
158
|
-
abstract connect(): Promise<void>;
|
|
159
|
-
abstract disconnect(): Promise<void>;
|
|
160
|
-
setTenantContext(context: TenantContext | undefined): void;
|
|
161
|
-
getTenantContext(): TenantContext | undefined;
|
|
162
|
-
init(collections: CollectionConfig[], globals?: GlobalConfig[]): Promise<void>;
|
|
163
|
-
abstract find<T>(args: FindArgs): Promise<FindResult<T>>;
|
|
164
|
-
abstract findByID<T>(args: FindByIDArgs): Promise<T | null>;
|
|
165
|
-
abstract create<T>(args: CreateArgs): Promise<T>;
|
|
166
|
-
abstract update<T>(args: UpdateArgs): Promise<T>;
|
|
167
|
-
abstract delete<T>(args: DeleteArgs): Promise<T>;
|
|
168
|
-
abstract count(args: {
|
|
169
|
-
collection: string;
|
|
170
|
-
where?: Record<string, any>;
|
|
171
|
-
tenantId?: string;
|
|
172
|
-
}): Promise<number>;
|
|
173
|
-
abstract findOne(args: FindOneArgs): Promise<any>;
|
|
174
|
-
abstract findVersions(args: FindVersionsArgs): Promise<FindResult<VersionRecord>>;
|
|
175
|
-
abstract findVersionByID(args: {
|
|
176
|
-
collection: string;
|
|
177
|
-
versionId: string;
|
|
178
|
-
tenantId?: string;
|
|
179
|
-
}): Promise<VersionRecord | null>;
|
|
180
|
-
abstract createVersion<T = Record<string, any>>(args: CreateVersionArgs<T>): Promise<VersionRecord<T>>;
|
|
181
|
-
abstract updateLatestVersion<T = Record<string, any>>(args: CreateVersionArgs<T>): Promise<VersionRecord<T>>;
|
|
182
|
-
abstract deleteVersions(args: {
|
|
183
|
-
collection: string;
|
|
184
|
-
documentId: string;
|
|
185
|
-
keepLatest?: number;
|
|
186
|
-
tenantId?: string;
|
|
187
|
-
}): Promise<void>;
|
|
188
|
-
migrate?(): Promise<void>;
|
|
189
|
-
rollback?(): Promise<void>;
|
|
190
|
-
transaction?<T>(fn: (tx: any) => Promise<T>): Promise<T>;
|
|
191
|
-
protected getCollection(slug: string): CollectionConfig;
|
|
192
|
-
protected applyTenantFilter(where?: Record<string, any>, tenantId?: string): Record<string, any>;
|
|
193
|
-
protected getTableName(slug: string): string;
|
|
194
|
-
protected prepareData(data: Record<string, any>, collection: CollectionConfig): Record<string, any>;
|
|
195
|
-
protected processRelationships(data: Record<string, any>, fields: Field[], depth: number): Record<string, any>;
|
|
196
|
-
protected parseSort(sort?: string): {
|
|
197
|
-
field: string;
|
|
198
|
-
direction: 'asc' | 'desc';
|
|
199
|
-
};
|
|
200
|
-
protected calculatePagination(page: number, limit: number, totalDocs: number): {
|
|
201
|
-
totalDocs: number;
|
|
202
|
-
limit: number;
|
|
203
|
-
totalPages: number;
|
|
204
|
-
page: number;
|
|
205
|
-
pagingCounter: number;
|
|
206
|
-
hasPrevPage: boolean;
|
|
207
|
-
hasNextPage: boolean;
|
|
208
|
-
prevPage: number | null;
|
|
209
|
-
nextPage: number | null;
|
|
210
|
-
};
|
|
211
|
-
protected selectFields(data: Record<string, any>, select?: string[]): Record<string, any>;
|
|
212
|
-
protected isRelationshipField(field: Field): field is RelationshipField;
|
|
213
|
-
protected isUploadField(field: Field): field is UploadField;
|
|
214
|
-
protected getRelationshipFields(fields: Field[]): RelationshipField[];
|
|
215
|
-
protected getUploadFields(fields: Field[]): UploadField[];
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
export { type AuditLog as A, type JWTPayload as J, type LoginCredentials as L, type RegisterData as R, type Session as S, type UserRole as U, type AuditLogFilter as a, AbstractBaseAdapter as b, type AuthAdapter as c, type AuthUser as d, type AuthTokenConfig as e, type AuthResult as f, type AuditAction as g };
|
package/dist/base-CyG7aF1e.d.cts
DELETED
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
import { B as BaseAdapter, C as CollectionConfig, G as GlobalConfig, T as TenantContext, F as FindArgs, b as FindResult, c as FindByIDArgs, d as CreateArgs, U as UpdateArgs, D as DeleteArgs, e as FindOneArgs, f as FindVersionsArgs, V as VersionRecord, g as CreateVersionArgs } from './types-B5Qz1svz.cjs';
|
|
2
|
-
import { F as Field, u as RelationshipField, U as UploadField } from './types-DROqAsr0.cjs';
|
|
3
|
-
|
|
4
|
-
type AuditAction = "login" | "logout" | "login_failed" | "register" | "verify_email" | "password_change" | "password_reset" | "password_reset_request" | "role_change" | "permission_change" | "document_create" | "document_update" | "document_delete" | "settings_change" | "user_lockout" | "user_unlock" | "user_create" | "user_update" | "user_delete" | "api_request" | "api_key_create" | "api_key_update" | "api_key_rotate" | "api_key_delete" | "tenant_create" | "tenant_delete";
|
|
5
|
-
interface AuditLog {
|
|
6
|
-
id: string;
|
|
7
|
-
timestamp: Date;
|
|
8
|
-
action: AuditAction;
|
|
9
|
-
userId?: string;
|
|
10
|
-
userEmail?: string;
|
|
11
|
-
role?: string;
|
|
12
|
-
resource: string;
|
|
13
|
-
resourceId?: string;
|
|
14
|
-
changes?: {
|
|
15
|
-
field: string;
|
|
16
|
-
old: any;
|
|
17
|
-
new: any;
|
|
18
|
-
}[];
|
|
19
|
-
ipAddress?: string;
|
|
20
|
-
userAgent?: string;
|
|
21
|
-
success: boolean;
|
|
22
|
-
error?: string;
|
|
23
|
-
metadata?: Record<string, any>;
|
|
24
|
-
}
|
|
25
|
-
interface AuditLogFilter {
|
|
26
|
-
userId?: string;
|
|
27
|
-
action?: AuditAction | AuditAction[];
|
|
28
|
-
resource?: string;
|
|
29
|
-
resourceId?: string;
|
|
30
|
-
success?: boolean;
|
|
31
|
-
startDate?: Date;
|
|
32
|
-
endDate?: Date;
|
|
33
|
-
limit?: number;
|
|
34
|
-
offset?: number;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
interface AuthUser {
|
|
38
|
-
id: string;
|
|
39
|
-
name?: string;
|
|
40
|
-
email: string;
|
|
41
|
-
passwordHash?: string;
|
|
42
|
-
role: UserRole;
|
|
43
|
-
avatar?: string;
|
|
44
|
-
tenantId?: string;
|
|
45
|
-
emailVerified?: boolean;
|
|
46
|
-
locked?: boolean;
|
|
47
|
-
lastLogin?: string;
|
|
48
|
-
failedLoginAttempts?: number;
|
|
49
|
-
createdAt: string;
|
|
50
|
-
updatedAt: string;
|
|
51
|
-
}
|
|
52
|
-
type UserRole = "super_admin" | "admin" | "editor" | "author" | "customer" | "guest";
|
|
53
|
-
interface Session {
|
|
54
|
-
id: string;
|
|
55
|
-
userId: string;
|
|
56
|
-
token: string;
|
|
57
|
-
refreshToken?: string;
|
|
58
|
-
expiresAt: string;
|
|
59
|
-
createdAt: string;
|
|
60
|
-
ipAddress?: string;
|
|
61
|
-
userAgent?: string;
|
|
62
|
-
}
|
|
63
|
-
interface JWTPayload {
|
|
64
|
-
sub: string;
|
|
65
|
-
email: string;
|
|
66
|
-
role: UserRole;
|
|
67
|
-
tenantId?: string;
|
|
68
|
-
iat?: number;
|
|
69
|
-
exp?: number;
|
|
70
|
-
sid?: string;
|
|
71
|
-
}
|
|
72
|
-
interface AuthTokenConfig {
|
|
73
|
-
secret: string;
|
|
74
|
-
expiresIn?: string | number;
|
|
75
|
-
refreshExpiresIn?: string | number;
|
|
76
|
-
issuer?: string;
|
|
77
|
-
audience?: string[];
|
|
78
|
-
saltRounds?: number;
|
|
79
|
-
}
|
|
80
|
-
interface LoginCredentials {
|
|
81
|
-
email: string;
|
|
82
|
-
password: string;
|
|
83
|
-
}
|
|
84
|
-
interface RegisterData {
|
|
85
|
-
email: string;
|
|
86
|
-
password: string;
|
|
87
|
-
role?: UserRole;
|
|
88
|
-
tenantId?: string;
|
|
89
|
-
}
|
|
90
|
-
interface AuthResult {
|
|
91
|
-
success: boolean;
|
|
92
|
-
user?: AuthUser;
|
|
93
|
-
session?: Session;
|
|
94
|
-
token?: string;
|
|
95
|
-
error?: string;
|
|
96
|
-
}
|
|
97
|
-
interface AuthAdapter {
|
|
98
|
-
createUser(data: {
|
|
99
|
-
email: string;
|
|
100
|
-
password: string;
|
|
101
|
-
name?: string;
|
|
102
|
-
role?: UserRole;
|
|
103
|
-
avatar?: string;
|
|
104
|
-
tenantId?: string;
|
|
105
|
-
}): Promise<AuthUser>;
|
|
106
|
-
findUserByEmail(email: string): Promise<AuthUser | null>;
|
|
107
|
-
findUserById(id: string): Promise<AuthUser | null>;
|
|
108
|
-
updateUser(id: string, data: Partial<AuthUser> & {
|
|
109
|
-
password?: string;
|
|
110
|
-
}): Promise<AuthUser | null>;
|
|
111
|
-
deleteUser(id: string): Promise<boolean>;
|
|
112
|
-
verifyPassword(email: string, password: string): Promise<AuthUser | null>;
|
|
113
|
-
hashPassword(password: string): Promise<string>;
|
|
114
|
-
createSession(userId: string, data?: {
|
|
115
|
-
ipAddress?: string;
|
|
116
|
-
userAgent?: string;
|
|
117
|
-
}): Promise<Session>;
|
|
118
|
-
findSessionByToken(token: string): Promise<Session | null>;
|
|
119
|
-
findSessionByRefreshToken(refreshToken: string): Promise<Session | null>;
|
|
120
|
-
deleteSession(sessionId: string): Promise<boolean>;
|
|
121
|
-
deleteUserSessions(userId: string): Promise<number>;
|
|
122
|
-
createEmailVerificationToken(userId: string): Promise<{
|
|
123
|
-
token: string;
|
|
124
|
-
expiresAt: Date;
|
|
125
|
-
}>;
|
|
126
|
-
verifyEmailToken(token: string): Promise<{
|
|
127
|
-
success: boolean;
|
|
128
|
-
userId?: string;
|
|
129
|
-
error?: string;
|
|
130
|
-
}>;
|
|
131
|
-
createPasswordResetToken(email: string): Promise<{
|
|
132
|
-
token: string;
|
|
133
|
-
expiresAt: Date;
|
|
134
|
-
error?: string;
|
|
135
|
-
}>;
|
|
136
|
-
resetPasswordWithToken(token: string, newPassword: string): Promise<{
|
|
137
|
-
success: boolean;
|
|
138
|
-
error?: string;
|
|
139
|
-
}>;
|
|
140
|
-
hasAnyUsers?(): Promise<boolean>;
|
|
141
|
-
connect?(): Promise<void>;
|
|
142
|
-
disconnect?(): Promise<void>;
|
|
143
|
-
addPasswordToHistory?(userId: string, passwordHash: string): Promise<void>;
|
|
144
|
-
getPasswordHistory?(userId: string, count?: number): Promise<string[]>;
|
|
145
|
-
isPasswordInHistory?(password: string, userId: string, historyCount?: number): Promise<boolean>;
|
|
146
|
-
findAuditLogs(filter: AuditLogFilter): Promise<{
|
|
147
|
-
logs: AuditLog[];
|
|
148
|
-
total: number;
|
|
149
|
-
}>;
|
|
150
|
-
createAuditLog(data: Omit<AuditLog, "id" | "timestamp">): Promise<AuditLog>;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
declare abstract class AbstractBaseAdapter implements BaseAdapter {
|
|
154
|
-
protected collections: Map<string, CollectionConfig>;
|
|
155
|
-
protected globals: Map<string, GlobalConfig>;
|
|
156
|
-
protected connected: boolean;
|
|
157
|
-
protected tenantContext?: TenantContext;
|
|
158
|
-
abstract connect(): Promise<void>;
|
|
159
|
-
abstract disconnect(): Promise<void>;
|
|
160
|
-
setTenantContext(context: TenantContext | undefined): void;
|
|
161
|
-
getTenantContext(): TenantContext | undefined;
|
|
162
|
-
init(collections: CollectionConfig[], globals?: GlobalConfig[]): Promise<void>;
|
|
163
|
-
abstract find<T>(args: FindArgs): Promise<FindResult<T>>;
|
|
164
|
-
abstract findByID<T>(args: FindByIDArgs): Promise<T | null>;
|
|
165
|
-
abstract create<T>(args: CreateArgs): Promise<T>;
|
|
166
|
-
abstract update<T>(args: UpdateArgs): Promise<T>;
|
|
167
|
-
abstract delete<T>(args: DeleteArgs): Promise<T>;
|
|
168
|
-
abstract count(args: {
|
|
169
|
-
collection: string;
|
|
170
|
-
where?: Record<string, any>;
|
|
171
|
-
tenantId?: string;
|
|
172
|
-
}): Promise<number>;
|
|
173
|
-
abstract findOne(args: FindOneArgs): Promise<any>;
|
|
174
|
-
abstract findVersions(args: FindVersionsArgs): Promise<FindResult<VersionRecord>>;
|
|
175
|
-
abstract findVersionByID(args: {
|
|
176
|
-
collection: string;
|
|
177
|
-
versionId: string;
|
|
178
|
-
tenantId?: string;
|
|
179
|
-
}): Promise<VersionRecord | null>;
|
|
180
|
-
abstract createVersion<T = Record<string, any>>(args: CreateVersionArgs<T>): Promise<VersionRecord<T>>;
|
|
181
|
-
abstract updateLatestVersion<T = Record<string, any>>(args: CreateVersionArgs<T>): Promise<VersionRecord<T>>;
|
|
182
|
-
abstract deleteVersions(args: {
|
|
183
|
-
collection: string;
|
|
184
|
-
documentId: string;
|
|
185
|
-
keepLatest?: number;
|
|
186
|
-
tenantId?: string;
|
|
187
|
-
}): Promise<void>;
|
|
188
|
-
migrate?(): Promise<void>;
|
|
189
|
-
rollback?(): Promise<void>;
|
|
190
|
-
transaction?<T>(fn: (tx: any) => Promise<T>): Promise<T>;
|
|
191
|
-
protected getCollection(slug: string): CollectionConfig;
|
|
192
|
-
protected applyTenantFilter(where?: Record<string, any>, tenantId?: string): Record<string, any>;
|
|
193
|
-
protected getTableName(slug: string): string;
|
|
194
|
-
protected prepareData(data: Record<string, any>, collection: CollectionConfig): Record<string, any>;
|
|
195
|
-
protected processRelationships(data: Record<string, any>, fields: Field[], depth: number): Record<string, any>;
|
|
196
|
-
protected parseSort(sort?: string): {
|
|
197
|
-
field: string;
|
|
198
|
-
direction: 'asc' | 'desc';
|
|
199
|
-
};
|
|
200
|
-
protected calculatePagination(page: number, limit: number, totalDocs: number): {
|
|
201
|
-
totalDocs: number;
|
|
202
|
-
limit: number;
|
|
203
|
-
totalPages: number;
|
|
204
|
-
page: number;
|
|
205
|
-
pagingCounter: number;
|
|
206
|
-
hasPrevPage: boolean;
|
|
207
|
-
hasNextPage: boolean;
|
|
208
|
-
prevPage: number | null;
|
|
209
|
-
nextPage: number | null;
|
|
210
|
-
};
|
|
211
|
-
protected selectFields(data: Record<string, any>, select?: string[]): Record<string, any>;
|
|
212
|
-
protected isRelationshipField(field: Field): field is RelationshipField;
|
|
213
|
-
protected isUploadField(field: Field): field is UploadField;
|
|
214
|
-
protected getRelationshipFields(fields: Field[]): RelationshipField[];
|
|
215
|
-
protected getUploadFields(fields: Field[]): UploadField[];
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
export { type AuditLog as A, type JWTPayload as J, type LoginCredentials as L, type RegisterData as R, type Session as S, type UserRole as U, type AuditLogFilter as a, AbstractBaseAdapter as b, type AuthAdapter as c, type AuthUser as d, type AuthTokenConfig as e, type AuthResult as f, type AuditAction as g };
|
package/dist/base-DOImeJ-F.d.ts
DELETED
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
import { B as BaseAdapter, C as CollectionConfig, G as GlobalConfig, T as TenantContext, F as FindArgs, b as FindResult, c as FindByIDArgs, d as CreateArgs, U as UpdateArgs, D as DeleteArgs, e as FindOneArgs, f as FindVersionsArgs, V as VersionRecord, g as CreateVersionArgs } from './types-Bt2_ycUO.js';
|
|
2
|
-
import { F as Field, s as RelationshipField, U as UploadField } from './types-DlGSbh7I.js';
|
|
3
|
-
|
|
4
|
-
type AuditAction = "login" | "logout" | "login_failed" | "register" | "verify_email" | "password_change" | "password_reset" | "password_reset_request" | "role_change" | "permission_change" | "document_create" | "document_update" | "document_delete" | "settings_change" | "user_lockout" | "user_unlock" | "user_create" | "user_update" | "user_delete" | "api_request" | "api_key_create" | "api_key_update" | "api_key_rotate" | "api_key_delete" | "tenant_create" | "tenant_delete";
|
|
5
|
-
interface AuditLog {
|
|
6
|
-
id: string;
|
|
7
|
-
timestamp: Date;
|
|
8
|
-
action: AuditAction;
|
|
9
|
-
userId?: string;
|
|
10
|
-
userEmail?: string;
|
|
11
|
-
role?: string;
|
|
12
|
-
resource: string;
|
|
13
|
-
resourceId?: string;
|
|
14
|
-
changes?: {
|
|
15
|
-
field: string;
|
|
16
|
-
old: any;
|
|
17
|
-
new: any;
|
|
18
|
-
}[];
|
|
19
|
-
ipAddress?: string;
|
|
20
|
-
userAgent?: string;
|
|
21
|
-
success: boolean;
|
|
22
|
-
error?: string;
|
|
23
|
-
metadata?: Record<string, any>;
|
|
24
|
-
}
|
|
25
|
-
interface AuditLogFilter {
|
|
26
|
-
userId?: string;
|
|
27
|
-
action?: AuditAction | AuditAction[];
|
|
28
|
-
resource?: string;
|
|
29
|
-
resourceId?: string;
|
|
30
|
-
success?: boolean;
|
|
31
|
-
startDate?: Date;
|
|
32
|
-
endDate?: Date;
|
|
33
|
-
limit?: number;
|
|
34
|
-
offset?: number;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
interface AuthUser {
|
|
38
|
-
id: string;
|
|
39
|
-
name?: string;
|
|
40
|
-
email: string;
|
|
41
|
-
passwordHash?: string;
|
|
42
|
-
role: UserRole;
|
|
43
|
-
avatar?: string;
|
|
44
|
-
tenantId?: string;
|
|
45
|
-
emailVerified?: boolean;
|
|
46
|
-
locked?: boolean;
|
|
47
|
-
lastLogin?: string;
|
|
48
|
-
failedLoginAttempts?: number;
|
|
49
|
-
createdAt: string;
|
|
50
|
-
updatedAt: string;
|
|
51
|
-
}
|
|
52
|
-
type UserRole = "super_admin" | "admin" | "editor" | "author" | "customer" | "guest";
|
|
53
|
-
interface Session {
|
|
54
|
-
id: string;
|
|
55
|
-
userId: string;
|
|
56
|
-
token: string;
|
|
57
|
-
refreshToken?: string;
|
|
58
|
-
expiresAt: string;
|
|
59
|
-
createdAt: string;
|
|
60
|
-
ipAddress?: string;
|
|
61
|
-
userAgent?: string;
|
|
62
|
-
}
|
|
63
|
-
interface JWTPayload {
|
|
64
|
-
sub: string;
|
|
65
|
-
email: string;
|
|
66
|
-
role: UserRole;
|
|
67
|
-
tenantId?: string;
|
|
68
|
-
iat?: number;
|
|
69
|
-
exp?: number;
|
|
70
|
-
sid?: string;
|
|
71
|
-
}
|
|
72
|
-
interface AuthTokenConfig {
|
|
73
|
-
secret: string;
|
|
74
|
-
expiresIn?: string | number;
|
|
75
|
-
refreshExpiresIn?: string | number;
|
|
76
|
-
issuer?: string;
|
|
77
|
-
audience?: string[];
|
|
78
|
-
saltRounds?: number;
|
|
79
|
-
}
|
|
80
|
-
interface LoginCredentials {
|
|
81
|
-
email: string;
|
|
82
|
-
password: string;
|
|
83
|
-
}
|
|
84
|
-
interface RegisterData {
|
|
85
|
-
email: string;
|
|
86
|
-
password: string;
|
|
87
|
-
role?: UserRole;
|
|
88
|
-
tenantId?: string;
|
|
89
|
-
}
|
|
90
|
-
interface AuthResult {
|
|
91
|
-
success: boolean;
|
|
92
|
-
user?: AuthUser;
|
|
93
|
-
session?: Session;
|
|
94
|
-
token?: string;
|
|
95
|
-
error?: string;
|
|
96
|
-
}
|
|
97
|
-
interface AuthAdapter {
|
|
98
|
-
createUser(data: {
|
|
99
|
-
email: string;
|
|
100
|
-
password: string;
|
|
101
|
-
name?: string;
|
|
102
|
-
role?: UserRole;
|
|
103
|
-
avatar?: string;
|
|
104
|
-
tenantId?: string;
|
|
105
|
-
}): Promise<AuthUser>;
|
|
106
|
-
findUserByEmail(email: string): Promise<AuthUser | null>;
|
|
107
|
-
findUserById(id: string): Promise<AuthUser | null>;
|
|
108
|
-
updateUser(id: string, data: Partial<AuthUser> & {
|
|
109
|
-
password?: string;
|
|
110
|
-
}): Promise<AuthUser | null>;
|
|
111
|
-
deleteUser(id: string): Promise<boolean>;
|
|
112
|
-
verifyPassword(email: string, password: string): Promise<AuthUser | null>;
|
|
113
|
-
hashPassword(password: string): Promise<string>;
|
|
114
|
-
createSession(userId: string, data?: {
|
|
115
|
-
ipAddress?: string;
|
|
116
|
-
userAgent?: string;
|
|
117
|
-
}): Promise<Session>;
|
|
118
|
-
findSessionByToken(token: string): Promise<Session | null>;
|
|
119
|
-
findSessionByRefreshToken(refreshToken: string): Promise<Session | null>;
|
|
120
|
-
deleteSession(sessionId: string): Promise<boolean>;
|
|
121
|
-
deleteUserSessions(userId: string): Promise<number>;
|
|
122
|
-
createEmailVerificationToken(userId: string): Promise<{
|
|
123
|
-
token: string;
|
|
124
|
-
expiresAt: Date;
|
|
125
|
-
}>;
|
|
126
|
-
verifyEmailToken(token: string): Promise<{
|
|
127
|
-
success: boolean;
|
|
128
|
-
userId?: string;
|
|
129
|
-
error?: string;
|
|
130
|
-
}>;
|
|
131
|
-
createPasswordResetToken(email: string): Promise<{
|
|
132
|
-
token: string;
|
|
133
|
-
expiresAt: Date;
|
|
134
|
-
error?: string;
|
|
135
|
-
}>;
|
|
136
|
-
resetPasswordWithToken(token: string, newPassword: string): Promise<{
|
|
137
|
-
success: boolean;
|
|
138
|
-
error?: string;
|
|
139
|
-
}>;
|
|
140
|
-
hasAnyUsers?(): Promise<boolean>;
|
|
141
|
-
connect?(): Promise<void>;
|
|
142
|
-
disconnect?(): Promise<void>;
|
|
143
|
-
addPasswordToHistory?(userId: string, passwordHash: string): Promise<void>;
|
|
144
|
-
getPasswordHistory?(userId: string, count?: number): Promise<string[]>;
|
|
145
|
-
isPasswordInHistory?(password: string, userId: string, historyCount?: number): Promise<boolean>;
|
|
146
|
-
findAuditLogs(filter: AuditLogFilter): Promise<{
|
|
147
|
-
logs: AuditLog[];
|
|
148
|
-
total: number;
|
|
149
|
-
}>;
|
|
150
|
-
createAuditLog(data: Omit<AuditLog, "id" | "timestamp">): Promise<AuditLog>;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
declare abstract class AbstractBaseAdapter implements BaseAdapter {
|
|
154
|
-
protected collections: Map<string, CollectionConfig>;
|
|
155
|
-
protected globals: Map<string, GlobalConfig>;
|
|
156
|
-
protected connected: boolean;
|
|
157
|
-
protected tenantContext?: TenantContext;
|
|
158
|
-
abstract connect(): Promise<void>;
|
|
159
|
-
abstract disconnect(): Promise<void>;
|
|
160
|
-
setTenantContext(context: TenantContext | undefined): void;
|
|
161
|
-
getTenantContext(): TenantContext | undefined;
|
|
162
|
-
init(collections: CollectionConfig[], globals?: GlobalConfig[]): Promise<void>;
|
|
163
|
-
abstract find<T>(args: FindArgs): Promise<FindResult<T>>;
|
|
164
|
-
abstract findByID<T>(args: FindByIDArgs): Promise<T | null>;
|
|
165
|
-
abstract create<T>(args: CreateArgs): Promise<T>;
|
|
166
|
-
abstract update<T>(args: UpdateArgs): Promise<T>;
|
|
167
|
-
abstract delete<T>(args: DeleteArgs): Promise<T>;
|
|
168
|
-
abstract count(args: {
|
|
169
|
-
collection: string;
|
|
170
|
-
where?: Record<string, any>;
|
|
171
|
-
tenantId?: string;
|
|
172
|
-
}): Promise<number>;
|
|
173
|
-
abstract findOne(args: FindOneArgs): Promise<any>;
|
|
174
|
-
abstract findVersions(args: FindVersionsArgs): Promise<FindResult<VersionRecord>>;
|
|
175
|
-
abstract findVersionByID(args: {
|
|
176
|
-
collection: string;
|
|
177
|
-
versionId: string;
|
|
178
|
-
tenantId?: string;
|
|
179
|
-
}): Promise<VersionRecord | null>;
|
|
180
|
-
abstract createVersion<T = Record<string, any>>(args: CreateVersionArgs<T>): Promise<VersionRecord<T>>;
|
|
181
|
-
abstract updateLatestVersion<T = Record<string, any>>(args: CreateVersionArgs<T>): Promise<VersionRecord<T>>;
|
|
182
|
-
abstract deleteVersions(args: {
|
|
183
|
-
collection: string;
|
|
184
|
-
documentId: string;
|
|
185
|
-
keepLatest?: number;
|
|
186
|
-
tenantId?: string;
|
|
187
|
-
}): Promise<void>;
|
|
188
|
-
migrate?(): Promise<void>;
|
|
189
|
-
rollback?(): Promise<void>;
|
|
190
|
-
transaction?<T>(fn: (tx: any) => Promise<T>): Promise<T>;
|
|
191
|
-
protected getCollection(slug: string): CollectionConfig;
|
|
192
|
-
protected applyTenantFilter(where?: Record<string, any>, tenantId?: string): Record<string, any>;
|
|
193
|
-
protected getTableName(slug: string): string;
|
|
194
|
-
protected prepareData(data: Record<string, any>, collection: CollectionConfig): Record<string, any>;
|
|
195
|
-
protected processRelationships(data: Record<string, any>, fields: Field[], depth: number): Record<string, any>;
|
|
196
|
-
protected parseSort(sort?: string): {
|
|
197
|
-
field: string;
|
|
198
|
-
direction: 'asc' | 'desc';
|
|
199
|
-
};
|
|
200
|
-
protected calculatePagination(page: number, limit: number, totalDocs: number): {
|
|
201
|
-
totalDocs: number;
|
|
202
|
-
limit: number;
|
|
203
|
-
totalPages: number;
|
|
204
|
-
page: number;
|
|
205
|
-
pagingCounter: number;
|
|
206
|
-
hasPrevPage: boolean;
|
|
207
|
-
hasNextPage: boolean;
|
|
208
|
-
prevPage: number | null;
|
|
209
|
-
nextPage: number | null;
|
|
210
|
-
};
|
|
211
|
-
protected selectFields(data: Record<string, any>, select?: string[]): Record<string, any>;
|
|
212
|
-
protected isRelationshipField(field: Field): field is RelationshipField;
|
|
213
|
-
protected isUploadField(field: Field): field is UploadField;
|
|
214
|
-
protected getRelationshipFields(fields: Field[]): RelationshipField[];
|
|
215
|
-
protected getUploadFields(fields: Field[]): UploadField[];
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
export { type AuditLog as A, type JWTPayload as J, type LoginCredentials as L, type RegisterData as R, type Session as S, type UserRole as U, type AuditLogFilter as a, AbstractBaseAdapter as b, type AuthAdapter as c, type AuthUser as d, type AuthTokenConfig as e, type AuthResult as f, type AuditAction as g };
|