@p4code/cli 0.9.21 → 0.9.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AcpMcpStdioBridge-DxIZyDJz.mjs → AcpMcpStdioBridge-BNuxv1nx.mjs} +15 -7
- package/dist/AcpMcpStdioBridge-C9Ry_oCI.mjs +3 -0
- package/dist/{Effect-BqRgldaH.mjs → Effect-BrI3bavz.mjs} +1242 -448
- package/dist/{Schema-CkGB1Dgx.mjs → Schema-06GeVid5.mjs} +1626 -1148
- package/dist/{Stream-DZTo5F3N.mjs → Stream-DKSvHopl.mjs} +470 -190
- package/dist/{TraceDiagnostics-DEAfnZGb.mjs → TraceDiagnostics-DY_cYrzB.mjs} +1961 -531
- package/dist/bin.mjs +2 -2
- package/dist/{binCli-IfUU-uWs.mjs → binCli-Bou3rWgW.mjs} +2302 -1946
- package/dist/claude-history-worker.mjs +1 -1
- package/dist/{claudeHistoryWorker-Cst8OnLH.mjs → claudeHistoryWorker-BZBBGtSw.mjs} +1 -1
- package/dist/{claudeHistoryWorker-r4mV4Dxy.mjs → claudeHistoryWorker-DlhW7K2f.mjs} +2 -2
- package/dist/client/.vite/manifest.json +2155 -2127
- package/dist/client/assets/{2NI2N5EU-qP3PpVDC.js → 2NI2N5EU-B3GKfpTJ.js} +2 -2
- package/dist/client/assets/{4UO7MD6I-Da5jHHfF.js → 4UO7MD6I-D1jV-2l8.js} +2 -2
- package/dist/client/assets/{5B3SVYGG-BGHUtemY.js → 5B3SVYGG-CiUCamIk.js} +2 -2
- package/dist/client/assets/{5GK6JWQ2-DwbHk3MV.js → 5GK6JWQ2-t3RHg90Y.js} +2 -2
- package/dist/client/assets/{5N7A7DKN-B-2quXAp.js → 5N7A7DKN-QVdNnUVu.js} +2 -2
- package/dist/client/assets/{5OC2THR4-DSQWJ0ZQ.js → 5OC2THR4-CxE7bwzV.js} +2 -2
- package/dist/client/assets/{5S6HY5KT-CAwEcA6I.js → 5S6HY5KT-msIIAX0G.js} +2 -2
- package/dist/client/assets/{6IMQ5BUJ-BABYtiev.js → 6IMQ5BUJ-BzYnQ5qg.js} +2 -2
- package/dist/client/assets/{6OLKWJ4F-CwQRt55E.js → 6OLKWJ4F-AQyY5TLk.js} +2 -2
- package/dist/client/assets/{74OO7NKP-DZoL_aBI.js → 74OO7NKP-CCpQBxNH.js} +2 -2
- package/dist/client/assets/{75O6YZUN-CoqdPLhF.js → 75O6YZUN-D3WwLu8s.js} +2 -2
- package/dist/client/assets/{77XECAW3-DM5Itfvk.js → 77XECAW3-C6PMMrkh.js} +2 -2
- package/dist/client/assets/{ABYRPUBD-C2IaQicJ.js → ABYRPUBD-BmXVPnuD.js} +2 -2
- package/dist/client/assets/AlertDialogRoot-CNpt8h9w.js +2 -0
- package/dist/client/assets/{AnimatedHeight-BoS1RBdk.js → AnimatedHeight-B2j_NXft.js} +2 -2
- package/dist/client/assets/{AuthSurfaceShell-Dfcdz_aG.js → AuthSurfaceShell-DDT8iJWE.js} +2 -2
- package/dist/client/assets/{BB2UYUI2-DQkTEBDf.js → BB2UYUI2-C_DXRsEF.js} +2 -2
- package/dist/client/assets/{BUM34MOA-DuY83HEN.js → BUM34MOA-sLk4tJuF.js} +2 -2
- package/dist/client/assets/{CEQABKGZ-CNAynrzB.js → CEQABKGZ-DsLeCUfk.js} +2 -2
- package/dist/client/assets/{CXAC5362-B_mhvA6r.js → CXAC5362-6czpP5mH.js} +2 -2
- package/dist/client/assets/ChatGptUsageButton-BElkMe1K.js +2 -0
- package/dist/client/assets/ChatMarkdown-pRUIhpGi.js +49 -0
- package/dist/client/assets/{CheckboxIndicator-Dj91Im5z.js → CheckboxIndicator-DFCs5GRD.js} +2 -2
- package/dist/client/assets/{ClippedText-CmBRrYNb.js → ClippedText-BIwvWMlV.js} +2 -2
- package/dist/client/assets/CodexSetupSection.logic-3MrEmFzD.js +2 -0
- package/dist/client/assets/{CollapsiblePanel-BwDr-EKA.js → CollapsiblePanel-CsWNZ7jo.js} +2 -2
- package/dist/client/assets/{ComboboxClear-DeqR6c-6.js → ComboboxClear-Cv9NZFNr.js} +2 -2
- package/dist/client/assets/{ComboboxGroupLabel-Dk-MF4sD.js → ComboboxGroupLabel-BPe0M6wJ.js} +2 -2
- package/dist/client/assets/{CommandBlock-DnTIHX5l.js → CommandBlock-DUs3JB3r.js} +2 -2
- package/dist/client/assets/{CompositeRoot-Cx12XSsh.js → CompositeRoot-RcqGhRAf.js} +2 -2
- package/dist/client/assets/ConnectAgentSurface-BG30oBmC.js +2 -0
- package/dist/client/assets/{ConnectionStatusDot-BnhNFCMA.js → ConnectionStatusDot-DIUevPBM.js} +2 -2
- package/dist/client/assets/{DRLTVNUE-Bp-Mh_TD.js → DRLTVNUE-CAWKPVio.js} +2 -2
- package/dist/client/assets/{DYY6UVD2-Dwh9ZkXt.js → DYY6UVD2-HB9mYAbb.js} +2 -2
- package/dist/client/assets/DevicePanel-BAT6BS-V.js +2 -0
- package/dist/client/assets/DeviceSetup-ClD1wdY1.js +2 -0
- package/dist/client/assets/DialogRoot-Dg58-QOq.js +2 -0
- package/dist/client/assets/DialogTitle-CSaaIBpP.js +2 -0
- package/dist/client/assets/{DiffCommentAnnotation-D7iLWjnP.js → DiffCommentAnnotation-BjI2rZNS.js} +3 -3
- package/dist/client/assets/{DiffFileTree-PCGZGqlB.js → DiffFileTree-C6VB4VCo.js} +2 -2
- package/dist/client/assets/DiffPanel-pkAdnqL7.js +2 -0
- package/dist/client/assets/{DiffWorkerPoolProvider-CmorWW2H.js → DiffWorkerPoolProvider-CPwS1D4h.js} +3 -3
- package/dist/client/assets/{EmbeddedDesign-CeUGLwuZ.js → EmbeddedDesign-DOevokgh.js} +7 -7
- package/dist/client/assets/{EnvironmentMachineIcon-Lz2YGk0G.js → EnvironmentMachineIcon-DM48TG2x.js} +2 -2
- package/dist/client/assets/{ExpandableText-B034p2kF.js → ExpandableText-CYFNBBpY.js} +2 -2
- package/dist/client/assets/{FNOVOB4O-BJscBtWY.js → FNOVOB4O-BkKBPKb-.js} +2 -2
- package/dist/client/assets/{FieldControl-H6iQvC-Q.js → FieldControl-DHSVFpKc.js} +2 -2
- package/dist/client/assets/{FileDiff-BMtpmo0v.js → FileDiff-CdxU7jjH.js} +2 -2
- package/dist/client/assets/{FilePreviewPanel-DUqI7pF3.js → FilePreviewPanel-Bz8HETIa.js} +4 -4
- package/dist/client/assets/{FoldedSettingsSection-BTMENmDo.js → FoldedSettingsSection-IyrJlpO8.js} +2 -2
- package/dist/client/assets/{HDGCDEEZ-BA3H_tu4.js → HDGCDEEZ-BW-K6GhK.js} +2 -2
- package/dist/client/assets/{HSJLKHB7-BojHXJG0.js → HSJLKHB7-B8h6fviS.js} +2 -2
- package/dist/client/assets/{Icons-DmQwwfAN.js → Icons-DpgbzNj8.js} +2 -2
- package/dist/client/assets/Input-BT2VVALp.js +2 -0
- package/dist/client/assets/{IntervalSecondsField-Cpc7UePr.js → IntervalSecondsField-BaJ1qNX-.js} +2 -2
- package/dist/client/assets/JZOYTAAL-DbSUKTwO.js +1 -0
- package/dist/client/assets/{K3MD6TGW-hwfRTJ3N.js → K3MD6TGW-BTpBxr8x.js} +2 -2
- package/dist/client/assets/{K7RP3OMA-4mJh9KrG.js → K7RP3OMA-DcsmGbRM.js} +2 -2
- package/dist/client/assets/{KeybindingsSettings.logic-C6XG7NtX.js → KeybindingsSettings.logic-oAUXQqts.js} +2 -2
- package/dist/client/assets/{LHDIQX7Q-LIdvhN0m.js → LHDIQX7Q-NOcjEUQY.js} +2 -2
- package/dist/client/assets/{LUXOKEGN-B1aHy25-.js → LUXOKEGN-BWJqFZst.js} +2 -2
- package/dist/client/assets/LinkMachineSelect-Dp6FC1LE.js +2 -0
- package/dist/client/assets/{MathTypeset-CA2nw_Ej.js → MathTypeset-DHPwWtff.js} +2 -2
- package/dist/client/assets/{ModelLiveLayer-CPk6oSLz.js → ModelLiveLayer-D3x6mJFP.js} +3 -3
- package/dist/client/assets/{N3JZAHOW-Dz6QAj1L.js → N3JZAHOW-oDX5VWgR.js} +2 -2
- package/dist/client/assets/{NUIALGQ3-W9kPoZrb.js → NUIALGQ3-DbqxE7KO.js} +2 -2
- package/dist/client/assets/{NoProjectsHero-DrTDAhjM.js → NoProjectsHero-Dk-rv5RI.js} +2 -2
- package/dist/client/assets/{O65XPQGZ-CPx16bPB.js → O65XPQGZ-Cys4qXjc.js} +2 -2
- package/dist/client/assets/{O7XIQ6OM-CAdGDrqF.js → O7XIQ6OM-aLdTRbRJ.js} +2 -2
- package/dist/client/assets/{OFQON5FD-DOxYOpsO.js → OFQON5FD-DpC8rm9Y.js} +2 -2
- package/dist/client/assets/P4ConnectAccountPages-C-GbG9lk.js +2 -0
- package/dist/client/assets/{P4ConnectSidebarSignIn-CtO1hqIS.js → P4ConnectSidebarSignIn-DepXmk4f.js} +2 -2
- package/dist/client/assets/{PJQHF43J-CEic-zJ0.js → PJQHF43J-CUbFewuD.js} +2 -2
- package/dist/client/assets/PanelLayoutControls-CKWjLO_e.js +218 -0
- package/dist/client/assets/{PierreEntryIcon-oOiSTYpG.js → PierreEntryIcon-CVKV5qfT.js} +2 -2
- package/dist/client/assets/{PopoverHandle-DEcvmS0k.js → PopoverHandle-s36xVlsK.js} +2 -2
- package/dist/client/assets/PreviewPanel-B-ty1_ZL.js +2 -0
- package/dist/client/assets/{ProjectDefaultsSettings-BkxL8Xjx.js → ProjectDefaultsSettings-vF_5kxVM.js} +2 -2
- package/dist/client/assets/{ProjectFavicon-DYcNXMDQ.js → ProjectFavicon-BEsCcLjN.js} +3 -3
- package/dist/client/assets/{ProjectIconPickerDialog-CnlPMGQj.js → ProjectIconPickerDialog-D1_gSlWW.js} +2 -2
- package/dist/client/assets/{ProjectMonogram-C8btbogu.js → ProjectMonogram-Aw_ZBtDB.js} +2 -2
- package/dist/client/assets/{ProviderAuthTerminal-B1NeqFZE.js → ProviderAuthTerminal-cNp7I_XV.js} +2 -2
- package/dist/client/assets/ProviderModelPicker-CCCH-TiQ.js +2 -0
- package/dist/client/assets/{ProviderSettingsForm-D9GJtzdb.js → ProviderSettingsForm-CV7sAQy3.js} +2 -2
- package/dist/client/assets/PullRequestCodeTab-DjChxC-1.js +6 -0
- package/dist/client/assets/{RHNBAITX-D5lTu0BB.js → RHNBAITX-CEZ1jYAC.js} +2 -2
- package/dist/client/assets/{ReadOnlySourcePreview-LxG8Br9J.js → ReadOnlySourcePreview-Dw9TzXZ2.js} +2 -2
- package/dist/client/assets/{RedactedSensitiveText-BMXImj30.js → RedactedSensitiveText-bQSbv34p.js} +2 -2
- package/dist/client/assets/RenderErrorBoundary-Dbb6Gs8P.js +23 -0
- package/dist/client/assets/{RightPanelResizeHandle-Cog3JVw0.js → RightPanelResizeHandle-B6vIzqA0.js} +2 -2
- package/dist/client/assets/{SLD4V6NK-CG_xQFi-.js → SLD4V6NK-BXmFkBHB.js} +2 -2
- package/dist/client/assets/ScheduledTasksSettings-TjoGUXvC.js +6 -0
- package/dist/client/assets/{ScopedSwitch-LzARRHas.js → ScopedSwitch-C8qSHRkU.js} +2 -2
- package/dist/client/assets/{ScrollAreaCorner-DFCZuJ0r.js → ScrollAreaCorner-Cn2VDisz.js} +2 -2
- package/dist/client/assets/{SecretInput-CRgvNUgU.js → SecretInput-C6zW-8wI.js} +2 -2
- package/dist/client/assets/{SelectScrollUpArrow-C-MWJdyw.js → SelectScrollUpArrow-C40FP3vq.js} +2 -2
- package/dist/client/assets/{SelfImproveSettingsSection-DjuOvf_q.js → SelfImproveSettingsSection-BhUO-XvV.js} +2 -2
- package/dist/client/assets/{SettingsPanels-Ci2h30Aw.js → SettingsPanels-DFPZUI9O.js} +7 -7
- package/dist/client/assets/{SettingsPanels.logic-BkjrmwrI.js → SettingsPanels.logic-5bLleFhd.js} +2 -2
- package/dist/client/assets/{SettingsScopeNotice-96p-bg8p.js → SettingsScopeNotice-VgBZL2zg.js} +2 -2
- package/dist/client/assets/{SidebarStageBackdrop-B8YG-M-e.js → SidebarStageBackdrop-DvPzZM_j.js} +2 -2
- package/dist/client/assets/{T3PCR2KE-DyNYo7Zy.js → T3PCR2KE-bp9TnTiq.js} +2 -2
- package/dist/client/assets/{TKWO2OVW-5eCjJCfz.js → TKWO2OVW-Cyskzdq0.js} +2 -2
- package/dist/client/assets/{TSHNXIZL-CjI9VTqp.js → TSHNXIZL-Dp3os6bG.js} +2 -2
- package/dist/client/assets/{ThemeEditorPanel-BdfXdTV6.js → ThemeEditorPanel-B1RklhEA.js} +3 -3
- package/dist/client/assets/{ThreadDetailsItemsMenu-Cgj2yuzU.js → ThreadDetailsItemsMenu-BOMU-3M3.js} +60 -60
- package/dist/client/assets/ThreadTerminalDrawer-BmwBVDGv.js +5 -0
- package/dist/client/assets/TooltipProvider-DQ0TF9NB.js +2 -0
- package/dist/client/assets/{UQJE5E4I-CY9HwTsw.js → UQJE5E4I-DDRoojS_.js} +2 -2
- package/dist/client/assets/{USNYFO5S-BW0HcjRg.js → USNYFO5S-BvyU-aXY.js} +2 -2
- package/dist/client/assets/{Virtualizer-NI9bqlwX.js → Virtualizer-DFzJCTxQ.js} +2 -2
- package/dist/client/assets/{WEVWDWVA-BF8z-yRH.js → WEVWDWVA-DTuHUaDF.js} +2 -2
- package/dist/client/assets/{WorkspaceBreadcrumb-Cok6l_SJ.js → WorkspaceBreadcrumb-Dno2N8Xd.js} +2 -2
- package/dist/client/assets/{WorkspacePageContainer-_--jFIZ8.js → WorkspacePageContainer-OLpcgD_f.js} +2 -2
- package/dist/client/assets/{WorkspacePageHeader-CJB6rvZc.js → WorkspacePageHeader-Bn0m4gpR.js} +2 -2
- package/dist/client/assets/{X5RFHQXM-pdor6bX7.js → X5RFHQXM-D9IKIoIk.js} +2 -2
- package/dist/client/assets/{X62E3GBT-C6b2WsLT.js → X62E3GBT-BBXkOa6O.js} +2 -2
- package/dist/client/assets/{XBNEOJTC-BxqaKoJL.js → XBNEOJTC-D743Jp_H.js} +2 -2
- package/dist/client/assets/{YHV2MVVZ-DO-ICZOV.js → YHV2MVVZ-DZBsjjLM.js} +2 -2
- package/dist/client/assets/{YURCZMG2-BxKVNupW.js → YURCZMG2-ByezMSr0.js} +2 -2
- package/dist/client/assets/{YVG2LODB-BwiP1iS0.js → YVG2LODB-DrsC56GM.js} +2 -2
- package/dist/client/assets/_chat-BrgTPEvH.js +47 -0
- package/dist/client/assets/_chat.design-CgGDbdSU.js +2 -0
- package/dist/client/assets/{_chat.index-DsRV2lh0.js → _chat.index-BjAR62fj.js} +2 -2
- package/dist/client/assets/{_chat.new-B_AL_NJ2.js → _chat.new-SjhrzHWl.js} +3 -3
- package/dist/client/assets/_chat.pull-requests-BixugchU.js +2 -0
- package/dist/client/assets/{alert-D6WJ0q4-.js → alert-CfhQnxcL.js} +2 -2
- package/dist/client/assets/alert-dialog-Dn_PRSFU.js +2 -0
- package/dist/client/assets/{assetUrls-gAudvjhV.js → assetUrls-Bn1N9LX7.js} +2 -2
- package/dist/client/assets/assets-Lf7mgwY7.js +2 -0
- package/dist/client/assets/{browserHistoryStore-CIeLvEnV.js → browserHistoryStore-Ciy-Cygo.js} +2 -2
- package/dist/client/assets/{browserLinkTarget-MQvtO-01.js → browserLinkTarget-DKVi8qup.js} +2 -2
- package/dist/client/assets/{checkbox-Cw33xyU7.js → checkbox-iFzfBLKr.js} +2 -2
- package/dist/client/assets/{color-picker-Bmtarpj9.js → color-picker-W1NtR7ha.js} +2 -2
- package/dist/client/assets/combobox-B0IMIA-1.js +2 -0
- package/dist/client/assets/command-BdVxwZ8D.js +2 -0
- package/dist/client/assets/{connect-DkCGs4oR.js → connect-C605Zs89.js} +2 -2
- package/dist/client/assets/connect-agent-Cy1G_UzI.js +2 -0
- package/dist/client/assets/{design-Djc1_eDF.js → design-BNHLz8I2.js} +2 -2
- package/dist/client/assets/{device-P8L_QiVD.js → device-CwiofvsD.js} +2 -2
- package/dist/client/assets/dialog-DFlZvvht.js +2 -0
- package/dist/client/assets/dialog-styles-Df-wlHU1.js +2 -0
- package/dist/client/assets/{diffPanelStore-D3ARjaef.js → diffPanelStore-CGdPbp5I.js} +2 -2
- package/dist/client/assets/{diffRendering-Cb9qJUqp.js → diffRendering-DJnBG6ZN.js} +2 -2
- package/dist/client/assets/{dist-BocOAtMa.js → dist-D1XCsn7e.js} +3 -3
- package/dist/client/assets/{draft-input-DM7mC5ty.js → draft-input-1HTN8QVo.js} +2 -2
- package/dist/client/assets/{duoViewer-Domn2baW.js → duoViewer-CQpxZewd.js} +2 -2
- package/dist/client/assets/{dynamic-CjS-lEY3.js → dynamic-DHrzmb9Z.js} +2 -2
- package/dist/client/assets/{embeddedScripts-AO2vzovy.js → embeddedScripts-D7WC0N_7.js} +2 -2
- package/dist/client/assets/{empty-VkAC9qIO.js → empty-Dn5VI2Xk.js} +2 -2
- package/dist/client/assets/entities-CjoTQlW3.js +2 -0
- package/dist/client/assets/{fileLinks-BY6FjK66.js → fileLinks-BZkPwsEY.js} +2 -2
- package/dist/client/assets/{fileTreeExpansion-B--IBStv.js → fileTreeExpansion-DHPBKDpm.js} +2 -2
- package/dist/client/assets/{getDiffFileInput-B7pCnCeh.js → getDiffFileInput-D-dpZLfC.js} +2 -2
- package/dist/client/assets/{htmlRender-DYI6n9Xo.js → htmlRender-BdsR_7vV.js} +2 -2
- package/dist/client/assets/{index-C5VbGbq-.js → index-Cq59P2HC.js} +3 -3
- package/dist/client/assets/{input-group-DOUsG7P-.js → input-group-B1TOCtDG.js} +2 -2
- package/dist/client/assets/{input-CiPGmOLv.js → input-yaZxaTds.js} +2 -2
- package/dist/client/assets/{kbd-C8opCm5n.js → kbd-R7rkirqT.js} +2 -2
- package/dist/client/assets/{keybindings-CbaDrm2P.js → keybindings-CrlWqd5q.js} +2 -2
- package/dist/client/assets/{lazy-Bpm7QNt6.js → lazy-BH4rgIwO.js} +4 -4
- package/dist/client/assets/{lazyRouteComponent-BZe6tHvz.js → lazyRouteComponent-BxpFJiXB.js} +2 -2
- package/dist/client/assets/{link-BHR6GsRr.js → link-2ZiGGBbw.js} +2 -2
- package/dist/client/assets/{linkedPrompt-DqEOywCR.js → linkedPrompt-BTa8Gs9-.js} +2 -2
- package/dist/client/assets/main-Rpw_0nEx.css +2 -0
- package/dist/client/assets/main-xhw8F2iL.js +38 -0
- package/dist/client/assets/mediaReference-B7ym_1-U.js +2 -0
- package/dist/client/assets/{mediaSource-BgP2sq1w.js → mediaSource-GtWYcfeZ.js} +2 -2
- package/dist/client/assets/{modelScene-OONljnCt.js → modelScene-uWeIf_CC.js} +2 -2
- package/dist/client/assets/number-field-DNna9ps3.js +2 -0
- package/dist/client/assets/{observeResize-BESwMMOy.js → observeResize-Cz6dJUG2.js} +2 -2
- package/dist/client/assets/{onboarding-DLaBhCVN.js → onboarding-CxDppAGc.js} +2 -2
- package/dist/client/assets/openFileInPreview-MLuDI8fu.js +2 -0
- package/dist/client/assets/{p4ProjectFile-Fd0NSHmZ.js → p4ProjectFile-DlnfrOnm.js} +2 -2
- package/dist/client/assets/{pair-BUkFlR8l.js → pair-BJWvIdrD.js} +2 -2
- package/dist/client/assets/{pendingSendStore-CX8QB7C5.js → pendingSendStore-Cc6n4Xji.js} +2 -2
- package/dist/client/assets/{phoneViewer-BJj_96At.js → phoneViewer-OFK_ThS_.js} +2 -2
- package/dist/client/assets/{pierre-icons-BptmNFMW.js → pierre-icons-BYPQj09G.js} +2 -2
- package/dist/client/assets/popover-DnYfrQly.js +2 -0
- package/dist/client/assets/{preview-DnCP9Q0k.js → preview-Bi-hPWTp.js} +2 -2
- package/dist/client/assets/{preview-BBssbPEj.js → preview-CxFR-vue.js} +2 -2
- package/dist/client/assets/{previewMiniPlayerStore-DByen2Nk.js → previewMiniPlayerStore-W10VSM09.js} +2 -2
- package/dist/client/assets/primary-CCmKskNP.js +2 -0
- package/dist/client/assets/primaryCloudLinkState-DDs0gJOh.js +2 -0
- package/dist/client/assets/{projectFilesQueryState-CVSEDHhW.js → projectFilesQueryState-DzjMtjuq.js} +2 -2
- package/dist/client/assets/projectScriptEditor-C2NTRQLs.js +2 -0
- package/dist/client/assets/{providerSkills-5OBbbZq-.js → providerSkills-gNPMp_MW.js} +2 -2
- package/dist/client/assets/pullRequestDetail.logic-BZNLZTdt.js +10 -0
- package/dist/client/assets/{pullRequestIcons-1lUVOGQJ.js → pullRequestIcons-DwblWS4R.js} +2 -2
- package/dist/client/assets/{pullRequestReviewStore-CUZ0N4F2.js → pullRequestReviewStore-Cc4bHb4o.js} +2 -2
- package/dist/client/assets/{pullRequests-R7416J6H.js → pullRequests-DAMVEVGR.js} +2 -2
- package/dist/client/assets/queries-ckipBW-f.js +2 -0
- package/dist/client/assets/{query-CeIgbVxh.js → query-DFSffMGJ.js} +2 -2
- package/dist/client/assets/{radio-group-C14CASyG.js → radio-group-EK7EPCn2.js} +2 -2
- package/dist/client/assets/relay-BLgoNhyd.js +2 -0
- package/dist/client/assets/relayFailureReason-COnjzJFI.js +2 -0
- package/dist/client/assets/{renderScheduler-T1-hnpvd.js → renderScheduler-BCOEl9SF.js} +2 -2
- package/dist/client/assets/{rightPanelStore-Bt0unAo8.js → rightPanelStore-AjYoRisO.js} +2 -2
- package/dist/client/assets/runtime-CbYvES7U.js +9 -0
- package/dist/client/assets/{runtimeModeConfig-DymGoV55.js → runtimeModeConfig-Oh86kRYJ.js} +2 -2
- package/dist/client/assets/{scheduledTasksSettings.logic-DOegPD4_.js → scheduledTasksSettings.logic-DBMDVdjk.js} +3 -3
- package/dist/client/assets/{scroll-area-D2D-AlvC.js → scroll-area-DhDCLqyU.js} +2 -2
- package/dist/client/assets/{select-CE2f-g-3.js → select-CNcZzYBl.js} +2 -2
- package/dist/client/assets/{selfImproveFindings-Bhi6QF1b.js → selfImproveFindings-CvQXlaMJ.js} +2 -2
- package/dist/client/assets/{server-GB5fRm03.js → server-CEMcTnD1.js} +2 -2
- package/dist/client/assets/{session-CFzb2gMH.js → session-Ces3Ebxl.js} +2 -2
- package/dist/client/assets/session-logic-DoE1Q_f_.js +27 -0
- package/dist/client/assets/{settings-DuV3USCX.js → settings-DfyN3nPg.js} +2 -2
- package/dist/client/assets/{settings.appearance-DtON2De5.js → settings.appearance-DKdqiS33.js} +2 -2
- package/dist/client/assets/settings.archived-DDSjJTCo.js +2 -0
- package/dist/client/assets/{settings.computer-use-BuiCBgaZ.js → settings.computer-use-B9Lvx9ml.js} +2 -2
- package/dist/client/assets/settings.connections-CeVMC9_Q.js +2 -0
- package/dist/client/assets/{settings.data-controls-BTvw7hwA.js → settings.data-controls-C50d8Y1p.js} +2 -2
- package/dist/client/assets/{settings.decisions-DjyXWkGE.js → settings.decisions-IKWdsPJP.js} +2 -2
- package/dist/client/assets/{settings.designs-B7y3Iz_g.js → settings.designs-DYK1fORq.js} +2 -2
- package/dist/client/assets/settings.diagnostics-DDQ_8Jca.js +2 -0
- package/dist/client/assets/{settings.general-CejKrS3r.js → settings.general-c8Ls4Mz6.js} +2 -2
- package/dist/client/assets/settings.integrations-Bx78DSgB.js +2 -0
- package/dist/client/assets/{settings.keybindings-DhvXS2QI.js → settings.keybindings-CBhgDtMa.js} +2 -2
- package/dist/client/assets/{settings.open-source-licenses-nDTYUclU.js → settings.open-source-licenses-CgHCMsAt.js} +2 -2
- package/dist/client/assets/{settings.plugins-DJQxiL8Y.js → settings.plugins-1AVunwAZ.js} +4 -4
- package/dist/client/assets/{settings.projects-Cf31zLX1.js → settings.projects-voo-H787.js} +4 -4
- package/dist/client/assets/settings.providers-BWjGRXNt.js +3 -0
- package/dist/client/assets/{settings.scheduled-tasks-B0BJtx2Y.js → settings.scheduled-tasks-czvZRhu8.js} +2 -2
- package/dist/client/assets/{settings.secrets-CugtPHky.js → settings.secrets-B4BGlz80.js} +2 -2
- package/dist/client/assets/{settings.snap-shot-9uuaPZ8d.js → settings.snap-shot-d8VTC1Lv.js} +2 -2
- package/dist/client/assets/{settings.source-control-DECPD9xY.js → settings.source-control-Df0azAck.js} +2 -2
- package/dist/client/assets/settings.storage-CAwfhCbA.js +2 -0
- package/dist/client/assets/settingsLayout-D5Mded9h.js +3 -0
- package/dist/client/assets/sidebar-BUDllWET.js +2 -0
- package/dist/client/assets/{sidebarProjectGrouping-MU2UfzY1.js → sidebarProjectGrouping-Dt_irkWm.js} +2 -2
- package/dist/client/assets/{skeleton-D6RVfMa8.js → skeleton-C6O21cqb.js} +2 -2
- package/dist/client/assets/{sourceControl-BU6NXFEv.js → sourceControl-CgxDQG5w.js} +2 -2
- package/dist/client/assets/{sourceControlClients-DBozOkI3.js → sourceControlClients-Bg3Of7DX.js} +2 -2
- package/dist/client/assets/{spinner-C-qDE4WQ.js → spinner-m1uNq_wW.js} +2 -2
- package/dist/client/assets/src-DHn7yNZx.js +15 -0
- package/dist/client/assets/terminal-links-C2FjxVhS.js +2 -0
- package/dist/client/assets/terminalSessions-DBYKcIE6.js +2 -0
- package/dist/client/assets/{textarea-CWbMGhL9.js → textarea-xZYMC9X5.js} +2 -2
- package/dist/client/assets/{themePalette-B_fGWNEh.js → themePalette-BcMO2M90.js} +3 -3
- package/dist/client/assets/{threadCheckpoints-B88N2CXf.js → threadCheckpoints-DUorxvL1.js} +2 -2
- package/dist/client/assets/{toggle-CKr6iZUR.js → toggle-DumCe7R7.js} +2 -2
- package/dist/client/assets/{toggle-group-B1WN0Pgy.js → toggle-group-CzE2mG-B.js} +2 -2
- package/dist/client/assets/{tooltip-CCYU8XGM.js → tooltip-BhCWnsdW.js} +2 -2
- package/dist/client/assets/{uiStateStore-u_PaGpa6.js → uiStateStore-B25zCY_s.js} +2 -2
- package/dist/client/assets/usage-DdBC08dx.js +2 -0
- package/dist/client/assets/{usageAccess-B0nqd8U-.js → usageAccess-COKmar79.js} +2 -2
- package/dist/client/assets/{usageFormat-CUSzTPTq.js → usageFormat-2913AogD.js} +2 -2
- package/dist/client/assets/{usageShortcuts-jGu1QJHr.js → usageShortcuts-U_aRtpf7.js} +2 -2
- package/dist/client/assets/{use-atom-command-Bd7vZxeH.js → use-atom-command-DWabKYXN.js} +2 -2
- package/dist/client/assets/{useAriaLabelledBy-CJvtvui4.js → useAriaLabelledBy-BiZIzNf7.js} +2 -2
- package/dist/client/assets/useHandleNewThread-DTgcUVdd.js +2 -0
- package/dist/client/assets/{useLocation-KvBZAN7v.js → useLocation-BXwb7I1F.js} +2 -2
- package/dist/client/assets/{useNavigate-DXSBYc-k.js → useNavigate-P1p3Es15.js} +2 -2
- package/dist/client/assets/{useNavigateBack-DzR35iiJ.js → useNavigateBack-D02Al7yk.js} +2 -2
- package/dist/client/assets/{useP4ConnectAuthPrompt-czmNhUqV.js → useP4ConnectAuthPrompt-DKYJHISj.js} +2 -2
- package/dist/client/assets/{useParams-D9reDvT8.js → useParams-DsmZTF__.js} +2 -2
- package/dist/client/assets/{usePermissionStatus-C5YvHVz-.js → usePermissionStatus-DeJYBk6u.js} +2 -2
- package/dist/client/assets/{usePopupViewport-D7yp2NvZ.js → usePopupViewport-BBKn7x_4.js} +2 -2
- package/dist/client/assets/usePullRequestActions-BGugTe1S.js +3 -0
- package/dist/client/assets/{useRegisterFieldControl-D-hYtXkm.js → useRegisterFieldControl-DkFmgEzw.js} +2 -2
- package/dist/client/assets/{useScopedModelAvailability-UuZvj6HE.js → useScopedModelAvailability-LgMepA3M.js} +2 -2
- package/dist/client/assets/useSettings-hYzrsDTp.js +3 -0
- package/dist/client/assets/utils-BVnIIHXP.js +26 -0
- package/dist/client/assets/vcsRefInvalidation-C5gDWck3.js +2 -0
- package/dist/client/assets/welcome-CQrdWD2c.js +2 -0
- package/dist/client/icon-192x192.png +0 -0
- package/dist/client/icon-512x512.png +0 -0
- package/dist/client/index.html +1 -1
- package/dist/client/manifest.webmanifest +12 -0
- package/dist/client/third-party-licenses.json +1 -1
- package/dist/{mcpResponsePayloads-tqyeJD3c.mjs → mcpResponsePayloads-C8W7Qyxk.mjs} +3 -3
- package/dist/{preview-JlPVV2bV.mjs → preview-C_kKbIjf.mjs} +6741 -3322
- package/dist/{renderer-CswgrCon.mjs → renderer-DKOOIEoX.mjs} +2 -2
- package/dist/resource-monitor/darwin-arm64/p4-resource-monitor +0 -0
- package/dist/{runtime-Bec3_bh8.mjs → runtime-Bm_EVnst.mjs} +3 -3
- package/dist/{runtimeLayer-B9K2BVKV.mjs → runtimeLayer-DQ7pD9BT.mjs} +22626 -21082
- package/dist/{runtimeLayer-ZFdf4c6R.mjs → runtimeLayer-Go0xTEaW.mjs} +1 -1
- package/dist/{server-BnHhGuOc.mjs → server-DQ0wuuLG.mjs} +4388 -3021
- package/dist/{sha2-BfCJmkJJ.mjs → sha2-Daa2Fiv1.mjs} +7411 -5229
- package/package.json +1 -1
- package/dist/AcpMcpStdioBridge-DbCGhPmy.mjs +0 -3
- package/dist/client/assets/AlertDialogRoot-COfNlajP.js +0 -2
- package/dist/client/assets/ChatGptUsageButton-DT3CRIhB.js +0 -2
- package/dist/client/assets/ChatMarkdown-_SLyl8Hk.js +0 -49
- package/dist/client/assets/CodexSetupSection.logic-CqdvWoE6.js +0 -2
- package/dist/client/assets/ConnectAgentSurface-D-Z7Gl3G.js +0 -2
- package/dist/client/assets/DevicePanel-MMC7u5qJ.js +0 -2
- package/dist/client/assets/DeviceSetup-BCrBVLkf.js +0 -2
- package/dist/client/assets/DialogTitle-5cBExuFs.js +0 -2
- package/dist/client/assets/DiffPanel-OOedo4tu.js +0 -2
- package/dist/client/assets/Input-DWc7cRWt.js +0 -2
- package/dist/client/assets/JZOYTAAL-Bw2-11fa.js +0 -1
- package/dist/client/assets/LinkMachineSelect-CM7JZDuM.js +0 -2
- package/dist/client/assets/P4ConnectAccountPages-D0qqCxCf.js +0 -2
- package/dist/client/assets/PanelLayoutControls-CPevLAhG.js +0 -216
- package/dist/client/assets/PreviewPanel-BSwObBjW.js +0 -2
- package/dist/client/assets/ProviderModelPicker-CLwSFV6Q.js +0 -2
- package/dist/client/assets/PullRequestCodeTab-CajEWSe5.js +0 -6
- package/dist/client/assets/RenderErrorBoundary-CcI-4Zo3.js +0 -23
- package/dist/client/assets/ScheduledTasksSettings-CSygG_5X.js +0 -6
- package/dist/client/assets/ThreadTerminalDrawer-DBG1eHBS.js +0 -5
- package/dist/client/assets/TooltipProvider-DiV5KdTq.js +0 -2
- package/dist/client/assets/_chat-DDScEBKF.js +0 -47
- package/dist/client/assets/_chat.design-360SdjDb.js +0 -2
- package/dist/client/assets/_chat.pull-requests-DlL4gjh7.js +0 -2
- package/dist/client/assets/alert-dialog-DsMTn0ZK.js +0 -2
- package/dist/client/assets/assets-DaZ46ybf.js +0 -2
- package/dist/client/assets/combobox-D6RfzdE7.js +0 -2
- package/dist/client/assets/command-1dJ-vX2N.js +0 -2
- package/dist/client/assets/connect-agent-C4n-OyN3.js +0 -2
- package/dist/client/assets/dialog-5OaxRXCC.js +0 -2
- package/dist/client/assets/entities-s42SFcbu.js +0 -2
- package/dist/client/assets/main-BYwnnJ9E.js +0 -38
- package/dist/client/assets/main-i3nSjwXu.css +0 -2
- package/dist/client/assets/mediaReference-CW0q8-nM.js +0 -2
- package/dist/client/assets/number-field-BkDsfSCt.js +0 -2
- package/dist/client/assets/openFileInPreview-Dpge7x7S.js +0 -2
- package/dist/client/assets/popover-hyDlWUPU.js +0 -2
- package/dist/client/assets/primary-TNEEuOuT.js +0 -2
- package/dist/client/assets/primaryCloudLinkState-DbUZbjy4.js +0 -2
- package/dist/client/assets/projectScriptEditor-D2C0qPZA.js +0 -2
- package/dist/client/assets/pullRequestDetail.logic-D5hhGj8d.js +0 -10
- package/dist/client/assets/queries-Bp7Rbzrz.js +0 -2
- package/dist/client/assets/relay-V_5ApBIP.js +0 -2
- package/dist/client/assets/runtime-B92ivG9b.js +0 -7
- package/dist/client/assets/session-logic-Cx9524Pd.js +0 -27
- package/dist/client/assets/settings.archived-CxxKM6i3.js +0 -2
- package/dist/client/assets/settings.connections-CTuywqD3.js +0 -2
- package/dist/client/assets/settings.diagnostics-muot_u8V.js +0 -2
- package/dist/client/assets/settings.integrations-3B64nKur.js +0 -2
- package/dist/client/assets/settings.providers-BenYwp5l.js +0 -3
- package/dist/client/assets/settings.storage-uPkJDu8D.js +0 -2
- package/dist/client/assets/settingsLayout-BoWaVHvV.js +0 -3
- package/dist/client/assets/sidebar-4oe_dr6q.js +0 -2
- package/dist/client/assets/src-R7EkrVcv.js +0 -15
- package/dist/client/assets/terminal-links-B5f_yaZ1.js +0 -2
- package/dist/client/assets/terminalSessions-Cg0AQjBU.js +0 -2
- package/dist/client/assets/usage-BzExgBit.js +0 -2
- package/dist/client/assets/useHandleNewThread-CA9pnWuC.js +0 -2
- package/dist/client/assets/usePullRequestActions-BIPl_xE4.js +0 -3
- package/dist/client/assets/useSettings-Dp9RSL-0.js +0 -3
- package/dist/client/assets/utils-DkKLB01I.js +0 -24
- package/dist/client/assets/vcsRefInvalidation-CoBKCEWS.js +0 -2
- package/dist/client/assets/welcome-CJjj0VVp.js +0 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { $
|
|
4
|
-
// ../../node_modules/.pnpm/effect@4.
|
|
3
|
+
import { $ as fnUntracedEager, $l as equals, Ac as try_$1, Al as setStackTraceLimit, Bi as succeed$2, Bs as append, Cc as isFailure, Cu as isNumber, Dc as mapError, Ds as empty$3, Dt as mapErrorEager, Ec as map$3, Eu as isPropertyKey, F as exit, Fl as format$1, Gc as isNone, Go as EncodingError, Gt as provideServiceEffect, Gu as memoizeIdempotent, Hl as symbolRedactable, Hs as empty$4, I as fail$2, Ii as isExit, J as flatMap, Jc as liftThrowable, Jl as Tuple$1, Ju as Prototype, Kc as isOption, Ko as Class$2, Lc as fromNullOr, Ll as formatJson, M as die, Mi as failCause, Nc as filter, Nl as NodeInspectSymbol, Nn as void_$2, Or as currentTimeMillis, Os as get, Ou as isString$1, Qc as none, R as failCauseSync, Ri as isSuccess, Rl as formatPath, Sa as map$7, Ss as toSeconds, St as map$4, Tn as try_, Ts as Service, Tt as mapEager, Tu as isObjectKeyword, Uu as identity, Vc as getOrNull, Vi as void_$1, Vl as redact$2, Vs as appendAll$1, Vu as dual, Wi as IllegalArgumentError, Wl as assignProperty, Wu as memoize, Xc as map$6, Xl as strictEqual, Y as flatMapEager, Yl as make$10, Yo as TaggedError$1, Yu as pipeArguments, Zc as match$1, Zi as die$1, Zl as asEquivalence, Zs as fromIterable$1, _a as isReason, _l as args, _s as seconds, _u as isFunction, al as String$5, au as hash, ba as makeFailReason, bc as flatMap$1, bs as toMillis, bu as isNotNullish, cl as isGreaterThanOrEqualTo$3, co as iterateConcurrent, cs as isFinite$2, cu as string$1, da as isCause, dl as make$9, dn as succeed$3, du as symbol, ec as isArrayNonEmpty, el as some, eu as makeCompareMap, fn as succeedNone, fs as millis, g as catchCause, gl as PipeInspectableProto, gs as negativeInfinity, gu as isError, hl as Error$3, hn as sync, hs as nanos, hu as isBoolean, ia as fromReasons, il as Number$4, is as fromInputUnsafe, iu as combine, ji as fail$3, jl as BaseProto, ju as isUnknown, kc as succeed$1, kl as getStackTraceLimit, ll as isLessThan$3, lo as iterateEager, lu as structure, ma as isFailReason, mn as suspend$1, mo as map$2, mu as isBigInt, nc as isReadonlyArrayNonEmpty, nu as symbol$1, oc as makeEquivalence$3, os as infinity, ou as number$1, pl as min$2, pu as hasProperty, qc as isSome, ql as Array_, qo as Error$2, qu as Class$1, rn as runSyncExit, rs as fromInput$2, ru as array, sc as map$5, sl as isGreaterThan$3, ss as isDuration, st as fromResult, su as optimize, tu as makeCompareSet, ul as isLessThanOrEqualTo$3, vc as fail$1, vo as resolveConcurrency, vu as isNever$1, ws as Reference, wt as mapBothEager, wu as isObject, xa as makeInterruptReason, xc as getOrThrow, xu as isNotUndefined, y as catchEager, ya as makeDieReason, za as effectIsExit, zl as formatPropertyKey } from "./Effect-BrI3bavz.mjs";
|
|
4
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Tuple.js
|
|
5
5
|
/**
|
|
6
6
|
* Creates an `Equivalence` for tuples by comparing corresponding elements
|
|
7
7
|
* using the provided per-position `Equivalence`s. Two tuples are equivalent
|
|
@@ -35,7 +35,7 @@ import { $c as make$8, $l as hasProperty, Ac as getOrNull, As as appendAll$1, Au
|
|
|
35
35
|
* @since 4.0.0
|
|
36
36
|
*/
|
|
37
37
|
const makeEquivalence$2 = Tuple$1;
|
|
38
|
-
// ../../node_modules/.pnpm/effect@4.
|
|
38
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Record.js
|
|
39
39
|
/**
|
|
40
40
|
* Determines if a mutable record is empty.
|
|
41
41
|
*
|
|
@@ -128,7 +128,7 @@ const keys = (self) => Object.keys(self);
|
|
|
128
128
|
* @category mutations
|
|
129
129
|
* @since 2.0.0
|
|
130
130
|
*/
|
|
131
|
-
const set$
|
|
131
|
+
const set$2 = /*#__PURE__*/ dual(3, (self, key, value) => {
|
|
132
132
|
return {
|
|
133
133
|
...self,
|
|
134
134
|
[key]: value
|
|
@@ -189,7 +189,7 @@ const makeEquivalence$1 = (equivalence) => {
|
|
|
189
189
|
const is = isSubrecordBy(equivalence);
|
|
190
190
|
return (self, that) => is(self, that) && is(that, self);
|
|
191
191
|
};
|
|
192
|
-
// ../../node_modules/.pnpm/effect@4.
|
|
192
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/BigDecimal.js
|
|
193
193
|
/**
|
|
194
194
|
* Decimal numbers and arithmetic for cases where JavaScript `number` rounding
|
|
195
195
|
* is not precise enough. A `BigDecimal` stores digits as a `bigint` plus a
|
|
@@ -197,12 +197,15 @@ const makeEquivalence$1 = (equivalence) => {
|
|
|
197
197
|
* divide, round, and format decimal values such as money, quantities, and
|
|
198
198
|
* measurements.
|
|
199
199
|
*
|
|
200
|
+
* Parsed scales are limited to ±10,000, and operations that align scales throw
|
|
201
|
+
* a `RangeError` when the scales differ by more than 20,000.
|
|
202
|
+
*
|
|
200
203
|
* @stability stable
|
|
201
204
|
* @since 2.0.0
|
|
202
205
|
*/
|
|
203
|
-
const TypeId$
|
|
206
|
+
const TypeId$12 = "~effect/BigDecimal";
|
|
204
207
|
const BigDecimalProto = {
|
|
205
|
-
[TypeId$
|
|
208
|
+
[TypeId$12]: TypeId$12,
|
|
206
209
|
[symbol]() {
|
|
207
210
|
const normalized = normalize(this);
|
|
208
211
|
return combine(string$1(String(normalized.value)), number$1(normalized.scale));
|
|
@@ -250,7 +253,7 @@ const BigDecimalProto = {
|
|
|
250
253
|
* @category guards
|
|
251
254
|
* @since 2.0.0
|
|
252
255
|
*/
|
|
253
|
-
const isBigDecimal = (u) => hasProperty(u, TypeId$
|
|
256
|
+
const isBigDecimal = (u) => hasProperty(u, TypeId$12);
|
|
254
257
|
/**
|
|
255
258
|
* Creates a `BigDecimal` from a `bigint` value and a safe integer scale.
|
|
256
259
|
*
|
|
@@ -283,7 +286,7 @@ const isBigDecimal = (u) => hasProperty(u, TypeId$11);
|
|
|
283
286
|
* @category constructors
|
|
284
287
|
* @since 2.0.0
|
|
285
288
|
*/
|
|
286
|
-
const make$
|
|
289
|
+
const make$8 = (value, scale) => {
|
|
287
290
|
if (!Number.isSafeInteger(scale)) throw new RangeError(`Scale must be a safe integer, got ${scale}`);
|
|
288
291
|
const o = Object.create(BigDecimalProto);
|
|
289
292
|
o.value = value;
|
|
@@ -291,7 +294,7 @@ const make$7 = (value, scale) => {
|
|
|
291
294
|
return o;
|
|
292
295
|
};
|
|
293
296
|
const makeNormalized = (value, scale) => {
|
|
294
|
-
const o = make$
|
|
297
|
+
const o = make$8(value, scale);
|
|
295
298
|
o.normalized = o;
|
|
296
299
|
return o;
|
|
297
300
|
};
|
|
@@ -330,13 +333,17 @@ const normalize = (self) => {
|
|
|
330
333
|
if (self.value === bigint0) self.normalized = zero;
|
|
331
334
|
else {
|
|
332
335
|
const digits = `${self.value}`;
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
self.normalized = makeNormalized(BigInt(digits.slice(0, end)), self.scale - (digits.length - end));
|
|
336
|
+
const zeros = trailingZeros(digits);
|
|
337
|
+
self.normalized = makeNormalized(BigInt(digits.slice(0, digits.length - zeros)), self.scale - zeros);
|
|
336
338
|
}
|
|
337
339
|
}
|
|
338
340
|
return self.normalized;
|
|
339
341
|
};
|
|
342
|
+
const trailingZeros = (digits) => {
|
|
343
|
+
let end = digits.length;
|
|
344
|
+
while (digits[end - 1] === "0") end--;
|
|
345
|
+
return digits.length - end;
|
|
346
|
+
};
|
|
340
347
|
const MAX_COMPARISON_SCALE_ALIGNMENT = 100;
|
|
341
348
|
const comparisonPowersOfTen = [bigint1];
|
|
342
349
|
const compareBigInt = (self, that) => self === that ? 0 : self < that ? -1 : 1;
|
|
@@ -473,322 +480,13 @@ const toExponential = (n) => {
|
|
|
473
480
|
* @since 2.0.0
|
|
474
481
|
*/
|
|
475
482
|
const isZero = (n) => n.value === bigint0;
|
|
476
|
-
// ../../node_modules/.pnpm/effect@4.
|
|
477
|
-
/**
|
|
478
|
-
* Provides a base class for immutable data types.
|
|
479
|
-
*
|
|
480
|
-
* **When to use**
|
|
481
|
-
*
|
|
482
|
-
* Use when you need a lightweight immutable value type with `.pipe()` support.
|
|
483
|
-
*
|
|
484
|
-
* **Details**
|
|
485
|
-
*
|
|
486
|
-
* Extend `Class` with a type parameter to declare fields. The constructor
|
|
487
|
-
* accepts those fields as a single object argument. When there are no fields
|
|
488
|
-
* the argument is optional. Instances are `Readonly` and `Pipeable`.
|
|
489
|
-
*
|
|
490
|
-
* **Example** (Defining a value class)
|
|
491
|
-
*
|
|
492
|
-
* ```ts import.meta.vitest
|
|
493
|
-
* import { Data, Equal } from "effect"
|
|
494
|
-
*
|
|
495
|
-
* class Person extends Data.Class<{ readonly name: string }> {}
|
|
496
|
-
*
|
|
497
|
-
* Equal.equals(new Person({ name: "Mike" }), new Person({ name: "Mike" })) // => true
|
|
498
|
-
* ```
|
|
499
|
-
*
|
|
500
|
-
* @see {@link TaggedClass} — adds a `_tag` field
|
|
501
|
-
* @see {@link Error} — yieldable error variant
|
|
502
|
-
*
|
|
503
|
-
* @stability stable
|
|
504
|
-
* @category constructors
|
|
505
|
-
* @since 2.0.0
|
|
506
|
-
*/
|
|
507
|
-
const Class$1 = class extends Class$2 {
|
|
508
|
-
constructor(props) {
|
|
509
|
-
super();
|
|
510
|
-
if (props) assignProperties(this, props);
|
|
511
|
-
}
|
|
512
|
-
};
|
|
513
|
-
/**
|
|
514
|
-
* Provides a base class for immutable data types with a `_tag` discriminator.
|
|
515
|
-
*
|
|
516
|
-
* **When to use**
|
|
517
|
-
*
|
|
518
|
-
* Use when you need a single-variant tagged type or an ad-hoc discriminator.
|
|
519
|
-
*
|
|
520
|
-
* **Details**
|
|
521
|
-
*
|
|
522
|
-
* Like {@link Class}, but the resulting instances also carry a
|
|
523
|
-
* `readonly _tag: Tag` property. The `_tag` is excluded from the constructor
|
|
524
|
-
* argument.
|
|
525
|
-
*
|
|
526
|
-
* **Example** (Defining a tagged class)
|
|
527
|
-
*
|
|
528
|
-
* ```ts import.meta.vitest
|
|
529
|
-
* import { Data } from "effect"
|
|
530
|
-
*
|
|
531
|
-
* class Person extends Data.TaggedClass("Person")<{
|
|
532
|
-
* readonly name: string
|
|
533
|
-
* }> {}
|
|
534
|
-
*
|
|
535
|
-
* new Person({ name: "Mike" })._tag // => "Person"
|
|
536
|
-
* ```
|
|
537
|
-
*
|
|
538
|
-
* @see {@link Class} — without a `_tag`
|
|
539
|
-
* @see {@link TaggedError} — tagged error variant
|
|
540
|
-
* @see {@link TaggedEnum} — multi-variant unions
|
|
541
|
-
*
|
|
542
|
-
* @stability stable
|
|
543
|
-
* @category constructors
|
|
544
|
-
* @since 2.0.0
|
|
545
|
-
*/
|
|
546
|
-
const TaggedClass = (tag) => class extends Class$1 {
|
|
547
|
-
_tag = tag;
|
|
548
|
-
};
|
|
549
|
-
/**
|
|
550
|
-
* Creates constructors and matchers for a `TaggedEnum` type.
|
|
551
|
-
*
|
|
552
|
-
* **When to use**
|
|
553
|
-
*
|
|
554
|
-
* Use when you model a closed union with plain data objects and want
|
|
555
|
-
* construction, tag checks, and exhaustive matching from the same definition.
|
|
556
|
-
*
|
|
557
|
-
* **Details**
|
|
558
|
-
*
|
|
559
|
-
* Returns an object with:
|
|
560
|
-
* - One constructor per variant (keyed by tag name)
|
|
561
|
-
* - `$is(tag)` — returns a type-guard function that checks only the `_tag` field
|
|
562
|
-
* - `$match` — exhaustive pattern matching (data-first or data-last)
|
|
563
|
-
*
|
|
564
|
-
* **Gotchas**
|
|
565
|
-
*
|
|
566
|
-
* - Constructors produce **plain objects**, not class instances.
|
|
567
|
-
* - `$is(tag)` only checks the `_tag` field, not the full structure. It relies
|
|
568
|
-
* on the tag being globally unique and the value being produced by your
|
|
569
|
-
* constructors. For untrusted input, validate with the `Schema` module first.
|
|
570
|
-
*
|
|
571
|
-
* **Example** (Creating and matching tagged enum values)
|
|
572
|
-
*
|
|
573
|
-
* ```ts import.meta.vitest
|
|
574
|
-
* import { Data } from "effect"
|
|
575
|
-
*
|
|
576
|
-
* type HttpError = Data.TaggedEnum<{
|
|
577
|
-
* BadRequest: { readonly message: string }
|
|
578
|
-
* NotFound: { readonly url: string }
|
|
579
|
-
* }>
|
|
580
|
-
*
|
|
581
|
-
* const { BadRequest, NotFound, $is, $match } = Data.taggedEnum<HttpError>()
|
|
582
|
-
*
|
|
583
|
-
* const err = NotFound({ url: "/missing" })
|
|
584
|
-
*
|
|
585
|
-
* $is("NotFound")(err) // => true
|
|
586
|
-
*
|
|
587
|
-
* $match(err, {
|
|
588
|
-
* BadRequest: (e) => e.message,
|
|
589
|
-
* NotFound: (e) => `${e.url} not found`
|
|
590
|
-
* }) // => "/missing not found"
|
|
591
|
-
* ```
|
|
592
|
-
*
|
|
593
|
-
* **Example** (Defining a generic tagged enum)
|
|
594
|
-
*
|
|
595
|
-
* ```ts import.meta.vitest
|
|
596
|
-
* import { Data } from "effect"
|
|
597
|
-
*
|
|
598
|
-
* type MyResult<E, A> = Data.TaggedEnum<{
|
|
599
|
-
* Failure: { readonly error: E }
|
|
600
|
-
* Success: { readonly value: A }
|
|
601
|
-
* }>
|
|
602
|
-
* interface MyResultDef extends Data.TaggedEnum.WithGenerics<2> {
|
|
603
|
-
* readonly taggedEnum: MyResult<this["A"], this["B"]>
|
|
604
|
-
* }
|
|
605
|
-
* const { Failure, Success } = Data.taggedEnum<MyResultDef>()
|
|
606
|
-
*
|
|
607
|
-
* const ok = Success({ value: 42 })
|
|
608
|
-
* // ok: { readonly _tag: "Success"; readonly value: number }
|
|
609
|
-
* ok // => { value: 42, _tag: "Success" }
|
|
610
|
-
* ```
|
|
611
|
-
*
|
|
612
|
-
* @see {@link TaggedEnum} — the type-level companion
|
|
613
|
-
* @see {@link TaggedEnum.Constructor} — the returned object type
|
|
614
|
-
* @see {@link TaggedEnum.WithGenerics} — generic enum support
|
|
615
|
-
*
|
|
616
|
-
* @stability stable
|
|
617
|
-
* @category constructors
|
|
618
|
-
* @since 2.0.0
|
|
619
|
-
*/
|
|
620
|
-
const taggedEnum = () => new Proxy({}, { get(_target, tag, _receiver) {
|
|
621
|
-
if (tag === "$is") return isTagged;
|
|
622
|
-
else if (tag === "$match") return taggedMatch;
|
|
623
|
-
return (props) => ({
|
|
624
|
-
...props,
|
|
625
|
-
_tag: tag
|
|
626
|
-
});
|
|
627
|
-
} });
|
|
628
|
-
function taggedMatch() {
|
|
629
|
-
if (arguments.length === 1) {
|
|
630
|
-
const cases = arguments[0];
|
|
631
|
-
return function(value) {
|
|
632
|
-
return cases[value._tag](value);
|
|
633
|
-
};
|
|
634
|
-
}
|
|
635
|
-
const value = arguments[0];
|
|
636
|
-
return arguments[1][value._tag](value);
|
|
637
|
-
}
|
|
638
|
-
/**
|
|
639
|
-
* Provides a base class for yieldable errors.
|
|
640
|
-
*
|
|
641
|
-
* **When to use**
|
|
642
|
-
*
|
|
643
|
-
* Use when you need yieldable errors that do **not** need tag-based
|
|
644
|
-
* discrimination.
|
|
645
|
-
*
|
|
646
|
-
* **Details**
|
|
647
|
-
*
|
|
648
|
-
* Extends `Cause.YieldableError`, so instances can be yielded inside
|
|
649
|
-
* `Effect.gen` to fail the enclosing effect. Fields are passed as a single
|
|
650
|
-
* object; when there are no fields the argument is optional. If a `message`
|
|
651
|
-
* field is provided, it becomes the error's `.message`.
|
|
652
|
-
*
|
|
653
|
-
* **Example** (Defining a yieldable error)
|
|
654
|
-
*
|
|
655
|
-
* ```ts import.meta.vitest
|
|
656
|
-
* import { Data, Effect, Exit } from "effect"
|
|
657
|
-
*
|
|
658
|
-
* class NetworkError extends Data.Error<{
|
|
659
|
-
* readonly code: number
|
|
660
|
-
* readonly message: string
|
|
661
|
-
* }> {}
|
|
662
|
-
*
|
|
663
|
-
* const program = Effect.gen(function*() {
|
|
664
|
-
* return yield* new NetworkError({ code: 500, message: "timeout" })
|
|
665
|
-
* })
|
|
666
|
-
*
|
|
667
|
-
* Effect.runSync(Effect.exit(program)) // => Exit.fail(new NetworkError({ code: 500, message: "timeout" }))
|
|
668
|
-
* ```
|
|
669
|
-
*
|
|
670
|
-
* @see {@link TaggedError} — adds a `_tag` for `Effect.catchTag`
|
|
671
|
-
* @see {@link Class} — non-error data class
|
|
672
|
-
*
|
|
673
|
-
* @stability stable
|
|
674
|
-
* @category constructors
|
|
675
|
-
* @since 2.0.0
|
|
676
|
-
*/
|
|
677
|
-
const Error$2 = Error$3;
|
|
678
|
-
/**
|
|
679
|
-
* Creates a tagged error class with a `_tag` discriminator.
|
|
680
|
-
*
|
|
681
|
-
* **When to use**
|
|
682
|
-
*
|
|
683
|
-
* Use when you need domain errors with discriminated-union handling.
|
|
684
|
-
*
|
|
685
|
-
* **Details**
|
|
686
|
-
*
|
|
687
|
-
* Like {@link Error}, but instances also carry a `readonly _tag` property,
|
|
688
|
-
* enabling `Effect.catchTag` and `Effect.catchTags` for tag-based recovery.
|
|
689
|
-
* The `_tag` is excluded from the constructor argument. Yielding an instance
|
|
690
|
-
* inside `Effect.gen` fails the effect with this error.
|
|
691
|
-
*
|
|
692
|
-
* **Example** (Recovering by tag)
|
|
693
|
-
*
|
|
694
|
-
* ```ts import.meta.vitest
|
|
695
|
-
* import { Data, Effect } from "effect"
|
|
696
|
-
*
|
|
697
|
-
* class NotFound extends Data.TaggedError("NotFound")<{
|
|
698
|
-
* readonly resource: string
|
|
699
|
-
* }> {}
|
|
700
|
-
*
|
|
701
|
-
* class Forbidden extends Data.TaggedError("Forbidden")<{
|
|
702
|
-
* readonly reason: string
|
|
703
|
-
* }> {}
|
|
704
|
-
*
|
|
705
|
-
* const program = Effect.gen(function*() {
|
|
706
|
-
* return yield* new NotFound({ resource: "/users/42" })
|
|
707
|
-
* })
|
|
708
|
-
*
|
|
709
|
-
* const recovered = program.pipe(
|
|
710
|
-
* Effect.catchTag("NotFound", (e) =>
|
|
711
|
-
* Effect.succeed(`missing: ${e.resource}`))
|
|
712
|
-
* )
|
|
713
|
-
*
|
|
714
|
-
* await Effect.runPromise(recovered) // => "missing: /users/42"
|
|
715
|
-
* ```
|
|
716
|
-
*
|
|
717
|
-
* @see {@link Error} — without a `_tag`
|
|
718
|
-
* @see {@link TaggedClass} — tagged class that is not an error
|
|
719
|
-
*
|
|
720
|
-
* @stability stable
|
|
721
|
-
* @category constructors
|
|
722
|
-
* @since 2.0.0
|
|
723
|
-
*/
|
|
724
|
-
const TaggedError$1 = TaggedError$2;
|
|
725
|
-
// ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/encoding/EncodingError.js
|
|
726
|
-
/**
|
|
727
|
-
* Shared error type for encoding and decoding operations.
|
|
728
|
-
*
|
|
729
|
-
* @stability stable
|
|
730
|
-
* @since 4.0.0
|
|
731
|
-
*/
|
|
732
|
-
/**
|
|
733
|
-
* Type identifier stored on `EncodingError` values and used by
|
|
734
|
-
* `isEncodingError`.
|
|
735
|
-
*
|
|
736
|
-
* **When to use**
|
|
737
|
-
*
|
|
738
|
-
* Use when implementing low-level `EncodingError`-compatible values that need
|
|
739
|
-
* to carry the runtime marker.
|
|
740
|
-
*
|
|
741
|
-
* **Details**
|
|
742
|
-
*
|
|
743
|
-
* This marker is part of the runtime representation of `EncodingError`. Prefer
|
|
744
|
-
* `isEncodingError` when narrowing unknown values.
|
|
745
|
-
*
|
|
746
|
-
* @see {@link isEncodingError} for the public guard that checks this marker
|
|
747
|
-
*
|
|
748
|
-
* @stability stable
|
|
749
|
-
* @category type IDs
|
|
750
|
-
* @since 4.0.0
|
|
751
|
-
*/
|
|
752
|
-
const EncodingErrorTypeId = "~effect/encoding/EncodingError";
|
|
753
|
-
/**
|
|
754
|
-
* Error returned when an encoding or decoding operation cannot process its input.
|
|
755
|
-
*
|
|
756
|
-
* **When to use**
|
|
757
|
-
*
|
|
758
|
-
* Use when you need to handle or inspect failures from encoding or decoding
|
|
759
|
-
* operations.
|
|
760
|
-
*
|
|
761
|
-
* **Details**
|
|
762
|
-
*
|
|
763
|
-
* The error records whether the failure happened during encoding or decoding,
|
|
764
|
-
* which encoding module reported it, the original input, and a human-readable
|
|
765
|
-
* message.
|
|
766
|
-
*
|
|
767
|
-
* @see {@link isEncodingError} for checking whether a value is an EncodingError
|
|
768
|
-
*
|
|
769
|
-
* @stability stable
|
|
770
|
-
* @category errors
|
|
771
|
-
* @since 4.0.0
|
|
772
|
-
*/
|
|
773
|
-
var EncodingError = class extends (/*#__PURE__*/ TaggedError$1("EncodingError")) {
|
|
774
|
-
/**
|
|
775
|
-
* Marks this value as an encoding or decoding error for runtime guards.
|
|
776
|
-
*
|
|
777
|
-
* **When to use**
|
|
778
|
-
*
|
|
779
|
-
* Use to identify `EncodingError` instances through `isEncodingError`.
|
|
780
|
-
*
|
|
781
|
-
* @since 4.0.0
|
|
782
|
-
*/
|
|
783
|
-
[EncodingErrorTypeId] = EncodingErrorTypeId;
|
|
784
|
-
};
|
|
785
|
-
// ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/dateTime.js
|
|
483
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/dateTime.js
|
|
786
484
|
/** @internal */
|
|
787
|
-
const TypeId$
|
|
485
|
+
const TypeId$11 = "~effect/DateTime";
|
|
788
486
|
/** @internal */
|
|
789
487
|
const TimeZoneTypeId = "~effect/DateTime/TimeZone";
|
|
790
|
-
const Proto$
|
|
791
|
-
[TypeId$
|
|
488
|
+
const Proto$4 = {
|
|
489
|
+
[TypeId$11]: TypeId$11,
|
|
792
490
|
pipe() {
|
|
793
491
|
return pipeArguments(this, arguments);
|
|
794
492
|
},
|
|
@@ -800,7 +498,7 @@ const Proto$3 = {
|
|
|
800
498
|
}
|
|
801
499
|
};
|
|
802
500
|
const ProtoUtc = {
|
|
803
|
-
...Proto$
|
|
501
|
+
...Proto$4,
|
|
804
502
|
_tag: "Utc",
|
|
805
503
|
[symbol]() {
|
|
806
504
|
return number$1(this.epochMilliseconds);
|
|
@@ -813,7 +511,7 @@ const ProtoUtc = {
|
|
|
813
511
|
}
|
|
814
512
|
};
|
|
815
513
|
const ProtoZoned = {
|
|
816
|
-
...Proto$
|
|
514
|
+
...Proto$4,
|
|
817
515
|
_tag: "Zoned",
|
|
818
516
|
[symbol]() {
|
|
819
517
|
return combine(number$1(this.epochMilliseconds))(hash(this.zone));
|
|
@@ -852,47 +550,63 @@ const ProtoTimeZoneNamed = {
|
|
|
852
550
|
}
|
|
853
551
|
};
|
|
854
552
|
({ ...ProtoTimeZone });
|
|
553
|
+
const cacheSlot = {
|
|
554
|
+
value: void 0,
|
|
555
|
+
enumerable: false,
|
|
556
|
+
writable: true
|
|
557
|
+
};
|
|
558
|
+
const sealedCaches = /*#__PURE__*/ new WeakMap();
|
|
559
|
+
const cacheAccessor = (key, slots) => ({
|
|
560
|
+
get() {
|
|
561
|
+
return Object.isExtensible(this) ? void 0 : sealedCaches.get(this)?.[key];
|
|
562
|
+
},
|
|
563
|
+
set(value) {
|
|
564
|
+
if (Object.isExtensible(this)) {
|
|
565
|
+
for (const slot of slots) Object.defineProperty(this, slot, cacheSlot);
|
|
566
|
+
this[key] = value;
|
|
567
|
+
} else {
|
|
568
|
+
let caches = sealedCaches.get(this);
|
|
569
|
+
if (caches === void 0) {
|
|
570
|
+
caches = {};
|
|
571
|
+
sealedCaches.set(this, caches);
|
|
572
|
+
}
|
|
573
|
+
caches[key] = value;
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
});
|
|
577
|
+
const zonedSlots = [
|
|
578
|
+
"partsUtc",
|
|
579
|
+
"adjustedEpochMilliseconds",
|
|
580
|
+
"partsAdjusted"
|
|
581
|
+
];
|
|
582
|
+
Object.defineProperty(ProtoUtc, "partsUtc", cacheAccessor("partsUtc", ["partsUtc"]));
|
|
583
|
+
Object.defineProperties(ProtoZoned, {
|
|
584
|
+
partsUtc: cacheAccessor("partsUtc", zonedSlots),
|
|
585
|
+
adjustedEpochMilliseconds: cacheAccessor("adjustedEpochMilliseconds", zonedSlots),
|
|
586
|
+
partsAdjusted: cacheAccessor("partsAdjusted", zonedSlots)
|
|
587
|
+
});
|
|
855
588
|
/** @internal */
|
|
856
589
|
const makeZonedProto = (epochMillis, zone, partsUtc) => {
|
|
857
590
|
const self = Object.create(ProtoZoned);
|
|
858
591
|
self.epochMilliseconds = epochMillis;
|
|
859
592
|
self.zone = zone;
|
|
860
|
-
|
|
861
|
-
value: partsUtc,
|
|
862
|
-
enumerable: false,
|
|
863
|
-
writable: true
|
|
864
|
-
});
|
|
865
|
-
Object.defineProperty(self, "adjustedEpochMillis", {
|
|
866
|
-
value: void 0,
|
|
867
|
-
enumerable: false,
|
|
868
|
-
writable: true
|
|
869
|
-
});
|
|
870
|
-
Object.defineProperty(self, "partsAdjusted", {
|
|
871
|
-
value: void 0,
|
|
872
|
-
enumerable: false,
|
|
873
|
-
writable: true
|
|
874
|
-
});
|
|
593
|
+
if (partsUtc !== void 0) self.partsUtc = partsUtc;
|
|
875
594
|
return self;
|
|
876
595
|
};
|
|
877
596
|
/** @internal */
|
|
878
|
-
const isDateTime$1 = (u) => hasProperty(u, TypeId$
|
|
597
|
+
const isDateTime$1 = (u) => hasProperty(u, TypeId$11);
|
|
879
598
|
const isDateTimeArgs = (args) => isDateTime$1(args[0]);
|
|
880
599
|
/** @internal */
|
|
881
600
|
const isTimeZone = (u) => hasProperty(u, TimeZoneTypeId);
|
|
882
601
|
/** @internal */
|
|
883
602
|
const isUtc$1 = (self) => self._tag === "Utc";
|
|
884
603
|
/** @internal */
|
|
885
|
-
const Equivalence$
|
|
604
|
+
const Equivalence$4 = /*#__PURE__*/ make$10((a, b) => a.epochMilliseconds === b.epochMilliseconds);
|
|
886
605
|
/** @internal */
|
|
887
|
-
const Order$1 = /*#__PURE__*/ make$
|
|
606
|
+
const Order$1 = /*#__PURE__*/ make$9((self, that) => self.epochMilliseconds < that.epochMilliseconds ? -1 : self.epochMilliseconds > that.epochMilliseconds ? 1 : 0);
|
|
888
607
|
const makeUtc = (epochMillis) => {
|
|
889
608
|
const self = Object.create(ProtoUtc);
|
|
890
609
|
self.epochMilliseconds = epochMillis;
|
|
891
|
-
Object.defineProperty(self, "partsUtc", {
|
|
892
|
-
value: void 0,
|
|
893
|
-
enumerable: false,
|
|
894
|
-
writable: true
|
|
895
|
-
});
|
|
896
610
|
return self;
|
|
897
611
|
};
|
|
898
612
|
/** @internal */
|
|
@@ -919,10 +633,13 @@ const makeUnsafe$1 = (input) => {
|
|
|
919
633
|
* so `makeUnsafe` appends "Z" to force UTC interpretation.
|
|
920
634
|
* This check prevents appending "Z" to strings that already have a zone
|
|
921
635
|
* (e.g. "2024-01-01T12:00:00Z", "...+05:30", "...GMT"), which would produce invalid dates.
|
|
636
|
+
* `Date.parse` also accepts a trailing `z` or `gmt` in any case. Only that trailing
|
|
637
|
+
* match is case-insensitive, so lowercase letters in a comment like "(xyz)" do not
|
|
638
|
+
* count as a zone.
|
|
922
639
|
*/
|
|
923
|
-
const hasZone = (input) => /Z|GMT|[+-]\d{2}$|[+-]\d{2}:?\d{2}$|\]$/.test(input);
|
|
640
|
+
const hasZone = (input) => /Z|GMT|[+-]\d{2}$|[+-]\d{2}:?\d{2}$|\]$/.test(input) || /z$|gmt$/i.test(input);
|
|
924
641
|
/** @internal */
|
|
925
|
-
const make$
|
|
642
|
+
const make$7 = /*#__PURE__*/ liftThrowable(makeUnsafe$1);
|
|
926
643
|
/** @internal */
|
|
927
644
|
const now$1 = /*#__PURE__*/ map$2(currentTimeMillis, makeUtc);
|
|
928
645
|
/** @internal */
|
|
@@ -936,6 +653,7 @@ const formatOptions = {
|
|
|
936
653
|
day: "numeric",
|
|
937
654
|
month: "numeric",
|
|
938
655
|
year: "numeric",
|
|
656
|
+
era: "short",
|
|
939
657
|
hour: "numeric",
|
|
940
658
|
minute: "numeric",
|
|
941
659
|
second: "numeric",
|
|
@@ -972,9 +690,17 @@ const toDate$1 = (self) => {
|
|
|
972
690
|
if (self._tag === "Utc") return new Date(self.epochMilliseconds);
|
|
973
691
|
else if (self.zone._tag === "Offset") return new Date(self.epochMilliseconds + self.zone.offset);
|
|
974
692
|
else if (self.adjustedEpochMilliseconds !== void 0) return new Date(self.adjustedEpochMilliseconds);
|
|
975
|
-
|
|
693
|
+
let bc = false;
|
|
694
|
+
const parts = self.zone.format.formatToParts(self.epochMilliseconds).filter((_) => {
|
|
695
|
+
if (_.type === "era") {
|
|
696
|
+
bc = _.value === "BC";
|
|
697
|
+
return false;
|
|
698
|
+
}
|
|
699
|
+
return _.type !== "literal";
|
|
700
|
+
});
|
|
701
|
+
const year = Number(parts[2].value);
|
|
976
702
|
const date = /* @__PURE__ */ new Date(0);
|
|
977
|
-
date.setUTCFullYear(
|
|
703
|
+
date.setUTCFullYear(bc ? 1 - year : year, Number(parts[0].value) - 1, Number(parts[1].value));
|
|
978
704
|
date.setUTCHours(Number(parts[3].value), Number(parts[4].value), Number(parts[5].value), parts[6]?.type === "fractionalSecond" ? Number(parts[6].value) : (self.epochMilliseconds % 1e3 + 1e3) % 1e3);
|
|
979
705
|
self.adjustedEpochMilliseconds = date.getTime();
|
|
980
706
|
return date;
|
|
@@ -1011,14 +737,16 @@ const dateToParts = (date) => ({
|
|
|
1011
737
|
const toParts$1 = (self) => {
|
|
1012
738
|
if (self._tag === "Utc") return toPartsUtc(self);
|
|
1013
739
|
else if (self.partsAdjusted !== void 0) return self.partsAdjusted;
|
|
1014
|
-
|
|
1015
|
-
|
|
740
|
+
const parts = withDate(self, dateToParts);
|
|
741
|
+
self.partsAdjusted = parts;
|
|
742
|
+
return parts;
|
|
1016
743
|
};
|
|
1017
744
|
/** @internal */
|
|
1018
745
|
const toPartsUtc = (self) => {
|
|
1019
746
|
if (self.partsUtc !== void 0) return self.partsUtc;
|
|
1020
|
-
|
|
1021
|
-
|
|
747
|
+
const parts = withDateUtc(self, dateToParts);
|
|
748
|
+
self.partsUtc = parts;
|
|
749
|
+
return parts;
|
|
1022
750
|
};
|
|
1023
751
|
const setPartsDate = (date, parts) => {
|
|
1024
752
|
if (parts.year !== void 0 || parts.month !== void 0 || parts.day !== void 0) date.setUTCFullYear(parts.year ?? date.getUTCFullYear(), parts.month !== void 0 ? parts.month - 1 : date.getUTCMonth(), parts.day ?? date.getUTCDate());
|
|
@@ -1065,7 +793,7 @@ const makeZonedFromAdjusted = (adjustedMillis, zone, disambiguation) => {
|
|
|
1065
793
|
}
|
|
1066
794
|
return makeZonedProto(adjustedMillis - afterOffset, zone);
|
|
1067
795
|
};
|
|
1068
|
-
const offsetRegExp = /([+-])(\d{2})
|
|
796
|
+
const offsetRegExp = /([+-])(\d{2}):?(\d{2})$/;
|
|
1069
797
|
const parseOffset = (offset) => {
|
|
1070
798
|
const match = offsetRegExp.exec(offset);
|
|
1071
799
|
if (match === null) return null;
|
|
@@ -1185,76 +913,271 @@ const toLowerCase$2 = (self) => self.toLowerCase();
|
|
|
1185
913
|
* @since 2.0.0
|
|
1186
914
|
*/
|
|
1187
915
|
const trim$2 = (self) => self.trim();
|
|
1188
|
-
// ../../node_modules/.pnpm/effect@4.
|
|
916
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/encoding/Base64.js
|
|
1189
917
|
/**
|
|
1190
|
-
*
|
|
1191
|
-
*
|
|
1192
|
-
* **When to use**
|
|
1193
|
-
*
|
|
1194
|
-
* Use to narrow an unknown value before treating it as a `DateTime`.
|
|
1195
|
-
*
|
|
1196
|
-
* @see {@link isUtc} for narrowing a known `DateTime` to UTC
|
|
1197
|
-
* @see {@link isZoned} for narrowing a known `DateTime` to zoned
|
|
918
|
+
* Base64 encoding and decoding helpers.
|
|
1198
919
|
*
|
|
1199
920
|
* @stability stable
|
|
1200
|
-
* @
|
|
1201
|
-
* @since 3.6.0
|
|
921
|
+
* @since 4.0.0
|
|
1202
922
|
*/
|
|
1203
|
-
const isDateTime = isDateTime$1;
|
|
1204
923
|
/**
|
|
1205
|
-
*
|
|
924
|
+
* Encodes the given value into a Base64 (RFC 4648) string.
|
|
1206
925
|
*
|
|
1207
926
|
* **When to use**
|
|
1208
927
|
*
|
|
1209
|
-
* Use to
|
|
1210
|
-
*
|
|
1211
|
-
*
|
|
1212
|
-
* @see {@link isZoned} for narrowing to zoned date-times
|
|
1213
|
-
* @see {@link match} for handling both UTC and zoned cases
|
|
1214
|
-
*
|
|
1215
|
-
* @stability stable
|
|
1216
|
-
* @category guards
|
|
1217
|
-
* @since 3.6.0
|
|
1218
|
-
*/
|
|
1219
|
-
const isUtc = isUtc$1;
|
|
1220
|
-
/**
|
|
1221
|
-
* Provides an `Equivalence` for comparing two `DateTime` values for equality.
|
|
928
|
+
* Use to encode text or bytes as a standard padded Base64 string for storage or
|
|
929
|
+
* transport.
|
|
1222
930
|
*
|
|
1223
931
|
* **Details**
|
|
1224
932
|
*
|
|
1225
|
-
*
|
|
1226
|
-
*
|
|
933
|
+
* String inputs are encoded as UTF-8 bytes before Base64 encoding.
|
|
934
|
+
* `Uint8Array` inputs are encoded directly. The output uses the standard
|
|
935
|
+
* RFC 4648 alphabet with `=` padding.
|
|
1227
936
|
*
|
|
1228
|
-
* **Example** (
|
|
937
|
+
* **Example** (Encoding Base64 strings and bytes)
|
|
1229
938
|
*
|
|
1230
939
|
* ```ts import.meta.vitest
|
|
1231
|
-
* import {
|
|
940
|
+
* import { Base64 } from "effect/encoding"
|
|
1232
941
|
*
|
|
1233
|
-
*
|
|
1234
|
-
* const zoned = DateTime.makeZonedUnsafe("2024-01-01T12:00:00Z", {
|
|
1235
|
-
* timeZone: "Europe/London"
|
|
1236
|
-
* })
|
|
942
|
+
* Base64.encode("hello") // => "aGVsbG8="
|
|
1237
943
|
*
|
|
1238
|
-
*
|
|
944
|
+
* const bytes = new Uint8Array([72, 101, 108, 108, 111])
|
|
945
|
+
* Base64.encode(bytes) // => "SGVsbG8="
|
|
1239
946
|
* ```
|
|
1240
947
|
*
|
|
948
|
+
* @see {@link decode} for decoding standard Base64 to bytes
|
|
949
|
+
* @see {@link decodeString} for decoding standard Base64 to UTF-8 text
|
|
950
|
+
*
|
|
1241
951
|
* @stability stable
|
|
1242
|
-
* @category
|
|
1243
|
-
* @since
|
|
952
|
+
* @category encoding
|
|
953
|
+
* @since 4.0.0
|
|
1244
954
|
*/
|
|
1245
|
-
const
|
|
955
|
+
const encode$1 = (input) => encodeBytes(typeof input === "string" ? encoder$1.encode(input) : input);
|
|
1246
956
|
/**
|
|
1247
|
-
*
|
|
957
|
+
* Decodes a Base64 (RFC 4648) string into bytes safely.
|
|
958
|
+
*
|
|
959
|
+
* **When to use**
|
|
960
|
+
*
|
|
961
|
+
* Use to decode a standard padded Base64 string into bytes without throwing on
|
|
962
|
+
* invalid input.
|
|
1248
963
|
*
|
|
1249
964
|
* **Details**
|
|
1250
965
|
*
|
|
1251
|
-
* `
|
|
1252
|
-
*
|
|
966
|
+
* Returns `Result.succeed` with a `Uint8Array` when decoding succeeds, or
|
|
967
|
+
* `Result.fail` with an `EncodingError` when the input is not valid Base64.
|
|
1253
968
|
*
|
|
1254
|
-
* **Example** (
|
|
969
|
+
* **Example** (Decoding Base64 bytes)
|
|
1255
970
|
*
|
|
1256
971
|
* ```ts import.meta.vitest
|
|
1257
|
-
* import {
|
|
972
|
+
* import { Result } from "effect"
|
|
973
|
+
* import { Base64 } from "effect/encoding"
|
|
974
|
+
*
|
|
975
|
+
* Base64.decode("SGVsbG8=") // => Result.succeed(new Uint8Array([72, 101, 108, 108, 111]))
|
|
976
|
+
* ```
|
|
977
|
+
*
|
|
978
|
+
* @stability stable
|
|
979
|
+
* @category decoding
|
|
980
|
+
* @since 4.0.0
|
|
981
|
+
*/
|
|
982
|
+
const decode$1 = (str) => {
|
|
983
|
+
const stripped = stripCrlf(str);
|
|
984
|
+
const length = stripped.length;
|
|
985
|
+
if (length % 4 !== 0) return fail$1(new EncodingError({
|
|
986
|
+
kind: "Decode",
|
|
987
|
+
module: "Base64",
|
|
988
|
+
input: stripped,
|
|
989
|
+
message: `Length must be a multiple of 4, but is ${length}`
|
|
990
|
+
}));
|
|
991
|
+
const index = stripped.indexOf("=");
|
|
992
|
+
if (index !== -1 && (index < length - 2 || index === length - 2 && stripped[length - 1] !== "=")) return fail$1(new EncodingError({
|
|
993
|
+
kind: "Decode",
|
|
994
|
+
module: "Base64",
|
|
995
|
+
input: stripped,
|
|
996
|
+
message: "Found a '=' character, but it is not at the end"
|
|
997
|
+
}));
|
|
998
|
+
try {
|
|
999
|
+
const missingOctets = stripped.endsWith("==") ? 2 : stripped.endsWith("=") ? 1 : 0;
|
|
1000
|
+
const result = new Uint8Array(3 * (length / 4) - missingOctets);
|
|
1001
|
+
for (let i = 0, j = 0; i < length; i += 4, j += 3) {
|
|
1002
|
+
const buffer = getCode(stripped.charCodeAt(i)) << 18 | getCode(stripped.charCodeAt(i + 1)) << 12 | getCode(stripped.charCodeAt(i + 2)) << 6 | getCode(stripped.charCodeAt(i + 3));
|
|
1003
|
+
result[j] = buffer >> 16;
|
|
1004
|
+
result[j + 1] = buffer >> 8 & 255;
|
|
1005
|
+
result[j + 2] = buffer & 255;
|
|
1006
|
+
}
|
|
1007
|
+
return succeed$1(result);
|
|
1008
|
+
} catch (cause) {
|
|
1009
|
+
return fail$1(new EncodingError({
|
|
1010
|
+
kind: "Decode",
|
|
1011
|
+
module: "Base64",
|
|
1012
|
+
input: stripped,
|
|
1013
|
+
message: cause instanceof Error ? cause.message : "Invalid input"
|
|
1014
|
+
}));
|
|
1015
|
+
}
|
|
1016
|
+
};
|
|
1017
|
+
/**
|
|
1018
|
+
* Decodes a Base64 (RFC 4648) string into UTF-8 text safely.
|
|
1019
|
+
*
|
|
1020
|
+
* **When to use**
|
|
1021
|
+
*
|
|
1022
|
+
* Use to decode a standard padded Base64 string into UTF-8 text without
|
|
1023
|
+
* throwing on invalid input.
|
|
1024
|
+
*
|
|
1025
|
+
* **Details**
|
|
1026
|
+
*
|
|
1027
|
+
* Returns `Result.succeed` with the decoded text when decoding succeeds, or
|
|
1028
|
+
* `Result.fail` with an `EncodingError` when the input is not valid Base64.
|
|
1029
|
+
*
|
|
1030
|
+
* **Example** (Decoding Base64 strings)
|
|
1031
|
+
*
|
|
1032
|
+
* ```ts import.meta.vitest
|
|
1033
|
+
* import { Result } from "effect"
|
|
1034
|
+
* import { Base64 } from "effect/encoding"
|
|
1035
|
+
*
|
|
1036
|
+
* Base64.decodeString("aGVsbG8=") // => Result.succeed("hello")
|
|
1037
|
+
* ```
|
|
1038
|
+
*
|
|
1039
|
+
* @stability stable
|
|
1040
|
+
* @category decoding
|
|
1041
|
+
* @since 4.0.0
|
|
1042
|
+
*/
|
|
1043
|
+
const decodeString = (str) => map$3(decode$1(str), (_) => decoder.decode(_));
|
|
1044
|
+
const encodeBytes = (bytes) => {
|
|
1045
|
+
const length = bytes.length;
|
|
1046
|
+
const toBase64 = Uint8Array.prototype.toBase64;
|
|
1047
|
+
if (length >= 32 && typeof toBase64 === "function") return toBase64.call(bytes);
|
|
1048
|
+
return length < 128 ? encodeShort(bytes) : encodeLong(bytes);
|
|
1049
|
+
};
|
|
1050
|
+
const encodeShort = (bytes) => {
|
|
1051
|
+
const length = bytes.length;
|
|
1052
|
+
let result = "";
|
|
1053
|
+
let i = 2;
|
|
1054
|
+
for (; i < length; i += 3) {
|
|
1055
|
+
result += alphabet[bytes[i - 2] >> 2];
|
|
1056
|
+
result += alphabet[(bytes[i - 2] & 3) << 4 | bytes[i - 1] >> 4];
|
|
1057
|
+
result += alphabet[(bytes[i - 1] & 15) << 2 | bytes[i] >> 6];
|
|
1058
|
+
result += alphabet[bytes[i] & 63];
|
|
1059
|
+
}
|
|
1060
|
+
if (i === length + 1) {
|
|
1061
|
+
result += alphabet[bytes[i - 2] >> 2];
|
|
1062
|
+
result += alphabet[(bytes[i - 2] & 3) << 4];
|
|
1063
|
+
result += "==";
|
|
1064
|
+
}
|
|
1065
|
+
if (i === length) {
|
|
1066
|
+
result += alphabet[bytes[i - 2] >> 2];
|
|
1067
|
+
result += alphabet[(bytes[i - 2] & 3) << 4 | bytes[i - 1] >> 4];
|
|
1068
|
+
result += alphabet[(bytes[i - 1] & 15) << 2];
|
|
1069
|
+
result += "=";
|
|
1070
|
+
}
|
|
1071
|
+
return result;
|
|
1072
|
+
};
|
|
1073
|
+
const encodeLong = (bytes) => {
|
|
1074
|
+
const length = bytes.length;
|
|
1075
|
+
const result = new Uint8Array(Math.ceil(length / 3) * 4);
|
|
1076
|
+
let i;
|
|
1077
|
+
let j = 0;
|
|
1078
|
+
for (i = 2; i < length; i += 3, j += 4) {
|
|
1079
|
+
result[j] = alphabetCodes[bytes[i - 2] >> 2];
|
|
1080
|
+
result[j + 1] = alphabetCodes[(bytes[i - 2] & 3) << 4 | bytes[i - 1] >> 4];
|
|
1081
|
+
result[j + 2] = alphabetCodes[(bytes[i - 1] & 15) << 2 | bytes[i] >> 6];
|
|
1082
|
+
result[j + 3] = alphabetCodes[bytes[i] & 63];
|
|
1083
|
+
}
|
|
1084
|
+
if (i === length + 1) {
|
|
1085
|
+
result[j] = alphabetCodes[bytes[i - 2] >> 2];
|
|
1086
|
+
result[j + 1] = alphabetCodes[(bytes[i - 2] & 3) << 4];
|
|
1087
|
+
result[j + 2] = paddingCode;
|
|
1088
|
+
result[j + 3] = paddingCode;
|
|
1089
|
+
}
|
|
1090
|
+
if (i === length) {
|
|
1091
|
+
result[j] = alphabetCodes[bytes[i - 2] >> 2];
|
|
1092
|
+
result[j + 1] = alphabetCodes[(bytes[i - 2] & 3) << 4 | bytes[i - 1] >> 4];
|
|
1093
|
+
result[j + 2] = alphabetCodes[(bytes[i - 1] & 15) << 2];
|
|
1094
|
+
result[j + 3] = paddingCode;
|
|
1095
|
+
}
|
|
1096
|
+
return decoder.decode(result);
|
|
1097
|
+
};
|
|
1098
|
+
const encoder$1 = /*#__PURE__*/ new TextEncoder();
|
|
1099
|
+
const decoder = /*#__PURE__*/ new TextDecoder();
|
|
1100
|
+
const stripCrlf = (str) => str.replace(/[\n\r]/g, "");
|
|
1101
|
+
const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
1102
|
+
const alphabetCodes = /*#__PURE__*/ encoder$1.encode(alphabet);
|
|
1103
|
+
const paddingCode = /*#__PURE__*/ "=".charCodeAt(0);
|
|
1104
|
+
const codes = /*#__PURE__*/ (/* @__PURE__ */ new Uint8Array(123)).fill(255);
|
|
1105
|
+
for (let i = 0; i < 64; i++) codes[/*#__PURE__*/ alphabet.charCodeAt(i)] = i;
|
|
1106
|
+
codes[/*#__PURE__*/ "=".charCodeAt(0)] = 0;
|
|
1107
|
+
const getCode = (charCode) => {
|
|
1108
|
+
if (charCode >= codes.length || codes[charCode] === 255) throw new TypeError(`Invalid character ${String.fromCharCode(charCode)}`);
|
|
1109
|
+
return codes[charCode];
|
|
1110
|
+
};
|
|
1111
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/DateTime.js
|
|
1112
|
+
/**
|
|
1113
|
+
* Checks whether a value is a `DateTime`.
|
|
1114
|
+
*
|
|
1115
|
+
* **When to use**
|
|
1116
|
+
*
|
|
1117
|
+
* Use to narrow an unknown value before treating it as a `DateTime`.
|
|
1118
|
+
*
|
|
1119
|
+
* @see {@link isUtc} for narrowing a known `DateTime` to UTC
|
|
1120
|
+
* @see {@link isZoned} for narrowing a known `DateTime` to zoned
|
|
1121
|
+
*
|
|
1122
|
+
* @stability stable
|
|
1123
|
+
* @category guards
|
|
1124
|
+
* @since 3.6.0
|
|
1125
|
+
*/
|
|
1126
|
+
const isDateTime = isDateTime$1;
|
|
1127
|
+
/**
|
|
1128
|
+
* Checks whether a `DateTime` is a UTC `DateTime` (no time zone information).
|
|
1129
|
+
*
|
|
1130
|
+
* **When to use**
|
|
1131
|
+
*
|
|
1132
|
+
* Use to narrow a `DateTime` before passing it to code that requires a UTC
|
|
1133
|
+
* value without an associated time zone.
|
|
1134
|
+
*
|
|
1135
|
+
* @see {@link isZoned} for narrowing to zoned date-times
|
|
1136
|
+
* @see {@link match} for handling both UTC and zoned cases
|
|
1137
|
+
*
|
|
1138
|
+
* @stability stable
|
|
1139
|
+
* @category guards
|
|
1140
|
+
* @since 3.6.0
|
|
1141
|
+
*/
|
|
1142
|
+
const isUtc = isUtc$1;
|
|
1143
|
+
/**
|
|
1144
|
+
* Provides an `Equivalence` for comparing two `DateTime` values for equality.
|
|
1145
|
+
*
|
|
1146
|
+
* **Details**
|
|
1147
|
+
*
|
|
1148
|
+
* Two `DateTime` values are considered equivalent if they represent the same
|
|
1149
|
+
* point in time, regardless of their time zone.
|
|
1150
|
+
*
|
|
1151
|
+
* **Example** (Comparing DateTime values for equivalence)
|
|
1152
|
+
*
|
|
1153
|
+
* ```ts import.meta.vitest
|
|
1154
|
+
* import { DateTime } from "effect"
|
|
1155
|
+
*
|
|
1156
|
+
* const utc = DateTime.makeUnsafe("2024-01-01T12:00:00Z")
|
|
1157
|
+
* const zoned = DateTime.makeZonedUnsafe("2024-01-01T12:00:00Z", {
|
|
1158
|
+
* timeZone: "Europe/London"
|
|
1159
|
+
* })
|
|
1160
|
+
*
|
|
1161
|
+
* DateTime.Equivalence(utc, zoned) // => true
|
|
1162
|
+
* ```
|
|
1163
|
+
*
|
|
1164
|
+
* @stability stable
|
|
1165
|
+
* @category instances
|
|
1166
|
+
* @since 3.6.0
|
|
1167
|
+
*/
|
|
1168
|
+
const Equivalence$3 = Equivalence$4;
|
|
1169
|
+
/**
|
|
1170
|
+
* Provides an `Order` for comparing and sorting `DateTime` values.
|
|
1171
|
+
*
|
|
1172
|
+
* **Details**
|
|
1173
|
+
*
|
|
1174
|
+
* `DateTime` values are ordered by their epoch milliseconds, so earlier times
|
|
1175
|
+
* come before later times regardless of time zone.
|
|
1176
|
+
*
|
|
1177
|
+
* **Example** (Sorting DateTime values chronologically)
|
|
1178
|
+
*
|
|
1179
|
+
* ```ts import.meta.vitest
|
|
1180
|
+
* import { Array, DateTime } from "effect"
|
|
1258
1181
|
*
|
|
1259
1182
|
* const dates = [
|
|
1260
1183
|
* DateTime.makeUnsafe("2024-03-01"),
|
|
@@ -1342,7 +1265,7 @@ const makeUnsafe = makeUnsafe$1;
|
|
|
1342
1265
|
* @category constructors
|
|
1343
1266
|
* @since 3.6.0
|
|
1344
1267
|
*/
|
|
1345
|
-
const make$
|
|
1268
|
+
const make$6 = make$7;
|
|
1346
1269
|
/**
|
|
1347
1270
|
* Gets the current time using the `Clock` service and converts it to a `DateTime`.
|
|
1348
1271
|
*
|
|
@@ -1709,7 +1632,7 @@ var CurrentTimeZone = class extends (/*#__PURE__*/ Service()("effect/DateTime/Cu
|
|
|
1709
1632
|
* @category accessors
|
|
1710
1633
|
* @since 3.6.0
|
|
1711
1634
|
*/
|
|
1712
|
-
const setZoneCurrent = (self) => map$
|
|
1635
|
+
const setZoneCurrent = (self) => map$4(CurrentTimeZone, (zone) => setZone(self, zone));
|
|
1713
1636
|
/**
|
|
1714
1637
|
* Provides the `CurrentTimeZone` to an effect, using the system's local time
|
|
1715
1638
|
* zone.
|
|
@@ -1872,210 +1795,52 @@ const subtract = subtract$1;
|
|
|
1872
1795
|
* @since 3.6.0
|
|
1873
1796
|
*/
|
|
1874
1797
|
const formatIso = formatIso$1;
|
|
1875
|
-
// ../../node_modules/.pnpm/effect@4.
|
|
1798
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/http/Cookies.js
|
|
1876
1799
|
/**
|
|
1877
|
-
*
|
|
1800
|
+
* Models HTTP cookies and cookie collections for requests and responses.
|
|
1878
1801
|
*
|
|
1879
|
-
*
|
|
1802
|
+
* A `Cookie` stores a name, value, encoded value, and standard cookie
|
|
1803
|
+
* attributes. A `Cookies` value is an immutable collection keyed by cookie
|
|
1804
|
+
* name. This module parses request `Cookie` headers, builds response
|
|
1805
|
+
* `Set-Cookie` headers, and provides helpers for adding, removing, merging, and
|
|
1806
|
+
* expiring cookies.
|
|
1807
|
+
*
|
|
1808
|
+
* For client-side storage, `mergeIntoArray` and `toRequestCookieHeader`
|
|
1809
|
+
* work on a plain array of cookies scoped by domain, path and scheme, following
|
|
1810
|
+
* RFC 6265.
|
|
1811
|
+
*
|
|
1812
|
+
* @stability unstable
|
|
1880
1813
|
* @since 4.0.0
|
|
1881
1814
|
*/
|
|
1815
|
+
const TypeId$10 = "~effect/http/Cookies";
|
|
1882
1816
|
/**
|
|
1883
|
-
*
|
|
1884
|
-
*
|
|
1885
|
-
* **When to use**
|
|
1886
|
-
*
|
|
1887
|
-
* Use to encode text or bytes as a standard padded Base64 string for storage or
|
|
1888
|
-
* transport.
|
|
1889
|
-
*
|
|
1890
|
-
* **Details**
|
|
1891
|
-
*
|
|
1892
|
-
* String inputs are encoded as UTF-8 bytes before Base64 encoding.
|
|
1893
|
-
* `Uint8Array` inputs are encoded directly. The output uses the standard
|
|
1894
|
-
* RFC 4648 alphabet with `=` padding.
|
|
1895
|
-
*
|
|
1896
|
-
* **Example** (Encoding Base64 strings and bytes)
|
|
1897
|
-
*
|
|
1898
|
-
* ```ts import.meta.vitest
|
|
1899
|
-
* import { Base64 } from "effect/encoding"
|
|
1900
|
-
*
|
|
1901
|
-
* Base64.encode("hello") // => "aGVsbG8="
|
|
1902
|
-
*
|
|
1903
|
-
* const bytes = new Uint8Array([72, 101, 108, 108, 111])
|
|
1904
|
-
* Base64.encode(bytes) // => "SGVsbG8="
|
|
1905
|
-
* ```
|
|
1906
|
-
*
|
|
1907
|
-
* @see {@link decode} for decoding standard Base64 to bytes
|
|
1908
|
-
* @see {@link decodeString} for decoding standard Base64 to UTF-8 text
|
|
1817
|
+
* Returns `true` when a value is a `Cookies` collection.
|
|
1909
1818
|
*
|
|
1910
|
-
* @stability
|
|
1911
|
-
* @category
|
|
1819
|
+
* @stability unstable
|
|
1820
|
+
* @category guards
|
|
1912
1821
|
* @since 4.0.0
|
|
1913
1822
|
*/
|
|
1914
|
-
const
|
|
1823
|
+
const isCookies = (u) => hasProperty(u, TypeId$10);
|
|
1824
|
+
const CookieTypeId = "~effect/http/Cookies/Cookie";
|
|
1825
|
+
const CookieErrorTypeId = "~effect/http/Cookies/CookieError";
|
|
1915
1826
|
/**
|
|
1916
|
-
*
|
|
1917
|
-
*
|
|
1918
|
-
* **When to use**
|
|
1827
|
+
* Error reason describing why cookie construction failed, such as invalid name,
|
|
1828
|
+
* value, domain, path, or infinite max-age.
|
|
1919
1829
|
*
|
|
1920
|
-
*
|
|
1921
|
-
*
|
|
1830
|
+
* @stability unstable
|
|
1831
|
+
* @category errors
|
|
1832
|
+
* @since 4.0.0
|
|
1833
|
+
*/
|
|
1834
|
+
var CookiesErrorReason = class extends Error$2 {};
|
|
1835
|
+
/**
|
|
1836
|
+
* Error returned when a cookie name, value, domain, path, or max-age option is invalid.
|
|
1922
1837
|
*
|
|
1923
1838
|
* **Details**
|
|
1924
1839
|
*
|
|
1925
|
-
*
|
|
1926
|
-
* `Result.fail` with an `EncodingError` when the input is not valid Base64.
|
|
1927
|
-
*
|
|
1928
|
-
* **Example** (Decoding Base64 bytes)
|
|
1929
|
-
*
|
|
1930
|
-
* ```ts import.meta.vitest
|
|
1931
|
-
* import { Result } from "effect"
|
|
1932
|
-
* import { Base64 } from "effect/encoding"
|
|
1933
|
-
*
|
|
1934
|
-
* Base64.decode("SGVsbG8=") // => Result.succeed(new Uint8Array([72, 101, 108, 108, 111]))
|
|
1935
|
-
* ```
|
|
1840
|
+
* Inspect `reason` to determine the specific validation failure.
|
|
1936
1841
|
*
|
|
1937
|
-
* @stability
|
|
1938
|
-
* @category
|
|
1939
|
-
* @since 4.0.0
|
|
1940
|
-
*/
|
|
1941
|
-
const decode$1 = (str) => {
|
|
1942
|
-
const stripped = stripCrlf(str);
|
|
1943
|
-
const length = stripped.length;
|
|
1944
|
-
if (length % 4 !== 0) return fail$1(new EncodingError({
|
|
1945
|
-
kind: "Decode",
|
|
1946
|
-
module: "Base64",
|
|
1947
|
-
input: stripped,
|
|
1948
|
-
message: `Length must be a multiple of 4, but is ${length}`
|
|
1949
|
-
}));
|
|
1950
|
-
const index = stripped.indexOf("=");
|
|
1951
|
-
if (index !== -1 && (index < length - 2 || index === length - 2 && stripped[length - 1] !== "=")) return fail$1(new EncodingError({
|
|
1952
|
-
kind: "Decode",
|
|
1953
|
-
module: "Base64",
|
|
1954
|
-
input: stripped,
|
|
1955
|
-
message: "Found a '=' character, but it is not at the end"
|
|
1956
|
-
}));
|
|
1957
|
-
try {
|
|
1958
|
-
const missingOctets = stripped.endsWith("==") ? 2 : stripped.endsWith("=") ? 1 : 0;
|
|
1959
|
-
const result = new Uint8Array(3 * (length / 4) - missingOctets);
|
|
1960
|
-
for (let i = 0, j = 0; i < length; i += 4, j += 3) {
|
|
1961
|
-
const buffer = getCode(stripped.charCodeAt(i)) << 18 | getCode(stripped.charCodeAt(i + 1)) << 12 | getCode(stripped.charCodeAt(i + 2)) << 6 | getCode(stripped.charCodeAt(i + 3));
|
|
1962
|
-
result[j] = buffer >> 16;
|
|
1963
|
-
result[j + 1] = buffer >> 8 & 255;
|
|
1964
|
-
result[j + 2] = buffer & 255;
|
|
1965
|
-
}
|
|
1966
|
-
return succeed$1(result);
|
|
1967
|
-
} catch (cause) {
|
|
1968
|
-
return fail$1(new EncodingError({
|
|
1969
|
-
kind: "Decode",
|
|
1970
|
-
module: "Base64",
|
|
1971
|
-
input: stripped,
|
|
1972
|
-
message: cause instanceof Error ? cause.message : "Invalid input"
|
|
1973
|
-
}));
|
|
1974
|
-
}
|
|
1975
|
-
};
|
|
1976
|
-
/**
|
|
1977
|
-
* Decodes a Base64 (RFC 4648) string into UTF-8 text safely.
|
|
1978
|
-
*
|
|
1979
|
-
* **When to use**
|
|
1980
|
-
*
|
|
1981
|
-
* Use to decode a standard padded Base64 string into UTF-8 text without
|
|
1982
|
-
* throwing on invalid input.
|
|
1983
|
-
*
|
|
1984
|
-
* **Details**
|
|
1985
|
-
*
|
|
1986
|
-
* Returns `Result.succeed` with the decoded text when decoding succeeds, or
|
|
1987
|
-
* `Result.fail` with an `EncodingError` when the input is not valid Base64.
|
|
1988
|
-
*
|
|
1989
|
-
* **Example** (Decoding Base64 strings)
|
|
1990
|
-
*
|
|
1991
|
-
* ```ts import.meta.vitest
|
|
1992
|
-
* import { Result } from "effect"
|
|
1993
|
-
* import { Base64 } from "effect/encoding"
|
|
1994
|
-
*
|
|
1995
|
-
* Base64.decodeString("aGVsbG8=") // => Result.succeed("hello")
|
|
1996
|
-
* ```
|
|
1997
|
-
*
|
|
1998
|
-
* @stability stable
|
|
1999
|
-
* @category decoding
|
|
2000
|
-
* @since 4.0.0
|
|
2001
|
-
*/
|
|
2002
|
-
const decodeString = (str) => map$4(decode$1(str), (_) => decoder.decode(_));
|
|
2003
|
-
const encodeBytes = (bytes) => {
|
|
2004
|
-
const length = bytes.length;
|
|
2005
|
-
let result = "";
|
|
2006
|
-
let i = 2;
|
|
2007
|
-
for (; i < length; i += 3) {
|
|
2008
|
-
result += alphabet[bytes[i - 2] >> 2];
|
|
2009
|
-
result += alphabet[(bytes[i - 2] & 3) << 4 | bytes[i - 1] >> 4];
|
|
2010
|
-
result += alphabet[(bytes[i - 1] & 15) << 2 | bytes[i] >> 6];
|
|
2011
|
-
result += alphabet[bytes[i] & 63];
|
|
2012
|
-
}
|
|
2013
|
-
if (i === length + 1) {
|
|
2014
|
-
result += alphabet[bytes[i - 2] >> 2];
|
|
2015
|
-
result += alphabet[(bytes[i - 2] & 3) << 4];
|
|
2016
|
-
result += "==";
|
|
2017
|
-
}
|
|
2018
|
-
if (i === length) {
|
|
2019
|
-
result += alphabet[bytes[i - 2] >> 2];
|
|
2020
|
-
result += alphabet[(bytes[i - 2] & 3) << 4 | bytes[i - 1] >> 4];
|
|
2021
|
-
result += alphabet[(bytes[i - 1] & 15) << 2];
|
|
2022
|
-
result += "=";
|
|
2023
|
-
}
|
|
2024
|
-
return result;
|
|
2025
|
-
};
|
|
2026
|
-
const encoder$1 = /*#__PURE__*/ new TextEncoder();
|
|
2027
|
-
const decoder = /*#__PURE__*/ new TextDecoder();
|
|
2028
|
-
const stripCrlf = (str) => str.replace(/[\n\r]/g, "");
|
|
2029
|
-
const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
2030
|
-
const codes = /*#__PURE__*/ (/* @__PURE__ */ new Uint8Array(123)).fill(255);
|
|
2031
|
-
for (let i = 0; i < 64; i++) codes[/*#__PURE__*/ alphabet.charCodeAt(i)] = i;
|
|
2032
|
-
codes[/*#__PURE__*/ "=".charCodeAt(0)] = 0;
|
|
2033
|
-
const getCode = (charCode) => {
|
|
2034
|
-
if (charCode >= codes.length || codes[charCode] === 255) throw new TypeError(`Invalid character ${String.fromCharCode(charCode)}`);
|
|
2035
|
-
return codes[charCode];
|
|
2036
|
-
};
|
|
2037
|
-
// ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/http/Cookies.js
|
|
2038
|
-
/**
|
|
2039
|
-
* Models HTTP cookies and cookie collections for requests and responses.
|
|
2040
|
-
*
|
|
2041
|
-
* A `Cookie` stores a name, value, encoded value, and standard cookie
|
|
2042
|
-
* attributes. A `Cookies` value is an immutable collection keyed by cookie
|
|
2043
|
-
* name. This module parses request `Cookie` headers, builds response
|
|
2044
|
-
* `Set-Cookie` headers, and provides helpers for adding, removing, merging, and
|
|
2045
|
-
* expiring cookies.
|
|
2046
|
-
*
|
|
2047
|
-
* @stability unstable
|
|
2048
|
-
* @since 4.0.0
|
|
2049
|
-
*/
|
|
2050
|
-
const TypeId$9 = "~effect/http/Cookies";
|
|
2051
|
-
/**
|
|
2052
|
-
* Returns `true` when a value is a `Cookies` collection.
|
|
2053
|
-
*
|
|
2054
|
-
* @stability unstable
|
|
2055
|
-
* @category guards
|
|
2056
|
-
* @since 4.0.0
|
|
2057
|
-
*/
|
|
2058
|
-
const isCookies = (u) => hasProperty(u, TypeId$9);
|
|
2059
|
-
const CookieTypeId = "~effect/http/Cookies/Cookie";
|
|
2060
|
-
const CookieErrorTypeId = "~effect/http/Cookies/CookieError";
|
|
2061
|
-
/**
|
|
2062
|
-
* Error reason describing why cookie construction failed, such as invalid name,
|
|
2063
|
-
* value, domain, path, or infinite max-age.
|
|
2064
|
-
*
|
|
2065
|
-
* @stability unstable
|
|
2066
|
-
* @category errors
|
|
2067
|
-
* @since 4.0.0
|
|
2068
|
-
*/
|
|
2069
|
-
var CookiesErrorReason = class extends Error$2 {};
|
|
2070
|
-
/**
|
|
2071
|
-
* Error returned when a cookie name, value, domain, path, or max-age option is invalid.
|
|
2072
|
-
*
|
|
2073
|
-
* **Details**
|
|
2074
|
-
*
|
|
2075
|
-
* Inspect `reason` to determine the specific validation failure.
|
|
2076
|
-
*
|
|
2077
|
-
* @stability unstable
|
|
2078
|
-
* @category errors
|
|
1842
|
+
* @stability unstable
|
|
1843
|
+
* @category errors
|
|
2079
1844
|
* @since 4.0.0
|
|
2080
1845
|
*/
|
|
2081
1846
|
var CookiesError = class CookiesError extends (/*#__PURE__*/ TaggedError$1("CookiesError")) {
|
|
@@ -2108,8 +1873,8 @@ var CookiesError = class CookiesError extends (/*#__PURE__*/ TaggedError$1("Cook
|
|
|
2108
1873
|
return this.reason._tag;
|
|
2109
1874
|
}
|
|
2110
1875
|
};
|
|
2111
|
-
const Proto$
|
|
2112
|
-
[TypeId$
|
|
1876
|
+
const Proto$3 = {
|
|
1877
|
+
[TypeId$10]: TypeId$10,
|
|
2113
1878
|
...BaseProto,
|
|
2114
1879
|
toJSON() {
|
|
2115
1880
|
return {
|
|
@@ -2129,7 +1894,7 @@ const Proto$2 = {
|
|
|
2129
1894
|
* @since 4.0.0
|
|
2130
1895
|
*/
|
|
2131
1896
|
const fromReadonlyRecord = (cookies) => {
|
|
2132
|
-
const self = Object.create(Proto$
|
|
1897
|
+
const self = Object.create(Proto$3);
|
|
2133
1898
|
self.cookies = cookies;
|
|
2134
1899
|
return self;
|
|
2135
1900
|
};
|
|
@@ -2166,9 +1931,9 @@ function parseSetCookie(header) {
|
|
|
2166
1931
|
if (parts.length === 0) return;
|
|
2167
1932
|
const firstEqual = parts[0].indexOf("=");
|
|
2168
1933
|
if (firstEqual === -1) return;
|
|
2169
|
-
const name = parts[0].slice(0, firstEqual);
|
|
1934
|
+
const name = parts[0].slice(0, firstEqual).replace(cookieWhitespaceRegExp, "");
|
|
2170
1935
|
if (!cookieNameRegExp.test(name)) return;
|
|
2171
|
-
const valueEncoded = parts[0].slice(firstEqual + 1);
|
|
1936
|
+
const valueEncoded = parts[0].slice(firstEqual + 1).replace(cookieWhitespaceRegExp, "");
|
|
2172
1937
|
const value = tryDecodeURIComponent(valueEncoded);
|
|
2173
1938
|
if (parts.length === 1) return Object.assign(Object.create(CookieProto), {
|
|
2174
1939
|
name,
|
|
@@ -2194,12 +1959,10 @@ function parseSetCookie(header) {
|
|
|
2194
1959
|
if (!isNaN(date.getTime())) options.expires = date;
|
|
2195
1960
|
break;
|
|
2196
1961
|
}
|
|
2197
|
-
case "max-age":
|
|
2198
|
-
if (value === void 0) break;
|
|
2199
|
-
|
|
2200
|
-
if (!isNaN(maxAge)) options.maxAge = seconds(maxAge);
|
|
1962
|
+
case "max-age":
|
|
1963
|
+
if (value === void 0 || !maxAgeRegExp.test(value)) break;
|
|
1964
|
+
options.maxAge = seconds(parseInt(value, 10));
|
|
2201
1965
|
break;
|
|
2202
|
-
}
|
|
2203
1966
|
case "path":
|
|
2204
1967
|
if (value === void 0) break;
|
|
2205
1968
|
if (value[0] === "/") options.path = value;
|
|
@@ -2252,7 +2015,7 @@ function parseSetCookie(header) {
|
|
|
2252
2015
|
* @category constructors
|
|
2253
2016
|
* @since 4.0.0
|
|
2254
2017
|
*/
|
|
2255
|
-
const empty$
|
|
2018
|
+
const empty$2 = /*#__PURE__*/ fromIterable([]);
|
|
2256
2019
|
/**
|
|
2257
2020
|
* Returns `true` when the `Cookies` collection contains no cookies.
|
|
2258
2021
|
*
|
|
@@ -2263,6 +2026,8 @@ const empty$1 = /*#__PURE__*/ fromIterable([]);
|
|
|
2263
2026
|
const isEmpty = (self) => isEmptyRecord(self.cookies);
|
|
2264
2027
|
const fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
|
|
2265
2028
|
const cookieNameRegExp = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
|
|
2029
|
+
const cookieWhitespaceRegExp = /^[\t ]+|[\t ]+$/g;
|
|
2030
|
+
const maxAgeRegExp = /^-?[0-9]+$/;
|
|
2266
2031
|
const cookieDomainRegExp = /^[\u0009\u0020-\u003a\u003c-\u007e\u0080-\u00ff]+$/;
|
|
2267
2032
|
const cookiePathRegExp = /^[\u0020-\u003a\u003c-\u007e]+$/;
|
|
2268
2033
|
const CookieProto = {
|
|
@@ -2313,7 +2078,7 @@ function validateCookie(name, encodedValue, options) {
|
|
|
2313
2078
|
* @category combinators
|
|
2314
2079
|
* @since 4.0.0
|
|
2315
2080
|
*/
|
|
2316
|
-
const merge = /*#__PURE__*/ dual(2, (self, that) => fromReadonlyRecord({
|
|
2081
|
+
const merge$1 = /*#__PURE__*/ dual(2, (self, that) => fromReadonlyRecord({
|
|
2317
2082
|
...self.cookies,
|
|
2318
2083
|
...that.cookies
|
|
2319
2084
|
}));
|
|
@@ -2328,7 +2093,7 @@ const merge = /*#__PURE__*/ dual(2, (self, that) => fromReadonlyRecord({
|
|
|
2328
2093
|
* @category combinators
|
|
2329
2094
|
* @since 4.0.0
|
|
2330
2095
|
*/
|
|
2331
|
-
const set = /*#__PURE__*/ dual((args) => isCookies(args[0]), (self, name, value, options) => map$
|
|
2096
|
+
const set$1 = /*#__PURE__*/ dual((args) => isCookies(args[0]), (self, name, value, options) => map$3(makeCookie(name, value, options), (cookie) => fromReadonlyRecord(set$2(self.cookies, name, cookie))));
|
|
2332
2097
|
/**
|
|
2333
2098
|
* Adds an expired cookie safely with an empty value, `Max-Age=0`, and an epoch `Expires` value.
|
|
2334
2099
|
*
|
|
@@ -2340,7 +2105,7 @@ const set = /*#__PURE__*/ dual((args) => isCookies(args[0]), (self, name, value,
|
|
|
2340
2105
|
* @category combinators
|
|
2341
2106
|
* @since 4.0.0
|
|
2342
2107
|
*/
|
|
2343
|
-
const expireCookie = /*#__PURE__*/ dual((args) => isCookies(args[0]), (self, name, options) => set(self, name, "", {
|
|
2108
|
+
const expireCookie = /*#__PURE__*/ dual((args) => isCookies(args[0]), (self, name, options) => set$1(self, name, "", {
|
|
2344
2109
|
...options,
|
|
2345
2110
|
maxAge: 0,
|
|
2346
2111
|
expires: /* @__PURE__ */ new Date(0)
|
|
@@ -2366,7 +2131,7 @@ function serializeCookie(self) {
|
|
|
2366
2131
|
const maxAge = toSeconds(fromInputUnsafe(options.maxAge));
|
|
2367
2132
|
str += "; Max-Age=" + Math.trunc(maxAge);
|
|
2368
2133
|
}
|
|
2369
|
-
if (options.domain !== void 0) str += "; Domain=" + options.domain;
|
|
2134
|
+
if (options.domain !== void 0 && !options.hostOnly) str += "; Domain=" + options.domain;
|
|
2370
2135
|
if (options.path !== void 0) str += "; Path=" + options.path;
|
|
2371
2136
|
if (options.priority !== void 0) switch (options.priority) {
|
|
2372
2137
|
case "low":
|
|
@@ -2428,8 +2193,9 @@ function parseHeader(header) {
|
|
|
2428
2193
|
}
|
|
2429
2194
|
const key = header.substring(pos, eqIdx++).trim();
|
|
2430
2195
|
if (!Object.hasOwn(result, key)) {
|
|
2431
|
-
|
|
2432
|
-
|
|
2196
|
+
let value = header.substring(eqIdx, terminatorPos).trim();
|
|
2197
|
+
if (value.charCodeAt(0) === 34) value = value.slice(1, -1).trim();
|
|
2198
|
+
assignProperty(result, key, !(value.indexOf("%") === -1) ? tryDecodeURIComponent(value) : value);
|
|
2433
2199
|
}
|
|
2434
2200
|
pos = terminatorPos + 1;
|
|
2435
2201
|
}
|
|
@@ -2442,7 +2208,7 @@ const tryDecodeURIComponent = (str) => {
|
|
|
2442
2208
|
return str;
|
|
2443
2209
|
}
|
|
2444
2210
|
};
|
|
2445
|
-
// ../../node_modules/.pnpm/effect@4.
|
|
2211
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/redacted.js
|
|
2446
2212
|
/** @internal */
|
|
2447
2213
|
const redactedRegistry = /*#__PURE__*/ new WeakMap();
|
|
2448
2214
|
/** @internal */
|
|
@@ -2452,7 +2218,7 @@ const value$1 = (self) => {
|
|
|
2452
2218
|
};
|
|
2453
2219
|
/** @internal */
|
|
2454
2220
|
const stringOrRedacted = (val) => typeof val === "string" ? val : value$1(val);
|
|
2455
|
-
// ../../node_modules/.pnpm/effect@4.
|
|
2221
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Redacted.js
|
|
2456
2222
|
/**
|
|
2457
2223
|
* Wraps sensitive values so normal output does not reveal them.
|
|
2458
2224
|
*
|
|
@@ -2466,7 +2232,7 @@ const stringOrRedacted = (val) => typeof val === "string" ? val : value$1(val);
|
|
|
2466
2232
|
* @stability stable
|
|
2467
2233
|
* @since 3.3.0
|
|
2468
2234
|
*/
|
|
2469
|
-
const TypeId$
|
|
2235
|
+
const TypeId$9 = "~effect/Redacted";
|
|
2470
2236
|
/**
|
|
2471
2237
|
* Returns `true` if a value is a `Redacted` wrapper.
|
|
2472
2238
|
*
|
|
@@ -2495,7 +2261,7 @@ const TypeId$8 = "~effect/Redacted";
|
|
|
2495
2261
|
* @category guards
|
|
2496
2262
|
* @since 3.3.0
|
|
2497
2263
|
*/
|
|
2498
|
-
const isRedacted = (u) => hasProperty(u, TypeId$
|
|
2264
|
+
const isRedacted = (u) => hasProperty(u, TypeId$9);
|
|
2499
2265
|
/**
|
|
2500
2266
|
* Creates a `Redacted` wrapper for a sensitive value.
|
|
2501
2267
|
*
|
|
@@ -2523,14 +2289,14 @@ const isRedacted = (u) => hasProperty(u, TypeId$8);
|
|
|
2523
2289
|
* @category constructors
|
|
2524
2290
|
* @since 3.3.0
|
|
2525
2291
|
*/
|
|
2526
|
-
const make$
|
|
2527
|
-
const self = Object.create(Proto$
|
|
2292
|
+
const make$5 = (value, options) => {
|
|
2293
|
+
const self = Object.create(Proto$2);
|
|
2528
2294
|
if (options?.label) self.label = options.label;
|
|
2529
2295
|
redactedRegistry.set(self, value);
|
|
2530
2296
|
return self;
|
|
2531
2297
|
};
|
|
2532
|
-
const Proto$
|
|
2533
|
-
[TypeId$
|
|
2298
|
+
const Proto$2 = {
|
|
2299
|
+
[TypeId$9]: { _A: (_) => _ },
|
|
2534
2300
|
label: void 0,
|
|
2535
2301
|
...PipeInspectableProto,
|
|
2536
2302
|
toJSON() {
|
|
@@ -2598,8 +2364,409 @@ const value = value$1;
|
|
|
2598
2364
|
* @category instances
|
|
2599
2365
|
* @since 4.0.0
|
|
2600
2366
|
*/
|
|
2601
|
-
const makeEquivalence = (isEquivalent) => make$
|
|
2602
|
-
// ../../node_modules/.pnpm/effect@4.
|
|
2367
|
+
const makeEquivalence = (isEquivalent) => make$10((x, y) => isEquivalent(value(x), value(y)));
|
|
2368
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/http/Headers.js
|
|
2369
|
+
/**
|
|
2370
|
+
* Models HTTP headers for the unstable HTTP client and server modules.
|
|
2371
|
+
*
|
|
2372
|
+
* `Headers` values are immutable maps keyed by lowercase header name. This
|
|
2373
|
+
* module converts common header inputs into that shape, provides helpers for
|
|
2374
|
+
* reading and updating header values, and redacts configured sensitive headers
|
|
2375
|
+
* when values are inspected.
|
|
2376
|
+
*
|
|
2377
|
+
* It also parses and formats the values of standard headers, such as HTTP
|
|
2378
|
+
* dates and `Retry-After`, with the tolerance the RFCs allow and nothing more.
|
|
2379
|
+
* The string codecs for those values live in `Schema`, for example
|
|
2380
|
+
* `Schema.DateTimeUtcFromHttpDate` and `Schema.RetryAfterFromString`.
|
|
2381
|
+
*
|
|
2382
|
+
* @stability unstable
|
|
2383
|
+
* @since 4.0.0
|
|
2384
|
+
*/
|
|
2385
|
+
/**
|
|
2386
|
+
* Runtime type identifier for `Headers` values.
|
|
2387
|
+
*
|
|
2388
|
+
* @stability unstable
|
|
2389
|
+
* @category type IDs
|
|
2390
|
+
* @since 4.0.0
|
|
2391
|
+
*/
|
|
2392
|
+
const TypeId$8 = /*#__PURE__*/ Symbol.for("~effect/http/Headers");
|
|
2393
|
+
/**
|
|
2394
|
+
* Returns `true` if the provided value is a `Headers` value.
|
|
2395
|
+
*
|
|
2396
|
+
* @stability unstable
|
|
2397
|
+
* @category guards
|
|
2398
|
+
* @since 4.0.0
|
|
2399
|
+
*/
|
|
2400
|
+
const isHeaders = (u) => hasProperty(u, TypeId$8);
|
|
2401
|
+
const Proto$1 = /*#__PURE__*/ Object.defineProperties(/*#__PURE__*/ Object.create(null), {
|
|
2402
|
+
[TypeId$8]: { value: TypeId$8 },
|
|
2403
|
+
[symbolRedactable]: { value(context) {
|
|
2404
|
+
return redact$1(this, get(context, CurrentRedactedNames$1));
|
|
2405
|
+
} },
|
|
2406
|
+
toJSON: { value() {
|
|
2407
|
+
return redact$2(this);
|
|
2408
|
+
} },
|
|
2409
|
+
[symbol$1]: { value(that) {
|
|
2410
|
+
return Equivalence$2(this, that);
|
|
2411
|
+
} },
|
|
2412
|
+
[symbol]: { value() {
|
|
2413
|
+
return structure(this);
|
|
2414
|
+
} },
|
|
2415
|
+
toString: { value: BaseProto.toString },
|
|
2416
|
+
[NodeInspectSymbol]: { value: BaseProto[NodeInspectSymbol] }
|
|
2417
|
+
});
|
|
2418
|
+
const make$4 = (input) => Object.assign(Object.create(Proto$1), input);
|
|
2419
|
+
/**
|
|
2420
|
+
* Provides an `Equivalence` instance that compares `Headers` by header names
|
|
2421
|
+
* and string values.
|
|
2422
|
+
*
|
|
2423
|
+
* @stability unstable
|
|
2424
|
+
* @category instances
|
|
2425
|
+
* @since 4.0.0
|
|
2426
|
+
*/
|
|
2427
|
+
const Equivalence$2 = /*#__PURE__*/ makeEquivalence$1(/*#__PURE__*/ strictEqual());
|
|
2428
|
+
/**
|
|
2429
|
+
* An empty `Headers` collection.
|
|
2430
|
+
*
|
|
2431
|
+
* @stability unstable
|
|
2432
|
+
* @category constructors
|
|
2433
|
+
* @since 4.0.0
|
|
2434
|
+
*/
|
|
2435
|
+
const empty$1 = /*#__PURE__*/ Object.create(Proto$1);
|
|
2436
|
+
/**
|
|
2437
|
+
* Creates `Headers` from a record or iterable of header entries.
|
|
2438
|
+
*
|
|
2439
|
+
* **Details**
|
|
2440
|
+
*
|
|
2441
|
+
* Header names are normalized to lowercase. Array values in record input are joined with `", "`, and `undefined` values are omitted.
|
|
2442
|
+
*
|
|
2443
|
+
* @stability unstable
|
|
2444
|
+
* @category constructors
|
|
2445
|
+
* @since 4.0.0
|
|
2446
|
+
*/
|
|
2447
|
+
const fromInput$1 = (input) => {
|
|
2448
|
+
if (input === void 0) return empty$1;
|
|
2449
|
+
else if (Symbol.iterator in input) {
|
|
2450
|
+
const out = Object.create(Proto$1);
|
|
2451
|
+
for (const [k, v] of input) out[k.toLowerCase()] = v;
|
|
2452
|
+
return out;
|
|
2453
|
+
}
|
|
2454
|
+
const out = Object.create(Proto$1);
|
|
2455
|
+
for (const [k, v] of Object.entries(input)) if (Array.isArray(v)) out[k.toLowerCase()] = v.join(", ");
|
|
2456
|
+
else if (v !== void 0) out[k.toLowerCase()] = v;
|
|
2457
|
+
return out;
|
|
2458
|
+
};
|
|
2459
|
+
/**
|
|
2460
|
+
* Treats an existing record as `Headers` unsafely.
|
|
2461
|
+
*
|
|
2462
|
+
* **Gotchas**
|
|
2463
|
+
*
|
|
2464
|
+
* This mutates the record's prototype and does not normalize header names; callers must provide the expected lowercase keys.
|
|
2465
|
+
*
|
|
2466
|
+
* @stability unstable
|
|
2467
|
+
* @category constructors
|
|
2468
|
+
* @since 4.0.0
|
|
2469
|
+
*/
|
|
2470
|
+
const fromRecordUnsafe = (input) => Object.setPrototypeOf(input, Proto$1);
|
|
2471
|
+
/**
|
|
2472
|
+
* Returns a new `Headers` collection with the given header set.
|
|
2473
|
+
*
|
|
2474
|
+
* **Details**
|
|
2475
|
+
*
|
|
2476
|
+
* The header name is normalized to lowercase.
|
|
2477
|
+
*
|
|
2478
|
+
* @stability unstable
|
|
2479
|
+
* @category combinators
|
|
2480
|
+
* @since 4.0.0
|
|
2481
|
+
*/
|
|
2482
|
+
const set = /*#__PURE__*/ dual(3, (self, key, value) => {
|
|
2483
|
+
const out = make$4(self);
|
|
2484
|
+
out[key.toLowerCase()] = value;
|
|
2485
|
+
return out;
|
|
2486
|
+
});
|
|
2487
|
+
/**
|
|
2488
|
+
* Returns a new `Headers` collection with all provided headers set.
|
|
2489
|
+
*
|
|
2490
|
+
* **Details**
|
|
2491
|
+
*
|
|
2492
|
+
* Input headers are normalized with `fromInput` and override existing headers with the same lowercase name.
|
|
2493
|
+
*
|
|
2494
|
+
* @stability unstable
|
|
2495
|
+
* @category combinators
|
|
2496
|
+
* @since 4.0.0
|
|
2497
|
+
*/
|
|
2498
|
+
const setAll$1 = /*#__PURE__*/ dual(2, (self, headers) => make$4({
|
|
2499
|
+
...self,
|
|
2500
|
+
...fromInput$1(headers)
|
|
2501
|
+
}));
|
|
2502
|
+
/**
|
|
2503
|
+
* Returns a new `Headers` collection containing headers from both collections.
|
|
2504
|
+
*
|
|
2505
|
+
* **Details**
|
|
2506
|
+
*
|
|
2507
|
+
* Headers from the second collection override headers from the first collection with the same name.
|
|
2508
|
+
*
|
|
2509
|
+
* @stability unstable
|
|
2510
|
+
* @category combinators
|
|
2511
|
+
* @since 4.0.0
|
|
2512
|
+
*/
|
|
2513
|
+
const merge = /*#__PURE__*/ dual(2, (self, headers) => {
|
|
2514
|
+
const out = make$4(self);
|
|
2515
|
+
Object.assign(out, headers);
|
|
2516
|
+
return out;
|
|
2517
|
+
});
|
|
2518
|
+
/**
|
|
2519
|
+
* Returns a new `Headers` collection with the named header removed.
|
|
2520
|
+
*
|
|
2521
|
+
* **Details**
|
|
2522
|
+
*
|
|
2523
|
+
* The provided header name is normalized to lowercase before removal.
|
|
2524
|
+
*
|
|
2525
|
+
* @stability unstable
|
|
2526
|
+
* @category combinators
|
|
2527
|
+
* @since 4.0.0
|
|
2528
|
+
*/
|
|
2529
|
+
const remove = /*#__PURE__*/ dual(2, (self, key) => {
|
|
2530
|
+
const out = make$4(self);
|
|
2531
|
+
delete out[key.toLowerCase()];
|
|
2532
|
+
return out;
|
|
2533
|
+
});
|
|
2534
|
+
/**
|
|
2535
|
+
* Returns a plain record with selected header values wrapped in `Redacted`.
|
|
2536
|
+
*
|
|
2537
|
+
* **Details**
|
|
2538
|
+
*
|
|
2539
|
+
* String keys are normalized to lowercase before matching; regular expressions are tested against the stored header names.
|
|
2540
|
+
*
|
|
2541
|
+
* @stability unstable
|
|
2542
|
+
* @category combinators
|
|
2543
|
+
* @since 4.0.0
|
|
2544
|
+
*/
|
|
2545
|
+
const redact$1 = /*#__PURE__*/ dual(2, (self, key) => {
|
|
2546
|
+
const out = { ...self };
|
|
2547
|
+
const modify = (key) => {
|
|
2548
|
+
if (typeof key === "string") {
|
|
2549
|
+
const k = key.toLowerCase();
|
|
2550
|
+
if (k in self) out[k] = make$5(self[k]);
|
|
2551
|
+
} else for (const name in self) if (name.search(key) !== -1) out[name] = make$5(self[name]);
|
|
2552
|
+
};
|
|
2553
|
+
if (Array.isArray(key)) for (let i = 0; i < key.length; i++) modify(key[i]);
|
|
2554
|
+
else modify(key);
|
|
2555
|
+
return out;
|
|
2556
|
+
});
|
|
2557
|
+
/**
|
|
2558
|
+
* Checks whether a header name matches one of the redaction patterns.
|
|
2559
|
+
*
|
|
2560
|
+
* **Details**
|
|
2561
|
+
*
|
|
2562
|
+
* String patterns are compared case-insensitively against the header name;
|
|
2563
|
+
* regular expressions are tested against it. Use to avoid the record copy of
|
|
2564
|
+
* `redact` when only a membership check is needed.
|
|
2565
|
+
*
|
|
2566
|
+
* @stability unstable
|
|
2567
|
+
* @category combinators
|
|
2568
|
+
* @since 4.0.0
|
|
2569
|
+
*/
|
|
2570
|
+
const isRedactedName$1 = (name, patterns) => {
|
|
2571
|
+
const lowerName = name.toLowerCase();
|
|
2572
|
+
for (let i = 0; i < patterns.length; i++) {
|
|
2573
|
+
const pattern = patterns[i];
|
|
2574
|
+
if (typeof pattern === "string") {
|
|
2575
|
+
if (pattern.toLowerCase() === lowerName) return true;
|
|
2576
|
+
} else if (name.search(pattern) !== -1) return true;
|
|
2577
|
+
}
|
|
2578
|
+
return false;
|
|
2579
|
+
};
|
|
2580
|
+
/**
|
|
2581
|
+
* Context reference listing header names or patterns that should be redacted when `Headers` are inspected or rendered.
|
|
2582
|
+
*
|
|
2583
|
+
* **Details**
|
|
2584
|
+
*
|
|
2585
|
+
* Defaults include `authorization`, `cookie`, `set-cookie` and `x-api-key`.
|
|
2586
|
+
* A custom list replaces the defaults. Matching uses `isRedactedName`.
|
|
2587
|
+
* Use `UrlParams.CurrentRedactedNames` for query parameters.
|
|
2588
|
+
*
|
|
2589
|
+
* @stability unstable
|
|
2590
|
+
* @category services
|
|
2591
|
+
* @since 4.0.0
|
|
2592
|
+
*/
|
|
2593
|
+
const CurrentRedactedNames$1 = /*#__PURE__*/ Reference("effect/Headers/CurrentRedactedNames", { defaultValue: () => [
|
|
2594
|
+
"authorization",
|
|
2595
|
+
"cookie",
|
|
2596
|
+
"set-cookie",
|
|
2597
|
+
"x-api-key"
|
|
2598
|
+
] });
|
|
2599
|
+
const HeaderParseErrorTypeId = "~effect/http/Headers/HeaderParseError";
|
|
2600
|
+
/**
|
|
2601
|
+
* Error reason describing which header value failed to parse.
|
|
2602
|
+
*
|
|
2603
|
+
* **Details**
|
|
2604
|
+
*
|
|
2605
|
+
* `input` is the raw header value that was rejected.
|
|
2606
|
+
*
|
|
2607
|
+
* @stability unstable
|
|
2608
|
+
* @category errors
|
|
2609
|
+
* @since 4.0.0
|
|
2610
|
+
*/
|
|
2611
|
+
var HeaderParseErrorReason = class extends Error$2 {};
|
|
2612
|
+
/**
|
|
2613
|
+
* Error returned when a header value does not match its grammar.
|
|
2614
|
+
*
|
|
2615
|
+
* **Details**
|
|
2616
|
+
*
|
|
2617
|
+
* Inspect `reason` to find the header that failed and the rejected input.
|
|
2618
|
+
*
|
|
2619
|
+
* @stability unstable
|
|
2620
|
+
* @category errors
|
|
2621
|
+
* @since 4.0.0
|
|
2622
|
+
*/
|
|
2623
|
+
var HeaderParseError = class HeaderParseError extends (/*#__PURE__*/ TaggedError$1("HeaderParseError")) {
|
|
2624
|
+
/**
|
|
2625
|
+
* Creates a header parse error from a reason tag and the rejected input.
|
|
2626
|
+
*
|
|
2627
|
+
* @stability unstable
|
|
2628
|
+
* @since 4.0.0
|
|
2629
|
+
*/
|
|
2630
|
+
static fromReason(reason, input) {
|
|
2631
|
+
return new HeaderParseError({ reason: new HeaderParseErrorReason({
|
|
2632
|
+
_tag: reason,
|
|
2633
|
+
input
|
|
2634
|
+
}) });
|
|
2635
|
+
}
|
|
2636
|
+
/**
|
|
2637
|
+
* Marks this value as a header parse error for runtime guards.
|
|
2638
|
+
*
|
|
2639
|
+
* @stability unstable
|
|
2640
|
+
* @since 4.0.0
|
|
2641
|
+
*/
|
|
2642
|
+
[HeaderParseErrorTypeId] = HeaderParseErrorTypeId;
|
|
2643
|
+
/**
|
|
2644
|
+
* Names the failed header and the rejected input.
|
|
2645
|
+
*
|
|
2646
|
+
* @stability unstable
|
|
2647
|
+
* @since 4.0.0
|
|
2648
|
+
*/
|
|
2649
|
+
get message() {
|
|
2650
|
+
return `${this.reason._tag}: ${JSON.stringify(this.reason.input)}`;
|
|
2651
|
+
}
|
|
2652
|
+
};
|
|
2653
|
+
const monthNames = [
|
|
2654
|
+
"jan",
|
|
2655
|
+
"feb",
|
|
2656
|
+
"mar",
|
|
2657
|
+
"apr",
|
|
2658
|
+
"may",
|
|
2659
|
+
"jun",
|
|
2660
|
+
"jul",
|
|
2661
|
+
"aug",
|
|
2662
|
+
"sep",
|
|
2663
|
+
"oct",
|
|
2664
|
+
"nov",
|
|
2665
|
+
"dec"
|
|
2666
|
+
];
|
|
2667
|
+
const httpDateFormats = [
|
|
2668
|
+
/^(?:mon|tue|wed|thu|fri|sat|sun), (?<day>\d{2}) (?<month>[a-z]{3}) (?<year>\d{4}) (?<hour>\d{2}):(?<minute>\d{2}):(?<second>\d{2}) gmt$/i,
|
|
2669
|
+
/^(?:monday|tuesday|wednesday|thursday|friday|saturday|sunday), (?<day>\d{2})-(?<month>[a-z]{3})-(?<year>\d{2}) (?<hour>\d{2}):(?<minute>\d{2}):(?<second>\d{2}) gmt$/i,
|
|
2670
|
+
/^(?:mon|tue|wed|thu|fri|sat|sun) (?<month>[a-z]{3}) (?<day> \d|\d{2}) (?<hour>\d{2}):(?<minute>\d{2}):(?<second>\d{2}) (?<year>\d{4})$/i
|
|
2671
|
+
];
|
|
2672
|
+
const httpDateToMillis = (input) => {
|
|
2673
|
+
for (const format of httpDateFormats) {
|
|
2674
|
+
const groups = format.exec(input)?.groups;
|
|
2675
|
+
if (groups === void 0) continue;
|
|
2676
|
+
const month = monthNames.indexOf(groups.month.toLowerCase());
|
|
2677
|
+
const hour = Number(groups.hour);
|
|
2678
|
+
const minute = Number(groups.minute);
|
|
2679
|
+
const second = Number(groups.second);
|
|
2680
|
+
if (month === -1 || hour > 23 || minute > 59 || second > 60) return;
|
|
2681
|
+
let year = Number(groups.year);
|
|
2682
|
+
if (groups.year.length === 2) year += year < 70 ? 2e3 : 1900;
|
|
2683
|
+
const day = Number(groups.day);
|
|
2684
|
+
const date = /* @__PURE__ */ new Date(0);
|
|
2685
|
+
date.setUTCFullYear(year, month, day);
|
|
2686
|
+
if (date.getUTCFullYear() !== year || date.getUTCMonth() !== month || date.getUTCDate() !== day) return;
|
|
2687
|
+
return date.getTime() + ((hour * 60 + minute) * 60 + second) * 1e3;
|
|
2688
|
+
}
|
|
2689
|
+
};
|
|
2690
|
+
/**
|
|
2691
|
+
* Creates a `Retry-After` value from an HTTP date.
|
|
2692
|
+
*
|
|
2693
|
+
* @stability unstable
|
|
2694
|
+
* @category constructors
|
|
2695
|
+
* @since 4.0.0
|
|
2696
|
+
*/
|
|
2697
|
+
const retryAfterDateTime = (dateTime) => ({
|
|
2698
|
+
_tag: "DateTime",
|
|
2699
|
+
dateTime
|
|
2700
|
+
});
|
|
2701
|
+
const wholeSeconds = /^\d+$/;
|
|
2702
|
+
const nanosPerSecond = /*#__PURE__*/ BigInt(1e9);
|
|
2703
|
+
/**
|
|
2704
|
+
* Parses a `Retry-After` header value.
|
|
2705
|
+
*
|
|
2706
|
+
* **Details**
|
|
2707
|
+
*
|
|
2708
|
+
* Accepts whole non-negative seconds (`120`) of any size, read exactly, or an
|
|
2709
|
+
* HTTP date in any of the formats {@link parseHttpDate} accepts. Fractional,
|
|
2710
|
+
* negative, exponent and non-finite numbers are rejected, as are dates in
|
|
2711
|
+
* other formats.
|
|
2712
|
+
*
|
|
2713
|
+
* @stability unstable
|
|
2714
|
+
* @category header values
|
|
2715
|
+
* @since 4.0.0
|
|
2716
|
+
*/
|
|
2717
|
+
const parseRetryAfter = (input) => {
|
|
2718
|
+
const trimmed = input.trim();
|
|
2719
|
+
if (wholeSeconds.test(trimmed)) {
|
|
2720
|
+
const seconds$1 = Number(trimmed);
|
|
2721
|
+
const duration = Number.isSafeInteger(seconds$1 * 1e3) ? seconds(seconds$1) : nanos(BigInt(trimmed) * nanosPerSecond);
|
|
2722
|
+
return succeed$1({
|
|
2723
|
+
_tag: "Duration",
|
|
2724
|
+
duration
|
|
2725
|
+
});
|
|
2726
|
+
}
|
|
2727
|
+
const millis = httpDateToMillis(trimmed);
|
|
2728
|
+
return millis === void 0 ? fail$1(HeaderParseError.fromReason("InvalidRetryAfter", input)) : succeed$1(retryAfterDateTime(makeUnsafe(millis)));
|
|
2729
|
+
};
|
|
2730
|
+
/**
|
|
2731
|
+
* Computes how long to wait for a `Retry-After` value, measured from `now`
|
|
2732
|
+
* in epoch milliseconds.
|
|
2733
|
+
*
|
|
2734
|
+
* **Details**
|
|
2735
|
+
*
|
|
2736
|
+
* A date that is already in the past yields a zero duration, never a
|
|
2737
|
+
* negative one. Compute the delay when the retry is scheduled rather than
|
|
2738
|
+
* when the header is parsed, so the wait reflects the time already spent.
|
|
2739
|
+
*
|
|
2740
|
+
* @stability unstable
|
|
2741
|
+
* @category header values
|
|
2742
|
+
* @since 4.0.0
|
|
2743
|
+
*/
|
|
2744
|
+
const retryAfterDelay = (self, now) => self._tag === "Duration" ? self.duration : millis(Math.max(0, toEpochMillis(self.dateTime) - now));
|
|
2745
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/http/internal/urlParams.js
|
|
2746
|
+
/** @internal */
|
|
2747
|
+
const unwrap = (value$6) => typeof value$6 === "string" ? value$6 : value(value$6);
|
|
2748
|
+
/** @internal */
|
|
2749
|
+
const stripSearchAndHash = (url) => {
|
|
2750
|
+
const queryIndex = url.indexOf("?");
|
|
2751
|
+
const hashIndex = url.indexOf("#");
|
|
2752
|
+
if (queryIndex === -1) return hashIndex === -1 ? url : url.slice(0, hashIndex);
|
|
2753
|
+
if (hashIndex === -1) return url.slice(0, queryIndex);
|
|
2754
|
+
return url.slice(0, Math.min(queryIndex, hashIndex));
|
|
2755
|
+
};
|
|
2756
|
+
const bodyDecoder = /*#__PURE__*/ new TextDecoder("utf-8", { ignoreBOM: true });
|
|
2757
|
+
/** @internal */
|
|
2758
|
+
const fromBody = (bytes) => new URLSearchParams(bodyDecoder.decode(bytes).replace(/^\?/, "%3F"));
|
|
2759
|
+
const originForm = /^\/(?![/\\])/;
|
|
2760
|
+
/** @internal */
|
|
2761
|
+
const toPath = (url) => {
|
|
2762
|
+
if (url === "*" || originForm.test(url)) return stripSearchAndHash(url);
|
|
2763
|
+
try {
|
|
2764
|
+
return new URL(url, "http://localhost").pathname;
|
|
2765
|
+
} catch {
|
|
2766
|
+
return "<invalid URL>";
|
|
2767
|
+
}
|
|
2768
|
+
};
|
|
2769
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/http/UrlParams.js
|
|
2603
2770
|
/**
|
|
2604
2771
|
* Models URL query parameters as ordered string pairs.
|
|
2605
2772
|
*
|
|
@@ -2626,21 +2793,24 @@ const Proto = {
|
|
|
2626
2793
|
[Symbol.iterator]() {
|
|
2627
2794
|
return this.params[Symbol.iterator]();
|
|
2628
2795
|
},
|
|
2629
|
-
|
|
2796
|
+
[symbolRedactable](context) {
|
|
2630
2797
|
return {
|
|
2631
2798
|
_id: "UrlParams",
|
|
2632
|
-
params: Object.fromEntries(this
|
|
2799
|
+
params: Object.fromEntries(redact(this, get(context, CurrentRedactedNames)))
|
|
2633
2800
|
};
|
|
2634
2801
|
},
|
|
2802
|
+
toJSON() {
|
|
2803
|
+
return redact$2(this);
|
|
2804
|
+
},
|
|
2635
2805
|
[symbol$1](that) {
|
|
2636
|
-
return Equivalence(this, that);
|
|
2806
|
+
return Equivalence$1(this, that);
|
|
2637
2807
|
},
|
|
2638
2808
|
[symbol]() {
|
|
2639
2809
|
return array(this.params.flat());
|
|
2640
2810
|
}
|
|
2641
2811
|
};
|
|
2642
2812
|
/**
|
|
2643
|
-
* Creates `UrlParams` from ordered
|
|
2813
|
+
* Creates `UrlParams` from ordered key-value pairs.
|
|
2644
2814
|
*
|
|
2645
2815
|
* **Details**
|
|
2646
2816
|
*
|
|
@@ -2662,6 +2832,7 @@ const make$3 = (params) => {
|
|
|
2662
2832
|
*
|
|
2663
2833
|
* Primitive values are converted to strings, arrays produce repeated parameters,
|
|
2664
2834
|
* nested records use bracket notation, and `undefined` values are omitted.
|
|
2835
|
+
* `Redacted` values are kept as-is.
|
|
2665
2836
|
*
|
|
2666
2837
|
* @stability unstable
|
|
2667
2838
|
* @category constructors
|
|
@@ -2681,13 +2852,14 @@ const fromInputNested = (input) => {
|
|
|
2681
2852
|
const entries = typeof input[Symbol.iterator] === "function" ? fromIterable$1(input) : Object.entries(input);
|
|
2682
2853
|
const out = [];
|
|
2683
2854
|
for (const [key, value] of entries) if (Array.isArray(value)) {
|
|
2684
|
-
for (let i = 0; i < value.length; i++) if (value[i] !== void 0) out.push([key,
|
|
2685
|
-
} else if (value !== null && typeof value === "object") {
|
|
2855
|
+
for (let i = 0; i < value.length; i++) if (value[i] !== void 0) out.push([key, coerce(value[i])]);
|
|
2856
|
+
} else if (value !== null && typeof value === "object" && !isRedacted(value)) {
|
|
2686
2857
|
const nested = fromInputNested(value);
|
|
2687
2858
|
for (const [k, v] of nested) out.push([[key, ...typeof k === "string" ? [k] : k], v]);
|
|
2688
|
-
} else if (value !== void 0) out.push([key,
|
|
2859
|
+
} else if (value !== void 0) out.push([key, coerce(value)]);
|
|
2689
2860
|
return out;
|
|
2690
2861
|
};
|
|
2862
|
+
const coerce = (value) => isRedacted(value) ? value : String(value);
|
|
2691
2863
|
/**
|
|
2692
2864
|
* Provides an order-sensitive `Equivalence` instance for `UrlParams`.
|
|
2693
2865
|
*
|
|
@@ -2700,8 +2872,8 @@ const fromInputNested = (input) => {
|
|
|
2700
2872
|
* @category instances
|
|
2701
2873
|
* @since 4.0.0
|
|
2702
2874
|
*/
|
|
2703
|
-
const Equivalence = /*#__PURE__*/ make$
|
|
2704
|
-
const arrayEquivalence = /*#__PURE__*/ makeEquivalence$3(/*#__PURE__*/ makeEquivalence$2([/*#__PURE__*/ strictEqual(), /*#__PURE__*/
|
|
2875
|
+
const Equivalence$1 = /*#__PURE__*/ make$10((a, b) => arrayEquivalence(a.params, b.params));
|
|
2876
|
+
const arrayEquivalence = /*#__PURE__*/ makeEquivalence$3(/*#__PURE__*/ makeEquivalence$2([/*#__PURE__*/ strictEqual(), /*#__PURE__*/ asEquivalence()]));
|
|
2705
2877
|
/**
|
|
2706
2878
|
* An empty `UrlParams` value.
|
|
2707
2879
|
*
|
|
@@ -2759,11 +2931,15 @@ const appendAll = /*#__PURE__*/ dual(2, (self, input) => transform$2(self, appen
|
|
|
2759
2931
|
/**
|
|
2760
2932
|
* Serializes `UrlParams` to a URL query string without a leading question mark.
|
|
2761
2933
|
*
|
|
2934
|
+
* **Gotchas**
|
|
2935
|
+
*
|
|
2936
|
+
* The output contains the unwrapped values of `Redacted` parameters.
|
|
2937
|
+
*
|
|
2762
2938
|
* @stability unstable
|
|
2763
2939
|
* @category converting
|
|
2764
2940
|
* @since 4.0.0
|
|
2765
2941
|
*/
|
|
2766
|
-
const toString = (input) => new URLSearchParams(fromInput(input).params).toString();
|
|
2942
|
+
const toString = (input) => new URLSearchParams(fromInput(input).params.map(([key, value]) => [key, unwrap(value)])).toString();
|
|
2767
2943
|
/**
|
|
2768
2944
|
* Builds a `Record` containing all the key-value pairs in the given `UrlParams`
|
|
2769
2945
|
* as `string` (if only one value for a key) or a `NonEmptyArray<string>`
|
|
@@ -2789,11 +2965,14 @@ const toString = (input) => new URLSearchParams(fromInput(input).params).toStrin
|
|
|
2789
2965
|
*/
|
|
2790
2966
|
const toRecord = (self) => {
|
|
2791
2967
|
const out = {};
|
|
2792
|
-
for (const [k,
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2968
|
+
for (const [k, v] of self.params) {
|
|
2969
|
+
const value = unwrap(v);
|
|
2970
|
+
if (!Object.hasOwn(out, k)) assignProperty(out, k, value);
|
|
2971
|
+
else {
|
|
2972
|
+
const current = out[k];
|
|
2973
|
+
if (typeof current === "string") assignProperty(out, k, [current, value]);
|
|
2974
|
+
else current.push(value);
|
|
2975
|
+
}
|
|
2797
2976
|
}
|
|
2798
2977
|
return out;
|
|
2799
2978
|
};
|
|
@@ -2802,15 +2981,134 @@ const toRecord = (self) => {
|
|
|
2802
2981
|
*
|
|
2803
2982
|
* **Details**
|
|
2804
2983
|
*
|
|
2805
|
-
* Keys with one value map to a string, and keys with multiple values map to a
|
|
2806
|
-
* non-empty readonly array of strings.
|
|
2984
|
+
* Keys with one value map to a string, and keys with multiple values map to a
|
|
2985
|
+
* non-empty readonly array of strings.
|
|
2986
|
+
*
|
|
2987
|
+
* @stability unstable
|
|
2988
|
+
* @category converting
|
|
2989
|
+
* @since 4.0.0
|
|
2990
|
+
*/
|
|
2991
|
+
const toReadonlyRecord = toRecord;
|
|
2992
|
+
/**
|
|
2993
|
+
* Returns the parameter pairs with selected values wrapped in `Redacted`.
|
|
2994
|
+
*
|
|
2995
|
+
* **Details**
|
|
2996
|
+
*
|
|
2997
|
+
* Keeps `Redacted` values and wraps values whose names match `isRedactedName`,
|
|
2998
|
+
* preserving order and repeated names.
|
|
2999
|
+
*
|
|
3000
|
+
* @stability unstable
|
|
3001
|
+
* @category combinators
|
|
3002
|
+
* @since 4.0.0
|
|
3003
|
+
*/
|
|
3004
|
+
const redact = /*#__PURE__*/ dual(2, (self, key) => {
|
|
3005
|
+
const patterns = Array.isArray(key) ? key : [key];
|
|
3006
|
+
return self.params.map(([name, value]) => [name, typeof value === "string" && isRedactedName(name, patterns) ? make$5(value) : value]);
|
|
3007
|
+
});
|
|
3008
|
+
/**
|
|
3009
|
+
* Checks whether a parameter name matches one of the redaction patterns.
|
|
3010
|
+
*
|
|
3011
|
+
* **Details**
|
|
3012
|
+
*
|
|
3013
|
+
* String patterns match case-insensitively; regular expressions test the name.
|
|
3014
|
+
*
|
|
3015
|
+
* @stability unstable
|
|
3016
|
+
* @category combinators
|
|
3017
|
+
* @since 4.0.0
|
|
3018
|
+
*/
|
|
3019
|
+
const isRedactedName = isRedactedName$1;
|
|
3020
|
+
/**
|
|
3021
|
+
* Redacts URL userinfo and the values of matching query parameters.
|
|
3022
|
+
*
|
|
3023
|
+
* **Details**
|
|
3024
|
+
*
|
|
3025
|
+
* Replaces userinfo with `REDACTED:REDACTED` and query values with `REDACTED`
|
|
3026
|
+
* when their decoded names match `isRedactedName`. Preserves all other text.
|
|
3027
|
+
* When names are omitted, uses the current fiber's `CurrentRedactedNames`,
|
|
3028
|
+
* falling back to the defaults outside a fiber.
|
|
3029
|
+
*
|
|
3030
|
+
* **Example** (Redacting a signed URL)
|
|
3031
|
+
*
|
|
3032
|
+
* ```ts import.meta.vitest
|
|
3033
|
+
* import { UrlParams } from "effect/http"
|
|
3034
|
+
*
|
|
3035
|
+
* const url = UrlParams.redactUrl("https://bucket.test/file?Signature=abc&size=1")
|
|
3036
|
+
* url // => "https://bucket.test/file?Signature=REDACTED&size=1"
|
|
3037
|
+
* ```
|
|
3038
|
+
*
|
|
3039
|
+
* @stability unstable
|
|
3040
|
+
* @category combinators
|
|
3041
|
+
* @since 4.0.0
|
|
3042
|
+
*/
|
|
3043
|
+
const redactUrl = (url, redactedNames = currentRedactedNames()) => {
|
|
3044
|
+
if (url.includes("@")) url = redactUserinfo(url);
|
|
3045
|
+
const queryStart = url.indexOf("?");
|
|
3046
|
+
if (queryStart === -1 || redactedNames.length === 0) return url;
|
|
3047
|
+
const hashStart = url.indexOf("#");
|
|
3048
|
+
if (hashStart !== -1 && hashStart < queryStart) return url;
|
|
3049
|
+
const queryEnd = hashStart === -1 ? url.length : hashStart;
|
|
3050
|
+
return url.slice(0, queryStart + 1) + redactQuery(url.slice(queryStart + 1, queryEnd), redactedNames) + url.slice(queryEnd);
|
|
3051
|
+
};
|
|
3052
|
+
const authorityStart = /^(?:(https?|ftp|wss?):[/\\]*|[a-z][a-z\d+.-]*:\/\/|[/\\]{2,})/i;
|
|
3053
|
+
const specialAuthorityEnd = /[/\\?#]/;
|
|
3054
|
+
const authorityEnd = /[/?#]/;
|
|
3055
|
+
const redactUserinfo = (url) => {
|
|
3056
|
+
let normalized = "";
|
|
3057
|
+
const offsets = [];
|
|
3058
|
+
for (let i = 0; i < url.length; i++) {
|
|
3059
|
+
const code = url.charCodeAt(i);
|
|
3060
|
+
if (code === 9 || code === 10 || code === 13 || normalized === "" && code <= 32) continue;
|
|
3061
|
+
normalized += url[i];
|
|
3062
|
+
offsets.push(i);
|
|
3063
|
+
}
|
|
3064
|
+
const authority = authorityStart.exec(normalized);
|
|
3065
|
+
if (authority === null) return url;
|
|
3066
|
+
const start = authority[0].length;
|
|
3067
|
+
const special = authority[1] !== void 0 || !authority[0].includes(":");
|
|
3068
|
+
const rest = normalized.slice(start);
|
|
3069
|
+
const end = rest.search(special ? specialAuthorityEnd : authorityEnd);
|
|
3070
|
+
const userinfoEnd = (end === -1 ? rest : rest.slice(0, end)).lastIndexOf("@");
|
|
3071
|
+
return userinfoEnd === -1 ? url : url.slice(0, offsets[start]) + "REDACTED:REDACTED" + url.slice(offsets[start + userinfoEnd]);
|
|
3072
|
+
};
|
|
3073
|
+
const redactQuery = (query, redactedNames) => query.split("&").map((part) => {
|
|
3074
|
+
const index = part.indexOf("=");
|
|
3075
|
+
return index !== -1 && isRedactedName(decodeQueryKey(part.slice(0, index)), redactedNames) ? part.slice(0, index + 1) + "REDACTED" : part;
|
|
3076
|
+
}).join("&");
|
|
3077
|
+
const decodeQueryKey = (key) => {
|
|
3078
|
+
if (!key.includes("%") && !key.includes("+")) return key;
|
|
3079
|
+
try {
|
|
3080
|
+
return decodeURIComponent(key.replace(/\+/g, " "));
|
|
3081
|
+
} catch {
|
|
3082
|
+
return key;
|
|
3083
|
+
}
|
|
3084
|
+
};
|
|
3085
|
+
const currentRedactedNames = () => get(globalThis["~effect/Fiber/currentFiber"]?.context ?? empty$3(), CurrentRedactedNames);
|
|
3086
|
+
/**
|
|
3087
|
+
* Query parameter names or patterns to redact in inspection, spans and errors.
|
|
3088
|
+
*
|
|
3089
|
+
* **Details**
|
|
3090
|
+
*
|
|
3091
|
+
* Defaults match the OpenTelemetry `url.full` list: `X-Amz-Signature`,
|
|
3092
|
+
* `X-Amz-Credential`, `X-Amz-Security-Token`, `AWSAccessKeyId`, `Signature`,
|
|
3093
|
+
* `sig` and `X-Goog-Signature`.
|
|
3094
|
+
* A custom list replaces the defaults. Matching uses `isRedactedName`.
|
|
3095
|
+
* Redaction leaves request URLs and parameter values unchanged. `Redacted`
|
|
3096
|
+
* values are redacted regardless of this list.
|
|
2807
3097
|
*
|
|
2808
3098
|
* @stability unstable
|
|
2809
|
-
* @category
|
|
3099
|
+
* @category services
|
|
2810
3100
|
* @since 4.0.0
|
|
2811
3101
|
*/
|
|
2812
|
-
const
|
|
2813
|
-
|
|
3102
|
+
const CurrentRedactedNames = /*#__PURE__*/ Reference("effect/http/UrlParams/CurrentRedactedNames", { defaultValue: () => [
|
|
3103
|
+
"X-Amz-Signature",
|
|
3104
|
+
"X-Amz-Credential",
|
|
3105
|
+
"X-Amz-Security-Token",
|
|
3106
|
+
"AWSAccessKeyId",
|
|
3107
|
+
"Signature",
|
|
3108
|
+
"sig",
|
|
3109
|
+
"X-Goog-Signature"
|
|
3110
|
+
] });
|
|
3111
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/schema/annotations.js
|
|
2814
3112
|
/** @internal */
|
|
2815
3113
|
function resolve$1(ast) {
|
|
2816
3114
|
return ast.checks ? ast.checks[ast.checks.length - 1].annotations : ast.annotations;
|
|
@@ -2868,7 +3166,7 @@ const annotationExcludedKeys = /*#__PURE__*/ new Set([
|
|
|
2868
3166
|
"toCodecIso",
|
|
2869
3167
|
"toCodecArbitrary"
|
|
2870
3168
|
]);
|
|
2871
|
-
// ../../node_modules/.pnpm/effect@4.
|
|
3169
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/schema/parser.js
|
|
2872
3170
|
/** @internal */
|
|
2873
3171
|
const missing = /*#__PURE__*/ Symbol();
|
|
2874
3172
|
/** @internal */
|
|
@@ -2881,7 +3179,7 @@ const sameExit = /*#__PURE__*/ succeed(missing);
|
|
|
2881
3179
|
const toOption = (value) => value === missing ? none() : some(value);
|
|
2882
3180
|
/** @internal */
|
|
2883
3181
|
const fromOptionExit = (option) => option._tag === "None" ? missingExit : succeed(option.value);
|
|
2884
|
-
// ../../node_modules/.pnpm/effect@4.
|
|
3182
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/SchemaIssue.js
|
|
2885
3183
|
/**
|
|
2886
3184
|
* Describes problems found while decoding, encoding, or checking data with
|
|
2887
3185
|
* schemas.
|
|
@@ -3291,8 +3589,8 @@ const defaultLeafHook = (issue) => {
|
|
|
3291
3589
|
*
|
|
3292
3590
|
* **Details**
|
|
3293
3591
|
*
|
|
3294
|
-
* - Looks for a `message` annotation on the
|
|
3295
|
-
*
|
|
3592
|
+
* - Looks for a `message` annotation on the filter first, then on the inner
|
|
3593
|
+
* issue.
|
|
3296
3594
|
* - Returns `undefined` when no annotation is found, causing the formatter to
|
|
3297
3595
|
* fall back to `"Expected <filter>"` or, when the filter reports input,
|
|
3298
3596
|
* `"Expected <filter>, got <input>"`.
|
|
@@ -3304,7 +3602,7 @@ const defaultLeafHook = (issue) => {
|
|
|
3304
3602
|
* @category formatting
|
|
3305
3603
|
* @since 4.0.0
|
|
3306
3604
|
*/
|
|
3307
|
-
const defaultCheckHook = (issue) => findMessage(issue
|
|
3605
|
+
const defaultCheckHook = (issue) => findMessage(issue) ?? findMessage(issue.issue);
|
|
3308
3606
|
function formatInput(issue) {
|
|
3309
3607
|
return hasInput(issue) ? format$1(issue.input) : void 0;
|
|
3310
3608
|
}
|
|
@@ -3316,6 +3614,12 @@ function getExpectedMessage(expected, issue) {
|
|
|
3316
3614
|
const input = formatInput(issue);
|
|
3317
3615
|
return input === void 0 ? `Expected ${expected}` : `Expected ${expected}, got ${input}`;
|
|
3318
3616
|
}
|
|
3617
|
+
function getFilterMessage(issue, checkHook) {
|
|
3618
|
+
const message = checkHook(issue);
|
|
3619
|
+
if (message !== void 0 || issue.issue._tag !== "InvalidValue") return message;
|
|
3620
|
+
const expected = findExpected(issue.issue);
|
|
3621
|
+
return expected === void 0 ? getExpectedMessage(formatCheck(issue.filter), issue) : getExpectedMessage(expected, issue.issue);
|
|
3622
|
+
}
|
|
3319
3623
|
function formatCheck(check) {
|
|
3320
3624
|
const expected = check.annotations?.expected;
|
|
3321
3625
|
if (typeof expected === "string") return expected;
|
|
@@ -3369,37 +3673,28 @@ function makeFormatterDefault() {
|
|
|
3369
3673
|
}
|
|
3370
3674
|
/** @internal */
|
|
3371
3675
|
const defaultFormatter = /*#__PURE__*/ makeFormatterDefault();
|
|
3372
|
-
function formatIssue(issue, path) {
|
|
3676
|
+
function formatIssue(issue, path, messageOverride) {
|
|
3373
3677
|
let message;
|
|
3374
3678
|
switch (issue._tag) {
|
|
3375
|
-
case "Filter":
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
else {
|
|
3379
|
-
if (issue.issue._tag !== "InvalidValue") return formatIssue(issue.issue, path);
|
|
3380
|
-
const expected = findExpected(issue.issue);
|
|
3381
|
-
message = expected === void 0 ? getExpectedMessage(formatCheck(issue.filter), issue) : getExpectedMessage(expected, issue.issue);
|
|
3382
|
-
}
|
|
3383
|
-
break;
|
|
3384
|
-
}
|
|
3385
|
-
case "Encoding": return formatIssue(issue.issue, path);
|
|
3386
|
-
case "Pointer": return formatIssue(issue.issue, path + formatPath(issue.path));
|
|
3679
|
+
case "Filter": return formatIssue(issue.issue, path, messageOverride ?? getFilterMessage(issue, defaultCheckHook));
|
|
3680
|
+
case "Encoding": return formatIssue(issue.issue, path, messageOverride);
|
|
3681
|
+
case "Pointer": return formatIssue(issue.issue, path + formatPath(issue.path), messageOverride);
|
|
3387
3682
|
case "Composite":
|
|
3388
3683
|
case "AnyOf":
|
|
3389
|
-
if (issue._tag === "Composite" || issue.issues.length > 0) return issue.issues.map((issue) => formatIssue(issue, path)).join("\n");
|
|
3390
|
-
message = findMessage(issue) ?? getExpectedMessage(getExpected(issue.ast), issue);
|
|
3684
|
+
if (issue._tag === "Composite" || issue.issues.length > 0) return issue.issues.map((issue) => formatIssue(issue, path, messageOverride)).join("\n");
|
|
3685
|
+
message = messageOverride ?? findMessage(issue) ?? getExpectedMessage(getExpected(issue.ast), issue);
|
|
3391
3686
|
break;
|
|
3392
|
-
default: message = defaultLeafHook(issue);
|
|
3687
|
+
default: message = messageOverride ?? defaultLeafHook(issue);
|
|
3393
3688
|
}
|
|
3394
3689
|
return path ? `${message}\n at ${path}` : message;
|
|
3395
3690
|
}
|
|
3396
3691
|
function findMessage(issue) {
|
|
3397
|
-
if (issue._tag === "Pointer") return;
|
|
3692
|
+
if (issue._tag === "Pointer" || issue._tag === "Composite") return;
|
|
3398
3693
|
if (issue._tag === "Encoding") return findMessage(issue.issue);
|
|
3399
3694
|
const message = (issue._tag === "Filter" ? issue.filter.annotations : "annotations" in issue ? issue.annotations : issue.ast.annotations)?.[issue._tag === "MissingKey" ? "messageMissingKey" : issue._tag === "UnexpectedKey" ? "messageUnexpectedKey" : "message"];
|
|
3400
3695
|
if (typeof message === "string") return message;
|
|
3401
3696
|
}
|
|
3402
|
-
// ../../node_modules/.pnpm/effect@4.
|
|
3697
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/schema/cause.js
|
|
3403
3698
|
/** @internal */
|
|
3404
3699
|
function getSchemaIssue(cause) {
|
|
3405
3700
|
let issue;
|
|
@@ -3415,7 +3710,7 @@ function getSchemaIssueOrThrow(cause, message) {
|
|
|
3415
3710
|
if (issue === void 0) throw new Error(message, { cause });
|
|
3416
3711
|
return issue;
|
|
3417
3712
|
}
|
|
3418
|
-
// ../../node_modules/.pnpm/effect@4.
|
|
3713
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/SchemaGetter.js
|
|
3419
3714
|
const runGetter = (self, input, options) => {
|
|
3420
3715
|
switch (self._tag) {
|
|
3421
3716
|
case "Passthrough": return succeed$3(input);
|
|
@@ -3872,7 +4167,8 @@ function Number$3() {
|
|
|
3872
4167
|
* **Details**
|
|
3873
4168
|
*
|
|
3874
4169
|
* - Delegates to `globalThis.BigInt`.
|
|
3875
|
-
* -
|
|
4170
|
+
* - Fails with `SchemaIssue.InvalidValue` if the input cannot be converted
|
|
4171
|
+
* (e.g. a non-numeric string or a non-integer number).
|
|
3876
4172
|
*
|
|
3877
4173
|
* **Example** (Coercing to a bigint)
|
|
3878
4174
|
*
|
|
@@ -3888,7 +4184,13 @@ function Number$3() {
|
|
|
3888
4184
|
* @since 4.0.0
|
|
3889
4185
|
*/
|
|
3890
4186
|
function BigInt$3() {
|
|
3891
|
-
return
|
|
4187
|
+
return transformEffect$1((input, options) => {
|
|
4188
|
+
try {
|
|
4189
|
+
return succeed$3(globalThis.BigInt(input));
|
|
4190
|
+
} catch {
|
|
4191
|
+
return fail$2(new InvalidValue({ expected: "a value that can be converted to a bigint" }, input, options));
|
|
4192
|
+
}
|
|
4193
|
+
});
|
|
3892
4194
|
}
|
|
3893
4195
|
/**
|
|
3894
4196
|
* Strips whitespace from both ends of a string.
|
|
@@ -3999,7 +4301,10 @@ function stringifyJson(options) {
|
|
|
3999
4301
|
* The getter is pure and never fails. It splits the string by `separator`
|
|
4000
4302
|
* (default `,`) and then each pair at the first `keyValueSeparator` (default `=`),
|
|
4001
4303
|
* preserving the rest of the value. An empty `keyValueSeparator` uses the first
|
|
4002
|
-
* two characters as the key and value. Pairs
|
|
4304
|
+
* two characters as the key and value. Pairs without a `keyValueSeparator` or
|
|
4305
|
+
* with an empty key are skipped. Pairs with an empty value are skipped unless
|
|
4306
|
+
* `keepEmptyValues` is `true`, in which case the value is `""`. When `trim` is
|
|
4307
|
+
* `true`, keys and values are trimmed before these checks.
|
|
4003
4308
|
*
|
|
4004
4309
|
* **Example** (Parsing a key-value string)
|
|
4005
4310
|
*
|
|
@@ -4021,17 +4326,26 @@ function stringifyJson(options) {
|
|
|
4021
4326
|
function splitKeyValue$1(options) {
|
|
4022
4327
|
const separator = options?.separator ?? ",";
|
|
4023
4328
|
const keyValueSeparator = options?.keyValueSeparator ?? "=";
|
|
4329
|
+
const trim = options?.trim ?? false;
|
|
4330
|
+
const keepEmptyValues = options?.keepEmptyValues ?? false;
|
|
4024
4331
|
return transform$1((input) => input.split(separator).reduce((acc, pair) => {
|
|
4332
|
+
let key;
|
|
4333
|
+
let value;
|
|
4025
4334
|
if (keyValueSeparator === "") {
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4335
|
+
key = pair.slice(0, 1);
|
|
4336
|
+
value = pair.slice(1, 2);
|
|
4337
|
+
} else {
|
|
4338
|
+
const index = pair.indexOf(keyValueSeparator);
|
|
4339
|
+
if (index === -1) return acc;
|
|
4340
|
+
key = pair.slice(0, index);
|
|
4341
|
+
value = pair.slice(index + keyValueSeparator.length);
|
|
4342
|
+
}
|
|
4343
|
+
if (trim) {
|
|
4344
|
+
key = key.trim();
|
|
4345
|
+
value = value.trim();
|
|
4029
4346
|
}
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
const key = pair.slice(0, index);
|
|
4033
|
-
const value = pair.slice(index + keyValueSeparator.length);
|
|
4034
|
-
if (value) assignProperty(acc, key, value);
|
|
4347
|
+
if (key === "" || value === "" && !keepEmptyValues) return acc;
|
|
4348
|
+
assignProperty(acc, key, value);
|
|
4035
4349
|
return acc;
|
|
4036
4350
|
}, {}));
|
|
4037
4351
|
}
|
|
@@ -4185,7 +4499,18 @@ function decodeUriComponent() {
|
|
|
4185
4499
|
}
|
|
4186
4500
|
});
|
|
4187
4501
|
}
|
|
4188
|
-
// ../../node_modules/.pnpm/effect@4.
|
|
4502
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/schema/content.js
|
|
4503
|
+
const ContentTypeId = /*#__PURE__*/ Symbol.for("~effect/Schema/content");
|
|
4504
|
+
/** @internal */
|
|
4505
|
+
function setContent(operation, content) {
|
|
4506
|
+
Object.defineProperty(operation, ContentTypeId, { value: content });
|
|
4507
|
+
return operation;
|
|
4508
|
+
}
|
|
4509
|
+
/** @internal */
|
|
4510
|
+
function getContent(operation) {
|
|
4511
|
+
return operation[ContentTypeId];
|
|
4512
|
+
}
|
|
4513
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/SchemaTransformation.js
|
|
4189
4514
|
/**
|
|
4190
4515
|
* Constructs schema middleware from its decode and encode functions.
|
|
4191
4516
|
*
|
|
@@ -4193,7 +4518,7 @@ function decodeUriComponent() {
|
|
|
4193
4518
|
* @category constructors
|
|
4194
4519
|
* @since 4.0.0
|
|
4195
4520
|
*/
|
|
4196
|
-
const Middleware = class extends Class$
|
|
4521
|
+
const Middleware = class extends Class$1 {
|
|
4197
4522
|
_tag = "Middleware";
|
|
4198
4523
|
decode;
|
|
4199
4524
|
encode;
|
|
@@ -4214,7 +4539,7 @@ const TypeId$5 = "~effect/SchemaTransformation/Transformation";
|
|
|
4214
4539
|
* @category constructors
|
|
4215
4540
|
* @since 4.0.0
|
|
4216
4541
|
*/
|
|
4217
|
-
const Transformation = class extends Class$
|
|
4542
|
+
const Transformation = class extends Class$1 {
|
|
4218
4543
|
[TypeId$5] = TypeId$5;
|
|
4219
4544
|
_tag = "Transformation";
|
|
4220
4545
|
decode;
|
|
@@ -4552,9 +4877,12 @@ function toLowerCase() {
|
|
|
4552
4877
|
* **Details**
|
|
4553
4878
|
*
|
|
4554
4879
|
* Decoding splits the string by `separator` (default `","`) into pairs, then
|
|
4555
|
-
* splits each pair by `keyValueSeparator` (default `"="`).
|
|
4556
|
-
*
|
|
4557
|
-
*
|
|
4880
|
+
* splits each pair by `keyValueSeparator` (default `"="`). Set `trim` to trim
|
|
4881
|
+
* keys and values, and `keepEmptyValues` to keep pairs with an empty value as
|
|
4882
|
+
* `""` instead of skipping them (see {@link SchemaGetter.splitKeyValue}).
|
|
4883
|
+
* Encoding joins the record back into a string using the same separators. The
|
|
4884
|
+
* transformation is round-trippable when keys and values do not contain the
|
|
4885
|
+
* separators and, with `trim`, have no surrounding whitespace.
|
|
4558
4886
|
*
|
|
4559
4887
|
* **Example** (Parsing key-value pairs)
|
|
4560
4888
|
*
|
|
@@ -4814,7 +5142,7 @@ const uint8ArrayFromBase64String = /*#__PURE__*/ new Transformation(/*#__PURE__*
|
|
|
4814
5142
|
* **When to use**
|
|
4815
5143
|
*
|
|
4816
5144
|
* Use when you need a schema transformation to store structured data in URL
|
|
4817
|
-
* query parameters or fragments, such as composing with `Schema.
|
|
5145
|
+
* query parameters or fragments, such as composing with `Schema.fromJsonString` to
|
|
4818
5146
|
* round-trip JSON through a URL.
|
|
4819
5147
|
*
|
|
4820
5148
|
* **Details**
|
|
@@ -4877,9 +5205,12 @@ const stringFromUriComponent = /*#__PURE__*/ new Transformation(/*#__PURE__*/ de
|
|
|
4877
5205
|
* @since 4.0.0
|
|
4878
5206
|
*/
|
|
4879
5207
|
function fromJsonString$1(options) {
|
|
4880
|
-
return new Transformation(parseJson(options ?? {}), stringifyJson(options)
|
|
5208
|
+
return new Transformation(parseJson(options ?? {}), setContent(stringifyJson(options), {
|
|
5209
|
+
mediaType: "application/json",
|
|
5210
|
+
preserveSchema: options?.reviver === void 0 && options?.replacer === void 0
|
|
5211
|
+
}));
|
|
4881
5212
|
}
|
|
4882
|
-
// ../../node_modules/.pnpm/effect@4.
|
|
5213
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/SchemaAST.js
|
|
4883
5214
|
/**
|
|
4884
5215
|
* Represents Effect schemas as runtime trees.
|
|
4885
5216
|
*
|
|
@@ -5104,7 +5435,12 @@ const Declaration = class extends ASTNodeImpl {
|
|
|
5104
5435
|
let run;
|
|
5105
5436
|
return (input, options) => {
|
|
5106
5437
|
if (input === missing) return missingExit;
|
|
5107
|
-
|
|
5438
|
+
run ??= this.run(this.typeParameters);
|
|
5439
|
+
try {
|
|
5440
|
+
return run(input, this, options);
|
|
5441
|
+
} catch (error) {
|
|
5442
|
+
return die(error);
|
|
5443
|
+
}
|
|
5108
5444
|
};
|
|
5109
5445
|
}
|
|
5110
5446
|
_rebuild(recur, checks, encodingChecks, run, encodingRun) {
|
|
@@ -5180,8 +5516,8 @@ const Void$1 = class extends ASTNodeImpl {
|
|
|
5180
5516
|
_tag = "Void";
|
|
5181
5517
|
/** @internal */
|
|
5182
5518
|
getParser() {
|
|
5183
|
-
const succeed$
|
|
5184
|
-
return (input) => input === missing ? missingExit : succeed$
|
|
5519
|
+
const succeed$4 = succeed(void 0);
|
|
5520
|
+
return (input) => input === missing ? missingExit : succeed$4;
|
|
5185
5521
|
}
|
|
5186
5522
|
/** @internal */
|
|
5187
5523
|
toCodecJson() {
|
|
@@ -5670,7 +6006,7 @@ const Arrays = class extends ASTNodeImpl {
|
|
|
5670
6006
|
input,
|
|
5671
6007
|
len,
|
|
5672
6008
|
tailThreshold: Math.max(elementLen, len - tailLen),
|
|
5673
|
-
output:
|
|
6009
|
+
output: [],
|
|
5674
6010
|
issues: void 0,
|
|
5675
6011
|
options
|
|
5676
6012
|
};
|
|
@@ -5764,9 +6100,12 @@ const wrapPropertyKeyIssue = (s, ast, key, exit) => {
|
|
|
5764
6100
|
};
|
|
5765
6101
|
/**
|
|
5766
6102
|
* floating point or integer, with optional exponent
|
|
6103
|
+
*
|
|
6104
|
+
* The mantissa alternation keeps rejection linear: `\d*\.?\d+` retries
|
|
6105
|
+
* every split of a long digit run.
|
|
5767
6106
|
* @internal
|
|
5768
6107
|
*/
|
|
5769
|
-
const FINITE_PATTERN = "[+-]
|
|
6108
|
+
const FINITE_PATTERN = "[+-]?(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:[Ee][+-]?\\d+)?";
|
|
5770
6109
|
/**
|
|
5771
6110
|
* Returns the object keys that match the index signature parameter schema.
|
|
5772
6111
|
* @internal
|
|
@@ -5839,7 +6178,7 @@ const IndexSignature = class {
|
|
|
5839
6178
|
if (!isIndexSignatureParameter(parameter)) throw new Error(`Invalid index signature parameter ${parameter._tag}`);
|
|
5840
6179
|
this.parameter = parameter;
|
|
5841
6180
|
this.type = type;
|
|
5842
|
-
if (isOptional(type) &&
|
|
6181
|
+
if (isOptional(type) || type.encoding !== void 0 && isOptional(toEncoded$1(type))) throw new Error("Cannot use `Schema.optionalKey` or `Schema.optional` with index signatures. Index signatures already allow keys to be absent; use `Schema.UndefinedOr` to allow `undefined` values.");
|
|
5843
6182
|
}
|
|
5844
6183
|
};
|
|
5845
6184
|
/**
|
|
@@ -5964,7 +6303,7 @@ const Objects = class extends ASTNodeImpl {
|
|
|
5964
6303
|
}
|
|
5965
6304
|
}
|
|
5966
6305
|
else if (parseIndexes) {
|
|
5967
|
-
const keyPairs = empty$
|
|
6306
|
+
const keyPairs = empty$4();
|
|
5968
6307
|
for (let i = 0; i < indexCount; i++) {
|
|
5969
6308
|
const index = indexes[i];
|
|
5970
6309
|
const keys = indexKeys?.[i] ?? (index.is.parameter === string ? Object.keys(record) : getIndexSignatureKeys(record, index.is.parameter, options));
|
|
@@ -5979,9 +6318,13 @@ const Objects = class extends ASTNodeImpl {
|
|
|
5979
6318
|
};
|
|
5980
6319
|
if (indexCount) return makeFallback();
|
|
5981
6320
|
let fallback;
|
|
5982
|
-
const resume = (
|
|
6321
|
+
const resume = (snapshot, index, pending) => {
|
|
5983
6322
|
const property = properties[index];
|
|
5984
6323
|
return flatMap(exit(pending), (exit) => {
|
|
6324
|
+
const state = {
|
|
6325
|
+
...snapshot,
|
|
6326
|
+
out: { ...snapshot.out }
|
|
6327
|
+
};
|
|
5985
6328
|
const terminal = stepProperty(state, property, exit);
|
|
5986
6329
|
if (terminal) return terminal;
|
|
5987
6330
|
const done = () => succeed(state.out);
|
|
@@ -6513,7 +6856,7 @@ const Suspend = class extends ASTNodeImpl {
|
|
|
6513
6856
|
* @category constructors
|
|
6514
6857
|
* @since 4.0.0
|
|
6515
6858
|
*/
|
|
6516
|
-
const Filter = class extends Class$
|
|
6859
|
+
const Filter = class extends Class$1 {
|
|
6517
6860
|
_tag = "Filter";
|
|
6518
6861
|
run;
|
|
6519
6862
|
annotations;
|
|
@@ -6547,7 +6890,7 @@ const Filter = class extends Class$2 {
|
|
|
6547
6890
|
* @category constructors
|
|
6548
6891
|
* @since 4.0.0
|
|
6549
6892
|
*/
|
|
6550
|
-
const FilterGroup = class extends Class$
|
|
6893
|
+
const FilterGroup = class extends Class$1 {
|
|
6551
6894
|
_tag = "FilterGroup";
|
|
6552
6895
|
checks;
|
|
6553
6896
|
annotations;
|
|
@@ -6601,7 +6944,7 @@ const numberToJson = /*#__PURE__*/ new Link(/*#__PURE__*/ new Union$1([finite, n
|
|
|
6601
6944
|
*
|
|
6602
6945
|
* **Details**
|
|
6603
6946
|
*
|
|
6604
|
-
* The filter can be used with `Schema.
|
|
6947
|
+
* The filter can be used with `Schema.check` or attached directly to a
|
|
6605
6948
|
* `String` AST node through checks. The regular expression is cloned and its
|
|
6606
6949
|
* `lastIndex` is reset before each test, so global and sticky expressions are
|
|
6607
6950
|
* deterministic and the provided regular expression is not mutated. The
|
|
@@ -6815,13 +7158,19 @@ function decodeTo$1(from, to, transformation) {
|
|
|
6815
7158
|
function parseParameter(ast) {
|
|
6816
7159
|
const literals = [];
|
|
6817
7160
|
const parameters = [];
|
|
7161
|
+
function addLiteral(literal) {
|
|
7162
|
+
if (!literals.includes(literal)) literals.push(literal);
|
|
7163
|
+
}
|
|
6818
7164
|
function go(ast) {
|
|
6819
7165
|
switch (ast._tag) {
|
|
6820
7166
|
case "Literal":
|
|
6821
|
-
if (isPropertyKey(ast.literal)
|
|
7167
|
+
if (isPropertyKey(ast.literal)) addLiteral(ast.literal);
|
|
6822
7168
|
return;
|
|
6823
7169
|
case "UniqueSymbol":
|
|
6824
|
-
|
|
7170
|
+
addLiteral(ast.symbol);
|
|
7171
|
+
return;
|
|
7172
|
+
case "Enum":
|
|
7173
|
+
for (const [, value] of ast.enums) addLiteral(value);
|
|
6825
7174
|
return;
|
|
6826
7175
|
case "Never": return;
|
|
6827
7176
|
case "Union":
|
|
@@ -6971,7 +7320,7 @@ function flipEncoding(ast, encoding) {
|
|
|
6971
7320
|
* **Details**
|
|
6972
7321
|
*
|
|
6973
7322
|
* After flipping, what was decoding becomes encoding and vice versa. This is
|
|
6974
|
-
* the core operation behind `Schema.
|
|
7323
|
+
* the core operation behind `Schema.encodeEffect` — encoding a value is decoding
|
|
6975
7324
|
* with a flipped SchemaAST.
|
|
6976
7325
|
*
|
|
6977
7326
|
* - Memoized: same input reference → same output reference.
|
|
@@ -6992,19 +7341,11 @@ const flip = /*#__PURE__*/ memoize((ast) => {
|
|
|
6992
7341
|
}
|
|
6993
7342
|
return "flip" in ast ? ast.flip(flip) : "recur" in ast ? ast.recur(flip) : ast;
|
|
6994
7343
|
});
|
|
6995
|
-
/** @internal */
|
|
6996
|
-
function containsUndefined(ast) {
|
|
6997
|
-
switch (ast._tag) {
|
|
6998
|
-
case "Undefined": return true;
|
|
6999
|
-
case "Union": return ast.types.some(containsUndefined);
|
|
7000
|
-
default: return false;
|
|
7001
|
-
}
|
|
7002
|
-
}
|
|
7003
7344
|
function fromConst(ast, value) {
|
|
7004
|
-
const succeed$
|
|
7345
|
+
const succeed$5 = value === 0 ? sameExit : succeed(value);
|
|
7005
7346
|
return (input, options) => {
|
|
7006
7347
|
if (input === missing) return missingExit;
|
|
7007
|
-
if (input === value) return succeed$
|
|
7348
|
+
if (input === value) return succeed$5;
|
|
7008
7349
|
return fail$2(new InvalidType(ast, input, options));
|
|
7009
7350
|
};
|
|
7010
7351
|
}
|
|
@@ -7168,7 +7509,7 @@ const resolveAt = resolveAt$1;
|
|
|
7168
7509
|
*
|
|
7169
7510
|
* **Details**
|
|
7170
7511
|
*
|
|
7171
|
-
* The identifier is typically set by `Schema.
|
|
7512
|
+
* The identifier is typically set by `Schema.annotate({ identifier: "..." })`
|
|
7172
7513
|
* and is used for error messages and schema identification.
|
|
7173
7514
|
*
|
|
7174
7515
|
* @see {@link resolve}
|
|
@@ -7282,9 +7623,19 @@ const unknownToStringTree = /*#__PURE__*/ new Link(/* @__PURE__ */ new Declarati
|
|
|
7282
7623
|
expected: "StringTree",
|
|
7283
7624
|
toCodecStringTree: () => void 0
|
|
7284
7625
|
}), /*#__PURE__*/ passthrough());
|
|
7285
|
-
// ../../node_modules/.pnpm/effect@4.
|
|
7626
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/schema/interpreter.js
|
|
7286
7627
|
const flatMapTransformation = (result, current, f) => result === sameExit ? f(current) : flatMapEager(result, f);
|
|
7287
7628
|
function compileTransformation(transformation) {
|
|
7629
|
+
const apply = compileTransformationUnsafe(transformation);
|
|
7630
|
+
return (result, current, options) => {
|
|
7631
|
+
try {
|
|
7632
|
+
return apply(result, current, options);
|
|
7633
|
+
} catch (error) {
|
|
7634
|
+
return die(error);
|
|
7635
|
+
}
|
|
7636
|
+
};
|
|
7637
|
+
}
|
|
7638
|
+
function compileTransformationUnsafe(transformation) {
|
|
7288
7639
|
if (transformation._tag === "Middleware") return (result, current, options) => {
|
|
7289
7640
|
const transformed = result === sameExit ? transformation.decode(succeed(toOption(current)), options) : transformation.decode(mapEager(result, toOption), options);
|
|
7290
7641
|
return fromOptionalEffect(transformed);
|
|
@@ -7350,40 +7701,44 @@ function compile(ast, compile, compileField, base, specialize) {
|
|
|
7350
7701
|
let encodingParsers;
|
|
7351
7702
|
const parseChecks = (input, options) => {
|
|
7352
7703
|
let result = parser(input, options);
|
|
7353
|
-
|
|
7354
|
-
if (
|
|
7355
|
-
if (result
|
|
7356
|
-
|
|
7357
|
-
|
|
7704
|
+
try {
|
|
7705
|
+
if (encodingChecks && !options.disableChecks) {
|
|
7706
|
+
if (effectIsExit(result)) {
|
|
7707
|
+
if (result._tag === "Success") {
|
|
7708
|
+
const output = result === sameExit ? input : result[args];
|
|
7709
|
+
if (input !== missing && output !== missing) {
|
|
7710
|
+
const issues = collectIssues(encodingChecks, input, void 0, ast, options);
|
|
7711
|
+
if (issues) result = fail$2(new Composite(ast, issues, input, options));
|
|
7712
|
+
}
|
|
7713
|
+
}
|
|
7714
|
+
} else result = flatMap(result, (value) => {
|
|
7715
|
+
if (input !== missing && value !== missing) {
|
|
7358
7716
|
const issues = collectIssues(encodingChecks, input, void 0, ast, options);
|
|
7359
|
-
if (issues)
|
|
7717
|
+
if (issues) return fail$2(new Composite(ast, issues, input, options));
|
|
7360
7718
|
}
|
|
7361
|
-
|
|
7362
|
-
|
|
7363
|
-
|
|
7364
|
-
|
|
7365
|
-
|
|
7366
|
-
|
|
7367
|
-
|
|
7368
|
-
|
|
7369
|
-
|
|
7370
|
-
|
|
7371
|
-
|
|
7372
|
-
|
|
7373
|
-
|
|
7374
|
-
|
|
7375
|
-
|
|
7376
|
-
|
|
7377
|
-
|
|
7378
|
-
|
|
7379
|
-
|
|
7380
|
-
|
|
7381
|
-
|
|
7382
|
-
|
|
7383
|
-
return succeed$3(value);
|
|
7384
|
-
});
|
|
7719
|
+
return succeed$3(value);
|
|
7720
|
+
});
|
|
7721
|
+
}
|
|
7722
|
+
if (checks && !options.disableChecks) {
|
|
7723
|
+
if (effectIsExit(result)) {
|
|
7724
|
+
if (result._tag === "Success") {
|
|
7725
|
+
const value = result === sameExit ? input : result[args];
|
|
7726
|
+
if (value === missing) return result;
|
|
7727
|
+
const issues = collectIssues(checks, value, void 0, ast, options);
|
|
7728
|
+
if (issues) result = fail$2(new Composite(ast, issues, value, options));
|
|
7729
|
+
}
|
|
7730
|
+
} else result = flatMap(result, (value) => {
|
|
7731
|
+
if (value !== missing) {
|
|
7732
|
+
const issues = collectIssues(checks, value, void 0, ast, options);
|
|
7733
|
+
if (issues) return fail$2(new Composite(ast, issues, value, options));
|
|
7734
|
+
}
|
|
7735
|
+
return succeed$3(value);
|
|
7736
|
+
});
|
|
7737
|
+
}
|
|
7738
|
+
return result;
|
|
7739
|
+
} catch (error) {
|
|
7740
|
+
return die(error);
|
|
7385
7741
|
}
|
|
7386
|
-
return result;
|
|
7387
7742
|
};
|
|
7388
7743
|
const parseLocal = specialize === void 0 ? parseChecks : specialize(parseChecks);
|
|
7389
7744
|
if (!links) return parseLocal;
|
|
@@ -7416,7 +7771,7 @@ function compile(ast, compile, compileField, base, specialize) {
|
|
|
7416
7771
|
});
|
|
7417
7772
|
};
|
|
7418
7773
|
}
|
|
7419
|
-
// ../../node_modules/.pnpm/effect@4.
|
|
7774
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/schema/compilerRegistry.js
|
|
7420
7775
|
/** @internal */
|
|
7421
7776
|
const invalid = /*#__PURE__*/ Symbol();
|
|
7422
7777
|
const cache = /*#__PURE__*/ new WeakMap();
|
|
@@ -7446,7 +7801,7 @@ function resolve(ast) {
|
|
|
7446
7801
|
cache.set(ast, entry);
|
|
7447
7802
|
return entry;
|
|
7448
7803
|
}
|
|
7449
|
-
// ../../node_modules/.pnpm/effect@4.
|
|
7804
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/SchemaParser.js
|
|
7450
7805
|
/**
|
|
7451
7806
|
* Runs schemas against real values.
|
|
7452
7807
|
*
|
|
@@ -7807,32 +8162,55 @@ function runSync(effect, message) {
|
|
|
7807
8162
|
const issue = getSchemaIssueOrThrow(exit.cause, message);
|
|
7808
8163
|
throw new Error("Schema validation failed", { cause: issue });
|
|
7809
8164
|
}
|
|
8165
|
+
const constructorDefectMessage = "Constructor adapter can only throw schema issues";
|
|
8166
|
+
function throwConstructorDefect(error) {
|
|
8167
|
+
throw new Error(constructorDefectMessage, { cause: die$1(error) });
|
|
8168
|
+
}
|
|
7810
8169
|
function makeConstructorSync(ast) {
|
|
7811
8170
|
let entry;
|
|
7812
|
-
|
|
7813
|
-
|
|
7814
|
-
|
|
7815
|
-
|
|
7816
|
-
|
|
7817
|
-
|
|
7818
|
-
|
|
7819
|
-
|
|
7820
|
-
|
|
7821
|
-
|
|
7822
|
-
|
|
7823
|
-
|
|
7824
|
-
|
|
7825
|
-
|
|
7826
|
-
throw error;
|
|
7827
|
-
}
|
|
7828
|
-
if (output !== invalid && output !== missing) return output;
|
|
8171
|
+
return (input, options) => constructSync(entry ??= resolve(ast), input, options);
|
|
8172
|
+
}
|
|
8173
|
+
function constructSync(entry, input, options) {
|
|
8174
|
+
const parseOptions = options?.disableChecks ? options.parseOptions ? {
|
|
8175
|
+
...options.parseOptions,
|
|
8176
|
+
disableChecks: true
|
|
8177
|
+
} : { disableChecks: true } : options?.parseOptions ?? defaultParseOptions;
|
|
8178
|
+
const make = entry.make;
|
|
8179
|
+
if (make !== void 0 && input !== missing) {
|
|
8180
|
+
let output;
|
|
8181
|
+
try {
|
|
8182
|
+
output = make(input, parseOptions);
|
|
8183
|
+
} catch (error) {
|
|
8184
|
+
throwConstructorDefect(error);
|
|
7829
8185
|
}
|
|
7830
|
-
|
|
7831
|
-
}
|
|
8186
|
+
if (output !== invalid && output !== missing) return output;
|
|
8187
|
+
}
|
|
8188
|
+
return runSync(parserResult(entry.makeEffect(input, parseOptions), input), constructorDefectMessage);
|
|
8189
|
+
}
|
|
8190
|
+
/**
|
|
8191
|
+
* Constructs a class instance from its type-side declaration.
|
|
8192
|
+
*
|
|
8193
|
+
* When the declaration has no compiled constructor, the fields are validated first
|
|
8194
|
+
* and the instance is built outside the parser, so stacks captured by the
|
|
8195
|
+
* class constructor keep the caller's frames.
|
|
8196
|
+
*
|
|
8197
|
+
* @internal
|
|
8198
|
+
*/
|
|
8199
|
+
function makeClassSync(ast, input, options, construct) {
|
|
8200
|
+
const entry = resolve(ast);
|
|
8201
|
+
const descriptor = getConstructorDescriptor(ast);
|
|
8202
|
+
if (descriptor === void 0 || entry.make !== void 0 || entry.compiledMakeEffect !== void 0) return constructSync(entry, input, options);
|
|
8203
|
+
if (descriptor.isConstructed(input)) return input;
|
|
8204
|
+
const fields = constructSync((entry.resolve ?? resolve)(descriptor.link.to), input, options);
|
|
8205
|
+
try {
|
|
8206
|
+
return construct(fields);
|
|
8207
|
+
} catch (error) {
|
|
8208
|
+
throwConstructorDefect(error);
|
|
8209
|
+
}
|
|
7832
8210
|
}
|
|
7833
8211
|
const normalCompiler = (ast) => resolve(ast).parser;
|
|
7834
8212
|
const constructorCompiler = (ast) => resolve(ast).makeEffect;
|
|
7835
|
-
// ../../node_modules/.pnpm/effect@4.
|
|
8213
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/schema/make.js
|
|
7836
8214
|
/** @internal */
|
|
7837
8215
|
const TypeId$3 = "~effect/Schema/Schema";
|
|
7838
8216
|
const RebuildOptions = /*#__PURE__*/ Symbol();
|
|
@@ -7888,7 +8266,32 @@ function make$1(ast, options) {
|
|
|
7888
8266
|
self.ast = ast;
|
|
7889
8267
|
return self;
|
|
7890
8268
|
}
|
|
7891
|
-
// ../../node_modules/.pnpm/effect@4.
|
|
8269
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/jsonSchema.js
|
|
8270
|
+
/** @internal */
|
|
8271
|
+
function getSubschemaKind(keyword) {
|
|
8272
|
+
switch (keyword) {
|
|
8273
|
+
case "$defs":
|
|
8274
|
+
case "properties":
|
|
8275
|
+
case "patternProperties":
|
|
8276
|
+
case "dependentSchemas": return "map";
|
|
8277
|
+
case "allOf":
|
|
8278
|
+
case "anyOf":
|
|
8279
|
+
case "oneOf":
|
|
8280
|
+
case "prefixItems": return "array";
|
|
8281
|
+
case "not":
|
|
8282
|
+
case "additionalProperties":
|
|
8283
|
+
case "propertyNames":
|
|
8284
|
+
case "unevaluatedProperties":
|
|
8285
|
+
case "items":
|
|
8286
|
+
case "contains":
|
|
8287
|
+
case "unevaluatedItems":
|
|
8288
|
+
case "if":
|
|
8289
|
+
case "then":
|
|
8290
|
+
case "else":
|
|
8291
|
+
case "contentSchema": return "schema";
|
|
8292
|
+
}
|
|
8293
|
+
}
|
|
8294
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/JsonPointer.js
|
|
7892
8295
|
/**
|
|
7893
8296
|
* Helpers for escaping JSON Pointer path segments and converting JSON Pointer
|
|
7894
8297
|
* URI fragments. JSON Pointer uses `/` to separate path tokens inside a JSON
|
|
@@ -8058,7 +8461,7 @@ function parseUriFragment(fragment) {
|
|
|
8058
8461
|
function formatUriFragment(path) {
|
|
8059
8462
|
return path.reduce((fragment, token) => `${fragment}/${formatUriFragmentToken(token)}`, "#");
|
|
8060
8463
|
}
|
|
8061
|
-
// ../../node_modules/.pnpm/effect@4.
|
|
8464
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/JsonSchema.js
|
|
8062
8465
|
/**
|
|
8063
8466
|
* Helpers for normalizing and converting JSON Schema and OpenAPI schema
|
|
8064
8467
|
* documents. Supported inputs include JSON Schema Draft-07, Draft 2020-12,
|
|
@@ -8129,6 +8532,18 @@ const OPEN_API_31_TARGET_COLLISIONS = [
|
|
|
8129
8532
|
* @since 4.0.0
|
|
8130
8533
|
*/
|
|
8131
8534
|
function toMultiDocumentOpenApi3_1(multiDocument) {
|
|
8535
|
+
return {
|
|
8536
|
+
dialect: "openapi-3.1",
|
|
8537
|
+
...toMultiDocumentComponents(multiDocument, {
|
|
8538
|
+
target: "OpenAPI 3.1",
|
|
8539
|
+
checkSchema(schema) {
|
|
8540
|
+
rejectKeywordCollisions(schema, OPEN_API_31_TARGET_COLLISIONS, "OpenAPI 3.1", "Draft 2020-12");
|
|
8541
|
+
}
|
|
8542
|
+
})
|
|
8543
|
+
};
|
|
8544
|
+
}
|
|
8545
|
+
/** @internal */
|
|
8546
|
+
function toMultiDocumentComponents(multiDocument, options) {
|
|
8132
8547
|
const definitionKeys = Object.keys(multiDocument.definitions);
|
|
8133
8548
|
const keyMap = /* @__PURE__ */ new Map();
|
|
8134
8549
|
const usedKeys = new Set(definitionKeys.filter((key) => VALID_OPEN_API_COMPONENTS_SCHEMAS_KEY_REGEXP.test(key)));
|
|
@@ -8152,13 +8567,13 @@ function toMultiDocumentOpenApi3_1(multiDocument) {
|
|
|
8152
8567
|
const isRootResource = createsResource(schema.$id);
|
|
8153
8568
|
const localDefinitions = isObject(schema.$defs) ? schema.$defs : void 0;
|
|
8154
8569
|
return transformSchema(schema, (schema, inEmbeddedResource) => {
|
|
8155
|
-
|
|
8570
|
+
options.checkSchema?.(schema);
|
|
8156
8571
|
rewriteSchemaRef(schema, (reference, keyword) => {
|
|
8157
8572
|
const path = reference.startsWith("#") ? parseUriFragment(reference) : void 0;
|
|
8158
8573
|
if (path === void 0 || path[0] !== "$defs" || path.length < 2) return reference;
|
|
8159
8574
|
const key = path[1];
|
|
8160
8575
|
if (isRootResource) {
|
|
8161
|
-
if (rejectSharedDefinitionRefs && !inEmbeddedResource && Object.hasOwn(multiDocument.definitions, key) && (localDefinitions === void 0 || !Object.hasOwn(localDefinitions, key))) unsupported(keyword,
|
|
8576
|
+
if (rejectSharedDefinitionRefs && !inEmbeddedResource && Object.hasOwn(multiDocument.definitions, key) && (localDefinitions === void 0 || !Object.hasOwn(localDefinitions, key))) unsupported(keyword, options.target, "a schema resource cannot reference the shared definitions pool");
|
|
8162
8577
|
return reference;
|
|
8163
8578
|
}
|
|
8164
8579
|
return inEmbeddedResource ? reference : formatUriFragment([
|
|
@@ -8174,7 +8589,6 @@ function toMultiDocumentOpenApi3_1(multiDocument) {
|
|
|
8174
8589
|
const definitions = {};
|
|
8175
8590
|
for (const key of definitionKeys) assignProperty(definitions, keyMap.get(key) ?? key, rewrite(multiDocument.definitions[key]));
|
|
8176
8591
|
return {
|
|
8177
|
-
dialect: "openapi-3.1",
|
|
8178
8592
|
schemas,
|
|
8179
8593
|
definitions
|
|
8180
8594
|
};
|
|
@@ -8204,30 +8618,14 @@ function transformSchema(node, transform) {
|
|
|
8204
8618
|
for (const key of Object.keys(node)) {
|
|
8205
8619
|
const value = node[key];
|
|
8206
8620
|
let transformed = value;
|
|
8207
|
-
switch (key) {
|
|
8208
|
-
case "
|
|
8209
|
-
case "properties":
|
|
8210
|
-
case "patternProperties":
|
|
8211
|
-
case "dependentSchemas":
|
|
8621
|
+
switch (getSubschemaKind(key)) {
|
|
8622
|
+
case "map":
|
|
8212
8623
|
transformed = mapObject(value, (value) => walk(value, inEmbeddedResource)) ?? value;
|
|
8213
8624
|
break;
|
|
8214
|
-
case "
|
|
8215
|
-
case "anyOf":
|
|
8216
|
-
case "oneOf":
|
|
8217
|
-
case "prefixItems":
|
|
8625
|
+
case "array":
|
|
8218
8626
|
transformed = Array.isArray(value) ? value.map((value) => walk(value, inEmbeddedResource)) : value;
|
|
8219
8627
|
break;
|
|
8220
|
-
case "
|
|
8221
|
-
case "additionalProperties":
|
|
8222
|
-
case "propertyNames":
|
|
8223
|
-
case "unevaluatedProperties":
|
|
8224
|
-
case "items":
|
|
8225
|
-
case "contains":
|
|
8226
|
-
case "unevaluatedItems":
|
|
8227
|
-
case "if":
|
|
8228
|
-
case "then":
|
|
8229
|
-
case "else":
|
|
8230
|
-
case "contentSchema": transformed = walk(value, inEmbeddedResource);
|
|
8628
|
+
case "schema": transformed = walk(value, inEmbeddedResource);
|
|
8231
8629
|
}
|
|
8232
8630
|
assignProperty(out, key, transformed);
|
|
8233
8631
|
}
|
|
@@ -8277,18 +8675,27 @@ function unsupported(keyword, dialect, details) {
|
|
|
8277
8675
|
function rejectKeywordCollisions(source, keywords, targetDialect, sourceDialect) {
|
|
8278
8676
|
for (const keyword of keywords) if (Object.hasOwn(source, keyword)) unsupported(keyword, targetDialect, `it is not active in ${sourceDialect} but would become active in the target`);
|
|
8279
8677
|
}
|
|
8280
|
-
// ../../node_modules/.pnpm/effect@4.
|
|
8678
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/schema/toCodec.js
|
|
8281
8679
|
/** @internal */
|
|
8282
8680
|
function toCodecJson$1(schema) {
|
|
8283
8681
|
return make$1(toCodecJsonAST(schema.ast), { schema });
|
|
8284
8682
|
}
|
|
8285
8683
|
/** @internal */
|
|
8286
|
-
const toCodecJsonAST = /*#__PURE__*/
|
|
8287
|
-
|
|
8288
|
-
const
|
|
8289
|
-
|
|
8290
|
-
|
|
8291
|
-
|
|
8684
|
+
const toCodecJsonAST = /*#__PURE__*/ makeCodecDerivation(toCodecJsonASTStep);
|
|
8685
|
+
function makeCodecDerivation(step, options) {
|
|
8686
|
+
const deriveBody = memoize((owner) => {
|
|
8687
|
+
const body = replaceContext(owner, void 0);
|
|
8688
|
+
const out = step(body, recur);
|
|
8689
|
+
return out === body ? null : out;
|
|
8690
|
+
});
|
|
8691
|
+
const recur = applyToSelfOrLastLinkEncodingIdempotent((ast) => {
|
|
8692
|
+
const derived = deriveBody(getContextOwner(ast));
|
|
8693
|
+
if (derived === null) return ast;
|
|
8694
|
+
const out = replaceContext(derived, ast.context);
|
|
8695
|
+
return ast.context === void 0 ? out : replaceContextLastLink(out, withoutConstructorDefault(ast.context));
|
|
8696
|
+
}, options);
|
|
8697
|
+
return recur;
|
|
8698
|
+
}
|
|
8292
8699
|
function withoutConstructorDefault(context) {
|
|
8293
8700
|
return context.constructorDefault === void 0 ? context : new Context(context.isOptional, context.isMutable, void 0, context.annotations);
|
|
8294
8701
|
}
|
|
@@ -8402,13 +8809,9 @@ const nullToString = /*#__PURE__*/ new Link(/*#__PURE__*/ new Literal$1("null"),
|
|
|
8402
8809
|
const booleanToString = /*#__PURE__*/ new Link(/*#__PURE__*/ new Union$1([/*#__PURE__*/ new Literal$1("true"), /*#__PURE__*/ new Literal$1("false")]), /*#__PURE__*/ new Transformation(/*#__PURE__*/ transform$1((s) => s === "true"), /*#__PURE__*/ String$3()));
|
|
8403
8810
|
const arrayFromSingleTransformation = /*#__PURE__*/ new Transformation(/*#__PURE__*/ transform$1((input) => typeof input === "string" ? [input] : input), /*#__PURE__*/ passthrough$1());
|
|
8404
8811
|
const isCodecArrayFromSingleLink = (link) => link.transformation === arrayFromSingleTransformation;
|
|
8405
|
-
const toCodecStringTreeAST = /*#__PURE__*/
|
|
8406
|
-
|
|
8407
|
-
|
|
8408
|
-
});
|
|
8409
|
-
if (out !== ast && ast.context !== void 0) return replaceContextLastLink(out, withoutConstructorDefault(ast.context));
|
|
8410
|
-
return out;
|
|
8411
|
-
}, { stopAt: isCodecArrayFromSingleLink });
|
|
8812
|
+
const toCodecStringTreeAST = /*#__PURE__*/ makeCodecDerivation((ast, recur) => toCodecStringTreeASTStep(ast, recur, (ast) => {
|
|
8813
|
+
throw new globalThis.Error("Missing structural codec for StringTree", { cause: ast });
|
|
8814
|
+
}), { stopAt: isCodecArrayFromSingleLink });
|
|
8412
8815
|
const toArrayFromSingleInputElement = (ast) => isOptional(ast) ? optionalKey$1(unknown) : unknown;
|
|
8413
8816
|
const toCodecArrayFromSingleAST = /*#__PURE__*/ applyToSelfOrLastLinkEncodingIdempotent((ast) => {
|
|
8414
8817
|
const out = toCodecArrayFromSingleASTStep(ast);
|
|
@@ -8442,13 +8845,13 @@ globalThis.RegExp;
|
|
|
8442
8845
|
* @since 2.0.0
|
|
8443
8846
|
*/
|
|
8444
8847
|
const escape = (string) => string.replace(/[/\\^$*+?.()|[\]{}]/g, "\\$&");
|
|
8445
|
-
// ../../node_modules/.pnpm/effect@4.
|
|
8848
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/errors.js
|
|
8446
8849
|
/** @internal */
|
|
8447
8850
|
function errorWithPath(message, path) {
|
|
8448
8851
|
if (path.length > 0) message += `\n at ${formatPath(path)}`;
|
|
8449
8852
|
return new Error(message);
|
|
8450
8853
|
}
|
|
8451
|
-
// ../../node_modules/.pnpm/effect@4.
|
|
8854
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/schema/toJsonSchemaDocument.js
|
|
8452
8855
|
function formatDefinitionReference(key) {
|
|
8453
8856
|
return `#/$defs/${formatUriFragmentToken(key)}`;
|
|
8454
8857
|
}
|
|
@@ -8460,26 +8863,26 @@ const jsonSchemaAnnotationExcludedKeys = /*#__PURE__*/ new Set([
|
|
|
8460
8863
|
function collectJsonSchemaAnnotations(annotations, options) {
|
|
8461
8864
|
if (annotations === void 0) return void 0;
|
|
8462
8865
|
const out = {};
|
|
8463
|
-
const
|
|
8464
|
-
|
|
8465
|
-
|
|
8866
|
+
for (const key of [
|
|
8867
|
+
"title",
|
|
8868
|
+
"description",
|
|
8869
|
+
"format",
|
|
8870
|
+
"contentEncoding",
|
|
8871
|
+
"contentMediaType"
|
|
8872
|
+
]) {
|
|
8873
|
+
const value = annotations[key];
|
|
8874
|
+
if (typeof value === "string") out[key] = value;
|
|
8875
|
+
}
|
|
8876
|
+
for (const key of ["readOnly", "writeOnly"]) {
|
|
8877
|
+
const value = annotations[key];
|
|
8878
|
+
if (typeof value === "boolean") out[key] = value;
|
|
8879
|
+
}
|
|
8466
8880
|
const expected = annotations.expected;
|
|
8467
|
-
if (typeof
|
|
8468
|
-
else if (options?.generateDescriptions === true && typeof expected === "string") out.description = expected;
|
|
8881
|
+
if (out.description === void 0 && options?.generateDescriptions === true && typeof expected === "string") out.description = expected;
|
|
8469
8882
|
const defaultValue = annotations.default;
|
|
8470
8883
|
if (isJson(defaultValue)) out.default = defaultValue;
|
|
8471
8884
|
const examples = annotations.examples;
|
|
8472
8885
|
if (Array.isArray(examples) && isJson(examples)) out.examples = examples;
|
|
8473
|
-
const readOnly = annotations.readOnly;
|
|
8474
|
-
if (typeof readOnly === "boolean") out.readOnly = readOnly;
|
|
8475
|
-
const writeOnly = annotations.writeOnly;
|
|
8476
|
-
if (typeof writeOnly === "boolean") out.writeOnly = writeOnly;
|
|
8477
|
-
const format = annotations.format;
|
|
8478
|
-
if (typeof format === "string") out.format = format;
|
|
8479
|
-
const contentEncoding = annotations.contentEncoding;
|
|
8480
|
-
if (typeof contentEncoding === "string") out.contentEncoding = contentEncoding;
|
|
8481
|
-
const contentMediaType = annotations.contentMediaType;
|
|
8482
|
-
if (typeof contentMediaType === "string") out.contentMediaType = contentMediaType;
|
|
8483
8886
|
const contentSchema = annotations.contentSchema;
|
|
8484
8887
|
if (isJson(contentSchema)) out.contentSchema = contentSchema;
|
|
8485
8888
|
if (options?.includeAnnotationKey !== void 0) for (const [key, value] of Object.entries(annotations)) {
|
|
@@ -8602,6 +9005,7 @@ function isApproximateCheckOutput(output) {
|
|
|
8602
9005
|
return Array.isArray(output);
|
|
8603
9006
|
}
|
|
8604
9007
|
function compileJsonSchema(representations, rootPaths, references, options) {
|
|
9008
|
+
const numberKeyPattern = `^(?:${FINITE_PATTERN}|Infinity|-Infinity|NaN)$`;
|
|
8605
9009
|
const compiledDefinitions = /* @__PURE__ */ new Map();
|
|
8606
9010
|
const definitionAliases = /* @__PURE__ */ new Map();
|
|
8607
9011
|
const compiledRepresentations = /* @__PURE__ */ new WeakMap();
|
|
@@ -8610,7 +9014,7 @@ function compileJsonSchema(representations, rootPaths, references, options) {
|
|
|
8610
9014
|
const referenceKeys = Object.keys(references);
|
|
8611
9015
|
for (const key of referenceKeys) compileDefinition(key, ["references", key]);
|
|
8612
9016
|
const compiledSchemas = map$5(representations, (representation, index) => recur(representation, rootPaths[index], []));
|
|
8613
|
-
for (const
|
|
9017
|
+
for (const { branches, schemas } of pendingOneOf.values()) if (!isExact(branches)) {
|
|
8614
9018
|
for (const schema of schemas) if (Array.isArray(schema.oneOf)) {
|
|
8615
9019
|
schema.anyOf = schema.oneOf;
|
|
8616
9020
|
delete schema.oneOf;
|
|
@@ -8620,9 +9024,9 @@ function compileJsonSchema(representations, rootPaths, references, options) {
|
|
|
8620
9024
|
const representation = references[key];
|
|
8621
9025
|
const fallback = getIdentifierFallback(representation);
|
|
8622
9026
|
if (fallback === void 0) continue;
|
|
8623
|
-
const schema = compiledDefinitions.get(key)
|
|
9027
|
+
const schema = compiledDefinitions.get(key).schema;
|
|
8624
9028
|
const candidates = fallbackDefinitions.get(fallback);
|
|
8625
|
-
const match = candidates?.find((candidate) => equals(compiledDefinitions.get(candidate)
|
|
9029
|
+
const match = candidates?.find((candidate) => equals(compiledDefinitions.get(candidate).schema, schema));
|
|
8626
9030
|
if (match === void 0) {
|
|
8627
9031
|
if (candidates === void 0) fallbackDefinitions.set(fallback, [key]);
|
|
8628
9032
|
else candidates.push(key);
|
|
@@ -8630,23 +9034,31 @@ function compileJsonSchema(representations, rootPaths, references, options) {
|
|
|
8630
9034
|
}
|
|
8631
9035
|
const schemas = map$5(compiledSchemas, finalizeJsonSchema);
|
|
8632
9036
|
const definitions = {};
|
|
8633
|
-
for (const key of referenceKeys) if (!definitionAliases.has(key)) assignProperty(definitions, key, finalizeJsonSchema(compiledDefinitions.get(key)
|
|
9037
|
+
for (const key of referenceKeys) if (!definitionAliases.has(key)) assignProperty(definitions, key, finalizeJsonSchema(compiledDefinitions.get(key).schema));
|
|
8634
9038
|
return {
|
|
8635
9039
|
dialect: "draft-2020-12",
|
|
8636
9040
|
schemas,
|
|
8637
9041
|
definitions
|
|
8638
9042
|
};
|
|
8639
9043
|
function registerPendingOneOf(schema) {
|
|
8640
|
-
if (Array.isArray(schema.oneOf)) pendingOneOf.get(schema.oneOf)?.
|
|
9044
|
+
if (Array.isArray(schema.oneOf)) pendingOneOf.get(schema.oneOf)?.schemas.push(schema);
|
|
8641
9045
|
return schema;
|
|
8642
9046
|
}
|
|
9047
|
+
function compileAnnotatedMember(member, path, dependencies) {
|
|
9048
|
+
const schema = recur(member.type, [...path, "type"], dependencies);
|
|
9049
|
+
const annotations = collectJsonSchemaAnnotations(member.annotations, options);
|
|
9050
|
+
return annotations === void 0 ? schema : registerPendingOneOf(appendJsonSchema(schema, annotations));
|
|
9051
|
+
}
|
|
8643
9052
|
function compileDefinition(key, path) {
|
|
8644
9053
|
if (!Object.hasOwn(references, key)) throw errorWithPath(`Invalid reference ${key}`, [...path, "$ref"]);
|
|
8645
9054
|
const cached = compiledDefinitions.get(key);
|
|
8646
9055
|
if (cached !== void 0) return cached;
|
|
8647
|
-
const result =
|
|
9056
|
+
const result = {
|
|
9057
|
+
schema: {},
|
|
9058
|
+
dependencies: []
|
|
9059
|
+
};
|
|
8648
9060
|
compiledDefinitions.set(key, result);
|
|
8649
|
-
result
|
|
9061
|
+
result.schema = recur(references[key], ["references", key], result.dependencies);
|
|
8650
9062
|
return result;
|
|
8651
9063
|
}
|
|
8652
9064
|
function finalizeJsonSchema(schema) {
|
|
@@ -8714,22 +9126,30 @@ function compileJsonSchema(representations, rootPaths, references, options) {
|
|
|
8714
9126
|
}
|
|
8715
9127
|
function recur(representation, path, dependencies) {
|
|
8716
9128
|
if (representation._tag === "Reference") {
|
|
8717
|
-
dependencies.push(compileDefinition(representation.$ref, path)
|
|
9129
|
+
dependencies.push(compileDefinition(representation.$ref, path).dependencies);
|
|
8718
9130
|
return { $ref: formatDefinitionReference(representation.$ref) };
|
|
8719
9131
|
}
|
|
8720
9132
|
const cached = compiledRepresentations.get(representation);
|
|
8721
9133
|
if (cached !== void 0) {
|
|
8722
|
-
dependencies.push(cached
|
|
8723
|
-
return cached
|
|
9134
|
+
dependencies.push(cached.dependencies);
|
|
9135
|
+
return cached.schema;
|
|
8724
9136
|
}
|
|
8725
9137
|
const local = [];
|
|
8726
9138
|
dependencies.push(local);
|
|
8727
|
-
let output =
|
|
8728
|
-
|
|
8729
|
-
|
|
8730
|
-
...output,
|
|
8731
|
-
...ordinary
|
|
9139
|
+
let output = {
|
|
9140
|
+
...on(representation, path, local),
|
|
9141
|
+
...collectJsonSchemaAnnotations(representation.annotations, options)
|
|
8732
9142
|
};
|
|
9143
|
+
if (representation._tag === "String" && representation.content !== void 0) {
|
|
9144
|
+
const content = representation.content;
|
|
9145
|
+
output.contentMediaType = content.mediaType;
|
|
9146
|
+
delete output.contentSchema;
|
|
9147
|
+
if (content.schema !== void 0) output.contentSchema = recur(content.schema, [
|
|
9148
|
+
...path,
|
|
9149
|
+
"content",
|
|
9150
|
+
"schema"
|
|
9151
|
+
], []);
|
|
9152
|
+
}
|
|
8733
9153
|
for (let index = 0; index < representation.checks.length; index++) {
|
|
8734
9154
|
const type = typeof output.type === "string" && isJsonSchemaType(output.type) ? output.type : void 0;
|
|
8735
9155
|
const check = compileCheck(representation.checks[index], type, [
|
|
@@ -8739,7 +9159,10 @@ function compileJsonSchema(representations, rootPaths, references, options) {
|
|
|
8739
9159
|
], local);
|
|
8740
9160
|
if (check !== void 0) output = appendJsonSchema(output, ...check);
|
|
8741
9161
|
}
|
|
8742
|
-
compiledRepresentations.set(representation,
|
|
9162
|
+
compiledRepresentations.set(representation, {
|
|
9163
|
+
schema: output,
|
|
9164
|
+
dependencies: local
|
|
9165
|
+
});
|
|
8743
9166
|
return registerPendingOneOf(output);
|
|
8744
9167
|
}
|
|
8745
9168
|
function on(representation, path, dependencies) {
|
|
@@ -8788,39 +9211,31 @@ function compileJsonSchema(representations, rootPaths, references, options) {
|
|
|
8788
9211
|
};
|
|
8789
9212
|
}
|
|
8790
9213
|
case "Enum": {
|
|
8791
|
-
const types = representation.enums.map(([title, literal]
|
|
8792
|
-
|
|
8793
|
-
|
|
8794
|
-
|
|
8795
|
-
|
|
8796
|
-
1
|
|
8797
|
-
]);
|
|
8798
|
-
return {
|
|
8799
|
-
type: typeof literal,
|
|
8800
|
-
enum: [literal],
|
|
8801
|
-
title
|
|
8802
|
-
};
|
|
8803
|
-
});
|
|
9214
|
+
const types = representation.enums.map(([title, literal]) => ({
|
|
9215
|
+
type: typeof literal,
|
|
9216
|
+
enum: [literal],
|
|
9217
|
+
title
|
|
9218
|
+
}));
|
|
8804
9219
|
return types.length === 0 ? { not: {} } : { anyOf: types };
|
|
8805
9220
|
}
|
|
8806
|
-
case "TemplateLiteral":
|
|
8807
|
-
|
|
8808
|
-
|
|
8809
|
-
|
|
9221
|
+
case "TemplateLiteral": {
|
|
9222
|
+
const { exact, pattern } = getTemplateLiteralPattern(representation.parts);
|
|
9223
|
+
if (!exact) dependencies.push(false);
|
|
9224
|
+
return {
|
|
9225
|
+
type: "string",
|
|
9226
|
+
pattern
|
|
9227
|
+
};
|
|
9228
|
+
}
|
|
8810
9229
|
case "Arrays": {
|
|
8811
|
-
if (representation.rest.length > 1) throw errorWithPath("Invalid schema representation document", [...path, "rest"]);
|
|
8812
9230
|
const out = { type: "array" };
|
|
8813
9231
|
let minItems = representation.elements.length;
|
|
8814
9232
|
const prefixItems = representation.elements.map((element, index) => {
|
|
8815
9233
|
if (element.isOptional) minItems--;
|
|
8816
|
-
|
|
9234
|
+
return compileAnnotatedMember(element, [
|
|
8817
9235
|
...path,
|
|
8818
9236
|
"elements",
|
|
8819
|
-
index
|
|
8820
|
-
"type"
|
|
9237
|
+
index
|
|
8821
9238
|
], dependencies);
|
|
8822
|
-
const annotations = collectJsonSchemaAnnotations(element.annotations, options);
|
|
8823
|
-
return annotations === void 0 ? schema : registerPendingOneOf(appendJsonSchema(schema, annotations));
|
|
8824
9239
|
});
|
|
8825
9240
|
if (prefixItems.length > 0) {
|
|
8826
9241
|
out.prefixItems = prefixItems;
|
|
@@ -8836,92 +9251,15 @@ function compileJsonSchema(representations, rootPaths, references, options) {
|
|
|
8836
9251
|
], dependencies);
|
|
8837
9252
|
if (Object.keys(rest).length > 0) out.items = rest;
|
|
8838
9253
|
else delete out.items;
|
|
9254
|
+
} else if (representation.rest.length > 1) {
|
|
9255
|
+
delete out.maxItems;
|
|
9256
|
+
delete out.items;
|
|
9257
|
+
out.minItems = minItems + representation.rest.length - 1;
|
|
9258
|
+
dependencies.push(false);
|
|
8839
9259
|
}
|
|
8840
9260
|
return out;
|
|
8841
9261
|
}
|
|
8842
|
-
case "Objects":
|
|
8843
|
-
if (representation.propertySignatures.length === 0 && representation.indexSignatures.length === 0) return { not: { type: "null" } };
|
|
8844
|
-
const out = { type: "object" };
|
|
8845
|
-
const properties = {};
|
|
8846
|
-
const required = [];
|
|
8847
|
-
for (let index = 0; index < representation.propertySignatures.length; index++) {
|
|
8848
|
-
const property = representation.propertySignatures[index];
|
|
8849
|
-
if (typeof property.name !== "string") throw errorWithPath("Invalid schema representation document", [
|
|
8850
|
-
...path,
|
|
8851
|
-
"propertySignatures",
|
|
8852
|
-
index,
|
|
8853
|
-
"name"
|
|
8854
|
-
]);
|
|
8855
|
-
const name = property.name;
|
|
8856
|
-
const schema = recur(property.type, [
|
|
8857
|
-
...path,
|
|
8858
|
-
"propertySignatures",
|
|
8859
|
-
index,
|
|
8860
|
-
"type"
|
|
8861
|
-
], dependencies);
|
|
8862
|
-
const annotations = collectJsonSchemaAnnotations(property.annotations, options);
|
|
8863
|
-
assignProperty(properties, name, annotations === void 0 ? schema : registerPendingOneOf(appendJsonSchema(schema, annotations)));
|
|
8864
|
-
if (!property.isOptional) required.push(name);
|
|
8865
|
-
}
|
|
8866
|
-
if (representation.propertySignatures.length > 0) out.properties = properties;
|
|
8867
|
-
if (required.length > 0) out.required = required;
|
|
8868
|
-
const patternProperties = {};
|
|
8869
|
-
const additionalPropertySchemas = [];
|
|
8870
|
-
const indexValueSchemas = [];
|
|
8871
|
-
let hasUnrepresentableIndexPattern = false;
|
|
8872
|
-
for (let index = 0; index < representation.indexSignatures.length; index++) {
|
|
8873
|
-
const signature = representation.indexSignatures[index];
|
|
8874
|
-
let type = recur(signature.type, [
|
|
8875
|
-
...path,
|
|
8876
|
-
"indexSignatures",
|
|
8877
|
-
index,
|
|
8878
|
-
"type"
|
|
8879
|
-
], dependencies);
|
|
8880
|
-
if (equals(type, { not: {} })) type = false;
|
|
8881
|
-
indexValueSchemas.push(type);
|
|
8882
|
-
const patterns = getParameterPatterns(signature.parameter, [
|
|
8883
|
-
...path,
|
|
8884
|
-
"indexSignatures",
|
|
8885
|
-
index,
|
|
8886
|
-
"parameter"
|
|
8887
|
-
], /* @__PURE__ */ new Set());
|
|
8888
|
-
if (patterns === void 0) {
|
|
8889
|
-
hasUnrepresentableIndexPattern = true;
|
|
8890
|
-
dependencies.push(false);
|
|
8891
|
-
continue;
|
|
8892
|
-
}
|
|
8893
|
-
if (patterns.length === 0) additionalPropertySchemas.push(type);
|
|
8894
|
-
else for (const pattern of patterns) {
|
|
8895
|
-
const previous = patternProperties[pattern];
|
|
8896
|
-
assignProperty(patternProperties, pattern, previous === void 0 ? type : previous === false || type === false ? false : registerPendingOneOf(appendJsonSchema(previous, type)));
|
|
8897
|
-
}
|
|
8898
|
-
}
|
|
8899
|
-
const hasPatternProperties = Object.keys(patternProperties).length > 0;
|
|
8900
|
-
if (hasPatternProperties) out.patternProperties = patternProperties;
|
|
8901
|
-
if (hasUnrepresentableIndexPattern && options?.onExcessProperty === "error") {
|
|
8902
|
-
const propertyNames = [];
|
|
8903
|
-
if (representation.propertySignatures.length > 0) propertyNames.push({ enum: Object.keys(properties) });
|
|
8904
|
-
for (let index = 0; index < representation.indexSignatures.length; index++) propertyNames.push(recur(representation.indexSignatures[index].parameter, [
|
|
8905
|
-
...path,
|
|
8906
|
-
"indexSignatures",
|
|
8907
|
-
index,
|
|
8908
|
-
"parameter"
|
|
8909
|
-
], dependencies));
|
|
8910
|
-
out.propertyNames = propertyNames.length === 1 ? propertyNames[0] : { anyOf: propertyNames };
|
|
8911
|
-
out.additionalProperties = indexValueSchemas.length === 1 ? indexValueSchemas[0] : { anyOf: indexValueSchemas };
|
|
8912
|
-
if (additionalPropertySchemas.length > 0) out.allOf = additionalPropertySchemas.map((type) => ({
|
|
8913
|
-
type: "object",
|
|
8914
|
-
additionalProperties: type
|
|
8915
|
-
}));
|
|
8916
|
-
} else if (additionalPropertySchemas.length === 0) out.additionalProperties = hasUnrepresentableIndexPattern || options?.onExcessProperty !== "error";
|
|
8917
|
-
else if (additionalPropertySchemas.length === 1 && representation.propertySignatures.length === 0 && !hasPatternProperties) out.additionalProperties = additionalPropertySchemas[0];
|
|
8918
|
-
else if (additionalPropertySchemas.length > 0) out.allOf = additionalPropertySchemas.map((type) => ({
|
|
8919
|
-
type: "object",
|
|
8920
|
-
additionalProperties: type
|
|
8921
|
-
}));
|
|
8922
|
-
if (typeof out.additionalProperties === "object" && out.additionalProperties !== null && Object.keys(out.additionalProperties).length === 0) delete out.additionalProperties;
|
|
8923
|
-
return out;
|
|
8924
|
-
}
|
|
9262
|
+
case "Objects": return compileObjects(representation, path, dependencies);
|
|
8925
9263
|
case "Union": {
|
|
8926
9264
|
const branches = [];
|
|
8927
9265
|
const types = representation.types.map((type, index) => recur(type, [
|
|
@@ -8931,20 +9269,104 @@ function compileJsonSchema(representations, rootPaths, references, options) {
|
|
|
8931
9269
|
], branches));
|
|
8932
9270
|
dependencies.push(branches);
|
|
8933
9271
|
if (types.length === 0) return { not: {} };
|
|
8934
|
-
|
|
8935
|
-
|
|
9272
|
+
if (representation.options?.mode === "oneOf") {
|
|
9273
|
+
pendingOneOf.set(types, {
|
|
9274
|
+
branches,
|
|
9275
|
+
schemas: []
|
|
9276
|
+
});
|
|
9277
|
+
return { oneOf: types };
|
|
9278
|
+
}
|
|
9279
|
+
if (types.length > 1) {
|
|
8936
9280
|
const compacted = compactEnums(types);
|
|
8937
9281
|
if (compacted !== void 0) return compacted;
|
|
8938
9282
|
}
|
|
8939
|
-
|
|
8940
|
-
return { [mode]: types };
|
|
9283
|
+
return { anyOf: types.flatMap((type) => Array.isArray(type.anyOf) && Object.keys(type).length === 1 ? type.anyOf : [type]) };
|
|
8941
9284
|
}
|
|
8942
9285
|
}
|
|
8943
9286
|
}
|
|
9287
|
+
function compileObjects(representation, path, dependencies) {
|
|
9288
|
+
const { indexSignatures, propertySignatures } = representation;
|
|
9289
|
+
if (propertySignatures.length === 0 && indexSignatures.length === 0) return { not: { type: "null" } };
|
|
9290
|
+
const out = { type: "object" };
|
|
9291
|
+
const properties = {};
|
|
9292
|
+
const required = [];
|
|
9293
|
+
for (const [index, property] of propertySignatures.entries()) {
|
|
9294
|
+
const propertyPath = [
|
|
9295
|
+
...path,
|
|
9296
|
+
"propertySignatures",
|
|
9297
|
+
index
|
|
9298
|
+
];
|
|
9299
|
+
if (typeof property.name !== "string") throw errorWithPath("Objects property names must be strings", [...propertyPath, "name"]);
|
|
9300
|
+
assignProperty(properties, property.name, compileAnnotatedMember(property, propertyPath, dependencies));
|
|
9301
|
+
if (!property.isOptional) required.push(property.name);
|
|
9302
|
+
}
|
|
9303
|
+
if (propertySignatures.length > 0) out.properties = properties;
|
|
9304
|
+
if (required.length > 0) out.required = required;
|
|
9305
|
+
const indexes = indexSignatures.map((signature, index) => {
|
|
9306
|
+
const indexPath = [
|
|
9307
|
+
...path,
|
|
9308
|
+
"indexSignatures",
|
|
9309
|
+
index
|
|
9310
|
+
];
|
|
9311
|
+
const schema = recur(signature.type, [...indexPath, "type"], dependencies);
|
|
9312
|
+
const type = equals(schema, { not: {} }) ? false : schema;
|
|
9313
|
+
const patterns = getParameterPatterns(signature.parameter, [...indexPath, "parameter"], /* @__PURE__ */ new Set());
|
|
9314
|
+
if (patterns === void 0) dependencies.push(false);
|
|
9315
|
+
return {
|
|
9316
|
+
type,
|
|
9317
|
+
patterns
|
|
9318
|
+
};
|
|
9319
|
+
});
|
|
9320
|
+
const patternProperties = {};
|
|
9321
|
+
for (const { patterns, type } of indexes) for (const pattern of patterns ?? []) {
|
|
9322
|
+
const previous = patternProperties[pattern];
|
|
9323
|
+
assignProperty(patternProperties, pattern, previous === void 0 ? type : previous === false || type === false ? false : registerPendingOneOf(appendJsonSchema(previous, type)));
|
|
9324
|
+
}
|
|
9325
|
+
const hasPatternProperties = Object.keys(patternProperties).length > 0;
|
|
9326
|
+
if (hasPatternProperties) out.patternProperties = patternProperties;
|
|
9327
|
+
const additionalPropertySchemas = indexes.filter(({ patterns }) => patterns?.length === 0).map(({ type }) => type);
|
|
9328
|
+
const hasUnrepresentableIndexPattern = indexes.some(({ patterns }) => patterns === void 0);
|
|
9329
|
+
if (hasUnrepresentableIndexPattern && options?.onExcessProperty === "error") {
|
|
9330
|
+
const propertyNames = [];
|
|
9331
|
+
if (propertySignatures.length > 0) propertyNames.push({ enum: Object.keys(properties) });
|
|
9332
|
+
for (const [index, signature] of indexSignatures.entries()) propertyNames.push(getPropertyNameSchema(signature.parameter, [
|
|
9333
|
+
...path,
|
|
9334
|
+
"indexSignatures",
|
|
9335
|
+
index,
|
|
9336
|
+
"parameter"
|
|
9337
|
+
], dependencies, /* @__PURE__ */ new Set()));
|
|
9338
|
+
out.propertyNames = propertyNames.length === 1 ? propertyNames[0] : { anyOf: propertyNames };
|
|
9339
|
+
const values = indexes.map(({ type }) => type);
|
|
9340
|
+
out.additionalProperties = values.length === 1 ? values[0] : { anyOf: values };
|
|
9341
|
+
if (additionalPropertySchemas.length > 0) out.allOf = additionalPropertySchemas.map((type) => ({
|
|
9342
|
+
type: "object",
|
|
9343
|
+
additionalProperties: type
|
|
9344
|
+
}));
|
|
9345
|
+
} else if (additionalPropertySchemas.length === 0) out.additionalProperties = hasUnrepresentableIndexPattern || options?.onExcessProperty !== "error";
|
|
9346
|
+
else if (additionalPropertySchemas.length === 1 && propertySignatures.length === 0 && !hasPatternProperties) out.additionalProperties = additionalPropertySchemas[0];
|
|
9347
|
+
else out.allOf = additionalPropertySchemas.map((type) => ({
|
|
9348
|
+
type: "object",
|
|
9349
|
+
additionalProperties: type
|
|
9350
|
+
}));
|
|
9351
|
+
if (typeof out.additionalProperties === "object" && out.additionalProperties !== null && Object.keys(out.additionalProperties).length === 0) delete out.additionalProperties;
|
|
9352
|
+
return out;
|
|
9353
|
+
}
|
|
9354
|
+
function getPropertyNameSchema(parameter, path, dependencies, seenReferences) {
|
|
9355
|
+
switch (parameter._tag) {
|
|
9356
|
+
case "Number": return {
|
|
9357
|
+
type: "string",
|
|
9358
|
+
pattern: numberKeyPattern
|
|
9359
|
+
};
|
|
9360
|
+
case "Reference":
|
|
9361
|
+
if (seenReferences.has(parameter.$ref)) return { type: "string" };
|
|
9362
|
+
return getPropertyNameSchema(references[parameter.$ref], ["references", parameter.$ref], dependencies, new Set(seenReferences).add(parameter.$ref));
|
|
9363
|
+
case "Union": return { anyOf: parameter.types.map((type) => getPropertyNameSchema(type, path, dependencies, seenReferences)) };
|
|
9364
|
+
default: return recur(parameter, path, dependencies);
|
|
9365
|
+
}
|
|
9366
|
+
}
|
|
8944
9367
|
function getParameterPatterns(parameter, path, seenReferences) {
|
|
8945
9368
|
switch (parameter._tag) {
|
|
8946
9369
|
case "Reference": {
|
|
8947
|
-
if (!Object.hasOwn(references, parameter.$ref)) throw errorWithPath(`Invalid reference ${parameter.$ref}`, [...path, "$ref"]);
|
|
8948
9370
|
compileDefinition(parameter.$ref, path);
|
|
8949
9371
|
if (seenReferences.has(parameter.$ref)) return void 0;
|
|
8950
9372
|
const next = new Set(seenReferences).add(parameter.$ref);
|
|
@@ -8958,7 +9380,11 @@ function compileJsonSchema(representations, rootPaths, references, options) {
|
|
|
8958
9380
|
if (!isExact(dependencies)) return void 0;
|
|
8959
9381
|
return schema.type === "string" && typeof schema.pattern === "string" && hasOnlyKeywords(schema, "|type|pattern|title|description|default|examples|readOnly|writeOnly|") ? [schema.pattern] : void 0;
|
|
8960
9382
|
}
|
|
8961
|
-
case "TemplateLiteral":
|
|
9383
|
+
case "TemplateLiteral": {
|
|
9384
|
+
if (parameter.checks.length > 0) return void 0;
|
|
9385
|
+
const { exact, pattern } = getTemplateLiteralPattern(parameter.parts);
|
|
9386
|
+
return exact ? [pattern] : void 0;
|
|
9387
|
+
}
|
|
8962
9388
|
case "Union": {
|
|
8963
9389
|
if (parameter.types.length === 0 || parameter.checks.length > 0 || parameter.options?.mode === "oneOf") return;
|
|
8964
9390
|
const patterns = [];
|
|
@@ -8974,7 +9400,39 @@ function compileJsonSchema(representations, rootPaths, references, options) {
|
|
|
8974
9400
|
}
|
|
8975
9401
|
return patterns;
|
|
8976
9402
|
}
|
|
8977
|
-
|
|
9403
|
+
case "Number": return parameter.checks.length === 0 ? [numberKeyPattern] : void 0;
|
|
9404
|
+
default: throw errorWithPath(`Invalid index signature parameter ${parameter._tag}`, path);
|
|
9405
|
+
}
|
|
9406
|
+
}
|
|
9407
|
+
function getTemplateLiteralPattern(parts) {
|
|
9408
|
+
const activeReferences = /* @__PURE__ */ new Set();
|
|
9409
|
+
let exact = true;
|
|
9410
|
+
return {
|
|
9411
|
+
pattern: `^${parts.map(getPartPattern).join("")}$`,
|
|
9412
|
+
exact
|
|
9413
|
+
};
|
|
9414
|
+
function getPartPattern(part) {
|
|
9415
|
+
if (part._tag !== "Reference" && part.checks.length > 0) exact = false;
|
|
9416
|
+
switch (part._tag) {
|
|
9417
|
+
case "Reference": {
|
|
9418
|
+
if (!Object.hasOwn(references, part.$ref)) throw errorWithPath(`Invalid reference ${part.$ref}`, []);
|
|
9419
|
+
if (activeReferences.has(part.$ref)) throw errorWithPath(`Invalid recursive TemplateLiteral part ${part.$ref}`, []);
|
|
9420
|
+
activeReferences.add(part.$ref);
|
|
9421
|
+
const pattern = getPartPattern(references[part.$ref]);
|
|
9422
|
+
activeReferences.delete(part.$ref);
|
|
9423
|
+
return pattern;
|
|
9424
|
+
}
|
|
9425
|
+
case "Literal": return escape(globalThis.String(part.literal));
|
|
9426
|
+
case "String": return STRING_PATTERN;
|
|
9427
|
+
case "Number": return FINITE_PATTERN;
|
|
9428
|
+
case "BigInt": return "-?\\d+";
|
|
9429
|
+
case "TemplateLiteral": return part.parts.map(getPartPattern).join("");
|
|
9430
|
+
case "Union":
|
|
9431
|
+
if (part.types.length === 0) return "(?!)";
|
|
9432
|
+
if (part.options?.mode === "oneOf") exact = false;
|
|
9433
|
+
return `(?:${part.types.map(getPartPattern).join("|")})`;
|
|
9434
|
+
default: throw errorWithPath(`Invalid TemplateLiteral part ${part._tag}`, []);
|
|
9435
|
+
}
|
|
8978
9436
|
}
|
|
8979
9437
|
}
|
|
8980
9438
|
}
|
|
@@ -8998,16 +9456,6 @@ function compactEnums(schemas) {
|
|
|
8998
9456
|
enum: values
|
|
8999
9457
|
};
|
|
9000
9458
|
}
|
|
9001
|
-
function getPartPattern(part) {
|
|
9002
|
-
switch (part._tag) {
|
|
9003
|
-
case "Literal": return escape(globalThis.String(part.literal));
|
|
9004
|
-
case "String": return STRING_PATTERN;
|
|
9005
|
-
case "Number": return FINITE_PATTERN;
|
|
9006
|
-
case "TemplateLiteral": return part.parts.map(getPartPattern).join("");
|
|
9007
|
-
case "Union": return `(?:${part.types.map(getPartPattern).join("|")})`;
|
|
9008
|
-
default: throw errorWithPath("Invalid schema representation document", []);
|
|
9009
|
-
}
|
|
9010
|
-
}
|
|
9011
9459
|
/** @internal */
|
|
9012
9460
|
function toJsonSchemaDocument$1(document, options) {
|
|
9013
9461
|
const output = compileJsonSchema([document.representation], [["representation"]], document.references, options);
|
|
@@ -9021,7 +9469,7 @@ function toJsonSchemaDocument$1(document, options) {
|
|
|
9021
9469
|
function toJsonSchemaMultiDocument(document, options) {
|
|
9022
9470
|
return compileJsonSchema(document.representations, document.representations.map((_, index) => ["representations", index]), document.references, options);
|
|
9023
9471
|
}
|
|
9024
|
-
// ../../node_modules/.pnpm/effect@4.
|
|
9472
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/schema/toRepresentation.js
|
|
9025
9473
|
const defaultReferencePolicy = ({ identifier }) => identifier;
|
|
9026
9474
|
function annotationsField(annotations) {
|
|
9027
9475
|
return annotations === void 0 ? void 0 : { annotations };
|
|
@@ -9037,33 +9485,28 @@ function toRepresentation(ast, options) {
|
|
|
9037
9485
|
/** @internal */
|
|
9038
9486
|
function toRepresentations(asts, options) {
|
|
9039
9487
|
const references = {};
|
|
9040
|
-
const
|
|
9041
|
-
const buildingReferences = /* @__PURE__ */ new Set();
|
|
9488
|
+
const usedReferences = /* @__PURE__ */ new Set();
|
|
9042
9489
|
const candidates = /* @__PURE__ */ new Map();
|
|
9043
|
-
const visitingCandidates = /* @__PURE__ */ new Set();
|
|
9044
9490
|
for (const ast of asts) visit(ast);
|
|
9045
9491
|
const referencePolicy = options?.referencePolicy ?? defaultReferencePolicy;
|
|
9046
|
-
for (const
|
|
9492
|
+
for (const variants of candidates.values()) for (const candidate of variants) {
|
|
9047
9493
|
const requestedReference = referencePolicy({
|
|
9048
9494
|
ast: candidate.ast,
|
|
9049
9495
|
occurrences: candidate.occurrences,
|
|
9050
9496
|
identifier: candidate.identifier
|
|
9051
9497
|
});
|
|
9052
|
-
if (requestedReference !== void 0) candidate.reference = getReference(requestedReference,
|
|
9053
|
-
else if (candidate.isRecursive) candidate.reference = getReference(`${candidate.ast._tag}_`,
|
|
9498
|
+
if (requestedReference !== void 0) candidate.reference = getReference(requestedReference, requestedReference === candidate.identifier || !requestedReference.endsWith("_") ? "_" : "");
|
|
9499
|
+
else if (candidate.isRecursive) candidate.reference = getReference(`${candidate.ast._tag}_`, "");
|
|
9054
9500
|
}
|
|
9055
9501
|
return {
|
|
9056
|
-
representations: map$5(asts,
|
|
9502
|
+
representations: map$5(asts, recur),
|
|
9057
9503
|
references
|
|
9058
9504
|
};
|
|
9059
|
-
function getReference(prefix,
|
|
9505
|
+
function getReference(prefix, separator) {
|
|
9060
9506
|
let candidate = prefix;
|
|
9061
9507
|
let suffix = 0;
|
|
9062
|
-
while (
|
|
9063
|
-
|
|
9064
|
-
candidate = `${prefix}${separator}${++suffix}`;
|
|
9065
|
-
}
|
|
9066
|
-
referenceOwners.set(candidate, owner);
|
|
9508
|
+
while (usedReferences.has(candidate)) candidate = `${prefix}${separator}${++suffix}`;
|
|
9509
|
+
usedReferences.add(candidate);
|
|
9067
9510
|
return candidate;
|
|
9068
9511
|
}
|
|
9069
9512
|
function annotateReference(ast, candidate, reference) {
|
|
@@ -9071,70 +9514,68 @@ function toRepresentations(asts, options) {
|
|
|
9071
9514
|
if (fallback !== void 0) return resolveIdentifierFallback(ast) === fallback ? ast : annotate$1(ast, { [IDENTIFIER_FALLBACK_KEY]: fallback });
|
|
9072
9515
|
return reference === candidate.identifier ? ast : annotate$1(ast, { identifier: reference });
|
|
9073
9516
|
}
|
|
9074
|
-
function
|
|
9075
|
-
|
|
9076
|
-
|
|
9077
|
-
|
|
9078
|
-
|
|
9079
|
-
|
|
9517
|
+
function getCandidate(input, encodingLength = input.encoding?.length ?? 0) {
|
|
9518
|
+
let ast = input;
|
|
9519
|
+
let content;
|
|
9520
|
+
while (ast.encoding !== void 0 && encodingLength > 0) {
|
|
9521
|
+
const last = ast.encoding[encodingLength - 1];
|
|
9522
|
+
if (last.to.encoding === void 0 && last.to._tag === "String") {
|
|
9523
|
+
const metadata = getContent(last.transformation.encode);
|
|
9524
|
+
if (metadata !== void 0) content = {
|
|
9525
|
+
mediaType: metadata.mediaType,
|
|
9526
|
+
schema: metadata.preserveSchema ? getCandidate(ast, encodingLength - 1) : void 0
|
|
9527
|
+
};
|
|
9528
|
+
}
|
|
9529
|
+
ast = last.to;
|
|
9530
|
+
encodingLength = ast.encoding?.length ?? 0;
|
|
9080
9531
|
}
|
|
9081
|
-
return {
|
|
9082
|
-
_tag: "Reference",
|
|
9083
|
-
$ref: reference
|
|
9084
|
-
};
|
|
9085
|
-
}
|
|
9086
|
-
function getCandidate(input) {
|
|
9087
|
-
const ast = getLastEncoding(input);
|
|
9088
9532
|
const owner = getContextOwner(ast);
|
|
9089
9533
|
let identifier = resolveIdentifier$1(ast);
|
|
9090
9534
|
const fallback = identifier === void 0 ? (ast !== input ? resolveIdentifier$1(input) : void 0) ?? resolveIdentifierFallback(ast) : void 0;
|
|
9091
9535
|
if (fallback !== void 0) identifier = `${fallback}Encoded`;
|
|
9092
|
-
let
|
|
9093
|
-
if (
|
|
9094
|
-
|
|
9095
|
-
candidates.set(owner,
|
|
9536
|
+
let variants = candidates.get(owner);
|
|
9537
|
+
if (variants === void 0) {
|
|
9538
|
+
variants = [];
|
|
9539
|
+
candidates.set(owner, variants);
|
|
9096
9540
|
}
|
|
9097
|
-
let candidate =
|
|
9541
|
+
let candidate = variants.find((candidate) => candidate.identifier === identifier && candidate.content?.mediaType === content?.mediaType && candidate.content?.schema === content?.schema);
|
|
9098
9542
|
if (candidate === void 0) {
|
|
9099
9543
|
candidate = {
|
|
9100
9544
|
ast: owner,
|
|
9101
9545
|
identifier,
|
|
9102
9546
|
fallback,
|
|
9103
|
-
|
|
9104
|
-
|
|
9105
|
-
reference: void 0
|
|
9547
|
+
content,
|
|
9548
|
+
occurrences: 0
|
|
9106
9549
|
};
|
|
9107
|
-
|
|
9550
|
+
variants.push(candidate);
|
|
9108
9551
|
}
|
|
9109
9552
|
return candidate;
|
|
9110
9553
|
}
|
|
9111
9554
|
function visit(input) {
|
|
9112
|
-
|
|
9555
|
+
visitCandidate(getCandidate(input));
|
|
9556
|
+
return input;
|
|
9557
|
+
}
|
|
9558
|
+
function visitCandidate(candidate) {
|
|
9113
9559
|
const ast = candidate.ast;
|
|
9114
9560
|
candidate.occurrences++;
|
|
9115
|
-
if (
|
|
9561
|
+
if (candidate.visiting) {
|
|
9116
9562
|
candidate.isRecursive = true;
|
|
9117
9563
|
return;
|
|
9118
9564
|
}
|
|
9119
9565
|
if (candidate.occurrences > 1) return;
|
|
9120
|
-
|
|
9566
|
+
candidate.visiting = true;
|
|
9567
|
+
if (candidate.content?.schema !== void 0) visitCandidate(candidate.content.schema);
|
|
9121
9568
|
visitChecks(ast.checks);
|
|
9122
9569
|
switch (ast._tag) {
|
|
9123
|
-
|
|
9124
|
-
|
|
9125
|
-
case "Objects":
|
|
9126
|
-
case "Union":
|
|
9127
|
-
ast.recur((child) => {
|
|
9128
|
-
visit(child);
|
|
9129
|
-
return child;
|
|
9130
|
-
});
|
|
9570
|
+
default:
|
|
9571
|
+
if ("recur" in ast) ast.recur(visit);
|
|
9131
9572
|
break;
|
|
9132
9573
|
case "TemplateLiteral":
|
|
9133
9574
|
ast.parts.forEach(visit);
|
|
9134
9575
|
break;
|
|
9135
9576
|
case "Suspend": visit(ast.thunk());
|
|
9136
9577
|
}
|
|
9137
|
-
|
|
9578
|
+
candidate.visiting = false;
|
|
9138
9579
|
}
|
|
9139
9580
|
function visitChecks(checks) {
|
|
9140
9581
|
checks?.forEach((check) => {
|
|
@@ -9143,63 +9584,65 @@ function toRepresentations(asts, options) {
|
|
|
9143
9584
|
});
|
|
9144
9585
|
}
|
|
9145
9586
|
function recur(input) {
|
|
9146
|
-
|
|
9587
|
+
return recurCandidate(getCandidate(input));
|
|
9588
|
+
}
|
|
9589
|
+
function recurCandidate(candidate) {
|
|
9147
9590
|
const ast = candidate.ast;
|
|
9148
9591
|
const reference = candidate.reference;
|
|
9149
|
-
if (reference !== void 0)
|
|
9150
|
-
|
|
9592
|
+
if (reference !== void 0) {
|
|
9593
|
+
if (!candidate.emitted) {
|
|
9594
|
+
candidate.emitted = true;
|
|
9595
|
+
const representation = on(candidate.identifier === void 0 ? ast : annotateReference(ast, candidate, reference), candidate.content);
|
|
9596
|
+
assignProperty(references, reference, representation);
|
|
9597
|
+
}
|
|
9598
|
+
return {
|
|
9599
|
+
_tag: "Reference",
|
|
9600
|
+
$ref: reference
|
|
9601
|
+
};
|
|
9602
|
+
}
|
|
9603
|
+
return on(ast, candidate.content);
|
|
9151
9604
|
}
|
|
9152
|
-
function on(ast) {
|
|
9153
|
-
const
|
|
9605
|
+
function on(ast, content) {
|
|
9606
|
+
const common = {
|
|
9607
|
+
checks: ast.checks?.map(fromCheck) ?? [],
|
|
9608
|
+
...ast._tag === "Declaration" ? fromAnnotations(ast.annotations) : annotationsField(ast.annotations)
|
|
9609
|
+
};
|
|
9154
9610
|
switch (ast._tag) {
|
|
9155
9611
|
case "Declaration": return {
|
|
9156
|
-
_tag:
|
|
9157
|
-
typeParameters: ast.typeParameters.map(
|
|
9158
|
-
|
|
9159
|
-
...fromDeclarationAnnotations(ast.annotations)
|
|
9612
|
+
_tag: ast._tag,
|
|
9613
|
+
typeParameters: ast.typeParameters.map(recur),
|
|
9614
|
+
...common
|
|
9160
9615
|
};
|
|
9161
|
-
|
|
9162
|
-
case "Undefined":
|
|
9163
|
-
case "Void":
|
|
9164
|
-
case "Never":
|
|
9165
|
-
case "Unknown":
|
|
9166
|
-
case "Any":
|
|
9167
|
-
case "String":
|
|
9168
|
-
case "Boolean":
|
|
9169
|
-
case "Number":
|
|
9170
|
-
case "BigInt":
|
|
9171
|
-
case "Symbol":
|
|
9172
|
-
case "ObjectKeyword": return {
|
|
9616
|
+
default: return {
|
|
9173
9617
|
_tag: ast._tag,
|
|
9174
|
-
|
|
9175
|
-
|
|
9618
|
+
...content === void 0 ? void 0 : { content: {
|
|
9619
|
+
mediaType: content.mediaType,
|
|
9620
|
+
...content.schema === void 0 ? void 0 : { schema: recurCandidate(content.schema) }
|
|
9621
|
+
} },
|
|
9622
|
+
...common
|
|
9176
9623
|
};
|
|
9177
9624
|
case "Literal": return {
|
|
9178
|
-
_tag:
|
|
9625
|
+
_tag: ast._tag,
|
|
9179
9626
|
literal: ast.literal,
|
|
9180
|
-
|
|
9181
|
-
...annotationsField(ast.annotations)
|
|
9627
|
+
...common
|
|
9182
9628
|
};
|
|
9183
9629
|
case "UniqueSymbol": return {
|
|
9184
|
-
_tag:
|
|
9630
|
+
_tag: ast._tag,
|
|
9185
9631
|
symbol: ast.symbol,
|
|
9186
|
-
|
|
9187
|
-
...annotationsField(ast.annotations)
|
|
9632
|
+
...common
|
|
9188
9633
|
};
|
|
9189
9634
|
case "Enum": return {
|
|
9190
|
-
_tag:
|
|
9635
|
+
_tag: ast._tag,
|
|
9191
9636
|
enums: ast.enums,
|
|
9192
|
-
|
|
9193
|
-
...annotationsField(ast.annotations)
|
|
9637
|
+
...common
|
|
9194
9638
|
};
|
|
9195
9639
|
case "TemplateLiteral": return {
|
|
9196
|
-
_tag:
|
|
9197
|
-
parts: ast.parts.map(
|
|
9198
|
-
|
|
9199
|
-
...annotationsField(ast.annotations)
|
|
9640
|
+
_tag: ast._tag,
|
|
9641
|
+
parts: ast.parts.map(recur),
|
|
9642
|
+
...common
|
|
9200
9643
|
};
|
|
9201
9644
|
case "Arrays": return {
|
|
9202
|
-
_tag:
|
|
9645
|
+
_tag: ast._tag,
|
|
9203
9646
|
elements: ast.elements.map((element) => {
|
|
9204
9647
|
const projected = getLastEncoding(element);
|
|
9205
9648
|
const annotations = projected.context?.annotations;
|
|
@@ -9209,12 +9652,11 @@ function toRepresentations(asts, options) {
|
|
|
9209
9652
|
...annotationsField(annotations)
|
|
9210
9653
|
};
|
|
9211
9654
|
}),
|
|
9212
|
-
rest: ast.rest.map(
|
|
9213
|
-
|
|
9214
|
-
...annotationsField(ast.annotations)
|
|
9655
|
+
rest: ast.rest.map(recur),
|
|
9656
|
+
...common
|
|
9215
9657
|
};
|
|
9216
9658
|
case "Objects": return {
|
|
9217
|
-
_tag:
|
|
9659
|
+
_tag: ast._tag,
|
|
9218
9660
|
propertySignatures: ast.propertySignatures.map((property) => {
|
|
9219
9661
|
const projected = getLastEncoding(property.type);
|
|
9220
9662
|
const annotations = projected.context?.annotations;
|
|
@@ -9230,63 +9672,48 @@ function toRepresentations(asts, options) {
|
|
|
9230
9672
|
parameter: recur(index.parameter),
|
|
9231
9673
|
type: recur(index.type)
|
|
9232
9674
|
})),
|
|
9233
|
-
|
|
9234
|
-
...annotationsField(ast.annotations)
|
|
9675
|
+
...common
|
|
9235
9676
|
};
|
|
9236
9677
|
case "Union": return {
|
|
9237
|
-
_tag:
|
|
9238
|
-
types: ast.types.map(
|
|
9678
|
+
_tag: ast._tag,
|
|
9679
|
+
types: ast.types.map(recur),
|
|
9239
9680
|
...ast.options === void 0 ? {} : { options: ast.options },
|
|
9240
|
-
|
|
9241
|
-
...annotationsField(ast.annotations)
|
|
9681
|
+
...common
|
|
9242
9682
|
};
|
|
9243
9683
|
case "Suspend": return {
|
|
9244
|
-
_tag:
|
|
9684
|
+
_tag: ast._tag,
|
|
9685
|
+
...common,
|
|
9245
9686
|
checks: [],
|
|
9246
|
-
thunk: recur(ast.thunk())
|
|
9247
|
-
...annotationsField(ast.annotations)
|
|
9687
|
+
thunk: recur(ast.thunk())
|
|
9248
9688
|
};
|
|
9249
9689
|
}
|
|
9250
9690
|
}
|
|
9251
|
-
function fromChecks(checks) {
|
|
9252
|
-
return checks?.map(fromCheck) ?? [];
|
|
9253
|
-
}
|
|
9254
9691
|
function fromCheck(check) {
|
|
9255
|
-
switch (check._tag) {
|
|
9256
|
-
case "Filter": return {
|
|
9257
|
-
_tag: "Filter",
|
|
9258
|
-
aborted: check.aborted,
|
|
9259
|
-
...fromCheckAnnotations(check.annotations)
|
|
9260
|
-
};
|
|
9261
|
-
case "FilterGroup": return {
|
|
9262
|
-
_tag: "FilterGroup",
|
|
9263
|
-
checks: map$5(check.checks, fromCheck),
|
|
9264
|
-
...fromCheckAnnotations(check.annotations)
|
|
9265
|
-
};
|
|
9266
|
-
}
|
|
9267
|
-
}
|
|
9268
|
-
function fromDeclarationAnnotations(annotations) {
|
|
9269
|
-
if (annotations === void 0) return void 0;
|
|
9270
|
-
const { representation, ...ordinary } = annotations;
|
|
9271
9692
|
return {
|
|
9272
|
-
...
|
|
9273
|
-
|
|
9693
|
+
...check._tag === "Filter" ? {
|
|
9694
|
+
_tag: check._tag,
|
|
9695
|
+
aborted: check.aborted
|
|
9696
|
+
} : {
|
|
9697
|
+
_tag: check._tag,
|
|
9698
|
+
checks: map$5(check.checks, fromCheck)
|
|
9699
|
+
},
|
|
9700
|
+
...fromAnnotations(check.annotations, true)
|
|
9274
9701
|
};
|
|
9275
9702
|
}
|
|
9276
|
-
function
|
|
9703
|
+
function fromAnnotations(annotations, projectSchemas = false) {
|
|
9277
9704
|
if (annotations === void 0) return void 0;
|
|
9278
9705
|
const { representation, ...ordinary } = annotations;
|
|
9279
|
-
const projected =
|
|
9706
|
+
const projected = projectSchemas && representation?.schemas !== void 0 ? {
|
|
9280
9707
|
...representation,
|
|
9281
9708
|
schemas: representation.schemas.map((schema) => recur(toType$1(schema)))
|
|
9282
|
-
};
|
|
9709
|
+
} : representation;
|
|
9283
9710
|
return {
|
|
9284
9711
|
...projected === void 0 ? void 0 : { representation: projected },
|
|
9285
9712
|
...Object.keys(ordinary).length === 0 ? void 0 : { annotations: ordinary }
|
|
9286
9713
|
};
|
|
9287
9714
|
}
|
|
9288
9715
|
}
|
|
9289
|
-
// ../../node_modules/.pnpm/effect@4.
|
|
9716
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/schema/toEquivalence.js
|
|
9290
9717
|
/** @internal */
|
|
9291
9718
|
const toEquivalence$1 = /*#__PURE__*/ memoize((ast) => {
|
|
9292
9719
|
return recur(ast);
|
|
@@ -9317,7 +9744,7 @@ function recur(ast) {
|
|
|
9317
9744
|
const rest = ast.rest.map(recur);
|
|
9318
9745
|
const [head, ...tail] = rest;
|
|
9319
9746
|
const tailLength = tail.length;
|
|
9320
|
-
return make$
|
|
9747
|
+
return make$10((a, b) => {
|
|
9321
9748
|
if (!Array.isArray(a) || !Array.isArray(b)) return false;
|
|
9322
9749
|
const len = a.length;
|
|
9323
9750
|
if (len !== b.length) return false;
|
|
@@ -9334,7 +9761,7 @@ function recur(ast) {
|
|
|
9334
9761
|
if (ast.propertySignatures.length === 0 && ast.indexSignatures.length === 0) return equals;
|
|
9335
9762
|
const propertySignatures = ast.propertySignatures.map((ps) => recur(ps.type));
|
|
9336
9763
|
const indexSignatures = ast.indexSignatures.map((is) => recur(is.type));
|
|
9337
|
-
return make$
|
|
9764
|
+
return make$10((a, b) => {
|
|
9338
9765
|
if (!isObject(a) || !isObject(b)) return false;
|
|
9339
9766
|
for (let i = 0; i < propertySignatures.length; i++) {
|
|
9340
9767
|
const ps = ast.propertySignatures[i];
|
|
@@ -9363,7 +9790,7 @@ function recur(ast) {
|
|
|
9363
9790
|
const types = toType$1(ast).types;
|
|
9364
9791
|
const index = getCandidateIndex(types);
|
|
9365
9792
|
const compiled = types.map((candidate, i) => [_is(candidate), recur(ast.types[i])]);
|
|
9366
|
-
return make$
|
|
9793
|
+
return make$10((a, b) => {
|
|
9367
9794
|
const candidates = index(a, false);
|
|
9368
9795
|
for (let i = 0; i < candidates.length; i++) {
|
|
9369
9796
|
const [is, equivalence] = compiled[candidates[i]];
|
|
@@ -9374,7 +9801,7 @@ function recur(ast) {
|
|
|
9374
9801
|
}
|
|
9375
9802
|
case "Suspend": {
|
|
9376
9803
|
let equivalence;
|
|
9377
|
-
return make$
|
|
9804
|
+
return make$10((a, b) => (equivalence ??= toEquivalence$1(ast.thunk()))(a, b));
|
|
9378
9805
|
}
|
|
9379
9806
|
}
|
|
9380
9807
|
}
|
|
@@ -9430,7 +9857,7 @@ function causeEquivalence(error, defect) {
|
|
|
9430
9857
|
const reasons = Array_(causeReasonEquivalence(error, defect));
|
|
9431
9858
|
return (a, b) => reasons(a.reasons, b.reasons);
|
|
9432
9859
|
}
|
|
9433
|
-
// ../../node_modules/.pnpm/effect@4.
|
|
9860
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Struct.js
|
|
9434
9861
|
/**
|
|
9435
9862
|
* Creates a new struct with the specified keys removed.
|
|
9436
9863
|
*
|
|
@@ -9592,12 +10019,58 @@ function buildStruct(source, f) {
|
|
|
9592
10019
|
}
|
|
9593
10020
|
return out;
|
|
9594
10021
|
}
|
|
9595
|
-
// ../../node_modules/.pnpm/effect@4.
|
|
10022
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/internal/schemaError.js
|
|
9596
10023
|
const SchemaErrorTypeId = "~effect/Schema/SchemaError";
|
|
9597
10024
|
function isSchemaError$1(u) {
|
|
9598
10025
|
return hasProperty(u, "~effect/Schema/SchemaError") && u["~effect/Schema/SchemaError"] === "~effect/Schema/SchemaError";
|
|
9599
10026
|
}
|
|
9600
|
-
// ../../node_modules/.pnpm/effect@4.
|
|
10027
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Bytes.js
|
|
10028
|
+
/**
|
|
10029
|
+
* Joins and compares byte sequences stored in `Uint8Array` values.
|
|
10030
|
+
*
|
|
10031
|
+
* Byte-to-text conversions live in `TextEncoder` / `TextDecoder`, and hex or
|
|
10032
|
+
* base64 conversions live in the `Encoding` modules.
|
|
10033
|
+
*
|
|
10034
|
+
* @stability unstable
|
|
10035
|
+
* @since 4.0.6
|
|
10036
|
+
*/
|
|
10037
|
+
/**
|
|
10038
|
+
* Joins byte chunks into one new `Uint8Array`.
|
|
10039
|
+
*
|
|
10040
|
+
* **When to use**
|
|
10041
|
+
*
|
|
10042
|
+
* Use to combine frames, headers, or streamed chunks into a single buffer.
|
|
10043
|
+
*
|
|
10044
|
+
* **Gotchas**
|
|
10045
|
+
*
|
|
10046
|
+
* The result is always a new array, even when there is zero or one chunk, so
|
|
10047
|
+
* it never aliases an input.
|
|
10048
|
+
*
|
|
10049
|
+
* **Example** (Joining byte chunks)
|
|
10050
|
+
*
|
|
10051
|
+
* ```ts import.meta.vitest
|
|
10052
|
+
* import { Bytes } from "effect"
|
|
10053
|
+
*
|
|
10054
|
+
* const bytes = Bytes.concat([new Uint8Array([1, 2]), new Uint8Array([3])])
|
|
10055
|
+
* Array.from(bytes) // => [1, 2, 3]
|
|
10056
|
+
* ```
|
|
10057
|
+
*
|
|
10058
|
+
* @stability unstable
|
|
10059
|
+
* @category combinators
|
|
10060
|
+
* @since 4.0.6
|
|
10061
|
+
*/
|
|
10062
|
+
const concat = (chunks) => {
|
|
10063
|
+
let length = 0;
|
|
10064
|
+
for (let i = 0; i < chunks.length; i++) length += chunks[i].length;
|
|
10065
|
+
const out = new Uint8Array(length);
|
|
10066
|
+
let offset = 0;
|
|
10067
|
+
for (let i = 0; i < chunks.length; i++) {
|
|
10068
|
+
out.set(chunks[i], offset);
|
|
10069
|
+
offset += chunks[i].length;
|
|
10070
|
+
}
|
|
10071
|
+
return out;
|
|
10072
|
+
};
|
|
10073
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/net/NetAddress.js
|
|
9601
10074
|
const TypeId$2 = "~effect/net/NetAddress";
|
|
9602
10075
|
const ipv4Value = (self) => self.value;
|
|
9603
10076
|
const ipv6Words = (self) => self;
|
|
@@ -9729,6 +10202,14 @@ const wordToOctets = (word) => [
|
|
|
9729
10202
|
word >>> 8 & 255,
|
|
9730
10203
|
word & 255
|
|
9731
10204
|
];
|
|
10205
|
+
/**
|
|
10206
|
+
* The IPv4 loopback address `127.0.0.1`.
|
|
10207
|
+
*
|
|
10208
|
+
* @stability unstable
|
|
10209
|
+
* @category constants
|
|
10210
|
+
* @since 4.0.0
|
|
10211
|
+
*/
|
|
10212
|
+
const ipv4Loopback = /*#__PURE__*/ makeIpv4(2130706433);
|
|
9732
10213
|
const addressError = (input, message) => fail$1(new NetAddressError({
|
|
9733
10214
|
input,
|
|
9734
10215
|
message
|
|
@@ -9797,7 +10278,7 @@ const parseIpv6Segments = (input) => {
|
|
|
9797
10278
|
let embedded;
|
|
9798
10279
|
if (trailing.includes(".")) {
|
|
9799
10280
|
if (halves.length === 2 && tail.length === 0) return addressError(input, "embedded IPv4 syntax must be trailing");
|
|
9800
|
-
const parsed = map$
|
|
10281
|
+
const parsed = map$3(ipv4FromString(trailing), (address) => {
|
|
9801
10282
|
const value = ipv4Value(address);
|
|
9802
10283
|
return [value >>> 16, value & 65535];
|
|
9803
10284
|
});
|
|
@@ -10089,7 +10570,7 @@ const toUrl = (self, scheme = "http") => {
|
|
|
10089
10570
|
* @category encoding
|
|
10090
10571
|
* @since 4.0.0
|
|
10091
10572
|
*/
|
|
10092
|
-
const formatUrl = (self, scheme = "http") => isUnixPathAddress(self) ? succeed$1(formatUnixPath(self)) : map$
|
|
10573
|
+
const formatUrl = (self, scheme = "http") => isUnixPathAddress(self) ? succeed$1(formatUnixPath(self)) : map$3(toUrl(self, scheme), (url) => `${url.protocol}//${url.host}`);
|
|
10093
10574
|
/**
|
|
10094
10575
|
* Formats an IP or socket address as a URL display string,
|
|
10095
10576
|
* throwing a `NetAddressError` when conversion fails.
|
|
@@ -10153,7 +10634,7 @@ const unixPathAddress = (path) => {
|
|
|
10153
10634
|
const formatUnixPath = (self) => `unix://${self.path}`;
|
|
10154
10635
|
({ ...BaseProto });
|
|
10155
10636
|
({ ...BaseProto });
|
|
10156
|
-
// ../../node_modules/.pnpm/effect@4.
|
|
10637
|
+
// ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/Schema.js
|
|
10157
10638
|
/**
|
|
10158
10639
|
* Describes data shapes and how unknown input becomes trusted values.
|
|
10159
10640
|
*
|
|
@@ -11323,11 +11804,18 @@ function fieldsAssign(fields) {
|
|
|
11323
11804
|
*
|
|
11324
11805
|
* **Gotchas**
|
|
11325
11806
|
*
|
|
11807
|
+
* Dynamic records reject value schemas wrapped with {@link optionalKey} or
|
|
11808
|
+
* {@link optional}. Index signatures already allow keys to be absent; use
|
|
11809
|
+
* {@link UndefinedOr} when existing entries may contain `undefined`. Optional
|
|
11810
|
+
* value schemas remain valid for finite literal keys, which become declared
|
|
11811
|
+
* properties.
|
|
11812
|
+
*
|
|
11326
11813
|
* When decoded or encoded key transformations produce the same property key,
|
|
11327
11814
|
* sequential parsing applies selected own properties in selection order, so
|
|
11328
11815
|
* the later selected property overwrites the earlier value. Dynamic key
|
|
11329
|
-
* selection always examines own properties. Finite literal keys are
|
|
11330
|
-
* fields and may therefore be inherited. Output key order is not
|
|
11816
|
+
* selection always examines own properties. Finite literal and enum keys are
|
|
11817
|
+
* declared fields and may therefore be inherited. Output key order is not
|
|
11818
|
+
* guaranteed.
|
|
11331
11819
|
*
|
|
11332
11820
|
* **Example** (Defining a string-keyed record of numbers)
|
|
11333
11821
|
*
|
|
@@ -11974,6 +12462,7 @@ function withConstructorDefault(defaultValue) {
|
|
|
11974
12462
|
return (schema) => make(withConstructorDefault$1(schema.ast, defaultValue), { schema });
|
|
11975
12463
|
}
|
|
11976
12464
|
function toIssueEffect(self) {
|
|
12465
|
+
if (effectIsExit(self) && self._tag === "Success") return self;
|
|
11977
12466
|
return catchCause(self, (cause) => failCauseSync(() => map$7(cause, (error) => error.issue)));
|
|
11978
12467
|
}
|
|
11979
12468
|
/**
|
|
@@ -12153,7 +12642,9 @@ function TaggedStruct(value, fields) {
|
|
|
12153
12642
|
*
|
|
12154
12643
|
* **Gotchas**
|
|
12155
12644
|
*
|
|
12156
|
-
* Throws
|
|
12645
|
+
* Throws when multiple members use the same discriminant property key,
|
|
12646
|
+
* including members of nested unions. Numeric and string values such as `1`
|
|
12647
|
+
* and `"1"` count as duplicates.
|
|
12157
12648
|
*
|
|
12158
12649
|
* **Example** (Adding tagged-union utilities to an existing union)
|
|
12159
12650
|
*
|
|
@@ -12334,9 +12825,8 @@ function link() {
|
|
|
12334
12825
|
* )
|
|
12335
12826
|
*
|
|
12336
12827
|
* const result = Schema.decodeUnknownResult(schema)({ password: "123456", confirmPassword: "1234567" })
|
|
12337
|
-
*
|
|
12338
|
-
*
|
|
12339
|
-
* }
|
|
12828
|
+
* const message = Result.isFailure(result) ? result.failure.message : ""
|
|
12829
|
+
* message // => "password and confirmPassword must match\n at [\"password\"]"
|
|
12340
12830
|
* ```
|
|
12341
12831
|
*
|
|
12342
12832
|
* **Example** (Reporting multiple failures at once)
|
|
@@ -12356,9 +12846,8 @@ function link() {
|
|
|
12356
12846
|
* )
|
|
12357
12847
|
*
|
|
12358
12848
|
* const result = Schema.decodeUnknownResult(schema)({ a: 1, b: 0, c: 0 })
|
|
12359
|
-
*
|
|
12360
|
-
*
|
|
12361
|
-
* }
|
|
12849
|
+
* const message = Result.isFailure(result) ? result.failure.message : ""
|
|
12850
|
+
* message // => "b must be greater than 0\n at [\"b\"]\nc must be greater than 0\n at [\"c\"]"
|
|
12362
12851
|
* ```
|
|
12363
12852
|
*
|
|
12364
12853
|
* @stability stable
|
|
@@ -12427,7 +12916,7 @@ function isPattern(regExp, annotations) {
|
|
|
12427
12916
|
const source = regExp.source;
|
|
12428
12917
|
const flags = regExp.flags;
|
|
12429
12918
|
const canExport = /^[dg]*uy?$/.test(flags);
|
|
12430
|
-
const runtimeRegExp = flags === "" ? `new RegExp(${format$1(source)})` : `new RegExp(${format$1(source)}, ${format$1(flags)})`;
|
|
12919
|
+
const runtimeRegExp = flags === "" ? `new globalThis.RegExp(${format$1(source)})` : `new globalThis.RegExp(${format$1(source)}, ${format$1(flags)})`;
|
|
12431
12920
|
return isPattern$1(regExp, {
|
|
12432
12921
|
toJsonSchema: () => canExport ? { pattern: flags.endsWith("y") ? `^(?:${source})` : source } : [{}, true],
|
|
12433
12922
|
toCode: () => ({ runtime: `Schema.isPattern(${runtimeRegExp})` }),
|
|
@@ -13254,10 +13743,7 @@ const URL$1 = /*#__PURE__*/ instanceOf(globalThis.URL, {
|
|
|
13254
13743
|
* @since 4.0.0
|
|
13255
13744
|
*/
|
|
13256
13745
|
const URLFromString = /*#__PURE__*/ URLString.pipe(/*#__PURE__*/ decodeTo(URL$1, urlFromString));
|
|
13257
|
-
const JsonString = /*#__PURE__*/ String$1.annotate({
|
|
13258
|
-
expected: "a string that will be decoded as JSON",
|
|
13259
|
-
contentMediaType: "application/json"
|
|
13260
|
-
});
|
|
13746
|
+
const JsonString = /*#__PURE__*/ String$1.annotate({ expected: "a string that will be decoded as JSON" });
|
|
13261
13747
|
/**
|
|
13262
13748
|
* Returns a schema that decodes a JSON string and then decodes the parsed value
|
|
13263
13749
|
* using the given schema.
|
|
@@ -13294,7 +13780,6 @@ function fromJsonString(schema, options) {
|
|
|
13294
13780
|
/** @internal */
|
|
13295
13781
|
const UnknownFromJsonString = /*#__PURE__*/ fromJsonString(Unknown);
|
|
13296
13782
|
globalThis.File;
|
|
13297
|
-
globalThis.FormData;
|
|
13298
13783
|
globalThis.URLSearchParams;
|
|
13299
13784
|
/**
|
|
13300
13785
|
* Schema that parses a string into a `number` using JavaScript
|
|
@@ -13580,7 +14065,7 @@ function Cause(error, defect) {
|
|
|
13580
14065
|
if (!isCause(input)) return fail$2(new InvalidType(ast, input, options));
|
|
13581
14066
|
return mapBothEager(decodeUnknownEffect$1(failures)(input.reasons, options), {
|
|
13582
14067
|
onSuccess: fromReasons,
|
|
13583
|
-
onFailure: (issue) => makeCompositeAtKey(ast, "
|
|
14068
|
+
onFailure: (issue) => makeCompositeAtKey(ast, "reasons", issue, input, options)
|
|
13584
14069
|
});
|
|
13585
14070
|
};
|
|
13586
14071
|
}, {
|
|
@@ -13606,7 +14091,7 @@ function Cause(error, defect) {
|
|
|
13606
14091
|
}
|
|
13607
14092
|
const dateTimeUtcFromString = /*#__PURE__*/ transformEffect({
|
|
13608
14093
|
decode: (s, options) => {
|
|
13609
|
-
return match$1(make$
|
|
14094
|
+
return match$1(make$6(s), {
|
|
13610
14095
|
onNone: () => fail$2(new InvalidValue({ expected: "a valid UTC DateTime string" }, s, options)),
|
|
13611
14096
|
onSome: (result) => succeed$3(toUtc(result))
|
|
13612
14097
|
});
|
|
@@ -13690,7 +14175,7 @@ const DateTimeUtc = /*#__PURE__*/ declare((u) => isDateTime(u) && isUtc(u), {
|
|
|
13690
14175
|
*/
|
|
13691
14176
|
const DateTimeUtcFromString = /*#__PURE__*/ String$1.annotate({ expected: "a string that will be decoded as a DateTime.Utc" }).pipe(/*#__PURE__*/ decodeTo(DateTimeUtc, dateTimeUtcFromString));
|
|
13692
14177
|
const durationFromString = /*#__PURE__*/ transformEffect({
|
|
13693
|
-
decode: (s, options) => match$1(fromInput$
|
|
14178
|
+
decode: (s, options) => match$1(fromInput$2(s), {
|
|
13694
14179
|
onNone: () => fail$2(new InvalidValue({ expected: "a valid Duration string" }, s, options)),
|
|
13695
14180
|
onSome: succeed$3
|
|
13696
14181
|
}),
|
|
@@ -13972,10 +14457,10 @@ const RecordFromUrlParams = /*#__PURE__*/ (/* @__PURE__ */ declare(isUrlParams,
|
|
|
13972
14457
|
importDeclarations: [`import * as UrlParams from "effect/http/UrlParams"`]
|
|
13973
14458
|
}),
|
|
13974
14459
|
expected: "UrlParams",
|
|
13975
|
-
toEquivalence: () => Equivalence,
|
|
14460
|
+
toEquivalence: () => Equivalence$1,
|
|
13976
14461
|
toCodec: () => link()(ArraySchema(Tuple([String$1, String$1])), transform({
|
|
13977
14462
|
decode: make$3,
|
|
13978
|
-
encode: (self) => self.params
|
|
14463
|
+
encode: (self) => self.params.map(([key, value]) => [key, unwrap(value)])
|
|
13979
14464
|
}))
|
|
13980
14465
|
})).pipe(/*#__PURE__*/ decodeTo(/*#__PURE__*/ Record(String$1, /*#__PURE__*/ Union([String$1, /*#__PURE__*/ NonEmptyArray(String$1)])), /*#__PURE__*/ transform({
|
|
13981
14466
|
decode: toReadonlyRecord,
|
|
@@ -14010,11 +14495,11 @@ function Redacted(value$3, options) {
|
|
|
14010
14495
|
disallowJsonEncode: true
|
|
14011
14496
|
} : { label } : disallowJsonEncode ? { disallowJsonEncode: true } : void 0;
|
|
14012
14497
|
const decodeLabel = label !== void 0 ? decodeUnknownEffect$1(Literal(label)) : void 0;
|
|
14013
|
-
const schema = declareConstructor()([value$3], ([value$
|
|
14498
|
+
const schema = declareConstructor()([value$3], ([value$5]) => (input, ast, poptions) => {
|
|
14014
14499
|
if (isRedacted(input)) {
|
|
14015
14500
|
const label = decodeLabel !== void 0 ? mapErrorEager(decodeLabel(input.label, poptions), (issue) => new Pointer(["label"], issue)) : void_$2;
|
|
14016
|
-
return flatMapEager(label, () => mapBothEager(decodeUnknownEffect$1(value$
|
|
14017
|
-
onSuccess: (value) => make$
|
|
14501
|
+
return flatMapEager(label, () => mapBothEager(decodeUnknownEffect$1(value$5)(value(input), poptions), {
|
|
14502
|
+
onSuccess: (value) => make$5(value, { label: input.label }),
|
|
14018
14503
|
onFailure: () => {
|
|
14019
14504
|
return new Composite(ast, [new Pointer(["value"], new InvalidValue(void 0, input, poptions))], input, poptions);
|
|
14020
14505
|
}
|
|
@@ -14033,7 +14518,7 @@ function Redacted(value$3, options) {
|
|
|
14033
14518
|
}),
|
|
14034
14519
|
expected: "Redacted",
|
|
14035
14520
|
toCodecJson: ([value$2]) => link()(value$2, {
|
|
14036
|
-
decode: transform$1((e) => make$
|
|
14521
|
+
decode: transform$1((e) => make$5(e, { label })),
|
|
14037
14522
|
encode: disallowJsonEncode ? forbidden((oe) => "Cannot serialize Redacted" + (isSome(oe) && typeof oe.value.label === "string" ? ` with label: "${oe.value.label}"` : "")) : transform$1(value)
|
|
14038
14523
|
}),
|
|
14039
14524
|
toEquivalence: ([value]) => makeEquivalence(value)
|
|
@@ -14075,7 +14560,7 @@ function makeClass(Inherited, identifier, struct$1, annotations, proto) {
|
|
|
14075
14560
|
return getClassSchema(this).rebuild(ast);
|
|
14076
14561
|
}
|
|
14077
14562
|
static make(input, options) {
|
|
14078
|
-
return
|
|
14563
|
+
return makeClassSync(toType$1(getClassSchema(this).ast), input ?? {}, options, (fields) => makeClassTrusted(this, fields));
|
|
14079
14564
|
}
|
|
14080
14565
|
static makeOption(input, options) {
|
|
14081
14566
|
return makeOption(getClassSchema(this))(input ?? {}, options);
|
|
@@ -14110,11 +14595,20 @@ function makeClass(Inherited, identifier, struct$1, annotations, proto) {
|
|
|
14110
14595
|
if (proto !== void 0) Object.assign(out.prototype, proto(identifier));
|
|
14111
14596
|
return out;
|
|
14112
14597
|
}
|
|
14113
|
-
|
|
14114
|
-
|
|
14598
|
+
/**
|
|
14599
|
+
* Constructs a class instance from fields that were already validated against
|
|
14600
|
+
* the class struct, without running the constructor's schema pass.
|
|
14601
|
+
*
|
|
14602
|
+
* @internal
|
|
14603
|
+
*/
|
|
14604
|
+
function makeClassTrusted(self, fields) {
|
|
14605
|
+
return new self(fields, { "~payload": {
|
|
14115
14606
|
token: payloadToken,
|
|
14116
|
-
value:
|
|
14117
|
-
} })
|
|
14607
|
+
value: fields
|
|
14608
|
+
} });
|
|
14609
|
+
}
|
|
14610
|
+
function getClassTransformation(self) {
|
|
14611
|
+
return new Transformation(transform$1((input) => makeClassTrusted(self, input)), passthrough$1());
|
|
14118
14612
|
}
|
|
14119
14613
|
function getClassTypeId(identifier) {
|
|
14120
14614
|
return `~effect/Schema/Class/${identifier}`;
|
|
@@ -14172,7 +14666,13 @@ function isStruct(schema) {
|
|
|
14172
14666
|
*
|
|
14173
14667
|
* **Gotchas**
|
|
14174
14668
|
*
|
|
14175
|
-
*
|
|
14669
|
+
* To subclass a `Schema.Class`, use `Base.extend<Self>(...)`, even when only
|
|
14670
|
+
* adding methods or getters. Pass `{}` for the fields when none are added.
|
|
14671
|
+
* Plain `class Child extends Base` is unsupported.
|
|
14672
|
+
*
|
|
14673
|
+
* Passing `disableChecks: true` skips filters and checks, not parsing of types
|
|
14674
|
+
* and structure. Wrong types and shapes are still rejected, and constructor
|
|
14675
|
+
* defaults still apply.
|
|
14176
14676
|
*
|
|
14177
14677
|
* **Example** (Defining a basic class)
|
|
14178
14678
|
*
|
|
@@ -14217,7 +14717,7 @@ function isStruct(schema) {
|
|
|
14217
14717
|
*/
|
|
14218
14718
|
const Class = (identifier) => (schema, annotations) => {
|
|
14219
14719
|
const struct = isStruct(schema) ? schema : Struct(schema);
|
|
14220
|
-
return makeClass(Class$
|
|
14720
|
+
return makeClass(Class$2, identifier, struct, annotations, (identifier) => ({ toString() {
|
|
14221
14721
|
return `${identifier}(${format$1({ ...this })})`;
|
|
14222
14722
|
} }));
|
|
14223
14723
|
};
|
|
@@ -14476,28 +14976,6 @@ const Json = /*#__PURE__*/ make(/*#__PURE__*/ annotate$1(Json$1, { toCode: () =>
|
|
|
14476
14976
|
Type: "Schema.Json"
|
|
14477
14977
|
}) }));
|
|
14478
14978
|
/**
|
|
14479
|
-
* Schema for readonly string-keyed records whose values are JSON-compatible.
|
|
14480
|
-
*
|
|
14481
|
-
* **When to use**
|
|
14482
|
-
*
|
|
14483
|
-
* Use when you need to validate a JSON object rather than any JSON value.
|
|
14484
|
-
*
|
|
14485
|
-
* **Example** (Validating a JSON object)
|
|
14486
|
-
*
|
|
14487
|
-
* ```ts import.meta.vitest
|
|
14488
|
-
* import { Option, Schema } from "effect"
|
|
14489
|
-
*
|
|
14490
|
-
* Schema.decodeUnknownOption(Schema.JsonObject)({ key: [1, true, null] }) // => Option.some({ key: [1, true, null] })
|
|
14491
|
-
* Schema.decodeUnknownOption(Schema.JsonObject)([1, 2, 3]) // => Option.none()
|
|
14492
|
-
* ```
|
|
14493
|
-
*
|
|
14494
|
-
* @see {@link Json} for a schema that also accepts JSON arrays and primitive values
|
|
14495
|
-
* @stability stable
|
|
14496
|
-
* @category schemas
|
|
14497
|
-
* @since 4.0.0
|
|
14498
|
-
*/
|
|
14499
|
-
const JsonObject = /*#__PURE__*/ Record(String$1, Json);
|
|
14500
|
-
/**
|
|
14501
14979
|
* Schema that accepts any mutable JSON-compatible value. See {@link Json} for
|
|
14502
14980
|
* the immutable variant.
|
|
14503
14981
|
*
|
|
@@ -14534,6 +15012,6 @@ function resolveAnnotations(schema) {
|
|
|
14534
15012
|
function resolveAnnotationsKey(schema) {
|
|
14535
15013
|
return schema.ast.context?.annotations;
|
|
14536
15014
|
}
|
|
14537
|
-
export {
|
|
15015
|
+
export { Undefined as $, getAST as $n, fromInput$1 as $r, makeFilter as $t, Number$1 as A, make$6 as Ai, concat as An, stringifyJson as Ar, fromJsonString as At, StringFromUriComponent as B, toEpochMillis as Bi, getReferenceKey as Bn, appendAll as Br, isLessThanOrEqualTo as Bt, MutableJson as C, add as Ci, inetAddressFromIpString as Cn, transformEffect as Cr, encode as Ct, NonEmptyString as D, isGreaterThanOrEqualTo$1 as Di, isUnspecified as Dn, forbidden as Dr, encodeUnknownEffect as Dt, NonEmptyArray as E, isGreaterThan$1 as Ei, isUnixPathAddress as En, compose as Er, encodeTo as Et, Record as F, nowUnsafe as Fi, omit as Fn, Forbidden as Fr, isGreaterThan as Ft, TemplateLiteral as G, decodeString as Gi, Never$1 as Gn, toRecord as Gr, isPattern as Gt, StructWithRest as H, toUtc as Hi, decodeUnknownEffect$1 as Hn, fromInput as Hr, isMaxProperties as Ht, RecordFromUrlParams as I, setParts as Ii, toRepresentations as In, InvalidValue as Ir, isGreaterThanOrEqualTo as It, Tuple as J, Union$1 as Jn, stripSearchAndHash as Jr, isSchemaError as Jt, Trim as K, encode$1 as Ki, Objects as Kn, toString as Kr, isPropertyNames as Kt, Redacted as L, subtract as Li, toJsonSchemaMultiDocument as Ln, Pointer as Lr, isInt as Lt, Opaque as M, min as Mi, assign as Mn, transformEffect$1 as Mr, is as Mt, Option as N, now as Ni, lambda as Nn, transformOptional$1 as Nr, isBetween as Nt, Null as O, isLessThan$1 as Oi, toUrl as On, parseJson as Or, encodeUnknownExit as Ot, OptionFromNullOr as P, nowInCurrentZone as Pi, map as Pn, withDefault$1 as Pr, isFinite as Pt, Uint8ArrayFromBase64 as Q, defaultParseOptions as Qn, empty$1 as Qr, make as Qt, SchemaError as R, subtractDuration as Ri, toCodecJsonAST as Rn, defaultFormatter as Rr, isInt32 as Rt, Literals as S, Order as Si, formatUrlUnsafe as Sn, transform as Sr, decodeUnknownSync as St, Never as T, formatIso as Ti, isInetAddress as Tn, trim as Tr, encodeSync as Tt, TaggedError as U, withCurrentZoneLocal as Ui, encodeUnknownEffect$1 as Un, redactUrl as Ur, isMinLength as Ut, Struct as V, toParts as Vi, toMultiDocumentOpenApi3_1 as Vn, empty as Vr, isMaxLength as Vt, TaggedStruct as W, decode$1 as Wi, make$2 as Wn, setAll as Wr, isNonEmpty as Wt, URLFromString as X, applyToSelfOrLastLinkEncodingIdempotent as Xn, unwrap as Xr, isTrimmed as Xt, URL$1 as Y, applyToSelfOrLastLinkEncoding as Yn, toPath as Yr, isStartingWith as Yt, Uint8Array$1 as Z, decodeTo$1 as Zn, CurrentRedactedNames$1 as Zr, isUUID as Zt, Finite as _, merge$1 as _i, withConstructorDefault as _n, unknown as _r, decodeTo as _t, BooleanLiterals as a, remove as ai, resolveAnnotations as an, isNull as ar, annotate as at, Json as b, toSetCookieHeaders as bi, formatIp as bn, splitKeyValue as br, decodeUnknownOption as bt, DateTimeUtc as c, setAll$1 as ci, tag as cn, isSuspend as cr, catchDecoding as ct, Duration as d, value as di, toCodecStringTree as dn, mapOrSame as dr, declare as dt, fromRecordUnsafe as ei, mutable as en, getContextOwner as er, UndefinedOr as et, DurationFromMillis as f, stringOrRedacted as fi, toEncoded as fn, replaceContext as fr, decode as ft, FalseLiterals as g, isEmpty as gi, toType as gn, toEncoded$1 as gr, decodeSync as gt, Exit as h, fromSetCookie as hi, toTaggedUnion as hn, resolveIdentifier as hr, decodeOption as ht, BooleanFromBit as i, parseRetryAfter as ii, refine as in, isLiteral as ir, Void as it, NumberFromString as j, makeUnsafe as ji, isSchemaError$1 as jn, transform$1 as jr, instanceOf as jt, NullOr as k, isLessThanOrEqualTo$1 as ki, unixPathAddress as kn, passthrough$1 as kr, fieldsAssign as kt, DateTimeUtcFromString as l, isRedacted as li, toCodecArrayFromSingle as ln, isUnion as lr, catchEncoding as lt, Error$1 as m, expireCookie as mi, toJsonSchemaDocument as mn, resolveDescription as mr, decodeExit as mt, ArraySchema as n, isRedactedName$1 as ni, optional as nn, getLastEncoding as nr, Unknown as nt, Cause as o, retryAfterDelay as oi, resolveAnnotationsKey as on, isObjects as or, annotateKey as ot, DurationFromString as p, empty$2 as pi, toEquivalence as pn, resolveAt as pr, decodeEffect as pt, TrueLiterals as q, map$1 as qi, PropertySignature as qn, fromBody as qr, isSchema as qt, Boolean as r, merge as ri, optionalKey as rn, isDeclaration as rr, UnknownFromJsonString as rt, Class as s, set as si, suspend as sn, isOptional as sr, brand as st, Any as t, isHeaders as ti, mutableKey as tn, getIndexSignatureKeys as tr, Union as tt, Defect as u, make$5 as ui, toCodecJson as un, isVoid as ur, check as ut, FiniteFromString as v, parseHeader as vi, withDecodingDefault as vn, Transformation as vr, decodeUnknownEffect as vt, Natural as w, addDuration as wi, ipv4Loopback as wn, transformOptional as wr, encodeEffect as wt, Literal as x, Equivalence$3 as xi, formatUrlHostString as xn, toLowerCase as xr, decodeUnknownResult as xt, Int as y, set$1 as yi, withDecodingDefaultKey as yn, composeTransformation as yr, decodeUnknownExit as yt, String$1 as z, toDate as zi, VALID_OPEN_API_COMPONENTS_SCHEMAS_KEY_REGEXP as zn, CurrentRedactedNames as zr, isLessThan as zt };
|
|
14538
15016
|
|
|
14539
|
-
//# sourceMappingURL=Schema-
|
|
15017
|
+
//# sourceMappingURL=Schema-06GeVid5.mjs.map
|