@vercel/cli-support 0.0.0 → 65.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +100 -3
- package/dist/chunks/add-7NS6HIWC.js +8 -0
- package/dist/chunks/add-NMYFDVXW.js +8 -0
- package/dist/chunks/add-PMJ5BECU.js +8 -0
- package/dist/chunks/build-BCY6HQJG.js +7 -0
- package/dist/chunks/chunk-25565AGS.js +7 -0
- package/dist/chunks/chunk-2EYYB6YN.js +7 -0
- package/dist/chunks/chunk-2GHZGOWT.js +7 -0
- package/dist/chunks/chunk-2K3ISCQ6.js +7 -0
- package/dist/chunks/chunk-2NABMKFV.js +29 -0
- package/dist/chunks/chunk-2S6PE6GB.js +7 -0
- package/dist/chunks/chunk-2TUVL6WE.js +12 -0
- package/dist/chunks/chunk-363SJ4TN.js +7 -0
- package/dist/chunks/chunk-3G3FQYMW.js +7 -0
- package/dist/chunks/chunk-3LIKVGFT.js +8 -0
- package/dist/chunks/chunk-3XW7N4W3.js +9 -0
- package/dist/chunks/chunk-462YCCJZ.js +7 -0
- package/dist/chunks/chunk-4CACOKMS.js +7 -0
- package/dist/chunks/chunk-4N6LMERQ.js +57 -0
- package/dist/chunks/chunk-4NTBYNFR.js +17 -0
- package/dist/chunks/chunk-4SAVH3H7.js +7 -0
- package/dist/chunks/chunk-4VFYJU37.js +7 -0
- package/dist/chunks/chunk-527GBU3K.js +7 -0
- package/dist/chunks/chunk-5IWFRZQT.js +10 -0
- package/dist/chunks/chunk-5KUUMQ3M.js +7 -0
- package/dist/chunks/chunk-5RMIM4S2.js +7 -0
- package/dist/chunks/chunk-5V53NA6C.js +7 -0
- package/dist/chunks/chunk-67GZ5REA.js +7 -0
- package/dist/chunks/chunk-6I6QJHCY.js +7 -0
- package/dist/chunks/chunk-6IDNVZZR.js +7 -0
- package/dist/chunks/chunk-6OVX3PWM.js +7 -0
- package/dist/chunks/chunk-6QKS6QK7.js +7 -0
- package/dist/chunks/chunk-6TXEVQA4.js +7 -0
- package/dist/chunks/chunk-6VH56CX2.js +19 -0
- package/dist/chunks/chunk-6Y2ZL5XJ.js +98 -0
- package/dist/chunks/chunk-6YXIWZ3X.js +25 -0
- package/dist/chunks/chunk-773GOZIR.js +13 -0
- package/dist/chunks/chunk-7E3WREH5.js +7 -0
- package/dist/chunks/chunk-7EJQLVWX.js +7 -0
- package/dist/chunks/chunk-7L2K4OKM.js +63 -0
- package/dist/chunks/chunk-7L5QUDUR.js +8 -0
- package/dist/chunks/chunk-7QAGSRCU.js +7 -0
- package/dist/chunks/chunk-7R6TRRG5.js +7 -0
- package/dist/chunks/chunk-7YKFF6CE.js +7 -0
- package/dist/chunks/chunk-A2RZZQEP.js +7 -0
- package/dist/chunks/chunk-ADLBLGT3.js +8 -0
- package/dist/chunks/chunk-AM46JVVN.js +7 -0
- package/dist/chunks/chunk-ANMDN3EG.js +9 -0
- package/dist/chunks/chunk-AYUUSAB7.js +7 -0
- package/dist/chunks/chunk-BLUPZPAS.js +7 -0
- package/dist/chunks/chunk-BPUANOGW.js +7 -0
- package/dist/chunks/chunk-BRQUZ5NC.js +7 -0
- package/dist/chunks/chunk-BS32OUOC.js +7 -0
- package/dist/chunks/chunk-BTI5TG6Q.js +7 -0
- package/dist/chunks/chunk-BUJITHGZ.js +8 -0
- package/dist/chunks/chunk-BVGGTBYE.js +7 -0
- package/dist/chunks/chunk-BVH2AEFE.js +7 -0
- package/dist/chunks/chunk-BZENIQ7N.js +7 -0
- package/dist/chunks/chunk-C6GY2G73.js +7 -0
- package/dist/chunks/chunk-C7FQMC6D.js +7 -0
- package/dist/chunks/chunk-CBVKB3DT.js +21 -0
- package/dist/chunks/chunk-CC6FLKIP.js +11 -0
- package/dist/chunks/chunk-COD3WAUI.js +7 -0
- package/dist/chunks/chunk-CR3NBTHV.js +7 -0
- package/dist/chunks/chunk-CWM2F235.js +7 -0
- package/dist/chunks/chunk-CZSOZKHX.js +7 -0
- package/dist/chunks/chunk-D3AHZ5LI.js +7 -0
- package/dist/chunks/chunk-D6REP5QQ.js +15 -0
- package/dist/chunks/chunk-DFVNL5ML.js +7 -0
- package/dist/chunks/chunk-DKJL2KV7.js +7 -0
- package/dist/chunks/chunk-DQ2SVW4R.js +12 -0
- package/dist/chunks/chunk-DWZBL4NK.js +7 -0
- package/dist/chunks/chunk-EAUDC24V.js +9 -0
- package/dist/chunks/chunk-EAXMWCOL.js +63 -0
- package/dist/chunks/chunk-ECEDD646.js +8 -0
- package/dist/chunks/chunk-ECQIO5K3.js +7 -0
- package/dist/chunks/chunk-EEUJLJEJ.js +7 -0
- package/dist/chunks/chunk-EGNR2DEI.js +7 -0
- package/dist/chunks/chunk-EISD3RG7.js +11 -0
- package/dist/chunks/chunk-EKZTFGDX.js +7 -0
- package/dist/chunks/chunk-ETV3C2CV.js +7 -0
- package/dist/chunks/chunk-EU2GBIPC.js +7 -0
- package/dist/chunks/chunk-F4KY2TOK.js +7 -0
- package/dist/chunks/chunk-F53OKXYI.js +7 -0
- package/dist/chunks/chunk-F6EBOT64.js +7 -0
- package/dist/chunks/chunk-F7AVGV4Y.js +7 -0
- package/dist/chunks/chunk-FBYA6LLM.js +7 -0
- package/dist/chunks/chunk-FGFLTLEA.js +7 -0
- package/dist/chunks/chunk-FHU2O7ZJ.js +8 -0
- package/dist/chunks/chunk-FLHO75XC.js +8 -0
- package/dist/chunks/chunk-FSPPKNKN.js +7 -0
- package/dist/chunks/chunk-FUX6LKNP.js +7 -0
- package/dist/chunks/chunk-GA277JFB.js +20 -0
- package/dist/chunks/chunk-GCZVIDNG.js +86 -0
- package/dist/chunks/chunk-GD7AV7BO.js +9 -0
- package/dist/chunks/chunk-GG5RME4X.js +7 -0
- package/dist/chunks/chunk-GHAY4PSD.js +7 -0
- package/dist/chunks/chunk-GYVJIIYL.js +7 -0
- package/dist/chunks/chunk-GZNDA6SV.js +8 -0
- package/dist/chunks/chunk-HCRD3JFL.js +7 -0
- package/dist/chunks/chunk-HEGJZJO7.js +7 -0
- package/dist/chunks/chunk-HRR57QNP.js +7 -0
- package/dist/chunks/chunk-HSFKISDH.js +9 -0
- package/dist/chunks/chunk-HTXDC7E2.js +10 -0
- package/dist/chunks/chunk-ID663OJ7.js +7 -0
- package/dist/chunks/chunk-IOZ3I765.js +7 -0
- package/dist/chunks/chunk-IQ7FPAI4.js +7 -0
- package/dist/chunks/chunk-IQKGQ2Y2.js +15 -0
- package/dist/chunks/chunk-ISWW3DKF.js +7 -0
- package/dist/chunks/chunk-IVSSTHB6.js +7 -0
- package/dist/chunks/chunk-J24BABG4.js +21 -0
- package/dist/chunks/chunk-JALVF3C2.js +7 -0
- package/dist/chunks/chunk-JELLVPCM.js +8 -0
- package/dist/chunks/chunk-JESNVRVR.js +7 -0
- package/dist/chunks/chunk-JLE7K4SY.js +9 -0
- package/dist/chunks/chunk-JLEJB6KM.js +7 -0
- package/dist/chunks/chunk-JP33AIDQ.js +7 -0
- package/dist/chunks/chunk-JRPNHWA3.js +7 -0
- package/dist/chunks/chunk-JUSR7V2L.js +7 -0
- package/dist/chunks/chunk-JWCEHQQF.js +29 -0
- package/dist/chunks/chunk-K5U47EVH.js +7 -0
- package/dist/chunks/chunk-KCKYPLIH.js +7 -0
- package/dist/chunks/chunk-KGBIRIFF.js +7 -0
- package/dist/chunks/chunk-KJA2GKPT.js +7 -0
- package/dist/chunks/chunk-KPQLUGFI.js +32 -0
- package/dist/chunks/chunk-KQCFC2JL.js +7 -0
- package/dist/chunks/chunk-KQCROPL3.js +8 -0
- package/dist/chunks/chunk-KRPY5FHJ.js +7 -0
- package/dist/chunks/chunk-KW6GSQXV.js +7 -0
- package/dist/chunks/chunk-KY335KWI.js +7 -0
- package/dist/chunks/chunk-L3JYCXVB.js +23 -0
- package/dist/chunks/chunk-LFOWP74R.js +7 -0
- package/dist/chunks/chunk-LOBA3E72.js +7 -0
- package/dist/chunks/chunk-LQVSU5HR.js +7 -0
- package/dist/chunks/chunk-LSF7FY6X.js +7 -0
- package/dist/chunks/chunk-LSQREJXO.js +11 -0
- package/dist/chunks/chunk-LW4N3CW6.js +9 -0
- package/dist/chunks/chunk-M2NXKZKX.js +16 -0
- package/dist/chunks/chunk-MBEKRUTQ.js +8 -0
- package/dist/chunks/chunk-MCRKBVZA.js +7 -0
- package/dist/chunks/chunk-MVGTMPMI.js +23 -0
- package/dist/chunks/chunk-MXTC4ZAQ.js +7 -0
- package/dist/chunks/chunk-N2FLYCCO.js +9 -0
- package/dist/chunks/chunk-N6JBQMOF.js +20 -0
- package/dist/chunks/chunk-NAX6IARA.js +11 -0
- package/dist/chunks/chunk-NB2WLB3J.js +12 -0
- package/dist/chunks/chunk-NGKO2OOU.js +8 -0
- package/dist/chunks/chunk-NW7WWUCQ.js +9 -0
- package/dist/chunks/chunk-NWGBDBZI.js +7 -0
- package/dist/chunks/chunk-NZ2TFADV.js +7 -0
- package/dist/chunks/chunk-O4WNSKQR.js +15 -0
- package/dist/chunks/chunk-O72YDZKD.js +10 -0
- package/dist/chunks/chunk-OAM5NJCU.js +9 -0
- package/dist/chunks/chunk-OCR5CRTH.js +10 -0
- package/dist/chunks/chunk-OFDTADPQ.js +7 -0
- package/dist/chunks/chunk-OHEOYFBU.js +9 -0
- package/dist/chunks/chunk-OO572JUC.js +7 -0
- package/dist/chunks/chunk-OPORM35X.js +7 -0
- package/dist/chunks/chunk-OZCQTXI4.js +7 -0
- package/dist/chunks/chunk-PADL3C6Z.js +7 -0
- package/dist/chunks/chunk-PFD7LETF.js +7 -0
- package/dist/chunks/chunk-PFPJLIFF.js +33 -0
- package/dist/chunks/chunk-PSOVLGHP.js +7 -0
- package/dist/chunks/chunk-PUKYAALC.js +7 -0
- package/dist/chunks/chunk-PVASGBEF.js +7 -0
- package/dist/chunks/chunk-Q4KTAQB3.js +7 -0
- package/dist/chunks/chunk-Q5ODLDCU.js +7 -0
- package/dist/chunks/chunk-Q7D7RGXM.js +7 -0
- package/dist/chunks/chunk-QB7F3UAP.js +7 -0
- package/dist/chunks/chunk-QHJLRTVY.js +7 -0
- package/dist/chunks/chunk-QIVX6SCR.js +27 -0
- package/dist/chunks/chunk-QVHXFHBV.js +14 -0
- package/dist/chunks/chunk-QVXS234E.js +7 -0
- package/dist/chunks/chunk-QVZAAMGQ.js +39 -0
- package/dist/chunks/chunk-R2BUF6Z7.js +7 -0
- package/dist/chunks/chunk-R2XHJDAP.js +7 -0
- package/dist/chunks/chunk-R6BEOVTU.js +7 -0
- package/dist/chunks/chunk-RLKS5G6C.js +12 -0
- package/dist/chunks/chunk-RM3ZDRYE.js +7 -0
- package/dist/chunks/chunk-RMZTB2IU.js +7 -0
- package/dist/chunks/chunk-RRDNKB2X.js +7 -0
- package/dist/chunks/chunk-RW3X523R.js +8 -0
- package/dist/chunks/chunk-S3L2OHPO.js +7 -0
- package/dist/chunks/chunk-SACGQMVQ.js +13 -0
- package/dist/chunks/chunk-SCV7XEEO.js +7 -0
- package/dist/chunks/chunk-SF4E3AQ3.js +7 -0
- package/dist/chunks/chunk-SLGUYM42.js +10 -0
- package/dist/chunks/chunk-SYFG2RM6.js +10 -0
- package/dist/chunks/chunk-T6243EDS.js +7 -0
- package/dist/chunks/chunk-TAAWMNNL.js +7 -0
- package/dist/chunks/chunk-TAISZMA2.js +7 -0
- package/dist/chunks/chunk-TEYREL44.js +7 -0
- package/dist/chunks/chunk-TG2RCYTH.js +7 -0
- package/dist/chunks/chunk-TIPQQ4TG.js +17 -0
- package/dist/chunks/chunk-U2OBPULW.js +7 -0
- package/dist/chunks/chunk-U4Z2MMOF.js +301 -0
- package/dist/chunks/chunk-U56NHYAH.js +7 -0
- package/dist/chunks/chunk-UGNIIDHR.js +32 -0
- package/dist/chunks/chunk-UHBMX3OK.js +7 -0
- package/dist/chunks/chunk-UVHKXCR5.js +11 -0
- package/dist/chunks/chunk-V6Y6UK6B.js +43 -0
- package/dist/chunks/chunk-VNIKIQVE.js +10 -0
- package/dist/chunks/chunk-VT6RIZJH.js +7 -0
- package/dist/chunks/chunk-WDXW6A4H.js +10 -0
- package/dist/chunks/chunk-WEH6XC4Y.js +22 -0
- package/dist/chunks/chunk-WKZ6JSGZ.js +7 -0
- package/dist/chunks/chunk-WVHCBDTB.js +7 -0
- package/dist/chunks/chunk-XC46OAAT.js +9 -0
- package/dist/chunks/chunk-XGTKHQTT.js +7 -0
- package/dist/chunks/chunk-XOETL6DB.js +96 -0
- package/dist/chunks/chunk-XP3FT56R.js +27 -0
- package/dist/chunks/chunk-XR6QY7RR.js +7 -0
- package/dist/chunks/chunk-XVDRGWXM.js +16 -0
- package/dist/chunks/chunk-Y5ZMKL7E.js +7 -0
- package/dist/chunks/chunk-YEZJNXQX.js +7 -0
- package/dist/chunks/chunk-YHPPP3SF.js +7 -0
- package/dist/chunks/chunk-YHULP2KK.js +7 -0
- package/dist/chunks/chunk-YMZ6WBKB.js +21 -0
- package/dist/chunks/chunk-ZF27J6FQ.js +7 -0
- package/dist/chunks/chunk-ZFRNVIHI.js +7 -0
- package/dist/chunks/chunk-ZN6CQWVP.js +7 -0
- package/dist/chunks/chunk-ZQBSAMFL.js +24 -0
- package/dist/chunks/cjs-2SMN43VH.js +54 -0
- package/dist/chunks/clear-FKVWDCVA.js +8 -0
- package/dist/chunks/compile-vercel-config-GWAJE44R.js +7 -0
- package/dist/chunks/config-5WVLG5SE.js +8 -0
- package/dist/chunks/config-RMOHN5YT.js +7 -0
- package/dist/chunks/config-validator.mjs +1 -0
- package/dist/chunks/connect-git-provider-FS5Q2HO4.js +7 -0
- package/dist/chunks/constants-JAB7MRSK.js +7 -0
- package/dist/chunks/create-project-IKCB6MB2.js +7 -0
- package/dist/chunks/delete-5WMB4WFR.js +9 -0
- package/dist/chunks/delete-EM4JZPFA.js +10 -0
- package/dist/chunks/detect-projects-OD4JEAW2.js +7 -0
- package/dist/chunks/detect-services-BSJGB4RM.js +7 -0
- package/dist/chunks/disable-QOM7UHQC.js +7 -0
- package/dist/chunks/discard-L5ZH7P5B.js +14 -0
- package/dist/chunks/dist-33WTJLVQ.js +7 -0
- package/dist/chunks/dist-RXYNZPEA.js +7 -0
- package/dist/chunks/edit-F3VJGCG2.js +9 -0
- package/dist/chunks/edit-TM7YCWBU.js +8 -0
- package/dist/chunks/enable-72C3QX34.js +7 -0
- package/dist/chunks/esm-33752ISR.js +7 -0
- package/dist/chunks/esm-4JKEE7PC.js +7 -0
- package/dist/chunks/esm-BYG5BWYH.js +9 -0
- package/dist/chunks/esm-DFFBNKNU.js +20 -0
- package/dist/chunks/esm-IF453UWS.js +7 -0
- package/dist/chunks/esm-LABWDJ72.js +7 -0
- package/dist/chunks/esm-TG37FXTU.js +9 -0
- package/dist/chunks/exec-OZSY46V6.js +16372 -0
- package/dist/chunks/export-EPLYZF2Q.js +19 -0
- package/dist/chunks/fetch-proxy-45DGILKR.js +67 -0
- package/dist/chunks/future-V77DRMQG.js +7 -0
- package/dist/chunks/generate-cert-for-deploy-Y3YHBMPU.js +7 -0
- package/dist/chunks/image-CVXEXU5R.js +7 -0
- package/dist/chunks/import-builders-PGRKJOOE.js +7 -0
- package/dist/chunks/inspect-BTRNXRJT.js +9 -0
- package/dist/chunks/inspect-CZ7WXYE5.js +20 -0
- package/dist/chunks/inspect-FGDVWAQP.js +13 -0
- package/dist/chunks/inspect-HFDGZNWC.js +15 -0
- package/dist/chunks/inspect-T2AIREYK.js +19 -0
- package/dist/chunks/list-CKRRHAOE.js +12 -0
- package/dist/chunks/list-FLREMGJR.js +16 -0
- package/dist/chunks/list-ON4YTQRN.js +10 -0
- package/dist/chunks/login-55LJ5ZA6.js +9 -0
- package/dist/chunks/login-DQRZSD4Z.js +7 -0
- package/dist/chunks/logs-2HQXWOHM.js +7 -0
- package/dist/chunks/ls-2HUJHVLA.js +12 -0
- package/dist/chunks/ls-3DVM5HLK.js +12 -0
- package/dist/chunks/ls-4B3QYHCI.js +8 -0
- package/dist/chunks/ls-A7K4XDQB.js +8 -0
- package/dist/chunks/ls-FK5XEJEU.js +12 -0
- package/dist/chunks/ls-QGUKJJY5.js +12 -0
- package/dist/chunks/ls-VTKHPDWS.js +11 -0
- package/dist/chunks/mutate-7ADZBCZM.js +9 -0
- package/dist/chunks/notifications-XZJXE2K4.js +7 -0
- package/dist/chunks/open-EE5IZQD7.js +7 -0
- package/dist/chunks/openapi-QBX62ZXC.js +7 -0
- package/dist/chunks/permissions-VYJ4LL5R.js +7 -0
- package/dist/chunks/pkg-EDJQLCNP.js +7 -0
- package/dist/chunks/plugin-offer-TEGYA3TA.js +9 -0
- package/dist/chunks/prompt-missing-credentials-VP6OVCFM.js +7 -0
- package/dist/chunks/publish-2HEK5UMJ.js +15 -0
- package/dist/chunks/pull-WRTTSY7J.js +7 -0
- package/dist/chunks/purchase-domain-if-available-6S3NLTUI.js +7 -0
- package/dist/chunks/push-L3QRGGLC.js +7 -0
- package/dist/chunks/query-FXXLX6UB.js +12 -0
- package/dist/chunks/reauthenticate-IXQDC4UZ.js +7 -0
- package/dist/chunks/reorder-B4OXSYCI.js +10 -0
- package/dist/chunks/reply-F637K6XH.js +9 -0
- package/dist/chunks/repo-info-to-url-XQSULSEO.js +7 -0
- package/dist/chunks/resolve-E3F6NYQZ.js +12 -0
- package/dist/chunks/resolve-agent-team-EIPCH766.js +7 -0
- package/dist/chunks/resolve-deployment-framework-preset-AXXYBFCL.js +7 -0
- package/dist/chunks/restore-Q25KRZPH.js +16 -0
- package/dist/chunks/rm-FWD2NUGX.js +8 -0
- package/dist/chunks/rm-JMQ4QKCC.js +8 -0
- package/dist/chunks/rm-PPG7P3GN.js +8 -0
- package/dist/chunks/rm-SH3DYKNS.js +8 -0
- package/dist/chunks/rm-UEBLKFVC.js +8 -0
- package/dist/chunks/routes-PKTWMDWQ.js +7 -0
- package/dist/chunks/rule-inspect-LKQA5I4V.js +8 -0
- package/dist/chunks/schema-FBV42W7N.js +14 -0
- package/dist/chunks/schema-ZWE5MNMG.js +44 -0
- package/dist/chunks/select-org-WMB752Z6.js +7 -0
- package/dist/chunks/set-UTYIPOLC.js +7 -0
- package/dist/chunks/setup-and-link-ZLY5XQW5.js +7 -0
- package/dist/chunks/skills-RKIGVVNM.js +590 -0
- package/dist/chunks/slugify-NMMUASYK.js +7 -0
- package/dist/chunks/stamp-TKONNIJ5.js +7 -0
- package/dist/chunks/tags-UCLZ5UMX.js +7 -0
- package/dist/chunks/token-W6P2KNI5.js +7 -0
- package/dist/chunks/token-util-JDQI37VN.js +7 -0
- package/dist/chunks/types-YM7TMHXW.js +14 -0
- package/dist/chunks/update-BGDQ5TXO.js +8 -0
- package/dist/chunks/update-route-version-KWK5S4UW.js +7 -0
- package/dist/chunks/utils-IQZEE4DT.js +86 -0
- package/dist/chunks/vlt-builder-graph-XL2XRO4V.js +7 -0
- package/dist/chunks/vlt-builder-importer-RBUPAB6J.js +11 -0
- package/dist/chunks/zod-2C2SXNIK.js +7 -0
- package/dist/commands/build/builder-worker.cjs +281 -0
- package/dist/commands/build/index.js +34 -0
- package/dist/commands/deploy/index.js +72 -0
- package/dist/commands/dev/builder-worker.cjs +110 -0
- package/dist/commands/dev/index.js +157 -0
- package/dist/commands/env/index.js +40 -0
- package/dist/commands/link/index.js +10 -0
- package/dist/commands/list/index.js +14 -0
- package/dist/commands/project/index.js +113 -0
- package/dist/commands-account.js +209 -0
- package/dist/commands-ai.js +200 -0
- package/dist/commands-blob.js +107 -0
- package/dist/commands-core.js +222 -0
- package/dist/commands-deployments.js +84 -0
- package/dist/commands-flags.js +377 -0
- package/dist/commands-integrations.js +143 -0
- package/dist/commands-observability.js +122 -0
- package/dist/commands-routing.js +273 -0
- package/dist/fetch-dist-tags.cjs +60 -0
- package/dist/get-latest-worker.cjs +222 -0
- package/dist/help.js +7 -0
- package/dist/index.js +27 -0
- package/dist/internal-build-worker.js +10 -0
- package/dist/internal-build.js +11 -0
- package/dist/package.json +264 -0
- package/dist/root-help-commands.mjs +1 -0
- package/dist/runtime-assets/dev-tunnel/api/tunnel.ts +443 -0
- package/dist/runtime-assets/dev-tunnel/lib/env.ts +25 -0
- package/dist/runtime-assets/dev-tunnel/lib/tunnel_pb.ts +505 -0
- package/dist/runtime-assets/node-preloads/next-dev-websocket.cjs +220 -0
- package/dist/vc.js +404 -0
- package/dist/version.mjs +2 -0
- package/package.json +224 -14
- package/index.js +0 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{require_isexe}from"./chunk-OPORM35X.js";import{__commonJS,__require}from"./chunk-BZENIQ7N.js";var require_which=__commonJS({"../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js"(exports,module){var isWindows=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",path=__require("path"),COLON=isWindows?";":":",isexe=require_isexe(),getNotFoundError=cmd=>Object.assign(new Error(`not found: ${cmd}`),{code:"ENOENT"}),getPathInfo=(cmd,opt)=>{let colon=opt.colon||COLON,pathEnv=cmd.match(/\//)||isWindows&&cmd.match(/\\/)?[""]:[...isWindows?[process.cwd()]:[],...(opt.path||process.env.PATH||"").split(colon)],pathExtExe=isWindows?opt.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",pathExt=isWindows?pathExtExe.split(colon):[""];return isWindows&&cmd.indexOf(".")!==-1&&pathExt[0]!==""&&pathExt.unshift(""),{pathEnv,pathExt,pathExtExe}},which=(cmd,opt,cb)=>{typeof opt=="function"&&(cb=opt,opt={}),opt||(opt={});let{pathEnv,pathExt,pathExtExe}=getPathInfo(cmd,opt),found=[],step=i=>new Promise((resolve,reject)=>{if(i===pathEnv.length)return opt.all&&found.length?resolve(found):reject(getNotFoundError(cmd));let ppRaw=pathEnv[i],pathPart=/^".*"$/.test(ppRaw)?ppRaw.slice(1,-1):ppRaw,pCmd=path.join(pathPart,cmd),p=!pathPart&&/^\.[\\\/]/.test(cmd)?cmd.slice(0,2)+pCmd:pCmd;resolve(subStep(p,i,0))}),subStep=(p,i,ii)=>new Promise((resolve,reject)=>{if(ii===pathExt.length)return resolve(step(i+1));let ext=pathExt[ii];isexe(p+ext,{pathExt:pathExtExe},(er,is)=>{if(!er&&is)if(opt.all)found.push(p+ext);else return resolve(p+ext);return resolve(subStep(p,i,ii+1))})});return cb?step(0).then(res=>cb(null,res),cb):step(0)},whichSync=(cmd,opt)=>{opt=opt||{};let{pathEnv,pathExt,pathExtExe}=getPathInfo(cmd,opt),found=[];for(let i=0;i<pathEnv.length;i++){let ppRaw=pathEnv[i],pathPart=/^".*"$/.test(ppRaw)?ppRaw.slice(1,-1):ppRaw,pCmd=path.join(pathPart,cmd),p=!pathPart&&/^\.[\\\/]/.test(cmd)?cmd.slice(0,2)+pCmd:pCmd;for(let j=0;j<pathExt.length;j++){let cur=p+pathExt[j];try{if(isexe.sync(cur,{pathExt:pathExtExe}))if(opt.all)found.push(cur);else return cur}catch{}}}if(opt.all&&found.length)return found;if(opt.nothrow)return null;throw getNotFoundError(cmd)};module.exports=which;which.sync=whichSync}});var require_path_key=__commonJS({"../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js"(exports,module){"use strict";var pathKey=(options={})=>{let environment=options.env||process.env;return(options.platform||process.platform)!=="win32"?"PATH":Object.keys(environment).reverse().find(key=>key.toUpperCase()==="PATH")||"Path"};module.exports=pathKey;module.exports.default=pathKey}});var require_resolveCommand=__commonJS({"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports,module){"use strict";var path=__require("path"),which=require_which(),getPathKey=require_path_key();function resolveCommandAttempt(parsed,withoutPathExt){let env=parsed.options.env||process.env,cwd=process.cwd(),hasCustomCwd=parsed.options.cwd!=null,shouldSwitchCwd=hasCustomCwd&&process.chdir!==void 0&&!process.chdir.disabled;if(shouldSwitchCwd)try{process.chdir(parsed.options.cwd)}catch{}let resolved;try{resolved=which.sync(parsed.command,{path:env[getPathKey({env})],pathExt:withoutPathExt?path.delimiter:void 0})}catch{}finally{shouldSwitchCwd&&process.chdir(cwd)}return resolved&&(resolved=path.resolve(hasCustomCwd?parsed.options.cwd:"",resolved)),resolved}function resolveCommand(parsed){return resolveCommandAttempt(parsed)||resolveCommandAttempt(parsed,!0)}module.exports=resolveCommand}});var require_escape=__commonJS({"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js"(exports,module){"use strict";var metaCharsRegExp=/([()\][%!^"`<>&|;, *?])/g;function escapeCommand(arg){return arg=arg.replace(metaCharsRegExp,"^$1"),arg}function escapeArgument(arg,doubleEscapeMetaChars){return arg=`${arg}`,arg=arg.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),arg=arg.replace(/(?=(\\+?)?)\1$/,"$1$1"),arg=`"${arg}"`,arg=arg.replace(metaCharsRegExp,"^$1"),doubleEscapeMetaChars&&(arg=arg.replace(metaCharsRegExp,"^$1")),arg}module.exports.command=escapeCommand;module.exports.argument=escapeArgument}});var require_shebang_regex=__commonJS({"../../node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js"(exports,module){"use strict";module.exports=/^#!(.*)/}});var require_shebang_command=__commonJS({"../../node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js"(exports,module){"use strict";var shebangRegex=require_shebang_regex();module.exports=(string="")=>{let match=string.match(shebangRegex);if(!match)return null;let[path,argument]=match[0].replace(/#! ?/,"").split(" "),binary=path.split("/").pop();return binary==="env"?argument:argument?`${binary} ${argument}`:binary}}});var require_readShebang=__commonJS({"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js"(exports,module){"use strict";var fs=__require("fs"),shebangCommand=require_shebang_command();function readShebang(command){let buffer=Buffer.alloc(150),fd;try{fd=fs.openSync(command,"r"),fs.readSync(fd,buffer,0,150,0),fs.closeSync(fd)}catch{}return shebangCommand(buffer.toString())}module.exports=readShebang}});var require_parse=__commonJS({"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js"(exports,module){"use strict";var path=__require("path"),resolveCommand=require_resolveCommand(),escape=require_escape(),readShebang=require_readShebang(),isWin=process.platform==="win32",isExecutableRegExp=/\.(?:com|exe)$/i,isCmdShimRegExp=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function detectShebang(parsed){parsed.file=resolveCommand(parsed);let shebang=parsed.file&&readShebang(parsed.file);return shebang?(parsed.args.unshift(parsed.file),parsed.command=shebang,resolveCommand(parsed)):parsed.file}function parseNonShell(parsed){if(!isWin)return parsed;let commandFile=detectShebang(parsed),needsShell=!isExecutableRegExp.test(commandFile);if(parsed.options.forceShell||needsShell){let needsDoubleEscapeMetaChars=isCmdShimRegExp.test(commandFile);parsed.command=path.normalize(parsed.command),parsed.command=escape.command(parsed.command),parsed.args=parsed.args.map(arg=>escape.argument(arg,needsDoubleEscapeMetaChars));let shellCommand=[parsed.command].concat(parsed.args).join(" ");parsed.args=["/d","/s","/c",`"${shellCommand}"`],parsed.command=process.env.comspec||"cmd.exe",parsed.options.windowsVerbatimArguments=!0}return parsed}function parse(command,args,options){args&&!Array.isArray(args)&&(options=args,args=null),args=args?args.slice(0):[],options=Object.assign({},options);let parsed={command,args,options,file:void 0,original:{command,args}};return options.shell?parsed:parseNonShell(parsed)}module.exports=parse}});var require_enoent=__commonJS({"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js"(exports,module){"use strict";var isWin=process.platform==="win32";function notFoundError(original,syscall){return Object.assign(new Error(`${syscall} ${original.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${syscall} ${original.command}`,path:original.command,spawnargs:original.args})}function hookChildProcess(cp,parsed){if(!isWin)return;let originalEmit=cp.emit;cp.emit=function(name,arg1){if(name==="exit"){let err=verifyENOENT(arg1,parsed);if(err)return originalEmit.call(cp,"error",err)}return originalEmit.apply(cp,arguments)}}function verifyENOENT(status,parsed){return isWin&&status===1&&!parsed.file?notFoundError(parsed.original,"spawn"):null}function verifyENOENTSync(status,parsed){return isWin&&status===1&&!parsed.file?notFoundError(parsed.original,"spawnSync"):null}module.exports={hookChildProcess,verifyENOENT,verifyENOENTSync,notFoundError}}});var require_cross_spawn=__commonJS({"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js"(exports,module){"use strict";var cp=__require("child_process"),parse=require_parse(),enoent=require_enoent();function spawn(command,args,options){let parsed=parse(command,args,options),spawned=cp.spawn(parsed.command,parsed.args,parsed.options);return enoent.hookChildProcess(spawned,parsed),spawned}function spawnSync(command,args,options){let parsed=parse(command,args,options),result=cp.spawnSync(parsed.command,parsed.args,parsed.options);return result.error=result.error||enoent.verifyENOENTSync(result.status,parsed),result}module.exports=spawn;module.exports.spawn=spawn;module.exports.sync=spawnSync;module.exports._parse=parse;module.exports._enoent=enoent}});var require_strip_final_newline=__commonJS({"../../node_modules/.pnpm/strip-final-newline@2.0.0/node_modules/strip-final-newline/index.js"(exports,module){"use strict";module.exports=input=>{let LF=typeof input=="string"?`
|
|
8
|
+
`:`
|
|
9
|
+
`.charCodeAt(),CR=typeof input=="string"?"\r":"\r".charCodeAt();return input[input.length-1]===LF&&(input=input.slice(0,input.length-1)),input[input.length-1]===CR&&(input=input.slice(0,input.length-1)),input}}});var require_npm_run_path=__commonJS({"../../node_modules/.pnpm/npm-run-path@4.0.1/node_modules/npm-run-path/index.js"(exports,module){"use strict";var path=__require("path"),pathKey=require_path_key(),npmRunPath=options=>{options={cwd:process.cwd(),path:process.env[pathKey()],execPath:process.execPath,...options};let previous,cwdPath=path.resolve(options.cwd),result=[];for(;previous!==cwdPath;)result.push(path.join(cwdPath,"node_modules/.bin")),previous=cwdPath,cwdPath=path.resolve(cwdPath,"..");let execPathDir=path.resolve(options.cwd,options.execPath,"..");return result.push(execPathDir),result.concat(options.path).join(path.delimiter)};module.exports=npmRunPath;module.exports.default=npmRunPath;module.exports.env=options=>{options={env:process.env,...options};let env={...options.env},path2=pathKey({env});return options.path=env[path2],env[path2]=module.exports(options),env}}});var require_mimic_fn=__commonJS({"../../node_modules/.pnpm/mimic-fn@2.1.0/node_modules/mimic-fn/index.js"(exports,module){"use strict";var mimicFn=(to,from)=>{for(let prop of Reflect.ownKeys(from))Object.defineProperty(to,prop,Object.getOwnPropertyDescriptor(from,prop));return to};module.exports=mimicFn;module.exports.default=mimicFn}});var require_onetime=__commonJS({"../../node_modules/.pnpm/onetime@5.1.2/node_modules/onetime/index.js"(exports,module){"use strict";var mimicFn=require_mimic_fn(),calledFunctions=new WeakMap,onetime=(function_,options={})=>{if(typeof function_!="function")throw new TypeError("Expected a function");let returnValue,callCount=0,functionName=function_.displayName||function_.name||"<anonymous>",onetime2=function(...arguments_){if(calledFunctions.set(onetime2,++callCount),callCount===1)returnValue=function_.apply(this,arguments_),function_=null;else if(options.throw===!0)throw new Error(`Function \`${functionName}\` can only be called once`);return returnValue};return mimicFn(onetime2,function_),calledFunctions.set(onetime2,callCount),onetime2};module.exports=onetime;module.exports.default=onetime;module.exports.callCount=function_=>{if(!calledFunctions.has(function_))throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`);return calledFunctions.get(function_)}}});var require_is_stream=__commonJS({"../../node_modules/.pnpm/is-stream@2.0.1/node_modules/is-stream/index.js"(exports,module){"use strict";var isStream=stream=>stream!==null&&typeof stream=="object"&&typeof stream.pipe=="function";isStream.writable=stream=>isStream(stream)&&stream.writable!==!1&&typeof stream._write=="function"&&typeof stream._writableState=="object";isStream.readable=stream=>isStream(stream)&&stream.readable!==!1&&typeof stream._read=="function"&&typeof stream._readableState=="object";isStream.duplex=stream=>isStream.writable(stream)&&isStream.readable(stream);isStream.transform=stream=>isStream.duplex(stream)&&typeof stream._transform=="function";module.exports=isStream}});var require_merge_stream=__commonJS({"../../node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js"(exports,module){"use strict";var{PassThrough}=__require("stream");module.exports=function(){var sources=[],output=new PassThrough({objectMode:!0});return output.setMaxListeners(0),output.add=add,output.isEmpty=isEmpty,output.on("unpipe",remove),Array.prototype.slice.call(arguments).forEach(add),output;function add(source){return Array.isArray(source)?(source.forEach(add),this):(sources.push(source),source.once("end",remove.bind(null,source)),source.once("error",output.emit.bind(output,"error")),source.pipe(output,{end:!1}),this)}function isEmpty(){return sources.length==0}function remove(source){sources=sources.filter(function(it){return it!==source}),!sources.length&&output.readable&&output.end()}}}});export{require_cross_spawn,require_strip_final_newline,require_npm_run_path,require_onetime,require_is_stream,require_merge_stream};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{getProductionUrl}from"./chunk-VT6RIZJH.js";import{output_manager_default}from"./chunk-XP3FT56R.js";var PROTECTION_METHODS=[{setting:"ssoProtection",id:"vercel_authentication",name:"Vercel Authentication"},{setting:"passwordProtection",id:"password",name:"Password Protection"}];async function getEnabledProtection(client,project){try{let settings=await client.fetch(`/v9/projects/${encodeURIComponent(project.id)}`,{accountId:project.accountId});return PROTECTION_METHODS.filter(method=>settings[method.setting]).map(method=>({...method,deploymentType:readDeploymentType(settings[method.setting])}))}catch(err){return output_manager_default.debug(`Could not read Deployment Protection settings: ${err}`),null}}function readDeploymentType(setting){if(setting&&typeof setting=="object"&&"deploymentType"in setting){let{deploymentType}=setting;return typeof deploymentType=="string"?deploymentType:void 0}}var PRODUCTION_DOMAINS_PUBLIC=new Set(["all_except_custom_domains","prod_deployment_urls_and_all_previews","preview"]),PRODUCTION_DEPLOYMENTS_PUBLIC=new Set(["preview"]);function getProtectionForDeployment(methods,deployment){if(!methods)return[];if(deployment.target!=="production")return methods;let publicScopes=getProductionUrl(deployment)?PRODUCTION_DOMAINS_PUBLIC:PRODUCTION_DEPLOYMENTS_PUBLIC;return methods.filter(method=>!method.deploymentType||!publicScopes.has(method.deploymentType))}export{getEnabledProtection,getProtectionForDeployment};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
var LABEL_OVERRIDES={createdAt:"Created",updatedAt:"Updated",deletedAt:"Deleted",expiredAt:"Expired",verifiedAt:"Verified",deployedAt:"Deployed",created_at:"Created",updated_at:"Updated",accountId:"Account Id",projectId:"Project Id",teamId:"Team Id",nodeVersion:"Node Version"};function humanizeIdentifier(raw){let s=raw.trim();return s?s.replace(/([a-z\d])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").split(/[\s_-]+/).filter(Boolean).map(w=>w.charAt(0).toUpperCase()+w.slice(1).toLowerCase()).join(" "):raw}function humanReadableColumnLabel(columnPath){let override=LABEL_OVERRIDES[columnPath];if(override)return override;let parts=columnPath.split(".").filter(Boolean);return parts.length===0?columnPath:parts.length===1?LABEL_OVERRIDES[parts[0]]??humanizeIdentifier(parts[0]):parts.map(p=>LABEL_OVERRIDES[p]??humanizeIdentifier(p)).join(" \u203A ")}export{humanizeIdentifier,humanReadableColumnLabel};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{require_strip_ansi}from"./chunk-BS32OUOC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_strip_ansi=__toESM(require_strip_ansi(),1),CONTROL_CHARACTERS=/[\u0000-\u001F\u007F-\u009F]/g,FORMAT_CHARACTERS=/[\u200B-\u200F\u202A-\u202E\u2060-\u2069\uFEFF]/g;function remoteText(value){return(0,import_strip_ansi.default)(value).replace(/\r?\n/g,"\\n").replace(CONTROL_CHARACTERS,"").replace(FORMAT_CHARACTERS,"")}export{remoteText};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
var indent_default=(input,level)=>{let fill=" ".repeat(level);return`${fill}${input.replace(/\n/g,`
|
|
8
|
+
${fill}`)}`};export{indent_default};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{CertConfigurationError,CertError,DomainNotFound,TooManyRequests}from"./chunk-6VH56CX2.js";function mapCertError(error,cns){let errorCode=error.code;if(errorCode==="too_many_requests"){let retryAfter=typeof error.retryAfterMs=="number"?error.retryAfterMs:0;return new TooManyRequests("certificates",retryAfter)}return errorCode==="not_found"?new DomainNotFound(error.domain):errorCode==="configuration_error"?new CertConfigurationError({cns:cns||error.cns||[],message:error.message,external:error.external,helpUrl:error.helpUrl,type:error.statusCode===449?"http-01":"dns-01"}):errorCode==="bad_domains"||errorCode==="challenge_still_pending"||errorCode==="common_name_domain_name_mismatch"||errorCode==="conflicting_caa_record"||errorCode==="domain_not_verified"||errorCode==="invalid_cn"||errorCode==="invalid_domain"||errorCode==="rate_limited"||errorCode==="should_share_root_domain"||errorCode==="unauthorized_request_error"||errorCode==="unsupported_challenge_priority"||errorCode==="wildcard_not_allowed"||errorCode==="validation_running"||errorCode==="dns_error"||errorCode==="challenge_error"||errorCode==="txt_record_not_found"?new CertError({cns:cns||error.cns||[],code:errorCode,message:error.message,helpUrl:error.helpUrl}):null}export{mapCertError};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
var REPOSITORY_PATTERN=/^[a-z0-9]+(?:(?:\.|_|__|-+)[a-z0-9]+)*$/,TAG_PATTERN=/^[a-zA-Z0-9_][a-zA-Z0-9._-]{0,127}$/,DEFAULT_TAG="latest";function parseNameArg(nameArg,defaultRepo){if(!nameArg)return{repository:defaultRepo,tag:void 0};if(nameArg.includes("/"))return{error:`Invalid image name "${nameArg}". Provide only a repository name (optionally with :tag); the registry, team, and project are added automatically.`};let colon=nameArg.lastIndexOf(":");if(colon===-1)return{repository:nameArg,tag:void 0};let repository=nameArg.slice(0,colon),tag=nameArg.slice(colon+1);return repository?{repository,tag}:{error:`Invalid image name "${nameArg}". Missing repository name before ":".`}}function validateImageParts(parts){if(!REPOSITORY_PATTERN.test(parts.repository))return`Invalid repository name "${parts.repository}". Use lowercase letters, digits, and separators (\`.\` \`_\` \`-\`), for example "my-app". Pass a valid name explicitly, e.g. \`... my-app\`.`;if(parts.tag!==void 0&&!TAG_PATTERN.test(parts.tag))return`Invalid tag "${parts.tag}". Tags may contain letters, digits, "_", ".", "-" and be up to 128 characters.`}function buildRepositoryReference(parts){return`${parts.registry}/${parts.teamSlug}/${parts.projectName}/${parts.repository}`}export{DEFAULT_TAG,parseNameArg,validateImageParts,buildRepositoryReference};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{require_format}from"./chunk-PFD7LETF.js";import{require_ms}from"./chunk-MXTC4ZAQ.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_ms=__toESM(require_ms(),1),import_chalk=__toESM(require_source(),1),import_format=__toESM(require_format(),1);function isMissingDate(value){return value==null||value===""}function formatDate(dateStrOrNumber){if(isMissingDate(dateStrOrNumber))return import_chalk.default.gray("-");let date=new Date(dateStrOrNumber),diff=date.getTime()-Date.now();return diff<0?`${(0,import_format.default)(date,"DD MMMM YYYY HH:mm:ss")} ${import_chalk.default.gray(`[${(0,import_ms.default)(-diff)} ago]`)}`:`${(0,import_format.default)(date,"DD MMMM YYYY HH:mm:ss")} ${import_chalk.default.gray(`[in ${(0,import_ms.default)(diff)}]`)}`}function formatDateWithoutTime(dateStrOrNumber){if(isMissingDate(dateStrOrNumber))return import_chalk.default.gray("-");let date=new Date(dateStrOrNumber),diff=date.getTime()-Date.now();return diff<0?`${(0,import_format.default)(date,"MMM DD YYYY")} ${import_chalk.default.gray(`[${(0,import_ms.default)(-diff)} ago]`)}`:`${(0,import_format.default)(date,"MMM DD YYYY")} ${import_chalk.default.gray(`[in ${(0,import_ms.default)(diff)}]`)}`}export{formatDate,formatDateWithoutTime};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{getErrorRecovery,shouldEmitNonInteractiveCommandError,trackAgentError,writeAgentError}from"./chunk-WDXW6A4H.js";import{buildCorrectedCommand,isArgumentError}from"./chunk-KCKYPLIH.js";import{parseRetryAfterHeaderAsMillis,require_bytes}from"./chunk-6VH56CX2.js";import{getCommandName}from"./chunk-JESNVRVR.js";import{cliErrorFromUnknown,output_manager_default,recordCliError}from"./chunk-XP3FT56R.js";import{pkg_default}from"./chunk-OO572JUC.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);var import_bytes=__toESM(require_bytes(),1);async function responseError(res,fallbackMessage=null,parsedBody={}){let message="",bodyError;if(res.status>=400&&res.status<500){let body;try{body=await res.json()}catch{body=parsedBody}bodyError=body.error||body.err||{},message=bodyError.message}message||(message=fallbackMessage===null?"Response Error":fallbackMessage);let err=new Error(`${message} (${res.status})`);if(err.status=res.status,err.serverMessage=message,bodyError)for(let field of Object.keys(bodyError))field!=="message"&&(err[field]=bodyError[field]);if(res.status===429||res.status===503){let parsed=parseRetryAfterHeaderAsMillis(res.headers.get("Retry-After"));err.retryAfterMs=parsed??(res.status===429?0:void 0)}return err}var MAX_SERIALIZED_ERROR_DEPTH=5;function isPlainObject(value){let proto=Object.getPrototypeOf(value);return proto===null||proto===Object.prototype}function toJsonSafe(value,ancestors,depth){if(typeof value=="bigint")return value.toString();if(!(typeof value=="function"||typeof value=="symbol")){if(value===null||typeof value!="object")return value;if(ancestors.has(value))return"[Circular]";if(depth>=MAX_SERIALIZED_ERROR_DEPTH)return"[Truncated]";if(value instanceof Error)return serializeError(value,ancestors,depth+1);if(!Array.isArray(value)&&!isPlainObject(value))return`[${value.constructor?.name||"Object"}]`;ancestors.add(value);try{if(Array.isArray(value))return value.map(item=>toJsonSafe(item,ancestors,depth+1));let copy={};for(let[key,child]of Object.entries(value))copy[key]=toJsonSafe(child,ancestors,depth+1);return copy}finally{ancestors.delete(value)}}}function serializeError(err,ancestors,depth){ancestors.add(err);try{let enumerable={name:err.name};for(let key of Object.getOwnPropertyNames(err))enumerable[key]=toJsonSafe(err[key],ancestors,depth);return enumerable}finally{ancestors.delete(err)}}function toEnumerableError(err){return err===null||typeof err!="object"?{name:"Error",message:String(err)}:serializeError(err,new WeakSet,0)}function printError(error2,client){typeof error2=="string"&&(error2=new Error(error2)),recordCliError(cliErrorFromUnknown(error2));let apiError=error2,{message,stack,status,code,sizeLimit}=apiError,argumentError=isArgumentError(error2)?error2:void 0,suggestion=argumentError?.suggestedOption&&argumentError.invalidOption,correction=suggestion&&client&&argumentError?buildCorrectedCommand(client.argv,argumentError.invalidOption,argumentError.suggestedOption,argumentError.flagsSpecification):void 0,recovery=getErrorRecovery(apiError,client),reason=status===403?"forbidden":status===402?"payment_required":status===401?"not_authorized":status===429?"rate_limited":argumentError?"invalid_arguments":"api_error",hint=argumentError?.allowedOptions?`Vercel CLI ${pkg_default.version} accepts: ${argumentError.allowedOptions.join(", ")}.${suggestion?` Did you mean ${argumentError.suggestedOption}?`:""}`:recovery.hint;if(client&&(status||argumentError?.allowedOptions)){let payload={...recovery,status:"error",reason,message:apiError.serverMessage||message,hint,...argumentError?.allowedOptions&&{allowedOptions:argumentError.allowedOptions,suggestedOption:argumentError.suggestedOption,cliVersion:pkg_default.version},...correction&&{next:[{command:correction,when:correction.includes("<")?"Replace placeholders with the intended values, then run the corrected command":"Run the corrected command"}]}};if(shouldEmitNonInteractiveCommandError(client)){output_manager_default.stopSpinner(),writeAgentError(client,payload);return}trackAgentError(client,payload)}if(hint){output_manager_default.stopSpinner(),output_manager_default.fatal(apiError.serverMessage||message||"The request failed."),output_manager_default.print(` ${hint}
|
|
8
|
+
`),correction&&output_manager_default.print(` ${correction}
|
|
9
|
+
`);return}output_manager_default.debug(`handling error: ${stack}`),message!=="User force closed the prompt with 0 null"&&(status===403?output_manager_default.error(message||`Authentication error. Run ${getCommandName("login")} to log-in again.`):status===429?output_manager_default.error(message):code==="size_limit_exceeded"?output_manager_default.error(`File size limit exceeded (${(0,import_bytes.default)(sizeLimit)})`):message?output_manager_default.prettyError(apiError):status===500?output_manager_default.error("Unexpected server error. Please retry."):code==="USER_ABORT"?output_manager_default.log("Canceled"):output_manager_default.error(`Unexpected error. Please try again later. (${message})`))}export{responseError,toEnumerableError,printError};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{printProjectNotFoundError}from"./chunk-2TUVL6WE.js";import{param}from"./chunk-3G3FQYMW.js";import{detectExplicitScope}from"./chunk-K5U47EVH.js";import{AGENT_REASON,AGENT_STATUS,buildCommandWithYes,outputActionRequired,outputAgentError}from"./chunk-WDXW6A4H.js";import{getLinkedProject,resolveProjectCwd}from"./chunk-4N6LMERQ.js";import{getCommandName,getCommandNamePlain}from"./chunk-JESNVRVR.js";import{output_manager_default,require_build_utils}from"./chunk-XP3FT56R.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_build_utils=__toESM(require_build_utils(),1);async function ensureLink(commandName,client,cwd,opts={}){opts.singleFile||(cwd=await resolveProjectCwd(cwd));let link=opts.link,nonInteractive=opts.nonInteractive??client.nonInteractive??!1;if(opts.nonInteractive=nonInteractive,link||(opts.forceDelete?link={status:"not_linked",org:null,project:null}:link=await getLinkedProject(client,{cwd,projectName:opts.projectName,projectNameIsExplicit:!!(opts.projectName&&opts.failIfNotFound),scopeIsExplicit:detectExplicitScope(client),allowOwnerLookupFallback:opts.allowOwnerLookupFallback,skipOwnerLookup:opts.skipOwnerLookup,skipRemoteLookup:opts.skipRemoteLookup,skipProjectRootResolution:!!opts.singleFile}),opts.link=link),link.status==="linked"&&opts.forceDelete||link.status==="not_linked"){if(link.status==="not_linked"&&opts.failIfNotFound&&opts.projectName){let pinnedProjectId=(0,import_build_utils.getPlatformEnv)("PROJECT_ID"),creatable=!opts.projectName.startsWith("prj_")&&!pinnedProjectId;if(!opts.createIfNotFound||opts.projectName.startsWith("prj_")||pinnedProjectId===opts.projectName)return await printProjectNotFoundError(client,opts.projectName,commandName,link.orgId,{createCommand:creatable?opts.createCommand:void 0}),1;if(pinnedProjectId){let message=`Can't use --project with VERCEL_PROJECT_ID. --project is "${opts.projectName}" and VERCEL_PROJECT_ID is "${pinnedProjectId}". Remove one of them.`,helpCommand=getCommandNamePlain(`${commandName} --help`);return output_manager_default.error(`${message}
|
|
8
|
+
|
|
9
|
+
See all options:
|
|
10
|
+
${helpCommand}`),outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.INVALID_ARGUMENTS,message,next:[{command:helpCommand,when:"see all options"}]}),2}}if(link.status==="not_linked"&&opts.requireExistingLink)return output_manager_default.error(`Project is not linked. Run ${getCommandName("link")} first.`),1;let{default:setupAndLink}=await import("./setup-and-link-ZLY5XQW5.js");if(link=await setupAndLink(client,cwd,opts),link.status==="not_linked")return 0}return link.status==="error"?(link.reason==="HEADLESS"&&(nonInteractive?outputActionRequired(client,{status:"action_required",reason:"confirmation_required",message:`Command ${getCommandNamePlain(commandName)} requires confirmation. Use option --yes to confirm.`,next:[{command:buildCommandWithYes(client.argv),when:"Confirm and run"}]},link.exitCode):output_manager_default.error(`Command ${getCommandName(commandName)} requires confirmation. Use option ${param("--yes")} to confirm.`)),nonInteractive&&process.exit(link.exitCode),link.exitCode):link}export{ensureLink};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{require_strip_ansi}from"./chunk-BS32OUOC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_strip_ansi=__toESM(require_strip_ansi(),1);function truncateEnd(value,maxLength,opts={}){let omission=opts.omission??"...";return value.length<=maxLength?value:maxLength<=omission.length?value.slice(0,maxLength):`${value.slice(0,maxLength-omission.length)}${omission}`}function truncateMiddle(value,maxLength,opts={}){let omission=opts.omission??"...",comparable=opts.useVisibleLength?(0,import_strip_ansi.default)(value):value;if(comparable.length<=maxLength)return value;if(maxLength<=omission.length)return comparable.slice(0,maxLength);let available=maxLength-omission.length,start=Math.ceil(available/2),end=Math.floor(available/2);return`${comparable.slice(0,start)}${omission}${comparable.slice(comparable.length-end)}`}function ellipsizeMiddle(value,maxLength,useVisibleLength=!1){return truncateMiddle(value,maxLength,{omission:"\u2026",useVisibleLength})}export{truncateEnd,truncateMiddle,ellipsizeMiddle};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{getScope}from"./chunk-K5U47EVH.js";import{sleep}from"./chunk-4N6LMERQ.js";import{DomainChargeOutcomeUnknown,DomainNotAvailable,DomainPaymentError,DomainPriceChanged,DomainPurchaseRefundFailed,DomainPurchaseRefunded,InvalidDomain,TLDNotSupportedViaCLI,UnexpectedDomainPurchaseError,UnsupportedTLD,isAPIError}from"./chunk-6VH56CX2.js";import{output_manager_default}from"./chunk-XP3FT56R.js";async function getDomainPrice(client,name){try{return await client.fetch(`/v1/registrar/domains/${name}/price`)}catch(err){if(isAPIError(err)){if(err.code==="tld_not_supported")return new UnsupportedTLD(name);if(err.status<500)return err}throw err}}async function getDomainStatus(client,domain){return client.fetch(`/v1/registrar/domains/${encodeURIComponent(domain)}/availability`)}function getOrderOutcome(order,domain){let item=order.domains.find(d=>d.domainName===domain);return order.status==="completed"&&item?.status==="completed"?"completed":order.error?.code==="payment-failed"?"payment_failed":item?.status==="refund-failed"?"refund_failed":item?.status==="refunded"?"refunded":item?.status==="failed"?"failed":"unknown"}async function getOrder(client,orderId){let{team}=await getScope(client),teamParam=team?`?teamId=${team.slug}`:"";try{return await client.fetch(`/v1/registrar/orders/${orderId}${teamParam}`)}catch(err){if(isAPIError(err)){if(err.code==="not_found")return null;if(err.status<500)return err}throw err}}var pollForOrder=async(client,orderId,timeoutMs=1e4)=>{let startTime=Date.now();for(;Date.now()-startTime<timeoutMs;){let order=await getOrder(client,orderId);if(order!==null&&(order.status==="completed"||order.status==="failed"))return order;await sleep(500)}return null};async function purchaseDomain(client,name,expectedPrice,years,autoRenew=!0,contactInformation){let{team}=await getScope(client),teamParam=team?`?teamId=${team.slug}`:"",orderId;try{({orderId}=await client.fetch(`/v1/registrar/domains/${name}/buy${teamParam}`,{body:{expectedPrice,autoRenew,years,contactInformation},method:"POST",retry:{retries:0},bailOn429:!0}))}catch(err){if(isAPIError(err)&&err.status<500){if(err.code==="invalid_domain")return new InvalidDomain(name);if(err.code==="domain_not_available")return new DomainNotAvailable(name);if(err.code==="tld_not_supported")return new UnsupportedTLD(name);if(err.code==="additional_contact_info_required")return new TLDNotSupportedViaCLI(name);if(err.code==="expected_price_mismatch")return new DomainPriceChanged(name);throw err}return new DomainChargeOutcomeUnknown(name,"buy")}let order;try{order=await pollForOrder(client,orderId)}catch{order=null}if(order===null)return new DomainChargeOutcomeUnknown(name,"buy");switch(getOrderOutcome(order,name)){case"completed":return{orderId};case"payment_failed":return new DomainPaymentError;case"refund_failed":return new DomainPurchaseRefundFailed(name);case"refunded":return new DomainPurchaseRefunded(name);case"failed":return new UnexpectedDomainPurchaseError(name);case"unknown":return new DomainChargeOutcomeUnknown(name,"buy")}}var CONTACT_FIELDS=[{field:"firstName",flag:"--first-name",label:"First name",prompt:"First name:",validate:val=>val.length>0||"First name is required"},{field:"lastName",flag:"--last-name",label:"Last name",prompt:"Last name:",validate:val=>val.length>0||"Last name is required"},{field:"email",flag:"--email",label:"Email",prompt:"Email:",validate:val=>val.length===0?"Email is required":/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(val)?!0:"Invalid email format"},{field:"phone",flag:"--phone",label:"Phone",prompt:"Phone (include country code, e.g., +15551234567):",validate:val=>val.length===0?"Phone is required":/^\+\d{10,15}$/.test(val)?!0:"Phone must start with + and contain 10-15 digits"},{field:"address1",flag:"--address",label:"Address",prompt:"Address:",validate:val=>val.length>0||"Address is required"},{field:"city",flag:"--city",label:"City",prompt:"City:",validate:val=>val.length>0||"City is required"},{field:"state",flag:"--state",label:"State",prompt:"State/Province:",validate:val=>val.length>0||"State/Province is required"},{field:"zip",flag:"--zip",label:"ZIP",prompt:"Postal/ZIP code:",validate:val=>val.length>0||"Postal/ZIP code is required"},{field:"country",flag:"--country",label:"Country",prompt:"Country code (2 letters, e.g., US):",validate:val=>val.length===0?"Country code is required":/^[A-Z]{2}$/i.test(val)?!0:"Country code must be 2 letters"},{field:"companyName",flag:"--company",label:"Company",prompt:"Company name (optional):"}],ADDRESS_FIELDS=new Set(["address1","city","state","zip","country"]);function readContactFlags(flags){let contact={};for(let{field,flag,validate}of CONTACT_FIELDS){let raw=flags[flag];if(typeof raw!="string")continue;let value=raw.trim(),result=validate?validate(value):!0;if(result!==!0)return`Invalid ${flag}. ${result}.`;contact[field]=field==="country"?value.toUpperCase():value}return contact}function getBillingContact(team){let billing=team?.billing;if(!billing)return{};let address=billing.address,line1=address?.line1?.trim(),line2=address?.line2?.trim(),country=address?.country?.trim().toUpperCase(),rawState=address?.state?.trim(),state=country&&rawState?.toUpperCase().startsWith(`${country}-`)?rawState.slice(country.length+1):rawState,candidates={email:billing.email,address1:line1&&line2?`${line1}, ${line2}`:line1,city:address?.city,state:country==="US"&&!/^[A-Z]{2}$/i.test(state??"")?"":state,zip:address?.postalCode,country},contact={};for(let{field,validate}of CONTACT_FIELDS){let value=candidates[field]?.trim();value&&(!validate||validate(value)===!0)&&(contact[field]=value)}return contact}function mergeContact(fromFlags,billing){let ownAddress=[...ADDRESS_FIELDS].some(field=>fromFlags[field]!==void 0&&billing[field]!==void 0),merged={};for(let{field}of CONTACT_FIELDS){let fallback=ownAddress&&ADDRESS_FIELDS.has(field)?void 0:billing[field],value=fromFlags[field]??fallback;value!==void 0&&(merged[field]=value)}return merged}function billingFieldsUsed(fromFlags,billing){let merged=mergeContact(fromFlags,billing),used={};for(let{field}of CONTACT_FIELDS)fromFlags[field]===void 0&&merged[field]!==void 0&&(used[field]=merged[field]);return used}function missingContactFields(contact){return CONTACT_FIELDS.filter(({field,validate})=>validate&&!contact[field]).map(({field})=>field)}async function collectContactInformation(client,{provided={},defaults={}}={}){let contact={...provided},pending=CONTACT_FIELDS.filter(({field})=>!(field in provided));pending.length>0&&(output_manager_default.log(""),output_manager_default.log("Please provide contact information for domain registration:"));for(let{field,prompt,validate}of pending){let value=await client.input.text({message:prompt,default:defaults[field],validate});value&&(contact[field]=value)}return{...contact,country:contact.country.toUpperCase(),companyName:contact.companyName||void 0}}export{getDomainPrice,getDomainStatus,getOrderOutcome,pollForOrder,purchaseDomain,CONTACT_FIELDS,readContactFlags,getBillingContact,mergeContact,billingFieldsUsed,missingContactFields,collectContactInformation};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
function canPrompt(client){return!!client.stdin.isTTY&&!client.nonInteractive}function canPromptOnTerminal(client){return canPrompt(client)&&!!client.stderr.isTTY&&!process.env.CI}export{canPrompt,canPromptOnTerminal};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{Separator}from"./chunk-MVGTMPMI.js";import{require_strip_ansi}from"./chunk-BS32OUOC.js";import{isAPIError}from"./chunk-6VH56CX2.js";import{eraseLines,link_default,output_manager_default}from"./chunk-XP3FT56R.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);import{URL}from"url";var import_strip_ansi=__toESM(require_strip_ansi(),1);function getLength(input){let biggestLength=0;for(let line of input.split(`
|
|
8
|
+
`)){let str=(0,import_strip_ansi.default)(line);str.length>biggestLength&&(biggestLength=str.length)}return biggestLength}async function list(client,{message="the question",choices:_choices=[{name:`something
|
|
9
|
+
description
|
|
10
|
+
details
|
|
11
|
+
etc`,value:"something unique",short:"generally the first line of `name`"}],pageSize=15,separator=!1,cancel="end",eraseFinalAnswer=!1}){let biggestLength=0,selected;for(let choice of _choices)if("name"in choice){let length=getLength(choice.name);length>biggestLength&&(biggestLength=length)}else if(choice&&typeof choice=="object"&&"separator"in choice){let length=getLength(`\u2500\u2500 ${choice.separator} `);length>biggestLength&&(biggestLength=length)}let choices=_choices.map(choice=>{if(choice instanceof Separator)return choice;if("separator"in choice){let prefix=`\u2500\u2500 ${choice.separator} `,suffix="\u2500".repeat(Math.max(0,biggestLength-getLength(prefix)));return new Separator(`${prefix}${suffix}`)}if("short"in choice){if(choice.selected){if(selected)throw new Error("Only one choice may be selected");selected=choice.short}return choice}throw new Error("Invalid choice")});if(separator)for(let i=0;i<choices.length;i+=2)choices.splice(i,0,new Separator(" "));let cancelSeparator=new Separator("\u2500".repeat(biggestLength)),_cancel={name:"Cancel",value:"",short:""};cancel==="start"?choices.unshift(_cancel,cancelSeparator):choices.push(cancelSeparator,_cancel);let answer=await client.input.select({message,choices,pageSize,default:selected});return eraseFinalAnswer===!0&&process.stdout.write(eraseLines(2)),answer}async function disconnectGitProvider(client,org,projectId){let fetchUrl=`/v9/projects/${projectId}/link`;return client.fetch(fetchUrl,{method:"DELETE",headers:{"Content-Type":"application/json"}})}async function connectGitProvider(client,projectId,type,repo){let fetchUrl=`/v9/projects/${projectId}/link`;try{return await client.fetch(fetchUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type,repo})})}catch(err){let apiError=isAPIError(err);if(apiError&&(err.action==="Install GitHub App"||err.code==="repo_not_found"))output_manager_default.error(`Failed to connect ${import_chalk.default.cyan(repo)} to project. Make sure there aren't any typos and that you have access to the repository if it's private.`);else if(apiError&&err.code==="repo_links_exceeded_limit"){let ctaLabel,ctaUrl;typeof err.ctaLabel=="string"&&typeof err.ctaUrl=="string"?(ctaLabel=err.ctaLabel,ctaUrl=err.ctaUrl):typeof err.action=="string"&&typeof err.link=="string"&&(ctaLabel=err.action,ctaUrl=err.link);let message=err.message;ctaLabel&&ctaUrl&&(message+=`
|
|
12
|
+
${ctaLabel}: ${link_default(ctaUrl)}`),output_manager_default.error(message)}else apiError&&err.action==="Add a Login Connection"?output_manager_default.error(err.message.replace(repo,import_chalk.default.cyan(repo))+`
|
|
13
|
+
Visit ${link_default(err.link)} for more information.`):output_manager_default.error(`Failed to connect the ${formatProvider(type)} repository ${repo}.
|
|
14
|
+
${err}`);return 1}}function formatProvider(type){switch(type){case"github":return"GitHub";case"gitlab":return"GitLab";case"bitbucket":return"Bitbucket";default:return type}}function buildRepoUrl(provider,org,repo){switch(provider){case"github":return`https://github.com/${org}/${repo}`;case"gitlab":return`https://gitlab.com/${org}/${repo}`;case"bitbucket":return`https://bitbucket.org/${org}/${repo}`;default:return null}}function getURL(input){let url=null;try{url=new URL(input)}catch{}if(!url)try{url=new URL(`ssh://${input.replace(":","/")}`)}catch{}return url}function parseRepoUrl(originUrl){let url=getURL(originUrl);if(!url)return null;let hostParts=url.hostname.split(".");if(hostParts.length<2)return null;let provider=hostParts[hostParts.length-2],pathParts=url.pathname.split("/").filter(Boolean);if(pathParts.length<2)return null;let repo=pathParts.pop()?.replace(/\.git$/,"");if(!repo)return null;let org=pathParts.join("/");return{url:originUrl,provider,org,repo}}function printRemoteUrls(remoteUrls){for(let[name,url]of Object.entries(remoteUrls))output_manager_default.print(` \u2022 ${name}: ${import_chalk.default.cyan(url)}
|
|
15
|
+
`)}async function selectRemoteUrl(client,remoteUrls){let choices=[];for(let[urlKey,urlValue]of Object.entries(remoteUrls))choices.push({name:`${urlValue} ${import_chalk.default.gray(`(${urlKey})`)}`,value:urlValue,short:urlKey});return await list(client,{message:"Which remote do you want to connect?",choices})}async function selectAndParseRemoteUrl(client,remoteUrls){let remoteUrl;if(Object.keys(remoteUrls).length>1?(output_manager_default.log("Found multiple remote URLs."),remoteUrl=await selectRemoteUrl(client,remoteUrls)):remoteUrl=Object.values(remoteUrls)[0],remoteUrl==="")return output_manager_default.log("Canceled"),null;let repoInfo=parseRepoUrl(remoteUrl);return repoInfo||(output_manager_default.log(`Connecting Git repository: ${import_chalk.default.cyan(remoteUrl)}`),output_manager_default.error(`Failed to parse Git repo data from the following remote URL: ${link_default(remoteUrl)}`),null)}async function checkExistsAndConnect({client,confirm,org,project,gitProviderLink,provider,repoPath,gitOrg,repo}){let displayUrl=buildRepoUrl(provider,gitOrg,repo)||repoPath;if(output_manager_default.log(`Connecting ${formatProvider(provider)} repository: ${import_chalk.default.cyan(displayUrl)}`),gitProviderLink){let connectedProvider=gitProviderLink.type,connectedOrg=gitProviderLink.org,connectedRepo=gitProviderLink.repo,connectedRepoPath=`${connectedOrg}/${connectedRepo}`;if(connectedProvider===provider&&connectedOrg===gitOrg&&connectedRepo===repo)return output_manager_default.log(`${import_chalk.default.cyan(connectedRepoPath)} is already connected to your project.`),1;if(!await confirmRepoConnect(client,confirm,connectedProvider,connectedRepoPath))return 0;await disconnectGitProvider(client,org,project.id);let connect=await connectGitProvider(client,project.id,provider,repoPath);if(typeof connect=="number")return connect}else{let connect=await connectGitProvider(client,project.id,provider,repoPath);if(typeof connect=="number")return connect}output_manager_default.log("Connected")}async function confirmRepoConnect(client,yes,connectedProvider,connectedRepoPath){let shouldReplaceProject=yes;return shouldReplaceProject||(shouldReplaceProject=await client.input.confirm(`Looks like you already have a ${formatProvider(connectedProvider)} repository connected: ${import_chalk.default.cyan(connectedRepoPath)}. Do you want to replace it?`,!0),shouldReplaceProject||output_manager_default.log("Canceled. Repo not connected.")),shouldReplaceProject}export{list,disconnectGitProvider,connectGitProvider,formatProvider,buildRepoUrl,parseRepoUrl,printRemoteUrls,selectRemoteUrl,selectAndParseRemoteUrl,checkExistsAndConnect};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{__commonJS,__require}from"./chunk-BZENIQ7N.js";var require_has_flag=__commonJS({"../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js"(exports,module){"use strict";module.exports=(flag,argv=process.argv)=>{let prefix=flag.startsWith("-")?"":flag.length===1?"-":"--",position=argv.indexOf(prefix+flag),terminatorPosition=argv.indexOf("--");return position!==-1&&(terminatorPosition===-1||position<terminatorPosition)}}});var require_supports_color=__commonJS({"../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js"(exports,module){"use strict";var os=__require("os"),tty=__require("tty"),hasFlag=require_has_flag(),{env}=process,forceColor;hasFlag("no-color")||hasFlag("no-colors")||hasFlag("color=false")||hasFlag("color=never")?forceColor=0:(hasFlag("color")||hasFlag("colors")||hasFlag("color=true")||hasFlag("color=always"))&&(forceColor=1);"FORCE_COLOR"in env&&(env.FORCE_COLOR==="true"?forceColor=1:env.FORCE_COLOR==="false"?forceColor=0:forceColor=env.FORCE_COLOR.length===0?1:Math.min(parseInt(env.FORCE_COLOR,10),3));function translateLevel(level){return level===0?!1:{level,hasBasic:!0,has256:level>=2,has16m:level>=3}}function supportsColor(haveStream,streamIsTTY){if(forceColor===0)return 0;if(hasFlag("color=16m")||hasFlag("color=full")||hasFlag("color=truecolor"))return 3;if(hasFlag("color=256"))return 2;if(haveStream&&!streamIsTTY&&forceColor===void 0)return 0;let min=forceColor||0;if(env.TERM==="dumb")return min;if(process.platform==="win32"){let osRelease=os.release().split(".");return Number(osRelease[0])>=10&&Number(osRelease[2])>=10586?Number(osRelease[2])>=14931?3:2:1}if("CI"in env)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(sign=>sign in env)||env.CI_NAME==="codeship"?1:min;if("TEAMCITY_VERSION"in env)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION)?1:0;if(env.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in env){let version=parseInt((env.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(env.TERM_PROGRAM){case"iTerm.app":return version>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(env.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)||"COLORTERM"in env?1:min}function getSupportLevel(stream){let level=supportsColor(stream,stream&&stream.isTTY);return translateLevel(level)}module.exports={supportsColor:getSupportLevel,stdout:translateLevel(supportsColor(!0,tty.isatty(1))),stderr:translateLevel(supportsColor(!0,tty.isatty(2)))}}});export{require_has_flag,require_supports_color};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
function formatGranularity(value){if(!value||typeof value!="object")return;let granularity=value;if(typeof granularity.minutes=="number")return`${granularity.minutes}m`;if(typeof granularity.hours=="number")return`${granularity.hours}h`;if(typeof granularity.days=="number")return`${granularity.days}d`}export{formatGranularity};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{__esm}from"./chunk-BZENIQ7N.js";function createScanner(text,ignoreTrivia=!1){let len=text.length,pos=0,value="",tokenOffset=0,token=16,lineNumber=0,lineStartOffset=0,tokenLineStartOffset=0,prevTokenLineStartOffset=0,scanError=0;function scanHexDigits(count,exact){let digits=0,value2=0;for(;digits<count||!exact;){let ch=text.charCodeAt(pos);if(ch>=48&&ch<=57)value2=value2*16+ch-48;else if(ch>=65&&ch<=70)value2=value2*16+ch-65+10;else if(ch>=97&&ch<=102)value2=value2*16+ch-97+10;else break;pos++,digits++}return digits<count&&(value2=-1),value2}function setPosition(newPosition){pos=newPosition,value="",tokenOffset=0,token=16,scanError=0}function scanNumber(){let start=pos;if(text.charCodeAt(pos)===48)pos++;else for(pos++;pos<text.length&&isDigit(text.charCodeAt(pos));)pos++;if(pos<text.length&&text.charCodeAt(pos)===46)if(pos++,pos<text.length&&isDigit(text.charCodeAt(pos)))for(pos++;pos<text.length&&isDigit(text.charCodeAt(pos));)pos++;else return scanError=3,text.substring(start,pos);let end=pos;if(pos<text.length&&(text.charCodeAt(pos)===69||text.charCodeAt(pos)===101))if(pos++,(pos<text.length&&text.charCodeAt(pos)===43||text.charCodeAt(pos)===45)&&pos++,pos<text.length&&isDigit(text.charCodeAt(pos))){for(pos++;pos<text.length&&isDigit(text.charCodeAt(pos));)pos++;end=pos}else scanError=3;return text.substring(start,end)}function scanString(){let result="",start=pos;for(;;){if(pos>=len){result+=text.substring(start,pos),scanError=2;break}let ch=text.charCodeAt(pos);if(ch===34){result+=text.substring(start,pos),pos++;break}if(ch===92){if(result+=text.substring(start,pos),pos++,pos>=len){scanError=2;break}switch(text.charCodeAt(pos++)){case 34:result+='"';break;case 92:result+="\\";break;case 47:result+="/";break;case 98:result+="\b";break;case 102:result+="\f";break;case 110:result+=`
|
|
8
|
+
`;break;case 114:result+="\r";break;case 116:result+=" ";break;case 117:let ch3=scanHexDigits(4,!0);ch3>=0?result+=String.fromCharCode(ch3):scanError=4;break;default:scanError=5}start=pos;continue}if(ch>=0&&ch<=31)if(isLineBreak(ch)){result+=text.substring(start,pos),scanError=2;break}else scanError=6;pos++}return result}function scanNext(){if(value="",scanError=0,tokenOffset=pos,lineStartOffset=lineNumber,prevTokenLineStartOffset=tokenLineStartOffset,pos>=len)return tokenOffset=len,token=17;let code=text.charCodeAt(pos);if(isWhiteSpace(code)){do pos++,value+=String.fromCharCode(code),code=text.charCodeAt(pos);while(isWhiteSpace(code));return token=15}if(isLineBreak(code))return pos++,value+=String.fromCharCode(code),code===13&&text.charCodeAt(pos)===10&&(pos++,value+=`
|
|
9
|
+
`),lineNumber++,tokenLineStartOffset=pos,token=14;switch(code){case 123:return pos++,token=1;case 125:return pos++,token=2;case 91:return pos++,token=3;case 93:return pos++,token=4;case 58:return pos++,token=6;case 44:return pos++,token=5;case 34:return pos++,value=scanString(),token=10;case 47:let start=pos-1;if(text.charCodeAt(pos+1)===47){for(pos+=2;pos<len&&!isLineBreak(text.charCodeAt(pos));)pos++;return value=text.substring(start,pos),token=12}if(text.charCodeAt(pos+1)===42){pos+=2;let safeLength=len-1,commentClosed=!1;for(;pos<safeLength;){let ch=text.charCodeAt(pos);if(ch===42&&text.charCodeAt(pos+1)===47){pos+=2,commentClosed=!0;break}pos++,isLineBreak(ch)&&(ch===13&&text.charCodeAt(pos)===10&&pos++,lineNumber++,tokenLineStartOffset=pos)}return commentClosed||(pos++,scanError=1),value=text.substring(start,pos),token=13}return value+=String.fromCharCode(code),pos++,token=16;case 45:if(value+=String.fromCharCode(code),pos++,pos===len||!isDigit(text.charCodeAt(pos)))return token=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return value+=scanNumber(),token=11;default:for(;pos<len&&isUnknownContentCharacter(code);)pos++,code=text.charCodeAt(pos);if(tokenOffset!==pos){switch(value=text.substring(tokenOffset,pos),value){case"true":return token=8;case"false":return token=9;case"null":return token=7}return token=16}return value+=String.fromCharCode(code),pos++,token=16}}function isUnknownContentCharacter(code){if(isWhiteSpace(code)||isLineBreak(code))return!1;switch(code){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function scanNextNonTrivia(){let result;do result=scanNext();while(result>=12&&result<=15);return result}return{setPosition,getPosition:()=>pos,scan:ignoreTrivia?scanNextNonTrivia:scanNext,getToken:()=>token,getTokenValue:()=>value,getTokenOffset:()=>tokenOffset,getTokenLength:()=>pos-tokenOffset,getTokenStartLine:()=>lineStartOffset,getTokenStartCharacter:()=>tokenOffset-prevTokenLineStartOffset,getTokenError:()=>scanError}}function isWhiteSpace(ch){return ch===32||ch===9}function isLineBreak(ch){return ch===10||ch===13}function isDigit(ch){return ch>=48&&ch<=57}var CharacterCodes,init_scanner=__esm({"../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/scanner.js"(){"use strict";(function(CharacterCodes2){CharacterCodes2[CharacterCodes2.lineFeed=10]="lineFeed",CharacterCodes2[CharacterCodes2.carriageReturn=13]="carriageReturn",CharacterCodes2[CharacterCodes2.space=32]="space",CharacterCodes2[CharacterCodes2._0=48]="_0",CharacterCodes2[CharacterCodes2._1=49]="_1",CharacterCodes2[CharacterCodes2._2=50]="_2",CharacterCodes2[CharacterCodes2._3=51]="_3",CharacterCodes2[CharacterCodes2._4=52]="_4",CharacterCodes2[CharacterCodes2._5=53]="_5",CharacterCodes2[CharacterCodes2._6=54]="_6",CharacterCodes2[CharacterCodes2._7=55]="_7",CharacterCodes2[CharacterCodes2._8=56]="_8",CharacterCodes2[CharacterCodes2._9=57]="_9",CharacterCodes2[CharacterCodes2.a=97]="a",CharacterCodes2[CharacterCodes2.b=98]="b",CharacterCodes2[CharacterCodes2.c=99]="c",CharacterCodes2[CharacterCodes2.d=100]="d",CharacterCodes2[CharacterCodes2.e=101]="e",CharacterCodes2[CharacterCodes2.f=102]="f",CharacterCodes2[CharacterCodes2.g=103]="g",CharacterCodes2[CharacterCodes2.h=104]="h",CharacterCodes2[CharacterCodes2.i=105]="i",CharacterCodes2[CharacterCodes2.j=106]="j",CharacterCodes2[CharacterCodes2.k=107]="k",CharacterCodes2[CharacterCodes2.l=108]="l",CharacterCodes2[CharacterCodes2.m=109]="m",CharacterCodes2[CharacterCodes2.n=110]="n",CharacterCodes2[CharacterCodes2.o=111]="o",CharacterCodes2[CharacterCodes2.p=112]="p",CharacterCodes2[CharacterCodes2.q=113]="q",CharacterCodes2[CharacterCodes2.r=114]="r",CharacterCodes2[CharacterCodes2.s=115]="s",CharacterCodes2[CharacterCodes2.t=116]="t",CharacterCodes2[CharacterCodes2.u=117]="u",CharacterCodes2[CharacterCodes2.v=118]="v",CharacterCodes2[CharacterCodes2.w=119]="w",CharacterCodes2[CharacterCodes2.x=120]="x",CharacterCodes2[CharacterCodes2.y=121]="y",CharacterCodes2[CharacterCodes2.z=122]="z",CharacterCodes2[CharacterCodes2.A=65]="A",CharacterCodes2[CharacterCodes2.B=66]="B",CharacterCodes2[CharacterCodes2.C=67]="C",CharacterCodes2[CharacterCodes2.D=68]="D",CharacterCodes2[CharacterCodes2.E=69]="E",CharacterCodes2[CharacterCodes2.F=70]="F",CharacterCodes2[CharacterCodes2.G=71]="G",CharacterCodes2[CharacterCodes2.H=72]="H",CharacterCodes2[CharacterCodes2.I=73]="I",CharacterCodes2[CharacterCodes2.J=74]="J",CharacterCodes2[CharacterCodes2.K=75]="K",CharacterCodes2[CharacterCodes2.L=76]="L",CharacterCodes2[CharacterCodes2.M=77]="M",CharacterCodes2[CharacterCodes2.N=78]="N",CharacterCodes2[CharacterCodes2.O=79]="O",CharacterCodes2[CharacterCodes2.P=80]="P",CharacterCodes2[CharacterCodes2.Q=81]="Q",CharacterCodes2[CharacterCodes2.R=82]="R",CharacterCodes2[CharacterCodes2.S=83]="S",CharacterCodes2[CharacterCodes2.T=84]="T",CharacterCodes2[CharacterCodes2.U=85]="U",CharacterCodes2[CharacterCodes2.V=86]="V",CharacterCodes2[CharacterCodes2.W=87]="W",CharacterCodes2[CharacterCodes2.X=88]="X",CharacterCodes2[CharacterCodes2.Y=89]="Y",CharacterCodes2[CharacterCodes2.Z=90]="Z",CharacterCodes2[CharacterCodes2.asterisk=42]="asterisk",CharacterCodes2[CharacterCodes2.backslash=92]="backslash",CharacterCodes2[CharacterCodes2.closeBrace=125]="closeBrace",CharacterCodes2[CharacterCodes2.closeBracket=93]="closeBracket",CharacterCodes2[CharacterCodes2.colon=58]="colon",CharacterCodes2[CharacterCodes2.comma=44]="comma",CharacterCodes2[CharacterCodes2.dot=46]="dot",CharacterCodes2[CharacterCodes2.doubleQuote=34]="doubleQuote",CharacterCodes2[CharacterCodes2.minus=45]="minus",CharacterCodes2[CharacterCodes2.openBrace=123]="openBrace",CharacterCodes2[CharacterCodes2.openBracket=91]="openBracket",CharacterCodes2[CharacterCodes2.plus=43]="plus",CharacterCodes2[CharacterCodes2.slash=47]="slash",CharacterCodes2[CharacterCodes2.formFeed=12]="formFeed",CharacterCodes2[CharacterCodes2.tab=9]="tab"})(CharacterCodes||(CharacterCodes={}))}});var cachedSpaces,maxCachedValues,cachedBreakLinesWithSpaces,supportedEols,init_string_intern=__esm({"../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/string-intern.js"(){cachedSpaces=new Array(20).fill(0).map((_,index)=>" ".repeat(index)),maxCachedValues=200,cachedBreakLinesWithSpaces={" ":{"\n":new Array(maxCachedValues).fill(0).map((_,index)=>`
|
|
10
|
+
`+" ".repeat(index)),"\r":new Array(maxCachedValues).fill(0).map((_,index)=>"\r"+" ".repeat(index)),"\r\n":new Array(maxCachedValues).fill(0).map((_,index)=>`\r
|
|
11
|
+
`+" ".repeat(index))}," ":{"\n":new Array(maxCachedValues).fill(0).map((_,index)=>`
|
|
12
|
+
`+" ".repeat(index)),"\r":new Array(maxCachedValues).fill(0).map((_,index)=>"\r"+" ".repeat(index)),"\r\n":new Array(maxCachedValues).fill(0).map((_,index)=>`\r
|
|
13
|
+
`+" ".repeat(index))}},supportedEols=[`
|
|
14
|
+
`,"\r",`\r
|
|
15
|
+
`]}});function format(documentText,range,options){let initialIndentLevel,formatText,formatTextStart,rangeStart,rangeEnd;if(range){for(rangeStart=range.offset,rangeEnd=rangeStart+range.length,formatTextStart=rangeStart;formatTextStart>0&&!isEOL(documentText,formatTextStart-1);)formatTextStart--;let endOffset=rangeEnd;for(;endOffset<documentText.length&&!isEOL(documentText,endOffset);)endOffset++;formatText=documentText.substring(formatTextStart,endOffset),initialIndentLevel=computeIndentLevel(formatText,options)}else formatText=documentText,initialIndentLevel=0,formatTextStart=0,rangeStart=0,rangeEnd=documentText.length;let eol=getEOL(options,documentText),eolFastPathSupported=supportedEols.includes(eol),numberLineBreaks=0,indentLevel=0,indentValue;options.insertSpaces?indentValue=cachedSpaces[options.tabSize||4]??repeat(cachedSpaces[1],options.tabSize||4):indentValue=" ";let indentType=indentValue===" "?" ":" ",scanner=createScanner(formatText,!1),hasError=!1;function newLinesAndIndent(){if(numberLineBreaks>1)return repeat(eol,numberLineBreaks)+repeat(indentValue,initialIndentLevel+indentLevel);let amountOfSpaces=indentValue.length*(initialIndentLevel+indentLevel);return!eolFastPathSupported||amountOfSpaces>cachedBreakLinesWithSpaces[indentType][eol].length?eol+repeat(indentValue,initialIndentLevel+indentLevel):amountOfSpaces<=0?eol:cachedBreakLinesWithSpaces[indentType][eol][amountOfSpaces]}function scanNext(){let token=scanner.scan();for(numberLineBreaks=0;token===15||token===14;)token===14&&options.keepLines?numberLineBreaks+=1:token===14&&(numberLineBreaks=1),token=scanner.scan();return hasError=token===16||scanner.getTokenError()!==0,token}let editOperations=[];function addEdit(text,startOffset,endOffset){!hasError&&(!range||startOffset<rangeEnd&&endOffset>rangeStart)&&documentText.substring(startOffset,endOffset)!==text&&editOperations.push({offset:startOffset,length:endOffset-startOffset,content:text})}let firstToken=scanNext();if(options.keepLines&&numberLineBreaks>0&&addEdit(repeat(eol,numberLineBreaks),0,0),firstToken!==17){let firstTokenStart=scanner.getTokenOffset()+formatTextStart,initialIndent=indentValue.length*initialIndentLevel<20&&options.insertSpaces?cachedSpaces[indentValue.length*initialIndentLevel]:repeat(indentValue,initialIndentLevel);addEdit(initialIndent,formatTextStart,firstTokenStart)}for(;firstToken!==17;){let firstTokenEnd=scanner.getTokenOffset()+scanner.getTokenLength()+formatTextStart,secondToken=scanNext(),replaceContent="",needsLineBreak=!1;for(;numberLineBreaks===0&&(secondToken===12||secondToken===13);){let commentTokenStart=scanner.getTokenOffset()+formatTextStart;addEdit(cachedSpaces[1],firstTokenEnd,commentTokenStart),firstTokenEnd=scanner.getTokenOffset()+scanner.getTokenLength()+formatTextStart,needsLineBreak=secondToken===12,replaceContent=needsLineBreak?newLinesAndIndent():"",secondToken=scanNext()}if(secondToken===2)firstToken!==1&&indentLevel--,options.keepLines&&numberLineBreaks>0||!options.keepLines&&firstToken!==1?replaceContent=newLinesAndIndent():options.keepLines&&(replaceContent=cachedSpaces[1]);else if(secondToken===4)firstToken!==3&&indentLevel--,options.keepLines&&numberLineBreaks>0||!options.keepLines&&firstToken!==3?replaceContent=newLinesAndIndent():options.keepLines&&(replaceContent=cachedSpaces[1]);else{switch(firstToken){case 3:case 1:indentLevel++,options.keepLines&&numberLineBreaks>0||!options.keepLines?replaceContent=newLinesAndIndent():replaceContent=cachedSpaces[1];break;case 5:options.keepLines&&numberLineBreaks>0||!options.keepLines?replaceContent=newLinesAndIndent():replaceContent=cachedSpaces[1];break;case 12:replaceContent=newLinesAndIndent();break;case 13:numberLineBreaks>0?replaceContent=newLinesAndIndent():needsLineBreak||(replaceContent=cachedSpaces[1]);break;case 6:options.keepLines&&numberLineBreaks>0?replaceContent=newLinesAndIndent():needsLineBreak||(replaceContent=cachedSpaces[1]);break;case 10:options.keepLines&&numberLineBreaks>0?replaceContent=newLinesAndIndent():secondToken===6&&!needsLineBreak&&(replaceContent="");break;case 7:case 8:case 9:case 11:case 2:case 4:options.keepLines&&numberLineBreaks>0?replaceContent=newLinesAndIndent():(secondToken===12||secondToken===13)&&!needsLineBreak?replaceContent=cachedSpaces[1]:secondToken!==5&&secondToken!==17&&(hasError=!0);break;case 16:hasError=!0;break}numberLineBreaks>0&&(secondToken===12||secondToken===13)&&(replaceContent=newLinesAndIndent())}secondToken===17&&(options.keepLines&&numberLineBreaks>0?replaceContent=newLinesAndIndent():replaceContent=options.insertFinalNewline?eol:"");let secondTokenStart=scanner.getTokenOffset()+formatTextStart;addEdit(replaceContent,firstTokenEnd,secondTokenStart),firstToken=secondToken}return editOperations}function repeat(s,count){let result="";for(let i=0;i<count;i++)result+=s;return result}function computeIndentLevel(content,options){let i=0,nChars=0,tabSize=options.tabSize||4;for(;i<content.length;){let ch=content.charAt(i);if(ch===cachedSpaces[1])nChars++;else if(ch===" ")nChars+=tabSize;else break;i++}return Math.floor(nChars/tabSize)}function getEOL(options,text){for(let i=0;i<text.length;i++){let ch=text.charAt(i);if(ch==="\r")return i+1<text.length&&text.charAt(i+1)===`
|
|
16
|
+
`?`\r
|
|
17
|
+
`:"\r";if(ch===`
|
|
18
|
+
`)return`
|
|
19
|
+
`}return options&&options.eol||`
|
|
20
|
+
`}function isEOL(text,offset){return`\r
|
|
21
|
+
`.indexOf(text.charAt(offset))!==-1}var init_format=__esm({"../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/format.js"(){"use strict";init_scanner();init_string_intern()}});function parse(text,errors=[],options=ParseOptions.DEFAULT){let currentProperty=null,currentParent=[],previousParents=[];function onValue(value){Array.isArray(currentParent)?currentParent.push(value):currentProperty!==null&&(currentParent[currentProperty]=value)}return visit(text,{onObjectBegin:()=>{let object={};onValue(object),previousParents.push(currentParent),currentParent=object,currentProperty=null},onObjectProperty:name=>{currentProperty=name},onObjectEnd:()=>{currentParent=previousParents.pop()},onArrayBegin:()=>{let array=[];onValue(array),previousParents.push(currentParent),currentParent=array,currentProperty=null},onArrayEnd:()=>{currentParent=previousParents.pop()},onLiteralValue:onValue,onError:(error,offset,length)=>{errors.push({error,offset,length})}},options),currentParent[0]}function parseTree(text,errors=[],options=ParseOptions.DEFAULT){let currentParent={type:"array",offset:-1,length:-1,children:[],parent:void 0};function ensurePropertyComplete(endOffset){currentParent.type==="property"&&(currentParent.length=endOffset-currentParent.offset,currentParent=currentParent.parent)}function onValue(valueNode){return currentParent.children.push(valueNode),valueNode}visit(text,{onObjectBegin:offset=>{currentParent=onValue({type:"object",offset,length:-1,parent:currentParent,children:[]})},onObjectProperty:(name,offset,length)=>{currentParent=onValue({type:"property",offset,length:-1,parent:currentParent,children:[]}),currentParent.children.push({type:"string",value:name,offset,length,parent:currentParent})},onObjectEnd:(offset,length)=>{ensurePropertyComplete(offset+length),currentParent.length=offset+length-currentParent.offset,currentParent=currentParent.parent,ensurePropertyComplete(offset+length)},onArrayBegin:(offset,length)=>{currentParent=onValue({type:"array",offset,length:-1,parent:currentParent,children:[]})},onArrayEnd:(offset,length)=>{currentParent.length=offset+length-currentParent.offset,currentParent=currentParent.parent,ensurePropertyComplete(offset+length)},onLiteralValue:(value,offset,length)=>{onValue({type:getNodeType(value),offset,length,parent:currentParent,value}),ensurePropertyComplete(offset+length)},onSeparator:(sep,offset,length)=>{currentParent.type==="property"&&(sep===":"?currentParent.colonOffset=offset:sep===","&&ensurePropertyComplete(offset))},onError:(error,offset,length)=>{errors.push({error,offset,length})}},options);let result=currentParent.children[0];return result&&delete result.parent,result}function findNodeAtLocation(root,path){if(!root)return;let node=root;for(let segment of path)if(typeof segment=="string"){if(node.type!=="object"||!Array.isArray(node.children))return;let found=!1;for(let propertyNode of node.children)if(Array.isArray(propertyNode.children)&&propertyNode.children[0].value===segment&&propertyNode.children.length===2){node=propertyNode.children[1],found=!0;break}if(!found)return}else{let index=segment;if(node.type!=="array"||index<0||!Array.isArray(node.children)||index>=node.children.length)return;node=node.children[index]}return node}function visit(text,visitor,options=ParseOptions.DEFAULT){let _scanner=createScanner(text,!1),_jsonPath=[],suppressedCallbacks=0;function toNoArgVisit(visitFunction){return visitFunction?()=>suppressedCallbacks===0&&visitFunction(_scanner.getTokenOffset(),_scanner.getTokenLength(),_scanner.getTokenStartLine(),_scanner.getTokenStartCharacter()):()=>!0}function toOneArgVisit(visitFunction){return visitFunction?arg=>suppressedCallbacks===0&&visitFunction(arg,_scanner.getTokenOffset(),_scanner.getTokenLength(),_scanner.getTokenStartLine(),_scanner.getTokenStartCharacter()):()=>!0}function toOneArgVisitWithPath(visitFunction){return visitFunction?arg=>suppressedCallbacks===0&&visitFunction(arg,_scanner.getTokenOffset(),_scanner.getTokenLength(),_scanner.getTokenStartLine(),_scanner.getTokenStartCharacter(),()=>_jsonPath.slice()):()=>!0}function toBeginVisit(visitFunction){return visitFunction?()=>{suppressedCallbacks>0?suppressedCallbacks++:visitFunction(_scanner.getTokenOffset(),_scanner.getTokenLength(),_scanner.getTokenStartLine(),_scanner.getTokenStartCharacter(),()=>_jsonPath.slice())===!1&&(suppressedCallbacks=1)}:()=>!0}function toEndVisit(visitFunction){return visitFunction?()=>{suppressedCallbacks>0&&suppressedCallbacks--,suppressedCallbacks===0&&visitFunction(_scanner.getTokenOffset(),_scanner.getTokenLength(),_scanner.getTokenStartLine(),_scanner.getTokenStartCharacter())}:()=>!0}let onObjectBegin=toBeginVisit(visitor.onObjectBegin),onObjectProperty=toOneArgVisitWithPath(visitor.onObjectProperty),onObjectEnd=toEndVisit(visitor.onObjectEnd),onArrayBegin=toBeginVisit(visitor.onArrayBegin),onArrayEnd=toEndVisit(visitor.onArrayEnd),onLiteralValue=toOneArgVisitWithPath(visitor.onLiteralValue),onSeparator=toOneArgVisit(visitor.onSeparator),onComment=toNoArgVisit(visitor.onComment),onError=toOneArgVisit(visitor.onError),disallowComments=options&&options.disallowComments,allowTrailingComma=options&&options.allowTrailingComma;function scanNext(){for(;;){let token=_scanner.scan();switch(_scanner.getTokenError()){case 4:handleError(14);break;case 5:handleError(15);break;case 3:handleError(13);break;case 1:disallowComments||handleError(11);break;case 2:handleError(12);break;case 6:handleError(16);break}switch(token){case 12:case 13:disallowComments?handleError(10):onComment();break;case 16:handleError(1);break;case 15:case 14:break;default:return token}}}function handleError(error,skipUntilAfter=[],skipUntil=[]){if(onError(error),skipUntilAfter.length+skipUntil.length>0){let token=_scanner.getToken();for(;token!==17;){if(skipUntilAfter.indexOf(token)!==-1){scanNext();break}else if(skipUntil.indexOf(token)!==-1)break;token=scanNext()}}}function parseString(isValue){let value=_scanner.getTokenValue();return isValue?onLiteralValue(value):(onObjectProperty(value),_jsonPath.push(value)),scanNext(),!0}function parseLiteral(){switch(_scanner.getToken()){case 11:let tokenValue=_scanner.getTokenValue(),value=Number(tokenValue);isNaN(value)&&(handleError(2),value=0),onLiteralValue(value);break;case 7:onLiteralValue(null);break;case 8:onLiteralValue(!0);break;case 9:onLiteralValue(!1);break;default:return!1}return scanNext(),!0}function parseProperty(){return _scanner.getToken()!==10?(handleError(3,[],[2,5]),!1):(parseString(!1),_scanner.getToken()===6?(onSeparator(":"),scanNext(),parseValue()||handleError(4,[],[2,5])):handleError(5,[],[2,5]),_jsonPath.pop(),!0)}function parseObject(){onObjectBegin(),scanNext();let needsComma=!1;for(;_scanner.getToken()!==2&&_scanner.getToken()!==17;){if(_scanner.getToken()===5){if(needsComma||handleError(4,[],[]),onSeparator(","),scanNext(),_scanner.getToken()===2&&allowTrailingComma)break}else needsComma&&handleError(6,[],[]);parseProperty()||handleError(4,[],[2,5]),needsComma=!0}return onObjectEnd(),_scanner.getToken()!==2?handleError(7,[2],[]):scanNext(),!0}function parseArray(){onArrayBegin(),scanNext();let isFirstElement=!0,needsComma=!1;for(;_scanner.getToken()!==4&&_scanner.getToken()!==17;){if(_scanner.getToken()===5){if(needsComma||handleError(4,[],[]),onSeparator(","),scanNext(),_scanner.getToken()===4&&allowTrailingComma)break}else needsComma&&handleError(6,[],[]);isFirstElement?(_jsonPath.push(0),isFirstElement=!1):_jsonPath[_jsonPath.length-1]++,parseValue()||handleError(4,[],[4,5]),needsComma=!0}return onArrayEnd(),isFirstElement||_jsonPath.pop(),_scanner.getToken()!==4?handleError(8,[4],[]):scanNext(),!0}function parseValue(){switch(_scanner.getToken()){case 3:return parseArray();case 1:return parseObject();case 10:return parseString(!0);default:return parseLiteral()}}return scanNext(),_scanner.getToken()===17?options.allowEmptyContent?!0:(handleError(4,[],[]),!1):parseValue()?(_scanner.getToken()!==17&&handleError(9,[],[]),!0):(handleError(4,[],[]),!1)}function getNodeType(value){switch(typeof value){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(value){if(Array.isArray(value))return"array"}else return"null";return"object"}default:return"null"}}var ParseOptions,init_parser=__esm({"../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/parser.js"(){"use strict";init_scanner();(function(ParseOptions2){ParseOptions2.DEFAULT={allowTrailingComma:!1}})(ParseOptions||(ParseOptions={}))}});function setProperty(text,originalPath,value,options){let path=originalPath.slice(),root=parseTree(text,[]),parent,lastSegment;for(;path.length>0&&(lastSegment=path.pop(),parent=findNodeAtLocation(root,path),parent===void 0&&value!==void 0);)typeof lastSegment=="string"?value={[lastSegment]:value}:value=[value];if(parent)if(parent.type==="object"&&typeof lastSegment=="string"&&Array.isArray(parent.children)){let existing=findNodeAtLocation(parent,[lastSegment]);if(existing!==void 0)if(value===void 0){if(!existing.parent)throw new Error("Malformed AST");let propertyIndex=parent.children.indexOf(existing.parent),removeBegin,removeEnd=existing.parent.offset+existing.parent.length;if(propertyIndex>0){let previous=parent.children[propertyIndex-1];removeBegin=previous.offset+previous.length}else removeBegin=parent.offset+1,parent.children.length>1&&(removeEnd=parent.children[1].offset);return withFormatting(text,{offset:removeBegin,length:removeEnd-removeBegin,content:""},options)}else return withFormatting(text,{offset:existing.offset,length:existing.length,content:JSON.stringify(value)},options);else{if(value===void 0)return[];let newProperty=`${JSON.stringify(lastSegment)}: ${JSON.stringify(value)}`,index=options.getInsertionIndex?options.getInsertionIndex(parent.children.map(p=>p.children[0].value)):parent.children.length,edit;if(index>0){let previous=parent.children[index-1];edit={offset:previous.offset+previous.length,length:0,content:","+newProperty}}else parent.children.length===0?edit={offset:parent.offset+1,length:0,content:newProperty}:edit={offset:parent.offset+1,length:0,content:newProperty+","};return withFormatting(text,edit,options)}}else if(parent.type==="array"&&typeof lastSegment=="number"&&Array.isArray(parent.children)){let insertIndex=lastSegment;if(insertIndex===-1){let newProperty=`${JSON.stringify(value)}`,edit;if(parent.children.length===0)edit={offset:parent.offset+1,length:0,content:newProperty};else{let previous=parent.children[parent.children.length-1];edit={offset:previous.offset+previous.length,length:0,content:","+newProperty}}return withFormatting(text,edit,options)}else if(value===void 0&&parent.children.length>=0){let removalIndex=lastSegment,toRemove=parent.children[removalIndex],edit;if(parent.children.length===1)edit={offset:parent.offset+1,length:parent.length-2,content:""};else if(parent.children.length-1===removalIndex){let previous=parent.children[removalIndex-1],offset=previous.offset+previous.length,parentEndOffset=parent.offset+parent.length;edit={offset,length:parentEndOffset-2-offset,content:""}}else edit={offset:toRemove.offset,length:parent.children[removalIndex+1].offset-toRemove.offset,content:""};return withFormatting(text,edit,options)}else if(value!==void 0){let edit,newProperty=`${JSON.stringify(value)}`;if(!options.isArrayInsertion&&parent.children.length>lastSegment){let toModify=parent.children[lastSegment];edit={offset:toModify.offset,length:toModify.length,content:newProperty}}else if(parent.children.length===0||lastSegment===0)edit={offset:parent.offset+1,length:0,content:parent.children.length===0?newProperty:newProperty+","};else{let index=lastSegment>parent.children.length?parent.children.length:lastSegment,previous=parent.children[index-1];edit={offset:previous.offset+previous.length,length:0,content:","+newProperty}}return withFormatting(text,edit,options)}else throw new Error(`Can not ${value===void 0?"remove":options.isArrayInsertion?"insert":"modify"} Array index ${insertIndex} as length is not sufficient`)}else throw new Error(`Can not add ${typeof lastSegment!="number"?"index":"property"} to parent of type ${parent.type}`);else{if(value===void 0)throw new Error("Can not delete in empty document");return withFormatting(text,{offset:root?root.offset:0,length:root?root.length:0,content:JSON.stringify(value)},options)}}function withFormatting(text,edit,options){if(!options.formattingOptions)return[edit];let newText=applyEdit(text,edit),begin=edit.offset,end=edit.offset+edit.content.length;if(edit.length===0||edit.content.length===0){for(;begin>0&&!isEOL(newText,begin-1);)begin--;for(;end<newText.length&&!isEOL(newText,end);)end++}let edits=format(newText,{offset:begin,length:end-begin},{...options.formattingOptions,keepLines:!1});for(let i=edits.length-1;i>=0;i--){let edit2=edits[i];newText=applyEdit(newText,edit2),begin=Math.min(begin,edit2.offset),end=Math.max(end,edit2.offset+edit2.length),end+=edit2.content.length-edit2.length}let editLength=text.length-(newText.length-end)-begin;return[{offset:begin,length:editLength,content:newText.substring(begin,end)}]}function applyEdit(text,edit){return text.substring(0,edit.offset)+edit.content+text.substring(edit.offset+edit.length)}var init_edit=__esm({"../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/edit.js"(){"use strict";init_format();init_parser()}});function printParseErrorCode(code){switch(code){case 1:return"InvalidSymbol";case 2:return"InvalidNumberFormat";case 3:return"PropertyNameExpected";case 4:return"ValueExpected";case 5:return"ColonExpected";case 6:return"CommaExpected";case 7:return"CloseBraceExpected";case 8:return"CloseBracketExpected";case 9:return"EndOfFileExpected";case 10:return"InvalidCommentToken";case 11:return"UnexpectedEndOfComment";case 12:return"UnexpectedEndOfString";case 13:return"UnexpectedEndOfNumber";case 14:return"InvalidUnicode";case 15:return"InvalidEscapeCharacter";case 16:return"InvalidCharacter"}return"<unknown ParseErrorCode>"}function modify(text,path,value,options){return setProperty(text,path,value,options)}function applyEdits(text,edits){let sortedEdits=edits.slice(0).sort((a,b)=>{let diff=a.offset-b.offset;return diff===0?a.length-b.length:diff}),lastModifiedOffset=text.length;for(let i=sortedEdits.length-1;i>=0;i--){let e=sortedEdits[i];if(e.offset+e.length<=lastModifiedOffset)text=applyEdit(text,e);else throw new Error("Overlapping edit");lastModifiedOffset=e.offset}return text}var ScanError,SyntaxKind,parse2,parseTree2,findNodeAtLocation2,ParseErrorCode,init_main=__esm({"../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/main.js"(){"use strict";init_format();init_edit();init_scanner();init_parser();(function(ScanError2){ScanError2[ScanError2.None=0]="None",ScanError2[ScanError2.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",ScanError2[ScanError2.UnexpectedEndOfString=2]="UnexpectedEndOfString",ScanError2[ScanError2.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",ScanError2[ScanError2.InvalidUnicode=4]="InvalidUnicode",ScanError2[ScanError2.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",ScanError2[ScanError2.InvalidCharacter=6]="InvalidCharacter"})(ScanError||(ScanError={}));(function(SyntaxKind2){SyntaxKind2[SyntaxKind2.OpenBraceToken=1]="OpenBraceToken",SyntaxKind2[SyntaxKind2.CloseBraceToken=2]="CloseBraceToken",SyntaxKind2[SyntaxKind2.OpenBracketToken=3]="OpenBracketToken",SyntaxKind2[SyntaxKind2.CloseBracketToken=4]="CloseBracketToken",SyntaxKind2[SyntaxKind2.CommaToken=5]="CommaToken",SyntaxKind2[SyntaxKind2.ColonToken=6]="ColonToken",SyntaxKind2[SyntaxKind2.NullKeyword=7]="NullKeyword",SyntaxKind2[SyntaxKind2.TrueKeyword=8]="TrueKeyword",SyntaxKind2[SyntaxKind2.FalseKeyword=9]="FalseKeyword",SyntaxKind2[SyntaxKind2.StringLiteral=10]="StringLiteral",SyntaxKind2[SyntaxKind2.NumericLiteral=11]="NumericLiteral",SyntaxKind2[SyntaxKind2.LineCommentTrivia=12]="LineCommentTrivia",SyntaxKind2[SyntaxKind2.BlockCommentTrivia=13]="BlockCommentTrivia",SyntaxKind2[SyntaxKind2.LineBreakTrivia=14]="LineBreakTrivia",SyntaxKind2[SyntaxKind2.Trivia=15]="Trivia",SyntaxKind2[SyntaxKind2.Unknown=16]="Unknown",SyntaxKind2[SyntaxKind2.EOF=17]="EOF"})(SyntaxKind||(SyntaxKind={}));parse2=parse,parseTree2=parseTree,findNodeAtLocation2=findNodeAtLocation;(function(ParseErrorCode2){ParseErrorCode2[ParseErrorCode2.InvalidSymbol=1]="InvalidSymbol",ParseErrorCode2[ParseErrorCode2.InvalidNumberFormat=2]="InvalidNumberFormat",ParseErrorCode2[ParseErrorCode2.PropertyNameExpected=3]="PropertyNameExpected",ParseErrorCode2[ParseErrorCode2.ValueExpected=4]="ValueExpected",ParseErrorCode2[ParseErrorCode2.ColonExpected=5]="ColonExpected",ParseErrorCode2[ParseErrorCode2.CommaExpected=6]="CommaExpected",ParseErrorCode2[ParseErrorCode2.CloseBraceExpected=7]="CloseBraceExpected",ParseErrorCode2[ParseErrorCode2.CloseBracketExpected=8]="CloseBracketExpected",ParseErrorCode2[ParseErrorCode2.EndOfFileExpected=9]="EndOfFileExpected",ParseErrorCode2[ParseErrorCode2.InvalidCommentToken=10]="InvalidCommentToken",ParseErrorCode2[ParseErrorCode2.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",ParseErrorCode2[ParseErrorCode2.UnexpectedEndOfString=12]="UnexpectedEndOfString",ParseErrorCode2[ParseErrorCode2.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",ParseErrorCode2[ParseErrorCode2.InvalidUnicode=14]="InvalidUnicode",ParseErrorCode2[ParseErrorCode2.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",ParseErrorCode2[ParseErrorCode2.InvalidCharacter=16]="InvalidCharacter"})(ParseErrorCode||(ParseErrorCode={}))}});export{parse2 as parse,parseTree2 as parseTree,findNodeAtLocation2 as findNodeAtLocation,printParseErrorCode,modify,applyEdits,init_main};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{__commonJS,__require}from"./chunk-BZENIQ7N.js";var require_dist=__commonJS({"../../node_modules/.pnpm/async-listen@3.0.0/node_modules/async-listen/dist/index.js"(exports){"use strict";var __awaiter=exports&&exports.__awaiter||function(thisArg,_arguments,P,generator){function adopt(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):adopt(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0});exports.listen=void 0;var http=__require("http"),https=__require("https"),path_1=__require("path"),events_1=__require("events"),getProtocol=server=>{if(typeof server.protocol=="string")return server.protocol;if(server instanceof http.Server)return"http";if(server instanceof https.Server)return"https"};function listen(server,...args){return __awaiter(this,void 0,void 0,function*(){server.listen(...args,()=>{}),yield(0,events_1.once)(server,"listening");let addressInfo=server.address();if(!addressInfo)throw new Error("Server not listening");let host,protocol=getProtocol(server);if(typeof addressInfo=="string")host=encodeURIComponent((0,path_1.resolve)(addressInfo)),protocol?protocol+="+unix":protocol="unix";else{let{address,port,family}=addressInfo;host=family==="IPv6"?`[${address}]`:address,host+=`:${port}`,protocol||(protocol="tcp")}return new URL(`${protocol}://${host}`)})}exports.listen=listen;exports.default=listen}});export{require_dist};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{__commonJS,__require}from"./chunk-BZENIQ7N.js";var require_dist=__commonJS({"../../node_modules/.pnpm/@next+env@11.1.2/node_modules/@next/env/dist/index.js"(exports,module){module.exports=function(n,r){"use strict";var e={};function __webpack_require__(r2){if(e[r2])return e[r2].exports;var t=e[r2]={i:r2,l:!1,exports:{}};return n[r2].call(t.exports,t,t.exports,__webpack_require__),t.l=!0,t.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(903)}return r(__webpack_require__),startup()}({148:function(n){"use strict";var r=function(n2){var r2=n2.ignoreProcessEnv?{}:process.env,e=function(t2){var o2=t2.match(/(.?\${?(?:[a-zA-Z0-9_]+)?}?)/g)||[];return o2.reduce(function(t3,o3){var c2=/(.?)\${?([a-zA-Z0-9_]+)?}?/g.exec(o3),s=c2[1],i,f;if(s==="\\")f=c2[0],i=f.replace("\\$","$");else{var p=c2[2];f=c2[0].substring(s.length),i=r2.hasOwnProperty(p)?r2[p]:n2.parsed[p]||"",i=e(i)}return t3.replace(f,i)},t2)};for(var t in n2.parsed){var o=r2.hasOwnProperty(t)?r2[t]:n2.parsed[t];n2.parsed[t]=e(o)}for(var c in n2.parsed)r2[c]=n2.parsed[c];return n2};n.exports=r},548:function(n,r,e){let t=e(747),o=e(622);function log(n2){console.log(`[dotenv][DEBUG] ${n2}`)}let c=`
|
|
8
|
+
`,s=/^\s*([\w.-]+)\s*=\s*(.*)?\s*$/,i=/\\n/g,f=/\n|\r|\r\n/;function parse(n2,r2){let e2=!!(r2&&r2.debug),t2={};return n2.toString().split(f).forEach(function(n3,r3){let o2=n3.match(s);if(o2!=null){let n4=o2[1],r4=o2[2]||"",e3=r4.length-1,s2=r4[0]==='"'&&r4[e3]==='"';r4[0]==="'"&&r4[e3]==="'"||s2?(r4=r4.substring(1,e3),s2&&(r4=r4.replace(i,c))):r4=r4.trim(),t2[n4]=r4}else e2&&log(`did not match key and value when parsing line ${r3+1}: ${n3}`)}),t2}function config(n2){let r2=o.resolve(process.cwd(),".env"),e2="utf8",c2=!1;n2&&(n2.path!=null&&(r2=n2.path),n2.encoding!=null&&(e2=n2.encoding),n2.debug!=null&&(c2=!0));try{let n3=parse(t.readFileSync(r2,{encoding:e2}),{debug:c2});return Object.keys(n3).forEach(function(r3){Object.prototype.hasOwnProperty.call(process.env,r3)?c2&&log(`"${r3}" is already defined in \`process.env\` and will not be overwritten`):process.env[r3]=n3[r3]}),{parsed:n3}}catch(n3){return{error:n3}}}n.exports.config=config,n.exports.parse=parse},622:function(n){n.exports=__require("path")},747:function(n){n.exports=__require("fs")},903:function(n,r,e){"use strict";e.r(r),e.d(r,"processEnv",function(){return processEnv}),e.d(r,"loadEnvConfig",function(){return loadEnvConfig});var t=e(747),o=e.n(t),c=e(622),s=e.n(c),i=e(548),f=e.n(i),p=e(148),u=e.n(p);let a,d=[];function processEnv(n2,r2,e2=console){var t2;if(process.env.__NEXT_PROCESSED_ENV||n2.length===0)return process.env;process.env.__NEXT_PROCESSED_ENV="true";let o2=Object.assign({},process.env),s2={};for(let f2 of n2)try{let n3={};n3.parsed=i.parse(f2.contents),n3=u()(n3),n3.parsed&&e2.info(`Loaded env from ${c.join(r2||"",f2.path)}`);for(let r3 of Object.keys(n3.parsed||{}))typeof s2[r3]>"u"&&typeof o2[r3]>"u"&&(s2[r3]=(t2=n3.parsed)===null||t2===void 0?void 0:t2[r3])}catch(n3){e2.error(`Failed to load env from ${c.join(r2||"",f2.path)}`,n3)}return Object.assign(process.env,s2)}function loadEnvConfig(n2,r2,e2=console){if(a)return{combinedEnv:a,loadedEnvFiles:d};let s2=process.env.NODE_ENV==="test"?"test":r2?"development":"production",i2=[`.env.${s2}.local`,s2!=="test"&&".env.local",`.env.${s2}`,".env"].filter(Boolean);for(let r3 of i2){let o3=c.join(n2,r3);try{if(!t.statSync(o3).isFile())continue;let c2=t.readFileSync(o3,"utf8");d.push({path:r3,contents:c2})}catch(n3){n3.code!=="ENOENT"&&e2.error(`Failed to load env from ${r3}`,n3)}}return a=processEnv(d,n2,e2),{combinedEnv:a,loadedEnvFiles:d}}}},function(n){"use strict";(function(){n.r=function(n2){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(n2,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n2,"__esModule",{value:!0})}})(),function(){n.n=function(r){var e=r&&r.__esModule?function(){return r.default}:function(){return r};return n.d(e,"a",e),e}}(),function(){var r=Object.prototype.hasOwnProperty;n.d=function(n2,e,t){r.call(n2,e)||Object.defineProperty(n2,e,{enumerable:!0,get:t})}}()})}});export{require_dist};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{pkg_default}from"./chunk-OO572JUC.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__commonJS,__toESM}from"./chunk-BZENIQ7N.js";var require_lower_case=__commonJS({"../../node_modules/.pnpm/title@3.4.1/node_modules/title/lib/lower-case.js"(exports,module){var conjunctions=["for","and","nor","but","or","yet","so"],articles=["a","an","the"],prepositions=["aboard","about","above","across","after","against","along","amid","among","anti","around","as","at","before","behind","below","beneath","beside","besides","between","beyond","but","by","concerning","considering","despite","down","during","except","excepting","excluding","following","for","from","in","inside","into","like","minus","near","of","off","on","onto","opposite","over","past","per","plus","regarding","round","save","since","than","through","to","toward","towards","under","underneath","unlike","until","up","upon","versus","via","with","within","without"];module.exports=new Set([...conjunctions,...articles,...prepositions])}});var require_specials=__commonJS({"../../node_modules/.pnpm/title@3.4.1/node_modules/title/lib/specials.js"(exports,module){var intended=["ZEIT","ZEIT Inc.","CLI","API","HTTP","HTTPS","JSX","DNS","URL","now.sh","now.json","CI","CDN","package.json","GitHub","CSS","JS","HTML","WordPress","JavaScript","Next.js","Node.js"];module.exports=intended}});var require_lib=__commonJS({"../../node_modules/.pnpm/title@3.4.1/node_modules/title/lib/index.js"(exports,module){var lowerCase=require_lower_case(),specials=require_specials(),regex=/(?:(?:(\s?(?:^|[.\(\)!?;:"-])\s*)(\w))|(\w))(\w*[’']*\w*)/g,convertToRegExp=specials2=>specials2.map(s=>[new RegExp(`\\b${s}\\b`,"gi"),s]);function parseMatch(match){let firstCharacter=match[0];return/\s/.test(firstCharacter)?match.substr(1):/[\(\)]/.test(firstCharacter)?null:match}module.exports=(str,options={})=>{str=str.toLowerCase().replace(regex,(m,lead="",forced,lower,rest)=>{let parsedMatch=parseMatch(m);if(!parsedMatch)return m;if(!forced){let fullLower=lower+rest;if(lowerCase.has(fullLower))return parsedMatch}return lead+(lower||forced).toUpperCase()+rest});let customSpecials=options.special||[],replace=[...specials,...customSpecials];return convertToRegExp(replace).forEach(([pattern,s])=>{str=str.replace(pattern,s)}),str}}});var import_chalk=__toESM(require_source(),1);function cmd(text){return`${import_chalk.default.gray("`")}${import_chalk.default.cyan(text)}${import_chalk.default.gray("`")}`}var import_title=__toESM(require_lib(),1);var packageName=pkg_default.name;function getTitleName(){return(0,import_title.default)(packageName)}function getCommandName(subcommands){let vercel=packageName;return subcommands&&(vercel=`${vercel} ${subcommands}`),cmd(vercel)}function getCommandNamePlain(subcommands){return subcommands?`${packageName} ${subcommands}`:packageName}export{require_lib,cmd,packageName,getTitleName,getCommandName,getCommandNamePlain};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{writeProjectSettings}from"./chunk-KJA2GKPT.js";import{stamp_default}from"./chunk-A2RZZQEP.js";import{envPullCommandLogic}from"./chunk-L3JYCXVB.js";import{parseTarget,warnDeprecatedProdFlag}from"./chunk-7QAGSRCU.js";import{ensureLink}from"./chunk-HTXDC7E2.js";import{pullCommand}from"./chunk-LOBA3E72.js";import{help}from"./chunk-FLHO75XC.js";import{printError}from"./chunk-HSFKISDH.js";import{TelemetryClient}from"./chunk-6YXIWZ3X.js";import{VERCEL_DIR,VERCEL_DIR_PROJECT,humanizePath}from"./chunk-4N6LMERQ.js";import{parseArguments}from"./chunk-KCKYPLIH.js";import{getFlagsSpecification}from"./chunk-QVXS234E.js";import{emoji,output_manager_default,prependEmoji}from"./chunk-XP3FT56R.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);import{join}from"node:path";var PullTelemetryClient=class extends TelemetryClient{trackCliArgumentProjectPath(value){value&&this.trackCliArgument({arg:"projectPath",value:this.redactedValue})}trackCliOptionEnvironment(environment){environment&&this.trackCliOption({option:"environment",value:this.redactedTargetName(environment)})}trackCliOptionGitBranch(gitBranch){gitBranch&&this.trackCliOption({option:"git-branch",value:this.redactedValue})}trackCliFlagProd(isProduction){isProduction&&this.trackCliFlag("prod")}trackCliFlagYes(yes){yes&&this.trackCliFlag("yes")}};async function pullAllEnvFiles(environment,client,link,flags,cwd){let environmentFile=`.env.${environment}.local`;return await envPullCommandLogic(client,join(".vercel",environmentFile),!!flags["--yes"],environment,link,flags["--git-branch"],cwd,"vercel-cli:pull"),0}async function main(client){let parsedArgs=null,flagsSpecification=getFlagsSpecification(pullCommand.options);try{parsedArgs=parseArguments(client.argv.slice(2),flagsSpecification)}catch(error){return printError(error),2}let telemetryClient=new PullTelemetryClient({opts:{store:client.telemetryEventStore}});if(parsedArgs.flags["--help"])return telemetryClient.trackCliFlagHelp("pull"),output_manager_default.print(help(pullCommand,{columns:client.stderr.columns})),0;let cwd=parsedArgs.args[1]||client.cwd,autoConfirm=!!parsedArgs.flags["--yes"],isProduction=!!parsedArgs.flags["--prod"];warnDeprecatedProdFlag(client,parsedArgs.flags);let environment=parseTarget({flagName:"environment",flags:parsedArgs.flags})||"development";return telemetryClient.trackCliArgumentProjectPath(parsedArgs.args[1]),telemetryClient.trackCliFlagYes(autoConfirm),telemetryClient.trackCliFlagProd(isProduction),telemetryClient.trackCliOptionGitBranch(parsedArgs.flags["--git-branch"]),telemetryClient.trackCliOptionEnvironment(parsedArgs.flags["--environment"]),telemetryClient.trackCliOptionProject(parsedArgs.flags["--project"]),await pullCommandLogic(client,cwd,autoConfirm,environment,parsedArgs.flags,parsedArgs.flags["--project"])}async function pullCommandLogic(client,cwd,autoConfirm,environment,flags,projectNameOrId){let link=await ensureLink("pull",client,cwd,{autoConfirm,pullEnv:!1,projectName:projectNameOrId,failIfNotFound:!!projectNameOrId,skipOwnerLookup:!0});if(typeof link=="number")return link;let{project,org,repoRoot}=link,currentDirectory;repoRoot?currentDirectory=join(repoRoot,project.rootDirectory||""):currentDirectory=cwd,client.config.currentTeam=org.type==="team"?org.id:void 0;let pullResultCode=await pullAllEnvFiles(environment,client,link,flags,currentDirectory);if(pullResultCode!==0)return pullResultCode;output_manager_default.print(`
|
|
8
|
+
`),output_manager_default.log("Downloading project settings"),await writeProjectSettings(currentDirectory,project,org,typeof repoRoot=="string");let settingsStamp=stamp_default();return output_manager_default.print(`${prependEmoji(`Downloaded project settings to ${import_chalk.default.bold(humanizePath(join(currentDirectory,VERCEL_DIR,VERCEL_DIR_PROJECT)))} ${import_chalk.default.gray(settingsStamp())}`,emoji("success"))}
|
|
9
|
+
`),0}export{main,pullCommandLogic};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{STANDARD_ENVIRONMENTS}from"./chunk-7YKFF6CE.js";import{require_lib}from"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-XP3FT56R.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);var import_title=__toESM(require_lib(),1);function formatEnvironment(orgSlug,projectSlug,environment){let projectUrl=`https://vercel.com/${orgSlug}/${projectSlug}`,boldName=import_chalk.default.bold(STANDARD_ENVIRONMENTS.includes(environment.slug)?(0,import_title.default)(environment.slug):environment.slug);return output_manager_default.link(boldName,`${projectUrl}/settings/environments/${environment.slug}`,{fallback:()=>boldName,color:!1})}export{formatEnvironment};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{printProjectNotFoundError}from"./chunk-2TUVL6WE.js";import{detectExplicitScope}from"./chunk-K5U47EVH.js";import{omitGlobalFlagsFromArgs}from"./chunk-WDXW6A4H.js";import{getLinkedProject}from"./chunk-4N6LMERQ.js";function getInvokingCommandFromArgv(argv){let args=omitGlobalFlagsFromArgs(argv.slice(2)),positionals=[];for(let arg of args){if(arg.startsWith("-"))break;positionals.push(arg)}return positionals.join(" ")}async function resolveProjectContext({client,cwd=client.cwd,projectNameOrId,commandName="",projectNotFoundHandling="report",skipOwnerLookup,quiet}){let context=await getLinkedProject(client,{cwd,projectName:projectNameOrId,projectNameIsExplicit:!!projectNameOrId,scopeIsExplicit:detectExplicitScope(client),skipOwnerLookup,quiet});return context.status==="not_linked"&&projectNameOrId&&projectNotFoundHandling==="report"?(await printProjectNotFoundError(client,projectNameOrId,commandName||getInvokingCommandFromArgv(client.argv),context.orgId),{status:"error",exitCode:1,orgId:context.orgId}):context}export{resolveProjectContext};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{resolveProjectContext}from"./chunk-JP33AIDQ.js";function getProjectNameFromFlags(flags){return flags["--project"]}function getLinkedFlagsProject(client,projectName,options){return resolveProjectContext({client,projectNameOrId:projectName,projectNotFoundHandling:options?.projectNotFoundHandling})}export{getProjectNameFromFlags,getLinkedFlagsProject};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{outputError,writeJsonError}from"./chunk-RW3X523R.js";import{resolveProjectContext}from"./chunk-JP33AIDQ.js";import{printError}from"./chunk-HSFKISDH.js";import{detectExplicitScope,getScope}from"./chunk-K5U47EVH.js";import{getLinkedProject}from"./chunk-4N6LMERQ.js";import{isAPIError}from"./chunk-6VH56CX2.js";import{getCommandName}from"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-XP3FT56R.js";function handleCommentsParseError(err,subcommandName){return printError(err),err instanceof Error&&/unknown or unexpected option: -[^-]/.test(err.message)&&output_manager_default.log(`An argument starting with "-"? Put it after \`--\`: ${getCommandName(`comments ${subcommandName} -- <arg>`)}`),output_manager_default.log(`Run ${getCommandName(`comments ${subcommandName} --help`)} for usage.`),2}function threadNotFoundMessage(threadId,scope){return`Comment not found: ${threadId} in team ${scope.teamSlug??scope.teamId}. If it belongs to another team, pass --scope <team>.`}function query(teamId,params={}){let search=new URLSearchParams({teamId});for(let[key,value]of Object.entries(params))if(value!==void 0)if(Array.isArray(value))for(let entry of value)search.append(key,entry);else search.set(key,String(value));return search.toString()}var fetchOpts={useCurrentTeam:!1};function listThreads(client,teamId,params){return client.fetch(`/toolbar/threads?${query(teamId,{...params})}`,fetchOpts)}function getThread(client,teamId,threadId){return client.fetch(`/toolbar/threads/${encodeURIComponent(threadId)}?${query(teamId)}`,fetchOpts)}function updateThread(client,teamId,threadId,resolved){return client.fetch(`/toolbar/threads/${encodeURIComponent(threadId)}?${query(teamId)}`,{...fetchOpts,method:"PATCH",body:{resolved}})}function listMessages(client,teamId,threadId,opts={}){return client.fetch(`/toolbar/threads/${encodeURIComponent(threadId)}/messages?${query(teamId,{...opts})}`,fetchOpts)}function addMessage(client,teamId,threadId,body){return client.fetch(`/toolbar/threads/${encodeURIComponent(threadId)}/messages?${query(teamId)}`,{...fetchOpts,method:"POST",body})}function updateMessage(client,teamId,threadId,messageId,body){return client.fetch(`/toolbar/threads/${encodeURIComponent(threadId)}/messages/${encodeURIComponent(messageId)}?${query(teamId)}`,{...fetchOpts,method:"PATCH",body})}function deleteMessage(client,teamId,threadId,messageId){return client.fetch(`/toolbar/threads/${encodeURIComponent(threadId)}/messages/${encodeURIComponent(messageId)}?${query(teamId)}`,{...fetchOpts,method:"DELETE"})}function toApiErrorParts(err){let apiErr=err;return{code:apiErr.code||"API_ERROR",message:apiErr.serverMessage||`API error (${apiErr.status??"unknown"}).`}}import{spawnSync}from"node:child_process";async function resolveCommentsScope(client,opts){if(opts.urlTeamSlug&&!opts.project&&!detectExplicitScope(client))return{teamId:opts.urlTeamSlug,teamSlug:opts.urlTeamSlug};if(opts.project){let context;try{context=await resolveProjectContext({client,projectNameOrId:opts.project,projectNotFoundHandling:opts.jsonOutput?"return":"report"})}catch(err){if(isAPIError(err))return outputError(client,opts.jsonOutput,err.code||"API_ERROR",err.serverMessage||`API error (${err.status}).`);throw err}return context.status==="error"?(opts.jsonOutput&&writeJsonError(client,"PROJECT_CONTEXT_ERROR","Could not resolve the project context."),context.exitCode):context.status==="not_linked"?outputError(client,opts.jsonOutput,"PROJECT_NOT_FOUND",`Project "${opts.project}" was not found in the current scope.`):{teamId:context.org.id,teamSlug:context.org.slug,projectId:context.project.id,projectName:context.project.name,linked:!!context.repoRoot}}let linked=await getLinkedProject(client);if(linked.status==="error")return linked.exitCode;if(linked.status==="linked"){if(detectExplicitScope(client)){let{team:team2}=await getScope(client);if(!team2)return outputError(client,opts.jsonOutput,"NO_TEAM","No team context found for --scope.");if(team2.id!==linked.org.id)return opts.requireProject?outputError(client,opts.jsonOutput,"SCOPE_PROJECT_MISMATCH",`--scope ${team2.slug} does not match the linked project's team (${linked.org.slug}). Pass --project <name-or-id> for a project in ${team2.slug}.`):{teamId:team2.id,teamSlug:team2.slug}}return{teamId:linked.org.id,teamSlug:linked.org.slug,projectId:linked.project.id,projectName:linked.project.name,linked:!0}}if(opts.requireProject)return outputError(client,opts.jsonOutput,"NOT_LINKED","No linked project found. Run `vercel link` to link a project, or pass --project <name-or-id>.");let{team}=await getScope(client);return team?{teamId:team.id,teamSlug:team.slug}:outputError(client,opts.jsonOutput,"NO_TEAM","No team context found. Run `vercel switch` to select a team, or run `vercel link` in a project directory.")}function inferBranch(cwd){let result=spawnSync("git",["rev-parse","--abbrev-ref","HEAD"],{cwd,encoding:"utf8"});if(result.status===0){let branch=result.stdout.trim();if(branch&&branch!=="HEAD")return{value:branch,source:"git"}}let ciRef=process.env.VERCEL_GIT_COMMIT_REF||process.env.GITHUB_HEAD_REF||process.env.GITHUB_REF_NAME;if(ciRef)return{value:ciRef,source:"ci"}}export{handleCommentsParseError,threadNotFoundMessage,listThreads,getThread,updateThread,listMessages,addMessage,updateMessage,deleteMessage,toApiErrorParts,resolveCommentsScope,inferBranch};
|