@wix/cli 1.1.180 → 1.1.182
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/build/{ConnectWixVibeCommand-NHQEX6KA.js → ConnectWixVibeCommand-6BEDYCKY.js} +21 -21
- package/build/{DevCommand-KZ6TP7Z2.js → DevCommand-DBUFGQZQ.js} +22 -22
- package/build/{DevCommand-2YNCASR4.js → DevCommand-NQ7XZVUL.js} +24 -24
- package/build/{DevCommand-TE2X6ATP.js → DevCommand-RS4J6ADW.js} +19 -19
- package/build/EnvPullCommand-6FIP7DY2.js +30 -0
- package/build/{EnvRemoveCommand-NPBAIMO2.js → EnvRemoveCommand-VHYHBSNM.js} +15 -15
- package/build/{EnvSetCommand-WXUUESWT.js → EnvSetCommand-QMFNEVZS.js} +15 -15
- package/build/{GenerateCommand-7GNP63UH.js → GenerateCommand-3DH2DLE4.js} +704 -4704
- package/build/GenerateCommand-3DH2DLE4.js.map +1 -0
- package/build/GenerateManifestCommand-OMZ45UEQ.js +29902 -0
- package/build/GenerateManifestCommand-OMZ45UEQ.js.map +1 -0
- package/build/{InstallCommand-Y3PSBQXV.js → InstallCommand-VCI2BVN6.js} +21 -21
- package/build/{LoginCommand-YP7I2SNP.js → LoginCommand-HJ2HT7SA.js} +13 -13
- package/build/{LogoutCommand-EAQ45JZ7.js → LogoutCommand-GU5XRFSY.js} +9 -9
- package/build/PreviewCommand-7NYYMQLY.js +44 -0
- package/build/{PreviewCommand-KNCJLD7I.js → PreviewCommand-KTOAGVPW.js} +25 -25
- package/build/{PreviewCommand-Q67HDEB3.js → PreviewCommand-QL6MDPIR.js} +22 -22
- package/build/{PromoteCommand-EHZ7IGKT.js → PromoteCommand-L4NCDMV3.js} +24 -24
- package/build/{PublishCommand-EUMOWDMN.js → PublishCommand-FCUCIBAV.js} +22 -22
- package/build/{ReleaseCommand-KO2PKWSG.js → ReleaseCommand-EOKCJLNM.js} +25 -25
- package/build/TranslationPullCommand-7SO2URFQ.js +30 -0
- package/build/TranslationPushCommand-WFFRD6YT.js +31 -0
- package/build/{UninstallCommand-4UEFMKGE.js → UninstallCommand-D7G74MVR.js} +21 -21
- package/build/{WhoamiCommand-AFLDEJMZ.js → WhoamiCommand-XLN4S4L2.js} +4 -4
- package/build/{chunk-LFX6WS3B.js → chunk-2Q36TQPK.js} +4 -4
- package/build/{chunk-GOCIJYL7.js → chunk-35FZKORJ.js} +8 -8
- package/build/chunk-35LXVE2A.js +16 -0
- package/build/chunk-35LXVE2A.js.map +1 -0
- package/build/{chunk-SCQFHY4A.js → chunk-4BLGYECY.js} +2 -2
- package/build/{chunk-3USR7ERV.js → chunk-4Q64IHNH.js} +4 -4
- package/build/{chunk-JK5XXAQX.js → chunk-4VXSZ62N.js} +11 -11
- package/build/{chunk-XUXZFTF6.js → chunk-5RHYO63Y.js} +7 -14
- package/build/chunk-5RHYO63Y.js.map +1 -0
- package/build/{chunk-JWHJ7OLI.js → chunk-6IDTJWIT.js} +6 -6
- package/build/{chunk-FTXPALCB.js → chunk-6KQHWT2P.js} +2 -2
- package/build/{chunk-DBU3FYE4.js → chunk-6O7D3EEV.js} +8 -8
- package/build/{chunk-22SU6O2P.js → chunk-6R4ALWJQ.js} +2 -2
- package/build/{chunk-QZ7736TO.js → chunk-7GJBDAO5.js} +6 -6
- package/build/{chunk-HEKVXBWZ.js → chunk-7UEVOXCQ.js} +2 -2
- package/build/{chunk-526J7NQD.js → chunk-B4JR5SFD.js} +2 -2
- package/build/{chunk-H74IDTCR.js → chunk-B7ZXL7I6.js} +3 -3
- package/build/{chunk-XJE267QM.js → chunk-BQHRRQBX.js} +4 -4
- package/build/{chunk-QVQMIH5X.js → chunk-BZKXTB4T.js} +7 -7
- package/build/{chunk-4HM4GXIT.js → chunk-C2HRZPSU.js} +4 -4
- package/build/{chunk-AQ3JNRRK.js → chunk-D34SXQRN.js} +4 -4
- package/build/{chunk-AQ3JNRRK.js.map → chunk-D34SXQRN.js.map} +1 -1
- package/build/{chunk-TOLFJFE7.js → chunk-DUVH7OZ3.js} +4 -4
- package/build/{chunk-C6NTLNAT.js → chunk-EKYIDDQZ.js} +3 -3
- package/build/{chunk-VZ3FZHJK.js → chunk-F4637D6J.js} +8 -8
- package/build/{chunk-YTGCPERW.js → chunk-FAWKGNPX.js} +4 -4
- package/build/{chunk-QTQWEMSZ.js → chunk-FL5Y77KR.js} +2 -2
- package/build/{chunk-UF3RDBXA.js → chunk-FTJCTJ3H.js} +3 -3
- package/build/{chunk-E45X4RFQ.js → chunk-FTOUPDNJ.js} +8 -8
- package/build/{chunk-XCIXZDFH.js → chunk-FUXD5HKJ.js} +2 -2
- package/build/{chunk-RBF5RKXJ.js → chunk-HEVQAPPA.js} +4 -4
- package/build/{chunk-V2MRR3XI.js → chunk-HQCSHTDQ.js} +4 -4
- package/build/{chunk-CIOBCAOI.js → chunk-HWDCTJMM.js} +2 -2
- package/build/{chunk-MVIV6AJ7.js → chunk-IMJP2HSM.js} +6 -6
- package/build/{chunk-G4TDZ7KU.js → chunk-IRHF3V5Y.js} +6 -6
- package/build/{chunk-XTNCREFR.js → chunk-ITNZ4UGK.js} +4 -4
- package/build/{chunk-XYXTYRGK.js → chunk-J3SUNJOV.js} +6 -6
- package/build/{chunk-4EUYO6LF.js → chunk-JKO47YSE.js} +3 -3
- package/build/{chunk-CJWIGDAC.js → chunk-KB3GWH37.js} +2 -2
- package/build/{chunk-K72QYUHN.js → chunk-L4QZKYUD.js} +3 -3
- package/build/{chunk-MK2ZHK32.js → chunk-LKTUI3ST.js} +9 -9
- package/build/{chunk-TMZBOD2B.js → chunk-LU3R3EBR.js} +2 -2
- package/build/{chunk-WHDJD2R3.js → chunk-M7WD5ZQK.js} +3 -3
- package/build/{chunk-JKVSR6GG.js → chunk-MDXK4IXJ.js} +9 -9
- package/build/chunk-MW53IRHO.js +3966 -0
- package/build/chunk-MW53IRHO.js.map +1 -0
- package/build/{chunk-T6BKE35X.js → chunk-MXTO56FV.js} +7 -7
- package/build/{chunk-JWVFFICN.js → chunk-NHAADNMH.js} +2 -2
- package/build/{chunk-AS4VDEWN.js → chunk-P4S73OVC.js} +6 -6
- package/build/{chunk-OWRWPLVG.js → chunk-PC4B6ELA.js} +3 -3
- package/build/{chunk-L5MY6I2S.js → chunk-QKA4LE5L.js} +22 -11
- package/build/chunk-QKA4LE5L.js.map +1 -0
- package/build/{chunk-7RE3MBIG.js → chunk-S2JYKNXU.js} +7 -7
- package/build/{chunk-JJWBWHWO.js → chunk-SAIVMZIB.js} +2 -2
- package/build/{chunk-YRSNPU5L.js → chunk-SDLCFZRL.js} +3 -1
- package/build/{chunk-U53IU22M.js → chunk-SZCNTYRU.js} +4 -4
- package/build/{chunk-V2542KTT.js → chunk-U666337H.js} +4 -4
- package/build/{chunk-NO7FTQL7.js → chunk-UFW2PFO2.js} +7 -7
- package/build/{chunk-2DKXIL7C.js → chunk-UURGNAJX.js} +2 -2
- package/build/{chunk-X3JDCNCM.js → chunk-VW4KSJFB.js} +3 -3
- package/build/{chunk-JHA55BW5.js → chunk-WLDYJSRX.js} +7 -7
- package/build/{chunk-KEFW74AD.js → chunk-XAS2IV7X.js} +9 -9
- package/build/{chunk-DR2IE2NL.js → chunk-XZUGLEBK.js} +2 -2
- package/build/{chunk-KQQQHQ4W.js → chunk-YSUYAQ6O.js} +4 -4
- package/build/{chunk-XTVDTH5G.js → chunk-YT5BPQDJ.js} +2 -2
- package/build/{dev-V6QC5PH2.js → dev-ZWELVDKY.js} +30 -30
- package/build/{env-pull-JUO7U6YO.js → env-pull-AZ6HGILQ.js} +21 -19
- package/build/{env-pull-JUO7U6YO.js.map → env-pull-AZ6HGILQ.js.map} +1 -1
- package/build/index.js +30 -30
- package/build/{install-SJTW6HNB.js → install-7QYGQXMN.js} +22 -22
- package/build/{preview-B66EACAT.js → preview-3IVMSBRU.js} +29 -27
- package/build/{preview-B66EACAT.js.map → preview-3IVMSBRU.js.map} +1 -1
- package/build/{publish-FU3EXACH.js → publish-6TR7HI32.js} +23 -23
- package/build/{render-command-WODH5K2G.js → render-command-2YCW5SOA.js} +17 -17
- package/build/{render-command-FJDO7DAW.js → render-command-4AMXBW2Q.js} +15 -15
- package/build/render-command-F5WLES7G.js +32 -0
- package/build/{render-command-5343MO3I.js → render-command-SR6H6HUZ.js} +15 -15
- package/build/render-command-W7WD7F6D.js +32 -0
- package/build/run-command-THBEUJFU.js +24 -0
- package/build/schema-generate-extensions-HICBTQWF.js +1766 -0
- package/build/schema-generate-extensions-HICBTQWF.js.map +1 -0
- package/build/{src-D4THTFS2.js → src-2XUFCZ7J.js} +4 -4
- package/build/{src-NWN24JWL.js → src-7IKAOPE7.js} +18 -18
- package/build/{src-4VQLBTIZ.js → src-C4SEDOK6.js} +70 -48
- package/build/src-C4SEDOK6.js.map +1 -0
- package/build/{src-OWBBLJDF.js → src-DHTI77NY.js} +7 -7
- package/build/{src-IX36IWZF.js → src-HR56WUSP.js} +9 -9
- package/build/{src-23YBI7FY.js → src-NXFYP3JX.js} +15 -15
- package/build/{src-SBYT5BGZ.js → src-RQAKKX67.js} +7 -7
- package/build/{sync-types-4OKZPCQM.js → sync-types-LBP6XSD7.js} +15 -15
- package/build/{translation-pull-MDNH62KX.js → translation-pull-OPBZH6HH.js} +21 -19
- package/build/{translation-pull-MDNH62KX.js.map → translation-pull-OPBZH6HH.js.map} +1 -1
- package/build/{translation-push-6DSMU6XP.js → translation-push-ELBWUEKD.js} +22 -20
- package/build/{translation-push-6DSMU6XP.js.map → translation-push-ELBWUEKD.js.map} +1 -1
- package/build/{uninstall-C6GTQYNW.js → uninstall-CPOC7DUA.js} +22 -22
- package/package.json +2 -2
- package/templates/astro/editor-react-component/files/component.tsx.ejs +64 -0
- package/templates/astro/editor-react-component/files/extension.ts.ejs +45 -0
- package/templates/astro/editor-react-component/files/styles.module.css +121 -0
- package/build/EnvPullCommand-3Y2HT7KM.js +0 -30
- package/build/GenerateCommand-7GNP63UH.js.map +0 -1
- package/build/GenerateManifestCommand-3KYXLCZZ.js +0 -50707
- package/build/GenerateManifestCommand-3KYXLCZZ.js.map +0 -1
- package/build/PreviewCommand-YOLWH2DS.js +0 -44
- package/build/TranslationPullCommand-CYAALEEV.js +0 -30
- package/build/TranslationPushCommand-4EUDIOM4.js +0 -31
- package/build/chunk-L5MY6I2S.js.map +0 -1
- package/build/chunk-XUXZFTF6.js.map +0 -1
- package/build/render-command-2XQJZBJS.js +0 -32
- package/build/render-command-ZX7FARMW.js +0 -32
- package/build/run-command-YCHA3NXK.js +0 -24
- package/build/src-4VQLBTIZ.js.map +0 -1
- package/templates/astro/react-component/files/component.tsx.ejs +0 -19
- package/templates/astro/react-component/files/extension.ts.ejs +0 -19
- /package/build/{ConnectWixVibeCommand-NHQEX6KA.js.map → ConnectWixVibeCommand-6BEDYCKY.js.map} +0 -0
- /package/build/{DevCommand-KZ6TP7Z2.js.map → DevCommand-DBUFGQZQ.js.map} +0 -0
- /package/build/{DevCommand-2YNCASR4.js.map → DevCommand-NQ7XZVUL.js.map} +0 -0
- /package/build/{DevCommand-TE2X6ATP.js.map → DevCommand-RS4J6ADW.js.map} +0 -0
- /package/build/{EnvPullCommand-3Y2HT7KM.js.map → EnvPullCommand-6FIP7DY2.js.map} +0 -0
- /package/build/{EnvRemoveCommand-NPBAIMO2.js.map → EnvRemoveCommand-VHYHBSNM.js.map} +0 -0
- /package/build/{EnvSetCommand-WXUUESWT.js.map → EnvSetCommand-QMFNEVZS.js.map} +0 -0
- /package/build/{InstallCommand-Y3PSBQXV.js.map → InstallCommand-VCI2BVN6.js.map} +0 -0
- /package/build/{LoginCommand-YP7I2SNP.js.map → LoginCommand-HJ2HT7SA.js.map} +0 -0
- /package/build/{LogoutCommand-EAQ45JZ7.js.map → LogoutCommand-GU5XRFSY.js.map} +0 -0
- /package/build/{PreviewCommand-YOLWH2DS.js.map → PreviewCommand-7NYYMQLY.js.map} +0 -0
- /package/build/{PreviewCommand-KNCJLD7I.js.map → PreviewCommand-KTOAGVPW.js.map} +0 -0
- /package/build/{PreviewCommand-Q67HDEB3.js.map → PreviewCommand-QL6MDPIR.js.map} +0 -0
- /package/build/{PromoteCommand-EHZ7IGKT.js.map → PromoteCommand-L4NCDMV3.js.map} +0 -0
- /package/build/{PublishCommand-EUMOWDMN.js.map → PublishCommand-FCUCIBAV.js.map} +0 -0
- /package/build/{ReleaseCommand-KO2PKWSG.js.map → ReleaseCommand-EOKCJLNM.js.map} +0 -0
- /package/build/{TranslationPullCommand-CYAALEEV.js.map → TranslationPullCommand-7SO2URFQ.js.map} +0 -0
- /package/build/{TranslationPushCommand-4EUDIOM4.js.map → TranslationPushCommand-WFFRD6YT.js.map} +0 -0
- /package/build/{UninstallCommand-4UEFMKGE.js.map → UninstallCommand-D7G74MVR.js.map} +0 -0
- /package/build/{WhoamiCommand-AFLDEJMZ.js.map → WhoamiCommand-XLN4S4L2.js.map} +0 -0
- /package/build/{chunk-LFX6WS3B.js.map → chunk-2Q36TQPK.js.map} +0 -0
- /package/build/{chunk-GOCIJYL7.js.map → chunk-35FZKORJ.js.map} +0 -0
- /package/build/{chunk-SCQFHY4A.js.map → chunk-4BLGYECY.js.map} +0 -0
- /package/build/{chunk-3USR7ERV.js.map → chunk-4Q64IHNH.js.map} +0 -0
- /package/build/{chunk-JK5XXAQX.js.map → chunk-4VXSZ62N.js.map} +0 -0
- /package/build/{chunk-JWHJ7OLI.js.map → chunk-6IDTJWIT.js.map} +0 -0
- /package/build/{chunk-FTXPALCB.js.map → chunk-6KQHWT2P.js.map} +0 -0
- /package/build/{chunk-DBU3FYE4.js.map → chunk-6O7D3EEV.js.map} +0 -0
- /package/build/{chunk-22SU6O2P.js.map → chunk-6R4ALWJQ.js.map} +0 -0
- /package/build/{chunk-QZ7736TO.js.map → chunk-7GJBDAO5.js.map} +0 -0
- /package/build/{chunk-HEKVXBWZ.js.map → chunk-7UEVOXCQ.js.map} +0 -0
- /package/build/{chunk-526J7NQD.js.map → chunk-B4JR5SFD.js.map} +0 -0
- /package/build/{chunk-H74IDTCR.js.map → chunk-B7ZXL7I6.js.map} +0 -0
- /package/build/{chunk-XJE267QM.js.map → chunk-BQHRRQBX.js.map} +0 -0
- /package/build/{chunk-QVQMIH5X.js.map → chunk-BZKXTB4T.js.map} +0 -0
- /package/build/{chunk-4HM4GXIT.js.map → chunk-C2HRZPSU.js.map} +0 -0
- /package/build/{chunk-TOLFJFE7.js.map → chunk-DUVH7OZ3.js.map} +0 -0
- /package/build/{chunk-C6NTLNAT.js.map → chunk-EKYIDDQZ.js.map} +0 -0
- /package/build/{chunk-VZ3FZHJK.js.map → chunk-F4637D6J.js.map} +0 -0
- /package/build/{chunk-YTGCPERW.js.map → chunk-FAWKGNPX.js.map} +0 -0
- /package/build/{chunk-QTQWEMSZ.js.map → chunk-FL5Y77KR.js.map} +0 -0
- /package/build/{chunk-UF3RDBXA.js.map → chunk-FTJCTJ3H.js.map} +0 -0
- /package/build/{chunk-E45X4RFQ.js.map → chunk-FTOUPDNJ.js.map} +0 -0
- /package/build/{chunk-XCIXZDFH.js.map → chunk-FUXD5HKJ.js.map} +0 -0
- /package/build/{chunk-RBF5RKXJ.js.map → chunk-HEVQAPPA.js.map} +0 -0
- /package/build/{chunk-V2MRR3XI.js.map → chunk-HQCSHTDQ.js.map} +0 -0
- /package/build/{chunk-CIOBCAOI.js.map → chunk-HWDCTJMM.js.map} +0 -0
- /package/build/{chunk-MVIV6AJ7.js.map → chunk-IMJP2HSM.js.map} +0 -0
- /package/build/{chunk-G4TDZ7KU.js.map → chunk-IRHF3V5Y.js.map} +0 -0
- /package/build/{chunk-XTNCREFR.js.map → chunk-ITNZ4UGK.js.map} +0 -0
- /package/build/{chunk-XYXTYRGK.js.map → chunk-J3SUNJOV.js.map} +0 -0
- /package/build/{chunk-4EUYO6LF.js.map → chunk-JKO47YSE.js.map} +0 -0
- /package/build/{chunk-CJWIGDAC.js.map → chunk-KB3GWH37.js.map} +0 -0
- /package/build/{chunk-K72QYUHN.js.map → chunk-L4QZKYUD.js.map} +0 -0
- /package/build/{chunk-MK2ZHK32.js.map → chunk-LKTUI3ST.js.map} +0 -0
- /package/build/{chunk-TMZBOD2B.js.map → chunk-LU3R3EBR.js.map} +0 -0
- /package/build/{chunk-WHDJD2R3.js.map → chunk-M7WD5ZQK.js.map} +0 -0
- /package/build/{chunk-JKVSR6GG.js.map → chunk-MDXK4IXJ.js.map} +0 -0
- /package/build/{chunk-T6BKE35X.js.map → chunk-MXTO56FV.js.map} +0 -0
- /package/build/{chunk-JWVFFICN.js.map → chunk-NHAADNMH.js.map} +0 -0
- /package/build/{chunk-AS4VDEWN.js.map → chunk-P4S73OVC.js.map} +0 -0
- /package/build/{chunk-OWRWPLVG.js.map → chunk-PC4B6ELA.js.map} +0 -0
- /package/build/{chunk-7RE3MBIG.js.map → chunk-S2JYKNXU.js.map} +0 -0
- /package/build/{chunk-JJWBWHWO.js.map → chunk-SAIVMZIB.js.map} +0 -0
- /package/build/{chunk-YRSNPU5L.js.map → chunk-SDLCFZRL.js.map} +0 -0
- /package/build/{chunk-U53IU22M.js.map → chunk-SZCNTYRU.js.map} +0 -0
- /package/build/{chunk-V2542KTT.js.map → chunk-U666337H.js.map} +0 -0
- /package/build/{chunk-NO7FTQL7.js.map → chunk-UFW2PFO2.js.map} +0 -0
- /package/build/{chunk-2DKXIL7C.js.map → chunk-UURGNAJX.js.map} +0 -0
- /package/build/{chunk-X3JDCNCM.js.map → chunk-VW4KSJFB.js.map} +0 -0
- /package/build/{chunk-JHA55BW5.js.map → chunk-WLDYJSRX.js.map} +0 -0
- /package/build/{chunk-KEFW74AD.js.map → chunk-XAS2IV7X.js.map} +0 -0
- /package/build/{chunk-DR2IE2NL.js.map → chunk-XZUGLEBK.js.map} +0 -0
- /package/build/{chunk-KQQQHQ4W.js.map → chunk-YSUYAQ6O.js.map} +0 -0
- /package/build/{chunk-XTVDTH5G.js.map → chunk-YT5BPQDJ.js.map} +0 -0
- /package/build/{dev-V6QC5PH2.js.map → dev-ZWELVDKY.js.map} +0 -0
- /package/build/{install-SJTW6HNB.js.map → install-7QYGQXMN.js.map} +0 -0
- /package/build/{publish-FU3EXACH.js.map → publish-6TR7HI32.js.map} +0 -0
- /package/build/{render-command-WODH5K2G.js.map → render-command-2YCW5SOA.js.map} +0 -0
- /package/build/{render-command-FJDO7DAW.js.map → render-command-4AMXBW2Q.js.map} +0 -0
- /package/build/{render-command-2XQJZBJS.js.map → render-command-F5WLES7G.js.map} +0 -0
- /package/build/{render-command-5343MO3I.js.map → render-command-SR6H6HUZ.js.map} +0 -0
- /package/build/{render-command-ZX7FARMW.js.map → render-command-W7WD7F6D.js.map} +0 -0
- /package/build/{run-command-YCHA3NXK.js.map → run-command-THBEUJFU.js.map} +0 -0
- /package/build/{src-D4THTFS2.js.map → src-2XUFCZ7J.js.map} +0 -0
- /package/build/{src-NWN24JWL.js.map → src-7IKAOPE7.js.map} +0 -0
- /package/build/{src-IX36IWZF.js.map → src-DHTI77NY.js.map} +0 -0
- /package/build/{src-OWBBLJDF.js.map → src-HR56WUSP.js.map} +0 -0
- /package/build/{src-23YBI7FY.js.map → src-NXFYP3JX.js.map} +0 -0
- /package/build/{src-SBYT5BGZ.js.map → src-RQAKKX67.js.map} +0 -0
- /package/build/{sync-types-4OKZPCQM.js.map → sync-types-LBP6XSD7.js.map} +0 -0
- /package/build/{uninstall-C6GTQYNW.js.map → uninstall-CPOC7DUA.js.map} +0 -0
- /package/templates/astro/{react-component → editor-react-component}/dependencies.json +0 -0
|
@@ -0,0 +1,1766 @@
|
|
|
1
|
+
import { createRequire as _createRequire } from 'node:module';
|
|
2
|
+
const require = _createRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
ExtensionDataClient,
|
|
5
|
+
VALID_PATH_REGEX
|
|
6
|
+
} from "./chunk-MW53IRHO.js";
|
|
7
|
+
import {
|
|
8
|
+
log
|
|
9
|
+
} from "./chunk-35LXVE2A.js";
|
|
10
|
+
import "./chunk-SAIVMZIB.js";
|
|
11
|
+
import "./chunk-FAWKGNPX.js";
|
|
12
|
+
import {
|
|
13
|
+
createHttpClient,
|
|
14
|
+
isLoggedInToAccount
|
|
15
|
+
} from "./chunk-F4637D6J.js";
|
|
16
|
+
import "./chunk-PC4B6ELA.js";
|
|
17
|
+
import "./chunk-HWDCTJMM.js";
|
|
18
|
+
import "./chunk-RPTAJN5Y.js";
|
|
19
|
+
import "./chunk-UURGNAJX.js";
|
|
20
|
+
import "./chunk-7ZOEVDW3.js";
|
|
21
|
+
import "./chunk-AFPDHQYI.js";
|
|
22
|
+
import "./chunk-HYKBBZLS.js";
|
|
23
|
+
import "./chunk-C5RTKQVL.js";
|
|
24
|
+
import "./chunk-2Q36TQPK.js";
|
|
25
|
+
import "./chunk-YT5BPQDJ.js";
|
|
26
|
+
import "./chunk-LU3R3EBR.js";
|
|
27
|
+
import "./chunk-XZUGLEBK.js";
|
|
28
|
+
import "./chunk-NHAADNMH.js";
|
|
29
|
+
import {
|
|
30
|
+
ZodFirstPartyTypeKind,
|
|
31
|
+
ZodOptional,
|
|
32
|
+
external_exports
|
|
33
|
+
} from "./chunk-SDLCFZRL.js";
|
|
34
|
+
import {
|
|
35
|
+
CliError,
|
|
36
|
+
CliErrorCode
|
|
37
|
+
} from "./chunk-PIOT47FJ.js";
|
|
38
|
+
import {
|
|
39
|
+
init_esm_shims
|
|
40
|
+
} from "./chunk-EXLZF52D.js";
|
|
41
|
+
|
|
42
|
+
// ../cli-astro-commands/src/non-interactive/schema-generate-extensions.ts
|
|
43
|
+
init_esm_shims();
|
|
44
|
+
|
|
45
|
+
// ../cli-astro-commands/src/components/GenerateCommand/generate-schema/generateSchema.ts
|
|
46
|
+
init_esm_shims();
|
|
47
|
+
|
|
48
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/index.js
|
|
49
|
+
init_esm_shims();
|
|
50
|
+
|
|
51
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/Options.js
|
|
52
|
+
init_esm_shims();
|
|
53
|
+
var ignoreOverride = Symbol("Let zodToJsonSchema decide on which parser to use");
|
|
54
|
+
var defaultOptions = {
|
|
55
|
+
name: void 0,
|
|
56
|
+
$refStrategy: "root",
|
|
57
|
+
basePath: ["#"],
|
|
58
|
+
effectStrategy: "input",
|
|
59
|
+
pipeStrategy: "all",
|
|
60
|
+
dateStrategy: "format:date-time",
|
|
61
|
+
mapStrategy: "entries",
|
|
62
|
+
removeAdditionalStrategy: "passthrough",
|
|
63
|
+
definitionPath: "definitions",
|
|
64
|
+
target: "jsonSchema7",
|
|
65
|
+
strictUnions: false,
|
|
66
|
+
definitions: {},
|
|
67
|
+
errorMessages: false,
|
|
68
|
+
markdownDescription: false,
|
|
69
|
+
patternStrategy: "escape",
|
|
70
|
+
applyRegexFlags: false,
|
|
71
|
+
emailStrategy: "format:email",
|
|
72
|
+
base64Strategy: "contentEncoding:base64",
|
|
73
|
+
nameStrategy: "ref"
|
|
74
|
+
};
|
|
75
|
+
var getDefaultOptions = (options) => typeof options === "string" ? {
|
|
76
|
+
...defaultOptions,
|
|
77
|
+
name: options
|
|
78
|
+
} : {
|
|
79
|
+
...defaultOptions,
|
|
80
|
+
...options
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/Refs.js
|
|
84
|
+
init_esm_shims();
|
|
85
|
+
var getRefs = (options) => {
|
|
86
|
+
const _options = getDefaultOptions(options);
|
|
87
|
+
const currentPath = _options.name !== void 0 ? [..._options.basePath, _options.definitionPath, _options.name] : _options.basePath;
|
|
88
|
+
return {
|
|
89
|
+
..._options,
|
|
90
|
+
currentPath,
|
|
91
|
+
propertyPath: void 0,
|
|
92
|
+
seen: new Map(Object.entries(_options.definitions).map(([name, def]) => [
|
|
93
|
+
def._def,
|
|
94
|
+
{
|
|
95
|
+
def: def._def,
|
|
96
|
+
path: [..._options.basePath, _options.definitionPath, name],
|
|
97
|
+
// Resolution of references will be forced even though seen, so it's ok that the schema is undefined here for now.
|
|
98
|
+
jsonSchema: void 0
|
|
99
|
+
}
|
|
100
|
+
]))
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/errorMessages.js
|
|
105
|
+
init_esm_shims();
|
|
106
|
+
function addErrorMessage(res, key, errorMessage, refs) {
|
|
107
|
+
if (!refs?.errorMessages)
|
|
108
|
+
return;
|
|
109
|
+
if (errorMessage) {
|
|
110
|
+
res.errorMessage = {
|
|
111
|
+
...res.errorMessage,
|
|
112
|
+
[key]: errorMessage
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
function setResponseValueAndErrors(res, key, value, errorMessage, refs) {
|
|
117
|
+
res[key] = value;
|
|
118
|
+
addErrorMessage(res, key, errorMessage, refs);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/parseDef.js
|
|
122
|
+
init_esm_shims();
|
|
123
|
+
|
|
124
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/selectParser.js
|
|
125
|
+
init_esm_shims();
|
|
126
|
+
|
|
127
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/parsers/any.js
|
|
128
|
+
init_esm_shims();
|
|
129
|
+
function parseAnyDef() {
|
|
130
|
+
return {};
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/parsers/array.js
|
|
134
|
+
init_esm_shims();
|
|
135
|
+
function parseArrayDef(def, refs) {
|
|
136
|
+
const res = {
|
|
137
|
+
type: "array"
|
|
138
|
+
};
|
|
139
|
+
if (def.type?._def && def.type?._def?.typeName !== ZodFirstPartyTypeKind.ZodAny) {
|
|
140
|
+
res.items = parseDef(def.type._def, {
|
|
141
|
+
...refs,
|
|
142
|
+
currentPath: [...refs.currentPath, "items"]
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
if (def.minLength) {
|
|
146
|
+
setResponseValueAndErrors(res, "minItems", def.minLength.value, def.minLength.message, refs);
|
|
147
|
+
}
|
|
148
|
+
if (def.maxLength) {
|
|
149
|
+
setResponseValueAndErrors(res, "maxItems", def.maxLength.value, def.maxLength.message, refs);
|
|
150
|
+
}
|
|
151
|
+
if (def.exactLength) {
|
|
152
|
+
setResponseValueAndErrors(res, "minItems", def.exactLength.value, def.exactLength.message, refs);
|
|
153
|
+
setResponseValueAndErrors(res, "maxItems", def.exactLength.value, def.exactLength.message, refs);
|
|
154
|
+
}
|
|
155
|
+
return res;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js
|
|
159
|
+
init_esm_shims();
|
|
160
|
+
function parseBigintDef(def, refs) {
|
|
161
|
+
const res = {
|
|
162
|
+
type: "integer",
|
|
163
|
+
format: "int64"
|
|
164
|
+
};
|
|
165
|
+
if (!def.checks)
|
|
166
|
+
return res;
|
|
167
|
+
for (const check of def.checks) {
|
|
168
|
+
switch (check.kind) {
|
|
169
|
+
case "min":
|
|
170
|
+
if (refs.target === "jsonSchema7") {
|
|
171
|
+
if (check.inclusive) {
|
|
172
|
+
setResponseValueAndErrors(res, "minimum", check.value, check.message, refs);
|
|
173
|
+
} else {
|
|
174
|
+
setResponseValueAndErrors(res, "exclusiveMinimum", check.value, check.message, refs);
|
|
175
|
+
}
|
|
176
|
+
} else {
|
|
177
|
+
if (!check.inclusive) {
|
|
178
|
+
res.exclusiveMinimum = true;
|
|
179
|
+
}
|
|
180
|
+
setResponseValueAndErrors(res, "minimum", check.value, check.message, refs);
|
|
181
|
+
}
|
|
182
|
+
break;
|
|
183
|
+
case "max":
|
|
184
|
+
if (refs.target === "jsonSchema7") {
|
|
185
|
+
if (check.inclusive) {
|
|
186
|
+
setResponseValueAndErrors(res, "maximum", check.value, check.message, refs);
|
|
187
|
+
} else {
|
|
188
|
+
setResponseValueAndErrors(res, "exclusiveMaximum", check.value, check.message, refs);
|
|
189
|
+
}
|
|
190
|
+
} else {
|
|
191
|
+
if (!check.inclusive) {
|
|
192
|
+
res.exclusiveMaximum = true;
|
|
193
|
+
}
|
|
194
|
+
setResponseValueAndErrors(res, "maximum", check.value, check.message, refs);
|
|
195
|
+
}
|
|
196
|
+
break;
|
|
197
|
+
case "multipleOf":
|
|
198
|
+
setResponseValueAndErrors(res, "multipleOf", check.value, check.message, refs);
|
|
199
|
+
break;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
return res;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js
|
|
206
|
+
init_esm_shims();
|
|
207
|
+
function parseBooleanDef() {
|
|
208
|
+
return {
|
|
209
|
+
type: "boolean"
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/parsers/branded.js
|
|
214
|
+
init_esm_shims();
|
|
215
|
+
function parseBrandedDef(_def, refs) {
|
|
216
|
+
return parseDef(_def.type._def, refs);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/parsers/catch.js
|
|
220
|
+
init_esm_shims();
|
|
221
|
+
var parseCatchDef = (def, refs) => {
|
|
222
|
+
return parseDef(def.innerType._def, refs);
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/parsers/date.js
|
|
226
|
+
init_esm_shims();
|
|
227
|
+
function parseDateDef(def, refs, overrideDateStrategy) {
|
|
228
|
+
const strategy = overrideDateStrategy ?? refs.dateStrategy;
|
|
229
|
+
if (Array.isArray(strategy)) {
|
|
230
|
+
return {
|
|
231
|
+
anyOf: strategy.map((item, i) => parseDateDef(def, refs, item))
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
switch (strategy) {
|
|
235
|
+
case "string":
|
|
236
|
+
case "format:date-time":
|
|
237
|
+
return {
|
|
238
|
+
type: "string",
|
|
239
|
+
format: "date-time"
|
|
240
|
+
};
|
|
241
|
+
case "format:date":
|
|
242
|
+
return {
|
|
243
|
+
type: "string",
|
|
244
|
+
format: "date"
|
|
245
|
+
};
|
|
246
|
+
case "integer":
|
|
247
|
+
return integerDateParser(def, refs);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
var integerDateParser = (def, refs) => {
|
|
251
|
+
const res = {
|
|
252
|
+
type: "integer",
|
|
253
|
+
format: "unix-time"
|
|
254
|
+
};
|
|
255
|
+
if (refs.target === "openApi3") {
|
|
256
|
+
return res;
|
|
257
|
+
}
|
|
258
|
+
for (const check of def.checks) {
|
|
259
|
+
switch (check.kind) {
|
|
260
|
+
case "min":
|
|
261
|
+
setResponseValueAndErrors(
|
|
262
|
+
res,
|
|
263
|
+
"minimum",
|
|
264
|
+
check.value,
|
|
265
|
+
// This is in milliseconds
|
|
266
|
+
check.message,
|
|
267
|
+
refs
|
|
268
|
+
);
|
|
269
|
+
break;
|
|
270
|
+
case "max":
|
|
271
|
+
setResponseValueAndErrors(
|
|
272
|
+
res,
|
|
273
|
+
"maximum",
|
|
274
|
+
check.value,
|
|
275
|
+
// This is in milliseconds
|
|
276
|
+
check.message,
|
|
277
|
+
refs
|
|
278
|
+
);
|
|
279
|
+
break;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
return res;
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/parsers/default.js
|
|
286
|
+
init_esm_shims();
|
|
287
|
+
function parseDefaultDef(_def, refs) {
|
|
288
|
+
return {
|
|
289
|
+
...parseDef(_def.innerType._def, refs),
|
|
290
|
+
default: _def.defaultValue()
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/parsers/effects.js
|
|
295
|
+
init_esm_shims();
|
|
296
|
+
function parseEffectsDef(_def, refs) {
|
|
297
|
+
return refs.effectStrategy === "input" ? parseDef(_def.schema._def, refs) : {};
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/parsers/enum.js
|
|
301
|
+
init_esm_shims();
|
|
302
|
+
function parseEnumDef(def) {
|
|
303
|
+
return {
|
|
304
|
+
type: "string",
|
|
305
|
+
enum: Array.from(def.values)
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js
|
|
310
|
+
init_esm_shims();
|
|
311
|
+
var isJsonSchema7AllOfType = (type) => {
|
|
312
|
+
if ("type" in type && type.type === "string")
|
|
313
|
+
return false;
|
|
314
|
+
return "allOf" in type;
|
|
315
|
+
};
|
|
316
|
+
function parseIntersectionDef(def, refs) {
|
|
317
|
+
const allOf = [
|
|
318
|
+
parseDef(def.left._def, {
|
|
319
|
+
...refs,
|
|
320
|
+
currentPath: [...refs.currentPath, "allOf", "0"]
|
|
321
|
+
}),
|
|
322
|
+
parseDef(def.right._def, {
|
|
323
|
+
...refs,
|
|
324
|
+
currentPath: [...refs.currentPath, "allOf", "1"]
|
|
325
|
+
})
|
|
326
|
+
].filter((x) => !!x);
|
|
327
|
+
let unevaluatedProperties = refs.target === "jsonSchema2019-09" ? { unevaluatedProperties: false } : void 0;
|
|
328
|
+
const mergedAllOf = [];
|
|
329
|
+
allOf.forEach((schema) => {
|
|
330
|
+
if (isJsonSchema7AllOfType(schema)) {
|
|
331
|
+
mergedAllOf.push(...schema.allOf);
|
|
332
|
+
if (schema.unevaluatedProperties === void 0) {
|
|
333
|
+
unevaluatedProperties = void 0;
|
|
334
|
+
}
|
|
335
|
+
} else {
|
|
336
|
+
let nestedSchema = schema;
|
|
337
|
+
if ("additionalProperties" in schema && schema.additionalProperties === false) {
|
|
338
|
+
const { additionalProperties, ...rest } = schema;
|
|
339
|
+
nestedSchema = rest;
|
|
340
|
+
} else {
|
|
341
|
+
unevaluatedProperties = void 0;
|
|
342
|
+
}
|
|
343
|
+
mergedAllOf.push(nestedSchema);
|
|
344
|
+
}
|
|
345
|
+
});
|
|
346
|
+
return mergedAllOf.length ? {
|
|
347
|
+
allOf: mergedAllOf,
|
|
348
|
+
...unevaluatedProperties
|
|
349
|
+
} : void 0;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/parsers/literal.js
|
|
353
|
+
init_esm_shims();
|
|
354
|
+
function parseLiteralDef(def, refs) {
|
|
355
|
+
const parsedType = typeof def.value;
|
|
356
|
+
if (parsedType !== "bigint" && parsedType !== "number" && parsedType !== "boolean" && parsedType !== "string") {
|
|
357
|
+
return {
|
|
358
|
+
type: Array.isArray(def.value) ? "array" : "object"
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
if (refs.target === "openApi3") {
|
|
362
|
+
return {
|
|
363
|
+
type: parsedType === "bigint" ? "integer" : parsedType,
|
|
364
|
+
enum: [def.value]
|
|
365
|
+
};
|
|
366
|
+
}
|
|
367
|
+
return {
|
|
368
|
+
type: parsedType === "bigint" ? "integer" : parsedType,
|
|
369
|
+
const: def.value
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/parsers/map.js
|
|
374
|
+
init_esm_shims();
|
|
375
|
+
|
|
376
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/parsers/record.js
|
|
377
|
+
init_esm_shims();
|
|
378
|
+
|
|
379
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/parsers/string.js
|
|
380
|
+
init_esm_shims();
|
|
381
|
+
var emojiRegex = void 0;
|
|
382
|
+
var zodPatterns = {
|
|
383
|
+
/**
|
|
384
|
+
* `c` was changed to `[cC]` to replicate /i flag
|
|
385
|
+
*/
|
|
386
|
+
cuid: /^[cC][^\s-]{8,}$/,
|
|
387
|
+
cuid2: /^[0-9a-z]+$/,
|
|
388
|
+
ulid: /^[0-9A-HJKMNP-TV-Z]{26}$/,
|
|
389
|
+
/**
|
|
390
|
+
* `a-z` was added to replicate /i flag
|
|
391
|
+
*/
|
|
392
|
+
email: /^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,
|
|
393
|
+
/**
|
|
394
|
+
* Constructed a valid Unicode RegExp
|
|
395
|
+
*
|
|
396
|
+
* Lazily instantiate since this type of regex isn't supported
|
|
397
|
+
* in all envs (e.g. React Native).
|
|
398
|
+
*
|
|
399
|
+
* See:
|
|
400
|
+
* https://github.com/colinhacks/zod/issues/2433
|
|
401
|
+
* Fix in Zod:
|
|
402
|
+
* https://github.com/colinhacks/zod/commit/9340fd51e48576a75adc919bff65dbc4a5d4c99b
|
|
403
|
+
*/
|
|
404
|
+
emoji: () => {
|
|
405
|
+
if (emojiRegex === void 0) {
|
|
406
|
+
emojiRegex = RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u");
|
|
407
|
+
}
|
|
408
|
+
return emojiRegex;
|
|
409
|
+
},
|
|
410
|
+
/**
|
|
411
|
+
* Unused
|
|
412
|
+
*/
|
|
413
|
+
uuid: /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,
|
|
414
|
+
/**
|
|
415
|
+
* Unused
|
|
416
|
+
*/
|
|
417
|
+
ipv4: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,
|
|
418
|
+
ipv4Cidr: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,
|
|
419
|
+
/**
|
|
420
|
+
* Unused
|
|
421
|
+
*/
|
|
422
|
+
ipv6: /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,
|
|
423
|
+
ipv6Cidr: /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,
|
|
424
|
+
base64: /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,
|
|
425
|
+
base64url: /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,
|
|
426
|
+
nanoid: /^[a-zA-Z0-9_-]{21}$/,
|
|
427
|
+
jwt: /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/
|
|
428
|
+
};
|
|
429
|
+
function parseStringDef(def, refs) {
|
|
430
|
+
const res = {
|
|
431
|
+
type: "string"
|
|
432
|
+
};
|
|
433
|
+
if (def.checks) {
|
|
434
|
+
for (const check of def.checks) {
|
|
435
|
+
switch (check.kind) {
|
|
436
|
+
case "min":
|
|
437
|
+
setResponseValueAndErrors(res, "minLength", typeof res.minLength === "number" ? Math.max(res.minLength, check.value) : check.value, check.message, refs);
|
|
438
|
+
break;
|
|
439
|
+
case "max":
|
|
440
|
+
setResponseValueAndErrors(res, "maxLength", typeof res.maxLength === "number" ? Math.min(res.maxLength, check.value) : check.value, check.message, refs);
|
|
441
|
+
break;
|
|
442
|
+
case "email":
|
|
443
|
+
switch (refs.emailStrategy) {
|
|
444
|
+
case "format:email":
|
|
445
|
+
addFormat(res, "email", check.message, refs);
|
|
446
|
+
break;
|
|
447
|
+
case "format:idn-email":
|
|
448
|
+
addFormat(res, "idn-email", check.message, refs);
|
|
449
|
+
break;
|
|
450
|
+
case "pattern:zod":
|
|
451
|
+
addPattern(res, zodPatterns.email, check.message, refs);
|
|
452
|
+
break;
|
|
453
|
+
}
|
|
454
|
+
break;
|
|
455
|
+
case "url":
|
|
456
|
+
addFormat(res, "uri", check.message, refs);
|
|
457
|
+
break;
|
|
458
|
+
case "uuid":
|
|
459
|
+
addFormat(res, "uuid", check.message, refs);
|
|
460
|
+
break;
|
|
461
|
+
case "regex":
|
|
462
|
+
addPattern(res, check.regex, check.message, refs);
|
|
463
|
+
break;
|
|
464
|
+
case "cuid":
|
|
465
|
+
addPattern(res, zodPatterns.cuid, check.message, refs);
|
|
466
|
+
break;
|
|
467
|
+
case "cuid2":
|
|
468
|
+
addPattern(res, zodPatterns.cuid2, check.message, refs);
|
|
469
|
+
break;
|
|
470
|
+
case "startsWith":
|
|
471
|
+
addPattern(res, RegExp(`^${escapeLiteralCheckValue(check.value, refs)}`), check.message, refs);
|
|
472
|
+
break;
|
|
473
|
+
case "endsWith":
|
|
474
|
+
addPattern(res, RegExp(`${escapeLiteralCheckValue(check.value, refs)}$`), check.message, refs);
|
|
475
|
+
break;
|
|
476
|
+
case "datetime":
|
|
477
|
+
addFormat(res, "date-time", check.message, refs);
|
|
478
|
+
break;
|
|
479
|
+
case "date":
|
|
480
|
+
addFormat(res, "date", check.message, refs);
|
|
481
|
+
break;
|
|
482
|
+
case "time":
|
|
483
|
+
addFormat(res, "time", check.message, refs);
|
|
484
|
+
break;
|
|
485
|
+
case "duration":
|
|
486
|
+
addFormat(res, "duration", check.message, refs);
|
|
487
|
+
break;
|
|
488
|
+
case "length":
|
|
489
|
+
setResponseValueAndErrors(res, "minLength", typeof res.minLength === "number" ? Math.max(res.minLength, check.value) : check.value, check.message, refs);
|
|
490
|
+
setResponseValueAndErrors(res, "maxLength", typeof res.maxLength === "number" ? Math.min(res.maxLength, check.value) : check.value, check.message, refs);
|
|
491
|
+
break;
|
|
492
|
+
case "includes": {
|
|
493
|
+
addPattern(res, RegExp(escapeLiteralCheckValue(check.value, refs)), check.message, refs);
|
|
494
|
+
break;
|
|
495
|
+
}
|
|
496
|
+
case "ip": {
|
|
497
|
+
if (check.version !== "v6") {
|
|
498
|
+
addFormat(res, "ipv4", check.message, refs);
|
|
499
|
+
}
|
|
500
|
+
if (check.version !== "v4") {
|
|
501
|
+
addFormat(res, "ipv6", check.message, refs);
|
|
502
|
+
}
|
|
503
|
+
break;
|
|
504
|
+
}
|
|
505
|
+
case "base64url":
|
|
506
|
+
addPattern(res, zodPatterns.base64url, check.message, refs);
|
|
507
|
+
break;
|
|
508
|
+
case "jwt":
|
|
509
|
+
addPattern(res, zodPatterns.jwt, check.message, refs);
|
|
510
|
+
break;
|
|
511
|
+
case "cidr": {
|
|
512
|
+
if (check.version !== "v6") {
|
|
513
|
+
addPattern(res, zodPatterns.ipv4Cidr, check.message, refs);
|
|
514
|
+
}
|
|
515
|
+
if (check.version !== "v4") {
|
|
516
|
+
addPattern(res, zodPatterns.ipv6Cidr, check.message, refs);
|
|
517
|
+
}
|
|
518
|
+
break;
|
|
519
|
+
}
|
|
520
|
+
case "emoji":
|
|
521
|
+
addPattern(res, zodPatterns.emoji(), check.message, refs);
|
|
522
|
+
break;
|
|
523
|
+
case "ulid": {
|
|
524
|
+
addPattern(res, zodPatterns.ulid, check.message, refs);
|
|
525
|
+
break;
|
|
526
|
+
}
|
|
527
|
+
case "base64": {
|
|
528
|
+
switch (refs.base64Strategy) {
|
|
529
|
+
case "format:binary": {
|
|
530
|
+
addFormat(res, "binary", check.message, refs);
|
|
531
|
+
break;
|
|
532
|
+
}
|
|
533
|
+
case "contentEncoding:base64": {
|
|
534
|
+
setResponseValueAndErrors(res, "contentEncoding", "base64", check.message, refs);
|
|
535
|
+
break;
|
|
536
|
+
}
|
|
537
|
+
case "pattern:zod": {
|
|
538
|
+
addPattern(res, zodPatterns.base64, check.message, refs);
|
|
539
|
+
break;
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
break;
|
|
543
|
+
}
|
|
544
|
+
case "nanoid": {
|
|
545
|
+
addPattern(res, zodPatterns.nanoid, check.message, refs);
|
|
546
|
+
}
|
|
547
|
+
case "toLowerCase":
|
|
548
|
+
case "toUpperCase":
|
|
549
|
+
case "trim":
|
|
550
|
+
break;
|
|
551
|
+
default:
|
|
552
|
+
/* @__PURE__ */ ((_) => {
|
|
553
|
+
})(check);
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
return res;
|
|
558
|
+
}
|
|
559
|
+
function escapeLiteralCheckValue(literal, refs) {
|
|
560
|
+
return refs.patternStrategy === "escape" ? escapeNonAlphaNumeric(literal) : literal;
|
|
561
|
+
}
|
|
562
|
+
var ALPHA_NUMERIC = new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
|
|
563
|
+
function escapeNonAlphaNumeric(source) {
|
|
564
|
+
let result = "";
|
|
565
|
+
for (let i = 0; i < source.length; i++) {
|
|
566
|
+
if (!ALPHA_NUMERIC.has(source[i])) {
|
|
567
|
+
result += "\\";
|
|
568
|
+
}
|
|
569
|
+
result += source[i];
|
|
570
|
+
}
|
|
571
|
+
return result;
|
|
572
|
+
}
|
|
573
|
+
function addFormat(schema, value, message, refs) {
|
|
574
|
+
if (schema.format || schema.anyOf?.some((x) => x.format)) {
|
|
575
|
+
if (!schema.anyOf) {
|
|
576
|
+
schema.anyOf = [];
|
|
577
|
+
}
|
|
578
|
+
if (schema.format) {
|
|
579
|
+
schema.anyOf.push({
|
|
580
|
+
format: schema.format,
|
|
581
|
+
...schema.errorMessage && refs.errorMessages && {
|
|
582
|
+
errorMessage: { format: schema.errorMessage.format }
|
|
583
|
+
}
|
|
584
|
+
});
|
|
585
|
+
delete schema.format;
|
|
586
|
+
if (schema.errorMessage) {
|
|
587
|
+
delete schema.errorMessage.format;
|
|
588
|
+
if (Object.keys(schema.errorMessage).length === 0) {
|
|
589
|
+
delete schema.errorMessage;
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
schema.anyOf.push({
|
|
594
|
+
format: value,
|
|
595
|
+
...message && refs.errorMessages && { errorMessage: { format: message } }
|
|
596
|
+
});
|
|
597
|
+
} else {
|
|
598
|
+
setResponseValueAndErrors(schema, "format", value, message, refs);
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
function addPattern(schema, regex, message, refs) {
|
|
602
|
+
if (schema.pattern || schema.allOf?.some((x) => x.pattern)) {
|
|
603
|
+
if (!schema.allOf) {
|
|
604
|
+
schema.allOf = [];
|
|
605
|
+
}
|
|
606
|
+
if (schema.pattern) {
|
|
607
|
+
schema.allOf.push({
|
|
608
|
+
pattern: schema.pattern,
|
|
609
|
+
...schema.errorMessage && refs.errorMessages && {
|
|
610
|
+
errorMessage: { pattern: schema.errorMessage.pattern }
|
|
611
|
+
}
|
|
612
|
+
});
|
|
613
|
+
delete schema.pattern;
|
|
614
|
+
if (schema.errorMessage) {
|
|
615
|
+
delete schema.errorMessage.pattern;
|
|
616
|
+
if (Object.keys(schema.errorMessage).length === 0) {
|
|
617
|
+
delete schema.errorMessage;
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
schema.allOf.push({
|
|
622
|
+
pattern: stringifyRegExpWithFlags(regex, refs),
|
|
623
|
+
...message && refs.errorMessages && { errorMessage: { pattern: message } }
|
|
624
|
+
});
|
|
625
|
+
} else {
|
|
626
|
+
setResponseValueAndErrors(schema, "pattern", stringifyRegExpWithFlags(regex, refs), message, refs);
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
function stringifyRegExpWithFlags(regex, refs) {
|
|
630
|
+
if (!refs.applyRegexFlags || !regex.flags) {
|
|
631
|
+
return regex.source;
|
|
632
|
+
}
|
|
633
|
+
const flags = {
|
|
634
|
+
i: regex.flags.includes("i"),
|
|
635
|
+
m: regex.flags.includes("m"),
|
|
636
|
+
s: regex.flags.includes("s")
|
|
637
|
+
// `.` matches newlines
|
|
638
|
+
};
|
|
639
|
+
const source = flags.i ? regex.source.toLowerCase() : regex.source;
|
|
640
|
+
let pattern = "";
|
|
641
|
+
let isEscaped = false;
|
|
642
|
+
let inCharGroup = false;
|
|
643
|
+
let inCharRange = false;
|
|
644
|
+
for (let i = 0; i < source.length; i++) {
|
|
645
|
+
if (isEscaped) {
|
|
646
|
+
pattern += source[i];
|
|
647
|
+
isEscaped = false;
|
|
648
|
+
continue;
|
|
649
|
+
}
|
|
650
|
+
if (flags.i) {
|
|
651
|
+
if (inCharGroup) {
|
|
652
|
+
if (source[i].match(/[a-z]/)) {
|
|
653
|
+
if (inCharRange) {
|
|
654
|
+
pattern += source[i];
|
|
655
|
+
pattern += `${source[i - 2]}-${source[i]}`.toUpperCase();
|
|
656
|
+
inCharRange = false;
|
|
657
|
+
} else if (source[i + 1] === "-" && source[i + 2]?.match(/[a-z]/)) {
|
|
658
|
+
pattern += source[i];
|
|
659
|
+
inCharRange = true;
|
|
660
|
+
} else {
|
|
661
|
+
pattern += `${source[i]}${source[i].toUpperCase()}`;
|
|
662
|
+
}
|
|
663
|
+
continue;
|
|
664
|
+
}
|
|
665
|
+
} else if (source[i].match(/[a-z]/)) {
|
|
666
|
+
pattern += `[${source[i]}${source[i].toUpperCase()}]`;
|
|
667
|
+
continue;
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
if (flags.m) {
|
|
671
|
+
if (source[i] === "^") {
|
|
672
|
+
pattern += `(^|(?<=[\r
|
|
673
|
+
]))`;
|
|
674
|
+
continue;
|
|
675
|
+
} else if (source[i] === "$") {
|
|
676
|
+
pattern += `($|(?=[\r
|
|
677
|
+
]))`;
|
|
678
|
+
continue;
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
if (flags.s && source[i] === ".") {
|
|
682
|
+
pattern += inCharGroup ? `${source[i]}\r
|
|
683
|
+
` : `[${source[i]}\r
|
|
684
|
+
]`;
|
|
685
|
+
continue;
|
|
686
|
+
}
|
|
687
|
+
pattern += source[i];
|
|
688
|
+
if (source[i] === "\\") {
|
|
689
|
+
isEscaped = true;
|
|
690
|
+
} else if (inCharGroup && source[i] === "]") {
|
|
691
|
+
inCharGroup = false;
|
|
692
|
+
} else if (!inCharGroup && source[i] === "[") {
|
|
693
|
+
inCharGroup = true;
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
try {
|
|
697
|
+
new RegExp(pattern);
|
|
698
|
+
} catch {
|
|
699
|
+
console.warn(`Could not convert regex pattern at ${refs.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`);
|
|
700
|
+
return regex.source;
|
|
701
|
+
}
|
|
702
|
+
return pattern;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/parsers/record.js
|
|
706
|
+
function parseRecordDef(def, refs) {
|
|
707
|
+
if (refs.target === "openAi") {
|
|
708
|
+
console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");
|
|
709
|
+
}
|
|
710
|
+
if (refs.target === "openApi3" && def.keyType?._def.typeName === ZodFirstPartyTypeKind.ZodEnum) {
|
|
711
|
+
return {
|
|
712
|
+
type: "object",
|
|
713
|
+
required: def.keyType._def.values,
|
|
714
|
+
properties: def.keyType._def.values.reduce((acc, key) => ({
|
|
715
|
+
...acc,
|
|
716
|
+
[key]: parseDef(def.valueType._def, {
|
|
717
|
+
...refs,
|
|
718
|
+
currentPath: [...refs.currentPath, "properties", key]
|
|
719
|
+
}) ?? {}
|
|
720
|
+
}), {}),
|
|
721
|
+
additionalProperties: false
|
|
722
|
+
};
|
|
723
|
+
}
|
|
724
|
+
const schema = {
|
|
725
|
+
type: "object",
|
|
726
|
+
additionalProperties: parseDef(def.valueType._def, {
|
|
727
|
+
...refs,
|
|
728
|
+
currentPath: [...refs.currentPath, "additionalProperties"]
|
|
729
|
+
}) ?? {}
|
|
730
|
+
};
|
|
731
|
+
if (refs.target === "openApi3") {
|
|
732
|
+
return schema;
|
|
733
|
+
}
|
|
734
|
+
if (def.keyType?._def.typeName === ZodFirstPartyTypeKind.ZodString && def.keyType._def.checks?.length) {
|
|
735
|
+
const { type, ...keyType } = parseStringDef(def.keyType._def, refs);
|
|
736
|
+
return {
|
|
737
|
+
...schema,
|
|
738
|
+
propertyNames: keyType
|
|
739
|
+
};
|
|
740
|
+
} else if (def.keyType?._def.typeName === ZodFirstPartyTypeKind.ZodEnum) {
|
|
741
|
+
return {
|
|
742
|
+
...schema,
|
|
743
|
+
propertyNames: {
|
|
744
|
+
enum: def.keyType._def.values
|
|
745
|
+
}
|
|
746
|
+
};
|
|
747
|
+
} else if (def.keyType?._def.typeName === ZodFirstPartyTypeKind.ZodBranded && def.keyType._def.type._def.typeName === ZodFirstPartyTypeKind.ZodString && def.keyType._def.type._def.checks?.length) {
|
|
748
|
+
const { type, ...keyType } = parseBrandedDef(def.keyType._def, refs);
|
|
749
|
+
return {
|
|
750
|
+
...schema,
|
|
751
|
+
propertyNames: keyType
|
|
752
|
+
};
|
|
753
|
+
}
|
|
754
|
+
return schema;
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/parsers/map.js
|
|
758
|
+
function parseMapDef(def, refs) {
|
|
759
|
+
if (refs.mapStrategy === "record") {
|
|
760
|
+
return parseRecordDef(def, refs);
|
|
761
|
+
}
|
|
762
|
+
const keys = parseDef(def.keyType._def, {
|
|
763
|
+
...refs,
|
|
764
|
+
currentPath: [...refs.currentPath, "items", "items", "0"]
|
|
765
|
+
}) || {};
|
|
766
|
+
const values = parseDef(def.valueType._def, {
|
|
767
|
+
...refs,
|
|
768
|
+
currentPath: [...refs.currentPath, "items", "items", "1"]
|
|
769
|
+
}) || {};
|
|
770
|
+
return {
|
|
771
|
+
type: "array",
|
|
772
|
+
maxItems: 125,
|
|
773
|
+
items: {
|
|
774
|
+
type: "array",
|
|
775
|
+
items: [keys, values],
|
|
776
|
+
minItems: 2,
|
|
777
|
+
maxItems: 2
|
|
778
|
+
}
|
|
779
|
+
};
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js
|
|
783
|
+
init_esm_shims();
|
|
784
|
+
function parseNativeEnumDef(def) {
|
|
785
|
+
const object = def.values;
|
|
786
|
+
const actualKeys = Object.keys(def.values).filter((key) => {
|
|
787
|
+
return typeof object[object[key]] !== "number";
|
|
788
|
+
});
|
|
789
|
+
const actualValues = actualKeys.map((key) => object[key]);
|
|
790
|
+
const parsedTypes = Array.from(new Set(actualValues.map((values) => typeof values)));
|
|
791
|
+
return {
|
|
792
|
+
type: parsedTypes.length === 1 ? parsedTypes[0] === "string" ? "string" : "number" : ["string", "number"],
|
|
793
|
+
enum: actualValues
|
|
794
|
+
};
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/parsers/never.js
|
|
798
|
+
init_esm_shims();
|
|
799
|
+
function parseNeverDef() {
|
|
800
|
+
return {
|
|
801
|
+
not: {}
|
|
802
|
+
};
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/parsers/null.js
|
|
806
|
+
init_esm_shims();
|
|
807
|
+
function parseNullDef(refs) {
|
|
808
|
+
return refs.target === "openApi3" ? {
|
|
809
|
+
enum: ["null"],
|
|
810
|
+
nullable: true
|
|
811
|
+
} : {
|
|
812
|
+
type: "null"
|
|
813
|
+
};
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js
|
|
817
|
+
init_esm_shims();
|
|
818
|
+
|
|
819
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/parsers/union.js
|
|
820
|
+
init_esm_shims();
|
|
821
|
+
var primitiveMappings = {
|
|
822
|
+
ZodString: "string",
|
|
823
|
+
ZodNumber: "number",
|
|
824
|
+
ZodBigInt: "integer",
|
|
825
|
+
ZodBoolean: "boolean",
|
|
826
|
+
ZodNull: "null"
|
|
827
|
+
};
|
|
828
|
+
function parseUnionDef(def, refs) {
|
|
829
|
+
if (refs.target === "openApi3")
|
|
830
|
+
return asAnyOf(def, refs);
|
|
831
|
+
const options = def.options instanceof Map ? Array.from(def.options.values()) : def.options;
|
|
832
|
+
if (options.every((x) => x._def.typeName in primitiveMappings && (!x._def.checks || !x._def.checks.length))) {
|
|
833
|
+
const types = options.reduce((types2, x) => {
|
|
834
|
+
const type = primitiveMappings[x._def.typeName];
|
|
835
|
+
return type && !types2.includes(type) ? [...types2, type] : types2;
|
|
836
|
+
}, []);
|
|
837
|
+
return {
|
|
838
|
+
type: types.length > 1 ? types : types[0]
|
|
839
|
+
};
|
|
840
|
+
} else if (options.every((x) => x._def.typeName === "ZodLiteral" && !x.description)) {
|
|
841
|
+
const types = options.reduce((acc, x) => {
|
|
842
|
+
const type = typeof x._def.value;
|
|
843
|
+
switch (type) {
|
|
844
|
+
case "string":
|
|
845
|
+
case "number":
|
|
846
|
+
case "boolean":
|
|
847
|
+
return [...acc, type];
|
|
848
|
+
case "bigint":
|
|
849
|
+
return [...acc, "integer"];
|
|
850
|
+
case "object":
|
|
851
|
+
if (x._def.value === null)
|
|
852
|
+
return [...acc, "null"];
|
|
853
|
+
case "symbol":
|
|
854
|
+
case "undefined":
|
|
855
|
+
case "function":
|
|
856
|
+
default:
|
|
857
|
+
return acc;
|
|
858
|
+
}
|
|
859
|
+
}, []);
|
|
860
|
+
if (types.length === options.length) {
|
|
861
|
+
const uniqueTypes = types.filter((x, i, a) => a.indexOf(x) === i);
|
|
862
|
+
return {
|
|
863
|
+
type: uniqueTypes.length > 1 ? uniqueTypes : uniqueTypes[0],
|
|
864
|
+
enum: options.reduce((acc, x) => {
|
|
865
|
+
return acc.includes(x._def.value) ? acc : [...acc, x._def.value];
|
|
866
|
+
}, [])
|
|
867
|
+
};
|
|
868
|
+
}
|
|
869
|
+
} else if (options.every((x) => x._def.typeName === "ZodEnum")) {
|
|
870
|
+
return {
|
|
871
|
+
type: "string",
|
|
872
|
+
enum: options.reduce((acc, x) => [
|
|
873
|
+
...acc,
|
|
874
|
+
...x._def.values.filter((x2) => !acc.includes(x2))
|
|
875
|
+
], [])
|
|
876
|
+
};
|
|
877
|
+
}
|
|
878
|
+
return asAnyOf(def, refs);
|
|
879
|
+
}
|
|
880
|
+
var asAnyOf = (def, refs) => {
|
|
881
|
+
const anyOf = (def.options instanceof Map ? Array.from(def.options.values()) : def.options).map((x, i) => parseDef(x._def, {
|
|
882
|
+
...refs,
|
|
883
|
+
currentPath: [...refs.currentPath, "anyOf", `${i}`]
|
|
884
|
+
})).filter((x) => !!x && (!refs.strictUnions || typeof x === "object" && Object.keys(x).length > 0));
|
|
885
|
+
return anyOf.length ? { anyOf } : void 0;
|
|
886
|
+
};
|
|
887
|
+
|
|
888
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js
|
|
889
|
+
function parseNullableDef(def, refs) {
|
|
890
|
+
if (["ZodString", "ZodNumber", "ZodBigInt", "ZodBoolean", "ZodNull"].includes(def.innerType._def.typeName) && (!def.innerType._def.checks || !def.innerType._def.checks.length)) {
|
|
891
|
+
if (refs.target === "openApi3") {
|
|
892
|
+
return {
|
|
893
|
+
type: primitiveMappings[def.innerType._def.typeName],
|
|
894
|
+
nullable: true
|
|
895
|
+
};
|
|
896
|
+
}
|
|
897
|
+
return {
|
|
898
|
+
type: [
|
|
899
|
+
primitiveMappings[def.innerType._def.typeName],
|
|
900
|
+
"null"
|
|
901
|
+
]
|
|
902
|
+
};
|
|
903
|
+
}
|
|
904
|
+
if (refs.target === "openApi3") {
|
|
905
|
+
const base2 = parseDef(def.innerType._def, {
|
|
906
|
+
...refs,
|
|
907
|
+
currentPath: [...refs.currentPath]
|
|
908
|
+
});
|
|
909
|
+
if (base2 && "$ref" in base2)
|
|
910
|
+
return { allOf: [base2], nullable: true };
|
|
911
|
+
return base2 && { ...base2, nullable: true };
|
|
912
|
+
}
|
|
913
|
+
const base = parseDef(def.innerType._def, {
|
|
914
|
+
...refs,
|
|
915
|
+
currentPath: [...refs.currentPath, "anyOf", "0"]
|
|
916
|
+
});
|
|
917
|
+
return base && { anyOf: [base, { type: "null" }] };
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/parsers/number.js
|
|
921
|
+
init_esm_shims();
|
|
922
|
+
function parseNumberDef(def, refs) {
|
|
923
|
+
const res = {
|
|
924
|
+
type: "number"
|
|
925
|
+
};
|
|
926
|
+
if (!def.checks)
|
|
927
|
+
return res;
|
|
928
|
+
for (const check of def.checks) {
|
|
929
|
+
switch (check.kind) {
|
|
930
|
+
case "int":
|
|
931
|
+
res.type = "integer";
|
|
932
|
+
addErrorMessage(res, "type", check.message, refs);
|
|
933
|
+
break;
|
|
934
|
+
case "min":
|
|
935
|
+
if (refs.target === "jsonSchema7") {
|
|
936
|
+
if (check.inclusive) {
|
|
937
|
+
setResponseValueAndErrors(res, "minimum", check.value, check.message, refs);
|
|
938
|
+
} else {
|
|
939
|
+
setResponseValueAndErrors(res, "exclusiveMinimum", check.value, check.message, refs);
|
|
940
|
+
}
|
|
941
|
+
} else {
|
|
942
|
+
if (!check.inclusive) {
|
|
943
|
+
res.exclusiveMinimum = true;
|
|
944
|
+
}
|
|
945
|
+
setResponseValueAndErrors(res, "minimum", check.value, check.message, refs);
|
|
946
|
+
}
|
|
947
|
+
break;
|
|
948
|
+
case "max":
|
|
949
|
+
if (refs.target === "jsonSchema7") {
|
|
950
|
+
if (check.inclusive) {
|
|
951
|
+
setResponseValueAndErrors(res, "maximum", check.value, check.message, refs);
|
|
952
|
+
} else {
|
|
953
|
+
setResponseValueAndErrors(res, "exclusiveMaximum", check.value, check.message, refs);
|
|
954
|
+
}
|
|
955
|
+
} else {
|
|
956
|
+
if (!check.inclusive) {
|
|
957
|
+
res.exclusiveMaximum = true;
|
|
958
|
+
}
|
|
959
|
+
setResponseValueAndErrors(res, "maximum", check.value, check.message, refs);
|
|
960
|
+
}
|
|
961
|
+
break;
|
|
962
|
+
case "multipleOf":
|
|
963
|
+
setResponseValueAndErrors(res, "multipleOf", check.value, check.message, refs);
|
|
964
|
+
break;
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
return res;
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/parsers/object.js
|
|
971
|
+
init_esm_shims();
|
|
972
|
+
function decideAdditionalProperties(def, refs) {
|
|
973
|
+
if (refs.removeAdditionalStrategy === "strict") {
|
|
974
|
+
return def.catchall._def.typeName === "ZodNever" ? def.unknownKeys !== "strict" : parseDef(def.catchall._def, {
|
|
975
|
+
...refs,
|
|
976
|
+
currentPath: [...refs.currentPath, "additionalProperties"]
|
|
977
|
+
}) ?? true;
|
|
978
|
+
} else {
|
|
979
|
+
return def.catchall._def.typeName === "ZodNever" ? def.unknownKeys === "passthrough" : parseDef(def.catchall._def, {
|
|
980
|
+
...refs,
|
|
981
|
+
currentPath: [...refs.currentPath, "additionalProperties"]
|
|
982
|
+
}) ?? true;
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
function parseObjectDef(def, refs) {
|
|
986
|
+
const forceOptionalIntoNullable = refs.target === "openAi";
|
|
987
|
+
const result = {
|
|
988
|
+
type: "object",
|
|
989
|
+
...Object.entries(def.shape()).reduce((acc, [propName, propDef]) => {
|
|
990
|
+
if (propDef === void 0 || propDef._def === void 0)
|
|
991
|
+
return acc;
|
|
992
|
+
let propOptional = propDef.isOptional();
|
|
993
|
+
if (propOptional && forceOptionalIntoNullable) {
|
|
994
|
+
if (propDef instanceof ZodOptional) {
|
|
995
|
+
propDef = propDef._def.innerType;
|
|
996
|
+
}
|
|
997
|
+
if (!propDef.isNullable()) {
|
|
998
|
+
propDef = propDef.nullable();
|
|
999
|
+
}
|
|
1000
|
+
propOptional = false;
|
|
1001
|
+
}
|
|
1002
|
+
const parsedDef = parseDef(propDef._def, {
|
|
1003
|
+
...refs,
|
|
1004
|
+
currentPath: [...refs.currentPath, "properties", propName],
|
|
1005
|
+
propertyPath: [...refs.currentPath, "properties", propName]
|
|
1006
|
+
});
|
|
1007
|
+
if (parsedDef === void 0)
|
|
1008
|
+
return acc;
|
|
1009
|
+
return {
|
|
1010
|
+
properties: { ...acc.properties, [propName]: parsedDef },
|
|
1011
|
+
required: propOptional ? acc.required : [...acc.required, propName]
|
|
1012
|
+
};
|
|
1013
|
+
}, { properties: {}, required: [] }),
|
|
1014
|
+
additionalProperties: decideAdditionalProperties(def, refs)
|
|
1015
|
+
};
|
|
1016
|
+
if (!result.required.length)
|
|
1017
|
+
delete result.required;
|
|
1018
|
+
return result;
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/parsers/optional.js
|
|
1022
|
+
init_esm_shims();
|
|
1023
|
+
var parseOptionalDef = (def, refs) => {
|
|
1024
|
+
if (refs.currentPath.toString() === refs.propertyPath?.toString()) {
|
|
1025
|
+
return parseDef(def.innerType._def, refs);
|
|
1026
|
+
}
|
|
1027
|
+
const innerSchema = parseDef(def.innerType._def, {
|
|
1028
|
+
...refs,
|
|
1029
|
+
currentPath: [...refs.currentPath, "anyOf", "1"]
|
|
1030
|
+
});
|
|
1031
|
+
return innerSchema ? {
|
|
1032
|
+
anyOf: [
|
|
1033
|
+
{
|
|
1034
|
+
not: {}
|
|
1035
|
+
},
|
|
1036
|
+
innerSchema
|
|
1037
|
+
]
|
|
1038
|
+
} : {};
|
|
1039
|
+
};
|
|
1040
|
+
|
|
1041
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js
|
|
1042
|
+
init_esm_shims();
|
|
1043
|
+
var parsePipelineDef = (def, refs) => {
|
|
1044
|
+
if (refs.pipeStrategy === "input") {
|
|
1045
|
+
return parseDef(def.in._def, refs);
|
|
1046
|
+
} else if (refs.pipeStrategy === "output") {
|
|
1047
|
+
return parseDef(def.out._def, refs);
|
|
1048
|
+
}
|
|
1049
|
+
const a = parseDef(def.in._def, {
|
|
1050
|
+
...refs,
|
|
1051
|
+
currentPath: [...refs.currentPath, "allOf", "0"]
|
|
1052
|
+
});
|
|
1053
|
+
const b = parseDef(def.out._def, {
|
|
1054
|
+
...refs,
|
|
1055
|
+
currentPath: [...refs.currentPath, "allOf", a ? "1" : "0"]
|
|
1056
|
+
});
|
|
1057
|
+
return {
|
|
1058
|
+
allOf: [a, b].filter((x) => x !== void 0)
|
|
1059
|
+
};
|
|
1060
|
+
};
|
|
1061
|
+
|
|
1062
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/parsers/promise.js
|
|
1063
|
+
init_esm_shims();
|
|
1064
|
+
function parsePromiseDef(def, refs) {
|
|
1065
|
+
return parseDef(def.type._def, refs);
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/parsers/set.js
|
|
1069
|
+
init_esm_shims();
|
|
1070
|
+
function parseSetDef(def, refs) {
|
|
1071
|
+
const items = parseDef(def.valueType._def, {
|
|
1072
|
+
...refs,
|
|
1073
|
+
currentPath: [...refs.currentPath, "items"]
|
|
1074
|
+
});
|
|
1075
|
+
const schema = {
|
|
1076
|
+
type: "array",
|
|
1077
|
+
uniqueItems: true,
|
|
1078
|
+
items
|
|
1079
|
+
};
|
|
1080
|
+
if (def.minSize) {
|
|
1081
|
+
setResponseValueAndErrors(schema, "minItems", def.minSize.value, def.minSize.message, refs);
|
|
1082
|
+
}
|
|
1083
|
+
if (def.maxSize) {
|
|
1084
|
+
setResponseValueAndErrors(schema, "maxItems", def.maxSize.value, def.maxSize.message, refs);
|
|
1085
|
+
}
|
|
1086
|
+
return schema;
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js
|
|
1090
|
+
init_esm_shims();
|
|
1091
|
+
function parseTupleDef(def, refs) {
|
|
1092
|
+
if (def.rest) {
|
|
1093
|
+
return {
|
|
1094
|
+
type: "array",
|
|
1095
|
+
minItems: def.items.length,
|
|
1096
|
+
items: def.items.map((x, i) => parseDef(x._def, {
|
|
1097
|
+
...refs,
|
|
1098
|
+
currentPath: [...refs.currentPath, "items", `${i}`]
|
|
1099
|
+
})).reduce((acc, x) => x === void 0 ? acc : [...acc, x], []),
|
|
1100
|
+
additionalItems: parseDef(def.rest._def, {
|
|
1101
|
+
...refs,
|
|
1102
|
+
currentPath: [...refs.currentPath, "additionalItems"]
|
|
1103
|
+
})
|
|
1104
|
+
};
|
|
1105
|
+
} else {
|
|
1106
|
+
return {
|
|
1107
|
+
type: "array",
|
|
1108
|
+
minItems: def.items.length,
|
|
1109
|
+
maxItems: def.items.length,
|
|
1110
|
+
items: def.items.map((x, i) => parseDef(x._def, {
|
|
1111
|
+
...refs,
|
|
1112
|
+
currentPath: [...refs.currentPath, "items", `${i}`]
|
|
1113
|
+
})).reduce((acc, x) => x === void 0 ? acc : [...acc, x], [])
|
|
1114
|
+
};
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js
|
|
1119
|
+
init_esm_shims();
|
|
1120
|
+
function parseUndefinedDef() {
|
|
1121
|
+
return {
|
|
1122
|
+
not: {}
|
|
1123
|
+
};
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js
|
|
1127
|
+
init_esm_shims();
|
|
1128
|
+
function parseUnknownDef() {
|
|
1129
|
+
return {};
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js
|
|
1133
|
+
init_esm_shims();
|
|
1134
|
+
var parseReadonlyDef = (def, refs) => {
|
|
1135
|
+
return parseDef(def.innerType._def, refs);
|
|
1136
|
+
};
|
|
1137
|
+
|
|
1138
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/selectParser.js
|
|
1139
|
+
var selectParser = (def, typeName, refs) => {
|
|
1140
|
+
switch (typeName) {
|
|
1141
|
+
case ZodFirstPartyTypeKind.ZodString:
|
|
1142
|
+
return parseStringDef(def, refs);
|
|
1143
|
+
case ZodFirstPartyTypeKind.ZodNumber:
|
|
1144
|
+
return parseNumberDef(def, refs);
|
|
1145
|
+
case ZodFirstPartyTypeKind.ZodObject:
|
|
1146
|
+
return parseObjectDef(def, refs);
|
|
1147
|
+
case ZodFirstPartyTypeKind.ZodBigInt:
|
|
1148
|
+
return parseBigintDef(def, refs);
|
|
1149
|
+
case ZodFirstPartyTypeKind.ZodBoolean:
|
|
1150
|
+
return parseBooleanDef();
|
|
1151
|
+
case ZodFirstPartyTypeKind.ZodDate:
|
|
1152
|
+
return parseDateDef(def, refs);
|
|
1153
|
+
case ZodFirstPartyTypeKind.ZodUndefined:
|
|
1154
|
+
return parseUndefinedDef();
|
|
1155
|
+
case ZodFirstPartyTypeKind.ZodNull:
|
|
1156
|
+
return parseNullDef(refs);
|
|
1157
|
+
case ZodFirstPartyTypeKind.ZodArray:
|
|
1158
|
+
return parseArrayDef(def, refs);
|
|
1159
|
+
case ZodFirstPartyTypeKind.ZodUnion:
|
|
1160
|
+
case ZodFirstPartyTypeKind.ZodDiscriminatedUnion:
|
|
1161
|
+
return parseUnionDef(def, refs);
|
|
1162
|
+
case ZodFirstPartyTypeKind.ZodIntersection:
|
|
1163
|
+
return parseIntersectionDef(def, refs);
|
|
1164
|
+
case ZodFirstPartyTypeKind.ZodTuple:
|
|
1165
|
+
return parseTupleDef(def, refs);
|
|
1166
|
+
case ZodFirstPartyTypeKind.ZodRecord:
|
|
1167
|
+
return parseRecordDef(def, refs);
|
|
1168
|
+
case ZodFirstPartyTypeKind.ZodLiteral:
|
|
1169
|
+
return parseLiteralDef(def, refs);
|
|
1170
|
+
case ZodFirstPartyTypeKind.ZodEnum:
|
|
1171
|
+
return parseEnumDef(def);
|
|
1172
|
+
case ZodFirstPartyTypeKind.ZodNativeEnum:
|
|
1173
|
+
return parseNativeEnumDef(def);
|
|
1174
|
+
case ZodFirstPartyTypeKind.ZodNullable:
|
|
1175
|
+
return parseNullableDef(def, refs);
|
|
1176
|
+
case ZodFirstPartyTypeKind.ZodOptional:
|
|
1177
|
+
return parseOptionalDef(def, refs);
|
|
1178
|
+
case ZodFirstPartyTypeKind.ZodMap:
|
|
1179
|
+
return parseMapDef(def, refs);
|
|
1180
|
+
case ZodFirstPartyTypeKind.ZodSet:
|
|
1181
|
+
return parseSetDef(def, refs);
|
|
1182
|
+
case ZodFirstPartyTypeKind.ZodLazy:
|
|
1183
|
+
return () => def.getter()._def;
|
|
1184
|
+
case ZodFirstPartyTypeKind.ZodPromise:
|
|
1185
|
+
return parsePromiseDef(def, refs);
|
|
1186
|
+
case ZodFirstPartyTypeKind.ZodNaN:
|
|
1187
|
+
case ZodFirstPartyTypeKind.ZodNever:
|
|
1188
|
+
return parseNeverDef();
|
|
1189
|
+
case ZodFirstPartyTypeKind.ZodEffects:
|
|
1190
|
+
return parseEffectsDef(def, refs);
|
|
1191
|
+
case ZodFirstPartyTypeKind.ZodAny:
|
|
1192
|
+
return parseAnyDef();
|
|
1193
|
+
case ZodFirstPartyTypeKind.ZodUnknown:
|
|
1194
|
+
return parseUnknownDef();
|
|
1195
|
+
case ZodFirstPartyTypeKind.ZodDefault:
|
|
1196
|
+
return parseDefaultDef(def, refs);
|
|
1197
|
+
case ZodFirstPartyTypeKind.ZodBranded:
|
|
1198
|
+
return parseBrandedDef(def, refs);
|
|
1199
|
+
case ZodFirstPartyTypeKind.ZodReadonly:
|
|
1200
|
+
return parseReadonlyDef(def, refs);
|
|
1201
|
+
case ZodFirstPartyTypeKind.ZodCatch:
|
|
1202
|
+
return parseCatchDef(def, refs);
|
|
1203
|
+
case ZodFirstPartyTypeKind.ZodPipeline:
|
|
1204
|
+
return parsePipelineDef(def, refs);
|
|
1205
|
+
case ZodFirstPartyTypeKind.ZodFunction:
|
|
1206
|
+
case ZodFirstPartyTypeKind.ZodVoid:
|
|
1207
|
+
case ZodFirstPartyTypeKind.ZodSymbol:
|
|
1208
|
+
return void 0;
|
|
1209
|
+
default:
|
|
1210
|
+
return /* @__PURE__ */ ((_) => void 0)(typeName);
|
|
1211
|
+
}
|
|
1212
|
+
};
|
|
1213
|
+
|
|
1214
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/parseDef.js
|
|
1215
|
+
function parseDef(def, refs, forceResolution = false) {
|
|
1216
|
+
const seenItem = refs.seen.get(def);
|
|
1217
|
+
if (refs.override) {
|
|
1218
|
+
const overrideResult = refs.override?.(def, refs, seenItem, forceResolution);
|
|
1219
|
+
if (overrideResult !== ignoreOverride) {
|
|
1220
|
+
return overrideResult;
|
|
1221
|
+
}
|
|
1222
|
+
}
|
|
1223
|
+
if (seenItem && !forceResolution) {
|
|
1224
|
+
const seenSchema = get$ref(seenItem, refs);
|
|
1225
|
+
if (seenSchema !== void 0) {
|
|
1226
|
+
return seenSchema;
|
|
1227
|
+
}
|
|
1228
|
+
}
|
|
1229
|
+
const newItem = { def, path: refs.currentPath, jsonSchema: void 0 };
|
|
1230
|
+
refs.seen.set(def, newItem);
|
|
1231
|
+
const jsonSchemaOrGetter = selectParser(def, def.typeName, refs);
|
|
1232
|
+
const jsonSchema = typeof jsonSchemaOrGetter === "function" ? parseDef(jsonSchemaOrGetter(), refs) : jsonSchemaOrGetter;
|
|
1233
|
+
if (jsonSchema) {
|
|
1234
|
+
addMeta(def, refs, jsonSchema);
|
|
1235
|
+
}
|
|
1236
|
+
if (refs.postProcess) {
|
|
1237
|
+
const postProcessResult = refs.postProcess(jsonSchema, def, refs);
|
|
1238
|
+
newItem.jsonSchema = jsonSchema;
|
|
1239
|
+
return postProcessResult;
|
|
1240
|
+
}
|
|
1241
|
+
newItem.jsonSchema = jsonSchema;
|
|
1242
|
+
return jsonSchema;
|
|
1243
|
+
}
|
|
1244
|
+
var get$ref = (item, refs) => {
|
|
1245
|
+
switch (refs.$refStrategy) {
|
|
1246
|
+
case "root":
|
|
1247
|
+
return { $ref: item.path.join("/") };
|
|
1248
|
+
case "relative":
|
|
1249
|
+
return { $ref: getRelativePath(refs.currentPath, item.path) };
|
|
1250
|
+
case "none":
|
|
1251
|
+
case "seen": {
|
|
1252
|
+
if (item.path.length < refs.currentPath.length && item.path.every((value, index) => refs.currentPath[index] === value)) {
|
|
1253
|
+
console.warn(`Recursive reference detected at ${refs.currentPath.join("/")}! Defaulting to any`);
|
|
1254
|
+
return {};
|
|
1255
|
+
}
|
|
1256
|
+
return refs.$refStrategy === "seen" ? {} : void 0;
|
|
1257
|
+
}
|
|
1258
|
+
}
|
|
1259
|
+
};
|
|
1260
|
+
var getRelativePath = (pathA, pathB) => {
|
|
1261
|
+
let i = 0;
|
|
1262
|
+
for (; i < pathA.length && i < pathB.length; i++) {
|
|
1263
|
+
if (pathA[i] !== pathB[i])
|
|
1264
|
+
break;
|
|
1265
|
+
}
|
|
1266
|
+
return [(pathA.length - i).toString(), ...pathB.slice(i)].join("/");
|
|
1267
|
+
};
|
|
1268
|
+
var addMeta = (def, refs, jsonSchema) => {
|
|
1269
|
+
if (def.description) {
|
|
1270
|
+
jsonSchema.description = def.description;
|
|
1271
|
+
if (refs.markdownDescription) {
|
|
1272
|
+
jsonSchema.markdownDescription = def.description;
|
|
1273
|
+
}
|
|
1274
|
+
}
|
|
1275
|
+
return jsonSchema;
|
|
1276
|
+
};
|
|
1277
|
+
|
|
1278
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/parseTypes.js
|
|
1279
|
+
init_esm_shims();
|
|
1280
|
+
|
|
1281
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js
|
|
1282
|
+
init_esm_shims();
|
|
1283
|
+
var zodToJsonSchema = (schema, options) => {
|
|
1284
|
+
const refs = getRefs(options);
|
|
1285
|
+
const definitions = typeof options === "object" && options.definitions ? Object.entries(options.definitions).reduce((acc, [name2, schema2]) => ({
|
|
1286
|
+
...acc,
|
|
1287
|
+
[name2]: parseDef(schema2._def, {
|
|
1288
|
+
...refs,
|
|
1289
|
+
currentPath: [...refs.basePath, refs.definitionPath, name2]
|
|
1290
|
+
}, true) ?? {}
|
|
1291
|
+
}), {}) : void 0;
|
|
1292
|
+
const name = typeof options === "string" ? options : options?.nameStrategy === "title" ? void 0 : options?.name;
|
|
1293
|
+
const main = parseDef(schema._def, name === void 0 ? refs : {
|
|
1294
|
+
...refs,
|
|
1295
|
+
currentPath: [...refs.basePath, refs.definitionPath, name]
|
|
1296
|
+
}, false) ?? {};
|
|
1297
|
+
const title = typeof options === "object" && options.name !== void 0 && options.nameStrategy === "title" ? options.name : void 0;
|
|
1298
|
+
if (title !== void 0) {
|
|
1299
|
+
main.title = title;
|
|
1300
|
+
}
|
|
1301
|
+
const combined = name === void 0 ? definitions ? {
|
|
1302
|
+
...main,
|
|
1303
|
+
[refs.definitionPath]: definitions
|
|
1304
|
+
} : main : {
|
|
1305
|
+
$ref: [
|
|
1306
|
+
...refs.$refStrategy === "relative" ? [] : refs.basePath,
|
|
1307
|
+
refs.definitionPath,
|
|
1308
|
+
name
|
|
1309
|
+
].join("/"),
|
|
1310
|
+
[refs.definitionPath]: {
|
|
1311
|
+
...definitions,
|
|
1312
|
+
[name]: main
|
|
1313
|
+
}
|
|
1314
|
+
};
|
|
1315
|
+
if (refs.target === "jsonSchema7") {
|
|
1316
|
+
combined.$schema = "http://json-schema.org/draft-07/schema#";
|
|
1317
|
+
} else if (refs.target === "jsonSchema2019-09" || refs.target === "openAi") {
|
|
1318
|
+
combined.$schema = "https://json-schema.org/draft/2019-09/schema#";
|
|
1319
|
+
}
|
|
1320
|
+
if (refs.target === "openAi" && ("anyOf" in combined || "oneOf" in combined || "allOf" in combined || "type" in combined && Array.isArray(combined.type))) {
|
|
1321
|
+
console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property.");
|
|
1322
|
+
}
|
|
1323
|
+
return combined;
|
|
1324
|
+
};
|
|
1325
|
+
|
|
1326
|
+
// ../cli-astro-commands/src/components/GenerateCommand/generate-schema/types.ts
|
|
1327
|
+
init_esm_shims();
|
|
1328
|
+
var extensionFieldDefinitionSchema = external_exports.object({
|
|
1329
|
+
title: external_exports.string(),
|
|
1330
|
+
description: external_exports.string().optional()
|
|
1331
|
+
});
|
|
1332
|
+
|
|
1333
|
+
// ../cli-astro-commands/src/components/GenerateCommand/dashboard-page/schema.ts
|
|
1334
|
+
init_esm_shims();
|
|
1335
|
+
|
|
1336
|
+
// ../cli-astro-commands/src/components/GenerateCommand/generate-schema/definitions.ts
|
|
1337
|
+
init_esm_shims();
|
|
1338
|
+
function defineField(field) {
|
|
1339
|
+
return JSON.stringify(field);
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
// ../cli-astro-commands/src/components/GenerateCommand/dashboard-page/schema.ts
|
|
1343
|
+
var dashboardPageTypeDef = {
|
|
1344
|
+
extensionType: "DASHBOARD_PAGE",
|
|
1345
|
+
title: "Dashboard Page",
|
|
1346
|
+
description: "A Dashboard page",
|
|
1347
|
+
group: "Dashboard",
|
|
1348
|
+
documentation: "https://dev.wix.com/docs/wix-cli/guides/extensions/dashboard-extensions/dashboard-pages/add-dashboard-page-extensions",
|
|
1349
|
+
zodSchema: external_exports.object({
|
|
1350
|
+
extensionType: external_exports.literal("DASHBOARD_PAGE"),
|
|
1351
|
+
title: external_exports.string().describe(
|
|
1352
|
+
defineField({ title: "Page title", description: "The Page Title" })
|
|
1353
|
+
),
|
|
1354
|
+
route: external_exports.string().regex(VALID_PATH_REGEX).describe(
|
|
1355
|
+
defineField({
|
|
1356
|
+
title: "Page route",
|
|
1357
|
+
description: "Lowercase alphanumeric, hyphens, and slashes"
|
|
1358
|
+
})
|
|
1359
|
+
)
|
|
1360
|
+
})
|
|
1361
|
+
};
|
|
1362
|
+
|
|
1363
|
+
// ../cli-astro-commands/src/components/GenerateCommand/dashboard-modal/schema.ts
|
|
1364
|
+
init_esm_shims();
|
|
1365
|
+
var dashboardModalTypeDef = {
|
|
1366
|
+
extensionType: "DASHBOARD_MODAL",
|
|
1367
|
+
title: "Dashboard Modal",
|
|
1368
|
+
description: "A Dashboard modal dialog",
|
|
1369
|
+
group: "Dashboard",
|
|
1370
|
+
documentation: "https://dev.wix.com/docs/wix-cli/guides/extensions/dashboard-extensions/dashboard-modals/add-dashboard-modal-extensions",
|
|
1371
|
+
zodSchema: external_exports.object({
|
|
1372
|
+
extensionType: external_exports.literal("DASHBOARD_MODAL"),
|
|
1373
|
+
title: external_exports.string().describe(defineField({ title: "Modal title" })),
|
|
1374
|
+
folder: external_exports.string().regex(VALID_PATH_REGEX).describe(
|
|
1375
|
+
defineField({
|
|
1376
|
+
title: "Modal folder",
|
|
1377
|
+
description: "Lowercase alphanumeric and hyphens only."
|
|
1378
|
+
})
|
|
1379
|
+
)
|
|
1380
|
+
})
|
|
1381
|
+
};
|
|
1382
|
+
|
|
1383
|
+
// ../cli-astro-commands/src/components/GenerateCommand/plugins/dashboard-plugin/schema.ts
|
|
1384
|
+
init_esm_shims();
|
|
1385
|
+
function buildSlotIdField(containers) {
|
|
1386
|
+
if (containers.length === 0) {
|
|
1387
|
+
return external_exports.string().describe(
|
|
1388
|
+
defineField({
|
|
1389
|
+
title: "Slot to extend",
|
|
1390
|
+
description: "Component ID of the back-office extension container to extend. Obtain from the Dev Center."
|
|
1391
|
+
})
|
|
1392
|
+
);
|
|
1393
|
+
}
|
|
1394
|
+
const literals = containers.map(
|
|
1395
|
+
(c) => external_exports.literal(c.component.componentId).describe(
|
|
1396
|
+
defineField({
|
|
1397
|
+
title: c.component.data.backOfficeExtensionContainer.slotData?.displayName ?? c.component.name
|
|
1398
|
+
})
|
|
1399
|
+
)
|
|
1400
|
+
);
|
|
1401
|
+
const field = literals.length === 1 ? literals[0] : external_exports.union(
|
|
1402
|
+
literals
|
|
1403
|
+
);
|
|
1404
|
+
return field.describe(
|
|
1405
|
+
defineField({
|
|
1406
|
+
title: "Slot to extend",
|
|
1407
|
+
description: "Component ID of the back-office extension container to extend."
|
|
1408
|
+
})
|
|
1409
|
+
);
|
|
1410
|
+
}
|
|
1411
|
+
var dashboardPluginTypeDef = {
|
|
1412
|
+
extensionType: "DASHBOARD_PLUGIN",
|
|
1413
|
+
title: "Dashboard Plugin",
|
|
1414
|
+
description: "A plugin that extends a back-office page with a custom widget",
|
|
1415
|
+
group: "Dashboard",
|
|
1416
|
+
documentation: "https://dev.wix.com/docs/wix-cli/guides/extensions/dashboard-extensions/dashboard-plugins/add-dashboard-plugin-extensions",
|
|
1417
|
+
zodSchema: async (httpClient) => {
|
|
1418
|
+
const client = new ExtensionDataClient(httpClient);
|
|
1419
|
+
const containers = await client.getBackofficeExtensionWidgets();
|
|
1420
|
+
return external_exports.object({
|
|
1421
|
+
extensionType: external_exports.literal("DASHBOARD_PLUGIN"),
|
|
1422
|
+
extendsSlotId: buildSlotIdField(containers),
|
|
1423
|
+
title: external_exports.string().describe(defineField({ title: "Plugin title" })),
|
|
1424
|
+
folder: external_exports.string().regex(VALID_PATH_REGEX).describe(
|
|
1425
|
+
defineField({
|
|
1426
|
+
title: "Plugin folder",
|
|
1427
|
+
description: "Lowercase alphanumeric and hyphens only. Must be unique within src/dashboard/plugins/."
|
|
1428
|
+
})
|
|
1429
|
+
)
|
|
1430
|
+
});
|
|
1431
|
+
}
|
|
1432
|
+
};
|
|
1433
|
+
|
|
1434
|
+
// ../cli-astro-commands/src/components/GenerateCommand/plugins/dashboad-menu-plugin/schema.ts
|
|
1435
|
+
init_esm_shims();
|
|
1436
|
+
var actionSchema = external_exports.union([
|
|
1437
|
+
external_exports.object({
|
|
1438
|
+
pageId: external_exports.string().uuid().describe(defineField({ title: "Page ID" }))
|
|
1439
|
+
}).describe(JSON.stringify({ title: "Navigate to a page" })),
|
|
1440
|
+
external_exports.object({
|
|
1441
|
+
modalId: external_exports.string().uuid().describe(defineField({ title: "Modal ID" }))
|
|
1442
|
+
}).describe(JSON.stringify({ title: "Open a modal" }))
|
|
1443
|
+
]).describe(
|
|
1444
|
+
defineField({
|
|
1445
|
+
title: "Action",
|
|
1446
|
+
description: "The action performed when the menu item is clicked. Provide either pageId to navigate to a dashboard page or modalId to open a dashboard modal."
|
|
1447
|
+
})
|
|
1448
|
+
);
|
|
1449
|
+
function buildSlotIdField2(containers) {
|
|
1450
|
+
if (containers.length === 0) {
|
|
1451
|
+
return external_exports.string().describe(
|
|
1452
|
+
defineField({
|
|
1453
|
+
title: "Slot to extend",
|
|
1454
|
+
description: "Component ID of the back-office menu extension container to extend. Obtain from the Dev Center."
|
|
1455
|
+
})
|
|
1456
|
+
);
|
|
1457
|
+
}
|
|
1458
|
+
const literals = containers.map(
|
|
1459
|
+
(c) => external_exports.literal(c.component.componentId).describe(
|
|
1460
|
+
defineField({
|
|
1461
|
+
title: c.component.data.backOfficeExtensionContainer.slotData?.displayName ?? c.component.name
|
|
1462
|
+
})
|
|
1463
|
+
)
|
|
1464
|
+
);
|
|
1465
|
+
const field = literals.length === 1 ? literals[0] : external_exports.union(
|
|
1466
|
+
literals
|
|
1467
|
+
);
|
|
1468
|
+
return field.describe(
|
|
1469
|
+
defineField({
|
|
1470
|
+
title: "Slot to extend",
|
|
1471
|
+
description: "Component ID of the back-office menu extension container to extend."
|
|
1472
|
+
})
|
|
1473
|
+
);
|
|
1474
|
+
}
|
|
1475
|
+
var dashboardMenuPluginTypeDef = {
|
|
1476
|
+
extensionType: "DASHBOARD_MENU_PLUGIN",
|
|
1477
|
+
title: "Dashboard Menu Plugin",
|
|
1478
|
+
description: "A plugin that adds a menu item to a back-office page navigation",
|
|
1479
|
+
group: "Dashboard",
|
|
1480
|
+
documentation: "https://dev.wix.com/docs/wix-cli/guides/extensions/dashboard-extensions/dashboard-menu-plugins/add-dashboard-menu-plugin-extensions",
|
|
1481
|
+
zodSchema: async (httpClient) => {
|
|
1482
|
+
const client = new ExtensionDataClient(httpClient);
|
|
1483
|
+
const containers = await client.getBackofficeMenuItems();
|
|
1484
|
+
return external_exports.object({
|
|
1485
|
+
extensionType: external_exports.literal("DASHBOARD_MENU_PLUGIN"),
|
|
1486
|
+
extendsSlotId: buildSlotIdField2(containers),
|
|
1487
|
+
action: actionSchema,
|
|
1488
|
+
title: external_exports.string().describe(defineField({ title: "Menu item title" })),
|
|
1489
|
+
folder: external_exports.string().regex(VALID_PATH_REGEX).describe(
|
|
1490
|
+
defineField({
|
|
1491
|
+
title: "Plugin folder",
|
|
1492
|
+
description: "Lowercase alphanumeric and hyphens only. Must be unique within src/dashboard/menu-plugins/."
|
|
1493
|
+
})
|
|
1494
|
+
)
|
|
1495
|
+
});
|
|
1496
|
+
}
|
|
1497
|
+
};
|
|
1498
|
+
|
|
1499
|
+
// ../cli-astro-commands/src/components/GenerateCommand/event/schema.ts
|
|
1500
|
+
init_esm_shims();
|
|
1501
|
+
var eventTypeDef = {
|
|
1502
|
+
extensionType: "EVENT",
|
|
1503
|
+
title: "Event",
|
|
1504
|
+
description: "A backend event handler",
|
|
1505
|
+
group: "Backend",
|
|
1506
|
+
documentation: "https://dev.wix.com/docs/wix-cli/guides/extensions/backend-extensions/events/add-event-extensions",
|
|
1507
|
+
zodSchema: external_exports.object({
|
|
1508
|
+
extensionType: external_exports.literal("EVENT"),
|
|
1509
|
+
folder: external_exports.string().regex(VALID_PATH_REGEX).describe(
|
|
1510
|
+
defineField({
|
|
1511
|
+
title: "Event folder",
|
|
1512
|
+
description: "Lowercase alphanumeric and hyphens only"
|
|
1513
|
+
})
|
|
1514
|
+
)
|
|
1515
|
+
})
|
|
1516
|
+
};
|
|
1517
|
+
|
|
1518
|
+
// ../cli-astro-commands/src/components/GenerateCommand/service-plugin/schema.ts
|
|
1519
|
+
init_esm_shims();
|
|
1520
|
+
var servicePluginTypeDef = {
|
|
1521
|
+
extensionType: "SERVICE_PLUGIN",
|
|
1522
|
+
title: "Service Plugin",
|
|
1523
|
+
description: "A backend service plugin that extends a Wix service",
|
|
1524
|
+
group: "Backend",
|
|
1525
|
+
documentation: "https://dev.wix.com/docs/wix-cli/guides/extensions/backend-extensions/service-plugins/add-service-plugin-extensions",
|
|
1526
|
+
zodSchema: external_exports.object({
|
|
1527
|
+
extensionType: external_exports.literal("SERVICE_PLUGIN"),
|
|
1528
|
+
pluginType: external_exports.union([
|
|
1529
|
+
external_exports.literal("ECOM_ADDITIONAL_FEES").describe(defineField({ title: "Ecom Additional Fees" })),
|
|
1530
|
+
external_exports.literal("ECOM_SHIPPING_RATES").describe(defineField({ title: "Ecom Shipping Rates" })),
|
|
1531
|
+
external_exports.literal("ECOM_DISCOUNTS_TRIGGER").describe(defineField({ title: "Ecom Discount Triggers" })),
|
|
1532
|
+
external_exports.literal("ECOM_VALIDATIONS").describe(defineField({ title: "Ecom Validations" })),
|
|
1533
|
+
external_exports.literal("ECOM_PAYMENT_SETTINGS").describe(defineField({ title: "Ecom Payment Settings" })),
|
|
1534
|
+
external_exports.literal("GIFT_CARDS_PROVIDER").describe(defineField({ title: "Ecom Gift Cards Provider" })),
|
|
1535
|
+
external_exports.literal("STAFF_SORTING_PROVIDER").describe(defineField({ title: "Staff Sorting Provider" }))
|
|
1536
|
+
]).describe(defineField({ title: "Plugin type" })),
|
|
1537
|
+
name: external_exports.string().regex(VALID_PATH_REGEX).max(19).describe(
|
|
1538
|
+
defineField({
|
|
1539
|
+
title: "Plugin name",
|
|
1540
|
+
description: "Lowercase alphanumeric and hyphens only."
|
|
1541
|
+
})
|
|
1542
|
+
)
|
|
1543
|
+
})
|
|
1544
|
+
};
|
|
1545
|
+
|
|
1546
|
+
// ../cli-astro-commands/src/components/GenerateCommand/embedded-script/schema.ts
|
|
1547
|
+
init_esm_shims();
|
|
1548
|
+
var embeddedScriptTypeDef = {
|
|
1549
|
+
extensionType: "EMBEDDED_SCRIPT",
|
|
1550
|
+
title: "Embedded Script",
|
|
1551
|
+
description: "A script embedded into site pages",
|
|
1552
|
+
group: "Site",
|
|
1553
|
+
documentation: "https://dev.wix.com/docs/wix-cli/guides/extensions/site-extensions/embedded-scripts/about-embedded-scripts",
|
|
1554
|
+
zodSchema: external_exports.object({
|
|
1555
|
+
extensionType: external_exports.literal("EMBEDDED_SCRIPT"),
|
|
1556
|
+
name: external_exports.string().describe(defineField({ title: "Script name" })),
|
|
1557
|
+
folder: external_exports.string().regex(VALID_PATH_REGEX).describe(
|
|
1558
|
+
defineField({
|
|
1559
|
+
title: "Script folder",
|
|
1560
|
+
description: "Lowercase alphanumeric and hyphens only. Must be unique within src/site/embedded-scripts/."
|
|
1561
|
+
})
|
|
1562
|
+
),
|
|
1563
|
+
scriptType: external_exports.union([
|
|
1564
|
+
external_exports.literal("ESSENTIAL").describe(defineField({ title: "Essential" })),
|
|
1565
|
+
external_exports.literal("FUNCTIONAL").describe(defineField({ title: "Functional" })),
|
|
1566
|
+
external_exports.literal("ANALYTICS").describe(defineField({ title: "Analytics" })),
|
|
1567
|
+
external_exports.literal("ADVERTISING").describe(defineField({ title: "Advertising" }))
|
|
1568
|
+
]).describe(
|
|
1569
|
+
defineField({
|
|
1570
|
+
title: "Script type",
|
|
1571
|
+
description: "Determines the consent category of the script."
|
|
1572
|
+
})
|
|
1573
|
+
),
|
|
1574
|
+
placement: external_exports.union([
|
|
1575
|
+
external_exports.literal("HEAD").describe(defineField({ title: "Head" })),
|
|
1576
|
+
external_exports.literal("BODY_START").describe(defineField({ title: "Body Start" })),
|
|
1577
|
+
external_exports.literal("BODY_END").describe(defineField({ title: "Body End" }))
|
|
1578
|
+
]).describe(
|
|
1579
|
+
defineField({
|
|
1580
|
+
title: "Placement",
|
|
1581
|
+
description: "Where in the page HTML the script is injected."
|
|
1582
|
+
})
|
|
1583
|
+
)
|
|
1584
|
+
})
|
|
1585
|
+
};
|
|
1586
|
+
|
|
1587
|
+
// ../cli-astro-commands/src/components/GenerateCommand/custom-element/schema.ts
|
|
1588
|
+
init_esm_shims();
|
|
1589
|
+
var customElementTypeDef = {
|
|
1590
|
+
extensionType: "CUSTOM_ELEMENT",
|
|
1591
|
+
title: "Custom Element",
|
|
1592
|
+
description: "A site widget built as a custom HTML element",
|
|
1593
|
+
group: "Site",
|
|
1594
|
+
documentation: "https://dev.wix.com/docs/wix-cli/guides/extensions/site-extensions/site-widgets/add-a-site-widget-extension",
|
|
1595
|
+
zodSchema: external_exports.object({
|
|
1596
|
+
extensionType: external_exports.literal("CUSTOM_ELEMENT"),
|
|
1597
|
+
name: external_exports.string().describe(defineField({ title: "Widget name" })),
|
|
1598
|
+
folder: external_exports.string().regex(/^[a-z][a-z0-9]*(-[a-z0-9]+)+$/).describe(
|
|
1599
|
+
defineField({
|
|
1600
|
+
title: "Widget folder",
|
|
1601
|
+
description: "Must be a valid custom element name: lowercase, starts with a letter, contains at least one hyphen."
|
|
1602
|
+
})
|
|
1603
|
+
)
|
|
1604
|
+
})
|
|
1605
|
+
};
|
|
1606
|
+
|
|
1607
|
+
// ../cli-astro-commands/src/components/GenerateCommand/site-plugin/schema.ts
|
|
1608
|
+
init_esm_shims();
|
|
1609
|
+
function buildWidgetPluginSlots(plugins) {
|
|
1610
|
+
const slotOptions = plugins.flatMap(
|
|
1611
|
+
(wp) => wp.component.data.widgetPlugin.placements.map((p) => ({
|
|
1612
|
+
value: `${wp.component.componentId}:${p.slotId}`,
|
|
1613
|
+
title: `${wp.component.name} \u2014 ${p.slotId}`
|
|
1614
|
+
}))
|
|
1615
|
+
);
|
|
1616
|
+
return slotOptions.map(
|
|
1617
|
+
(opt) => external_exports.literal(opt.value).describe(defineField({ title: opt.title }))
|
|
1618
|
+
);
|
|
1619
|
+
}
|
|
1620
|
+
var sitePluginTypeDef = {
|
|
1621
|
+
extensionType: "SITE_PLUGIN",
|
|
1622
|
+
title: "Site Plugin",
|
|
1623
|
+
description: "A plugin that extends a Wix app widget with a custom component",
|
|
1624
|
+
group: "Site",
|
|
1625
|
+
documentation: "https://dev.wix.com/docs/wix-cli/guides/extensions/site-extensions/site-plugins/add-a-site-plugin-extension",
|
|
1626
|
+
zodSchema: async (httpClient) => {
|
|
1627
|
+
const client = new ExtensionDataClient(httpClient);
|
|
1628
|
+
const plugins = await client.getWidgetPlugins();
|
|
1629
|
+
const slotLiterals = buildWidgetPluginSlots(plugins);
|
|
1630
|
+
return external_exports.object({
|
|
1631
|
+
extensionType: external_exports.literal("SITE_PLUGIN"),
|
|
1632
|
+
slotId: external_exports.union(slotLiterals).describe(
|
|
1633
|
+
defineField({
|
|
1634
|
+
title: "Slot",
|
|
1635
|
+
description: "The widget slot to extend. Format: componentId:slotId."
|
|
1636
|
+
})
|
|
1637
|
+
),
|
|
1638
|
+
name: external_exports.string().describe(defineField({ title: "Plugin name" })),
|
|
1639
|
+
folder: external_exports.string().regex(/^[a-z][a-z0-9]*(-[a-z0-9]+)+$/).describe(
|
|
1640
|
+
defineField({
|
|
1641
|
+
title: "Plugin folder",
|
|
1642
|
+
description: "Must be a valid custom element name: lowercase, starts with a letter, contains at least one hyphen."
|
|
1643
|
+
})
|
|
1644
|
+
)
|
|
1645
|
+
});
|
|
1646
|
+
}
|
|
1647
|
+
};
|
|
1648
|
+
|
|
1649
|
+
// ../cli-astro-commands/src/components/GenerateCommand/data-collections/schema.ts
|
|
1650
|
+
init_esm_shims();
|
|
1651
|
+
var dataCollectionTypeDef = {
|
|
1652
|
+
extensionType: "DATA_COLLECTION",
|
|
1653
|
+
title: "Data Collection",
|
|
1654
|
+
description: "A backend data collection",
|
|
1655
|
+
group: "Backend",
|
|
1656
|
+
documentation: "https://dev.wix.com/docs/api-reference/business-solutions/cms/collection-management/data-collections-extension/data-collections-extension-object",
|
|
1657
|
+
zodSchema: external_exports.object({
|
|
1658
|
+
extensionType: external_exports.literal("DATA_COLLECTION"),
|
|
1659
|
+
collectionName: external_exports.string().regex(/^[A-Za-z0-9_-]{1,36}$/).describe(
|
|
1660
|
+
defineField({
|
|
1661
|
+
title: "Collection name",
|
|
1662
|
+
description: "1-36 characters, letters, numbers, underscores, and hyphens only."
|
|
1663
|
+
})
|
|
1664
|
+
)
|
|
1665
|
+
})
|
|
1666
|
+
};
|
|
1667
|
+
|
|
1668
|
+
// ../cli-astro-commands/src/components/GenerateCommand/editor-react-component/schema.ts
|
|
1669
|
+
init_esm_shims();
|
|
1670
|
+
var editorReactComponentTypeDef = {
|
|
1671
|
+
extensionType: "EDITOR_REACT_COMPONENT",
|
|
1672
|
+
title: "Editor React Component",
|
|
1673
|
+
description: "A site widget built as a React component for the Wix editor",
|
|
1674
|
+
group: "Site",
|
|
1675
|
+
zodSchema: external_exports.object({
|
|
1676
|
+
extensionType: external_exports.literal("EDITOR_REACT_COMPONENT"),
|
|
1677
|
+
name: external_exports.string().max(30).describe(defineField({ title: "Component name" })),
|
|
1678
|
+
folder: external_exports.string().regex(VALID_PATH_REGEX).describe(
|
|
1679
|
+
defineField({
|
|
1680
|
+
title: "Component folder",
|
|
1681
|
+
description: "Lowercase alphanumeric and hyphens only."
|
|
1682
|
+
})
|
|
1683
|
+
)
|
|
1684
|
+
})
|
|
1685
|
+
};
|
|
1686
|
+
|
|
1687
|
+
// ../cli-astro-commands/src/components/GenerateCommand/generate-schema/generateSchema.ts
|
|
1688
|
+
var extensionTypeDefs = [
|
|
1689
|
+
dashboardPageTypeDef,
|
|
1690
|
+
dashboardModalTypeDef,
|
|
1691
|
+
dashboardPluginTypeDef,
|
|
1692
|
+
dashboardMenuPluginTypeDef,
|
|
1693
|
+
eventTypeDef,
|
|
1694
|
+
servicePluginTypeDef,
|
|
1695
|
+
embeddedScriptTypeDef,
|
|
1696
|
+
customElementTypeDef,
|
|
1697
|
+
sitePluginTypeDef,
|
|
1698
|
+
dataCollectionTypeDef,
|
|
1699
|
+
editorReactComponentTypeDef
|
|
1700
|
+
];
|
|
1701
|
+
function processExtensionFields(jsonSchema, zodDef) {
|
|
1702
|
+
if (!jsonSchema) {
|
|
1703
|
+
return jsonSchema;
|
|
1704
|
+
}
|
|
1705
|
+
let result = { ...jsonSchema };
|
|
1706
|
+
if (zodDef.description) {
|
|
1707
|
+
try {
|
|
1708
|
+
const parsed = extensionFieldDefinitionSchema.parse(
|
|
1709
|
+
JSON.parse(zodDef.description)
|
|
1710
|
+
);
|
|
1711
|
+
result = { ...result, ...parsed };
|
|
1712
|
+
if (!parsed.description) {
|
|
1713
|
+
delete result.description;
|
|
1714
|
+
}
|
|
1715
|
+
} catch {
|
|
1716
|
+
}
|
|
1717
|
+
}
|
|
1718
|
+
return result;
|
|
1719
|
+
}
|
|
1720
|
+
function getExtensionInputSchema(zodSchema) {
|
|
1721
|
+
return zodToJsonSchema(zodSchema, {
|
|
1722
|
+
postProcess: processExtensionFields
|
|
1723
|
+
});
|
|
1724
|
+
}
|
|
1725
|
+
async function buildGenerateExtensionsSchema(httpClient) {
|
|
1726
|
+
const definitions = {};
|
|
1727
|
+
for (const def of extensionTypeDefs) {
|
|
1728
|
+
const zodSchema = typeof def.zodSchema === "function" ? await def.zodSchema(httpClient) : def.zodSchema;
|
|
1729
|
+
const { $schema: _$schema, ...inputSchema } = getExtensionInputSchema(zodSchema);
|
|
1730
|
+
definitions[def.extensionType] = {
|
|
1731
|
+
title: def.title,
|
|
1732
|
+
description: def.description,
|
|
1733
|
+
group: def.group,
|
|
1734
|
+
documentation: def.documentation,
|
|
1735
|
+
...inputSchema
|
|
1736
|
+
};
|
|
1737
|
+
}
|
|
1738
|
+
return {
|
|
1739
|
+
$schema: "http://json-schema.org/draft-07/schema#",
|
|
1740
|
+
schemaVersion: 1,
|
|
1741
|
+
definitions,
|
|
1742
|
+
oneOf: extensionTypeDefs.map((def) => ({
|
|
1743
|
+
$ref: `#/definitions/${def.extensionType}`
|
|
1744
|
+
}))
|
|
1745
|
+
};
|
|
1746
|
+
}
|
|
1747
|
+
|
|
1748
|
+
// ../cli-astro-commands/src/non-interactive/schema-generate-extensions.ts
|
|
1749
|
+
async function nonInteractiveSchemaGenerateExtensions(_services, _model) {
|
|
1750
|
+
const authData = await isLoggedInToAccount();
|
|
1751
|
+
if (!authData) {
|
|
1752
|
+
throw new CliError({
|
|
1753
|
+
code: CliErrorCode.AuthenticationRequired(),
|
|
1754
|
+
cause: null
|
|
1755
|
+
});
|
|
1756
|
+
}
|
|
1757
|
+
const httpClient = createHttpClient({
|
|
1758
|
+
type: "backoffice",
|
|
1759
|
+
getAppToken: () => authData.getAccessToken({})
|
|
1760
|
+
});
|
|
1761
|
+
log(JSON.stringify(await buildGenerateExtensionsSchema(httpClient), null, 2));
|
|
1762
|
+
}
|
|
1763
|
+
export {
|
|
1764
|
+
nonInteractiveSchemaGenerateExtensions
|
|
1765
|
+
};
|
|
1766
|
+
//# sourceMappingURL=schema-generate-extensions-HICBTQWF.js.map
|