cognova 0.2.3 → 0.2.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/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{DQlXU6_H.js → -2wkydbj.js} +1 -1
- package/.output/public/_nuxt/{D9V13KTK.js → 0J8pJb0Z.js} +1 -1
- package/.output/public/_nuxt/{CclZMdca.js → 0LyRrTRM.js} +1 -1
- package/.output/public/_nuxt/{CflRLvFC.js → 1Hz98MKF.js} +1 -1
- package/.output/public/_nuxt/{DkBIU-1F.js → 1IuG3yiQ.js} +1 -1
- package/.output/public/_nuxt/{B_17gAr_.js → 4bC1z31I.js} +1 -1
- package/.output/public/_nuxt/{CC4Goztu.js → A5lrd5_j.js} +1 -1
- package/.output/public/_nuxt/{BHe4VLtR.js → B-5roYpk.js} +1 -1
- package/.output/public/_nuxt/{B_qzFVK_.js → B-YQztaH.js} +1 -1
- package/.output/public/_nuxt/B1gFtqXK.js +1 -0
- package/.output/public/_nuxt/B43p0So7.js +1 -0
- package/.output/public/_nuxt/{DSQj-oMk.js → B5OWqWCh.js} +1 -1
- package/.output/public/_nuxt/{CvJtd2Af.js → B7-0ADn3.js} +1 -1
- package/.output/public/_nuxt/{DU6ewLkE.js → B8Kve-DH.js} +1 -1
- package/.output/public/_nuxt/{BF7413u4.js → B9Kd_0HK.js} +1 -1
- package/.output/public/_nuxt/{BhrzKbv9.js → BJ_GgKV0.js} +1 -1
- package/.output/public/_nuxt/{CM2phu_3.js → BJi2ZHtT.js} +1 -1
- package/.output/public/_nuxt/{qR_K5W8V.js → BLL1JLwq.js} +1 -1
- package/.output/public/_nuxt/{aiXk7zRt.js → BLszW9T3.js} +1 -1
- package/.output/public/_nuxt/{DeAGWdWK.js → BMLwzSDu.js} +1 -1
- package/.output/public/_nuxt/{B5dI_yLq.js → BNlugvM3.js} +1 -1
- package/.output/public/_nuxt/{Dvw-hR3Y.js → BTfZ7nek.js} +1 -1
- package/.output/public/_nuxt/{m5001Uvl.js → BTk5mgdf.js} +1 -1
- package/.output/public/_nuxt/{DfF1qofg.js → BW-E-Sar.js} +1 -1
- package/.output/public/_nuxt/{xxnk7j0F.js → BZFXnEwe.js} +1 -1
- package/.output/public/_nuxt/{DaBp0Gba.js → B_28CKij.js} +2 -2
- package/.output/public/_nuxt/{CYjcQPl-.js → BaJEGr8G.js} +1 -1
- package/.output/public/_nuxt/{CFyD2NHP.js → BaVaTug8.js} +1 -1
- package/.output/public/_nuxt/{_E89BQAO.js → Bb1B0ntt.js} +1 -1
- package/.output/public/_nuxt/{C3dYlP5x.js → Bb9LNSu_.js} +1 -1
- package/.output/public/_nuxt/{BLmc9T7l.js → BbPnqQJ0.js} +1 -1
- package/.output/public/_nuxt/{XHiJSquP.js → Bc0NIKN7.js} +1 -1
- package/.output/public/_nuxt/{DFg8PvHV.js → BdCB2PoJ.js} +1 -1
- package/.output/public/_nuxt/{BQZfTrUg.js → Bf34lExB.js} +1 -1
- package/.output/public/_nuxt/{CrZGoMo_.js → BhOIdu3Z.js} +1 -1
- package/.output/public/_nuxt/{PqWbiAD2.js → BhSWIRpp.js} +1 -1
- package/.output/public/_nuxt/{DqsUSndS.js → BjFs8Ujb.js} +1 -1
- package/.output/public/_nuxt/{DauLdT7p.js → BmTCDcNm.js} +1 -1
- package/.output/public/_nuxt/{DAIbdyS6.js → Bn8loaeQ.js} +1 -1
- package/.output/public/_nuxt/{BGtUoCgi.js → BoPAYize.js} +1 -1
- package/.output/public/_nuxt/{BtVIBBUN.js → BrICHPil.js} +1 -1
- package/.output/public/_nuxt/{gGlaVUMD.js → Brqrl-cH.js} +1 -1
- package/.output/public/_nuxt/{9QKmiSP_.js → BsPj3ifk.js} +1 -1
- package/.output/public/_nuxt/{DAvlXjt0.js → BsXPllgv.js} +1 -1
- package/.output/public/_nuxt/{DEATxnaF.js → BvuV9uCn.js} +1 -1
- package/.output/public/_nuxt/{DaH2FbAy.js → By6kmkhJ.js} +1 -1
- package/.output/public/_nuxt/{Cwtd8e-P.js → ByfSJZV6.js} +1 -1
- package/.output/public/_nuxt/{D1r0uqf3.js → C14DGwaT.js} +1 -1
- package/.output/public/_nuxt/{DmAM6bZ0.js → C4XVJnNJ.js} +1 -1
- package/.output/public/_nuxt/{BIvPdoE3.js → C5nfaH9w.js} +1 -1
- package/.output/public/_nuxt/{fEUQvmn8.js → C6Kc4XvS.js} +1 -1
- package/.output/public/_nuxt/{BrEXdify.js → CB8_A8N4.js} +1 -1
- package/.output/public/_nuxt/{D1DYuOOm.js → CBrXB4hk.js} +1 -1
- package/.output/public/_nuxt/{Bwcpy7gC.js → CEfkp9Rl.js} +2 -2
- package/.output/public/_nuxt/{D5EZbuub.js → CG0fS-BQ.js} +1 -1
- package/.output/public/_nuxt/{BlPToGni.js → CJ85o8FK.js} +1 -1
- package/.output/public/_nuxt/{-AsXrBBy.js → CK5Ef4YR.js} +1 -1
- package/.output/public/_nuxt/{cL7whuPe.js → CLZS246x.js} +1 -1
- package/.output/public/_nuxt/{BnmwiZbF.js → CNwGp6eP.js} +1 -1
- package/.output/public/_nuxt/{Bw5h4Jaf.js → CSQ-nblB.js} +1 -1
- package/.output/public/_nuxt/{DQvuQpwh.js → CVr40yKH.js} +1 -1
- package/.output/public/_nuxt/{B-2BuR5g.js → CW8xtqwN.js} +1 -1
- package/.output/public/_nuxt/{CQpYRq61.js → CXuKrnTA.js} +1 -1
- package/.output/public/_nuxt/{DWhzQg7B.js → CeDxLTxX.js} +1 -1
- package/.output/public/_nuxt/{Bl6LNGlA.js → Cebw7Q7c.js} +1 -1
- package/.output/public/_nuxt/{DmmTnMzZ.js → Cedv1M65.js} +1 -1
- package/.output/public/_nuxt/{B6fnZcA6.js → CfWDee_q.js} +1 -1
- package/.output/public/_nuxt/{CHpwuMSk.js → CgQKyBSS.js} +1 -1
- package/.output/public/_nuxt/{C2RZSTuy.js → Ci-MVdCd.js} +1 -1
- package/.output/public/_nuxt/{DBKzwexZ.js → CjRmY2OQ.js} +1 -1
- package/.output/public/_nuxt/{Tu4FhMRc.js → CjYUi9c8.js} +1 -1
- package/.output/public/_nuxt/{xKRwul0f.js → CkvyAKbu.js} +1 -1
- package/.output/public/_nuxt/{wPSLEMBw.js → CnW8zyuA.js} +1 -1
- package/.output/public/_nuxt/{UO2Y9Nve.js → Cow1TrPj.js} +1 -1
- package/.output/public/_nuxt/{C4zyxZG7.js → CpC3C9gj.js} +1 -1
- package/.output/public/_nuxt/{D0P9llU7.js → CphXSvBo.js} +1 -1
- package/.output/public/_nuxt/{mQkFCz_M.js → CqiOV9n1.js} +1 -1
- package/.output/public/_nuxt/{BIMBp1Tj.js → CrjKigv8.js} +1 -1
- package/.output/public/_nuxt/{p9l1LjVc.js → CvMqUdkl.js} +3 -3
- package/.output/public/_nuxt/{DmeAKr3J.js → CwCEQ4Dw.js} +1 -1
- package/.output/public/_nuxt/{BbRPwpIX.js → CwJR22-0.js} +1 -1
- package/.output/public/_nuxt/{BtNnS4m3.js → CwaMSU1O.js} +1 -1
- package/.output/public/_nuxt/{D_vK6VPK.js → CxJr4mB0.js} +1 -1
- package/.output/public/_nuxt/{ARbTpeGy.js → CzTTKfet.js} +1 -1
- package/.output/public/_nuxt/{DaJo0CeV.js → CzqLfT8k.js} +1 -1
- package/.output/public/_nuxt/{5UFq_rDn.js → D-wVwRIx.js} +1 -1
- package/.output/public/_nuxt/D2f7BlK2.js +1 -0
- package/.output/public/_nuxt/D2lmhTjQ.js +1 -0
- package/.output/public/_nuxt/{B4u7Mczo.js → D3V98LVR.js} +1 -1
- package/.output/public/_nuxt/D64-rCSQ.js +1 -0
- package/.output/public/_nuxt/{CGQDTeaO.js → DAFasgHH.js} +1 -1
- package/.output/public/_nuxt/{BlwHr46F.js → DAs574wU.js} +1 -1
- package/.output/public/_nuxt/{BQnublTW.js → DB3y_21M.js} +1 -1
- package/.output/public/_nuxt/{C3sh_tLi.js → DCco_rlV.js} +1 -1
- package/.output/public/_nuxt/{90UksHlj.js → DGP2JJt8.js} +1 -1
- package/.output/public/_nuxt/{HOeKUnra.js → DImdNj-F.js} +1 -1
- package/.output/public/_nuxt/{CzIMQevQ.js → DMsHLHmB.js} +1 -1
- package/.output/public/_nuxt/{ct6_k5IW.js → DNpsjOxN.js} +1 -1
- package/.output/public/_nuxt/{UKPXYG4z.js → DV0JMebZ.js} +1 -1
- package/.output/public/_nuxt/{CLzcRUcs.js → DZ_azKLI.js} +1 -1
- package/.output/public/_nuxt/{BBiRyPlN.js → DZdh7_lh.js} +1 -1
- package/.output/public/_nuxt/{MpTk6K7N.js → DaiWSWdm.js} +1 -1
- package/.output/public/_nuxt/{BOgdaA_8.js → Db5XIfWS.js} +1 -1
- package/.output/public/_nuxt/{ClXDAYjE.js → DfpSaqgV.js} +1 -1
- package/.output/public/_nuxt/{D3a8R1T6.js → DgKeJf5C.js} +1 -1
- package/.output/public/_nuxt/{BWqJFnZy.js → DgPiIWA2.js} +1 -1
- package/.output/public/_nuxt/{BKaRtCjP.js → Dkzqkzki.js} +1 -1
- package/.output/public/_nuxt/DpYns7cT.js +1 -0
- package/.output/public/_nuxt/{5Zh-9l8_.js → Dpp5cOwJ.js} +1 -1
- package/.output/public/_nuxt/{DiGBA-aA.js → Drr-RSSP.js} +1 -1
- package/.output/public/_nuxt/{CUN4bYcg.js → DsKy-gee.js} +1 -1
- package/.output/public/_nuxt/{BqtxLJaf.js → DuOsLoVR.js} +1 -1
- package/.output/public/_nuxt/{IR1jkN7B.js → DvgLoqaC.js} +1 -1
- package/.output/public/_nuxt/{2W1RPpXM.js → Dx2Tgm6S.js} +1 -1
- package/.output/public/_nuxt/{D1dDc8Vw.js → DxR8g9So.js} +1 -1
- package/.output/public/_nuxt/Dysa6np_.js +1 -0
- package/.output/public/_nuxt/{gjmGkVlL.js → DytaiikM.js} +1 -1
- package/.output/public/_nuxt/{Cx44SSNp.js → EgYyfo1g.js} +3 -3
- package/.output/public/_nuxt/{NZ7Wz6LP.js → HC3657Xq.js} +1 -1
- package/.output/public/_nuxt/{CZ32KfaS.js → HCCuOAgZ.js} +1 -1
- package/.output/public/_nuxt/{BVypxKRT.js → JJIcQEna.js} +1 -1
- package/.output/public/_nuxt/{FNhYm5FX.js → MdebRWqA.js} +1 -1
- package/.output/public/_nuxt/{CxEVzuCn.js → MzEmU9ER.js} +1 -1
- package/.output/public/_nuxt/{C0TUK31m.js → NBE83ZQn.js} +1 -1
- package/.output/public/_nuxt/{ZR87XvwB.js → NlScC3GW.js} +1 -1
- package/.output/public/_nuxt/{xgpiGSxb.js → RRoc4m9d.js} +1 -1
- package/.output/public/_nuxt/{BXxYdXMr.js → S4a_N6rD.js} +1 -1
- package/.output/public/_nuxt/{DAE2hbP7.js → WWNeb45u.js} +1 -1
- package/.output/public/_nuxt/{DiJxF69i.js → XzRnkkwG.js} +1 -1
- package/.output/public/_nuxt/{DdPA4eTX.js → Zjvb5YJR.js} +1 -1
- package/.output/public/_nuxt/{uc4c4mfb.js → _16_b82K.js} +1 -1
- package/.output/public/_nuxt/{CXoITXft.js → atVSHCxP.js} +1 -1
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/8c74f6cf-7412-4c62-a25a-07541ca3e889.json +1 -0
- package/.output/public/_nuxt/{Dz6sfh81.js → deSeNTOh.js} +1 -1
- package/.output/public/_nuxt/f7zDjk6q.js +1 -0
- package/.output/public/_nuxt/{CdpT_Vb6.js → fTEmwfo4.js} +1 -1
- package/.output/public/_nuxt/{CkqNv7sq.js → hqpqUuXS.js} +1 -1
- package/.output/public/_nuxt/{DPFugPaB.js → jeu3Xx8e.js} +1 -1
- package/.output/public/_nuxt/{ApfLnl06.js → pkbwpgSD.js} +1 -1
- package/.output/public/_nuxt/{t_9QQ4MF.js → qW7F87d8.js} +3 -3
- package/.output/public/_nuxt/{C5I-XBZT.js → sdvIKLwS.js} +1 -1
- package/.output/public/_nuxt/{B7uMSBlN.js → vM-wdhkZ.js} +1 -1
- package/.output/public/_nuxt/{DNE7kw9s.js → w3t8WD8v.js} +1 -1
- package/.output/public/_nuxt/{C1T4GK6c.js → zBoPDS4z.js} +1 -1
- package/.output/server/chunks/build/A-BWukSPjS.mjs +4 -1
- package/.output/server/chunks/build/Accordion-BaJYea6e.mjs +4 -1
- package/.output/server/chunks/build/AccordionItem-DdG2zgcN.mjs +4 -1
- package/.output/server/chunks/build/Badge-BrU9UkCv.mjs +4 -1
- package/.output/server/chunks/build/Blockquote-DND8wTkU.mjs +4 -1
- package/.output/server/chunks/build/Callout-1halpaEg.mjs +4 -1
- package/.output/server/chunks/build/Card-BHCSDKDt.mjs +4 -1
- package/.output/server/chunks/build/CardGroup-BOuJcNGp.mjs +4 -1
- package/.output/server/chunks/build/Caution-BP3y-TcC.mjs +4 -1
- package/.output/server/chunks/build/Code-B1xkAS5a.mjs +4 -1
- package/.output/server/chunks/build/CodeCollapse-BIhaNa22.mjs +4 -1
- package/.output/server/chunks/build/CodeGroup-BviYyCuo.mjs +4 -1
- package/.output/server/chunks/build/CodeIcon-CWD5HcV7.mjs +5 -2
- package/.output/server/chunks/build/CodePreview-D8PsCQ6m.mjs +4 -1
- package/.output/server/chunks/build/CodeTree-BUTLupmL.mjs +4 -1
- package/.output/server/chunks/build/Collapsible-BIvXNaSq.mjs +4 -1
- package/.output/server/chunks/build/DropdownMenu-BBrV9nXz.mjs +1 -1
- package/.output/server/chunks/build/EditorToolbar-DIfb5arC.mjs +1 -1
- package/.output/server/chunks/build/Em-DsIz_BnD.mjs +4 -1
- package/.output/server/chunks/build/Field-cwwmSQDT.mjs +4 -1
- package/.output/server/chunks/build/FieldGroup-CAIpQv8s.mjs +4 -1
- package/.output/server/chunks/build/H1-BbFNsPyP.mjs +4 -1
- package/.output/server/chunks/build/H2-vHTl_pWr.mjs +4 -1
- package/.output/server/chunks/build/H3-7eTcfO3s.mjs +4 -1
- package/.output/server/chunks/build/H4-C89p_PKO.mjs +4 -1
- package/.output/server/chunks/build/Hr-Bm8RlL3O.mjs +4 -1
- package/.output/server/chunks/build/Icon-Dp9iy0BI.mjs +4 -1
- package/.output/server/chunks/build/Img-CWLmvN1t.mjs +5 -2
- package/.output/server/chunks/build/Kbd-CQG6I_Ch.mjs +4 -1
- package/.output/server/chunks/build/Li-Bw1QUaGv.mjs +4 -1
- package/.output/server/chunks/build/MDC-Dx0YPDhe.mjs +1 -1
- package/.output/server/chunks/build/Note-CHkjm9jm.mjs +4 -1
- package/.output/server/chunks/build/Ol-D-fPnfFM.mjs +4 -1
- package/.output/server/chunks/build/P-B5YI1V9y.mjs +4 -1
- package/.output/server/chunks/build/Pre-ChiJcf3C.mjs +4 -1
- package/.output/server/chunks/build/ProseH5-DahJyv8h.mjs +4 -1
- package/.output/server/chunks/build/ProseH6-C4Is5h6c.mjs +4 -1
- package/.output/server/chunks/build/Select-BB1oLrCD.mjs +1 -1
- package/.output/server/chunks/build/SelectMenu-DPssg6zD.mjs +1 -1
- package/.output/server/chunks/build/Steps-BZpvXfzb.mjs +4 -1
- package/.output/server/chunks/build/Strong-DXJqOWL3.mjs +4 -1
- package/.output/server/chunks/build/Table-BSrLZ7dt.mjs +4 -1
- package/.output/server/chunks/build/Table-DCwTlhCj.mjs +1 -1
- package/.output/server/chunks/build/Tabs-Dk3nvOFF.mjs +4 -1
- package/.output/server/chunks/build/TabsItem-CDhyuBtJ.mjs +4 -1
- package/.output/server/chunks/build/Tbody-CjMT5oH-.mjs +4 -1
- package/.output/server/chunks/build/Td-ZBVaEjFN.mjs +4 -1
- package/.output/server/chunks/build/Th-D317icbd.mjs +4 -1
- package/.output/server/chunks/build/Thead-Ca_ZESTK.mjs +4 -1
- package/.output/server/chunks/build/Tip-CP3oTARR.mjs +4 -1
- package/.output/server/chunks/build/Tooltip-TRyl6dje.mjs +1 -1
- package/.output/server/chunks/build/Tr-6jI8j9gD.mjs +4 -1
- package/.output/server/chunks/build/Tree-DUhXKd8y.mjs +1 -1
- package/.output/server/chunks/build/Ul-BUGj_CPb.mjs +4 -1
- package/.output/server/chunks/build/Warning-BJ8G6cxC.mjs +4 -1
- package/.output/server/chunks/build/_id_-DN00UDdO.mjs +4 -1
- package/.output/server/chunks/build/_id_-DN00UDdO.mjs.map +1 -1
- package/.output/server/chunks/build/_name_-BnS_KEfX.mjs +4 -1
- package/.output/server/chunks/build/_name_-BnS_KEfX.mjs.map +1 -1
- package/.output/server/chunks/build/_uuid_-DfJaumTE.mjs +5 -2
- package/.output/server/chunks/build/auth-CvD7MqKW.mjs +4 -1
- package/.output/server/chunks/build/auth-CvD7MqKW.mjs.map +1 -1
- package/.output/server/chunks/build/chat-CZMiB68R.mjs +4 -1
- package/.output/server/chunks/build/chat-CZMiB68R.mjs.map +1 -1
- package/.output/server/chunks/build/client.precomputed.mjs +1 -1
- package/.output/server/chunks/build/cookie-C_iulBi6.mjs +1 -1
- package/.output/server/chunks/build/dashboard-CLk1NlbR.mjs +4 -1
- package/.output/server/chunks/build/dashboard-CLk1NlbR.mjs.map +1 -1
- package/.output/server/chunks/build/dashboard-CiVTAZuF.mjs +5 -2
- package/.output/server/chunks/build/docs-ChGwOPg5.mjs +5 -2
- package/.output/server/chunks/build/error-404-BzbcNcdU.mjs +4 -1
- package/.output/server/chunks/build/error-500-uCDjGRW8.mjs +4 -1
- package/.output/server/chunks/build/fetch-BB7Qzkwe.mjs +1 -1
- package/.output/server/chunks/build/hooks-D328DcO6.mjs +4 -1
- package/.output/server/chunks/build/hooks-D328DcO6.mjs.map +1 -1
- package/.output/server/chunks/build/index-Byt-3Yq6.mjs +4 -1
- package/.output/server/chunks/build/index-C9PuieXh.mjs +4 -1
- package/.output/server/chunks/build/index-C9PuieXh.mjs.map +1 -1
- package/.output/server/chunks/build/{index-C_LcBBgO.mjs → index-CAnGTRlu.mjs} +281 -14
- package/.output/server/chunks/build/{index-C_LcBBgO.mjs.map → index-CAnGTRlu.mjs.map} +1 -1
- package/.output/server/chunks/build/index-CxDxc9fm.mjs +1 -1
- package/.output/server/chunks/build/index-DzdvIi8V.mjs +4 -1
- package/.output/server/chunks/build/{library-CbWcF5wT.mjs → library-Aeg7_Lsb.mjs} +8 -3
- package/.output/server/chunks/build/library-Aeg7_Lsb.mjs.map +1 -0
- package/.output/server/chunks/build/login-DnnElTl2.mjs +4 -1
- package/.output/server/chunks/build/memories-BqA719O1.mjs +4 -1
- package/.output/server/chunks/build/memories-BqA719O1.mjs.map +1 -1
- package/.output/server/chunks/build/server.mjs +8 -5
- package/.output/server/chunks/build/{settings-DdkKCJ00.mjs → settings-DuT6LGJZ.mjs} +524 -12
- package/.output/server/chunks/build/settings-DuT6LGJZ.mjs.map +1 -0
- package/.output/server/chunks/build/styles.mjs +2 -2
- package/.output/server/chunks/build/tasks-DnAFqbtt.mjs +4 -1
- package/.output/server/chunks/build/tasks-DnAFqbtt.mjs.map +1 -1
- package/.output/server/chunks/build/usage-CSrBh4Or.mjs +4 -1
- package/.output/server/chunks/build/useNotificationBus-BG5JNQf1.mjs +1 -1
- package/.output/server/chunks/build/view-n2sYa4Zh.mjs +5 -2
- package/.output/server/chunks/build/virtual_nuxt__Users_tony_Documents_GitHub_second-brain_node_modules_.cache_nuxt_.nuxt_mdc-imports-PtwWlZ2H.mjs +4 -1
- package/.output/server/chunks/nitro/nitro.mjs +2091 -1081
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
- package/.output/server/chunks/routes/_ws/chat.mjs +4 -1
- package/.output/server/chunks/routes/_ws/chat.mjs.map +1 -1
- package/.output/server/chunks/routes/api/agents/_id/cancel.post.mjs +4 -1
- package/.output/server/chunks/routes/api/agents/_id/cancel.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/agents/_id/run.post.mjs +4 -1
- package/.output/server/chunks/routes/api/agents/_id/run.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/agents/_id/runs.get.mjs +4 -1
- package/.output/server/chunks/routes/api/agents/_id/runs.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/agents/_id/stats.get.mjs +4 -1
- package/.output/server/chunks/routes/api/agents/_id/stats.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/agents/_id_.delete.mjs +4 -1
- package/.output/server/chunks/routes/api/agents/_id_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/agents/_id_.get.mjs +4 -1
- package/.output/server/chunks/routes/api/agents/_id_.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/agents/_id_.patch.mjs +4 -1
- package/.output/server/chunks/routes/api/agents/_id_.patch.mjs.map +1 -1
- package/.output/server/chunks/routes/api/agents/stats.get.mjs +4 -1
- package/.output/server/chunks/routes/api/agents/stats.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/auth/_...all_.mjs +4 -1
- package/.output/server/chunks/routes/api/auth/_...all_.mjs.map +1 -1
- package/.output/server/chunks/routes/api/bridges/_id/health.get.mjs +98 -0
- package/.output/server/chunks/routes/api/bridges/_id/health.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/bridges/_id_.delete.mjs +68 -0
- package/.output/server/chunks/routes/api/bridges/_id_.delete.mjs.map +1 -0
- package/.output/server/chunks/routes/api/bridges/_id_.get.mjs +60 -0
- package/.output/server/chunks/routes/api/bridges/_id_.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/bridges/_id_.put.mjs +79 -0
- package/.output/server/chunks/routes/api/bridges/_id_.put.mjs.map +1 -0
- package/.output/server/chunks/routes/api/bridges/context.get.mjs +183 -0
- package/.output/server/chunks/routes/api/bridges/context.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/conversations/_id_.delete.mjs +5 -2
- package/.output/server/chunks/routes/api/conversations/_id_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/conversations/_id_.get.mjs +5 -2
- package/.output/server/chunks/routes/api/conversations/_id_.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/dashboard/overview.get.mjs +5 -2
- package/.output/server/chunks/routes/api/dashboard/overview.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/documents/_id/public.get.mjs +5 -2
- package/.output/server/chunks/routes/api/documents/_id/public.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/documents/_id/restore.post.mjs +5 -2
- package/.output/server/chunks/routes/api/documents/_id/restore.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/documents/by-path.post.mjs +5 -2
- package/.output/server/chunks/routes/api/documents/by-path.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/documents/index.delete.mjs +5 -2
- package/.output/server/chunks/routes/api/documents/index.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/documents/index.put.mjs +5 -2
- package/.output/server/chunks/routes/api/documents/index.put.mjs.map +1 -1
- package/.output/server/chunks/routes/api/fs/delete.post.mjs +5 -2
- package/.output/server/chunks/routes/api/fs/delete.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/fs/list.get.mjs +5 -2
- package/.output/server/chunks/routes/api/fs/list.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/fs/mkdir.post.mjs +5 -2
- package/.output/server/chunks/routes/api/fs/mkdir.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/fs/move.post.mjs +5 -2
- package/.output/server/chunks/routes/api/fs/move.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/fs/read.post.mjs +5 -2
- package/.output/server/chunks/routes/api/fs/read.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/fs/rename.post.mjs +5 -2
- package/.output/server/chunks/routes/api/fs/rename.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/fs/write.post.mjs +5 -2
- package/.output/server/chunks/routes/api/fs/write.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/health.get.mjs +5 -2
- package/.output/server/chunks/routes/api/health.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/home.get.mjs +5 -2
- package/.output/server/chunks/routes/api/home.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/hooks/index.get.mjs +5 -2
- package/.output/server/chunks/routes/api/hooks/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/hooks/index.post.mjs +5 -2
- package/.output/server/chunks/routes/api/hooks/index.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/hooks/stats.get.mjs +5 -2
- package/.output/server/chunks/routes/api/hooks/stats.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.get.mjs +4 -1
- package/.output/server/chunks/routes/api/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.get10.mjs +86 -0
- package/.output/server/chunks/routes/api/index.get10.mjs.map +1 -0
- package/.output/server/chunks/routes/api/index.get2.mjs +11 -5
- package/.output/server/chunks/routes/api/index.get2.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.get3.mjs +8 -34
- package/.output/server/chunks/routes/api/index.get3.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.get4.mjs +35 -5
- package/.output/server/chunks/routes/api/index.get4.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.get5.mjs +12 -15
- package/.output/server/chunks/routes/api/index.get5.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.get6.mjs +17 -22
- package/.output/server/chunks/routes/api/index.get6.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.get7.mjs +28 -40
- package/.output/server/chunks/routes/api/index.get7.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.get8.mjs +56 -38
- package/.output/server/chunks/routes/api/index.get8.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.get9.mjs +36 -39
- package/.output/server/chunks/routes/api/index.get9.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.post.mjs +4 -1
- package/.output/server/chunks/routes/api/index.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.post2.mjs +26 -17
- package/.output/server/chunks/routes/api/index.post2.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.post3.mjs +21 -35
- package/.output/server/chunks/routes/api/index.post3.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.post4.mjs +35 -25
- package/.output/server/chunks/routes/api/index.post4.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.post5.mjs +75 -0
- package/.output/server/chunks/routes/api/index.post5.mjs.map +1 -0
- package/.output/server/chunks/routes/api/index.put.mjs +5 -2
- package/.output/server/chunks/routes/api/index.put.mjs.map +1 -1
- package/.output/server/chunks/routes/api/memory/_id_.delete.mjs +5 -2
- package/.output/server/chunks/routes/api/memory/_id_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/memory/context.get.mjs +5 -2
- package/.output/server/chunks/routes/api/memory/context.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/memory/extract.post.mjs +5 -2
- package/.output/server/chunks/routes/api/memory/extract.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/memory/search.get.mjs +5 -2
- package/.output/server/chunks/routes/api/memory/search.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/memory/store.post.mjs +5 -2
- package/.output/server/chunks/routes/api/memory/store.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/projects/index.delete.mjs +5 -2
- package/.output/server/chunks/routes/api/projects/index.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/projects/index.get.mjs +5 -2
- package/.output/server/chunks/routes/api/projects/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/projects/index.put.mjs +5 -2
- package/.output/server/chunks/routes/api/projects/index.put.mjs.map +1 -1
- package/.output/server/chunks/routes/api/secrets/_key_.delete.mjs +5 -2
- package/.output/server/chunks/routes/api/secrets/_key_.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/secrets/_key_.get.mjs +5 -2
- package/.output/server/chunks/routes/api/secrets/_key_.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/secrets/_key_.put.mjs +5 -2
- package/.output/server/chunks/routes/api/secrets/_key_.put.mjs.map +1 -1
- package/.output/server/chunks/routes/api/skills/_name/delete.post.mjs +69 -0
- package/.output/server/chunks/routes/api/skills/_name/delete.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/skills/_name/export.get.mjs +5 -2
- package/.output/server/chunks/routes/api/skills/_name/export.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/skills/_name/files/create.post.mjs +5 -2
- package/.output/server/chunks/routes/api/skills/_name/files/create.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/skills/_name/files/delete.post.mjs +5 -2
- package/.output/server/chunks/routes/api/skills/_name/files/delete.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/skills/_name/files/read.post.mjs +5 -2
- package/.output/server/chunks/routes/api/skills/_name/files/read.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/skills/_name/files/write.post.mjs +5 -2
- package/.output/server/chunks/routes/api/skills/_name/files/write.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/skills/_name/index.get.mjs +5 -2
- package/.output/server/chunks/routes/api/skills/_name/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/skills/_name/rename.post.mjs +5 -2
- package/.output/server/chunks/routes/api/skills/_name/rename.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/skills/_name/toggle.post.mjs +5 -2
- package/.output/server/chunks/routes/api/skills/_name/toggle.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/skills/create.post.mjs +5 -2
- package/.output/server/chunks/routes/api/skills/create.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/skills/generate.post.mjs +5 -2
- package/.output/server/chunks/routes/api/skills/generate.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/skills/import.post.mjs +5 -2
- package/.output/server/chunks/routes/api/skills/import.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/skills/index.get.mjs +5 -2
- package/.output/server/chunks/routes/api/skills/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/skills/index.get2.mjs +5 -2
- package/.output/server/chunks/routes/api/skills/index.get2.mjs.map +1 -1
- package/.output/server/chunks/routes/api/skills/library/check-updates.get.mjs +5 -2
- package/.output/server/chunks/routes/api/skills/library/check-updates.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/skills/library/install.post.mjs +9 -4
- package/.output/server/chunks/routes/api/skills/library/install.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tasks/_id/restore.post.mjs +5 -2
- package/.output/server/chunks/routes/api/tasks/_id/restore.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tasks/index.delete.mjs +5 -2
- package/.output/server/chunks/routes/api/tasks/index.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tasks/index.get.mjs +4 -1
- package/.output/server/chunks/routes/api/tasks/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tasks/index.put.mjs +5 -2
- package/.output/server/chunks/routes/api/tasks/index.put.mjs.map +1 -1
- package/.output/server/chunks/routes/api/tasks/tags.get.mjs +5 -2
- package/.output/server/chunks/routes/api/tasks/tags.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/usage/stats.get.mjs +5 -2
- package/.output/server/chunks/routes/api/usage/stats.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/user/email.patch.mjs +5 -2
- package/.output/server/chunks/routes/api/user/email.patch.mjs.map +1 -1
- package/.output/server/chunks/routes/api/webhooks/bluebubbles.post.mjs +56 -0
- package/.output/server/chunks/routes/api/webhooks/bluebubbles.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/webhooks/telegram.post.mjs +60 -0
- package/.output/server/chunks/routes/api/webhooks/telegram.post.mjs.map +1 -0
- package/.output/server/chunks/routes/notifications.mjs +5 -2
- package/.output/server/chunks/routes/notifications.mjs.map +1 -1
- package/.output/server/chunks/routes/renderer.mjs +1 -1
- package/.output/server/chunks/routes/terminal.mjs +5 -2
- package/.output/server/chunks/routes/terminal.mjs.map +1 -1
- package/.output/server/index.mjs +5 -2
- package/.output/server/index.mjs.map +1 -1
- package/.output/server/node_modules/.nitro/@discordjs/collection@1.5.3/dist/index.js +543 -0
- package/.output/server/node_modules/.nitro/@discordjs/collection@1.5.3/package.json +76 -0
- package/.output/server/node_modules/.nitro/@discordjs/collection@2.1.1/dist/index.js +567 -0
- package/.output/server/node_modules/.nitro/@discordjs/collection@2.1.1/package.json +86 -0
- package/.output/server/node_modules/@discordjs/builders/dist/index.js +4229 -0
- package/.output/server/node_modules/@discordjs/builders/package.json +99 -0
- package/.output/server/node_modules/@discordjs/formatters/dist/index.js +519 -0
- package/.output/server/node_modules/@discordjs/formatters/package.json +83 -0
- package/.output/server/node_modules/@discordjs/rest/dist/index.js +1515 -0
- package/.output/server/node_modules/@discordjs/rest/package.json +119 -0
- package/.output/server/node_modules/@discordjs/util/dist/index.js +159 -0
- package/.output/server/node_modules/@discordjs/util/package.json +94 -0
- package/.output/server/node_modules/@discordjs/ws/dist/defaultWorker.js +1057 -0
- package/.output/server/node_modules/@discordjs/ws/dist/index.js +1506 -0
- package/.output/server/node_modules/@discordjs/ws/package.json +113 -0
- package/.output/server/node_modules/@sapphire/async-queue/dist/cjs/index.cjs +137 -0
- package/.output/server/node_modules/@sapphire/async-queue/package.json +74 -0
- package/.output/server/node_modules/@sapphire/shapeshift/dist/cjs/index.cjs +3210 -0
- package/.output/server/node_modules/@sapphire/shapeshift/package.json +125 -0
- package/.output/server/node_modules/@sapphire/snowflake/dist/cjs/index.cjs +194 -0
- package/.output/server/node_modules/@sapphire/snowflake/package.json +72 -0
- package/.output/server/node_modules/@vladfrangu/async_event_emitter/dist/index.cjs +2825 -0
- package/.output/server/node_modules/@vladfrangu/async_event_emitter/package.json +112 -0
- package/.output/server/node_modules/discord-api-types/gateway/v10.js +277 -0
- package/.output/server/node_modules/discord-api-types/globals.js +105 -0
- package/.output/server/node_modules/discord-api-types/package.json +215 -0
- package/.output/server/node_modules/discord-api-types/payloads/common.js +310 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/_chatInput/shared.js +21 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/chatInput.js +18 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/_interactions/_applicationCommands/permissions.js +21 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/_interactions/applicationCommands.js +89 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/_interactions/responses.js +63 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/application.js +138 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/auditLog.js +85 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/autoModeration.js +88 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/channel.js +219 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/gateway.js +103 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/guild.js +403 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/guildScheduledEvent.js +74 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/index.js +37 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/interactions.js +19 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/invite.js +31 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/message.js +379 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/monetization.js +101 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/oauth2.js +148 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/permissions.js +17 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/poll.js +17 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/stageInstance.js +21 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/sticker.js +31 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/teams.js +24 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/user.js +189 -0
- package/.output/server/node_modules/discord-api-types/payloads/v10/webhook.js +73 -0
- package/.output/server/node_modules/discord-api-types/rest/common.js +273 -0
- package/.output/server/node_modules/discord-api-types/rest/v10/channel.js +12 -0
- package/.output/server/node_modules/discord-api-types/rest/v10/index.js +1272 -0
- package/.output/server/node_modules/discord-api-types/rest/v10/monetization.js +12 -0
- package/.output/server/node_modules/discord-api-types/rpc/common.js +240 -0
- package/.output/server/node_modules/discord-api-types/rpc/v10.js +299 -0
- package/.output/server/node_modules/discord-api-types/utils/internals.js +13 -0
- package/.output/server/node_modules/discord-api-types/utils/v10.js +158 -0
- package/.output/server/node_modules/discord-api-types/v10.js +25 -0
- package/.output/server/node_modules/discord.js/package.json +107 -0
- package/.output/server/node_modules/discord.js/src/client/BaseClient.js +120 -0
- package/.output/server/node_modules/discord.js/src/client/Client.js +649 -0
- package/.output/server/node_modules/discord.js/src/client/WebhookClient.js +103 -0
- package/.output/server/node_modules/discord.js/src/client/actions/Action.js +143 -0
- package/.output/server/node_modules/discord.js/src/client/actions/ActionsManager.js +85 -0
- package/.output/server/node_modules/discord.js/src/client/actions/ApplicationCommandPermissionsUpdate.js +34 -0
- package/.output/server/node_modules/discord.js/src/client/actions/AutoModerationActionExecution.js +26 -0
- package/.output/server/node_modules/discord.js/src/client/actions/AutoModerationRuleCreate.js +27 -0
- package/.output/server/node_modules/discord.js/src/client/actions/AutoModerationRuleDelete.js +31 -0
- package/.output/server/node_modules/discord.js/src/client/actions/AutoModerationRuleUpdate.js +29 -0
- package/.output/server/node_modules/discord.js/src/client/actions/ChannelCreate.js +23 -0
- package/.output/server/node_modules/discord.js/src/client/actions/ChannelDelete.js +23 -0
- package/.output/server/node_modules/discord.js/src/client/actions/ChannelUpdate.js +42 -0
- package/.output/server/node_modules/discord.js/src/client/actions/EntitlementCreate.js +23 -0
- package/.output/server/node_modules/discord.js/src/client/actions/EntitlementDelete.js +27 -0
- package/.output/server/node_modules/discord.js/src/client/actions/EntitlementUpdate.js +25 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildAuditLogEntryCreate.js +29 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildBanAdd.js +20 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildBanRemove.js +25 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildChannelsPositionUpdate.js +21 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildDelete.js +44 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildEmojiCreate.js +20 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildEmojiDelete.js +19 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildEmojiUpdate.js +20 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildEmojisUpdate.js +34 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildIntegrationsUpdate.js +19 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildMemberRemove.js +31 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildMemberUpdate.js +44 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildRoleCreate.js +25 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildRoleDelete.js +29 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildRoleUpdate.js +39 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildRolesPositionUpdate.js +21 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildScheduledEventCreate.js +27 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildScheduledEventDelete.js +31 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildScheduledEventUpdate.js +30 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildScheduledEventUserAdd.js +32 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildScheduledEventUserRemove.js +32 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildSoundboardSoundDelete.js +29 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildStickerCreate.js +20 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildStickerDelete.js +19 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildStickerUpdate.js +20 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildStickersUpdate.js +34 -0
- package/.output/server/node_modules/discord.js/src/client/actions/GuildUpdate.js +33 -0
- package/.output/server/node_modules/discord.js/src/client/actions/InteractionCreate.js +105 -0
- package/.output/server/node_modules/discord.js/src/client/actions/InviteCreate.js +27 -0
- package/.output/server/node_modules/discord.js/src/client/actions/InviteDelete.js +29 -0
- package/.output/server/node_modules/discord.js/src/client/actions/MessageCreate.js +41 -0
- package/.output/server/node_modules/discord.js/src/client/actions/MessageDelete.js +32 -0
- package/.output/server/node_modules/discord.js/src/client/actions/MessageDeleteBulk.js +47 -0
- package/.output/server/node_modules/discord.js/src/client/actions/MessagePollVoteAdd.js +40 -0
- package/.output/server/node_modules/discord.js/src/client/actions/MessagePollVoteRemove.js +38 -0
- package/.output/server/node_modules/discord.js/src/client/actions/MessageReactionAdd.js +70 -0
- package/.output/server/node_modules/discord.js/src/client/actions/MessageReactionRemove.js +50 -0
- package/.output/server/node_modules/discord.js/src/client/actions/MessageReactionRemoveAll.js +33 -0
- package/.output/server/node_modules/discord.js/src/client/actions/MessageReactionRemoveEmoji.js +28 -0
- package/.output/server/node_modules/discord.js/src/client/actions/MessageUpdate.js +26 -0
- package/.output/server/node_modules/discord.js/src/client/actions/PresenceUpdate.js +45 -0
- package/.output/server/node_modules/discord.js/src/client/actions/StageInstanceCreate.js +28 -0
- package/.output/server/node_modules/discord.js/src/client/actions/StageInstanceDelete.js +31 -0
- package/.output/server/node_modules/discord.js/src/client/actions/StageInstanceUpdate.js +30 -0
- package/.output/server/node_modules/discord.js/src/client/actions/ThreadCreate.js +24 -0
- package/.output/server/node_modules/discord.js/src/client/actions/ThreadDelete.js +26 -0
- package/.output/server/node_modules/discord.js/src/client/actions/ThreadListSync.js +60 -0
- package/.output/server/node_modules/discord.js/src/client/actions/ThreadMemberUpdate.js +30 -0
- package/.output/server/node_modules/discord.js/src/client/actions/ThreadMembersUpdate.js +47 -0
- package/.output/server/node_modules/discord.js/src/client/actions/TypingStart.js +29 -0
- package/.output/server/node_modules/discord.js/src/client/actions/UserUpdate.js +36 -0
- package/.output/server/node_modules/discord.js/src/client/actions/VoiceStateUpdate.js +43 -0
- package/.output/server/node_modules/discord.js/src/client/actions/WebhooksUpdate.js +37 -0
- package/.output/server/node_modules/discord.js/src/client/voice/ClientVoiceManager.js +44 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/WebSocketManager.js +407 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/WebSocketShard.js +234 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/APPLICATION_COMMAND_PERMISSIONS_UPDATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/AUTO_MODERATION_ACTION_EXECUTION.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/AUTO_MODERATION_RULE_CREATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/AUTO_MODERATION_RULE_DELETE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/AUTO_MODERATION_RULE_UPDATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/CHANNEL_CREATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/CHANNEL_DELETE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/CHANNEL_PINS_UPDATE.js +22 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/CHANNEL_UPDATE.js +16 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/ENTITLEMENT_CREATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/ENTITLEMENT_DELETE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/ENTITLEMENT_UPDATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_AUDIT_LOG_ENTRY_CREATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_BAN_ADD.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_BAN_REMOVE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_CREATE.js +33 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_DELETE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_EMOJIS_UPDATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_INTEGRATIONS_UPDATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_MEMBERS_CHUNK.js +39 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_MEMBER_ADD.js +20 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_MEMBER_REMOVE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_MEMBER_UPDATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_ROLE_CREATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_ROLE_DELETE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_ROLE_UPDATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_CREATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_DELETE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_UPDATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_USER_ADD.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_USER_REMOVE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_SOUNDBOARD_SOUNDS_UPDATE.js +24 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_SOUNDBOARD_SOUND_CREATE.js +18 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_SOUNDBOARD_SOUND_DELETE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_SOUNDBOARD_SOUND_UPDATE.js +20 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_STICKERS_UPDATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/GUILD_UPDATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/INTERACTION_CREATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/INVITE_CREATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/INVITE_DELETE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_DELETE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_DELETE_BULK.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_POLL_VOTE_ADD.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_POLL_VOTE_REMOVE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_REACTION_ADD.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_REACTION_REMOVE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_REACTION_REMOVE_ALL.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_REACTION_REMOVE_EMOJI.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_UPDATE.js +16 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/PRESENCE_UPDATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/RATE_LIMITED.js +25 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/READY.js +27 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/RESUMED.js +14 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/SOUNDBOARD_SOUNDS.js +24 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/STAGE_INSTANCE_CREATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/STAGE_INSTANCE_DELETE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/STAGE_INSTANCE_UPDATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/SUBSCRIPTION_CREATE.js +14 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/SUBSCRIPTION_DELETE.js +16 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/SUBSCRIPTION_UPDATE.js +16 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/THREAD_CREATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/THREAD_DELETE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/THREAD_LIST_SYNC.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/THREAD_MEMBERS_UPDATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/THREAD_MEMBER_UPDATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/THREAD_UPDATE.js +16 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/TYPING_START.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/USER_UPDATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/VOICE_CHANNEL_EFFECT_SEND.js +16 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/VOICE_SERVER_UPDATE.js +6 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/VOICE_STATE_UPDATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/WEBHOOKS_UPDATE.js +5 -0
- package/.output/server/node_modules/discord.js/src/client/websocket/handlers/index.js +79 -0
- package/.output/server/node_modules/discord.js/src/errors/DJSError.js +48 -0
- package/.output/server/node_modules/discord.js/src/errors/ErrorCodes.js +356 -0
- package/.output/server/node_modules/discord.js/src/errors/Messages.js +187 -0
- package/.output/server/node_modules/discord.js/src/errors/index.js +5 -0
- package/.output/server/node_modules/discord.js/src/index.js +254 -0
- package/.output/server/node_modules/discord.js/src/managers/ApplicationCommandManager.js +269 -0
- package/.output/server/node_modules/discord.js/src/managers/ApplicationCommandPermissionsManager.js +428 -0
- package/.output/server/node_modules/discord.js/src/managers/ApplicationEmojiManager.js +142 -0
- package/.output/server/node_modules/discord.js/src/managers/AutoModerationRuleManager.js +292 -0
- package/.output/server/node_modules/discord.js/src/managers/BaseGuildEmojiManager.js +85 -0
- package/.output/server/node_modules/discord.js/src/managers/BaseManager.js +19 -0
- package/.output/server/node_modules/discord.js/src/managers/CachedManager.js +64 -0
- package/.output/server/node_modules/discord.js/src/managers/CategoryChannelChildManager.js +79 -0
- package/.output/server/node_modules/discord.js/src/managers/ChannelManager.js +135 -0
- package/.output/server/node_modules/discord.js/src/managers/DMMessageManager.js +17 -0
- package/.output/server/node_modules/discord.js/src/managers/DataManager.js +61 -0
- package/.output/server/node_modules/discord.js/src/managers/EntitlementManager.js +174 -0
- package/.output/server/node_modules/discord.js/src/managers/GuildApplicationCommandManager.js +28 -0
- package/.output/server/node_modules/discord.js/src/managers/GuildBanManager.js +249 -0
- package/.output/server/node_modules/discord.js/src/managers/GuildChannelManager.js +519 -0
- package/.output/server/node_modules/discord.js/src/managers/GuildEmojiManager.js +174 -0
- package/.output/server/node_modules/discord.js/src/managers/GuildEmojiRoleManager.js +126 -0
- package/.output/server/node_modules/discord.js/src/managers/GuildForumThreadManager.js +83 -0
- package/.output/server/node_modules/discord.js/src/managers/GuildInviteManager.js +215 -0
- package/.output/server/node_modules/discord.js/src/managers/GuildManager.js +408 -0
- package/.output/server/node_modules/discord.js/src/managers/GuildMemberManager.js +638 -0
- package/.output/server/node_modules/discord.js/src/managers/GuildMemberRoleManager.js +217 -0
- package/.output/server/node_modules/discord.js/src/managers/GuildMessageManager.js +17 -0
- package/.output/server/node_modules/discord.js/src/managers/GuildScheduledEventManager.js +315 -0
- package/.output/server/node_modules/discord.js/src/managers/GuildSoundboardSoundManager.js +214 -0
- package/.output/server/node_modules/discord.js/src/managers/GuildStickerManager.js +182 -0
- package/.output/server/node_modules/discord.js/src/managers/GuildTextThreadManager.js +91 -0
- package/.output/server/node_modules/discord.js/src/managers/MessageManager.js +368 -0
- package/.output/server/node_modules/discord.js/src/managers/PartialGroupDMMessageManager.js +17 -0
- package/.output/server/node_modules/discord.js/src/managers/PermissionOverwriteManager.js +166 -0
- package/.output/server/node_modules/discord.js/src/managers/PollAnswerVoterManager.js +50 -0
- package/.output/server/node_modules/discord.js/src/managers/PresenceManager.js +58 -0
- package/.output/server/node_modules/discord.js/src/managers/ReactionManager.js +68 -0
- package/.output/server/node_modules/discord.js/src/managers/ReactionUserManager.js +78 -0
- package/.output/server/node_modules/discord.js/src/managers/RoleManager.js +444 -0
- package/.output/server/node_modules/discord.js/src/managers/StageInstanceManager.js +159 -0
- package/.output/server/node_modules/discord.js/src/managers/SubscriptionManager.js +81 -0
- package/.output/server/node_modules/discord.js/src/managers/ThreadManager.js +193 -0
- package/.output/server/node_modules/discord.js/src/managers/ThreadMemberManager.js +204 -0
- package/.output/server/node_modules/discord.js/src/managers/UserManager.js +146 -0
- package/.output/server/node_modules/discord.js/src/managers/VoiceStateManager.js +59 -0
- package/.output/server/node_modules/discord.js/src/sharding/Shard.js +482 -0
- package/.output/server/node_modules/discord.js/src/sharding/ShardClientUtil.js +292 -0
- package/.output/server/node_modules/discord.js/src/sharding/ShardingManager.js +331 -0
- package/.output/server/node_modules/discord.js/src/structures/ActionRow.js +46 -0
- package/.output/server/node_modules/discord.js/src/structures/ActionRowBuilder.js +35 -0
- package/.output/server/node_modules/discord.js/src/structures/AnonymousGuild.js +97 -0
- package/.output/server/node_modules/discord.js/src/structures/ApplicationCommand.js +639 -0
- package/.output/server/node_modules/discord.js/src/structures/ApplicationEmoji.js +169 -0
- package/.output/server/node_modules/discord.js/src/structures/ApplicationRoleConnectionMetadata.js +46 -0
- package/.output/server/node_modules/discord.js/src/structures/Attachment.js +163 -0
- package/.output/server/node_modules/discord.js/src/structures/AttachmentBuilder.js +111 -0
- package/.output/server/node_modules/discord.js/src/structures/AutoModerationActionExecution.js +116 -0
- package/.output/server/node_modules/discord.js/src/structures/AutoModerationRule.js +288 -0
- package/.output/server/node_modules/discord.js/src/structures/AutocompleteInteraction.js +102 -0
- package/.output/server/node_modules/discord.js/src/structures/Base.js +43 -0
- package/.output/server/node_modules/discord.js/src/structures/BaseChannel.js +171 -0
- package/.output/server/node_modules/discord.js/src/structures/BaseGuild.js +119 -0
- package/.output/server/node_modules/discord.js/src/structures/BaseGuildEmoji.js +111 -0
- package/.output/server/node_modules/discord.js/src/structures/BaseGuildTextChannel.js +196 -0
- package/.output/server/node_modules/discord.js/src/structures/BaseGuildVoiceChannel.js +234 -0
- package/.output/server/node_modules/discord.js/src/structures/BaseInteraction.js +349 -0
- package/.output/server/node_modules/discord.js/src/structures/BaseSelectMenuComponent.js +56 -0
- package/.output/server/node_modules/discord.js/src/structures/ButtonBuilder.js +44 -0
- package/.output/server/node_modules/discord.js/src/structures/ButtonComponent.js +65 -0
- package/.output/server/node_modules/discord.js/src/structures/ButtonInteraction.js +11 -0
- package/.output/server/node_modules/discord.js/src/structures/CategoryChannel.js +45 -0
- package/.output/server/node_modules/discord.js/src/structures/ChannelSelectMenuBuilder.js +31 -0
- package/.output/server/node_modules/discord.js/src/structures/ChannelSelectMenuComponent.js +20 -0
- package/.output/server/node_modules/discord.js/src/structures/ChannelSelectMenuInteraction.js +33 -0
- package/.output/server/node_modules/discord.js/src/structures/ChatInputCommandInteraction.js +42 -0
- package/.output/server/node_modules/discord.js/src/structures/ClientApplication.js +415 -0
- package/.output/server/node_modules/discord.js/src/structures/ClientPresence.js +84 -0
- package/.output/server/node_modules/discord.js/src/structures/ClientUser.js +204 -0
- package/.output/server/node_modules/discord.js/src/structures/CommandInteraction.js +168 -0
- package/.output/server/node_modules/discord.js/src/structures/CommandInteractionOptionResolver.js +308 -0
- package/.output/server/node_modules/discord.js/src/structures/Component.js +56 -0
- package/.output/server/node_modules/discord.js/src/structures/ContainerComponent.js +60 -0
- package/.output/server/node_modules/discord.js/src/structures/ContextMenuCommandInteraction.js +65 -0
- package/.output/server/node_modules/discord.js/src/structures/DMChannel.js +129 -0
- package/.output/server/node_modules/discord.js/src/structures/DirectoryChannel.js +36 -0
- package/.output/server/node_modules/discord.js/src/structures/Embed.js +237 -0
- package/.output/server/node_modules/discord.js/src/structures/EmbedBuilder.js +50 -0
- package/.output/server/node_modules/discord.js/src/structures/Emoji.js +115 -0
- package/.output/server/node_modules/discord.js/src/structures/Entitlement.js +179 -0
- package/.output/server/node_modules/discord.js/src/structures/FileComponent.js +40 -0
- package/.output/server/node_modules/discord.js/src/structures/ForumChannel.js +31 -0
- package/.output/server/node_modules/discord.js/src/structures/Guild.js +1496 -0
- package/.output/server/node_modules/discord.js/src/structures/GuildAuditLogs.js +91 -0
- package/.output/server/node_modules/discord.js/src/structures/GuildAuditLogsEntry.js +527 -0
- package/.output/server/node_modules/discord.js/src/structures/GuildBan.js +59 -0
- package/.output/server/node_modules/discord.js/src/structures/GuildChannel.js +476 -0
- package/.output/server/node_modules/discord.js/src/structures/GuildEmoji.js +148 -0
- package/.output/server/node_modules/discord.js/src/structures/GuildMember.js +591 -0
- package/.output/server/node_modules/discord.js/src/structures/GuildOnboarding.js +64 -0
- package/.output/server/node_modules/discord.js/src/structures/GuildOnboardingPrompt.js +78 -0
- package/.output/server/node_modules/discord.js/src/structures/GuildOnboardingPromptOption.js +86 -0
- package/.output/server/node_modules/discord.js/src/structures/GuildPreview.js +193 -0
- package/.output/server/node_modules/discord.js/src/structures/GuildPreviewEmoji.js +27 -0
- package/.output/server/node_modules/discord.js/src/structures/GuildScheduledEvent.js +534 -0
- package/.output/server/node_modules/discord.js/src/structures/GuildTemplate.js +242 -0
- package/.output/server/node_modules/discord.js/src/structures/Integration.js +220 -0
- package/.output/server/node_modules/discord.js/src/structures/IntegrationApplication.js +85 -0
- package/.output/server/node_modules/discord.js/src/structures/InteractionCallback.js +74 -0
- package/.output/server/node_modules/discord.js/src/structures/InteractionCallbackResource.js +52 -0
- package/.output/server/node_modules/discord.js/src/structures/InteractionCallbackResponse.js +33 -0
- package/.output/server/node_modules/discord.js/src/structures/InteractionCollector.js +269 -0
- package/.output/server/node_modules/discord.js/src/structures/InteractionResponse.js +102 -0
- package/.output/server/node_modules/discord.js/src/structures/InteractionWebhook.js +59 -0
- package/.output/server/node_modules/discord.js/src/structures/Invite.js +341 -0
- package/.output/server/node_modules/discord.js/src/structures/InviteGuild.js +22 -0
- package/.output/server/node_modules/discord.js/src/structures/InviteStageInstance.js +87 -0
- package/.output/server/node_modules/discord.js/src/structures/LabelComponent.js +54 -0
- package/.output/server/node_modules/discord.js/src/structures/MediaChannel.js +11 -0
- package/.output/server/node_modules/discord.js/src/structures/MediaGalleryComponent.js +31 -0
- package/.output/server/node_modules/discord.js/src/structures/MediaGalleryItem.js +51 -0
- package/.output/server/node_modules/discord.js/src/structures/MentionableSelectMenuBuilder.js +32 -0
- package/.output/server/node_modules/discord.js/src/structures/MentionableSelectMenuComponent.js +11 -0
- package/.output/server/node_modules/discord.js/src/structures/MentionableSelectMenuInteraction.js +71 -0
- package/.output/server/node_modules/discord.js/src/structures/Message.js +1137 -0
- package/.output/server/node_modules/discord.js/src/structures/MessageCollector.js +146 -0
- package/.output/server/node_modules/discord.js/src/structures/MessageComponentInteraction.js +108 -0
- package/.output/server/node_modules/discord.js/src/structures/MessageContextMenuCommandInteraction.js +20 -0
- package/.output/server/node_modules/discord.js/src/structures/MessageMentions.js +297 -0
- package/.output/server/node_modules/discord.js/src/structures/MessagePayload.js +344 -0
- package/.output/server/node_modules/discord.js/src/structures/MessageReaction.js +200 -0
- package/.output/server/node_modules/discord.js/src/structures/ModalBuilder.js +36 -0
- package/.output/server/node_modules/discord.js/src/structures/ModalSubmitFields.js +232 -0
- package/.output/server/node_modules/discord.js/src/structures/ModalSubmitInteraction.js +256 -0
- package/.output/server/node_modules/discord.js/src/structures/NewsChannel.js +32 -0
- package/.output/server/node_modules/discord.js/src/structures/OAuth2Guild.js +28 -0
- package/.output/server/node_modules/discord.js/src/structures/PartialGroupDMChannel.js +131 -0
- package/.output/server/node_modules/discord.js/src/structures/PermissionOverwrites.js +199 -0
- package/.output/server/node_modules/discord.js/src/structures/Poll.js +175 -0
- package/.output/server/node_modules/discord.js/src/structures/PollAnswer.js +114 -0
- package/.output/server/node_modules/discord.js/src/structures/Presence.js +385 -0
- package/.output/server/node_modules/discord.js/src/structures/PrimaryEntryPointCommandInteraction.js +11 -0
- package/.output/server/node_modules/discord.js/src/structures/ReactionCollector.js +229 -0
- package/.output/server/node_modules/discord.js/src/structures/ReactionEmoji.js +31 -0
- package/.output/server/node_modules/discord.js/src/structures/Role.js +519 -0
- package/.output/server/node_modules/discord.js/src/structures/RoleSelectMenuBuilder.js +31 -0
- package/.output/server/node_modules/discord.js/src/structures/RoleSelectMenuComponent.js +11 -0
- package/.output/server/node_modules/discord.js/src/structures/RoleSelectMenuInteraction.js +33 -0
- package/.output/server/node_modules/discord.js/src/structures/SKU.js +52 -0
- package/.output/server/node_modules/discord.js/src/structures/SectionComponent.js +42 -0
- package/.output/server/node_modules/discord.js/src/structures/SelectMenuBuilder.js +26 -0
- package/.output/server/node_modules/discord.js/src/structures/SelectMenuComponent.js +26 -0
- package/.output/server/node_modules/discord.js/src/structures/SelectMenuInteraction.js +26 -0
- package/.output/server/node_modules/discord.js/src/structures/SelectMenuOptionBuilder.js +26 -0
- package/.output/server/node_modules/discord.js/src/structures/SeparatorComponent.js +30 -0
- package/.output/server/node_modules/discord.js/src/structures/SoundboardSound.js +204 -0
- package/.output/server/node_modules/discord.js/src/structures/StageChannel.js +112 -0
- package/.output/server/node_modules/discord.js/src/structures/StageInstance.js +167 -0
- package/.output/server/node_modules/discord.js/src/structures/Sticker.js +268 -0
- package/.output/server/node_modules/discord.js/src/structures/StickerPack.js +95 -0
- package/.output/server/node_modules/discord.js/src/structures/StringSelectMenuBuilder.js +79 -0
- package/.output/server/node_modules/discord.js/src/structures/StringSelectMenuComponent.js +20 -0
- package/.output/server/node_modules/discord.js/src/structures/StringSelectMenuInteraction.js +21 -0
- package/.output/server/node_modules/discord.js/src/structures/StringSelectMenuOptionBuilder.js +49 -0
- package/.output/server/node_modules/discord.js/src/structures/Subscription.js +117 -0
- package/.output/server/node_modules/discord.js/src/structures/Team.js +117 -0
- package/.output/server/node_modules/discord.js/src/structures/TeamMember.js +79 -0
- package/.output/server/node_modules/discord.js/src/structures/TextChannel.js +33 -0
- package/.output/server/node_modules/discord.js/src/structures/TextDisplayComponent.js +20 -0
- package/.output/server/node_modules/discord.js/src/structures/TextInputBuilder.js +31 -0
- package/.output/server/node_modules/discord.js/src/structures/TextInputComponent.js +29 -0
- package/.output/server/node_modules/discord.js/src/structures/ThreadChannel.js +612 -0
- package/.output/server/node_modules/discord.js/src/structures/ThreadMember.js +119 -0
- package/.output/server/node_modules/discord.js/src/structures/ThreadOnlyChannel.js +249 -0
- package/.output/server/node_modules/discord.js/src/structures/ThumbnailComponent.js +49 -0
- package/.output/server/node_modules/discord.js/src/structures/Typing.js +74 -0
- package/.output/server/node_modules/discord.js/src/structures/UnfurledMediaItem.js +33 -0
- package/.output/server/node_modules/discord.js/src/structures/User.js +505 -0
- package/.output/server/node_modules/discord.js/src/structures/UserContextMenuCommandInteraction.js +29 -0
- package/.output/server/node_modules/discord.js/src/structures/UserSelectMenuBuilder.js +31 -0
- package/.output/server/node_modules/discord.js/src/structures/UserSelectMenuComponent.js +11 -0
- package/.output/server/node_modules/discord.js/src/structures/UserSelectMenuInteraction.js +51 -0
- package/.output/server/node_modules/discord.js/src/structures/VoiceChannel.js +116 -0
- package/.output/server/node_modules/discord.js/src/structures/VoiceChannelEffect.js +78 -0
- package/.output/server/node_modules/discord.js/src/structures/VoiceRegion.js +46 -0
- package/.output/server/node_modules/discord.js/src/structures/VoiceState.js +312 -0
- package/.output/server/node_modules/discord.js/src/structures/Webhook.js +489 -0
- package/.output/server/node_modules/discord.js/src/structures/WelcomeChannel.js +60 -0
- package/.output/server/node_modules/discord.js/src/structures/WelcomeScreen.js +49 -0
- package/.output/server/node_modules/discord.js/src/structures/Widget.js +97 -0
- package/.output/server/node_modules/discord.js/src/structures/WidgetMember.js +99 -0
- package/.output/server/node_modules/discord.js/src/structures/interfaces/Application.js +158 -0
- package/.output/server/node_modules/discord.js/src/structures/interfaces/Collector.js +335 -0
- package/.output/server/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js +494 -0
- package/.output/server/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js +447 -0
- package/.output/server/node_modules/discord.js/src/util/ActivityFlagsBitField.js +26 -0
- package/.output/server/node_modules/discord.js/src/util/ApplicationFlagsBitField.js +41 -0
- package/.output/server/node_modules/discord.js/src/util/AttachmentFlagsBitField.js +26 -0
- package/.output/server/node_modules/discord.js/src/util/BitField.js +178 -0
- package/.output/server/node_modules/discord.js/src/util/ChannelFlagsBitField.js +41 -0
- package/.output/server/node_modules/discord.js/src/util/Channels.js +161 -0
- package/.output/server/node_modules/discord.js/src/util/Colors.js +73 -0
- package/.output/server/node_modules/discord.js/src/util/Components.js +311 -0
- package/.output/server/node_modules/discord.js/src/util/Constants.js +283 -0
- package/.output/server/node_modules/discord.js/src/util/DataResolver.js +142 -0
- package/.output/server/node_modules/discord.js/src/util/Enums.js +13 -0
- package/.output/server/node_modules/discord.js/src/util/Events.js +190 -0
- package/.output/server/node_modules/discord.js/src/util/Formatters.js +413 -0
- package/.output/server/node_modules/discord.js/src/util/GuildMemberFlagsBitField.js +42 -0
- package/.output/server/node_modules/discord.js/src/util/IntentsBitField.js +34 -0
- package/.output/server/node_modules/discord.js/src/util/InviteFlagsBitField.js +28 -0
- package/.output/server/node_modules/discord.js/src/util/LimitedCollection.js +68 -0
- package/.output/server/node_modules/discord.js/src/util/MessageFlagsBitField.js +41 -0
- package/.output/server/node_modules/discord.js/src/util/Options.js +239 -0
- package/.output/server/node_modules/discord.js/src/util/Partials.js +50 -0
- package/.output/server/node_modules/discord.js/src/util/PermissionsBitField.js +104 -0
- package/.output/server/node_modules/discord.js/src/util/RoleFlagsBitField.js +26 -0
- package/.output/server/node_modules/discord.js/src/util/SKUFlagsBitField.js +26 -0
- package/.output/server/node_modules/discord.js/src/util/ShardEvents.js +29 -0
- package/.output/server/node_modules/discord.js/src/util/Status.js +33 -0
- package/.output/server/node_modules/discord.js/src/util/Sweepers.js +487 -0
- package/.output/server/node_modules/discord.js/src/util/Symbols.js +3 -0
- package/.output/server/node_modules/discord.js/src/util/SystemChannelFlagsBitField.js +43 -0
- package/.output/server/node_modules/discord.js/src/util/ThreadMemberFlagsBitField.js +32 -0
- package/.output/server/node_modules/discord.js/src/util/Transformers.js +125 -0
- package/.output/server/node_modules/discord.js/src/util/UserFlagsBitField.js +32 -0
- package/.output/server/node_modules/discord.js/src/util/Util.js +558 -0
- package/.output/server/node_modules/discord.js/src/util/WebSocketShardEvents.js +25 -0
- package/.output/server/node_modules/fast-deep-equal/es6/index.js +72 -0
- package/.output/server/node_modules/fast-deep-equal/index.js +46 -0
- package/.output/server/node_modules/fast-deep-equal/package.json +61 -0
- package/.output/server/node_modules/lodash/_Hash.js +32 -0
- package/.output/server/node_modules/lodash/_ListCache.js +32 -0
- package/.output/server/node_modules/lodash/_Map.js +7 -0
- package/.output/server/node_modules/lodash/_MapCache.js +32 -0
- package/.output/server/node_modules/lodash/_Set.js +7 -0
- package/.output/server/node_modules/lodash/_SetCache.js +27 -0
- package/.output/server/node_modules/lodash/_Symbol.js +6 -0
- package/.output/server/node_modules/lodash/_arrayIncludes.js +17 -0
- package/.output/server/node_modules/lodash/_arrayIncludesWith.js +22 -0
- package/.output/server/node_modules/lodash/_arrayMap.js +21 -0
- package/.output/server/node_modules/lodash/_assocIndexOf.js +21 -0
- package/.output/server/node_modules/lodash/_baseFindIndex.js +24 -0
- package/.output/server/node_modules/lodash/_baseGet.js +24 -0
- package/.output/server/node_modules/lodash/_baseGetTag.js +28 -0
- package/.output/server/node_modules/lodash/_baseIndexOf.js +20 -0
- package/.output/server/node_modules/lodash/_baseIsNaN.js +12 -0
- package/.output/server/node_modules/lodash/_baseIsNative.js +47 -0
- package/.output/server/node_modules/lodash/_baseToString.js +37 -0
- package/.output/server/node_modules/lodash/_baseUniq.js +72 -0
- package/.output/server/node_modules/lodash/_cacheHas.js +13 -0
- package/.output/server/node_modules/lodash/_castPath.js +21 -0
- package/.output/server/node_modules/lodash/_coreJsData.js +6 -0
- package/.output/server/node_modules/lodash/_createSet.js +19 -0
- package/.output/server/node_modules/lodash/_freeGlobal.js +4 -0
- package/.output/server/node_modules/lodash/_getMapData.js +18 -0
- package/.output/server/node_modules/lodash/_getNative.js +17 -0
- package/.output/server/node_modules/lodash/_getRawTag.js +46 -0
- package/.output/server/node_modules/lodash/_getValue.js +13 -0
- package/.output/server/node_modules/lodash/_hashClear.js +15 -0
- package/.output/server/node_modules/lodash/_hashDelete.js +17 -0
- package/.output/server/node_modules/lodash/_hashGet.js +30 -0
- package/.output/server/node_modules/lodash/_hashHas.js +23 -0
- package/.output/server/node_modules/lodash/_hashSet.js +23 -0
- package/.output/server/node_modules/lodash/_isKey.js +29 -0
- package/.output/server/node_modules/lodash/_isKeyable.js +15 -0
- package/.output/server/node_modules/lodash/_isMasked.js +20 -0
- package/.output/server/node_modules/lodash/_listCacheClear.js +13 -0
- package/.output/server/node_modules/lodash/_listCacheDelete.js +35 -0
- package/.output/server/node_modules/lodash/_listCacheGet.js +19 -0
- package/.output/server/node_modules/lodash/_listCacheHas.js +16 -0
- package/.output/server/node_modules/lodash/_listCacheSet.js +26 -0
- package/.output/server/node_modules/lodash/_mapCacheClear.js +21 -0
- package/.output/server/node_modules/lodash/_mapCacheDelete.js +18 -0
- package/.output/server/node_modules/lodash/_mapCacheGet.js +16 -0
- package/.output/server/node_modules/lodash/_mapCacheHas.js +16 -0
- package/.output/server/node_modules/lodash/_mapCacheSet.js +22 -0
- package/.output/server/node_modules/lodash/_memoizeCapped.js +26 -0
- package/.output/server/node_modules/lodash/_nativeCreate.js +6 -0
- package/.output/server/node_modules/lodash/_objectToString.js +22 -0
- package/.output/server/node_modules/lodash/_root.js +9 -0
- package/.output/server/node_modules/lodash/_setCacheAdd.js +19 -0
- package/.output/server/node_modules/lodash/_setCacheHas.js +14 -0
- package/.output/server/node_modules/lodash/_setToArray.js +18 -0
- package/.output/server/node_modules/lodash/_strictIndexOf.js +23 -0
- package/.output/server/node_modules/lodash/_stringToPath.js +27 -0
- package/.output/server/node_modules/lodash/_toKey.js +21 -0
- package/.output/server/node_modules/lodash/_toSource.js +26 -0
- package/.output/server/node_modules/lodash/eq.js +37 -0
- package/.output/server/node_modules/lodash/get.js +33 -0
- package/.output/server/node_modules/lodash/isArray.js +26 -0
- package/.output/server/node_modules/lodash/isFunction.js +37 -0
- package/.output/server/node_modules/lodash/isObject.js +31 -0
- package/.output/server/node_modules/lodash/isObjectLike.js +29 -0
- package/.output/server/node_modules/lodash/isSymbol.js +29 -0
- package/.output/server/node_modules/lodash/memoize.js +73 -0
- package/.output/server/node_modules/lodash/noop.js +17 -0
- package/.output/server/node_modules/lodash/package.json +19 -0
- package/.output/server/node_modules/lodash/toString.js +28 -0
- package/.output/server/node_modules/lodash/uniqWith.js +28 -0
- package/.output/server/node_modules/lodash.snakecase/index.js +435 -0
- package/.output/server/node_modules/lodash.snakecase/package.json +19 -0
- package/.output/server/node_modules/magic-bytes.js/dist/index.js +61 -0
- package/.output/server/node_modules/magic-bytes.js/dist/model/pattern-tree.js +1176 -0
- package/.output/server/node_modules/magic-bytes.js/dist/model/toHex.js +8 -0
- package/.output/server/node_modules/magic-bytes.js/dist/model/tree.js +61 -0
- package/.output/server/node_modules/magic-bytes.js/package.json +77 -0
- package/.output/server/node_modules/ts-mixer/dist/cjs/decorator.js +109 -0
- package/.output/server/node_modules/ts-mixer/dist/cjs/index.js +12 -0
- package/.output/server/node_modules/ts-mixer/dist/cjs/mixin-tracking.js +42 -0
- package/.output/server/node_modules/ts-mixer/dist/cjs/mixins.js +82 -0
- package/.output/server/node_modules/ts-mixer/dist/cjs/proxy.js +82 -0
- package/.output/server/node_modules/ts-mixer/dist/cjs/settings.js +9 -0
- package/.output/server/node_modules/ts-mixer/dist/cjs/util.js +85 -0
- package/.output/server/node_modules/ts-mixer/package.json +63 -0
- package/.output/server/node_modules/tslib/package.json +47 -0
- package/.output/server/node_modules/tslib/tslib.js +484 -0
- package/.output/server/node_modules/undici/index.js +169 -0
- package/.output/server/node_modules/undici/lib/api/abort-signal.js +57 -0
- package/.output/server/node_modules/undici/lib/api/api-connect.js +108 -0
- package/.output/server/node_modules/undici/lib/api/api-pipeline.js +251 -0
- package/.output/server/node_modules/undici/lib/api/api-request.js +214 -0
- package/.output/server/node_modules/undici/lib/api/api-stream.js +220 -0
- package/.output/server/node_modules/undici/lib/api/api-upgrade.js +108 -0
- package/.output/server/node_modules/undici/lib/api/index.js +7 -0
- package/.output/server/node_modules/undici/lib/api/readable.js +385 -0
- package/.output/server/node_modules/undici/lib/api/util.js +93 -0
- package/.output/server/node_modules/undici/lib/core/connect.js +240 -0
- package/.output/server/node_modules/undici/lib/core/constants.js +118 -0
- package/.output/server/node_modules/undici/lib/core/diagnostics.js +202 -0
- package/.output/server/node_modules/undici/lib/core/errors.js +244 -0
- package/.output/server/node_modules/undici/lib/core/request.js +395 -0
- package/.output/server/node_modules/undici/lib/core/symbols.js +67 -0
- package/.output/server/node_modules/undici/lib/core/tree.js +152 -0
- package/.output/server/node_modules/undici/lib/core/util.js +719 -0
- package/.output/server/node_modules/undici/lib/dispatcher/agent.js +129 -0
- package/.output/server/node_modules/undici/lib/dispatcher/balanced-pool.js +209 -0
- package/.output/server/node_modules/undici/lib/dispatcher/client-h1.js +1370 -0
- package/.output/server/node_modules/undici/lib/dispatcher/client-h2.js +744 -0
- package/.output/server/node_modules/undici/lib/dispatcher/client.js +622 -0
- package/.output/server/node_modules/undici/lib/dispatcher/dispatcher-base.js +190 -0
- package/.output/server/node_modules/undici/lib/dispatcher/dispatcher.js +65 -0
- package/.output/server/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +160 -0
- package/.output/server/node_modules/undici/lib/dispatcher/fixed-queue.js +117 -0
- package/.output/server/node_modules/undici/lib/dispatcher/pool-base.js +194 -0
- package/.output/server/node_modules/undici/lib/dispatcher/pool-stats.js +34 -0
- package/.output/server/node_modules/undici/lib/dispatcher/pool.js +107 -0
- package/.output/server/node_modules/undici/lib/dispatcher/proxy-agent.js +192 -0
- package/.output/server/node_modules/undici/lib/dispatcher/retry-agent.js +35 -0
- package/.output/server/node_modules/undici/lib/global.js +32 -0
- package/.output/server/node_modules/undici/lib/handler/decorator-handler.js +44 -0
- package/.output/server/node_modules/undici/lib/handler/redirect-handler.js +232 -0
- package/.output/server/node_modules/undici/lib/handler/retry-handler.js +374 -0
- package/.output/server/node_modules/undici/lib/interceptor/dns.js +375 -0
- package/.output/server/node_modules/undici/lib/interceptor/dump.js +123 -0
- package/.output/server/node_modules/undici/lib/interceptor/redirect-interceptor.js +21 -0
- package/.output/server/node_modules/undici/lib/interceptor/redirect.js +24 -0
- package/.output/server/node_modules/undici/lib/interceptor/retry.js +19 -0
- package/.output/server/node_modules/undici/lib/llhttp/constants.js +278 -0
- package/.output/server/node_modules/undici/lib/llhttp/llhttp-wasm.js +5 -0
- package/.output/server/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js +5 -0
- package/.output/server/node_modules/undici/lib/llhttp/utils.js +15 -0
- package/.output/server/node_modules/undici/lib/mock/mock-agent.js +160 -0
- package/.output/server/node_modules/undici/lib/mock/mock-client.js +59 -0
- package/.output/server/node_modules/undici/lib/mock/mock-errors.js +17 -0
- package/.output/server/node_modules/undici/lib/mock/mock-interceptor.js +207 -0
- package/.output/server/node_modules/undici/lib/mock/mock-pool.js +59 -0
- package/.output/server/node_modules/undici/lib/mock/mock-symbols.js +23 -0
- package/.output/server/node_modules/undici/lib/mock/mock-utils.js +367 -0
- package/.output/server/node_modules/undici/lib/mock/pending-interceptors-formatter.js +43 -0
- package/.output/server/node_modules/undici/lib/mock/pluralizer.js +29 -0
- package/.output/server/node_modules/undici/lib/util/timers.js +423 -0
- package/.output/server/node_modules/undici/lib/web/cache/cache.js +859 -0
- package/.output/server/node_modules/undici/lib/web/cache/cachestorage.js +152 -0
- package/.output/server/node_modules/undici/lib/web/cache/symbols.js +5 -0
- package/.output/server/node_modules/undici/lib/web/cache/util.js +45 -0
- package/.output/server/node_modules/undici/lib/web/cookies/constants.js +12 -0
- package/.output/server/node_modules/undici/lib/web/cookies/index.js +184 -0
- package/.output/server/node_modules/undici/lib/web/cookies/parse.js +317 -0
- package/.output/server/node_modules/undici/lib/web/cookies/util.js +282 -0
- package/.output/server/node_modules/undici/lib/web/eventsource/eventsource-stream.js +398 -0
- package/.output/server/node_modules/undici/lib/web/eventsource/eventsource.js +480 -0
- package/.output/server/node_modules/undici/lib/web/eventsource/util.js +37 -0
- package/.output/server/node_modules/undici/lib/web/fetch/body.js +533 -0
- package/.output/server/node_modules/undici/lib/web/fetch/constants.js +124 -0
- package/.output/server/node_modules/undici/lib/web/fetch/data-url.js +744 -0
- package/.output/server/node_modules/undici/lib/web/fetch/dispatcher-weakref.js +46 -0
- package/.output/server/node_modules/undici/lib/web/fetch/file.js +126 -0
- package/.output/server/node_modules/undici/lib/web/fetch/formdata-parser.js +474 -0
- package/.output/server/node_modules/undici/lib/web/fetch/formdata.js +252 -0
- package/.output/server/node_modules/undici/lib/web/fetch/global.js +40 -0
- package/.output/server/node_modules/undici/lib/web/fetch/headers.js +687 -0
- package/.output/server/node_modules/undici/lib/web/fetch/index.js +2266 -0
- package/.output/server/node_modules/undici/lib/web/fetch/request.js +1037 -0
- package/.output/server/node_modules/undici/lib/web/fetch/response.js +605 -0
- package/.output/server/node_modules/undici/lib/web/fetch/symbols.js +9 -0
- package/.output/server/node_modules/undici/lib/web/fetch/util.js +1632 -0
- package/.output/server/node_modules/undici/lib/web/fetch/webidl.js +695 -0
- package/.output/server/node_modules/undici/lib/web/fileapi/encoding.js +290 -0
- package/.output/server/node_modules/undici/lib/web/fileapi/filereader.js +344 -0
- package/.output/server/node_modules/undici/lib/web/fileapi/progressevent.js +78 -0
- package/.output/server/node_modules/undici/lib/web/fileapi/symbols.js +10 -0
- package/.output/server/node_modules/undici/lib/web/fileapi/util.js +391 -0
- package/.output/server/node_modules/undici/lib/web/websocket/connection.js +371 -0
- package/.output/server/node_modules/undici/lib/web/websocket/constants.js +66 -0
- package/.output/server/node_modules/undici/lib/web/websocket/events.js +329 -0
- package/.output/server/node_modules/undici/lib/web/websocket/frame.js +96 -0
- package/.output/server/node_modules/undici/lib/web/websocket/permessage-deflate.js +70 -0
- package/.output/server/node_modules/undici/lib/web/websocket/receiver.js +424 -0
- package/.output/server/node_modules/undici/lib/web/websocket/sender.js +104 -0
- package/.output/server/node_modules/undici/lib/web/websocket/symbols.js +12 -0
- package/.output/server/node_modules/undici/lib/web/websocket/util.js +314 -0
- package/.output/server/node_modules/undici/lib/web/websocket/websocket.js +588 -0
- package/.output/server/node_modules/undici/package.json +160 -0
- package/.output/server/node_modules/ws/index.js +13 -0
- package/.output/server/node_modules/ws/lib/buffer-util.js +131 -0
- package/.output/server/node_modules/ws/lib/constants.js +18 -0
- package/.output/server/node_modules/ws/lib/event-target.js +292 -0
- package/.output/server/node_modules/ws/lib/extension.js +203 -0
- package/.output/server/node_modules/ws/lib/limiter.js +55 -0
- package/.output/server/node_modules/ws/lib/permessage-deflate.js +528 -0
- package/.output/server/node_modules/ws/lib/receiver.js +706 -0
- package/.output/server/node_modules/ws/lib/sender.js +602 -0
- package/.output/server/node_modules/ws/lib/stream.js +161 -0
- package/.output/server/node_modules/ws/lib/subprotocol.js +62 -0
- package/.output/server/node_modules/ws/lib/validation.js +152 -0
- package/.output/server/node_modules/ws/lib/websocket-server.js +550 -0
- package/.output/server/node_modules/ws/lib/websocket.js +1388 -0
- package/.output/server/node_modules/ws/package.json +69 -0
- package/.output/server/package.json +21 -1
- package/Claude/hooks/lib/hook_client.py +38 -0
- package/Claude/hooks/session-start.py +8 -1
- package/Claude/skills/bridge/SKILL.md +125 -0
- package/Claude/skills/bridge/bridge.py +234 -0
- package/README.md +1 -1
- package/app/components/skills/Card.vue +18 -0
- package/app/pages/settings.vue +279 -3
- package/app/pages/skills/index.vue +106 -0
- package/app/pages/skills/library.vue +20 -1
- package/nuxt.config.ts +2 -2
- package/package.json +4 -5
- package/server/api/bridges/[id]/health.get.ts +78 -0
- package/server/api/bridges/[id].delete.ts +41 -0
- package/server/api/bridges/[id].get.ts +25 -0
- package/server/api/bridges/[id].put.ts +54 -0
- package/server/api/bridges/context.get.ts +168 -0
- package/server/api/bridges/index.get.ts +15 -0
- package/server/api/bridges/index.post.ts +39 -0
- package/server/api/skills/[name]/delete.post.ts +38 -0
- package/server/api/skills/index.get.ts +24 -0
- package/server/api/skills/library/install.post.ts +7 -3
- package/server/api/webhooks/bluebubbles.post.ts +23 -0
- package/server/api/webhooks/telegram.post.ts +34 -0
- package/server/bridge/adapters/discord.ts +180 -0
- package/server/bridge/adapters/email.ts +50 -0
- package/server/bridge/adapters/google.ts +215 -0
- package/server/bridge/adapters/imessage.ts +352 -0
- package/server/bridge/adapters/telegram.ts +294 -0
- package/server/bridge/lifecycle.ts +124 -0
- package/server/bridge/registry.ts +50 -0
- package/server/bridge/router.ts +126 -0
- package/server/bridge/types.ts +87 -0
- package/server/db/schema.ts +53 -0
- package/server/drizzle/migrations/0014_worthless_cable.sql +36 -0
- package/server/drizzle/migrations/meta/0014_snapshot.json +1959 -0
- package/server/drizzle/migrations/meta/_journal.json +7 -0
- package/server/plugins/06.message-bridge.ts +42 -0
- package/server/utils/get-secret.ts +18 -0
- package/server/utils/notify-resource.ts +2 -1
- package/shared/types/index.ts +113 -0
- package/shared/utils/notification-defaults.ts +2 -1
- package/.output/public/_nuxt/BMdnU6BF.js +0 -1
- package/.output/public/_nuxt/BSsvedap.js +0 -1
- package/.output/public/_nuxt/C2ANDZen.js +0 -1
- package/.output/public/_nuxt/CC77iplr.js +0 -1
- package/.output/public/_nuxt/DM4MyqI-.js +0 -1
- package/.output/public/_nuxt/DO0oG4fG.js +0 -1
- package/.output/public/_nuxt/DRlG_bnX.js +0 -1
- package/.output/public/_nuxt/YGWAImQo.js +0 -1
- package/.output/public/_nuxt/builds/meta/91727fcc-bf7f-407f-9b1e-092017fcfee0.json +0 -1
- package/.output/server/chunks/build/library-CbWcF5wT.mjs.map +0 -1
- package/.output/server/chunks/build/settings-DdkKCJ00.mjs.map +0 -1
- package/Claude/CLAUDE.md +0 -129
|
@@ -0,0 +1,3210 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var get = require('lodash/get.js');
|
|
4
|
+
var fastDeepEqual = require('fast-deep-equal/es6/index.js');
|
|
5
|
+
var uniqWith = require('lodash/uniqWith.js');
|
|
6
|
+
|
|
7
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
|
+
|
|
9
|
+
var get__default = /*#__PURE__*/_interopDefault(get);
|
|
10
|
+
var fastDeepEqual__default = /*#__PURE__*/_interopDefault(fastDeepEqual);
|
|
11
|
+
var uniqWith__default = /*#__PURE__*/_interopDefault(uniqWith);
|
|
12
|
+
|
|
13
|
+
var __defProp = Object.defineProperty;
|
|
14
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
15
|
+
|
|
16
|
+
// node_modules/@jspm/core/nodelibs/browser/chunk-5decc758.js
|
|
17
|
+
var e;
|
|
18
|
+
var t;
|
|
19
|
+
var n;
|
|
20
|
+
var r = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis;
|
|
21
|
+
var o = e = {};
|
|
22
|
+
function i() {
|
|
23
|
+
throw new Error("setTimeout has not been defined");
|
|
24
|
+
}
|
|
25
|
+
__name(i, "i");
|
|
26
|
+
function u() {
|
|
27
|
+
throw new Error("clearTimeout has not been defined");
|
|
28
|
+
}
|
|
29
|
+
__name(u, "u");
|
|
30
|
+
function c(e3) {
|
|
31
|
+
if (t === setTimeout)
|
|
32
|
+
return setTimeout(e3, 0);
|
|
33
|
+
if ((t === i || !t) && setTimeout)
|
|
34
|
+
return t = setTimeout, setTimeout(e3, 0);
|
|
35
|
+
try {
|
|
36
|
+
return t(e3, 0);
|
|
37
|
+
} catch (n3) {
|
|
38
|
+
try {
|
|
39
|
+
return t.call(null, e3, 0);
|
|
40
|
+
} catch (n4) {
|
|
41
|
+
return t.call(this || r, e3, 0);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
__name(c, "c");
|
|
46
|
+
!function() {
|
|
47
|
+
try {
|
|
48
|
+
t = "function" == typeof setTimeout ? setTimeout : i;
|
|
49
|
+
} catch (e3) {
|
|
50
|
+
t = i;
|
|
51
|
+
}
|
|
52
|
+
try {
|
|
53
|
+
n = "function" == typeof clearTimeout ? clearTimeout : u;
|
|
54
|
+
} catch (e3) {
|
|
55
|
+
n = u;
|
|
56
|
+
}
|
|
57
|
+
}();
|
|
58
|
+
var l;
|
|
59
|
+
var s = [];
|
|
60
|
+
var f = false;
|
|
61
|
+
var a = -1;
|
|
62
|
+
function h() {
|
|
63
|
+
f && l && (f = false, l.length ? s = l.concat(s) : a = -1, s.length && d());
|
|
64
|
+
}
|
|
65
|
+
__name(h, "h");
|
|
66
|
+
function d() {
|
|
67
|
+
if (!f) {
|
|
68
|
+
var e3 = c(h);
|
|
69
|
+
f = true;
|
|
70
|
+
for (var t3 = s.length; t3; ) {
|
|
71
|
+
for (l = s, s = []; ++a < t3; )
|
|
72
|
+
l && l[a].run();
|
|
73
|
+
a = -1, t3 = s.length;
|
|
74
|
+
}
|
|
75
|
+
l = null, f = false, function(e4) {
|
|
76
|
+
if (n === clearTimeout)
|
|
77
|
+
return clearTimeout(e4);
|
|
78
|
+
if ((n === u || !n) && clearTimeout)
|
|
79
|
+
return n = clearTimeout, clearTimeout(e4);
|
|
80
|
+
try {
|
|
81
|
+
n(e4);
|
|
82
|
+
} catch (t4) {
|
|
83
|
+
try {
|
|
84
|
+
return n.call(null, e4);
|
|
85
|
+
} catch (t5) {
|
|
86
|
+
return n.call(this || r, e4);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}(e3);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
__name(d, "d");
|
|
93
|
+
function m(e3, t3) {
|
|
94
|
+
(this || r).fun = e3, (this || r).array = t3;
|
|
95
|
+
}
|
|
96
|
+
__name(m, "m");
|
|
97
|
+
function p() {
|
|
98
|
+
}
|
|
99
|
+
__name(p, "p");
|
|
100
|
+
o.nextTick = function(e3) {
|
|
101
|
+
var t3 = new Array(arguments.length - 1);
|
|
102
|
+
if (arguments.length > 1)
|
|
103
|
+
for (var n3 = 1; n3 < arguments.length; n3++)
|
|
104
|
+
t3[n3 - 1] = arguments[n3];
|
|
105
|
+
s.push(new m(e3, t3)), 1 !== s.length || f || c(d);
|
|
106
|
+
}, m.prototype.run = function() {
|
|
107
|
+
(this || r).fun.apply(null, (this || r).array);
|
|
108
|
+
}, o.title = "browser", o.browser = true, o.env = {}, o.argv = [], o.version = "", o.versions = {}, o.on = p, o.addListener = p, o.once = p, o.off = p, o.removeListener = p, o.removeAllListeners = p, o.emit = p, o.prependListener = p, o.prependOnceListener = p, o.listeners = function(e3) {
|
|
109
|
+
return [];
|
|
110
|
+
}, o.binding = function(e3) {
|
|
111
|
+
throw new Error("process.binding is not supported");
|
|
112
|
+
}, o.cwd = function() {
|
|
113
|
+
return "/";
|
|
114
|
+
}, o.chdir = function(e3) {
|
|
115
|
+
throw new Error("process.chdir is not supported");
|
|
116
|
+
}, o.umask = function() {
|
|
117
|
+
return 0;
|
|
118
|
+
};
|
|
119
|
+
var T = e;
|
|
120
|
+
T.addListener;
|
|
121
|
+
T.argv;
|
|
122
|
+
T.binding;
|
|
123
|
+
T.browser;
|
|
124
|
+
T.chdir;
|
|
125
|
+
T.cwd;
|
|
126
|
+
T.emit;
|
|
127
|
+
T.env;
|
|
128
|
+
T.listeners;
|
|
129
|
+
T.nextTick;
|
|
130
|
+
T.off;
|
|
131
|
+
T.on;
|
|
132
|
+
T.once;
|
|
133
|
+
T.prependListener;
|
|
134
|
+
T.prependOnceListener;
|
|
135
|
+
T.removeAllListeners;
|
|
136
|
+
T.removeListener;
|
|
137
|
+
T.title;
|
|
138
|
+
T.umask;
|
|
139
|
+
T.version;
|
|
140
|
+
T.versions;
|
|
141
|
+
|
|
142
|
+
// node_modules/@jspm/core/nodelibs/browser/chunk-b4205b57.js
|
|
143
|
+
var t2 = "function" == typeof Symbol && "symbol" == typeof Symbol.toStringTag;
|
|
144
|
+
var e2 = Object.prototype.toString;
|
|
145
|
+
var o2 = /* @__PURE__ */ __name(function(o3) {
|
|
146
|
+
return !(t2 && o3 && "object" == typeof o3 && Symbol.toStringTag in o3) && "[object Arguments]" === e2.call(o3);
|
|
147
|
+
}, "o");
|
|
148
|
+
var n2 = /* @__PURE__ */ __name(function(t3) {
|
|
149
|
+
return !!o2(t3) || null !== t3 && "object" == typeof t3 && "number" == typeof t3.length && t3.length >= 0 && "[object Array]" !== e2.call(t3) && "[object Function]" === e2.call(t3.callee);
|
|
150
|
+
}, "n");
|
|
151
|
+
var r2 = function() {
|
|
152
|
+
return o2(arguments);
|
|
153
|
+
}();
|
|
154
|
+
o2.isLegacyArguments = n2;
|
|
155
|
+
var l2 = r2 ? o2 : n2;
|
|
156
|
+
var t$1 = Object.prototype.toString;
|
|
157
|
+
var o$1 = Function.prototype.toString;
|
|
158
|
+
var n$1 = /^\s*(?:function)?\*/;
|
|
159
|
+
var e$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.toStringTag;
|
|
160
|
+
var r$1 = Object.getPrototypeOf;
|
|
161
|
+
var c2 = function() {
|
|
162
|
+
if (!e$1)
|
|
163
|
+
return false;
|
|
164
|
+
try {
|
|
165
|
+
return Function("return function*() {}")();
|
|
166
|
+
} catch (t3) {
|
|
167
|
+
}
|
|
168
|
+
}();
|
|
169
|
+
var u2 = c2 ? r$1(c2) : {};
|
|
170
|
+
var i2 = /* @__PURE__ */ __name(function(c3) {
|
|
171
|
+
return "function" == typeof c3 && (!!n$1.test(o$1.call(c3)) || (e$1 ? r$1(c3) === u2 : "[object GeneratorFunction]" === t$1.call(c3)));
|
|
172
|
+
}, "i");
|
|
173
|
+
var t$2 = "function" == typeof Object.create ? function(t3, e3) {
|
|
174
|
+
e3 && (t3.super_ = e3, t3.prototype = Object.create(e3.prototype, { constructor: { value: t3, enumerable: false, writable: true, configurable: true } }));
|
|
175
|
+
} : function(t3, e3) {
|
|
176
|
+
if (e3) {
|
|
177
|
+
t3.super_ = e3;
|
|
178
|
+
var o3 = /* @__PURE__ */ __name(function() {
|
|
179
|
+
}, "o");
|
|
180
|
+
o3.prototype = e3.prototype, t3.prototype = new o3(), t3.prototype.constructor = t3;
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
var i$1 = /* @__PURE__ */ __name(function(e3) {
|
|
184
|
+
return e3 && "object" == typeof e3 && "function" == typeof e3.copy && "function" == typeof e3.fill && "function" == typeof e3.readUInt8;
|
|
185
|
+
}, "i$1");
|
|
186
|
+
var o$2 = {};
|
|
187
|
+
var u$1 = i$1;
|
|
188
|
+
var f2 = l2;
|
|
189
|
+
var a2 = i2;
|
|
190
|
+
function c$1(e3) {
|
|
191
|
+
return e3.call.bind(e3);
|
|
192
|
+
}
|
|
193
|
+
__name(c$1, "c$1");
|
|
194
|
+
var s2 = "undefined" != typeof BigInt;
|
|
195
|
+
var p2 = "undefined" != typeof Symbol;
|
|
196
|
+
var y = p2 && void 0 !== Symbol.toStringTag;
|
|
197
|
+
var l$1 = "undefined" != typeof Uint8Array;
|
|
198
|
+
var d2 = "undefined" != typeof ArrayBuffer;
|
|
199
|
+
if (l$1 && y)
|
|
200
|
+
var g = Object.getPrototypeOf(Uint8Array.prototype), b = c$1(Object.getOwnPropertyDescriptor(g, Symbol.toStringTag).get);
|
|
201
|
+
var m2 = c$1(Object.prototype.toString);
|
|
202
|
+
var h2 = c$1(Number.prototype.valueOf);
|
|
203
|
+
var j = c$1(String.prototype.valueOf);
|
|
204
|
+
var A = c$1(Boolean.prototype.valueOf);
|
|
205
|
+
if (s2)
|
|
206
|
+
var w = c$1(BigInt.prototype.valueOf);
|
|
207
|
+
if (p2)
|
|
208
|
+
var v = c$1(Symbol.prototype.valueOf);
|
|
209
|
+
function O(e3, t3) {
|
|
210
|
+
if ("object" != typeof e3)
|
|
211
|
+
return false;
|
|
212
|
+
try {
|
|
213
|
+
return t3(e3), true;
|
|
214
|
+
} catch (e4) {
|
|
215
|
+
return false;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
__name(O, "O");
|
|
219
|
+
function S(e3) {
|
|
220
|
+
return l$1 && y ? void 0 !== b(e3) : B(e3) || k(e3) || E(e3) || D(e3) || U(e3) || P(e3) || x(e3) || I(e3) || M(e3) || z(e3) || F(e3);
|
|
221
|
+
}
|
|
222
|
+
__name(S, "S");
|
|
223
|
+
function B(e3) {
|
|
224
|
+
return l$1 && y ? "Uint8Array" === b(e3) : "[object Uint8Array]" === m2(e3) || u$1(e3) && void 0 !== e3.buffer;
|
|
225
|
+
}
|
|
226
|
+
__name(B, "B");
|
|
227
|
+
function k(e3) {
|
|
228
|
+
return l$1 && y ? "Uint8ClampedArray" === b(e3) : "[object Uint8ClampedArray]" === m2(e3);
|
|
229
|
+
}
|
|
230
|
+
__name(k, "k");
|
|
231
|
+
function E(e3) {
|
|
232
|
+
return l$1 && y ? "Uint16Array" === b(e3) : "[object Uint16Array]" === m2(e3);
|
|
233
|
+
}
|
|
234
|
+
__name(E, "E");
|
|
235
|
+
function D(e3) {
|
|
236
|
+
return l$1 && y ? "Uint32Array" === b(e3) : "[object Uint32Array]" === m2(e3);
|
|
237
|
+
}
|
|
238
|
+
__name(D, "D");
|
|
239
|
+
function U(e3) {
|
|
240
|
+
return l$1 && y ? "Int8Array" === b(e3) : "[object Int8Array]" === m2(e3);
|
|
241
|
+
}
|
|
242
|
+
__name(U, "U");
|
|
243
|
+
function P(e3) {
|
|
244
|
+
return l$1 && y ? "Int16Array" === b(e3) : "[object Int16Array]" === m2(e3);
|
|
245
|
+
}
|
|
246
|
+
__name(P, "P");
|
|
247
|
+
function x(e3) {
|
|
248
|
+
return l$1 && y ? "Int32Array" === b(e3) : "[object Int32Array]" === m2(e3);
|
|
249
|
+
}
|
|
250
|
+
__name(x, "x");
|
|
251
|
+
function I(e3) {
|
|
252
|
+
return l$1 && y ? "Float32Array" === b(e3) : "[object Float32Array]" === m2(e3);
|
|
253
|
+
}
|
|
254
|
+
__name(I, "I");
|
|
255
|
+
function M(e3) {
|
|
256
|
+
return l$1 && y ? "Float64Array" === b(e3) : "[object Float64Array]" === m2(e3);
|
|
257
|
+
}
|
|
258
|
+
__name(M, "M");
|
|
259
|
+
function z(e3) {
|
|
260
|
+
return l$1 && y ? "BigInt64Array" === b(e3) : "[object BigInt64Array]" === m2(e3);
|
|
261
|
+
}
|
|
262
|
+
__name(z, "z");
|
|
263
|
+
function F(e3) {
|
|
264
|
+
return l$1 && y ? "BigUint64Array" === b(e3) : "[object BigUint64Array]" === m2(e3);
|
|
265
|
+
}
|
|
266
|
+
__name(F, "F");
|
|
267
|
+
function T2(e3) {
|
|
268
|
+
return "[object Map]" === m2(e3);
|
|
269
|
+
}
|
|
270
|
+
__name(T2, "T");
|
|
271
|
+
function N(e3) {
|
|
272
|
+
return "[object Set]" === m2(e3);
|
|
273
|
+
}
|
|
274
|
+
__name(N, "N");
|
|
275
|
+
function W(e3) {
|
|
276
|
+
return "[object WeakMap]" === m2(e3);
|
|
277
|
+
}
|
|
278
|
+
__name(W, "W");
|
|
279
|
+
function $(e3) {
|
|
280
|
+
return "[object WeakSet]" === m2(e3);
|
|
281
|
+
}
|
|
282
|
+
__name($, "$");
|
|
283
|
+
function C(e3) {
|
|
284
|
+
return "[object ArrayBuffer]" === m2(e3);
|
|
285
|
+
}
|
|
286
|
+
__name(C, "C");
|
|
287
|
+
function V(e3) {
|
|
288
|
+
return "undefined" != typeof ArrayBuffer && (C.working ? C(e3) : e3 instanceof ArrayBuffer);
|
|
289
|
+
}
|
|
290
|
+
__name(V, "V");
|
|
291
|
+
function G(e3) {
|
|
292
|
+
return "[object DataView]" === m2(e3);
|
|
293
|
+
}
|
|
294
|
+
__name(G, "G");
|
|
295
|
+
function R(e3) {
|
|
296
|
+
return "undefined" != typeof DataView && (G.working ? G(e3) : e3 instanceof DataView);
|
|
297
|
+
}
|
|
298
|
+
__name(R, "R");
|
|
299
|
+
function J(e3) {
|
|
300
|
+
return "[object SharedArrayBuffer]" === m2(e3);
|
|
301
|
+
}
|
|
302
|
+
__name(J, "J");
|
|
303
|
+
function _(e3) {
|
|
304
|
+
return "undefined" != typeof SharedArrayBuffer && (J.working ? J(e3) : e3 instanceof SharedArrayBuffer);
|
|
305
|
+
}
|
|
306
|
+
__name(_, "_");
|
|
307
|
+
function H(e3) {
|
|
308
|
+
return O(e3, h2);
|
|
309
|
+
}
|
|
310
|
+
__name(H, "H");
|
|
311
|
+
function Z(e3) {
|
|
312
|
+
return O(e3, j);
|
|
313
|
+
}
|
|
314
|
+
__name(Z, "Z");
|
|
315
|
+
function q(e3) {
|
|
316
|
+
return O(e3, A);
|
|
317
|
+
}
|
|
318
|
+
__name(q, "q");
|
|
319
|
+
function K(e3) {
|
|
320
|
+
return s2 && O(e3, w);
|
|
321
|
+
}
|
|
322
|
+
__name(K, "K");
|
|
323
|
+
function L(e3) {
|
|
324
|
+
return p2 && O(e3, v);
|
|
325
|
+
}
|
|
326
|
+
__name(L, "L");
|
|
327
|
+
o$2.isArgumentsObject = f2, o$2.isGeneratorFunction = a2, o$2.isPromise = function(e3) {
|
|
328
|
+
return "undefined" != typeof Promise && e3 instanceof Promise || null !== e3 && "object" == typeof e3 && "function" == typeof e3.then && "function" == typeof e3.catch;
|
|
329
|
+
}, o$2.isArrayBufferView = function(e3) {
|
|
330
|
+
return d2 && ArrayBuffer.isView ? ArrayBuffer.isView(e3) : S(e3) || R(e3);
|
|
331
|
+
}, o$2.isTypedArray = S, o$2.isUint8Array = B, o$2.isUint8ClampedArray = k, o$2.isUint16Array = E, o$2.isUint32Array = D, o$2.isInt8Array = U, o$2.isInt16Array = P, o$2.isInt32Array = x, o$2.isFloat32Array = I, o$2.isFloat64Array = M, o$2.isBigInt64Array = z, o$2.isBigUint64Array = F, T2.working = "undefined" != typeof Map && T2(/* @__PURE__ */ new Map()), o$2.isMap = function(e3) {
|
|
332
|
+
return "undefined" != typeof Map && (T2.working ? T2(e3) : e3 instanceof Map);
|
|
333
|
+
}, N.working = "undefined" != typeof Set && N(/* @__PURE__ */ new Set()), o$2.isSet = function(e3) {
|
|
334
|
+
return "undefined" != typeof Set && (N.working ? N(e3) : e3 instanceof Set);
|
|
335
|
+
}, W.working = "undefined" != typeof WeakMap && W(/* @__PURE__ */ new WeakMap()), o$2.isWeakMap = function(e3) {
|
|
336
|
+
return "undefined" != typeof WeakMap && (W.working ? W(e3) : e3 instanceof WeakMap);
|
|
337
|
+
}, $.working = "undefined" != typeof WeakSet && $(/* @__PURE__ */ new WeakSet()), o$2.isWeakSet = function(e3) {
|
|
338
|
+
return $(e3);
|
|
339
|
+
}, C.working = "undefined" != typeof ArrayBuffer && C(new ArrayBuffer()), o$2.isArrayBuffer = V, G.working = "undefined" != typeof ArrayBuffer && "undefined" != typeof DataView && G(new DataView(new ArrayBuffer(1), 0, 1)), o$2.isDataView = R, J.working = "undefined" != typeof SharedArrayBuffer && J(new SharedArrayBuffer()), o$2.isSharedArrayBuffer = _, o$2.isAsyncFunction = function(e3) {
|
|
340
|
+
return "[object AsyncFunction]" === m2(e3);
|
|
341
|
+
}, o$2.isMapIterator = function(e3) {
|
|
342
|
+
return "[object Map Iterator]" === m2(e3);
|
|
343
|
+
}, o$2.isSetIterator = function(e3) {
|
|
344
|
+
return "[object Set Iterator]" === m2(e3);
|
|
345
|
+
}, o$2.isGeneratorObject = function(e3) {
|
|
346
|
+
return "[object Generator]" === m2(e3);
|
|
347
|
+
}, o$2.isWebAssemblyCompiledModule = function(e3) {
|
|
348
|
+
return "[object WebAssembly.Module]" === m2(e3);
|
|
349
|
+
}, o$2.isNumberObject = H, o$2.isStringObject = Z, o$2.isBooleanObject = q, o$2.isBigIntObject = K, o$2.isSymbolObject = L, o$2.isBoxedPrimitive = function(e3) {
|
|
350
|
+
return H(e3) || Z(e3) || q(e3) || K(e3) || L(e3);
|
|
351
|
+
}, o$2.isAnyArrayBuffer = function(e3) {
|
|
352
|
+
return l$1 && (V(e3) || _(e3));
|
|
353
|
+
}, ["isProxy", "isExternal", "isModuleNamespaceObject"].forEach(function(e3) {
|
|
354
|
+
Object.defineProperty(o$2, e3, { enumerable: false, value: function() {
|
|
355
|
+
throw new Error(e3 + " is not supported in userland");
|
|
356
|
+
} });
|
|
357
|
+
});
|
|
358
|
+
var Q = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis;
|
|
359
|
+
var X = {};
|
|
360
|
+
var Y = T;
|
|
361
|
+
var ee = Object.getOwnPropertyDescriptors || function(e3) {
|
|
362
|
+
for (var t3 = Object.keys(e3), r3 = {}, n3 = 0; n3 < t3.length; n3++)
|
|
363
|
+
r3[t3[n3]] = Object.getOwnPropertyDescriptor(e3, t3[n3]);
|
|
364
|
+
return r3;
|
|
365
|
+
};
|
|
366
|
+
var te = /%[sdj%]/g;
|
|
367
|
+
X.format = function(e3) {
|
|
368
|
+
if (!ge(e3)) {
|
|
369
|
+
for (var t3 = [], r3 = 0; r3 < arguments.length; r3++)
|
|
370
|
+
t3.push(oe(arguments[r3]));
|
|
371
|
+
return t3.join(" ");
|
|
372
|
+
}
|
|
373
|
+
r3 = 1;
|
|
374
|
+
for (var n3 = arguments, i3 = n3.length, o3 = String(e3).replace(te, function(e4) {
|
|
375
|
+
if ("%%" === e4)
|
|
376
|
+
return "%";
|
|
377
|
+
if (r3 >= i3)
|
|
378
|
+
return e4;
|
|
379
|
+
switch (e4) {
|
|
380
|
+
case "%s":
|
|
381
|
+
return String(n3[r3++]);
|
|
382
|
+
case "%d":
|
|
383
|
+
return Number(n3[r3++]);
|
|
384
|
+
case "%j":
|
|
385
|
+
try {
|
|
386
|
+
return JSON.stringify(n3[r3++]);
|
|
387
|
+
} catch (e5) {
|
|
388
|
+
return "[Circular]";
|
|
389
|
+
}
|
|
390
|
+
default:
|
|
391
|
+
return e4;
|
|
392
|
+
}
|
|
393
|
+
}), u3 = n3[r3]; r3 < i3; u3 = n3[++r3])
|
|
394
|
+
le(u3) || !he(u3) ? o3 += " " + u3 : o3 += " " + oe(u3);
|
|
395
|
+
return o3;
|
|
396
|
+
}, X.deprecate = function(e3, t3) {
|
|
397
|
+
if (void 0 !== Y && true === Y.noDeprecation)
|
|
398
|
+
return e3;
|
|
399
|
+
if (void 0 === Y)
|
|
400
|
+
return function() {
|
|
401
|
+
return X.deprecate(e3, t3).apply(this || Q, arguments);
|
|
402
|
+
};
|
|
403
|
+
var r3 = false;
|
|
404
|
+
return function() {
|
|
405
|
+
if (!r3) {
|
|
406
|
+
if (Y.throwDeprecation)
|
|
407
|
+
throw new Error(t3);
|
|
408
|
+
Y.traceDeprecation ? console.trace(t3) : console.error(t3), r3 = true;
|
|
409
|
+
}
|
|
410
|
+
return e3.apply(this || Q, arguments);
|
|
411
|
+
};
|
|
412
|
+
};
|
|
413
|
+
var re = {};
|
|
414
|
+
var ne = /^$/;
|
|
415
|
+
if (Y.env.NODE_DEBUG) {
|
|
416
|
+
ie = Y.env.NODE_DEBUG;
|
|
417
|
+
ie = ie.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".*").replace(/,/g, "$|^").toUpperCase(), ne = new RegExp("^" + ie + "$", "i");
|
|
418
|
+
}
|
|
419
|
+
var ie;
|
|
420
|
+
function oe(e3, t3) {
|
|
421
|
+
var r3 = { seen: [], stylize: fe };
|
|
422
|
+
return arguments.length >= 3 && (r3.depth = arguments[2]), arguments.length >= 4 && (r3.colors = arguments[3]), ye(t3) ? r3.showHidden = t3 : t3 && X._extend(r3, t3), be(r3.showHidden) && (r3.showHidden = false), be(r3.depth) && (r3.depth = 2), be(r3.colors) && (r3.colors = false), be(r3.customInspect) && (r3.customInspect = true), r3.colors && (r3.stylize = ue), ae(r3, e3, r3.depth);
|
|
423
|
+
}
|
|
424
|
+
__name(oe, "oe");
|
|
425
|
+
function ue(e3, t3) {
|
|
426
|
+
var r3 = oe.styles[t3];
|
|
427
|
+
return r3 ? "\x1B[" + oe.colors[r3][0] + "m" + e3 + "\x1B[" + oe.colors[r3][1] + "m" : e3;
|
|
428
|
+
}
|
|
429
|
+
__name(ue, "ue");
|
|
430
|
+
function fe(e3, t3) {
|
|
431
|
+
return e3;
|
|
432
|
+
}
|
|
433
|
+
__name(fe, "fe");
|
|
434
|
+
function ae(e3, t3, r3) {
|
|
435
|
+
if (e3.customInspect && t3 && we(t3.inspect) && t3.inspect !== X.inspect && (!t3.constructor || t3.constructor.prototype !== t3)) {
|
|
436
|
+
var n3 = t3.inspect(r3, e3);
|
|
437
|
+
return ge(n3) || (n3 = ae(e3, n3, r3)), n3;
|
|
438
|
+
}
|
|
439
|
+
var i3 = function(e4, t4) {
|
|
440
|
+
if (be(t4))
|
|
441
|
+
return e4.stylize("undefined", "undefined");
|
|
442
|
+
if (ge(t4)) {
|
|
443
|
+
var r4 = "'" + JSON.stringify(t4).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'";
|
|
444
|
+
return e4.stylize(r4, "string");
|
|
445
|
+
}
|
|
446
|
+
if (de(t4))
|
|
447
|
+
return e4.stylize("" + t4, "number");
|
|
448
|
+
if (ye(t4))
|
|
449
|
+
return e4.stylize("" + t4, "boolean");
|
|
450
|
+
if (le(t4))
|
|
451
|
+
return e4.stylize("null", "null");
|
|
452
|
+
}(e3, t3);
|
|
453
|
+
if (i3)
|
|
454
|
+
return i3;
|
|
455
|
+
var o3 = Object.keys(t3), u3 = function(e4) {
|
|
456
|
+
var t4 = {};
|
|
457
|
+
return e4.forEach(function(e5, r4) {
|
|
458
|
+
t4[e5] = true;
|
|
459
|
+
}), t4;
|
|
460
|
+
}(o3);
|
|
461
|
+
if (e3.showHidden && (o3 = Object.getOwnPropertyNames(t3)), Ae(t3) && (o3.indexOf("message") >= 0 || o3.indexOf("description") >= 0))
|
|
462
|
+
return ce(t3);
|
|
463
|
+
if (0 === o3.length) {
|
|
464
|
+
if (we(t3)) {
|
|
465
|
+
var f3 = t3.name ? ": " + t3.name : "";
|
|
466
|
+
return e3.stylize("[Function" + f3 + "]", "special");
|
|
467
|
+
}
|
|
468
|
+
if (me(t3))
|
|
469
|
+
return e3.stylize(RegExp.prototype.toString.call(t3), "regexp");
|
|
470
|
+
if (je(t3))
|
|
471
|
+
return e3.stylize(Date.prototype.toString.call(t3), "date");
|
|
472
|
+
if (Ae(t3))
|
|
473
|
+
return ce(t3);
|
|
474
|
+
}
|
|
475
|
+
var a3, c3 = "", s4 = false, p3 = ["{", "}"];
|
|
476
|
+
(pe(t3) && (s4 = true, p3 = ["[", "]"]), we(t3)) && (c3 = " [Function" + (t3.name ? ": " + t3.name : "") + "]");
|
|
477
|
+
return me(t3) && (c3 = " " + RegExp.prototype.toString.call(t3)), je(t3) && (c3 = " " + Date.prototype.toUTCString.call(t3)), Ae(t3) && (c3 = " " + ce(t3)), 0 !== o3.length || s4 && 0 != t3.length ? r3 < 0 ? me(t3) ? e3.stylize(RegExp.prototype.toString.call(t3), "regexp") : e3.stylize("[Object]", "special") : (e3.seen.push(t3), a3 = s4 ? function(e4, t4, r4, n4, i4) {
|
|
478
|
+
for (var o4 = [], u4 = 0, f4 = t4.length; u4 < f4; ++u4)
|
|
479
|
+
ke(t4, String(u4)) ? o4.push(se(e4, t4, r4, n4, String(u4), true)) : o4.push("");
|
|
480
|
+
return i4.forEach(function(i5) {
|
|
481
|
+
i5.match(/^\d+$/) || o4.push(se(e4, t4, r4, n4, i5, true));
|
|
482
|
+
}), o4;
|
|
483
|
+
}(e3, t3, r3, u3, o3) : o3.map(function(n4) {
|
|
484
|
+
return se(e3, t3, r3, u3, n4, s4);
|
|
485
|
+
}), e3.seen.pop(), function(e4, t4, r4) {
|
|
486
|
+
var n4 = 0;
|
|
487
|
+
if (e4.reduce(function(e5, t5) {
|
|
488
|
+
return n4++, t5.indexOf("\n") >= 0 && n4++, e5 + t5.replace(/\u001b\[\d\d?m/g, "").length + 1;
|
|
489
|
+
}, 0) > 60)
|
|
490
|
+
return r4[0] + ("" === t4 ? "" : t4 + "\n ") + " " + e4.join(",\n ") + " " + r4[1];
|
|
491
|
+
return r4[0] + t4 + " " + e4.join(", ") + " " + r4[1];
|
|
492
|
+
}(a3, c3, p3)) : p3[0] + c3 + p3[1];
|
|
493
|
+
}
|
|
494
|
+
__name(ae, "ae");
|
|
495
|
+
function ce(e3) {
|
|
496
|
+
return "[" + Error.prototype.toString.call(e3) + "]";
|
|
497
|
+
}
|
|
498
|
+
__name(ce, "ce");
|
|
499
|
+
function se(e3, t3, r3, n3, i3, o3) {
|
|
500
|
+
var u3, f3, a3;
|
|
501
|
+
if ((a3 = Object.getOwnPropertyDescriptor(t3, i3) || { value: t3[i3] }).get ? f3 = a3.set ? e3.stylize("[Getter/Setter]", "special") : e3.stylize("[Getter]", "special") : a3.set && (f3 = e3.stylize("[Setter]", "special")), ke(n3, i3) || (u3 = "[" + i3 + "]"), f3 || (e3.seen.indexOf(a3.value) < 0 ? (f3 = le(r3) ? ae(e3, a3.value, null) : ae(e3, a3.value, r3 - 1)).indexOf("\n") > -1 && (f3 = o3 ? f3.split("\n").map(function(e4) {
|
|
502
|
+
return " " + e4;
|
|
503
|
+
}).join("\n").substr(2) : "\n" + f3.split("\n").map(function(e4) {
|
|
504
|
+
return " " + e4;
|
|
505
|
+
}).join("\n")) : f3 = e3.stylize("[Circular]", "special")), be(u3)) {
|
|
506
|
+
if (o3 && i3.match(/^\d+$/))
|
|
507
|
+
return f3;
|
|
508
|
+
(u3 = JSON.stringify("" + i3)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/) ? (u3 = u3.substr(1, u3.length - 2), u3 = e3.stylize(u3, "name")) : (u3 = u3.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"), u3 = e3.stylize(u3, "string"));
|
|
509
|
+
}
|
|
510
|
+
return u3 + ": " + f3;
|
|
511
|
+
}
|
|
512
|
+
__name(se, "se");
|
|
513
|
+
function pe(e3) {
|
|
514
|
+
return Array.isArray(e3);
|
|
515
|
+
}
|
|
516
|
+
__name(pe, "pe");
|
|
517
|
+
function ye(e3) {
|
|
518
|
+
return "boolean" == typeof e3;
|
|
519
|
+
}
|
|
520
|
+
__name(ye, "ye");
|
|
521
|
+
function le(e3) {
|
|
522
|
+
return null === e3;
|
|
523
|
+
}
|
|
524
|
+
__name(le, "le");
|
|
525
|
+
function de(e3) {
|
|
526
|
+
return "number" == typeof e3;
|
|
527
|
+
}
|
|
528
|
+
__name(de, "de");
|
|
529
|
+
function ge(e3) {
|
|
530
|
+
return "string" == typeof e3;
|
|
531
|
+
}
|
|
532
|
+
__name(ge, "ge");
|
|
533
|
+
function be(e3) {
|
|
534
|
+
return void 0 === e3;
|
|
535
|
+
}
|
|
536
|
+
__name(be, "be");
|
|
537
|
+
function me(e3) {
|
|
538
|
+
return he(e3) && "[object RegExp]" === ve(e3);
|
|
539
|
+
}
|
|
540
|
+
__name(me, "me");
|
|
541
|
+
function he(e3) {
|
|
542
|
+
return "object" == typeof e3 && null !== e3;
|
|
543
|
+
}
|
|
544
|
+
__name(he, "he");
|
|
545
|
+
function je(e3) {
|
|
546
|
+
return he(e3) && "[object Date]" === ve(e3);
|
|
547
|
+
}
|
|
548
|
+
__name(je, "je");
|
|
549
|
+
function Ae(e3) {
|
|
550
|
+
return he(e3) && ("[object Error]" === ve(e3) || e3 instanceof Error);
|
|
551
|
+
}
|
|
552
|
+
__name(Ae, "Ae");
|
|
553
|
+
function we(e3) {
|
|
554
|
+
return "function" == typeof e3;
|
|
555
|
+
}
|
|
556
|
+
__name(we, "we");
|
|
557
|
+
function ve(e3) {
|
|
558
|
+
return Object.prototype.toString.call(e3);
|
|
559
|
+
}
|
|
560
|
+
__name(ve, "ve");
|
|
561
|
+
function Oe(e3) {
|
|
562
|
+
return e3 < 10 ? "0" + e3.toString(10) : e3.toString(10);
|
|
563
|
+
}
|
|
564
|
+
__name(Oe, "Oe");
|
|
565
|
+
X.debuglog = function(e3) {
|
|
566
|
+
if (e3 = e3.toUpperCase(), !re[e3])
|
|
567
|
+
if (ne.test(e3)) {
|
|
568
|
+
var t3 = Y.pid;
|
|
569
|
+
re[e3] = function() {
|
|
570
|
+
var r3 = X.format.apply(X, arguments);
|
|
571
|
+
console.error("%s %d: %s", e3, t3, r3);
|
|
572
|
+
};
|
|
573
|
+
} else
|
|
574
|
+
re[e3] = function() {
|
|
575
|
+
};
|
|
576
|
+
return re[e3];
|
|
577
|
+
}, X.inspect = oe, oe.colors = { bold: [1, 22], italic: [3, 23], underline: [4, 24], inverse: [7, 27], white: [37, 39], grey: [90, 39], black: [30, 39], blue: [34, 39], cyan: [36, 39], green: [32, 39], magenta: [35, 39], red: [31, 39], yellow: [33, 39] }, oe.styles = { special: "cyan", number: "yellow", boolean: "yellow", undefined: "grey", null: "bold", string: "green", date: "magenta", regexp: "red" }, X.types = o$2, X.isArray = pe, X.isBoolean = ye, X.isNull = le, X.isNullOrUndefined = function(e3) {
|
|
578
|
+
return null == e3;
|
|
579
|
+
}, X.isNumber = de, X.isString = ge, X.isSymbol = function(e3) {
|
|
580
|
+
return "symbol" == typeof e3;
|
|
581
|
+
}, X.isUndefined = be, X.isRegExp = me, X.types.isRegExp = me, X.isObject = he, X.isDate = je, X.types.isDate = je, X.isError = Ae, X.types.isNativeError = Ae, X.isFunction = we, X.isPrimitive = function(e3) {
|
|
582
|
+
return null === e3 || "boolean" == typeof e3 || "number" == typeof e3 || "string" == typeof e3 || "symbol" == typeof e3 || void 0 === e3;
|
|
583
|
+
}, X.isBuffer = i$1;
|
|
584
|
+
var Se = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
585
|
+
function Be() {
|
|
586
|
+
var e3 = /* @__PURE__ */ new Date(), t3 = [Oe(e3.getHours()), Oe(e3.getMinutes()), Oe(e3.getSeconds())].join(":");
|
|
587
|
+
return [e3.getDate(), Se[e3.getMonth()], t3].join(" ");
|
|
588
|
+
}
|
|
589
|
+
__name(Be, "Be");
|
|
590
|
+
function ke(e3, t3) {
|
|
591
|
+
return Object.prototype.hasOwnProperty.call(e3, t3);
|
|
592
|
+
}
|
|
593
|
+
__name(ke, "ke");
|
|
594
|
+
X.log = function() {
|
|
595
|
+
console.log("%s - %s", Be(), X.format.apply(X, arguments));
|
|
596
|
+
}, X.inherits = t$2, X._extend = function(e3, t3) {
|
|
597
|
+
if (!t3 || !he(t3))
|
|
598
|
+
return e3;
|
|
599
|
+
for (var r3 = Object.keys(t3), n3 = r3.length; n3--; )
|
|
600
|
+
e3[r3[n3]] = t3[r3[n3]];
|
|
601
|
+
return e3;
|
|
602
|
+
};
|
|
603
|
+
var Ee = "undefined" != typeof Symbol ? Symbol("util.promisify.custom") : void 0;
|
|
604
|
+
function De(e3, t3) {
|
|
605
|
+
if (!e3) {
|
|
606
|
+
var r3 = new Error("Promise was rejected with a falsy value");
|
|
607
|
+
r3.reason = e3, e3 = r3;
|
|
608
|
+
}
|
|
609
|
+
return t3(e3);
|
|
610
|
+
}
|
|
611
|
+
__name(De, "De");
|
|
612
|
+
X.promisify = function(e3) {
|
|
613
|
+
if ("function" != typeof e3)
|
|
614
|
+
throw new TypeError('The "original" argument must be of type Function');
|
|
615
|
+
if (Ee && e3[Ee]) {
|
|
616
|
+
var t3;
|
|
617
|
+
if ("function" != typeof (t3 = e3[Ee]))
|
|
618
|
+
throw new TypeError('The "util.promisify.custom" argument must be of type Function');
|
|
619
|
+
return Object.defineProperty(t3, Ee, { value: t3, enumerable: false, writable: false, configurable: true }), t3;
|
|
620
|
+
}
|
|
621
|
+
function t3() {
|
|
622
|
+
for (var t4, r3, n3 = new Promise(function(e4, n4) {
|
|
623
|
+
t4 = e4, r3 = n4;
|
|
624
|
+
}), i3 = [], o3 = 0; o3 < arguments.length; o3++)
|
|
625
|
+
i3.push(arguments[o3]);
|
|
626
|
+
i3.push(function(e4, n4) {
|
|
627
|
+
e4 ? r3(e4) : t4(n4);
|
|
628
|
+
});
|
|
629
|
+
try {
|
|
630
|
+
e3.apply(this || Q, i3);
|
|
631
|
+
} catch (e4) {
|
|
632
|
+
r3(e4);
|
|
633
|
+
}
|
|
634
|
+
return n3;
|
|
635
|
+
}
|
|
636
|
+
__name(t3, "t");
|
|
637
|
+
return Object.setPrototypeOf(t3, Object.getPrototypeOf(e3)), Ee && Object.defineProperty(t3, Ee, { value: t3, enumerable: false, writable: false, configurable: true }), Object.defineProperties(t3, ee(e3));
|
|
638
|
+
}, X.promisify.custom = Ee, X.callbackify = function(e3) {
|
|
639
|
+
if ("function" != typeof e3)
|
|
640
|
+
throw new TypeError('The "original" argument must be of type Function');
|
|
641
|
+
function t3() {
|
|
642
|
+
for (var t4 = [], r3 = 0; r3 < arguments.length; r3++)
|
|
643
|
+
t4.push(arguments[r3]);
|
|
644
|
+
var n3 = t4.pop();
|
|
645
|
+
if ("function" != typeof n3)
|
|
646
|
+
throw new TypeError("The last argument must be of type Function");
|
|
647
|
+
var i3 = this || Q, o3 = /* @__PURE__ */ __name(function() {
|
|
648
|
+
return n3.apply(i3, arguments);
|
|
649
|
+
}, "o");
|
|
650
|
+
e3.apply(this || Q, t4).then(function(e4) {
|
|
651
|
+
Y.nextTick(o3.bind(null, null, e4));
|
|
652
|
+
}, function(e4) {
|
|
653
|
+
Y.nextTick(De.bind(null, e4, o3));
|
|
654
|
+
});
|
|
655
|
+
}
|
|
656
|
+
__name(t3, "t");
|
|
657
|
+
return Object.setPrototypeOf(t3, Object.getPrototypeOf(e3)), Object.defineProperties(t3, ee(e3)), t3;
|
|
658
|
+
};
|
|
659
|
+
|
|
660
|
+
// node_modules/@jspm/core/nodelibs/browser/chunk-ce0fbc82.js
|
|
661
|
+
X._extend;
|
|
662
|
+
X.callbackify;
|
|
663
|
+
X.debuglog;
|
|
664
|
+
X.deprecate;
|
|
665
|
+
X.format;
|
|
666
|
+
X.inherits;
|
|
667
|
+
X.inspect;
|
|
668
|
+
X.isArray;
|
|
669
|
+
X.isBoolean;
|
|
670
|
+
X.isBuffer;
|
|
671
|
+
X.isDate;
|
|
672
|
+
X.isError;
|
|
673
|
+
X.isFunction;
|
|
674
|
+
X.isNull;
|
|
675
|
+
X.isNullOrUndefined;
|
|
676
|
+
X.isNumber;
|
|
677
|
+
X.isObject;
|
|
678
|
+
X.isPrimitive;
|
|
679
|
+
X.isRegExp;
|
|
680
|
+
X.isString;
|
|
681
|
+
X.isSymbol;
|
|
682
|
+
X.isUndefined;
|
|
683
|
+
X.log;
|
|
684
|
+
X.promisify;
|
|
685
|
+
X._extend;
|
|
686
|
+
X.callbackify;
|
|
687
|
+
X.debuglog;
|
|
688
|
+
X.deprecate;
|
|
689
|
+
X.format;
|
|
690
|
+
X.inherits;
|
|
691
|
+
X.inspect;
|
|
692
|
+
X.isArray;
|
|
693
|
+
X.isBoolean;
|
|
694
|
+
X.isBuffer;
|
|
695
|
+
X.isDate;
|
|
696
|
+
X.isError;
|
|
697
|
+
X.isFunction;
|
|
698
|
+
X.isNull;
|
|
699
|
+
X.isNullOrUndefined;
|
|
700
|
+
X.isNumber;
|
|
701
|
+
X.isObject;
|
|
702
|
+
X.isPrimitive;
|
|
703
|
+
X.isRegExp;
|
|
704
|
+
X.isString;
|
|
705
|
+
X.isSymbol;
|
|
706
|
+
X.isUndefined;
|
|
707
|
+
X.log;
|
|
708
|
+
X.promisify;
|
|
709
|
+
X.types;
|
|
710
|
+
|
|
711
|
+
// node-modules-polyfills:util
|
|
712
|
+
X._extend;
|
|
713
|
+
X.callbackify;
|
|
714
|
+
X.debuglog;
|
|
715
|
+
X.deprecate;
|
|
716
|
+
X.format;
|
|
717
|
+
X.inherits;
|
|
718
|
+
var inspect2 = X.inspect;
|
|
719
|
+
X.isArray;
|
|
720
|
+
X.isBoolean;
|
|
721
|
+
X.isBuffer;
|
|
722
|
+
X.isDate;
|
|
723
|
+
X.isError;
|
|
724
|
+
X.isFunction;
|
|
725
|
+
X.isNull;
|
|
726
|
+
X.isNullOrUndefined;
|
|
727
|
+
X.isNumber;
|
|
728
|
+
X.isObject;
|
|
729
|
+
X.isPrimitive;
|
|
730
|
+
X.isRegExp;
|
|
731
|
+
X.isString;
|
|
732
|
+
X.isSymbol;
|
|
733
|
+
X.isUndefined;
|
|
734
|
+
X.log;
|
|
735
|
+
X.promisify;
|
|
736
|
+
X.types;
|
|
737
|
+
X.TextEncoder = globalThis.TextEncoder;
|
|
738
|
+
X.TextDecoder = globalThis.TextDecoder;
|
|
739
|
+
|
|
740
|
+
// src/lib/errors/BaseError.ts
|
|
741
|
+
var customInspectSymbol = Symbol.for("nodejs.util.inspect.custom");
|
|
742
|
+
var customInspectSymbolStackLess = Symbol.for("nodejs.util.inspect.custom.stack-less");
|
|
743
|
+
var _BaseError = class _BaseError extends Error {
|
|
744
|
+
toJSON() {
|
|
745
|
+
return {
|
|
746
|
+
name: this.name,
|
|
747
|
+
message: this.message
|
|
748
|
+
};
|
|
749
|
+
}
|
|
750
|
+
[customInspectSymbol](depth, options) {
|
|
751
|
+
return `${this[customInspectSymbolStackLess](depth, options)}
|
|
752
|
+
${this.stack.slice(this.stack.indexOf("\n"))}`;
|
|
753
|
+
}
|
|
754
|
+
};
|
|
755
|
+
__name(_BaseError, "BaseError");
|
|
756
|
+
var BaseError = _BaseError;
|
|
757
|
+
|
|
758
|
+
// src/lib/errors/BaseConstraintError.ts
|
|
759
|
+
var _BaseConstraintError = class _BaseConstraintError extends BaseError {
|
|
760
|
+
constructor(constraint, message, given) {
|
|
761
|
+
super(message);
|
|
762
|
+
this.constraint = constraint;
|
|
763
|
+
this.given = given;
|
|
764
|
+
}
|
|
765
|
+
toJSON() {
|
|
766
|
+
return {
|
|
767
|
+
name: this.name,
|
|
768
|
+
constraint: this.constraint,
|
|
769
|
+
given: this.given,
|
|
770
|
+
message: this.message
|
|
771
|
+
};
|
|
772
|
+
}
|
|
773
|
+
};
|
|
774
|
+
__name(_BaseConstraintError, "BaseConstraintError");
|
|
775
|
+
var BaseConstraintError = _BaseConstraintError;
|
|
776
|
+
|
|
777
|
+
// src/lib/errors/ExpectedConstraintError.ts
|
|
778
|
+
var _ExpectedConstraintError = class _ExpectedConstraintError extends BaseConstraintError {
|
|
779
|
+
constructor(constraint, message, given, expected) {
|
|
780
|
+
super(constraint, message, given);
|
|
781
|
+
this.expected = expected;
|
|
782
|
+
}
|
|
783
|
+
toJSON() {
|
|
784
|
+
return {
|
|
785
|
+
name: this.name,
|
|
786
|
+
constraint: this.constraint,
|
|
787
|
+
given: this.given,
|
|
788
|
+
expected: this.expected,
|
|
789
|
+
message: this.message
|
|
790
|
+
};
|
|
791
|
+
}
|
|
792
|
+
[customInspectSymbolStackLess](depth, options) {
|
|
793
|
+
const constraint = options.stylize(this.constraint, "string");
|
|
794
|
+
if (depth < 0) {
|
|
795
|
+
return options.stylize(`[ExpectedConstraintError: ${constraint}]`, "special");
|
|
796
|
+
}
|
|
797
|
+
const newOptions = { ...options, depth: options.depth === null ? null : options.depth - 1 };
|
|
798
|
+
const padding = `
|
|
799
|
+
${options.stylize("|", "undefined")} `;
|
|
800
|
+
const given = inspect2(this.given, newOptions).replace(/\n/g, padding);
|
|
801
|
+
const header = `${options.stylize("ExpectedConstraintError", "special")} > ${constraint}`;
|
|
802
|
+
const message = options.stylize(this.message, "regexp");
|
|
803
|
+
const expectedBlock = `
|
|
804
|
+
${options.stylize("Expected: ", "string")}${options.stylize(this.expected, "boolean")}`;
|
|
805
|
+
const givenBlock = `
|
|
806
|
+
${options.stylize("Received:", "regexp")}${padding}${given}`;
|
|
807
|
+
return `${header}
|
|
808
|
+
${message}
|
|
809
|
+
${expectedBlock}
|
|
810
|
+
${givenBlock}`;
|
|
811
|
+
}
|
|
812
|
+
};
|
|
813
|
+
__name(_ExpectedConstraintError, "ExpectedConstraintError");
|
|
814
|
+
var ExpectedConstraintError = _ExpectedConstraintError;
|
|
815
|
+
|
|
816
|
+
// src/lib/Result.ts
|
|
817
|
+
var _Result = class _Result {
|
|
818
|
+
constructor(success, value, error) {
|
|
819
|
+
this.success = success;
|
|
820
|
+
if (success) {
|
|
821
|
+
this.value = value;
|
|
822
|
+
} else {
|
|
823
|
+
this.error = error;
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
isOk() {
|
|
827
|
+
return this.success;
|
|
828
|
+
}
|
|
829
|
+
isErr() {
|
|
830
|
+
return !this.success;
|
|
831
|
+
}
|
|
832
|
+
unwrap() {
|
|
833
|
+
if (this.isOk())
|
|
834
|
+
return this.value;
|
|
835
|
+
throw this.error;
|
|
836
|
+
}
|
|
837
|
+
static ok(value) {
|
|
838
|
+
return new _Result(true, value);
|
|
839
|
+
}
|
|
840
|
+
static err(error) {
|
|
841
|
+
return new _Result(false, void 0, error);
|
|
842
|
+
}
|
|
843
|
+
};
|
|
844
|
+
__name(_Result, "Result");
|
|
845
|
+
var Result = _Result;
|
|
846
|
+
|
|
847
|
+
// src/constraints/ObjectConstrains.ts
|
|
848
|
+
function whenConstraint(key, options, validator, validatorOptions) {
|
|
849
|
+
return {
|
|
850
|
+
run(input, parent) {
|
|
851
|
+
if (!parent) {
|
|
852
|
+
return Result.err(
|
|
853
|
+
new ExpectedConstraintError(
|
|
854
|
+
"s.object(T.when)",
|
|
855
|
+
validatorOptions?.message ?? "Validator has no parent",
|
|
856
|
+
parent,
|
|
857
|
+
"Validator to have a parent"
|
|
858
|
+
)
|
|
859
|
+
);
|
|
860
|
+
}
|
|
861
|
+
const isKeyArray = Array.isArray(key);
|
|
862
|
+
const value = isKeyArray ? key.map((k2) => get__default.default(parent, k2)) : get__default.default(parent, key);
|
|
863
|
+
const predicate = resolveBooleanIs(options, value, isKeyArray) ? options.then : options.otherwise;
|
|
864
|
+
if (predicate) {
|
|
865
|
+
return predicate(validator).run(input);
|
|
866
|
+
}
|
|
867
|
+
return Result.ok(input);
|
|
868
|
+
}
|
|
869
|
+
};
|
|
870
|
+
}
|
|
871
|
+
__name(whenConstraint, "whenConstraint");
|
|
872
|
+
function resolveBooleanIs(options, value, isKeyArray) {
|
|
873
|
+
if (options.is === void 0) {
|
|
874
|
+
return isKeyArray ? !value.some((val) => !val) : Boolean(value);
|
|
875
|
+
}
|
|
876
|
+
if (typeof options.is === "function") {
|
|
877
|
+
return options.is(value);
|
|
878
|
+
}
|
|
879
|
+
return value === options.is;
|
|
880
|
+
}
|
|
881
|
+
__name(resolveBooleanIs, "resolveBooleanIs");
|
|
882
|
+
|
|
883
|
+
// src/lib/configs.ts
|
|
884
|
+
var validationEnabled = true;
|
|
885
|
+
function setGlobalValidationEnabled(enabled) {
|
|
886
|
+
validationEnabled = enabled;
|
|
887
|
+
}
|
|
888
|
+
__name(setGlobalValidationEnabled, "setGlobalValidationEnabled");
|
|
889
|
+
function getGlobalValidationEnabled() {
|
|
890
|
+
return validationEnabled;
|
|
891
|
+
}
|
|
892
|
+
__name(getGlobalValidationEnabled, "getGlobalValidationEnabled");
|
|
893
|
+
|
|
894
|
+
// src/validators/util/getValue.ts
|
|
895
|
+
function getValue(valueOrFn) {
|
|
896
|
+
return typeof valueOrFn === "function" ? valueOrFn() : valueOrFn;
|
|
897
|
+
}
|
|
898
|
+
__name(getValue, "getValue");
|
|
899
|
+
|
|
900
|
+
// src/validators/BaseValidator.ts
|
|
901
|
+
var _BaseValidator = class _BaseValidator {
|
|
902
|
+
constructor(validatorOptions = {}, constraints = []) {
|
|
903
|
+
this.constraints = [];
|
|
904
|
+
this.isValidationEnabled = null;
|
|
905
|
+
this.constraints = constraints;
|
|
906
|
+
this.validatorOptions = validatorOptions;
|
|
907
|
+
}
|
|
908
|
+
setParent(parent) {
|
|
909
|
+
this.parent = parent;
|
|
910
|
+
return this;
|
|
911
|
+
}
|
|
912
|
+
optional(options = this.validatorOptions) {
|
|
913
|
+
return new UnionValidator([new LiteralValidator(void 0, options), this.clone()], options);
|
|
914
|
+
}
|
|
915
|
+
nullable(options = this.validatorOptions) {
|
|
916
|
+
return new UnionValidator([new LiteralValidator(null, options), this.clone()], options);
|
|
917
|
+
}
|
|
918
|
+
nullish(options = this.validatorOptions) {
|
|
919
|
+
return new UnionValidator([new NullishValidator(options), this.clone()], options);
|
|
920
|
+
}
|
|
921
|
+
array(options = this.validatorOptions) {
|
|
922
|
+
return new ArrayValidator(this.clone(), options);
|
|
923
|
+
}
|
|
924
|
+
set(options = this.validatorOptions) {
|
|
925
|
+
return new SetValidator(this.clone(), options);
|
|
926
|
+
}
|
|
927
|
+
or(...predicates) {
|
|
928
|
+
return new UnionValidator([this.clone(), ...predicates], this.validatorOptions);
|
|
929
|
+
}
|
|
930
|
+
transform(cb, options = this.validatorOptions) {
|
|
931
|
+
return this.addConstraint(
|
|
932
|
+
{
|
|
933
|
+
run: (input) => Result.ok(cb(input))
|
|
934
|
+
},
|
|
935
|
+
options
|
|
936
|
+
);
|
|
937
|
+
}
|
|
938
|
+
reshape(cb, options = this.validatorOptions) {
|
|
939
|
+
return this.addConstraint(
|
|
940
|
+
{
|
|
941
|
+
run: cb
|
|
942
|
+
},
|
|
943
|
+
options
|
|
944
|
+
);
|
|
945
|
+
}
|
|
946
|
+
default(value, options = this.validatorOptions) {
|
|
947
|
+
return new DefaultValidator(this.clone(), value, options);
|
|
948
|
+
}
|
|
949
|
+
when(key, options, validatorOptions) {
|
|
950
|
+
return this.addConstraint(whenConstraint(key, options, this, validatorOptions));
|
|
951
|
+
}
|
|
952
|
+
describe(description) {
|
|
953
|
+
const clone = this.clone();
|
|
954
|
+
clone.description = description;
|
|
955
|
+
return clone;
|
|
956
|
+
}
|
|
957
|
+
run(value) {
|
|
958
|
+
let result = this.handle(value);
|
|
959
|
+
if (result.isErr())
|
|
960
|
+
return result;
|
|
961
|
+
for (const constraint of this.constraints) {
|
|
962
|
+
result = constraint.run(result.value, this.parent);
|
|
963
|
+
if (result.isErr())
|
|
964
|
+
break;
|
|
965
|
+
}
|
|
966
|
+
return result;
|
|
967
|
+
}
|
|
968
|
+
parse(value) {
|
|
969
|
+
if (!this.shouldRunConstraints) {
|
|
970
|
+
return this.handle(value).unwrap();
|
|
971
|
+
}
|
|
972
|
+
return this.constraints.reduce((v2, constraint) => constraint.run(v2).unwrap(), this.handle(value).unwrap());
|
|
973
|
+
}
|
|
974
|
+
is(value) {
|
|
975
|
+
return this.run(value).isOk();
|
|
976
|
+
}
|
|
977
|
+
/**
|
|
978
|
+
* Sets if the validator should also run constraints or just do basic checks.
|
|
979
|
+
* @param isValidationEnabled Whether this validator should be enabled or disabled. You can pass boolean or a function returning boolean which will be called just before parsing.
|
|
980
|
+
* Set to `null` to go off of the global configuration.
|
|
981
|
+
*/
|
|
982
|
+
setValidationEnabled(isValidationEnabled) {
|
|
983
|
+
const clone = this.clone();
|
|
984
|
+
clone.isValidationEnabled = isValidationEnabled;
|
|
985
|
+
return clone;
|
|
986
|
+
}
|
|
987
|
+
getValidationEnabled() {
|
|
988
|
+
return getValue(this.isValidationEnabled);
|
|
989
|
+
}
|
|
990
|
+
get shouldRunConstraints() {
|
|
991
|
+
return getValue(this.isValidationEnabled) ?? getGlobalValidationEnabled();
|
|
992
|
+
}
|
|
993
|
+
clone() {
|
|
994
|
+
const clone = Reflect.construct(this.constructor, [this.validatorOptions, this.constraints]);
|
|
995
|
+
clone.isValidationEnabled = this.isValidationEnabled;
|
|
996
|
+
return clone;
|
|
997
|
+
}
|
|
998
|
+
addConstraint(constraint, validatorOptions = this.validatorOptions) {
|
|
999
|
+
const clone = this.clone();
|
|
1000
|
+
clone.validatorOptions = validatorOptions;
|
|
1001
|
+
clone.constraints = clone.constraints.concat(constraint);
|
|
1002
|
+
return clone;
|
|
1003
|
+
}
|
|
1004
|
+
};
|
|
1005
|
+
__name(_BaseValidator, "BaseValidator");
|
|
1006
|
+
var BaseValidator = _BaseValidator;
|
|
1007
|
+
function isUnique(input) {
|
|
1008
|
+
if (input.length < 2)
|
|
1009
|
+
return true;
|
|
1010
|
+
const uniqueArray2 = uniqWith__default.default(input, fastDeepEqual__default.default);
|
|
1011
|
+
return uniqueArray2.length === input.length;
|
|
1012
|
+
}
|
|
1013
|
+
__name(isUnique, "isUnique");
|
|
1014
|
+
|
|
1015
|
+
// src/constraints/util/operators.ts
|
|
1016
|
+
function lessThan(a3, b2) {
|
|
1017
|
+
return a3 < b2;
|
|
1018
|
+
}
|
|
1019
|
+
__name(lessThan, "lessThan");
|
|
1020
|
+
function lessThanOrEqual(a3, b2) {
|
|
1021
|
+
return a3 <= b2;
|
|
1022
|
+
}
|
|
1023
|
+
__name(lessThanOrEqual, "lessThanOrEqual");
|
|
1024
|
+
function greaterThan(a3, b2) {
|
|
1025
|
+
return a3 > b2;
|
|
1026
|
+
}
|
|
1027
|
+
__name(greaterThan, "greaterThan");
|
|
1028
|
+
function greaterThanOrEqual(a3, b2) {
|
|
1029
|
+
return a3 >= b2;
|
|
1030
|
+
}
|
|
1031
|
+
__name(greaterThanOrEqual, "greaterThanOrEqual");
|
|
1032
|
+
function equal(a3, b2) {
|
|
1033
|
+
return a3 === b2;
|
|
1034
|
+
}
|
|
1035
|
+
__name(equal, "equal");
|
|
1036
|
+
function notEqual(a3, b2) {
|
|
1037
|
+
return a3 !== b2;
|
|
1038
|
+
}
|
|
1039
|
+
__name(notEqual, "notEqual");
|
|
1040
|
+
|
|
1041
|
+
// src/constraints/ArrayConstraints.ts
|
|
1042
|
+
function arrayLengthComparator(comparator, name, expected, length, options) {
|
|
1043
|
+
return {
|
|
1044
|
+
run(input) {
|
|
1045
|
+
return comparator(input.length, length) ? Result.ok(input) : Result.err(new ExpectedConstraintError(name, options?.message ?? "Invalid Array length", input, expected));
|
|
1046
|
+
}
|
|
1047
|
+
};
|
|
1048
|
+
}
|
|
1049
|
+
__name(arrayLengthComparator, "arrayLengthComparator");
|
|
1050
|
+
function arrayLengthLessThan(value, options) {
|
|
1051
|
+
const expected = `expected.length < ${value}`;
|
|
1052
|
+
return arrayLengthComparator(lessThan, "s.array(T).lengthLessThan()", expected, value, options);
|
|
1053
|
+
}
|
|
1054
|
+
__name(arrayLengthLessThan, "arrayLengthLessThan");
|
|
1055
|
+
function arrayLengthLessThanOrEqual(value, options) {
|
|
1056
|
+
const expected = `expected.length <= ${value}`;
|
|
1057
|
+
return arrayLengthComparator(lessThanOrEqual, "s.array(T).lengthLessThanOrEqual()", expected, value, options);
|
|
1058
|
+
}
|
|
1059
|
+
__name(arrayLengthLessThanOrEqual, "arrayLengthLessThanOrEqual");
|
|
1060
|
+
function arrayLengthGreaterThan(value, options) {
|
|
1061
|
+
const expected = `expected.length > ${value}`;
|
|
1062
|
+
return arrayLengthComparator(greaterThan, "s.array(T).lengthGreaterThan()", expected, value, options);
|
|
1063
|
+
}
|
|
1064
|
+
__name(arrayLengthGreaterThan, "arrayLengthGreaterThan");
|
|
1065
|
+
function arrayLengthGreaterThanOrEqual(value, options) {
|
|
1066
|
+
const expected = `expected.length >= ${value}`;
|
|
1067
|
+
return arrayLengthComparator(greaterThanOrEqual, "s.array(T).lengthGreaterThanOrEqual()", expected, value, options);
|
|
1068
|
+
}
|
|
1069
|
+
__name(arrayLengthGreaterThanOrEqual, "arrayLengthGreaterThanOrEqual");
|
|
1070
|
+
function arrayLengthEqual(value, options) {
|
|
1071
|
+
const expected = `expected.length === ${value}`;
|
|
1072
|
+
return arrayLengthComparator(equal, "s.array(T).lengthEqual()", expected, value, options);
|
|
1073
|
+
}
|
|
1074
|
+
__name(arrayLengthEqual, "arrayLengthEqual");
|
|
1075
|
+
function arrayLengthNotEqual(value, options) {
|
|
1076
|
+
const expected = `expected.length !== ${value}`;
|
|
1077
|
+
return arrayLengthComparator(notEqual, "s.array(T).lengthNotEqual()", expected, value, options);
|
|
1078
|
+
}
|
|
1079
|
+
__name(arrayLengthNotEqual, "arrayLengthNotEqual");
|
|
1080
|
+
function arrayLengthRange(start, endBefore, options) {
|
|
1081
|
+
const expected = `expected.length >= ${start} && expected.length < ${endBefore}`;
|
|
1082
|
+
return {
|
|
1083
|
+
run(input) {
|
|
1084
|
+
return input.length >= start && input.length < endBefore ? Result.ok(input) : Result.err(new ExpectedConstraintError("s.array(T).lengthRange()", options?.message ?? "Invalid Array length", input, expected));
|
|
1085
|
+
}
|
|
1086
|
+
};
|
|
1087
|
+
}
|
|
1088
|
+
__name(arrayLengthRange, "arrayLengthRange");
|
|
1089
|
+
function arrayLengthRangeInclusive(start, end, options) {
|
|
1090
|
+
const expected = `expected.length >= ${start} && expected.length <= ${end}`;
|
|
1091
|
+
return {
|
|
1092
|
+
run(input) {
|
|
1093
|
+
return input.length >= start && input.length <= end ? Result.ok(input) : Result.err(
|
|
1094
|
+
new ExpectedConstraintError("s.array(T).lengthRangeInclusive()", options?.message ?? "Invalid Array length", input, expected)
|
|
1095
|
+
);
|
|
1096
|
+
}
|
|
1097
|
+
};
|
|
1098
|
+
}
|
|
1099
|
+
__name(arrayLengthRangeInclusive, "arrayLengthRangeInclusive");
|
|
1100
|
+
function arrayLengthRangeExclusive(startAfter, endBefore, options) {
|
|
1101
|
+
const expected = `expected.length > ${startAfter} && expected.length < ${endBefore}`;
|
|
1102
|
+
return {
|
|
1103
|
+
run(input) {
|
|
1104
|
+
return input.length > startAfter && input.length < endBefore ? Result.ok(input) : Result.err(
|
|
1105
|
+
new ExpectedConstraintError("s.array(T).lengthRangeExclusive()", options?.message ?? "Invalid Array length", input, expected)
|
|
1106
|
+
);
|
|
1107
|
+
}
|
|
1108
|
+
};
|
|
1109
|
+
}
|
|
1110
|
+
__name(arrayLengthRangeExclusive, "arrayLengthRangeExclusive");
|
|
1111
|
+
function uniqueArray(options) {
|
|
1112
|
+
return {
|
|
1113
|
+
run(input) {
|
|
1114
|
+
return isUnique(input) ? Result.ok(input) : Result.err(
|
|
1115
|
+
new ExpectedConstraintError(
|
|
1116
|
+
"s.array(T).unique()",
|
|
1117
|
+
options?.message ?? "Array values are not unique",
|
|
1118
|
+
input,
|
|
1119
|
+
"Expected all values to be unique"
|
|
1120
|
+
)
|
|
1121
|
+
);
|
|
1122
|
+
}
|
|
1123
|
+
};
|
|
1124
|
+
}
|
|
1125
|
+
__name(uniqueArray, "uniqueArray");
|
|
1126
|
+
|
|
1127
|
+
// src/lib/errors/CombinedPropertyError.ts
|
|
1128
|
+
var _CombinedPropertyError = class _CombinedPropertyError extends BaseError {
|
|
1129
|
+
constructor(errors, validatorOptions) {
|
|
1130
|
+
super(validatorOptions?.message ?? "Received one or more errors");
|
|
1131
|
+
this.errors = errors;
|
|
1132
|
+
}
|
|
1133
|
+
[customInspectSymbolStackLess](depth, options) {
|
|
1134
|
+
if (depth < 0) {
|
|
1135
|
+
return options.stylize("[CombinedPropertyError]", "special");
|
|
1136
|
+
}
|
|
1137
|
+
const newOptions = { ...options, depth: options.depth === null ? null : options.depth - 1, compact: true };
|
|
1138
|
+
const padding = `
|
|
1139
|
+
${options.stylize("|", "undefined")} `;
|
|
1140
|
+
const header = `${options.stylize("CombinedPropertyError", "special")} (${options.stylize(this.errors.length.toString(), "number")})`;
|
|
1141
|
+
const message = options.stylize(this.message, "regexp");
|
|
1142
|
+
const errors = this.errors.map(([key, error]) => {
|
|
1143
|
+
const property = _CombinedPropertyError.formatProperty(key, options);
|
|
1144
|
+
const body = error[customInspectSymbolStackLess](depth - 1, newOptions).replace(/\n/g, padding);
|
|
1145
|
+
return ` input${property}${padding}${body}`;
|
|
1146
|
+
}).join("\n\n");
|
|
1147
|
+
return `${header}
|
|
1148
|
+
${message}
|
|
1149
|
+
|
|
1150
|
+
${errors}`;
|
|
1151
|
+
}
|
|
1152
|
+
static formatProperty(key, options) {
|
|
1153
|
+
if (typeof key === "string")
|
|
1154
|
+
return options.stylize(`.${key}`, "symbol");
|
|
1155
|
+
if (typeof key === "number")
|
|
1156
|
+
return `[${options.stylize(key.toString(), "number")}]`;
|
|
1157
|
+
return `[${options.stylize("Symbol", "symbol")}(${key.description})]`;
|
|
1158
|
+
}
|
|
1159
|
+
};
|
|
1160
|
+
__name(_CombinedPropertyError, "CombinedPropertyError");
|
|
1161
|
+
var CombinedPropertyError = _CombinedPropertyError;
|
|
1162
|
+
|
|
1163
|
+
// src/lib/errors/ValidationError.ts
|
|
1164
|
+
var _ValidationError = class _ValidationError extends BaseError {
|
|
1165
|
+
constructor(validator, message, given) {
|
|
1166
|
+
super(message);
|
|
1167
|
+
this.validator = validator;
|
|
1168
|
+
this.given = given;
|
|
1169
|
+
}
|
|
1170
|
+
toJSON() {
|
|
1171
|
+
return {
|
|
1172
|
+
name: this.name,
|
|
1173
|
+
message: "Unknown validation error occurred.",
|
|
1174
|
+
validator: this.validator,
|
|
1175
|
+
given: this.given
|
|
1176
|
+
};
|
|
1177
|
+
}
|
|
1178
|
+
[customInspectSymbolStackLess](depth, options) {
|
|
1179
|
+
const validator = options.stylize(this.validator, "string");
|
|
1180
|
+
if (depth < 0) {
|
|
1181
|
+
return options.stylize(`[ValidationError: ${validator}]`, "special");
|
|
1182
|
+
}
|
|
1183
|
+
const newOptions = { ...options, depth: options.depth === null ? null : options.depth - 1, compact: true };
|
|
1184
|
+
const padding = `
|
|
1185
|
+
${options.stylize("|", "undefined")} `;
|
|
1186
|
+
const given = inspect2(this.given, newOptions).replace(/\n/g, padding);
|
|
1187
|
+
const header = `${options.stylize("ValidationError", "special")} > ${validator}`;
|
|
1188
|
+
const message = options.stylize(this.message, "regexp");
|
|
1189
|
+
const givenBlock = `
|
|
1190
|
+
${options.stylize("Received:", "regexp")}${padding}${given}`;
|
|
1191
|
+
return `${header}
|
|
1192
|
+
${message}
|
|
1193
|
+
${givenBlock}`;
|
|
1194
|
+
}
|
|
1195
|
+
};
|
|
1196
|
+
__name(_ValidationError, "ValidationError");
|
|
1197
|
+
var ValidationError = _ValidationError;
|
|
1198
|
+
|
|
1199
|
+
// src/validators/ArrayValidator.ts
|
|
1200
|
+
var _ArrayValidator = class _ArrayValidator extends BaseValidator {
|
|
1201
|
+
constructor(validator, validatorOptions = {}, constraints = []) {
|
|
1202
|
+
super(validatorOptions, constraints);
|
|
1203
|
+
this.validator = validator;
|
|
1204
|
+
}
|
|
1205
|
+
lengthLessThan(length, options = this.validatorOptions) {
|
|
1206
|
+
return this.addConstraint(arrayLengthLessThan(length, options));
|
|
1207
|
+
}
|
|
1208
|
+
lengthLessThanOrEqual(length, options = this.validatorOptions) {
|
|
1209
|
+
return this.addConstraint(arrayLengthLessThanOrEqual(length, options));
|
|
1210
|
+
}
|
|
1211
|
+
lengthGreaterThan(length, options = this.validatorOptions) {
|
|
1212
|
+
return this.addConstraint(arrayLengthGreaterThan(length, options));
|
|
1213
|
+
}
|
|
1214
|
+
lengthGreaterThanOrEqual(length, options = this.validatorOptions) {
|
|
1215
|
+
return this.addConstraint(arrayLengthGreaterThanOrEqual(length, options));
|
|
1216
|
+
}
|
|
1217
|
+
lengthEqual(length, options = this.validatorOptions) {
|
|
1218
|
+
return this.addConstraint(arrayLengthEqual(length, options));
|
|
1219
|
+
}
|
|
1220
|
+
lengthNotEqual(length, options = this.validatorOptions) {
|
|
1221
|
+
return this.addConstraint(arrayLengthNotEqual(length, options));
|
|
1222
|
+
}
|
|
1223
|
+
lengthRange(start, endBefore, options = this.validatorOptions) {
|
|
1224
|
+
return this.addConstraint(arrayLengthRange(start, endBefore, options));
|
|
1225
|
+
}
|
|
1226
|
+
lengthRangeInclusive(startAt, endAt, options = this.validatorOptions) {
|
|
1227
|
+
return this.addConstraint(arrayLengthRangeInclusive(startAt, endAt, options));
|
|
1228
|
+
}
|
|
1229
|
+
lengthRangeExclusive(startAfter, endBefore, options = this.validatorOptions) {
|
|
1230
|
+
return this.addConstraint(arrayLengthRangeExclusive(startAfter, endBefore, options));
|
|
1231
|
+
}
|
|
1232
|
+
unique(options = this.validatorOptions) {
|
|
1233
|
+
return this.addConstraint(uniqueArray(options));
|
|
1234
|
+
}
|
|
1235
|
+
clone() {
|
|
1236
|
+
return Reflect.construct(this.constructor, [this.validator, this.validatorOptions, this.constraints]);
|
|
1237
|
+
}
|
|
1238
|
+
handle(values) {
|
|
1239
|
+
if (!Array.isArray(values)) {
|
|
1240
|
+
return Result.err(new ValidationError("s.array(T)", this.validatorOptions.message ?? "Expected an array", values));
|
|
1241
|
+
}
|
|
1242
|
+
if (!this.shouldRunConstraints) {
|
|
1243
|
+
return Result.ok(values);
|
|
1244
|
+
}
|
|
1245
|
+
const errors = [];
|
|
1246
|
+
const transformed = [];
|
|
1247
|
+
for (let i3 = 0; i3 < values.length; i3++) {
|
|
1248
|
+
const result = this.validator.run(values[i3]);
|
|
1249
|
+
if (result.isOk())
|
|
1250
|
+
transformed.push(result.value);
|
|
1251
|
+
else
|
|
1252
|
+
errors.push([i3, result.error]);
|
|
1253
|
+
}
|
|
1254
|
+
return errors.length === 0 ? Result.ok(transformed) : Result.err(new CombinedPropertyError(errors, this.validatorOptions));
|
|
1255
|
+
}
|
|
1256
|
+
};
|
|
1257
|
+
__name(_ArrayValidator, "ArrayValidator");
|
|
1258
|
+
var ArrayValidator = _ArrayValidator;
|
|
1259
|
+
|
|
1260
|
+
// src/constraints/BigIntConstraints.ts
|
|
1261
|
+
function bigintComparator(comparator, name, expected, number, options) {
|
|
1262
|
+
return {
|
|
1263
|
+
run(input) {
|
|
1264
|
+
return comparator(input, number) ? Result.ok(input) : Result.err(new ExpectedConstraintError(name, options?.message ?? "Invalid bigint value", input, expected));
|
|
1265
|
+
}
|
|
1266
|
+
};
|
|
1267
|
+
}
|
|
1268
|
+
__name(bigintComparator, "bigintComparator");
|
|
1269
|
+
function bigintLessThan(value, options) {
|
|
1270
|
+
const expected = `expected < ${value}n`;
|
|
1271
|
+
return bigintComparator(lessThan, "s.bigint().lessThan()", expected, value, options);
|
|
1272
|
+
}
|
|
1273
|
+
__name(bigintLessThan, "bigintLessThan");
|
|
1274
|
+
function bigintLessThanOrEqual(value, options) {
|
|
1275
|
+
const expected = `expected <= ${value}n`;
|
|
1276
|
+
return bigintComparator(lessThanOrEqual, "s.bigint().lessThanOrEqual()", expected, value, options);
|
|
1277
|
+
}
|
|
1278
|
+
__name(bigintLessThanOrEqual, "bigintLessThanOrEqual");
|
|
1279
|
+
function bigintGreaterThan(value, options) {
|
|
1280
|
+
const expected = `expected > ${value}n`;
|
|
1281
|
+
return bigintComparator(greaterThan, "s.bigint().greaterThan()", expected, value, options);
|
|
1282
|
+
}
|
|
1283
|
+
__name(bigintGreaterThan, "bigintGreaterThan");
|
|
1284
|
+
function bigintGreaterThanOrEqual(value, options) {
|
|
1285
|
+
const expected = `expected >= ${value}n`;
|
|
1286
|
+
return bigintComparator(greaterThanOrEqual, "s.bigint().greaterThanOrEqual()", expected, value, options);
|
|
1287
|
+
}
|
|
1288
|
+
__name(bigintGreaterThanOrEqual, "bigintGreaterThanOrEqual");
|
|
1289
|
+
function bigintEqual(value, options) {
|
|
1290
|
+
const expected = `expected === ${value}n`;
|
|
1291
|
+
return bigintComparator(equal, "s.bigint().equal()", expected, value, options);
|
|
1292
|
+
}
|
|
1293
|
+
__name(bigintEqual, "bigintEqual");
|
|
1294
|
+
function bigintNotEqual(value, options) {
|
|
1295
|
+
const expected = `expected !== ${value}n`;
|
|
1296
|
+
return bigintComparator(notEqual, "s.bigint().notEqual()", expected, value, options);
|
|
1297
|
+
}
|
|
1298
|
+
__name(bigintNotEqual, "bigintNotEqual");
|
|
1299
|
+
function bigintDivisibleBy(divider, options) {
|
|
1300
|
+
const expected = `expected % ${divider}n === 0n`;
|
|
1301
|
+
return {
|
|
1302
|
+
run(input) {
|
|
1303
|
+
return input % divider === 0n ? Result.ok(input) : Result.err(new ExpectedConstraintError("s.bigint().divisibleBy()", options?.message ?? "BigInt is not divisible", input, expected));
|
|
1304
|
+
}
|
|
1305
|
+
};
|
|
1306
|
+
}
|
|
1307
|
+
__name(bigintDivisibleBy, "bigintDivisibleBy");
|
|
1308
|
+
|
|
1309
|
+
// src/validators/BigIntValidator.ts
|
|
1310
|
+
var _BigIntValidator = class _BigIntValidator extends BaseValidator {
|
|
1311
|
+
lessThan(number, options = this.validatorOptions) {
|
|
1312
|
+
return this.addConstraint(bigintLessThan(number, options));
|
|
1313
|
+
}
|
|
1314
|
+
lessThanOrEqual(number, options = this.validatorOptions) {
|
|
1315
|
+
return this.addConstraint(bigintLessThanOrEqual(number, options));
|
|
1316
|
+
}
|
|
1317
|
+
greaterThan(number, options = this.validatorOptions) {
|
|
1318
|
+
return this.addConstraint(bigintGreaterThan(number, options));
|
|
1319
|
+
}
|
|
1320
|
+
greaterThanOrEqual(number, options = this.validatorOptions) {
|
|
1321
|
+
return this.addConstraint(bigintGreaterThanOrEqual(number, options));
|
|
1322
|
+
}
|
|
1323
|
+
equal(number, options = this.validatorOptions) {
|
|
1324
|
+
return this.addConstraint(bigintEqual(number, options));
|
|
1325
|
+
}
|
|
1326
|
+
notEqual(number, options = this.validatorOptions) {
|
|
1327
|
+
return this.addConstraint(bigintNotEqual(number, options));
|
|
1328
|
+
}
|
|
1329
|
+
positive(options = this.validatorOptions) {
|
|
1330
|
+
return this.greaterThanOrEqual(0n, options);
|
|
1331
|
+
}
|
|
1332
|
+
negative(options = this.validatorOptions) {
|
|
1333
|
+
return this.lessThan(0n, options);
|
|
1334
|
+
}
|
|
1335
|
+
divisibleBy(number, options = this.validatorOptions) {
|
|
1336
|
+
return this.addConstraint(bigintDivisibleBy(number, options));
|
|
1337
|
+
}
|
|
1338
|
+
abs(options = this.validatorOptions) {
|
|
1339
|
+
return this.transform((value) => value < 0 ? -value : value, options);
|
|
1340
|
+
}
|
|
1341
|
+
intN(bits, options = this.validatorOptions) {
|
|
1342
|
+
return this.transform((value) => BigInt.asIntN(bits, value), options);
|
|
1343
|
+
}
|
|
1344
|
+
uintN(bits, options = this.validatorOptions) {
|
|
1345
|
+
return this.transform((value) => BigInt.asUintN(bits, value), options);
|
|
1346
|
+
}
|
|
1347
|
+
handle(value) {
|
|
1348
|
+
return typeof value === "bigint" ? Result.ok(value) : Result.err(new ValidationError("s.bigint()", this.validatorOptions.message ?? "Expected a bigint primitive", value));
|
|
1349
|
+
}
|
|
1350
|
+
};
|
|
1351
|
+
__name(_BigIntValidator, "BigIntValidator");
|
|
1352
|
+
var BigIntValidator = _BigIntValidator;
|
|
1353
|
+
|
|
1354
|
+
// src/constraints/BooleanConstraints.ts
|
|
1355
|
+
function booleanTrue(options) {
|
|
1356
|
+
return {
|
|
1357
|
+
run(input) {
|
|
1358
|
+
return input ? Result.ok(input) : Result.err(new ExpectedConstraintError("s.boolean().true()", options?.message ?? "Invalid boolean value", input, "true"));
|
|
1359
|
+
}
|
|
1360
|
+
};
|
|
1361
|
+
}
|
|
1362
|
+
__name(booleanTrue, "booleanTrue");
|
|
1363
|
+
function booleanFalse(options) {
|
|
1364
|
+
return {
|
|
1365
|
+
run(input) {
|
|
1366
|
+
return input ? Result.err(new ExpectedConstraintError("s.boolean().false()", options?.message ?? "Invalid boolean value", input, "false")) : Result.ok(input);
|
|
1367
|
+
}
|
|
1368
|
+
};
|
|
1369
|
+
}
|
|
1370
|
+
__name(booleanFalse, "booleanFalse");
|
|
1371
|
+
|
|
1372
|
+
// src/validators/BooleanValidator.ts
|
|
1373
|
+
var _BooleanValidator = class _BooleanValidator extends BaseValidator {
|
|
1374
|
+
true(options = this.validatorOptions) {
|
|
1375
|
+
return this.addConstraint(booleanTrue(options));
|
|
1376
|
+
}
|
|
1377
|
+
false(options = this.validatorOptions) {
|
|
1378
|
+
return this.addConstraint(booleanFalse(options));
|
|
1379
|
+
}
|
|
1380
|
+
equal(value, options = this.validatorOptions) {
|
|
1381
|
+
return value ? this.true(options) : this.false(options);
|
|
1382
|
+
}
|
|
1383
|
+
notEqual(value, options = this.validatorOptions) {
|
|
1384
|
+
return value ? this.false(options) : this.true(options);
|
|
1385
|
+
}
|
|
1386
|
+
handle(value) {
|
|
1387
|
+
return typeof value === "boolean" ? Result.ok(value) : Result.err(new ValidationError("s.boolean()", this.validatorOptions.message ?? "Expected a boolean primitive", value));
|
|
1388
|
+
}
|
|
1389
|
+
};
|
|
1390
|
+
__name(_BooleanValidator, "BooleanValidator");
|
|
1391
|
+
var BooleanValidator = _BooleanValidator;
|
|
1392
|
+
|
|
1393
|
+
// src/constraints/DateConstraints.ts
|
|
1394
|
+
function dateComparator(comparator, name, expected, number, options) {
|
|
1395
|
+
return {
|
|
1396
|
+
run(input) {
|
|
1397
|
+
return comparator(input.getTime(), number) ? Result.ok(input) : Result.err(new ExpectedConstraintError(name, options?.message ?? "Invalid Date value", input, expected));
|
|
1398
|
+
}
|
|
1399
|
+
};
|
|
1400
|
+
}
|
|
1401
|
+
__name(dateComparator, "dateComparator");
|
|
1402
|
+
function dateLessThan(value, options) {
|
|
1403
|
+
const expected = `expected < ${value.toISOString()}`;
|
|
1404
|
+
return dateComparator(lessThan, "s.date().lessThan()", expected, value.getTime(), options);
|
|
1405
|
+
}
|
|
1406
|
+
__name(dateLessThan, "dateLessThan");
|
|
1407
|
+
function dateLessThanOrEqual(value, options) {
|
|
1408
|
+
const expected = `expected <= ${value.toISOString()}`;
|
|
1409
|
+
return dateComparator(lessThanOrEqual, "s.date().lessThanOrEqual()", expected, value.getTime(), options);
|
|
1410
|
+
}
|
|
1411
|
+
__name(dateLessThanOrEqual, "dateLessThanOrEqual");
|
|
1412
|
+
function dateGreaterThan(value, options) {
|
|
1413
|
+
const expected = `expected > ${value.toISOString()}`;
|
|
1414
|
+
return dateComparator(greaterThan, "s.date().greaterThan()", expected, value.getTime(), options);
|
|
1415
|
+
}
|
|
1416
|
+
__name(dateGreaterThan, "dateGreaterThan");
|
|
1417
|
+
function dateGreaterThanOrEqual(value, options) {
|
|
1418
|
+
const expected = `expected >= ${value.toISOString()}`;
|
|
1419
|
+
return dateComparator(greaterThanOrEqual, "s.date().greaterThanOrEqual()", expected, value.getTime(), options);
|
|
1420
|
+
}
|
|
1421
|
+
__name(dateGreaterThanOrEqual, "dateGreaterThanOrEqual");
|
|
1422
|
+
function dateEqual(value, options) {
|
|
1423
|
+
const expected = `expected === ${value.toISOString()}`;
|
|
1424
|
+
return dateComparator(equal, "s.date().equal()", expected, value.getTime(), options);
|
|
1425
|
+
}
|
|
1426
|
+
__name(dateEqual, "dateEqual");
|
|
1427
|
+
function dateNotEqual(value, options) {
|
|
1428
|
+
const expected = `expected !== ${value.toISOString()}`;
|
|
1429
|
+
return dateComparator(notEqual, "s.date().notEqual()", expected, value.getTime(), options);
|
|
1430
|
+
}
|
|
1431
|
+
__name(dateNotEqual, "dateNotEqual");
|
|
1432
|
+
function dateInvalid(options) {
|
|
1433
|
+
return {
|
|
1434
|
+
run(input) {
|
|
1435
|
+
return Number.isNaN(input.getTime()) ? Result.ok(input) : Result.err(new ExpectedConstraintError("s.date().invalid()", options?.message ?? "Invalid Date value", input, "expected === NaN"));
|
|
1436
|
+
}
|
|
1437
|
+
};
|
|
1438
|
+
}
|
|
1439
|
+
__name(dateInvalid, "dateInvalid");
|
|
1440
|
+
function dateValid(options) {
|
|
1441
|
+
return {
|
|
1442
|
+
run(input) {
|
|
1443
|
+
return Number.isNaN(input.getTime()) ? Result.err(new ExpectedConstraintError("s.date().valid()", options?.message ?? "Invalid Date value", input, "expected !== NaN")) : Result.ok(input);
|
|
1444
|
+
}
|
|
1445
|
+
};
|
|
1446
|
+
}
|
|
1447
|
+
__name(dateValid, "dateValid");
|
|
1448
|
+
|
|
1449
|
+
// src/validators/DateValidator.ts
|
|
1450
|
+
var _DateValidator = class _DateValidator extends BaseValidator {
|
|
1451
|
+
lessThan(date, options = this.validatorOptions) {
|
|
1452
|
+
return this.addConstraint(dateLessThan(new Date(date), options));
|
|
1453
|
+
}
|
|
1454
|
+
lessThanOrEqual(date, options = this.validatorOptions) {
|
|
1455
|
+
return this.addConstraint(dateLessThanOrEqual(new Date(date), options));
|
|
1456
|
+
}
|
|
1457
|
+
greaterThan(date, options = this.validatorOptions) {
|
|
1458
|
+
return this.addConstraint(dateGreaterThan(new Date(date), options));
|
|
1459
|
+
}
|
|
1460
|
+
greaterThanOrEqual(date, options = this.validatorOptions) {
|
|
1461
|
+
return this.addConstraint(dateGreaterThanOrEqual(new Date(date), options));
|
|
1462
|
+
}
|
|
1463
|
+
equal(date, options = this.validatorOptions) {
|
|
1464
|
+
const resolved = new Date(date);
|
|
1465
|
+
return Number.isNaN(resolved.getTime()) ? this.invalid(options) : this.addConstraint(dateEqual(resolved, options));
|
|
1466
|
+
}
|
|
1467
|
+
notEqual(date, options = this.validatorOptions) {
|
|
1468
|
+
const resolved = new Date(date);
|
|
1469
|
+
return Number.isNaN(resolved.getTime()) ? this.valid(options) : this.addConstraint(dateNotEqual(resolved, options));
|
|
1470
|
+
}
|
|
1471
|
+
valid(options = this.validatorOptions) {
|
|
1472
|
+
return this.addConstraint(dateValid(options));
|
|
1473
|
+
}
|
|
1474
|
+
invalid(options = this.validatorOptions) {
|
|
1475
|
+
return this.addConstraint(dateInvalid(options));
|
|
1476
|
+
}
|
|
1477
|
+
handle(value) {
|
|
1478
|
+
return value instanceof Date ? Result.ok(value) : Result.err(new ValidationError("s.date()", this.validatorOptions.message ?? "Expected a Date", value));
|
|
1479
|
+
}
|
|
1480
|
+
};
|
|
1481
|
+
__name(_DateValidator, "DateValidator");
|
|
1482
|
+
var DateValidator = _DateValidator;
|
|
1483
|
+
|
|
1484
|
+
// src/lib/errors/ExpectedValidationError.ts
|
|
1485
|
+
var _ExpectedValidationError = class _ExpectedValidationError extends ValidationError {
|
|
1486
|
+
constructor(validator, message, given, expected) {
|
|
1487
|
+
super(validator, message, given);
|
|
1488
|
+
this.expected = expected;
|
|
1489
|
+
}
|
|
1490
|
+
toJSON() {
|
|
1491
|
+
return {
|
|
1492
|
+
name: this.name,
|
|
1493
|
+
validator: this.validator,
|
|
1494
|
+
given: this.given,
|
|
1495
|
+
expected: this.expected,
|
|
1496
|
+
message: this.message
|
|
1497
|
+
};
|
|
1498
|
+
}
|
|
1499
|
+
[customInspectSymbolStackLess](depth, options) {
|
|
1500
|
+
const validator = options.stylize(this.validator, "string");
|
|
1501
|
+
if (depth < 0) {
|
|
1502
|
+
return options.stylize(`[ExpectedValidationError: ${validator}]`, "special");
|
|
1503
|
+
}
|
|
1504
|
+
const newOptions = { ...options, depth: options.depth === null ? null : options.depth - 1 };
|
|
1505
|
+
const padding = `
|
|
1506
|
+
${options.stylize("|", "undefined")} `;
|
|
1507
|
+
const expected = inspect2(this.expected, newOptions).replace(/\n/g, padding);
|
|
1508
|
+
const given = inspect2(this.given, newOptions).replace(/\n/g, padding);
|
|
1509
|
+
const header = `${options.stylize("ExpectedValidationError", "special")} > ${validator}`;
|
|
1510
|
+
const message = options.stylize(this.message, "regexp");
|
|
1511
|
+
const expectedBlock = `
|
|
1512
|
+
${options.stylize("Expected:", "string")}${padding}${expected}`;
|
|
1513
|
+
const givenBlock = `
|
|
1514
|
+
${options.stylize("Received:", "regexp")}${padding}${given}`;
|
|
1515
|
+
return `${header}
|
|
1516
|
+
${message}
|
|
1517
|
+
${expectedBlock}
|
|
1518
|
+
${givenBlock}`;
|
|
1519
|
+
}
|
|
1520
|
+
};
|
|
1521
|
+
__name(_ExpectedValidationError, "ExpectedValidationError");
|
|
1522
|
+
var ExpectedValidationError = _ExpectedValidationError;
|
|
1523
|
+
|
|
1524
|
+
// src/validators/InstanceValidator.ts
|
|
1525
|
+
var _InstanceValidator = class _InstanceValidator extends BaseValidator {
|
|
1526
|
+
constructor(expected, validatorOptions = {}, constraints = []) {
|
|
1527
|
+
super(validatorOptions, constraints);
|
|
1528
|
+
this.expected = expected;
|
|
1529
|
+
}
|
|
1530
|
+
handle(value) {
|
|
1531
|
+
return value instanceof this.expected ? Result.ok(value) : Result.err(new ExpectedValidationError("s.instance(V)", this.validatorOptions.message ?? "Expected", value, this.expected));
|
|
1532
|
+
}
|
|
1533
|
+
clone() {
|
|
1534
|
+
return Reflect.construct(this.constructor, [this.expected, this.validatorOptions, this.constraints]);
|
|
1535
|
+
}
|
|
1536
|
+
};
|
|
1537
|
+
__name(_InstanceValidator, "InstanceValidator");
|
|
1538
|
+
var InstanceValidator = _InstanceValidator;
|
|
1539
|
+
|
|
1540
|
+
// src/validators/LiteralValidator.ts
|
|
1541
|
+
var _LiteralValidator = class _LiteralValidator extends BaseValidator {
|
|
1542
|
+
constructor(literal, validatorOptions = {}, constraints = []) {
|
|
1543
|
+
super(validatorOptions, constraints);
|
|
1544
|
+
this.expected = literal;
|
|
1545
|
+
}
|
|
1546
|
+
handle(value) {
|
|
1547
|
+
return Object.is(value, this.expected) ? Result.ok(value) : Result.err(
|
|
1548
|
+
new ExpectedValidationError("s.literal(V)", this.validatorOptions.message ?? "Expected values to be equals", value, this.expected)
|
|
1549
|
+
);
|
|
1550
|
+
}
|
|
1551
|
+
clone() {
|
|
1552
|
+
return Reflect.construct(this.constructor, [this.expected, this.validatorOptions, this.constraints]);
|
|
1553
|
+
}
|
|
1554
|
+
};
|
|
1555
|
+
__name(_LiteralValidator, "LiteralValidator");
|
|
1556
|
+
var LiteralValidator = _LiteralValidator;
|
|
1557
|
+
|
|
1558
|
+
// src/validators/NeverValidator.ts
|
|
1559
|
+
var _NeverValidator = class _NeverValidator extends BaseValidator {
|
|
1560
|
+
handle(value) {
|
|
1561
|
+
return Result.err(new ValidationError("s.never()", this.validatorOptions.message ?? "Expected a value to not be passed", value));
|
|
1562
|
+
}
|
|
1563
|
+
};
|
|
1564
|
+
__name(_NeverValidator, "NeverValidator");
|
|
1565
|
+
var NeverValidator = _NeverValidator;
|
|
1566
|
+
|
|
1567
|
+
// src/validators/NullishValidator.ts
|
|
1568
|
+
var _NullishValidator = class _NullishValidator extends BaseValidator {
|
|
1569
|
+
handle(value) {
|
|
1570
|
+
return value === void 0 || value === null ? Result.ok(value) : Result.err(new ValidationError("s.nullish()", this.validatorOptions.message ?? "Expected undefined or null", value));
|
|
1571
|
+
}
|
|
1572
|
+
};
|
|
1573
|
+
__name(_NullishValidator, "NullishValidator");
|
|
1574
|
+
var NullishValidator = _NullishValidator;
|
|
1575
|
+
|
|
1576
|
+
// src/constraints/NumberConstraints.ts
|
|
1577
|
+
function numberComparator(comparator, name, expected, number, options) {
|
|
1578
|
+
return {
|
|
1579
|
+
run(input) {
|
|
1580
|
+
return comparator(input, number) ? Result.ok(input) : Result.err(new ExpectedConstraintError(name, options?.message ?? "Invalid number value", input, expected));
|
|
1581
|
+
}
|
|
1582
|
+
};
|
|
1583
|
+
}
|
|
1584
|
+
__name(numberComparator, "numberComparator");
|
|
1585
|
+
function numberLessThan(value, options) {
|
|
1586
|
+
const expected = `expected < ${value}`;
|
|
1587
|
+
return numberComparator(lessThan, "s.number().lessThan()", expected, value, options);
|
|
1588
|
+
}
|
|
1589
|
+
__name(numberLessThan, "numberLessThan");
|
|
1590
|
+
function numberLessThanOrEqual(value, options) {
|
|
1591
|
+
const expected = `expected <= ${value}`;
|
|
1592
|
+
return numberComparator(lessThanOrEqual, "s.number().lessThanOrEqual()", expected, value, options);
|
|
1593
|
+
}
|
|
1594
|
+
__name(numberLessThanOrEqual, "numberLessThanOrEqual");
|
|
1595
|
+
function numberGreaterThan(value, options) {
|
|
1596
|
+
const expected = `expected > ${value}`;
|
|
1597
|
+
return numberComparator(greaterThan, "s.number().greaterThan()", expected, value, options);
|
|
1598
|
+
}
|
|
1599
|
+
__name(numberGreaterThan, "numberGreaterThan");
|
|
1600
|
+
function numberGreaterThanOrEqual(value, options) {
|
|
1601
|
+
const expected = `expected >= ${value}`;
|
|
1602
|
+
return numberComparator(greaterThanOrEqual, "s.number().greaterThanOrEqual()", expected, value, options);
|
|
1603
|
+
}
|
|
1604
|
+
__name(numberGreaterThanOrEqual, "numberGreaterThanOrEqual");
|
|
1605
|
+
function numberEqual(value, options) {
|
|
1606
|
+
const expected = `expected === ${value}`;
|
|
1607
|
+
return numberComparator(equal, "s.number().equal()", expected, value, options);
|
|
1608
|
+
}
|
|
1609
|
+
__name(numberEqual, "numberEqual");
|
|
1610
|
+
function numberNotEqual(value, options) {
|
|
1611
|
+
const expected = `expected !== ${value}`;
|
|
1612
|
+
return numberComparator(notEqual, "s.number().notEqual()", expected, value, options);
|
|
1613
|
+
}
|
|
1614
|
+
__name(numberNotEqual, "numberNotEqual");
|
|
1615
|
+
function numberInt(options) {
|
|
1616
|
+
return {
|
|
1617
|
+
run(input) {
|
|
1618
|
+
return Number.isInteger(input) ? Result.ok(input) : Result.err(
|
|
1619
|
+
new ExpectedConstraintError(
|
|
1620
|
+
"s.number().int()",
|
|
1621
|
+
options?.message ?? "Given value is not an integer",
|
|
1622
|
+
input,
|
|
1623
|
+
"Number.isInteger(expected) to be true"
|
|
1624
|
+
)
|
|
1625
|
+
);
|
|
1626
|
+
}
|
|
1627
|
+
};
|
|
1628
|
+
}
|
|
1629
|
+
__name(numberInt, "numberInt");
|
|
1630
|
+
function numberSafeInt(options) {
|
|
1631
|
+
return {
|
|
1632
|
+
run(input) {
|
|
1633
|
+
return Number.isSafeInteger(input) ? Result.ok(input) : Result.err(
|
|
1634
|
+
new ExpectedConstraintError(
|
|
1635
|
+
"s.number().safeInt()",
|
|
1636
|
+
options?.message ?? "Given value is not a safe integer",
|
|
1637
|
+
input,
|
|
1638
|
+
"Number.isSafeInteger(expected) to be true"
|
|
1639
|
+
)
|
|
1640
|
+
);
|
|
1641
|
+
}
|
|
1642
|
+
};
|
|
1643
|
+
}
|
|
1644
|
+
__name(numberSafeInt, "numberSafeInt");
|
|
1645
|
+
function numberFinite(options) {
|
|
1646
|
+
return {
|
|
1647
|
+
run(input) {
|
|
1648
|
+
return Number.isFinite(input) ? Result.ok(input) : Result.err(
|
|
1649
|
+
new ExpectedConstraintError(
|
|
1650
|
+
"s.number().finite()",
|
|
1651
|
+
options?.message ?? "Given value is not finite",
|
|
1652
|
+
input,
|
|
1653
|
+
"Number.isFinite(expected) to be true"
|
|
1654
|
+
)
|
|
1655
|
+
);
|
|
1656
|
+
}
|
|
1657
|
+
};
|
|
1658
|
+
}
|
|
1659
|
+
__name(numberFinite, "numberFinite");
|
|
1660
|
+
function numberNaN(options) {
|
|
1661
|
+
return {
|
|
1662
|
+
run(input) {
|
|
1663
|
+
return Number.isNaN(input) ? Result.ok(input) : Result.err(
|
|
1664
|
+
new ExpectedConstraintError("s.number().equal(NaN)", options?.message ?? "Invalid number value", input, "expected === NaN")
|
|
1665
|
+
);
|
|
1666
|
+
}
|
|
1667
|
+
};
|
|
1668
|
+
}
|
|
1669
|
+
__name(numberNaN, "numberNaN");
|
|
1670
|
+
function numberNotNaN(options) {
|
|
1671
|
+
return {
|
|
1672
|
+
run(input) {
|
|
1673
|
+
return Number.isNaN(input) ? Result.err(
|
|
1674
|
+
new ExpectedConstraintError("s.number().notEqual(NaN)", options?.message ?? "Invalid number value", input, "expected !== NaN")
|
|
1675
|
+
) : Result.ok(input);
|
|
1676
|
+
}
|
|
1677
|
+
};
|
|
1678
|
+
}
|
|
1679
|
+
__name(numberNotNaN, "numberNotNaN");
|
|
1680
|
+
function numberDivisibleBy(divider, options) {
|
|
1681
|
+
const expected = `expected % ${divider} === 0`;
|
|
1682
|
+
return {
|
|
1683
|
+
run(input) {
|
|
1684
|
+
return input % divider === 0 ? Result.ok(input) : Result.err(new ExpectedConstraintError("s.number().divisibleBy()", options?.message ?? "Number is not divisible", input, expected));
|
|
1685
|
+
}
|
|
1686
|
+
};
|
|
1687
|
+
}
|
|
1688
|
+
__name(numberDivisibleBy, "numberDivisibleBy");
|
|
1689
|
+
|
|
1690
|
+
// src/validators/NumberValidator.ts
|
|
1691
|
+
var _NumberValidator = class _NumberValidator extends BaseValidator {
|
|
1692
|
+
lessThan(number, options = this.validatorOptions) {
|
|
1693
|
+
return this.addConstraint(numberLessThan(number, options));
|
|
1694
|
+
}
|
|
1695
|
+
lessThanOrEqual(number, options = this.validatorOptions) {
|
|
1696
|
+
return this.addConstraint(numberLessThanOrEqual(number, options));
|
|
1697
|
+
}
|
|
1698
|
+
greaterThan(number, options = this.validatorOptions) {
|
|
1699
|
+
return this.addConstraint(numberGreaterThan(number, options));
|
|
1700
|
+
}
|
|
1701
|
+
greaterThanOrEqual(number, options = this.validatorOptions) {
|
|
1702
|
+
return this.addConstraint(numberGreaterThanOrEqual(number, options));
|
|
1703
|
+
}
|
|
1704
|
+
equal(number, options = this.validatorOptions) {
|
|
1705
|
+
return Number.isNaN(number) ? this.addConstraint(numberNaN(options)) : this.addConstraint(numberEqual(number, options));
|
|
1706
|
+
}
|
|
1707
|
+
notEqual(number, options = this.validatorOptions) {
|
|
1708
|
+
return Number.isNaN(number) ? this.addConstraint(numberNotNaN(options)) : this.addConstraint(numberNotEqual(number, options));
|
|
1709
|
+
}
|
|
1710
|
+
int(options = this.validatorOptions) {
|
|
1711
|
+
return this.addConstraint(numberInt(options));
|
|
1712
|
+
}
|
|
1713
|
+
safeInt(options = this.validatorOptions) {
|
|
1714
|
+
return this.addConstraint(numberSafeInt(options));
|
|
1715
|
+
}
|
|
1716
|
+
finite(options = this.validatorOptions) {
|
|
1717
|
+
return this.addConstraint(numberFinite(options));
|
|
1718
|
+
}
|
|
1719
|
+
positive(options = this.validatorOptions) {
|
|
1720
|
+
return this.greaterThanOrEqual(0, options);
|
|
1721
|
+
}
|
|
1722
|
+
negative(options = this.validatorOptions) {
|
|
1723
|
+
return this.lessThan(0, options);
|
|
1724
|
+
}
|
|
1725
|
+
divisibleBy(divider, options = this.validatorOptions) {
|
|
1726
|
+
return this.addConstraint(numberDivisibleBy(divider, options));
|
|
1727
|
+
}
|
|
1728
|
+
abs(options = this.validatorOptions) {
|
|
1729
|
+
return this.transform(Math.abs, options);
|
|
1730
|
+
}
|
|
1731
|
+
sign(options = this.validatorOptions) {
|
|
1732
|
+
return this.transform(Math.sign, options);
|
|
1733
|
+
}
|
|
1734
|
+
trunc(options = this.validatorOptions) {
|
|
1735
|
+
return this.transform(Math.trunc, options);
|
|
1736
|
+
}
|
|
1737
|
+
floor(options = this.validatorOptions) {
|
|
1738
|
+
return this.transform(Math.floor, options);
|
|
1739
|
+
}
|
|
1740
|
+
fround(options = this.validatorOptions) {
|
|
1741
|
+
return this.transform(Math.fround, options);
|
|
1742
|
+
}
|
|
1743
|
+
round(options = this.validatorOptions) {
|
|
1744
|
+
return this.transform(Math.round, options);
|
|
1745
|
+
}
|
|
1746
|
+
ceil(options = this.validatorOptions) {
|
|
1747
|
+
return this.transform(Math.ceil, options);
|
|
1748
|
+
}
|
|
1749
|
+
handle(value) {
|
|
1750
|
+
return typeof value === "number" ? Result.ok(value) : Result.err(new ValidationError("s.number()", this.validatorOptions.message ?? "Expected a number primitive", value));
|
|
1751
|
+
}
|
|
1752
|
+
};
|
|
1753
|
+
__name(_NumberValidator, "NumberValidator");
|
|
1754
|
+
var NumberValidator = _NumberValidator;
|
|
1755
|
+
|
|
1756
|
+
// src/lib/errors/MissingPropertyError.ts
|
|
1757
|
+
var _MissingPropertyError = class _MissingPropertyError extends BaseError {
|
|
1758
|
+
constructor(property, validatorOptions) {
|
|
1759
|
+
super(validatorOptions?.message ?? "A required property is missing");
|
|
1760
|
+
this.property = property;
|
|
1761
|
+
}
|
|
1762
|
+
toJSON() {
|
|
1763
|
+
return {
|
|
1764
|
+
name: this.name,
|
|
1765
|
+
message: this.message,
|
|
1766
|
+
property: this.property
|
|
1767
|
+
};
|
|
1768
|
+
}
|
|
1769
|
+
[customInspectSymbolStackLess](depth, options) {
|
|
1770
|
+
const property = options.stylize(this.property.toString(), "string");
|
|
1771
|
+
if (depth < 0) {
|
|
1772
|
+
return options.stylize(`[MissingPropertyError: ${property}]`, "special");
|
|
1773
|
+
}
|
|
1774
|
+
const header = `${options.stylize("MissingPropertyError", "special")} > ${property}`;
|
|
1775
|
+
const message = options.stylize(this.message, "regexp");
|
|
1776
|
+
return `${header}
|
|
1777
|
+
${message}`;
|
|
1778
|
+
}
|
|
1779
|
+
};
|
|
1780
|
+
__name(_MissingPropertyError, "MissingPropertyError");
|
|
1781
|
+
var MissingPropertyError = _MissingPropertyError;
|
|
1782
|
+
|
|
1783
|
+
// src/lib/errors/UnknownPropertyError.ts
|
|
1784
|
+
var _UnknownPropertyError = class _UnknownPropertyError extends BaseError {
|
|
1785
|
+
constructor(property, value, options) {
|
|
1786
|
+
super(options?.message ?? "Received unexpected property");
|
|
1787
|
+
this.property = property;
|
|
1788
|
+
this.value = value;
|
|
1789
|
+
}
|
|
1790
|
+
toJSON() {
|
|
1791
|
+
return {
|
|
1792
|
+
name: this.name,
|
|
1793
|
+
message: this.message,
|
|
1794
|
+
property: this.property,
|
|
1795
|
+
value: this.value
|
|
1796
|
+
};
|
|
1797
|
+
}
|
|
1798
|
+
[customInspectSymbolStackLess](depth, options) {
|
|
1799
|
+
const property = options.stylize(this.property.toString(), "string");
|
|
1800
|
+
if (depth < 0) {
|
|
1801
|
+
return options.stylize(`[UnknownPropertyError: ${property}]`, "special");
|
|
1802
|
+
}
|
|
1803
|
+
const newOptions = { ...options, depth: options.depth === null ? null : options.depth - 1, compact: true };
|
|
1804
|
+
const padding = `
|
|
1805
|
+
${options.stylize("|", "undefined")} `;
|
|
1806
|
+
const given = inspect2(this.value, newOptions).replace(/\n/g, padding);
|
|
1807
|
+
const header = `${options.stylize("UnknownPropertyError", "special")} > ${property}`;
|
|
1808
|
+
const message = options.stylize(this.message, "regexp");
|
|
1809
|
+
const givenBlock = `
|
|
1810
|
+
${options.stylize("Received:", "regexp")}${padding}${given}`;
|
|
1811
|
+
return `${header}
|
|
1812
|
+
${message}
|
|
1813
|
+
${givenBlock}`;
|
|
1814
|
+
}
|
|
1815
|
+
};
|
|
1816
|
+
__name(_UnknownPropertyError, "UnknownPropertyError");
|
|
1817
|
+
var UnknownPropertyError = _UnknownPropertyError;
|
|
1818
|
+
|
|
1819
|
+
// src/validators/DefaultValidator.ts
|
|
1820
|
+
var _DefaultValidator = class _DefaultValidator extends BaseValidator {
|
|
1821
|
+
constructor(validator, value, validatorOptions = {}, constraints = []) {
|
|
1822
|
+
super(validatorOptions, constraints);
|
|
1823
|
+
this.validator = validator;
|
|
1824
|
+
this.defaultValue = value;
|
|
1825
|
+
}
|
|
1826
|
+
default(value, options = this.validatorOptions) {
|
|
1827
|
+
const clone = this.clone();
|
|
1828
|
+
clone.validatorOptions = options;
|
|
1829
|
+
clone.defaultValue = value;
|
|
1830
|
+
return clone;
|
|
1831
|
+
}
|
|
1832
|
+
handle(value) {
|
|
1833
|
+
return typeof value === "undefined" ? Result.ok(getValue(this.defaultValue)) : this.validator["handle"](value);
|
|
1834
|
+
}
|
|
1835
|
+
clone() {
|
|
1836
|
+
return Reflect.construct(this.constructor, [this.validator, this.defaultValue, this.validatorOptions, this.constraints]);
|
|
1837
|
+
}
|
|
1838
|
+
};
|
|
1839
|
+
__name(_DefaultValidator, "DefaultValidator");
|
|
1840
|
+
var DefaultValidator = _DefaultValidator;
|
|
1841
|
+
|
|
1842
|
+
// src/lib/errors/CombinedError.ts
|
|
1843
|
+
var _CombinedError = class _CombinedError extends BaseError {
|
|
1844
|
+
constructor(errors, validatorOptions) {
|
|
1845
|
+
super(validatorOptions?.message ?? "Received one or more errors");
|
|
1846
|
+
this.errors = errors;
|
|
1847
|
+
}
|
|
1848
|
+
[customInspectSymbolStackLess](depth, options) {
|
|
1849
|
+
if (depth < 0) {
|
|
1850
|
+
return options.stylize("[CombinedError]", "special");
|
|
1851
|
+
}
|
|
1852
|
+
const newOptions = { ...options, depth: options.depth === null ? null : options.depth - 1, compact: true };
|
|
1853
|
+
const padding = `
|
|
1854
|
+
${options.stylize("|", "undefined")} `;
|
|
1855
|
+
const header = `${options.stylize("CombinedError", "special")} (${options.stylize(this.errors.length.toString(), "number")})`;
|
|
1856
|
+
const message = options.stylize(this.message, "regexp");
|
|
1857
|
+
const errors = this.errors.map((error, i3) => {
|
|
1858
|
+
const index = options.stylize((i3 + 1).toString(), "number");
|
|
1859
|
+
const body = error[customInspectSymbolStackLess](depth - 1, newOptions).replace(/\n/g, padding);
|
|
1860
|
+
return ` ${index} ${body}`;
|
|
1861
|
+
}).join("\n\n");
|
|
1862
|
+
return `${header}
|
|
1863
|
+
${message}
|
|
1864
|
+
|
|
1865
|
+
${errors}`;
|
|
1866
|
+
}
|
|
1867
|
+
};
|
|
1868
|
+
__name(_CombinedError, "CombinedError");
|
|
1869
|
+
var CombinedError = _CombinedError;
|
|
1870
|
+
|
|
1871
|
+
// src/validators/UnionValidator.ts
|
|
1872
|
+
var _UnionValidator = class _UnionValidator extends BaseValidator {
|
|
1873
|
+
constructor(validators, validatorOptions, constraints = []) {
|
|
1874
|
+
super(validatorOptions, constraints);
|
|
1875
|
+
this.validators = validators;
|
|
1876
|
+
}
|
|
1877
|
+
optional(options = this.validatorOptions) {
|
|
1878
|
+
if (this.validators.length === 0)
|
|
1879
|
+
return new _UnionValidator([new LiteralValidator(void 0, options)], this.validatorOptions, this.constraints);
|
|
1880
|
+
const [validator] = this.validators;
|
|
1881
|
+
if (validator instanceof LiteralValidator) {
|
|
1882
|
+
if (validator.expected === void 0)
|
|
1883
|
+
return this.clone();
|
|
1884
|
+
if (validator.expected === null) {
|
|
1885
|
+
return new _UnionValidator(
|
|
1886
|
+
[new NullishValidator(options), ...this.validators.slice(1)],
|
|
1887
|
+
this.validatorOptions,
|
|
1888
|
+
this.constraints
|
|
1889
|
+
);
|
|
1890
|
+
}
|
|
1891
|
+
} else if (validator instanceof NullishValidator) {
|
|
1892
|
+
return this.clone();
|
|
1893
|
+
}
|
|
1894
|
+
return new _UnionValidator([new LiteralValidator(void 0, options), ...this.validators], this.validatorOptions);
|
|
1895
|
+
}
|
|
1896
|
+
required(options = this.validatorOptions) {
|
|
1897
|
+
if (this.validators.length === 0)
|
|
1898
|
+
return this.clone();
|
|
1899
|
+
const [validator] = this.validators;
|
|
1900
|
+
if (validator instanceof LiteralValidator) {
|
|
1901
|
+
if (validator.expected === void 0) {
|
|
1902
|
+
return new _UnionValidator(this.validators.slice(1), this.validatorOptions, this.constraints);
|
|
1903
|
+
}
|
|
1904
|
+
} else if (validator instanceof NullishValidator) {
|
|
1905
|
+
return new _UnionValidator(
|
|
1906
|
+
[new LiteralValidator(null, options), ...this.validators.slice(1)],
|
|
1907
|
+
this.validatorOptions,
|
|
1908
|
+
this.constraints
|
|
1909
|
+
);
|
|
1910
|
+
}
|
|
1911
|
+
return this.clone();
|
|
1912
|
+
}
|
|
1913
|
+
nullable(options = this.validatorOptions) {
|
|
1914
|
+
if (this.validators.length === 0) {
|
|
1915
|
+
return new _UnionValidator([new LiteralValidator(null, options)], this.validatorOptions, this.constraints);
|
|
1916
|
+
}
|
|
1917
|
+
const [validator] = this.validators;
|
|
1918
|
+
if (validator instanceof LiteralValidator) {
|
|
1919
|
+
if (validator.expected === null)
|
|
1920
|
+
return this.clone();
|
|
1921
|
+
if (validator.expected === void 0) {
|
|
1922
|
+
return new _UnionValidator(
|
|
1923
|
+
[new NullishValidator(options), ...this.validators.slice(1)],
|
|
1924
|
+
this.validatorOptions,
|
|
1925
|
+
this.constraints
|
|
1926
|
+
);
|
|
1927
|
+
}
|
|
1928
|
+
} else if (validator instanceof NullishValidator) {
|
|
1929
|
+
return this.clone();
|
|
1930
|
+
}
|
|
1931
|
+
return new _UnionValidator([new LiteralValidator(null, options), ...this.validators], this.validatorOptions);
|
|
1932
|
+
}
|
|
1933
|
+
nullish(options = this.validatorOptions) {
|
|
1934
|
+
if (this.validators.length === 0) {
|
|
1935
|
+
return new _UnionValidator([new NullishValidator(options)], options, this.constraints);
|
|
1936
|
+
}
|
|
1937
|
+
const [validator] = this.validators;
|
|
1938
|
+
if (validator instanceof LiteralValidator) {
|
|
1939
|
+
if (validator.expected === null || validator.expected === void 0) {
|
|
1940
|
+
return new _UnionValidator(
|
|
1941
|
+
[new NullishValidator(options), ...this.validators.slice(1)],
|
|
1942
|
+
options,
|
|
1943
|
+
this.constraints
|
|
1944
|
+
);
|
|
1945
|
+
}
|
|
1946
|
+
} else if (validator instanceof NullishValidator) {
|
|
1947
|
+
return this.clone();
|
|
1948
|
+
}
|
|
1949
|
+
return new _UnionValidator([new NullishValidator(options), ...this.validators], options);
|
|
1950
|
+
}
|
|
1951
|
+
or(...predicates) {
|
|
1952
|
+
return new _UnionValidator([...this.validators, ...predicates], this.validatorOptions);
|
|
1953
|
+
}
|
|
1954
|
+
clone() {
|
|
1955
|
+
return Reflect.construct(this.constructor, [this.validators, this.validatorOptions, this.constraints]);
|
|
1956
|
+
}
|
|
1957
|
+
handle(value) {
|
|
1958
|
+
const errors = [];
|
|
1959
|
+
for (const validator of this.validators) {
|
|
1960
|
+
const result = validator.run(value);
|
|
1961
|
+
if (result.isOk())
|
|
1962
|
+
return result;
|
|
1963
|
+
errors.push(result.error);
|
|
1964
|
+
}
|
|
1965
|
+
return Result.err(new CombinedError(errors, this.validatorOptions));
|
|
1966
|
+
}
|
|
1967
|
+
};
|
|
1968
|
+
__name(_UnionValidator, "UnionValidator");
|
|
1969
|
+
var UnionValidator = _UnionValidator;
|
|
1970
|
+
|
|
1971
|
+
// src/validators/ObjectValidator.ts
|
|
1972
|
+
var _ObjectValidator = class _ObjectValidator extends BaseValidator {
|
|
1973
|
+
constructor(shape, strategy = 0 /* Ignore */, validatorOptions = {}, constraints = []) {
|
|
1974
|
+
super(validatorOptions, constraints);
|
|
1975
|
+
this.keys = [];
|
|
1976
|
+
this.requiredKeys = /* @__PURE__ */ new Map();
|
|
1977
|
+
this.possiblyUndefinedKeys = /* @__PURE__ */ new Map();
|
|
1978
|
+
this.possiblyUndefinedKeysWithDefaults = /* @__PURE__ */ new Map();
|
|
1979
|
+
this.shape = shape;
|
|
1980
|
+
this.strategy = strategy;
|
|
1981
|
+
switch (this.strategy) {
|
|
1982
|
+
case 0 /* Ignore */:
|
|
1983
|
+
this.handleStrategy = (value) => this.handleIgnoreStrategy(value);
|
|
1984
|
+
break;
|
|
1985
|
+
case 1 /* Strict */: {
|
|
1986
|
+
this.handleStrategy = (value) => this.handleStrictStrategy(value);
|
|
1987
|
+
break;
|
|
1988
|
+
}
|
|
1989
|
+
case 2 /* Passthrough */:
|
|
1990
|
+
this.handleStrategy = (value) => this.handlePassthroughStrategy(value);
|
|
1991
|
+
break;
|
|
1992
|
+
}
|
|
1993
|
+
const shapeEntries = Object.entries(shape);
|
|
1994
|
+
this.keys = shapeEntries.map(([key]) => key);
|
|
1995
|
+
for (const [key, validator] of shapeEntries) {
|
|
1996
|
+
if (validator instanceof UnionValidator) {
|
|
1997
|
+
const [possiblyLiteralOrNullishPredicate] = validator["validators"];
|
|
1998
|
+
if (possiblyLiteralOrNullishPredicate instanceof NullishValidator) {
|
|
1999
|
+
this.possiblyUndefinedKeys.set(key, validator);
|
|
2000
|
+
} else if (possiblyLiteralOrNullishPredicate instanceof LiteralValidator) {
|
|
2001
|
+
if (possiblyLiteralOrNullishPredicate.expected === void 0) {
|
|
2002
|
+
this.possiblyUndefinedKeys.set(key, validator);
|
|
2003
|
+
} else {
|
|
2004
|
+
this.requiredKeys.set(key, validator);
|
|
2005
|
+
}
|
|
2006
|
+
} else if (validator instanceof DefaultValidator) {
|
|
2007
|
+
this.possiblyUndefinedKeysWithDefaults.set(key, validator);
|
|
2008
|
+
} else {
|
|
2009
|
+
this.requiredKeys.set(key, validator);
|
|
2010
|
+
}
|
|
2011
|
+
} else if (validator instanceof NullishValidator) {
|
|
2012
|
+
this.possiblyUndefinedKeys.set(key, validator);
|
|
2013
|
+
} else if (validator instanceof LiteralValidator) {
|
|
2014
|
+
if (validator.expected === void 0) {
|
|
2015
|
+
this.possiblyUndefinedKeys.set(key, validator);
|
|
2016
|
+
} else {
|
|
2017
|
+
this.requiredKeys.set(key, validator);
|
|
2018
|
+
}
|
|
2019
|
+
} else if (validator instanceof DefaultValidator) {
|
|
2020
|
+
this.possiblyUndefinedKeysWithDefaults.set(key, validator);
|
|
2021
|
+
} else {
|
|
2022
|
+
this.requiredKeys.set(key, validator);
|
|
2023
|
+
}
|
|
2024
|
+
}
|
|
2025
|
+
}
|
|
2026
|
+
strict(options = this.validatorOptions) {
|
|
2027
|
+
return Reflect.construct(this.constructor, [this.shape, 1 /* Strict */, options, this.constraints]);
|
|
2028
|
+
}
|
|
2029
|
+
ignore(options = this.validatorOptions) {
|
|
2030
|
+
return Reflect.construct(this.constructor, [this.shape, 0 /* Ignore */, options, this.constraints]);
|
|
2031
|
+
}
|
|
2032
|
+
passthrough(options = this.validatorOptions) {
|
|
2033
|
+
return Reflect.construct(this.constructor, [this.shape, 2 /* Passthrough */, options, this.constraints]);
|
|
2034
|
+
}
|
|
2035
|
+
partial(options = this.validatorOptions) {
|
|
2036
|
+
const shape = Object.fromEntries(this.keys.map((key) => [key, this.shape[key].optional(options)]));
|
|
2037
|
+
return Reflect.construct(this.constructor, [shape, this.strategy, options, this.constraints]);
|
|
2038
|
+
}
|
|
2039
|
+
required(options = this.validatorOptions) {
|
|
2040
|
+
const shape = Object.fromEntries(
|
|
2041
|
+
this.keys.map((key) => {
|
|
2042
|
+
let validator = this.shape[key];
|
|
2043
|
+
if (validator instanceof UnionValidator)
|
|
2044
|
+
validator = validator.required(options);
|
|
2045
|
+
return [key, validator];
|
|
2046
|
+
})
|
|
2047
|
+
);
|
|
2048
|
+
return Reflect.construct(this.constructor, [shape, this.strategy, options, this.constraints]);
|
|
2049
|
+
}
|
|
2050
|
+
extend(schema, options = this.validatorOptions) {
|
|
2051
|
+
const shape = { ...this.shape, ...schema instanceof _ObjectValidator ? schema.shape : schema };
|
|
2052
|
+
return Reflect.construct(this.constructor, [shape, this.strategy, options, this.constraints]);
|
|
2053
|
+
}
|
|
2054
|
+
pick(keys, options = this.validatorOptions) {
|
|
2055
|
+
const shape = Object.fromEntries(
|
|
2056
|
+
keys.filter((key) => this.keys.includes(key)).map((key) => [key, this.shape[key]])
|
|
2057
|
+
);
|
|
2058
|
+
return Reflect.construct(this.constructor, [shape, this.strategy, options, this.constraints]);
|
|
2059
|
+
}
|
|
2060
|
+
omit(keys, options = this.validatorOptions) {
|
|
2061
|
+
const shape = Object.fromEntries(
|
|
2062
|
+
this.keys.filter((key) => !keys.includes(key)).map((key) => [key, this.shape[key]])
|
|
2063
|
+
);
|
|
2064
|
+
return Reflect.construct(this.constructor, [shape, this.strategy, options, this.constraints]);
|
|
2065
|
+
}
|
|
2066
|
+
handle(value) {
|
|
2067
|
+
const typeOfValue = typeof value;
|
|
2068
|
+
if (typeOfValue !== "object") {
|
|
2069
|
+
return Result.err(
|
|
2070
|
+
new ValidationError(
|
|
2071
|
+
"s.object(T)",
|
|
2072
|
+
this.validatorOptions.message ?? `Expected the value to be an object, but received ${typeOfValue} instead`,
|
|
2073
|
+
value
|
|
2074
|
+
)
|
|
2075
|
+
);
|
|
2076
|
+
}
|
|
2077
|
+
if (value === null) {
|
|
2078
|
+
return Result.err(new ValidationError("s.object(T)", this.validatorOptions.message ?? "Expected the value to not be null", value));
|
|
2079
|
+
}
|
|
2080
|
+
if (Array.isArray(value)) {
|
|
2081
|
+
return Result.err(new ValidationError("s.object(T)", this.validatorOptions.message ?? "Expected the value to not be an array", value));
|
|
2082
|
+
}
|
|
2083
|
+
if (!this.shouldRunConstraints) {
|
|
2084
|
+
return Result.ok(value);
|
|
2085
|
+
}
|
|
2086
|
+
for (const predicate of Object.values(this.shape)) {
|
|
2087
|
+
predicate.setParent(this.parent ?? value);
|
|
2088
|
+
}
|
|
2089
|
+
return this.handleStrategy(value);
|
|
2090
|
+
}
|
|
2091
|
+
clone() {
|
|
2092
|
+
return Reflect.construct(this.constructor, [this.shape, this.strategy, this.validatorOptions, this.constraints]);
|
|
2093
|
+
}
|
|
2094
|
+
handleIgnoreStrategy(value) {
|
|
2095
|
+
const errors = [];
|
|
2096
|
+
const finalObject = {};
|
|
2097
|
+
const inputEntries = new Map(Object.entries(value));
|
|
2098
|
+
const runPredicate = /* @__PURE__ */ __name((key, predicate) => {
|
|
2099
|
+
const result = predicate.run(value[key]);
|
|
2100
|
+
if (result.isOk()) {
|
|
2101
|
+
finalObject[key] = result.value;
|
|
2102
|
+
} else {
|
|
2103
|
+
const error = result.error;
|
|
2104
|
+
errors.push([key, error]);
|
|
2105
|
+
}
|
|
2106
|
+
}, "runPredicate");
|
|
2107
|
+
for (const [key, predicate] of this.requiredKeys) {
|
|
2108
|
+
if (inputEntries.delete(key)) {
|
|
2109
|
+
runPredicate(key, predicate);
|
|
2110
|
+
} else {
|
|
2111
|
+
errors.push([key, new MissingPropertyError(key, this.validatorOptions)]);
|
|
2112
|
+
}
|
|
2113
|
+
}
|
|
2114
|
+
for (const [key, validator] of this.possiblyUndefinedKeysWithDefaults) {
|
|
2115
|
+
inputEntries.delete(key);
|
|
2116
|
+
runPredicate(key, validator);
|
|
2117
|
+
}
|
|
2118
|
+
if (inputEntries.size === 0) {
|
|
2119
|
+
return errors.length === 0 ? Result.ok(finalObject) : Result.err(new CombinedPropertyError(errors, this.validatorOptions));
|
|
2120
|
+
}
|
|
2121
|
+
const checkInputEntriesInsteadOfSchemaKeys = this.possiblyUndefinedKeys.size > inputEntries.size;
|
|
2122
|
+
if (checkInputEntriesInsteadOfSchemaKeys) {
|
|
2123
|
+
for (const [key] of inputEntries) {
|
|
2124
|
+
const predicate = this.possiblyUndefinedKeys.get(key);
|
|
2125
|
+
if (predicate) {
|
|
2126
|
+
runPredicate(key, predicate);
|
|
2127
|
+
}
|
|
2128
|
+
}
|
|
2129
|
+
} else {
|
|
2130
|
+
for (const [key, predicate] of this.possiblyUndefinedKeys) {
|
|
2131
|
+
if (inputEntries.delete(key)) {
|
|
2132
|
+
runPredicate(key, predicate);
|
|
2133
|
+
}
|
|
2134
|
+
}
|
|
2135
|
+
}
|
|
2136
|
+
return errors.length === 0 ? Result.ok(finalObject) : Result.err(new CombinedPropertyError(errors, this.validatorOptions));
|
|
2137
|
+
}
|
|
2138
|
+
handleStrictStrategy(value) {
|
|
2139
|
+
const errors = [];
|
|
2140
|
+
const finalResult = {};
|
|
2141
|
+
const inputEntries = new Map(Object.entries(value));
|
|
2142
|
+
const runPredicate = /* @__PURE__ */ __name((key, predicate) => {
|
|
2143
|
+
const result = predicate.run(value[key]);
|
|
2144
|
+
if (result.isOk()) {
|
|
2145
|
+
finalResult[key] = result.value;
|
|
2146
|
+
} else {
|
|
2147
|
+
const error = result.error;
|
|
2148
|
+
errors.push([key, error]);
|
|
2149
|
+
}
|
|
2150
|
+
}, "runPredicate");
|
|
2151
|
+
for (const [key, predicate] of this.requiredKeys) {
|
|
2152
|
+
if (inputEntries.delete(key)) {
|
|
2153
|
+
runPredicate(key, predicate);
|
|
2154
|
+
} else {
|
|
2155
|
+
errors.push([key, new MissingPropertyError(key, this.validatorOptions)]);
|
|
2156
|
+
}
|
|
2157
|
+
}
|
|
2158
|
+
for (const [key, validator] of this.possiblyUndefinedKeysWithDefaults) {
|
|
2159
|
+
inputEntries.delete(key);
|
|
2160
|
+
runPredicate(key, validator);
|
|
2161
|
+
}
|
|
2162
|
+
for (const [key, predicate] of this.possiblyUndefinedKeys) {
|
|
2163
|
+
if (inputEntries.size === 0) {
|
|
2164
|
+
break;
|
|
2165
|
+
}
|
|
2166
|
+
if (inputEntries.delete(key)) {
|
|
2167
|
+
runPredicate(key, predicate);
|
|
2168
|
+
}
|
|
2169
|
+
}
|
|
2170
|
+
if (inputEntries.size !== 0) {
|
|
2171
|
+
for (const [key, value2] of inputEntries.entries()) {
|
|
2172
|
+
errors.push([key, new UnknownPropertyError(key, value2, this.validatorOptions)]);
|
|
2173
|
+
}
|
|
2174
|
+
}
|
|
2175
|
+
return errors.length === 0 ? Result.ok(finalResult) : Result.err(new CombinedPropertyError(errors, this.validatorOptions));
|
|
2176
|
+
}
|
|
2177
|
+
handlePassthroughStrategy(value) {
|
|
2178
|
+
const result = this.handleIgnoreStrategy(value);
|
|
2179
|
+
return result.isErr() ? result : Result.ok({ ...value, ...result.value });
|
|
2180
|
+
}
|
|
2181
|
+
};
|
|
2182
|
+
__name(_ObjectValidator, "ObjectValidator");
|
|
2183
|
+
var ObjectValidator = _ObjectValidator;
|
|
2184
|
+
|
|
2185
|
+
// src/validators/PassthroughValidator.ts
|
|
2186
|
+
var _PassthroughValidator = class _PassthroughValidator extends BaseValidator {
|
|
2187
|
+
handle(value) {
|
|
2188
|
+
return Result.ok(value);
|
|
2189
|
+
}
|
|
2190
|
+
};
|
|
2191
|
+
__name(_PassthroughValidator, "PassthroughValidator");
|
|
2192
|
+
var PassthroughValidator = _PassthroughValidator;
|
|
2193
|
+
|
|
2194
|
+
// src/validators/RecordValidator.ts
|
|
2195
|
+
var _RecordValidator = class _RecordValidator extends BaseValidator {
|
|
2196
|
+
constructor(validator, validatorOptions = {}, constraints = []) {
|
|
2197
|
+
super(validatorOptions, constraints);
|
|
2198
|
+
this.validator = validator;
|
|
2199
|
+
}
|
|
2200
|
+
clone() {
|
|
2201
|
+
return Reflect.construct(this.constructor, [this.validator, this.validatorOptions, this.constraints]);
|
|
2202
|
+
}
|
|
2203
|
+
handle(value) {
|
|
2204
|
+
if (typeof value !== "object") {
|
|
2205
|
+
return Result.err(new ValidationError("s.record(T)", this.validatorOptions.message ?? "Expected an object", value));
|
|
2206
|
+
}
|
|
2207
|
+
if (value === null) {
|
|
2208
|
+
return Result.err(new ValidationError("s.record(T)", this.validatorOptions.message ?? "Expected the value to not be null", value));
|
|
2209
|
+
}
|
|
2210
|
+
if (Array.isArray(value)) {
|
|
2211
|
+
return Result.err(new ValidationError("s.record(T)", this.validatorOptions.message ?? "Expected the value to not be an array", value));
|
|
2212
|
+
}
|
|
2213
|
+
if (!this.shouldRunConstraints) {
|
|
2214
|
+
return Result.ok(value);
|
|
2215
|
+
}
|
|
2216
|
+
const errors = [];
|
|
2217
|
+
const transformed = {};
|
|
2218
|
+
for (const [key, val] of Object.entries(value)) {
|
|
2219
|
+
const result = this.validator.run(val);
|
|
2220
|
+
if (result.isOk())
|
|
2221
|
+
transformed[key] = result.value;
|
|
2222
|
+
else
|
|
2223
|
+
errors.push([key, result.error]);
|
|
2224
|
+
}
|
|
2225
|
+
return errors.length === 0 ? Result.ok(transformed) : Result.err(new CombinedPropertyError(errors, this.validatorOptions));
|
|
2226
|
+
}
|
|
2227
|
+
};
|
|
2228
|
+
__name(_RecordValidator, "RecordValidator");
|
|
2229
|
+
var RecordValidator = _RecordValidator;
|
|
2230
|
+
|
|
2231
|
+
// src/validators/SetValidator.ts
|
|
2232
|
+
var _SetValidator = class _SetValidator extends BaseValidator {
|
|
2233
|
+
constructor(validator, validatorOptions, constraints = []) {
|
|
2234
|
+
super(validatorOptions, constraints);
|
|
2235
|
+
this.validator = validator;
|
|
2236
|
+
}
|
|
2237
|
+
clone() {
|
|
2238
|
+
return Reflect.construct(this.constructor, [this.validator, this.validatorOptions, this.constraints]);
|
|
2239
|
+
}
|
|
2240
|
+
handle(values) {
|
|
2241
|
+
if (!(values instanceof Set)) {
|
|
2242
|
+
return Result.err(new ValidationError("s.set(T)", this.validatorOptions.message ?? "Expected a set", values));
|
|
2243
|
+
}
|
|
2244
|
+
if (!this.shouldRunConstraints) {
|
|
2245
|
+
return Result.ok(values);
|
|
2246
|
+
}
|
|
2247
|
+
const errors = [];
|
|
2248
|
+
const transformed = /* @__PURE__ */ new Set();
|
|
2249
|
+
for (const value of values) {
|
|
2250
|
+
const result = this.validator.run(value);
|
|
2251
|
+
if (result.isOk())
|
|
2252
|
+
transformed.add(result.value);
|
|
2253
|
+
else
|
|
2254
|
+
errors.push(result.error);
|
|
2255
|
+
}
|
|
2256
|
+
return errors.length === 0 ? Result.ok(transformed) : Result.err(new CombinedError(errors, this.validatorOptions));
|
|
2257
|
+
}
|
|
2258
|
+
};
|
|
2259
|
+
__name(_SetValidator, "SetValidator");
|
|
2260
|
+
var SetValidator = _SetValidator;
|
|
2261
|
+
|
|
2262
|
+
// src/constraints/util/emailValidator.ts
|
|
2263
|
+
var accountRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]$/i;
|
|
2264
|
+
function validateEmail(email) {
|
|
2265
|
+
if (!email)
|
|
2266
|
+
return false;
|
|
2267
|
+
const atIndex = email.indexOf("@");
|
|
2268
|
+
if (atIndex === -1)
|
|
2269
|
+
return false;
|
|
2270
|
+
if (atIndex > 64)
|
|
2271
|
+
return false;
|
|
2272
|
+
const domainIndex = atIndex + 1;
|
|
2273
|
+
if (email.includes("@", domainIndex))
|
|
2274
|
+
return false;
|
|
2275
|
+
if (email.length - domainIndex > 255)
|
|
2276
|
+
return false;
|
|
2277
|
+
let dotIndex = email.indexOf(".", domainIndex);
|
|
2278
|
+
if (dotIndex === -1)
|
|
2279
|
+
return false;
|
|
2280
|
+
let lastDotIndex = domainIndex;
|
|
2281
|
+
do {
|
|
2282
|
+
if (dotIndex - lastDotIndex > 63)
|
|
2283
|
+
return false;
|
|
2284
|
+
lastDotIndex = dotIndex + 1;
|
|
2285
|
+
} while ((dotIndex = email.indexOf(".", lastDotIndex)) !== -1);
|
|
2286
|
+
if (email.length - lastDotIndex > 63)
|
|
2287
|
+
return false;
|
|
2288
|
+
return accountRegex.test(email.slice(0, atIndex)) && validateEmailDomain(email.slice(domainIndex));
|
|
2289
|
+
}
|
|
2290
|
+
__name(validateEmail, "validateEmail");
|
|
2291
|
+
function validateEmailDomain(domain) {
|
|
2292
|
+
try {
|
|
2293
|
+
return new URL(`http://${domain}`).hostname === domain;
|
|
2294
|
+
} catch {
|
|
2295
|
+
return false;
|
|
2296
|
+
}
|
|
2297
|
+
}
|
|
2298
|
+
__name(validateEmailDomain, "validateEmailDomain");
|
|
2299
|
+
|
|
2300
|
+
// src/constraints/util/net.ts
|
|
2301
|
+
var v4Seg = "(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])";
|
|
2302
|
+
var v4Str = `(${v4Seg}[.]){3}${v4Seg}`;
|
|
2303
|
+
var IPv4Reg = new RegExp(`^${v4Str}$`);
|
|
2304
|
+
var v6Seg = "(?:[0-9a-fA-F]{1,4})";
|
|
2305
|
+
var IPv6Reg = new RegExp(
|
|
2306
|
+
`^((?:${v6Seg}:){7}(?:${v6Seg}|:)|(?:${v6Seg}:){6}(?:${v4Str}|:${v6Seg}|:)|(?:${v6Seg}:){5}(?::${v4Str}|(:${v6Seg}){1,2}|:)|(?:${v6Seg}:){4}(?:(:${v6Seg}){0,1}:${v4Str}|(:${v6Seg}){1,3}|:)|(?:${v6Seg}:){3}(?:(:${v6Seg}){0,2}:${v4Str}|(:${v6Seg}){1,4}|:)|(?:${v6Seg}:){2}(?:(:${v6Seg}){0,3}:${v4Str}|(:${v6Seg}){1,5}|:)|(?:${v6Seg}:){1}(?:(:${v6Seg}){0,4}:${v4Str}|(:${v6Seg}){1,6}|:)|(?::((?::${v6Seg}){0,5}:${v4Str}|(?::${v6Seg}){1,7}|:)))(%[0-9a-zA-Z-.:]{1,})?$`
|
|
2307
|
+
);
|
|
2308
|
+
function isIPv4(s4) {
|
|
2309
|
+
return IPv4Reg.test(s4);
|
|
2310
|
+
}
|
|
2311
|
+
__name(isIPv4, "isIPv4");
|
|
2312
|
+
function isIPv6(s4) {
|
|
2313
|
+
return IPv6Reg.test(s4);
|
|
2314
|
+
}
|
|
2315
|
+
__name(isIPv6, "isIPv6");
|
|
2316
|
+
function isIP(s4) {
|
|
2317
|
+
if (isIPv4(s4))
|
|
2318
|
+
return 4;
|
|
2319
|
+
if (isIPv6(s4))
|
|
2320
|
+
return 6;
|
|
2321
|
+
return 0;
|
|
2322
|
+
}
|
|
2323
|
+
__name(isIP, "isIP");
|
|
2324
|
+
|
|
2325
|
+
// src/constraints/util/phoneValidator.ts
|
|
2326
|
+
var phoneNumberRegex = /^((?:\+|0{0,2})\d{1,2}\s?)?\(?\d{3}\)?[\s.-]?\d{3}[\s.-]?\d{4}$/;
|
|
2327
|
+
function validatePhoneNumber(input) {
|
|
2328
|
+
return phoneNumberRegex.test(input);
|
|
2329
|
+
}
|
|
2330
|
+
__name(validatePhoneNumber, "validatePhoneNumber");
|
|
2331
|
+
|
|
2332
|
+
// src/lib/errors/MultiplePossibilitiesConstraintError.ts
|
|
2333
|
+
var _MultiplePossibilitiesConstraintError = class _MultiplePossibilitiesConstraintError extends BaseConstraintError {
|
|
2334
|
+
constructor(constraint, message, given, expected) {
|
|
2335
|
+
super(constraint, message, given);
|
|
2336
|
+
this.expected = expected;
|
|
2337
|
+
}
|
|
2338
|
+
toJSON() {
|
|
2339
|
+
return {
|
|
2340
|
+
name: this.name,
|
|
2341
|
+
message: this.message,
|
|
2342
|
+
constraint: this.constraint,
|
|
2343
|
+
given: this.given,
|
|
2344
|
+
expected: this.expected
|
|
2345
|
+
};
|
|
2346
|
+
}
|
|
2347
|
+
[customInspectSymbolStackLess](depth, options) {
|
|
2348
|
+
const constraint = options.stylize(this.constraint, "string");
|
|
2349
|
+
if (depth < 0) {
|
|
2350
|
+
return options.stylize(`[MultiplePossibilitiesConstraintError: ${constraint}]`, "special");
|
|
2351
|
+
}
|
|
2352
|
+
const newOptions = { ...options, depth: options.depth === null ? null : options.depth - 1 };
|
|
2353
|
+
const verticalLine = options.stylize("|", "undefined");
|
|
2354
|
+
const padding = `
|
|
2355
|
+
${verticalLine} `;
|
|
2356
|
+
const given = inspect2(this.given, newOptions).replace(/\n/g, padding);
|
|
2357
|
+
const header = `${options.stylize("MultiplePossibilitiesConstraintError", "special")} > ${constraint}`;
|
|
2358
|
+
const message = options.stylize(this.message, "regexp");
|
|
2359
|
+
const expectedPadding = `
|
|
2360
|
+
${verticalLine} - `;
|
|
2361
|
+
const expectedBlock = `
|
|
2362
|
+
${options.stylize("Expected any of the following:", "string")}${expectedPadding}${this.expected.map((possible) => options.stylize(possible, "boolean")).join(expectedPadding)}`;
|
|
2363
|
+
const givenBlock = `
|
|
2364
|
+
${options.stylize("Received:", "regexp")}${padding}${given}`;
|
|
2365
|
+
return `${header}
|
|
2366
|
+
${message}
|
|
2367
|
+
${expectedBlock}
|
|
2368
|
+
${givenBlock}`;
|
|
2369
|
+
}
|
|
2370
|
+
};
|
|
2371
|
+
__name(_MultiplePossibilitiesConstraintError, "MultiplePossibilitiesConstraintError");
|
|
2372
|
+
var MultiplePossibilitiesConstraintError = _MultiplePossibilitiesConstraintError;
|
|
2373
|
+
|
|
2374
|
+
// src/constraints/util/common/combinedResultFn.ts
|
|
2375
|
+
function combinedErrorFn(...fns) {
|
|
2376
|
+
switch (fns.length) {
|
|
2377
|
+
case 0:
|
|
2378
|
+
return () => null;
|
|
2379
|
+
case 1:
|
|
2380
|
+
return fns[0];
|
|
2381
|
+
case 2: {
|
|
2382
|
+
const [fn0, fn1] = fns;
|
|
2383
|
+
return (...params) => fn0(...params) || fn1(...params);
|
|
2384
|
+
}
|
|
2385
|
+
default: {
|
|
2386
|
+
return (...params) => {
|
|
2387
|
+
for (const fn of fns) {
|
|
2388
|
+
const result = fn(...params);
|
|
2389
|
+
if (result)
|
|
2390
|
+
return result;
|
|
2391
|
+
}
|
|
2392
|
+
return null;
|
|
2393
|
+
};
|
|
2394
|
+
}
|
|
2395
|
+
}
|
|
2396
|
+
}
|
|
2397
|
+
__name(combinedErrorFn, "combinedErrorFn");
|
|
2398
|
+
|
|
2399
|
+
// src/constraints/util/urlValidators.ts
|
|
2400
|
+
function createUrlValidators(options, validatorOptions) {
|
|
2401
|
+
const fns = [];
|
|
2402
|
+
if (options?.allowedProtocols?.length)
|
|
2403
|
+
fns.push(allowedProtocolsFn(options.allowedProtocols, validatorOptions));
|
|
2404
|
+
if (options?.allowedDomains?.length)
|
|
2405
|
+
fns.push(allowedDomainsFn(options.allowedDomains, validatorOptions));
|
|
2406
|
+
return combinedErrorFn(...fns);
|
|
2407
|
+
}
|
|
2408
|
+
__name(createUrlValidators, "createUrlValidators");
|
|
2409
|
+
function allowedProtocolsFn(allowedProtocols, options) {
|
|
2410
|
+
return (input, url) => allowedProtocols.includes(url.protocol) ? null : new MultiplePossibilitiesConstraintError("s.string().url()", options?.message ?? "Invalid URL protocol", input, allowedProtocols);
|
|
2411
|
+
}
|
|
2412
|
+
__name(allowedProtocolsFn, "allowedProtocolsFn");
|
|
2413
|
+
function allowedDomainsFn(allowedDomains, options) {
|
|
2414
|
+
return (input, url) => allowedDomains.includes(url.hostname) ? null : new MultiplePossibilitiesConstraintError("s.string().url()", options?.message ?? "Invalid URL domain", input, allowedDomains);
|
|
2415
|
+
}
|
|
2416
|
+
__name(allowedDomainsFn, "allowedDomainsFn");
|
|
2417
|
+
|
|
2418
|
+
// src/constraints/StringConstraints.ts
|
|
2419
|
+
function stringLengthComparator(comparator, name, expected, length, options) {
|
|
2420
|
+
return {
|
|
2421
|
+
run(input) {
|
|
2422
|
+
return comparator(input.length, length) ? Result.ok(input) : Result.err(new ExpectedConstraintError(name, options?.message ?? "Invalid string length", input, expected));
|
|
2423
|
+
}
|
|
2424
|
+
};
|
|
2425
|
+
}
|
|
2426
|
+
__name(stringLengthComparator, "stringLengthComparator");
|
|
2427
|
+
function stringLengthLessThan(length, options) {
|
|
2428
|
+
const expected = `expected.length < ${length}`;
|
|
2429
|
+
return stringLengthComparator(lessThan, "s.string().lengthLessThan()", expected, length, options);
|
|
2430
|
+
}
|
|
2431
|
+
__name(stringLengthLessThan, "stringLengthLessThan");
|
|
2432
|
+
function stringLengthLessThanOrEqual(length, options) {
|
|
2433
|
+
const expected = `expected.length <= ${length}`;
|
|
2434
|
+
return stringLengthComparator(lessThanOrEqual, "s.string().lengthLessThanOrEqual()", expected, length, options);
|
|
2435
|
+
}
|
|
2436
|
+
__name(stringLengthLessThanOrEqual, "stringLengthLessThanOrEqual");
|
|
2437
|
+
function stringLengthGreaterThan(length, options) {
|
|
2438
|
+
const expected = `expected.length > ${length}`;
|
|
2439
|
+
return stringLengthComparator(greaterThan, "s.string().lengthGreaterThan()", expected, length, options);
|
|
2440
|
+
}
|
|
2441
|
+
__name(stringLengthGreaterThan, "stringLengthGreaterThan");
|
|
2442
|
+
function stringLengthGreaterThanOrEqual(length, options) {
|
|
2443
|
+
const expected = `expected.length >= ${length}`;
|
|
2444
|
+
return stringLengthComparator(greaterThanOrEqual, "s.string().lengthGreaterThanOrEqual()", expected, length, options);
|
|
2445
|
+
}
|
|
2446
|
+
__name(stringLengthGreaterThanOrEqual, "stringLengthGreaterThanOrEqual");
|
|
2447
|
+
function stringLengthEqual(length, options) {
|
|
2448
|
+
const expected = `expected.length === ${length}`;
|
|
2449
|
+
return stringLengthComparator(equal, "s.string().lengthEqual()", expected, length, options);
|
|
2450
|
+
}
|
|
2451
|
+
__name(stringLengthEqual, "stringLengthEqual");
|
|
2452
|
+
function stringLengthNotEqual(length, options) {
|
|
2453
|
+
const expected = `expected.length !== ${length}`;
|
|
2454
|
+
return stringLengthComparator(notEqual, "s.string().lengthNotEqual()", expected, length, options);
|
|
2455
|
+
}
|
|
2456
|
+
__name(stringLengthNotEqual, "stringLengthNotEqual");
|
|
2457
|
+
function stringEmail(options) {
|
|
2458
|
+
return {
|
|
2459
|
+
run(input) {
|
|
2460
|
+
return validateEmail(input) ? Result.ok(input) : Result.err(
|
|
2461
|
+
new ExpectedConstraintError(
|
|
2462
|
+
"s.string().email()",
|
|
2463
|
+
options?.message ?? "Invalid email address",
|
|
2464
|
+
input,
|
|
2465
|
+
"expected to be an email address"
|
|
2466
|
+
)
|
|
2467
|
+
);
|
|
2468
|
+
}
|
|
2469
|
+
};
|
|
2470
|
+
}
|
|
2471
|
+
__name(stringEmail, "stringEmail");
|
|
2472
|
+
function stringRegexValidator(type, expected, regex, options) {
|
|
2473
|
+
return {
|
|
2474
|
+
run(input) {
|
|
2475
|
+
return regex.test(input) ? Result.ok(input) : Result.err(new ExpectedConstraintError(type, options?.message ?? "Invalid string format", input, expected));
|
|
2476
|
+
}
|
|
2477
|
+
};
|
|
2478
|
+
}
|
|
2479
|
+
__name(stringRegexValidator, "stringRegexValidator");
|
|
2480
|
+
function stringUrl(options, validatorOptions) {
|
|
2481
|
+
const validatorFn = createUrlValidators(options, validatorOptions);
|
|
2482
|
+
return {
|
|
2483
|
+
run(input) {
|
|
2484
|
+
let url;
|
|
2485
|
+
try {
|
|
2486
|
+
url = new URL(input);
|
|
2487
|
+
} catch {
|
|
2488
|
+
return Result.err(
|
|
2489
|
+
new ExpectedConstraintError("s.string().url()", validatorOptions?.message ?? "Invalid URL", input, "expected to match a URL")
|
|
2490
|
+
);
|
|
2491
|
+
}
|
|
2492
|
+
const validatorFnResult = validatorFn(input, url);
|
|
2493
|
+
if (validatorFnResult === null)
|
|
2494
|
+
return Result.ok(input);
|
|
2495
|
+
return Result.err(validatorFnResult);
|
|
2496
|
+
}
|
|
2497
|
+
};
|
|
2498
|
+
}
|
|
2499
|
+
__name(stringUrl, "stringUrl");
|
|
2500
|
+
function stringIp(version, options) {
|
|
2501
|
+
const ipVersion = version ? `v${version}` : "";
|
|
2502
|
+
const validatorFn = version === 4 ? isIPv4 : version === 6 ? isIPv6 : isIP;
|
|
2503
|
+
const name = `s.string().ip${ipVersion}()`;
|
|
2504
|
+
const message = `Invalid IP${ipVersion} address`;
|
|
2505
|
+
const expected = `expected to be an IP${ipVersion} address`;
|
|
2506
|
+
return {
|
|
2507
|
+
run(input) {
|
|
2508
|
+
return validatorFn(input) ? Result.ok(input) : Result.err(new ExpectedConstraintError(name, options?.message ?? message, input, expected));
|
|
2509
|
+
}
|
|
2510
|
+
};
|
|
2511
|
+
}
|
|
2512
|
+
__name(stringIp, "stringIp");
|
|
2513
|
+
function stringRegex(regex, options) {
|
|
2514
|
+
return stringRegexValidator("s.string().regex()", `expected ${regex}.test(expected) to be true`, regex, options);
|
|
2515
|
+
}
|
|
2516
|
+
__name(stringRegex, "stringRegex");
|
|
2517
|
+
function stringUuid({ version = 4, nullable = false } = {}, options) {
|
|
2518
|
+
version ?? (version = "1-5");
|
|
2519
|
+
const regex = new RegExp(
|
|
2520
|
+
`^(?:[0-9A-F]{8}-[0-9A-F]{4}-[${version}][0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}${nullable ? "|00000000-0000-0000-0000-000000000000" : ""})$`,
|
|
2521
|
+
"i"
|
|
2522
|
+
);
|
|
2523
|
+
const expected = `expected to match UUID${typeof version === "number" ? `v${version}` : ` in range of ${version}`}`;
|
|
2524
|
+
return stringRegexValidator("s.string().uuid()", expected, regex, options);
|
|
2525
|
+
}
|
|
2526
|
+
__name(stringUuid, "stringUuid");
|
|
2527
|
+
function stringDate(options) {
|
|
2528
|
+
return {
|
|
2529
|
+
run(input) {
|
|
2530
|
+
const time = Date.parse(input);
|
|
2531
|
+
return Number.isNaN(time) ? Result.err(
|
|
2532
|
+
new ExpectedConstraintError(
|
|
2533
|
+
"s.string().date()",
|
|
2534
|
+
options?.message ?? "Invalid date string",
|
|
2535
|
+
input,
|
|
2536
|
+
"expected to be a valid date string (in the ISO 8601 or ECMA-262 format)"
|
|
2537
|
+
)
|
|
2538
|
+
) : Result.ok(input);
|
|
2539
|
+
}
|
|
2540
|
+
};
|
|
2541
|
+
}
|
|
2542
|
+
__name(stringDate, "stringDate");
|
|
2543
|
+
function stringPhone(options) {
|
|
2544
|
+
return {
|
|
2545
|
+
run(input) {
|
|
2546
|
+
return validatePhoneNumber(input) ? Result.ok(input) : Result.err(
|
|
2547
|
+
new ExpectedConstraintError(
|
|
2548
|
+
"s.string().phone()",
|
|
2549
|
+
options?.message ?? "Invalid phone number",
|
|
2550
|
+
input,
|
|
2551
|
+
"expected to be a phone number"
|
|
2552
|
+
)
|
|
2553
|
+
);
|
|
2554
|
+
}
|
|
2555
|
+
};
|
|
2556
|
+
}
|
|
2557
|
+
__name(stringPhone, "stringPhone");
|
|
2558
|
+
|
|
2559
|
+
// src/validators/StringValidator.ts
|
|
2560
|
+
var _StringValidator = class _StringValidator extends BaseValidator {
|
|
2561
|
+
lengthLessThan(length, options = this.validatorOptions) {
|
|
2562
|
+
return this.addConstraint(stringLengthLessThan(length, options));
|
|
2563
|
+
}
|
|
2564
|
+
lengthLessThanOrEqual(length, options = this.validatorOptions) {
|
|
2565
|
+
return this.addConstraint(stringLengthLessThanOrEqual(length, options));
|
|
2566
|
+
}
|
|
2567
|
+
lengthGreaterThan(length, options = this.validatorOptions) {
|
|
2568
|
+
return this.addConstraint(stringLengthGreaterThan(length, options));
|
|
2569
|
+
}
|
|
2570
|
+
lengthGreaterThanOrEqual(length, options = this.validatorOptions) {
|
|
2571
|
+
return this.addConstraint(stringLengthGreaterThanOrEqual(length, options));
|
|
2572
|
+
}
|
|
2573
|
+
lengthEqual(length, options = this.validatorOptions) {
|
|
2574
|
+
return this.addConstraint(stringLengthEqual(length, options));
|
|
2575
|
+
}
|
|
2576
|
+
lengthNotEqual(length, options = this.validatorOptions) {
|
|
2577
|
+
return this.addConstraint(stringLengthNotEqual(length, options));
|
|
2578
|
+
}
|
|
2579
|
+
email(options = this.validatorOptions) {
|
|
2580
|
+
return this.addConstraint(stringEmail(options));
|
|
2581
|
+
}
|
|
2582
|
+
url(options, validatorOptions = this.validatorOptions) {
|
|
2583
|
+
const urlOptions = this.isUrlOptions(options);
|
|
2584
|
+
if (urlOptions) {
|
|
2585
|
+
return this.addConstraint(stringUrl(options, validatorOptions));
|
|
2586
|
+
}
|
|
2587
|
+
return this.addConstraint(stringUrl(void 0, validatorOptions));
|
|
2588
|
+
}
|
|
2589
|
+
uuid(options, validatorOptions = this.validatorOptions) {
|
|
2590
|
+
const stringUuidOptions = this.isStringUuidOptions(options);
|
|
2591
|
+
if (stringUuidOptions) {
|
|
2592
|
+
return this.addConstraint(stringUuid(options, validatorOptions));
|
|
2593
|
+
}
|
|
2594
|
+
return this.addConstraint(stringUuid(void 0, validatorOptions));
|
|
2595
|
+
}
|
|
2596
|
+
regex(regex, options = this.validatorOptions) {
|
|
2597
|
+
return this.addConstraint(stringRegex(regex, options));
|
|
2598
|
+
}
|
|
2599
|
+
date(options = this.validatorOptions) {
|
|
2600
|
+
return this.addConstraint(stringDate(options));
|
|
2601
|
+
}
|
|
2602
|
+
ipv4(options = this.validatorOptions) {
|
|
2603
|
+
return this.ip(4, options);
|
|
2604
|
+
}
|
|
2605
|
+
ipv6(options = this.validatorOptions) {
|
|
2606
|
+
return this.ip(6, options);
|
|
2607
|
+
}
|
|
2608
|
+
ip(version, options = this.validatorOptions) {
|
|
2609
|
+
return this.addConstraint(stringIp(version, options));
|
|
2610
|
+
}
|
|
2611
|
+
phone(options = this.validatorOptions) {
|
|
2612
|
+
return this.addConstraint(stringPhone(options));
|
|
2613
|
+
}
|
|
2614
|
+
handle(value) {
|
|
2615
|
+
return typeof value === "string" ? Result.ok(value) : Result.err(new ValidationError("s.string()", this.validatorOptions.message ?? "Expected a string primitive", value));
|
|
2616
|
+
}
|
|
2617
|
+
isUrlOptions(options) {
|
|
2618
|
+
return options?.message === void 0;
|
|
2619
|
+
}
|
|
2620
|
+
isStringUuidOptions(options) {
|
|
2621
|
+
return options?.message === void 0;
|
|
2622
|
+
}
|
|
2623
|
+
};
|
|
2624
|
+
__name(_StringValidator, "StringValidator");
|
|
2625
|
+
var StringValidator = _StringValidator;
|
|
2626
|
+
|
|
2627
|
+
// src/validators/TupleValidator.ts
|
|
2628
|
+
var _TupleValidator = class _TupleValidator extends BaseValidator {
|
|
2629
|
+
constructor(validators, validatorOptions = {}, constraints = []) {
|
|
2630
|
+
super(validatorOptions, constraints);
|
|
2631
|
+
this.validators = [];
|
|
2632
|
+
this.validators = validators;
|
|
2633
|
+
}
|
|
2634
|
+
clone() {
|
|
2635
|
+
return Reflect.construct(this.constructor, [this.validators, this.validatorOptions, this.constraints]);
|
|
2636
|
+
}
|
|
2637
|
+
handle(values) {
|
|
2638
|
+
if (!Array.isArray(values)) {
|
|
2639
|
+
return Result.err(new ValidationError("s.tuple(T)", this.validatorOptions.message ?? "Expected an array", values));
|
|
2640
|
+
}
|
|
2641
|
+
if (values.length !== this.validators.length) {
|
|
2642
|
+
return Result.err(
|
|
2643
|
+
new ValidationError("s.tuple(T)", this.validatorOptions.message ?? `Expected an array of length ${this.validators.length}`, values)
|
|
2644
|
+
);
|
|
2645
|
+
}
|
|
2646
|
+
if (!this.shouldRunConstraints) {
|
|
2647
|
+
return Result.ok(values);
|
|
2648
|
+
}
|
|
2649
|
+
const errors = [];
|
|
2650
|
+
const transformed = [];
|
|
2651
|
+
for (let i3 = 0; i3 < values.length; i3++) {
|
|
2652
|
+
const result = this.validators[i3].run(values[i3]);
|
|
2653
|
+
if (result.isOk())
|
|
2654
|
+
transformed.push(result.value);
|
|
2655
|
+
else
|
|
2656
|
+
errors.push([i3, result.error]);
|
|
2657
|
+
}
|
|
2658
|
+
return errors.length === 0 ? Result.ok(transformed) : Result.err(new CombinedPropertyError(errors, this.validatorOptions));
|
|
2659
|
+
}
|
|
2660
|
+
};
|
|
2661
|
+
__name(_TupleValidator, "TupleValidator");
|
|
2662
|
+
var TupleValidator = _TupleValidator;
|
|
2663
|
+
|
|
2664
|
+
// src/validators/MapValidator.ts
|
|
2665
|
+
var _MapValidator = class _MapValidator extends BaseValidator {
|
|
2666
|
+
constructor(keyValidator, valueValidator, validatorOptions = {}, constraints = []) {
|
|
2667
|
+
super(validatorOptions, constraints);
|
|
2668
|
+
this.keyValidator = keyValidator;
|
|
2669
|
+
this.valueValidator = valueValidator;
|
|
2670
|
+
}
|
|
2671
|
+
clone() {
|
|
2672
|
+
return Reflect.construct(this.constructor, [this.keyValidator, this.valueValidator, this.validatorOptions, this.constraints]);
|
|
2673
|
+
}
|
|
2674
|
+
handle(value) {
|
|
2675
|
+
if (!(value instanceof Map)) {
|
|
2676
|
+
return Result.err(new ValidationError("s.map(K, V)", this.validatorOptions.message ?? "Expected a map", value));
|
|
2677
|
+
}
|
|
2678
|
+
if (!this.shouldRunConstraints) {
|
|
2679
|
+
return Result.ok(value);
|
|
2680
|
+
}
|
|
2681
|
+
const errors = [];
|
|
2682
|
+
const transformed = /* @__PURE__ */ new Map();
|
|
2683
|
+
for (const [key, val] of value.entries()) {
|
|
2684
|
+
const keyResult = this.keyValidator.run(key);
|
|
2685
|
+
const valueResult = this.valueValidator.run(val);
|
|
2686
|
+
const { length } = errors;
|
|
2687
|
+
if (keyResult.isErr())
|
|
2688
|
+
errors.push([key, keyResult.error]);
|
|
2689
|
+
if (valueResult.isErr())
|
|
2690
|
+
errors.push([key, valueResult.error]);
|
|
2691
|
+
if (errors.length === length)
|
|
2692
|
+
transformed.set(keyResult.value, valueResult.value);
|
|
2693
|
+
}
|
|
2694
|
+
return errors.length === 0 ? Result.ok(transformed) : Result.err(new CombinedPropertyError(errors, this.validatorOptions));
|
|
2695
|
+
}
|
|
2696
|
+
};
|
|
2697
|
+
__name(_MapValidator, "MapValidator");
|
|
2698
|
+
var MapValidator = _MapValidator;
|
|
2699
|
+
|
|
2700
|
+
// src/validators/LazyValidator.ts
|
|
2701
|
+
var _LazyValidator = class _LazyValidator extends BaseValidator {
|
|
2702
|
+
constructor(validator, validatorOptions = {}, constraints = []) {
|
|
2703
|
+
super(validatorOptions, constraints);
|
|
2704
|
+
this.validator = validator;
|
|
2705
|
+
}
|
|
2706
|
+
clone() {
|
|
2707
|
+
return Reflect.construct(this.constructor, [this.validator, this.validatorOptions, this.constraints]);
|
|
2708
|
+
}
|
|
2709
|
+
handle(values) {
|
|
2710
|
+
return this.validator(values).run(values);
|
|
2711
|
+
}
|
|
2712
|
+
};
|
|
2713
|
+
__name(_LazyValidator, "LazyValidator");
|
|
2714
|
+
var LazyValidator = _LazyValidator;
|
|
2715
|
+
|
|
2716
|
+
// src/lib/errors/UnknownEnumValueError.ts
|
|
2717
|
+
var _UnknownEnumValueError = class _UnknownEnumValueError extends BaseError {
|
|
2718
|
+
constructor(value, keys, enumMappings, validatorOptions) {
|
|
2719
|
+
super(validatorOptions?.message ?? "Expected the value to be one of the following enum values:");
|
|
2720
|
+
this.value = value;
|
|
2721
|
+
this.enumKeys = keys;
|
|
2722
|
+
this.enumMappings = enumMappings;
|
|
2723
|
+
}
|
|
2724
|
+
toJSON() {
|
|
2725
|
+
return {
|
|
2726
|
+
name: this.name,
|
|
2727
|
+
message: this.message,
|
|
2728
|
+
value: this.value,
|
|
2729
|
+
enumKeys: this.enumKeys,
|
|
2730
|
+
enumMappings: [...this.enumMappings.entries()]
|
|
2731
|
+
};
|
|
2732
|
+
}
|
|
2733
|
+
[customInspectSymbolStackLess](depth, options) {
|
|
2734
|
+
const value = options.stylize(this.value.toString(), "string");
|
|
2735
|
+
if (depth < 0) {
|
|
2736
|
+
return options.stylize(`[UnknownEnumValueError: ${value}]`, "special");
|
|
2737
|
+
}
|
|
2738
|
+
const padding = `
|
|
2739
|
+
${options.stylize("|", "undefined")} `;
|
|
2740
|
+
const pairs = this.enumKeys.map((key) => {
|
|
2741
|
+
const enumValue = this.enumMappings.get(key);
|
|
2742
|
+
return `${options.stylize(key, "string")} or ${options.stylize(
|
|
2743
|
+
enumValue.toString(),
|
|
2744
|
+
typeof enumValue === "number" ? "number" : "string"
|
|
2745
|
+
)}`;
|
|
2746
|
+
}).join(padding);
|
|
2747
|
+
const header = `${options.stylize("UnknownEnumValueError", "special")} > ${value}`;
|
|
2748
|
+
const message = options.stylize(this.message, "regexp");
|
|
2749
|
+
const pairsBlock = `${padding}${pairs}`;
|
|
2750
|
+
return `${header}
|
|
2751
|
+
${message}
|
|
2752
|
+
${pairsBlock}`;
|
|
2753
|
+
}
|
|
2754
|
+
};
|
|
2755
|
+
__name(_UnknownEnumValueError, "UnknownEnumValueError");
|
|
2756
|
+
var UnknownEnumValueError = _UnknownEnumValueError;
|
|
2757
|
+
|
|
2758
|
+
// src/validators/NativeEnumValidator.ts
|
|
2759
|
+
var _NativeEnumValidator = class _NativeEnumValidator extends BaseValidator {
|
|
2760
|
+
constructor(enumShape, validatorOptions = {}) {
|
|
2761
|
+
super(validatorOptions);
|
|
2762
|
+
this.hasNumericElements = false;
|
|
2763
|
+
this.enumMapping = /* @__PURE__ */ new Map();
|
|
2764
|
+
this.enumShape = enumShape;
|
|
2765
|
+
this.enumKeys = Object.keys(enumShape).filter((key) => {
|
|
2766
|
+
return typeof enumShape[enumShape[key]] !== "number";
|
|
2767
|
+
});
|
|
2768
|
+
for (const key of this.enumKeys) {
|
|
2769
|
+
const enumValue = enumShape[key];
|
|
2770
|
+
this.enumMapping.set(key, enumValue);
|
|
2771
|
+
this.enumMapping.set(enumValue, enumValue);
|
|
2772
|
+
if (typeof enumValue === "number") {
|
|
2773
|
+
this.hasNumericElements = true;
|
|
2774
|
+
this.enumMapping.set(`${enumValue}`, enumValue);
|
|
2775
|
+
}
|
|
2776
|
+
}
|
|
2777
|
+
}
|
|
2778
|
+
handle(value) {
|
|
2779
|
+
const typeOfValue = typeof value;
|
|
2780
|
+
if (typeOfValue === "number") {
|
|
2781
|
+
if (!this.hasNumericElements) {
|
|
2782
|
+
return Result.err(
|
|
2783
|
+
new ValidationError("s.nativeEnum(T)", this.validatorOptions.message ?? "Expected the value to be a string", value)
|
|
2784
|
+
);
|
|
2785
|
+
}
|
|
2786
|
+
} else if (typeOfValue !== "string") {
|
|
2787
|
+
return Result.err(
|
|
2788
|
+
new ValidationError("s.nativeEnum(T)", this.validatorOptions.message ?? "Expected the value to be a string or number", value)
|
|
2789
|
+
);
|
|
2790
|
+
}
|
|
2791
|
+
const casted = value;
|
|
2792
|
+
const possibleEnumValue = this.enumMapping.get(casted);
|
|
2793
|
+
return typeof possibleEnumValue === "undefined" ? Result.err(new UnknownEnumValueError(casted, this.enumKeys, this.enumMapping, this.validatorOptions)) : Result.ok(possibleEnumValue);
|
|
2794
|
+
}
|
|
2795
|
+
clone() {
|
|
2796
|
+
return Reflect.construct(this.constructor, [this.enumShape, this.validatorOptions]);
|
|
2797
|
+
}
|
|
2798
|
+
};
|
|
2799
|
+
__name(_NativeEnumValidator, "NativeEnumValidator");
|
|
2800
|
+
var NativeEnumValidator = _NativeEnumValidator;
|
|
2801
|
+
|
|
2802
|
+
// src/constraints/TypedArrayLengthConstraints.ts
|
|
2803
|
+
function typedArrayByteLengthComparator(comparator, name, expected, length, options) {
|
|
2804
|
+
return {
|
|
2805
|
+
run(input) {
|
|
2806
|
+
return comparator(input.byteLength, length) ? Result.ok(input) : Result.err(new ExpectedConstraintError(name, options?.message ?? "Invalid Typed Array byte length", input, expected));
|
|
2807
|
+
}
|
|
2808
|
+
};
|
|
2809
|
+
}
|
|
2810
|
+
__name(typedArrayByteLengthComparator, "typedArrayByteLengthComparator");
|
|
2811
|
+
function typedArrayByteLengthLessThan(value, options) {
|
|
2812
|
+
const expected = `expected.byteLength < ${value}`;
|
|
2813
|
+
return typedArrayByteLengthComparator(lessThan, "s.typedArray(T).byteLengthLessThan()", expected, value, options);
|
|
2814
|
+
}
|
|
2815
|
+
__name(typedArrayByteLengthLessThan, "typedArrayByteLengthLessThan");
|
|
2816
|
+
function typedArrayByteLengthLessThanOrEqual(value, options) {
|
|
2817
|
+
const expected = `expected.byteLength <= ${value}`;
|
|
2818
|
+
return typedArrayByteLengthComparator(lessThanOrEqual, "s.typedArray(T).byteLengthLessThanOrEqual()", expected, value, options);
|
|
2819
|
+
}
|
|
2820
|
+
__name(typedArrayByteLengthLessThanOrEqual, "typedArrayByteLengthLessThanOrEqual");
|
|
2821
|
+
function typedArrayByteLengthGreaterThan(value, options) {
|
|
2822
|
+
const expected = `expected.byteLength > ${value}`;
|
|
2823
|
+
return typedArrayByteLengthComparator(greaterThan, "s.typedArray(T).byteLengthGreaterThan()", expected, value, options);
|
|
2824
|
+
}
|
|
2825
|
+
__name(typedArrayByteLengthGreaterThan, "typedArrayByteLengthGreaterThan");
|
|
2826
|
+
function typedArrayByteLengthGreaterThanOrEqual(value, options) {
|
|
2827
|
+
const expected = `expected.byteLength >= ${value}`;
|
|
2828
|
+
return typedArrayByteLengthComparator(greaterThanOrEqual, "s.typedArray(T).byteLengthGreaterThanOrEqual()", expected, value, options);
|
|
2829
|
+
}
|
|
2830
|
+
__name(typedArrayByteLengthGreaterThanOrEqual, "typedArrayByteLengthGreaterThanOrEqual");
|
|
2831
|
+
function typedArrayByteLengthEqual(value, options) {
|
|
2832
|
+
const expected = `expected.byteLength === ${value}`;
|
|
2833
|
+
return typedArrayByteLengthComparator(equal, "s.typedArray(T).byteLengthEqual()", expected, value, options);
|
|
2834
|
+
}
|
|
2835
|
+
__name(typedArrayByteLengthEqual, "typedArrayByteLengthEqual");
|
|
2836
|
+
function typedArrayByteLengthNotEqual(value, options) {
|
|
2837
|
+
const expected = `expected.byteLength !== ${value}`;
|
|
2838
|
+
return typedArrayByteLengthComparator(notEqual, "s.typedArray(T).byteLengthNotEqual()", expected, value, options);
|
|
2839
|
+
}
|
|
2840
|
+
__name(typedArrayByteLengthNotEqual, "typedArrayByteLengthNotEqual");
|
|
2841
|
+
function typedArrayByteLengthRange(start, endBefore, options) {
|
|
2842
|
+
const expected = `expected.byteLength >= ${start} && expected.byteLength < ${endBefore}`;
|
|
2843
|
+
return {
|
|
2844
|
+
run(input) {
|
|
2845
|
+
return input.byteLength >= start && input.byteLength < endBefore ? Result.ok(input) : Result.err(
|
|
2846
|
+
new ExpectedConstraintError(
|
|
2847
|
+
"s.typedArray(T).byteLengthRange()",
|
|
2848
|
+
options?.message ?? "Invalid Typed Array byte length",
|
|
2849
|
+
input,
|
|
2850
|
+
expected
|
|
2851
|
+
)
|
|
2852
|
+
);
|
|
2853
|
+
}
|
|
2854
|
+
};
|
|
2855
|
+
}
|
|
2856
|
+
__name(typedArrayByteLengthRange, "typedArrayByteLengthRange");
|
|
2857
|
+
function typedArrayByteLengthRangeInclusive(start, end, options) {
|
|
2858
|
+
const expected = `expected.byteLength >= ${start} && expected.byteLength <= ${end}`;
|
|
2859
|
+
return {
|
|
2860
|
+
run(input) {
|
|
2861
|
+
return input.byteLength >= start && input.byteLength <= end ? Result.ok(input) : Result.err(
|
|
2862
|
+
new ExpectedConstraintError(
|
|
2863
|
+
"s.typedArray(T).byteLengthRangeInclusive()",
|
|
2864
|
+
options?.message ?? "Invalid Typed Array byte length",
|
|
2865
|
+
input,
|
|
2866
|
+
expected
|
|
2867
|
+
)
|
|
2868
|
+
);
|
|
2869
|
+
}
|
|
2870
|
+
};
|
|
2871
|
+
}
|
|
2872
|
+
__name(typedArrayByteLengthRangeInclusive, "typedArrayByteLengthRangeInclusive");
|
|
2873
|
+
function typedArrayByteLengthRangeExclusive(startAfter, endBefore, options) {
|
|
2874
|
+
const expected = `expected.byteLength > ${startAfter} && expected.byteLength < ${endBefore}`;
|
|
2875
|
+
return {
|
|
2876
|
+
run(input) {
|
|
2877
|
+
return input.byteLength > startAfter && input.byteLength < endBefore ? Result.ok(input) : Result.err(
|
|
2878
|
+
new ExpectedConstraintError(
|
|
2879
|
+
"s.typedArray(T).byteLengthRangeExclusive()",
|
|
2880
|
+
options?.message ?? "Invalid Typed Array byte length",
|
|
2881
|
+
input,
|
|
2882
|
+
expected
|
|
2883
|
+
)
|
|
2884
|
+
);
|
|
2885
|
+
}
|
|
2886
|
+
};
|
|
2887
|
+
}
|
|
2888
|
+
__name(typedArrayByteLengthRangeExclusive, "typedArrayByteLengthRangeExclusive");
|
|
2889
|
+
function typedArrayLengthComparator(comparator, name, expected, length, options) {
|
|
2890
|
+
return {
|
|
2891
|
+
run(input) {
|
|
2892
|
+
return comparator(input.length, length) ? Result.ok(input) : Result.err(new ExpectedConstraintError(name, options?.message ?? "Invalid Typed Array length", input, expected));
|
|
2893
|
+
}
|
|
2894
|
+
};
|
|
2895
|
+
}
|
|
2896
|
+
__name(typedArrayLengthComparator, "typedArrayLengthComparator");
|
|
2897
|
+
function typedArrayLengthLessThan(value, options) {
|
|
2898
|
+
const expected = `expected.length < ${value}`;
|
|
2899
|
+
return typedArrayLengthComparator(lessThan, "s.typedArray(T).lengthLessThan()", expected, value, options);
|
|
2900
|
+
}
|
|
2901
|
+
__name(typedArrayLengthLessThan, "typedArrayLengthLessThan");
|
|
2902
|
+
function typedArrayLengthLessThanOrEqual(value, options) {
|
|
2903
|
+
const expected = `expected.length <= ${value}`;
|
|
2904
|
+
return typedArrayLengthComparator(lessThanOrEqual, "s.typedArray(T).lengthLessThanOrEqual()", expected, value, options);
|
|
2905
|
+
}
|
|
2906
|
+
__name(typedArrayLengthLessThanOrEqual, "typedArrayLengthLessThanOrEqual");
|
|
2907
|
+
function typedArrayLengthGreaterThan(value, options) {
|
|
2908
|
+
const expected = `expected.length > ${value}`;
|
|
2909
|
+
return typedArrayLengthComparator(greaterThan, "s.typedArray(T).lengthGreaterThan()", expected, value, options);
|
|
2910
|
+
}
|
|
2911
|
+
__name(typedArrayLengthGreaterThan, "typedArrayLengthGreaterThan");
|
|
2912
|
+
function typedArrayLengthGreaterThanOrEqual(value, options) {
|
|
2913
|
+
const expected = `expected.length >= ${value}`;
|
|
2914
|
+
return typedArrayLengthComparator(greaterThanOrEqual, "s.typedArray(T).lengthGreaterThanOrEqual()", expected, value, options);
|
|
2915
|
+
}
|
|
2916
|
+
__name(typedArrayLengthGreaterThanOrEqual, "typedArrayLengthGreaterThanOrEqual");
|
|
2917
|
+
function typedArrayLengthEqual(value, options) {
|
|
2918
|
+
const expected = `expected.length === ${value}`;
|
|
2919
|
+
return typedArrayLengthComparator(equal, "s.typedArray(T).lengthEqual()", expected, value, options);
|
|
2920
|
+
}
|
|
2921
|
+
__name(typedArrayLengthEqual, "typedArrayLengthEqual");
|
|
2922
|
+
function typedArrayLengthNotEqual(value, options) {
|
|
2923
|
+
const expected = `expected.length !== ${value}`;
|
|
2924
|
+
return typedArrayLengthComparator(notEqual, "s.typedArray(T).lengthNotEqual()", expected, value, options);
|
|
2925
|
+
}
|
|
2926
|
+
__name(typedArrayLengthNotEqual, "typedArrayLengthNotEqual");
|
|
2927
|
+
function typedArrayLengthRange(start, endBefore, options) {
|
|
2928
|
+
const expected = `expected.length >= ${start} && expected.length < ${endBefore}`;
|
|
2929
|
+
return {
|
|
2930
|
+
run(input) {
|
|
2931
|
+
return input.length >= start && input.length < endBefore ? Result.ok(input) : Result.err(
|
|
2932
|
+
new ExpectedConstraintError(
|
|
2933
|
+
"s.typedArray(T).lengthRange()",
|
|
2934
|
+
options?.message ?? "Invalid Typed Array length",
|
|
2935
|
+
input,
|
|
2936
|
+
expected
|
|
2937
|
+
)
|
|
2938
|
+
);
|
|
2939
|
+
}
|
|
2940
|
+
};
|
|
2941
|
+
}
|
|
2942
|
+
__name(typedArrayLengthRange, "typedArrayLengthRange");
|
|
2943
|
+
function typedArrayLengthRangeInclusive(start, end, options) {
|
|
2944
|
+
const expected = `expected.length >= ${start} && expected.length <= ${end}`;
|
|
2945
|
+
return {
|
|
2946
|
+
run(input) {
|
|
2947
|
+
return input.length >= start && input.length <= end ? Result.ok(input) : Result.err(
|
|
2948
|
+
new ExpectedConstraintError(
|
|
2949
|
+
"s.typedArray(T).lengthRangeInclusive()",
|
|
2950
|
+
options?.message ?? "Invalid Typed Array length",
|
|
2951
|
+
input,
|
|
2952
|
+
expected
|
|
2953
|
+
)
|
|
2954
|
+
);
|
|
2955
|
+
}
|
|
2956
|
+
};
|
|
2957
|
+
}
|
|
2958
|
+
__name(typedArrayLengthRangeInclusive, "typedArrayLengthRangeInclusive");
|
|
2959
|
+
function typedArrayLengthRangeExclusive(startAfter, endBefore, options) {
|
|
2960
|
+
const expected = `expected.length > ${startAfter} && expected.length < ${endBefore}`;
|
|
2961
|
+
return {
|
|
2962
|
+
run(input) {
|
|
2963
|
+
return input.length > startAfter && input.length < endBefore ? Result.ok(input) : Result.err(
|
|
2964
|
+
new ExpectedConstraintError(
|
|
2965
|
+
"s.typedArray(T).lengthRangeExclusive()",
|
|
2966
|
+
options?.message ?? "Invalid Typed Array length",
|
|
2967
|
+
input,
|
|
2968
|
+
expected
|
|
2969
|
+
)
|
|
2970
|
+
);
|
|
2971
|
+
}
|
|
2972
|
+
};
|
|
2973
|
+
}
|
|
2974
|
+
__name(typedArrayLengthRangeExclusive, "typedArrayLengthRangeExclusive");
|
|
2975
|
+
|
|
2976
|
+
// src/constraints/util/common/vowels.ts
|
|
2977
|
+
var vowels = ["a", "e", "i", "o", "u"];
|
|
2978
|
+
var aOrAn = /* @__PURE__ */ __name((word) => {
|
|
2979
|
+
return `${vowels.includes(word[0].toLowerCase()) ? "an" : "a"} ${word}`;
|
|
2980
|
+
}, "aOrAn");
|
|
2981
|
+
|
|
2982
|
+
// src/constraints/util/typedArray.ts
|
|
2983
|
+
var TypedArrays = {
|
|
2984
|
+
Int8Array: (x2) => x2 instanceof Int8Array,
|
|
2985
|
+
Uint8Array: (x2) => x2 instanceof Uint8Array,
|
|
2986
|
+
Uint8ClampedArray: (x2) => x2 instanceof Uint8ClampedArray,
|
|
2987
|
+
Int16Array: (x2) => x2 instanceof Int16Array,
|
|
2988
|
+
Uint16Array: (x2) => x2 instanceof Uint16Array,
|
|
2989
|
+
Int32Array: (x2) => x2 instanceof Int32Array,
|
|
2990
|
+
Uint32Array: (x2) => x2 instanceof Uint32Array,
|
|
2991
|
+
Float32Array: (x2) => x2 instanceof Float32Array,
|
|
2992
|
+
Float64Array: (x2) => x2 instanceof Float64Array,
|
|
2993
|
+
BigInt64Array: (x2) => x2 instanceof BigInt64Array,
|
|
2994
|
+
BigUint64Array: (x2) => x2 instanceof BigUint64Array,
|
|
2995
|
+
TypedArray: (x2) => ArrayBuffer.isView(x2) && !(x2 instanceof DataView)
|
|
2996
|
+
};
|
|
2997
|
+
|
|
2998
|
+
// src/validators/TypedArrayValidator.ts
|
|
2999
|
+
var _TypedArrayValidator = class _TypedArrayValidator extends BaseValidator {
|
|
3000
|
+
constructor(type, validatorOptions = {}, constraints = []) {
|
|
3001
|
+
super(validatorOptions, constraints);
|
|
3002
|
+
this.type = type;
|
|
3003
|
+
}
|
|
3004
|
+
byteLengthLessThan(length, options = this.validatorOptions) {
|
|
3005
|
+
return this.addConstraint(typedArrayByteLengthLessThan(length, options));
|
|
3006
|
+
}
|
|
3007
|
+
byteLengthLessThanOrEqual(length, options = this.validatorOptions) {
|
|
3008
|
+
return this.addConstraint(typedArrayByteLengthLessThanOrEqual(length, options));
|
|
3009
|
+
}
|
|
3010
|
+
byteLengthGreaterThan(length, options = this.validatorOptions) {
|
|
3011
|
+
return this.addConstraint(typedArrayByteLengthGreaterThan(length, options));
|
|
3012
|
+
}
|
|
3013
|
+
byteLengthGreaterThanOrEqual(length, options = this.validatorOptions) {
|
|
3014
|
+
return this.addConstraint(typedArrayByteLengthGreaterThanOrEqual(length, options));
|
|
3015
|
+
}
|
|
3016
|
+
byteLengthEqual(length, options = this.validatorOptions) {
|
|
3017
|
+
return this.addConstraint(typedArrayByteLengthEqual(length, options));
|
|
3018
|
+
}
|
|
3019
|
+
byteLengthNotEqual(length, options = this.validatorOptions) {
|
|
3020
|
+
return this.addConstraint(typedArrayByteLengthNotEqual(length, options));
|
|
3021
|
+
}
|
|
3022
|
+
byteLengthRange(start, endBefore, options = this.validatorOptions) {
|
|
3023
|
+
return this.addConstraint(typedArrayByteLengthRange(start, endBefore, options));
|
|
3024
|
+
}
|
|
3025
|
+
byteLengthRangeInclusive(startAt, endAt, options = this.validatorOptions) {
|
|
3026
|
+
return this.addConstraint(typedArrayByteLengthRangeInclusive(startAt, endAt, options));
|
|
3027
|
+
}
|
|
3028
|
+
byteLengthRangeExclusive(startAfter, endBefore, options = this.validatorOptions) {
|
|
3029
|
+
return this.addConstraint(typedArrayByteLengthRangeExclusive(startAfter, endBefore, options));
|
|
3030
|
+
}
|
|
3031
|
+
lengthLessThan(length, options = this.validatorOptions) {
|
|
3032
|
+
return this.addConstraint(typedArrayLengthLessThan(length, options));
|
|
3033
|
+
}
|
|
3034
|
+
lengthLessThanOrEqual(length, options = this.validatorOptions) {
|
|
3035
|
+
return this.addConstraint(typedArrayLengthLessThanOrEqual(length, options));
|
|
3036
|
+
}
|
|
3037
|
+
lengthGreaterThan(length, options = this.validatorOptions) {
|
|
3038
|
+
return this.addConstraint(typedArrayLengthGreaterThan(length, options));
|
|
3039
|
+
}
|
|
3040
|
+
lengthGreaterThanOrEqual(length, options = this.validatorOptions) {
|
|
3041
|
+
return this.addConstraint(typedArrayLengthGreaterThanOrEqual(length, options));
|
|
3042
|
+
}
|
|
3043
|
+
lengthEqual(length, options = this.validatorOptions) {
|
|
3044
|
+
return this.addConstraint(typedArrayLengthEqual(length, options));
|
|
3045
|
+
}
|
|
3046
|
+
lengthNotEqual(length, options = this.validatorOptions) {
|
|
3047
|
+
return this.addConstraint(typedArrayLengthNotEqual(length, options));
|
|
3048
|
+
}
|
|
3049
|
+
lengthRange(start, endBefore, options = this.validatorOptions) {
|
|
3050
|
+
return this.addConstraint(typedArrayLengthRange(start, endBefore, options));
|
|
3051
|
+
}
|
|
3052
|
+
lengthRangeInclusive(startAt, endAt, options = this.validatorOptions) {
|
|
3053
|
+
return this.addConstraint(typedArrayLengthRangeInclusive(startAt, endAt, options));
|
|
3054
|
+
}
|
|
3055
|
+
lengthRangeExclusive(startAfter, endBefore, options = this.validatorOptions) {
|
|
3056
|
+
return this.addConstraint(typedArrayLengthRangeExclusive(startAfter, endBefore, options));
|
|
3057
|
+
}
|
|
3058
|
+
clone() {
|
|
3059
|
+
return Reflect.construct(this.constructor, [this.type, this.validatorOptions, this.constraints]);
|
|
3060
|
+
}
|
|
3061
|
+
handle(value) {
|
|
3062
|
+
return TypedArrays[this.type](value) ? Result.ok(value) : Result.err(new ValidationError("s.typedArray()", this.validatorOptions.message ?? `Expected ${aOrAn(this.type)}`, value));
|
|
3063
|
+
}
|
|
3064
|
+
};
|
|
3065
|
+
__name(_TypedArrayValidator, "TypedArrayValidator");
|
|
3066
|
+
var TypedArrayValidator = _TypedArrayValidator;
|
|
3067
|
+
|
|
3068
|
+
// src/lib/Shapes.ts
|
|
3069
|
+
var _Shapes = class _Shapes {
|
|
3070
|
+
string(options) {
|
|
3071
|
+
return new StringValidator(options);
|
|
3072
|
+
}
|
|
3073
|
+
number(options) {
|
|
3074
|
+
return new NumberValidator(options);
|
|
3075
|
+
}
|
|
3076
|
+
bigint(options) {
|
|
3077
|
+
return new BigIntValidator(options);
|
|
3078
|
+
}
|
|
3079
|
+
boolean(options) {
|
|
3080
|
+
return new BooleanValidator(options);
|
|
3081
|
+
}
|
|
3082
|
+
date(options) {
|
|
3083
|
+
return new DateValidator(options);
|
|
3084
|
+
}
|
|
3085
|
+
object(shape, options) {
|
|
3086
|
+
return new ObjectValidator(shape, 0 /* Ignore */, options);
|
|
3087
|
+
}
|
|
3088
|
+
undefined(options) {
|
|
3089
|
+
return this.literal(void 0, { equalsOptions: options });
|
|
3090
|
+
}
|
|
3091
|
+
null(options) {
|
|
3092
|
+
return this.literal(null, { equalsOptions: options });
|
|
3093
|
+
}
|
|
3094
|
+
nullish(options) {
|
|
3095
|
+
return new NullishValidator(options);
|
|
3096
|
+
}
|
|
3097
|
+
any(options) {
|
|
3098
|
+
return new PassthroughValidator(options);
|
|
3099
|
+
}
|
|
3100
|
+
unknown(options) {
|
|
3101
|
+
return new PassthroughValidator(options);
|
|
3102
|
+
}
|
|
3103
|
+
never(options) {
|
|
3104
|
+
return new NeverValidator(options);
|
|
3105
|
+
}
|
|
3106
|
+
enum(values, options) {
|
|
3107
|
+
return this.union(
|
|
3108
|
+
values.map((value) => this.literal(value, { equalsOptions: options })),
|
|
3109
|
+
options
|
|
3110
|
+
);
|
|
3111
|
+
}
|
|
3112
|
+
nativeEnum(enumShape, options) {
|
|
3113
|
+
return new NativeEnumValidator(enumShape, options);
|
|
3114
|
+
}
|
|
3115
|
+
literal(value, options) {
|
|
3116
|
+
if (value instanceof Date) {
|
|
3117
|
+
return this.date(options?.dateOptions).equal(value, options?.equalsOptions);
|
|
3118
|
+
}
|
|
3119
|
+
return new LiteralValidator(value, options?.equalsOptions);
|
|
3120
|
+
}
|
|
3121
|
+
instance(expected, options) {
|
|
3122
|
+
return new InstanceValidator(expected, options);
|
|
3123
|
+
}
|
|
3124
|
+
union(validators, options) {
|
|
3125
|
+
return new UnionValidator(validators, options);
|
|
3126
|
+
}
|
|
3127
|
+
array(validator, options) {
|
|
3128
|
+
return new ArrayValidator(validator, options);
|
|
3129
|
+
}
|
|
3130
|
+
typedArray(type = "TypedArray", options) {
|
|
3131
|
+
return new TypedArrayValidator(type, options);
|
|
3132
|
+
}
|
|
3133
|
+
int8Array(options) {
|
|
3134
|
+
return this.typedArray("Int8Array", options);
|
|
3135
|
+
}
|
|
3136
|
+
uint8Array(options) {
|
|
3137
|
+
return this.typedArray("Uint8Array", options);
|
|
3138
|
+
}
|
|
3139
|
+
uint8ClampedArray(options) {
|
|
3140
|
+
return this.typedArray("Uint8ClampedArray", options);
|
|
3141
|
+
}
|
|
3142
|
+
int16Array(options) {
|
|
3143
|
+
return this.typedArray("Int16Array", options);
|
|
3144
|
+
}
|
|
3145
|
+
uint16Array(options) {
|
|
3146
|
+
return this.typedArray("Uint16Array", options);
|
|
3147
|
+
}
|
|
3148
|
+
int32Array(options) {
|
|
3149
|
+
return this.typedArray("Int32Array", options);
|
|
3150
|
+
}
|
|
3151
|
+
uint32Array(options) {
|
|
3152
|
+
return this.typedArray("Uint32Array", options);
|
|
3153
|
+
}
|
|
3154
|
+
float32Array(options) {
|
|
3155
|
+
return this.typedArray("Float32Array", options);
|
|
3156
|
+
}
|
|
3157
|
+
float64Array(options) {
|
|
3158
|
+
return this.typedArray("Float64Array", options);
|
|
3159
|
+
}
|
|
3160
|
+
bigInt64Array(options) {
|
|
3161
|
+
return this.typedArray("BigInt64Array", options);
|
|
3162
|
+
}
|
|
3163
|
+
bigUint64Array(options) {
|
|
3164
|
+
return this.typedArray("BigUint64Array", options);
|
|
3165
|
+
}
|
|
3166
|
+
tuple(validators, options) {
|
|
3167
|
+
return new TupleValidator(validators, options);
|
|
3168
|
+
}
|
|
3169
|
+
set(validator, options) {
|
|
3170
|
+
return new SetValidator(validator, options);
|
|
3171
|
+
}
|
|
3172
|
+
record(validator, options) {
|
|
3173
|
+
return new RecordValidator(validator, options);
|
|
3174
|
+
}
|
|
3175
|
+
map(keyValidator, valueValidator, options) {
|
|
3176
|
+
return new MapValidator(keyValidator, valueValidator, options);
|
|
3177
|
+
}
|
|
3178
|
+
lazy(validator, options) {
|
|
3179
|
+
return new LazyValidator(validator, options);
|
|
3180
|
+
}
|
|
3181
|
+
};
|
|
3182
|
+
__name(_Shapes, "Shapes");
|
|
3183
|
+
var Shapes = _Shapes;
|
|
3184
|
+
|
|
3185
|
+
// src/index.ts
|
|
3186
|
+
var s3 = new Shapes();
|
|
3187
|
+
/**
|
|
3188
|
+
* @license MIT
|
|
3189
|
+
* @copyright 2020 Colin McDonnell
|
|
3190
|
+
* @see https://github.com/colinhacks/zod/blob/master/LICENSE
|
|
3191
|
+
*/
|
|
3192
|
+
|
|
3193
|
+
exports.BaseError = BaseError;
|
|
3194
|
+
exports.CombinedError = CombinedError;
|
|
3195
|
+
exports.CombinedPropertyError = CombinedPropertyError;
|
|
3196
|
+
exports.ExpectedConstraintError = ExpectedConstraintError;
|
|
3197
|
+
exports.ExpectedValidationError = ExpectedValidationError;
|
|
3198
|
+
exports.MissingPropertyError = MissingPropertyError;
|
|
3199
|
+
exports.MultiplePossibilitiesConstraintError = MultiplePossibilitiesConstraintError;
|
|
3200
|
+
exports.Result = Result;
|
|
3201
|
+
exports.UnknownEnumValueError = UnknownEnumValueError;
|
|
3202
|
+
exports.UnknownPropertyError = UnknownPropertyError;
|
|
3203
|
+
exports.ValidationError = ValidationError;
|
|
3204
|
+
exports.customInspectSymbol = customInspectSymbol;
|
|
3205
|
+
exports.customInspectSymbolStackLess = customInspectSymbolStackLess;
|
|
3206
|
+
exports.getGlobalValidationEnabled = getGlobalValidationEnabled;
|
|
3207
|
+
exports.s = s3;
|
|
3208
|
+
exports.setGlobalValidationEnabled = setGlobalValidationEnabled;
|
|
3209
|
+
//# sourceMappingURL=out.js.map
|
|
3210
|
+
//# sourceMappingURL=index.cjs.map
|