@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
package/dist/chunk-ZWDBPEXL.js
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import {a as a$1,d,j,k,e as e$1,h,i}from'./chunk-47CXBWMA.js';import {n,M,p,s}from'./chunk-HRAY65XH.js';import {J}from'./chunk-3NSZZCOJ.js';import {a}from'./chunk-7NH7H3WA.js';import {g,e}from'./chunk-Y2YAKDEQ.js';import {randomBytes}from'crypto';if (typeof window === "undefined") { const { createRequire } = await import(/* @vite-ignore */ 'module'); createRequire(import.meta.url); }
|
|
2
|
-
g();var R=e(a(),1);var S=false,_=class{db;prefix;sessionTTL;refreshTokenTTL;constructor(e){this.db=e.db,this.prefix=e.prefix||"kyro:",this.sessionTTL=e.sessionTTL||86400,this.refreshTokenTTL=e.refreshTokenTTL||604800;}async connect(){S||(await this.db.execute(J`
|
|
3
|
-
CREATE TABLE IF NOT EXISTS "users" (
|
|
4
|
-
"id" UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
5
|
-
"name" VARCHAR(255),
|
|
6
|
-
"email" VARCHAR(255) NOT NULL,
|
|
7
|
-
"password_hash" VARCHAR(255),
|
|
8
|
-
"role" VARCHAR(50) NOT NULL DEFAULT 'customer',
|
|
9
|
-
"tenant_id" UUID,
|
|
10
|
-
"email_verified" BOOLEAN DEFAULT false,
|
|
11
|
-
"locked" BOOLEAN DEFAULT false,
|
|
12
|
-
"last_login" TIMESTAMP,
|
|
13
|
-
"failed_login_attempts" INTEGER DEFAULT 0,
|
|
14
|
-
"metadata" JSONB,
|
|
15
|
-
"avatar" VARCHAR(255),
|
|
16
|
-
"created_at" TIMESTAMP NOT NULL DEFAULT NOW(),
|
|
17
|
-
"updated_at" TIMESTAMP NOT NULL DEFAULT NOW()
|
|
18
|
-
)
|
|
19
|
-
`),await this.db.execute(J`ALTER TABLE "users" ADD COLUMN IF NOT EXISTS "avatar" VARCHAR(255)`),await this.db.execute(J`CREATE UNIQUE INDEX IF NOT EXISTS "users_email_idx" ON "users" ("email")`),await this.db.execute(J`CREATE INDEX IF NOT EXISTS "users_tenant_idx" ON "users" ("tenant_id")`),await this.db.execute(J`CREATE INDEX IF NOT EXISTS "users_role_idx" ON "users" ("role")`),await this.db.execute(J`
|
|
20
|
-
CREATE TABLE IF NOT EXISTS "sessions" (
|
|
21
|
-
"id" UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
22
|
-
"user_id" UUID NOT NULL REFERENCES "users"("id") ON DELETE CASCADE,
|
|
23
|
-
"token" VARCHAR(512) NOT NULL UNIQUE,
|
|
24
|
-
"refresh_token" VARCHAR(512),
|
|
25
|
-
"ip_address" VARCHAR(45),
|
|
26
|
-
"user_agent" TEXT,
|
|
27
|
-
"expires_at" TIMESTAMP NOT NULL,
|
|
28
|
-
"created_at" TIMESTAMP NOT NULL DEFAULT NOW()
|
|
29
|
-
)
|
|
30
|
-
`),await this.db.execute(J`CREATE INDEX IF NOT EXISTS "sessions_user_idx" ON "sessions" ("user_id")`),await this.db.execute(J`CREATE INDEX IF NOT EXISTS "sessions_token_idx" ON "sessions" ("token")`),await this.db.execute(J`CREATE INDEX IF NOT EXISTS "sessions_expires_idx" ON "sessions" ("expires_at")`),await this.db.execute(J`
|
|
31
|
-
CREATE TABLE IF NOT EXISTS "audit_logs" (
|
|
32
|
-
"id" UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
33
|
-
"action" VARCHAR(100) NOT NULL,
|
|
34
|
-
"user_id" UUID REFERENCES "users"("id") ON DELETE SET NULL,
|
|
35
|
-
"user_email" VARCHAR(255),
|
|
36
|
-
"role" VARCHAR(50),
|
|
37
|
-
"resource" VARCHAR(100) NOT NULL,
|
|
38
|
-
"resource_id" VARCHAR(255),
|
|
39
|
-
"changes" JSONB,
|
|
40
|
-
"ip_address" VARCHAR(45),
|
|
41
|
-
"user_agent" TEXT,
|
|
42
|
-
"success" BOOLEAN NOT NULL DEFAULT true,
|
|
43
|
-
"error" TEXT,
|
|
44
|
-
"metadata" JSONB,
|
|
45
|
-
"timestamp" TIMESTAMP NOT NULL DEFAULT NOW()
|
|
46
|
-
)
|
|
47
|
-
`),await this.db.execute(J`ALTER TABLE "audit_logs" ALTER COLUMN "resource_id" TYPE VARCHAR(255)`),await this.db.execute(J`CREATE INDEX IF NOT EXISTS "audit_logs_user_idx" ON "audit_logs" ("user_id")`),await this.db.execute(J`CREATE INDEX IF NOT EXISTS "audit_logs_action_idx" ON "audit_logs" ("action")`),await this.db.execute(J`CREATE INDEX IF NOT EXISTS "audit_logs_resource_idx" ON "audit_logs" ("resource")`),await this.db.execute(J`CREATE INDEX IF NOT EXISTS "audit_logs_timestamp_idx" ON "audit_logs" ("timestamp")`),await this.db.execute(J`
|
|
48
|
-
CREATE TABLE IF NOT EXISTS "password_history" (
|
|
49
|
-
"id" UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
50
|
-
"user_id" UUID NOT NULL REFERENCES "users"("id") ON DELETE CASCADE,
|
|
51
|
-
"password_hash" VARCHAR(255) NOT NULL,
|
|
52
|
-
"created_at" TIMESTAMP NOT NULL DEFAULT NOW()
|
|
53
|
-
)
|
|
54
|
-
`),await this.db.execute(J`CREATE INDEX IF NOT EXISTS "password_history_user_idx" ON "password_history" ("user_id")`),await this.db.execute(J`
|
|
55
|
-
CREATE TABLE IF NOT EXISTS "lockouts" (
|
|
56
|
-
"id" UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
57
|
-
"user_id" UUID NOT NULL REFERENCES "users"("id") ON DELETE CASCADE,
|
|
58
|
-
"ip_address" VARCHAR(45),
|
|
59
|
-
"reason" VARCHAR(255),
|
|
60
|
-
"locked_until" TIMESTAMP NOT NULL,
|
|
61
|
-
"released_at" TIMESTAMP,
|
|
62
|
-
"created_at" TIMESTAMP NOT NULL DEFAULT NOW()
|
|
63
|
-
)
|
|
64
|
-
`),await this.db.execute(J`CREATE INDEX IF NOT EXISTS "lockouts_user_idx" ON "lockouts" ("user_id")`),await this.db.execute(J`CREATE INDEX IF NOT EXISTS "lockouts_locked_until_idx" ON "lockouts" ("locked_until")`),await this.db.execute(J`
|
|
65
|
-
CREATE TABLE IF NOT EXISTS "roles" (
|
|
66
|
-
"id" UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
67
|
-
"name" VARCHAR(100) NOT NULL UNIQUE,
|
|
68
|
-
"level" INTEGER NOT NULL DEFAULT 0,
|
|
69
|
-
"inherits" TEXT[],
|
|
70
|
-
"description" TEXT,
|
|
71
|
-
"permissions" JSONB DEFAULT '[]',
|
|
72
|
-
"is_system" BOOLEAN DEFAULT false,
|
|
73
|
-
"created_at" TIMESTAMP NOT NULL DEFAULT NOW(),
|
|
74
|
-
"updated_at" TIMESTAMP NOT NULL DEFAULT NOW()
|
|
75
|
-
)
|
|
76
|
-
`),await this.db.execute(J`CREATE INDEX IF NOT EXISTS "roles_level_idx" ON "roles" ("level")`),await this.db.execute(J`
|
|
77
|
-
CREATE TABLE IF NOT EXISTS "tenants" (
|
|
78
|
-
"id" UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
79
|
-
"name" VARCHAR(255) NOT NULL,
|
|
80
|
-
"slug" VARCHAR(100) NOT NULL UNIQUE,
|
|
81
|
-
"settings" JSONB DEFAULT '{}',
|
|
82
|
-
"is_active" BOOLEAN DEFAULT true,
|
|
83
|
-
"created_at" TIMESTAMP NOT NULL DEFAULT NOW(),
|
|
84
|
-
"updated_at" TIMESTAMP NOT NULL DEFAULT NOW()
|
|
85
|
-
)
|
|
86
|
-
`),await this.db.execute(J`
|
|
87
|
-
CREATE TABLE IF NOT EXISTS "api_keys" (
|
|
88
|
-
"id" UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
89
|
-
"user_id" UUID NOT NULL REFERENCES "users"("id") ON DELETE CASCADE,
|
|
90
|
-
"name" VARCHAR(255) NOT NULL,
|
|
91
|
-
"key" VARCHAR(64) NOT NULL UNIQUE,
|
|
92
|
-
"key_prefix" VARCHAR(8) NOT NULL,
|
|
93
|
-
"permissions" JSONB DEFAULT '[]',
|
|
94
|
-
"last_used_at" TIMESTAMP,
|
|
95
|
-
"expires_at" TIMESTAMP,
|
|
96
|
-
"created_at" TIMESTAMP NOT NULL DEFAULT NOW()
|
|
97
|
-
)
|
|
98
|
-
`),await this.db.execute(J`
|
|
99
|
-
CREATE TABLE IF NOT EXISTS "email_verifications" (
|
|
100
|
-
"id" UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
101
|
-
"user_id" UUID NOT NULL REFERENCES "users"("id") ON DELETE CASCADE,
|
|
102
|
-
"token" VARCHAR(64) NOT NULL UNIQUE,
|
|
103
|
-
"expires_at" TIMESTAMP NOT NULL,
|
|
104
|
-
"created_at" TIMESTAMP NOT NULL DEFAULT NOW()
|
|
105
|
-
)
|
|
106
|
-
`),await this.db.execute(J`
|
|
107
|
-
CREATE TABLE IF NOT EXISTS "password_resets" (
|
|
108
|
-
"id" UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
109
|
-
"user_id" UUID NOT NULL REFERENCES "users"("id") ON DELETE CASCADE,
|
|
110
|
-
"token" VARCHAR(64) NOT NULL UNIQUE,
|
|
111
|
-
"expires_at" TIMESTAMP NOT NULL,
|
|
112
|
-
"used_at" TIMESTAMP,
|
|
113
|
-
"created_at" TIMESTAMP NOT NULL DEFAULT NOW()
|
|
114
|
-
)
|
|
115
|
-
`),S=true);}async disconnect(){}async createUser(e){let s=await this.hashPassword(e.password),[t]=await this.db.insert(a$1).values({email:e.email.toLowerCase(),name:e.name,passwordHash:s,role:e.role||"customer",avatar:e.avatar,tenantId:e.tenantId,emailVerified:e.emailVerified??true}).returning();return this.userToAuthUser(t)}async findUserByEmail(e){let[s]=await this.db.select().from(a$1).where(n(a$1.email,e.toLowerCase())).limit(1);return s?this.userToAuthUser(s):null}async findUserById(e){let[s]=await this.db.select().from(a$1).where(n(a$1.id,e)).limit(1);return s?this.userToAuthUser(s):null}async updateUser(e,s){let t={updatedAt:new Date};s.name!==void 0&&(t.name=s.name),s.email!==void 0&&(t.email=s.email),s.passwordHash!==void 0&&(t.passwordHash=s.passwordHash),s.role!==void 0&&(t.role=s.role),s.tenantId!==void 0&&(t.tenantId=s.tenantId),s.avatar!==void 0&&(t.avatar=s.avatar),s.emailVerified!==void 0&&(t.emailVerified=s.emailVerified),s.locked!==void 0&&(t.locked=s.locked),s.lastLogin!==void 0&&(t.lastLogin=s.lastLogin?new Date(s.lastLogin):null),s.failedLoginAttempts!==void 0&&(t.failedLoginAttempts=s.failedLoginAttempts);let[r]=await this.db.update(a$1).set(t).where(n(a$1.id,e)).returning();return r?this.userToAuthUser(r):null}async deleteUser(e){return await this.db.delete(a$1).where(n(a$1.id,e)),true}async findUsers(e={}){let s=e.page??1,t=e.limit??10,r=(s-1)*t,u=e.search;if(u){let m=`%${u}%`,[w,[{count:p}]]=await Promise.all([this.db.select().from(a$1).where(J`${a$1.email} ILIKE ${m}`).orderBy(M(a$1.createdAt)).limit(t).offset(r),this.db.select({count:J`count(*)`}).from(a$1).where(J`${a$1.email} ILIKE ${m}`)]);return {users:w.map(T=>this.userToAuthUser(T)),total:Number(p)}}let[c,[{count:E}]]=await Promise.all([this.db.select().from(a$1).orderBy(M(a$1.createdAt)).limit(t).offset(r),this.db.select({count:J`count(*)`}).from(a$1)]);return {users:c.map(m=>this.userToAuthUser(m)),total:Number(E)}}async verifyPassword(e,s){let t=await this.findUserByEmail(e);if(!t)return null;let[r]=await this.db.select().from(a$1).where(n(a$1.email,e.toLowerCase())).limit(1);return r?.passwordHash&&await R.default.compare(s,r.passwordHash)?t:null}async hashPassword(e){return R.default.hash(e,12)}async createSession(e,s){let t=randomBytes(32).toString("base64url"),r=randomBytes(32).toString("base64url"),u=new Date(Date.now()+this.sessionTTL*1e3);new Date(Date.now()+this.refreshTokenTTL*1e3);let [E]=await this.db.insert(d).values({userId:e,token:t,refreshToken:r,ipAddress:s?.ipAddress,userAgent:s?.userAgent,expiresAt:u}).returning();return this.sessionToSession(E)}async findSessionByToken(e){let[s$1]=await this.db.select().from(d).where(p(n(d.token,e),s(d.expiresAt,new Date))).limit(1);return s$1?this.sessionToSession(s$1):null}async findSessionByRefreshToken(e){let[s$1]=await this.db.select().from(d).where(p(n(d.refreshToken,e),s(d.expiresAt,new Date))).limit(1);return s$1?this.sessionToSession(s$1):null}async deleteSession(e){return await this.db.delete(d).where(n(d.id,e)),true}async deleteUserSessions(e){return await this.db.delete(d).where(n(d.userId,e)),1}async addPasswordToHistory(e,s){await this.db.insert(j).values({userId:e,passwordHash:s});}async getPasswordHistory(e,s=5){return (await this.db.select({passwordHash:j.passwordHash}).from(j).where(n(j.userId,e)).orderBy(M(j.createdAt)).limit(s)).map(r=>r.passwordHash)}async isPasswordInHistory(e,s,t=5){let r=await this.getPasswordHistory(s,t);for(let u of r)if(await this.verifyPassword(e,u))return true;return false}async isLocked(e){let[s$1]=await this.db.select().from(k).where(p(n(k.userId,e),s(k.lockedUntil,new Date))).limit(1);return !!s$1}async getLockout(e){let[s$1]=await this.db.select().from(k).where(p(n(k.userId,e),s(k.lockedUntil,new Date))).limit(1);return s$1?{lockedUntil:s$1.lockedUntil}:null}async recordFailedAttempt(e,s){let r=((await this.findUserById(e))?.failedLoginAttempts||0)+1;await this.updateUser(e,{failedLoginAttempts:r});let c=r>=5;return c&&await this.db.insert(k).values({userId:e,ipAddress:s,reason:"Too many failed login attempts",lockedUntil:new Date(Date.now()+9e5)}),{attempts:r,locked:c}}async resetAttempts(e){await this.updateUser(e,{failedLoginAttempts:0});}async findAuditLogs(e){let{limit:s=50,offset:t=0,userId:r,action:u,resource:c,resourceId:E,success:m,startDate:w,endDate:p$1}=e,T=[];r&&T.push(n(e$1.userId,r)),u&&(Array.isArray(u)?T.push(J`${e$1.action} = ANY(${u})`):T.push(n(e$1.action,u))),c&&T.push(n(e$1.resource,c)),E&&T.push(n(e$1.resourceId,E)),m!==void 0&&T.push(n(e$1.success,m)),w&&T.push(J`${e$1.timestamp} >= ${w}`),p$1&&T.push(J`${e$1.timestamp} <= ${p$1}`);let O=T.length>0?p(...T):void 0,b=await this.db.select({count:J`count(*)`}).from(e$1).where(O);return {logs:(await this.db.select().from(e$1).where(O).orderBy(M(e$1.timestamp)).limit(s).offset(t)).map(o=>({id:o.id,timestamp:o.timestamp,action:o.action,userId:o.userId||void 0,userEmail:o.userEmail||void 0,role:o.role||void 0,resource:o.resource,resourceId:o.resourceId||void 0,changes:o.changes||void 0,ipAddress:o.ipAddress||void 0,userAgent:o.userAgent||void 0,success:o.success,error:o.error||void 0,metadata:o.metadata||void 0})),total:Number(b[0]?.count||0)}}async createAuditLog(e){let s=crypto.randomUUID(),t=new Date;return await this.db.insert(e$1).values({id:s,action:e.action,userId:e.userId??null,userEmail:e.userEmail??null,role:e.role??null,resource:e.resource,resourceId:e.resourceId??null,changes:e.changes??null,ipAddress:e.ipAddress??null,userAgent:e.userAgent??null,success:e.success,error:e.error??null,metadata:e.metadata??null,timestamp:t}),{...e,id:s,timestamp:t}}userToAuthUser(e){return {id:e.id,name:e.name||void 0,email:e.email,passwordHash:e.passwordHash||void 0,role:e.role,avatar:e.avatar&&typeof e.avatar=="object"?e.avatar.id||void 0:e.avatar||void 0,tenantId:e.tenantId||void 0,emailVerified:e.emailVerified||false,locked:e.locked||false,lastLogin:e.lastLogin?new Date(e.lastLogin).toISOString():void 0,failedLoginAttempts:e.failedLoginAttempts||0,createdAt:new Date(e.createdAt).toISOString(),updatedAt:new Date(e.updatedAt).toISOString()}}sessionToSession(e){return {id:e.id,userId:e.userId,token:e.token,refreshToken:e.refreshToken||void 0,expiresAt:new Date(e.expiresAt).toISOString(),createdAt:new Date(e.createdAt).toISOString(),ipAddress:e.ipAddress||void 0,userAgent:e.userAgent||void 0}}async createEmailVerificationToken(e){let s=randomBytes(32).toString("hex"),t=new Date(Date.now()+1440*60*1e3);return await this.db.insert(h).values({userId:e,token:s,expiresAt:t}),{token:s,expiresAt:t}}async verifyEmailToken(e){let[s]=await this.db.select().from(h).where(n(h.token,e)).limit(1);return s?s.expiresAt<new Date?{success:false,error:"Verification token has expired"}:(await this.db.update(a$1).set({emailVerified:true}).where(n(a$1.id,s.userId)),await this.db.delete(h).where(n(h.id,s.id)),{success:true,userId:s.userId}):{success:false,error:"Invalid verification token"}}async createPasswordResetToken(e){let s=await this.findUserByEmail(e);if(!s)return {token:"",expiresAt:new Date,error:"User not found"};let t=randomBytes(32).toString("hex"),r=new Date(Date.now()+3600*1e3);return await this.db.insert(i).values({userId:s.id,token:t,expiresAt:r}),{token:t,expiresAt:r}}async resetPasswordWithToken(e,s){let[t]=await this.db.select().from(i).where(n(i.token,e)).limit(1);if(!t)return {success:false,error:"Invalid reset token"};if(t.expiresAt<new Date)return {success:false,error:"Reset token has expired"};if(t.usedAt)return {success:false,error:"Reset token has already been used"};let r=await this.hashPassword(s);return await this.db.update(a$1).set({passwordHash:r,updatedAt:new Date}).where(n(a$1.id,t.userId)),await this.db.update(i).set({usedAt:new Date}).where(n(i.id,t.id)),await this.db.delete(d).where(n(d.userId,t.userId)),{success:true}}};export{_ as a};
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { S as StorageConfig, a as StorageProvider, C as CollectionConfig, G as GlobalConfig, K as KyroPlugin } from './types-DsF64Wrc.cjs';
|
|
2
|
-
import { F as Field } from './types-DlGSbh7I.cjs';
|
|
3
|
-
import { ZodTypeAny } from 'zod';
|
|
4
|
-
|
|
5
|
-
interface StorageProviderRegistration {
|
|
6
|
-
type: string;
|
|
7
|
-
displayName: string;
|
|
8
|
-
pluginName?: string;
|
|
9
|
-
configFields: Field[];
|
|
10
|
-
configKey?: string;
|
|
11
|
-
extractConfig: (storageConfig: StorageConfig, configKey: string) => any;
|
|
12
|
-
extractRawConfig: (config: any) => any;
|
|
13
|
-
factory: (config: any) => StorageProvider;
|
|
14
|
-
}
|
|
15
|
-
declare class StorageProviderRegistry {
|
|
16
|
-
private providers;
|
|
17
|
-
private providerToPlugin;
|
|
18
|
-
private disabledPlugins;
|
|
19
|
-
constructor();
|
|
20
|
-
private registerLocal;
|
|
21
|
-
private registerImgix;
|
|
22
|
-
private registerBunny;
|
|
23
|
-
private registerCloudflareR2;
|
|
24
|
-
private registerCloudflareS3;
|
|
25
|
-
register(registration: StorageProviderRegistration): void;
|
|
26
|
-
unregister(type: string): void;
|
|
27
|
-
get(type: string): StorageProviderRegistration | undefined;
|
|
28
|
-
getAll(): StorageProviderRegistration[];
|
|
29
|
-
getAllAvailable(isPluginEnabled?: (name: string) => boolean): StorageProviderRegistration[];
|
|
30
|
-
has(type: string): boolean;
|
|
31
|
-
resolve(type: string, storageConfig: StorageConfig): Promise<StorageProvider>;
|
|
32
|
-
resolveWithConfig(type: string, config: any): Promise<StorageProvider>;
|
|
33
|
-
getProviderPluginName(type: string): string | undefined;
|
|
34
|
-
getAllPluginNames(): string[];
|
|
35
|
-
setPluginEnabled(name: string, enabled: boolean): void;
|
|
36
|
-
isPluginEnabled(name: string): boolean;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
declare class Registry {
|
|
40
|
-
storageProviders: StorageProviderRegistry;
|
|
41
|
-
private collections;
|
|
42
|
-
private globals;
|
|
43
|
-
private plugins;
|
|
44
|
-
private schemaCache;
|
|
45
|
-
private initialized;
|
|
46
|
-
addCollection(config: CollectionConfig): void;
|
|
47
|
-
addCollections(configs: CollectionConfig[]): void;
|
|
48
|
-
getCollection(slug: string): CollectionConfig | undefined;
|
|
49
|
-
getCollections(): CollectionConfig[];
|
|
50
|
-
getCollectionSlugs(): string[];
|
|
51
|
-
hasCollection(slug: string): boolean;
|
|
52
|
-
removeCollection(slug: string): boolean;
|
|
53
|
-
addGlobal(config: GlobalConfig): void;
|
|
54
|
-
/**
|
|
55
|
-
* Add a global after the registry is already initialized.
|
|
56
|
-
* Only for internal use (e.g. storage settings form built at startup).
|
|
57
|
-
*/
|
|
58
|
-
addGlobalPostInit(config: GlobalConfig): void;
|
|
59
|
-
private _addGlobalUnsafe;
|
|
60
|
-
addGlobals(configs: GlobalConfig[]): void;
|
|
61
|
-
getGlobal(slug: string): GlobalConfig | undefined;
|
|
62
|
-
getGlobals(): GlobalConfig[];
|
|
63
|
-
getGlobalSlugs(): string[];
|
|
64
|
-
hasGlobal(slug: string): boolean;
|
|
65
|
-
removeGlobal(slug: string): boolean;
|
|
66
|
-
addPlugin(plugin: KyroPlugin): void;
|
|
67
|
-
getPlugins(): KyroPlugin[];
|
|
68
|
-
getZodSchema(slug: string): ZodTypeAny;
|
|
69
|
-
getCreateZodSchema(slug: string): ZodTypeAny;
|
|
70
|
-
getUpdateZodSchema(slug: string): ZodTypeAny;
|
|
71
|
-
getWhereZodSchema(slug: string): ZodTypeAny;
|
|
72
|
-
getFieldZodSchema(field: Field): ZodTypeAny;
|
|
73
|
-
private clearSchemaCache;
|
|
74
|
-
private applyFieldDefaults;
|
|
75
|
-
getFields(slug: string): Field[];
|
|
76
|
-
getFieldMap(slug: string): Map<string, Field>;
|
|
77
|
-
getVisibleFields(slug: string): Field[];
|
|
78
|
-
validate(): void;
|
|
79
|
-
init(kyroInstance?: any): Promise<void>;
|
|
80
|
-
isInitialized(): boolean;
|
|
81
|
-
getPaginationDefaults(slug: string): {
|
|
82
|
-
defaultLimit: number;
|
|
83
|
-
limits: number[];
|
|
84
|
-
};
|
|
85
|
-
getDefaultSort(slug: string): string;
|
|
86
|
-
getDefaultColumns(slug: string): string[];
|
|
87
|
-
getAdminTitle(slug: string): string;
|
|
88
|
-
getAdminLabel(slug: string): string;
|
|
89
|
-
getAdminGroup(slug: string): string | undefined;
|
|
90
|
-
getStats(): {
|
|
91
|
-
collections: number;
|
|
92
|
-
globals: number;
|
|
93
|
-
plugins: number;
|
|
94
|
-
fields: number;
|
|
95
|
-
};
|
|
96
|
-
toJSON(): {
|
|
97
|
-
collections: CollectionConfig[];
|
|
98
|
-
globals: GlobalConfig[];
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
declare function getRegistry(): Registry;
|
|
102
|
-
declare function resetRegistry(): void;
|
|
103
|
-
declare function createRegistry(): Registry;
|
|
104
|
-
|
|
105
|
-
export { Registry as R, createRegistry as c, getRegistry as g, resetRegistry as r };
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { S as StorageConfig, a as StorageProvider, C as CollectionConfig, G as GlobalConfig, K as KyroPlugin } from './types-B5Qz1svz.cjs';
|
|
2
|
-
import { F as Field } from './types-DROqAsr0.cjs';
|
|
3
|
-
import { ZodTypeAny } from 'zod';
|
|
4
|
-
|
|
5
|
-
interface StorageProviderRegistration {
|
|
6
|
-
type: string;
|
|
7
|
-
displayName: string;
|
|
8
|
-
pluginName?: string;
|
|
9
|
-
configFields: Field[];
|
|
10
|
-
configKey?: string;
|
|
11
|
-
extractConfig: (storageConfig: StorageConfig, configKey: string) => any;
|
|
12
|
-
extractRawConfig: (config: any) => any;
|
|
13
|
-
factory: (config: any) => StorageProvider;
|
|
14
|
-
}
|
|
15
|
-
declare class StorageProviderRegistry {
|
|
16
|
-
private providers;
|
|
17
|
-
private providerToPlugin;
|
|
18
|
-
private disabledPlugins;
|
|
19
|
-
constructor();
|
|
20
|
-
private registerLocal;
|
|
21
|
-
private registerImgix;
|
|
22
|
-
private registerBunny;
|
|
23
|
-
private registerCloudflareR2;
|
|
24
|
-
private registerCloudflareS3;
|
|
25
|
-
register(registration: StorageProviderRegistration): void;
|
|
26
|
-
unregister(type: string): void;
|
|
27
|
-
get(type: string): StorageProviderRegistration | undefined;
|
|
28
|
-
getAll(): StorageProviderRegistration[];
|
|
29
|
-
getAllAvailable(isPluginEnabled?: (name: string) => boolean): StorageProviderRegistration[];
|
|
30
|
-
has(type: string): boolean;
|
|
31
|
-
resolve(type: string, storageConfig: StorageConfig): Promise<StorageProvider>;
|
|
32
|
-
resolveWithConfig(type: string, config: any): Promise<StorageProvider>;
|
|
33
|
-
getProviderPluginName(type: string): string | undefined;
|
|
34
|
-
getAllPluginNames(): string[];
|
|
35
|
-
setPluginEnabled(name: string, enabled: boolean): void;
|
|
36
|
-
isPluginEnabled(name: string): boolean;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
declare class Registry {
|
|
40
|
-
storageProviders: StorageProviderRegistry;
|
|
41
|
-
private collections;
|
|
42
|
-
private globals;
|
|
43
|
-
private plugins;
|
|
44
|
-
private schemaCache;
|
|
45
|
-
private initialized;
|
|
46
|
-
addCollection(config: CollectionConfig): void;
|
|
47
|
-
addCollections(configs: CollectionConfig[]): void;
|
|
48
|
-
getCollection(slug: string): CollectionConfig | undefined;
|
|
49
|
-
getCollections(): CollectionConfig[];
|
|
50
|
-
getCollectionSlugs(): string[];
|
|
51
|
-
hasCollection(slug: string): boolean;
|
|
52
|
-
removeCollection(slug: string): boolean;
|
|
53
|
-
addGlobal(config: GlobalConfig): void;
|
|
54
|
-
/**
|
|
55
|
-
* Add a global after the registry is already initialized.
|
|
56
|
-
* Only for internal use (e.g. storage settings form built at startup).
|
|
57
|
-
*/
|
|
58
|
-
addGlobalPostInit(config: GlobalConfig): void;
|
|
59
|
-
private _addGlobalUnsafe;
|
|
60
|
-
addGlobals(configs: GlobalConfig[]): void;
|
|
61
|
-
getGlobal(slug: string): GlobalConfig | undefined;
|
|
62
|
-
getGlobals(): GlobalConfig[];
|
|
63
|
-
getGlobalSlugs(): string[];
|
|
64
|
-
hasGlobal(slug: string): boolean;
|
|
65
|
-
removeGlobal(slug: string): boolean;
|
|
66
|
-
addPlugin(plugin: KyroPlugin): void;
|
|
67
|
-
getPlugins(): KyroPlugin[];
|
|
68
|
-
getZodSchema(slug: string): ZodTypeAny;
|
|
69
|
-
getCreateZodSchema(slug: string): ZodTypeAny;
|
|
70
|
-
getUpdateZodSchema(slug: string): ZodTypeAny;
|
|
71
|
-
getWhereZodSchema(slug: string): ZodTypeAny;
|
|
72
|
-
getFieldZodSchema(field: Field): ZodTypeAny;
|
|
73
|
-
private clearSchemaCache;
|
|
74
|
-
private applyFieldDefaults;
|
|
75
|
-
getFields(slug: string): Field[];
|
|
76
|
-
getFieldMap(slug: string): Map<string, Field>;
|
|
77
|
-
getVisibleFields(slug: string): Field[];
|
|
78
|
-
validate(): void;
|
|
79
|
-
init(kyroInstance?: any): Promise<void>;
|
|
80
|
-
isInitialized(): boolean;
|
|
81
|
-
getPaginationDefaults(slug: string): {
|
|
82
|
-
defaultLimit: number;
|
|
83
|
-
limits: number[];
|
|
84
|
-
};
|
|
85
|
-
getDefaultSort(slug: string): string;
|
|
86
|
-
getDefaultColumns(slug: string): string[];
|
|
87
|
-
getAdminTitle(slug: string): string;
|
|
88
|
-
getAdminLabel(slug: string): string;
|
|
89
|
-
getAdminGroup(slug: string): string | undefined;
|
|
90
|
-
getStats(): {
|
|
91
|
-
collections: number;
|
|
92
|
-
globals: number;
|
|
93
|
-
plugins: number;
|
|
94
|
-
fields: number;
|
|
95
|
-
};
|
|
96
|
-
toJSON(): {
|
|
97
|
-
collections: CollectionConfig[];
|
|
98
|
-
globals: GlobalConfig[];
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
declare function getRegistry(): Registry;
|
|
102
|
-
declare function resetRegistry(): void;
|
|
103
|
-
declare function createRegistry(): Registry;
|
|
104
|
-
|
|
105
|
-
export { Registry as R, createRegistry as c, getRegistry as g, resetRegistry as r };
|
package/dist/index-ByOM1Y5x.d.ts
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { S as StorageConfig, a as StorageProvider, C as CollectionConfig, G as GlobalConfig, K as KyroPlugin } from './types-IeKFn7Ky.js';
|
|
2
|
-
import { F as Field } from './types-B9oXBEKI.js';
|
|
3
|
-
import { ZodTypeAny } from 'zod';
|
|
4
|
-
|
|
5
|
-
interface StorageProviderRegistration {
|
|
6
|
-
type: string;
|
|
7
|
-
displayName: string;
|
|
8
|
-
pluginName?: string;
|
|
9
|
-
configFields: Field[];
|
|
10
|
-
configKey?: string;
|
|
11
|
-
extractConfig: (storageConfig: StorageConfig, configKey: string) => any;
|
|
12
|
-
extractRawConfig: (config: any) => any;
|
|
13
|
-
factory: (config: any) => StorageProvider;
|
|
14
|
-
}
|
|
15
|
-
declare class StorageProviderRegistry {
|
|
16
|
-
private providers;
|
|
17
|
-
private providerToPlugin;
|
|
18
|
-
private disabledPlugins;
|
|
19
|
-
constructor();
|
|
20
|
-
private registerLocal;
|
|
21
|
-
private registerImgix;
|
|
22
|
-
private registerBunny;
|
|
23
|
-
private registerCloudflareR2;
|
|
24
|
-
private registerCloudflareS3;
|
|
25
|
-
register(registration: StorageProviderRegistration): void;
|
|
26
|
-
unregister(type: string): void;
|
|
27
|
-
get(type: string): StorageProviderRegistration | undefined;
|
|
28
|
-
getAll(): StorageProviderRegistration[];
|
|
29
|
-
getAllAvailable(isPluginEnabled?: (name: string) => boolean): StorageProviderRegistration[];
|
|
30
|
-
has(type: string): boolean;
|
|
31
|
-
resolve(type: string, storageConfig: StorageConfig): Promise<StorageProvider>;
|
|
32
|
-
resolveWithConfig(type: string, config: any): Promise<StorageProvider>;
|
|
33
|
-
getProviderPluginName(type: string): string | undefined;
|
|
34
|
-
getAllPluginNames(): string[];
|
|
35
|
-
setPluginEnabled(name: string, enabled: boolean): void;
|
|
36
|
-
isPluginEnabled(name: string): boolean;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
declare class Registry {
|
|
40
|
-
storageProviders: StorageProviderRegistry;
|
|
41
|
-
private collections;
|
|
42
|
-
private globals;
|
|
43
|
-
private plugins;
|
|
44
|
-
private schemaCache;
|
|
45
|
-
private initialized;
|
|
46
|
-
addCollection(config: CollectionConfig): void;
|
|
47
|
-
addCollections(configs: CollectionConfig[]): void;
|
|
48
|
-
getCollection(slug: string): CollectionConfig | undefined;
|
|
49
|
-
getCollections(): CollectionConfig[];
|
|
50
|
-
getCollectionSlugs(): string[];
|
|
51
|
-
hasCollection(slug: string): boolean;
|
|
52
|
-
removeCollection(slug: string): boolean;
|
|
53
|
-
addGlobal(config: GlobalConfig): void;
|
|
54
|
-
/**
|
|
55
|
-
* Add a global after the registry is already initialized.
|
|
56
|
-
* Only for internal use (e.g. storage settings form built at startup).
|
|
57
|
-
*/
|
|
58
|
-
addGlobalPostInit(config: GlobalConfig): void;
|
|
59
|
-
private _addGlobalUnsafe;
|
|
60
|
-
addGlobals(configs: GlobalConfig[]): void;
|
|
61
|
-
getGlobal(slug: string): GlobalConfig | undefined;
|
|
62
|
-
getGlobals(): GlobalConfig[];
|
|
63
|
-
getGlobalSlugs(): string[];
|
|
64
|
-
hasGlobal(slug: string): boolean;
|
|
65
|
-
removeGlobal(slug: string): boolean;
|
|
66
|
-
addPlugin(plugin: KyroPlugin): void;
|
|
67
|
-
getPlugins(): KyroPlugin[];
|
|
68
|
-
getZodSchema(slug: string): ZodTypeAny;
|
|
69
|
-
getCreateZodSchema(slug: string): ZodTypeAny;
|
|
70
|
-
getUpdateZodSchema(slug: string): ZodTypeAny;
|
|
71
|
-
getWhereZodSchema(slug: string): ZodTypeAny;
|
|
72
|
-
getFieldZodSchema(field: Field): ZodTypeAny;
|
|
73
|
-
private clearSchemaCache;
|
|
74
|
-
private applyFieldDefaults;
|
|
75
|
-
getFields(slug: string): Field[];
|
|
76
|
-
getFieldMap(slug: string): Map<string, Field>;
|
|
77
|
-
getVisibleFields(slug: string): Field[];
|
|
78
|
-
validate(): void;
|
|
79
|
-
init(kyroInstance?: any): Promise<void>;
|
|
80
|
-
isInitialized(): boolean;
|
|
81
|
-
getPaginationDefaults(slug: string): {
|
|
82
|
-
defaultLimit: number;
|
|
83
|
-
limits: number[];
|
|
84
|
-
};
|
|
85
|
-
getDefaultSort(slug: string): string;
|
|
86
|
-
getDefaultColumns(slug: string): string[];
|
|
87
|
-
getAdminTitle(slug: string): string;
|
|
88
|
-
getAdminLabel(slug: string): string;
|
|
89
|
-
getAdminGroup(slug: string): string | undefined;
|
|
90
|
-
getStats(): {
|
|
91
|
-
collections: number;
|
|
92
|
-
globals: number;
|
|
93
|
-
plugins: number;
|
|
94
|
-
fields: number;
|
|
95
|
-
};
|
|
96
|
-
toJSON(): {
|
|
97
|
-
collections: CollectionConfig[];
|
|
98
|
-
globals: GlobalConfig[];
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
declare function getRegistry(): Registry;
|
|
102
|
-
declare function resetRegistry(): void;
|
|
103
|
-
declare function createRegistry(): Registry;
|
|
104
|
-
|
|
105
|
-
export { Registry as R, createRegistry as c, getRegistry as g, resetRegistry as r };
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { S as StorageConfig, a as StorageProvider, C as CollectionConfig, G as GlobalConfig, K as KyroPlugin } from './types-C8yIAV6K.cjs';
|
|
2
|
-
import { F as Field } from './types-DROqAsr0.cjs';
|
|
3
|
-
import { ZodTypeAny } from 'zod';
|
|
4
|
-
|
|
5
|
-
interface StorageProviderRegistration {
|
|
6
|
-
type: string;
|
|
7
|
-
displayName: string;
|
|
8
|
-
pluginName?: string;
|
|
9
|
-
configFields: Field[];
|
|
10
|
-
configKey?: string;
|
|
11
|
-
extractConfig: (storageConfig: StorageConfig, configKey: string) => any;
|
|
12
|
-
extractRawConfig: (config: any) => any;
|
|
13
|
-
factory: (config: any) => StorageProvider;
|
|
14
|
-
}
|
|
15
|
-
declare class StorageProviderRegistry {
|
|
16
|
-
private providers;
|
|
17
|
-
private providerToPlugin;
|
|
18
|
-
private disabledPlugins;
|
|
19
|
-
constructor();
|
|
20
|
-
private registerLocal;
|
|
21
|
-
private registerImgix;
|
|
22
|
-
private registerBunny;
|
|
23
|
-
private registerCloudflareR2;
|
|
24
|
-
private registerCloudflareS3;
|
|
25
|
-
register(registration: StorageProviderRegistration): void;
|
|
26
|
-
unregister(type: string): void;
|
|
27
|
-
get(type: string): StorageProviderRegistration | undefined;
|
|
28
|
-
getAll(): StorageProviderRegistration[];
|
|
29
|
-
getAllAvailable(isPluginEnabled?: (name: string) => boolean): StorageProviderRegistration[];
|
|
30
|
-
has(type: string): boolean;
|
|
31
|
-
resolve(type: string, storageConfig: StorageConfig): Promise<StorageProvider>;
|
|
32
|
-
resolveWithConfig(type: string, config: any): Promise<StorageProvider>;
|
|
33
|
-
getProviderPluginName(type: string): string | undefined;
|
|
34
|
-
getAllPluginNames(): string[];
|
|
35
|
-
setPluginEnabled(name: string, enabled: boolean): void;
|
|
36
|
-
isPluginEnabled(name: string): boolean;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
declare class Registry {
|
|
40
|
-
storageProviders: StorageProviderRegistry;
|
|
41
|
-
private collections;
|
|
42
|
-
private globals;
|
|
43
|
-
private plugins;
|
|
44
|
-
private schemaCache;
|
|
45
|
-
private initialized;
|
|
46
|
-
addCollection(config: CollectionConfig): void;
|
|
47
|
-
addCollections(configs: CollectionConfig[]): void;
|
|
48
|
-
getCollection(slug: string): CollectionConfig | undefined;
|
|
49
|
-
getCollections(): CollectionConfig[];
|
|
50
|
-
getCollectionSlugs(): string[];
|
|
51
|
-
hasCollection(slug: string): boolean;
|
|
52
|
-
removeCollection(slug: string): boolean;
|
|
53
|
-
addGlobal(config: GlobalConfig): void;
|
|
54
|
-
/**
|
|
55
|
-
* Add a global after the registry is already initialized.
|
|
56
|
-
* Only for internal use (e.g. storage settings form built at startup).
|
|
57
|
-
*/
|
|
58
|
-
addGlobalPostInit(config: GlobalConfig): void;
|
|
59
|
-
private _addGlobalUnsafe;
|
|
60
|
-
addGlobals(configs: GlobalConfig[]): void;
|
|
61
|
-
getGlobal(slug: string): GlobalConfig | undefined;
|
|
62
|
-
getGlobals(): GlobalConfig[];
|
|
63
|
-
getGlobalSlugs(): string[];
|
|
64
|
-
hasGlobal(slug: string): boolean;
|
|
65
|
-
removeGlobal(slug: string): boolean;
|
|
66
|
-
addPlugin(plugin: KyroPlugin): void;
|
|
67
|
-
getPlugins(): KyroPlugin[];
|
|
68
|
-
getZodSchema(slug: string): ZodTypeAny;
|
|
69
|
-
getCreateZodSchema(slug: string): ZodTypeAny;
|
|
70
|
-
getUpdateZodSchema(slug: string): ZodTypeAny;
|
|
71
|
-
getWhereZodSchema(slug: string): ZodTypeAny;
|
|
72
|
-
getFieldZodSchema(field: Field): ZodTypeAny;
|
|
73
|
-
private clearSchemaCache;
|
|
74
|
-
private applyFieldDefaults;
|
|
75
|
-
getFields(slug: string): Field[];
|
|
76
|
-
getFieldMap(slug: string): Map<string, Field>;
|
|
77
|
-
getVisibleFields(slug: string): Field[];
|
|
78
|
-
validate(): void;
|
|
79
|
-
init(kyroInstance?: any): Promise<void>;
|
|
80
|
-
isInitialized(): boolean;
|
|
81
|
-
getPaginationDefaults(slug: string): {
|
|
82
|
-
defaultLimit: number;
|
|
83
|
-
limits: number[];
|
|
84
|
-
};
|
|
85
|
-
getDefaultSort(slug: string): string;
|
|
86
|
-
getDefaultColumns(slug: string): string[];
|
|
87
|
-
getAdminTitle(slug: string): string;
|
|
88
|
-
getAdminLabel(slug: string): string;
|
|
89
|
-
getAdminGroup(slug: string): string | undefined;
|
|
90
|
-
getStats(): {
|
|
91
|
-
collections: number;
|
|
92
|
-
globals: number;
|
|
93
|
-
plugins: number;
|
|
94
|
-
fields: number;
|
|
95
|
-
};
|
|
96
|
-
toJSON(): {
|
|
97
|
-
collections: CollectionConfig[];
|
|
98
|
-
globals: GlobalConfig[];
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
declare function getRegistry(): Registry;
|
|
102
|
-
declare function resetRegistry(): void;
|
|
103
|
-
declare function createRegistry(): Registry;
|
|
104
|
-
|
|
105
|
-
export { Registry as R, createRegistry as c, getRegistry as g, resetRegistry as r };
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { S as StorageConfig, a as StorageProvider, C as CollectionConfig, G as GlobalConfig, K as KyroPlugin } from './types-Cdssrcbz.cjs';
|
|
2
|
-
import { F as Field } from './types-B9oXBEKI.cjs';
|
|
3
|
-
import { ZodTypeAny } from 'zod';
|
|
4
|
-
|
|
5
|
-
interface StorageProviderRegistration {
|
|
6
|
-
type: string;
|
|
7
|
-
displayName: string;
|
|
8
|
-
pluginName?: string;
|
|
9
|
-
configFields: Field[];
|
|
10
|
-
configKey?: string;
|
|
11
|
-
extractConfig: (storageConfig: StorageConfig, configKey: string) => any;
|
|
12
|
-
extractRawConfig: (config: any) => any;
|
|
13
|
-
factory: (config: any) => StorageProvider;
|
|
14
|
-
}
|
|
15
|
-
declare class StorageProviderRegistry {
|
|
16
|
-
private providers;
|
|
17
|
-
private providerToPlugin;
|
|
18
|
-
private disabledPlugins;
|
|
19
|
-
constructor();
|
|
20
|
-
private registerLocal;
|
|
21
|
-
private registerImgix;
|
|
22
|
-
private registerBunny;
|
|
23
|
-
private registerCloudflareR2;
|
|
24
|
-
private registerCloudflareS3;
|
|
25
|
-
register(registration: StorageProviderRegistration): void;
|
|
26
|
-
unregister(type: string): void;
|
|
27
|
-
get(type: string): StorageProviderRegistration | undefined;
|
|
28
|
-
getAll(): StorageProviderRegistration[];
|
|
29
|
-
getAllAvailable(isPluginEnabled?: (name: string) => boolean): StorageProviderRegistration[];
|
|
30
|
-
has(type: string): boolean;
|
|
31
|
-
resolve(type: string, storageConfig: StorageConfig): Promise<StorageProvider>;
|
|
32
|
-
resolveWithConfig(type: string, config: any): Promise<StorageProvider>;
|
|
33
|
-
getProviderPluginName(type: string): string | undefined;
|
|
34
|
-
getAllPluginNames(): string[];
|
|
35
|
-
setPluginEnabled(name: string, enabled: boolean): void;
|
|
36
|
-
isPluginEnabled(name: string): boolean;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
declare class Registry {
|
|
40
|
-
storageProviders: StorageProviderRegistry;
|
|
41
|
-
private collections;
|
|
42
|
-
private globals;
|
|
43
|
-
private plugins;
|
|
44
|
-
private schemaCache;
|
|
45
|
-
private initialized;
|
|
46
|
-
addCollection(config: CollectionConfig): void;
|
|
47
|
-
addCollections(configs: CollectionConfig[]): void;
|
|
48
|
-
getCollection(slug: string): CollectionConfig | undefined;
|
|
49
|
-
getCollections(): CollectionConfig[];
|
|
50
|
-
getCollectionSlugs(): string[];
|
|
51
|
-
hasCollection(slug: string): boolean;
|
|
52
|
-
removeCollection(slug: string): boolean;
|
|
53
|
-
addGlobal(config: GlobalConfig): void;
|
|
54
|
-
/**
|
|
55
|
-
* Add a global after the registry is already initialized.
|
|
56
|
-
* Only for internal use (e.g. storage settings form built at startup).
|
|
57
|
-
*/
|
|
58
|
-
addGlobalPostInit(config: GlobalConfig): void;
|
|
59
|
-
private _addGlobalUnsafe;
|
|
60
|
-
addGlobals(configs: GlobalConfig[]): void;
|
|
61
|
-
getGlobal(slug: string): GlobalConfig | undefined;
|
|
62
|
-
getGlobals(): GlobalConfig[];
|
|
63
|
-
getGlobalSlugs(): string[];
|
|
64
|
-
hasGlobal(slug: string): boolean;
|
|
65
|
-
removeGlobal(slug: string): boolean;
|
|
66
|
-
addPlugin(plugin: KyroPlugin): void;
|
|
67
|
-
getPlugins(): KyroPlugin[];
|
|
68
|
-
getZodSchema(slug: string): ZodTypeAny;
|
|
69
|
-
getCreateZodSchema(slug: string): ZodTypeAny;
|
|
70
|
-
getUpdateZodSchema(slug: string): ZodTypeAny;
|
|
71
|
-
getWhereZodSchema(slug: string): ZodTypeAny;
|
|
72
|
-
getFieldZodSchema(field: Field): ZodTypeAny;
|
|
73
|
-
private clearSchemaCache;
|
|
74
|
-
private applyFieldDefaults;
|
|
75
|
-
getFields(slug: string): Field[];
|
|
76
|
-
getFieldMap(slug: string): Map<string, Field>;
|
|
77
|
-
getVisibleFields(slug: string): Field[];
|
|
78
|
-
validate(): void;
|
|
79
|
-
init(kyroInstance?: any): Promise<void>;
|
|
80
|
-
isInitialized(): boolean;
|
|
81
|
-
getPaginationDefaults(slug: string): {
|
|
82
|
-
defaultLimit: number;
|
|
83
|
-
limits: number[];
|
|
84
|
-
};
|
|
85
|
-
getDefaultSort(slug: string): string;
|
|
86
|
-
getDefaultColumns(slug: string): string[];
|
|
87
|
-
getAdminTitle(slug: string): string;
|
|
88
|
-
getAdminLabel(slug: string): string;
|
|
89
|
-
getAdminGroup(slug: string): string | undefined;
|
|
90
|
-
getStats(): {
|
|
91
|
-
collections: number;
|
|
92
|
-
globals: number;
|
|
93
|
-
plugins: number;
|
|
94
|
-
fields: number;
|
|
95
|
-
};
|
|
96
|
-
toJSON(): {
|
|
97
|
-
collections: CollectionConfig[];
|
|
98
|
-
globals: GlobalConfig[];
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
declare function getRegistry(): Registry;
|
|
102
|
-
declare function resetRegistry(): void;
|
|
103
|
-
declare function createRegistry(): Registry;
|
|
104
|
-
|
|
105
|
-
export { Registry as R, createRegistry as c, getRegistry as g, resetRegistry as r };
|