@kyro-cms/core 0.12.44 → 0.12.45
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-C19xR8qE.d.ts → WebhookService-CZf_na-J.d.ts} +1 -1
- package/dist/{WebhookService-BBcCHBo8.d.cts → WebhookService-DgIx21X-.d.cts} +1 -1
- package/dist/api-handler-graphql.cjs +1 -1
- package/dist/api-handler-graphql.js +2 -1
- package/dist/api-handler-trpc.cjs +1 -1
- package/dist/api-handler-trpc.js +2 -1
- package/dist/api-handler.cjs +1 -1
- package/dist/api-handler.js +1 -1
- package/dist/{base-yXdYZxFK.d.ts → base-7vJMzr4V.d.ts} +1 -1
- package/dist/{base-C2iwjdJQ.d.cts → base-DDEmdRqV.d.cts} +1 -1
- package/dist/bcryptjs-AZA6WEN2.js +2 -0
- package/dist/bcryptjs-WIQSWJGK.cjs +1 -0
- package/dist/better-sqlite3-42Q3FG3E.js +2 -0
- package/dist/better-sqlite3-5IISPX34.cjs +1 -0
- package/dist/bootstrap-7CI3NVSY.js +1 -0
- package/dist/bootstrap-DOOM2CNQ.cjs +1 -0
- package/dist/bowser-FI5JQGKZ.js +11 -0
- package/dist/bowser-VX6B6ZSE.cjs +10 -0
- package/dist/chokidar-24HVS6XD.cjs +5 -0
- package/dist/chokidar-43DT7CVN.js +6 -0
- package/dist/chunk-26Q7JXM4.cjs +3 -0
- package/dist/chunk-2BUODBE2.js +2 -0
- package/dist/chunk-2WFTETFB.js +2 -0
- package/dist/chunk-35PGCW3S.cjs +1 -0
- package/dist/chunk-3VXEK5ZW.cjs +1 -0
- package/dist/chunk-45TJAB5X.js +301 -0
- package/dist/chunk-5DWYVUQR.cjs +1 -0
- package/dist/chunk-5LPNEYK5.cjs +1 -0
- package/dist/chunk-66BJXVFJ.js +2 -0
- package/dist/chunk-6KRR7YHA.js +2 -0
- package/dist/chunk-6KUL2BSA.cjs +133 -0
- package/dist/chunk-6MSS5X77.js +2 -0
- package/dist/chunk-6QWLXJ7L.js +2 -0
- package/dist/chunk-6V3AP7HR.cjs +269 -0
- package/dist/chunk-73D2PNHD.cjs +7 -0
- package/dist/chunk-7ACHOBWY.cjs +13 -0
- package/dist/chunk-7AQSH3KR.js +2 -0
- package/dist/chunk-7GGZA5YU.cjs +2 -0
- package/dist/chunk-7I6URA6F.js +4 -0
- package/dist/chunk-7JWQ2PZP.cjs +1 -0
- package/dist/chunk-7SSFHJTR.js +57 -0
- package/dist/chunk-7T35572E.js +75 -0
- package/dist/chunk-7V67ONUD.js +4 -0
- package/dist/chunk-7WMMKGEO.cjs +1 -0
- package/dist/chunk-A73AVVFR.js +11 -0
- package/dist/chunk-AK754S3T.cjs +2 -0
- package/dist/chunk-AMGJ5AFH.cjs +1 -0
- package/dist/chunk-ATBH763U.js +2 -0
- package/dist/chunk-B3GDQ7UI.cjs +114 -0
- package/dist/chunk-BAVN7VDR.cjs +1 -0
- package/dist/chunk-BCEE4NBZ.cjs +2 -0
- package/dist/{chunk-J4252I5B.cjs → chunk-BHR7OAU4.cjs} +4 -4
- package/dist/chunk-BLH2MRK4.js +2 -0
- package/dist/chunk-BPMA2ECA.js +10 -0
- package/dist/chunk-BUNLC3II.cjs +1 -0
- package/dist/chunk-C2PXMVR5.js +2 -0
- package/dist/chunk-CGPAS4U5.js +4 -0
- package/dist/chunk-DS5DE5BU.js +2 -0
- package/dist/chunk-DUO523BH.cjs +1 -0
- package/dist/chunk-DVWYO3KK.cjs +1 -0
- package/dist/chunk-E27KEZPT.js +2 -0
- package/dist/chunk-EHWUALGH.cjs +1 -0
- package/dist/chunk-EN65ZEK2.cjs +2 -0
- package/dist/chunk-EOOZDOL7.js +3 -0
- package/dist/chunk-EZIDQBXI.cjs +1 -0
- package/dist/chunk-F4ITQ6XQ.cjs +3 -0
- package/dist/chunk-FLM37UVD.js +2 -0
- package/dist/chunk-GIS6X43A.cjs +3 -0
- package/dist/chunk-GNEVCEJU.cjs +3 -0
- package/dist/chunk-GNOSG3PK.cjs +1 -0
- package/dist/chunk-HLAEJB5R.js +384 -0
- package/dist/chunk-HPYH7GTS.cjs +1 -0
- package/dist/chunk-HT44I66C.js +24 -0
- package/dist/chunk-HTYVI2HK.cjs +9 -0
- package/dist/chunk-ICVQWR2A.js +2 -0
- package/dist/chunk-IP6JUEH3.js +3 -0
- package/dist/chunk-IPXOY4RI.js +2 -0
- package/dist/chunk-J6U5LWZ7.js +11 -0
- package/dist/{chunk-UHFDH3PG.js → chunk-JT36FTHY.cjs} +4 -4
- package/dist/chunk-JUJZOG6P.js +2 -0
- package/dist/{chunk-2BTRHVT3.cjs → chunk-K7YNEKVE.js} +5 -4
- package/dist/chunk-KCHPADCH.cjs +7 -0
- package/dist/chunk-KH7LM52S.js +3 -0
- package/dist/chunk-LEBM6ZSZ.cjs +10 -0
- package/dist/chunk-LQ3YZTPU.cjs +15 -0
- package/dist/chunk-LY7N3UHH.cjs +23 -0
- package/dist/chunk-M6ESQ5TE.cjs +56 -0
- package/dist/chunk-MCZ3YZ2L.js +2 -0
- package/dist/chunk-MP5VC5ER.cjs +1 -0
- package/dist/chunk-MVX2PYJJ.cjs +1 -0
- package/dist/chunk-MY42EWZP.js +2 -0
- package/dist/chunk-MZOWPV4D.js +20 -0
- package/dist/chunk-NGNJSUGL.cjs +1 -0
- package/dist/chunk-NWCREF47.js +3 -0
- package/dist/chunk-OMWQVPV7.js +14 -0
- package/dist/chunk-ORG67NXX.js +3 -0
- package/dist/chunk-OSAVAYJZ.js +16 -0
- package/dist/chunk-P7XYIKL6.cjs +300 -0
- package/dist/chunk-PBOZJOKN.js +2 -0
- package/dist/chunk-PITMDQYN.cjs +18 -0
- package/dist/chunk-PL5AIE6F.js +2 -0
- package/dist/chunk-QC4YXUBT.cjs +383 -0
- package/dist/chunk-QDHP5E4P.cjs +2 -0
- package/dist/chunk-QYI3GOHF.cjs +1 -0
- package/dist/chunk-R3NEPC4I.js +3 -0
- package/dist/chunk-R4LXRAMX.js +2 -0
- package/dist/chunk-S5HTTLN7.cjs +2 -0
- package/dist/chunk-STX5V7HG.cjs +20 -0
- package/dist/chunk-SVYUTQVE.js +115 -0
- package/dist/chunk-SYEP5QLG.js +19 -0
- package/dist/chunk-TR3ZS3T3.js +3 -0
- package/dist/chunk-UB5TJHQR.js +2 -0
- package/dist/chunk-UD6ZPO7T.js +2 -0
- package/dist/chunk-UK43ADRO.js +270 -0
- package/dist/chunk-UNYXWPLZ.cjs +2 -0
- package/dist/chunk-VBPAAQEF.js +2 -0
- package/dist/chunk-VIUU4D5I.js +2 -0
- package/dist/chunk-VJ2WMKPK.js +21 -0
- package/dist/chunk-VOQUO2EZ.cjs +74 -0
- package/dist/chunk-VQ53TFYA.cjs +1 -0
- package/dist/chunk-VRZC4TTF.cjs +1 -0
- package/dist/chunk-W46LZ4MY.js +2 -0
- package/dist/chunk-WCFHS7EZ.cjs +1 -0
- package/dist/chunk-WGESLAWV.js +8 -0
- package/dist/chunk-WSP7PSXC.js +8 -0
- package/dist/chunk-X54XZACS.cjs +10 -0
- package/dist/{chunk-Q2UYCYKV.js → chunk-XBH4YMC7.js} +5 -4
- package/dist/chunk-XDE7CFV6.cjs +19 -0
- package/dist/chunk-XOACKBG7.js +4 -0
- package/dist/chunk-XPPVX4GQ.cjs +1 -0
- package/dist/chunk-ZJE3VAAW.js +134 -0
- package/dist/chunk-ZO3YB5DK.cjs +1 -0
- package/dist/chunk-ZOVH6QT5.cjs +1 -0
- package/dist/chunk-ZYDOF65Q.cjs +1 -0
- package/dist/cli/index.cjs +197 -78
- package/dist/cli/index.js +198 -78
- package/dist/client.cjs +1 -1
- package/dist/client.d.cts +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.js +2 -1
- package/dist/d1-5ZQJOFDX.cjs +1 -0
- package/dist/d1-VPH75GI2.js +2 -0
- package/dist/dist-es-3SSNUZST.cjs +1 -0
- package/dist/dist-es-6SVFVYN3.js +1 -0
- package/dist/dist-es-6TQTDPE7.js +2 -0
- package/dist/dist-es-A5OF2STN.cjs +2 -0
- package/dist/dist-es-BOW5V247.cjs +6 -0
- package/dist/dist-es-CRIMATLL.cjs +2 -0
- package/dist/dist-es-DL3VLVP6.cjs +1 -0
- package/dist/dist-es-EMUQ6ZNZ.js +3 -0
- package/dist/dist-es-MNIQZC4U.js +2 -0
- package/dist/dist-es-P25IKLBI.cjs +1 -0
- package/dist/dist-es-SJ76GYCI.js +2 -0
- package/dist/dist-es-SRPWSAF4.cjs +1 -0
- package/dist/dist-es-T2H2W5BX.cjs +3 -0
- package/dist/dist-es-TX4DBXEW.js +3 -0
- package/dist/dist-es-U4ZB3ZDA.js +7 -0
- package/dist/dist-es-XZBHIIKY.js +4 -0
- package/dist/drizzle/index.cjs +1 -1
- package/dist/drizzle/index.d.cts +2 -2
- package/dist/drizzle/index.d.ts +2 -2
- package/dist/drizzle/index.js +1 -1
- package/dist/drizzle-orm-47ELDEM6.cjs +1 -0
- package/dist/drizzle-orm-7YTX5NTT.js +1 -0
- package/dist/event-streams-25YJ2Z6R.js +1 -0
- package/dist/event-streams-JBMWCI2O.cjs +1 -0
- package/dist/fields/index.cjs +1 -1
- package/dist/fields/index.js +1 -1
- package/dist/fs-DGKZLRM6.cjs +1 -0
- package/dist/fs-YZJ5FM6J.js +2 -0
- package/dist/graphql/index.cjs +1 -1
- package/dist/graphql/index.d.cts +2 -2
- package/dist/graphql/index.d.ts +2 -2
- package/dist/graphql/index.js +1 -1
- package/dist/{index-DTz6u7w9.d.cts → index-BJ1rwHxk.d.cts} +1 -1
- package/dist/{index-BeQtbl3z.d.ts → index-BTjlptCL.d.ts} +1 -1
- package/dist/index.cjs +28 -46
- package/dist/index.d.cts +23 -9
- package/dist/index.d.ts +23 -9
- package/dist/index.js +29 -46
- package/dist/integration.cjs +1 -1
- package/dist/integration.js +1 -1
- package/dist/jsonwebtoken-DFB6ZBZA.cjs +8 -0
- package/dist/jsonwebtoken-S7BG2YWK.js +9 -0
- package/dist/lib-5QYYN6ML.cjs +12 -0
- package/dist/lib-IYW32OER.js +13 -0
- package/dist/loadSso-JY4WDQPS.cjs +2 -0
- package/dist/loadSso-YTG2GQGW.js +3 -0
- package/dist/local-VDCSEMC2.js +1 -0
- package/dist/local-YCWBUF3R.cjs +1 -0
- package/dist/media-3Z6YW5J4.cjs +1 -0
- package/dist/media-HK2IZMUZ.js +1 -0
- package/dist/mongo-auth-adapter-7K64Y2QM.cjs +1 -0
- package/dist/mongo-auth-adapter-BUKINEZL.js +1 -0
- package/dist/mongodb/index.cjs +1 -1
- package/dist/mongodb/index.d.cts +2 -2
- package/dist/mongodb/index.d.ts +2 -2
- package/dist/mongodb/index.js +1 -1
- package/dist/nodemailer-AXROO37D.js +54 -0
- package/dist/nodemailer-IDML4L6W.cjs +53 -0
- package/dist/postgres-auth-adapter-2M4RNEY3.cjs +1 -0
- package/dist/postgres-auth-adapter-MKSHIJDL.js +1 -0
- package/dist/postgres-js-3Y54EXVQ.cjs +1 -0
- package/dist/postgres-js-INQPBHJP.js +1 -0
- package/dist/redis-adapter-EGMUN65D.cjs +1 -0
- package/dist/redis-adapter-SXOXLHNH.js +1 -0
- package/dist/rest/index.cjs +1 -1
- package/dist/rest/index.d.cts +5 -5
- package/dist/rest/index.d.ts +5 -5
- package/dist/rest/index.js +1 -1
- package/dist/schema-RT6WSUYC.cjs +1 -0
- package/dist/schema-XC5ISGNR.js +2 -0
- package/dist/signin-KZBIAHGS.js +3 -0
- package/dist/signin-VFBLX7EL.cjs +2 -0
- package/dist/sqlite-adapter-DV7ZX2EJ.js +1 -0
- package/dist/sqlite-adapter-ZTABLT2X.cjs +1 -0
- package/dist/src-6LAUXXDM.cjs +1 -0
- package/dist/src-GZRZ4VAO.js +1 -0
- package/dist/sso-oidc-54BIRYR6.cjs +2 -0
- package/dist/sso-oidc-SX5OIQGG.js +3 -0
- package/dist/sts-HVGDJYIF.js +3 -0
- package/dist/sts-YLXXIB3X.cjs +2 -0
- package/dist/templates/index.cjs +1 -1
- package/dist/templates/index.d.cts +1 -1
- package/dist/templates/index.d.ts +1 -1
- package/dist/templates/index.js +1 -1
- package/dist/trpc/index.cjs +1 -1
- package/dist/trpc/index.d.cts +7 -7
- package/dist/trpc/index.d.ts +7 -7
- package/dist/trpc/index.js +1 -1
- package/dist/{types-CaXXmV9h.d.ts → types-CYGXsNcJ.d.ts} +5 -5
- package/dist/{types-BjivdGbU.d.cts → types-DOKMyC3y.d.cts} +5 -5
- package/dist/ws/index.cjs +1 -1
- package/dist/ws/index.js +1 -1
- package/package.json +2 -2
- package/dist/bootstrap-ROSTPMVL.js +0 -1
- package/dist/bootstrap-WW5NJ6EB.cjs +0 -1
- package/dist/chunk-3CVLI5C5.cjs +0 -3
- package/dist/chunk-3Q2WUG63.cjs +0 -2
- package/dist/chunk-3RSMK4DA.cjs +0 -2
- package/dist/chunk-4IGWJMBY.cjs +0 -2
- package/dist/chunk-4ORJMSJU.cjs +0 -1
- package/dist/chunk-4RMFCTWH.js +0 -1
- package/dist/chunk-5B6X2GBJ.js +0 -2
- package/dist/chunk-5J6HXUF6.js +0 -1
- package/dist/chunk-5KOQYQEE.js +0 -1
- package/dist/chunk-5SEHX7ON.js +0 -1
- package/dist/chunk-6ROHVUXF.js +0 -1
- package/dist/chunk-6SPPR5JZ.js +0 -3
- package/dist/chunk-7IVN6TTY.js +0 -133
- package/dist/chunk-AHSFSERC.cjs +0 -1
- package/dist/chunk-B5XWYVWK.js +0 -1
- package/dist/chunk-BGX27ZRG.cjs +0 -300
- package/dist/chunk-C2W5PSHC.js +0 -300
- package/dist/chunk-CCUQZ66T.cjs +0 -133
- package/dist/chunk-D5P2IPGX.cjs +0 -3
- package/dist/chunk-EPMGPNBE.js +0 -1
- package/dist/chunk-FHJJKFAU.cjs +0 -1
- package/dist/chunk-FVZ5RFLO.js +0 -2
- package/dist/chunk-FZ6Q2EBJ.cjs +0 -20
- package/dist/chunk-G3J2EU5D.cjs +0 -1
- package/dist/chunk-G7SSHELM.cjs +0 -1
- package/dist/chunk-GKYEJ2UF.js +0 -1
- package/dist/chunk-GO34AOBZ.cjs +0 -1
- package/dist/chunk-GYQMNXXW.cjs +0 -114
- package/dist/chunk-HLSB2MCK.js +0 -1
- package/dist/chunk-HQP2Y7QQ.js +0 -251
- package/dist/chunk-HS2KNFAB.cjs +0 -2
- package/dist/chunk-HVXO3OFB.cjs +0 -1
- package/dist/chunk-IETGL7WJ.js +0 -1
- package/dist/chunk-IFJ73O3A.cjs +0 -1
- package/dist/chunk-ILEZ3NYX.cjs +0 -2
- package/dist/chunk-INB4LNA6.js +0 -90
- package/dist/chunk-K6WUOU6P.js +0 -1
- package/dist/chunk-KD7LUCFY.cjs +0 -1
- package/dist/chunk-KDNYHLD2.js +0 -1
- package/dist/chunk-LHW4R367.js +0 -1
- package/dist/chunk-MIOMMB23.cjs +0 -1
- package/dist/chunk-N5VNHUJS.cjs +0 -4
- package/dist/chunk-NRLIGDYF.js +0 -1
- package/dist/chunk-NY47CFVP.cjs +0 -1
- package/dist/chunk-NZJAGASC.cjs +0 -251
- package/dist/chunk-OG7CNQGU.js +0 -1
- package/dist/chunk-PP5S2UBV.js +0 -0
- package/dist/chunk-PP7W5UKL.js +0 -2
- package/dist/chunk-Q3Q7BJVQ.cjs +0 -1
- package/dist/chunk-QCA3AP3M.cjs +0 -1
- package/dist/chunk-QOCHBPMK.js +0 -2
- package/dist/chunk-QYFU5Y7S.js +0 -3
- package/dist/chunk-RHCWCG3O.js +0 -114
- package/dist/chunk-SK2Q4PRV.cjs +0 -90
- package/dist/chunk-TFBHE5FF.cjs +0 -1
- package/dist/chunk-UBRYJP2G.js +0 -1
- package/dist/chunk-V65NPSR5.cjs +0 -1
- package/dist/chunk-VGQ4VUG6.js +0 -2
- package/dist/chunk-W7C6SJXZ.js +0 -20
- package/dist/chunk-WIZ6C5QZ.cjs +0 -1
- package/dist/chunk-ZIWJJRWQ.js +0 -4
- package/dist/chunk-ZUVP4UK7.cjs +0 -1
- package/dist/media-L5XDD47D.js +0 -1
- package/dist/media-OUBQTIQP.cjs +0 -1
- package/dist/mongo-auth-adapter-5TJO5J5U.js +0 -1
- package/dist/mongo-auth-adapter-JVE5M3S4.cjs +0 -1
- package/dist/postgres-auth-adapter-33QOIRXT.js +0 -1
- package/dist/postgres-auth-adapter-JKDYYULH.cjs +0 -1
- package/dist/redis-adapter-NN3H4GRX.js +0 -1
- package/dist/redis-adapter-OUKQGYCH.cjs +0 -1
- package/dist/schema-HIUSHSUI.cjs +0 -1
- package/dist/schema-KFYUM674.js +0 -1
- package/dist/sqlite-adapter-GTTVSXRV.cjs +0 -1
- package/dist/sqlite-adapter-UPANATIW.js +0 -1
package/dist/chunk-B5XWYVWK.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {l,k}from'./chunk-C2W5PSHC.js';import {a}from'./chunk-Q2UYCYKV.js';async function f(r){let{adminEmail:e,adminPassword:t,adminRole:o="super_admin",tenantId:i,emailConfig:a$1,sendWelcomeEmail:c=false}=r,s=r.authAdapter||new a({path:r.authDbPath||"./data/auth.db"});try{await s.connect?.();}catch{return {success:false,error:"Failed to connect to auth storage"}}let l$1=new l().validate(t);if(!l$1.valid)return await s.disconnect?.(),{success:false,error:`Invalid password: ${l$1.errors.join(", ")}`};if(await s.findUserByEmail(e))return await s.disconnect?.(),{success:false,error:"Admin user already exists"};try{let n=await s.createUser({name:"Super Admin",email:e,password:t,role:o||"admin",tenantId:i});if(await s.updateUser?.(n.id,{emailVerified:!0}),c&&a$1){let u=new k(a$1),A=u.getTemplates().welcome(e.split("@")[0]);await u.send({to:e,...A});}return await s.disconnect?.(),{success:!0,user:n}}catch(n){return await s.disconnect?.(),{success:false,error:n instanceof Error?n.message:"Failed to create admin user"}}}async function y(r,e){return !await r.findUserByEmail(e)}function w(){let r=process.env.KYRO_ADMIN_EMAIL,e=process.env.KYRO_ADMIN_PASSWORD;return !r||!e?null:{authDbPath:process.env.KYRO_AUTH_DB_PATH||"./data/auth.db",adminEmail:r,adminPassword:e,adminRole:process.env.KYRO_ADMIN_ROLE||"super_admin",tenantId:process.env.KYRO_ADMIN_TENANT_ID,emailConfig:process.env.SMTP_HOST?{provider:"smtp",smtp:{host:process.env.SMTP_HOST,port:parseInt(process.env.SMTP_PORT||"587",10),secure:process.env.SMTP_SECURE==="true",auth:{user:process.env.SMTP_USER||"",pass:process.env.SMTP_PASS||""}},from:process.env.SMTP_FROM||"noreply@example.com",fromName:process.env.SMTP_FROM_NAME}:void 0,sendWelcomeEmail:process.env.KYRO_ADMIN_SEND_WELCOME==="true"}}async function T(r){let e=w();if(!e)return null;r&&(e.authAdapter=r);try{if(await e.authAdapter?.connect?.(),await e.authAdapter?.findUserByEmail(e.adminEmail))return await e.authAdapter?.disconnect?.(),{success:!1,error:"Admin user already exists"}}catch{}let t=await f(e);return t.success||console.error(`Bootstrap failed: ${t.error}`),t}async function v(r,e=3,t=2e3){let o="";for(let i=0;i<e;i++){let a=await f(r);if(a.success||(o=a.error||"Unknown error",o.includes("already exists")))return a;i<e-1&&await new Promise(c=>setTimeout(c,t));}return {success:false,error:`Failed after ${e} retries: ${o}`}}export{f as a,y as b,w as c,T as d,v as e};
|
package/dist/chunk-BGX27ZRG.cjs
DELETED
|
@@ -1,300 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkWIZ6C5QZ_cjs=require('./chunk-WIZ6C5QZ.cjs');function l(i){let{title:e,previewText:t=e,badgeText:r="Security Notification",badgeType:s="info",bodyHtml:o,ctaText:a,ctaUrl:n,secondaryCtaText:c,secondaryCtaUrl:g}=i,d="#eff6ff",p="#bfdbfe",m="#1d4ed8";return s==="success"?(d="#ecfdf5",p="#a7f3d0",m="#047857"):s==="warning"?(d="#fffbeb",p="#fde68a",m="#b45309"):s==="error"&&(d="#fef2f2",p="#fecaca",m="#b91c1c"),`<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
-
<meta name="color-scheme" content="light dark">
|
|
7
|
-
<meta name="supported-color-schemes" content="light dark">
|
|
8
|
-
<title>${e}</title>
|
|
9
|
-
<style>
|
|
10
|
-
:root {
|
|
11
|
-
color-scheme: light dark;
|
|
12
|
-
supported-color-schemes: light dark;
|
|
13
|
-
}
|
|
14
|
-
@media (prefers-color-scheme: dark) {
|
|
15
|
-
.email-body { background-color: #09090b !important; color: #f4f4f5 !important; }
|
|
16
|
-
.email-card { background-color: #121215 !important; border-color: #27272a !important; box-shadow: none !important; }
|
|
17
|
-
.email-header { background-color: #18181b !important; border-color: #27272a !important; }
|
|
18
|
-
.email-brand-text { color: #ffffff !important; }
|
|
19
|
-
.email-title { color: #ffffff !important; }
|
|
20
|
-
.email-text { color: #a1a1aa !important; }
|
|
21
|
-
.email-strong { color: #ffffff !important; }
|
|
22
|
-
.email-table { background-color: #18181b !important; border-color: #27272a !important; }
|
|
23
|
-
.email-td-border { border-color: #27272a !important; }
|
|
24
|
-
.email-label { color: #a1a1aa !important; }
|
|
25
|
-
.email-value { color: #f4f4f5 !important; }
|
|
26
|
-
.email-code-box { background-color: #18181b !important; border-color: #27272a !important; color: #ffffff !important; }
|
|
27
|
-
.email-btn-primary { background-color: #ffffff !important; color: #09090b !important; }
|
|
28
|
-
.email-btn-secondary { background-color: #18181b !important; border-color: #27272a !important; color: #f4f4f5 !important; }
|
|
29
|
-
.email-footer { background-color: #09090b !important; border-color: #27272a !important; }
|
|
30
|
-
.email-footer-text { color: #71717a !important; }
|
|
31
|
-
.email-footer-link { color: #a1a1aa !important; }
|
|
32
|
-
.logo-light { display: none !important; }
|
|
33
|
-
.logo-dark { display: inline-block !important; }
|
|
34
|
-
}
|
|
35
|
-
</style>
|
|
36
|
-
</head>
|
|
37
|
-
<body class="email-body" style="margin: 0; padding: 36px 16px; background-color: #f4f4f5; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; color: #09090b; -webkit-font-smoothing: antialiased;">
|
|
38
|
-
<!-- Preview Text -->
|
|
39
|
-
<div style="display: none; max-height: 0; overflow: hidden;">${t}</div>
|
|
40
|
-
|
|
41
|
-
<table role="presentation" width="100%" border="0" cellspacing="0" cellpadding="0" class="email-card" style="max-width: 540px; margin: 0 auto; background-color: #ffffff; border: 1px solid #e4e4e7; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);">
|
|
42
|
-
<!-- Header Bar -->
|
|
43
|
-
<tr>
|
|
44
|
-
<td class="email-header" style="padding: 22px 28px; border-bottom: 1px solid #f4f4f5; background-color: #ffffff;">
|
|
45
|
-
<table role="presentation" width="100%" border="0" cellspacing="0" cellpadding="0">
|
|
46
|
-
<tr>
|
|
47
|
-
<td align="left" valign="middle">
|
|
48
|
-
<a href="https://kyro-cms.com" target="_blank" style="text-decoration: none; display: inline-flex; align-items: center; gap: 10px;">
|
|
49
|
-
<!-- Light Mode Logo -->
|
|
50
|
-
<img src="https://kyro-cms.com/logo.svg" alt="Kyro Logo" class="logo-light" height="24" style="display: inline-block; border: 0; max-height: 24px; vertical-align: middle;" />
|
|
51
|
-
<!-- Dark Mode Logo -->
|
|
52
|
-
<img src="https://kyro-cms.com/logo-white.svg" alt="Kyro Logo" class="logo-dark" height="24" style="display: none; border: 0; max-height: 24px; vertical-align: middle;" />
|
|
53
|
-
<span class="email-brand-text" style="font-size: 16px; font-weight: 700; color: #09090b; letter-spacing: -0.3px; vertical-align: middle;">Kyro CMS</span>
|
|
54
|
-
</a>
|
|
55
|
-
</td>
|
|
56
|
-
<td align="right" valign="middle">
|
|
57
|
-
<span class="badge-status" style="display: inline-block; padding: 4px 10px; background-color: ${d}; border: 1px solid ${p}; border-radius: 9999px; font-size: 11px; font-weight: 500; color: ${m};">
|
|
58
|
-
${r}
|
|
59
|
-
</span>
|
|
60
|
-
</td>
|
|
61
|
-
</tr>
|
|
62
|
-
</table>
|
|
63
|
-
</td>
|
|
64
|
-
</tr>
|
|
65
|
-
|
|
66
|
-
<!-- Body Section -->
|
|
67
|
-
<tr>
|
|
68
|
-
<td style="padding: 28px;">
|
|
69
|
-
<h1 class="email-title" style="margin: 0 0 12px; font-size: 20px; font-weight: 600; color: #09090b; letter-spacing: -0.3px;">
|
|
70
|
-
${e}
|
|
71
|
-
</h1>
|
|
72
|
-
|
|
73
|
-
${o}
|
|
74
|
-
|
|
75
|
-
${a&&n?`
|
|
76
|
-
<!-- Action Buttons -->
|
|
77
|
-
<table role="presentation" width="100%" border="0" cellspacing="0" cellpadding="0" style="margin-top: 24px;">
|
|
78
|
-
<tr>
|
|
79
|
-
<td align="left">
|
|
80
|
-
<a href="${n}" target="_blank" class="email-btn-primary" style="display: inline-block; padding: 11px 20px; background-color: #09090b; color: #ffffff; font-size: 13px; font-weight: 500; text-decoration: none; border-radius: 6px;">
|
|
81
|
-
${a} \u2192
|
|
82
|
-
</a>
|
|
83
|
-
${c&&g?`<a href="${g}" target="_blank" class="email-btn-secondary" style="display: inline-block; padding: 11px 16px; margin-left: 8px; background-color: #ffffff; border: 1px solid #e4e4e7; color: #09090b; font-size: 13px; font-weight: 500; text-decoration: none; border-radius: 6px;">
|
|
84
|
-
${c}
|
|
85
|
-
</a>`:""}
|
|
86
|
-
</td>
|
|
87
|
-
</tr>
|
|
88
|
-
</table>`:""}
|
|
89
|
-
</td>
|
|
90
|
-
</tr>
|
|
91
|
-
|
|
92
|
-
<!-- Footer -->
|
|
93
|
-
<tr>
|
|
94
|
-
<td class="email-footer" style="padding: 18px 28px; border-top: 1px solid #f4f4f5; background-color: #fafafa; text-align: center;">
|
|
95
|
-
<p class="email-footer-text" style="margin: 0 0 8px; font-size: 12px; color: #71717a;">
|
|
96
|
-
Sent securely via <strong>Kyro CMS Authentication Engine</strong>.
|
|
97
|
-
</p>
|
|
98
|
-
<p style="margin: 0; font-size: 12px; color: #71717a;">
|
|
99
|
-
<a href="https://kyro-cms.com" target="_blank" class="email-footer-link" style="color: #09090b; text-decoration: none; font-weight: 500;">kyro-cms.com</a> \u2022
|
|
100
|
-
<a href="https://kyro-cms.com/docs" target="_blank" class="email-footer-link" style="color: #09090b; text-decoration: none; font-weight: 500;">Docs</a> \u2022
|
|
101
|
-
<a href="https://github.com/danielDozie/kyro-cms" target="_blank" class="email-footer-link" style="color: #09090b; text-decoration: none; font-weight: 500;">GitHub</a>
|
|
102
|
-
</p>
|
|
103
|
-
</td>
|
|
104
|
-
</tr>
|
|
105
|
-
</table>
|
|
106
|
-
</body>
|
|
107
|
-
</html>`}function h(i,e="User"){let t="Confirm your email address \u2014 Kyro CMS",r=`
|
|
108
|
-
<p class="email-text" style="margin: 0 0 16px; font-size: 14px; line-height: 1.6; color: #52525b;">
|
|
109
|
-
Hello <strong class="email-strong" style="color: #09090b;">${e}</strong>,
|
|
110
|
-
</p>
|
|
111
|
-
<p class="email-text" style="margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: #52525b;">
|
|
112
|
-
Thank you for registering. Please confirm your email address by clicking the verification button below to activate your account.
|
|
113
|
-
</p>
|
|
114
|
-
|
|
115
|
-
<!-- Verification Token Link Card -->
|
|
116
|
-
<table role="presentation" width="100%" border="0" cellspacing="0" cellpadding="0" class="email-table" style="background-color: #fafafa; border: 1px solid #e4e4e7; border-radius: 8px; margin-bottom: 20px; padding: 14px; border-collapse: separate;">
|
|
117
|
-
<tr>
|
|
118
|
-
<td style="font-size: 12px; color: #71717a; line-height: 1.5; word-break: break-all;">
|
|
119
|
-
<strong>Direct link:</strong><br />
|
|
120
|
-
<a href="${i}" style="color: #09090b; text-decoration: underline;" class="email-value">${i}</a>
|
|
121
|
-
</td>
|
|
122
|
-
</tr>
|
|
123
|
-
</table>
|
|
124
|
-
|
|
125
|
-
<p class="email-text" style="margin: 0 0 8px; font-size: 12px; color: #71717a;">
|
|
126
|
-
This verification link will expire in 24 hours. If you did not create an account, you can safely ignore this email.
|
|
127
|
-
</p>
|
|
128
|
-
`,s=l({title:"Confirm Your Email Address",previewText:"Please confirm your email address to activate your Kyro CMS account.",badgeText:"Action Required",badgeType:"warning",bodyHtml:r,ctaText:"Confirm Email Address",ctaUrl:i,secondaryCtaText:"Documentation",secondaryCtaUrl:"https://kyro-cms.com/docs"}),o=`Welcome, ${e}!
|
|
129
|
-
|
|
130
|
-
Please verify your email address by visiting:
|
|
131
|
-
${i}
|
|
132
|
-
|
|
133
|
-
This link expires in 24 hours.
|
|
134
|
-
|
|
135
|
-
Kyro CMS \u2014 https://kyro-cms.com`;return {subject:t,html:s,text:o}}function y(i,e="User"){let t="Reset your password \u2014 Kyro CMS",r=`
|
|
136
|
-
<p class="email-text" style="margin: 0 0 16px; font-size: 14px; line-height: 1.6; color: #52525b;">
|
|
137
|
-
Hello <strong class="email-strong" style="color: #09090b;">${e}</strong>,
|
|
138
|
-
</p>
|
|
139
|
-
<p class="email-text" style="margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: #52525b;">
|
|
140
|
-
We received a request to reset the password for your account. Click the button below to choose a new password.
|
|
141
|
-
</p>
|
|
142
|
-
|
|
143
|
-
<!-- Reset Link Box -->
|
|
144
|
-
<table role="presentation" width="100%" border="0" cellspacing="0" cellpadding="0" class="email-table" style="background-color: #fafafa; border: 1px solid #e4e4e7; border-radius: 8px; margin-bottom: 20px; padding: 14px; border-collapse: separate;">
|
|
145
|
-
<tr>
|
|
146
|
-
<td style="font-size: 12px; color: #71717a; line-height: 1.5; word-break: break-all;">
|
|
147
|
-
<strong>Reset URL:</strong><br />
|
|
148
|
-
<a href="${i}" style="color: #09090b; text-decoration: underline;" class="email-value">${i}</a>
|
|
149
|
-
</td>
|
|
150
|
-
</tr>
|
|
151
|
-
</table>
|
|
152
|
-
|
|
153
|
-
<p class="email-text" style="margin: 0 0 8px; font-size: 12px; color: #71717a;">
|
|
154
|
-
For security reasons, this link will expire in 1 hour. If you did not request a password reset, no further action is required.
|
|
155
|
-
</p>
|
|
156
|
-
`,s=l({title:"Reset Your Password",previewText:"Use this secure link to reset your Kyro CMS password.",badgeText:"Security Action",badgeType:"warning",bodyHtml:r,ctaText:"Reset Password",ctaUrl:i}),o=`Hello ${e},
|
|
157
|
-
|
|
158
|
-
Reset your password using the following link:
|
|
159
|
-
${i}
|
|
160
|
-
|
|
161
|
-
This link will expire in 1 hour.
|
|
162
|
-
|
|
163
|
-
Kyro CMS \u2014 https://kyro-cms.com`;return {subject:t,html:s,text:o}}function b(i="User",e="https://kyro-cms.com"){let t="Welcome to Kyro CMS!",r=`
|
|
164
|
-
<p class="email-text" style="margin: 0 0 16px; font-size: 14px; line-height: 1.6; color: #52525b;">
|
|
165
|
-
Welcome <strong class="email-strong" style="color: #09090b;">${i}</strong>,
|
|
166
|
-
</p>
|
|
167
|
-
<p class="email-text" style="margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: #52525b;">
|
|
168
|
-
Your Kyro CMS account is now set up and ready to go. You can access your admin dashboard, build content collections, and manage schema endpoints.
|
|
169
|
-
</p>
|
|
170
|
-
|
|
171
|
-
<!-- Key Capabilities List -->
|
|
172
|
-
<table role="presentation" width="100%" border="0" cellspacing="0" cellpadding="0" class="email-table" style="background-color: #fafafa; border: 1px solid #e4e4e7; border-radius: 8px; margin-bottom: 24px; padding: 16px; border-collapse: separate;">
|
|
173
|
-
<tr>
|
|
174
|
-
<td style="font-size: 13px; color: #09090b; line-height: 1.6;" class="email-value">
|
|
175
|
-
\u{1F680} <strong>What you can do next:</strong>
|
|
176
|
-
<ul style="margin: 8px 0 0; padding-left: 20px; color: #52525b;">
|
|
177
|
-
<li>Define collections & custom field schemas in <code style="font-family: monospace;">kyro.config.ts</code></li>
|
|
178
|
-
<li>Explore auto-generated REST, GraphQL, tRPC & WebSocket endpoints</li>
|
|
179
|
-
<li>Customize your visual Admin dashboard & branding settings</li>
|
|
180
|
-
</ul>
|
|
181
|
-
</td>
|
|
182
|
-
</tr>
|
|
183
|
-
</table>
|
|
184
|
-
`,s=l({title:"Welcome to Kyro CMS",previewText:"Your account is verified and ready. Start building content applications.",badgeText:"Account Ready",badgeType:"success",bodyHtml:r,ctaText:"Open Dashboard",ctaUrl:e,secondaryCtaText:"Documentation",secondaryCtaUrl:"https://kyro-cms.com/docs"}),o=`Welcome to Kyro CMS, ${i}!
|
|
185
|
-
|
|
186
|
-
Your account is active. Log in at ${e} to start building.
|
|
187
|
-
|
|
188
|
-
Documentation: https://kyro-cms.com/docs`;return {subject:t,html:s,text:o}}function x(i="User"){let e="Security Alert: Password Changed \u2014 Kyro CMS",t=new Date().toUTCString(),r=`
|
|
189
|
-
<p class="email-text" style="margin: 0 0 16px; font-size: 14px; line-height: 1.6; color: #52525b;">
|
|
190
|
-
Hello <strong class="email-strong" style="color: #09090b;">${i}</strong>,
|
|
191
|
-
</p>
|
|
192
|
-
<p class="email-text" style="margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: #52525b;">
|
|
193
|
-
This email confirms that the password for your Kyro CMS account was successfully updated on <strong>${t}</strong>.
|
|
194
|
-
</p>
|
|
195
|
-
|
|
196
|
-
<!-- Security Warning Card -->
|
|
197
|
-
<table role="presentation" width="100%" border="0" cellspacing="0" cellpadding="0" class="email-table" style="background-color: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; margin-bottom: 20px; padding: 14px; border-collapse: separate;">
|
|
198
|
-
<tr>
|
|
199
|
-
<td style="font-size: 13px; color: #991b1b; line-height: 1.5;">
|
|
200
|
-
\u26A0\uFE0F <strong>Did not request this change?</strong><br />
|
|
201
|
-
If you did not initiate this change, your account may be compromised. Reset your password immediately and contact an administrator.
|
|
202
|
-
</td>
|
|
203
|
-
</tr>
|
|
204
|
-
</table>
|
|
205
|
-
`,s=l({title:"Password Updated",previewText:"Your Kyro CMS account password was updated.",badgeText:"Security Alert",badgeType:"warning",bodyHtml:r,ctaText:"Account Security",ctaUrl:"https://kyro-cms.com"}),o=`Security Alert: Your Kyro CMS password was updated at ${t}.
|
|
206
|
-
|
|
207
|
-
If you did not make this change, please reset your password immediately.
|
|
208
|
-
|
|
209
|
-
Kyro CMS \u2014 https://kyro-cms.com`;return {subject:e,html:s,text:o}}function _(i,e,t="User"){let r="Your one-time login link \u2014 Kyro CMS",s=`
|
|
210
|
-
<p class="email-text" style="margin: 0 0 16px; font-size: 14px; line-height: 1.6; color: #52525b;">
|
|
211
|
-
Hello <strong class="email-strong" style="color: #09090b;">${t}</strong>,
|
|
212
|
-
</p>
|
|
213
|
-
<p class="email-text" style="margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: #52525b;">
|
|
214
|
-
Click the button below to sign in to your Kyro CMS account without entering a password.
|
|
215
|
-
</p>
|
|
216
|
-
|
|
217
|
-
${e?`
|
|
218
|
-
<!-- One-Time Passcode Box -->
|
|
219
|
-
<table role="presentation" width="100%" border="0" cellspacing="0" cellpadding="0" class="email-table" style="background-color: #fafafa; border: 1px solid #e4e4e7; border-radius: 8px; margin-bottom: 20px; padding: 16px; text-align: center;">
|
|
220
|
-
<tr>
|
|
221
|
-
<td style="font-size: 12px; color: #71717a; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px;">
|
|
222
|
-
One-Time Passcode
|
|
223
|
-
</td>
|
|
224
|
-
</tr>
|
|
225
|
-
<tr>
|
|
226
|
-
<td style="font-size: 28px; font-weight: 800; font-family: monospace; color: #09090b; letter-spacing: 4px;" class="email-code-box">
|
|
227
|
-
${e}
|
|
228
|
-
</td>
|
|
229
|
-
</tr>
|
|
230
|
-
</table>`:""}
|
|
231
|
-
|
|
232
|
-
<p class="email-text" style="margin: 0 0 8px; font-size: 12px; color: #71717a;">
|
|
233
|
-
This single-use link will expire in 10 minutes. Never share authentication links with anyone.
|
|
234
|
-
</p>
|
|
235
|
-
`,o=l({title:"Sign in to Kyro CMS",previewText:"Your secure magic login link for Kyro CMS.",badgeText:"Instant Login",badgeType:"info",bodyHtml:s,ctaText:"Sign In Now",ctaUrl:i}),a=`Hello ${t},
|
|
236
|
-
|
|
237
|
-
Sign in to Kyro CMS using the link below:
|
|
238
|
-
${i}${e?`
|
|
239
|
-
|
|
240
|
-
Or enter code: ${e}`:""}
|
|
241
|
-
|
|
242
|
-
This link expires in 10 minutes.
|
|
243
|
-
|
|
244
|
-
Kyro CMS \u2014 https://kyro-cms.com`;return {subject:r,html:o,text:a}}function S(i,e,t="User"){let r="Security Alert: Account Temporarily Locked \u2014 Kyro CMS",s=`
|
|
245
|
-
<p class="email-text" style="margin: 0 0 16px; font-size: 14px; line-height: 1.6; color: #52525b;">
|
|
246
|
-
Hello <strong class="email-strong" style="color: #09090b;">${t}</strong>,
|
|
247
|
-
</p>
|
|
248
|
-
<p class="email-text" style="margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: #52525b;">
|
|
249
|
-
Your Kyro CMS account was temporarily locked after <strong>${i} failed login attempts</strong>.
|
|
250
|
-
</p>
|
|
251
|
-
|
|
252
|
-
<!-- Lockout Notice Card -->
|
|
253
|
-
<table role="presentation" width="100%" border="0" cellspacing="0" cellpadding="0" class="email-table" style="background-color: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; margin-bottom: 20px; padding: 14px; border-collapse: separate;">
|
|
254
|
-
<tr>
|
|
255
|
-
<td style="font-size: 13px; color: #b45309; line-height: 1.5;">
|
|
256
|
-
\u{1F512} <strong>Lockout duration:</strong> ${e} minutes.<br />
|
|
257
|
-
You may try logging in again after the cooling-off period expires.
|
|
258
|
-
</td>
|
|
259
|
-
</tr>
|
|
260
|
-
</table>
|
|
261
|
-
`,o=l({title:"Account Temporarily Locked",previewText:"Your Kyro CMS account was locked due to multiple failed login attempts.",badgeText:"Security Lockout",badgeType:"warning",bodyHtml:s,ctaText:"Unlock Instructions",ctaUrl:"https://kyro-cms.com/docs"}),a=`Security Alert: Account temporarily locked for ${t} after ${i} failed login attempts. Unlocks in ${e} minutes.
|
|
262
|
-
|
|
263
|
-
Kyro CMS \u2014 https://kyro-cms.com`;return {subject:r,html:o,text:a}}function T(i,e="Editor",t="An Administrator"){let r="You're invited to join Kyro CMS",s=`
|
|
264
|
-
<p class="email-text" style="margin: 0 0 16px; font-size: 14px; line-height: 1.6; color: #52525b;">
|
|
265
|
-
Hello,
|
|
266
|
-
</p>
|
|
267
|
-
<p class="email-text" style="margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: #52525b;">
|
|
268
|
-
<strong class="email-strong" style="color: #09090b;">${t}</strong> has invited you to join their team workspace as an <strong>${e}</strong> in Kyro CMS.
|
|
269
|
-
</p>
|
|
270
|
-
|
|
271
|
-
<!-- Invite Details Card -->
|
|
272
|
-
<table role="presentation" width="100%" border="0" cellspacing="0" cellpadding="0" class="email-table" style="background-color: #fafafa; border: 1px solid #e4e4e7; border-radius: 8px; margin-bottom: 20px; padding: 14px; border-collapse: separate;">
|
|
273
|
-
<tr>
|
|
274
|
-
<td style="font-size: 13px; color: #09090b; line-height: 1.6;" class="email-value">
|
|
275
|
-
<strong>Assigned Role:</strong> ${e}<br />
|
|
276
|
-
<strong>Invited By:</strong> ${t}
|
|
277
|
-
</td>
|
|
278
|
-
</tr>
|
|
279
|
-
</table>
|
|
280
|
-
`,o=l({title:"Workspace Invitation",previewText:`You have been invited to join Kyro CMS as an ${e}.`,badgeText:"Team Invite",badgeType:"info",bodyHtml:s,ctaText:"Accept Invitation",ctaUrl:i,secondaryCtaText:"Documentation",secondaryCtaUrl:"https://kyro-cms.com/docs"}),a=`You're invited to join Kyro CMS as an ${e} by ${t}.
|
|
281
|
-
|
|
282
|
-
Accept your invitation here:
|
|
283
|
-
${i}
|
|
284
|
-
|
|
285
|
-
Kyro CMS \u2014 https://kyro-cms.com`;return {subject:r,html:o,text:a}}function w(){return {verifyEmail:(i,e)=>h(i,e),resetPassword:(i,e)=>y(i,e),welcome:(i,e)=>b(i,e),passwordChanged:i=>x(i),magicLink:(i,e,t)=>_(i,e,t),accountLocked:(i,e,t)=>S(i,e,t),newLogin:(i,e,t="User")=>{let r="Security Alert: New Sign-in to Kyro CMS",s=`New login detected for ${t} at ${e} from ${i}.`,o=`<p>${s}</p>`;return {subject:r,html:o,text:s}},userInvite:(i,e,t)=>T(i,e,t)}}var C=false,u=class i{db;cache={};loaded=false;static SENSITIVE_KEYS=["storage.s3.secret_access_key","storage.r2.secret_access_key","storage.gcs.private_key","storage.backblaze.application_key","storage.wasabi.secret_access_key","storage.ftp.password","storage.bunny.api_key","storage.cloudinary.api_secret","storage.imgix.sign_key","email.smtp.pass","auth.jwt_secret","auth.github_secret","auth.google_secret","auth.app_secret","database.url","redis.url","auth.admin_password"];constructor(e){this.db=e;}async load(){if(!this.loaded){await this.ensureSettingsTable();try{if(typeof this.db?.select=="function"){let e=await this.db.select().from(chunkWIZ6C5QZ_cjs.a);this.cache=e.reduce((t,r)=>(t[r.key]=r.value,t),{});}await this.loadFromGlobals();}catch{console.warn("ConfigService: Could not load settings from database, using environment fallbacks.");}this.loaded=true;}}async ensureSettingsTable(){if(!C)try{if(typeof this.db?.execute=="function"){let{sql:e}=await import('drizzle-orm');await this.db.execute(e`
|
|
286
|
-
CREATE TABLE IF NOT EXISTS "settings" (
|
|
287
|
-
"key" VARCHAR(255) PRIMARY KEY,
|
|
288
|
-
"value" TEXT NOT NULL,
|
|
289
|
-
"description" TEXT,
|
|
290
|
-
"updated_at" TIMESTAMP DEFAULT NOW()
|
|
291
|
-
)
|
|
292
|
-
`),C=!0;}else typeof this.db?.exec=="function"&&(this.db.exec(`
|
|
293
|
-
CREATE TABLE IF NOT EXISTS settings (
|
|
294
|
-
key TEXT PRIMARY KEY,
|
|
295
|
-
value TEXT NOT NULL,
|
|
296
|
-
description TEXT,
|
|
297
|
-
updated_at TEXT
|
|
298
|
-
)
|
|
299
|
-
`),C=!0);}catch{}}async loadFromGlobals(){try{let e=null;if(typeof this.db?.findOne=="function")try{let s=await this.db.findOne({collection:"_globals_storage-settings",where:{},draft:!0});s&&(e=s);}catch{}if(!e&&typeof this.db?.execute=="function"){let{sql:s}=await import('drizzle-orm'),o=['"_globals_storage-settings"','"_globals_storage_settings"','"global_storage_settings"'];for(let a of o)try{let n=await this.db.execute(s`SELECT * FROM ${s.raw(a)} LIMIT 1`);if(e=Array.isArray(n)?n[0]:n?.rows?n.rows[0]:null,e)break}catch{}}else if(!e&&typeof this.db?.prepare=="function"){let s=['"_globals_storage-settings"','"_globals_storage_settings"','"global_storage_settings"'];for(let o of s)try{if(e=this.db.prepare(`SELECT * FROM ${o} LIMIT 1`).get(),e)break}catch{}}if(!e)return;let t=s=>{if(!s)return null;if(typeof s=="string")try{return JSON.parse(s)}catch{return null}return s},r=e.provider||"local";if(this.cache["storage.type"]=r,r==="local"){let s=t(e.local);this.cache["storage.local.dir"]=s?.uploadDir||"./public/uploads",this.cache["storage.local.url"]=s?.baseUrl||"/uploads";}if(r==="aws"){let s=t(e.aws);this.cache["storage.s3.bucket"]=s?.bucket||"",this.cache["storage.s3.region"]=s?.region||"us-east-1",this.cache["storage.s3.access_key_id"]=s?.accessKeyId||"",this.cache["storage.s3.secret_access_key"]=s?.secretAccessKey||"",this.cache["storage.s3.endpoint"]=s?.endpoint||"",this.cache["storage.s3.cdn_url"]=s?.cdnUrl||"",this.cache["storage.s3.prefix"]=s?.prefix||"";}if(r==="r2"){let s=t(e.r2);this.cache["storage.r2.account_id"]=s?.accountId||"",this.cache["storage.r2.access_key_id"]=s?.accessKeyId||"",this.cache["storage.r2.secret_access_key"]=s?.secretAccessKey||"",this.cache["storage.r2.bucket"]=s?.bucket||"",this.cache["storage.r2.cdn_url"]=s?.cdnUrl||"",this.cache["storage.r2.prefix"]=s?.prefix||"";}if(r==="cloudinary"){let s=t(e.cloudinary);this.cache["storage.cloudinary.cloud_name"]=s?.cloudName||"",this.cache["storage.cloudinary.api_key"]=s?.apiKey||"",this.cache["storage.cloudinary.api_secret"]=s?.apiSecret||"",this.cache["storage.cloudinary.folder"]=s?.folder||"";}if(r==="ftp"){let s=t(e.ftp);this.cache["storage.ftp.host"]=s?.host||"",this.cache["storage.ftp.port"]=String(s?.port||"21"),this.cache["storage.ftp.user"]=s?.user||"",this.cache["storage.ftp.password"]=s?.password||"",this.cache["storage.ftp.secure"]=s?.secure?"true":"false",this.cache["storage.ftp.base_url"]=s?.baseUrl||"",this.cache["storage.ftp.prefix"]=s?.prefix||"";}}catch(e){console.warn("ConfigService: Could not load storage settings from globals table:",e);}try{let e=null;if(typeof this.db?.findOne=="function")try{let t=await this.db.findOne({collection:"_globals_email-settings",where:{},draft:!0});t&&(e=t);}catch{}if(!e&&typeof this.db?.execute=="function"){let{sql:t}=await import('drizzle-orm'),r=['"_globals_email-settings"','"_globals_email_settings"','"global_email_settings"'];for(let s of r)try{let o=await this.db.execute(t`SELECT * FROM ${t.raw(s)} LIMIT 1`);if(e=Array.isArray(o)?o[0]:o?.rows?o.rows[0]:null,e)break}catch{}}else if(!e&&typeof this.db?.prepare=="function"){let t=['"_globals_email-settings"','"_globals_email_settings"','"global_email_settings"'];for(let r of t)try{if(e=this.db.prepare(`SELECT * FROM ${r} LIMIT 1`).get(),e)break}catch{}}if(e){let t=r=>{if(!r)return null;if(typeof r=="string")try{return JSON.parse(r)}catch{return null}return r};if(this.cache["email.provider"]=e.provider||"smtp",this.cache["email.smtp.from"]=e.fromEmail||"",this.cache["email.smtp.from_name"]=e.fromName||"",this.cache["email.smtp.reply_to"]=e.replyTo||"",e.provider==="smtp"){let r=t(e.smtp);this.cache["email.smtp.host"]=r?.host||"",this.cache["email.smtp.port"]=String(r?.port||"587"),this.cache["email.smtp.user"]=r?.username||"",this.cache["email.smtp.pass"]=r?.password||"",this.cache["email.smtp.secure"]=r?.secure?"true":"false";}else if(e.provider==="resend"){let r=t(e.resend);this.cache["email.smtp.pass"]=r?.apiKey||"";}else if(e.provider==="sendgrid"){let r=t(e.sendgrid);this.cache["email.smtp.pass"]=r?.apiKey||"";}else if(e.provider==="mailgun"){let r=t(e.mailgun);this.cache["email.smtp.pass"]=r?.apiKey||"";}else if(e.provider==="ses"){let r=t(e.ses);this.cache["email.smtp.user"]=r?.accessKeyId||"",this.cache["email.smtp.pass"]=r?.secretAccessKey||"";}}}catch(e){console.warn("ConfigService: Could not load email settings from globals table:",e);}}get(e,t,r){return this.cache[e]?this.cache[e]:t&&process.env[t]?process.env[t]:r}getStorageConfig(){let e="local";return typeof globalThis.STORAGE_BUCKET<"u"&&(e="cloudflare_r2"),{type:this.get("storage.type","STORAGE_TYPE",e),s3:{bucket:this.get("storage.s3.bucket","STORAGE_BUCKET"),region:this.get("storage.s3.region","STORAGE_REGION","us-east-1"),accessKeyId:this.get("storage.s3.access_key_id","STORAGE_ACCESS_KEY_ID"),secretAccessKey:this.get("storage.s3.secret_access_key","STORAGE_SECRET_ACCESS_KEY"),endpoint:this.get("storage.s3.endpoint","STORAGE_ENDPOINT"),cdnUrl:this.get("storage.s3.cdn_url","STORAGE_CDN_URL"),prefix:this.get("storage.s3.prefix","STORAGE_PREFIX")},r2:{accountId:this.get("storage.r2.account_id","R2_ACCOUNT_ID"),accessKeyId:this.get("storage.r2.access_key_id","R2_ACCESS_KEY_ID"),secretAccessKey:this.get("storage.r2.secret_access_key","R2_SECRET_ACCESS_KEY"),bucket:this.get("storage.r2.bucket","R2_BUCKET"),cdnUrl:this.get("storage.r2.cdn_url","R2_CDN_URL"),prefix:this.get("storage.r2.prefix","R2_PREFIX")},gcs:{bucket:this.get("storage.gcs.bucket","GCS_BUCKET"),projectId:this.get("storage.gcs.project_id","GCS_PROJECT_ID"),clientEmail:this.get("storage.gcs.client_email","GCS_CLIENT_EMAIL"),privateKey:this.get("storage.gcs.private_key","GCS_PRIVATE_KEY"),cdnUrl:this.get("storage.gcs.cdn_url","GCS_CDN_URL"),prefix:this.get("storage.gcs.prefix","GCS_PREFIX")},digitalocean:{bucket:this.get("storage.digitalocean.bucket","DO_BUCKET"),region:this.get("storage.digitalocean.region","DO_REGION","nyc3"),accessKeyId:this.get("storage.digitalocean.access_key_id","DO_ACCESS_KEY_ID"),secretAccessKey:this.get("storage.digitalocean.secret_access_key","DO_SECRET_ACCESS_KEY"),cdnUrl:this.get("storage.digitalocean.cdn_url","DO_CDN_URL"),prefix:this.get("storage.digitalocean.prefix","DO_PREFIX")},backblaze:{bucket:this.get("storage.backblaze.bucket","BB_BUCKET"),accountId:this.get("storage.backblaze.account_id","BB_ACCOUNT_ID"),applicationKeyId:this.get("storage.backblaze.application_key_id","BB_APPLICATION_KEY_ID"),applicationKey:this.get("storage.backblaze.application_key","BB_APPLICATION_KEY"),cdnUrl:this.get("storage.backblaze.cdn_url","BB_CDN_URL"),prefix:this.get("storage.backblaze.prefix","BB_PREFIX")},wasabi:{bucket:this.get("storage.wasabi.bucket","WASABI_BUCKET"),region:this.get("storage.wasabi.region","WASABI_REGION","us-east-1"),accessKeyId:this.get("storage.wasabi.access_key_id","WASABI_ACCESS_KEY_ID"),secretAccessKey:this.get("storage.wasabi.secret_access_key","WASABI_SECRET_ACCESS_KEY"),cdnUrl:this.get("storage.wasabi.cdn_url","WASABI_CDN_URL"),prefix:this.get("storage.wasabi.prefix","WASABI_PREFIX")},bunny:{storageZone:this.get("storage.bunny.storage_zone","BUNNY_STORAGE_ZONE"),apiKey:this.get("storage.bunny.api_key","BUNNY_API_KEY"),cdnUrl:this.get("storage.bunny.cdn_url","BUNNY_CDN_URL"),prefix:this.get("storage.bunny.prefix","BUNNY_PREFIX")},ftp:{host:this.get("storage.ftp.host","FTP_HOST"),port:parseInt(this.get("storage.ftp.port","FTP_PORT","21"),10),user:this.get("storage.ftp.user","FTP_USER"),password:this.get("storage.ftp.password","FTP_PASSWORD"),secure:this.get("storage.ftp.secure","FTP_SECURE")==="true",baseUrl:this.get("storage.ftp.base_url","FTP_BASE_URL"),prefix:this.get("storage.ftp.prefix","FTP_PREFIX")},cloudinary:{cloudName:this.get("storage.cloudinary.cloud_name","CLOUDINARY_CLOUD_NAME"),apiKey:this.get("storage.cloudinary.api_key","CLOUDINARY_API_KEY"),apiSecret:this.get("storage.cloudinary.api_secret","CLOUDINARY_API_SECRET"),folder:this.get("storage.cloudinary.folder","CLOUDINARY_FOLDER")},imgix:{domain:this.get("storage.imgix.domain","IMGIX_DOMAIN"),signKey:this.get("storage.imgix.sign_key","IMGIX_SIGN_KEY")},local:{uploadDir:this.get("storage.local.dir","STORAGE_LOCAL_DIR","./public/uploads"),baseUrl:this.get("storage.local.url","STORAGE_LOCAL_URL","/uploads")}}}getEmailConfig(){return {provider:this.get("email.provider","EMAIL_PROVIDER","smtp"),host:this.get("email.smtp.host","SMTP_HOST"),port:parseInt(this.get("email.smtp.port","SMTP_PORT","587"),10),secure:this.get("email.smtp.secure","SMTP_SECURE")==="true",user:this.get("email.smtp.user","SMTP_USER"),pass:this.get("email.smtp.pass","SMTP_PASS"),from:this.get("email.smtp.from","SMTP_FROM","noreply@example.com"),fromName:this.get("email.smtp.from_name","SMTP_FROM_NAME","Kyro CMS"),replyTo:this.get("email.smtp.reply_to","SMTP_REPLY_TO")}}maskSensitive(e,t){return t&&(i.SENSITIVE_KEYS.includes(e)?"********":t)}async set(e,t,r){await this.db.insert(chunkWIZ6C5QZ_cjs.a).values({key:e,value:t,description:r,updatedAt:new Date}).onConflictDoUpdate({target:[chunkWIZ6C5QZ_cjs.a.key],set:{value:t,description:r,updatedAt:new Date}}),this.cache[e]=t;}};var E=class i{transporter;config;templates;transporterInitialized=false;constructor(e,t){this.config=e,this.templates={...w(),...t};}async ensureTransporter(){if(this.transporterInitialized)return this.transporter;let{default:e}=await import('nodemailer');return this.config.provider==="smtp"&&this.config.smtp?this.transporter=e.createTransport({host:this.config.smtp.host,port:this.config.smtp.port,secure:this.config.smtp.secure,auth:this.config.smtp.auth}):this.config.provider==="ses"&&this.config.ses&&(this.transporter=e.createTransport({host:`email-smtp.${this.config.ses.region}.amazonaws.com`,port:587,secure:false,auth:{user:this.config.ses.accessKeyId,pass:this.config.ses.secretAccessKey}})),this.transporterInitialized=true,this.transporter}async send(e){let{provider:t,from:r,fromName:s,replyTo:o}=this.config,a=`"${s||"Kyro CMS"}" <${r}>`,n=e.replyTo||o;try{let c;switch(t){case "smtp":case "ses":{let g=await this.ensureTransporter();if(!g)throw new Error(`${t} transporter not initialized`);c=await g.sendMail({from:a,to:Array.isArray(e.to)?e.to.join(", "):e.to,subject:e.subject,html:e.html,text:e.text,replyTo:n});}break;case "resend":c=await this.sendViaResend(a,e,n);break;case "sendgrid":c=await this.sendViaSendGrid(a,e,n);break;case "mailgun":c=await this.sendViaMailgun(a,e,n);break;default:throw new Error(`Unsupported email provider: ${t}`)}return c}catch(c){throw console.error("[EmailTransport] FAILED to send email:",c.message),c.response&&console.error("[EmailTransport] Provider Error Detail:",JSON.stringify(c.response,null,2)),c}}async sendViaResend(e,t,r){let s=this.config.resend?.apiKey;if(!s)throw new Error("Resend API Key missing");let o={from:e,to:t.to,subject:t.subject,html:t.html,text:t.text,reply_to:r},a=await fetch("https://api.resend.com/emails",{method:"POST",headers:{Authorization:`Bearer ${s}`,"Content-Type":"application/json"},body:JSON.stringify(o)});if(!a.ok){let n=await a.json();throw new Error(`Resend Error: ${JSON.stringify(n)}`)}return a.json()}async sendViaSendGrid(e,t,r){let s=this.config.sendgrid?.apiKey;if(!s)throw new Error("SendGrid API Key missing");let o={personalizations:[{to:Array.isArray(t.to)?t.to.map(n=>({email:n})):[{email:t.to}]}],from:{email:e.match(/<(.+)>/)?.[1]||e,name:e.match(/"(.+)"/)?.[1]},subject:t.subject,content:[{type:"text/plain",value:t.text||""},{type:"text/html",value:t.html}],reply_to:r?{email:r}:void 0},a=await fetch("https://api.sendgrid.com/v3/mail/send",{method:"POST",headers:{Authorization:`Bearer ${s}`,"Content-Type":"application/json"},body:JSON.stringify(o)});if(!a.ok){let n=await a.json();throw new Error(`SendGrid Error: ${JSON.stringify(n)}`)}return {success:true}}async sendViaMailgun(e,t,r){let{apiKey:s,domain:o,region:a}=this.config.mailgun||{};if(!s||!o)throw new Error("Mailgun config missing");let n=a==="eu"?"api.eu.mailgun.net":"api.mailgun.net",c=btoa(`api:${s}`),g=new URLSearchParams;g.append("from",e);let d=Array.isArray(t.to)?t.to.join(", "):t.to;g.append("to",d),g.append("subject",t.subject),g.append("html",t.html),t.text&&g.append("text",t.text),r&&g.append("h:Reply-To",r);let p=await fetch(`https://${n}/v3/${o}/messages`,{method:"POST",headers:{Authorization:`Basic ${c}`,"Content-Type":"application/x-www-form-urlencoded"},body:g});if(!p.ok){let m=await p.json();throw new Error(`Mailgun Error: ${JSON.stringify(m)}`)}return p.json()}getTemplates(){return this.templates}async verifyConnection(){if(this.config.provider==="smtp"||this.config.provider==="ses")try{let e=await this.ensureTransporter();if(e)return await e.verify(),!0}catch{return false}return !!(this.config.resend?.apiKey||this.config.sendgrid?.apiKey||this.config.mailgun?.apiKey)}static async fromConfig(e){let t=new u(e);await t.load();let r=t.getEmailConfig();if(!r.provider)return this.fromEnv();let s={provider:r.provider||"smtp",from:r.from||"noreply@example.com",fromName:r.fromName,replyTo:r.replyTo,smtp:r.provider==="smtp"?{host:r.host||"",port:r.port||587,secure:r.secure||false,auth:{user:r.user||"",pass:r.pass||""}}:void 0,resend:r.provider==="resend"?{apiKey:r.pass||""}:void 0,sendgrid:r.provider==="sendgrid"?{apiKey:r.pass||""}:void 0,mailgun:r.provider==="mailgun"?{apiKey:r.pass||"",domain:r.host||"",region:r.secure?"eu":"us"}:void 0,ses:r.provider==="ses"?{accessKeyId:r.user||"",secretAccessKey:r.pass||"",region:r.host||"us-east-1"}:void 0};return new i(s)}static fromEnv(){let e=process.env.EMAIL_PROVIDER||"smtp",t=process.env.SMTP_FROM||process.env.DEFAULT_FROM||"noreply@example.com",r=process.env.SMTP_FROM_NAME||"Kyro CMS",s=process.env.SMTP_REPLY_TO;if(e==="smtp"){let o=process.env.SMTP_HOST,a=process.env.SMTP_USER,n=process.env.SMTP_PASS;return !o||!a||!n?null:new i({provider:"smtp",from:t,fromName:r,replyTo:s,smtp:{host:o,port:parseInt(process.env.SMTP_PORT||"587",10),secure:process.env.SMTP_SECURE==="true",auth:{user:a,pass:n}}})}if(e==="resend"){let o=process.env.RESEND_API_KEY||process.env.SMTP_PASS;return o?new i({provider:"resend",from:t,fromName:r,replyTo:s,resend:{apiKey:o}}):null}if(e==="sendgrid"){let o=process.env.SENDGRID_API_KEY||process.env.SMTP_PASS;return o?new i({provider:"sendgrid",from:t,fromName:r,replyTo:s,sendgrid:{apiKey:o}}):null}if(e==="mailgun"){let o=process.env.MAILGUN_API_KEY||process.env.SMTP_PASS,a=process.env.MAILGUN_DOMAIN||process.env.SMTP_HOST;return !o||!a?null:new i({provider:"mailgun",from:t,fromName:r,replyTo:s,mailgun:{apiKey:o,domain:a,region:process.env.MAILGUN_REGION||(process.env.SMTP_SECURE==="true"?"eu":"us")}})}if(e==="ses"){let o=process.env.AWS_ACCESS_KEY_ID||process.env.SMTP_USER,a=process.env.AWS_SECRET_ACCESS_KEY||process.env.SMTP_PASS,n=process.env.AWS_REGION||process.env.SMTP_HOST||"us-east-1";return !o||!a?null:new i({provider:"ses",from:t,fromName:r,replyTo:s,ses:{accessKeyId:o,secretAccessKey:a,region:n}})}return null}};var v={minLength:12,requireUppercase:true,requireLowercase:true,requireNumbers:true,requireSpecialChars:true,preventReuse:5,maxLength:128},k=class{config;constructor(e={}){this.config={...v,...e};}validate(e){let t=[];return this.config.maxLength&&e.length>this.config.maxLength&&t.push(`Password must not exceed ${this.config.maxLength} characters`),e.length<this.config.minLength&&t.push(`Password must be at least ${this.config.minLength} characters`),this.config.requireUppercase&&!/[A-Z]/.test(e)&&t.push("Password must contain at least one uppercase letter"),this.config.requireLowercase&&!/[a-z]/.test(e)&&t.push("Password must contain at least one lowercase letter"),this.config.requireNumbers&&!/[0-9]/.test(e)&&t.push("Password must contain at least one number"),this.config.requireSpecialChars&&!/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/.test(e)&&t.push("Password must contain at least one special character"),["password","123456","12345678","qwerty","abc123","monkey","1234567","letmein","trustno1","dragon","baseball","iloveyou","master","sunshine","ashley","football","password1","shadow","123123","654321"].includes(e.toLowerCase())&&t.push("This password is too common. Please choose a more secure password"),(/^[a-zA-Z]+$/.test(e)||/^[0-9]+$/.test(e))&&t.push("Password must contain a mix of letters, numbers, and/or special characters"),/(.)\1{2,}/.test(e)&&t.push("Password must not contain more than 2 consecutive identical characters"),/^(012|123|234|345|456|567|678|789|890|098|987|876|765|654|543|432|321|210)+$/i.test(e)&&t.push("Password must not contain sequential numbers or letters"),{valid:t.length===0,errors:t}}async checkReuse(e,t,r){return {valid:true,errors:[]}}async isInHistory(e,t,r){for(let s of t)if(await r(e,s))return true;return false}generatePassword(e=16){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZ",r="abcdefghijklmnopqrstuvwxyz",s="0123456789",o="!@#$%^&*()_+-=[]{}|;:,.<>?",a="";a+=t[Math.floor(Math.random()*t.length)],a+=r[Math.floor(Math.random()*r.length)],a+=s[Math.floor(Math.random()*s.length)],a+=o[Math.floor(Math.random()*o.length)];let n=t+r+s+o;for(let c=a.length;c<e;c++)a+=n[Math.floor(Math.random()*n.length)];return a.split("").sort(()=>Math.random()-.5).join("")}getStrength(e){let t=0,r=[];e.length>=8&&(t+=1),e.length>=12&&(t+=1),e.length>=16&&(t+=1),/[a-z]/.test(e)&&(t+=1),/[A-Z]/.test(e)&&(t+=1),/[0-9]/.test(e)&&(t+=1),/[!@#$%^&*()_+\-=\[\]{}|;:,.<>?]/.test(e)&&(t+=1),e.length>8&&(t+=1),e.length>12&&(t+=1);let s=new Set(e).size;s>6&&(t+=1),s>10&&(t+=1);let o;return t<=3?(o="Weak",r.push("Add more characters"),r.push("Include uppercase and lowercase letters")):t<=5?(o="Fair",r.push("Add special characters"),r.push("Consider making it longer")):t<=7?(o="Good",r.push("Consider making it longer for extra security")):o="Strong",{score:t,label:o,feedback:r}}setConfig(e){this.config={...this.config,...e};}getConfig(){return {...this.config}}};
|
|
300
|
-
exports.a=l;exports.b=h;exports.c=y;exports.d=b;exports.e=x;exports.f=_;exports.g=S;exports.h=T;exports.i=w;exports.j=u;exports.k=E;exports.l=k;
|