@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-FLS2FJM6.cjs
DELETED
|
@@ -1,431 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkHPYH7GTS_cjs=require('./chunk-HPYH7GTS.cjs'),chunkBUNLC3II_cjs=require('./chunk-BUNLC3II.cjs');chunkBUNLC3II_cjs.h();function g(i){let{brand:e,title:t,previewText:r=t,bodyHtml:s,ctaText:o,ctaUrl:n,secondaryCtaText:a,secondaryCtaUrl:l}=i,p=e?.siteName||"Kyro CMS",f=e?.logoUrl||"https://kyro-cms.com/logo.svg",m=e?.logoDarkUrl||e?.logoUrl||"https://kyro-cms.com/logo-white.svg",u=e?.appUrl||"https://kyro-cms.com";return `<!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>${t}</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: 24px 12px; background-color: #fafafa; 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;">${r}</div>
|
|
40
|
-
|
|
41
|
-
<table role="presentation" width="100%" border="0" cellspacing="0" cellpadding="0" class="email-card" style="max-width: 480px; margin: 0 auto; background-color: #ffffff; border: 1px solid #f4f4f5; border-radius: 16px; overflow: hidden; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);">
|
|
42
|
-
<!-- Header Bar -->
|
|
43
|
-
<tr>
|
|
44
|
-
<td class="email-header" style="padding: 16px 24px; border-bottom: 1px solid #fafafa; background-color: #ffffff;">
|
|
45
|
-
<table role="presentation" width="100%" border="0" cellspacing="0" cellpadding="0">
|
|
46
|
-
<tr>
|
|
47
|
-
<td align="center" valign="middle">
|
|
48
|
-
<a href="${u}" target="_blank" style="text-decoration: none; display: inline-flex; align-items: center; gap: 8px;">
|
|
49
|
-
<!-- Light Mode Logo -->
|
|
50
|
-
<img src="${f}" alt="${p} Logo" class="logo-light" height="22" style="display: inline-block; border: 0; max-height: 22px; vertical-align: middle;" />
|
|
51
|
-
<!-- Dark Mode Logo -->
|
|
52
|
-
<img src="${m}" alt="${p} Logo" class="logo-dark" height="22" style="display: none; border: 0; max-height: 22px; vertical-align: middle;" />
|
|
53
|
-
<span class="email-brand-text" style="font-size: 15px; font-weight: 600; color: #09090b; letter-spacing: -0.2px; vertical-align: middle;">${p}</span>
|
|
54
|
-
</a>
|
|
55
|
-
</td>
|
|
56
|
-
</tr>
|
|
57
|
-
</table>
|
|
58
|
-
</td>
|
|
59
|
-
</tr>
|
|
60
|
-
|
|
61
|
-
<!-- Body Section -->
|
|
62
|
-
<tr>
|
|
63
|
-
<td style="padding: 24px;">
|
|
64
|
-
<h1 class="email-title" style="margin: 0 0 8px; font-size: 18px; font-weight: 600; color: #09090b; letter-spacing: -0.2px; text-align: center;">
|
|
65
|
-
${t}
|
|
66
|
-
</h1>
|
|
67
|
-
|
|
68
|
-
${s}
|
|
69
|
-
|
|
70
|
-
${o&&n?`
|
|
71
|
-
<!-- Action Buttons -->
|
|
72
|
-
<table role="presentation" width="100%" border="0" cellspacing="0" cellpadding="0" style="margin-top: 20px;">
|
|
73
|
-
<tr>
|
|
74
|
-
<td align="center">
|
|
75
|
-
<a href="${n}" target="_blank" class="email-btn-primary" style="display: inline-block; padding: 10px 18px; background-color: #09090b; color: #ffffff; font-size: 13px; font-weight: 500; text-decoration: none; border-radius: 8px;">
|
|
76
|
-
${o} \u2192
|
|
77
|
-
</a>
|
|
78
|
-
${a&&l?`<a href="${l}" target="_blank" class="email-btn-secondary" style="display: inline-block; padding: 10px 16px; margin-left: 8px; background-color: #ffffff; border: 1px solid #e4e4e7; color: #09090b; font-size: 13px; font-weight: 500; text-decoration: none; border-radius: 8px;">
|
|
79
|
-
${a}
|
|
80
|
-
</a>`:""}
|
|
81
|
-
</td>
|
|
82
|
-
</tr>
|
|
83
|
-
</table>`:""}
|
|
84
|
-
</td>
|
|
85
|
-
</tr>
|
|
86
|
-
|
|
87
|
-
<!-- Footer -->
|
|
88
|
-
<tr>
|
|
89
|
-
<td class="email-footer" style="padding: 16px 24px; border-top: 1px solid #fafafa; background-color: #fdfdfd; text-align: center;">
|
|
90
|
-
<p style="margin: 0; font-size: 12px; color: #a1a1aa;">
|
|
91
|
-
<a href="${u}" target="_blank" class="email-footer-link" style="color: #71717a; text-decoration: none; font-weight: 500;">${u.replace(/^https?:\/\//,"")}</a> \u2022
|
|
92
|
-
<a href="${u}/docs" target="_blank" class="email-footer-link" style="color: #71717a; text-decoration: none; font-weight: 500;">Docs</a>
|
|
93
|
-
</p>
|
|
94
|
-
</td>
|
|
95
|
-
</tr>
|
|
96
|
-
</table>
|
|
97
|
-
</body>
|
|
98
|
-
</html>`}chunkBUNLC3II_cjs.h();function b(i,e="User",t){let r="Confirm your email address \u2014 Kyro CMS",s=`
|
|
99
|
-
<p class="email-text" style="margin: 0 0 16px; font-size: 14px; line-height: 1.6; color: #52525b;">
|
|
100
|
-
Hello <strong class="email-strong" style="color: #09090b;">${e}</strong>,
|
|
101
|
-
</p>
|
|
102
|
-
<p class="email-text" style="margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: #52525b;">
|
|
103
|
-
Thank you for registering. Please confirm your email address by clicking the verification button below to activate your account.
|
|
104
|
-
</p>
|
|
105
|
-
|
|
106
|
-
<!-- Verification Token Link Card -->
|
|
107
|
-
<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;">
|
|
108
|
-
<tr>
|
|
109
|
-
<td style="font-size: 12px; color: #71717a; line-height: 1.5; word-break: break-all;">
|
|
110
|
-
<strong>Direct link:</strong><br />
|
|
111
|
-
<a href="${i}" style="color: #09090b; text-decoration: underline;" class="email-value">${i}</a>
|
|
112
|
-
</td>
|
|
113
|
-
</tr>
|
|
114
|
-
</table>
|
|
115
|
-
|
|
116
|
-
<p class="email-text" style="margin: 0 0 8px; font-size: 12px; color: #71717a;">
|
|
117
|
-
This verification link will expire in 24 hours. If you did not create an account, you can safely ignore this email.
|
|
118
|
-
</p>
|
|
119
|
-
`,o=g({brand:t,title:"Confirm Your Email Address",previewText:"Please confirm your email address to activate your Kyro CMS account.",bodyHtml:s,ctaText:"Confirm Email Address",ctaUrl:i,secondaryCtaText:"Documentation",secondaryCtaUrl:"https://kyro-cms.com/docs"}),n=`Welcome, ${e}!
|
|
120
|
-
|
|
121
|
-
Please verify your email address by visiting:
|
|
122
|
-
${i}
|
|
123
|
-
|
|
124
|
-
This link expires in 24 hours.
|
|
125
|
-
|
|
126
|
-
Kyro CMS \u2014 https://kyro-cms.com`;return {subject:r,html:o,text:n}}chunkBUNLC3II_cjs.h();function x(i,e="User",t){let r="Reset your password \u2014 Kyro CMS",s=`
|
|
127
|
-
<p class="email-text" style="margin: 0 0 16px; font-size: 14px; line-height: 1.6; color: #52525b;">
|
|
128
|
-
Hello <strong class="email-strong" style="color: #09090b;">${e}</strong>,
|
|
129
|
-
</p>
|
|
130
|
-
<p class="email-text" style="margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: #52525b;">
|
|
131
|
-
We received a request to reset the password for your account. Click the button below to choose a new password.
|
|
132
|
-
</p>
|
|
133
|
-
|
|
134
|
-
<!-- Reset Link Box -->
|
|
135
|
-
<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;">
|
|
136
|
-
<tr>
|
|
137
|
-
<td style="font-size: 12px; color: #71717a; line-height: 1.5; word-break: break-all;">
|
|
138
|
-
<strong>Reset URL:</strong><br />
|
|
139
|
-
<a href="${i}" style="color: #09090b; text-decoration: underline;" class="email-value">${i}</a>
|
|
140
|
-
</td>
|
|
141
|
-
</tr>
|
|
142
|
-
</table>
|
|
143
|
-
|
|
144
|
-
<p class="email-text" style="margin: 0 0 8px; font-size: 12px; color: #71717a;">
|
|
145
|
-
For security reasons, this link will expire in 1 hour. If you did not request a password reset, no further action is required.
|
|
146
|
-
</p>
|
|
147
|
-
`,o=g({brand:t,title:"Reset Your Password",previewText:"Use this secure link to reset your Kyro CMS password.",bodyHtml:s,ctaText:"Reset Password",ctaUrl:i}),n=`Hello ${e},
|
|
148
|
-
|
|
149
|
-
Reset your password using the following link:
|
|
150
|
-
${i}
|
|
151
|
-
|
|
152
|
-
This link will expire in 1 hour.
|
|
153
|
-
|
|
154
|
-
Kyro CMS \u2014 https://kyro-cms.com`;return {subject:r,html:o,text:n}}chunkBUNLC3II_cjs.h();function w(i="User",e="https://kyro-cms.com",t){let r="Welcome to Kyro CMS!",s=`
|
|
155
|
-
<p class="email-text" style="margin: 0 0 16px; font-size: 14px; line-height: 1.6; color: #52525b;">
|
|
156
|
-
Welcome <strong class="email-strong" style="color: #09090b;">${i}</strong>,
|
|
157
|
-
</p>
|
|
158
|
-
<p class="email-text" style="margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: #52525b;">
|
|
159
|
-
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.
|
|
160
|
-
</p>
|
|
161
|
-
|
|
162
|
-
<!-- Key Capabilities List -->
|
|
163
|
-
<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;">
|
|
164
|
-
<tr>
|
|
165
|
-
<td style="font-size: 13px; color: #09090b; line-height: 1.6;" class="email-value">
|
|
166
|
-
\u{1F680} <strong>What you can do next:</strong>
|
|
167
|
-
<ul style="margin: 8px 0 0; padding-left: 20px; color: #52525b;">
|
|
168
|
-
<li>Define collections & custom field schemas in <code style="font-family: monospace;">kyro.config.ts</code></li>
|
|
169
|
-
<li>Explore auto-generated REST, GraphQL, tRPC & WebSocket endpoints</li>
|
|
170
|
-
<li>Customize your visual Admin dashboard & branding settings</li>
|
|
171
|
-
</ul>
|
|
172
|
-
</td>
|
|
173
|
-
</tr>
|
|
174
|
-
</table>
|
|
175
|
-
`,o=g({brand:t,title:"Welcome to Kyro CMS",previewText:"Your account is verified and ready. Start building content applications.",bodyHtml:s,ctaText:"Open Dashboard",ctaUrl:e,secondaryCtaText:"Documentation",secondaryCtaUrl:"https://kyro-cms.com/docs"}),n=`Welcome to Kyro CMS, ${i}!
|
|
176
|
-
|
|
177
|
-
Your account is active. Log in at ${e} to start building.
|
|
178
|
-
|
|
179
|
-
Documentation: https://kyro-cms.com/docs`;return {subject:r,html:o,text:n}}chunkBUNLC3II_cjs.h();function _(i="User",e,t,r){let s="Security Alert: Password Changed \u2014 Kyro CMS",o=new Date().toUTCString(),n=`
|
|
180
|
-
<p class="email-text" style="margin: 0 0 16px; font-size: 14px; line-height: 1.6; color: #52525b; text-align: center;">
|
|
181
|
-
Hello <strong class="email-strong" style="color: #09090b;">${i}</strong>,
|
|
182
|
-
</p>
|
|
183
|
-
<p class="email-text" style="margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: #52525b; text-align: center;">
|
|
184
|
-
This email confirms that the password for your Kyro CMS account was successfully updated on <strong>${o}</strong>.
|
|
185
|
-
</p>
|
|
186
|
-
|
|
187
|
-
<!-- Security Warning Card -->
|
|
188
|
-
<table role="presentation" width="100%" border="0" cellspacing="0" cellpadding="0" class="email-table" style="background-color: #fef2f2; border: 1px solid #fecaca; border-radius: 12px; margin-bottom: 20px; padding: 16px; border-collapse: separate;">
|
|
189
|
-
<tr>
|
|
190
|
-
<td style="font-size: 13px; color: #991b1b; line-height: 1.5; text-align: center;">
|
|
191
|
-
\u26A0\uFE0F <strong>Did not request this change?</strong><br />
|
|
192
|
-
If you did not initiate this change, your account may be compromised. Reset your password immediately and contact an administrator.
|
|
193
|
-
</td>
|
|
194
|
-
</tr>
|
|
195
|
-
</table>
|
|
196
|
-
|
|
197
|
-
${t||r?`
|
|
198
|
-
<table role="presentation" width="100%" border="0" cellspacing="0" cellpadding="0" class="email-table" style="background-color: #fafafa; border: 1px solid #f4f4f5; border-radius: 12px; margin-bottom: 20px; padding: 16px; border-collapse: separate;">
|
|
199
|
-
<tr>
|
|
200
|
-
<td style="font-size: 13px; color: #09090b; line-height: 1.6;" class="email-value">
|
|
201
|
-
<strong>Action IP:</strong> ${t||"Unknown"}<br />
|
|
202
|
-
<strong>Device:</strong> ${r||"Unknown"}
|
|
203
|
-
</td>
|
|
204
|
-
</tr>
|
|
205
|
-
</table>`:""}
|
|
206
|
-
`,a=g({brand:e,title:"Password Updated",previewText:"Your Kyro CMS account password was updated.",bodyHtml:n,ctaText:"Account Security",ctaUrl:"https://kyro-cms.com"}),l=`Security Alert: Your Kyro CMS password was updated at ${o}.
|
|
207
|
-
|
|
208
|
-
If you did not make this change, please reset your password immediately.
|
|
209
|
-
|
|
210
|
-
Kyro CMS \u2014 https://kyro-cms.com`;return {subject:s,html:a,text:l}}chunkBUNLC3II_cjs.h();function C(i,e,t="User",r){let s="Your one-time login link \u2014 Kyro CMS",o=`
|
|
211
|
-
<p class="email-text" style="margin: 0 0 16px; font-size: 14px; line-height: 1.6; color: #52525b;">
|
|
212
|
-
Hello <strong class="email-strong" style="color: #09090b;">${t}</strong>,
|
|
213
|
-
</p>
|
|
214
|
-
<p class="email-text" style="margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: #52525b;">
|
|
215
|
-
Click the button below to sign in to your Kyro CMS account without entering a password.
|
|
216
|
-
</p>
|
|
217
|
-
|
|
218
|
-
${e?`
|
|
219
|
-
<!-- One-Time Passcode Box -->
|
|
220
|
-
<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;">
|
|
221
|
-
<tr>
|
|
222
|
-
<td style="font-size: 12px; color: #71717a; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px;">
|
|
223
|
-
One-Time Passcode
|
|
224
|
-
</td>
|
|
225
|
-
</tr>
|
|
226
|
-
<tr>
|
|
227
|
-
<td style="font-size: 28px; font-weight: 800; font-family: monospace; color: #09090b; letter-spacing: 4px;" class="email-code-box">
|
|
228
|
-
${e}
|
|
229
|
-
</td>
|
|
230
|
-
</tr>
|
|
231
|
-
</table>`:""}
|
|
232
|
-
|
|
233
|
-
<p class="email-text" style="margin: 0 0 8px; font-size: 12px; color: #71717a;">
|
|
234
|
-
This single-use link will expire in 10 minutes. Never share authentication links with anyone.
|
|
235
|
-
</p>
|
|
236
|
-
`,n=g({brand:r,title:"Sign in to Kyro CMS",previewText:"Your secure magic login link for Kyro CMS.",bodyHtml:o,ctaText:"Sign In Now",ctaUrl:i}),a=`Hello ${t},
|
|
237
|
-
|
|
238
|
-
Sign in to Kyro CMS using the link below:
|
|
239
|
-
${i}${e?`
|
|
240
|
-
|
|
241
|
-
Or enter code: ${e}`:""}
|
|
242
|
-
|
|
243
|
-
This link expires in 10 minutes.
|
|
244
|
-
|
|
245
|
-
Kyro CMS \u2014 https://kyro-cms.com`;return {subject:s,html:n,text:a}}chunkBUNLC3II_cjs.h();function S(i,e,t="User",r,s,o){let n="Security Alert: Account Temporarily Locked \u2014 Kyro CMS",a=`
|
|
246
|
-
<p class="email-text" style="margin: 0 0 16px; font-size: 14px; line-height: 1.6; color: #52525b; text-align: center;">
|
|
247
|
-
Hello <strong class="email-strong" style="color: #09090b;">${t}</strong>,
|
|
248
|
-
</p>
|
|
249
|
-
<p class="email-text" style="margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: #52525b; text-align: center;">
|
|
250
|
-
Your Kyro CMS account was temporarily locked after <strong>${i} failed login attempts</strong>.
|
|
251
|
-
</p>
|
|
252
|
-
|
|
253
|
-
<!-- Lockout Notice Card -->
|
|
254
|
-
<table role="presentation" width="100%" border="0" cellspacing="0" cellpadding="0" class="email-table" style="background-color: #fffbeb; border: 1px solid #fde68a; border-radius: 12px; margin-bottom: 20px; padding: 16px; border-collapse: separate;">
|
|
255
|
-
<tr>
|
|
256
|
-
<td style="font-size: 13px; color: #b45309; line-height: 1.5; text-align: center;">
|
|
257
|
-
\u{1F512} <strong>Lockout duration:</strong> ${e} minutes.<br />
|
|
258
|
-
You may try logging in again after the cooling-off period expires.
|
|
259
|
-
</td>
|
|
260
|
-
</tr>
|
|
261
|
-
</table>
|
|
262
|
-
|
|
263
|
-
${s||o?`
|
|
264
|
-
<table role="presentation" width="100%" border="0" cellspacing="0" cellpadding="0" class="email-table" style="background-color: #fafafa; border: 1px solid #f4f4f5; border-radius: 12px; margin-bottom: 20px; padding: 16px; border-collapse: separate;">
|
|
265
|
-
<tr>
|
|
266
|
-
<td style="font-size: 13px; color: #09090b; line-height: 1.6;" class="email-value">
|
|
267
|
-
<strong>Failed Attempts IP:</strong> ${s||"Unknown"}<br />
|
|
268
|
-
<strong>Device:</strong> ${o||"Unknown"}
|
|
269
|
-
</td>
|
|
270
|
-
</tr>
|
|
271
|
-
</table>`:""}
|
|
272
|
-
`,l=g({brand:r,title:"Account Temporarily Locked",previewText:"Your Kyro CMS account was locked due to multiple failed login attempts.",bodyHtml:a,ctaText:"Unlock Instructions",ctaUrl:"https://kyro-cms.com/docs"}),p=`Security Alert: Account temporarily locked for ${t} after ${i} failed login attempts. Unlocks in ${e} minutes.
|
|
273
|
-
|
|
274
|
-
Kyro CMS \u2014 https://kyro-cms.com`;return {subject:n,html:l,text:p}}chunkBUNLC3II_cjs.h();function T(i,e="Editor",t="An Administrator",r){let s="You're invited to join Kyro CMS",o=`
|
|
275
|
-
<p class="email-text" style="margin: 0 0 16px; font-size: 14px; line-height: 1.6; color: #52525b;">
|
|
276
|
-
Hello,
|
|
277
|
-
</p>
|
|
278
|
-
<p class="email-text" style="margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: #52525b;">
|
|
279
|
-
<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.
|
|
280
|
-
</p>
|
|
281
|
-
|
|
282
|
-
<!-- Invite Details Card -->
|
|
283
|
-
<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;">
|
|
284
|
-
<tr>
|
|
285
|
-
<td style="font-size: 13px; color: #09090b; line-height: 1.6;" class="email-value">
|
|
286
|
-
<strong>Assigned Role:</strong> ${e}<br />
|
|
287
|
-
<strong>Invited By:</strong> ${t}
|
|
288
|
-
</td>
|
|
289
|
-
</tr>
|
|
290
|
-
</table>
|
|
291
|
-
`,n=g({brand:r,title:"Workspace Invitation",previewText:`You have been invited to join Kyro CMS as an ${e}.`,bodyHtml:o,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}.
|
|
292
|
-
|
|
293
|
-
Accept your invitation here:
|
|
294
|
-
${i}
|
|
295
|
-
|
|
296
|
-
Kyro CMS \u2014 https://kyro-cms.com`;return {subject:s,html:n,text:a}}chunkBUNLC3II_cjs.h();function k(i,e,t="User",r,s="Unknown Device"){let o="Security Alert: New Sign-in to Kyro CMS",n=`
|
|
297
|
-
<p class="email-text" style="margin: 0 0 16px; font-size: 14px; line-height: 1.6; color: #52525b; text-align: center;">
|
|
298
|
-
Hello <strong class="email-strong" style="color: #09090b;">${t}</strong>,
|
|
299
|
-
</p>
|
|
300
|
-
<p class="email-text" style="margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: #52525b; text-align: center;">
|
|
301
|
-
A new sign-in to your Kyro CMS account was detected.
|
|
302
|
-
</p>
|
|
303
|
-
|
|
304
|
-
<!-- Sign-in Details -->
|
|
305
|
-
<table role="presentation" width="100%" border="0" cellspacing="0" cellpadding="0" class="email-table" style="background-color: #fafafa; border: 1px solid #f4f4f5; border-radius: 12px; margin-bottom: 20px; padding: 16px; border-collapse: separate;">
|
|
306
|
-
<tr>
|
|
307
|
-
<td style="font-size: 13px; color: #09090b; line-height: 1.6;" class="email-value">
|
|
308
|
-
<strong>Time:</strong> ${e}<br />
|
|
309
|
-
<strong>Location/IP:</strong> ${i}<br />
|
|
310
|
-
<strong>Device:</strong> ${s}
|
|
311
|
-
</td>
|
|
312
|
-
</tr>
|
|
313
|
-
</table>
|
|
314
|
-
|
|
315
|
-
<!-- Security Warning Card -->
|
|
316
|
-
<table role="presentation" width="100%" border="0" cellspacing="0" cellpadding="0" class="email-table" style="background-color: #fef2f2; border: 1px solid #fecaca; border-radius: 12px; margin-bottom: 20px; padding: 16px; border-collapse: separate;">
|
|
317
|
-
<tr>
|
|
318
|
-
<td style="font-size: 13px; color: #991b1b; line-height: 1.5; text-align: center;">
|
|
319
|
-
\u26A0\uFE0F <strong>Don't recognize this activity?</strong><br />
|
|
320
|
-
If you did not sign in recently, your account may be compromised. Please reset your password immediately and contact an administrator.
|
|
321
|
-
</td>
|
|
322
|
-
</tr>
|
|
323
|
-
</table>
|
|
324
|
-
`,a=g({brand:r,title:"New Sign-in Detected",previewText:"A new sign-in was detected on your Kyro CMS account.",bodyHtml:n,ctaText:"Review Account Security",ctaUrl:"https://kyro-cms.com"}),l=`Security Alert: New Sign-in to Kyro CMS
|
|
325
|
-
|
|
326
|
-
Hello ${t},
|
|
327
|
-
|
|
328
|
-
A new sign-in to your account was detected at ${e} from ${i} using ${s}.
|
|
329
|
-
|
|
330
|
-
If you did not sign in recently, please reset your password immediately.
|
|
331
|
-
|
|
332
|
-
Kyro CMS \u2014 https://kyro-cms.com`;return {subject:o,html:a,text:l}}chunkBUNLC3II_cjs.h();function E(i,e="Customer",t,r,s){let o=`Order Confirmation #${i}`,n=`
|
|
333
|
-
<p class="email-text" style="margin: 0 0 16px; font-size: 14px; line-height: 1.6; color: #52525b;">
|
|
334
|
-
Hi <strong class="email-strong" style="color: #09090b;">${e}</strong>,
|
|
335
|
-
</p>
|
|
336
|
-
<p class="email-text" style="margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: #52525b;">
|
|
337
|
-
Thank you for your order! We've received your order <strong>#${i}</strong> and are getting it ready for shipment.
|
|
338
|
-
</p>
|
|
339
|
-
|
|
340
|
-
<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;">
|
|
341
|
-
<tr>
|
|
342
|
-
<td style="font-size: 13px; color: #09090b; line-height: 1.6;" class="email-value">
|
|
343
|
-
\u{1F6D2} <strong>Order Summary:</strong><br/>
|
|
344
|
-
Order Total: <strong>${t}</strong>
|
|
345
|
-
</td>
|
|
346
|
-
</tr>
|
|
347
|
-
</table>
|
|
348
|
-
`,a=g({brand:s,title:"Order Confirmed",previewText:`Your order #${i} has been confirmed.`,bodyHtml:n,ctaText:"View Order",ctaUrl:r||"https://kyro-cms.com"}),l=`Hi ${e},
|
|
349
|
-
|
|
350
|
-
Thank you for your order #${i}!
|
|
351
|
-
|
|
352
|
-
Order Total: ${t}
|
|
353
|
-
|
|
354
|
-
View your order here: ${r||"https://kyro-cms.com"}`;return {subject:o,html:a,text:l}}chunkBUNLC3II_cjs.h();function v(i,e="Customer",t,r,s){let o=`Your Order #${i} is on the way!`,n=`
|
|
355
|
-
<p class="email-text" style="margin: 0 0 16px; font-size: 14px; line-height: 1.6; color: #52525b;">
|
|
356
|
-
Great news, <strong class="email-strong" style="color: #09090b;">${e}</strong>!
|
|
357
|
-
</p>
|
|
358
|
-
<p class="email-text" style="margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: #52525b;">
|
|
359
|
-
Your order <strong>#${i}</strong> has been shipped and is on its way to you.
|
|
360
|
-
</p>
|
|
361
|
-
|
|
362
|
-
<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;">
|
|
363
|
-
<tr>
|
|
364
|
-
<td style="font-size: 13px; color: #09090b; line-height: 1.6;" class="email-value">
|
|
365
|
-
\u{1F4E6} <strong>Tracking Number:</strong> ${t}
|
|
366
|
-
</td>
|
|
367
|
-
</tr>
|
|
368
|
-
</table>
|
|
369
|
-
`,a=g({brand:s,title:"Order Shipped",previewText:`Your order #${i} has shipped. Track your package now.`,bodyHtml:n,ctaText:"Track Package",ctaUrl:r}),l=`Hi ${e},
|
|
370
|
-
|
|
371
|
-
Your order #${i} has been shipped!
|
|
372
|
-
|
|
373
|
-
Tracking Number: ${t}
|
|
374
|
-
Track it here: ${r}`;return {subject:o,html:a,text:l}}chunkBUNLC3II_cjs.h();function A(i,e="Customer",t,r){let s=`Your Order #${i} has been delivered`,o=`
|
|
375
|
-
<p class="email-text" style="margin: 0 0 16px; font-size: 14px; line-height: 1.6; color: #52525b;">
|
|
376
|
-
Hi <strong class="email-strong" style="color: #09090b;">${e}</strong>,
|
|
377
|
-
</p>
|
|
378
|
-
<p class="email-text" style="margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: #52525b;">
|
|
379
|
-
Good news! Your order <strong>#${i}</strong> has been successfully delivered. We hope you love it!
|
|
380
|
-
</p>
|
|
381
|
-
<p class="email-text" style="margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: #52525b;">
|
|
382
|
-
We'd love to hear your thoughts. If you have a minute, please leave a review for your items.
|
|
383
|
-
</p>
|
|
384
|
-
`,n=g({brand:r,title:"Order Delivered",previewText:`Your order #${i} has arrived!`,bodyHtml:o,ctaText:"Leave a Review",ctaUrl:t}),a=`Hi ${e},
|
|
385
|
-
|
|
386
|
-
Your order #${i} has been delivered!
|
|
387
|
-
|
|
388
|
-
Leave a review here: ${t}`;return {subject:s,html:n,text:a}}chunkBUNLC3II_cjs.h();function P(i,e="Customer",t,r){let s=`Refund Processed for Order #${i}`,o=`
|
|
389
|
-
<p class="email-text" style="margin: 0 0 16px; font-size: 14px; line-height: 1.6; color: #52525b;">
|
|
390
|
-
Hi <strong class="email-strong" style="color: #09090b;">${e}</strong>,
|
|
391
|
-
</p>
|
|
392
|
-
<p class="email-text" style="margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: #52525b;">
|
|
393
|
-
We have processed a refund for your order <strong>#${i}</strong>. It may take 3-5 business days for the funds to appear on your original payment method.
|
|
394
|
-
</p>
|
|
395
|
-
|
|
396
|
-
<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;">
|
|
397
|
-
<tr>
|
|
398
|
-
<td style="font-size: 13px; color: #09090b; line-height: 1.6;" class="email-value">
|
|
399
|
-
\u{1F4B8} <strong>Refund Amount:</strong> ${t}
|
|
400
|
-
</td>
|
|
401
|
-
</tr>
|
|
402
|
-
</table>
|
|
403
|
-
`,n=g({brand:r,title:"Refund Processed",previewText:`We have processed a refund of ${t} for order #${i}.`,bodyHtml:o,ctaText:"View Store",ctaUrl:"https://kyro-cms.com"}),a=`Hi ${e},
|
|
404
|
-
|
|
405
|
-
We have processed a refund of ${t} for order #${i}.
|
|
406
|
-
|
|
407
|
-
View store: https://kyro-cms.com`;return {subject:s,html:n,text:a}}chunkBUNLC3II_cjs.h();function R(i="Customer",e,t){let r="You left something behind...",s=`
|
|
408
|
-
<p class="email-text" style="margin: 0 0 16px; font-size: 14px; line-height: 1.6; color: #52525b;">
|
|
409
|
-
Hi <strong class="email-strong" style="color: #09090b;">${i}</strong>,
|
|
410
|
-
</p>
|
|
411
|
-
<p class="email-text" style="margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: #52525b;">
|
|
412
|
-
We noticed you left some great items in your shopping cart. They are still waiting for you, but they might sell out soon!
|
|
413
|
-
</p>
|
|
414
|
-
`,o=g({brand:t,title:"Complete Your Purchase",previewText:"Your shopping cart is waiting for you. Complete your purchase now.",bodyHtml:s,ctaText:"Return to Checkout",ctaUrl:e}),n=`Hi ${i},
|
|
415
|
-
|
|
416
|
-
You left some items in your cart! Complete your purchase here: ${e}`;return {subject:r,html:o,text:n}}chunkBUNLC3II_cjs.h();function I(i){return {verifyEmail:(e,t)=>b(e,t,i),resetPassword:(e,t)=>x(e,t,i),welcome:(e,t)=>w(e,t,i),passwordChanged:e=>_(e,i),magicLink:(e,t,r)=>C(e,t,r,i),accountLocked:(e,t,r)=>S(e,t,r,i),newLogin:(e,t,r)=>k(e,t,r,i),userInvite:(e,t,r)=>T(e,t,r,i),orderConfirmation:(e,t,r,s)=>E(e,t,r||"0.00",s,i),orderShipped:(e,t,r,s)=>v(e,t,r||"",s||"",i),orderDelivered:(e,t,r)=>A(e,t,r||"",i),orderRefunded:(e,t,r)=>P(e,t,r||"0.00",i),abandonedCart:(e,t)=>R(e,t||"",i)}}chunkBUNLC3II_cjs.h();var O=false,y=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(chunkHPYH7GTS_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(!O)try{if(typeof this.db?.execute=="function"){let{sql:e}=await import('./drizzle-orm-47ELDEM6.cjs');await this.db.execute(e`
|
|
417
|
-
CREATE TABLE IF NOT EXISTS "settings" (
|
|
418
|
-
"key" VARCHAR(255) PRIMARY KEY,
|
|
419
|
-
"value" TEXT NOT NULL,
|
|
420
|
-
"description" TEXT,
|
|
421
|
-
"updated_at" TIMESTAMP DEFAULT NOW()
|
|
422
|
-
)
|
|
423
|
-
`),O=!0;}else typeof this.db?.exec=="function"&&(this.db.exec(`
|
|
424
|
-
CREATE TABLE IF NOT EXISTS settings (
|
|
425
|
-
key TEXT PRIMARY KEY,
|
|
426
|
-
value TEXT NOT NULL,
|
|
427
|
-
description TEXT,
|
|
428
|
-
updated_at TEXT
|
|
429
|
-
)
|
|
430
|
-
`),O=!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-47ELDEM6.cjs'),o=['"_globals_storage-settings"','"_globals_storage_settings"','"global_storage_settings"'];for(let n of o)try{let a=await this.db.execute(s`SELECT * FROM ${s.raw(n)} LIMIT 1`);if(e=Array.isArray(a)?a[0]:a?.rows?a.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-47ELDEM6.cjs'),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(chunkHPYH7GTS_cjs.a).values({key:e,value:t,description:r,updatedAt:new Date}).onConflictDoUpdate({target:[chunkHPYH7GTS_cjs.a.key],set:{value:t,description:r,updatedAt:new Date}}),this.cache[e]=t;}};chunkBUNLC3II_cjs.h();var $=class i{transporter;config;templates;transporterInitialized=false;constructor(e,t){this.config=e,this.templates={...I(e.brand),...t};}async ensureTransporter(){if(this.transporterInitialized)return this.transporter;let{default:e}=await import('./nodemailer-IDML4L6W.cjs');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,n=`"${s||"Kyro CMS"}" <${r}>`,a=e.replyTo||o;try{let l;switch(t){case "smtp":case "ses":{let p=await this.ensureTransporter();if(!p)throw new Error(`${t} transporter not initialized`);l=await p.sendMail({from:n,to:Array.isArray(e.to)?e.to.join(", "):e.to,subject:e.subject,html:e.html,text:e.text,replyTo:a});}break;case "resend":l=await this.sendViaResend(n,e,a);break;case "sendgrid":l=await this.sendViaSendGrid(n,e,a);break;case "mailgun":l=await this.sendViaMailgun(n,e,a);break;default:throw new Error(`Unsupported email provider: ${t}`)}return l}catch(l){throw console.error("[EmailTransport] FAILED to send email:",l.message),l.response&&console.error("[EmailTransport] Provider Error Detail:",JSON.stringify(l.response,null,2)),l}}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},n=await fetch("https://api.resend.com/emails",{method:"POST",headers:{Authorization:`Bearer ${s}`,"Content-Type":"application/json"},body:JSON.stringify(o)});if(!n.ok){let a=await n.json();throw new Error(`Resend Error: ${JSON.stringify(a)}`)}return n.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(a=>({email:a})):[{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},n=await fetch("https://api.sendgrid.com/v3/mail/send",{method:"POST",headers:{Authorization:`Bearer ${s}`,"Content-Type":"application/json"},body:JSON.stringify(o)});if(!n.ok){let a=await n.json();throw new Error(`SendGrid Error: ${JSON.stringify(a)}`)}return {success:true}}async sendViaMailgun(e,t,r){let{apiKey:s,domain:o,region:n}=this.config.mailgun||{};if(!s||!o)throw new Error("Mailgun config missing");let a=n==="eu"?"api.eu.mailgun.net":"api.mailgun.net",l=btoa(`api:${s}`),p=new URLSearchParams;p.append("from",e);let f=Array.isArray(t.to)?t.to.join(", "):t.to;p.append("to",f),p.append("subject",t.subject),p.append("html",t.html),t.text&&p.append("text",t.text),r&&p.append("h:Reply-To",r);let m=await fetch(`https://${a}/v3/${o}/messages`,{method:"POST",headers:{Authorization:`Basic ${l}`,"Content-Type":"application/x-www-form-urlencoded"},body:p});if(!m.ok){let u=await m.json();throw new Error(`Mailgun Error: ${JSON.stringify(u)}`)}return m.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 fetchBrandConfig(e){let t="Kyro CMS",r="https://kyro-cms.com/logo.svg",s="https://kyro-cms.com/logo-white.svg";try{let o=null,n=null;if(typeof e?.findOne=="function")o=await e.findOne({collection:"_globals_store-settings",where:{},draft:!0}),n=await e.findOne({collection:"_globals_brand-settings",where:{},draft:!0});else if(typeof e?.execute=="function"){let{sql:a}=await import('./drizzle-orm-47ELDEM6.cjs');try{let l=await e.execute(a`SELECT * FROM "_globals_store-settings" LIMIT 1`);o=Array.isArray(l)?l[0]:l?.rows?l.rows[0]:null;}catch{}try{let l=await e.execute(a`SELECT * FROM "_globals_brand-settings" LIMIT 1`);n=Array.isArray(l)?l[0]:l?.rows?l.rows[0]:null;}catch{}}else if(typeof e?.prepare=="function"){try{o=e.prepare('SELECT * FROM "_globals_store-settings" LIMIT 1').get();}catch{}try{n=e.prepare('SELECT * FROM "_globals_brand-settings" LIMIT 1').get();}catch{}}if(o?.storeName&&(t=o.storeName),n?.identity){let a=typeof n.identity=="string"?JSON.parse(n.identity):n.identity,l=async p=>{if(typeof e?.findOne=="function")return (await e.findOne({collection:"media",where:{id:{equals:p}}}))?.url;if(typeof e?.execute=="function"){let{sql:f}=await import('./drizzle-orm-47ELDEM6.cjs');try{let m=await e.execute(f`SELECT url FROM "media" WHERE id = ${p}`);return (Array.isArray(m)?m[0]:m?.rows?m.rows[0]:null)?.url}catch{}}else if(typeof e?.prepare=="function")try{return e.prepare('SELECT url FROM "media" WHERE id = ?').get(p)?.url}catch{}};if(a.primaryLogo){let p=await l(a.primaryLogo);p&&(r=p);}if(a.darkLogo){let p=await l(a.darkLogo);p&&(s=p);}}}catch{}return {siteName:t,logoUrl:r,logoDarkUrl:s,appUrl:process.env.PUBLIC_URL||"https://kyro-cms.com"}}static async fromConfig(e){let t=new y(e);await t.load();let r=t.getEmailConfig();if(!r.provider)return this.fromEnv();let o={brand:await this.fetchBrandConfig(e),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(o)}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,n=process.env.SMTP_USER,a=process.env.SMTP_PASS;return !o||!n||!a?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:n,pass:a}}})}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,n=process.env.MAILGUN_DOMAIN||process.env.SMTP_HOST;return !o||!n?null:new i({provider:"mailgun",from:t,fromName:r,replyTo:s,mailgun:{apiKey:o,domain:n,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,n=process.env.AWS_SECRET_ACCESS_KEY||process.env.SMTP_PASS,a=process.env.AWS_REGION||process.env.SMTP_HOST||"us-east-1";return !o||!n?null:new i({provider:"ses",from:t,fromName:r,replyTo:s,ses:{accessKeyId:o,secretAccessKey:n,region:a}})}return null}};chunkBUNLC3II_cjs.h();var M={minLength:12,requireUppercase:true,requireLowercase:true,requireNumbers:true,requireSpecialChars:true,preventReuse:5,maxLength:128},K=class{config;constructor(e={}){this.config={...M,...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="!@#$%^&*()_+-=[]{}|;:,.<>?",n="";n+=t[Math.floor(Math.random()*t.length)],n+=r[Math.floor(Math.random()*r.length)],n+=s[Math.floor(Math.random()*s.length)],n+=o[Math.floor(Math.random()*o.length)];let a=t+r+s+o;for(let l=n.length;l<e;l++)n+=a[Math.floor(Math.random()*a.length)];return n.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}}};
|
|
431
|
-
exports.a=g;exports.b=b;exports.c=x;exports.d=w;exports.e=_;exports.f=C;exports.g=S;exports.h=T;exports.i=k;exports.j=E;exports.k=v;exports.l=A;exports.m=P;exports.n=R;exports.o=I;exports.p=y;exports.q=$;exports.r=K;
|
package/dist/chunk-FP5UK272.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkFSL3NLRT_cjs=require('./chunk-FSL3NLRT.cjs'),chunkZHA446FA_cjs=require('./chunk-ZHA446FA.cjs'),chunkZOVH6QT5_cjs=require('./chunk-ZOVH6QT5.cjs'),chunkBUNLC3II_cjs=require('./chunk-BUNLC3II.cjs');chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();async function V(e){let a=chunkFSL3NLRT_cjs.n(e.db),t={db:e.db,registry:e.registry,req:e.req,user:e.user,tenantId:e.tenantId,webhookService:a,settings:e.settings},n=chunkZHA446FA_cjs.c(e.req);if(n){let r=await chunkZHA446FA_cjs.b(n,e.db,async o=>{try{return await e.db.findByID({collection:"users",id:o})||null}catch{return null}});r.valid&&(t.user=r.user||e.user,t.tenantId=r.tenantId||e.tenantId,t.apiKey=chunkZHA446FA_cjs.d(r));}return t}chunkBUNLC3II_cjs.h();var G={_media:{create:chunkFSL3NLRT_cjs.c.MEDIA_UPLOAD,update:chunkFSL3NLRT_cjs.c.MEDIA_UPLOAD,delete:chunkFSL3NLRT_cjs.c.MEDIA_DELETE}};function R(e,a){let t=G[e];return t?t[a]:`collection.${a}`}async function q(e,a,t){if(e.webhookService)try{await e.webhookService.trigger(a,{collection:t.collection,operation:t.operation,data:t.data,previousData:t.previousData,user:e.user?{id:e.user.id,email:e.user.email,role:e.user.role}:void 0,tenantId:e.tenantId});}catch(n){console.error(`[Webhook] Failed to trigger ${a}:`,n);}}function I(e,a){if(!(!e||typeof e!="object"))for(let t of a){if(t.type==="tabs"&&Array.isArray(t.tabs)){let r=t.name?e[t.name]:e;if(r&&typeof r=="object")for(let o of t.tabs)Array.isArray(o.fields)&&I(r,o.fields);continue}if(!t.name||!(t.name in e))continue;if(e[t.name]===""&&(t.type==="text"||t.type==="textarea"||t.type==="code"||t.type==="markdown"||t.type==="email"||t.type==="password"||t.type==="color"||(e[t.name]=null)),(t.type==="group"||t.type==="collapsible")&&t.name&&Array.isArray(t.fields)&&e[t.name]&&typeof e[t.name]=="object")I(e[t.name],t.fields);else if(t.type==="array"&&t.name&&Array.isArray(t.fields)&&Array.isArray(e[t.name]))for(let r of e[t.name])r&&typeof r=="object"&&I(r,t.fields);else if(t.type==="blocks"&&t.name&&Array.isArray(t.blocks)&&Array.isArray(e[t.name]))for(let r of e[t.name]){if(!r||typeof r!="object")continue;let o=r.type||r.blockType;if(!o)continue;let s=t.blocks.find(i=>i.slug===o);if(!s||!Array.isArray(s.fields))continue;let u=r.data&&typeof r.data=="object"?r.data:r;I(u,s.fields);}}}async function b(e,a,t){let n=await chunkFSL3NLRT_cjs.a(e,a,{user:t.user,req:t.req,tenantId:t.tenantId,apiKey:t.apiKey});if(!n.allowed)throw new Error(n.error||"Access denied");t.tenantId&&t.db.setTenantContext({tenantId:t.tenantId,userId:t.user?.id??"",role:t.user?.role,isSuperAdmin:t.user?.role==="super_admin"});}function P(e){return async a=>{let{collection:t,where:n,sort:r,limit:o,page:s,depth:u,select:i,draft:d}=a,l=e.registry.getCollection(t);if(await b(l,"read",e),l.hooks?.beforeRead)for(let p of l.hooks.beforeRead)await p({collection:t,req:e.req,user:e.user,tenantId:e.tenantId,operation:"read",where:n});let c=d??!!e.user,h=await e.db.find({collection:t,where:n||{},sort:r,limit:o||10,page:s||1,depth:u||0,tenantId:e.tenantId,select:i,draft:c});if(l.hooks?.afterRead)for(let p of h.docs)for(let k of l.hooks.afterRead)await k({collection:t,doc:p,req:e.req,user:e.user,tenantId:e.tenantId,operation:"read"});return await chunkFSL3NLRT_cjs.o(h.docs,l.fields,e.db,e.registry,1,u||0),chunkZOVH6QT5_cjs.a(h)}}function v(e){return async a=>{let{collection:t,id:n,depth:r,select:o,draft:s}=a,u=e.registry.getCollection(t);await b(u,"read",e);let i=s??!!e.user,d=await e.db.findByID({collection:t,id:n,depth:r||0,tenantId:e.tenantId,select:o,draft:i});if(!d)throw new Error(`Document not found: ${t}/${n}`);if(u.hooks?.afterRead)for(let l of u.hooks.afterRead)await l({collection:t,doc:d,req:e.req,user:e.user,tenantId:e.tenantId,operation:"read",id:n});return await chunkFSL3NLRT_cjs.o([d],u.fields,e.db,e.registry,1,r||0),chunkZOVH6QT5_cjs.a(d)}}function K(e){return async a=>{let{collection:t,data:n,depth:r,select:o}=a,s=e.registry.getCollection(t);await b(s,"create",e);let i=e.registry.getCreateZodSchema(t).parse(n);if(s.tenantScoped&&e.tenantId&&(i.tenantId=e.tenantId),s.hooks?.beforeValidate)for(let l of s.hooks.beforeValidate){let c=await l({collection:t,data:i,req:e.req,user:e.user,tenantId:e.tenantId,operation:"create"});c&&typeof c=="object"&&!Array.isArray(c)&&Object.assign(i,c);}if(s.hooks?.beforeChange)for(let l of s.hooks.beforeChange){let c=await l({collection:t,data:i,req:e.req,user:e.user,tenantId:e.tenantId,operation:"create"});c&&typeof c=="object"&&!Array.isArray(c)&&Object.assign(i,c);}let d=await e.db.create({collection:t,data:i,depth:r||0,tenantId:e.tenantId,select:o});if(s.hooks?.afterChange)for(let l of s.hooks.afterChange)await l({collection:t,doc:d,data:i,req:e.req,user:e.user,tenantId:e.tenantId,operation:"create"});return await q(e,R(t,"create"),{collection:t,data:d,operation:"create"}),{doc:d}}}function E(e){return async a=>{let{collection:t,id:n,data:r,depth:o,select:s,baseUpdatedAt:u}=a,i=e.registry.getCollection(t);await b(i,"update",e);let d=await e.db.findByID({collection:t,id:n,tenantId:e.tenantId,draft:true});if(!d)throw new Error(`Document not found: ${t}/${n}`);if(u&&d.updatedAt&&u!==d.updatedAt)throw new Error(`Revision conflict: document has changed since ${u}. Current updatedAt: ${d.updatedAt}`);I(r,i.fields);let c=e.registry.getUpdateZodSchema(t).parse(r);if(i.tenantScoped&&e.tenantId&&(c.tenantId=e.tenantId),i.hooks?.beforeValidate)for(let m of i.hooks.beforeValidate){let f=await m({collection:t,data:c,originalDoc:d,req:e.req,user:e.user,tenantId:e.tenantId,operation:"update",id:n});f&&typeof f=="object"&&!Array.isArray(f)&&Object.assign(c,f);}if(i.hooks?.beforeChange)for(let m of i.hooks.beforeChange){let f=await m({collection:t,data:c,originalDoc:d,req:e.req,user:e.user,tenantId:e.tenantId,operation:"update",id:n});f&&typeof f=="object"&&!Array.isArray(f)&&Object.assign(c,f);}let h=e.req&&typeof e.req.headers?.get=="function"&&e.req.headers.get("x-draft")==="true"||a.draft===true,p=i.versions?.drafts===true,k=e.req?.query?.autosave==="true"||e.req?.url?.includes("autosave=true")||a.autosave===true,g;if(p&&h?(await e.db.createVersion({collection:t,documentId:n,data:c,status:"draft",autosave:k,createdBy:e.user?.id,tenantId:e.tenantId}),g=await e.db.findByID({collection:t,id:n,tenantId:e.tenantId,draft:true})):p?(g=await e.db.update({collection:t,id:n,data:{...c,status:"published"},depth:o||0,tenantId:e.tenantId,select:s}),await e.db.createVersion({collection:t,documentId:n,data:c,status:"published",createdBy:e.user?.id,tenantId:e.tenantId})):g=await e.db.update({collection:t,id:n,data:c,depth:o||0,tenantId:e.tenantId,select:s}),i.hooks?.afterChange)for(let m of i.hooks.afterChange)await m({collection:t,doc:g,data:c,originalDoc:d,req:e.req,user:e.user,tenantId:e.tenantId,operation:"update",id:n});return await q(e,R(t,"update"),{collection:t,data:g,previousData:d,operation:"update"}),{doc:g}}}function j(e){return async a=>{let{collection:t,id:n}=a,r=e.registry.getCollection(t);await b(r,"delete",e);let o=await e.db.findByID({collection:t,id:n,tenantId:e.tenantId,draft:true});if(!o)throw new Error(`Document not found: ${t}/${n}`);if(r.hooks?.beforeDelete)for(let u of r.hooks.beforeDelete)await u({collection:t,doc:o,req:e.req,user:e.user,tenantId:e.tenantId,operation:"delete",id:n});let s=await e.db.delete({collection:t,id:n,tenantId:e.tenantId});if(r.hooks?.afterDelete)for(let u of r.hooks.afterDelete)await u({collection:t,doc:s,req:e.req,user:e.user,tenantId:e.tenantId,operation:"delete",id:n});return await q(e,R(t,"delete"),{collection:t,data:s,previousData:o,operation:"delete"}),{doc:s,message:"Deleted successfully"}}}function S(e){return async a=>{let{collection:t,where:n}=a,r=e.registry.getCollection(t);return await b(r,"read",e),{totalDocs:await e.db.count({collection:t,where:n||{},tenantId:e.tenantId})}}}chunkBUNLC3II_cjs.h();async function W(e,a,t){let n=await chunkFSL3NLRT_cjs.b(e,a,{user:t.user,req:t.req,tenantId:t.tenantId});if(!n.allowed)throw new Error(n.error||"Access denied");t.tenantId&&t.db.setTenantContext({tenantId:t.tenantId,userId:t.user?.id??"",role:t.user?.role,isSuperAdmin:t.user?.role==="super_admin"});}function O(e){let a={},t=e.registry.getCollections();for(let r of t){let o=r.slug;a[o]={find:P(e),findByID:v(e),create:K(e),update:E(e),delete:j(e),count:S(e)};}let n=e.registry.getGlobals();for(let r of n){let o=r.slug;a[`_globals_${o}`]={get:async s=>(await W(r,"read",e),await e.db.findOne({collection:`_globals_${o}`,where:{},tenantId:e.tenantId,depth:s?.depth,draft:s?.draft,select:s?.select})),update:async s=>{await W(r,"update",e);let i=e.registry.getZodSchema(o).parse(s.data),d=await e.db.findOne({collection:`_globals_${o}`,where:{},tenantId:e.tenantId,draft:true}),l;return d?l=await e.db.update({collection:`_globals_${o}`,id:d.id,data:i,tenantId:e.tenantId}):l=await e.db.create({collection:`_globals_${o}`,data:{...i,id:o},tenantId:e.tenantId}),l}};}return a}function L(e){if(e.settings?.access?.apiAccess?.trpcEnabled===false)throw new Error("tRPC API is disabled");return O(e)}exports.a=V;exports.b=P;exports.c=v;exports.d=K;exports.e=E;exports.f=j;exports.g=S;exports.h=O;exports.i=L;
|
package/dist/chunk-FSL3NLRT.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkZHA446FA_cjs=require('./chunk-ZHA446FA.cjs'),chunkZOVH6QT5_cjs=require('./chunk-ZOVH6QT5.cjs'),chunk7WMMKGEO_cjs=require('./chunk-7WMMKGEO.cjs'),chunkBUNLC3II_cjs=require('./chunk-BUNLC3II.cjs'),crypto=require('crypto');chunkBUNLC3II_cjs.h();var B={COLLECTION_CREATE:"collection.create",COLLECTION_UPDATE:"collection.update",COLLECTION_DELETE:"collection.delete",MEDIA_UPLOAD:"media.upload",MEDIA_DELETE:"media.delete",AUTH_LOGIN:"auth.login",AUTH_REGISTER:"auth.register",AUTH_LOGOUT:"auth.logout",ORDER_CREATED:"order.created",ORDER_PAID:"order.paid",ORDER_SHIPPED:"order.shipped",ORDER_DELIVERED:"order.delivered"},M=Object.values(B);var b="_webhooks",D="_webhook_deliveries";chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();async function _(o,t,s,e={}){let r=e.timeout||3e4,i=Date.now(),u=new AbortController,c=setTimeout(()=>u.abort(),r);try{let a=await fetch(o,{method:"POST",headers:t,body:s,signal:u.signal});clearTimeout(c);let n=Date.now()-i,l;try{l=(await a.text()).slice(0,1e3);}catch{}let d={success:a.ok,status:a.status,statusText:a.statusText,body:l,duration:n};return d.success&&e.onSuccess?e.onSuccess(d):!d.success&&e.onFailure&&e.onFailure(`HTTP ${a.status}: ${a.statusText}`),d}catch(a){clearTimeout(c);let n=Date.now()-i,l=a.name==="AbortError"?`Request timed out after ${r}ms`:a.message||"Unknown error";return e.onFailure&&e.onFailure(l),{success:false,status:0,duration:n,error:l}}}async function L(o,t,s={}){let e=JSON.stringify(t),r={"Content-Type":"application/json","User-Agent":"Kyro-CMS-Webhook/1.0","X-Webhook-Event":t.event,"X-Webhook-Delivery":t.id,"X-Webhook-Timestamp":t.timestamp,...o.headers||{}};return o.secret&&(r["X-Webhook-Signature"]=C(e,o.secret)),_(o.url,r,e,s)}chunkBUNLC3II_cjs.h();async function $(o,t,s={}){let e=o.config||{},r=process.env.GITHUB_TOKEN;if(!r)return {success:false,status:0,duration:0,error:"GITHUB_TOKEN environment variable is not set"};if(!e.githubOwner||!e.githubRepo)return {success:false,status:0,duration:0,error:"GitHub owner and repo are required"};let i=e.githubBranch||"main",u=Date.now(),c=async(a,n,l)=>{let d=await fetch(a,{method:n,headers:{"Content-Type":"application/json",Accept:"application/vnd.github+json",Authorization:`Bearer ${r}`,"X-GitHub-Api-Version":"2022-11-28","User-Agent":"Kyro-CMS-Webhook/1.0"},body:l?JSON.stringify(l):void 0});if(!d.ok){let y=await d.text();throw new Error(`GitHub API HTTP ${d.status}: ${y}`)}return d.json()};try{let a=`https://api.github.com/repos/${e.githubOwner}/${e.githubRepo}/git/refs/heads/${i}`,l=(await c(a,"GET")).object.sha,d=`https://api.github.com/repos/${e.githubOwner}/${e.githubRepo}/git/commits/${l}`,f=(await c(d,"GET")).tree.sha,p=`https://api.github.com/repos/${e.githubOwner}/${e.githubRepo}/git/commits`,m=(await c(p,"POST",{message:`Content updated via Kyro CMS (${t.event})`,tree:f,parents:[l]})).sha;return await c(a,"PATCH",{sha:m,force:!1}),{success:!0,status:201,duration:Date.now()-u,body:`Successfully pushed empty commit ${m} to branch ${i}`}}catch(a){return {success:false,status:0,duration:Date.now()-u,error:a.message||"Failed to push empty commit to GitHub"}}}var j={generic:L,"github-push":$};function P(o){return j[o||"generic"]||j.generic}function C(o,t){return `sha256=${crypto.createHmac("sha256",t).update(o).digest("hex")}`}function S(){return crypto.randomBytes(32).toString("hex")}async function K(o,t,s={}){return P(o.action)(o,t,s)}async function x(o,t,s,e={}){let r=e.maxRetries??5,i=e.retryDelay??1e3,u=null;for(let c=0;c<=r;c++){if(c>0){let a=Math.min(i*Math.pow(2,c-1),3e4);e.onRetry&&e.onRetry(c,`Retrying in ${a}ms...`),await V(a);}if(e.onRetry&&c>0&&e.onRetry(c,`Attempt ${c+1}/${r+1}`),u=await K(o,t,{...e,onRetry:void 0,onSuccess:void 0,onFailure:void 0}),u.success)return u;if(!(u.error?.includes("timed out")&&c<r)&&u.status>=400&&u.status<500)return u}return u||{success:false,status:0,duration:0,error:"All delivery attempts failed"}}function I(o,t,s,e,r,i){return {id:o,webhookId:t,event:s,payload:e,attempt:r,status:i.success?"success":"failed",responseStatus:i.status||void 0,responseBody:i.body,duration:i.duration,error:i.error,createdAt:new Date().toISOString(),deliveredAt:i.success?new Date().toISOString():void 0}}function V(o){return new Promise(t=>setTimeout(t,o))}function F(){return {id:`test_${Date.now()}`,event:"collection.create",timestamp:new Date().toISOString(),collection:"test",operation:"create",data:{message:"This is a test webhook delivery"},user:{id:"system",email:"system@kyro.dev",role:"super_admin"}}}chunkBUNLC3II_cjs.h();function U(o){let t=new Set,s=[];for(let e of o){let r=e==="create"||e==="update"||e==="delete"?`collection.${e}`:e;t.has(r)||(t.add(r),s.push(r));}return s}var T=class{db;constructor(t){this.db=t;}async getWebhooks(t){let e=(await this.db.find({collection:b,where:t?.status?{status:{equals:t.status}}:{},limit:100,page:1,draft:true})).docs;return t?.event?e.filter(r=>r.events.includes(t.event)):e}async getWebhookById(t){return this.db.findByID({collection:b,id:t,draft:true})}async createWebhook(t){let s=new Date().toISOString(),e=t.secret||S(),r={id:crypto.randomUUID(),name:t.name,url:t.url,events:U(t.events),collections:t.collections||[],status:t.status||"active",secret:e,headers:t.headers||{},action:t.action||"generic",config:t.config||{},createdAt:s,updatedAt:s};return await this.db.create({collection:b,data:r}),r}async updateWebhook(t,s){let e=await this.getWebhookById(t);if(!e)return null;let r={...e,...s,events:s.events?U(s.events):e.events,collections:s.collections!==void 0?s.collections:e.collections,action:s.action!==void 0?s.action:e.action,config:s.config!==void 0?{...e.config,...s.config}:e.config,updatedAt:new Date().toISOString()};return s.secret===""&&"secret"in s&&delete r.secret,await this.db.update({collection:b,id:t,data:r}),r}async deleteWebhook(t){await this.db.delete({collection:b,id:t});}async trigger(t,s){let e=await this.getWebhooks({status:"active",event:t}),r=s.collection,i=e.filter(a=>!a.collections||a.collections.length===0||!r?true:a.collections.includes(r));if(i.length===0)return [];let u={id:crypto.randomUUID(),event:t,timestamp:new Date().toISOString(),...s},c=[];for(let a of i){let n=await this.triggerWebhook(a,u);c.push(n);}return c}async triggerWebhook(t,s){let e=crypto.randomUUID();try{let r=await x(t,s,e,{maxRetries:5,retryDelay:1e3}),i=I(e,t.id,t.events[0],s,1,r);try{await this.db.create({collection:D,data:i});}catch{console.warn("[WebhookService] Failed to save delivery record:",e);}return r.success?await this.updateWebhook(t.id,{lastTriggered:new Date().toISOString(),lastError:null}).catch(()=>{}):await this.updateWebhook(t.id,{lastError:r.error||`HTTP ${r.status}`}).catch(()=>{}),{deliveryId:e,webhookId:t.id,event:t.events[0],status:r.success?"success":"failed",responseStatus:r.status,duration:r.duration,error:r.error}}catch(r){return {deliveryId:e,webhookId:t.id,event:t.events[0],status:"failed",error:r.message}}}async testWebhook(t){let s=await this.getWebhookById(t);if(!s)return null;let e={id:crypto.randomUUID(),event:s.events[0]||"collection.create",timestamp:new Date().toISOString(),collection:"test",operation:"create",data:{message:"This is a test webhook delivery from Kyro CMS"},user:{id:"system",email:"system@kyro.dev",role:"super_admin"}};return this.triggerWebhook(s,e)}async getDeliveryHistory(t,s=50){return (await this.db.find({collection:D,where:{webhookId:{equals:t}},sort:"-createdAt",limit:s,page:1})).docs}async retryDelivery(t){let s=await this.db.findByID({collection:D,id:t});if(!s)return null;let e=await this.getWebhookById(s.webhookId);return e?this.triggerWebhook(e,s.payload):null}};function z(o){return new T(o)}chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();function N(o){return o==="read"?"read":o==="create"?"create":o==="update"?"update":"delete"}function X(o,t){return {none:false,read:o==="read",create:o==="read"||o==="create",update:o==="read"||o==="create"||o==="update",delete:o==="read"||o==="create"||o==="update"||o==="delete",admin:true}[t]||false}async function Ie(o,t,s,e={}){let{user:r,req:i,tenantId:u,apiKey:c}=s,{enablePublicAccess:a=true,defaultAccess:n="none"}=e,l=o.access?.[t];if(l){let y=await chunkZHA446FA_cjs.h(l,{req:i,user:r,tenantId:u});return y===false?{allowed:false,error:"Access denied",status:403}:typeof y=="object"?{allowed:true,extraWhere:y}:{allowed:true}}if(c?.permissions?.length>0){let y=o.slug,f=N(t),p=`${y}:${f}`;return !chunkZHA446FA_cjs.e(c.permissions,p)&&!chunkZHA446FA_cjs.e(c.permissions,`${y}:admin`)?{allowed:false,error:"Access denied: insufficient permissions",status:403}:{allowed:true}}if(r){let y=o.slug,f=N(t),p=`${y}:${f}`,O=chunk7WMMKGEO_cjs.a({id:r.id,email:r.email,role:r.role},p),m=chunk7WMMKGEO_cjs.a({id:r.id,email:r.email,role:r.role},`${y}:admin`);return O||m?{allowed:true}:{allowed:false,error:"Access denied: missing RBAC permission",status:403}}let d=X(t,n);return a&&d?{allowed:true}:{allowed:false,error:"Authentication required",status:401}}async function He(o,t,s,e={}){let{user:r,req:i,tenantId:u}=s,{enablePublicAccess:c=true}=e,a=o.access?.[t];if(a)return await chunkZHA446FA_cjs.h(a,{req:i,user:r,tenantId:u})===false?{allowed:false,error:"Access denied",status:403}:{allowed:true};if(r){let n=`globals:${t}`,l=chunk7WMMKGEO_cjs.a({id:r.id,email:r.email,role:r.role},n),d=chunk7WMMKGEO_cjs.a({id:r.id,email:r.email,role:r.role},"globals:admin");return l||d?{allowed:true}:{allowed:false,error:"Access denied: missing RBAC permission",status:403}}return c?{allowed:true}:{allowed:false,error:"Authentication required",status:401}}chunkBUNLC3II_cjs.h();function Y(o){if(!o)return [];if(typeof o=="string")return [{id:o}];if(Array.isArray(o))return o.map(t=>typeof t=="object"?{id:t.value??t.id??t,relationTo:t.relationTo}:{id:t});if(typeof o=="object"){let t=o.value??o.id??o;if(typeof t=="string")return [{id:t,relationTo:o.relationTo}];if(Array.isArray(t))return t.map(s=>({id:s,relationTo:o.relationTo}))}return []}function k(o,t,s){if(!(!o||typeof o!="object")){for(let e of t)if(!(!e.name&&e.type!=="row"&&e.type!=="collapsible"&&e.type!=="tabs")){if(e.type==="relationship"||e.type==="upload")s(e,o);else if(e.type==="group"||e.type==="collapsible"||e.type==="row"){let r=e.name?o[e.name]:o;k(r,e.fields||[],s);}else if(e.type==="tabs"&&e.tabs){let r=e.name?o[e.name]:o;for(let i of e.tabs)k(r,i.fields||[],s);}else if(e.type==="array"&&e.name&&Array.isArray(o[e.name]))for(let r of o[e.name])k(r,e.fields||[],s);else if(e.type==="blocks"&&e.name&&Array.isArray(o[e.name]))for(let r of o[e.name]){if(!r||typeof r!="object")continue;let i=r.type||r.blockType;if(!i)continue;let u=e.blocks?.find(c=>c.slug===i);if(u&&Array.isArray(u.fields)){let c=r.data&&typeof r.data=="object"?r.data:r;k(c,u.fields,s);}}}}}function J(o,t,s){k(o,t,(e,r)=>{let i=r[e.name];if(!i)return;let u=Array.isArray(e.relationTo)?e.relationTo:[e.relationTo],c=Y(i);for(let a of c){if(!a.id)continue;let n=a.relationTo?[a.relationTo]:u;for(let l of n)l!=="*"&&(s.has(l)||s.set(l,new Set),s.get(l).add(a.id));}});}function Q(o,t,s){k(o,t,(e,r)=>{let i=r[e.name];if(!i)return;let u=Array.isArray(e.relationTo)?e.relationTo:[e.relationTo],c=n=>{r[e.name]=n;},a=(n,l)=>{let d=l?[l]:u;for(let y of d){let f=s.get(y);if(f&&f.has(n))return f.get(n)}return null};if(typeof i=="string"){let n=a(i);c(n||{id:i});}else if(Array.isArray(i))c(i.map(n=>{let l=typeof n=="object"?n.value??n.id:n,d=typeof n=="object"?n.relationTo:void 0,y=a(l,d);return y||{id:l}}));else if(typeof i=="object"){let n=i.value??i.id,l=i.relationTo,d=a(n,l);c(d||{id:n});}});}async function Z(o,t,s,e,r=1,i=0){if(!o||o.length===0||r>i)return;let u=new Map;for(let n of o)J(n,t,u);if(u.size===0)return;let c=new Map,a=new Map;for(let[n,l]of u.entries()){if(l.size===0||!e.getCollection(n))continue;let y=new Map,f=Array.from(l),p=[];for(let O of f){try{let W=(await s.find({collection:n,where:{id:{in:f}},limit:f.length,draft:!0}))?.docs||[];for(let v of W)v&&v.id&&(y.set(String(v.id),v),p.push(v));}catch{for(let m of f)try{let W=await s.findByID({collection:n,id:m,draft:!0});W&&(y.set(m,W),p.push(W));}catch{}}break}c.set(n,y),p.length>0&&a.set(n,p);}if(r<i)for(let[n,l]of a.entries()){let d=e.getCollection(n);d&&await Z(l,d.fields,s,e,r+1,i);}for(let n=0;n<o.length;n++)Q(o[n],t,c),o[n]=chunkZOVH6QT5_cjs.a(o[n]);}
|
|
2
|
-
exports.a=Ie;exports.b=He;exports.c=B;exports.d=M;exports.e=b;exports.f=D;exports.g=C;exports.h=S;exports.i=K;exports.j=x;exports.k=I;exports.l=F;exports.m=T;exports.n=z;exports.o=Z;
|