@recombine-ai/platform 0.2.6-test.9 → 0.3.0
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/README.md +27 -2
- package/bin/bosun.js +300 -0
- package/bin/rc-build.js +12 -0
- package/build/agent/index.d.ts +5 -0
- package/build/agent/index.d.ts.map +1 -0
- package/build/agent/index.js +2 -0
- package/build/agent/text-agent.d.ts +14 -0
- package/build/agent/text-agent.d.ts.map +1 -0
- package/build/agent/text-agent.js +28 -0
- package/build/agent/timed.d.ts +2 -0
- package/build/agent/timed.d.ts.map +1 -0
- package/build/agent/timed.js +9 -0
- package/build/agent/voice-agent.d.ts +24 -0
- package/build/agent/voice-agent.d.ts.map +1 -0
- package/build/agent/voice-agent.js +24 -0
- package/build/bosun/context.d.ts +23 -0
- package/build/bosun/context.d.ts.map +1 -0
- package/build/bosun/context.js +41 -0
- package/build/bosun/index.d.ts +11 -0
- package/build/bosun/index.d.ts.map +1 -0
- package/build/bosun/index.js +7 -0
- package/build/bosun/interfaces/agent.d.ts +40 -0
- package/build/bosun/interfaces/agent.d.ts.map +1 -0
- package/build/bosun/interfaces/agent.js +3 -0
- package/build/bosun/mock.d.ts +6 -0
- package/build/bosun/mock.d.ts.map +1 -0
- package/build/bosun/mock.js +28 -0
- package/build/bosun/std-mocks/call-control.d.ts +11 -0
- package/build/bosun/std-mocks/call-control.d.ts.map +1 -0
- package/build/bosun/std-mocks/call-control.js +128 -0
- package/build/bosun/std-mocks/platform.d.ts +8 -0
- package/build/bosun/std-mocks/platform.d.ts.map +1 -0
- package/build/bosun/std-mocks/platform.js +45 -0
- package/build/bosun/test-agent.d.ts +4 -0
- package/build/bosun/test-agent.d.ts.map +1 -0
- package/build/bosun/test-agent.js +70 -0
- package/build/bosun/test-step-registry.d.ts +14 -0
- package/build/bosun/test-step-registry.d.ts.map +1 -0
- package/build/bosun/test-step-registry.js +48 -0
- package/build/bosun/utils.d.ts +4 -0
- package/build/bosun/utils.d.ts.map +1 -0
- package/build/bosun/utils.js +7 -0
- package/build/bosun-app/backend/server.js +48570 -0
- package/build/bosun-app/backend/server.js.map +7 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/0.B5fEz2jr.css +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/0.B5fEz2jr.css.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/0.B5fEz2jr.css.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/10.DIVePEYf.css +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/10.DIVePEYf.css.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/10.DIVePEYf.css.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/18.C5apk4jm.css +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/18.C5apk4jm.css.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/18.C5apk4jm.css.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/2.DtxQDOXx.css +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/2.DtxQDOXx.css.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/2.DtxQDOXx.css.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/3.Dzh7_Q8n.css +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/3.Dzh7_Q8n.css.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/3.Dzh7_Q8n.css.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/5.CZVw96CJ.css +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/5.CZVw96CJ.css.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/5.CZVw96CJ.css.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/9.DlSPCZj0.css +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/9.DlSPCZj0.css.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/9.DlSPCZj0.css.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/AgentSidebar.BL1i3rB_.css +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/AgentSidebar.BL1i3rB_.css.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/AgentSidebar.BL1i3rB_.css.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/Input.CJ8KyccG.css +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/Input.CJ8KyccG.css.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/Input.CJ8KyccG.css.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/Popper.CLTyHc88.css +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/Popper.CLTyHc88.css.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/Popper.CLTyHc88.css.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/ReadOnlyMonacoDiff.iiWNRlR-.css +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/ReadOnlyMonacoDiff.iiWNRlR-.css.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/ReadOnlyMonacoDiff.iiWNRlR-.css.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/Tab.DlCfjMY1.css +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/Tab.DlCfjMY1.css.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/Tab.DlCfjMY1.css.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/chat-content.Cabnnfyv.css +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/chat-content.Cabnnfyv.css.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/chat-content.Cabnnfyv.css.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/codicon.DCmgc-ay.ttf +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/editor.BMIWPGx3.css +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/editor.BMIWPGx3.css.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/assets/editor.BMIWPGx3.css.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/-UyI9lYi.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/-UyI9lYi.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/-UyI9lYi.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/0cvrggvQ.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/0cvrggvQ.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/0cvrggvQ.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/25W9uPmb.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/25W9uPmb.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/25W9uPmb.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/4Ik7cdeQ.js +8 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/4Ik7cdeQ.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/4Ik7cdeQ.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/5Rap-vPy.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/5Rap-vPy.js.br +3 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/5Rap-vPy.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/9mOMnnWN.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/9mOMnnWN.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/9mOMnnWN.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/B03wrqEc.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/B03wrqEc.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/B03wrqEc.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/B0XwC4Ot.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/B0XwC4Ot.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/B0XwC4Ot.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/B0nqNj93.js +2 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/B0nqNj93.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/B0nqNj93.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/B1dhmiqQ.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/B1dhmiqQ.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/B1dhmiqQ.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/B5zXfXm9.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/B5zXfXm9.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/B5zXfXm9.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/B8q_gCwD.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/B8q_gCwD.js.br +2 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/B8q_gCwD.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/B9Xyijhd.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/B9Xyijhd.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/B9Xyijhd.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/B9pMb6OP.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/B9pMb6OP.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/B9pMb6OP.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BBk8_Xpk.js +2 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BBk8_Xpk.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BBk8_Xpk.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BEdAvgYp.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BEdAvgYp.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BEdAvgYp.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BFG1Mk7z.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BFG1Mk7z.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BFG1Mk7z.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BIv9DU6q.js +303 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BIv9DU6q.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BIv9DU6q.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BJ9KKLWf.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BJ9KKLWf.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BJ9KKLWf.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BKW04JRY.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BKW04JRY.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BKW04JRY.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BKlk5iyT.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BKlk5iyT.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BKlk5iyT.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BMYSavKM.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BMYSavKM.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BMYSavKM.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BOiOqwrA.js +3 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BOiOqwrA.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BOiOqwrA.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BQIf5msi.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BQIf5msi.js.br +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BQIf5msi.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BSkB5QuD.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BSkB5QuD.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BSkB5QuD.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BU7aeYn4.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BU7aeYn4.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BU7aeYn4.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BUkXSKT3.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BUkXSKT3.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BUkXSKT3.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BW6P0Ecp.js +33 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BW6P0Ecp.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BW6P0Ecp.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BY8d35y9.js +16 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BY8d35y9.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BY8d35y9.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/B_c3zf-v.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/B_c3zf-v.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/B_c3zf-v.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/B_fMsGYe.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/B_fMsGYe.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/B_fMsGYe.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BaJupSGV.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BaJupSGV.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BaJupSGV.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BaLxmfj-.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BaLxmfj-.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BaLxmfj-.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Bc-ZgV77.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Bc-ZgV77.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Bc-ZgV77.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BcbX6huO.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BcbX6huO.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BcbX6huO.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BfEKNvv3.js +7 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BfEKNvv3.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BfEKNvv3.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Bhzvs7bI.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Bhzvs7bI.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Bhzvs7bI.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Bio4gycK.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Bio4gycK.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Bio4gycK.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BoFRg7Ot.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BoFRg7Ot.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BoFRg7Ot.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BoX_BZZY.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BoX_BZZY.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BoX_BZZY.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Bp8N7Z1t.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Bp8N7Z1t.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Bp8N7Z1t.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Bqgm2twL.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Bqgm2twL.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Bqgm2twL.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BrgZPUOV.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BrgZPUOV.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BrgZPUOV.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BsTHnhdd.js +7 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BsTHnhdd.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/BsTHnhdd.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/C0rPkxmP.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/C0rPkxmP.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/C0rPkxmP.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/C1FmrZbK.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/C1FmrZbK.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/C1FmrZbK.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/C3cROXCy.js +9 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/C3cROXCy.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/C3cROXCy.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/C4mbwMvt.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/C4mbwMvt.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/C4mbwMvt.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/C5WLch3f.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/C5WLch3f.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/C5WLch3f.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/C9yBjdYI.js +2 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/C9yBjdYI.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/C9yBjdYI.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CAFoob5N.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CAFoob5N.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CAFoob5N.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CCSDG5nI.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CCSDG5nI.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CCSDG5nI.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CCYriF4C.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CCYriF4C.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CCYriF4C.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CDGzqUPQ.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CDGzqUPQ.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CDGzqUPQ.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CDntyWJ8.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CDntyWJ8.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CDntyWJ8.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CFKIUWau.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CFKIUWau.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CFKIUWau.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CFOPXBzS.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CFOPXBzS.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CFOPXBzS.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CGinwM47.js +8 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CGinwM47.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CGinwM47.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CHCMKZAC.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CHCMKZAC.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CHCMKZAC.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CLLBncYj.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CLLBncYj.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CLLBncYj.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/COyEY5Pt.js +7 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/COyEY5Pt.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/COyEY5Pt.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CPajHgWi.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CPajHgWi.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CPajHgWi.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CR-uVjxM.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CR-uVjxM.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CR-uVjxM.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CR5IRTqC.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CR5IRTqC.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CR5IRTqC.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CVwtpugi.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CVwtpugi.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CVwtpugi.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CX-rkNHf.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CX-rkNHf.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CX-rkNHf.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CXOwvkN_.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CXOwvkN_.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CXOwvkN_.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CdQndTaG.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CdQndTaG.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CdQndTaG.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Ce3n6wWz.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Ce3n6wWz.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Ce3n6wWz.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Cg7bfA9N.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Cg7bfA9N.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Cg7bfA9N.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/ClLUwVGq.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/ClLUwVGq.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/ClLUwVGq.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Cp1zYvxS.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Cp1zYvxS.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Cp1zYvxS.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CpIb_Oan.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CpIb_Oan.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CpIb_Oan.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Cpb6xl2v.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Cpb6xl2v.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Cpb6xl2v.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Cphgjts3.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Cphgjts3.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Cphgjts3.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CrxwEwqu.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CrxwEwqu.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CrxwEwqu.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CwNk8-XU.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CwNk8-XU.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CwNk8-XU.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CwmAWymP.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CwmAWymP.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CwmAWymP.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CzKuDChf.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CzKuDChf.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/CzKuDChf.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/D-MeaMDU.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/D-MeaMDU.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/D-MeaMDU.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/D3h14YRZ.js +8 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/D3h14YRZ.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/D3h14YRZ.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/D5C2fndG.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/D5C2fndG.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/D5C2fndG.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DDMPVpvs.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DDMPVpvs.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DDMPVpvs.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DDwshQtU.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DDwshQtU.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DDwshQtU.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DEz15oJb.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DEz15oJb.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DEz15oJb.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DGc0An5V.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DGc0An5V.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DGc0An5V.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DHaeiCBh.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DHaeiCBh.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DHaeiCBh.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DJnDF3d9.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DJnDF3d9.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DJnDF3d9.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DLQqXQ6R.js +751 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DLQqXQ6R.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DLQqXQ6R.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DNvczHUR.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DNvczHUR.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DNvczHUR.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DRIMs3uA.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DRIMs3uA.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DRIMs3uA.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DSZPf7rp.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DSZPf7rp.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DSZPf7rp.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DTECt2xU.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DTECt2xU.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DTECt2xU.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DUeN9t8P.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DUeN9t8P.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DUeN9t8P.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DWH0347h.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DWH0347h.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DWH0347h.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DXsF11_5.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DXsF11_5.js.br +2 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DXsF11_5.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DXyYeYxl.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DXyYeYxl.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DXyYeYxl.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DZxMt77D.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DZxMt77D.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DZxMt77D.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Dba0_Upf.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Dba0_Upf.js.br +2 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Dba0_Upf.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Dd3NCNK9.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Dd3NCNK9.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Dd3NCNK9.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DfzH4Xui.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DfzH4Xui.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DfzH4Xui.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DgGeUDDh.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DgGeUDDh.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DgGeUDDh.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DgyLZaXg.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DgyLZaXg.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DgyLZaXg.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DjDhNM9l.js +9 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DjDhNM9l.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DjDhNM9l.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DjujL8K1.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DjujL8K1.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DjujL8K1.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DnHyzjbg.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DnHyzjbg.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DnHyzjbg.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DnMQeiTY.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DnMQeiTY.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DnMQeiTY.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DrQuvNYM.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DrQuvNYM.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DrQuvNYM.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Drc7WvVn.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Drc7WvVn.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Drc7WvVn.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DuQdgMax.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DuQdgMax.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DuQdgMax.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DwJ7jVG9.js +8 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DwJ7jVG9.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DwJ7jVG9.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DyP6w7ZV.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DyP6w7ZV.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/DyP6w7ZV.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/IKQcdn9t.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/IKQcdn9t.js.br +2 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/IKQcdn9t.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/OERrxy3_.js +64 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/OERrxy3_.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/OERrxy3_.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/T0seCQS_.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/T0seCQS_.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/T0seCQS_.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Tw7wswEv.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Tw7wswEv.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Tw7wswEv.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/YWi4-JPR.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/YWi4-JPR.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/YWi4-JPR.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/ZGfwyPNq.js +15 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/ZGfwyPNq.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/ZGfwyPNq.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Zznr-cwX.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Zznr-cwX.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/Zznr-cwX.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/bynEV6cE.js +9 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/bynEV6cE.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/bynEV6cE.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/dUCx_-0o.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/dUCx_-0o.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/dUCx_-0o.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/ddC1NP9R.js +2 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/ddC1NP9R.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/ddC1NP9R.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/deUWdS0T.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/deUWdS0T.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/deUWdS0T.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/i9-g7ZhI.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/i9-g7ZhI.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/i9-g7ZhI.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/joiJcRPz.js +11 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/joiJcRPz.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/joiJcRPz.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/nf6ki56Z.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/nf6ki56Z.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/nf6ki56Z.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/ouMvMh56.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/ouMvMh56.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/ouMvMh56.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/pnP8ivHi.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/pnP8ivHi.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/pnP8ivHi.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/qiSVE_6c.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/qiSVE_6c.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/qiSVE_6c.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/rUNN04Wq.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/rUNN04Wq.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/rUNN04Wq.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/sKHuRf4Z.js +2 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/sKHuRf4Z.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/sKHuRf4Z.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/tGk8EFnU.js +6 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/tGk8EFnU.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/tGk8EFnU.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/wbPk3Yxo.js +81 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/wbPk3Yxo.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/wbPk3Yxo.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/xC2C8d09.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/xC2C8d09.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/chunks/xC2C8d09.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/entry/app.Bni-2yHM.js +2 -0
- package/build/bosun-app/frontend/client/_app/immutable/entry/app.Bni-2yHM.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/entry/app.Bni-2yHM.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/entry/start.Bwh8stkk.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/entry/start.Bwh8stkk.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/entry/start.Bwh8stkk.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/0.CyFCeOko.js +3 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/0.CyFCeOko.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/0.CyFCeOko.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/1.D9Za90TC.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/1.D9Za90TC.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/1.D9Za90TC.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/10.CQP8ZYdc.js +35 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/10.CQP8ZYdc.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/10.CQP8ZYdc.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/11.1H8cz_S1.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/11.1H8cz_S1.js.br +2 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/11.1H8cz_S1.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/12.Douyi5CF.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/12.Douyi5CF.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/12.Douyi5CF.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/13.DmDIoZI2.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/13.DmDIoZI2.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/13.DmDIoZI2.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/14.DfC4E0Jp.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/14.DfC4E0Jp.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/14.DfC4E0Jp.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/15.drIyAxl2.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/15.drIyAxl2.js.br +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/15.drIyAxl2.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/16.u0CZMrcc.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/16.u0CZMrcc.js.br +4 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/16.u0CZMrcc.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/17.C-6g-4TG.js +3 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/17.C-6g-4TG.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/17.C-6g-4TG.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/18.CKu_cfLu.js +11 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/18.CKu_cfLu.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/18.CKu_cfLu.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/2.lZxPEqtw.js +35 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/2.lZxPEqtw.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/2.lZxPEqtw.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/3.BjH4Ma-k.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/3.BjH4Ma-k.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/3.BjH4Ma-k.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/4.B_swg0wq.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/4.B_swg0wq.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/4.B_swg0wq.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/5.CJfS926N.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/5.CJfS926N.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/5.CJfS926N.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/6.4aRjHu4u.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/6.4aRjHu4u.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/6.4aRjHu4u.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/7.BzXqUj2v.js +1 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/7.BzXqUj2v.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/7.BzXqUj2v.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/8.BZFIHe4g.js +2 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/8.BZFIHe4g.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/8.BZFIHe4g.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/9.BYJRzNt4.js +2 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/9.BYJRzNt4.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/nodes/9.BYJRzNt4.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/workers/css.worker-BRIrhzkG.js +84 -0
- package/build/bosun-app/frontend/client/_app/immutable/workers/css.worker-BRIrhzkG.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/workers/css.worker-BRIrhzkG.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/workers/editor.worker-DX6ApQqM.js +12 -0
- package/build/bosun-app/frontend/client/_app/immutable/workers/editor.worker-DX6ApQqM.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/workers/editor.worker-DX6ApQqM.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/workers/html.worker-CBI4EQBP.js +461 -0
- package/build/bosun-app/frontend/client/_app/immutable/workers/html.worker-CBI4EQBP.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/workers/html.worker-CBI4EQBP.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/workers/json.worker-CIZWV9vN.js +49 -0
- package/build/bosun-app/frontend/client/_app/immutable/workers/json.worker-CIZWV9vN.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/workers/json.worker-CIZWV9vN.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/workers/ts.worker-Ds4I2Msu.js +51334 -0
- package/build/bosun-app/frontend/client/_app/immutable/workers/ts.worker-Ds4I2Msu.js.br +0 -0
- package/build/bosun-app/frontend/client/_app/immutable/workers/ts.worker-Ds4I2Msu.js.gz +0 -0
- package/build/bosun-app/frontend/client/_app/version.json +1 -0
- package/build/bosun-app/frontend/client/_app/version.json.br +0 -0
- package/build/bosun-app/frontend/client/_app/version.json.gz +0 -0
- package/build/bosun-app/frontend/client/favicon.png +0 -0
- package/build/bosun-app/frontend/client/fonts/DarkerGrotesque-Black.ttf +0 -0
- package/build/bosun-app/frontend/client/fonts/DarkerGrotesque-Bold.ttf +0 -0
- package/build/bosun-app/frontend/client/fonts/DarkerGrotesque-Light.ttf +0 -0
- package/build/bosun-app/frontend/client/fonts/DarkerGrotesque-Medium.ttf +0 -0
- package/build/bosun-app/frontend/client/fonts/DarkerGrotesque-Regular.ttf +0 -0
- package/build/bosun-app/frontend/client/fonts/DarkerGrotesque-SemiBold.ttf +0 -0
- package/build/bosun-app/frontend/client/fonts.css +42 -0
- package/build/bosun-app/frontend/client/fonts.css.br +0 -0
- package/build/bosun-app/frontend/client/fonts.css.gz +0 -0
- package/build/bosun-app/frontend/client/recombine.svg +11 -0
- package/build/bosun-app/frontend/client/recombine.svg.br +0 -0
- package/build/bosun-app/frontend/client/recombine.svg.gz +0 -0
- package/build/bosun-app/frontend/client/telescope-icon.svg +4 -0
- package/build/bosun-app/frontend/client/telescope-icon.svg.br +0 -0
- package/build/bosun-app/frontend/client/telescope-icon.svg.gz +0 -0
- package/build/bosun-app/frontend/client/ui/arrow_tests.svg +3 -0
- package/build/bosun-app/frontend/client/ui/arrow_tests.svg.br +0 -0
- package/build/bosun-app/frontend/client/ui/arrow_tests.svg.gz +0 -0
- package/build/bosun-app/frontend/client/ui/paperclip.svg +3 -0
- package/build/bosun-app/frontend/client/ui/paperclip.svg.br +0 -0
- package/build/bosun-app/frontend/client/ui/paperclip.svg.gz +0 -0
- package/build/bosun-app/frontend/client/ui/send.svg +4 -0
- package/build/bosun-app/frontend/client/ui/send.svg.br +0 -0
- package/build/bosun-app/frontend/client/ui/send.svg.gz +0 -0
- package/build/bosun-app/frontend/env.js +70 -0
- package/build/bosun-app/frontend/env.js.map +1 -0
- package/build/bosun-app/frontend/handler.js +28 -0
- package/build/bosun-app/frontend/handler.js.map +1 -0
- package/build/bosun-app/frontend/index.js +151 -0
- package/build/bosun-app/frontend/index.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/chunks/AgentSidebar.js-CFHwsTeS.js +170 -0
- package/build/bosun-app/frontend/server/chunks/chunks/AgentSidebar.js-CFHwsTeS.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/chunks/Button.js-IbO6ojjD.js +47 -0
- package/build/bosun-app/frontend/server/chunks/chunks/Button.js-IbO6ojjD.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/chunks/ChatStepTrace.js-VTtwaKGp.js +558 -0
- package/build/bosun-app/frontend/server/chunks/chunks/ChatStepTrace.js-VTtwaKGp.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/chunks/Dropdown.js-VxjZvXGD.js +62 -0
- package/build/bosun-app/frontend/server/chunks/chunks/Dropdown.js-VxjZvXGD.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/chunks/Icon.js-DzsiLkia.js +77 -0
- package/build/bosun-app/frontend/server/chunks/chunks/Icon.js-DzsiLkia.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/chunks/Input.js-V9tWKRFS.js +22 -0
- package/build/bosun-app/frontend/server/chunks/chunks/Input.js-V9tWKRFS.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/chunks/Modal.js-BUDSUOER.js +2290 -0
- package/build/bosun-app/frontend/server/chunks/chunks/Modal.js-BUDSUOER.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/chunks/Panel.js-Dyc_ecR2.js +11 -0
- package/build/bosun-app/frontend/server/chunks/chunks/Panel.js-Dyc_ecR2.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/chunks/Tab.js-DpBcUmVx.js +83 -0
- package/build/bosun-app/frontend/server/chunks/chunks/Tab.js-DpBcUmVx.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/chunks/agents-context.js-DdI5kzRS.js +6 -0
- package/build/bosun-app/frontend/server/chunks/chunks/agents-context.js-DdI5kzRS.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/chunks/client.js-C_B2rv3r.js +19 -0
- package/build/bosun-app/frontend/server/chunks/chunks/client.js-C_B2rv3r.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/chunks/conversation-view-memory.js-DjOFeigb.js +20 -0
- package/build/bosun-app/frontend/server/chunks/chunks/conversation-view-memory.js-DjOFeigb.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/chunks/edit-workspace-context.js-DGPpbvI5.js +6 -0
- package/build/bosun-app/frontend/server/chunks/chunks/edit-workspace-context.js-DGPpbvI5.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/chunks/event.js-BfLhxAp5.js +19 -0
- package/build/bosun-app/frontend/server/chunks/chunks/event.js-BfLhxAp5.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/chunks/exports.js-8HOoaa4e.js +161 -0
- package/build/bosun-app/frontend/server/chunks/chunks/exports.js-8HOoaa4e.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/chunks/index-server.js-CALBgpac.js +17 -0
- package/build/bosun-app/frontend/server/chunks/chunks/index-server.js-CALBgpac.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/chunks/index.js-DczFGj-7.js +3383 -0
- package/build/bosun-app/frontend/server/chunks/chunks/index.js-DczFGj-7.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/chunks/index2.js-DYVLcO2-.js +28 -0
- package/build/bosun-app/frontend/server/chunks/chunks/index2.js-DYVLcO2-.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/chunks/index3.js-WpnIn8V1.js +111 -0
- package/build/bosun-app/frontend/server/chunks/chunks/index3.js-WpnIn8V1.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/chunks/index4.js-C9gg2iSH.js +63 -0
- package/build/bosun-app/frontend/server/chunks/chunks/index4.js-C9gg2iSH.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/chunks/internal.js-V8Wfo1-F.js +121 -0
- package/build/bosun-app/frontend/server/chunks/chunks/internal.js-V8Wfo1-F.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/chunks/js-yaml.js-Dx-xfeGn.js +733 -0
- package/build/bosun-app/frontend/server/chunks/chunks/js-yaml.js-Dx-xfeGn.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/chunks/latency-recordings.js-CqioXMQl.js +117 -0
- package/build/bosun-app/frontend/server/chunks/chunks/latency-recordings.js-CqioXMQl.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/chunks/latency.js--f3JYIRg.js +157 -0
- package/build/bosun-app/frontend/server/chunks/chunks/latency.js--f3JYIRg.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/chunks/log-content.svelte.js-C6EzbHLC.js +20 -0
- package/build/bosun-app/frontend/server/chunks/chunks/log-content.svelte.js-C6EzbHLC.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/chunks/root.js-CJvqqGUj.js +1052 -0
- package/build/bosun-app/frontend/server/chunks/chunks/root.js-CJvqqGUj.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/chunks/schemas.js-W-DP3mDr.js +4506 -0
- package/build/bosun-app/frontend/server/chunks/chunks/schemas.js-W-DP3mDr.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/chunks/server.js-Bf8x1V_n.js +16 -0
- package/build/bosun-app/frontend/server/chunks/chunks/server.js-Bf8x1V_n.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/chunks/shared-server.js-DaWdgxVh.js +11 -0
- package/build/bosun-app/frontend/server/chunks/chunks/shared-server.js-DaWdgxVh.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/chunks/source-selection.js-Cc6RX6-m.js +243 -0
- package/build/bosun-app/frontend/server/chunks/chunks/source-selection.js-Cc6RX6-m.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/chunks/sources.server.js-B6fpC51P.js +74 -0
- package/build/bosun-app/frontend/server/chunks/chunks/sources.server.js-B6fpC51P.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/chunks/state.svelte.js-DDOPLPl-.js +13 -0
- package/build/bosun-app/frontend/server/chunks/chunks/state.svelte.js-DDOPLPl-.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/chunks/steps.js-DzZCg39h.js +8 -0
- package/build/bosun-app/frontend/server/chunks/chunks/steps.js-DzZCg39h.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/chunks/trpc-client.js-zIPF9ytu.js +1154 -0
- package/build/bosun-app/frontend/server/chunks/chunks/trpc-client.js-zIPF9ytu.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/chunks/uneval.js-5Y6J9rDU.js +530 -0
- package/build/bosun-app/frontend/server/chunks/chunks/uneval.js-5Y6J9rDU.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/chunks/utils.js-BQzn9ikS.js +38 -0
- package/build/bosun-app/frontend/server/chunks/chunks/utils.js-BQzn9ikS.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/chunks/utils2.js-DyJSCbBx.js +1365 -0
- package/build/bosun-app/frontend/server/chunks/chunks/utils2.js-DyJSCbBx.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/entries/endpoints/traces/api/latency/_conversationId_/_server.ts.js-hHR2eFvt.js +140 -0
- package/build/bosun-app/frontend/server/chunks/entries/endpoints/traces/api/latency/_conversationId_/_server.ts.js-hHR2eFvt.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/entries/endpoints/traces/api/latency/_conversationId_/audio/_server.ts.js-BluTfSQd.js +38 -0
- package/build/bosun-app/frontend/server/chunks/entries/endpoints/traces/api/latency/_conversationId_/audio/_server.ts.js-BluTfSQd.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/entries/endpoints/traces/api/proxy/_...path_/_server.ts.js-CHrOiduq.js +51 -0
- package/build/bosun-app/frontend/server/chunks/entries/endpoints/traces/api/proxy/_...path_/_server.ts.js-CHrOiduq.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/entries/endpoints/traces/api/sources/_server.ts.js-C2FIU8Kr.js +24 -0
- package/build/bosun-app/frontend/server/chunks/entries/endpoints/traces/api/sources/_server.ts.js-C2FIU8Kr.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/entries/fallbacks/error.svelte.js-CUaQ38ir.js +17 -0
- package/build/bosun-app/frontend/server/chunks/entries/fallbacks/error.svelte.js-CUaQ38ir.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/entries/hooks.universal.js-BJphIAi-.js +8 -0
- package/build/bosun-app/frontend/server/chunks/entries/hooks.universal.js-BJphIAi-.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/entries/pages/_layout.svelte.js-BzoISDtG.js +48 -0
- package/build/bosun-app/frontend/server/chunks/entries/pages/_layout.svelte.js-BzoISDtG.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/entries/pages/_page.svelte.js-Dx0vF3Lq.js +47 -0
- package/build/bosun-app/frontend/server/chunks/entries/pages/_page.svelte.js-Dx0vF3Lq.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/entries/pages/edit/_agent_/_layout.svelte.js-B2wHKJV7.js +9089 -0
- package/build/bosun-app/frontend/server/chunks/entries/pages/edit/_agent_/_layout.svelte.js-B2wHKJV7.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/entries/pages/edit/_agent_/_page.ts.js-CFNiL-gK.js +19 -0
- package/build/bosun-app/frontend/server/chunks/entries/pages/edit/_agent_/_page.ts.js-CFNiL-gK.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/entries/pages/edit/_agent_/configure/_page.svelte.js-CEL_4VPG.js +61 -0
- package/build/bosun-app/frontend/server/chunks/entries/pages/edit/_agent_/configure/_page.svelte.js-CEL_4VPG.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/entries/pages/edit/_agent_/roleplay/_page.svelte.js-DDcIjgZD.js +1435 -0
- package/build/bosun-app/frontend/server/chunks/entries/pages/edit/_agent_/roleplay/_page.svelte.js-DDcIjgZD.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/entries/pages/edit/_agent_/tests/_page.svelte.js-UVUg89-t.js +2169 -0
- package/build/bosun-app/frontend/server/chunks/entries/pages/edit/_agent_/tests/_page.svelte.js-UVUg89-t.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/entries/pages/edit/_page.svelte.js-kE5Ar91A.js +73 -0
- package/build/bosun-app/frontend/server/chunks/entries/pages/edit/_page.svelte.js-kE5Ar91A.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/entries/pages/roleplay/_page.ts.js-7xRh8oLz.js +19 -0
- package/build/bosun-app/frontend/server/chunks/entries/pages/roleplay/_page.ts.js-7xRh8oLz.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/entries/pages/tests/_agent_/_page.ts.js-CoMBAK66.js +15 -0
- package/build/bosun-app/frontend/server/chunks/entries/pages/tests/_agent_/_page.ts.js-CoMBAK66.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/entries/pages/tests/_page.ts.js-BeaHASlP.js +13 -0
- package/build/bosun-app/frontend/server/chunks/entries/pages/tests/_page.ts.js-BeaHASlP.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/entries/pages/traces/_page.ts.js-BDwYwqJJ.js +14 -0
- package/build/bosun-app/frontend/server/chunks/entries/pages/traces/_page.ts.js-BDwYwqJJ.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/entries/pages/traces/conversations/_conversationId_/_layout.svelte.js-BunyOuzX.js +64 -0
- package/build/bosun-app/frontend/server/chunks/entries/pages/traces/conversations/_conversationId_/_layout.svelte.js-BunyOuzX.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/entries/pages/traces/conversations/_conversationId_/_page.ts.js-DCdyFx8I.js +14 -0
- package/build/bosun-app/frontend/server/chunks/entries/pages/traces/conversations/_conversationId_/_page.ts.js-DCdyFx8I.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/entries/pages/traces/conversations/_conversationId_/latency/_page.svelte.js-tdUdTo4m.js +1821 -0
- package/build/bosun-app/frontend/server/chunks/entries/pages/traces/conversations/_conversationId_/latency/_page.svelte.js-tdUdTo4m.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/entries/pages/traces/conversations/_conversationId_/traces/_page.svelte.js-Ca79DBzJ.js +947 -0
- package/build/bosun-app/frontend/server/chunks/entries/pages/traces/conversations/_conversationId_/traces/_page.svelte.js-Ca79DBzJ.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/entries/pages/traces/conversations/_layout.svelte.js-Dvn3tfM7.js +478 -0
- package/build/bosun-app/frontend/server/chunks/entries/pages/traces/conversations/_layout.svelte.js-Dvn3tfM7.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/entries/pages/traces/conversations/_page.svelte.js-DvRZkYfo.js +14 -0
- package/build/bosun-app/frontend/server/chunks/entries/pages/traces/conversations/_page.svelte.js-DvRZkYfo.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/handler-I7zF-fv9.js +1756 -0
- package/build/bosun-app/frontend/server/chunks/handler-I7zF-fv9.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/index.js-Ca0Ef2Tt.js +4120 -0
- package/build/bosun-app/frontend/server/chunks/index.js-Ca0Ef2Tt.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/manifest.js-D22OChaf.js +177 -0
- package/build/bosun-app/frontend/server/chunks/manifest.js-D22OChaf.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/nodes/0.js-CoDyOiLt.js +9 -0
- package/build/bosun-app/frontend/server/chunks/nodes/0.js-CoDyOiLt.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/nodes/1.js-BesNpd2w.js +9 -0
- package/build/bosun-app/frontend/server/chunks/nodes/1.js-BesNpd2w.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/nodes/10.js-DN5elTKV.js +9 -0
- package/build/bosun-app/frontend/server/chunks/nodes/10.js-DN5elTKV.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/nodes/11.js-DY_yGGfd.js +12 -0
- package/build/bosun-app/frontend/server/chunks/nodes/11.js-DY_yGGfd.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/nodes/12.js-Y03iWeel.js +12 -0
- package/build/bosun-app/frontend/server/chunks/nodes/12.js-Y03iWeel.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/nodes/13.js-1lz41CRL.js +12 -0
- package/build/bosun-app/frontend/server/chunks/nodes/13.js-1lz41CRL.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/nodes/14.js-DkuFA-fc.js +12 -0
- package/build/bosun-app/frontend/server/chunks/nodes/14.js-DkuFA-fc.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/nodes/15.js-cNd06B9T.js +9 -0
- package/build/bosun-app/frontend/server/chunks/nodes/15.js-cNd06B9T.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/nodes/16.js-BnrzEE51.js +12 -0
- package/build/bosun-app/frontend/server/chunks/nodes/16.js-BnrzEE51.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/nodes/17.js-DExEAB_e.js +9 -0
- package/build/bosun-app/frontend/server/chunks/nodes/17.js-DExEAB_e.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/nodes/18.js-OLWFvVu0.js +9 -0
- package/build/bosun-app/frontend/server/chunks/nodes/18.js-OLWFvVu0.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/nodes/2.js-DdMhYSQT.js +9 -0
- package/build/bosun-app/frontend/server/chunks/nodes/2.js-DdMhYSQT.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/nodes/3.js-DRo_79wF.js +9 -0
- package/build/bosun-app/frontend/server/chunks/nodes/3.js-DRo_79wF.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/nodes/4.js-Bb8ZnG8K.js +9 -0
- package/build/bosun-app/frontend/server/chunks/nodes/4.js-Bb8ZnG8K.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/nodes/5.js-DNbqpjRZ.js +9 -0
- package/build/bosun-app/frontend/server/chunks/nodes/5.js-DNbqpjRZ.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/nodes/6.js-MMZWg86o.js +9 -0
- package/build/bosun-app/frontend/server/chunks/nodes/6.js-MMZWg86o.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/nodes/7.js-CmnAMDtD.js +12 -0
- package/build/bosun-app/frontend/server/chunks/nodes/7.js-CmnAMDtD.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/nodes/8.js-Cs981zJ4.js +9 -0
- package/build/bosun-app/frontend/server/chunks/nodes/8.js-Cs981zJ4.js.map +1 -0
- package/build/bosun-app/frontend/server/chunks/nodes/9.js-h4jeZZT-.js +9 -0
- package/build/bosun-app/frontend/server/chunks/nodes/9.js-h4jeZZT-.js.map +1 -0
- package/build/bosun-app/frontend/shims.js +33 -0
- package/build/bosun-app/frontend/shims.js.map +1 -0
- package/build/build/agent-service.d.ts +8 -0
- package/build/build/agent-service.d.ts.map +1 -0
- package/build/build/agent-service.js +32 -0
- package/build/build/cli.d.ts +13 -0
- package/build/build/cli.d.ts.map +1 -0
- package/build/build/cli.js +103 -0
- package/build/build/common.d.ts +12 -0
- package/build/build/common.d.ts.map +1 -0
- package/build/build/common.js +75 -0
- package/build/build/index.d.ts +7 -0
- package/build/build/index.d.ts.map +1 -0
- package/build/build/index.js +3 -0
- package/build/build/text-function.d.ts +6 -0
- package/build/build/text-function.d.ts.map +1 -0
- package/build/build/text-function.js +55 -0
- package/build/call-control/call-control.d.ts +36 -0
- package/build/call-control/call-control.d.ts.map +1 -0
- package/build/call-control/call-control.js +207 -0
- package/build/call-control/call-details/index.d.ts +2 -0
- package/build/call-control/call-details/index.d.ts.map +1 -0
- package/build/call-control/call-details/index.js +1 -0
- package/build/call-control/call-details/noop-storage.d.ts +10 -0
- package/build/call-control/call-details/noop-storage.d.ts.map +1 -0
- package/build/call-control/call-details/noop-storage.js +11 -0
- package/build/call-control/index.d.ts +7 -0
- package/build/call-control/index.d.ts.map +1 -0
- package/build/call-control/index.js +4 -0
- package/build/call-control/port.d.ts +15 -0
- package/build/call-control/port.d.ts.map +1 -0
- package/build/call-control/port.js +1 -0
- package/build/call-control/schemas.generated.d.ts +156 -0
- package/build/call-control/schemas.generated.d.ts.map +1 -0
- package/build/call-control/schemas.generated.js +281 -0
- package/build/call-control/sip-setup-lock.d.ts +6 -0
- package/build/call-control/sip-setup-lock.d.ts.map +1 -0
- package/build/call-control/sip-setup-lock.js +60 -0
- package/build/call-control/sip.d.ts +41 -0
- package/build/call-control/sip.d.ts.map +1 -0
- package/build/call-control/sip.js +423 -0
- package/build/call-control/types.d.ts +352 -0
- package/build/call-control/types.d.ts.map +1 -0
- package/build/call-control/types.js +30 -0
- package/build/call-control/utils.d.ts +13 -0
- package/build/call-control/utils.d.ts.map +1 -0
- package/build/call-control/utils.js +43 -0
- package/build/{context-cache.d.ts → context-cache/index.d.ts} +4 -3
- package/build/context-cache/index.d.ts.map +1 -0
- package/build/{context-cache.js → context-cache/index.js} +20 -8
- package/build/core/index.d.ts +6 -0
- package/build/core/index.d.ts.map +1 -0
- package/build/core/index.js +2 -0
- package/build/core/make-text-platform.d.ts +15 -0
- package/build/core/make-text-platform.d.ts.map +1 -0
- package/build/core/make-text-platform.js +27 -0
- package/build/core/make-voice-platform.d.ts +16 -0
- package/build/core/make-voice-platform.d.ts.map +1 -0
- package/build/core/make-voice-platform.js +51 -0
- package/build/core/platform.d.ts +30 -0
- package/build/core/platform.d.ts.map +1 -0
- package/build/core/platform.js +1 -0
- package/build/dockyard/index.d.ts +4 -0
- package/build/dockyard/index.d.ts.map +1 -0
- package/build/dockyard/index.js +2 -0
- package/build/dockyard/logger/base.d.ts +20 -0
- package/build/dockyard/logger/base.d.ts.map +1 -0
- package/build/dockyard/logger/base.js +26 -0
- package/build/dockyard/logger/configuration.d.ts +13 -0
- package/build/dockyard/logger/configuration.d.ts.map +1 -0
- package/build/dockyard/logger/configuration.js +22 -0
- package/build/dockyard/logger/helpers.d.ts +6 -0
- package/build/dockyard/logger/helpers.d.ts.map +1 -0
- package/build/dockyard/logger/helpers.js +46 -0
- package/build/dockyard/logger/index.d.ts +12 -0
- package/build/dockyard/logger/index.d.ts.map +1 -0
- package/build/dockyard/logger/index.js +92 -0
- package/build/dockyard/logger/local-context.d.ts +11 -0
- package/build/dockyard/logger/local-context.d.ts.map +1 -0
- package/build/dockyard/logger/local-context.js +23 -0
- package/build/engine/bosun/action.d.ts +10 -0
- package/build/engine/bosun/action.d.ts.map +1 -0
- package/build/engine/bosun/action.js +32 -0
- package/build/engine/bosun/agent.d.ts +37 -0
- package/build/engine/bosun/agent.d.ts.map +1 -0
- package/build/engine/bosun/agent.js +3 -0
- package/build/engine/bosun/api-call-tracer.d.ts +8 -0
- package/build/engine/bosun/api-call-tracer.d.ts.map +1 -0
- package/build/engine/bosun/api-call-tracer.js +8 -0
- package/build/engine/bosun/context.d.ts +23 -0
- package/build/engine/bosun/context.d.ts.map +1 -0
- package/build/engine/bosun/context.js +41 -0
- package/build/engine/bosun/conversational-tracer.d.ts +8 -0
- package/build/engine/bosun/conversational-tracer.d.ts.map +1 -0
- package/build/engine/bosun/conversational-tracer.js +8 -0
- package/build/engine/bosun/index.d.ts +9 -0
- package/build/engine/bosun/index.d.ts.map +1 -0
- package/build/engine/bosun/index.js +7 -0
- package/build/engine/bosun/mock.d.ts +6 -0
- package/build/engine/bosun/mock.d.ts.map +1 -0
- package/build/engine/bosun/mock.js +28 -0
- package/build/engine/bosun/step-tracer.d.ts +8 -0
- package/build/engine/bosun/step-tracer.d.ts.map +1 -0
- package/build/engine/bosun/step-tracer.js +29 -0
- package/build/engine/default-logger.d.ts +3 -0
- package/build/engine/default-logger.d.ts.map +1 -0
- package/build/engine/default-logger.js +5 -0
- package/build/engine/engine.d.ts +6 -0
- package/build/engine/engine.d.ts.map +1 -0
- package/build/engine/engine.js +306 -0
- package/build/engine/index.d.ts +15 -0
- package/build/engine/index.d.ts.map +1 -0
- package/build/engine/index.js +7 -0
- package/build/engine/interfaces/adapter.d.ts +12 -0
- package/build/engine/interfaces/adapter.d.ts.map +1 -0
- package/build/engine/interfaces/adapter.js +1 -0
- package/build/engine/interfaces/conversation.d.ts +19 -0
- package/build/engine/interfaces/conversation.d.ts.map +1 -0
- package/build/engine/interfaces/conversation.js +1 -0
- package/build/engine/interfaces/engine.d.ts +21 -0
- package/build/engine/interfaces/engine.d.ts.map +1 -0
- package/build/engine/interfaces/engine.js +1 -0
- package/build/engine/interfaces/index.d.ts +8 -0
- package/build/engine/interfaces/index.d.ts.map +1 -0
- package/build/engine/interfaces/index.js +7 -0
- package/build/engine/interfaces/other.d.ts +7 -0
- package/build/engine/interfaces/other.d.ts.map +1 -0
- package/build/engine/interfaces/other.js +1 -0
- package/build/engine/interfaces/steps.d.ts +33 -0
- package/build/engine/interfaces/steps.d.ts.map +1 -0
- package/build/engine/interfaces/steps.js +1 -0
- package/build/engine/interfaces/stream.d.ts +43 -0
- package/build/engine/interfaces/stream.d.ts.map +1 -0
- package/build/engine/interfaces/stream.js +1 -0
- package/build/engine/interfaces/workflow.d.ts +18 -0
- package/build/engine/interfaces/workflow.d.ts.map +1 -0
- package/build/engine/interfaces/workflow.js +1 -0
- package/build/engine/llm-adapters/index.d.ts +5 -0
- package/build/engine/llm-adapters/index.d.ts.map +1 -0
- package/build/engine/llm-adapters/index.js +4 -0
- package/build/engine/llm-adapters/mock.d.ts +3 -0
- package/build/engine/llm-adapters/mock.d.ts.map +1 -0
- package/build/engine/llm-adapters/mock.js +11 -0
- package/build/engine/llm-adapters/openai-stream.d.ts +6 -0
- package/build/engine/llm-adapters/openai-stream.d.ts.map +1 -0
- package/build/engine/llm-adapters/openai-stream.js +29 -0
- package/build/engine/llm-adapters/openai.d.ts +8 -0
- package/build/engine/llm-adapters/openai.d.ts.map +1 -0
- package/build/engine/llm-adapters/openai.js +34 -0
- package/build/engine/llm-adapters/provider.d.ts +4 -0
- package/build/engine/llm-adapters/provider.d.ts.map +1 -0
- package/build/engine/llm-adapters/provider.js +10 -0
- package/build/engine/monitoring/index.d.ts +2 -0
- package/build/engine/monitoring/index.d.ts.map +1 -0
- package/build/engine/monitoring/index.js +1 -0
- package/build/engine/monitoring/provider-errors.d.ts +19 -0
- package/build/engine/monitoring/provider-errors.d.ts.map +1 -0
- package/build/engine/monitoring/provider-errors.js +133 -0
- package/build/engine/prompt-fs.d.ts +17 -0
- package/build/engine/prompt-fs.d.ts.map +1 -0
- package/build/engine/prompt-fs.js +18 -0
- package/build/engine/schedule.d.ts +30 -0
- package/build/engine/schedule.d.ts.map +1 -0
- package/build/engine/schedule.js +109 -0
- package/build/engine/step-registry.d.ts +19 -0
- package/build/engine/step-registry.d.ts.map +1 -0
- package/build/engine/step-registry.js +16 -0
- package/build/engine/stream/engine.d.ts +3 -0
- package/build/engine/stream/engine.d.ts.map +1 -0
- package/build/engine/stream/engine.js +167 -0
- package/build/engine/stream/get-client.d.ts +15 -0
- package/build/engine/stream/get-client.d.ts.map +1 -0
- package/build/engine/stream/get-client.js +118 -0
- package/build/engine/stream/index.d.ts +4 -0
- package/build/engine/stream/index.d.ts.map +1 -0
- package/build/engine/stream/index.js +2 -0
- package/build/engine/stream/token-transformers.d.ts +6 -0
- package/build/engine/stream/token-transformers.d.ts.map +1 -0
- package/build/engine/stream/token-transformers.js +50 -0
- package/build/index.d.ts +2 -7
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2 -23
- package/build/notifications/index.d.ts +5 -0
- package/build/notifications/index.d.ts.map +1 -0
- package/build/notifications/index.js +4 -0
- package/build/notifications/logger.d.ts +2 -0
- package/build/notifications/logger.d.ts.map +1 -0
- package/build/notifications/logger.js +2 -0
- package/build/notifications/publisher.d.ts +10 -0
- package/build/notifications/publisher.d.ts.map +1 -0
- package/build/notifications/publisher.js +31 -0
- package/build/notifications/router.d.ts +18 -0
- package/build/notifications/router.d.ts.map +1 -0
- package/build/notifications/router.js +132 -0
- package/build/notifications/transport.d.ts +11 -0
- package/build/notifications/transport.d.ts.map +1 -0
- package/build/notifications/transport.js +31 -0
- package/build/notifications/types.d.ts +20 -0
- package/build/notifications/types.d.ts.map +1 -0
- package/build/notifications/types.js +1 -0
- package/build/steps/helpers.d.ts +11 -0
- package/build/steps/helpers.d.ts.map +1 -0
- package/build/steps/helpers.js +36 -0
- package/build/steps/index.d.ts +10 -0
- package/build/steps/index.d.ts.map +1 -0
- package/build/steps/index.js +5 -0
- package/build/steps/instructions-or-query.d.ts +9 -0
- package/build/steps/instructions-or-query.d.ts.map +1 -0
- package/build/steps/instructions-or-query.js +15 -0
- package/build/steps/make-all-required.d.ts +3 -0
- package/build/steps/make-all-required.d.ts.map +1 -0
- package/build/steps/make-all-required.js +41 -0
- package/build/steps/slot-booker/book-slot/prompt.d.ts +2 -0
- package/build/steps/slot-booker/book-slot/prompt.d.ts.map +1 -0
- package/build/steps/slot-booker/book-slot/prompt.js +24 -0
- package/build/steps/slot-booker/book-slot/step.d.ts +12 -0
- package/build/steps/slot-booker/book-slot/step.d.ts.map +1 -0
- package/build/steps/slot-booker/book-slot/step.js +51 -0
- package/build/steps/slot-booker/check-slots-for-match/prompt.d.ts +2 -0
- package/build/steps/slot-booker/check-slots-for-match/prompt.d.ts.map +1 -0
- package/build/steps/slot-booker/check-slots-for-match/prompt.js +30 -0
- package/build/steps/slot-booker/check-slots-for-match/step.d.ts +9 -0
- package/build/steps/slot-booker/check-slots-for-match/step.d.ts.map +1 -0
- package/build/steps/slot-booker/check-slots-for-match/step.js +23 -0
- package/build/steps/slot-booker/cleanup/step.d.ts +5 -0
- package/build/steps/slot-booker/cleanup/step.d.ts.map +1 -0
- package/build/steps/slot-booker/cleanup/step.js +22 -0
- package/build/steps/slot-booker/context.d.ts +14 -0
- package/build/steps/slot-booker/context.d.ts.map +1 -0
- package/build/steps/slot-booker/context.js +1 -0
- package/build/steps/slot-booker/find-slots/prompt.d.ts +2 -0
- package/build/steps/slot-booker/find-slots/prompt.d.ts.map +1 -0
- package/build/steps/slot-booker/find-slots/prompt.js +27 -0
- package/build/steps/slot-booker/find-slots/step.d.ts +12 -0
- package/build/steps/slot-booker/find-slots/step.d.ts.map +1 -0
- package/build/steps/slot-booker/find-slots/step.js +79 -0
- package/build/steps/slot-booker/init/step.d.ts +5 -0
- package/build/steps/slot-booker/init/step.d.ts.map +1 -0
- package/build/steps/slot-booker/init/step.js +37 -0
- package/build/steps/slot-booker/interfaces.d.ts +29 -0
- package/build/steps/slot-booker/interfaces.d.ts.map +1 -0
- package/build/steps/slot-booker/interfaces.js +1 -0
- package/build/steps/slot-booker/slot-booker.d.ts +27 -0
- package/build/steps/slot-booker/slot-booker.d.ts.map +1 -0
- package/build/steps/slot-booker/slot-booker.js +28 -0
- package/build/steps/slot-booker/util.d.ts +8 -0
- package/build/steps/slot-booker/util.d.ts.map +1 -0
- package/build/steps/slot-booker/util.js +26 -0
- package/build/telescope/api.d.ts +13 -0
- package/build/telescope/api.d.ts.map +1 -0
- package/build/telescope/api.js +43 -0
- package/build/telescope/create-telescope.d.ts +10 -0
- package/build/telescope/create-telescope.d.ts.map +1 -0
- package/build/telescope/create-telescope.js +7 -0
- package/build/telescope/index.d.ts +22 -0
- package/build/telescope/index.d.ts.map +1 -0
- package/build/telescope/index.js +8 -0
- package/build/telescope/interfaces/api-call-tracer.d.ts +21 -0
- package/build/telescope/interfaces/api-call-tracer.d.ts.map +1 -0
- package/build/telescope/interfaces/api-call-tracer.js +1 -0
- package/build/telescope/interfaces/conversation.d.ts +22 -0
- package/build/telescope/interfaces/conversation.d.ts.map +1 -0
- package/build/telescope/interfaces/conversation.js +1 -0
- package/build/telescope/interfaces/conversational-tracer.d.ts +16 -0
- package/build/telescope/interfaces/conversational-tracer.d.ts.map +1 -0
- package/build/telescope/interfaces/conversational-tracer.js +1 -0
- package/build/telescope/interfaces/event-tracer.d.ts +125 -0
- package/build/telescope/interfaces/event-tracer.d.ts.map +1 -0
- package/build/telescope/interfaces/event-tracer.js +1 -0
- package/build/telescope/interfaces/latency-tracer.d.ts +14 -0
- package/build/telescope/interfaces/latency-tracer.d.ts.map +1 -0
- package/build/telescope/interfaces/latency-tracer.js +1 -0
- package/build/telescope/interfaces/step-tracer.d.ts +30 -0
- package/build/telescope/interfaces/step-tracer.d.ts.map +1 -0
- package/build/telescope/interfaces/step-tracer.js +1 -0
- package/build/telescope/interfaces/storage.d.ts +17 -0
- package/build/telescope/interfaces/storage.d.ts.map +1 -0
- package/build/telescope/interfaces/storage.js +1 -0
- package/build/telescope/interfaces/telescope.d.ts +22 -0
- package/build/telescope/interfaces/telescope.d.ts.map +1 -0
- package/build/telescope/interfaces/telescope.js +1 -0
- package/build/telescope/interfaces/traces.d.ts +88 -0
- package/build/telescope/interfaces/traces.d.ts.map +1 -0
- package/build/telescope/interfaces/traces.js +1 -0
- package/build/telescope/latency-events.d.ts +15 -0
- package/build/telescope/latency-events.d.ts.map +1 -0
- package/build/telescope/latency-events.js +41 -0
- package/build/telescope/stub-storage.d.ts +21 -0
- package/build/telescope/stub-storage.d.ts.map +1 -0
- package/build/telescope/stub-storage.js +55 -0
- package/build/telescope/stub-telescope.d.ts +5 -0
- package/build/telescope/stub-telescope.d.ts.map +1 -0
- package/build/telescope/stub-telescope.js +47 -0
- package/build/telescope/stubs.d.ts +22 -0
- package/build/telescope/stubs.d.ts.map +1 -0
- package/build/telescope/stubs.js +51 -0
- package/build/telescope/telescope.d.ts +21 -0
- package/build/telescope/telescope.d.ts.map +1 -0
- package/build/telescope/telescope.js +41 -0
- package/build/telescope/trace-helpers.d.ts +12 -0
- package/build/telescope/trace-helpers.d.ts.map +1 -0
- package/build/telescope/trace-helpers.js +54 -0
- package/build/telescope/tracers/api-call-tracer.d.ts +15 -0
- package/build/telescope/tracers/api-call-tracer.d.ts.map +1 -0
- package/build/telescope/tracers/api-call-tracer.js +53 -0
- package/build/telescope/tracers/conversational-tracer.d.ts +15 -0
- package/build/telescope/tracers/conversational-tracer.d.ts.map +1 -0
- package/build/telescope/tracers/conversational-tracer.js +45 -0
- package/build/telescope/tracers/event-tracer.d.ts +14 -0
- package/build/telescope/tracers/event-tracer.d.ts.map +1 -0
- package/build/telescope/tracers/event-tracer.js +72 -0
- package/build/telescope/tracers/index.d.ts +7 -0
- package/build/telescope/tracers/index.d.ts.map +1 -0
- package/build/telescope/tracers/index.js +5 -0
- package/build/telescope/tracers/latency-tracer.d.ts +15 -0
- package/build/telescope/tracers/latency-tracer.d.ts.map +1 -0
- package/build/telescope/tracers/latency-tracer.js +40 -0
- package/build/telescope/tracers/step-tracer.d.ts +15 -0
- package/build/telescope/tracers/step-tracer.d.ts.map +1 -0
- package/build/telescope/tracers/step-tracer.js +50 -0
- package/build/text-agent-handlers/event.d.ts +11 -0
- package/build/text-agent-handlers/event.d.ts.map +1 -0
- package/build/text-agent-handlers/event.js +1 -0
- package/build/text-agent-handlers/incoming-message.d.ts +17 -0
- package/build/text-agent-handlers/incoming-message.d.ts.map +1 -0
- package/build/text-agent-handlers/incoming-message.js +131 -0
- package/build/text-agent-handlers/index.d.ts +15 -0
- package/build/text-agent-handlers/index.d.ts.map +1 -0
- package/build/text-agent-handlers/index.js +6 -0
- package/build/text-agent-handlers/instrument.d.ts +12 -0
- package/build/text-agent-handlers/instrument.d.ts.map +1 -0
- package/build/text-agent-handlers/instrument.js +27 -0
- package/build/text-agent-handlers/jobs-handler.d.ts +10 -0
- package/build/text-agent-handlers/jobs-handler.d.ts.map +1 -0
- package/build/text-agent-handlers/jobs-handler.js +27 -0
- package/build/text-agent-handlers/jobs.d.ts +19 -0
- package/build/text-agent-handlers/jobs.d.ts.map +1 -0
- package/build/text-agent-handlers/jobs.js +1 -0
- package/build/text-agent-handlers/message-acceptor.d.ts +13 -0
- package/build/text-agent-handlers/message-acceptor.d.ts.map +1 -0
- package/build/text-agent-handlers/message-acceptor.js +32 -0
- package/build/text-agent-handlers/notification-hook.d.ts +14 -0
- package/build/text-agent-handlers/notification-hook.d.ts.map +1 -0
- package/build/text-agent-handlers/notification-hook.js +51 -0
- package/build/text-agent-handlers/ports.d.ts +36 -0
- package/build/text-agent-handlers/ports.d.ts.map +1 -0
- package/build/text-agent-handlers/ports.js +3 -0
- package/build/{timeouts-manager.d.ts → timeout-manager/index.d.ts} +3 -3
- package/build/timeout-manager/index.d.ts.map +1 -0
- package/build/{timeouts-manager.js → timeout-manager/index.js} +1 -5
- package/build/token-storage/index.d.ts +4 -0
- package/build/token-storage/index.d.ts.map +1 -0
- package/build/token-storage/index.js +1 -0
- package/build/voice-agent-api/http-helpers.d.ts +13 -0
- package/build/voice-agent-api/http-helpers.d.ts.map +1 -0
- package/build/voice-agent-api/http-helpers.js +39 -0
- package/build/voice-agent-api/index.d.ts +6 -0
- package/build/voice-agent-api/index.d.ts.map +1 -0
- package/build/voice-agent-api/index.js +3 -0
- package/build/voice-agent-api/llm-completion-handler.d.ts +5 -0
- package/build/voice-agent-api/llm-completion-handler.d.ts.map +1 -0
- package/build/voice-agent-api/llm-completion-handler.js +75 -0
- package/build/voice-agent-api/logger.d.ts +3 -0
- package/build/voice-agent-api/logger.d.ts.map +1 -0
- package/build/voice-agent-api/logger.js +3 -0
- package/build/voice-agent-api/voice-http.d.ts +33 -0
- package/build/voice-agent-api/voice-http.d.ts.map +1 -0
- package/build/voice-agent-api/voice-http.js +370 -0
- package/package.json +49 -11
- package/build/analytics.d.ts +0 -40
- package/build/analytics.d.ts.map +0 -1
- package/build/analytics.js +0 -114
- package/build/context-cache.d.ts.map +0 -1
- package/build/interfaces/platform.d.ts +0 -60
- package/build/interfaces/platform.d.ts.map +0 -1
- package/build/interfaces/platform.js +0 -21
- package/build/interfaces/rc-voice.d.ts +0 -53
- package/build/interfaces/rc-voice.d.ts.map +0 -1
- package/build/interfaces/rc-voice.js +0 -2
- package/build/postgres-analytics-query.d.ts +0 -87
- package/build/postgres-analytics-query.d.ts.map +0 -1
- package/build/postgres-analytics-query.js +0 -392
- package/build/postgres-analytics.d.ts +0 -45
- package/build/postgres-analytics.d.ts.map +0 -1
- package/build/postgres-analytics.js +0 -274
- package/build/timeouts-manager.d.ts.map +0 -1
|
@@ -0,0 +1,4506 @@
|
|
|
1
|
+
var _a$1;
|
|
2
|
+
function $constructor(name, initializer2, params) {
|
|
3
|
+
function init(inst, def) {
|
|
4
|
+
if (!inst._zod) {
|
|
5
|
+
Object.defineProperty(inst, "_zod", {
|
|
6
|
+
value: {
|
|
7
|
+
def,
|
|
8
|
+
constr: _,
|
|
9
|
+
traits: /* @__PURE__ */ new Set()
|
|
10
|
+
},
|
|
11
|
+
enumerable: false
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
if (inst._zod.traits.has(name)) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
inst._zod.traits.add(name);
|
|
18
|
+
initializer2(inst, def);
|
|
19
|
+
const proto = _.prototype;
|
|
20
|
+
const keys = Object.keys(proto);
|
|
21
|
+
for (let i = 0; i < keys.length; i++) {
|
|
22
|
+
const k = keys[i];
|
|
23
|
+
if (!(k in inst)) {
|
|
24
|
+
inst[k] = proto[k].bind(inst);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
const Parent = params?.Parent ?? Object;
|
|
29
|
+
class Definition extends Parent {
|
|
30
|
+
}
|
|
31
|
+
Object.defineProperty(Definition, "name", { value: name });
|
|
32
|
+
function _(def) {
|
|
33
|
+
var _a2;
|
|
34
|
+
const inst = params?.Parent ? new Definition() : this;
|
|
35
|
+
init(inst, def);
|
|
36
|
+
(_a2 = inst._zod).deferred ?? (_a2.deferred = []);
|
|
37
|
+
for (const fn of inst._zod.deferred) {
|
|
38
|
+
fn();
|
|
39
|
+
}
|
|
40
|
+
return inst;
|
|
41
|
+
}
|
|
42
|
+
Object.defineProperty(_, "init", { value: init });
|
|
43
|
+
Object.defineProperty(_, Symbol.hasInstance, {
|
|
44
|
+
value: (inst) => {
|
|
45
|
+
if (params?.Parent && inst instanceof params.Parent)
|
|
46
|
+
return true;
|
|
47
|
+
return inst?._zod?.traits?.has(name);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
Object.defineProperty(_, "name", { value: name });
|
|
51
|
+
return _;
|
|
52
|
+
}
|
|
53
|
+
class $ZodAsyncError extends Error {
|
|
54
|
+
constructor() {
|
|
55
|
+
super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
class $ZodEncodeError extends Error {
|
|
59
|
+
constructor(name) {
|
|
60
|
+
super(`Encountered unidirectional transform during encode: ${name}`);
|
|
61
|
+
this.name = "ZodEncodeError";
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
(_a$1 = globalThis).__zod_globalConfig ?? (_a$1.__zod_globalConfig = {});
|
|
65
|
+
const globalConfig = globalThis.__zod_globalConfig;
|
|
66
|
+
function config(newConfig) {
|
|
67
|
+
return globalConfig;
|
|
68
|
+
}
|
|
69
|
+
function getEnumValues(entries) {
|
|
70
|
+
const numericValues = Object.values(entries).filter((v) => typeof v === "number");
|
|
71
|
+
const values = Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
|
|
72
|
+
return values;
|
|
73
|
+
}
|
|
74
|
+
function jsonStringifyReplacer(_, value) {
|
|
75
|
+
if (typeof value === "bigint")
|
|
76
|
+
return value.toString();
|
|
77
|
+
return value;
|
|
78
|
+
}
|
|
79
|
+
function cached(getter) {
|
|
80
|
+
return {
|
|
81
|
+
get value() {
|
|
82
|
+
{
|
|
83
|
+
const value = getter();
|
|
84
|
+
Object.defineProperty(this, "value", { value });
|
|
85
|
+
return value;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function nullish(input) {
|
|
91
|
+
return input === null || input === void 0;
|
|
92
|
+
}
|
|
93
|
+
function cleanRegex(source) {
|
|
94
|
+
const start = source.startsWith("^") ? 1 : 0;
|
|
95
|
+
const end = source.endsWith("$") ? source.length - 1 : source.length;
|
|
96
|
+
return source.slice(start, end);
|
|
97
|
+
}
|
|
98
|
+
function floatSafeRemainder(val, step) {
|
|
99
|
+
const ratio = val / step;
|
|
100
|
+
const roundedRatio = Math.round(ratio);
|
|
101
|
+
const tolerance = Number.EPSILON * Math.max(Math.abs(ratio), 1);
|
|
102
|
+
if (Math.abs(ratio - roundedRatio) < tolerance)
|
|
103
|
+
return 0;
|
|
104
|
+
return ratio - roundedRatio;
|
|
105
|
+
}
|
|
106
|
+
const EVALUATING = /* @__PURE__ */ Symbol("evaluating");
|
|
107
|
+
function defineLazy(object2, key, getter) {
|
|
108
|
+
let value = void 0;
|
|
109
|
+
Object.defineProperty(object2, key, {
|
|
110
|
+
get() {
|
|
111
|
+
if (value === EVALUATING) {
|
|
112
|
+
return void 0;
|
|
113
|
+
}
|
|
114
|
+
if (value === void 0) {
|
|
115
|
+
value = EVALUATING;
|
|
116
|
+
value = getter();
|
|
117
|
+
}
|
|
118
|
+
return value;
|
|
119
|
+
},
|
|
120
|
+
set(v) {
|
|
121
|
+
Object.defineProperty(object2, key, {
|
|
122
|
+
value: v
|
|
123
|
+
// configurable: true,
|
|
124
|
+
});
|
|
125
|
+
},
|
|
126
|
+
configurable: true
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
function assignProp(target, prop, value) {
|
|
130
|
+
Object.defineProperty(target, prop, {
|
|
131
|
+
value,
|
|
132
|
+
writable: true,
|
|
133
|
+
enumerable: true,
|
|
134
|
+
configurable: true
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
function mergeDefs(...defs) {
|
|
138
|
+
const mergedDescriptors = {};
|
|
139
|
+
for (const def of defs) {
|
|
140
|
+
const descriptors = Object.getOwnPropertyDescriptors(def);
|
|
141
|
+
Object.assign(mergedDescriptors, descriptors);
|
|
142
|
+
}
|
|
143
|
+
return Object.defineProperties({}, mergedDescriptors);
|
|
144
|
+
}
|
|
145
|
+
function esc(str) {
|
|
146
|
+
return JSON.stringify(str);
|
|
147
|
+
}
|
|
148
|
+
function slugify(input) {
|
|
149
|
+
return input.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
150
|
+
}
|
|
151
|
+
const captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {
|
|
152
|
+
};
|
|
153
|
+
function isObject(data) {
|
|
154
|
+
return typeof data === "object" && data !== null && !Array.isArray(data);
|
|
155
|
+
}
|
|
156
|
+
const allowsEval = /* @__PURE__ */ cached(() => {
|
|
157
|
+
if (globalConfig.jitless) {
|
|
158
|
+
return false;
|
|
159
|
+
}
|
|
160
|
+
if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) {
|
|
161
|
+
return false;
|
|
162
|
+
}
|
|
163
|
+
try {
|
|
164
|
+
const F = Function;
|
|
165
|
+
new F("");
|
|
166
|
+
return true;
|
|
167
|
+
} catch (_) {
|
|
168
|
+
return false;
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
function isPlainObject(o) {
|
|
172
|
+
if (isObject(o) === false)
|
|
173
|
+
return false;
|
|
174
|
+
const ctor = o.constructor;
|
|
175
|
+
if (ctor === void 0)
|
|
176
|
+
return true;
|
|
177
|
+
if (typeof ctor !== "function")
|
|
178
|
+
return true;
|
|
179
|
+
const prot = ctor.prototype;
|
|
180
|
+
if (isObject(prot) === false)
|
|
181
|
+
return false;
|
|
182
|
+
if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) {
|
|
183
|
+
return false;
|
|
184
|
+
}
|
|
185
|
+
return true;
|
|
186
|
+
}
|
|
187
|
+
function shallowClone(o) {
|
|
188
|
+
if (isPlainObject(o))
|
|
189
|
+
return { ...o };
|
|
190
|
+
if (Array.isArray(o))
|
|
191
|
+
return [...o];
|
|
192
|
+
if (o instanceof Map)
|
|
193
|
+
return new Map(o);
|
|
194
|
+
if (o instanceof Set)
|
|
195
|
+
return new Set(o);
|
|
196
|
+
return o;
|
|
197
|
+
}
|
|
198
|
+
const propertyKeyTypes = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
|
|
199
|
+
function escapeRegex(str) {
|
|
200
|
+
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
201
|
+
}
|
|
202
|
+
function clone(inst, def, params) {
|
|
203
|
+
const cl = new inst._zod.constr(def ?? inst._zod.def);
|
|
204
|
+
if (!def || params?.parent)
|
|
205
|
+
cl._zod.parent = inst;
|
|
206
|
+
return cl;
|
|
207
|
+
}
|
|
208
|
+
function normalizeParams(_params) {
|
|
209
|
+
const params = _params;
|
|
210
|
+
if (!params)
|
|
211
|
+
return {};
|
|
212
|
+
if (typeof params === "string")
|
|
213
|
+
return { error: () => params };
|
|
214
|
+
if (params?.message !== void 0) {
|
|
215
|
+
if (params?.error !== void 0)
|
|
216
|
+
throw new Error("Cannot specify both `message` and `error` params");
|
|
217
|
+
params.error = params.message;
|
|
218
|
+
}
|
|
219
|
+
delete params.message;
|
|
220
|
+
if (typeof params.error === "string")
|
|
221
|
+
return { ...params, error: () => params.error };
|
|
222
|
+
return params;
|
|
223
|
+
}
|
|
224
|
+
function optionalKeys(shape) {
|
|
225
|
+
return Object.keys(shape).filter((k) => {
|
|
226
|
+
return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
const NUMBER_FORMAT_RANGES = {
|
|
230
|
+
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
|
|
231
|
+
int32: [-2147483648, 2147483647],
|
|
232
|
+
uint32: [0, 4294967295],
|
|
233
|
+
float32: [-34028234663852886e22, 34028234663852886e22],
|
|
234
|
+
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
235
|
+
};
|
|
236
|
+
function pick(schema, mask) {
|
|
237
|
+
const currDef = schema._zod.def;
|
|
238
|
+
const checks = currDef.checks;
|
|
239
|
+
const hasChecks = checks && checks.length > 0;
|
|
240
|
+
if (hasChecks) {
|
|
241
|
+
throw new Error(".pick() cannot be used on object schemas containing refinements");
|
|
242
|
+
}
|
|
243
|
+
const def = mergeDefs(schema._zod.def, {
|
|
244
|
+
get shape() {
|
|
245
|
+
const newShape = {};
|
|
246
|
+
for (const key in mask) {
|
|
247
|
+
if (!(key in currDef.shape)) {
|
|
248
|
+
throw new Error(`Unrecognized key: "${key}"`);
|
|
249
|
+
}
|
|
250
|
+
if (!mask[key])
|
|
251
|
+
continue;
|
|
252
|
+
newShape[key] = currDef.shape[key];
|
|
253
|
+
}
|
|
254
|
+
assignProp(this, "shape", newShape);
|
|
255
|
+
return newShape;
|
|
256
|
+
},
|
|
257
|
+
checks: []
|
|
258
|
+
});
|
|
259
|
+
return clone(schema, def);
|
|
260
|
+
}
|
|
261
|
+
function omit(schema, mask) {
|
|
262
|
+
const currDef = schema._zod.def;
|
|
263
|
+
const checks = currDef.checks;
|
|
264
|
+
const hasChecks = checks && checks.length > 0;
|
|
265
|
+
if (hasChecks) {
|
|
266
|
+
throw new Error(".omit() cannot be used on object schemas containing refinements");
|
|
267
|
+
}
|
|
268
|
+
const def = mergeDefs(schema._zod.def, {
|
|
269
|
+
get shape() {
|
|
270
|
+
const newShape = { ...schema._zod.def.shape };
|
|
271
|
+
for (const key in mask) {
|
|
272
|
+
if (!(key in currDef.shape)) {
|
|
273
|
+
throw new Error(`Unrecognized key: "${key}"`);
|
|
274
|
+
}
|
|
275
|
+
if (!mask[key])
|
|
276
|
+
continue;
|
|
277
|
+
delete newShape[key];
|
|
278
|
+
}
|
|
279
|
+
assignProp(this, "shape", newShape);
|
|
280
|
+
return newShape;
|
|
281
|
+
},
|
|
282
|
+
checks: []
|
|
283
|
+
});
|
|
284
|
+
return clone(schema, def);
|
|
285
|
+
}
|
|
286
|
+
function extend(schema, shape) {
|
|
287
|
+
if (!isPlainObject(shape)) {
|
|
288
|
+
throw new Error("Invalid input to extend: expected a plain object");
|
|
289
|
+
}
|
|
290
|
+
const checks = schema._zod.def.checks;
|
|
291
|
+
const hasChecks = checks && checks.length > 0;
|
|
292
|
+
if (hasChecks) {
|
|
293
|
+
const existingShape = schema._zod.def.shape;
|
|
294
|
+
for (const key in shape) {
|
|
295
|
+
if (Object.getOwnPropertyDescriptor(existingShape, key) !== void 0) {
|
|
296
|
+
throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
const def = mergeDefs(schema._zod.def, {
|
|
301
|
+
get shape() {
|
|
302
|
+
const _shape = { ...schema._zod.def.shape, ...shape };
|
|
303
|
+
assignProp(this, "shape", _shape);
|
|
304
|
+
return _shape;
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
return clone(schema, def);
|
|
308
|
+
}
|
|
309
|
+
function safeExtend(schema, shape) {
|
|
310
|
+
if (!isPlainObject(shape)) {
|
|
311
|
+
throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
312
|
+
}
|
|
313
|
+
const def = mergeDefs(schema._zod.def, {
|
|
314
|
+
get shape() {
|
|
315
|
+
const _shape = { ...schema._zod.def.shape, ...shape };
|
|
316
|
+
assignProp(this, "shape", _shape);
|
|
317
|
+
return _shape;
|
|
318
|
+
}
|
|
319
|
+
});
|
|
320
|
+
return clone(schema, def);
|
|
321
|
+
}
|
|
322
|
+
function merge(a, b) {
|
|
323
|
+
if (a._zod.def.checks?.length) {
|
|
324
|
+
throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
|
|
325
|
+
}
|
|
326
|
+
const def = mergeDefs(a._zod.def, {
|
|
327
|
+
get shape() {
|
|
328
|
+
const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
|
|
329
|
+
assignProp(this, "shape", _shape);
|
|
330
|
+
return _shape;
|
|
331
|
+
},
|
|
332
|
+
get catchall() {
|
|
333
|
+
return b._zod.def.catchall;
|
|
334
|
+
},
|
|
335
|
+
checks: b._zod.def.checks ?? []
|
|
336
|
+
});
|
|
337
|
+
return clone(a, def);
|
|
338
|
+
}
|
|
339
|
+
function partial(Class, schema, mask) {
|
|
340
|
+
const currDef = schema._zod.def;
|
|
341
|
+
const checks = currDef.checks;
|
|
342
|
+
const hasChecks = checks && checks.length > 0;
|
|
343
|
+
if (hasChecks) {
|
|
344
|
+
throw new Error(".partial() cannot be used on object schemas containing refinements");
|
|
345
|
+
}
|
|
346
|
+
const def = mergeDefs(schema._zod.def, {
|
|
347
|
+
get shape() {
|
|
348
|
+
const oldShape = schema._zod.def.shape;
|
|
349
|
+
const shape = { ...oldShape };
|
|
350
|
+
if (mask) {
|
|
351
|
+
for (const key in mask) {
|
|
352
|
+
if (!(key in oldShape)) {
|
|
353
|
+
throw new Error(`Unrecognized key: "${key}"`);
|
|
354
|
+
}
|
|
355
|
+
if (!mask[key])
|
|
356
|
+
continue;
|
|
357
|
+
shape[key] = Class ? new Class({
|
|
358
|
+
type: "optional",
|
|
359
|
+
innerType: oldShape[key]
|
|
360
|
+
}) : oldShape[key];
|
|
361
|
+
}
|
|
362
|
+
} else {
|
|
363
|
+
for (const key in oldShape) {
|
|
364
|
+
shape[key] = Class ? new Class({
|
|
365
|
+
type: "optional",
|
|
366
|
+
innerType: oldShape[key]
|
|
367
|
+
}) : oldShape[key];
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
assignProp(this, "shape", shape);
|
|
371
|
+
return shape;
|
|
372
|
+
},
|
|
373
|
+
checks: []
|
|
374
|
+
});
|
|
375
|
+
return clone(schema, def);
|
|
376
|
+
}
|
|
377
|
+
function required(Class, schema, mask) {
|
|
378
|
+
const def = mergeDefs(schema._zod.def, {
|
|
379
|
+
get shape() {
|
|
380
|
+
const oldShape = schema._zod.def.shape;
|
|
381
|
+
const shape = { ...oldShape };
|
|
382
|
+
if (mask) {
|
|
383
|
+
for (const key in mask) {
|
|
384
|
+
if (!(key in shape)) {
|
|
385
|
+
throw new Error(`Unrecognized key: "${key}"`);
|
|
386
|
+
}
|
|
387
|
+
if (!mask[key])
|
|
388
|
+
continue;
|
|
389
|
+
shape[key] = new Class({
|
|
390
|
+
type: "nonoptional",
|
|
391
|
+
innerType: oldShape[key]
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
} else {
|
|
395
|
+
for (const key in oldShape) {
|
|
396
|
+
shape[key] = new Class({
|
|
397
|
+
type: "nonoptional",
|
|
398
|
+
innerType: oldShape[key]
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
assignProp(this, "shape", shape);
|
|
403
|
+
return shape;
|
|
404
|
+
}
|
|
405
|
+
});
|
|
406
|
+
return clone(schema, def);
|
|
407
|
+
}
|
|
408
|
+
function aborted(x, startIndex = 0) {
|
|
409
|
+
if (x.aborted === true)
|
|
410
|
+
return true;
|
|
411
|
+
for (let i = startIndex; i < x.issues.length; i++) {
|
|
412
|
+
if (x.issues[i]?.continue !== true) {
|
|
413
|
+
return true;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
return false;
|
|
417
|
+
}
|
|
418
|
+
function explicitlyAborted(x, startIndex = 0) {
|
|
419
|
+
if (x.aborted === true)
|
|
420
|
+
return true;
|
|
421
|
+
for (let i = startIndex; i < x.issues.length; i++) {
|
|
422
|
+
if (x.issues[i]?.continue === false) {
|
|
423
|
+
return true;
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
return false;
|
|
427
|
+
}
|
|
428
|
+
function prefixIssues(path, issues) {
|
|
429
|
+
return issues.map((iss) => {
|
|
430
|
+
var _a2;
|
|
431
|
+
(_a2 = iss).path ?? (_a2.path = []);
|
|
432
|
+
iss.path.unshift(path);
|
|
433
|
+
return iss;
|
|
434
|
+
});
|
|
435
|
+
}
|
|
436
|
+
function unwrapMessage(message) {
|
|
437
|
+
return typeof message === "string" ? message : message?.message;
|
|
438
|
+
}
|
|
439
|
+
function finalizeIssue(iss, ctx, config2) {
|
|
440
|
+
const message = iss.message ? iss.message : unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config2.customError?.(iss)) ?? unwrapMessage(config2.localeError?.(iss)) ?? "Invalid input";
|
|
441
|
+
const { inst: _inst, continue: _continue, input: _input, ...rest } = iss;
|
|
442
|
+
rest.path ?? (rest.path = []);
|
|
443
|
+
rest.message = message;
|
|
444
|
+
if (ctx?.reportInput) {
|
|
445
|
+
rest.input = _input;
|
|
446
|
+
}
|
|
447
|
+
return rest;
|
|
448
|
+
}
|
|
449
|
+
function getLengthableOrigin(input) {
|
|
450
|
+
if (Array.isArray(input))
|
|
451
|
+
return "array";
|
|
452
|
+
if (typeof input === "string")
|
|
453
|
+
return "string";
|
|
454
|
+
return "unknown";
|
|
455
|
+
}
|
|
456
|
+
function issue(...args) {
|
|
457
|
+
const [iss, input, inst] = args;
|
|
458
|
+
if (typeof iss === "string") {
|
|
459
|
+
return {
|
|
460
|
+
message: iss,
|
|
461
|
+
code: "custom",
|
|
462
|
+
input,
|
|
463
|
+
inst
|
|
464
|
+
};
|
|
465
|
+
}
|
|
466
|
+
return { ...iss };
|
|
467
|
+
}
|
|
468
|
+
const initializer$1 = (inst, def) => {
|
|
469
|
+
inst.name = "$ZodError";
|
|
470
|
+
Object.defineProperty(inst, "_zod", {
|
|
471
|
+
value: inst._zod,
|
|
472
|
+
enumerable: false
|
|
473
|
+
});
|
|
474
|
+
Object.defineProperty(inst, "issues", {
|
|
475
|
+
value: def,
|
|
476
|
+
enumerable: false
|
|
477
|
+
});
|
|
478
|
+
inst.message = JSON.stringify(def, jsonStringifyReplacer, 2);
|
|
479
|
+
Object.defineProperty(inst, "toString", {
|
|
480
|
+
value: () => inst.message,
|
|
481
|
+
enumerable: false
|
|
482
|
+
});
|
|
483
|
+
};
|
|
484
|
+
const $ZodError = $constructor("$ZodError", initializer$1);
|
|
485
|
+
const $ZodRealError = $constructor("$ZodError", initializer$1, { Parent: Error });
|
|
486
|
+
function flattenError(error, mapper = (issue2) => issue2.message) {
|
|
487
|
+
const fieldErrors = {};
|
|
488
|
+
const formErrors = [];
|
|
489
|
+
for (const sub of error.issues) {
|
|
490
|
+
if (sub.path.length > 0) {
|
|
491
|
+
fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
|
|
492
|
+
fieldErrors[sub.path[0]].push(mapper(sub));
|
|
493
|
+
} else {
|
|
494
|
+
formErrors.push(mapper(sub));
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
return { formErrors, fieldErrors };
|
|
498
|
+
}
|
|
499
|
+
function formatError(error, mapper = (issue2) => issue2.message) {
|
|
500
|
+
const fieldErrors = { _errors: [] };
|
|
501
|
+
const processError = (error2, path = []) => {
|
|
502
|
+
for (const issue2 of error2.issues) {
|
|
503
|
+
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
504
|
+
issue2.errors.map((issues) => processError({ issues }, [...path, ...issue2.path]));
|
|
505
|
+
} else if (issue2.code === "invalid_key") {
|
|
506
|
+
processError({ issues: issue2.issues }, [...path, ...issue2.path]);
|
|
507
|
+
} else if (issue2.code === "invalid_element") {
|
|
508
|
+
processError({ issues: issue2.issues }, [...path, ...issue2.path]);
|
|
509
|
+
} else {
|
|
510
|
+
const fullpath = [...path, ...issue2.path];
|
|
511
|
+
if (fullpath.length === 0) {
|
|
512
|
+
fieldErrors._errors.push(mapper(issue2));
|
|
513
|
+
} else {
|
|
514
|
+
let curr = fieldErrors;
|
|
515
|
+
let i = 0;
|
|
516
|
+
while (i < fullpath.length) {
|
|
517
|
+
const el = fullpath[i];
|
|
518
|
+
const terminal = i === fullpath.length - 1;
|
|
519
|
+
if (!terminal) {
|
|
520
|
+
curr[el] = curr[el] || { _errors: [] };
|
|
521
|
+
} else {
|
|
522
|
+
curr[el] = curr[el] || { _errors: [] };
|
|
523
|
+
curr[el]._errors.push(mapper(issue2));
|
|
524
|
+
}
|
|
525
|
+
curr = curr[el];
|
|
526
|
+
i++;
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
};
|
|
532
|
+
processError(error);
|
|
533
|
+
return fieldErrors;
|
|
534
|
+
}
|
|
535
|
+
const _parse = (_Err) => (schema, value, _ctx, _params) => {
|
|
536
|
+
const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
|
|
537
|
+
const result = schema._zod.run({ value, issues: [] }, ctx);
|
|
538
|
+
if (result instanceof Promise) {
|
|
539
|
+
throw new $ZodAsyncError();
|
|
540
|
+
}
|
|
541
|
+
if (result.issues.length) {
|
|
542
|
+
const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
543
|
+
captureStackTrace(e, _params?.callee);
|
|
544
|
+
throw e;
|
|
545
|
+
}
|
|
546
|
+
return result.value;
|
|
547
|
+
};
|
|
548
|
+
const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
|
|
549
|
+
const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
|
|
550
|
+
let result = schema._zod.run({ value, issues: [] }, ctx);
|
|
551
|
+
if (result instanceof Promise)
|
|
552
|
+
result = await result;
|
|
553
|
+
if (result.issues.length) {
|
|
554
|
+
const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
555
|
+
captureStackTrace(e, params?.callee);
|
|
556
|
+
throw e;
|
|
557
|
+
}
|
|
558
|
+
return result.value;
|
|
559
|
+
};
|
|
560
|
+
const _safeParse = (_Err) => (schema, value, _ctx) => {
|
|
561
|
+
const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
|
|
562
|
+
const result = schema._zod.run({ value, issues: [] }, ctx);
|
|
563
|
+
if (result instanceof Promise) {
|
|
564
|
+
throw new $ZodAsyncError();
|
|
565
|
+
}
|
|
566
|
+
return result.issues.length ? {
|
|
567
|
+
success: false,
|
|
568
|
+
error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
569
|
+
} : { success: true, data: result.value };
|
|
570
|
+
};
|
|
571
|
+
const safeParse$1 = /* @__PURE__ */ _safeParse($ZodRealError);
|
|
572
|
+
const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
|
|
573
|
+
const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
|
|
574
|
+
let result = schema._zod.run({ value, issues: [] }, ctx);
|
|
575
|
+
if (result instanceof Promise)
|
|
576
|
+
result = await result;
|
|
577
|
+
return result.issues.length ? {
|
|
578
|
+
success: false,
|
|
579
|
+
error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
580
|
+
} : { success: true, data: result.value };
|
|
581
|
+
};
|
|
582
|
+
const safeParseAsync$1 = /* @__PURE__ */ _safeParseAsync($ZodRealError);
|
|
583
|
+
const _encode = (_Err) => (schema, value, _ctx) => {
|
|
584
|
+
const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
|
|
585
|
+
return _parse(_Err)(schema, value, ctx);
|
|
586
|
+
};
|
|
587
|
+
const _decode = (_Err) => (schema, value, _ctx) => {
|
|
588
|
+
return _parse(_Err)(schema, value, _ctx);
|
|
589
|
+
};
|
|
590
|
+
const _encodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
591
|
+
const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
|
|
592
|
+
return _parseAsync(_Err)(schema, value, ctx);
|
|
593
|
+
};
|
|
594
|
+
const _decodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
595
|
+
return _parseAsync(_Err)(schema, value, _ctx);
|
|
596
|
+
};
|
|
597
|
+
const _safeEncode = (_Err) => (schema, value, _ctx) => {
|
|
598
|
+
const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
|
|
599
|
+
return _safeParse(_Err)(schema, value, ctx);
|
|
600
|
+
};
|
|
601
|
+
const _safeDecode = (_Err) => (schema, value, _ctx) => {
|
|
602
|
+
return _safeParse(_Err)(schema, value, _ctx);
|
|
603
|
+
};
|
|
604
|
+
const _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
605
|
+
const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
|
|
606
|
+
return _safeParseAsync(_Err)(schema, value, ctx);
|
|
607
|
+
};
|
|
608
|
+
const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
609
|
+
return _safeParseAsync(_Err)(schema, value, _ctx);
|
|
610
|
+
};
|
|
611
|
+
const cuid = /^[cC][0-9a-z]{6,}$/;
|
|
612
|
+
const cuid2 = /^[0-9a-z]+$/;
|
|
613
|
+
const ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
|
|
614
|
+
const xid = /^[0-9a-vA-V]{20}$/;
|
|
615
|
+
const ksuid = /^[A-Za-z0-9]{27}$/;
|
|
616
|
+
const nanoid = /^[a-zA-Z0-9_-]{21}$/;
|
|
617
|
+
const duration$1 = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;
|
|
618
|
+
const guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;
|
|
619
|
+
const uuid = (version2) => {
|
|
620
|
+
if (!version2)
|
|
621
|
+
return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;
|
|
622
|
+
return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version2}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);
|
|
623
|
+
};
|
|
624
|
+
const email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
|
|
625
|
+
const _emoji$1 = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
|
|
626
|
+
function emoji() {
|
|
627
|
+
return new RegExp(_emoji$1, "u");
|
|
628
|
+
}
|
|
629
|
+
const 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])$/;
|
|
630
|
+
const ipv6 = /^(([0-9a-fA-F]{1,4}:){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}|:))$/;
|
|
631
|
+
const cidrv4 = /^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/;
|
|
632
|
+
const cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
|
|
633
|
+
const base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
|
|
634
|
+
const base64url = /^[A-Za-z0-9_-]*$/;
|
|
635
|
+
const httpProtocol = /^https?$/;
|
|
636
|
+
const e164 = /^\+[1-9]\d{6,14}$/;
|
|
637
|
+
const dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;
|
|
638
|
+
const date$1 = /* @__PURE__ */ new RegExp(`^${dateSource}$`);
|
|
639
|
+
function timeSource(args) {
|
|
640
|
+
const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
|
|
641
|
+
const regex = typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
642
|
+
return regex;
|
|
643
|
+
}
|
|
644
|
+
function time$1(args) {
|
|
645
|
+
return new RegExp(`^${timeSource(args)}$`);
|
|
646
|
+
}
|
|
647
|
+
function datetime$1(args) {
|
|
648
|
+
const time2 = timeSource({ precision: args.precision });
|
|
649
|
+
const opts = ["Z"];
|
|
650
|
+
if (args.local)
|
|
651
|
+
opts.push("");
|
|
652
|
+
if (args.offset)
|
|
653
|
+
opts.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);
|
|
654
|
+
const timeRegex = `${time2}(?:${opts.join("|")})`;
|
|
655
|
+
return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
|
|
656
|
+
}
|
|
657
|
+
const string$1 = (params) => {
|
|
658
|
+
const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
|
|
659
|
+
return new RegExp(`^${regex}$`);
|
|
660
|
+
};
|
|
661
|
+
const integer = /^-?\d+$/;
|
|
662
|
+
const number$1 = /^-?\d+(?:\.\d+)?$/;
|
|
663
|
+
const boolean$1 = /^(?:true|false)$/i;
|
|
664
|
+
const lowercase = /^[^A-Z]*$/;
|
|
665
|
+
const uppercase = /^[^a-z]*$/;
|
|
666
|
+
const $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
|
|
667
|
+
var _a2;
|
|
668
|
+
inst._zod ?? (inst._zod = {});
|
|
669
|
+
inst._zod.def = def;
|
|
670
|
+
(_a2 = inst._zod).onattach ?? (_a2.onattach = []);
|
|
671
|
+
});
|
|
672
|
+
const numericOriginMap = {
|
|
673
|
+
number: "number",
|
|
674
|
+
bigint: "bigint",
|
|
675
|
+
object: "date"
|
|
676
|
+
};
|
|
677
|
+
const $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst, def) => {
|
|
678
|
+
$ZodCheck.init(inst, def);
|
|
679
|
+
const origin = numericOriginMap[typeof def.value];
|
|
680
|
+
inst._zod.onattach.push((inst2) => {
|
|
681
|
+
const bag = inst2._zod.bag;
|
|
682
|
+
const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
|
|
683
|
+
if (def.value < curr) {
|
|
684
|
+
if (def.inclusive)
|
|
685
|
+
bag.maximum = def.value;
|
|
686
|
+
else
|
|
687
|
+
bag.exclusiveMaximum = def.value;
|
|
688
|
+
}
|
|
689
|
+
});
|
|
690
|
+
inst._zod.check = (payload) => {
|
|
691
|
+
if (def.inclusive ? payload.value <= def.value : payload.value < def.value) {
|
|
692
|
+
return;
|
|
693
|
+
}
|
|
694
|
+
payload.issues.push({
|
|
695
|
+
origin,
|
|
696
|
+
code: "too_big",
|
|
697
|
+
maximum: typeof def.value === "object" ? def.value.getTime() : def.value,
|
|
698
|
+
input: payload.value,
|
|
699
|
+
inclusive: def.inclusive,
|
|
700
|
+
inst,
|
|
701
|
+
continue: !def.abort
|
|
702
|
+
});
|
|
703
|
+
};
|
|
704
|
+
});
|
|
705
|
+
const $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan", (inst, def) => {
|
|
706
|
+
$ZodCheck.init(inst, def);
|
|
707
|
+
const origin = numericOriginMap[typeof def.value];
|
|
708
|
+
inst._zod.onattach.push((inst2) => {
|
|
709
|
+
const bag = inst2._zod.bag;
|
|
710
|
+
const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
|
|
711
|
+
if (def.value > curr) {
|
|
712
|
+
if (def.inclusive)
|
|
713
|
+
bag.minimum = def.value;
|
|
714
|
+
else
|
|
715
|
+
bag.exclusiveMinimum = def.value;
|
|
716
|
+
}
|
|
717
|
+
});
|
|
718
|
+
inst._zod.check = (payload) => {
|
|
719
|
+
if (def.inclusive ? payload.value >= def.value : payload.value > def.value) {
|
|
720
|
+
return;
|
|
721
|
+
}
|
|
722
|
+
payload.issues.push({
|
|
723
|
+
origin,
|
|
724
|
+
code: "too_small",
|
|
725
|
+
minimum: typeof def.value === "object" ? def.value.getTime() : def.value,
|
|
726
|
+
input: payload.value,
|
|
727
|
+
inclusive: def.inclusive,
|
|
728
|
+
inst,
|
|
729
|
+
continue: !def.abort
|
|
730
|
+
});
|
|
731
|
+
};
|
|
732
|
+
});
|
|
733
|
+
const $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => {
|
|
734
|
+
$ZodCheck.init(inst, def);
|
|
735
|
+
inst._zod.onattach.push((inst2) => {
|
|
736
|
+
var _a2;
|
|
737
|
+
(_a2 = inst2._zod.bag).multipleOf ?? (_a2.multipleOf = def.value);
|
|
738
|
+
});
|
|
739
|
+
inst._zod.check = (payload) => {
|
|
740
|
+
if (typeof payload.value !== typeof def.value)
|
|
741
|
+
throw new Error("Cannot mix number and bigint in multiple_of check.");
|
|
742
|
+
const isMultiple = typeof payload.value === "bigint" ? payload.value % def.value === BigInt(0) : floatSafeRemainder(payload.value, def.value) === 0;
|
|
743
|
+
if (isMultiple)
|
|
744
|
+
return;
|
|
745
|
+
payload.issues.push({
|
|
746
|
+
origin: typeof payload.value,
|
|
747
|
+
code: "not_multiple_of",
|
|
748
|
+
divisor: def.value,
|
|
749
|
+
input: payload.value,
|
|
750
|
+
inst,
|
|
751
|
+
continue: !def.abort
|
|
752
|
+
});
|
|
753
|
+
};
|
|
754
|
+
});
|
|
755
|
+
const $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat", (inst, def) => {
|
|
756
|
+
$ZodCheck.init(inst, def);
|
|
757
|
+
def.format = def.format || "float64";
|
|
758
|
+
const isInt = def.format?.includes("int");
|
|
759
|
+
const origin = isInt ? "int" : "number";
|
|
760
|
+
const [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format];
|
|
761
|
+
inst._zod.onattach.push((inst2) => {
|
|
762
|
+
const bag = inst2._zod.bag;
|
|
763
|
+
bag.format = def.format;
|
|
764
|
+
bag.minimum = minimum;
|
|
765
|
+
bag.maximum = maximum;
|
|
766
|
+
if (isInt)
|
|
767
|
+
bag.pattern = integer;
|
|
768
|
+
});
|
|
769
|
+
inst._zod.check = (payload) => {
|
|
770
|
+
const input = payload.value;
|
|
771
|
+
if (isInt) {
|
|
772
|
+
if (!Number.isInteger(input)) {
|
|
773
|
+
payload.issues.push({
|
|
774
|
+
expected: origin,
|
|
775
|
+
format: def.format,
|
|
776
|
+
code: "invalid_type",
|
|
777
|
+
continue: false,
|
|
778
|
+
input,
|
|
779
|
+
inst
|
|
780
|
+
});
|
|
781
|
+
return;
|
|
782
|
+
}
|
|
783
|
+
if (!Number.isSafeInteger(input)) {
|
|
784
|
+
if (input > 0) {
|
|
785
|
+
payload.issues.push({
|
|
786
|
+
input,
|
|
787
|
+
code: "too_big",
|
|
788
|
+
maximum: Number.MAX_SAFE_INTEGER,
|
|
789
|
+
note: "Integers must be within the safe integer range.",
|
|
790
|
+
inst,
|
|
791
|
+
origin,
|
|
792
|
+
inclusive: true,
|
|
793
|
+
continue: !def.abort
|
|
794
|
+
});
|
|
795
|
+
} else {
|
|
796
|
+
payload.issues.push({
|
|
797
|
+
input,
|
|
798
|
+
code: "too_small",
|
|
799
|
+
minimum: Number.MIN_SAFE_INTEGER,
|
|
800
|
+
note: "Integers must be within the safe integer range.",
|
|
801
|
+
inst,
|
|
802
|
+
origin,
|
|
803
|
+
inclusive: true,
|
|
804
|
+
continue: !def.abort
|
|
805
|
+
});
|
|
806
|
+
}
|
|
807
|
+
return;
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
if (input < minimum) {
|
|
811
|
+
payload.issues.push({
|
|
812
|
+
origin: "number",
|
|
813
|
+
input,
|
|
814
|
+
code: "too_small",
|
|
815
|
+
minimum,
|
|
816
|
+
inclusive: true,
|
|
817
|
+
inst,
|
|
818
|
+
continue: !def.abort
|
|
819
|
+
});
|
|
820
|
+
}
|
|
821
|
+
if (input > maximum) {
|
|
822
|
+
payload.issues.push({
|
|
823
|
+
origin: "number",
|
|
824
|
+
input,
|
|
825
|
+
code: "too_big",
|
|
826
|
+
maximum,
|
|
827
|
+
inclusive: true,
|
|
828
|
+
inst,
|
|
829
|
+
continue: !def.abort
|
|
830
|
+
});
|
|
831
|
+
}
|
|
832
|
+
};
|
|
833
|
+
});
|
|
834
|
+
const $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => {
|
|
835
|
+
var _a2;
|
|
836
|
+
$ZodCheck.init(inst, def);
|
|
837
|
+
(_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
|
|
838
|
+
const val = payload.value;
|
|
839
|
+
return !nullish(val) && val.length !== void 0;
|
|
840
|
+
});
|
|
841
|
+
inst._zod.onattach.push((inst2) => {
|
|
842
|
+
const curr = inst2._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
843
|
+
if (def.maximum < curr)
|
|
844
|
+
inst2._zod.bag.maximum = def.maximum;
|
|
845
|
+
});
|
|
846
|
+
inst._zod.check = (payload) => {
|
|
847
|
+
const input = payload.value;
|
|
848
|
+
const length = input.length;
|
|
849
|
+
if (length <= def.maximum)
|
|
850
|
+
return;
|
|
851
|
+
const origin = getLengthableOrigin(input);
|
|
852
|
+
payload.issues.push({
|
|
853
|
+
origin,
|
|
854
|
+
code: "too_big",
|
|
855
|
+
maximum: def.maximum,
|
|
856
|
+
inclusive: true,
|
|
857
|
+
input,
|
|
858
|
+
inst,
|
|
859
|
+
continue: !def.abort
|
|
860
|
+
});
|
|
861
|
+
};
|
|
862
|
+
});
|
|
863
|
+
const $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => {
|
|
864
|
+
var _a2;
|
|
865
|
+
$ZodCheck.init(inst, def);
|
|
866
|
+
(_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
|
|
867
|
+
const val = payload.value;
|
|
868
|
+
return !nullish(val) && val.length !== void 0;
|
|
869
|
+
});
|
|
870
|
+
inst._zod.onattach.push((inst2) => {
|
|
871
|
+
const curr = inst2._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
872
|
+
if (def.minimum > curr)
|
|
873
|
+
inst2._zod.bag.minimum = def.minimum;
|
|
874
|
+
});
|
|
875
|
+
inst._zod.check = (payload) => {
|
|
876
|
+
const input = payload.value;
|
|
877
|
+
const length = input.length;
|
|
878
|
+
if (length >= def.minimum)
|
|
879
|
+
return;
|
|
880
|
+
const origin = getLengthableOrigin(input);
|
|
881
|
+
payload.issues.push({
|
|
882
|
+
origin,
|
|
883
|
+
code: "too_small",
|
|
884
|
+
minimum: def.minimum,
|
|
885
|
+
inclusive: true,
|
|
886
|
+
input,
|
|
887
|
+
inst,
|
|
888
|
+
continue: !def.abort
|
|
889
|
+
});
|
|
890
|
+
};
|
|
891
|
+
});
|
|
892
|
+
const $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => {
|
|
893
|
+
var _a2;
|
|
894
|
+
$ZodCheck.init(inst, def);
|
|
895
|
+
(_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
|
|
896
|
+
const val = payload.value;
|
|
897
|
+
return !nullish(val) && val.length !== void 0;
|
|
898
|
+
});
|
|
899
|
+
inst._zod.onattach.push((inst2) => {
|
|
900
|
+
const bag = inst2._zod.bag;
|
|
901
|
+
bag.minimum = def.length;
|
|
902
|
+
bag.maximum = def.length;
|
|
903
|
+
bag.length = def.length;
|
|
904
|
+
});
|
|
905
|
+
inst._zod.check = (payload) => {
|
|
906
|
+
const input = payload.value;
|
|
907
|
+
const length = input.length;
|
|
908
|
+
if (length === def.length)
|
|
909
|
+
return;
|
|
910
|
+
const origin = getLengthableOrigin(input);
|
|
911
|
+
const tooBig = length > def.length;
|
|
912
|
+
payload.issues.push({
|
|
913
|
+
origin,
|
|
914
|
+
...tooBig ? { code: "too_big", maximum: def.length } : { code: "too_small", minimum: def.length },
|
|
915
|
+
inclusive: true,
|
|
916
|
+
exact: true,
|
|
917
|
+
input: payload.value,
|
|
918
|
+
inst,
|
|
919
|
+
continue: !def.abort
|
|
920
|
+
});
|
|
921
|
+
};
|
|
922
|
+
});
|
|
923
|
+
const $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
|
|
924
|
+
var _a2, _b;
|
|
925
|
+
$ZodCheck.init(inst, def);
|
|
926
|
+
inst._zod.onattach.push((inst2) => {
|
|
927
|
+
const bag = inst2._zod.bag;
|
|
928
|
+
bag.format = def.format;
|
|
929
|
+
if (def.pattern) {
|
|
930
|
+
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
931
|
+
bag.patterns.add(def.pattern);
|
|
932
|
+
}
|
|
933
|
+
});
|
|
934
|
+
if (def.pattern)
|
|
935
|
+
(_a2 = inst._zod).check ?? (_a2.check = (payload) => {
|
|
936
|
+
def.pattern.lastIndex = 0;
|
|
937
|
+
if (def.pattern.test(payload.value))
|
|
938
|
+
return;
|
|
939
|
+
payload.issues.push({
|
|
940
|
+
origin: "string",
|
|
941
|
+
code: "invalid_format",
|
|
942
|
+
format: def.format,
|
|
943
|
+
input: payload.value,
|
|
944
|
+
...def.pattern ? { pattern: def.pattern.toString() } : {},
|
|
945
|
+
inst,
|
|
946
|
+
continue: !def.abort
|
|
947
|
+
});
|
|
948
|
+
});
|
|
949
|
+
else
|
|
950
|
+
(_b = inst._zod).check ?? (_b.check = () => {
|
|
951
|
+
});
|
|
952
|
+
});
|
|
953
|
+
const $ZodCheckRegex = /* @__PURE__ */ $constructor("$ZodCheckRegex", (inst, def) => {
|
|
954
|
+
$ZodCheckStringFormat.init(inst, def);
|
|
955
|
+
inst._zod.check = (payload) => {
|
|
956
|
+
def.pattern.lastIndex = 0;
|
|
957
|
+
if (def.pattern.test(payload.value))
|
|
958
|
+
return;
|
|
959
|
+
payload.issues.push({
|
|
960
|
+
origin: "string",
|
|
961
|
+
code: "invalid_format",
|
|
962
|
+
format: "regex",
|
|
963
|
+
input: payload.value,
|
|
964
|
+
pattern: def.pattern.toString(),
|
|
965
|
+
inst,
|
|
966
|
+
continue: !def.abort
|
|
967
|
+
});
|
|
968
|
+
};
|
|
969
|
+
});
|
|
970
|
+
const $ZodCheckLowerCase = /* @__PURE__ */ $constructor("$ZodCheckLowerCase", (inst, def) => {
|
|
971
|
+
def.pattern ?? (def.pattern = lowercase);
|
|
972
|
+
$ZodCheckStringFormat.init(inst, def);
|
|
973
|
+
});
|
|
974
|
+
const $ZodCheckUpperCase = /* @__PURE__ */ $constructor("$ZodCheckUpperCase", (inst, def) => {
|
|
975
|
+
def.pattern ?? (def.pattern = uppercase);
|
|
976
|
+
$ZodCheckStringFormat.init(inst, def);
|
|
977
|
+
});
|
|
978
|
+
const $ZodCheckIncludes = /* @__PURE__ */ $constructor("$ZodCheckIncludes", (inst, def) => {
|
|
979
|
+
$ZodCheck.init(inst, def);
|
|
980
|
+
const escapedRegex = escapeRegex(def.includes);
|
|
981
|
+
const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position}}${escapedRegex}` : escapedRegex);
|
|
982
|
+
def.pattern = pattern;
|
|
983
|
+
inst._zod.onattach.push((inst2) => {
|
|
984
|
+
const bag = inst2._zod.bag;
|
|
985
|
+
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
986
|
+
bag.patterns.add(pattern);
|
|
987
|
+
});
|
|
988
|
+
inst._zod.check = (payload) => {
|
|
989
|
+
if (payload.value.includes(def.includes, def.position))
|
|
990
|
+
return;
|
|
991
|
+
payload.issues.push({
|
|
992
|
+
origin: "string",
|
|
993
|
+
code: "invalid_format",
|
|
994
|
+
format: "includes",
|
|
995
|
+
includes: def.includes,
|
|
996
|
+
input: payload.value,
|
|
997
|
+
inst,
|
|
998
|
+
continue: !def.abort
|
|
999
|
+
});
|
|
1000
|
+
};
|
|
1001
|
+
});
|
|
1002
|
+
const $ZodCheckStartsWith = /* @__PURE__ */ $constructor("$ZodCheckStartsWith", (inst, def) => {
|
|
1003
|
+
$ZodCheck.init(inst, def);
|
|
1004
|
+
const pattern = new RegExp(`^${escapeRegex(def.prefix)}.*`);
|
|
1005
|
+
def.pattern ?? (def.pattern = pattern);
|
|
1006
|
+
inst._zod.onattach.push((inst2) => {
|
|
1007
|
+
const bag = inst2._zod.bag;
|
|
1008
|
+
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
1009
|
+
bag.patterns.add(pattern);
|
|
1010
|
+
});
|
|
1011
|
+
inst._zod.check = (payload) => {
|
|
1012
|
+
if (payload.value.startsWith(def.prefix))
|
|
1013
|
+
return;
|
|
1014
|
+
payload.issues.push({
|
|
1015
|
+
origin: "string",
|
|
1016
|
+
code: "invalid_format",
|
|
1017
|
+
format: "starts_with",
|
|
1018
|
+
prefix: def.prefix,
|
|
1019
|
+
input: payload.value,
|
|
1020
|
+
inst,
|
|
1021
|
+
continue: !def.abort
|
|
1022
|
+
});
|
|
1023
|
+
};
|
|
1024
|
+
});
|
|
1025
|
+
const $ZodCheckEndsWith = /* @__PURE__ */ $constructor("$ZodCheckEndsWith", (inst, def) => {
|
|
1026
|
+
$ZodCheck.init(inst, def);
|
|
1027
|
+
const pattern = new RegExp(`.*${escapeRegex(def.suffix)}$`);
|
|
1028
|
+
def.pattern ?? (def.pattern = pattern);
|
|
1029
|
+
inst._zod.onattach.push((inst2) => {
|
|
1030
|
+
const bag = inst2._zod.bag;
|
|
1031
|
+
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
1032
|
+
bag.patterns.add(pattern);
|
|
1033
|
+
});
|
|
1034
|
+
inst._zod.check = (payload) => {
|
|
1035
|
+
if (payload.value.endsWith(def.suffix))
|
|
1036
|
+
return;
|
|
1037
|
+
payload.issues.push({
|
|
1038
|
+
origin: "string",
|
|
1039
|
+
code: "invalid_format",
|
|
1040
|
+
format: "ends_with",
|
|
1041
|
+
suffix: def.suffix,
|
|
1042
|
+
input: payload.value,
|
|
1043
|
+
inst,
|
|
1044
|
+
continue: !def.abort
|
|
1045
|
+
});
|
|
1046
|
+
};
|
|
1047
|
+
});
|
|
1048
|
+
const $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (inst, def) => {
|
|
1049
|
+
$ZodCheck.init(inst, def);
|
|
1050
|
+
inst._zod.check = (payload) => {
|
|
1051
|
+
payload.value = def.tx(payload.value);
|
|
1052
|
+
};
|
|
1053
|
+
});
|
|
1054
|
+
class Doc {
|
|
1055
|
+
constructor(args = []) {
|
|
1056
|
+
this.content = [];
|
|
1057
|
+
this.indent = 0;
|
|
1058
|
+
if (this)
|
|
1059
|
+
this.args = args;
|
|
1060
|
+
}
|
|
1061
|
+
indented(fn) {
|
|
1062
|
+
this.indent += 1;
|
|
1063
|
+
fn(this);
|
|
1064
|
+
this.indent -= 1;
|
|
1065
|
+
}
|
|
1066
|
+
write(arg) {
|
|
1067
|
+
if (typeof arg === "function") {
|
|
1068
|
+
arg(this, { execution: "sync" });
|
|
1069
|
+
arg(this, { execution: "async" });
|
|
1070
|
+
return;
|
|
1071
|
+
}
|
|
1072
|
+
const content = arg;
|
|
1073
|
+
const lines = content.split("\n").filter((x) => x);
|
|
1074
|
+
const minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length));
|
|
1075
|
+
const dedented = lines.map((x) => x.slice(minIndent)).map((x) => " ".repeat(this.indent * 2) + x);
|
|
1076
|
+
for (const line of dedented) {
|
|
1077
|
+
this.content.push(line);
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
compile() {
|
|
1081
|
+
const F = Function;
|
|
1082
|
+
const args = this?.args;
|
|
1083
|
+
const content = this?.content ?? [``];
|
|
1084
|
+
const lines = [...content.map((x) => ` ${x}`)];
|
|
1085
|
+
return new F(...args, lines.join("\n"));
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
const version = {
|
|
1089
|
+
major: 4,
|
|
1090
|
+
minor: 4,
|
|
1091
|
+
patch: 3
|
|
1092
|
+
};
|
|
1093
|
+
const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
1094
|
+
var _a2;
|
|
1095
|
+
inst ?? (inst = {});
|
|
1096
|
+
inst._zod.def = def;
|
|
1097
|
+
inst._zod.bag = inst._zod.bag || {};
|
|
1098
|
+
inst._zod.version = version;
|
|
1099
|
+
const checks = [...inst._zod.def.checks ?? []];
|
|
1100
|
+
if (inst._zod.traits.has("$ZodCheck")) {
|
|
1101
|
+
checks.unshift(inst);
|
|
1102
|
+
}
|
|
1103
|
+
for (const ch of checks) {
|
|
1104
|
+
for (const fn of ch._zod.onattach) {
|
|
1105
|
+
fn(inst);
|
|
1106
|
+
}
|
|
1107
|
+
}
|
|
1108
|
+
if (checks.length === 0) {
|
|
1109
|
+
(_a2 = inst._zod).deferred ?? (_a2.deferred = []);
|
|
1110
|
+
inst._zod.deferred?.push(() => {
|
|
1111
|
+
inst._zod.run = inst._zod.parse;
|
|
1112
|
+
});
|
|
1113
|
+
} else {
|
|
1114
|
+
const runChecks = (payload, checks2, ctx) => {
|
|
1115
|
+
let isAborted = aborted(payload);
|
|
1116
|
+
let asyncResult;
|
|
1117
|
+
for (const ch of checks2) {
|
|
1118
|
+
if (ch._zod.def.when) {
|
|
1119
|
+
if (explicitlyAborted(payload))
|
|
1120
|
+
continue;
|
|
1121
|
+
const shouldRun = ch._zod.def.when(payload);
|
|
1122
|
+
if (!shouldRun)
|
|
1123
|
+
continue;
|
|
1124
|
+
} else if (isAborted) {
|
|
1125
|
+
continue;
|
|
1126
|
+
}
|
|
1127
|
+
const currLen = payload.issues.length;
|
|
1128
|
+
const _ = ch._zod.check(payload);
|
|
1129
|
+
if (_ instanceof Promise && ctx?.async === false) {
|
|
1130
|
+
throw new $ZodAsyncError();
|
|
1131
|
+
}
|
|
1132
|
+
if (asyncResult || _ instanceof Promise) {
|
|
1133
|
+
asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {
|
|
1134
|
+
await _;
|
|
1135
|
+
const nextLen = payload.issues.length;
|
|
1136
|
+
if (nextLen === currLen)
|
|
1137
|
+
return;
|
|
1138
|
+
if (!isAborted)
|
|
1139
|
+
isAborted = aborted(payload, currLen);
|
|
1140
|
+
});
|
|
1141
|
+
} else {
|
|
1142
|
+
const nextLen = payload.issues.length;
|
|
1143
|
+
if (nextLen === currLen)
|
|
1144
|
+
continue;
|
|
1145
|
+
if (!isAborted)
|
|
1146
|
+
isAborted = aborted(payload, currLen);
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
if (asyncResult) {
|
|
1150
|
+
return asyncResult.then(() => {
|
|
1151
|
+
return payload;
|
|
1152
|
+
});
|
|
1153
|
+
}
|
|
1154
|
+
return payload;
|
|
1155
|
+
};
|
|
1156
|
+
const handleCanaryResult = (canary, payload, ctx) => {
|
|
1157
|
+
if (aborted(canary)) {
|
|
1158
|
+
canary.aborted = true;
|
|
1159
|
+
return canary;
|
|
1160
|
+
}
|
|
1161
|
+
const checkResult = runChecks(payload, checks, ctx);
|
|
1162
|
+
if (checkResult instanceof Promise) {
|
|
1163
|
+
if (ctx.async === false)
|
|
1164
|
+
throw new $ZodAsyncError();
|
|
1165
|
+
return checkResult.then((checkResult2) => inst._zod.parse(checkResult2, ctx));
|
|
1166
|
+
}
|
|
1167
|
+
return inst._zod.parse(checkResult, ctx);
|
|
1168
|
+
};
|
|
1169
|
+
inst._zod.run = (payload, ctx) => {
|
|
1170
|
+
if (ctx.skipChecks) {
|
|
1171
|
+
return inst._zod.parse(payload, ctx);
|
|
1172
|
+
}
|
|
1173
|
+
if (ctx.direction === "backward") {
|
|
1174
|
+
const canary = inst._zod.parse({ value: payload.value, issues: [] }, { ...ctx, skipChecks: true });
|
|
1175
|
+
if (canary instanceof Promise) {
|
|
1176
|
+
return canary.then((canary2) => {
|
|
1177
|
+
return handleCanaryResult(canary2, payload, ctx);
|
|
1178
|
+
});
|
|
1179
|
+
}
|
|
1180
|
+
return handleCanaryResult(canary, payload, ctx);
|
|
1181
|
+
}
|
|
1182
|
+
const result = inst._zod.parse(payload, ctx);
|
|
1183
|
+
if (result instanceof Promise) {
|
|
1184
|
+
if (ctx.async === false)
|
|
1185
|
+
throw new $ZodAsyncError();
|
|
1186
|
+
return result.then((result2) => runChecks(result2, checks, ctx));
|
|
1187
|
+
}
|
|
1188
|
+
return runChecks(result, checks, ctx);
|
|
1189
|
+
};
|
|
1190
|
+
}
|
|
1191
|
+
defineLazy(inst, "~standard", () => ({
|
|
1192
|
+
validate: (value) => {
|
|
1193
|
+
try {
|
|
1194
|
+
const r = safeParse$1(inst, value);
|
|
1195
|
+
return r.success ? { value: r.data } : { issues: r.error?.issues };
|
|
1196
|
+
} catch (_) {
|
|
1197
|
+
return safeParseAsync$1(inst, value).then((r) => r.success ? { value: r.data } : { issues: r.error?.issues });
|
|
1198
|
+
}
|
|
1199
|
+
},
|
|
1200
|
+
vendor: "zod",
|
|
1201
|
+
version: 1
|
|
1202
|
+
}));
|
|
1203
|
+
});
|
|
1204
|
+
const $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
|
|
1205
|
+
$ZodType.init(inst, def);
|
|
1206
|
+
inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string$1(inst._zod.bag);
|
|
1207
|
+
inst._zod.parse = (payload, _) => {
|
|
1208
|
+
if (def.coerce)
|
|
1209
|
+
try {
|
|
1210
|
+
payload.value = String(payload.value);
|
|
1211
|
+
} catch (_2) {
|
|
1212
|
+
}
|
|
1213
|
+
if (typeof payload.value === "string")
|
|
1214
|
+
return payload;
|
|
1215
|
+
payload.issues.push({
|
|
1216
|
+
expected: "string",
|
|
1217
|
+
code: "invalid_type",
|
|
1218
|
+
input: payload.value,
|
|
1219
|
+
inst
|
|
1220
|
+
});
|
|
1221
|
+
return payload;
|
|
1222
|
+
};
|
|
1223
|
+
});
|
|
1224
|
+
const $ZodStringFormat = /* @__PURE__ */ $constructor("$ZodStringFormat", (inst, def) => {
|
|
1225
|
+
$ZodCheckStringFormat.init(inst, def);
|
|
1226
|
+
$ZodString.init(inst, def);
|
|
1227
|
+
});
|
|
1228
|
+
const $ZodGUID = /* @__PURE__ */ $constructor("$ZodGUID", (inst, def) => {
|
|
1229
|
+
def.pattern ?? (def.pattern = guid);
|
|
1230
|
+
$ZodStringFormat.init(inst, def);
|
|
1231
|
+
});
|
|
1232
|
+
const $ZodUUID = /* @__PURE__ */ $constructor("$ZodUUID", (inst, def) => {
|
|
1233
|
+
if (def.version) {
|
|
1234
|
+
const versionMap = {
|
|
1235
|
+
v1: 1,
|
|
1236
|
+
v2: 2,
|
|
1237
|
+
v3: 3,
|
|
1238
|
+
v4: 4,
|
|
1239
|
+
v5: 5,
|
|
1240
|
+
v6: 6,
|
|
1241
|
+
v7: 7,
|
|
1242
|
+
v8: 8
|
|
1243
|
+
};
|
|
1244
|
+
const v = versionMap[def.version];
|
|
1245
|
+
if (v === void 0)
|
|
1246
|
+
throw new Error(`Invalid UUID version: "${def.version}"`);
|
|
1247
|
+
def.pattern ?? (def.pattern = uuid(v));
|
|
1248
|
+
} else
|
|
1249
|
+
def.pattern ?? (def.pattern = uuid());
|
|
1250
|
+
$ZodStringFormat.init(inst, def);
|
|
1251
|
+
});
|
|
1252
|
+
const $ZodEmail = /* @__PURE__ */ $constructor("$ZodEmail", (inst, def) => {
|
|
1253
|
+
def.pattern ?? (def.pattern = email);
|
|
1254
|
+
$ZodStringFormat.init(inst, def);
|
|
1255
|
+
});
|
|
1256
|
+
const $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
|
|
1257
|
+
$ZodStringFormat.init(inst, def);
|
|
1258
|
+
inst._zod.check = (payload) => {
|
|
1259
|
+
try {
|
|
1260
|
+
const trimmed = payload.value.trim();
|
|
1261
|
+
if (!def.normalize && def.protocol?.source === httpProtocol.source) {
|
|
1262
|
+
if (!/^https?:\/\//i.test(trimmed)) {
|
|
1263
|
+
payload.issues.push({
|
|
1264
|
+
code: "invalid_format",
|
|
1265
|
+
format: "url",
|
|
1266
|
+
note: "Invalid URL format",
|
|
1267
|
+
input: payload.value,
|
|
1268
|
+
inst,
|
|
1269
|
+
continue: !def.abort
|
|
1270
|
+
});
|
|
1271
|
+
return;
|
|
1272
|
+
}
|
|
1273
|
+
}
|
|
1274
|
+
const url = new URL(trimmed);
|
|
1275
|
+
if (def.hostname) {
|
|
1276
|
+
def.hostname.lastIndex = 0;
|
|
1277
|
+
if (!def.hostname.test(url.hostname)) {
|
|
1278
|
+
payload.issues.push({
|
|
1279
|
+
code: "invalid_format",
|
|
1280
|
+
format: "url",
|
|
1281
|
+
note: "Invalid hostname",
|
|
1282
|
+
pattern: def.hostname.source,
|
|
1283
|
+
input: payload.value,
|
|
1284
|
+
inst,
|
|
1285
|
+
continue: !def.abort
|
|
1286
|
+
});
|
|
1287
|
+
}
|
|
1288
|
+
}
|
|
1289
|
+
if (def.protocol) {
|
|
1290
|
+
def.protocol.lastIndex = 0;
|
|
1291
|
+
if (!def.protocol.test(url.protocol.endsWith(":") ? url.protocol.slice(0, -1) : url.protocol)) {
|
|
1292
|
+
payload.issues.push({
|
|
1293
|
+
code: "invalid_format",
|
|
1294
|
+
format: "url",
|
|
1295
|
+
note: "Invalid protocol",
|
|
1296
|
+
pattern: def.protocol.source,
|
|
1297
|
+
input: payload.value,
|
|
1298
|
+
inst,
|
|
1299
|
+
continue: !def.abort
|
|
1300
|
+
});
|
|
1301
|
+
}
|
|
1302
|
+
}
|
|
1303
|
+
if (def.normalize) {
|
|
1304
|
+
payload.value = url.href;
|
|
1305
|
+
} else {
|
|
1306
|
+
payload.value = trimmed;
|
|
1307
|
+
}
|
|
1308
|
+
return;
|
|
1309
|
+
} catch (_) {
|
|
1310
|
+
payload.issues.push({
|
|
1311
|
+
code: "invalid_format",
|
|
1312
|
+
format: "url",
|
|
1313
|
+
input: payload.value,
|
|
1314
|
+
inst,
|
|
1315
|
+
continue: !def.abort
|
|
1316
|
+
});
|
|
1317
|
+
}
|
|
1318
|
+
};
|
|
1319
|
+
});
|
|
1320
|
+
const $ZodEmoji = /* @__PURE__ */ $constructor("$ZodEmoji", (inst, def) => {
|
|
1321
|
+
def.pattern ?? (def.pattern = emoji());
|
|
1322
|
+
$ZodStringFormat.init(inst, def);
|
|
1323
|
+
});
|
|
1324
|
+
const $ZodNanoID = /* @__PURE__ */ $constructor("$ZodNanoID", (inst, def) => {
|
|
1325
|
+
def.pattern ?? (def.pattern = nanoid);
|
|
1326
|
+
$ZodStringFormat.init(inst, def);
|
|
1327
|
+
});
|
|
1328
|
+
const $ZodCUID = /* @__PURE__ */ $constructor("$ZodCUID", (inst, def) => {
|
|
1329
|
+
def.pattern ?? (def.pattern = cuid);
|
|
1330
|
+
$ZodStringFormat.init(inst, def);
|
|
1331
|
+
});
|
|
1332
|
+
const $ZodCUID2 = /* @__PURE__ */ $constructor("$ZodCUID2", (inst, def) => {
|
|
1333
|
+
def.pattern ?? (def.pattern = cuid2);
|
|
1334
|
+
$ZodStringFormat.init(inst, def);
|
|
1335
|
+
});
|
|
1336
|
+
const $ZodULID = /* @__PURE__ */ $constructor("$ZodULID", (inst, def) => {
|
|
1337
|
+
def.pattern ?? (def.pattern = ulid);
|
|
1338
|
+
$ZodStringFormat.init(inst, def);
|
|
1339
|
+
});
|
|
1340
|
+
const $ZodXID = /* @__PURE__ */ $constructor("$ZodXID", (inst, def) => {
|
|
1341
|
+
def.pattern ?? (def.pattern = xid);
|
|
1342
|
+
$ZodStringFormat.init(inst, def);
|
|
1343
|
+
});
|
|
1344
|
+
const $ZodKSUID = /* @__PURE__ */ $constructor("$ZodKSUID", (inst, def) => {
|
|
1345
|
+
def.pattern ?? (def.pattern = ksuid);
|
|
1346
|
+
$ZodStringFormat.init(inst, def);
|
|
1347
|
+
});
|
|
1348
|
+
const $ZodISODateTime = /* @__PURE__ */ $constructor("$ZodISODateTime", (inst, def) => {
|
|
1349
|
+
def.pattern ?? (def.pattern = datetime$1(def));
|
|
1350
|
+
$ZodStringFormat.init(inst, def);
|
|
1351
|
+
});
|
|
1352
|
+
const $ZodISODate = /* @__PURE__ */ $constructor("$ZodISODate", (inst, def) => {
|
|
1353
|
+
def.pattern ?? (def.pattern = date$1);
|
|
1354
|
+
$ZodStringFormat.init(inst, def);
|
|
1355
|
+
});
|
|
1356
|
+
const $ZodISOTime = /* @__PURE__ */ $constructor("$ZodISOTime", (inst, def) => {
|
|
1357
|
+
def.pattern ?? (def.pattern = time$1(def));
|
|
1358
|
+
$ZodStringFormat.init(inst, def);
|
|
1359
|
+
});
|
|
1360
|
+
const $ZodISODuration = /* @__PURE__ */ $constructor("$ZodISODuration", (inst, def) => {
|
|
1361
|
+
def.pattern ?? (def.pattern = duration$1);
|
|
1362
|
+
$ZodStringFormat.init(inst, def);
|
|
1363
|
+
});
|
|
1364
|
+
const $ZodIPv4 = /* @__PURE__ */ $constructor("$ZodIPv4", (inst, def) => {
|
|
1365
|
+
def.pattern ?? (def.pattern = ipv4);
|
|
1366
|
+
$ZodStringFormat.init(inst, def);
|
|
1367
|
+
inst._zod.bag.format = `ipv4`;
|
|
1368
|
+
});
|
|
1369
|
+
const $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => {
|
|
1370
|
+
def.pattern ?? (def.pattern = ipv6);
|
|
1371
|
+
$ZodStringFormat.init(inst, def);
|
|
1372
|
+
inst._zod.bag.format = `ipv6`;
|
|
1373
|
+
inst._zod.check = (payload) => {
|
|
1374
|
+
try {
|
|
1375
|
+
new URL(`http://[${payload.value}]`);
|
|
1376
|
+
} catch {
|
|
1377
|
+
payload.issues.push({
|
|
1378
|
+
code: "invalid_format",
|
|
1379
|
+
format: "ipv6",
|
|
1380
|
+
input: payload.value,
|
|
1381
|
+
inst,
|
|
1382
|
+
continue: !def.abort
|
|
1383
|
+
});
|
|
1384
|
+
}
|
|
1385
|
+
};
|
|
1386
|
+
});
|
|
1387
|
+
const $ZodCIDRv4 = /* @__PURE__ */ $constructor("$ZodCIDRv4", (inst, def) => {
|
|
1388
|
+
def.pattern ?? (def.pattern = cidrv4);
|
|
1389
|
+
$ZodStringFormat.init(inst, def);
|
|
1390
|
+
});
|
|
1391
|
+
const $ZodCIDRv6 = /* @__PURE__ */ $constructor("$ZodCIDRv6", (inst, def) => {
|
|
1392
|
+
def.pattern ?? (def.pattern = cidrv6);
|
|
1393
|
+
$ZodStringFormat.init(inst, def);
|
|
1394
|
+
inst._zod.check = (payload) => {
|
|
1395
|
+
const parts = payload.value.split("/");
|
|
1396
|
+
try {
|
|
1397
|
+
if (parts.length !== 2)
|
|
1398
|
+
throw new Error();
|
|
1399
|
+
const [address, prefix] = parts;
|
|
1400
|
+
if (!prefix)
|
|
1401
|
+
throw new Error();
|
|
1402
|
+
const prefixNum = Number(prefix);
|
|
1403
|
+
if (`${prefixNum}` !== prefix)
|
|
1404
|
+
throw new Error();
|
|
1405
|
+
if (prefixNum < 0 || prefixNum > 128)
|
|
1406
|
+
throw new Error();
|
|
1407
|
+
new URL(`http://[${address}]`);
|
|
1408
|
+
} catch {
|
|
1409
|
+
payload.issues.push({
|
|
1410
|
+
code: "invalid_format",
|
|
1411
|
+
format: "cidrv6",
|
|
1412
|
+
input: payload.value,
|
|
1413
|
+
inst,
|
|
1414
|
+
continue: !def.abort
|
|
1415
|
+
});
|
|
1416
|
+
}
|
|
1417
|
+
};
|
|
1418
|
+
});
|
|
1419
|
+
function isValidBase64(data) {
|
|
1420
|
+
if (data === "")
|
|
1421
|
+
return true;
|
|
1422
|
+
if (/\s/.test(data))
|
|
1423
|
+
return false;
|
|
1424
|
+
if (data.length % 4 !== 0)
|
|
1425
|
+
return false;
|
|
1426
|
+
try {
|
|
1427
|
+
atob(data);
|
|
1428
|
+
return true;
|
|
1429
|
+
} catch {
|
|
1430
|
+
return false;
|
|
1431
|
+
}
|
|
1432
|
+
}
|
|
1433
|
+
const $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
|
|
1434
|
+
def.pattern ?? (def.pattern = base64);
|
|
1435
|
+
$ZodStringFormat.init(inst, def);
|
|
1436
|
+
inst._zod.bag.contentEncoding = "base64";
|
|
1437
|
+
inst._zod.check = (payload) => {
|
|
1438
|
+
if (isValidBase64(payload.value))
|
|
1439
|
+
return;
|
|
1440
|
+
payload.issues.push({
|
|
1441
|
+
code: "invalid_format",
|
|
1442
|
+
format: "base64",
|
|
1443
|
+
input: payload.value,
|
|
1444
|
+
inst,
|
|
1445
|
+
continue: !def.abort
|
|
1446
|
+
});
|
|
1447
|
+
};
|
|
1448
|
+
});
|
|
1449
|
+
function isValidBase64URL(data) {
|
|
1450
|
+
if (!base64url.test(data))
|
|
1451
|
+
return false;
|
|
1452
|
+
const base642 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
|
|
1453
|
+
const padded = base642.padEnd(Math.ceil(base642.length / 4) * 4, "=");
|
|
1454
|
+
return isValidBase64(padded);
|
|
1455
|
+
}
|
|
1456
|
+
const $ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def) => {
|
|
1457
|
+
def.pattern ?? (def.pattern = base64url);
|
|
1458
|
+
$ZodStringFormat.init(inst, def);
|
|
1459
|
+
inst._zod.bag.contentEncoding = "base64url";
|
|
1460
|
+
inst._zod.check = (payload) => {
|
|
1461
|
+
if (isValidBase64URL(payload.value))
|
|
1462
|
+
return;
|
|
1463
|
+
payload.issues.push({
|
|
1464
|
+
code: "invalid_format",
|
|
1465
|
+
format: "base64url",
|
|
1466
|
+
input: payload.value,
|
|
1467
|
+
inst,
|
|
1468
|
+
continue: !def.abort
|
|
1469
|
+
});
|
|
1470
|
+
};
|
|
1471
|
+
});
|
|
1472
|
+
const $ZodE164 = /* @__PURE__ */ $constructor("$ZodE164", (inst, def) => {
|
|
1473
|
+
def.pattern ?? (def.pattern = e164);
|
|
1474
|
+
$ZodStringFormat.init(inst, def);
|
|
1475
|
+
});
|
|
1476
|
+
function isValidJWT(token, algorithm = null) {
|
|
1477
|
+
try {
|
|
1478
|
+
const tokensParts = token.split(".");
|
|
1479
|
+
if (tokensParts.length !== 3)
|
|
1480
|
+
return false;
|
|
1481
|
+
const [header] = tokensParts;
|
|
1482
|
+
if (!header)
|
|
1483
|
+
return false;
|
|
1484
|
+
const parsedHeader = JSON.parse(atob(header));
|
|
1485
|
+
if ("typ" in parsedHeader && parsedHeader?.typ !== "JWT")
|
|
1486
|
+
return false;
|
|
1487
|
+
if (!parsedHeader.alg)
|
|
1488
|
+
return false;
|
|
1489
|
+
if (algorithm && (!("alg" in parsedHeader) || parsedHeader.alg !== algorithm))
|
|
1490
|
+
return false;
|
|
1491
|
+
return true;
|
|
1492
|
+
} catch {
|
|
1493
|
+
return false;
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
1496
|
+
const $ZodJWT = /* @__PURE__ */ $constructor("$ZodJWT", (inst, def) => {
|
|
1497
|
+
$ZodStringFormat.init(inst, def);
|
|
1498
|
+
inst._zod.check = (payload) => {
|
|
1499
|
+
if (isValidJWT(payload.value, def.alg))
|
|
1500
|
+
return;
|
|
1501
|
+
payload.issues.push({
|
|
1502
|
+
code: "invalid_format",
|
|
1503
|
+
format: "jwt",
|
|
1504
|
+
input: payload.value,
|
|
1505
|
+
inst,
|
|
1506
|
+
continue: !def.abort
|
|
1507
|
+
});
|
|
1508
|
+
};
|
|
1509
|
+
});
|
|
1510
|
+
const $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
|
|
1511
|
+
$ZodType.init(inst, def);
|
|
1512
|
+
inst._zod.pattern = inst._zod.bag.pattern ?? number$1;
|
|
1513
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
1514
|
+
if (def.coerce)
|
|
1515
|
+
try {
|
|
1516
|
+
payload.value = Number(payload.value);
|
|
1517
|
+
} catch (_) {
|
|
1518
|
+
}
|
|
1519
|
+
const input = payload.value;
|
|
1520
|
+
if (typeof input === "number" && !Number.isNaN(input) && Number.isFinite(input)) {
|
|
1521
|
+
return payload;
|
|
1522
|
+
}
|
|
1523
|
+
const received = typeof input === "number" ? Number.isNaN(input) ? "NaN" : !Number.isFinite(input) ? "Infinity" : void 0 : void 0;
|
|
1524
|
+
payload.issues.push({
|
|
1525
|
+
expected: "number",
|
|
1526
|
+
code: "invalid_type",
|
|
1527
|
+
input,
|
|
1528
|
+
inst,
|
|
1529
|
+
...received ? { received } : {}
|
|
1530
|
+
});
|
|
1531
|
+
return payload;
|
|
1532
|
+
};
|
|
1533
|
+
});
|
|
1534
|
+
const $ZodNumberFormat = /* @__PURE__ */ $constructor("$ZodNumberFormat", (inst, def) => {
|
|
1535
|
+
$ZodCheckNumberFormat.init(inst, def);
|
|
1536
|
+
$ZodNumber.init(inst, def);
|
|
1537
|
+
});
|
|
1538
|
+
const $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
|
|
1539
|
+
$ZodType.init(inst, def);
|
|
1540
|
+
inst._zod.pattern = boolean$1;
|
|
1541
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
1542
|
+
if (def.coerce)
|
|
1543
|
+
try {
|
|
1544
|
+
payload.value = Boolean(payload.value);
|
|
1545
|
+
} catch (_) {
|
|
1546
|
+
}
|
|
1547
|
+
const input = payload.value;
|
|
1548
|
+
if (typeof input === "boolean")
|
|
1549
|
+
return payload;
|
|
1550
|
+
payload.issues.push({
|
|
1551
|
+
expected: "boolean",
|
|
1552
|
+
code: "invalid_type",
|
|
1553
|
+
input,
|
|
1554
|
+
inst
|
|
1555
|
+
});
|
|
1556
|
+
return payload;
|
|
1557
|
+
};
|
|
1558
|
+
});
|
|
1559
|
+
const $ZodAny = /* @__PURE__ */ $constructor("$ZodAny", (inst, def) => {
|
|
1560
|
+
$ZodType.init(inst, def);
|
|
1561
|
+
inst._zod.parse = (payload) => payload;
|
|
1562
|
+
});
|
|
1563
|
+
const $ZodUnknown = /* @__PURE__ */ $constructor("$ZodUnknown", (inst, def) => {
|
|
1564
|
+
$ZodType.init(inst, def);
|
|
1565
|
+
inst._zod.parse = (payload) => payload;
|
|
1566
|
+
});
|
|
1567
|
+
const $ZodNever = /* @__PURE__ */ $constructor("$ZodNever", (inst, def) => {
|
|
1568
|
+
$ZodType.init(inst, def);
|
|
1569
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
1570
|
+
payload.issues.push({
|
|
1571
|
+
expected: "never",
|
|
1572
|
+
code: "invalid_type",
|
|
1573
|
+
input: payload.value,
|
|
1574
|
+
inst
|
|
1575
|
+
});
|
|
1576
|
+
return payload;
|
|
1577
|
+
};
|
|
1578
|
+
});
|
|
1579
|
+
function handleArrayResult(result, final, index) {
|
|
1580
|
+
if (result.issues.length) {
|
|
1581
|
+
final.issues.push(...prefixIssues(index, result.issues));
|
|
1582
|
+
}
|
|
1583
|
+
final.value[index] = result.value;
|
|
1584
|
+
}
|
|
1585
|
+
const $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
1586
|
+
$ZodType.init(inst, def);
|
|
1587
|
+
inst._zod.parse = (payload, ctx) => {
|
|
1588
|
+
const input = payload.value;
|
|
1589
|
+
if (!Array.isArray(input)) {
|
|
1590
|
+
payload.issues.push({
|
|
1591
|
+
expected: "array",
|
|
1592
|
+
code: "invalid_type",
|
|
1593
|
+
input,
|
|
1594
|
+
inst
|
|
1595
|
+
});
|
|
1596
|
+
return payload;
|
|
1597
|
+
}
|
|
1598
|
+
payload.value = Array(input.length);
|
|
1599
|
+
const proms = [];
|
|
1600
|
+
for (let i = 0; i < input.length; i++) {
|
|
1601
|
+
const item = input[i];
|
|
1602
|
+
const result = def.element._zod.run({
|
|
1603
|
+
value: item,
|
|
1604
|
+
issues: []
|
|
1605
|
+
}, ctx);
|
|
1606
|
+
if (result instanceof Promise) {
|
|
1607
|
+
proms.push(result.then((result2) => handleArrayResult(result2, payload, i)));
|
|
1608
|
+
} else {
|
|
1609
|
+
handleArrayResult(result, payload, i);
|
|
1610
|
+
}
|
|
1611
|
+
}
|
|
1612
|
+
if (proms.length) {
|
|
1613
|
+
return Promise.all(proms).then(() => payload);
|
|
1614
|
+
}
|
|
1615
|
+
return payload;
|
|
1616
|
+
};
|
|
1617
|
+
});
|
|
1618
|
+
function handlePropertyResult(result, final, key, input, isOptionalIn, isOptionalOut) {
|
|
1619
|
+
const isPresent = key in input;
|
|
1620
|
+
if (result.issues.length) {
|
|
1621
|
+
if (isOptionalIn && isOptionalOut && !isPresent) {
|
|
1622
|
+
return;
|
|
1623
|
+
}
|
|
1624
|
+
final.issues.push(...prefixIssues(key, result.issues));
|
|
1625
|
+
}
|
|
1626
|
+
if (!isPresent && !isOptionalIn) {
|
|
1627
|
+
if (!result.issues.length) {
|
|
1628
|
+
final.issues.push({
|
|
1629
|
+
code: "invalid_type",
|
|
1630
|
+
expected: "nonoptional",
|
|
1631
|
+
input: void 0,
|
|
1632
|
+
path: [key]
|
|
1633
|
+
});
|
|
1634
|
+
}
|
|
1635
|
+
return;
|
|
1636
|
+
}
|
|
1637
|
+
if (result.value === void 0) {
|
|
1638
|
+
if (isPresent) {
|
|
1639
|
+
final.value[key] = void 0;
|
|
1640
|
+
}
|
|
1641
|
+
} else {
|
|
1642
|
+
final.value[key] = result.value;
|
|
1643
|
+
}
|
|
1644
|
+
}
|
|
1645
|
+
function normalizeDef(def) {
|
|
1646
|
+
const keys = Object.keys(def.shape);
|
|
1647
|
+
for (const k of keys) {
|
|
1648
|
+
if (!def.shape?.[k]?._zod?.traits?.has("$ZodType")) {
|
|
1649
|
+
throw new Error(`Invalid element at key "${k}": expected a Zod schema`);
|
|
1650
|
+
}
|
|
1651
|
+
}
|
|
1652
|
+
const okeys = optionalKeys(def.shape);
|
|
1653
|
+
return {
|
|
1654
|
+
...def,
|
|
1655
|
+
keys,
|
|
1656
|
+
keySet: new Set(keys),
|
|
1657
|
+
numKeys: keys.length,
|
|
1658
|
+
optionalKeys: new Set(okeys)
|
|
1659
|
+
};
|
|
1660
|
+
}
|
|
1661
|
+
function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
1662
|
+
const unrecognized = [];
|
|
1663
|
+
const keySet = def.keySet;
|
|
1664
|
+
const _catchall = def.catchall._zod;
|
|
1665
|
+
const t = _catchall.def.type;
|
|
1666
|
+
const isOptionalIn = _catchall.optin === "optional";
|
|
1667
|
+
const isOptionalOut = _catchall.optout === "optional";
|
|
1668
|
+
for (const key in input) {
|
|
1669
|
+
if (key === "__proto__")
|
|
1670
|
+
continue;
|
|
1671
|
+
if (keySet.has(key))
|
|
1672
|
+
continue;
|
|
1673
|
+
if (t === "never") {
|
|
1674
|
+
unrecognized.push(key);
|
|
1675
|
+
continue;
|
|
1676
|
+
}
|
|
1677
|
+
const r = _catchall.run({ value: input[key], issues: [] }, ctx);
|
|
1678
|
+
if (r instanceof Promise) {
|
|
1679
|
+
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input, isOptionalIn, isOptionalOut)));
|
|
1680
|
+
} else {
|
|
1681
|
+
handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut);
|
|
1682
|
+
}
|
|
1683
|
+
}
|
|
1684
|
+
if (unrecognized.length) {
|
|
1685
|
+
payload.issues.push({
|
|
1686
|
+
code: "unrecognized_keys",
|
|
1687
|
+
keys: unrecognized,
|
|
1688
|
+
input,
|
|
1689
|
+
inst
|
|
1690
|
+
});
|
|
1691
|
+
}
|
|
1692
|
+
if (!proms.length)
|
|
1693
|
+
return payload;
|
|
1694
|
+
return Promise.all(proms).then(() => {
|
|
1695
|
+
return payload;
|
|
1696
|
+
});
|
|
1697
|
+
}
|
|
1698
|
+
const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
1699
|
+
$ZodType.init(inst, def);
|
|
1700
|
+
const desc = Object.getOwnPropertyDescriptor(def, "shape");
|
|
1701
|
+
if (!desc?.get) {
|
|
1702
|
+
const sh = def.shape;
|
|
1703
|
+
Object.defineProperty(def, "shape", {
|
|
1704
|
+
get: () => {
|
|
1705
|
+
const newSh = { ...sh };
|
|
1706
|
+
Object.defineProperty(def, "shape", {
|
|
1707
|
+
value: newSh
|
|
1708
|
+
});
|
|
1709
|
+
return newSh;
|
|
1710
|
+
}
|
|
1711
|
+
});
|
|
1712
|
+
}
|
|
1713
|
+
const _normalized = cached(() => normalizeDef(def));
|
|
1714
|
+
defineLazy(inst._zod, "propValues", () => {
|
|
1715
|
+
const shape = def.shape;
|
|
1716
|
+
const propValues = {};
|
|
1717
|
+
for (const key in shape) {
|
|
1718
|
+
const field = shape[key]._zod;
|
|
1719
|
+
if (field.values) {
|
|
1720
|
+
propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
|
|
1721
|
+
for (const v of field.values)
|
|
1722
|
+
propValues[key].add(v);
|
|
1723
|
+
}
|
|
1724
|
+
}
|
|
1725
|
+
return propValues;
|
|
1726
|
+
});
|
|
1727
|
+
const isObject$1 = isObject;
|
|
1728
|
+
const catchall = def.catchall;
|
|
1729
|
+
let value;
|
|
1730
|
+
inst._zod.parse = (payload, ctx) => {
|
|
1731
|
+
value ?? (value = _normalized.value);
|
|
1732
|
+
const input = payload.value;
|
|
1733
|
+
if (!isObject$1(input)) {
|
|
1734
|
+
payload.issues.push({
|
|
1735
|
+
expected: "object",
|
|
1736
|
+
code: "invalid_type",
|
|
1737
|
+
input,
|
|
1738
|
+
inst
|
|
1739
|
+
});
|
|
1740
|
+
return payload;
|
|
1741
|
+
}
|
|
1742
|
+
payload.value = {};
|
|
1743
|
+
const proms = [];
|
|
1744
|
+
const shape = value.shape;
|
|
1745
|
+
for (const key of value.keys) {
|
|
1746
|
+
const el = shape[key];
|
|
1747
|
+
const isOptionalIn = el._zod.optin === "optional";
|
|
1748
|
+
const isOptionalOut = el._zod.optout === "optional";
|
|
1749
|
+
const r = el._zod.run({ value: input[key], issues: [] }, ctx);
|
|
1750
|
+
if (r instanceof Promise) {
|
|
1751
|
+
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input, isOptionalIn, isOptionalOut)));
|
|
1752
|
+
} else {
|
|
1753
|
+
handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut);
|
|
1754
|
+
}
|
|
1755
|
+
}
|
|
1756
|
+
if (!catchall) {
|
|
1757
|
+
return proms.length ? Promise.all(proms).then(() => payload) : payload;
|
|
1758
|
+
}
|
|
1759
|
+
return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
|
|
1760
|
+
};
|
|
1761
|
+
});
|
|
1762
|
+
const $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) => {
|
|
1763
|
+
$ZodObject.init(inst, def);
|
|
1764
|
+
const superParse = inst._zod.parse;
|
|
1765
|
+
const _normalized = cached(() => normalizeDef(def));
|
|
1766
|
+
const generateFastpass = (shape) => {
|
|
1767
|
+
const doc = new Doc(["shape", "payload", "ctx"]);
|
|
1768
|
+
const normalized = _normalized.value;
|
|
1769
|
+
const parseStr = (key) => {
|
|
1770
|
+
const k = esc(key);
|
|
1771
|
+
return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
|
|
1772
|
+
};
|
|
1773
|
+
doc.write(`const input = payload.value;`);
|
|
1774
|
+
const ids = /* @__PURE__ */ Object.create(null);
|
|
1775
|
+
let counter = 0;
|
|
1776
|
+
for (const key of normalized.keys) {
|
|
1777
|
+
ids[key] = `key_${counter++}`;
|
|
1778
|
+
}
|
|
1779
|
+
doc.write(`const newResult = {};`);
|
|
1780
|
+
for (const key of normalized.keys) {
|
|
1781
|
+
const id = ids[key];
|
|
1782
|
+
const k = esc(key);
|
|
1783
|
+
const schema = shape[key];
|
|
1784
|
+
const isOptionalIn = schema?._zod?.optin === "optional";
|
|
1785
|
+
const isOptionalOut = schema?._zod?.optout === "optional";
|
|
1786
|
+
doc.write(`const ${id} = ${parseStr(key)};`);
|
|
1787
|
+
if (isOptionalIn && isOptionalOut) {
|
|
1788
|
+
doc.write(`
|
|
1789
|
+
if (${id}.issues.length) {
|
|
1790
|
+
if (${k} in input) {
|
|
1791
|
+
payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
|
|
1792
|
+
...iss,
|
|
1793
|
+
path: iss.path ? [${k}, ...iss.path] : [${k}]
|
|
1794
|
+
})));
|
|
1795
|
+
}
|
|
1796
|
+
}
|
|
1797
|
+
|
|
1798
|
+
if (${id}.value === undefined) {
|
|
1799
|
+
if (${k} in input) {
|
|
1800
|
+
newResult[${k}] = undefined;
|
|
1801
|
+
}
|
|
1802
|
+
} else {
|
|
1803
|
+
newResult[${k}] = ${id}.value;
|
|
1804
|
+
}
|
|
1805
|
+
|
|
1806
|
+
`);
|
|
1807
|
+
} else if (!isOptionalIn) {
|
|
1808
|
+
doc.write(`
|
|
1809
|
+
const ${id}_present = ${k} in input;
|
|
1810
|
+
if (${id}.issues.length) {
|
|
1811
|
+
payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
|
|
1812
|
+
...iss,
|
|
1813
|
+
path: iss.path ? [${k}, ...iss.path] : [${k}]
|
|
1814
|
+
})));
|
|
1815
|
+
}
|
|
1816
|
+
if (!${id}_present && !${id}.issues.length) {
|
|
1817
|
+
payload.issues.push({
|
|
1818
|
+
code: "invalid_type",
|
|
1819
|
+
expected: "nonoptional",
|
|
1820
|
+
input: undefined,
|
|
1821
|
+
path: [${k}]
|
|
1822
|
+
});
|
|
1823
|
+
}
|
|
1824
|
+
|
|
1825
|
+
if (${id}_present) {
|
|
1826
|
+
if (${id}.value === undefined) {
|
|
1827
|
+
newResult[${k}] = undefined;
|
|
1828
|
+
} else {
|
|
1829
|
+
newResult[${k}] = ${id}.value;
|
|
1830
|
+
}
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1833
|
+
`);
|
|
1834
|
+
} else {
|
|
1835
|
+
doc.write(`
|
|
1836
|
+
if (${id}.issues.length) {
|
|
1837
|
+
payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
|
|
1838
|
+
...iss,
|
|
1839
|
+
path: iss.path ? [${k}, ...iss.path] : [${k}]
|
|
1840
|
+
})));
|
|
1841
|
+
}
|
|
1842
|
+
|
|
1843
|
+
if (${id}.value === undefined) {
|
|
1844
|
+
if (${k} in input) {
|
|
1845
|
+
newResult[${k}] = undefined;
|
|
1846
|
+
}
|
|
1847
|
+
} else {
|
|
1848
|
+
newResult[${k}] = ${id}.value;
|
|
1849
|
+
}
|
|
1850
|
+
|
|
1851
|
+
`);
|
|
1852
|
+
}
|
|
1853
|
+
}
|
|
1854
|
+
doc.write(`payload.value = newResult;`);
|
|
1855
|
+
doc.write(`return payload;`);
|
|
1856
|
+
const fn = doc.compile();
|
|
1857
|
+
return (payload, ctx) => fn(shape, payload, ctx);
|
|
1858
|
+
};
|
|
1859
|
+
let fastpass;
|
|
1860
|
+
const isObject$1 = isObject;
|
|
1861
|
+
const jit = !globalConfig.jitless;
|
|
1862
|
+
const allowsEval$1 = allowsEval;
|
|
1863
|
+
const fastEnabled = jit && allowsEval$1.value;
|
|
1864
|
+
const catchall = def.catchall;
|
|
1865
|
+
let value;
|
|
1866
|
+
inst._zod.parse = (payload, ctx) => {
|
|
1867
|
+
value ?? (value = _normalized.value);
|
|
1868
|
+
const input = payload.value;
|
|
1869
|
+
if (!isObject$1(input)) {
|
|
1870
|
+
payload.issues.push({
|
|
1871
|
+
expected: "object",
|
|
1872
|
+
code: "invalid_type",
|
|
1873
|
+
input,
|
|
1874
|
+
inst
|
|
1875
|
+
});
|
|
1876
|
+
return payload;
|
|
1877
|
+
}
|
|
1878
|
+
if (jit && fastEnabled && ctx?.async === false && ctx.jitless !== true) {
|
|
1879
|
+
if (!fastpass)
|
|
1880
|
+
fastpass = generateFastpass(def.shape);
|
|
1881
|
+
payload = fastpass(payload, ctx);
|
|
1882
|
+
if (!catchall)
|
|
1883
|
+
return payload;
|
|
1884
|
+
return handleCatchall([], input, payload, ctx, value, inst);
|
|
1885
|
+
}
|
|
1886
|
+
return superParse(payload, ctx);
|
|
1887
|
+
};
|
|
1888
|
+
});
|
|
1889
|
+
function handleUnionResults(results, final, inst, ctx) {
|
|
1890
|
+
for (const result of results) {
|
|
1891
|
+
if (result.issues.length === 0) {
|
|
1892
|
+
final.value = result.value;
|
|
1893
|
+
return final;
|
|
1894
|
+
}
|
|
1895
|
+
}
|
|
1896
|
+
const nonaborted = results.filter((r) => !aborted(r));
|
|
1897
|
+
if (nonaborted.length === 1) {
|
|
1898
|
+
final.value = nonaborted[0].value;
|
|
1899
|
+
return nonaborted[0];
|
|
1900
|
+
}
|
|
1901
|
+
final.issues.push({
|
|
1902
|
+
code: "invalid_union",
|
|
1903
|
+
input: final.value,
|
|
1904
|
+
inst,
|
|
1905
|
+
errors: results.map((result) => result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
1906
|
+
});
|
|
1907
|
+
return final;
|
|
1908
|
+
}
|
|
1909
|
+
const $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
|
|
1910
|
+
$ZodType.init(inst, def);
|
|
1911
|
+
defineLazy(inst._zod, "optin", () => def.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0);
|
|
1912
|
+
defineLazy(inst._zod, "optout", () => def.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0);
|
|
1913
|
+
defineLazy(inst._zod, "values", () => {
|
|
1914
|
+
if (def.options.every((o) => o._zod.values)) {
|
|
1915
|
+
return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));
|
|
1916
|
+
}
|
|
1917
|
+
return void 0;
|
|
1918
|
+
});
|
|
1919
|
+
defineLazy(inst._zod, "pattern", () => {
|
|
1920
|
+
if (def.options.every((o) => o._zod.pattern)) {
|
|
1921
|
+
const patterns = def.options.map((o) => o._zod.pattern);
|
|
1922
|
+
return new RegExp(`^(${patterns.map((p) => cleanRegex(p.source)).join("|")})$`);
|
|
1923
|
+
}
|
|
1924
|
+
return void 0;
|
|
1925
|
+
});
|
|
1926
|
+
const first = def.options.length === 1 ? def.options[0]._zod.run : null;
|
|
1927
|
+
inst._zod.parse = (payload, ctx) => {
|
|
1928
|
+
if (first) {
|
|
1929
|
+
return first(payload, ctx);
|
|
1930
|
+
}
|
|
1931
|
+
let async = false;
|
|
1932
|
+
const results = [];
|
|
1933
|
+
for (const option of def.options) {
|
|
1934
|
+
const result = option._zod.run({
|
|
1935
|
+
value: payload.value,
|
|
1936
|
+
issues: []
|
|
1937
|
+
}, ctx);
|
|
1938
|
+
if (result instanceof Promise) {
|
|
1939
|
+
results.push(result);
|
|
1940
|
+
async = true;
|
|
1941
|
+
} else {
|
|
1942
|
+
if (result.issues.length === 0)
|
|
1943
|
+
return result;
|
|
1944
|
+
results.push(result);
|
|
1945
|
+
}
|
|
1946
|
+
}
|
|
1947
|
+
if (!async)
|
|
1948
|
+
return handleUnionResults(results, payload, inst, ctx);
|
|
1949
|
+
return Promise.all(results).then((results2) => {
|
|
1950
|
+
return handleUnionResults(results2, payload, inst, ctx);
|
|
1951
|
+
});
|
|
1952
|
+
};
|
|
1953
|
+
});
|
|
1954
|
+
const $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnion", (inst, def) => {
|
|
1955
|
+
def.inclusive = false;
|
|
1956
|
+
$ZodUnion.init(inst, def);
|
|
1957
|
+
const _super = inst._zod.parse;
|
|
1958
|
+
defineLazy(inst._zod, "propValues", () => {
|
|
1959
|
+
const propValues = {};
|
|
1960
|
+
for (const option of def.options) {
|
|
1961
|
+
const pv = option._zod.propValues;
|
|
1962
|
+
if (!pv || Object.keys(pv).length === 0)
|
|
1963
|
+
throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
|
|
1964
|
+
for (const [k, v] of Object.entries(pv)) {
|
|
1965
|
+
if (!propValues[k])
|
|
1966
|
+
propValues[k] = /* @__PURE__ */ new Set();
|
|
1967
|
+
for (const val of v) {
|
|
1968
|
+
propValues[k].add(val);
|
|
1969
|
+
}
|
|
1970
|
+
}
|
|
1971
|
+
}
|
|
1972
|
+
return propValues;
|
|
1973
|
+
});
|
|
1974
|
+
const disc = cached(() => {
|
|
1975
|
+
const opts = def.options;
|
|
1976
|
+
const map = /* @__PURE__ */ new Map();
|
|
1977
|
+
for (const o of opts) {
|
|
1978
|
+
const values = o._zod.propValues?.[def.discriminator];
|
|
1979
|
+
if (!values || values.size === 0)
|
|
1980
|
+
throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o)}"`);
|
|
1981
|
+
for (const v of values) {
|
|
1982
|
+
if (map.has(v)) {
|
|
1983
|
+
throw new Error(`Duplicate discriminator value "${String(v)}"`);
|
|
1984
|
+
}
|
|
1985
|
+
map.set(v, o);
|
|
1986
|
+
}
|
|
1987
|
+
}
|
|
1988
|
+
return map;
|
|
1989
|
+
});
|
|
1990
|
+
inst._zod.parse = (payload, ctx) => {
|
|
1991
|
+
const input = payload.value;
|
|
1992
|
+
if (!isObject(input)) {
|
|
1993
|
+
payload.issues.push({
|
|
1994
|
+
code: "invalid_type",
|
|
1995
|
+
expected: "object",
|
|
1996
|
+
input,
|
|
1997
|
+
inst
|
|
1998
|
+
});
|
|
1999
|
+
return payload;
|
|
2000
|
+
}
|
|
2001
|
+
const opt = disc.value.get(input?.[def.discriminator]);
|
|
2002
|
+
if (opt) {
|
|
2003
|
+
return opt._zod.run(payload, ctx);
|
|
2004
|
+
}
|
|
2005
|
+
if (def.unionFallback || ctx.direction === "backward") {
|
|
2006
|
+
return _super(payload, ctx);
|
|
2007
|
+
}
|
|
2008
|
+
payload.issues.push({
|
|
2009
|
+
code: "invalid_union",
|
|
2010
|
+
errors: [],
|
|
2011
|
+
note: "No matching discriminator",
|
|
2012
|
+
discriminator: def.discriminator,
|
|
2013
|
+
options: Array.from(disc.value.keys()),
|
|
2014
|
+
input,
|
|
2015
|
+
path: [def.discriminator],
|
|
2016
|
+
inst
|
|
2017
|
+
});
|
|
2018
|
+
return payload;
|
|
2019
|
+
};
|
|
2020
|
+
});
|
|
2021
|
+
const $ZodIntersection = /* @__PURE__ */ $constructor("$ZodIntersection", (inst, def) => {
|
|
2022
|
+
$ZodType.init(inst, def);
|
|
2023
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2024
|
+
const input = payload.value;
|
|
2025
|
+
const left = def.left._zod.run({ value: input, issues: [] }, ctx);
|
|
2026
|
+
const right = def.right._zod.run({ value: input, issues: [] }, ctx);
|
|
2027
|
+
const async = left instanceof Promise || right instanceof Promise;
|
|
2028
|
+
if (async) {
|
|
2029
|
+
return Promise.all([left, right]).then(([left2, right2]) => {
|
|
2030
|
+
return handleIntersectionResults(payload, left2, right2);
|
|
2031
|
+
});
|
|
2032
|
+
}
|
|
2033
|
+
return handleIntersectionResults(payload, left, right);
|
|
2034
|
+
};
|
|
2035
|
+
});
|
|
2036
|
+
function mergeValues(a, b) {
|
|
2037
|
+
if (a === b) {
|
|
2038
|
+
return { valid: true, data: a };
|
|
2039
|
+
}
|
|
2040
|
+
if (a instanceof Date && b instanceof Date && +a === +b) {
|
|
2041
|
+
return { valid: true, data: a };
|
|
2042
|
+
}
|
|
2043
|
+
if (isPlainObject(a) && isPlainObject(b)) {
|
|
2044
|
+
const bKeys = Object.keys(b);
|
|
2045
|
+
const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);
|
|
2046
|
+
const newObj = { ...a, ...b };
|
|
2047
|
+
for (const key of sharedKeys) {
|
|
2048
|
+
const sharedValue = mergeValues(a[key], b[key]);
|
|
2049
|
+
if (!sharedValue.valid) {
|
|
2050
|
+
return {
|
|
2051
|
+
valid: false,
|
|
2052
|
+
mergeErrorPath: [key, ...sharedValue.mergeErrorPath]
|
|
2053
|
+
};
|
|
2054
|
+
}
|
|
2055
|
+
newObj[key] = sharedValue.data;
|
|
2056
|
+
}
|
|
2057
|
+
return { valid: true, data: newObj };
|
|
2058
|
+
}
|
|
2059
|
+
if (Array.isArray(a) && Array.isArray(b)) {
|
|
2060
|
+
if (a.length !== b.length) {
|
|
2061
|
+
return { valid: false, mergeErrorPath: [] };
|
|
2062
|
+
}
|
|
2063
|
+
const newArray = [];
|
|
2064
|
+
for (let index = 0; index < a.length; index++) {
|
|
2065
|
+
const itemA = a[index];
|
|
2066
|
+
const itemB = b[index];
|
|
2067
|
+
const sharedValue = mergeValues(itemA, itemB);
|
|
2068
|
+
if (!sharedValue.valid) {
|
|
2069
|
+
return {
|
|
2070
|
+
valid: false,
|
|
2071
|
+
mergeErrorPath: [index, ...sharedValue.mergeErrorPath]
|
|
2072
|
+
};
|
|
2073
|
+
}
|
|
2074
|
+
newArray.push(sharedValue.data);
|
|
2075
|
+
}
|
|
2076
|
+
return { valid: true, data: newArray };
|
|
2077
|
+
}
|
|
2078
|
+
return { valid: false, mergeErrorPath: [] };
|
|
2079
|
+
}
|
|
2080
|
+
function handleIntersectionResults(result, left, right) {
|
|
2081
|
+
const unrecKeys = /* @__PURE__ */ new Map();
|
|
2082
|
+
let unrecIssue;
|
|
2083
|
+
for (const iss of left.issues) {
|
|
2084
|
+
if (iss.code === "unrecognized_keys") {
|
|
2085
|
+
unrecIssue ?? (unrecIssue = iss);
|
|
2086
|
+
for (const k of iss.keys) {
|
|
2087
|
+
if (!unrecKeys.has(k))
|
|
2088
|
+
unrecKeys.set(k, {});
|
|
2089
|
+
unrecKeys.get(k).l = true;
|
|
2090
|
+
}
|
|
2091
|
+
} else {
|
|
2092
|
+
result.issues.push(iss);
|
|
2093
|
+
}
|
|
2094
|
+
}
|
|
2095
|
+
for (const iss of right.issues) {
|
|
2096
|
+
if (iss.code === "unrecognized_keys") {
|
|
2097
|
+
for (const k of iss.keys) {
|
|
2098
|
+
if (!unrecKeys.has(k))
|
|
2099
|
+
unrecKeys.set(k, {});
|
|
2100
|
+
unrecKeys.get(k).r = true;
|
|
2101
|
+
}
|
|
2102
|
+
} else {
|
|
2103
|
+
result.issues.push(iss);
|
|
2104
|
+
}
|
|
2105
|
+
}
|
|
2106
|
+
const bothKeys = [...unrecKeys].filter(([, f]) => f.l && f.r).map(([k]) => k);
|
|
2107
|
+
if (bothKeys.length && unrecIssue) {
|
|
2108
|
+
result.issues.push({ ...unrecIssue, keys: bothKeys });
|
|
2109
|
+
}
|
|
2110
|
+
if (aborted(result))
|
|
2111
|
+
return result;
|
|
2112
|
+
const merged = mergeValues(left.value, right.value);
|
|
2113
|
+
if (!merged.valid) {
|
|
2114
|
+
throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(merged.mergeErrorPath)}`);
|
|
2115
|
+
}
|
|
2116
|
+
result.value = merged.data;
|
|
2117
|
+
return result;
|
|
2118
|
+
}
|
|
2119
|
+
const $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
|
|
2120
|
+
$ZodType.init(inst, def);
|
|
2121
|
+
const values = getEnumValues(def.entries);
|
|
2122
|
+
const valuesSet = new Set(values);
|
|
2123
|
+
inst._zod.values = valuesSet;
|
|
2124
|
+
inst._zod.pattern = new RegExp(`^(${values.filter((k) => propertyKeyTypes.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex(o) : o.toString()).join("|")})$`);
|
|
2125
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
2126
|
+
const input = payload.value;
|
|
2127
|
+
if (valuesSet.has(input)) {
|
|
2128
|
+
return payload;
|
|
2129
|
+
}
|
|
2130
|
+
payload.issues.push({
|
|
2131
|
+
code: "invalid_value",
|
|
2132
|
+
values,
|
|
2133
|
+
input,
|
|
2134
|
+
inst
|
|
2135
|
+
});
|
|
2136
|
+
return payload;
|
|
2137
|
+
};
|
|
2138
|
+
});
|
|
2139
|
+
const $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
|
|
2140
|
+
$ZodType.init(inst, def);
|
|
2141
|
+
if (def.values.length === 0) {
|
|
2142
|
+
throw new Error("Cannot create literal schema with no valid values");
|
|
2143
|
+
}
|
|
2144
|
+
const values = new Set(def.values);
|
|
2145
|
+
inst._zod.values = values;
|
|
2146
|
+
inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$`);
|
|
2147
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
2148
|
+
const input = payload.value;
|
|
2149
|
+
if (values.has(input)) {
|
|
2150
|
+
return payload;
|
|
2151
|
+
}
|
|
2152
|
+
payload.issues.push({
|
|
2153
|
+
code: "invalid_value",
|
|
2154
|
+
values: def.values,
|
|
2155
|
+
input,
|
|
2156
|
+
inst
|
|
2157
|
+
});
|
|
2158
|
+
return payload;
|
|
2159
|
+
};
|
|
2160
|
+
});
|
|
2161
|
+
const $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) => {
|
|
2162
|
+
$ZodType.init(inst, def);
|
|
2163
|
+
inst._zod.optin = "optional";
|
|
2164
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2165
|
+
if (ctx.direction === "backward") {
|
|
2166
|
+
throw new $ZodEncodeError(inst.constructor.name);
|
|
2167
|
+
}
|
|
2168
|
+
const _out = def.transform(payload.value, payload);
|
|
2169
|
+
if (ctx.async) {
|
|
2170
|
+
const output = _out instanceof Promise ? _out : Promise.resolve(_out);
|
|
2171
|
+
return output.then((output2) => {
|
|
2172
|
+
payload.value = output2;
|
|
2173
|
+
payload.fallback = true;
|
|
2174
|
+
return payload;
|
|
2175
|
+
});
|
|
2176
|
+
}
|
|
2177
|
+
if (_out instanceof Promise) {
|
|
2178
|
+
throw new $ZodAsyncError();
|
|
2179
|
+
}
|
|
2180
|
+
payload.value = _out;
|
|
2181
|
+
payload.fallback = true;
|
|
2182
|
+
return payload;
|
|
2183
|
+
};
|
|
2184
|
+
});
|
|
2185
|
+
function handleOptionalResult(result, input) {
|
|
2186
|
+
if (input === void 0 && (result.issues.length || result.fallback)) {
|
|
2187
|
+
return { issues: [], value: void 0 };
|
|
2188
|
+
}
|
|
2189
|
+
return result;
|
|
2190
|
+
}
|
|
2191
|
+
const $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
|
|
2192
|
+
$ZodType.init(inst, def);
|
|
2193
|
+
inst._zod.optin = "optional";
|
|
2194
|
+
inst._zod.optout = "optional";
|
|
2195
|
+
defineLazy(inst._zod, "values", () => {
|
|
2196
|
+
return def.innerType._zod.values ? /* @__PURE__ */ new Set([...def.innerType._zod.values, void 0]) : void 0;
|
|
2197
|
+
});
|
|
2198
|
+
defineLazy(inst._zod, "pattern", () => {
|
|
2199
|
+
const pattern = def.innerType._zod.pattern;
|
|
2200
|
+
return pattern ? new RegExp(`^(${cleanRegex(pattern.source)})?$`) : void 0;
|
|
2201
|
+
});
|
|
2202
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2203
|
+
if (def.innerType._zod.optin === "optional") {
|
|
2204
|
+
const input = payload.value;
|
|
2205
|
+
const result = def.innerType._zod.run(payload, ctx);
|
|
2206
|
+
if (result instanceof Promise)
|
|
2207
|
+
return result.then((r) => handleOptionalResult(r, input));
|
|
2208
|
+
return handleOptionalResult(result, input);
|
|
2209
|
+
}
|
|
2210
|
+
if (payload.value === void 0) {
|
|
2211
|
+
return payload;
|
|
2212
|
+
}
|
|
2213
|
+
return def.innerType._zod.run(payload, ctx);
|
|
2214
|
+
};
|
|
2215
|
+
});
|
|
2216
|
+
const $ZodExactOptional = /* @__PURE__ */ $constructor("$ZodExactOptional", (inst, def) => {
|
|
2217
|
+
$ZodOptional.init(inst, def);
|
|
2218
|
+
defineLazy(inst._zod, "values", () => def.innerType._zod.values);
|
|
2219
|
+
defineLazy(inst._zod, "pattern", () => def.innerType._zod.pattern);
|
|
2220
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2221
|
+
return def.innerType._zod.run(payload, ctx);
|
|
2222
|
+
};
|
|
2223
|
+
});
|
|
2224
|
+
const $ZodNullable = /* @__PURE__ */ $constructor("$ZodNullable", (inst, def) => {
|
|
2225
|
+
$ZodType.init(inst, def);
|
|
2226
|
+
defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
|
|
2227
|
+
defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
|
|
2228
|
+
defineLazy(inst._zod, "pattern", () => {
|
|
2229
|
+
const pattern = def.innerType._zod.pattern;
|
|
2230
|
+
return pattern ? new RegExp(`^(${cleanRegex(pattern.source)}|null)$`) : void 0;
|
|
2231
|
+
});
|
|
2232
|
+
defineLazy(inst._zod, "values", () => {
|
|
2233
|
+
return def.innerType._zod.values ? /* @__PURE__ */ new Set([...def.innerType._zod.values, null]) : void 0;
|
|
2234
|
+
});
|
|
2235
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2236
|
+
if (payload.value === null)
|
|
2237
|
+
return payload;
|
|
2238
|
+
return def.innerType._zod.run(payload, ctx);
|
|
2239
|
+
};
|
|
2240
|
+
});
|
|
2241
|
+
const $ZodDefault = /* @__PURE__ */ $constructor("$ZodDefault", (inst, def) => {
|
|
2242
|
+
$ZodType.init(inst, def);
|
|
2243
|
+
inst._zod.optin = "optional";
|
|
2244
|
+
defineLazy(inst._zod, "values", () => def.innerType._zod.values);
|
|
2245
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2246
|
+
if (ctx.direction === "backward") {
|
|
2247
|
+
return def.innerType._zod.run(payload, ctx);
|
|
2248
|
+
}
|
|
2249
|
+
if (payload.value === void 0) {
|
|
2250
|
+
payload.value = def.defaultValue;
|
|
2251
|
+
return payload;
|
|
2252
|
+
}
|
|
2253
|
+
const result = def.innerType._zod.run(payload, ctx);
|
|
2254
|
+
if (result instanceof Promise) {
|
|
2255
|
+
return result.then((result2) => handleDefaultResult(result2, def));
|
|
2256
|
+
}
|
|
2257
|
+
return handleDefaultResult(result, def);
|
|
2258
|
+
};
|
|
2259
|
+
});
|
|
2260
|
+
function handleDefaultResult(payload, def) {
|
|
2261
|
+
if (payload.value === void 0) {
|
|
2262
|
+
payload.value = def.defaultValue;
|
|
2263
|
+
}
|
|
2264
|
+
return payload;
|
|
2265
|
+
}
|
|
2266
|
+
const $ZodPrefault = /* @__PURE__ */ $constructor("$ZodPrefault", (inst, def) => {
|
|
2267
|
+
$ZodType.init(inst, def);
|
|
2268
|
+
inst._zod.optin = "optional";
|
|
2269
|
+
defineLazy(inst._zod, "values", () => def.innerType._zod.values);
|
|
2270
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2271
|
+
if (ctx.direction === "backward") {
|
|
2272
|
+
return def.innerType._zod.run(payload, ctx);
|
|
2273
|
+
}
|
|
2274
|
+
if (payload.value === void 0) {
|
|
2275
|
+
payload.value = def.defaultValue;
|
|
2276
|
+
}
|
|
2277
|
+
return def.innerType._zod.run(payload, ctx);
|
|
2278
|
+
};
|
|
2279
|
+
});
|
|
2280
|
+
const $ZodNonOptional = /* @__PURE__ */ $constructor("$ZodNonOptional", (inst, def) => {
|
|
2281
|
+
$ZodType.init(inst, def);
|
|
2282
|
+
defineLazy(inst._zod, "values", () => {
|
|
2283
|
+
const v = def.innerType._zod.values;
|
|
2284
|
+
return v ? new Set([...v].filter((x) => x !== void 0)) : void 0;
|
|
2285
|
+
});
|
|
2286
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2287
|
+
const result = def.innerType._zod.run(payload, ctx);
|
|
2288
|
+
if (result instanceof Promise) {
|
|
2289
|
+
return result.then((result2) => handleNonOptionalResult(result2, inst));
|
|
2290
|
+
}
|
|
2291
|
+
return handleNonOptionalResult(result, inst);
|
|
2292
|
+
};
|
|
2293
|
+
});
|
|
2294
|
+
function handleNonOptionalResult(payload, inst) {
|
|
2295
|
+
if (!payload.issues.length && payload.value === void 0) {
|
|
2296
|
+
payload.issues.push({
|
|
2297
|
+
code: "invalid_type",
|
|
2298
|
+
expected: "nonoptional",
|
|
2299
|
+
input: payload.value,
|
|
2300
|
+
inst
|
|
2301
|
+
});
|
|
2302
|
+
}
|
|
2303
|
+
return payload;
|
|
2304
|
+
}
|
|
2305
|
+
const $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => {
|
|
2306
|
+
$ZodType.init(inst, def);
|
|
2307
|
+
inst._zod.optin = "optional";
|
|
2308
|
+
defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
|
|
2309
|
+
defineLazy(inst._zod, "values", () => def.innerType._zod.values);
|
|
2310
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2311
|
+
if (ctx.direction === "backward") {
|
|
2312
|
+
return def.innerType._zod.run(payload, ctx);
|
|
2313
|
+
}
|
|
2314
|
+
const result = def.innerType._zod.run(payload, ctx);
|
|
2315
|
+
if (result instanceof Promise) {
|
|
2316
|
+
return result.then((result2) => {
|
|
2317
|
+
payload.value = result2.value;
|
|
2318
|
+
if (result2.issues.length) {
|
|
2319
|
+
payload.value = def.catchValue({
|
|
2320
|
+
...payload,
|
|
2321
|
+
error: {
|
|
2322
|
+
issues: result2.issues.map((iss) => finalizeIssue(iss, ctx, config()))
|
|
2323
|
+
},
|
|
2324
|
+
input: payload.value
|
|
2325
|
+
});
|
|
2326
|
+
payload.issues = [];
|
|
2327
|
+
payload.fallback = true;
|
|
2328
|
+
}
|
|
2329
|
+
return payload;
|
|
2330
|
+
});
|
|
2331
|
+
}
|
|
2332
|
+
payload.value = result.value;
|
|
2333
|
+
if (result.issues.length) {
|
|
2334
|
+
payload.value = def.catchValue({
|
|
2335
|
+
...payload,
|
|
2336
|
+
error: {
|
|
2337
|
+
issues: result.issues.map((iss) => finalizeIssue(iss, ctx, config()))
|
|
2338
|
+
},
|
|
2339
|
+
input: payload.value
|
|
2340
|
+
});
|
|
2341
|
+
payload.issues = [];
|
|
2342
|
+
payload.fallback = true;
|
|
2343
|
+
}
|
|
2344
|
+
return payload;
|
|
2345
|
+
};
|
|
2346
|
+
});
|
|
2347
|
+
const $ZodPipe = /* @__PURE__ */ $constructor("$ZodPipe", (inst, def) => {
|
|
2348
|
+
$ZodType.init(inst, def);
|
|
2349
|
+
defineLazy(inst._zod, "values", () => def.in._zod.values);
|
|
2350
|
+
defineLazy(inst._zod, "optin", () => def.in._zod.optin);
|
|
2351
|
+
defineLazy(inst._zod, "optout", () => def.out._zod.optout);
|
|
2352
|
+
defineLazy(inst._zod, "propValues", () => def.in._zod.propValues);
|
|
2353
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2354
|
+
if (ctx.direction === "backward") {
|
|
2355
|
+
const right = def.out._zod.run(payload, ctx);
|
|
2356
|
+
if (right instanceof Promise) {
|
|
2357
|
+
return right.then((right2) => handlePipeResult(right2, def.in, ctx));
|
|
2358
|
+
}
|
|
2359
|
+
return handlePipeResult(right, def.in, ctx);
|
|
2360
|
+
}
|
|
2361
|
+
const left = def.in._zod.run(payload, ctx);
|
|
2362
|
+
if (left instanceof Promise) {
|
|
2363
|
+
return left.then((left2) => handlePipeResult(left2, def.out, ctx));
|
|
2364
|
+
}
|
|
2365
|
+
return handlePipeResult(left, def.out, ctx);
|
|
2366
|
+
};
|
|
2367
|
+
});
|
|
2368
|
+
function handlePipeResult(left, next, ctx) {
|
|
2369
|
+
if (left.issues.length) {
|
|
2370
|
+
left.aborted = true;
|
|
2371
|
+
return left;
|
|
2372
|
+
}
|
|
2373
|
+
return next._zod.run({ value: left.value, issues: left.issues, fallback: left.fallback }, ctx);
|
|
2374
|
+
}
|
|
2375
|
+
const $ZodReadonly = /* @__PURE__ */ $constructor("$ZodReadonly", (inst, def) => {
|
|
2376
|
+
$ZodType.init(inst, def);
|
|
2377
|
+
defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues);
|
|
2378
|
+
defineLazy(inst._zod, "values", () => def.innerType._zod.values);
|
|
2379
|
+
defineLazy(inst._zod, "optin", () => def.innerType?._zod?.optin);
|
|
2380
|
+
defineLazy(inst._zod, "optout", () => def.innerType?._zod?.optout);
|
|
2381
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2382
|
+
if (ctx.direction === "backward") {
|
|
2383
|
+
return def.innerType._zod.run(payload, ctx);
|
|
2384
|
+
}
|
|
2385
|
+
const result = def.innerType._zod.run(payload, ctx);
|
|
2386
|
+
if (result instanceof Promise) {
|
|
2387
|
+
return result.then(handleReadonlyResult);
|
|
2388
|
+
}
|
|
2389
|
+
return handleReadonlyResult(result);
|
|
2390
|
+
};
|
|
2391
|
+
});
|
|
2392
|
+
function handleReadonlyResult(payload) {
|
|
2393
|
+
payload.value = Object.freeze(payload.value);
|
|
2394
|
+
return payload;
|
|
2395
|
+
}
|
|
2396
|
+
const $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => {
|
|
2397
|
+
$ZodCheck.init(inst, def);
|
|
2398
|
+
$ZodType.init(inst, def);
|
|
2399
|
+
inst._zod.parse = (payload, _) => {
|
|
2400
|
+
return payload;
|
|
2401
|
+
};
|
|
2402
|
+
inst._zod.check = (payload) => {
|
|
2403
|
+
const input = payload.value;
|
|
2404
|
+
const r = def.fn(input);
|
|
2405
|
+
if (r instanceof Promise) {
|
|
2406
|
+
return r.then((r2) => handleRefineResult(r2, payload, input, inst));
|
|
2407
|
+
}
|
|
2408
|
+
handleRefineResult(r, payload, input, inst);
|
|
2409
|
+
return;
|
|
2410
|
+
};
|
|
2411
|
+
});
|
|
2412
|
+
function handleRefineResult(result, payload, input, inst) {
|
|
2413
|
+
if (!result) {
|
|
2414
|
+
const _iss = {
|
|
2415
|
+
code: "custom",
|
|
2416
|
+
input,
|
|
2417
|
+
inst,
|
|
2418
|
+
// incorporates params.error into issue reporting
|
|
2419
|
+
path: [...inst._zod.def.path ?? []],
|
|
2420
|
+
// incorporates params.error into issue reporting
|
|
2421
|
+
continue: !inst._zod.def.abort
|
|
2422
|
+
// params: inst._zod.def.params,
|
|
2423
|
+
};
|
|
2424
|
+
if (inst._zod.def.params)
|
|
2425
|
+
_iss.params = inst._zod.def.params;
|
|
2426
|
+
payload.issues.push(issue(_iss));
|
|
2427
|
+
}
|
|
2428
|
+
}
|
|
2429
|
+
var _a;
|
|
2430
|
+
class $ZodRegistry {
|
|
2431
|
+
constructor() {
|
|
2432
|
+
this._map = /* @__PURE__ */ new WeakMap();
|
|
2433
|
+
this._idmap = /* @__PURE__ */ new Map();
|
|
2434
|
+
}
|
|
2435
|
+
add(schema, ..._meta) {
|
|
2436
|
+
const meta = _meta[0];
|
|
2437
|
+
this._map.set(schema, meta);
|
|
2438
|
+
if (meta && typeof meta === "object" && "id" in meta) {
|
|
2439
|
+
this._idmap.set(meta.id, schema);
|
|
2440
|
+
}
|
|
2441
|
+
return this;
|
|
2442
|
+
}
|
|
2443
|
+
clear() {
|
|
2444
|
+
this._map = /* @__PURE__ */ new WeakMap();
|
|
2445
|
+
this._idmap = /* @__PURE__ */ new Map();
|
|
2446
|
+
return this;
|
|
2447
|
+
}
|
|
2448
|
+
remove(schema) {
|
|
2449
|
+
const meta = this._map.get(schema);
|
|
2450
|
+
if (meta && typeof meta === "object" && "id" in meta) {
|
|
2451
|
+
this._idmap.delete(meta.id);
|
|
2452
|
+
}
|
|
2453
|
+
this._map.delete(schema);
|
|
2454
|
+
return this;
|
|
2455
|
+
}
|
|
2456
|
+
get(schema) {
|
|
2457
|
+
const p = schema._zod.parent;
|
|
2458
|
+
if (p) {
|
|
2459
|
+
const pm = { ...this.get(p) ?? {} };
|
|
2460
|
+
delete pm.id;
|
|
2461
|
+
const f = { ...pm, ...this._map.get(schema) };
|
|
2462
|
+
return Object.keys(f).length ? f : void 0;
|
|
2463
|
+
}
|
|
2464
|
+
return this._map.get(schema);
|
|
2465
|
+
}
|
|
2466
|
+
has(schema) {
|
|
2467
|
+
return this._map.has(schema);
|
|
2468
|
+
}
|
|
2469
|
+
}
|
|
2470
|
+
function registry() {
|
|
2471
|
+
return new $ZodRegistry();
|
|
2472
|
+
}
|
|
2473
|
+
(_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
|
|
2474
|
+
const globalRegistry = globalThis.__zod_globalRegistry;
|
|
2475
|
+
// @__NO_SIDE_EFFECTS__
|
|
2476
|
+
function _string(Class, params) {
|
|
2477
|
+
return new Class({
|
|
2478
|
+
type: "string",
|
|
2479
|
+
...normalizeParams(params)
|
|
2480
|
+
});
|
|
2481
|
+
}
|
|
2482
|
+
// @__NO_SIDE_EFFECTS__
|
|
2483
|
+
function _email(Class, params) {
|
|
2484
|
+
return new Class({
|
|
2485
|
+
type: "string",
|
|
2486
|
+
format: "email",
|
|
2487
|
+
check: "string_format",
|
|
2488
|
+
abort: false,
|
|
2489
|
+
...normalizeParams(params)
|
|
2490
|
+
});
|
|
2491
|
+
}
|
|
2492
|
+
// @__NO_SIDE_EFFECTS__
|
|
2493
|
+
function _guid(Class, params) {
|
|
2494
|
+
return new Class({
|
|
2495
|
+
type: "string",
|
|
2496
|
+
format: "guid",
|
|
2497
|
+
check: "string_format",
|
|
2498
|
+
abort: false,
|
|
2499
|
+
...normalizeParams(params)
|
|
2500
|
+
});
|
|
2501
|
+
}
|
|
2502
|
+
// @__NO_SIDE_EFFECTS__
|
|
2503
|
+
function _uuid(Class, params) {
|
|
2504
|
+
return new Class({
|
|
2505
|
+
type: "string",
|
|
2506
|
+
format: "uuid",
|
|
2507
|
+
check: "string_format",
|
|
2508
|
+
abort: false,
|
|
2509
|
+
...normalizeParams(params)
|
|
2510
|
+
});
|
|
2511
|
+
}
|
|
2512
|
+
// @__NO_SIDE_EFFECTS__
|
|
2513
|
+
function _uuidv4(Class, params) {
|
|
2514
|
+
return new Class({
|
|
2515
|
+
type: "string",
|
|
2516
|
+
format: "uuid",
|
|
2517
|
+
check: "string_format",
|
|
2518
|
+
abort: false,
|
|
2519
|
+
version: "v4",
|
|
2520
|
+
...normalizeParams(params)
|
|
2521
|
+
});
|
|
2522
|
+
}
|
|
2523
|
+
// @__NO_SIDE_EFFECTS__
|
|
2524
|
+
function _uuidv6(Class, params) {
|
|
2525
|
+
return new Class({
|
|
2526
|
+
type: "string",
|
|
2527
|
+
format: "uuid",
|
|
2528
|
+
check: "string_format",
|
|
2529
|
+
abort: false,
|
|
2530
|
+
version: "v6",
|
|
2531
|
+
...normalizeParams(params)
|
|
2532
|
+
});
|
|
2533
|
+
}
|
|
2534
|
+
// @__NO_SIDE_EFFECTS__
|
|
2535
|
+
function _uuidv7(Class, params) {
|
|
2536
|
+
return new Class({
|
|
2537
|
+
type: "string",
|
|
2538
|
+
format: "uuid",
|
|
2539
|
+
check: "string_format",
|
|
2540
|
+
abort: false,
|
|
2541
|
+
version: "v7",
|
|
2542
|
+
...normalizeParams(params)
|
|
2543
|
+
});
|
|
2544
|
+
}
|
|
2545
|
+
// @__NO_SIDE_EFFECTS__
|
|
2546
|
+
function _url(Class, params) {
|
|
2547
|
+
return new Class({
|
|
2548
|
+
type: "string",
|
|
2549
|
+
format: "url",
|
|
2550
|
+
check: "string_format",
|
|
2551
|
+
abort: false,
|
|
2552
|
+
...normalizeParams(params)
|
|
2553
|
+
});
|
|
2554
|
+
}
|
|
2555
|
+
// @__NO_SIDE_EFFECTS__
|
|
2556
|
+
function _emoji(Class, params) {
|
|
2557
|
+
return new Class({
|
|
2558
|
+
type: "string",
|
|
2559
|
+
format: "emoji",
|
|
2560
|
+
check: "string_format",
|
|
2561
|
+
abort: false,
|
|
2562
|
+
...normalizeParams(params)
|
|
2563
|
+
});
|
|
2564
|
+
}
|
|
2565
|
+
// @__NO_SIDE_EFFECTS__
|
|
2566
|
+
function _nanoid(Class, params) {
|
|
2567
|
+
return new Class({
|
|
2568
|
+
type: "string",
|
|
2569
|
+
format: "nanoid",
|
|
2570
|
+
check: "string_format",
|
|
2571
|
+
abort: false,
|
|
2572
|
+
...normalizeParams(params)
|
|
2573
|
+
});
|
|
2574
|
+
}
|
|
2575
|
+
// @__NO_SIDE_EFFECTS__
|
|
2576
|
+
function _cuid(Class, params) {
|
|
2577
|
+
return new Class({
|
|
2578
|
+
type: "string",
|
|
2579
|
+
format: "cuid",
|
|
2580
|
+
check: "string_format",
|
|
2581
|
+
abort: false,
|
|
2582
|
+
...normalizeParams(params)
|
|
2583
|
+
});
|
|
2584
|
+
}
|
|
2585
|
+
// @__NO_SIDE_EFFECTS__
|
|
2586
|
+
function _cuid2(Class, params) {
|
|
2587
|
+
return new Class({
|
|
2588
|
+
type: "string",
|
|
2589
|
+
format: "cuid2",
|
|
2590
|
+
check: "string_format",
|
|
2591
|
+
abort: false,
|
|
2592
|
+
...normalizeParams(params)
|
|
2593
|
+
});
|
|
2594
|
+
}
|
|
2595
|
+
// @__NO_SIDE_EFFECTS__
|
|
2596
|
+
function _ulid(Class, params) {
|
|
2597
|
+
return new Class({
|
|
2598
|
+
type: "string",
|
|
2599
|
+
format: "ulid",
|
|
2600
|
+
check: "string_format",
|
|
2601
|
+
abort: false,
|
|
2602
|
+
...normalizeParams(params)
|
|
2603
|
+
});
|
|
2604
|
+
}
|
|
2605
|
+
// @__NO_SIDE_EFFECTS__
|
|
2606
|
+
function _xid(Class, params) {
|
|
2607
|
+
return new Class({
|
|
2608
|
+
type: "string",
|
|
2609
|
+
format: "xid",
|
|
2610
|
+
check: "string_format",
|
|
2611
|
+
abort: false,
|
|
2612
|
+
...normalizeParams(params)
|
|
2613
|
+
});
|
|
2614
|
+
}
|
|
2615
|
+
// @__NO_SIDE_EFFECTS__
|
|
2616
|
+
function _ksuid(Class, params) {
|
|
2617
|
+
return new Class({
|
|
2618
|
+
type: "string",
|
|
2619
|
+
format: "ksuid",
|
|
2620
|
+
check: "string_format",
|
|
2621
|
+
abort: false,
|
|
2622
|
+
...normalizeParams(params)
|
|
2623
|
+
});
|
|
2624
|
+
}
|
|
2625
|
+
// @__NO_SIDE_EFFECTS__
|
|
2626
|
+
function _ipv4(Class, params) {
|
|
2627
|
+
return new Class({
|
|
2628
|
+
type: "string",
|
|
2629
|
+
format: "ipv4",
|
|
2630
|
+
check: "string_format",
|
|
2631
|
+
abort: false,
|
|
2632
|
+
...normalizeParams(params)
|
|
2633
|
+
});
|
|
2634
|
+
}
|
|
2635
|
+
// @__NO_SIDE_EFFECTS__
|
|
2636
|
+
function _ipv6(Class, params) {
|
|
2637
|
+
return new Class({
|
|
2638
|
+
type: "string",
|
|
2639
|
+
format: "ipv6",
|
|
2640
|
+
check: "string_format",
|
|
2641
|
+
abort: false,
|
|
2642
|
+
...normalizeParams(params)
|
|
2643
|
+
});
|
|
2644
|
+
}
|
|
2645
|
+
// @__NO_SIDE_EFFECTS__
|
|
2646
|
+
function _cidrv4(Class, params) {
|
|
2647
|
+
return new Class({
|
|
2648
|
+
type: "string",
|
|
2649
|
+
format: "cidrv4",
|
|
2650
|
+
check: "string_format",
|
|
2651
|
+
abort: false,
|
|
2652
|
+
...normalizeParams(params)
|
|
2653
|
+
});
|
|
2654
|
+
}
|
|
2655
|
+
// @__NO_SIDE_EFFECTS__
|
|
2656
|
+
function _cidrv6(Class, params) {
|
|
2657
|
+
return new Class({
|
|
2658
|
+
type: "string",
|
|
2659
|
+
format: "cidrv6",
|
|
2660
|
+
check: "string_format",
|
|
2661
|
+
abort: false,
|
|
2662
|
+
...normalizeParams(params)
|
|
2663
|
+
});
|
|
2664
|
+
}
|
|
2665
|
+
// @__NO_SIDE_EFFECTS__
|
|
2666
|
+
function _base64(Class, params) {
|
|
2667
|
+
return new Class({
|
|
2668
|
+
type: "string",
|
|
2669
|
+
format: "base64",
|
|
2670
|
+
check: "string_format",
|
|
2671
|
+
abort: false,
|
|
2672
|
+
...normalizeParams(params)
|
|
2673
|
+
});
|
|
2674
|
+
}
|
|
2675
|
+
// @__NO_SIDE_EFFECTS__
|
|
2676
|
+
function _base64url(Class, params) {
|
|
2677
|
+
return new Class({
|
|
2678
|
+
type: "string",
|
|
2679
|
+
format: "base64url",
|
|
2680
|
+
check: "string_format",
|
|
2681
|
+
abort: false,
|
|
2682
|
+
...normalizeParams(params)
|
|
2683
|
+
});
|
|
2684
|
+
}
|
|
2685
|
+
// @__NO_SIDE_EFFECTS__
|
|
2686
|
+
function _e164(Class, params) {
|
|
2687
|
+
return new Class({
|
|
2688
|
+
type: "string",
|
|
2689
|
+
format: "e164",
|
|
2690
|
+
check: "string_format",
|
|
2691
|
+
abort: false,
|
|
2692
|
+
...normalizeParams(params)
|
|
2693
|
+
});
|
|
2694
|
+
}
|
|
2695
|
+
// @__NO_SIDE_EFFECTS__
|
|
2696
|
+
function _jwt(Class, params) {
|
|
2697
|
+
return new Class({
|
|
2698
|
+
type: "string",
|
|
2699
|
+
format: "jwt",
|
|
2700
|
+
check: "string_format",
|
|
2701
|
+
abort: false,
|
|
2702
|
+
...normalizeParams(params)
|
|
2703
|
+
});
|
|
2704
|
+
}
|
|
2705
|
+
// @__NO_SIDE_EFFECTS__
|
|
2706
|
+
function _isoDateTime(Class, params) {
|
|
2707
|
+
return new Class({
|
|
2708
|
+
type: "string",
|
|
2709
|
+
format: "datetime",
|
|
2710
|
+
check: "string_format",
|
|
2711
|
+
offset: false,
|
|
2712
|
+
local: false,
|
|
2713
|
+
precision: null,
|
|
2714
|
+
...normalizeParams(params)
|
|
2715
|
+
});
|
|
2716
|
+
}
|
|
2717
|
+
// @__NO_SIDE_EFFECTS__
|
|
2718
|
+
function _isoDate(Class, params) {
|
|
2719
|
+
return new Class({
|
|
2720
|
+
type: "string",
|
|
2721
|
+
format: "date",
|
|
2722
|
+
check: "string_format",
|
|
2723
|
+
...normalizeParams(params)
|
|
2724
|
+
});
|
|
2725
|
+
}
|
|
2726
|
+
// @__NO_SIDE_EFFECTS__
|
|
2727
|
+
function _isoTime(Class, params) {
|
|
2728
|
+
return new Class({
|
|
2729
|
+
type: "string",
|
|
2730
|
+
format: "time",
|
|
2731
|
+
check: "string_format",
|
|
2732
|
+
precision: null,
|
|
2733
|
+
...normalizeParams(params)
|
|
2734
|
+
});
|
|
2735
|
+
}
|
|
2736
|
+
// @__NO_SIDE_EFFECTS__
|
|
2737
|
+
function _isoDuration(Class, params) {
|
|
2738
|
+
return new Class({
|
|
2739
|
+
type: "string",
|
|
2740
|
+
format: "duration",
|
|
2741
|
+
check: "string_format",
|
|
2742
|
+
...normalizeParams(params)
|
|
2743
|
+
});
|
|
2744
|
+
}
|
|
2745
|
+
// @__NO_SIDE_EFFECTS__
|
|
2746
|
+
function _number(Class, params) {
|
|
2747
|
+
return new Class({
|
|
2748
|
+
type: "number",
|
|
2749
|
+
checks: [],
|
|
2750
|
+
...normalizeParams(params)
|
|
2751
|
+
});
|
|
2752
|
+
}
|
|
2753
|
+
// @__NO_SIDE_EFFECTS__
|
|
2754
|
+
function _int(Class, params) {
|
|
2755
|
+
return new Class({
|
|
2756
|
+
type: "number",
|
|
2757
|
+
check: "number_format",
|
|
2758
|
+
abort: false,
|
|
2759
|
+
format: "safeint",
|
|
2760
|
+
...normalizeParams(params)
|
|
2761
|
+
});
|
|
2762
|
+
}
|
|
2763
|
+
// @__NO_SIDE_EFFECTS__
|
|
2764
|
+
function _boolean(Class, params) {
|
|
2765
|
+
return new Class({
|
|
2766
|
+
type: "boolean",
|
|
2767
|
+
...normalizeParams(params)
|
|
2768
|
+
});
|
|
2769
|
+
}
|
|
2770
|
+
// @__NO_SIDE_EFFECTS__
|
|
2771
|
+
function _any(Class) {
|
|
2772
|
+
return new Class({
|
|
2773
|
+
type: "any"
|
|
2774
|
+
});
|
|
2775
|
+
}
|
|
2776
|
+
// @__NO_SIDE_EFFECTS__
|
|
2777
|
+
function _unknown(Class) {
|
|
2778
|
+
return new Class({
|
|
2779
|
+
type: "unknown"
|
|
2780
|
+
});
|
|
2781
|
+
}
|
|
2782
|
+
// @__NO_SIDE_EFFECTS__
|
|
2783
|
+
function _never(Class, params) {
|
|
2784
|
+
return new Class({
|
|
2785
|
+
type: "never",
|
|
2786
|
+
...normalizeParams(params)
|
|
2787
|
+
});
|
|
2788
|
+
}
|
|
2789
|
+
// @__NO_SIDE_EFFECTS__
|
|
2790
|
+
function _lt(value, params) {
|
|
2791
|
+
return new $ZodCheckLessThan({
|
|
2792
|
+
check: "less_than",
|
|
2793
|
+
...normalizeParams(params),
|
|
2794
|
+
value,
|
|
2795
|
+
inclusive: false
|
|
2796
|
+
});
|
|
2797
|
+
}
|
|
2798
|
+
// @__NO_SIDE_EFFECTS__
|
|
2799
|
+
function _lte(value, params) {
|
|
2800
|
+
return new $ZodCheckLessThan({
|
|
2801
|
+
check: "less_than",
|
|
2802
|
+
...normalizeParams(params),
|
|
2803
|
+
value,
|
|
2804
|
+
inclusive: true
|
|
2805
|
+
});
|
|
2806
|
+
}
|
|
2807
|
+
// @__NO_SIDE_EFFECTS__
|
|
2808
|
+
function _gt(value, params) {
|
|
2809
|
+
return new $ZodCheckGreaterThan({
|
|
2810
|
+
check: "greater_than",
|
|
2811
|
+
...normalizeParams(params),
|
|
2812
|
+
value,
|
|
2813
|
+
inclusive: false
|
|
2814
|
+
});
|
|
2815
|
+
}
|
|
2816
|
+
// @__NO_SIDE_EFFECTS__
|
|
2817
|
+
function _gte(value, params) {
|
|
2818
|
+
return new $ZodCheckGreaterThan({
|
|
2819
|
+
check: "greater_than",
|
|
2820
|
+
...normalizeParams(params),
|
|
2821
|
+
value,
|
|
2822
|
+
inclusive: true
|
|
2823
|
+
});
|
|
2824
|
+
}
|
|
2825
|
+
// @__NO_SIDE_EFFECTS__
|
|
2826
|
+
function _multipleOf(value, params) {
|
|
2827
|
+
return new $ZodCheckMultipleOf({
|
|
2828
|
+
check: "multiple_of",
|
|
2829
|
+
...normalizeParams(params),
|
|
2830
|
+
value
|
|
2831
|
+
});
|
|
2832
|
+
}
|
|
2833
|
+
// @__NO_SIDE_EFFECTS__
|
|
2834
|
+
function _maxLength(maximum, params) {
|
|
2835
|
+
const ch = new $ZodCheckMaxLength({
|
|
2836
|
+
check: "max_length",
|
|
2837
|
+
...normalizeParams(params),
|
|
2838
|
+
maximum
|
|
2839
|
+
});
|
|
2840
|
+
return ch;
|
|
2841
|
+
}
|
|
2842
|
+
// @__NO_SIDE_EFFECTS__
|
|
2843
|
+
function _minLength(minimum, params) {
|
|
2844
|
+
return new $ZodCheckMinLength({
|
|
2845
|
+
check: "min_length",
|
|
2846
|
+
...normalizeParams(params),
|
|
2847
|
+
minimum
|
|
2848
|
+
});
|
|
2849
|
+
}
|
|
2850
|
+
// @__NO_SIDE_EFFECTS__
|
|
2851
|
+
function _length(length, params) {
|
|
2852
|
+
return new $ZodCheckLengthEquals({
|
|
2853
|
+
check: "length_equals",
|
|
2854
|
+
...normalizeParams(params),
|
|
2855
|
+
length
|
|
2856
|
+
});
|
|
2857
|
+
}
|
|
2858
|
+
// @__NO_SIDE_EFFECTS__
|
|
2859
|
+
function _regex(pattern, params) {
|
|
2860
|
+
return new $ZodCheckRegex({
|
|
2861
|
+
check: "string_format",
|
|
2862
|
+
format: "regex",
|
|
2863
|
+
...normalizeParams(params),
|
|
2864
|
+
pattern
|
|
2865
|
+
});
|
|
2866
|
+
}
|
|
2867
|
+
// @__NO_SIDE_EFFECTS__
|
|
2868
|
+
function _lowercase(params) {
|
|
2869
|
+
return new $ZodCheckLowerCase({
|
|
2870
|
+
check: "string_format",
|
|
2871
|
+
format: "lowercase",
|
|
2872
|
+
...normalizeParams(params)
|
|
2873
|
+
});
|
|
2874
|
+
}
|
|
2875
|
+
// @__NO_SIDE_EFFECTS__
|
|
2876
|
+
function _uppercase(params) {
|
|
2877
|
+
return new $ZodCheckUpperCase({
|
|
2878
|
+
check: "string_format",
|
|
2879
|
+
format: "uppercase",
|
|
2880
|
+
...normalizeParams(params)
|
|
2881
|
+
});
|
|
2882
|
+
}
|
|
2883
|
+
// @__NO_SIDE_EFFECTS__
|
|
2884
|
+
function _includes(includes, params) {
|
|
2885
|
+
return new $ZodCheckIncludes({
|
|
2886
|
+
check: "string_format",
|
|
2887
|
+
format: "includes",
|
|
2888
|
+
...normalizeParams(params),
|
|
2889
|
+
includes
|
|
2890
|
+
});
|
|
2891
|
+
}
|
|
2892
|
+
// @__NO_SIDE_EFFECTS__
|
|
2893
|
+
function _startsWith(prefix, params) {
|
|
2894
|
+
return new $ZodCheckStartsWith({
|
|
2895
|
+
check: "string_format",
|
|
2896
|
+
format: "starts_with",
|
|
2897
|
+
...normalizeParams(params),
|
|
2898
|
+
prefix
|
|
2899
|
+
});
|
|
2900
|
+
}
|
|
2901
|
+
// @__NO_SIDE_EFFECTS__
|
|
2902
|
+
function _endsWith(suffix, params) {
|
|
2903
|
+
return new $ZodCheckEndsWith({
|
|
2904
|
+
check: "string_format",
|
|
2905
|
+
format: "ends_with",
|
|
2906
|
+
...normalizeParams(params),
|
|
2907
|
+
suffix
|
|
2908
|
+
});
|
|
2909
|
+
}
|
|
2910
|
+
// @__NO_SIDE_EFFECTS__
|
|
2911
|
+
function _overwrite(tx) {
|
|
2912
|
+
return new $ZodCheckOverwrite({
|
|
2913
|
+
check: "overwrite",
|
|
2914
|
+
tx
|
|
2915
|
+
});
|
|
2916
|
+
}
|
|
2917
|
+
// @__NO_SIDE_EFFECTS__
|
|
2918
|
+
function _normalize(form) {
|
|
2919
|
+
return /* @__PURE__ */ _overwrite((input) => input.normalize(form));
|
|
2920
|
+
}
|
|
2921
|
+
// @__NO_SIDE_EFFECTS__
|
|
2922
|
+
function _trim() {
|
|
2923
|
+
return /* @__PURE__ */ _overwrite((input) => input.trim());
|
|
2924
|
+
}
|
|
2925
|
+
// @__NO_SIDE_EFFECTS__
|
|
2926
|
+
function _toLowerCase() {
|
|
2927
|
+
return /* @__PURE__ */ _overwrite((input) => input.toLowerCase());
|
|
2928
|
+
}
|
|
2929
|
+
// @__NO_SIDE_EFFECTS__
|
|
2930
|
+
function _toUpperCase() {
|
|
2931
|
+
return /* @__PURE__ */ _overwrite((input) => input.toUpperCase());
|
|
2932
|
+
}
|
|
2933
|
+
// @__NO_SIDE_EFFECTS__
|
|
2934
|
+
function _slugify() {
|
|
2935
|
+
return /* @__PURE__ */ _overwrite((input) => slugify(input));
|
|
2936
|
+
}
|
|
2937
|
+
// @__NO_SIDE_EFFECTS__
|
|
2938
|
+
function _array(Class, element, params) {
|
|
2939
|
+
return new Class({
|
|
2940
|
+
type: "array",
|
|
2941
|
+
element,
|
|
2942
|
+
// get element() {
|
|
2943
|
+
// return element;
|
|
2944
|
+
// },
|
|
2945
|
+
...normalizeParams(params)
|
|
2946
|
+
});
|
|
2947
|
+
}
|
|
2948
|
+
// @__NO_SIDE_EFFECTS__
|
|
2949
|
+
function _refine(Class, fn, _params) {
|
|
2950
|
+
const schema = new Class({
|
|
2951
|
+
type: "custom",
|
|
2952
|
+
check: "custom",
|
|
2953
|
+
fn,
|
|
2954
|
+
...normalizeParams(_params)
|
|
2955
|
+
});
|
|
2956
|
+
return schema;
|
|
2957
|
+
}
|
|
2958
|
+
// @__NO_SIDE_EFFECTS__
|
|
2959
|
+
function _superRefine(fn, params) {
|
|
2960
|
+
const ch = /* @__PURE__ */ _check((payload) => {
|
|
2961
|
+
payload.addIssue = (issue$1) => {
|
|
2962
|
+
if (typeof issue$1 === "string") {
|
|
2963
|
+
payload.issues.push(issue(issue$1, payload.value, ch._zod.def));
|
|
2964
|
+
} else {
|
|
2965
|
+
const _issue = issue$1;
|
|
2966
|
+
if (_issue.fatal)
|
|
2967
|
+
_issue.continue = false;
|
|
2968
|
+
_issue.code ?? (_issue.code = "custom");
|
|
2969
|
+
_issue.input ?? (_issue.input = payload.value);
|
|
2970
|
+
_issue.inst ?? (_issue.inst = ch);
|
|
2971
|
+
_issue.continue ?? (_issue.continue = !ch._zod.def.abort);
|
|
2972
|
+
payload.issues.push(issue(_issue));
|
|
2973
|
+
}
|
|
2974
|
+
};
|
|
2975
|
+
return fn(payload.value, payload);
|
|
2976
|
+
}, params);
|
|
2977
|
+
return ch;
|
|
2978
|
+
}
|
|
2979
|
+
// @__NO_SIDE_EFFECTS__
|
|
2980
|
+
function _check(fn, params) {
|
|
2981
|
+
const ch = new $ZodCheck({
|
|
2982
|
+
check: "custom",
|
|
2983
|
+
...normalizeParams(params)
|
|
2984
|
+
});
|
|
2985
|
+
ch._zod.check = fn;
|
|
2986
|
+
return ch;
|
|
2987
|
+
}
|
|
2988
|
+
function initializeContext(params) {
|
|
2989
|
+
let target = params?.target ?? "draft-2020-12";
|
|
2990
|
+
if (target === "draft-4")
|
|
2991
|
+
target = "draft-04";
|
|
2992
|
+
if (target === "draft-7")
|
|
2993
|
+
target = "draft-07";
|
|
2994
|
+
return {
|
|
2995
|
+
processors: params.processors ?? {},
|
|
2996
|
+
metadataRegistry: params?.metadata ?? globalRegistry,
|
|
2997
|
+
target,
|
|
2998
|
+
unrepresentable: params?.unrepresentable ?? "throw",
|
|
2999
|
+
override: params?.override ?? (() => {
|
|
3000
|
+
}),
|
|
3001
|
+
io: params?.io ?? "output",
|
|
3002
|
+
counter: 0,
|
|
3003
|
+
seen: /* @__PURE__ */ new Map(),
|
|
3004
|
+
cycles: params?.cycles ?? "ref",
|
|
3005
|
+
reused: params?.reused ?? "inline",
|
|
3006
|
+
external: params?.external ?? void 0
|
|
3007
|
+
};
|
|
3008
|
+
}
|
|
3009
|
+
function process(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
3010
|
+
var _a2;
|
|
3011
|
+
const def = schema._zod.def;
|
|
3012
|
+
const seen = ctx.seen.get(schema);
|
|
3013
|
+
if (seen) {
|
|
3014
|
+
seen.count++;
|
|
3015
|
+
const isCycle = _params.schemaPath.includes(schema);
|
|
3016
|
+
if (isCycle) {
|
|
3017
|
+
seen.cycle = _params.path;
|
|
3018
|
+
}
|
|
3019
|
+
return seen.schema;
|
|
3020
|
+
}
|
|
3021
|
+
const result = { schema: {}, count: 1, cycle: void 0, path: _params.path };
|
|
3022
|
+
ctx.seen.set(schema, result);
|
|
3023
|
+
const overrideSchema = schema._zod.toJSONSchema?.();
|
|
3024
|
+
if (overrideSchema) {
|
|
3025
|
+
result.schema = overrideSchema;
|
|
3026
|
+
} else {
|
|
3027
|
+
const params = {
|
|
3028
|
+
..._params,
|
|
3029
|
+
schemaPath: [..._params.schemaPath, schema],
|
|
3030
|
+
path: _params.path
|
|
3031
|
+
};
|
|
3032
|
+
if (schema._zod.processJSONSchema) {
|
|
3033
|
+
schema._zod.processJSONSchema(ctx, result.schema, params);
|
|
3034
|
+
} else {
|
|
3035
|
+
const _json = result.schema;
|
|
3036
|
+
const processor = ctx.processors[def.type];
|
|
3037
|
+
if (!processor) {
|
|
3038
|
+
throw new Error(`[toJSONSchema]: Non-representable type encountered: ${def.type}`);
|
|
3039
|
+
}
|
|
3040
|
+
processor(schema, ctx, _json, params);
|
|
3041
|
+
}
|
|
3042
|
+
const parent = schema._zod.parent;
|
|
3043
|
+
if (parent) {
|
|
3044
|
+
if (!result.ref)
|
|
3045
|
+
result.ref = parent;
|
|
3046
|
+
process(parent, ctx, params);
|
|
3047
|
+
ctx.seen.get(parent).isParent = true;
|
|
3048
|
+
}
|
|
3049
|
+
}
|
|
3050
|
+
const meta = ctx.metadataRegistry.get(schema);
|
|
3051
|
+
if (meta)
|
|
3052
|
+
Object.assign(result.schema, meta);
|
|
3053
|
+
if (ctx.io === "input" && isTransforming(schema)) {
|
|
3054
|
+
delete result.schema.examples;
|
|
3055
|
+
delete result.schema.default;
|
|
3056
|
+
}
|
|
3057
|
+
if (ctx.io === "input" && "_prefault" in result.schema)
|
|
3058
|
+
(_a2 = result.schema).default ?? (_a2.default = result.schema._prefault);
|
|
3059
|
+
delete result.schema._prefault;
|
|
3060
|
+
const _result = ctx.seen.get(schema);
|
|
3061
|
+
return _result.schema;
|
|
3062
|
+
}
|
|
3063
|
+
function extractDefs(ctx, schema) {
|
|
3064
|
+
const root = ctx.seen.get(schema);
|
|
3065
|
+
if (!root)
|
|
3066
|
+
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
3067
|
+
const idToSchema = /* @__PURE__ */ new Map();
|
|
3068
|
+
for (const entry of ctx.seen.entries()) {
|
|
3069
|
+
const id = ctx.metadataRegistry.get(entry[0])?.id;
|
|
3070
|
+
if (id) {
|
|
3071
|
+
const existing = idToSchema.get(id);
|
|
3072
|
+
if (existing && existing !== entry[0]) {
|
|
3073
|
+
throw new Error(`Duplicate schema id "${id}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
|
|
3074
|
+
}
|
|
3075
|
+
idToSchema.set(id, entry[0]);
|
|
3076
|
+
}
|
|
3077
|
+
}
|
|
3078
|
+
const makeURI = (entry) => {
|
|
3079
|
+
const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
3080
|
+
if (ctx.external) {
|
|
3081
|
+
const externalId = ctx.external.registry.get(entry[0])?.id;
|
|
3082
|
+
const uriGenerator = ctx.external.uri ?? ((id2) => id2);
|
|
3083
|
+
if (externalId) {
|
|
3084
|
+
return { ref: uriGenerator(externalId) };
|
|
3085
|
+
}
|
|
3086
|
+
const id = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`;
|
|
3087
|
+
entry[1].defId = id;
|
|
3088
|
+
return { defId: id, ref: `${uriGenerator("__shared")}#/${defsSegment}/${id}` };
|
|
3089
|
+
}
|
|
3090
|
+
if (entry[1] === root) {
|
|
3091
|
+
return { ref: "#" };
|
|
3092
|
+
}
|
|
3093
|
+
const uriPrefix = `#`;
|
|
3094
|
+
const defUriPrefix = `${uriPrefix}/${defsSegment}/`;
|
|
3095
|
+
const defId = entry[1].schema.id ?? `__schema${ctx.counter++}`;
|
|
3096
|
+
return { defId, ref: defUriPrefix + defId };
|
|
3097
|
+
};
|
|
3098
|
+
const extractToDef = (entry) => {
|
|
3099
|
+
if (entry[1].schema.$ref) {
|
|
3100
|
+
return;
|
|
3101
|
+
}
|
|
3102
|
+
const seen = entry[1];
|
|
3103
|
+
const { ref, defId } = makeURI(entry);
|
|
3104
|
+
seen.def = { ...seen.schema };
|
|
3105
|
+
if (defId)
|
|
3106
|
+
seen.defId = defId;
|
|
3107
|
+
const schema2 = seen.schema;
|
|
3108
|
+
for (const key in schema2) {
|
|
3109
|
+
delete schema2[key];
|
|
3110
|
+
}
|
|
3111
|
+
schema2.$ref = ref;
|
|
3112
|
+
};
|
|
3113
|
+
if (ctx.cycles === "throw") {
|
|
3114
|
+
for (const entry of ctx.seen.entries()) {
|
|
3115
|
+
const seen = entry[1];
|
|
3116
|
+
if (seen.cycle) {
|
|
3117
|
+
throw new Error(`Cycle detected: #/${seen.cycle?.join("/")}/<root>
|
|
3118
|
+
|
|
3119
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);
|
|
3120
|
+
}
|
|
3121
|
+
}
|
|
3122
|
+
}
|
|
3123
|
+
for (const entry of ctx.seen.entries()) {
|
|
3124
|
+
const seen = entry[1];
|
|
3125
|
+
if (schema === entry[0]) {
|
|
3126
|
+
extractToDef(entry);
|
|
3127
|
+
continue;
|
|
3128
|
+
}
|
|
3129
|
+
if (ctx.external) {
|
|
3130
|
+
const ext = ctx.external.registry.get(entry[0])?.id;
|
|
3131
|
+
if (schema !== entry[0] && ext) {
|
|
3132
|
+
extractToDef(entry);
|
|
3133
|
+
continue;
|
|
3134
|
+
}
|
|
3135
|
+
}
|
|
3136
|
+
const id = ctx.metadataRegistry.get(entry[0])?.id;
|
|
3137
|
+
if (id) {
|
|
3138
|
+
extractToDef(entry);
|
|
3139
|
+
continue;
|
|
3140
|
+
}
|
|
3141
|
+
if (seen.cycle) {
|
|
3142
|
+
extractToDef(entry);
|
|
3143
|
+
continue;
|
|
3144
|
+
}
|
|
3145
|
+
if (seen.count > 1) {
|
|
3146
|
+
if (ctx.reused === "ref") {
|
|
3147
|
+
extractToDef(entry);
|
|
3148
|
+
continue;
|
|
3149
|
+
}
|
|
3150
|
+
}
|
|
3151
|
+
}
|
|
3152
|
+
}
|
|
3153
|
+
function finalize(ctx, schema) {
|
|
3154
|
+
const root = ctx.seen.get(schema);
|
|
3155
|
+
if (!root)
|
|
3156
|
+
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
3157
|
+
const flattenRef = (zodSchema) => {
|
|
3158
|
+
const seen = ctx.seen.get(zodSchema);
|
|
3159
|
+
if (seen.ref === null)
|
|
3160
|
+
return;
|
|
3161
|
+
const schema2 = seen.def ?? seen.schema;
|
|
3162
|
+
const _cached = { ...schema2 };
|
|
3163
|
+
const ref = seen.ref;
|
|
3164
|
+
seen.ref = null;
|
|
3165
|
+
if (ref) {
|
|
3166
|
+
flattenRef(ref);
|
|
3167
|
+
const refSeen = ctx.seen.get(ref);
|
|
3168
|
+
const refSchema = refSeen.schema;
|
|
3169
|
+
if (refSchema.$ref && (ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0")) {
|
|
3170
|
+
schema2.allOf = schema2.allOf ?? [];
|
|
3171
|
+
schema2.allOf.push(refSchema);
|
|
3172
|
+
} else {
|
|
3173
|
+
Object.assign(schema2, refSchema);
|
|
3174
|
+
}
|
|
3175
|
+
Object.assign(schema2, _cached);
|
|
3176
|
+
const isParentRef = zodSchema._zod.parent === ref;
|
|
3177
|
+
if (isParentRef) {
|
|
3178
|
+
for (const key in schema2) {
|
|
3179
|
+
if (key === "$ref" || key === "allOf")
|
|
3180
|
+
continue;
|
|
3181
|
+
if (!(key in _cached)) {
|
|
3182
|
+
delete schema2[key];
|
|
3183
|
+
}
|
|
3184
|
+
}
|
|
3185
|
+
}
|
|
3186
|
+
if (refSchema.$ref && refSeen.def) {
|
|
3187
|
+
for (const key in schema2) {
|
|
3188
|
+
if (key === "$ref" || key === "allOf")
|
|
3189
|
+
continue;
|
|
3190
|
+
if (key in refSeen.def && JSON.stringify(schema2[key]) === JSON.stringify(refSeen.def[key])) {
|
|
3191
|
+
delete schema2[key];
|
|
3192
|
+
}
|
|
3193
|
+
}
|
|
3194
|
+
}
|
|
3195
|
+
}
|
|
3196
|
+
const parent = zodSchema._zod.parent;
|
|
3197
|
+
if (parent && parent !== ref) {
|
|
3198
|
+
flattenRef(parent);
|
|
3199
|
+
const parentSeen = ctx.seen.get(parent);
|
|
3200
|
+
if (parentSeen?.schema.$ref) {
|
|
3201
|
+
schema2.$ref = parentSeen.schema.$ref;
|
|
3202
|
+
if (parentSeen.def) {
|
|
3203
|
+
for (const key in schema2) {
|
|
3204
|
+
if (key === "$ref" || key === "allOf")
|
|
3205
|
+
continue;
|
|
3206
|
+
if (key in parentSeen.def && JSON.stringify(schema2[key]) === JSON.stringify(parentSeen.def[key])) {
|
|
3207
|
+
delete schema2[key];
|
|
3208
|
+
}
|
|
3209
|
+
}
|
|
3210
|
+
}
|
|
3211
|
+
}
|
|
3212
|
+
}
|
|
3213
|
+
ctx.override({
|
|
3214
|
+
zodSchema,
|
|
3215
|
+
jsonSchema: schema2,
|
|
3216
|
+
path: seen.path ?? []
|
|
3217
|
+
});
|
|
3218
|
+
};
|
|
3219
|
+
for (const entry of [...ctx.seen.entries()].reverse()) {
|
|
3220
|
+
flattenRef(entry[0]);
|
|
3221
|
+
}
|
|
3222
|
+
const result = {};
|
|
3223
|
+
if (ctx.target === "draft-2020-12") {
|
|
3224
|
+
result.$schema = "https://json-schema.org/draft/2020-12/schema";
|
|
3225
|
+
} else if (ctx.target === "draft-07") {
|
|
3226
|
+
result.$schema = "http://json-schema.org/draft-07/schema#";
|
|
3227
|
+
} else if (ctx.target === "draft-04") {
|
|
3228
|
+
result.$schema = "http://json-schema.org/draft-04/schema#";
|
|
3229
|
+
} else if (ctx.target === "openapi-3.0") ;
|
|
3230
|
+
else ;
|
|
3231
|
+
if (ctx.external?.uri) {
|
|
3232
|
+
const id = ctx.external.registry.get(schema)?.id;
|
|
3233
|
+
if (!id)
|
|
3234
|
+
throw new Error("Schema is missing an `id` property");
|
|
3235
|
+
result.$id = ctx.external.uri(id);
|
|
3236
|
+
}
|
|
3237
|
+
Object.assign(result, root.def ?? root.schema);
|
|
3238
|
+
const rootMetaId = ctx.metadataRegistry.get(schema)?.id;
|
|
3239
|
+
if (rootMetaId !== void 0 && result.id === rootMetaId)
|
|
3240
|
+
delete result.id;
|
|
3241
|
+
const defs = ctx.external?.defs ?? {};
|
|
3242
|
+
for (const entry of ctx.seen.entries()) {
|
|
3243
|
+
const seen = entry[1];
|
|
3244
|
+
if (seen.def && seen.defId) {
|
|
3245
|
+
if (seen.def.id === seen.defId)
|
|
3246
|
+
delete seen.def.id;
|
|
3247
|
+
defs[seen.defId] = seen.def;
|
|
3248
|
+
}
|
|
3249
|
+
}
|
|
3250
|
+
if (ctx.external) ;
|
|
3251
|
+
else {
|
|
3252
|
+
if (Object.keys(defs).length > 0) {
|
|
3253
|
+
if (ctx.target === "draft-2020-12") {
|
|
3254
|
+
result.$defs = defs;
|
|
3255
|
+
} else {
|
|
3256
|
+
result.definitions = defs;
|
|
3257
|
+
}
|
|
3258
|
+
}
|
|
3259
|
+
}
|
|
3260
|
+
try {
|
|
3261
|
+
const finalized = JSON.parse(JSON.stringify(result));
|
|
3262
|
+
Object.defineProperty(finalized, "~standard", {
|
|
3263
|
+
value: {
|
|
3264
|
+
...schema["~standard"],
|
|
3265
|
+
jsonSchema: {
|
|
3266
|
+
input: createStandardJSONSchemaMethod(schema, "input", ctx.processors),
|
|
3267
|
+
output: createStandardJSONSchemaMethod(schema, "output", ctx.processors)
|
|
3268
|
+
}
|
|
3269
|
+
},
|
|
3270
|
+
enumerable: false,
|
|
3271
|
+
writable: false
|
|
3272
|
+
});
|
|
3273
|
+
return finalized;
|
|
3274
|
+
} catch (_err) {
|
|
3275
|
+
throw new Error("Error converting schema to JSON.");
|
|
3276
|
+
}
|
|
3277
|
+
}
|
|
3278
|
+
function isTransforming(_schema, _ctx) {
|
|
3279
|
+
const ctx = _ctx ?? { seen: /* @__PURE__ */ new Set() };
|
|
3280
|
+
if (ctx.seen.has(_schema))
|
|
3281
|
+
return false;
|
|
3282
|
+
ctx.seen.add(_schema);
|
|
3283
|
+
const def = _schema._zod.def;
|
|
3284
|
+
if (def.type === "transform")
|
|
3285
|
+
return true;
|
|
3286
|
+
if (def.type === "array")
|
|
3287
|
+
return isTransforming(def.element, ctx);
|
|
3288
|
+
if (def.type === "set")
|
|
3289
|
+
return isTransforming(def.valueType, ctx);
|
|
3290
|
+
if (def.type === "lazy")
|
|
3291
|
+
return isTransforming(def.getter(), ctx);
|
|
3292
|
+
if (def.type === "promise" || def.type === "optional" || def.type === "nonoptional" || def.type === "nullable" || def.type === "readonly" || def.type === "default" || def.type === "prefault") {
|
|
3293
|
+
return isTransforming(def.innerType, ctx);
|
|
3294
|
+
}
|
|
3295
|
+
if (def.type === "intersection") {
|
|
3296
|
+
return isTransforming(def.left, ctx) || isTransforming(def.right, ctx);
|
|
3297
|
+
}
|
|
3298
|
+
if (def.type === "record" || def.type === "map") {
|
|
3299
|
+
return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);
|
|
3300
|
+
}
|
|
3301
|
+
if (def.type === "pipe") {
|
|
3302
|
+
if (_schema._zod.traits.has("$ZodCodec"))
|
|
3303
|
+
return true;
|
|
3304
|
+
return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);
|
|
3305
|
+
}
|
|
3306
|
+
if (def.type === "object") {
|
|
3307
|
+
for (const key in def.shape) {
|
|
3308
|
+
if (isTransforming(def.shape[key], ctx))
|
|
3309
|
+
return true;
|
|
3310
|
+
}
|
|
3311
|
+
return false;
|
|
3312
|
+
}
|
|
3313
|
+
if (def.type === "union") {
|
|
3314
|
+
for (const option of def.options) {
|
|
3315
|
+
if (isTransforming(option, ctx))
|
|
3316
|
+
return true;
|
|
3317
|
+
}
|
|
3318
|
+
return false;
|
|
3319
|
+
}
|
|
3320
|
+
if (def.type === "tuple") {
|
|
3321
|
+
for (const item of def.items) {
|
|
3322
|
+
if (isTransforming(item, ctx))
|
|
3323
|
+
return true;
|
|
3324
|
+
}
|
|
3325
|
+
if (def.rest && isTransforming(def.rest, ctx))
|
|
3326
|
+
return true;
|
|
3327
|
+
return false;
|
|
3328
|
+
}
|
|
3329
|
+
return false;
|
|
3330
|
+
}
|
|
3331
|
+
const createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
|
|
3332
|
+
const ctx = initializeContext({ ...params, processors });
|
|
3333
|
+
process(schema, ctx);
|
|
3334
|
+
extractDefs(ctx, schema);
|
|
3335
|
+
return finalize(ctx, schema);
|
|
3336
|
+
};
|
|
3337
|
+
const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {
|
|
3338
|
+
const { libraryOptions, target } = params ?? {};
|
|
3339
|
+
const ctx = initializeContext({ ...libraryOptions ?? {}, target, io, processors });
|
|
3340
|
+
process(schema, ctx);
|
|
3341
|
+
extractDefs(ctx, schema);
|
|
3342
|
+
return finalize(ctx, schema);
|
|
3343
|
+
};
|
|
3344
|
+
const formatMap = {
|
|
3345
|
+
guid: "uuid",
|
|
3346
|
+
url: "uri",
|
|
3347
|
+
datetime: "date-time",
|
|
3348
|
+
json_string: "json-string",
|
|
3349
|
+
regex: ""
|
|
3350
|
+
// do not set
|
|
3351
|
+
};
|
|
3352
|
+
const stringProcessor = (schema, ctx, _json, _params) => {
|
|
3353
|
+
const json = _json;
|
|
3354
|
+
json.type = "string";
|
|
3355
|
+
const { minimum, maximum, format, patterns, contentEncoding } = schema._zod.bag;
|
|
3356
|
+
if (typeof minimum === "number")
|
|
3357
|
+
json.minLength = minimum;
|
|
3358
|
+
if (typeof maximum === "number")
|
|
3359
|
+
json.maxLength = maximum;
|
|
3360
|
+
if (format) {
|
|
3361
|
+
json.format = formatMap[format] ?? format;
|
|
3362
|
+
if (json.format === "")
|
|
3363
|
+
delete json.format;
|
|
3364
|
+
if (format === "time") {
|
|
3365
|
+
delete json.format;
|
|
3366
|
+
}
|
|
3367
|
+
}
|
|
3368
|
+
if (contentEncoding)
|
|
3369
|
+
json.contentEncoding = contentEncoding;
|
|
3370
|
+
if (patterns && patterns.size > 0) {
|
|
3371
|
+
const regexes = [...patterns];
|
|
3372
|
+
if (regexes.length === 1)
|
|
3373
|
+
json.pattern = regexes[0].source;
|
|
3374
|
+
else if (regexes.length > 1) {
|
|
3375
|
+
json.allOf = [
|
|
3376
|
+
...regexes.map((regex) => ({
|
|
3377
|
+
...ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0" ? { type: "string" } : {},
|
|
3378
|
+
pattern: regex.source
|
|
3379
|
+
}))
|
|
3380
|
+
];
|
|
3381
|
+
}
|
|
3382
|
+
}
|
|
3383
|
+
};
|
|
3384
|
+
const numberProcessor = (schema, ctx, _json, _params) => {
|
|
3385
|
+
const json = _json;
|
|
3386
|
+
const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
|
|
3387
|
+
if (typeof format === "string" && format.includes("int"))
|
|
3388
|
+
json.type = "integer";
|
|
3389
|
+
else
|
|
3390
|
+
json.type = "number";
|
|
3391
|
+
const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);
|
|
3392
|
+
const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);
|
|
3393
|
+
const legacy = ctx.target === "draft-04" || ctx.target === "openapi-3.0";
|
|
3394
|
+
if (exMin) {
|
|
3395
|
+
if (legacy) {
|
|
3396
|
+
json.minimum = exclusiveMinimum;
|
|
3397
|
+
json.exclusiveMinimum = true;
|
|
3398
|
+
} else {
|
|
3399
|
+
json.exclusiveMinimum = exclusiveMinimum;
|
|
3400
|
+
}
|
|
3401
|
+
} else if (typeof minimum === "number") {
|
|
3402
|
+
json.minimum = minimum;
|
|
3403
|
+
}
|
|
3404
|
+
if (exMax) {
|
|
3405
|
+
if (legacy) {
|
|
3406
|
+
json.maximum = exclusiveMaximum;
|
|
3407
|
+
json.exclusiveMaximum = true;
|
|
3408
|
+
} else {
|
|
3409
|
+
json.exclusiveMaximum = exclusiveMaximum;
|
|
3410
|
+
}
|
|
3411
|
+
} else if (typeof maximum === "number") {
|
|
3412
|
+
json.maximum = maximum;
|
|
3413
|
+
}
|
|
3414
|
+
if (typeof multipleOf === "number")
|
|
3415
|
+
json.multipleOf = multipleOf;
|
|
3416
|
+
};
|
|
3417
|
+
const booleanProcessor = (_schema, _ctx, json, _params) => {
|
|
3418
|
+
json.type = "boolean";
|
|
3419
|
+
};
|
|
3420
|
+
const neverProcessor = (_schema, _ctx, json, _params) => {
|
|
3421
|
+
json.not = {};
|
|
3422
|
+
};
|
|
3423
|
+
const anyProcessor = (_schema, _ctx, _json, _params) => {
|
|
3424
|
+
};
|
|
3425
|
+
const unknownProcessor = (_schema, _ctx, _json, _params) => {
|
|
3426
|
+
};
|
|
3427
|
+
const enumProcessor = (schema, _ctx, json, _params) => {
|
|
3428
|
+
const def = schema._zod.def;
|
|
3429
|
+
const values = getEnumValues(def.entries);
|
|
3430
|
+
if (values.every((v) => typeof v === "number"))
|
|
3431
|
+
json.type = "number";
|
|
3432
|
+
if (values.every((v) => typeof v === "string"))
|
|
3433
|
+
json.type = "string";
|
|
3434
|
+
json.enum = values;
|
|
3435
|
+
};
|
|
3436
|
+
const literalProcessor = (schema, ctx, json, _params) => {
|
|
3437
|
+
const def = schema._zod.def;
|
|
3438
|
+
const vals = [];
|
|
3439
|
+
for (const val of def.values) {
|
|
3440
|
+
if (val === void 0) {
|
|
3441
|
+
if (ctx.unrepresentable === "throw") {
|
|
3442
|
+
throw new Error("Literal `undefined` cannot be represented in JSON Schema");
|
|
3443
|
+
}
|
|
3444
|
+
} else if (typeof val === "bigint") {
|
|
3445
|
+
if (ctx.unrepresentable === "throw") {
|
|
3446
|
+
throw new Error("BigInt literals cannot be represented in JSON Schema");
|
|
3447
|
+
} else {
|
|
3448
|
+
vals.push(Number(val));
|
|
3449
|
+
}
|
|
3450
|
+
} else {
|
|
3451
|
+
vals.push(val);
|
|
3452
|
+
}
|
|
3453
|
+
}
|
|
3454
|
+
if (vals.length === 0) ;
|
|
3455
|
+
else if (vals.length === 1) {
|
|
3456
|
+
const val = vals[0];
|
|
3457
|
+
json.type = val === null ? "null" : typeof val;
|
|
3458
|
+
if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") {
|
|
3459
|
+
json.enum = [val];
|
|
3460
|
+
} else {
|
|
3461
|
+
json.const = val;
|
|
3462
|
+
}
|
|
3463
|
+
} else {
|
|
3464
|
+
if (vals.every((v) => typeof v === "number"))
|
|
3465
|
+
json.type = "number";
|
|
3466
|
+
if (vals.every((v) => typeof v === "string"))
|
|
3467
|
+
json.type = "string";
|
|
3468
|
+
if (vals.every((v) => typeof v === "boolean"))
|
|
3469
|
+
json.type = "boolean";
|
|
3470
|
+
if (vals.every((v) => v === null))
|
|
3471
|
+
json.type = "null";
|
|
3472
|
+
json.enum = vals;
|
|
3473
|
+
}
|
|
3474
|
+
};
|
|
3475
|
+
const customProcessor = (_schema, ctx, _json, _params) => {
|
|
3476
|
+
if (ctx.unrepresentable === "throw") {
|
|
3477
|
+
throw new Error("Custom types cannot be represented in JSON Schema");
|
|
3478
|
+
}
|
|
3479
|
+
};
|
|
3480
|
+
const transformProcessor = (_schema, ctx, _json, _params) => {
|
|
3481
|
+
if (ctx.unrepresentable === "throw") {
|
|
3482
|
+
throw new Error("Transforms cannot be represented in JSON Schema");
|
|
3483
|
+
}
|
|
3484
|
+
};
|
|
3485
|
+
const arrayProcessor = (schema, ctx, _json, params) => {
|
|
3486
|
+
const json = _json;
|
|
3487
|
+
const def = schema._zod.def;
|
|
3488
|
+
const { minimum, maximum } = schema._zod.bag;
|
|
3489
|
+
if (typeof minimum === "number")
|
|
3490
|
+
json.minItems = minimum;
|
|
3491
|
+
if (typeof maximum === "number")
|
|
3492
|
+
json.maxItems = maximum;
|
|
3493
|
+
json.type = "array";
|
|
3494
|
+
json.items = process(def.element, ctx, {
|
|
3495
|
+
...params,
|
|
3496
|
+
path: [...params.path, "items"]
|
|
3497
|
+
});
|
|
3498
|
+
};
|
|
3499
|
+
const objectProcessor = (schema, ctx, _json, params) => {
|
|
3500
|
+
const json = _json;
|
|
3501
|
+
const def = schema._zod.def;
|
|
3502
|
+
json.type = "object";
|
|
3503
|
+
json.properties = {};
|
|
3504
|
+
const shape = def.shape;
|
|
3505
|
+
for (const key in shape) {
|
|
3506
|
+
json.properties[key] = process(shape[key], ctx, {
|
|
3507
|
+
...params,
|
|
3508
|
+
path: [...params.path, "properties", key]
|
|
3509
|
+
});
|
|
3510
|
+
}
|
|
3511
|
+
const allKeys = new Set(Object.keys(shape));
|
|
3512
|
+
const requiredKeys = new Set([...allKeys].filter((key) => {
|
|
3513
|
+
const v = def.shape[key]._zod;
|
|
3514
|
+
if (ctx.io === "input") {
|
|
3515
|
+
return v.optin === void 0;
|
|
3516
|
+
} else {
|
|
3517
|
+
return v.optout === void 0;
|
|
3518
|
+
}
|
|
3519
|
+
}));
|
|
3520
|
+
if (requiredKeys.size > 0) {
|
|
3521
|
+
json.required = Array.from(requiredKeys);
|
|
3522
|
+
}
|
|
3523
|
+
if (def.catchall?._zod.def.type === "never") {
|
|
3524
|
+
json.additionalProperties = false;
|
|
3525
|
+
} else if (!def.catchall) {
|
|
3526
|
+
if (ctx.io === "output")
|
|
3527
|
+
json.additionalProperties = false;
|
|
3528
|
+
} else if (def.catchall) {
|
|
3529
|
+
json.additionalProperties = process(def.catchall, ctx, {
|
|
3530
|
+
...params,
|
|
3531
|
+
path: [...params.path, "additionalProperties"]
|
|
3532
|
+
});
|
|
3533
|
+
}
|
|
3534
|
+
};
|
|
3535
|
+
const unionProcessor = (schema, ctx, json, params) => {
|
|
3536
|
+
const def = schema._zod.def;
|
|
3537
|
+
const isExclusive = def.inclusive === false;
|
|
3538
|
+
const options = def.options.map((x, i) => process(x, ctx, {
|
|
3539
|
+
...params,
|
|
3540
|
+
path: [...params.path, isExclusive ? "oneOf" : "anyOf", i]
|
|
3541
|
+
}));
|
|
3542
|
+
if (isExclusive) {
|
|
3543
|
+
json.oneOf = options;
|
|
3544
|
+
} else {
|
|
3545
|
+
json.anyOf = options;
|
|
3546
|
+
}
|
|
3547
|
+
};
|
|
3548
|
+
const intersectionProcessor = (schema, ctx, json, params) => {
|
|
3549
|
+
const def = schema._zod.def;
|
|
3550
|
+
const a = process(def.left, ctx, {
|
|
3551
|
+
...params,
|
|
3552
|
+
path: [...params.path, "allOf", 0]
|
|
3553
|
+
});
|
|
3554
|
+
const b = process(def.right, ctx, {
|
|
3555
|
+
...params,
|
|
3556
|
+
path: [...params.path, "allOf", 1]
|
|
3557
|
+
});
|
|
3558
|
+
const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1;
|
|
3559
|
+
const allOf = [
|
|
3560
|
+
...isSimpleIntersection(a) ? a.allOf : [a],
|
|
3561
|
+
...isSimpleIntersection(b) ? b.allOf : [b]
|
|
3562
|
+
];
|
|
3563
|
+
json.allOf = allOf;
|
|
3564
|
+
};
|
|
3565
|
+
const nullableProcessor = (schema, ctx, json, params) => {
|
|
3566
|
+
const def = schema._zod.def;
|
|
3567
|
+
const inner = process(def.innerType, ctx, params);
|
|
3568
|
+
const seen = ctx.seen.get(schema);
|
|
3569
|
+
if (ctx.target === "openapi-3.0") {
|
|
3570
|
+
seen.ref = def.innerType;
|
|
3571
|
+
json.nullable = true;
|
|
3572
|
+
} else {
|
|
3573
|
+
json.anyOf = [inner, { type: "null" }];
|
|
3574
|
+
}
|
|
3575
|
+
};
|
|
3576
|
+
const nonoptionalProcessor = (schema, ctx, _json, params) => {
|
|
3577
|
+
const def = schema._zod.def;
|
|
3578
|
+
process(def.innerType, ctx, params);
|
|
3579
|
+
const seen = ctx.seen.get(schema);
|
|
3580
|
+
seen.ref = def.innerType;
|
|
3581
|
+
};
|
|
3582
|
+
const defaultProcessor = (schema, ctx, json, params) => {
|
|
3583
|
+
const def = schema._zod.def;
|
|
3584
|
+
process(def.innerType, ctx, params);
|
|
3585
|
+
const seen = ctx.seen.get(schema);
|
|
3586
|
+
seen.ref = def.innerType;
|
|
3587
|
+
json.default = JSON.parse(JSON.stringify(def.defaultValue));
|
|
3588
|
+
};
|
|
3589
|
+
const prefaultProcessor = (schema, ctx, json, params) => {
|
|
3590
|
+
const def = schema._zod.def;
|
|
3591
|
+
process(def.innerType, ctx, params);
|
|
3592
|
+
const seen = ctx.seen.get(schema);
|
|
3593
|
+
seen.ref = def.innerType;
|
|
3594
|
+
if (ctx.io === "input")
|
|
3595
|
+
json._prefault = JSON.parse(JSON.stringify(def.defaultValue));
|
|
3596
|
+
};
|
|
3597
|
+
const catchProcessor = (schema, ctx, json, params) => {
|
|
3598
|
+
const def = schema._zod.def;
|
|
3599
|
+
process(def.innerType, ctx, params);
|
|
3600
|
+
const seen = ctx.seen.get(schema);
|
|
3601
|
+
seen.ref = def.innerType;
|
|
3602
|
+
let catchValue;
|
|
3603
|
+
try {
|
|
3604
|
+
catchValue = def.catchValue(void 0);
|
|
3605
|
+
} catch {
|
|
3606
|
+
throw new Error("Dynamic catch values are not supported in JSON Schema");
|
|
3607
|
+
}
|
|
3608
|
+
json.default = catchValue;
|
|
3609
|
+
};
|
|
3610
|
+
const pipeProcessor = (schema, ctx, _json, params) => {
|
|
3611
|
+
const def = schema._zod.def;
|
|
3612
|
+
const inIsTransform = def.in._zod.traits.has("$ZodTransform");
|
|
3613
|
+
const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out;
|
|
3614
|
+
process(innerType, ctx, params);
|
|
3615
|
+
const seen = ctx.seen.get(schema);
|
|
3616
|
+
seen.ref = innerType;
|
|
3617
|
+
};
|
|
3618
|
+
const readonlyProcessor = (schema, ctx, json, params) => {
|
|
3619
|
+
const def = schema._zod.def;
|
|
3620
|
+
process(def.innerType, ctx, params);
|
|
3621
|
+
const seen = ctx.seen.get(schema);
|
|
3622
|
+
seen.ref = def.innerType;
|
|
3623
|
+
json.readOnly = true;
|
|
3624
|
+
};
|
|
3625
|
+
const optionalProcessor = (schema, ctx, _json, params) => {
|
|
3626
|
+
const def = schema._zod.def;
|
|
3627
|
+
process(def.innerType, ctx, params);
|
|
3628
|
+
const seen = ctx.seen.get(schema);
|
|
3629
|
+
seen.ref = def.innerType;
|
|
3630
|
+
};
|
|
3631
|
+
const ZodISODateTime = /* @__PURE__ */ $constructor("ZodISODateTime", (inst, def) => {
|
|
3632
|
+
$ZodISODateTime.init(inst, def);
|
|
3633
|
+
ZodStringFormat.init(inst, def);
|
|
3634
|
+
});
|
|
3635
|
+
function datetime(params) {
|
|
3636
|
+
return /* @__PURE__ */ _isoDateTime(ZodISODateTime, params);
|
|
3637
|
+
}
|
|
3638
|
+
const ZodISODate = /* @__PURE__ */ $constructor("ZodISODate", (inst, def) => {
|
|
3639
|
+
$ZodISODate.init(inst, def);
|
|
3640
|
+
ZodStringFormat.init(inst, def);
|
|
3641
|
+
});
|
|
3642
|
+
function date(params) {
|
|
3643
|
+
return /* @__PURE__ */ _isoDate(ZodISODate, params);
|
|
3644
|
+
}
|
|
3645
|
+
const ZodISOTime = /* @__PURE__ */ $constructor("ZodISOTime", (inst, def) => {
|
|
3646
|
+
$ZodISOTime.init(inst, def);
|
|
3647
|
+
ZodStringFormat.init(inst, def);
|
|
3648
|
+
});
|
|
3649
|
+
function time(params) {
|
|
3650
|
+
return /* @__PURE__ */ _isoTime(ZodISOTime, params);
|
|
3651
|
+
}
|
|
3652
|
+
const ZodISODuration = /* @__PURE__ */ $constructor("ZodISODuration", (inst, def) => {
|
|
3653
|
+
$ZodISODuration.init(inst, def);
|
|
3654
|
+
ZodStringFormat.init(inst, def);
|
|
3655
|
+
});
|
|
3656
|
+
function duration(params) {
|
|
3657
|
+
return /* @__PURE__ */ _isoDuration(ZodISODuration, params);
|
|
3658
|
+
}
|
|
3659
|
+
const initializer = (inst, issues) => {
|
|
3660
|
+
$ZodError.init(inst, issues);
|
|
3661
|
+
inst.name = "ZodError";
|
|
3662
|
+
Object.defineProperties(inst, {
|
|
3663
|
+
format: {
|
|
3664
|
+
value: (mapper) => formatError(inst, mapper)
|
|
3665
|
+
// enumerable: false,
|
|
3666
|
+
},
|
|
3667
|
+
flatten: {
|
|
3668
|
+
value: (mapper) => flattenError(inst, mapper)
|
|
3669
|
+
// enumerable: false,
|
|
3670
|
+
},
|
|
3671
|
+
addIssue: {
|
|
3672
|
+
value: (issue2) => {
|
|
3673
|
+
inst.issues.push(issue2);
|
|
3674
|
+
inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2);
|
|
3675
|
+
}
|
|
3676
|
+
// enumerable: false,
|
|
3677
|
+
},
|
|
3678
|
+
addIssues: {
|
|
3679
|
+
value: (issues2) => {
|
|
3680
|
+
inst.issues.push(...issues2);
|
|
3681
|
+
inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2);
|
|
3682
|
+
}
|
|
3683
|
+
// enumerable: false,
|
|
3684
|
+
},
|
|
3685
|
+
isEmpty: {
|
|
3686
|
+
get() {
|
|
3687
|
+
return inst.issues.length === 0;
|
|
3688
|
+
}
|
|
3689
|
+
// enumerable: false,
|
|
3690
|
+
}
|
|
3691
|
+
});
|
|
3692
|
+
};
|
|
3693
|
+
const ZodError = /* @__PURE__ */ $constructor("ZodError", initializer);
|
|
3694
|
+
const ZodRealError = /* @__PURE__ */ $constructor("ZodError", initializer, {
|
|
3695
|
+
Parent: Error
|
|
3696
|
+
});
|
|
3697
|
+
const parse = /* @__PURE__ */ _parse(ZodRealError);
|
|
3698
|
+
const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
3699
|
+
const safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
3700
|
+
const safeParseAsync = /* @__PURE__ */ _safeParseAsync(ZodRealError);
|
|
3701
|
+
const encode = /* @__PURE__ */ _encode(ZodRealError);
|
|
3702
|
+
const decode = /* @__PURE__ */ _decode(ZodRealError);
|
|
3703
|
+
const encodeAsync = /* @__PURE__ */ _encodeAsync(ZodRealError);
|
|
3704
|
+
const decodeAsync = /* @__PURE__ */ _decodeAsync(ZodRealError);
|
|
3705
|
+
const safeEncode = /* @__PURE__ */ _safeEncode(ZodRealError);
|
|
3706
|
+
const safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
|
|
3707
|
+
const safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
3708
|
+
const safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
3709
|
+
const _installedGroups = /* @__PURE__ */ new WeakMap();
|
|
3710
|
+
function _installLazyMethods(inst, group, methods) {
|
|
3711
|
+
const proto = Object.getPrototypeOf(inst);
|
|
3712
|
+
let installed = _installedGroups.get(proto);
|
|
3713
|
+
if (!installed) {
|
|
3714
|
+
installed = /* @__PURE__ */ new Set();
|
|
3715
|
+
_installedGroups.set(proto, installed);
|
|
3716
|
+
}
|
|
3717
|
+
if (installed.has(group))
|
|
3718
|
+
return;
|
|
3719
|
+
installed.add(group);
|
|
3720
|
+
for (const key in methods) {
|
|
3721
|
+
const fn = methods[key];
|
|
3722
|
+
Object.defineProperty(proto, key, {
|
|
3723
|
+
configurable: true,
|
|
3724
|
+
enumerable: false,
|
|
3725
|
+
get() {
|
|
3726
|
+
const bound = fn.bind(this);
|
|
3727
|
+
Object.defineProperty(this, key, {
|
|
3728
|
+
configurable: true,
|
|
3729
|
+
writable: true,
|
|
3730
|
+
enumerable: true,
|
|
3731
|
+
value: bound
|
|
3732
|
+
});
|
|
3733
|
+
return bound;
|
|
3734
|
+
},
|
|
3735
|
+
set(v) {
|
|
3736
|
+
Object.defineProperty(this, key, {
|
|
3737
|
+
configurable: true,
|
|
3738
|
+
writable: true,
|
|
3739
|
+
enumerable: true,
|
|
3740
|
+
value: v
|
|
3741
|
+
});
|
|
3742
|
+
}
|
|
3743
|
+
});
|
|
3744
|
+
}
|
|
3745
|
+
}
|
|
3746
|
+
const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
3747
|
+
$ZodType.init(inst, def);
|
|
3748
|
+
Object.assign(inst["~standard"], {
|
|
3749
|
+
jsonSchema: {
|
|
3750
|
+
input: createStandardJSONSchemaMethod(inst, "input"),
|
|
3751
|
+
output: createStandardJSONSchemaMethod(inst, "output")
|
|
3752
|
+
}
|
|
3753
|
+
});
|
|
3754
|
+
inst.toJSONSchema = createToJSONSchemaMethod(inst, {});
|
|
3755
|
+
inst.def = def;
|
|
3756
|
+
inst.type = def.type;
|
|
3757
|
+
Object.defineProperty(inst, "_def", { value: def });
|
|
3758
|
+
inst.parse = (data, params) => parse(inst, data, params, { callee: inst.parse });
|
|
3759
|
+
inst.safeParse = (data, params) => safeParse(inst, data, params);
|
|
3760
|
+
inst.parseAsync = async (data, params) => parseAsync(inst, data, params, { callee: inst.parseAsync });
|
|
3761
|
+
inst.safeParseAsync = async (data, params) => safeParseAsync(inst, data, params);
|
|
3762
|
+
inst.spa = inst.safeParseAsync;
|
|
3763
|
+
inst.encode = (data, params) => encode(inst, data, params);
|
|
3764
|
+
inst.decode = (data, params) => decode(inst, data, params);
|
|
3765
|
+
inst.encodeAsync = async (data, params) => encodeAsync(inst, data, params);
|
|
3766
|
+
inst.decodeAsync = async (data, params) => decodeAsync(inst, data, params);
|
|
3767
|
+
inst.safeEncode = (data, params) => safeEncode(inst, data, params);
|
|
3768
|
+
inst.safeDecode = (data, params) => safeDecode(inst, data, params);
|
|
3769
|
+
inst.safeEncodeAsync = async (data, params) => safeEncodeAsync(inst, data, params);
|
|
3770
|
+
inst.safeDecodeAsync = async (data, params) => safeDecodeAsync(inst, data, params);
|
|
3771
|
+
_installLazyMethods(inst, "ZodType", {
|
|
3772
|
+
check(...chks) {
|
|
3773
|
+
const def2 = this.def;
|
|
3774
|
+
return this.clone(mergeDefs(def2, {
|
|
3775
|
+
checks: [
|
|
3776
|
+
...def2.checks ?? [],
|
|
3777
|
+
...chks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch)
|
|
3778
|
+
]
|
|
3779
|
+
}), { parent: true });
|
|
3780
|
+
},
|
|
3781
|
+
with(...chks) {
|
|
3782
|
+
return this.check(...chks);
|
|
3783
|
+
},
|
|
3784
|
+
clone(def2, params) {
|
|
3785
|
+
return clone(this, def2, params);
|
|
3786
|
+
},
|
|
3787
|
+
brand() {
|
|
3788
|
+
return this;
|
|
3789
|
+
},
|
|
3790
|
+
register(reg, meta) {
|
|
3791
|
+
reg.add(this, meta);
|
|
3792
|
+
return this;
|
|
3793
|
+
},
|
|
3794
|
+
refine(check, params) {
|
|
3795
|
+
return this.check(refine(check, params));
|
|
3796
|
+
},
|
|
3797
|
+
superRefine(refinement, params) {
|
|
3798
|
+
return this.check(superRefine(refinement, params));
|
|
3799
|
+
},
|
|
3800
|
+
overwrite(fn) {
|
|
3801
|
+
return this.check(/* @__PURE__ */ _overwrite(fn));
|
|
3802
|
+
},
|
|
3803
|
+
optional() {
|
|
3804
|
+
return optional(this);
|
|
3805
|
+
},
|
|
3806
|
+
exactOptional() {
|
|
3807
|
+
return exactOptional(this);
|
|
3808
|
+
},
|
|
3809
|
+
nullable() {
|
|
3810
|
+
return nullable(this);
|
|
3811
|
+
},
|
|
3812
|
+
nullish() {
|
|
3813
|
+
return optional(nullable(this));
|
|
3814
|
+
},
|
|
3815
|
+
nonoptional(params) {
|
|
3816
|
+
return nonoptional(this, params);
|
|
3817
|
+
},
|
|
3818
|
+
array() {
|
|
3819
|
+
return array(this);
|
|
3820
|
+
},
|
|
3821
|
+
or(arg) {
|
|
3822
|
+
return union([this, arg]);
|
|
3823
|
+
},
|
|
3824
|
+
and(arg) {
|
|
3825
|
+
return intersection(this, arg);
|
|
3826
|
+
},
|
|
3827
|
+
transform(tx) {
|
|
3828
|
+
return pipe(this, transform(tx));
|
|
3829
|
+
},
|
|
3830
|
+
default(d) {
|
|
3831
|
+
return _default(this, d);
|
|
3832
|
+
},
|
|
3833
|
+
prefault(d) {
|
|
3834
|
+
return prefault(this, d);
|
|
3835
|
+
},
|
|
3836
|
+
catch(params) {
|
|
3837
|
+
return _catch(this, params);
|
|
3838
|
+
},
|
|
3839
|
+
pipe(target) {
|
|
3840
|
+
return pipe(this, target);
|
|
3841
|
+
},
|
|
3842
|
+
readonly() {
|
|
3843
|
+
return readonly(this);
|
|
3844
|
+
},
|
|
3845
|
+
describe(description) {
|
|
3846
|
+
const cl = this.clone();
|
|
3847
|
+
globalRegistry.add(cl, { description });
|
|
3848
|
+
return cl;
|
|
3849
|
+
},
|
|
3850
|
+
meta(...args) {
|
|
3851
|
+
if (args.length === 0)
|
|
3852
|
+
return globalRegistry.get(this);
|
|
3853
|
+
const cl = this.clone();
|
|
3854
|
+
globalRegistry.add(cl, args[0]);
|
|
3855
|
+
return cl;
|
|
3856
|
+
},
|
|
3857
|
+
isOptional() {
|
|
3858
|
+
return this.safeParse(void 0).success;
|
|
3859
|
+
},
|
|
3860
|
+
isNullable() {
|
|
3861
|
+
return this.safeParse(null).success;
|
|
3862
|
+
},
|
|
3863
|
+
apply(fn) {
|
|
3864
|
+
return fn(this);
|
|
3865
|
+
}
|
|
3866
|
+
});
|
|
3867
|
+
Object.defineProperty(inst, "description", {
|
|
3868
|
+
get() {
|
|
3869
|
+
return globalRegistry.get(inst)?.description;
|
|
3870
|
+
},
|
|
3871
|
+
configurable: true
|
|
3872
|
+
});
|
|
3873
|
+
return inst;
|
|
3874
|
+
});
|
|
3875
|
+
const _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
|
|
3876
|
+
$ZodString.init(inst, def);
|
|
3877
|
+
ZodType.init(inst, def);
|
|
3878
|
+
inst._zod.processJSONSchema = (ctx, json, params) => stringProcessor(inst, ctx, json);
|
|
3879
|
+
const bag = inst._zod.bag;
|
|
3880
|
+
inst.format = bag.format ?? null;
|
|
3881
|
+
inst.minLength = bag.minimum ?? null;
|
|
3882
|
+
inst.maxLength = bag.maximum ?? null;
|
|
3883
|
+
_installLazyMethods(inst, "_ZodString", {
|
|
3884
|
+
regex(...args) {
|
|
3885
|
+
return this.check(/* @__PURE__ */ _regex(...args));
|
|
3886
|
+
},
|
|
3887
|
+
includes(...args) {
|
|
3888
|
+
return this.check(/* @__PURE__ */ _includes(...args));
|
|
3889
|
+
},
|
|
3890
|
+
startsWith(...args) {
|
|
3891
|
+
return this.check(/* @__PURE__ */ _startsWith(...args));
|
|
3892
|
+
},
|
|
3893
|
+
endsWith(...args) {
|
|
3894
|
+
return this.check(/* @__PURE__ */ _endsWith(...args));
|
|
3895
|
+
},
|
|
3896
|
+
min(...args) {
|
|
3897
|
+
return this.check(/* @__PURE__ */ _minLength(...args));
|
|
3898
|
+
},
|
|
3899
|
+
max(...args) {
|
|
3900
|
+
return this.check(/* @__PURE__ */ _maxLength(...args));
|
|
3901
|
+
},
|
|
3902
|
+
length(...args) {
|
|
3903
|
+
return this.check(/* @__PURE__ */ _length(...args));
|
|
3904
|
+
},
|
|
3905
|
+
nonempty(...args) {
|
|
3906
|
+
return this.check(/* @__PURE__ */ _minLength(1, ...args));
|
|
3907
|
+
},
|
|
3908
|
+
lowercase(params) {
|
|
3909
|
+
return this.check(/* @__PURE__ */ _lowercase(params));
|
|
3910
|
+
},
|
|
3911
|
+
uppercase(params) {
|
|
3912
|
+
return this.check(/* @__PURE__ */ _uppercase(params));
|
|
3913
|
+
},
|
|
3914
|
+
trim() {
|
|
3915
|
+
return this.check(/* @__PURE__ */ _trim());
|
|
3916
|
+
},
|
|
3917
|
+
normalize(...args) {
|
|
3918
|
+
return this.check(/* @__PURE__ */ _normalize(...args));
|
|
3919
|
+
},
|
|
3920
|
+
toLowerCase() {
|
|
3921
|
+
return this.check(/* @__PURE__ */ _toLowerCase());
|
|
3922
|
+
},
|
|
3923
|
+
toUpperCase() {
|
|
3924
|
+
return this.check(/* @__PURE__ */ _toUpperCase());
|
|
3925
|
+
},
|
|
3926
|
+
slugify() {
|
|
3927
|
+
return this.check(/* @__PURE__ */ _slugify());
|
|
3928
|
+
}
|
|
3929
|
+
});
|
|
3930
|
+
});
|
|
3931
|
+
const ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
|
|
3932
|
+
$ZodString.init(inst, def);
|
|
3933
|
+
_ZodString.init(inst, def);
|
|
3934
|
+
inst.email = (params) => inst.check(/* @__PURE__ */ _email(ZodEmail, params));
|
|
3935
|
+
inst.url = (params) => inst.check(/* @__PURE__ */ _url(ZodURL, params));
|
|
3936
|
+
inst.jwt = (params) => inst.check(/* @__PURE__ */ _jwt(ZodJWT, params));
|
|
3937
|
+
inst.emoji = (params) => inst.check(/* @__PURE__ */ _emoji(ZodEmoji, params));
|
|
3938
|
+
inst.guid = (params) => inst.check(/* @__PURE__ */ _guid(ZodGUID, params));
|
|
3939
|
+
inst.uuid = (params) => inst.check(/* @__PURE__ */ _uuid(ZodUUID, params));
|
|
3940
|
+
inst.uuidv4 = (params) => inst.check(/* @__PURE__ */ _uuidv4(ZodUUID, params));
|
|
3941
|
+
inst.uuidv6 = (params) => inst.check(/* @__PURE__ */ _uuidv6(ZodUUID, params));
|
|
3942
|
+
inst.uuidv7 = (params) => inst.check(/* @__PURE__ */ _uuidv7(ZodUUID, params));
|
|
3943
|
+
inst.nanoid = (params) => inst.check(/* @__PURE__ */ _nanoid(ZodNanoID, params));
|
|
3944
|
+
inst.guid = (params) => inst.check(/* @__PURE__ */ _guid(ZodGUID, params));
|
|
3945
|
+
inst.cuid = (params) => inst.check(/* @__PURE__ */ _cuid(ZodCUID, params));
|
|
3946
|
+
inst.cuid2 = (params) => inst.check(/* @__PURE__ */ _cuid2(ZodCUID2, params));
|
|
3947
|
+
inst.ulid = (params) => inst.check(/* @__PURE__ */ _ulid(ZodULID, params));
|
|
3948
|
+
inst.base64 = (params) => inst.check(/* @__PURE__ */ _base64(ZodBase64, params));
|
|
3949
|
+
inst.base64url = (params) => inst.check(/* @__PURE__ */ _base64url(ZodBase64URL, params));
|
|
3950
|
+
inst.xid = (params) => inst.check(/* @__PURE__ */ _xid(ZodXID, params));
|
|
3951
|
+
inst.ksuid = (params) => inst.check(/* @__PURE__ */ _ksuid(ZodKSUID, params));
|
|
3952
|
+
inst.ipv4 = (params) => inst.check(/* @__PURE__ */ _ipv4(ZodIPv4, params));
|
|
3953
|
+
inst.ipv6 = (params) => inst.check(/* @__PURE__ */ _ipv6(ZodIPv6, params));
|
|
3954
|
+
inst.cidrv4 = (params) => inst.check(/* @__PURE__ */ _cidrv4(ZodCIDRv4, params));
|
|
3955
|
+
inst.cidrv6 = (params) => inst.check(/* @__PURE__ */ _cidrv6(ZodCIDRv6, params));
|
|
3956
|
+
inst.e164 = (params) => inst.check(/* @__PURE__ */ _e164(ZodE164, params));
|
|
3957
|
+
inst.datetime = (params) => inst.check(datetime(params));
|
|
3958
|
+
inst.date = (params) => inst.check(date(params));
|
|
3959
|
+
inst.time = (params) => inst.check(time(params));
|
|
3960
|
+
inst.duration = (params) => inst.check(duration(params));
|
|
3961
|
+
});
|
|
3962
|
+
function string(params) {
|
|
3963
|
+
return /* @__PURE__ */ _string(ZodString, params);
|
|
3964
|
+
}
|
|
3965
|
+
const ZodStringFormat = /* @__PURE__ */ $constructor("ZodStringFormat", (inst, def) => {
|
|
3966
|
+
$ZodStringFormat.init(inst, def);
|
|
3967
|
+
_ZodString.init(inst, def);
|
|
3968
|
+
});
|
|
3969
|
+
const ZodEmail = /* @__PURE__ */ $constructor("ZodEmail", (inst, def) => {
|
|
3970
|
+
$ZodEmail.init(inst, def);
|
|
3971
|
+
ZodStringFormat.init(inst, def);
|
|
3972
|
+
});
|
|
3973
|
+
const ZodGUID = /* @__PURE__ */ $constructor("ZodGUID", (inst, def) => {
|
|
3974
|
+
$ZodGUID.init(inst, def);
|
|
3975
|
+
ZodStringFormat.init(inst, def);
|
|
3976
|
+
});
|
|
3977
|
+
const ZodUUID = /* @__PURE__ */ $constructor("ZodUUID", (inst, def) => {
|
|
3978
|
+
$ZodUUID.init(inst, def);
|
|
3979
|
+
ZodStringFormat.init(inst, def);
|
|
3980
|
+
});
|
|
3981
|
+
const ZodURL = /* @__PURE__ */ $constructor("ZodURL", (inst, def) => {
|
|
3982
|
+
$ZodURL.init(inst, def);
|
|
3983
|
+
ZodStringFormat.init(inst, def);
|
|
3984
|
+
});
|
|
3985
|
+
const ZodEmoji = /* @__PURE__ */ $constructor("ZodEmoji", (inst, def) => {
|
|
3986
|
+
$ZodEmoji.init(inst, def);
|
|
3987
|
+
ZodStringFormat.init(inst, def);
|
|
3988
|
+
});
|
|
3989
|
+
const ZodNanoID = /* @__PURE__ */ $constructor("ZodNanoID", (inst, def) => {
|
|
3990
|
+
$ZodNanoID.init(inst, def);
|
|
3991
|
+
ZodStringFormat.init(inst, def);
|
|
3992
|
+
});
|
|
3993
|
+
const ZodCUID = /* @__PURE__ */ $constructor("ZodCUID", (inst, def) => {
|
|
3994
|
+
$ZodCUID.init(inst, def);
|
|
3995
|
+
ZodStringFormat.init(inst, def);
|
|
3996
|
+
});
|
|
3997
|
+
const ZodCUID2 = /* @__PURE__ */ $constructor("ZodCUID2", (inst, def) => {
|
|
3998
|
+
$ZodCUID2.init(inst, def);
|
|
3999
|
+
ZodStringFormat.init(inst, def);
|
|
4000
|
+
});
|
|
4001
|
+
const ZodULID = /* @__PURE__ */ $constructor("ZodULID", (inst, def) => {
|
|
4002
|
+
$ZodULID.init(inst, def);
|
|
4003
|
+
ZodStringFormat.init(inst, def);
|
|
4004
|
+
});
|
|
4005
|
+
const ZodXID = /* @__PURE__ */ $constructor("ZodXID", (inst, def) => {
|
|
4006
|
+
$ZodXID.init(inst, def);
|
|
4007
|
+
ZodStringFormat.init(inst, def);
|
|
4008
|
+
});
|
|
4009
|
+
const ZodKSUID = /* @__PURE__ */ $constructor("ZodKSUID", (inst, def) => {
|
|
4010
|
+
$ZodKSUID.init(inst, def);
|
|
4011
|
+
ZodStringFormat.init(inst, def);
|
|
4012
|
+
});
|
|
4013
|
+
const ZodIPv4 = /* @__PURE__ */ $constructor("ZodIPv4", (inst, def) => {
|
|
4014
|
+
$ZodIPv4.init(inst, def);
|
|
4015
|
+
ZodStringFormat.init(inst, def);
|
|
4016
|
+
});
|
|
4017
|
+
const ZodIPv6 = /* @__PURE__ */ $constructor("ZodIPv6", (inst, def) => {
|
|
4018
|
+
$ZodIPv6.init(inst, def);
|
|
4019
|
+
ZodStringFormat.init(inst, def);
|
|
4020
|
+
});
|
|
4021
|
+
const ZodCIDRv4 = /* @__PURE__ */ $constructor("ZodCIDRv4", (inst, def) => {
|
|
4022
|
+
$ZodCIDRv4.init(inst, def);
|
|
4023
|
+
ZodStringFormat.init(inst, def);
|
|
4024
|
+
});
|
|
4025
|
+
const ZodCIDRv6 = /* @__PURE__ */ $constructor("ZodCIDRv6", (inst, def) => {
|
|
4026
|
+
$ZodCIDRv6.init(inst, def);
|
|
4027
|
+
ZodStringFormat.init(inst, def);
|
|
4028
|
+
});
|
|
4029
|
+
const ZodBase64 = /* @__PURE__ */ $constructor("ZodBase64", (inst, def) => {
|
|
4030
|
+
$ZodBase64.init(inst, def);
|
|
4031
|
+
ZodStringFormat.init(inst, def);
|
|
4032
|
+
});
|
|
4033
|
+
const ZodBase64URL = /* @__PURE__ */ $constructor("ZodBase64URL", (inst, def) => {
|
|
4034
|
+
$ZodBase64URL.init(inst, def);
|
|
4035
|
+
ZodStringFormat.init(inst, def);
|
|
4036
|
+
});
|
|
4037
|
+
const ZodE164 = /* @__PURE__ */ $constructor("ZodE164", (inst, def) => {
|
|
4038
|
+
$ZodE164.init(inst, def);
|
|
4039
|
+
ZodStringFormat.init(inst, def);
|
|
4040
|
+
});
|
|
4041
|
+
const ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => {
|
|
4042
|
+
$ZodJWT.init(inst, def);
|
|
4043
|
+
ZodStringFormat.init(inst, def);
|
|
4044
|
+
});
|
|
4045
|
+
const ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
|
|
4046
|
+
$ZodNumber.init(inst, def);
|
|
4047
|
+
ZodType.init(inst, def);
|
|
4048
|
+
inst._zod.processJSONSchema = (ctx, json, params) => numberProcessor(inst, ctx, json);
|
|
4049
|
+
_installLazyMethods(inst, "ZodNumber", {
|
|
4050
|
+
gt(value, params) {
|
|
4051
|
+
return this.check(/* @__PURE__ */ _gt(value, params));
|
|
4052
|
+
},
|
|
4053
|
+
gte(value, params) {
|
|
4054
|
+
return this.check(/* @__PURE__ */ _gte(value, params));
|
|
4055
|
+
},
|
|
4056
|
+
min(value, params) {
|
|
4057
|
+
return this.check(/* @__PURE__ */ _gte(value, params));
|
|
4058
|
+
},
|
|
4059
|
+
lt(value, params) {
|
|
4060
|
+
return this.check(/* @__PURE__ */ _lt(value, params));
|
|
4061
|
+
},
|
|
4062
|
+
lte(value, params) {
|
|
4063
|
+
return this.check(/* @__PURE__ */ _lte(value, params));
|
|
4064
|
+
},
|
|
4065
|
+
max(value, params) {
|
|
4066
|
+
return this.check(/* @__PURE__ */ _lte(value, params));
|
|
4067
|
+
},
|
|
4068
|
+
int(params) {
|
|
4069
|
+
return this.check(int(params));
|
|
4070
|
+
},
|
|
4071
|
+
safe(params) {
|
|
4072
|
+
return this.check(int(params));
|
|
4073
|
+
},
|
|
4074
|
+
positive(params) {
|
|
4075
|
+
return this.check(/* @__PURE__ */ _gt(0, params));
|
|
4076
|
+
},
|
|
4077
|
+
nonnegative(params) {
|
|
4078
|
+
return this.check(/* @__PURE__ */ _gte(0, params));
|
|
4079
|
+
},
|
|
4080
|
+
negative(params) {
|
|
4081
|
+
return this.check(/* @__PURE__ */ _lt(0, params));
|
|
4082
|
+
},
|
|
4083
|
+
nonpositive(params) {
|
|
4084
|
+
return this.check(/* @__PURE__ */ _lte(0, params));
|
|
4085
|
+
},
|
|
4086
|
+
multipleOf(value, params) {
|
|
4087
|
+
return this.check(/* @__PURE__ */ _multipleOf(value, params));
|
|
4088
|
+
},
|
|
4089
|
+
step(value, params) {
|
|
4090
|
+
return this.check(/* @__PURE__ */ _multipleOf(value, params));
|
|
4091
|
+
},
|
|
4092
|
+
finite() {
|
|
4093
|
+
return this;
|
|
4094
|
+
}
|
|
4095
|
+
});
|
|
4096
|
+
const bag = inst._zod.bag;
|
|
4097
|
+
inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
|
|
4098
|
+
inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
|
|
4099
|
+
inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5);
|
|
4100
|
+
inst.isFinite = true;
|
|
4101
|
+
inst.format = bag.format ?? null;
|
|
4102
|
+
});
|
|
4103
|
+
function number(params) {
|
|
4104
|
+
return /* @__PURE__ */ _number(ZodNumber, params);
|
|
4105
|
+
}
|
|
4106
|
+
const ZodNumberFormat = /* @__PURE__ */ $constructor("ZodNumberFormat", (inst, def) => {
|
|
4107
|
+
$ZodNumberFormat.init(inst, def);
|
|
4108
|
+
ZodNumber.init(inst, def);
|
|
4109
|
+
});
|
|
4110
|
+
function int(params) {
|
|
4111
|
+
return /* @__PURE__ */ _int(ZodNumberFormat, params);
|
|
4112
|
+
}
|
|
4113
|
+
const ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => {
|
|
4114
|
+
$ZodBoolean.init(inst, def);
|
|
4115
|
+
ZodType.init(inst, def);
|
|
4116
|
+
inst._zod.processJSONSchema = (ctx, json, params) => booleanProcessor(inst, ctx, json);
|
|
4117
|
+
});
|
|
4118
|
+
function boolean(params) {
|
|
4119
|
+
return /* @__PURE__ */ _boolean(ZodBoolean, params);
|
|
4120
|
+
}
|
|
4121
|
+
const ZodAny = /* @__PURE__ */ $constructor("ZodAny", (inst, def) => {
|
|
4122
|
+
$ZodAny.init(inst, def);
|
|
4123
|
+
ZodType.init(inst, def);
|
|
4124
|
+
inst._zod.processJSONSchema = (ctx, json, params) => anyProcessor();
|
|
4125
|
+
});
|
|
4126
|
+
function any() {
|
|
4127
|
+
return /* @__PURE__ */ _any(ZodAny);
|
|
4128
|
+
}
|
|
4129
|
+
const ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => {
|
|
4130
|
+
$ZodUnknown.init(inst, def);
|
|
4131
|
+
ZodType.init(inst, def);
|
|
4132
|
+
inst._zod.processJSONSchema = (ctx, json, params) => unknownProcessor();
|
|
4133
|
+
});
|
|
4134
|
+
function unknown() {
|
|
4135
|
+
return /* @__PURE__ */ _unknown(ZodUnknown);
|
|
4136
|
+
}
|
|
4137
|
+
const ZodNever = /* @__PURE__ */ $constructor("ZodNever", (inst, def) => {
|
|
4138
|
+
$ZodNever.init(inst, def);
|
|
4139
|
+
ZodType.init(inst, def);
|
|
4140
|
+
inst._zod.processJSONSchema = (ctx, json, params) => neverProcessor(inst, ctx, json);
|
|
4141
|
+
});
|
|
4142
|
+
function never(params) {
|
|
4143
|
+
return /* @__PURE__ */ _never(ZodNever, params);
|
|
4144
|
+
}
|
|
4145
|
+
const ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => {
|
|
4146
|
+
$ZodArray.init(inst, def);
|
|
4147
|
+
ZodType.init(inst, def);
|
|
4148
|
+
inst._zod.processJSONSchema = (ctx, json, params) => arrayProcessor(inst, ctx, json, params);
|
|
4149
|
+
inst.element = def.element;
|
|
4150
|
+
_installLazyMethods(inst, "ZodArray", {
|
|
4151
|
+
min(n, params) {
|
|
4152
|
+
return this.check(/* @__PURE__ */ _minLength(n, params));
|
|
4153
|
+
},
|
|
4154
|
+
nonempty(params) {
|
|
4155
|
+
return this.check(/* @__PURE__ */ _minLength(1, params));
|
|
4156
|
+
},
|
|
4157
|
+
max(n, params) {
|
|
4158
|
+
return this.check(/* @__PURE__ */ _maxLength(n, params));
|
|
4159
|
+
},
|
|
4160
|
+
length(n, params) {
|
|
4161
|
+
return this.check(/* @__PURE__ */ _length(n, params));
|
|
4162
|
+
},
|
|
4163
|
+
unwrap() {
|
|
4164
|
+
return this.element;
|
|
4165
|
+
}
|
|
4166
|
+
});
|
|
4167
|
+
});
|
|
4168
|
+
function array(element, params) {
|
|
4169
|
+
return /* @__PURE__ */ _array(ZodArray, element, params);
|
|
4170
|
+
}
|
|
4171
|
+
const ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
|
|
4172
|
+
$ZodObjectJIT.init(inst, def);
|
|
4173
|
+
ZodType.init(inst, def);
|
|
4174
|
+
inst._zod.processJSONSchema = (ctx, json, params) => objectProcessor(inst, ctx, json, params);
|
|
4175
|
+
defineLazy(inst, "shape", () => {
|
|
4176
|
+
return def.shape;
|
|
4177
|
+
});
|
|
4178
|
+
_installLazyMethods(inst, "ZodObject", {
|
|
4179
|
+
keyof() {
|
|
4180
|
+
return _enum(Object.keys(this._zod.def.shape));
|
|
4181
|
+
},
|
|
4182
|
+
catchall(catchall) {
|
|
4183
|
+
return this.clone({ ...this._zod.def, catchall });
|
|
4184
|
+
},
|
|
4185
|
+
passthrough() {
|
|
4186
|
+
return this.clone({ ...this._zod.def, catchall: unknown() });
|
|
4187
|
+
},
|
|
4188
|
+
loose() {
|
|
4189
|
+
return this.clone({ ...this._zod.def, catchall: unknown() });
|
|
4190
|
+
},
|
|
4191
|
+
strict() {
|
|
4192
|
+
return this.clone({ ...this._zod.def, catchall: never() });
|
|
4193
|
+
},
|
|
4194
|
+
strip() {
|
|
4195
|
+
return this.clone({ ...this._zod.def, catchall: void 0 });
|
|
4196
|
+
},
|
|
4197
|
+
extend(incoming) {
|
|
4198
|
+
return extend(this, incoming);
|
|
4199
|
+
},
|
|
4200
|
+
safeExtend(incoming) {
|
|
4201
|
+
return safeExtend(this, incoming);
|
|
4202
|
+
},
|
|
4203
|
+
merge(other) {
|
|
4204
|
+
return merge(this, other);
|
|
4205
|
+
},
|
|
4206
|
+
pick(mask) {
|
|
4207
|
+
return pick(this, mask);
|
|
4208
|
+
},
|
|
4209
|
+
omit(mask) {
|
|
4210
|
+
return omit(this, mask);
|
|
4211
|
+
},
|
|
4212
|
+
partial(...args) {
|
|
4213
|
+
return partial(ZodOptional, this, args[0]);
|
|
4214
|
+
},
|
|
4215
|
+
required(...args) {
|
|
4216
|
+
return required(ZodNonOptional, this, args[0]);
|
|
4217
|
+
}
|
|
4218
|
+
});
|
|
4219
|
+
});
|
|
4220
|
+
function object(shape, params) {
|
|
4221
|
+
const def = {
|
|
4222
|
+
type: "object",
|
|
4223
|
+
shape: shape ?? {},
|
|
4224
|
+
...normalizeParams(params)
|
|
4225
|
+
};
|
|
4226
|
+
return new ZodObject(def);
|
|
4227
|
+
}
|
|
4228
|
+
const ZodUnion = /* @__PURE__ */ $constructor("ZodUnion", (inst, def) => {
|
|
4229
|
+
$ZodUnion.init(inst, def);
|
|
4230
|
+
ZodType.init(inst, def);
|
|
4231
|
+
inst._zod.processJSONSchema = (ctx, json, params) => unionProcessor(inst, ctx, json, params);
|
|
4232
|
+
inst.options = def.options;
|
|
4233
|
+
});
|
|
4234
|
+
function union(options, params) {
|
|
4235
|
+
return new ZodUnion({
|
|
4236
|
+
type: "union",
|
|
4237
|
+
options,
|
|
4238
|
+
...normalizeParams(params)
|
|
4239
|
+
});
|
|
4240
|
+
}
|
|
4241
|
+
const ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("ZodDiscriminatedUnion", (inst, def) => {
|
|
4242
|
+
ZodUnion.init(inst, def);
|
|
4243
|
+
$ZodDiscriminatedUnion.init(inst, def);
|
|
4244
|
+
});
|
|
4245
|
+
function discriminatedUnion(discriminator, options, params) {
|
|
4246
|
+
return new ZodDiscriminatedUnion({
|
|
4247
|
+
type: "union",
|
|
4248
|
+
options,
|
|
4249
|
+
discriminator,
|
|
4250
|
+
...normalizeParams(params)
|
|
4251
|
+
});
|
|
4252
|
+
}
|
|
4253
|
+
const ZodIntersection = /* @__PURE__ */ $constructor("ZodIntersection", (inst, def) => {
|
|
4254
|
+
$ZodIntersection.init(inst, def);
|
|
4255
|
+
ZodType.init(inst, def);
|
|
4256
|
+
inst._zod.processJSONSchema = (ctx, json, params) => intersectionProcessor(inst, ctx, json, params);
|
|
4257
|
+
});
|
|
4258
|
+
function intersection(left, right) {
|
|
4259
|
+
return new ZodIntersection({
|
|
4260
|
+
type: "intersection",
|
|
4261
|
+
left,
|
|
4262
|
+
right
|
|
4263
|
+
});
|
|
4264
|
+
}
|
|
4265
|
+
const ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
|
|
4266
|
+
$ZodEnum.init(inst, def);
|
|
4267
|
+
ZodType.init(inst, def);
|
|
4268
|
+
inst._zod.processJSONSchema = (ctx, json, params) => enumProcessor(inst, ctx, json);
|
|
4269
|
+
inst.enum = def.entries;
|
|
4270
|
+
inst.options = Object.values(def.entries);
|
|
4271
|
+
const keys = new Set(Object.keys(def.entries));
|
|
4272
|
+
inst.extract = (values, params) => {
|
|
4273
|
+
const newEntries = {};
|
|
4274
|
+
for (const value of values) {
|
|
4275
|
+
if (keys.has(value)) {
|
|
4276
|
+
newEntries[value] = def.entries[value];
|
|
4277
|
+
} else
|
|
4278
|
+
throw new Error(`Key ${value} not found in enum`);
|
|
4279
|
+
}
|
|
4280
|
+
return new ZodEnum({
|
|
4281
|
+
...def,
|
|
4282
|
+
checks: [],
|
|
4283
|
+
...normalizeParams(params),
|
|
4284
|
+
entries: newEntries
|
|
4285
|
+
});
|
|
4286
|
+
};
|
|
4287
|
+
inst.exclude = (values, params) => {
|
|
4288
|
+
const newEntries = { ...def.entries };
|
|
4289
|
+
for (const value of values) {
|
|
4290
|
+
if (keys.has(value)) {
|
|
4291
|
+
delete newEntries[value];
|
|
4292
|
+
} else
|
|
4293
|
+
throw new Error(`Key ${value} not found in enum`);
|
|
4294
|
+
}
|
|
4295
|
+
return new ZodEnum({
|
|
4296
|
+
...def,
|
|
4297
|
+
checks: [],
|
|
4298
|
+
...normalizeParams(params),
|
|
4299
|
+
entries: newEntries
|
|
4300
|
+
});
|
|
4301
|
+
};
|
|
4302
|
+
});
|
|
4303
|
+
function _enum(values, params) {
|
|
4304
|
+
const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
|
|
4305
|
+
return new ZodEnum({
|
|
4306
|
+
type: "enum",
|
|
4307
|
+
entries,
|
|
4308
|
+
...normalizeParams(params)
|
|
4309
|
+
});
|
|
4310
|
+
}
|
|
4311
|
+
const ZodLiteral = /* @__PURE__ */ $constructor("ZodLiteral", (inst, def) => {
|
|
4312
|
+
$ZodLiteral.init(inst, def);
|
|
4313
|
+
ZodType.init(inst, def);
|
|
4314
|
+
inst._zod.processJSONSchema = (ctx, json, params) => literalProcessor(inst, ctx, json);
|
|
4315
|
+
inst.values = new Set(def.values);
|
|
4316
|
+
Object.defineProperty(inst, "value", {
|
|
4317
|
+
get() {
|
|
4318
|
+
if (def.values.length > 1) {
|
|
4319
|
+
throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
|
|
4320
|
+
}
|
|
4321
|
+
return def.values[0];
|
|
4322
|
+
}
|
|
4323
|
+
});
|
|
4324
|
+
});
|
|
4325
|
+
function literal(value, params) {
|
|
4326
|
+
return new ZodLiteral({
|
|
4327
|
+
type: "literal",
|
|
4328
|
+
values: Array.isArray(value) ? value : [value],
|
|
4329
|
+
...normalizeParams(params)
|
|
4330
|
+
});
|
|
4331
|
+
}
|
|
4332
|
+
const ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
|
|
4333
|
+
$ZodTransform.init(inst, def);
|
|
4334
|
+
ZodType.init(inst, def);
|
|
4335
|
+
inst._zod.processJSONSchema = (ctx, json, params) => transformProcessor(inst, ctx);
|
|
4336
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
4337
|
+
if (_ctx.direction === "backward") {
|
|
4338
|
+
throw new $ZodEncodeError(inst.constructor.name);
|
|
4339
|
+
}
|
|
4340
|
+
payload.addIssue = (issue$1) => {
|
|
4341
|
+
if (typeof issue$1 === "string") {
|
|
4342
|
+
payload.issues.push(issue(issue$1, payload.value, def));
|
|
4343
|
+
} else {
|
|
4344
|
+
const _issue = issue$1;
|
|
4345
|
+
if (_issue.fatal)
|
|
4346
|
+
_issue.continue = false;
|
|
4347
|
+
_issue.code ?? (_issue.code = "custom");
|
|
4348
|
+
_issue.input ?? (_issue.input = payload.value);
|
|
4349
|
+
_issue.inst ?? (_issue.inst = inst);
|
|
4350
|
+
payload.issues.push(issue(_issue));
|
|
4351
|
+
}
|
|
4352
|
+
};
|
|
4353
|
+
const output = def.transform(payload.value, payload);
|
|
4354
|
+
if (output instanceof Promise) {
|
|
4355
|
+
return output.then((output2) => {
|
|
4356
|
+
payload.value = output2;
|
|
4357
|
+
payload.fallback = true;
|
|
4358
|
+
return payload;
|
|
4359
|
+
});
|
|
4360
|
+
}
|
|
4361
|
+
payload.value = output;
|
|
4362
|
+
payload.fallback = true;
|
|
4363
|
+
return payload;
|
|
4364
|
+
};
|
|
4365
|
+
});
|
|
4366
|
+
function transform(fn) {
|
|
4367
|
+
return new ZodTransform({
|
|
4368
|
+
type: "transform",
|
|
4369
|
+
transform: fn
|
|
4370
|
+
});
|
|
4371
|
+
}
|
|
4372
|
+
const ZodOptional = /* @__PURE__ */ $constructor("ZodOptional", (inst, def) => {
|
|
4373
|
+
$ZodOptional.init(inst, def);
|
|
4374
|
+
ZodType.init(inst, def);
|
|
4375
|
+
inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
|
|
4376
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
4377
|
+
});
|
|
4378
|
+
function optional(innerType) {
|
|
4379
|
+
return new ZodOptional({
|
|
4380
|
+
type: "optional",
|
|
4381
|
+
innerType
|
|
4382
|
+
});
|
|
4383
|
+
}
|
|
4384
|
+
const ZodExactOptional = /* @__PURE__ */ $constructor("ZodExactOptional", (inst, def) => {
|
|
4385
|
+
$ZodExactOptional.init(inst, def);
|
|
4386
|
+
ZodType.init(inst, def);
|
|
4387
|
+
inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
|
|
4388
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
4389
|
+
});
|
|
4390
|
+
function exactOptional(innerType) {
|
|
4391
|
+
return new ZodExactOptional({
|
|
4392
|
+
type: "optional",
|
|
4393
|
+
innerType
|
|
4394
|
+
});
|
|
4395
|
+
}
|
|
4396
|
+
const ZodNullable = /* @__PURE__ */ $constructor("ZodNullable", (inst, def) => {
|
|
4397
|
+
$ZodNullable.init(inst, def);
|
|
4398
|
+
ZodType.init(inst, def);
|
|
4399
|
+
inst._zod.processJSONSchema = (ctx, json, params) => nullableProcessor(inst, ctx, json, params);
|
|
4400
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
4401
|
+
});
|
|
4402
|
+
function nullable(innerType) {
|
|
4403
|
+
return new ZodNullable({
|
|
4404
|
+
type: "nullable",
|
|
4405
|
+
innerType
|
|
4406
|
+
});
|
|
4407
|
+
}
|
|
4408
|
+
const ZodDefault = /* @__PURE__ */ $constructor("ZodDefault", (inst, def) => {
|
|
4409
|
+
$ZodDefault.init(inst, def);
|
|
4410
|
+
ZodType.init(inst, def);
|
|
4411
|
+
inst._zod.processJSONSchema = (ctx, json, params) => defaultProcessor(inst, ctx, json, params);
|
|
4412
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
4413
|
+
inst.removeDefault = inst.unwrap;
|
|
4414
|
+
});
|
|
4415
|
+
function _default(innerType, defaultValue) {
|
|
4416
|
+
return new ZodDefault({
|
|
4417
|
+
type: "default",
|
|
4418
|
+
innerType,
|
|
4419
|
+
get defaultValue() {
|
|
4420
|
+
return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue);
|
|
4421
|
+
}
|
|
4422
|
+
});
|
|
4423
|
+
}
|
|
4424
|
+
const ZodPrefault = /* @__PURE__ */ $constructor("ZodPrefault", (inst, def) => {
|
|
4425
|
+
$ZodPrefault.init(inst, def);
|
|
4426
|
+
ZodType.init(inst, def);
|
|
4427
|
+
inst._zod.processJSONSchema = (ctx, json, params) => prefaultProcessor(inst, ctx, json, params);
|
|
4428
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
4429
|
+
});
|
|
4430
|
+
function prefault(innerType, defaultValue) {
|
|
4431
|
+
return new ZodPrefault({
|
|
4432
|
+
type: "prefault",
|
|
4433
|
+
innerType,
|
|
4434
|
+
get defaultValue() {
|
|
4435
|
+
return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue);
|
|
4436
|
+
}
|
|
4437
|
+
});
|
|
4438
|
+
}
|
|
4439
|
+
const ZodNonOptional = /* @__PURE__ */ $constructor("ZodNonOptional", (inst, def) => {
|
|
4440
|
+
$ZodNonOptional.init(inst, def);
|
|
4441
|
+
ZodType.init(inst, def);
|
|
4442
|
+
inst._zod.processJSONSchema = (ctx, json, params) => nonoptionalProcessor(inst, ctx, json, params);
|
|
4443
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
4444
|
+
});
|
|
4445
|
+
function nonoptional(innerType, params) {
|
|
4446
|
+
return new ZodNonOptional({
|
|
4447
|
+
type: "nonoptional",
|
|
4448
|
+
innerType,
|
|
4449
|
+
...normalizeParams(params)
|
|
4450
|
+
});
|
|
4451
|
+
}
|
|
4452
|
+
const ZodCatch = /* @__PURE__ */ $constructor("ZodCatch", (inst, def) => {
|
|
4453
|
+
$ZodCatch.init(inst, def);
|
|
4454
|
+
ZodType.init(inst, def);
|
|
4455
|
+
inst._zod.processJSONSchema = (ctx, json, params) => catchProcessor(inst, ctx, json, params);
|
|
4456
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
4457
|
+
inst.removeCatch = inst.unwrap;
|
|
4458
|
+
});
|
|
4459
|
+
function _catch(innerType, catchValue) {
|
|
4460
|
+
return new ZodCatch({
|
|
4461
|
+
type: "catch",
|
|
4462
|
+
innerType,
|
|
4463
|
+
catchValue: typeof catchValue === "function" ? catchValue : () => catchValue
|
|
4464
|
+
});
|
|
4465
|
+
}
|
|
4466
|
+
const ZodPipe = /* @__PURE__ */ $constructor("ZodPipe", (inst, def) => {
|
|
4467
|
+
$ZodPipe.init(inst, def);
|
|
4468
|
+
ZodType.init(inst, def);
|
|
4469
|
+
inst._zod.processJSONSchema = (ctx, json, params) => pipeProcessor(inst, ctx, json, params);
|
|
4470
|
+
inst.in = def.in;
|
|
4471
|
+
inst.out = def.out;
|
|
4472
|
+
});
|
|
4473
|
+
function pipe(in_, out) {
|
|
4474
|
+
return new ZodPipe({
|
|
4475
|
+
type: "pipe",
|
|
4476
|
+
in: in_,
|
|
4477
|
+
out
|
|
4478
|
+
// ...util.normalizeParams(params),
|
|
4479
|
+
});
|
|
4480
|
+
}
|
|
4481
|
+
const ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => {
|
|
4482
|
+
$ZodReadonly.init(inst, def);
|
|
4483
|
+
ZodType.init(inst, def);
|
|
4484
|
+
inst._zod.processJSONSchema = (ctx, json, params) => readonlyProcessor(inst, ctx, json, params);
|
|
4485
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
4486
|
+
});
|
|
4487
|
+
function readonly(innerType) {
|
|
4488
|
+
return new ZodReadonly({
|
|
4489
|
+
type: "readonly",
|
|
4490
|
+
innerType
|
|
4491
|
+
});
|
|
4492
|
+
}
|
|
4493
|
+
const ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
|
|
4494
|
+
$ZodCustom.init(inst, def);
|
|
4495
|
+
ZodType.init(inst, def);
|
|
4496
|
+
inst._zod.processJSONSchema = (ctx, json, params) => customProcessor(inst, ctx);
|
|
4497
|
+
});
|
|
4498
|
+
function refine(fn, _params = {}) {
|
|
4499
|
+
return /* @__PURE__ */ _refine(ZodCustom, fn, _params);
|
|
4500
|
+
}
|
|
4501
|
+
function superRefine(fn, params) {
|
|
4502
|
+
return /* @__PURE__ */ _superRefine(fn, params);
|
|
4503
|
+
}
|
|
4504
|
+
|
|
4505
|
+
export { ZodError as Z, array as a, any as b, boolean as c, discriminatedUnion as d, literal as l, number as n, object as o, string as s, union as u };
|
|
4506
|
+
//# sourceMappingURL=schemas.js-W-DP3mDr.js.map
|