vercel 62.2.0 → 62.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/dist/chunks/{add-7HJR3HK7.js → add-E6SM6YUU.js} +1 -1
- package/dist/chunks/add-K6P7R3M4.js +8 -0
- package/dist/chunks/add-XZMJUVCZ.js +8 -0
- package/dist/chunks/build-ORM2P3M7.js +7 -0
- package/dist/chunks/{chunk-WW3VUXRV.js → chunk-2KCAQTPM.js} +1 -1
- package/dist/chunks/{chunk-NT67T6DL.js → chunk-3HO365U7.js} +1 -1
- package/dist/chunks/{chunk-743NGLUN.js → chunk-3P7HVGKM.js} +1 -1
- package/dist/chunks/{chunk-N7XPPYQQ.js → chunk-3YAQUAOG.js} +1 -1
- package/dist/chunks/{chunk-2RQFMCPJ.js → chunk-54SEEVOA.js} +1 -1
- package/dist/chunks/{chunk-UWO3M2L2.js → chunk-57NFMJ6O.js} +1 -1
- package/dist/chunks/chunk-5G3VXZB4.js +10 -0
- package/dist/chunks/{chunk-JSKSNCK2.js → chunk-6RNZA3VS.js} +1 -1
- package/dist/chunks/chunk-72DVIZTW.js +8 -0
- package/dist/chunks/{chunk-C3XFIO5L.js → chunk-7NEJJJH6.js} +1 -1
- package/dist/chunks/{chunk-WN6OXK2F.js → chunk-7OBZ2AM6.js} +1 -1
- package/dist/chunks/{chunk-UOHVKN6N.js → chunk-7W3B5AJR.js} +2 -2
- package/dist/chunks/{chunk-GASSNHZG.js → chunk-7X34JCBW.js} +1 -1
- package/dist/chunks/{chunk-3R66O72V.js → chunk-AUIBCIET.js} +1 -1
- package/dist/chunks/{chunk-X47XV2WG.js → chunk-B4VX6C2E.js} +1 -1
- package/dist/chunks/{chunk-ACCZWEKL.js → chunk-BIFJ5QEB.js} +1 -1
- package/dist/chunks/{chunk-ALXWJ7XN.js → chunk-DBDWXNAR.js} +1 -1
- package/dist/chunks/{chunk-A752WDCH.js → chunk-DJC2LX46.js} +1 -1
- package/dist/chunks/{chunk-M7ZGWERO.js → chunk-E4M34FSN.js} +1 -1
- package/dist/chunks/chunk-ETYHCI6U.js +7 -0
- package/dist/chunks/{chunk-WOKSTB3F.js → chunk-EWW4GCZY.js} +1 -1
- package/dist/chunks/chunk-EZU5U2PZ.js +7 -0
- package/dist/chunks/{chunk-K5WTLFS6.js → chunk-FSHYI4ZE.js} +1 -1
- package/dist/chunks/{chunk-N4PVXHAJ.js → chunk-G3NHWIPJ.js} +1 -1
- package/dist/chunks/{chunk-7JFK53D4.js → chunk-G7AD7DRG.js} +1 -1
- package/dist/chunks/{chunk-U6N2RNDI.js → chunk-GNJPIPBF.js} +1 -1
- package/dist/chunks/{chunk-CQ3RAERR.js → chunk-GTZDB7IL.js} +1 -1
- package/dist/chunks/{chunk-ZUYWATU5.js → chunk-GV6XYKYC.js} +1 -1
- package/dist/chunks/{chunk-4HXRTNAK.js → chunk-HNF6WZ5S.js} +2 -2
- package/dist/chunks/{chunk-JO3XBFR3.js → chunk-HTZPGIVL.js} +1 -1
- package/dist/chunks/{chunk-E4RLHRDF.js → chunk-IHXHZBHR.js} +1 -1
- package/dist/chunks/chunk-IIKYA7SM.js +9 -0
- package/dist/chunks/{chunk-FA6O7FPC.js → chunk-J4YZKLVO.js} +1 -1
- package/dist/chunks/{chunk-7T4CJ6MJ.js → chunk-J7JW6BBJ.js} +1 -1
- package/dist/chunks/{chunk-D5VTBRWF.js → chunk-JEYKXG6O.js} +1 -1
- package/dist/chunks/{chunk-C6ITILVT.js → chunk-JI2BTGLU.js} +1 -1
- package/dist/chunks/{chunk-VDOJERIW.js → chunk-KQM2AGUS.js} +1 -1
- package/dist/chunks/{chunk-LHQUNL52.js → chunk-L37LRUIN.js} +1 -1
- package/dist/chunks/{chunk-S5CEIACD.js → chunk-LG4JQAY7.js} +1 -1
- package/dist/chunks/{chunk-RFWCEREA.js → chunk-LKYVY3SY.js} +1 -1
- package/dist/chunks/{chunk-7IRKF3ZG.js → chunk-LOD56FYJ.js} +4 -4
- package/dist/chunks/chunk-LSF7FY6X.js +7 -0
- package/dist/chunks/{chunk-KOSM3DYE.js → chunk-LW3HJWXW.js} +1 -1
- package/dist/chunks/chunk-MB4RN7BI.js +9 -0
- package/dist/chunks/{chunk-DECIQZZQ.js → chunk-MJRZSYU2.js} +3 -3
- package/dist/chunks/chunk-OL3BQESW.js +21 -0
- package/dist/chunks/{chunk-NRN65VUM.js → chunk-OY2H4NBN.js} +1 -1
- package/dist/chunks/{chunk-6JU3QZ3O.js → chunk-PP36OP55.js} +1 -1
- package/dist/chunks/{chunk-LCWCTL6L.js → chunk-PTUZ7ATN.js} +1 -1
- package/dist/chunks/{chunk-LCY4SULE.js → chunk-QFVAARN7.js} +1 -1
- package/dist/chunks/{chunk-KG5BMLOI.js → chunk-QLJ72TJJ.js} +1 -1
- package/dist/chunks/{chunk-RVKOPGOI.js → chunk-QYGA4IKR.js} +1 -1
- package/dist/chunks/{chunk-HYW4A5B3.js → chunk-RDC4BJSR.js} +5 -5
- package/dist/chunks/{chunk-PV5YI2ZZ.js → chunk-ROOWZCAB.js} +1 -1
- package/dist/chunks/{chunk-KREBNPHL.js → chunk-SANUW37I.js} +8 -4
- package/dist/chunks/{chunk-VTMLKJVQ.js → chunk-SL5SJUAH.js} +1 -1
- package/dist/chunks/{chunk-JRU6AGXG.js → chunk-TATIUO4V.js} +1 -1
- package/dist/chunks/{chunk-HLVUEYOZ.js → chunk-TNERVI3E.js} +1 -1
- package/dist/chunks/{chunk-L46BHPRD.js → chunk-TNJVIC27.js} +1 -1
- package/dist/chunks/{chunk-B5PFD6Q3.js → chunk-TQ5ETS24.js} +1 -1
- package/dist/chunks/{chunk-7ANQHBBE.js → chunk-U4C2LU7H.js} +1 -1
- package/dist/chunks/{chunk-N5MNZPPJ.js → chunk-UDVWL4I4.js} +1 -1
- package/dist/chunks/{chunk-MK3CTSDV.js → chunk-UV4HOEHC.js} +1 -1
- package/dist/chunks/chunk-UZ2DSUM6.js +7 -0
- package/dist/chunks/chunk-VUCFX2G4.js +7 -0
- package/dist/chunks/chunk-VX7JFH7Q.js +7 -0
- package/dist/chunks/{chunk-EQHNA4BW.js → chunk-WGPFU3NA.js} +1 -1
- package/dist/chunks/chunk-WQLEYC3T.js +9 -0
- package/dist/chunks/{chunk-NESZV33T.js → chunk-WT73KR4Y.js} +1 -1
- package/dist/chunks/chunk-WVUD3JPC.js +10 -0
- package/dist/chunks/{chunk-W7PVS44H.js → chunk-XP4C5FLG.js} +1 -1
- package/dist/chunks/{chunk-S2LBGLRE.js → chunk-XQVD5V3T.js} +1 -1
- package/dist/chunks/{chunk-7POWBJDF.js → chunk-YAJFAGUO.js} +3 -3
- package/dist/chunks/{chunk-7I23VXBQ.js → chunk-ZXEYTD3W.js} +1 -1
- package/dist/chunks/clear-IWIBH2TY.js +8 -0
- package/dist/chunks/{compile-vercel-config-2IC23CNT.js → compile-vercel-config-B2ZES5JB.js} +1 -1
- package/dist/chunks/{config-T3WHONFJ.js → config-5GNX5VM2.js} +1 -1
- package/dist/chunks/config-BLTCR2NA.js +8 -0
- package/dist/chunks/config-validator.mjs +1 -1
- package/dist/chunks/delete-DSDSQVG7.js +9 -0
- package/dist/chunks/delete-TN2UUEOF.js +10 -0
- package/dist/chunks/{detect-projects-GJF4VXQI.js → detect-projects-AWDCPVLE.js} +1 -1
- package/dist/chunks/{detect-services-K3363KB7.js → detect-services-VQWDU5RR.js} +1 -1
- package/dist/chunks/disable-76QRXL7J.js +7 -0
- package/dist/chunks/discard-CWXRCRFL.js +14 -0
- package/dist/chunks/edit-KC6AK6DA.js +9 -0
- package/dist/chunks/edit-LYZPKUZY.js +8 -0
- package/dist/chunks/enable-ZVEULDXQ.js +7 -0
- package/dist/chunks/{export-CMP3APAJ.js → export-SYT5NHSM.js} +2 -2
- package/dist/chunks/{future-GS7ZLJ3N.js → future-YNSZJIAG.js} +1 -1
- package/dist/chunks/{generate-cert-for-deploy-2HHUYGHU.js → generate-cert-for-deploy-G26VGC4I.js} +1 -1
- package/dist/chunks/image-XAJFJ6UD.js +7 -0
- package/dist/chunks/{import-builders-EUOOFPHW.js → import-builders-JXIILQOI.js} +1 -1
- package/dist/chunks/inspect-7CODV4HJ.js +9 -0
- package/dist/chunks/{inspect-DYNTJMTQ.js → inspect-A76MME2I.js} +2 -2
- package/dist/chunks/{inspect-V7HA2GZ5.js → inspect-DF35I6AZ.js} +2 -2
- package/dist/chunks/{inspect-KYFVYFWX.js → inspect-HIRGIJON.js} +2 -2
- package/dist/chunks/inspect-JEHOMETA.js +13 -0
- package/dist/chunks/{list-X4MKKDJX.js → list-3KNHQV4S.js} +2 -2
- package/dist/chunks/{list-TSDBEAVF.js → list-M2YCP5HV.js} +2 -2
- package/dist/chunks/list-XNNJCS5K.js +11 -0
- package/dist/chunks/{login-5FMKHZVG.js → login-2GVRFOQQ.js} +1 -1
- package/dist/chunks/login-UM35IU3S.js +9 -0
- package/dist/chunks/{logs-X2OIQXGW.js → logs-HS5YRXDR.js} +1 -1
- package/dist/chunks/ls-ISILCAV4.js +11 -0
- package/dist/chunks/{ls-6EDJUUDW.js → ls-KGYG3F3A.js} +2 -2
- package/dist/chunks/ls-M2SGUIZK.js +8 -0
- package/dist/chunks/ls-WROXB2SF.js +8 -0
- package/dist/chunks/{ls-4W4KTJ6T.js → ls-Y3CBOCK2.js} +2 -2
- package/dist/chunks/{ls-HK45UWBD.js → ls-YJEUWZFT.js} +2 -2
- package/dist/chunks/{ls-BMAVUMXU.js → ls-Z2JKBJKR.js} +2 -2
- package/dist/chunks/mutate-ZCA7FKDL.js +9 -0
- package/dist/chunks/notifications-7QROHXJQ.js +7 -0
- package/dist/chunks/open-FU7OJPAY.js +7 -0
- package/dist/chunks/{openapi-W365UPH2.js → openapi-KGCZ7LB4.js} +1 -1
- package/dist/chunks/permissions-I4ZXPUVY.js +7 -0
- package/dist/chunks/{prompt-missing-credentials-VDR5HVA2.js → prompt-missing-credentials-YPLDAGZA.js} +1 -1
- package/dist/chunks/publish-6WBGPES3.js +15 -0
- package/dist/chunks/pull-BJUOPX3J.js +7 -0
- package/dist/chunks/{purchase-domain-if-available-Q7H2TGKR.js → purchase-domain-if-available-7KTEXJFK.js} +1 -1
- package/dist/chunks/push-ZRDFCF3D.js +7 -0
- package/dist/chunks/{query-ABPO2REN.js → query-RXONIAT5.js} +2 -2
- package/dist/chunks/{reauthenticate-3H5Q2ZWD.js → reauthenticate-7RZ2XFR4.js} +1 -1
- package/dist/chunks/reorder-P5LWY3FS.js +10 -0
- package/dist/chunks/reply-QNIIC2TP.js +9 -0
- package/dist/chunks/resolve-RQBKN4WL.js +12 -0
- package/dist/chunks/restore-NPY7XA3A.js +16 -0
- package/dist/chunks/{rm-KHO6RV55.js → rm-4PBTYQBF.js} +1 -1
- package/dist/chunks/rm-5LVIH5IE.js +8 -0
- package/dist/chunks/rm-GGY4TGSX.js +8 -0
- package/dist/chunks/rm-K3V6KVHW.js +8 -0
- package/dist/chunks/rm-XOE3T2QM.js +8 -0
- package/dist/chunks/rule-inspect-6UI5XBGA.js +8 -0
- package/dist/chunks/rules-MJWNYYRT.js +7 -0
- package/dist/chunks/{schema-EKWTCBNR.js → schema-ABJKQ6AB.js} +1 -1
- package/dist/chunks/{schema-FZVKQRNB.js → schema-SOV2XP24.js} +1 -1
- package/dist/chunks/{select-org-37C26F7T.js → select-org-G4KFHFH3.js} +1 -1
- package/dist/chunks/set-DJO2C6XG.js +7 -0
- package/dist/chunks/setup-and-link-BZCJ74II.js +7 -0
- package/dist/chunks/tags-DY5IM5QF.js +7 -0
- package/dist/chunks/{types-UN5J66MI.js → types-RHUVE4FN.js} +2 -2
- package/dist/chunks/{update-QY3ZME4T.js → update-6WSCOLSB.js} +2 -2
- package/dist/commands/build/index.js +2 -2
- package/dist/commands/deploy/index.js +13 -10
- package/dist/commands/dev/index.js +6 -6
- package/dist/commands/env/index.js +12 -12
- package/dist/commands/link/index.js +2 -2
- package/dist/commands/list/index.js +1 -1
- package/dist/commands-bulk.js +273 -273
- package/dist/index.js +6 -3
- package/dist/vc.js +2 -1
- package/dist/version.mjs +1 -1
- package/package.json +55 -55
- package/dist/chunks/add-Q5OZFIRM.js +0 -8
- package/dist/chunks/add-VLVURKGS.js +0 -8
- package/dist/chunks/build-MR7MUWBQ.js +0 -7
- package/dist/chunks/chunk-5VWK73R6.js +0 -10
- package/dist/chunks/chunk-ADDXKC3J.js +0 -9
- package/dist/chunks/chunk-AKPQWZIP.js +0 -21
- package/dist/chunks/chunk-CVX5X5RI.js +0 -7
- package/dist/chunks/chunk-HVROAV4B.js +0 -9
- package/dist/chunks/chunk-ILXXXXVQ.js +0 -8
- package/dist/chunks/chunk-NXTK7VKL.js +0 -7
- package/dist/chunks/chunk-PADCVJ7G.js +0 -7
- package/dist/chunks/chunk-PAI3WRPA.js +0 -9
- package/dist/chunks/chunk-PTFKU33G.js +0 -10
- package/dist/chunks/chunk-VZDY57PJ.js +0 -7
- package/dist/chunks/chunk-ZQIUMXCI.js +0 -7
- package/dist/chunks/clear-PPE55RPM.js +0 -8
- package/dist/chunks/config-G2A6KPPM.js +0 -8
- package/dist/chunks/delete-75SYJKNE.js +0 -10
- package/dist/chunks/delete-MHXN5KTO.js +0 -9
- package/dist/chunks/disable-OUYOHEWN.js +0 -7
- package/dist/chunks/discard-RXSHOY3J.js +0 -14
- package/dist/chunks/edit-Y7OL72ZK.js +0 -9
- package/dist/chunks/edit-Z5RCWPOX.js +0 -8
- package/dist/chunks/enable-HI2UH2NM.js +0 -7
- package/dist/chunks/image-SQIUEBFK.js +0 -7
- package/dist/chunks/inspect-2SXPXNYH.js +0 -13
- package/dist/chunks/inspect-J3F3U3YF.js +0 -9
- package/dist/chunks/list-ZQSOWXRI.js +0 -11
- package/dist/chunks/login-YEDMPXUF.js +0 -9
- package/dist/chunks/ls-LAYBQVU2.js +0 -8
- package/dist/chunks/ls-SQ42O6O5.js +0 -11
- package/dist/chunks/ls-XIJ4CY2N.js +0 -8
- package/dist/chunks/mutate-6FCOCHSA.js +0 -9
- package/dist/chunks/notifications-JTK7ZOLC.js +0 -7
- package/dist/chunks/open-3G4R3VIN.js +0 -7
- package/dist/chunks/permissions-IWUBXZBZ.js +0 -7
- package/dist/chunks/publish-5QKVU6YV.js +0 -15
- package/dist/chunks/pull-K4JQEP7N.js +0 -7
- package/dist/chunks/push-COILRLCW.js +0 -7
- package/dist/chunks/reorder-FBUQ5ET7.js +0 -10
- package/dist/chunks/reply-FR5VO7DA.js +0 -9
- package/dist/chunks/resolve-JI2ENFS6.js +0 -12
- package/dist/chunks/restore-LYY4BSYJ.js +0 -16
- package/dist/chunks/rm-C2RWWMO3.js +0 -8
- package/dist/chunks/rm-CYYVIF2U.js +0 -8
- package/dist/chunks/rm-ETLZ75RJ.js +0 -8
- package/dist/chunks/rm-GHSQEFRG.js +0 -8
- package/dist/chunks/rule-inspect-MISYALLU.js +0 -8
- package/dist/chunks/rules-KAGL6MH3.js +0 -7
- package/dist/chunks/set-5D7C6HMZ.js +0 -7
- package/dist/chunks/setup-and-link-H4P3FZB3.js +0 -7
- package/dist/chunks/tags-DVGQQZNC.js +0 -7
|
@@ -1,21 +0,0 @@
|
|
|
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_chownr,require_mkdirp,require_pump,require_tar_stream}from"./chunk-V6MR45PD.js";import{require_minimatch2 as require_minimatch}from"./chunk-N4PVXHAJ.js";import{require_ms}from"./chunk-QTKJC2O5.js";import{require_types}from"./chunk-GHM7V3GG.js";import{VERCEL_DIR,VERCEL_DIR_PROJECT,require_lib}from"./chunk-7IRKF3ZG.js";import{require_graceful_fs}from"./chunk-F2ZWW2IO.js";import{require_dist}from"./chunk-QGIQK47P.js";import{__commonJS,__require,__toESM}from"./chunk-6L236MNA.js";var require_universalify=__commonJS({"../../node_modules/.pnpm/universalify@0.1.2/node_modules/universalify/index.js"(exports){"use strict";exports.fromCallback=function(fn){return Object.defineProperty(function(){if(typeof arguments[arguments.length-1]=="function")fn.apply(this,arguments);else return new Promise((resolve,reject)=>{arguments[arguments.length]=(err,res)=>{if(err)return reject(err);resolve(res)},arguments.length++,fn.apply(this,arguments)})},"name",{value:fn.name})};exports.fromPromise=function(fn){return Object.defineProperty(function(){let cb=arguments[arguments.length-1];if(typeof cb!="function")return fn.apply(this,arguments);fn.apply(this,arguments).then(r=>cb(null,r),cb)},"name",{value:fn.name})}}});var require_fs=__commonJS({"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/fs/index.js"(exports){"use strict";var u=require_universalify().fromCallback,fs=require_graceful_fs(),api=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter(key=>typeof fs[key]=="function");Object.keys(fs).forEach(key=>{key!=="promises"&&(exports[key]=fs[key])});api.forEach(method=>{exports[method]=u(fs[method])});exports.exists=function(filename,callback){return typeof callback=="function"?fs.exists(filename,callback):new Promise(resolve=>fs.exists(filename,resolve))};exports.read=function(fd,buffer,offset,length,position,callback){return typeof callback=="function"?fs.read(fd,buffer,offset,length,position,callback):new Promise((resolve,reject)=>{fs.read(fd,buffer,offset,length,position,(err,bytesRead,buffer2)=>{if(err)return reject(err);resolve({bytesRead,buffer:buffer2})})})};exports.write=function(fd,buffer,...args){return typeof args[args.length-1]=="function"?fs.write(fd,buffer,...args):new Promise((resolve,reject)=>{fs.write(fd,buffer,...args,(err,bytesWritten,buffer2)=>{if(err)return reject(err);resolve({bytesWritten,buffer:buffer2})})})}}});var require_win32=__commonJS({"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/mkdirs/win32.js"(exports,module){"use strict";var path=__require("path");function getRootPath(p){return p=path.normalize(path.resolve(p)).split(path.sep),p.length>0?p[0]:null}var INVALID_PATH_CHARS=/[<>:"|?*]/;function invalidWin32Path(p){let rp=getRootPath(p);return p=p.replace(rp,""),INVALID_PATH_CHARS.test(p)}module.exports={getRootPath,invalidWin32Path}}});var require_mkdirs=__commonJS({"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/mkdirs/mkdirs.js"(exports,module){"use strict";var fs=require_graceful_fs(),path=__require("path"),invalidWin32Path=require_win32().invalidWin32Path,o777=parseInt("0777",8);function mkdirs(p,opts,callback,made){if(typeof opts=="function"?(callback=opts,opts={}):(!opts||typeof opts!="object")&&(opts={mode:opts}),process.platform==="win32"&&invalidWin32Path(p)){let errInval=new Error(p+" contains invalid WIN32 path characters.");return errInval.code="EINVAL",callback(errInval)}let mode=opts.mode,xfs=opts.fs||fs;mode===void 0&&(mode=o777&~process.umask()),made||(made=null),callback=callback||function(){},p=path.resolve(p),xfs.mkdir(p,mode,er=>{if(!er)return made=made||p,callback(null,made);switch(er.code){case"ENOENT":if(path.dirname(p)===p)return callback(er);mkdirs(path.dirname(p),opts,(er2,made2)=>{er2?callback(er2,made2):mkdirs(p,opts,callback,made2)});break;default:xfs.stat(p,(er2,stat)=>{er2||!stat.isDirectory()?callback(er,made):callback(null,made)});break}})}module.exports=mkdirs}});var require_mkdirs_sync=__commonJS({"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js"(exports,module){"use strict";var fs=require_graceful_fs(),path=__require("path"),invalidWin32Path=require_win32().invalidWin32Path,o777=parseInt("0777",8);function mkdirsSync(p,opts,made){(!opts||typeof opts!="object")&&(opts={mode:opts});let mode=opts.mode,xfs=opts.fs||fs;if(process.platform==="win32"&&invalidWin32Path(p)){let errInval=new Error(p+" contains invalid WIN32 path characters.");throw errInval.code="EINVAL",errInval}mode===void 0&&(mode=o777&~process.umask()),made||(made=null),p=path.resolve(p);try{xfs.mkdirSync(p,mode),made=made||p}catch(err0){if(err0.code==="ENOENT"){if(path.dirname(p)===p)throw err0;made=mkdirsSync(path.dirname(p),opts,made),mkdirsSync(p,opts,made)}else{let stat;try{stat=xfs.statSync(p)}catch{throw err0}if(!stat.isDirectory())throw err0}}return made}module.exports=mkdirsSync}});var require_mkdirs2=__commonJS({"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/mkdirs/index.js"(exports,module){"use strict";var u=require_universalify().fromCallback,mkdirs=u(require_mkdirs()),mkdirsSync=require_mkdirs_sync();module.exports={mkdirs,mkdirsSync,mkdirp:mkdirs,mkdirpSync:mkdirsSync,ensureDir:mkdirs,ensureDirSync:mkdirsSync}}});var require_utimes=__commonJS({"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/util/utimes.js"(exports,module){"use strict";var fs=require_graceful_fs(),os=__require("os"),path=__require("path");function hasMillisResSync(){let tmpfile=path.join("millis-test-sync"+Date.now().toString()+Math.random().toString().slice(2));tmpfile=path.join(os.tmpdir(),tmpfile);let d=new Date(1435410243862);fs.writeFileSync(tmpfile,"https://github.com/jprichardson/node-fs-extra/pull/141");let fd=fs.openSync(tmpfile,"r+");return fs.futimesSync(fd,d,d),fs.closeSync(fd),fs.statSync(tmpfile).mtime>1435410243e3}function hasMillisRes(callback){let tmpfile=path.join("millis-test"+Date.now().toString()+Math.random().toString().slice(2));tmpfile=path.join(os.tmpdir(),tmpfile);let d=new Date(1435410243862);fs.writeFile(tmpfile,"https://github.com/jprichardson/node-fs-extra/pull/141",err=>{if(err)return callback(err);fs.open(tmpfile,"r+",(err2,fd)=>{if(err2)return callback(err2);fs.futimes(fd,d,d,err3=>{if(err3)return callback(err3);fs.close(fd,err4=>{if(err4)return callback(err4);fs.stat(tmpfile,(err5,stats)=>{if(err5)return callback(err5);callback(null,stats.mtime>1435410243e3)})})})})})}function timeRemoveMillis(timestamp){if(typeof timestamp=="number")return Math.floor(timestamp/1e3)*1e3;if(timestamp instanceof Date)return new Date(Math.floor(timestamp.getTime()/1e3)*1e3);throw new Error("fs-extra: timeRemoveMillis() unknown parameter type")}function utimesMillis(path2,atime,mtime,callback){fs.open(path2,"r+",(err,fd)=>{if(err)return callback(err);fs.futimes(fd,atime,mtime,futimesErr=>{fs.close(fd,closeErr=>{callback&&callback(futimesErr||closeErr)})})})}function utimesMillisSync(path2,atime,mtime){let fd=fs.openSync(path2,"r+");return fs.futimesSync(fd,atime,mtime),fs.closeSync(fd)}module.exports={hasMillisRes,hasMillisResSync,timeRemoveMillis,utimesMillis,utimesMillisSync}}});var require_stat=__commonJS({"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/util/stat.js"(exports,module){"use strict";var fs=__require("fs"),path=__require("path"),NODE_VERSION_MAJOR_WITH_BIGINT=10,NODE_VERSION_MINOR_WITH_BIGINT=5,NODE_VERSION_PATCH_WITH_BIGINT=0,nodeVersion=process.versions.node.split("."),nodeVersionMajor=Number.parseInt(nodeVersion[0],10),nodeVersionMinor=Number.parseInt(nodeVersion[1],10),nodeVersionPatch=Number.parseInt(nodeVersion[2],10);function nodeSupportsBigInt(){if(nodeVersionMajor>NODE_VERSION_MAJOR_WITH_BIGINT)return!0;if(nodeVersionMajor===NODE_VERSION_MAJOR_WITH_BIGINT){if(nodeVersionMinor>NODE_VERSION_MINOR_WITH_BIGINT)return!0;if(nodeVersionMinor===NODE_VERSION_MINOR_WITH_BIGINT&&nodeVersionPatch>=NODE_VERSION_PATCH_WITH_BIGINT)return!0}return!1}function getStats(src,dest,cb){nodeSupportsBigInt()?fs.stat(src,{bigint:!0},(err,srcStat)=>{if(err)return cb(err);fs.stat(dest,{bigint:!0},(err2,destStat)=>err2?err2.code==="ENOENT"?cb(null,{srcStat,destStat:null}):cb(err2):cb(null,{srcStat,destStat}))}):fs.stat(src,(err,srcStat)=>{if(err)return cb(err);fs.stat(dest,(err2,destStat)=>err2?err2.code==="ENOENT"?cb(null,{srcStat,destStat:null}):cb(err2):cb(null,{srcStat,destStat}))})}function getStatsSync(src,dest){let srcStat,destStat;nodeSupportsBigInt()?srcStat=fs.statSync(src,{bigint:!0}):srcStat=fs.statSync(src);try{nodeSupportsBigInt()?destStat=fs.statSync(dest,{bigint:!0}):destStat=fs.statSync(dest)}catch(err){if(err.code==="ENOENT")return{srcStat,destStat:null};throw err}return{srcStat,destStat}}function checkPaths(src,dest,funcName,cb){getStats(src,dest,(err,stats)=>{if(err)return cb(err);let{srcStat,destStat}=stats;return destStat&&destStat.ino&&destStat.dev&&destStat.ino===srcStat.ino&&destStat.dev===srcStat.dev?cb(new Error("Source and destination must not be the same.")):srcStat.isDirectory()&&isSrcSubdir(src,dest)?cb(new Error(errMsg(src,dest,funcName))):cb(null,{srcStat,destStat})})}function checkPathsSync(src,dest,funcName){let{srcStat,destStat}=getStatsSync(src,dest);if(destStat&&destStat.ino&&destStat.dev&&destStat.ino===srcStat.ino&&destStat.dev===srcStat.dev)throw new Error("Source and destination must not be the same.");if(srcStat.isDirectory()&&isSrcSubdir(src,dest))throw new Error(errMsg(src,dest,funcName));return{srcStat,destStat}}function checkParentPaths(src,srcStat,dest,funcName,cb){let srcParent=path.resolve(path.dirname(src)),destParent=path.resolve(path.dirname(dest));if(destParent===srcParent||destParent===path.parse(destParent).root)return cb();nodeSupportsBigInt()?fs.stat(destParent,{bigint:!0},(err,destStat)=>err?err.code==="ENOENT"?cb():cb(err):destStat.ino&&destStat.dev&&destStat.ino===srcStat.ino&&destStat.dev===srcStat.dev?cb(new Error(errMsg(src,dest,funcName))):checkParentPaths(src,srcStat,destParent,funcName,cb)):fs.stat(destParent,(err,destStat)=>err?err.code==="ENOENT"?cb():cb(err):destStat.ino&&destStat.dev&&destStat.ino===srcStat.ino&&destStat.dev===srcStat.dev?cb(new Error(errMsg(src,dest,funcName))):checkParentPaths(src,srcStat,destParent,funcName,cb))}function checkParentPathsSync(src,srcStat,dest,funcName){let srcParent=path.resolve(path.dirname(src)),destParent=path.resolve(path.dirname(dest));if(destParent===srcParent||destParent===path.parse(destParent).root)return;let destStat;try{nodeSupportsBigInt()?destStat=fs.statSync(destParent,{bigint:!0}):destStat=fs.statSync(destParent)}catch(err){if(err.code==="ENOENT")return;throw err}if(destStat.ino&&destStat.dev&&destStat.ino===srcStat.ino&&destStat.dev===srcStat.dev)throw new Error(errMsg(src,dest,funcName));return checkParentPathsSync(src,srcStat,destParent,funcName)}function isSrcSubdir(src,dest){let srcArr=path.resolve(src).split(path.sep).filter(i=>i),destArr=path.resolve(dest).split(path.sep).filter(i=>i);return srcArr.reduce((acc,cur,i)=>acc&&destArr[i]===cur,!0)}function errMsg(src,dest,funcName){return`Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`}module.exports={checkPaths,checkPathsSync,checkParentPaths,checkParentPathsSync,isSrcSubdir}}});var require_buffer=__commonJS({"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/util/buffer.js"(exports,module){"use strict";module.exports=function(size){if(typeof Buffer.allocUnsafe=="function")try{return Buffer.allocUnsafe(size)}catch{return new Buffer(size)}return new Buffer(size)}}});var require_copy_sync=__commonJS({"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/copy-sync/copy-sync.js"(exports,module){"use strict";var fs=__require("fs"),path=__require("path"),mkdirpSync=require_mkdirs2().mkdirsSync,utimesSync=require_utimes().utimesMillisSync,stat=require_stat();function copySync(src,dest,opts){typeof opts=="function"&&(opts={filter:opts}),opts=opts||{},opts.clobber="clobber"in opts?!!opts.clobber:!0,opts.overwrite="overwrite"in opts?!!opts.overwrite:opts.clobber,opts.preserveTimestamps&&process.arch==="ia32"&&console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
8
|
-
|
|
9
|
-
see https://github.com/jprichardson/node-fs-extra/issues/269`);let{srcStat,destStat}=stat.checkPathsSync(src,dest,"copy");return stat.checkParentPathsSync(src,srcStat,dest,"copy"),handleFilterAndCopy(destStat,src,dest,opts)}function handleFilterAndCopy(destStat,src,dest,opts){if(opts.filter&&!opts.filter(src,dest))return;let destParent=path.dirname(dest);return fs.existsSync(destParent)||mkdirpSync(destParent),startCopy(destStat,src,dest,opts)}function startCopy(destStat,src,dest,opts){if(!(opts.filter&&!opts.filter(src,dest)))return getStats(destStat,src,dest,opts)}function getStats(destStat,src,dest,opts){let srcStat=(opts.dereference?fs.statSync:fs.lstatSync)(src);if(srcStat.isDirectory())return onDir(srcStat,destStat,src,dest,opts);if(srcStat.isFile()||srcStat.isCharacterDevice()||srcStat.isBlockDevice())return onFile(srcStat,destStat,src,dest,opts);if(srcStat.isSymbolicLink())return onLink(destStat,src,dest,opts)}function onFile(srcStat,destStat,src,dest,opts){return destStat?mayCopyFile(srcStat,src,dest,opts):copyFile(srcStat,src,dest,opts)}function mayCopyFile(srcStat,src,dest,opts){if(opts.overwrite)return fs.unlinkSync(dest),copyFile(srcStat,src,dest,opts);if(opts.errorOnExist)throw new Error(`'${dest}' already exists`)}function copyFile(srcStat,src,dest,opts){return typeof fs.copyFileSync=="function"?(fs.copyFileSync(src,dest),fs.chmodSync(dest,srcStat.mode),opts.preserveTimestamps?utimesSync(dest,srcStat.atime,srcStat.mtime):void 0):copyFileFallback(srcStat,src,dest,opts)}function copyFileFallback(srcStat,src,dest,opts){let _buff=require_buffer()(65536),fdr=fs.openSync(src,"r"),fdw=fs.openSync(dest,"w",srcStat.mode),pos=0;for(;pos<srcStat.size;){let bytesRead=fs.readSync(fdr,_buff,0,65536,pos);fs.writeSync(fdw,_buff,0,bytesRead),pos+=bytesRead}opts.preserveTimestamps&&fs.futimesSync(fdw,srcStat.atime,srcStat.mtime),fs.closeSync(fdr),fs.closeSync(fdw)}function onDir(srcStat,destStat,src,dest,opts){if(!destStat)return mkDirAndCopy(srcStat,src,dest,opts);if(destStat&&!destStat.isDirectory())throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`);return copyDir(src,dest,opts)}function mkDirAndCopy(srcStat,src,dest,opts){return fs.mkdirSync(dest),copyDir(src,dest,opts),fs.chmodSync(dest,srcStat.mode)}function copyDir(src,dest,opts){fs.readdirSync(src).forEach(item=>copyDirItem(item,src,dest,opts))}function copyDirItem(item,src,dest,opts){let srcItem=path.join(src,item),destItem=path.join(dest,item),{destStat}=stat.checkPathsSync(srcItem,destItem,"copy");return startCopy(destStat,srcItem,destItem,opts)}function onLink(destStat,src,dest,opts){let resolvedSrc=fs.readlinkSync(src);if(opts.dereference&&(resolvedSrc=path.resolve(process.cwd(),resolvedSrc)),destStat){let resolvedDest;try{resolvedDest=fs.readlinkSync(dest)}catch(err){if(err.code==="EINVAL"||err.code==="UNKNOWN")return fs.symlinkSync(resolvedSrc,dest);throw err}if(opts.dereference&&(resolvedDest=path.resolve(process.cwd(),resolvedDest)),stat.isSrcSubdir(resolvedSrc,resolvedDest))throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);if(fs.statSync(dest).isDirectory()&&stat.isSrcSubdir(resolvedDest,resolvedSrc))throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);return copyLink(resolvedSrc,dest)}else return fs.symlinkSync(resolvedSrc,dest)}function copyLink(resolvedSrc,dest){return fs.unlinkSync(dest),fs.symlinkSync(resolvedSrc,dest)}module.exports=copySync}});var require_copy_sync2=__commonJS({"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/copy-sync/index.js"(exports,module){"use strict";module.exports={copySync:require_copy_sync()}}});var require_path_exists=__commonJS({"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/path-exists/index.js"(exports,module){"use strict";var u=require_universalify().fromPromise,fs=require_fs();function pathExists(path){return fs.access(path).then(()=>!0).catch(()=>!1)}module.exports={pathExists:u(pathExists),pathExistsSync:fs.existsSync}}});var require_copy=__commonJS({"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/copy/copy.js"(exports,module){"use strict";var fs=__require("fs"),path=__require("path"),mkdirp=require_mkdirs2().mkdirs,pathExists=require_path_exists().pathExists,utimes=require_utimes().utimesMillis,stat=require_stat();function copy(src,dest,opts,cb){typeof opts=="function"&&!cb?(cb=opts,opts={}):typeof opts=="function"&&(opts={filter:opts}),cb=cb||function(){},opts=opts||{},opts.clobber="clobber"in opts?!!opts.clobber:!0,opts.overwrite="overwrite"in opts?!!opts.overwrite:opts.clobber,opts.preserveTimestamps&&process.arch==="ia32"&&console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
10
|
-
|
|
11
|
-
see https://github.com/jprichardson/node-fs-extra/issues/269`),stat.checkPaths(src,dest,"copy",(err,stats)=>{if(err)return cb(err);let{srcStat,destStat}=stats;stat.checkParentPaths(src,srcStat,dest,"copy",err2=>err2?cb(err2):opts.filter?handleFilter(checkParentDir,destStat,src,dest,opts,cb):checkParentDir(destStat,src,dest,opts,cb))})}function checkParentDir(destStat,src,dest,opts,cb){let destParent=path.dirname(dest);pathExists(destParent,(err,dirExists)=>{if(err)return cb(err);if(dirExists)return startCopy(destStat,src,dest,opts,cb);mkdirp(destParent,err2=>err2?cb(err2):startCopy(destStat,src,dest,opts,cb))})}function handleFilter(onInclude,destStat,src,dest,opts,cb){Promise.resolve(opts.filter(src,dest)).then(include=>include?onInclude(destStat,src,dest,opts,cb):cb(),error=>cb(error))}function startCopy(destStat,src,dest,opts,cb){return opts.filter?handleFilter(getStats,destStat,src,dest,opts,cb):getStats(destStat,src,dest,opts,cb)}function getStats(destStat,src,dest,opts,cb){(opts.dereference?fs.stat:fs.lstat)(src,(err,srcStat)=>{if(err)return cb(err);if(srcStat.isDirectory())return onDir(srcStat,destStat,src,dest,opts,cb);if(srcStat.isFile()||srcStat.isCharacterDevice()||srcStat.isBlockDevice())return onFile(srcStat,destStat,src,dest,opts,cb);if(srcStat.isSymbolicLink())return onLink(destStat,src,dest,opts,cb)})}function onFile(srcStat,destStat,src,dest,opts,cb){return destStat?mayCopyFile(srcStat,src,dest,opts,cb):copyFile(srcStat,src,dest,opts,cb)}function mayCopyFile(srcStat,src,dest,opts,cb){if(opts.overwrite)fs.unlink(dest,err=>err?cb(err):copyFile(srcStat,src,dest,opts,cb));else return opts.errorOnExist?cb(new Error(`'${dest}' already exists`)):cb()}function copyFile(srcStat,src,dest,opts,cb){return typeof fs.copyFile=="function"?fs.copyFile(src,dest,err=>err?cb(err):setDestModeAndTimestamps(srcStat,dest,opts,cb)):copyFileFallback(srcStat,src,dest,opts,cb)}function copyFileFallback(srcStat,src,dest,opts,cb){let rs=fs.createReadStream(src);rs.on("error",err=>cb(err)).once("open",()=>{let ws=fs.createWriteStream(dest,{mode:srcStat.mode});ws.on("error",err=>cb(err)).on("open",()=>rs.pipe(ws)).once("close",()=>setDestModeAndTimestamps(srcStat,dest,opts,cb))})}function setDestModeAndTimestamps(srcStat,dest,opts,cb){fs.chmod(dest,srcStat.mode,err=>err?cb(err):opts.preserveTimestamps?utimes(dest,srcStat.atime,srcStat.mtime,cb):cb())}function onDir(srcStat,destStat,src,dest,opts,cb){return destStat?destStat&&!destStat.isDirectory()?cb(new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`)):copyDir(src,dest,opts,cb):mkDirAndCopy(srcStat,src,dest,opts,cb)}function mkDirAndCopy(srcStat,src,dest,opts,cb){fs.mkdir(dest,err=>{if(err)return cb(err);copyDir(src,dest,opts,err2=>err2?cb(err2):fs.chmod(dest,srcStat.mode,cb))})}function copyDir(src,dest,opts,cb){fs.readdir(src,(err,items)=>err?cb(err):copyDirItems(items,src,dest,opts,cb))}function copyDirItems(items,src,dest,opts,cb){let item=items.pop();return item?copyDirItem(items,item,src,dest,opts,cb):cb()}function copyDirItem(items,item,src,dest,opts,cb){let srcItem=path.join(src,item),destItem=path.join(dest,item);stat.checkPaths(srcItem,destItem,"copy",(err,stats)=>{if(err)return cb(err);let{destStat}=stats;startCopy(destStat,srcItem,destItem,opts,err2=>err2?cb(err2):copyDirItems(items,src,dest,opts,cb))})}function onLink(destStat,src,dest,opts,cb){fs.readlink(src,(err,resolvedSrc)=>{if(err)return cb(err);if(opts.dereference&&(resolvedSrc=path.resolve(process.cwd(),resolvedSrc)),destStat)fs.readlink(dest,(err2,resolvedDest)=>err2?err2.code==="EINVAL"||err2.code==="UNKNOWN"?fs.symlink(resolvedSrc,dest,cb):cb(err2):(opts.dereference&&(resolvedDest=path.resolve(process.cwd(),resolvedDest)),stat.isSrcSubdir(resolvedSrc,resolvedDest)?cb(new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)):destStat.isDirectory()&&stat.isSrcSubdir(resolvedDest,resolvedSrc)?cb(new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)):copyLink(resolvedSrc,dest,cb)));else return fs.symlink(resolvedSrc,dest,cb)})}function copyLink(resolvedSrc,dest,cb){fs.unlink(dest,err=>err?cb(err):fs.symlink(resolvedSrc,dest,cb))}module.exports=copy}});var require_copy2=__commonJS({"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/copy/index.js"(exports,module){"use strict";var u=require_universalify().fromCallback;module.exports={copy:u(require_copy())}}});var require_rimraf=__commonJS({"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/remove/rimraf.js"(exports,module){"use strict";var fs=require_graceful_fs(),path=__require("path"),assert=__require("assert"),isWindows=process.platform==="win32";function defaults(options){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach(m=>{options[m]=options[m]||fs[m],m=m+"Sync",options[m]=options[m]||fs[m]}),options.maxBusyTries=options.maxBusyTries||3}function rimraf(p,options,cb){let busyTries=0;typeof options=="function"&&(cb=options,options={}),assert(p,"rimraf: missing path"),assert.strictEqual(typeof p,"string","rimraf: path should be a string"),assert.strictEqual(typeof cb,"function","rimraf: callback function required"),assert(options,"rimraf: invalid options argument provided"),assert.strictEqual(typeof options,"object","rimraf: options should be object"),defaults(options),rimraf_(p,options,function CB(er){if(er){if((er.code==="EBUSY"||er.code==="ENOTEMPTY"||er.code==="EPERM")&&busyTries<options.maxBusyTries){busyTries++;let time=busyTries*100;return setTimeout(()=>rimraf_(p,options,CB),time)}er.code==="ENOENT"&&(er=null)}cb(er)})}function rimraf_(p,options,cb){assert(p),assert(options),assert(typeof cb=="function"),options.lstat(p,(er,st)=>{if(er&&er.code==="ENOENT")return cb(null);if(er&&er.code==="EPERM"&&isWindows)return fixWinEPERM(p,options,er,cb);if(st&&st.isDirectory())return rmdir(p,options,er,cb);options.unlink(p,er2=>{if(er2){if(er2.code==="ENOENT")return cb(null);if(er2.code==="EPERM")return isWindows?fixWinEPERM(p,options,er2,cb):rmdir(p,options,er2,cb);if(er2.code==="EISDIR")return rmdir(p,options,er2,cb)}return cb(er2)})})}function fixWinEPERM(p,options,er,cb){assert(p),assert(options),assert(typeof cb=="function"),er&&assert(er instanceof Error),options.chmod(p,438,er2=>{er2?cb(er2.code==="ENOENT"?null:er):options.stat(p,(er3,stats)=>{er3?cb(er3.code==="ENOENT"?null:er):stats.isDirectory()?rmdir(p,options,er,cb):options.unlink(p,cb)})})}function fixWinEPERMSync(p,options,er){let stats;assert(p),assert(options),er&&assert(er instanceof Error);try{options.chmodSync(p,438)}catch(er2){if(er2.code==="ENOENT")return;throw er}try{stats=options.statSync(p)}catch(er3){if(er3.code==="ENOENT")return;throw er}stats.isDirectory()?rmdirSync(p,options,er):options.unlinkSync(p)}function rmdir(p,options,originalEr,cb){assert(p),assert(options),originalEr&&assert(originalEr instanceof Error),assert(typeof cb=="function"),options.rmdir(p,er=>{er&&(er.code==="ENOTEMPTY"||er.code==="EEXIST"||er.code==="EPERM")?rmkids(p,options,cb):er&&er.code==="ENOTDIR"?cb(originalEr):cb(er)})}function rmkids(p,options,cb){assert(p),assert(options),assert(typeof cb=="function"),options.readdir(p,(er,files)=>{if(er)return cb(er);let n=files.length,errState;if(n===0)return options.rmdir(p,cb);files.forEach(f=>{rimraf(path.join(p,f),options,er2=>{if(!errState){if(er2)return cb(errState=er2);--n===0&&options.rmdir(p,cb)}})})})}function rimrafSync(p,options){let st;options=options||{},defaults(options),assert(p,"rimraf: missing path"),assert.strictEqual(typeof p,"string","rimraf: path should be a string"),assert(options,"rimraf: missing options"),assert.strictEqual(typeof options,"object","rimraf: options should be object");try{st=options.lstatSync(p)}catch(er){if(er.code==="ENOENT")return;er.code==="EPERM"&&isWindows&&fixWinEPERMSync(p,options,er)}try{st&&st.isDirectory()?rmdirSync(p,options,null):options.unlinkSync(p)}catch(er){if(er.code==="ENOENT")return;if(er.code==="EPERM")return isWindows?fixWinEPERMSync(p,options,er):rmdirSync(p,options,er);if(er.code!=="EISDIR")throw er;rmdirSync(p,options,er)}}function rmdirSync(p,options,originalEr){assert(p),assert(options),originalEr&&assert(originalEr instanceof Error);try{options.rmdirSync(p)}catch(er){if(er.code==="ENOTDIR")throw originalEr;if(er.code==="ENOTEMPTY"||er.code==="EEXIST"||er.code==="EPERM")rmkidsSync(p,options);else if(er.code!=="ENOENT")throw er}}function rmkidsSync(p,options){if(assert(p),assert(options),options.readdirSync(p).forEach(f=>rimrafSync(path.join(p,f),options)),isWindows){let startTime=Date.now();do try{return options.rmdirSync(p,options)}catch{}while(Date.now()-startTime<500)}else return options.rmdirSync(p,options)}module.exports=rimraf;rimraf.sync=rimrafSync}});var require_remove=__commonJS({"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/remove/index.js"(exports,module){"use strict";var u=require_universalify().fromCallback,rimraf=require_rimraf();module.exports={remove:u(rimraf),removeSync:rimraf.sync}}});var require_empty=__commonJS({"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/empty/index.js"(exports,module){"use strict";var u=require_universalify().fromCallback,fs=__require("fs"),path=__require("path"),mkdir=require_mkdirs2(),remove=require_remove(),emptyDir=u(function(dir,callback){callback=callback||function(){},fs.readdir(dir,(err,items)=>{if(err)return mkdir.mkdirs(dir,callback);items=items.map(item=>path.join(dir,item)),deleteItem();function deleteItem(){let item=items.pop();if(!item)return callback();remove.remove(item,err2=>{if(err2)return callback(err2);deleteItem()})}})});function emptyDirSync(dir){let items;try{items=fs.readdirSync(dir)}catch{return mkdir.mkdirsSync(dir)}items.forEach(item=>{item=path.join(dir,item),remove.removeSync(item)})}module.exports={emptyDirSync,emptydirSync:emptyDirSync,emptyDir,emptydir:emptyDir}}});var require_file=__commonJS({"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/ensure/file.js"(exports,module){"use strict";var u=require_universalify().fromCallback,path=__require("path"),fs=require_graceful_fs(),mkdir=require_mkdirs2(),pathExists=require_path_exists().pathExists;function createFile(file,callback){function makeFile(){fs.writeFile(file,"",err=>{if(err)return callback(err);callback()})}fs.stat(file,(err,stats)=>{if(!err&&stats.isFile())return callback();let dir=path.dirname(file);pathExists(dir,(err2,dirExists)=>{if(err2)return callback(err2);if(dirExists)return makeFile();mkdir.mkdirs(dir,err3=>{if(err3)return callback(err3);makeFile()})})})}function createFileSync(file){let stats;try{stats=fs.statSync(file)}catch{}if(stats&&stats.isFile())return;let dir=path.dirname(file);fs.existsSync(dir)||mkdir.mkdirsSync(dir),fs.writeFileSync(file,"")}module.exports={createFile:u(createFile),createFileSync}}});var require_link=__commonJS({"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/ensure/link.js"(exports,module){"use strict";var u=require_universalify().fromCallback,path=__require("path"),fs=require_graceful_fs(),mkdir=require_mkdirs2(),pathExists=require_path_exists().pathExists;function createLink(srcpath,dstpath,callback){function makeLink(srcpath2,dstpath2){fs.link(srcpath2,dstpath2,err=>{if(err)return callback(err);callback(null)})}pathExists(dstpath,(err,destinationExists)=>{if(err)return callback(err);if(destinationExists)return callback(null);fs.lstat(srcpath,err2=>{if(err2)return err2.message=err2.message.replace("lstat","ensureLink"),callback(err2);let dir=path.dirname(dstpath);pathExists(dir,(err3,dirExists)=>{if(err3)return callback(err3);if(dirExists)return makeLink(srcpath,dstpath);mkdir.mkdirs(dir,err4=>{if(err4)return callback(err4);makeLink(srcpath,dstpath)})})})})}function createLinkSync(srcpath,dstpath){if(fs.existsSync(dstpath))return;try{fs.lstatSync(srcpath)}catch(err){throw err.message=err.message.replace("lstat","ensureLink"),err}let dir=path.dirname(dstpath);return fs.existsSync(dir)||mkdir.mkdirsSync(dir),fs.linkSync(srcpath,dstpath)}module.exports={createLink:u(createLink),createLinkSync}}});var require_symlink_paths=__commonJS({"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports,module){"use strict";var path=__require("path"),fs=require_graceful_fs(),pathExists=require_path_exists().pathExists;function symlinkPaths(srcpath,dstpath,callback){if(path.isAbsolute(srcpath))return fs.lstat(srcpath,err=>err?(err.message=err.message.replace("lstat","ensureSymlink"),callback(err)):callback(null,{toCwd:srcpath,toDst:srcpath}));{let dstdir=path.dirname(dstpath),relativeToDst=path.join(dstdir,srcpath);return pathExists(relativeToDst,(err,exists)=>err?callback(err):exists?callback(null,{toCwd:relativeToDst,toDst:srcpath}):fs.lstat(srcpath,err2=>err2?(err2.message=err2.message.replace("lstat","ensureSymlink"),callback(err2)):callback(null,{toCwd:srcpath,toDst:path.relative(dstdir,srcpath)})))}}function symlinkPathsSync(srcpath,dstpath){let exists;if(path.isAbsolute(srcpath)){if(exists=fs.existsSync(srcpath),!exists)throw new Error("absolute srcpath does not exist");return{toCwd:srcpath,toDst:srcpath}}else{let dstdir=path.dirname(dstpath),relativeToDst=path.join(dstdir,srcpath);if(exists=fs.existsSync(relativeToDst),exists)return{toCwd:relativeToDst,toDst:srcpath};if(exists=fs.existsSync(srcpath),!exists)throw new Error("relative srcpath does not exist");return{toCwd:srcpath,toDst:path.relative(dstdir,srcpath)}}}module.exports={symlinkPaths,symlinkPathsSync}}});var require_symlink_type=__commonJS({"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/ensure/symlink-type.js"(exports,module){"use strict";var fs=require_graceful_fs();function symlinkType(srcpath,type,callback){if(callback=typeof type=="function"?type:callback,type=typeof type=="function"?!1:type,type)return callback(null,type);fs.lstat(srcpath,(err,stats)=>{if(err)return callback(null,"file");type=stats&&stats.isDirectory()?"dir":"file",callback(null,type)})}function symlinkTypeSync(srcpath,type){let stats;if(type)return type;try{stats=fs.lstatSync(srcpath)}catch{return"file"}return stats&&stats.isDirectory()?"dir":"file"}module.exports={symlinkType,symlinkTypeSync}}});var require_symlink=__commonJS({"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/ensure/symlink.js"(exports,module){"use strict";var u=require_universalify().fromCallback,path=__require("path"),fs=require_graceful_fs(),_mkdirs=require_mkdirs2(),mkdirs=_mkdirs.mkdirs,mkdirsSync=_mkdirs.mkdirsSync,_symlinkPaths=require_symlink_paths(),symlinkPaths=_symlinkPaths.symlinkPaths,symlinkPathsSync=_symlinkPaths.symlinkPathsSync,_symlinkType=require_symlink_type(),symlinkType=_symlinkType.symlinkType,symlinkTypeSync=_symlinkType.symlinkTypeSync,pathExists=require_path_exists().pathExists;function createSymlink(srcpath,dstpath,type,callback){callback=typeof type=="function"?type:callback,type=typeof type=="function"?!1:type,pathExists(dstpath,(err,destinationExists)=>{if(err)return callback(err);if(destinationExists)return callback(null);symlinkPaths(srcpath,dstpath,(err2,relative)=>{if(err2)return callback(err2);srcpath=relative.toDst,symlinkType(relative.toCwd,type,(err3,type2)=>{if(err3)return callback(err3);let dir=path.dirname(dstpath);pathExists(dir,(err4,dirExists)=>{if(err4)return callback(err4);if(dirExists)return fs.symlink(srcpath,dstpath,type2,callback);mkdirs(dir,err5=>{if(err5)return callback(err5);fs.symlink(srcpath,dstpath,type2,callback)})})})})})}function createSymlinkSync(srcpath,dstpath,type){if(fs.existsSync(dstpath))return;let relative=symlinkPathsSync(srcpath,dstpath);srcpath=relative.toDst,type=symlinkTypeSync(relative.toCwd,type);let dir=path.dirname(dstpath);return fs.existsSync(dir)||mkdirsSync(dir),fs.symlinkSync(srcpath,dstpath,type)}module.exports={createSymlink:u(createSymlink),createSymlinkSync}}});var require_ensure=__commonJS({"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/ensure/index.js"(exports,module){"use strict";var file=require_file(),link=require_link(),symlink=require_symlink();module.exports={createFile:file.createFile,createFileSync:file.createFileSync,ensureFile:file.createFile,ensureFileSync:file.createFileSync,createLink:link.createLink,createLinkSync:link.createLinkSync,ensureLink:link.createLink,ensureLinkSync:link.createLinkSync,createSymlink:symlink.createSymlink,createSymlinkSync:symlink.createSymlinkSync,ensureSymlink:symlink.createSymlink,ensureSymlinkSync:symlink.createSymlinkSync}}});var require_jsonfile=__commonJS({"../../node_modules/.pnpm/jsonfile@4.0.0/node_modules/jsonfile/index.js"(exports,module){var _fs;try{_fs=require_graceful_fs()}catch{_fs=__require("fs")}function readFile2(file,options,callback){callback==null&&(callback=options,options={}),typeof options=="string"&&(options={encoding:options}),options=options||{};var fs=options.fs||_fs,shouldThrow=!0;"throws"in options&&(shouldThrow=options.throws),fs.readFile(file,options,function(err,data){if(err)return callback(err);data=stripBom(data);var obj;try{obj=JSON.parse(data,options?options.reviver:null)}catch(err2){return shouldThrow?(err2.message=file+": "+err2.message,callback(err2)):callback(null,null)}callback(null,obj)})}function readFileSync(file,options){options=options||{},typeof options=="string"&&(options={encoding:options});var fs=options.fs||_fs,shouldThrow=!0;"throws"in options&&(shouldThrow=options.throws);try{var content=fs.readFileSync(file,options);return content=stripBom(content),JSON.parse(content,options.reviver)}catch(err){if(shouldThrow)throw err.message=file+": "+err.message,err;return null}}function stringify(obj,options){var spaces,EOL=`
|
|
12
|
-
`;typeof options=="object"&&options!==null&&(options.spaces&&(spaces=options.spaces),options.EOL&&(EOL=options.EOL));var str=JSON.stringify(obj,options?options.replacer:null,spaces);return str.replace(/\n/g,EOL)+EOL}function writeFile(file,obj,options,callback){callback==null&&(callback=options,options={}),options=options||{};var fs=options.fs||_fs,str="";try{str=stringify(obj,options)}catch(err){callback&&callback(err,null);return}fs.writeFile(file,str,options,callback)}function writeFileSync(file,obj,options){options=options||{};var fs=options.fs||_fs,str=stringify(obj,options);return fs.writeFileSync(file,str,options)}function stripBom(content){return Buffer.isBuffer(content)&&(content=content.toString("utf8")),content=content.replace(/^\uFEFF/,""),content}var jsonfile={readFile:readFile2,readFileSync,writeFile,writeFileSync};module.exports=jsonfile}});var require_jsonfile2=__commonJS({"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/json/jsonfile.js"(exports,module){"use strict";var u=require_universalify().fromCallback,jsonFile=require_jsonfile();module.exports={readJson:u(jsonFile.readFile),readJsonSync:jsonFile.readFileSync,writeJson:u(jsonFile.writeFile),writeJsonSync:jsonFile.writeFileSync}}});var require_output_json=__commonJS({"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/json/output-json.js"(exports,module){"use strict";var path=__require("path"),mkdir=require_mkdirs2(),pathExists=require_path_exists().pathExists,jsonFile=require_jsonfile2();function outputJson(file,data,options,callback){typeof options=="function"&&(callback=options,options={});let dir=path.dirname(file);pathExists(dir,(err,itDoes)=>{if(err)return callback(err);if(itDoes)return jsonFile.writeJson(file,data,options,callback);mkdir.mkdirs(dir,err2=>{if(err2)return callback(err2);jsonFile.writeJson(file,data,options,callback)})})}module.exports=outputJson}});var require_output_json_sync=__commonJS({"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/json/output-json-sync.js"(exports,module){"use strict";var fs=require_graceful_fs(),path=__require("path"),mkdir=require_mkdirs2(),jsonFile=require_jsonfile2();function outputJsonSync(file,data,options){let dir=path.dirname(file);fs.existsSync(dir)||mkdir.mkdirsSync(dir),jsonFile.writeJsonSync(file,data,options)}module.exports=outputJsonSync}});var require_json=__commonJS({"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/json/index.js"(exports,module){"use strict";var u=require_universalify().fromCallback,jsonFile=require_jsonfile2();jsonFile.outputJson=u(require_output_json());jsonFile.outputJsonSync=require_output_json_sync();jsonFile.outputJSON=jsonFile.outputJson;jsonFile.outputJSONSync=jsonFile.outputJsonSync;jsonFile.writeJSON=jsonFile.writeJson;jsonFile.writeJSONSync=jsonFile.writeJsonSync;jsonFile.readJSON=jsonFile.readJson;jsonFile.readJSONSync=jsonFile.readJsonSync;module.exports=jsonFile}});var require_move_sync=__commonJS({"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/move-sync/move-sync.js"(exports,module){"use strict";var fs=__require("fs"),path=__require("path"),copySync=require_copy_sync2().copySync,removeSync=require_remove().removeSync,mkdirpSync=require_mkdirs2().mkdirpSync,stat=require_stat();function moveSync(src,dest,opts){opts=opts||{};let overwrite=opts.overwrite||opts.clobber||!1,{srcStat}=stat.checkPathsSync(src,dest,"move");return stat.checkParentPathsSync(src,srcStat,dest,"move"),mkdirpSync(path.dirname(dest)),doRename(src,dest,overwrite)}function doRename(src,dest,overwrite){if(overwrite)return removeSync(dest),rename(src,dest,overwrite);if(fs.existsSync(dest))throw new Error("dest already exists.");return rename(src,dest,overwrite)}function rename(src,dest,overwrite){try{fs.renameSync(src,dest)}catch(err){if(err.code!=="EXDEV")throw err;return moveAcrossDevice(src,dest,overwrite)}}function moveAcrossDevice(src,dest,overwrite){return copySync(src,dest,{overwrite,errorOnExist:!0}),removeSync(src)}module.exports=moveSync}});var require_move_sync2=__commonJS({"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/move-sync/index.js"(exports,module){"use strict";module.exports={moveSync:require_move_sync()}}});var require_move=__commonJS({"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/move/move.js"(exports,module){"use strict";var fs=__require("fs"),path=__require("path"),copy=require_copy2().copy,remove=require_remove().remove,mkdirp=require_mkdirs2().mkdirp,pathExists=require_path_exists().pathExists,stat=require_stat();function move(src,dest,opts,cb){typeof opts=="function"&&(cb=opts,opts={});let overwrite=opts.overwrite||opts.clobber||!1;stat.checkPaths(src,dest,"move",(err,stats)=>{if(err)return cb(err);let{srcStat}=stats;stat.checkParentPaths(src,srcStat,dest,"move",err2=>{if(err2)return cb(err2);mkdirp(path.dirname(dest),err3=>err3?cb(err3):doRename(src,dest,overwrite,cb))})})}function doRename(src,dest,overwrite,cb){if(overwrite)return remove(dest,err=>err?cb(err):rename(src,dest,overwrite,cb));pathExists(dest,(err,destExists)=>err?cb(err):destExists?cb(new Error("dest already exists.")):rename(src,dest,overwrite,cb))}function rename(src,dest,overwrite,cb){fs.rename(src,dest,err=>err?err.code!=="EXDEV"?cb(err):moveAcrossDevice(src,dest,overwrite,cb):cb())}function moveAcrossDevice(src,dest,overwrite,cb){copy(src,dest,{overwrite,errorOnExist:!0},err=>err?cb(err):remove(src,cb))}module.exports=move}});var require_move2=__commonJS({"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/move/index.js"(exports,module){"use strict";var u=require_universalify().fromCallback;module.exports={move:u(require_move())}}});var require_output=__commonJS({"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/output/index.js"(exports,module){"use strict";var u=require_universalify().fromCallback,fs=require_graceful_fs(),path=__require("path"),mkdir=require_mkdirs2(),pathExists=require_path_exists().pathExists;function outputFile(file,data,encoding,callback){typeof encoding=="function"&&(callback=encoding,encoding="utf8");let dir=path.dirname(file);pathExists(dir,(err,itDoes)=>{if(err)return callback(err);if(itDoes)return fs.writeFile(file,data,encoding,callback);mkdir.mkdirs(dir,err2=>{if(err2)return callback(err2);fs.writeFile(file,data,encoding,callback)})})}function outputFileSync(file,...args){let dir=path.dirname(file);if(fs.existsSync(dir))return fs.writeFileSync(file,...args);mkdir.mkdirsSync(dir),fs.writeFileSync(file,...args)}module.exports={outputFile:u(outputFile),outputFileSync}}});var require_lib2=__commonJS({"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/index.js"(exports,module){"use strict";module.exports=Object.assign({},require_fs(),require_copy_sync2(),require_copy2(),require_empty(),require_ensure(),require_json(),require_mkdirs2(),require_move_sync2(),require_move2(),require_output(),require_path_exists(),require_remove());var fs=__require("fs");Object.getOwnPropertyDescriptor(fs,"promises")&&Object.defineProperty(module.exports,"promises",{get(){return fs.promises}})}});var require_lib3=__commonJS({"../../node_modules/.pnpm/async-sema@3.0.0/node_modules/async-sema/lib/index.js"(exports){"use strict";var __importDefault=exports&&exports.__importDefault||function(mod){return mod&&mod.__esModule?mod:{default:mod}};Object.defineProperty(exports,"__esModule",{value:!0});var events_1=__importDefault(__require("events"));function arrayMove(src,srcIndex,dst,dstIndex,len){for(let j=0;j<len;++j)dst[j+dstIndex]=src[j+srcIndex],src[j+srcIndex]=void 0}function pow2AtLeast(n){return n=n>>>0,n=n-1,n=n|n>>1,n=n|n>>2,n=n|n>>4,n=n|n>>8,n=n|n>>16,n+1}function getCapacity(capacity){return pow2AtLeast(Math.min(Math.max(16,capacity),1073741824))}var Deque=class{constructor(capacity){this._capacity=getCapacity(capacity),this._length=0,this._front=0,this.arr=[]}push(item){let length=this._length;this.checkCapacity(length+1);let i=this._front+length&this._capacity-1;return this.arr[i]=item,this._length=length+1,length+1}pop(){let length=this._length;if(length===0)return;let i=this._front+length-1&this._capacity-1,ret=this.arr[i];return this.arr[i]=void 0,this._length=length-1,ret}shift(){let length=this._length;if(length===0)return;let front=this._front,ret=this.arr[front];return this.arr[front]=void 0,this._front=front+1&this._capacity-1,this._length=length-1,ret}get length(){return this._length}checkCapacity(size){this._capacity<size&&this.resizeTo(getCapacity(this._capacity*1.5+16))}resizeTo(capacity){let oldCapacity=this._capacity;this._capacity=capacity;let front=this._front,length=this._length;if(front+length>oldCapacity){let moveItemsCount=front+length&oldCapacity-1;arrayMove(this.arr,0,this.arr,oldCapacity,moveItemsCount)}}},ReleaseEmitter=class extends events_1.default{};function isFn(x){return typeof x=="function"}function defaultInit(){return"1"}var Sema=class{constructor(nr,{initFn=defaultInit,pauseFn,resumeFn,capacity=10}={}){if(isFn(pauseFn)!==isFn(resumeFn))throw new Error("pauseFn and resumeFn must be both set for pausing");this.nrTokens=nr,this.free=new Deque(nr),this.waiting=new Deque(capacity),this.releaseEmitter=new ReleaseEmitter,this.noTokens=initFn===defaultInit,this.pauseFn=pauseFn,this.resumeFn=resumeFn,this.paused=!1,this.releaseEmitter.on("release",token=>{let p=this.waiting.shift();p?p.resolve(token):(this.resumeFn&&this.paused&&(this.paused=!1,this.resumeFn()),this.free.push(token))});for(let i=0;i<nr;i++)this.free.push(initFn())}async acquire(){let token=this.free.pop();return token!==void 0?token:new Promise((resolve,reject)=>{this.pauseFn&&!this.paused&&(this.paused=!0,this.pauseFn()),this.waiting.push({resolve,reject})})}release(token){this.releaseEmitter.emit("release",this.noTokens?"1":token)}drain(){let a=new Array(this.nrTokens);for(let i=0;i<this.nrTokens;i++)a[i]=this.acquire();return Promise.all(a)}nrWaiting(){return this.waiting.length}};exports.Sema=Sema;function RateLimit(rps,{timeUnit=1e3,uniformDistribution=!1}={}){let sema=new Sema(uniformDistribution?1:rps),delay=uniformDistribution?timeUnit/rps:timeUnit;return async function(){await sema.acquire(),setTimeout(()=>sema.release(),delay)}}exports.RateLimit=RateLimit}});var require_hashes=__commonJS({"../client/dist/utils/hashes.js"(exports,module){"use strict";var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toESM2=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),hashes_exports={};__export(hashes_exports,{hash:()=>hash,hashes:()=>hashes,mapToObject:()=>mapToObject});module.exports=__toCommonJS(hashes_exports);var import_crypto=__require("crypto"),import_fs_extra2=__toESM2(require_lib2()),import_async_sema=require_lib3(),MAX_BUFFER_FILE_SIZE=2**31-1;function hash(buf){return(0,import_crypto.createHash)("sha1").update(Uint8Array.from(buf)).digest("hex")}async function hashFile(path){let digest=(0,import_crypto.createHash)("sha1");for await(let chunk of import_fs_extra2.default.createReadStream(path))digest.update(Uint8Array.from(chunk));return digest.digest("hex")}var mapToObject=map=>{let obj={};for(let[key,value]of map)typeof key>"u"||(obj[key]=value);return obj};async function hashes(files,map=new Map){let semaphore=new import_async_sema.Sema(100);return await Promise.all(files.map(async name=>{await semaphore.acquire();let stat=await import_fs_extra2.default.lstat(name),mode=stat.mode,data,size,isDirectory=stat.isDirectory(),h;if(!isDirectory)if(stat.isSymbolicLink()){let link=await import_fs_extra2.default.readlink(name);data=Buffer.from(link,"utf8"),size=data.length,h=hash(data)}else stat.size>MAX_BUFFER_FILE_SIZE?(size=stat.size,h=await hashFile(name)):(data=await import_fs_extra2.default.readFile(name),size=data.length,h=hash(data));let entry=map.get(h);if(entry){let names=new Set(entry.names);names.add(name),entry.names=[...names]}else map.set(h,{names:[name],data,mode,size});semaphore.release()})),map}}});var require_query_string=__commonJS({"../client/dist/utils/query-string.js"(exports,module){"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),query_string_exports={};__export(query_string_exports,{generateQueryString:()=>generateQueryString});module.exports=__toCommonJS(query_string_exports);var import_url=__require("url");function generateQueryString(clientOptions){let options=new import_url.URLSearchParams;return clientOptions.teamId&&options.set("teamId",clientOptions.teamId),clientOptions.force&&options.set("forceNew","1"),clientOptions.withCache&&options.set("withCache","1"),clientOptions.skipAutoDetectionConfirmation&&options.set("skipAutoDetectionConfirmation","1"),clientOptions.prebuilt&&options.set("prebuilt","1"),Array.from(options.entries()).length?`?${options.toString()}`:""}}});var require_ready_state=__commonJS({"../client/dist/utils/ready-state.js"(exports,module){"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),ready_state_exports={};__export(ready_state_exports,{isAliasAssigned:()=>isAliasAssigned,isAliasError:()=>isAliasError,isDone:()=>isDone,isFailed:()=>isFailed,isReady:()=>isReady});module.exports=__toCommonJS(ready_state_exports);var isReady=({readyState,state})=>readyState==="READY"||state==="READY",isFailed=({readyState,state})=>readyState?readyState.endsWith("_ERROR")||readyState==="ERROR":state?state.endsWith("_ERROR")||state==="ERROR":!1,isDone=buildOrDeployment=>isReady(buildOrDeployment)||isFailed(buildOrDeployment),isAliasAssigned=deployment=>!!deployment.aliasAssigned,isAliasError=deployment=>!!deployment.aliasError}});var require_cjs=__commonJS({"../../node_modules/.pnpm/sleep-promise@8.0.1/node_modules/sleep-promise/build/cjs.js"(exports,module){"use strict";var cachedSetTimeout=setTimeout;function createSleepPromise(a,b){var c=b.useCachedSetTimeout,d=c?cachedSetTimeout:setTimeout;return new Promise(function(b2){d(b2,a)})}function sleep(a){function b(a2){return e.then(function(){return a2})}var c=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{},d=c.useCachedSetTimeout,e=createSleepPromise(a,{useCachedSetTimeout:d});return b.then=function(){return e.then.apply(e,arguments)},b.catch=Promise.resolve().catch,b}module.exports=sleep}});var require_ignore=__commonJS({"../../node_modules/.pnpm/ignore@4.0.6/node_modules/ignore/index.js"(exports,module){function make_array(subject){return Array.isArray(subject)?subject:[subject]}var REGEX_BLANK_LINE=/^\s+$/,REGEX_LEADING_EXCAPED_EXCLAMATION=/^\\!/,REGEX_LEADING_EXCAPED_HASH=/^\\#/,SLASH="/",KEY_IGNORE=typeof Symbol<"u"?Symbol.for("node-ignore"):"node-ignore",define=(object,key,value)=>Object.defineProperty(object,key,{value}),REGEX_REGEXP_RANGE=/([0-z])-([0-z])/g,sanitizeRange=range=>range.replace(REGEX_REGEXP_RANGE,(match,from,to)=>from.charCodeAt(0)<=to.charCodeAt(0)?match:""),DEFAULT_REPLACER_PREFIX=[[/\\?\s+$/,match=>match.indexOf("\\")===0?" ":""],[/\\\s/g,()=>" "],[/[\\^$.|*+(){]/g,match=>`\\${match}`],[/\[([^\]/]*)($|\])/g,(match,p1,p2)=>p2==="]"?`[${sanitizeRange(p1)}]`:`\\${match}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"]],DEFAULT_REPLACER_SUFFIX=[[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(match,index,str)=>index+6<str.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)\\\*(?=.+)/g,(match,p1)=>`${p1}[^\\/]*`],[/(\^|\\\/)?\\\*$/,(match,p1)=>`${p1?`${p1}[^/]+`:"[^/]*"}(?=$|\\/$)`],[/\\\\\\/g,()=>"\\"]],POSITIVE_REPLACERS=[...DEFAULT_REPLACER_PREFIX,[/(?:[^*/])$/,match=>`${match}(?=$|\\/)`],...DEFAULT_REPLACER_SUFFIX],NEGATIVE_REPLACERS=[...DEFAULT_REPLACER_PREFIX,[/(?:[^*])$/,match=>`${match}(?=$|\\/$)`],...DEFAULT_REPLACER_SUFFIX],cache=Object.create(null),make_regex=(pattern,negative,ignorecase)=>{let r=cache[pattern];if(r)return r;let source=(negative?NEGATIVE_REPLACERS:POSITIVE_REPLACERS).reduce((prev,current)=>prev.replace(current[0],current[1].bind(pattern)),pattern);return cache[pattern]=ignorecase?new RegExp(source,"i"):new RegExp(source)},checkPattern=pattern=>pattern&&typeof pattern=="string"&&!REGEX_BLANK_LINE.test(pattern)&&pattern.indexOf("#")!==0,createRule=(pattern,ignorecase)=>{let origin=pattern,negative=!1;pattern.indexOf("!")===0&&(negative=!0,pattern=pattern.substr(1)),pattern=pattern.replace(REGEX_LEADING_EXCAPED_EXCLAMATION,"!").replace(REGEX_LEADING_EXCAPED_HASH,"#");let regex=make_regex(pattern,negative,ignorecase);return{origin,pattern,negative,regex}},IgnoreBase=class{constructor({ignorecase=!0}={}){this._rules=[],this._ignorecase=ignorecase,define(this,KEY_IGNORE,!0),this._initCache()}_initCache(){this._cache=Object.create(null)}add(pattern){return this._added=!1,typeof pattern=="string"&&(pattern=pattern.split(/\r?\n/g)),make_array(pattern).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(pattern){return this.add(pattern)}_addPattern(pattern){if(pattern&&pattern[KEY_IGNORE]){this._rules=this._rules.concat(pattern._rules),this._added=!0;return}if(checkPattern(pattern)){let rule=createRule(pattern,this._ignorecase);this._added=!0,this._rules.push(rule)}}filter(paths){return make_array(paths).filter(path=>this._filter(path))}createFilter(){return path=>this._filter(path)}ignores(path){return!this._filter(path)}_filter(path,slices){return path?path in this._cache?this._cache[path]:(slices||(slices=path.split(SLASH)),slices.pop(),this._cache[path]=slices.length?this._filter(slices.join(SLASH)+SLASH,slices)&&this._test(path):this._test(path)):!1}_test(path){let matched=0;return this._rules.forEach(rule=>{matched^rule.negative||(matched=rule.negative^rule.regex.test(path))}),!matched}};if(typeof process<"u"&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform==="win32")){let filter=IgnoreBase.prototype._filter,make_posix=str=>/^\\\\\?\\/.test(str)||/[^\x00-\x80]+/.test(str)?str:str.replace(/\\/g,"/");IgnoreBase.prototype._filter=function(path,slices){return path=make_posix(path),filter.call(this,path,slices)}}module.exports=options=>new IgnoreBase(options)}});var require_package=__commonJS({"../client/package.json"(exports,module){module.exports={name:"@vercel/client",version:"18.6.0",main:"dist/index.js",typings:"dist/index.d.ts",homepage:"https://vercel.com",license:"Apache-2.0",files:["dist"],repository:{type:"git",url:"https://github.com/vercel/vercel.git",directory:"packages/client"},scripts:{build:"node ../../utils/build.mjs",test:"vitest run --config ./vitest.config.mts","test-e2e":"vitest run --config ./vitest.config.mts tests/integration-","type-check":"tsc --noEmit","test-unit":"vitest run --config ./vitest.config.mts tests/unit."},engines:{node:">= 20"},devDependencies:{"@types/async-retry":"1.4.5","@types/fs-extra":"7.0.0","@types/minimatch":"3.0.5","@types/ms":"0.7.30","@types/node":"20.11.0","@types/recursive-readdir":"2.2.0","@types/tar-fs":"1.16.1",vitest:"4.1.10"},dependencies:{"@vercel/build-utils":"workspace:*","@vercel/error-utils":"workspace:*","@vercel/microfrontends":"2.4.0","@vercel/routing-utils":"workspace:*","async-retry":"1.2.3","async-sema":"3.0.0","fs-extra":"8.0.1",ignore:"4.0.6",minimatch:"5.0.1",ms:"2.1.2",querystring:"^0.2.0","sleep-promise":"8.0.1","tar-fs":"1.16.3"}}}});var require_pkg=__commonJS({"../client/dist/pkg.js"(exports,module){"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),pkg_exports={};__export(pkg_exports,{pkgVersion:()=>pkgVersion});module.exports=__toCommonJS(pkg_exports);var pkg=require_package(),pkgVersion=pkg.version}});var require_readdir_recursive=__commonJS({"../client/dist/utils/readdir-recursive.js"(exports,module){"use strict";var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toESM2=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),readdir_recursive_exports={};__export(readdir_recursive_exports,{default:()=>readdir});module.exports=__toCommonJS(readdir_recursive_exports);var import_fs=__toESM2(__require("fs")),import_path2=__toESM2(__require("path")),import_minimatch=__toESM2(require_minimatch());function patternMatcher(pattern){return function(path,stats){let minimatcher=new import_minimatch.default.Minimatch(pattern,{matchBase:!0});return(!minimatcher.negate||stats.isFile())&&minimatcher.match(path)}}function toMatcherFunction(ignoreEntry){return typeof ignoreEntry=="function"?ignoreEntry:patternMatcher(ignoreEntry)}function readdir(path,ignores){ignores=ignores.map(toMatcherFunction);let list=[];return new Promise(function(resolve,reject){import_fs.default.readdir(path,function(err,files){if(err)return reject(err);let pending=files.length;if(!pending)return resolve(list);files.forEach(function(file){let filePath=import_path2.default.join(path,file);import_fs.default.lstat(filePath,function(_err,stats){if(_err)return reject(_err);if(ignores.some(matcher=>matcher(filePath,stats)))return pending-=1,pending?null:resolve(list);if(stats.isDirectory())readdir(filePath,ignores).then(function(res){if(res.length===0&&list.push(filePath),list=list.concat(res),pending-=1,!pending)return resolve(list)}).catch(reject);else if(list.push(filePath),pending-=1,!pending)return resolve(list)})})})})}}});var require_utils=__commonJS({"../client/dist/utils/index.js"(exports,module){"use strict";var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toESM2=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),utils_exports={};__export(utils_exports,{API_FILES:()=>API_FILES,EVENTS:()=>EVENTS,buildFileTree:()=>buildFileTree2,createDebug:()=>createDebug,fetchApi:()=>fetchApi,getApiDeploymentsUrl:()=>getApiDeploymentsUrl,getVercelIgnore:()=>getVercelIgnore2,parseVercelConfig:()=>parseVercelConfig,prepareFiles:()=>prepareFiles,shouldInlineStaticFiles:()=>shouldInlineStaticFiles});module.exports=__toCommonJS(utils_exports);var import_path2=__require("path"),import_stream=__require("stream"),import_url=__require("url"),import_ignore=__toESM2(require_ignore()),import_pkg=require_pkg(),import_build_utils=__require("@vercel/build-utils"),import_async_sema=require_lib3(),import_fs_extra2=require_lib2(),import_readdir_recursive=__toESM2(require_readdir_recursive()),semaphore=new import_async_sema.Sema(10),API_FILES="/v2/files",EVENTS_ARRAY=["hashes-calculated","file-count","file-uploaded","all-files-uploaded","created","building","ready","alias-assigned","warning","error","notice","tip","canceled","checks-registered","checks-completed","checks-running","checks-conclusion-succeeded","checks-conclusion-failed","checks-conclusion-skipped","checks-conclusion-canceled","checks-v2-failed"],EVENTS=new Set(EVENTS_ARRAY);function getApiDeploymentsUrl(){return"/v13/deployments"}async function parseVercelConfig(filePath){if(!filePath)return{};try{let jsonString=await(0,import_fs_extra2.readFile)(filePath,"utf8");return JSON.parse(jsonString)}catch(e){return console.error(e),{}}}var maybeRead=async function(path,default_){try{return await(0,import_fs_extra2.readFile)(path,"utf8")}catch{return default_}};async function getUserIgnore(cwd){let[vercelignore,nowignore]=await Promise.all([maybeRead((0,import_path2.join)(cwd,".vercelignore"),""),maybeRead((0,import_path2.join)(cwd,".nowignore"),"")]);if(vercelignore&&nowignore)throw new import_build_utils.NowBuildError({code:"CONFLICTING_IGNORE_FILES",message:"Cannot use both a `.vercelignore` and `.nowignore` file. Please delete the `.nowignore` file.",link:"https://vercel.link/combining-old-and-new-config"});let ignoreFile=vercelignore||nowignore;return ignoreFile?{ig:(0,import_ignore.default)().add(clearRelative(ignoreFile)),ignoreFile,ignoreFileName:vercelignore?".vercelignore":".nowignore"}:null}var FILEPATHMAP_VERCELIGNORE_EXCEPTIONS=["node_modules",".next",".yarn/cache",".pnp*",".venv","venv","__pycache__","/target"],filePathMapVercelignoreExceptions=(0,import_ignore.default)().add(FILEPATHMAP_VERCELIGNORE_EXCEPTIONS.join(`
|
|
13
|
-
`));function isFilePathMapIgnoreException(posixRel){return filePathMapVercelignoreExceptions.ignores(posixRel)}var FILEPATHMAP_IGNORE_WARNING_LIST_LIMIT=100;function findMatchingIgnoreRule(ignoreFile,posixRel){let matcher=(0,import_ignore.default)(),wasIgnored=!1,match={};for(let[index,rule]of ignoreFile.split(/\r?\n/).entries()){matcher.add(clearRelative(rule));let isIgnored=matcher.ignores(posixRel);!wasIgnored&&isIgnored?match={rule,line:index+1}:wasIgnored&&!isIgnored&&(match={}),wasIgnored=isIgnored}return match}function formatFilePathMapIgnoreWarning(entries,ignoreFileName,truncated=!1){let shown=entries.slice(0,FILEPATHMAP_IGNORE_WARNING_LIST_LIMIT),lines=shown.map(({path,rule,line})=>rule&&line?` ${path} (matched \`${ignoreFileName}:${line}\`: \`${rule}\`)`:` ${path}`);truncated&&lines.push(" \u2026and more");let count=truncated?`at least ${shown.length}`:String(entries.length),fileWord=!truncated&&entries.length===1?"file":"files";return[`${ignoreFileName===".nowignore"?`\`${ignoreFileName}\` (deprecated)`:`\`${ignoreFileName}\``} excludes ${count} ${fileWord} the prebuilt functions need. Uploading without them may fail with ENOENT.`,"",...lines,"",`Remove the colliding rules from \`${ignoreFileName}\`, or exclude those paths from tracing with \`outputFileTracingExcludes\`.`].join(`
|
|
14
|
-
`)}async function buildFileTree2(path,{isDirectory,prebuilt,vercelOutputDir,rootDirectory,projectName,bulkRedirectsPath},debug){let ignoreList=[],fileList,warning,{ig,ignores}=await getVercelIgnore2(path,prebuilt,vercelOutputDir);if(debug(`Found ${ignores.length} rules in .vercelignore`),debug("Building file tree..."),isDirectory&&!Array.isArray(path)){let ignores2=absPath=>{let rel=(0,import_path2.relative)(path,absPath),ignored=ig.ignores(rel);return ignored&&ignoreList.push(rel),ignored};fileList=await(0,import_readdir_recursive.default)(path,[ignores2]);let refs=new Set;if(prebuilt){let vcConfigFilePaths=fileList.filter(file=>(0,import_path2.basename)(file)===".vc-config.json"),userIg=await getUserIgnore(path),ignoredFilePathMap=new Map,ignoredFilePathMapTruncated=!1,vcConfigs=await Promise.all(vcConfigFilePaths.map(async p=>{let configJson=await(0,import_fs_extra2.readFile)(p,"utf8");return JSON.parse(configJson)}));for(let config of vcConfigs)if(config.filePathMap)for(let v of Object.values(config.filePathMap)){let absPath=(0,import_path2.join)(path,v),rel=(0,import_path2.relative)(path,absPath),posixRel=rel.split(import_path2.sep).join("/");if(rel.startsWith("..")||(0,import_path2.isAbsolute)(rel)){debug(`Ignoring "filePathMap" entry "${v}": resolves outside the deployment root`);continue}if(userIg&&userIg.ig.ignores(posixRel))if(isFilePathMapIgnoreException(posixRel))debug(`Keeping "filePathMap" entry "${v}": matches a default-ignored dependency/output path`);else{if(ignoredFilePathMap.has(posixRel))continue;if(fileList.includes(absPath)){debug(`Skipping "filePathMap" entry "${v}": already in the upload set`);continue}else if(ignoredFilePathMap.size>=FILEPATHMAP_IGNORE_WARNING_LIST_LIMIT){ignoredFilePathMapTruncated=!0;continue}else{ignoredFilePathMap.set(posixRel,findMatchingIgnoreRule(userIg.ignoreFile,posixRel));continue}}refs.add(absPath)}if(ignoredFilePathMap.size>0){let violations=[...ignoredFilePathMap.entries()].sort(([a],[b])=>a.localeCompare(b)).map(([ignoredPath,match])=>({path:ignoredPath,...match}));warning=formatFilePathMapIgnoreWarning(violations,userIg?.ignoreFileName||".vercelignore",ignoredFilePathMapTruncated)}try{let{findConfig:findMicrofrontendsConfig,inferMicrofrontendsLocation}=await import("./utils-5BFO5HC4.js"),customConfigFilename=void 0,microfrontendConfigPath=findMicrofrontendsConfig({dir:(0,import_path2.join)(path,rootDirectory||""),customConfigFilename});!microfrontendConfigPath&&!rootDirectory&&projectName&&(microfrontendConfigPath=findMicrofrontendsConfig({dir:inferMicrofrontendsLocation({repositoryRoot:path,applicationContext:{name:projectName},customConfigFilename}),customConfigFilename})),microfrontendConfigPath&&refs.add(microfrontendConfigPath)}catch(e){debug(`Error detecting microfrontend config: ${e}`)}}try{let routesJsonPath=(0,import_path2.join)(path,".vercel","routes.json");await maybeRead(routesJsonPath,null)!==null&&(refs.add(routesJsonPath),debug("Including .vercel/routes.json in deployment"))}catch(e){debug(`Error checking for .vercel/routes.json: ${e}`)}if(prebuilt&&bulkRedirectsPath)try{let projectRoot=path,bulkRedirectsFullPath=(0,import_path2.join)(projectRoot,rootDirectory||"",bulkRedirectsPath);if((0,import_path2.relative)(projectRoot,bulkRedirectsFullPath).startsWith(".."))debug(`Skipping bulk redirects path "${bulkRedirectsPath}" - path traversal detected (resolves outside project root)`);else try{let stats=await(0,import_fs_extra2.stat)(bulkRedirectsFullPath);if(stats.isDirectory()){let dirFiles=await(0,import_readdir_recursive.default)(bulkRedirectsFullPath,[]);for(let file of dirFiles)refs.add(file);debug(`Including ${dirFiles.length} files from bulk redirects directory "${bulkRedirectsPath}" in deployment`)}else stats.isFile()&&(refs.add(bulkRedirectsFullPath),debug(`Including bulk redirects file "${bulkRedirectsPath}" in deployment`))}catch{debug(`Bulk redirects path "${bulkRedirectsPath}" not found`)}}catch(e){debug(`Error checking for bulk redirects path: ${e}`)}refs.size>0&&(fileList=fileList.concat(Array.from(refs))),debug(`Found ${fileList.length} files in the specified directory`)}else Array.isArray(path)?(fileList=path,debug(`Assigned ${fileList.length} files provided explicitly`)):(fileList=[path],debug("Deploying the provided path as single file"));return{fileList,ignoreList,warning}}async function getVercelIgnore2(cwd,prebuilt,vercelOutputDir){let ig=(0,import_ignore.default)(),ignores;if(prebuilt){if(typeof vercelOutputDir!="string")throw new Error('Missing required `vercelOutputDir` parameter when "prebuilt" is true');if(typeof cwd!="string")throw new Error('`cwd` must be a "string"');let relOutputDir=(0,import_path2.relative)(cwd,vercelOutputDir);ignores=["*"];let parts=relOutputDir.split(import_path2.sep);parts.forEach((_,i)=>{let level=parts.slice(0,i+1).join("/");ignores.push(`!/${level}`)}),ignores.push(`!/${parts.join("/")}/**`),ig.add(ignores.join(`
|
|
15
|
-
`))}else{ignores=[".hg",".git",".gitmodules",".svn",".cache",".next",".now",".vercel",".npmignore",".dockerignore",".gitignore",".*.swp",".DS_Store",".wafpicke-*",".lock-wscript",".env.local",".env.*.local",".venv",".yarn/cache",".pnp*","npm-debug.log","config.gypi","node_modules","__pycache__","venv","CVS"];let cwds=Array.isArray(cwd)?cwd:[cwd],files=await Promise.all(cwds.map(async cwd2=>{let[vercelignore,nowignore]=await Promise.all([maybeRead((0,import_path2.join)(cwd2,".vercelignore"),""),maybeRead((0,import_path2.join)(cwd2,".nowignore"),"")]);if(vercelignore&&nowignore)throw new import_build_utils.NowBuildError({code:"CONFLICTING_IGNORE_FILES",message:"Cannot use both a `.vercelignore` and `.nowignore` file. Please delete the `.nowignore` file.",link:"https://vercel.link/combining-old-and-new-config"});return vercelignore||nowignore}));(await Promise.all(cwds.map(cwd2=>(0,import_fs_extra2.pathExists)((0,import_path2.join)(cwd2,"Cargo.toml"))))).some(Boolean)&&ignores.push("/target");let ignoreFile=files.join(`
|
|
16
|
-
`);ig.add(`${ignores.join(`
|
|
17
|
-
`)}
|
|
18
|
-
${clearRelative(ignoreFile)}`)}return{ig,ignores}}function clearRelative(str){return str.replace(/(\n|^)\.\//g,"$1")}var fetchApi=async(url,token,opts={},debugEnabled)=>{semaphore.acquire();let debug=createDebug(debugEnabled),time;url=`${opts.apiUrl||"https://api.vercel.com"}${url}`,delete opts.apiUrl;let{VERCEL_TEAM_ID}=process.env;if(VERCEL_TEAM_ID&&(url+=`${url.includes("?")?"&":"?"}teamId=${VERCEL_TEAM_ID}`),opts.teamId){let parsedUrl=new import_url.URL(url);parsedUrl.searchParams.set("teamId",opts.teamId),url=parsedUrl.toString(),delete opts.teamId}let userAgent=opts.userAgent||`client-v${import_pkg.pkgVersion}`;delete opts.userAgent,opts.headers={...opts.headers,authorization:`Bearer ${token}`,accept:"application/json","user-agent":userAgent},opts.body instanceof import_stream.Readable&&(opts.duplex="half"),debug(`${opts.method||"GET"} ${url}`),time=Date.now();try{let res=await fetch(url,opts);return debug(`DONE in ${Date.now()-time}ms: ${opts.method||"GET"} ${url}`),res}finally{semaphore.release()}},isWin=process.platform.includes("win"),INLINE_STATIC_EXTENSIONS=[".html",".htm",".md"],MAX_INLINE_FILES=10,MAX_INLINE_TOTAL_BYTES=5*1024*1024,S_IFREG=32768,S_IFMT=61440;function shouldInlineStaticFiles(files){let count=0,totalBytes=0;for(let file of files.values()){if((file.mode&S_IFMT)!==S_IFREG||!file.data)return!1;for(let name of file.names){let lower=name.toLowerCase();if(!INLINE_STATIC_EXTENSIONS.some(ext=>lower.endsWith(ext)))return!1;count+=1,totalBytes+=file.data.byteLength}}return count>0&&count<=MAX_INLINE_FILES&&totalBytes<=MAX_INLINE_TOTAL_BYTES}var prepareFiles=(files,clientOptions)=>{let preparedFiles=[],inlineStaticFiles=shouldInlineStaticFiles(files);for(let[sha,file]of files)for(let name of file.names){let fileName;if(clientOptions.isDirectory)fileName=typeof clientOptions.path=="string"?(0,import_path2.relative)(clientOptions.path,name):name;else{let segments=name.split(import_path2.sep);fileName=segments[segments.length-1]}let normalizedName=isWin?fileName.replace(/\\/g,"/"):fileName;if(inlineStaticFiles&&file.data){preparedFiles.push({file:normalizedName,data:file.data.toString("base64"),encoding:"base64",mode:file.mode});continue}preparedFiles.push({file:normalizedName,size:file.data?.byteLength??file.size,mode:file.mode,sha:sha||void 0})}return preparedFiles};function createDebug(debug){return debug?(...logs)=>{process.stderr.write([`[client-debug] ${new Date().toISOString()}`,...logs].join(" ")+`
|
|
19
|
-
`)}:()=>{}}}});var require_get_polling_delay=__commonJS({"../client/dist/utils/get-polling-delay.js"(exports,module){"use strict";var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toESM2=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),get_polling_delay_exports={};__export(get_polling_delay_exports,{getPollingDelay:()=>getPollingDelay});module.exports=__toCommonJS(get_polling_delay_exports);var import_ms=__toESM2(require_ms());function getPollingDelay(elapsed){return elapsed<=(0,import_ms.default)("15s")?(0,import_ms.default)("1s"):elapsed<=(0,import_ms.default)("1m")?(0,import_ms.default)("5s"):elapsed<=(0,import_ms.default)("5m")?(0,import_ms.default)("15s"):(0,import_ms.default)("30s")}}});var require_check_deployment_status=__commonJS({"../client/dist/check-deployment-status.js"(exports,module){"use strict";var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toESM2=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),check_deployment_status_exports={};__export(check_deployment_status_exports,{checkDeploymentStatus:()=>checkDeploymentStatus2,parseRetryAfterMs:()=>parseRetryAfterMs});module.exports=__toCommonJS(check_deployment_status_exports);var import_sleep_promise=__toESM2(require_cjs()),import_utils=require_utils(),import_get_polling_delay=require_get_polling_delay(),import_ready_state=require_ready_state(),import_utils2=require_utils(),RETRY_COUNT=5,RETRY_DELAY_MAX_MS=6e4,RETRY_DELAY_MIN_MS=5e3,RETRY_DELAY_SKEW_MS=3e4,RETRY_DELAY_DEFAULT_MS=5e3;function getAliasAssignedEvent(signal,deploymentId){if(!signal?.aborted)return;let event=signal.reason;if(event?.type==="alias-assigned"&&event.deploymentId===deploymentId&&typeof event.date=="number"&&Array.isArray(event.alias)&&"aliasError"in event&&"aliasWarning"in event)return event}async function sleepUntilAliasAssigned(duration,signal,deploymentId){if(!getAliasAssignedEvent(signal,deploymentId)){if(!signal||signal.aborted){await(0,import_sleep_promise.default)(duration);return}await new Promise(resolve=>{let timeout=setTimeout(finish,duration);function finish(){clearTimeout(timeout),signal?.removeEventListener("abort",onAbort),resolve()}function onAbort(){getAliasAssignedEvent(signal,deploymentId)&&finish()}signal.addEventListener("abort",onAbort,{once:!0})})}}function parseRetryAfterMs(response){if(response.status===429||response.status===503){let header=response.headers.get("Retry-After");if(header==null)return RETRY_DELAY_DEFAULT_MS;let retryAfterMs=Number(header)*1e3;if(Number.isNaN(retryAfterMs)){let retryAfterDateMs=Date.parse(header);Number.isNaN(retryAfterDateMs)?retryAfterMs=RETRY_DELAY_DEFAULT_MS:retryAfterMs=retryAfterDateMs-Date.now()}return Math.min(RETRY_DELAY_MAX_MS,Math.max(RETRY_DELAY_MIN_MS,retryAfterMs))}else return response.status>=500&&response.status<=599?RETRY_DELAY_DEFAULT_MS:null}async function*checkDeploymentStatus2(deployment,clientOptions){let{token,teamId,apiUrl,userAgent}=clientOptions,debug=(0,import_utils2.createDebug)(clientOptions.debug),deploymentState=deployment,deploymentId=deployment.id||deployment.deploymentId,aliasAssignedSignal=clientOptions.aliasAssignedSignal,apiDeployments=(0,import_utils.getApiDeploymentsUrl)();if((0,import_ready_state.isDone)(deploymentState)&&(0,import_ready_state.isAliasAssigned)(deploymentState)){debug("Deployment is already READY and aliases are assigned. Not running status checks");return}debug("Waiting for builds and the deployment to complete...");let finishedEvents=new Set,startTime=Date.now();polling:for(;;){let aliasAssignedEvent=getAliasAssignedEvent(aliasAssignedSignal,deploymentId);if(aliasAssignedEvent)return deploymentState={...deploymentState,readyState:"READY",aliasAssigned:aliasAssignedEvent.date,alias:aliasAssignedEvent.alias,aliasError:aliasAssignedEvent.aliasError,aliasWarning:aliasAssignedEvent.aliasWarning},finishedEvents.has("ready")||(debug("Deployment state changed to READY"),finishedEvents.add("ready"),yield{type:"ready",payload:deploymentState}),debug("Deployment alias assigned from event stream"),yield{type:"alias-assigned",payload:deploymentState};let deploymentResponse,retriesLeft=RETRY_COUNT;for(;;){try{deploymentResponse=await(0,import_utils.fetchApi)(`${apiDeployments}/${deploymentId}${teamId?`?teamId=${teamId}`:""}`,token,{apiUrl,userAgent,dispatcher:clientOptions.dispatcher,signal:aliasAssignedSignal})}catch(error){if(getAliasAssignedEvent(aliasAssignedSignal,deploymentId))continue polling;if(aliasAssignedSignal?.aborted){aliasAssignedSignal=void 0;continue polling}throw error}if(getAliasAssignedEvent(aliasAssignedSignal,deploymentId))continue polling;if(retriesLeft--,retriesLeft==0)break;let retryAfterMs=parseRetryAfterMs(deploymentResponse);if(retryAfterMs!=null){let randomSkewMs=Math.floor(RETRY_DELAY_SKEW_MS*Math.random());if(debug(`Received a transient error or rate limit (HTTP ${deploymentResponse.status}) while querying deployment status, retrying after ${retryAfterMs+randomSkewMs}ms (${retryAfterMs} + ${randomSkewMs}ms of random skew)`),await sleepUntilAliasAssigned(retryAfterMs+randomSkewMs,aliasAssignedSignal,deploymentId),getAliasAssignedEvent(aliasAssignedSignal,deploymentId))continue polling;continue}break}let deploymentUpdate;try{deploymentUpdate=await deploymentResponse.json()}catch(error){if(getAliasAssignedEvent(aliasAssignedSignal,deploymentId))continue;if(aliasAssignedSignal?.aborted){aliasAssignedSignal=void 0;continue}throw error}if(getAliasAssignedEvent(aliasAssignedSignal,deploymentId))continue;if(deploymentUpdate.error)return debug("Deployment status check has errorred"),yield{type:"error",payload:deploymentUpdate.error};if(deploymentState=deploymentUpdate,deploymentUpdate.readyState==="BUILDING"&&!finishedEvents.has("building")&&(debug("Deployment state changed to BUILDING"),finishedEvents.add("building"),yield{type:"building",payload:deploymentUpdate}),deploymentUpdate.readyState==="CANCELED"&&!finishedEvents.has("canceled")&&(debug("Deployment state changed to CANCELED"),finishedEvents.add("canceled"),yield{type:"canceled",payload:deploymentUpdate}),(0,import_ready_state.isReady)(deploymentUpdate)&&!finishedEvents.has("ready")&&(debug("Deployment state changed to READY"),finishedEvents.add("ready"),yield{type:"ready",payload:deploymentUpdate}),deploymentUpdate.checksState!==void 0&&(deploymentUpdate.checksState==="completed"&&!finishedEvents.has("checks-completed")&&(finishedEvents.add("checks-completed"),deploymentUpdate.checksConclusion==="succeeded"?yield{type:"checks-conclusion-succeeded",payload:deploymentUpdate}:deploymentUpdate.checksConclusion==="failed"?yield{type:"checks-conclusion-failed",payload:deploymentUpdate}:deploymentUpdate.checksConclusion==="skipped"?yield{type:"checks-conclusion-skipped",payload:deploymentUpdate}:deploymentUpdate.checksConclusion==="canceled"&&(yield{type:"checks-conclusion-canceled",payload:deploymentUpdate})),deploymentUpdate.checksState==="registered"&&!finishedEvents.has("checks-registered")&&(finishedEvents.add("checks-registered"),yield{type:"checks-registered",payload:deploymentUpdate}),deploymentUpdate.checksState==="running"&&!finishedEvents.has("checks-running")&&(finishedEvents.add("checks-running"),yield{type:"checks-running",payload:deploymentUpdate})),deploymentUpdate.checks?.["deployment-alias"]?.state==="failed"&&!finishedEvents.has("checks-v2-failed"))return debug("v2 deployment-alias check failed"),finishedEvents.add("checks-v2-failed"),yield{type:"checks-v2-failed",payload:deploymentUpdate};if((0,import_ready_state.isAliasAssigned)(deploymentUpdate))return debug("Deployment alias assigned"),yield{type:"alias-assigned",payload:deploymentUpdate};if((0,import_ready_state.isAliasError)(deploymentUpdate))return yield{type:"error",payload:deploymentUpdate.aliasError};if(deploymentUpdate.readyState==="ERROR"&&deploymentUpdate.errorCode==="BUILD_FAILED")return yield{type:"error",payload:deploymentUpdate};if((0,import_ready_state.isFailed)(deploymentUpdate))return yield{type:"error",payload:deploymentUpdate.error||deploymentUpdate};let elapsed=Date.now()-startTime,duration=(0,import_get_polling_delay.getPollingDelay)(elapsed);await sleepUntilAliasAssigned(duration,aliasAssignedSignal,deploymentId)}}}});var require_deploy=__commonJS({"../client/dist/deploy.js"(exports,module){"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),deploy_exports={};__export(deploy_exports,{deploy:()=>deploy});module.exports=__toCommonJS(deploy_exports);var import_query_string=require_query_string(),import_ready_state=require_ready_state(),import_check_deployment_status=require_check_deployment_status(),import_utils=require_utils();async function*postDeployment(files,clientOptions,deploymentOptions){let debug=(0,import_utils.createDebug)(clientOptions.debug),preparedFiles=(0,import_utils.prepareFiles)(files,clientOptions),apiDeployments=(0,import_utils.getApiDeploymentsUrl)();deploymentOptions?.builds&&!deploymentOptions.functions&&(clientOptions.skipAutoDetectionConfirmation=!0),deploymentOptions.target==="preview"&&(deploymentOptions.target=void 0),deploymentOptions.target&&deploymentOptions.target!=="production"&&(deploymentOptions.customEnvironmentSlugOrId=deploymentOptions.target,deploymentOptions.target=void 0),debug("Sending deployment creation API request");try{let response=await(0,import_utils.fetchApi)(`${apiDeployments}${(0,import_query_string.generateQueryString)(clientOptions)}`,clientOptions.token,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({...deploymentOptions,files:preparedFiles}),apiUrl:clientOptions.apiUrl,userAgent:clientOptions.userAgent,dispatcher:clientOptions.dispatcher}),deployment;try{deployment=await response.json()}catch{throw new Error("Invalid JSON response")}if(clientOptions.debug&&debug("Deployment response:",JSON.stringify(deployment)),!response.ok||deployment.error)return debug("Error: Deployment request status is",response.status),yield{type:"error",payload:deployment.error?{...deployment.error,status:response.status}:{...deployment,status:response.status}};let indications=new Set(["warning","notice","tip"]),regex=/^x-(?:vercel|now)-(warning|notice|tip)-(.*)$/;for(let[name,payload]of response.headers.entries()){let match=name.match(regex);if(match){let[,type,identifier]=match,action=response.headers.get(`x-vercel-action-${identifier}`),link=response.headers.get(`x-vercel-link-${identifier}`);indications.has(type)&&(debug(`Deployment created with a ${type}: `,payload),yield{type,payload,action,link})}}yield{type:"created",payload:deployment}}catch(e){return yield{type:"error",payload:e}}}function getDefaultName(files,clientOptions){let debug=(0,import_utils.createDebug)(clientOptions.debug),{isDirectory,path}=clientOptions;if(isDirectory&&typeof path=="string")return debug("Provided path is a directory. Using last segment as default name"),path.split("/").pop()||path;{debug("Provided path is not a directory. Using last segment of the first file as default name");let filePath=Array.from(files.values())[0].names[0];return filePath.split("/").pop()||filePath}}async function*deploy(files,clientOptions,deploymentOptions){let debug=(0,import_utils.createDebug)(clientOptions.debug);!deploymentOptions.name&&files.size>0&&(deploymentOptions.version=2,deploymentOptions.name=files.size===1?"file":getDefaultName(files,clientOptions),deploymentOptions.name==="file"&&debug('Setting deployment name to "file" for single-file deployment')),!deploymentOptions.name&&files.size>0&&(deploymentOptions.name=clientOptions.defaultName||getDefaultName(files,clientOptions),debug("No name provided. Defaulting to",deploymentOptions.name)),clientOptions.withCache&&debug("'withCache' is provided. Force deploy will be performed with cache retention");let deployment;try{debug("Creating deployment");for await(let event of postDeployment(files,clientOptions,deploymentOptions))event.type==="created"&&(debug("Deployment created"),deployment=event.payload),yield event}catch(e){return debug("An unexpected error occurred when creating the deployment"),yield{type:"error",payload:e}}if(clientOptions.manual){debug("Manual mode - skipping ready state check");return}if(deployment){if((0,import_ready_state.isReady)(deployment)&&(0,import_ready_state.isAliasAssigned)(deployment))return debug("Deployment state changed to READY 3"),yield{type:"ready",payload:deployment},debug("Deployment alias assigned"),yield{type:"alias-assigned",payload:deployment};try{debug("Waiting for deployment to be ready...");for await(let event of(0,import_check_deployment_status.checkDeploymentStatus)(deployment,clientOptions))yield event}catch(e){return debug("An unexpected error occurred while waiting for deployment to be ready"),yield{type:"error",payload:e}}}}}});var require_retry_operation=__commonJS({"../../node_modules/.pnpm/retry@0.12.0/node_modules/retry/lib/retry_operation.js"(exports,module){function RetryOperation(timeouts,options){typeof options=="boolean"&&(options={forever:options}),this._originalTimeouts=JSON.parse(JSON.stringify(timeouts)),this._timeouts=timeouts,this._options=options||{},this._maxRetryTime=options&&options.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}module.exports=RetryOperation;RetryOperation.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};RetryOperation.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};RetryOperation.prototype.retry=function(err){if(this._timeout&&clearTimeout(this._timeout),!err)return!1;var currentTime=new Date().getTime();if(err&¤tTime-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(err);var timeout=this._timeouts.shift();if(timeout===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),timeout=this._timeouts.shift();else return!1;var self=this,timer=setTimeout(function(){self._attempts++,self._operationTimeoutCb&&(self._timeout=setTimeout(function(){self._operationTimeoutCb(self._attempts)},self._operationTimeout),self._options.unref&&self._timeout.unref()),self._fn(self._attempts)},timeout);return this._options.unref&&timer.unref(),!0};RetryOperation.prototype.attempt=function(fn,timeoutOps){this._fn=fn,timeoutOps&&(timeoutOps.timeout&&(this._operationTimeout=timeoutOps.timeout),timeoutOps.cb&&(this._operationTimeoutCb=timeoutOps.cb));var self=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){self._operationTimeoutCb()},self._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};RetryOperation.prototype.try=function(fn){console.log("Using RetryOperation.try() is deprecated"),this.attempt(fn)};RetryOperation.prototype.start=function(fn){console.log("Using RetryOperation.start() is deprecated"),this.attempt(fn)};RetryOperation.prototype.start=RetryOperation.prototype.try;RetryOperation.prototype.errors=function(){return this._errors};RetryOperation.prototype.attempts=function(){return this._attempts};RetryOperation.prototype.mainError=function(){if(this._errors.length===0)return null;for(var counts={},mainError=null,mainErrorCount=0,i=0;i<this._errors.length;i++){var error=this._errors[i],message=error.message,count=(counts[message]||0)+1;counts[message]=count,count>=mainErrorCount&&(mainError=error,mainErrorCount=count)}return mainError}}});var require_retry=__commonJS({"../../node_modules/.pnpm/retry@0.12.0/node_modules/retry/lib/retry.js"(exports){var RetryOperation=require_retry_operation();exports.operation=function(options){var timeouts=exports.timeouts(options);return new RetryOperation(timeouts,{forever:options&&options.forever,unref:options&&options.unref,maxRetryTime:options&&options.maxRetryTime})};exports.timeouts=function(options){if(options instanceof Array)return[].concat(options);var opts={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var key in options)opts[key]=options[key];if(opts.minTimeout>opts.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var timeouts=[],i=0;i<opts.retries;i++)timeouts.push(this.createTimeout(i,opts));return options&&options.forever&&!timeouts.length&&timeouts.push(this.createTimeout(i,opts)),timeouts.sort(function(a,b){return a-b}),timeouts};exports.createTimeout=function(attempt,opts){var random=opts.randomize?Math.random()+1:1,timeout=Math.round(random*opts.minTimeout*Math.pow(opts.factor,attempt));return timeout=Math.min(timeout,opts.maxTimeout),timeout};exports.wrap=function(obj,options,methods){if(options instanceof Array&&(methods=options,options=null),!methods){methods=[];for(var key in obj)typeof obj[key]=="function"&&methods.push(key)}for(var i=0;i<methods.length;i++){var method=methods[i],original=obj[method];obj[method]=function(original2){var op=exports.operation(options),args=Array.prototype.slice.call(arguments,1),callback=args.pop();args.push(function(err){op.retry(err)||(err&&(arguments[0]=op.mainError()),callback.apply(this,arguments))}),op.attempt(function(){original2.apply(obj,args)})}.bind(obj,original),obj[method].options=options}}}});var require_retry2=__commonJS({"../../node_modules/.pnpm/retry@0.12.0/node_modules/retry/index.js"(exports,module){module.exports=require_retry()}});var require_lib4=__commonJS({"../../node_modules/.pnpm/async-retry@1.2.3/node_modules/async-retry/lib/index.js"(exports,module){var retrier=require_retry2();function retry(fn,opts){function run(resolve,reject){var options=opts||{},op=retrier.operation(options);function bail(err){reject(err||new Error("Aborted"))}function onError(err,num){if(err.bail){bail(err);return}op.retry(err)?options.onRetry&&options.onRetry(err,num):reject(op.mainError())}function runAttempt(num){var val;try{val=fn(bail,num)}catch(err){onError(err,num);return}Promise.resolve(val).then(resolve).catch(function(err){onError(err,num)})}op.attempt(runAttempt)}return new Promise(run)}module.exports=retry}});var require_errors=__commonJS({"../client/dist/errors.js"(exports,module){"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),errors_exports={};__export(errors_exports,{DeploymentError:()=>DeploymentError});module.exports=__toCommonJS(errors_exports);var DeploymentError=class extends Error{constructor(err){super(err.message),this.code=err.code,this.errorName=err.name,this.name="DeploymentError"}}}});var require_upload=__commonJS({"../client/dist/upload.js"(exports,module){"use strict";var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toESM2=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),upload_exports={};__export(upload_exports,{UploadProgress:()=>UploadProgress,upload:()=>upload,uploadFiles:()=>uploadFiles});module.exports=__toCommonJS(upload_exports);var import_fs=__require("fs"),import_stream=__require("stream"),import_node_events=__require("node:events"),import_async_retry=__toESM2(require_lib4()),import_async_sema=require_lib3(),import_utils=require_utils(),import_errors=require_errors(),import_deploy=require_deploy(),isClientNetworkError=err=>err instanceof Error?err.message&&(err.message.includes("ETIMEDOUT")||err.message.includes("ECONNREFUSED")||err.message.includes("ENOTFOUND")||err.message.includes("ECONNRESET")||err.message.includes("EAI_FAIL")||err.message.includes("socket hang up")||err.message.includes("network socket disconnected"))?!0:isClientNetworkError(err.cause):!1;async function*upload(files,clientOptions,deploymentOptions){let debug=(0,import_utils.createDebug)(clientOptions.debug);if(!files&&!clientOptions.token&&!clientOptions.teamId){debug("Neither 'files', 'token' nor 'teamId are present. Exiting");return}let shas=[];debug("Determining necessary files for upload...");for await(let event of(0,import_deploy.deploy)(files,clientOptions,deploymentOptions))if(event.type==="error")if(event.payload.code==="missing_files")shas=event.payload.missing,debug(`${shas.length} files are required to upload`);else return yield event;else{if(event.type==="alias-assigned"||event.type==="checks-v2-failed")return debug(event.type==="alias-assigned"?"Deployment succeeded on file check":"v2 deployment-alias check failed on file check"),yield event;yield event}let uploads=shas.map(sha=>new UploadProgress(sha,files.get(sha)));yield{type:"file-count",payload:{total:files,missing:shas,uploads}};let uploadGenerator=uploadFiles({dispatcher:clientOptions.dispatcher,apiUrl:clientOptions.apiUrl,debug:clientOptions.debug,teamId:clientOptions.teamId,token:clientOptions.token,userAgent:clientOptions.userAgent,files,shas,uploads});for await(let event of uploadGenerator){if(event.type==="error")return yield event;yield event}debug("All files uploaded"),yield{type:"all-files-uploaded",payload:files};try{debug("Starting deployment creation");for await(let event of(0,import_deploy.deploy)(files,clientOptions,deploymentOptions)){if(event.type==="alias-assigned"||event.type==="checks-v2-failed")return debug("Deployment is ready"),yield event;yield event}}catch(e){debug("An unexpected error occurred when starting deployment creation"),yield{type:"error",payload:e}}}async function*uploadFiles(options){let debug=(0,import_utils.createDebug)(options.debug),uploadList={};debug("Building an upload list...");let semaphore=new import_async_sema.Sema(50,{capacity:50}),abortControllers=new Set,aborted=!1;for(options.shas.forEach((sha,index)=>{let uploadProgress=options.uploads[index];uploadList[sha]=(0,import_async_retry.default)(async bail=>{let file=options.files.get(sha);if(!file)return debug(`File ${sha} is undefined. Bailing`),bail(new Error(`File ${sha} is undefined`));if(await semaphore.acquire(),aborted)return semaphore.release(),bail(new Error("Upload aborted"));let{data,size,names}=file;uploadProgress.bytesUploaded=0;let body,contentLength,counter=new import_stream.Transform({transform(chunk,_encoding,callback){uploadProgress.bytesUploaded+=chunk.length,uploadProgress.emit("progress"),callback(null,chunk)}});if(typeof data<"u"){contentLength=data.length;let chunkSize=16384;function*chunks(){for(let i=0;i<data.length;i+=chunkSize)yield data.slice(i,i+chunkSize)}let buffered=import_stream.Readable.from(chunks());buffered.on("error",err2=>counter.destroy(err2)),body=buffered.pipe(counter)}else if(typeof size=="number"){contentLength=size;let fileStream=(0,import_fs.createReadStream)(names[0]);fileStream.on("error",err2=>counter.destroy(err2)),counter.on("close",()=>fileStream.destroy()),body=fileStream.pipe(counter)}else{semaphore.release();return}let err,result,abortController=new AbortController;abortControllers.add(abortController);try{let res=await(0,import_utils.fetchApi)(import_utils.API_FILES,options.token,{dispatcher:options.dispatcher,method:"POST",headers:{"Content-Type":"application/octet-stream","Content-Length":String(contentLength),"x-now-digest":sha,"x-now-size":String(contentLength)},body,teamId:options.teamId,apiUrl:options.apiUrl,userAgent:options.userAgent,signal:abortController.signal},options.debug);if(res.status===200)debug(`File ${sha} (${file.names[0]}${file.names.length>1?` +${file.names.length}`:""}) uploaded`),result={type:"file-uploaded",payload:{sha,file}};else if(res.status>200&&res.status<500){debug("An internal error occurred in upload request. Not retrying...");let{error}=await res.json();err=new import_errors.DeploymentError(error)}else{debug("A server error occurred in upload request. Retrying...");let{error}=await res.json();throw new import_errors.DeploymentError(error)}}catch(e){debug(`An unexpected error occurred in upload promise:
|
|
20
|
-
${e}`),err=e instanceof Error?e:new Error(String(e))}if(semaphore.release(),err){if(isClientNetworkError(err))throw debug("Network error, retrying: "+err.message),err;return debug("Other error, bailing: "+err.message),aborted||(aborted=!0,abortControllers.forEach(controller=>controller.abort())),bail(err)}return abortControllers.delete(abortController),result},{retries:5,factor:6,minTimeout:10})}),debug("Starting upload");Object.keys(uploadList).length>0;)try{let event=await Promise.race(Object.values(uploadList));delete uploadList[event.payload.sha],yield event}catch(e){return yield{type:"error",payload:e}}}var UploadProgress=class extends import_node_events.EventEmitter{constructor(sha,file){super(),this.sha=sha,this.file=file,this.bytesUploaded=0}}}});var require_tar_fs=__commonJS({"../../node_modules/.pnpm/tar-fs@1.16.3/node_modules/tar-fs/index.js"(exports){var chownr=require_chownr(),tar=require_tar_stream(),pump=require_pump(),mkdirp=require_mkdirp(),fs=__require("fs"),path=__require("path"),os=__require("os"),win32=os.platform()==="win32",noop=function(){},echo=function(name){return name},normalize=win32?function(name){return name.replace(/\\/g,"/").replace(/[:?<>|]/g,"_")}:echo,statAll=function(fs2,stat,cwd,ignore,entries,sort){var queue=entries||["."];return function(callback){if(!queue.length)return callback();var next=queue.shift(),nextAbs=path.join(cwd,next);stat(nextAbs,function(err,stat2){if(err)return callback(err);if(!stat2.isDirectory())return callback(null,next,stat2);fs2.readdir(nextAbs,function(err2,files){if(err2)return callback(err2);sort&&files.sort();for(var i=0;i<files.length;i++)ignore(path.join(cwd,next,files[i]))||queue.push(path.join(next,files[i]));callback(null,next,stat2)})})}},strip=function(map,level){return function(header){header.name=header.name.split("/").slice(level).join("/");var linkname=header.linkname;return linkname&&(header.type==="link"||path.isAbsolute(linkname))&&(header.linkname=linkname.split("/").slice(level).join("/")),map(header)}};exports.pack=function(cwd,opts){cwd||(cwd="."),opts||(opts={});var xfs=opts.fs||fs,ignore=opts.ignore||opts.filter||noop,map=opts.map||noop,mapStream=opts.mapStream||echo,statNext=statAll(xfs,opts.dereference?xfs.stat:xfs.lstat,cwd,ignore,opts.entries,opts.sort),strict=opts.strict!==!1,umask=typeof opts.umask=="number"?~opts.umask:~processUmask(),dmode=typeof opts.dmode=="number"?opts.dmode:0,fmode=typeof opts.fmode=="number"?opts.fmode:0,pack=opts.pack||tar.pack(),finish=opts.finish||noop;opts.strip&&(map=strip(map,opts.strip)),opts.readable&&(dmode|=parseInt(555,8),fmode|=parseInt(444,8)),opts.writable&&(dmode|=parseInt(333,8),fmode|=parseInt(222,8));var onsymlink=function(filename,header){xfs.readlink(path.join(cwd,filename),function(err,linkname){if(err)return pack.destroy(err);header.linkname=normalize(linkname),pack.entry(header,onnextentry)})},onstat=function(err,filename,stat){if(err)return pack.destroy(err);if(!filename)return opts.finalize!==!1&&pack.finalize(),finish(pack);if(stat.isSocket())return onnextentry();var header={name:normalize(filename),mode:(stat.mode|(stat.isDirectory()?dmode:fmode))&umask,mtime:stat.mtime,size:stat.size,type:"file",uid:stat.uid,gid:stat.gid};if(stat.isDirectory())return header.size=0,header.type="directory",header=map(header)||header,pack.entry(header,onnextentry);if(stat.isSymbolicLink())return header.size=0,header.type="symlink",header=map(header)||header,onsymlink(filename,header);if(header=map(header)||header,!stat.isFile())return strict?pack.destroy(new Error("unsupported type for "+filename)):onnextentry();var entry=pack.entry(header,onnextentry);if(entry){var rs=mapStream(xfs.createReadStream(path.join(cwd,filename)),header);rs.on("error",function(err2){entry.destroy(err2)}),pump(rs,entry)}},onnextentry=function(err){if(err)return pack.destroy(err);statNext(onstat)};return onnextentry(),pack};var head=function(list){return list.length?list[list.length-1]:null},processGetuid=function(){return process.getuid?process.getuid():-1},processUmask=function(){return process.umask?process.umask():0};exports.extract=function(cwd,opts){cwd||(cwd="."),opts||(opts={});var xfs=opts.fs||fs,ignore=opts.ignore||opts.filter||noop,map=opts.map||noop,mapStream=opts.mapStream||echo,own=opts.chown!==!1&&!win32&&processGetuid()===0,extract=opts.extract||tar.extract(),stack=[],now=new Date,umask=typeof opts.umask=="number"?~opts.umask:~processUmask(),dmode=typeof opts.dmode=="number"?opts.dmode:0,fmode=typeof opts.fmode=="number"?opts.fmode:0,strict=opts.strict!==!1;opts.strip&&(map=strip(map,opts.strip)),opts.readable&&(dmode|=parseInt(555,8),fmode|=parseInt(444,8)),opts.writable&&(dmode|=parseInt(333,8),fmode|=parseInt(222,8));var utimesParent=function(name,cb){for(var top;(top=head(stack))&&name.slice(0,top[0].length)!==top[0];)stack.pop();if(!top)return cb();xfs.utimes(top[0],now,top[1],cb)},utimes=function(name,header,cb){if(opts.utimes===!1)return cb();if(header.type==="directory")return xfs.utimes(name,now,header.mtime,cb);if(header.type==="symlink")return utimesParent(name,cb);xfs.utimes(name,now,header.mtime,function(err){if(err)return cb(err);utimesParent(name,cb)})},chperm=function(name,header,cb){var link=header.type==="symlink",chmod=link?xfs.lchmod:xfs.chmod,chown=link?xfs.lchown:xfs.chown;if(!chmod)return cb();var mode=(header.mode|(header.type==="directory"?dmode:fmode))&umask;chmod(name,mode,function(err){if(err)return cb(err);if(!own||!chown)return cb();chown(name,header.uid,header.gid,cb)})};return extract.on("entry",function(header,stream,next){header=map(header)||header,header.name=normalize(header.name);var name=path.join(cwd,path.join("/",header.name));if(ignore(name,header))return stream.resume(),next();var stat=function(err){if(err)return next(err);utimes(name,header,function(err2){if(err2)return next(err2);if(win32)return next();chperm(name,header,next)})},onsymlink=function(){if(win32)return next();xfs.unlink(name,function(){xfs.symlink(header.linkname,name,stat)})},onlink=function(){if(win32)return next();xfs.unlink(name,function(){var srcpath=path.join(cwd,path.join("/",header.linkname));xfs.link(srcpath,name,function(err){if(err&&err.code==="EPERM"&&opts.hardlinkAsFilesFallback)return stream=xfs.createReadStream(srcpath),onfile();stat(err)})})},onfile=function(){var ws=xfs.createWriteStream(name),rs=mapStream(stream,header);ws.on("error",function(err){rs.destroy(err)}),pump(rs,ws,function(err){if(err)return next(err);ws.on("close",stat)})};if(header.type==="directory")return stack.push([name,header.mtime]),mkdirfix(name,{fs:xfs,own,uid:header.uid,gid:header.gid},stat);var dir=path.dirname(name);validate(xfs,dir,path.join(cwd,"."),function(err,valid){if(err)return next(err);if(!valid)return next(new Error(dir+" is not a valid path"));mkdirfix(dir,{fs:xfs,own,uid:header.uid,gid:header.gid},function(err2){if(err2)return next(err2);switch(header.type){case"file":return onfile();case"link":return onlink();case"symlink":return onsymlink()}if(strict)return next(new Error("unsupported type for "+name+" ("+header.type+")"));stream.resume(),next()})})}),opts.finish&&extract.on("finish",opts.finish),extract};function validate(fs2,name,root,cb){if(name===root)return cb(null,!0);fs2.lstat(name,function(err,st){if(err&&err.code!=="ENOENT")return cb(err);if(err||st.isDirectory())return validate(fs2,path.join(name,".."),root,cb);cb(null,!1)})}function mkdirfix(name,opts,cb){mkdirp(name,{fs:opts.fs},function(err,made){!err&&made&&opts.own?chownr(made,opts.uid,opts.gid,cb):cb(err)})}}});var require_archive=__commonJS({"../client/dist/utils/archive.js"(exports,module){"use strict";var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toESM2=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),archive_exports={};__export(archive_exports,{createTgzFiles:()=>createTgzFiles});module.exports=__toCommonJS(archive_exports);var import_node_path=__require("node:path"),import_node_zlib=__require("node:zlib"),import_build_utils=__require("@vercel/build-utils"),import_tar_fs=__toESM2(require_tar_fs()),import_hashes=require_hashes();async function createTgzFiles(workPath,fileList,debug,exclude){let filesToArchive=exclude?fileList.filter(file=>!exclude.includes(file)):fileList;debug?.("Packing tarball");let tarStream=import_tar_fs.default.pack(workPath,{entries:filesToArchive.map(file=>(0,import_node_path.relative)(workPath,file))}).pipe((0,import_node_zlib.createGzip)()),chunkedTarBuffers=await(0,import_build_utils.streamToBufferChunks)(tarStream);return debug?.(`Packed tarball into ${chunkedTarBuffers.length} chunks`),new Map(chunkedTarBuffers.map((chunk,index)=>[(0,import_hashes.hash)(chunk),{names:[(0,import_node_path.join)(workPath,`.vercel/source.tgz.part${index+1}`)],data:chunk,mode:438}]))}}});var require_collect_deployment_files=__commonJS({"../client/dist/collect-deployment-files.js"(exports,module){"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),collect_deployment_files_exports={};__export(collect_deployment_files_exports,{assertDeploymentPath:()=>assertDeploymentPath,collectDeploymentFiles:()=>collectDeploymentFiles});module.exports=__toCommonJS(collect_deployment_files_exports);var import_error_utils2=require_dist(),import_fs_extra2=require_lib2(),import_path2=__require("path"),import_errors=require_errors(),import_utils=require_utils(),import_archive=require_archive(),import_hashes=require_hashes();function assertDeploymentPath(path,debug){if(typeof path!="string"&&!Array.isArray(path))throw debug(`Error: 'path' is expected to be a string or an array. Received ${typeof path}`),new import_errors.DeploymentError({code:"missing_path",message:"Path not provided"})}async function collectDeploymentFiles(path,clientOptions,debug){assertDeploymentPath(path,debug);let isDirectory=!Array.isArray(path)&&(0,import_fs_extra2.lstatSync)(path).isDirectory();if(clientOptions.isDirectory=isDirectory,Array.isArray(path)){for(let filePath of path)if(!(0,import_path2.isAbsolute)(filePath))throw new import_errors.DeploymentError({code:"invalid_path",message:`Provided path ${filePath} is not absolute`})}else if(!(0,import_path2.isAbsolute)(path))throw new import_errors.DeploymentError({code:"invalid_path",message:`Provided path ${path} is not absolute`});isDirectory&&!Array.isArray(path)?debug("Provided 'path' is a directory."):Array.isArray(path)?debug("Provided 'path' is an array of file paths"):debug("Provided 'path' is a single file");let{fileList,ignoreList,warning}=await(0,import_utils.buildFileTree)(path,clientOptions,debug),workPath=typeof path=="string"?path:path[0],filesMap;try{filesMap=clientOptions.archive==="tgz"?await(0,import_archive.createTgzFiles)(workPath,fileList,debug):await(0,import_hashes.hashes)(fileList)}catch(err){if(clientOptions.prebuilt&&(0,import_error_utils2.isErrnoException)(err)&&err.code==="ENOENT"&&err.path){let errPath=(0,import_path2.relative)(workPath,err.path);err.message=`File does not exist: "${(0,import_path2.relative)(workPath,errPath)}"`,errPath.split(import_path2.sep).includes("node_modules")&&(err.message=`Please ensure project dependencies have been installed:
|
|
21
|
-
${err.message}`)}throw err}return{fileList,filesMap,workPath,isDirectory,ignoreList,warning}}}});var require_create_deployment=__commonJS({"../client/dist/create-deployment.js"(exports,module){"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),create_deployment_exports={};__export(create_deployment_exports,{default:()=>buildCreateDeployment});module.exports=__toCommonJS(create_deployment_exports);var import_hashes=require_hashes(),import_deploy=require_deploy(),import_upload=require_upload(),import_utils=require_utils(),import_errors=require_errors(),import_collect_deployment_files=require_collect_deployment_files();function buildCreateDeployment(){return async function*(clientOptions,deploymentOptions={}){let options=Promise.resolve(deploymentOptions);options.catch(()=>{});let{path}=clientOptions,debug=(0,import_utils.createDebug)(clientOptions.debug);if(debug("Creating deployment..."),(0,import_collect_deployment_files.assertDeploymentPath)(path,debug),typeof clientOptions.token!="string")throw debug(`Error: 'token' is expected to be a string. Received ${typeof clientOptions.token}`),new import_errors.DeploymentError({code:"token_not_provided",message:"Options object must include a `token`"});if(clientOptions.manual){if(debug("Manual provisioning mode enabled"),!clientOptions.prebuilt)throw new import_errors.DeploymentError({code:"invalid_options",message:"The `manual` option requires `prebuilt` to be true"});let deploymentOptions2=await options;deploymentOptions2.build=deploymentOptions2.build||{},deploymentOptions2.build.env=deploymentOptions2.build.env||{},deploymentOptions2.build.env.VERCEL_MANUAL_PROVISIONING="1",deploymentOptions2.version=2,debug("Creating deployment with manual provisioning..."),yield*(0,import_deploy.deploy)(new Map,clientOptions,deploymentOptions2);return}let{fileList,filesMap:files,warning}=await(0,import_collect_deployment_files.collectDeploymentFiles)(path,clientOptions,debug);warning&&(debug("Yielding a prebuilt filePathMap ignore warning"),yield{type:"warning",payload:warning,code:"PREBUILT_FILEPATHMAP_IGNORED"}),fileList.length===0&&(debug("Deployment path has no files. Yielding a warning event"),yield{type:"warning",payload:"There are no files inside your deployment."}),debug(`Yielding a 'hashes-calculated' event with ${files.size} hashes`),yield{type:"hashes-calculated",payload:(0,import_hashes.mapToObject)(files)},clientOptions.apiUrl&&debug(`Using provided API URL: ${clientOptions.apiUrl}`),clientOptions.userAgent&&debug(`Using provided user agent: ${clientOptions.userAgent}`);let resolvedOptions=await options;debug("Setting platform version to harcoded value 2"),resolvedOptions.version=2,debug("Creating the deployment and starting upload...");for await(let event of(0,import_upload.upload)(files,clientOptions,resolvedOptions))debug(`Yielding a '${event.type}' event`),yield event}}}});var require_continue=__commonJS({"../client/dist/continue.js"(exports,module){"use strict";var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toESM2=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),continue_exports={};__export(continue_exports,{continueDeployment:()=>continueDeployment2});module.exports=__toCommonJS(continue_exports);var import_path2=__require("path"),import_fs_extra2=__toESM2(require_lib2()),import_check_deployment_status=require_check_deployment_status(),import_utils=require_utils(),import_hashes=require_hashes(),import_ready_state=require_ready_state(),import_upload=require_upload(),import_errors=require_errors(),import_archive=require_archive();async function*continueDeployment2(options){let debug=(0,import_utils.createDebug)(options.debug);debug(`Continuing deployment: ${options.deploymentId}`);let outputDir=options.vercelOutputDir||(0,import_path2.join)(options.path,".vercel","output");if(!await import_fs_extra2.default.pathExists(outputDir))return yield{type:"error",payload:new import_errors.DeploymentError({code:"output_dir_not_found",message:`Output directory not found at ${outputDir}. Run 'vercel build' first.`})};let{fileList,warning}=await(0,import_utils.buildFileTree)(options.path,{isDirectory:!0,prebuilt:!0,vercelOutputDir:outputDir},debug);warning&&(debug("Yielding a prebuilt filePathMap ignore warning"),yield{type:"warning",payload:warning,code:"PREBUILT_FILEPATHMAP_IGNORED"});let provisionJsonPath=(0,import_path2.join)(outputDir,"provision.json"),unbundledFiles=fileList.filter(f=>f===provisionJsonPath),files;if(options.archive==="tgz"){if(files=await(0,import_archive.createTgzFiles)(options.path,fileList,debug,unbundledFiles),unbundledFiles.length>0){let individualFiles=await(0,import_hashes.hashes)(unbundledFiles);for(let[sha,entry]of individualFiles)files.set(sha,entry)}}else files=await(0,import_hashes.hashes)(fileList);debug(`Calculated ${files.size} unique hashes`),yield{type:"hashes-calculated",payload:(0,import_hashes.mapToObject)(files)};let deployment,result=await postContinue({deploymentId:options.deploymentId,files,outputDir,path:options.path,token:options.token,teamId:options.teamId,apiUrl:options.apiUrl,userAgent:options.userAgent,dispatcher:options.dispatcher,debug:options.debug});if(result.type==="missing_files"){debug(`Uploading ${result.missing.length} missing files...`);let uploads=result.missing.map(sha=>new import_upload.UploadProgress(sha,files.get(sha)));yield{type:"file-count",payload:{total:files,missing:result.missing,uploads}};for await(let event of(0,import_upload.uploadFiles)({dispatcher:options.dispatcher,apiUrl:options.apiUrl,debug:options.debug,teamId:options.teamId,token:options.token,userAgent:options.userAgent,shas:result.missing,files,uploads})){if(event.type==="error")return yield event;yield event}if(yield{type:"all-files-uploaded",payload:files},result=await postContinue({deploymentId:options.deploymentId,files,outputDir,path:options.path,token:options.token,teamId:options.teamId,apiUrl:options.apiUrl,userAgent:options.userAgent,dispatcher:options.dispatcher,debug:options.debug}),result.type==="missing_files")return yield{type:"error",payload:{code:"missing_files",message:"Missing files",missing:result.missing}}}if(result.type==="error")return yield{type:"error",payload:result.error};if(result.type==="success"&&(deployment=result.deployment,yield{type:"created",payload:deployment}),!deployment)return yield{type:"error",payload:new import_errors.DeploymentError({code:"continue_failed",message:"Failed to continue deployment after uploading files"})};if((0,import_ready_state.isReady)(deployment)&&(0,import_ready_state.isAliasAssigned)(deployment))return yield{type:"ready",payload:deployment},yield{type:"alias-assigned",payload:deployment};yield*(0,import_check_deployment_status.checkDeploymentStatus)(deployment,{dispatcher:options.dispatcher,apiUrl:options.apiUrl,debug:options.debug,path:options.path,teamId:options.teamId,token:options.token,userAgent:options.userAgent})}async function postContinue(options){let debug=(0,import_utils.createDebug)(options.debug);debug(`Calling continue deployment endpoint for ${options.deploymentId}`);let response=await(0,import_utils.fetchApi)(`/deployments/${options.deploymentId}/continue${options.teamId?`?teamId=${options.teamId}`:""}`,options.token,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({files:(0,import_utils.prepareFiles)(options.files,{isDirectory:!0,path:options.path,token:options.token})}),apiUrl:options.apiUrl,userAgent:options.userAgent,dispatcher:options.dispatcher}),result;try{result=await response.json()}catch{return{type:"error",error:new Error("Invalid JSON response from continue endpoint")}}return!response.ok||result.error?result.error?.code==="missing_files"||result.code==="missing_files"?(debug(`Continue deployment returned missing_files: ${(result.error?.missing||result.missing||[]).length} files`),{type:"missing_files",missing:result.error?.missing||result.missing||[]}):(debug("Continue deployment request failed"),{type:"error",error:result.error?{...result.error,status:response.status}:{...result,status:response.status}}):(debug("Continue deployment succeeded"),{type:"success",deployment:result})}}});var require_inspect_deployment_files=__commonJS({"../client/dist/inspect-deployment-files.js"(exports,module){"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),inspect_deployment_files_exports={};__export(inspect_deployment_files_exports,{inspectDeploymentFiles:()=>inspectDeploymentFiles2});module.exports=__toCommonJS(inspect_deployment_files_exports);var import_path2=__require("path"),import_collect_deployment_files=require_collect_deployment_files(),import_utils=require_utils();async function inspectDeploymentFiles2(clientOptions){let{path}=clientOptions,debug=(0,import_utils.createDebug)(clientOptions.debug),{filesMap,workPath,isDirectory,ignoreList,warning}=await(0,import_collect_deployment_files.collectDeploymentFiles)(path,{...clientOptions},debug),files=[],totalSize=0;for(let[sha,file]of filesMap){let size=file.data?.byteLength||file.data?.length||0;for(let name of file.names){let deploymentFile={path:(isDirectory?(0,import_path2.relative)(workPath,name):name.split(import_path2.sep).at(-1)||name).split(import_path2.sep).join("/"),size,mode:file.mode};typeof sha<"u"&&(deploymentFile.sha=sha),files.push(deploymentFile),totalSize+=size}}return files.sort((a,b)=>a.path.localeCompare(b.path)),{basePath:workPath,fileCount:files.length,totalSize,ignoredCount:ignoreList.length,files,ignored:ignoreList.sort(),warning}}}});var require_dist2=__commonJS({"../client/dist/index.js"(exports,module){"use strict";var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__reExport=(target,mod,secondTarget)=>(__copyProps(target,mod,"default"),secondTarget&&__copyProps(secondTarget,mod,"default")),__toESM2=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),src_exports={};__export(src_exports,{buildFileTree:()=>import_utils.buildFileTree,checkDeploymentStatus:()=>import_check_deployment_status.checkDeploymentStatus,continueDeployment:()=>import_continue.continueDeployment,createDeployment:()=>createDeployment,getVercelIgnore:()=>import_utils.getVercelIgnore,inspectDeploymentFiles:()=>import_inspect_deployment_files.inspectDeploymentFiles});module.exports=__toCommonJS(src_exports);var import_create_deployment=__toESM2(require_create_deployment()),import_continue=require_continue(),import_check_deployment_status=require_check_deployment_status(),import_inspect_deployment_files=require_inspect_deployment_files(),import_utils=require_utils();__reExport(src_exports,require_errors(),module.exports);__reExport(src_exports,require_types(),module.exports);var createDeployment=(0,import_create_deployment.default)()}});var import_fs_extra=__toESM(require_lib(),1);import{join}from"path";var import_error_utils=__toESM(require_dist(),1);async function writeProjectSettings(cwd,project,org,isRepoLinked){let analyticsId;project.analytics?.id&&(!project.analytics.disabledAt||project.analytics.enabledAt&&project.analytics.enabledAt>project.analytics.disabledAt)&&(analyticsId=project.analytics.id);let projectLinkAndSettings={projectId:isRepoLinked?void 0:project.id,orgId:isRepoLinked?void 0:org.id,projectName:isRepoLinked?void 0:project.name,settings:{createdAt:project.createdAt,framework:project.framework,devCommand:project.devCommand,installCommand:project.installCommand,buildCommand:project.buildCommand,outputDirectory:project.outputDirectory,rootDirectory:project.rootDirectory,directoryListing:project.directoryListing,nodeVersion:project.nodeVersion,analyticsId}},path=join(cwd,VERCEL_DIR,VERCEL_DIR_PROJECT);return await(0,import_fs_extra.outputJSON)(path,projectLinkAndSettings,{spaces:2})}async function readProjectSettings(vercelDir){try{return JSON.parse(await(0,import_fs_extra.readFile)(join(vercelDir,VERCEL_DIR_PROJECT),"utf8"))}catch(err){if((0,import_error_utils.isErrnoException)(err)&&err.code&&["ENOENT","ENOTDIR"].includes(err.code)||(0,import_error_utils.isError)(err)&&err.name==="SyntaxError")return null;throw err}}function pickOverrides(vercelConfig){let overrides={};for(let prop of["buildCommand","devCommand","framework","ignoreCommand","installCommand","outputDirectory"])typeof vercelConfig[prop]<"u"&&(prop==="ignoreCommand"?overrides.commandForIgnoringBuildStep=vercelConfig[prop]:overrides[prop]=vercelConfig[prop]);return overrides}export{require_dist2 as require_dist,writeProjectSettings,readProjectSettings,pickOverrides};
|
|
@@ -1,7 +0,0 @@
|
|
|
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 AGENT_STATUS={ERROR:"error",ACTION_REQUIRED:"action_required",OK:"ok"},AGENT_REASON={MISSING_ARGUMENTS:"missing_arguments",INVALID_ARGUMENTS:"invalid_arguments",CONFIRMATION_REQUIRED:"confirmation_required",INTERACTIVE_CONFIRMATION_REQUIRED:"interactive_confirmation_required",LOGIN_REQUIRED:"login_required",PROJECT_SETTINGS_REQUIRED:"project_settings_required",NOT_LINKED:"not_linked",NOT_FOUND:"not_found",PROJECT_NOT_FOUND:"project_not_found",MISSING_SCOPE:"missing_scope",SCOPE_NOT_ACCESSIBLE:"scope_not_accessible",API_ERROR:"api_error",RATE_LIMITED:"rate_limited",SEGMENT_IN_USE:"segment_in_use",ENTITY_IN_USE:"entity_in_use",MISSING_REQUIREMENTS:"missing_requirements",MISSING_NAME:"missing_name",MISSING_VALUE:"missing_value",MISSING_ENVIRONMENT:"missing_environment",ENV_NOT_FOUND:"env_not_found",MULTIPLE_ENVS:"multiple_envs",ENV_FILE_EXISTS:"env_file_exists",GIT_BRANCH_REQUIRED:"git_branch_required",ENV_KEY_SENSITIVE:"env_key_sensitive",AMBIGUOUS_ROUTE:"ambiguous_route",ROUTE_CREATE_FAILED:"route_create_failed",ROUTE_GENERATION_FAILED:"route_generation_failed",DOMAIN_NOT_FOUND:"domain_not_found",DNS_RECORD_NOT_FOUND:"dns_record_not_found",INCOMPLETE_RECORD:"incomplete_record",PERMISSION_DENIED:"permission_denied",INVALID_PORT:"invalid_port",INVALID_DNS_TYPE:"invalid_dns_type",DNS_ADD_FAILED:"dns_add_failed",INVALID_DOMAIN:"invalid_domain",CONFIGURED_CORRECTLY:"configured_correctly",VERIFICATION_NEEDED:"verification_needed",INVALID_CONFIGURATION:"invalid_configuration",DNS_CHANGE_REQUIRED:"dns_change_required",DNS_CHANGE_RECOMMENDED:"dns_change_recommended",DNSSEC_NEEDS_TO_BE_DISABLED:"dnssec_needs_to_be_disabled",PROJECT_ATTACHMENT_RECOMMENDED:"project_attachment_recommended",PROJECT_DOMAIN_MISSING:"project_domain_missing",INTEGRATION_TERMS_ACCEPTANCE_REQUIRED:"integration_terms_acceptance_required",INTEGRATION_SETUP_REQUIRED:"integration_setup_required",HAS_RESOURCES:"has_resources",INTEGRATION_SANDBOX_CLAIM_REQUIRED:"integration_sandbox_claim_required",CLASSIC_TOKEN_REQUIRED:"classic_token_required",TOKEN_USER_SCOPE_REQUIRED:"token_user_scope_required",MISSING_URL:"missing_url",MISSING_EVENTS:"missing_events",INVALID_URL:"invalid_url",INVALID_EVENT:"invalid_event",INVALID_BUDGET:"invalid_budget",INVALID_REFRESH_PERIOD:"invalid_refresh_period",INVALID_EXPIRATION:"invalid_expiration",INVALID_ALERT_THRESHOLDS:"invalid_alert_thresholds",REQUIRES_CONSENT:"requires_consent",MISSING_ISSUER_ID:"missing_issuer_id",MISSING_KEY:"missing_key",MISSING_KEY_ID:"missing_key_id",MISSING_PROJECT:"missing_project",ISSUER_NOT_FOUND:"issuer_not_found",ISSUER_MANAGED:"issuer_managed",ISSUER_REQUIRES_IMPORTED_KEY:"issuer_requires_imported_key",ISSUER_REQUIRES_GENERATED_KEY:"issuer_requires_generated_key",KEY_NOT_REVOKING:"key_not_revoking",NO_CHANGES_REQUESTED:"no_changes_requested",GIT_REPOSITORY_REQUIRED:"git_repository_required",CI_RUN_NOT_FOUND:"ci_run_not_found",CI_RUN_IN_PROGRESS:"ci_run_in_progress",CI_RUN_NOT_RETRYABLE:"ci_run_not_retryable",SCHEDULES_NOT_ENABLED:"schedules_not_enabled",SCHEDULE_ALREADY_EXISTS:"schedule_already_exists",SCHEDULE_COMPLETED:"schedule_completed",STATIC_SCHEDULE:"static_schedule",INVALID_CRON_EXPRESSION:"invalid_cron_expression",INVALID_JITTER:"invalid_jitter",JITTER_EXCEEDS_CADENCE:"jitter_exceeds_cadence",SINGLE_AT_TOO_SOON:"single_at_too_soon",SCHEDULE_PAYLOAD_TOO_LARGE:"payload_too_large",SCHEDULE_PAYLOAD_STORE_FAILED:"payload_store_failed",SCHEDULE_SERVICE_UNAVAILABLE:"service_unavailable",SCHEDULE_SERVICE_ERROR:"service_error",REDIRECT_NOT_FOUND:"redirect_not_found",VERSION_NOT_FOUND:"version_not_found",VERSION_ALREADY_LIVE:"version_already_live",VERSION_IS_STAGING:"version_is_staging",PLAN_UPGRADE_REQUIRED:"plan_upgrade_required",NOT_TEAM_MEMBER:"not_team_member",INVALID_ROLE_COMBINATION:"invalid_role_combination"},AGENT_ACTION={MISSING_ARGUMENTS:"missing_arguments",CONFIRMATION_REQUIRED:"confirmation_required",LOGIN_REQUIRED:"login_required"};export{AGENT_STATUS,AGENT_REASON,AGENT_ACTION};
|
|
@@ -1,9 +0,0 @@
|
|
|
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{formatOption,jsonOption,projectOption,yesOption}from"./chunk-PV5YI2ZZ.js";import{packageName}from"./chunk-FI772UVH.js";var builtInBody={type:"built-in",name:"Production server errors",triggers:{mode:"selected",items:[{type:"error_anomaly",filter:"statusGroup:5xx AND route:/api/*"}]},matchMinimumSeverityLevel:"high"},patchBody={name:"Critical production errors",matchMinimumSeverityLevel:"critical"},authoringReference={title:"Authoring reference",body:["vercel alerts rules schema --type built-in"]},rulesAddHelpSections=[{title:"Scope",body:["Provide ruleScope in the body or use a scope flag, not both.","--project maps to one included project.","--all maps to every project in the team."]},{title:"Built-in body (rule.json)",body:[...JSON.stringify(builtInBody,null,2).split(`
|
|
8
|
-
`),"","vercel alerts rules create --project my-app --body ./rule.json"]},authoringReference],rulesUpdateHelpSections=[{title:"Update body",body:["Include only the fields to change. type is optional and inferred from the stored rule.","Use --project or --all to change scope with or without --body.","Do not combine a ruleScope field in the body with --project or --all.","--all moves the rule to team-wide scope."]},{title:"Partial body (patch.json)",body:[...JSON.stringify(patchBody,null,2).split(`
|
|
9
|
-
`),"","vercel alerts rules update ar_abc123 --body ./patch.json","vercel alerts rules update ar_abc123 --project my-app"]},authoringReference];var projectScopeOption={...projectOption,shorthand:"p",description:"Use a project by name or ID"},listAllOption={name:"all",shorthand:"a",type:Boolean,deprecated:!1,description:"List all accessible rules in the selected team"},mutationAllOption={...listAllOption,description:"Apply the rule to all projects in the selected team"},deprecatedItemScopeOptions=[{...projectScopeOption,deprecated:!0},{...listAllOption,deprecated:!0}],bodyOption={name:"body",shorthand:null,type:String,argument:"PATH",deprecated:!1,description:"Read the alert rule body from a JSON file"},rulesLsSubcommand={name:"ls",aliases:["list"],description:"List alert rules for a project or team",arguments:[],options:[projectScopeOption,listAllOption,{name:"type",shorthand:null,type:[String],argument:"TYPE",deprecated:!1,description:"Filter by rule type"},formatOption,jsonOption],examples:[{name:"List rules affecting the linked project",value:`${packageName} alerts rules ls`},{name:"List all rules in the selected team",value:`${packageName} alerts rules ls --all`},{name:"Write JSON output",value:`${packageName} alerts rules ls --all --json`}]},rulesSchemaSubcommand={name:"schema",aliases:[],description:"Show alert rule request fields and examples",arguments:[],options:[{name:"type",shorthand:null,type:String,argument:"TYPE",deprecated:!1,description:"Rule type to describe"},formatOption],examples:[{name:"List supported rule types",value:`${packageName} alerts rules schema`},{name:"Show the built-in rule schema",value:`${packageName} alerts rules schema --type built-in`}]},rulesAddSubcommand={name:"create",aliases:["add"],description:"Create an alert rule from a JSON body",helpSections:rulesAddHelpSections,arguments:[],options:[projectScopeOption,mutationAllOption,formatOption,jsonOption,bodyOption],examples:[{name:"Create a project-scoped rule",value:`${packageName} alerts rules create --project my-app --body ./rule.json`},{name:"Create a team-wide built-in rule",value:`${packageName} alerts rules create --all --body ./rule.json`}]},rulesInspectSubcommand={name:"inspect",aliases:["get"],description:"Show one alert rule by ID",arguments:[{name:"ruleId",required:!0}],options:[...deprecatedItemScopeOptions,formatOption,jsonOption],examples:[{name:"Inspect a rule",value:`${packageName} alerts rules inspect ar_abc123`},{name:"Write JSON output",value:`${packageName} alerts rules inspect ar_abc123 --json`}]},rulesRmSubcommand={name:"rm",aliases:["remove","delete"],description:"Delete an alert rule",arguments:[{name:"ruleId",required:!0}],options:[...deprecatedItemScopeOptions,formatOption,jsonOption,yesOption],examples:[{name:"Delete with confirmation",value:`${packageName} alerts rules rm ar_abc123`},{name:"Delete without a prompt",value:`${packageName} alerts rules rm ar_abc123 --yes`}]},rulesUpdateSubcommand={name:"update",aliases:["patch"],description:"Patch an alert rule or change its scope",helpSections:rulesUpdateHelpSections,arguments:[{name:"ruleId",required:!0}],options:[projectScopeOption,mutationAllOption,formatOption,jsonOption,{...bodyOption,description:"Read the partial update body from a JSON file"}],examples:[{name:"Update fields from a file",value:`${packageName} alerts rules update ar_abc123 --body ./patch.json`},{name:"Move a rule to a project",value:`${packageName} alerts rules update ar_abc123 --project my-app`}]},notificationTargetOptions=[{name:"webhook",shorthand:null,type:String,argument:"WEBHOOK_ID",deprecated:!1,description:"Select an account webhook by ID"},{name:"slack-channel",shorthand:null,type:String,argument:"CHANNEL_ID",deprecated:!1,description:"Select a Slack channel by ID"},{name:"slack-installation-id",shorthand:null,type:String,argument:"INSTALLATION_ID",deprecated:!1,description:"Slack installation ID. Optional only when the team has exactly one completed Slack installation."}],criticalOnlyOption={name:"critical-only",shorthand:null,type:Boolean,deprecated:!1,description:"Notify only when Vercel Agent escalates an alert to Critical"},noCriticalOnlyOption={name:"no-critical-only",shorthand:null,type:Boolean,deprecated:!1,description:"Deliver every alert matched by the rule"},rulesNotificationsLsSubcommand={name:"ls",aliases:["list"],default:!0,description:"List notification destinations for all readable rules or one alert rule",arguments:[{name:"ruleId",required:!1}],options:[formatOption,jsonOption],examples:[{name:"List notification destinations for all readable rules",value:`${packageName} alerts rules notifications ls`},{name:"List notification destinations for one rule",value:`${packageName} alerts rules notifications ls ar_abc123`},{name:"Write JSON output",value:`${packageName} alerts rules notifications ar_abc123 --json`}]},rulesNotificationsLinkSubcommand={name:"link",aliases:[],description:"Link a Slack channel or account webhook to an alert rule",arguments:[{name:"<ruleId>",required:!0}],options:[...notificationTargetOptions,criticalOnlyOption,formatOption,jsonOption],examples:[{name:"Link a Slack channel",value:`${packageName} alerts rules notifications link ar_abc123 --slack-channel C123`},{name:"Link a Slack channel from a specific installation",value:`${packageName} alerts rules notifications link ar_abc123 --slack-channel C123 --slack-installation-id icfg_abc123`},{name:"Link a webhook",value:`${packageName} alerts rules notifications link ar_abc123 --webhook wh_abc123`},{name:"Link a Critical-only webhook",value:`${packageName} alerts rules notifications link ar_abc123 --webhook wh_abc123 --critical-only`}]},rulesNotificationsUpdateSubcommand={name:"update",aliases:["patch"],description:"Update a notification destination's delivery setting",arguments:[{name:"<ruleId>",required:!0}],options:[...notificationTargetOptions,criticalOnlyOption,noCriticalOnlyOption,formatOption,jsonOption],examples:[{name:"Restrict a Slack channel to Critical alerts",value:`${packageName} alerts rules notifications update ar_abc123 --slack-channel C123 --critical-only`},{name:"Restore delivery for every alert matched by the rule",value:`${packageName} alerts rules notifications update ar_abc123 --webhook wh_abc123 --no-critical-only`}]},rulesNotificationsUnlinkSubcommand={name:"unlink",aliases:[],description:"Unlink a Slack channel or account webhook from an alert rule",arguments:[{name:"<ruleId>",required:!0}],options:[...notificationTargetOptions,formatOption,jsonOption],examples:[{name:"Unlink a Slack channel",value:`${packageName} alerts rules notifications unlink ar_abc123 --slack-channel C123`},{name:"Unlink a webhook",value:`${packageName} alerts rules notifications unlink ar_abc123 --webhook wh_abc123`}]},rulesNotificationsAggregateCommand={name:"notifications",aliases:[],description:"List and manage linked Slack and webhook destinations for alert rules",arguments:[],subcommands:[rulesNotificationsLsSubcommand,rulesNotificationsLinkSubcommand,rulesNotificationsUpdateSubcommand,rulesNotificationsUnlinkSubcommand],options:[formatOption,jsonOption],examples:[{name:"List destinations for all readable rules",value:`${packageName} alerts rules notifications`},{name:"List destinations for one rule",value:`${packageName} alerts rules notifications ar_abc123`},{name:"Link Slack with the team's only installation",value:`${packageName} alerts rules notifications link ar_abc123 --slack-channel C123`}]},rulesAggregateCommand={name:"rules",aliases:[],description:"Create, inspect, list, update, and delete alert rules and manage their notification destinations",arguments:[],subcommands:[rulesLsSubcommand,rulesSchemaSubcommand,rulesAddSubcommand,rulesInspectSubcommand,rulesRmSubcommand,rulesUpdateSubcommand,rulesNotificationsAggregateCommand],options:[],examples:[{name:"List rules for the linked project",value:`${packageName} alerts rules ls`},{name:"Create a rule",value:`${packageName} alerts rules create --project my-app --body ./rule.json`},{name:"Inspect a rule",value:`${packageName} alerts rules inspect ar_abc123`},{name:"Update a rule",value:`${packageName} alerts rules update ar_abc123 --body ./patch.json`},{name:"Delete a rule",value:`${packageName} alerts rules rm ar_abc123`},{name:"List notification destinations for a rule",value:`${packageName} alerts rules notifications ar_abc123`}]};export{rulesLsSubcommand,rulesSchemaSubcommand,rulesAddSubcommand,rulesInspectSubcommand,rulesRmSubcommand,rulesUpdateSubcommand,rulesNotificationsLsSubcommand,rulesNotificationsLinkSubcommand,rulesNotificationsUpdateSubcommand,rulesNotificationsUnlinkSubcommand,rulesNotificationsAggregateCommand,rulesAggregateCommand};
|
|
@@ -1,8 +0,0 @@
|
|
|
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_lib}from"./chunk-7IRKF3ZG.js";import{humanizePath}from"./chunk-PPCFQQSU.js";import{output_manager_default}from"./chunk-EWWFNMPZ.js";import{require_source}from"./chunk-U7KCDTCH.js";import{__toESM}from"./chunk-6L236MNA.js";var import_fs_extra=__toESM(require_lib(),1),import_chalk=__toESM(require_source(),1);import{homedir}from"os";import{resolve,sep}from"path";async function validateRootDirectory(cwd,path,errorSuffix=""){let pathStat=await(0,import_fs_extra.lstat)(path).catch(()=>null),suffix=errorSuffix?` ${errorSuffix}`:"";if(!pathStat)return output_manager_default.error(`The provided path ${import_chalk.default.cyan(`\u201C${humanizePath(path)}\u201D`)} does not exist.${suffix}`),!1;if(!pathStat.isDirectory())return output_manager_default.error(`The provided path ${import_chalk.default.cyan(`\u201C${humanizePath(path)}\u201D`)} is a file, but expected a directory.${suffix}`),!1;let base=resolve(cwd),target=resolve(path);return target!==base&&!target.startsWith(base+sep)?(output_manager_default.error(`The provided path ${import_chalk.default.cyan(`\u201C${humanizePath(path)}\u201D`)} is outside of the project.${suffix}`),!1):!0}async function validatePaths(client,paths){if(paths.length>1)return output_manager_default.error("Can't deploy more than one path."),{valid:!1,exitCode:1};let path=paths[0],pathStat=await(0,import_fs_extra.lstat)(path).catch(()=>null);return pathStat?pathStat.isDirectory()?path===homedir()&&!await client.input.confirm("You are deploying your home directory. Do you want to continue?",!1)?(output_manager_default.print(`Canceled
|
|
8
|
-
`),{valid:!1,exitCode:0}):{valid:!0,path}:(output_manager_default.prettyError({message:"Support for single file deployments has been removed.",link:"https://vercel.link/no-single-file-deployments"}),{valid:!1,exitCode:1}):(output_manager_default.error(`Could not find ${import_chalk.default.cyan(`\u201C${humanizePath(path)}\u201D`)}`),{valid:!1,exitCode:1})}export{validateRootDirectory,validatePaths};
|
|
@@ -1,7 +0,0 @@
|
|
|
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_dist,require_dist2}from"./chunk-N4PVXHAJ.js";import{require_types}from"./chunk-GHM7V3GG.js";import{require_build_utils}from"./chunk-EWWFNMPZ.js";import{__commonJS,__toESM}from"./chunk-6L236MNA.js";var require_dist3=__commonJS({"../../internals/service-topology/dist/index.js"(exports,module){"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),src_exports={};__export(src_exports,{INTERNAL_SERVICE_PREFIX:()=>import_fs_detectors2.INTERNAL_SERVICE_PREFIX,autoDetectServices:()=>import_fs_detectors2.autoDetectServices,detectServices:()=>import_fs_detectors2.detectServices,generateServiceRewrites:()=>import_fs_detectors2.generateServiceRewrites,generateServicesRoutes:()=>import_fs_detectors2.generateServicesRoutes,getInternalServiceCronPath:()=>import_fs_detectors2.getInternalServiceCronPath,getInternalServiceCronPathPrefix:()=>import_fs_detectors2.getInternalServiceCronPathPrefix,getInternalServiceFunctionPath:()=>import_fs_detectors2.getInternalServiceFunctionPath,getInternalServiceWorkerPath:()=>import_fs_detectors2.getInternalServiceWorkerPath,getInternalServiceWorkerPathPrefix:()=>import_fs_detectors2.getInternalServiceWorkerPathPrefix,hasLegacyServicesConfig:()=>import_fs_detectors2.hasLegacyServicesConfig,isExperimentalService:()=>import_fs_detectors2.isExperimentalService,isExperimentalServiceV2:()=>import_fs_detectors2.isExperimentalServiceV2,isRouteOwningBuilder:()=>import_fs_detectors2.isRouteOwningBuilder,isStaticBuild:()=>import_fs_detectors2.isStaticBuild,migrateExperimentalServices:()=>import_fs_detectors2.migrateExperimentalServices,planExperimentalServicesMigration:()=>import_fs_detectors2.planExperimentalServicesMigration,resolveAllConfiguredServices:()=>import_fs_detectors2.resolveAllConfiguredServices,resolveAllConfiguredServicesV2:()=>import_fs_detectors2.resolveAllConfiguredServicesV2,resolveConfiguredServiceV2:()=>import_fs_detectors2.resolveConfiguredServiceV2,validateServiceConfigV2:()=>import_fs_detectors2.validateServiceConfigV2});module.exports=__toCommonJS(src_exports);var import_fs_detectors2=require_dist2()}});var import_routing_utils=__toESM(require_dist(),1),import_build_utils=__toESM(require_build_utils(),1),import_types=__toESM(require_types(),1),import_fs_detectors=__toESM(require_dist2(),1);import{getConfigValidator}from"./config-validator.mjs";var imagesSchema={type:"object",additionalProperties:!1,required:["sizes"],properties:{contentDispositionType:{enum:["inline","attachment"]},contentSecurityPolicy:{type:"string",minLength:1,maxLength:256},dangerouslyAllowSVG:{type:"boolean"},domains:{type:"array",minItems:0,maxItems:50,items:{type:"string",minLength:1,maxLength:256}},formats:{type:"array",minItems:1,maxItems:4,items:{enum:["image/avif","image/webp","image/jpeg","image/png"]}},localPatterns:{type:"array",minItems:0,maxItems:25,items:{type:"object",additionalProperties:!1,properties:{pathname:{type:"string",minLength:1,maxLength:256},search:{type:"string",minLength:0,maxLength:256}}}},minimumCacheTTL:{type:"integer",minimum:1,maximum:31536e4},qualities:{type:"array",minItems:1,maxItems:20,items:{type:"integer",minimum:1,maximum:100}},remotePatterns:{type:"array",minItems:0,maxItems:50,items:{type:"object",additionalProperties:!1,required:["hostname"],properties:{protocol:{enum:["http","https"]},hostname:{type:"string",minLength:1,maxLength:256},port:{type:"string",minLength:0,maxLength:5},pathname:{type:"string",minLength:1,maxLength:256},search:{type:"string",minLength:0,maxLength:256}}}},sizes:{type:"array",minItems:1,maxItems:50,items:{type:"number"}}}},cronsSchema={type:"array",minItems:0,items:{type:"object",additionalProperties:!1,required:["path","schedule"],properties:{path:{type:"string",minLength:1,maxLength:512,pattern:"^/.*"},schedule:{type:"string",minLength:9,maxLength:256}}}},scheduleNameSchema={type:"string",minLength:1,maxLength:256,pattern:"^[0-9A-Za-z][0-9A-Za-z._-]*$"},scheduleTimezoneSchema={type:"string",minLength:1,maxLength:50,description:"IANA timezone for cron evaluation. Defaults to UTC."},scheduleJitterSchema={type:"integer",minimum:1,maximum:15},scheduleCronStringSchema={type:"string",minLength:9,maxLength:256},scheduleExpressionSchema={type:"object",additionalProperties:!1,required:["cron"],properties:{cron:{type:"string"},jitter:scheduleJitterSchema}},scheduleTargetFunctionSchema={type:"object",additionalProperties:!1,required:["function"],properties:{function:{type:"string",minLength:1}}},scheduleTargetPathSchema={type:"object",additionalProperties:!1,required:["path"],properties:{path:{description:"Deployment path to invoke over HTTP, like `crons[].path`. Must start with `/`.",type:"string",maxLength:512,pattern:"^/"}}},scheduleTargetTopicSchema={type:"object",additionalProperties:!1,required:["topic"],properties:{topic:{type:"string",minLength:1,maxLength:256,pattern:"^[A-Za-z0-9_-]+$"}}},scheduleTargetEntrypointSchema={type:"object",additionalProperties:!1,required:["entrypoint"],properties:{entrypoint:{type:"string",minLength:1,maxLength:512}}},legacyVercelJsonScheduleSchema={type:"object",additionalProperties:!1,required:["expression","target","name"],properties:{expression:scheduleExpressionSchema,target:{oneOf:[scheduleTargetFunctionSchema,scheduleTargetPathSchema,scheduleTargetTopicSchema,scheduleTargetEntrypointSchema]},name:scheduleNameSchema,timezone:scheduleTimezoneSchema}},flatVercelJsonScheduleSchema={type:"object",additionalProperties:!1,required:["name","schedule"],properties:{name:scheduleNameSchema,schedule:scheduleCronStringSchema,timezone:scheduleTimezoneSchema,jitter:scheduleJitterSchema,path:scheduleTargetPathSchema.properties.path,function:scheduleTargetFunctionSchema.properties.function,topic:scheduleTargetTopicSchema.properties.topic,entrypoint:scheduleTargetEntrypointSchema.properties.entrypoint},oneOf:[{required:["path"]},{required:["function"]},{required:["topic"]},{required:["entrypoint"]}]},schedulesSchema={type:"array",minItems:0,maxItems:100,items:{oneOf:[legacyVercelJsonScheduleSchema,flatVercelJsonScheduleSchema]}},experimentalServicesMountSchema={oneOf:[{type:"string",minLength:1,maxLength:512},{type:"object",additionalProperties:!1,properties:{path:{type:"string",minLength:1,maxLength:512},subdomain:{type:"string",minLength:1,maxLength:63}},anyOf:[{required:["path"]},{required:["subdomain"]}]}]},staticExperimentalServiceScheduleSchema={type:"string",minLength:9,maxLength:256,not:{const:"<dynamic>"}},experimentalServiceScheduleSchema={oneOf:[{type:"string",minLength:9,maxLength:256},{type:"array",minItems:1,items:staticExperimentalServiceScheduleSchema}]},experimentalServiceQueueTopicSchema={type:"object",additionalProperties:!1,required:["topic"],properties:{topic:{type:"string",minLength:1,maxLength:256},retryAfterSeconds:{type:"integer",minimum:1,maximum:86400},initialDelaySeconds:{type:"integer",minimum:0,maximum:86400}}},experimentalServiceTopicsSchema={oneOf:[{type:"array",minItems:1,items:{type:"string",minLength:1,maxLength:256}},{type:"array",minItems:1,items:experimentalServiceQueueTopicSchema}]},envVarNamesSchema={pattern:"^[A-Za-z_][A-Za-z0-9_]*$",maxLength:256},getExperimentalServicesCommonProperties=()=>({entrypoint:{type:"string",minLength:1,maxLength:512},root:{type:"string",minLength:1,maxLength:512},workspace:{type:"string",minLength:1,maxLength:512},framework:{type:"string",minLength:1,maxLength:256},builder:{type:"string",minLength:1,maxLength:256},runtime:{type:"string",minLength:1,maxLength:256},buildCommand:{type:"string",minLength:1,maxLength:2048},installCommand:{type:"string",minLength:1,maxLength:2048},preDeployCommand:{type:"string",minLength:1,maxLength:2048},command:{oneOf:[{type:"string",minLength:1,maxLength:2048},{type:"array",minItems:1,items:{type:"string",minLength:1,maxLength:2048}}]},memory:{type:"integer",minimum:128,maximum:10240},maxDuration:(0,import_build_utils.getMaxDurationSchema)(),includeFiles:{oneOf:[{type:"string",minLength:1},{type:"array",items:{type:"string",minLength:1}}]},excludeFiles:{oneOf:[{type:"string",minLength:1},{type:"array",items:{type:"string",minLength:1}}]}}),experimentalServicesRoutableProperties={mount:experimentalServicesMountSchema,routePrefix:{type:"string",minLength:1,maxLength:512},subdomain:{type:"string",minLength:1,maxLength:63}},getExperimentalServicesServiceConfigSchema=()=>({oneOf:[{type:"object",additionalProperties:!1,properties:{...getExperimentalServicesCommonProperties(),...experimentalServicesRoutableProperties,type:{enum:["web"]}}},{type:"object",additionalProperties:!1,required:["type","trigger","schedule"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"job"},trigger:{const:"schedule"},schedule:experimentalServiceScheduleSchema}},{type:"object",additionalProperties:!1,required:["type","trigger","topics"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"job"},trigger:{const:"queue"},topics:experimentalServiceTopicsSchema,consumer:{type:"string",minLength:1,maxLength:256}}},{type:"object",additionalProperties:!1,required:["type","trigger","entrypoint"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"job"},trigger:{const:"workflow"}}},{type:"object",additionalProperties:!1,required:["type"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"worker"},topics:{type:"array",items:{type:"string",minLength:1,maxLength:256},minItems:1},consumer:{type:"string",minLength:1,maxLength:256}}},{type:"object",additionalProperties:!1,required:["type","schedule"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"cron"},schedule:experimentalServiceScheduleSchema}}]}),getExperimentalServicesSchema=()=>({type:"object",propertyNames:{pattern:"^[a-zA-Z]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$",maxLength:64},additionalProperties:getExperimentalServicesServiceConfigSchema()}),experimentalServiceGroupsSchema={type:"object",propertyNames:{pattern:"^[a-zA-Z]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$",maxLength:64},additionalProperties:{type:"array",items:{type:"string",minLength:1,maxLength:256}}},servicesPathSchema={type:"string",minLength:1,maxLength:512},servicesCommandSchema={type:"string",minLength:1,maxLength:2048},servicesServiceNamePattern="^[a-z]([a-z_-]*[a-z])?$",servicesBindingSchema={type:"object",additionalProperties:!1,required:["service","format","env"],properties:{type:{description:"Optional binding type marker. Currently the only supported type is `service`. When present this must be `service`.",const:"service"},service:{type:"string",minLength:1,maxLength:64,pattern:servicesServiceNamePattern},format:{const:"url"},env:{type:"string",...envVarNamesSchema}}},servicesBindingsSchema={type:"array",maxItems:100,items:servicesBindingSchema},getServicesServiceConfigSchema=()=>({type:"object",additionalProperties:!1,required:["root"],properties:{root:servicesPathSchema,framework:{type:"string",minLength:1,maxLength:256},runtime:{type:"string",minLength:1,maxLength:256},entrypoint:servicesPathSchema,command:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},installCommand:servicesCommandSchema,buildCommand:servicesCommandSchema,devCommand:servicesCommandSchema,ignoreCommand:servicesCommandSchema,outputDirectory:servicesPathSchema,bindings:servicesBindingsSchema,functions:(0,import_build_utils.getFunctionsSchema)(),headers:import_routing_utils.headersSchema,redirects:import_routing_utils.redirectsSchema,rewrites:import_routing_utils.rewritesSchema,routes:import_routing_utils.routesSchema,cleanUrls:import_routing_utils.cleanUrlsSchema,trailingSlash:import_routing_utils.trailingSlashSchema}}),daemonConfigSchema={type:"object",additionalProperties:!1,required:["root","entrypoint","replicas"],properties:{root:servicesPathSchema,entrypoint:servicesPathSchema,command:{type:"array",minItems:1,maxItems:128,items:{type:"string",minLength:1,maxLength:4096}},replicas:{type:"object",additionalProperties:{type:"integer",minimum:0}},resources:{type:"object",additionalProperties:!1,required:["requests"],properties:{requests:{type:"object",additionalProperties:!1,required:["memory"],properties:{memory:{enum:["1Gi","2Gi","4Gi","8Gi"]}}}}}}},getServicesSchema=()=>({type:"object",propertyNames:{pattern:servicesServiceNamePattern,maxLength:64},additionalProperties:getServicesServiceConfigSchema()}),maxDaemons=100,daemonsSchema={type:"object",maxProperties:maxDaemons,propertyNames:{pattern:import_build_utils.DAEMON_NAME_PATTERN,maxLength:64},additionalProperties:daemonConfigSchema},proxySchema={type:"object",additionalProperties:!1,required:["entrypoint"],properties:{entrypoint:{type:"string",minLength:1},matcher:{oneOf:[{type:"string",minLength:1},{type:"array",minItems:1,items:{type:"string",minLength:1}}]}}};function buildVercelConfigSchema(){return{type:"object",additionalProperties:!0,properties:{builds:import_build_utils.buildsSchema,routes:import_routing_utils.routesSchema,cleanUrls:import_routing_utils.cleanUrlsSchema,headers:import_routing_utils.headersSchema,redirects:import_routing_utils.redirectsSchema,rewrites:import_routing_utils.rewritesSchema,trailingSlash:import_routing_utils.trailingSlashSchema,functions:(0,import_build_utils.getFunctionsSchema)(),images:imagesSchema,crons:cronsSchema,schedules:schedulesSchema,bunVersion:{type:"string"},proxy:proxySchema,experimentalServices:getExperimentalServicesSchema(),experimentalServiceGroups:experimentalServiceGroupsSchema,services:getServicesSchema(),experimentalServicesV2:getServicesSchema(),daemons:daemonsSchema}}}function validateConfig(config){let validate=getConfigValidator(buildVercelConfigSchema);if(!validate(config)&&validate.errors&&validate.errors[0]){let error=validate.errors[0],fileName=config[import_types.fileNameSymbol]||"vercel.json",niceError=(0,import_build_utils.getPrettyError)(error);return niceError.message=`Invalid ${fileName} - ${niceError.message}`,niceError}if(config.schedules?.length)try{for(let schedule of config.schedules)(0,import_build_utils.parseScheduleDefinition)(schedule)}catch(error){return new import_build_utils.NowBuildError({code:"INVALID_SCHEDULE",message:`Invalid ${config[import_types.fileNameSymbol]||"vercel.json"} - ${error instanceof Error?error.message:String(error)}`})}for(let[index,schedule]of(config.schedules??[]).entries())if(schedule.timezone!==void 0)try{if(!/^[A-Za-z][A-Za-z0-9_+/-]*$/.test(schedule.timezone))throw new RangeError("Expected a named timezone");new Intl.DateTimeFormat("en-US",{timeZone:schedule.timezone})}catch{return new import_build_utils.NowBuildError({code:"INVALID_SCHEDULE_TIMEZONE",message:`Invalid ${config[import_types.fileNameSymbol]||"vercel.json"} - \`schedules[${index}].timezone\` must be a valid IANA timezone, such as "America/New_York". Omit it to use UTC.`})}let functionMaps=[config.functions,...Object.values(config.services??{}).map(service=>service.functions),...Object.values(config.experimentalServicesV2??{}).map(service=>service.functions)];for(let functions of functionMaps)for(let[pattern,fn]of Object.entries(functions??{})){let regions=[...new Set(fn.regions)];if(fn.affinity?.mode==="strict"&&(regions.includes("all")||regions.length>1))return new import_build_utils.NowBuildError({code:"INVALID_FUNCTION_AFFINITY_REGIONS",message:`Function affinity mode "strict" requires at most one statically configured region. Update \`functions[${JSON.stringify(pattern)}].regions\` to contain a single region.`,link:"https://vercel.com/docs/concepts/projects/project-configuration#functions"})}if(config.proxy){let proxyError=(0,import_fs_detectors.validateProxyConfig)(config.proxy);if(proxyError)return new import_build_utils.NowBuildError({code:proxyError.code.toUpperCase(),message:proxyError.message})}if(config.functions&&config.builds)return new import_build_utils.NowBuildError({code:"FUNCTIONS_AND_BUILDS",message:"The `functions` property cannot be used in conjunction with the `builds` property. Please remove one of them.",link:"https://vercel.link/functions-and-builds"});if(config.proxy&&config.builds)return new import_build_utils.NowBuildError({code:"PROXY_AND_BUILDS",message:"The `proxy` property cannot be used with the `builds` property. Remove `builds` to use an explicit proxy entrypoint."});let hasExperimentalServices=!!config.experimentalServices;if(hasExperimentalServices&&config.builds)return new import_build_utils.NowBuildError({code:"EXPERIMENTAL_SERVICES_AND_BUILDS",message:"The `experimentalServices` property cannot be used in conjunction with the `builds` property. Please remove one of them."});if(hasExperimentalServices&&config.functions)return new import_build_utils.NowBuildError({code:"EXPERIMENTAL_SERVICES_AND_FUNCTIONS",message:"The `experimentalServices` property cannot be used in conjunction with the `functions` property. Please remove one of them."});if(config.experimentalServiceGroups&&!config.experimentalServices)return new import_build_utils.NowBuildError({code:"SERVICE_GROUPS_WITHOUT_SERVICES",message:"The `experimentalServiceGroups` property requires `experimentalServices` to be defined. Service groups reference services by name."});let hasServices=config.services!=null,hasExperimentalServicesV2=config.experimentalServicesV2!=null;if(hasServices&&hasExperimentalServicesV2)return new import_build_utils.NowBuildError({code:"SERVICES_AND_EXPERIMENTAL_SERVICES_V2",message:"The `services` property cannot be used in conjunction with its deprecated alias `experimentalServicesV2`. Please use only `services`."});let servicesConfig=config.services??config.experimentalServicesV2,servicesConfigKey=hasServices?"services":"experimentalServicesV2",servicesErrorCodePrefix=hasServices?"SERVICES":"EXPERIMENTAL_SERVICES_V2";if(servicesConfig&&hasExperimentalServices)return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_AND_EXPERIMENTAL_SERVICES`,message:`The \`${servicesConfigKey}\` property cannot be used in conjunction with the \`experimentalServices\` property. Please use only one services configuration.`});if(servicesConfig&&config.builds)return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_AND_BUILDS`,message:`The \`${servicesConfigKey}\` property cannot be used in conjunction with the \`builds\` property. Please remove one of them.`});if(servicesConfig){let ambiguousTopLevel=[];if(config.functions!=null&&ambiguousTopLevel.push("functions"),config.installCommand!=null&&ambiguousTopLevel.push("installCommand"),config.buildCommand!=null&&ambiguousTopLevel.push("buildCommand"),config.devCommand!=null&&ambiguousTopLevel.push("devCommand"),config.ignoreCommand!=null&&ambiguousTopLevel.push("ignoreCommand"),config.outputDirectory!=null&&ambiguousTopLevel.push("outputDirectory"),config.framework!=null&&ambiguousTopLevel.push("framework"),ambiguousTopLevel.length>0){let count=ambiguousTopLevel.length,fields=ambiguousTopLevel.map(field=>`\`${field}\``).join(", ");return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_AND_TOP_LEVEL_BUILD_SETTINGS`,message:`The top-level ${count>1?"properties":"property"} ${fields} cannot be used with \`${servicesConfigKey}\` because the owning service is ambiguous. Move ${count>1?"them":"it"} under the relevant service in \`${servicesConfigKey}\`.`})}}if(config.daemons){let daemonError=validateDaemons(config,config.daemons);if(daemonError)return daemonError}if(servicesConfig){let serviceNames=new Set(Object.keys(servicesConfig));for(let[serviceName,serviceConfig]of Object.entries(servicesConfig))for(let binding of serviceConfig.bindings??[])if(!serviceNames.has(binding.service))return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_BINDING_UNKNOWN_SERVICE`,message:`Service "${serviceName}" declares a binding to unknown service "${binding.service}". Add "${binding.service}" to \`${servicesConfigKey}\` or fix the binding.`})}return null}function validateDaemons(config,daemons){let invalid=message=>new import_build_utils.NowBuildError({code:"INVALID_DAEMON",message}),daemonNames=new Set(Object.keys(daemons));for(let[name,daemon]of Object.entries(daemons))if(!/^(docker|container)file(\.vercel)?$/i.test(daemon.entrypoint.split(/[\\/]/).pop()??""))return invalid(`Daemon "${name}" must set \`entrypoint\` to a Dockerfile or Containerfile.`);let services={...config.experimentalServicesV2,...config.services},isDaemonTarget=name=>daemonNames.has(name)&&!Object.prototype.hasOwnProperty.call(services,name);for(let[name,service]of Object.entries(services)){let binding=service.bindings?.find(binding2=>isDaemonTarget(binding2.service));if(binding)return invalid(`Service "${name}" cannot bind to daemon "${binding.service}" because daemons do not receive traffic.`)}let destinations=[...config.rewrites??[],...config.routes??[],...Object.values(services).flatMap(service=>[...service.rewrites??[],...service.routes??[]])].map(entry=>"destination"in entry?entry.destination:void 0);for(let destination of destinations)if(typeof destination=="object"&&destination!==null&&isDaemonTarget(destination.service))return invalid(`Rewrites and routes cannot target daemon "${destination.service}" because daemons do not receive traffic.`);return null}export{require_dist3 as require_dist,validateConfig};
|
|
@@ -1,7 +0,0 @@
|
|
|
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-EQHNA4BW.js";import{AGENT_REASON,AGENT_STATUS}from"./chunk-CVX5X5RI.js";import{detectExplicitScope}from"./chunk-ALXWJ7XN.js";import{printError}from"./chunk-7T4CJ6MJ.js";import{getProjectByNameOrId}from"./chunk-7IRKF3ZG.js";import{buildCommandWithGlobalFlags,getErrorRecovery,outputActionRequired,outputAgentError}from"./chunk-5VWK73R6.js";import{ProjectNotFound,isAPIError}from"./chunk-RINZXCDJ.js";import{output_manager_default}from"./chunk-EWWFNMPZ.js";function messageFor(err){return isAPIError(err)?err.serverMessage||err.message:err instanceof Error?err.message:String(err)}function handleTracingApiError(client,err){if(client.nonInteractive){let apiError=isAPIError(err)?err:void 0,status=apiError?.status;outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:status===403?AGENT_REASON.PERMISSION_DENIED:status===404?AGENT_REASON.NOT_FOUND:status===429?AGENT_REASON.RATE_LIMITED:AGENT_REASON.API_ERROR,message:messageFor(err),...apiError?.status===429&&getErrorRecovery(apiError,client)})}return isAPIError(err)&&err.status===403?(output_manager_default.error(messageFor(err)),1):(printError(err),1)}function configError(client,reason,message){return outputAgentError(client,{status:AGENT_STATUS.ERROR,reason,message}),output_manager_default.error(message),1}function invalidArguments(client,message){return configError(client,AGENT_REASON.INVALID_ARGUMENTS,message)}function ruleNotFound(client,message){return configError(client,AGENT_REASON.NOT_FOUND,message)}function confirmationRequired(client,message,next){return outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.CONFIRMATION_REQUIRED,message,userActionRequired:!0,next}),output_manager_default.error(message),1}var MISSING_BOTH_MESSAGE="No linked project found. Run `vercel link`, pass --cwd to a linked dir, or use --scope <team> and --project <name>.";async function resolveScope({client,flags={},linkedProject}){let flagScope=flags.scope?.trim()||void 0,flagProject=flags.project?.trim()||void 0;if(linkedProject.status==="linked"){if(!flagScope&&!flagProject)return{teamId:linkedProject.org.id,projectId:linkedProject.project.id,projectName:linkedProject.project.name};let teamId=flagScope?client.config.currentTeam:linkedProject.org.id;if(!teamId)return{reason:AGENT_REASON.NOT_FOUND,message:`Team not found: ${flagScope}`};let project=await getProjectByNameOrId(client,flagProject??linkedProject.project.id,teamId);return project instanceof ProjectNotFound?{reason:AGENT_REASON.NOT_FOUND,message:`Project not found: ${flagProject}`}:{teamId,projectId:project.id,projectName:project.name}}if(flagScope&&flagProject){let teamId=client.config.currentTeam;if(!teamId)return{reason:AGENT_REASON.NOT_FOUND,message:`Team not found: ${flagScope}`};let project=await getProjectByNameOrId(client,flagProject,teamId);return project instanceof ProjectNotFound?{reason:AGENT_REASON.NOT_FOUND,message:`Project not found: ${flagProject}`}:{teamId,projectId:project.id,projectName:project.name}}return{reason:AGENT_REASON.NOT_LINKED,message:MISSING_BOTH_MESSAGE}}async function resolveConfigScope(client,flags){let link=await resolveProjectContext({client,projectNameOrId:flags.project});return link.status==="error"?{exitCode:link.exitCode}:link.status==="not_linked"?(outputActionRequired(client,{status:AGENT_STATUS.ACTION_REQUIRED,reason:AGENT_REASON.NOT_LINKED,message:MISSING_BOTH_MESSAGE,hint:"Link a project or pass --scope and --project.",next:[{command:buildCommandWithGlobalFlags(client.argv,"link"),when:"link this directory to a project"}]}),output_manager_default.error(MISSING_BOTH_MESSAGE),{exitCode:1}):flags.project===void 0&&detectExplicitScope(client)&&link.org.id!==client.config.currentTeam?{exitCode:invalidArguments(client,`The linked project ${link.project.name} belongs to ${link.org.slug||link.org.id}, which is not the scope that was passed. Pass --project <name> to act on a project in that scope.`)}:{teamId:link.org.id,projectId:link.project.id}}export{resolveScope,handleTracingApiError,invalidArguments,ruleNotFound,confirmationRequired,resolveConfigScope};
|
|
@@ -1,9 +0,0 @@
|
|
|
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{emitAlertsScopeError,resolveAlertsScope}from"./chunk-VZDY57PJ.js";import{handleValidationError,validateAllProjectMutualExclusivity}from"./chunk-FA6O7FPC.js";import{isJSONObject}from"./chunk-DECIQZZQ.js";import{AGENT_REASON}from"./chunk-CVX5X5RI.js";import{getScope}from"./chunk-ALXWJ7XN.js";import{getProjectByNameOrId}from"./chunk-7IRKF3ZG.js";import{buildCommandWithGlobalFlags,outputAgentError}from"./chunk-5VWK73R6.js";import{ProjectNotFound,isAPIError}from"./chunk-RINZXCDJ.js";import{output_manager_default}from"./chunk-EWWFNMPZ.js";async function resolveRulesTeam(client,jsonOutput){let{team}=await getScope(client,{resolveLocalScope:!0});return team?{teamId:team.id}:emitAlertsScopeError(client,jsonOutput,"NO_TEAM","No team context found. Run `vercel switch` to select a team, use `--scope <team>`, or link a team project.",{reason:AGENT_REASON.MISSING_SCOPE,hint:"Alert rules belong to a team. Select the team before retrying.",next:[{command:buildCommandWithGlobalFlags(client.argv,"teams switch"),when:"Select a team"},{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"Inspect the current scope"}]})}async function resolveRulesProject(client,projectNameOrId,jsonOutput,command){let teamScope=await resolveRulesTeam(client,jsonOutput);if(typeof teamScope=="number")return teamScope;try{let project=await getProjectByNameOrId(client,projectNameOrId,teamScope.teamId);return project instanceof ProjectNotFound?emitAlertsScopeError(client,jsonOutput,"PROJECT_NOT_FOUND",`Project "${projectNameOrId}" was not found in the selected team.`,{reason:AGENT_REASON.NOT_FOUND,next:[{command:buildCommandWithGlobalFlags(client.argv,`${command} --project <name_or_id>`),when:"Retry with a valid project"}]}):{...teamScope,projectId:project.id,projectName:project.name}}catch(error){if(!isAPIError(error))throw error;return emitAlertsScopeError(client,jsonOutput,error.code||"API_ERROR",error.serverMessage||`API error (${error.status}).`,{reason:error.status===401?"not_authorized":error.status===403?"forbidden":AGENT_REASON.API_ERROR})}}async function parseRulesFlagsAndScope(client,flags,jsonOutput,command="alerts rules ls"){let mutual=validateAllProjectMutualExclusivity(flags["--all"],flags["--project"]);if(!mutual.valid)return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:mutual.message,next:[{command:buildCommandWithGlobalFlags(client.argv,"alerts rules --help"),when:"Use either `--project` or `--all`, not both"}]},1),handleValidationError(mutual,jsonOutput,client);if(flags["--all"])return resolveRulesTeam(client,jsonOutput);if(flags["--project"])return resolveRulesProject(client,flags["--project"],jsonOutput,command);let linkedScope=await resolveAlertsScope(client,{jsonOutput,command});if(typeof linkedScope=="number")return linkedScope;let teamScope=await resolveRulesTeam(client,jsonOutput);return typeof teamScope=="number"?teamScope:linkedScope.teamId===teamScope.teamId?linkedScope:teamScope}import{readFileSync}from"fs";import{resolve}from"path";function rulesCollectionPath(teamId,options={}){let query=new URLSearchParams({teamId});return options.limit!==void 0&&query.set("limit",String(options.limit)),options.cursor&&query.set("cursor",options.cursor),options.projectId&&query.set("projectId",options.projectId),options.type&&query.set("type",options.type),`/alerts/v3/alert-rules?${query.toString()}`}function rulesItemPath(teamId,ruleId){let query=new URLSearchParams({teamId});return`/alerts/v3/alert-rules/${encodeURIComponent(ruleId)}?${query.toString()}`}function ruleNotificationsPath(teamId,ruleId){let query=new URLSearchParams({teamId});return`/alerts/v3/alert-rules/${encodeURIComponent(ruleId)}/notifications?${query.toString()}`}function rulesNotificationsPath(teamId,options={}){let query=new URLSearchParams({teamId});return options.limit!==void 0&&query.set("limit",String(options.limit)),options.cursor&&query.set("cursor",options.cursor),`/alerts/v3/alert-rules/notifications?${query.toString()}`}function rulesNotificationLinksPath(teamId,ruleId){let query=new URLSearchParams({teamId});return`/alerts/v3/alert-rules/${encodeURIComponent(ruleId)}/notifications/links?${query.toString()}`}function rulesSchemaPath(teamId,type){let query=new URLSearchParams({teamId});return type&&query.set("type",type),`/alerts/v3/alert-rules/schema?${query.toString()}`}async function fetchRule(client,scope,ruleId){return(await client.fetch(rulesItemPath(scope.teamId,ruleId))).rule}function getIssues(error){return Array.isArray(error.issues)?error.issues.filter(issue=>isJSONObject(issue)&&typeof issue.path=="string"&&typeof issue.message=="string"):[]}function outputRulesError(client,jsonOutput,code,message,options={}){let issues=options.issues??[],issueSummary=issues.slice(0,5).map(issue=>`${issue.path||"body"}: ${issue.message}`).join("; ");return outputAgentError(client,{status:"error",reason:options.reason??AGENT_REASON.INVALID_ARGUMENTS,message,hint:options.hint??(issueSummary||void 0)},1),jsonOutput?client.stdout.write(`${JSON.stringify({error:{code,message,...issues.length?{issues}:{}}},null,2)}
|
|
8
|
-
`):output_manager_default.fatal([message,...issues.map(issue=>` ${issue.path}: ${issue.message}`)].join(`
|
|
9
|
-
`)),1}function handleRulesApiError(client,err,jsonOutput){let message=err.status===401?"You do not have access to alert rules in this team. Ensure your role can manage Alert Rules, or pass --token and --scope.":err.status===403?err.serverMessage||"You do not have permission to manage alert rules in this team.":err.status>=500?`The alert rules endpoint failed (${err.status}). Re-run with --debug and share the x-vercel-id from the failed request.`:err.serverMessage||`API error (${err.status}).`;return outputRulesError(client,jsonOutput,err.code||"API_ERROR",message,{reason:err.status===401?"not_authorized":err.status===403?"forbidden":err.status===404?AGENT_REASON.NOT_FOUND:err.status===429?"rate_limited":AGENT_REASON.API_ERROR,issues:getIssues(err),hint:err.status===401||err.status===403?"Confirm the team with `vercel whoami`; use --scope <team-slug> if the rule belongs to another team.":void 0})}var LEGACY_BODY_FIELDS=["alertTypes","customAlert","queryJsonString"];function readRuleBody(client,bodyPath,jsonOutput){let raw;try{raw=readFileSync(resolve(client.cwd,bodyPath),"utf8")}catch{return outputRulesError(client,jsonOutput,"INVALID_ARGUMENTS",`Could not read --body file: ${bodyPath}`)}let parsed;try{parsed=JSON.parse(raw)}catch{return outputRulesError(client,jsonOutput,"INVALID_ARGUMENTS","Invalid JSON in --body file.")}return isJSONObject(parsed)?LEGACY_BODY_FIELDS.some(field=>Object.hasOwn(parsed,field))?outputRulesError(client,jsonOutput,"LEGACY_ALERT_RULE_BODY","This body uses the previous alert-rules shape. Rewrite it using the current schema.",{hint:"Run `vercel alerts rules schema --type built-in` for examples."}):parsed:outputRulesError(client,jsonOutput,"INVALID_ARGUMENTS","The --body file must contain a JSON object.")}function getBodyType(body){return body.type==="built-in"||body.type==="custom"?body.type:void 0}function emitRulesArgParseError(client,err,recoverWithProjectFlag){let message=err instanceof Error?err.message:String(err),projectFlagMissingArg=message.includes("--project")&&message.includes("requires argument");outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:projectFlagMissingArg?"`--project` requires a project name or id (for example `--project my-app`).":message,next:[{command:buildCommandWithGlobalFlags(client.argv,projectFlagMissingArg?recoverWithProjectFlag:"alerts rules --help"),when:projectFlagMissingArg?"Retry with a project name or id":"See valid `alerts rules` subcommands"}]},1)}export{resolveRulesTeam,resolveRulesProject,parseRulesFlagsAndScope,rulesCollectionPath,rulesItemPath,ruleNotificationsPath,rulesNotificationsPath,rulesNotificationLinksPath,rulesSchemaPath,fetchRule,outputRulesError,handleRulesApiError,readRuleBody,getBodyType,emitRulesArgParseError};
|
|
@@ -1,10 +0,0 @@
|
|
|
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}from"./chunk-FA6O7FPC.js";import{require_execa}from"./chunk-HWWHR7H3.js";import{validateJsonOutput}from"./chunk-D4MW3RDW.js";import{AGENT_REASON}from"./chunk-CVX5X5RI.js";import{getScope}from"./chunk-ALXWJ7XN.js";import{require_ms}from"./chunk-QTKJC2O5.js";import{getLinkedProject,getProjectByNameOrId}from"./chunk-7IRKF3ZG.js";import{require_lib}from"./chunk-B4ATVYZW.js";import{buildCommandWithGlobalFlags,outputAgentError}from"./chunk-5VWK73R6.js";import{ProjectNotFound,isAPIError,require_bytes}from"./chunk-RINZXCDJ.js";import{packageName}from"./chunk-FI772UVH.js";import{output_manager_default}from"./chunk-EWWFNMPZ.js";import{__toESM}from"./chunk-6L236MNA.js";function emitVcrScopeError(client,jsonOutput,code,message,agent){return outputAgentError(client,{status:"error",reason:agent.reason,message,hint:agent.hint,next:agent.next},1),outputError(client,jsonOutput,code,message)}async function resolveVcrScope(client,opts){if(opts.project){let{team}=await getScope(client);if(!team){let msg="No team context found. Run `vercel switch` to select a team, or use `vercel link` in a project directory.";return emitVcrScopeError(client,opts.jsonOutput,"NO_TEAM",msg,{reason:AGENT_REASON.MISSING_SCOPE,hint:"Select a team scope before using --project with vcr.",next:[{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"See current user and team"},{command:buildCommandWithGlobalFlags(client.argv,"teams switch"),when:"Switch to a team that owns the project"}]})}let projectResult;try{projectResult=await getProjectByNameOrId(client,opts.project,team.id)}catch(err){if(isAPIError(err)){let msg=err.serverMessage||(err.status===403?`You do not have permission to access project "${opts.project}" in team "${team.slug}".`:`API error (${err.status}).`),reason=err.status===401?"not_authorized":err.status===403?"forbidden":AGENT_REASON.API_ERROR;return emitVcrScopeError(client,opts.jsonOutput,err.code||"API_ERROR",msg,{reason,next:[{command:buildCommandWithGlobalFlags(client.argv,"vcr ls --project <name_or_id>"),when:"Retry with a project you can access (replace <name_or_id>)"}]})}throw err}if(projectResult instanceof ProjectNotFound){let msg=`Project "${opts.project}" was not found in team "${team.slug}".`;return emitVcrScopeError(client,opts.jsonOutput,"PROJECT_NOT_FOUND",msg,{reason:AGENT_REASON.NOT_FOUND,next:[{command:buildCommandWithGlobalFlags(client.argv,"project ls"),when:"List projects in the current team to pick a name"}]})}return{teamId:team.id,teamSlug:team.slug,projectId:projectResult.id,projectName:projectResult.name}}let linkedProject=await getLinkedProject(client);if(linkedProject.status==="error")return linkedProject.exitCode;if(linkedProject.status==="not_linked"){let msg="No linked project found. Run `vercel link` to link a project, or pass --project <name>.";return emitVcrScopeError(client,opts.jsonOutput,"NOT_LINKED",msg,{reason:AGENT_REASON.NOT_LINKED,hint:"Agents should pass --project when no .vercel link exists in --cwd.",next:[{command:buildCommandWithGlobalFlags(client.argv,"link"),when:"Link this directory to a Vercel project"},{command:buildCommandWithGlobalFlags(client.argv,"vcr ls --project <name_or_id>"),when:"List repositories for a project without linking (replace <name_or_id>)"}]})}return{teamId:linkedProject.org.id,teamSlug:linkedProject.org.slug,projectId:linkedProject.project.id,projectName:linkedProject.project.name}}var import_ms=__toESM(require_ms(),1),import_bytes=__toESM(require_bytes(),1);function formatBytes(size){return typeof size!="number"||Number.isNaN(size)?"-":import_bytes.default.format(size,{decimalPlaces:1})??"-"}function formatRelativeTime(iso){let time=new Date(iso).getTime();return Number.isNaN(time)?"-":`${(0,import_ms.default)(Date.now()-time)} ago`}function formatDigest(digest){return digest?digest.replace(/^sha256:/,"").slice(0,12):"-"}function formatImageStatus(status){switch(status){case"ready":return"Ready";case"preparing":return"Preparing";case"unoptimized":return"Ready (unoptimized)";default:return"-"}}var VCR_REGISTRY="vcr.vercel.com";function formatImageReference(teamSlug,projectName,repositoryName,digest){return digest?`${VCR_REGISTRY}/${teamSlug}/${projectName}/${repositoryName}@${digest}`:"-"}function formatTagReference(teamSlug,projectName,repositoryName,tag){return tag?`${VCR_REGISTRY}/${teamSlug}/${projectName}/${repositoryName}:${tag}`:"-"}function validateVcrJsonOutput(client,flags){let fr=validateJsonOutput(flags);return fr.valid?{jsonOutput:fr.jsonOutput}:(outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:fr.error},1),output_manager_default.error(fr.error),1)}function validateVcrChoice(client,flag,value,choices,jsonOutput){if(value===void 0||choices.includes(value))return;let message=`Invalid value for ${flag}: "${value}". Must be one of: ${choices.join(", ")}.`;return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message},1),outputError(client,jsonOutput,"INVALID_ARGUMENTS",message)}function requireVcrRepository(client,repository,jsonOutput,usage){if(!repository)return outputAgentError(client,{status:"error",reason:AGENT_REASON.MISSING_ARGUMENTS,message:`Missing repository. Example: ${packageName} ${usage}`,next:[{command:buildCommandWithGlobalFlags(client.argv,"vcr ls"),when:"List repositories to pick a name or id"}]},1),outputError(client,jsonOutput,"MISSING_ARGUMENTS",`Usage: \`vercel ${usage}\``)}function requireVcrRepositoryAndTag(client,repository,tag,jsonOutput,usage){if(!(repository&&tag))return outputAgentError(client,{status:"error",reason:AGENT_REASON.MISSING_ARGUMENTS,message:`Missing arguments. Example: ${packageName} ${usage}`,next:[{command:buildCommandWithGlobalFlags(client.argv,"vcr tag ls <repository>"),when:"List tags to pick a tag (replace <repository>)"}]},1),outputError(client,jsonOutput,"MISSING_ARGUMENTS",`Usage: \`vercel ${usage}\``)}function requireVcrRepositoryAndImageId(client,repository,imageId,jsonOutput,usage){if(!(repository&&imageId))return outputAgentError(client,{status:"error",reason:AGENT_REASON.MISSING_ARGUMENTS,message:`Missing arguments. Example: ${packageName} ${usage}`,next:[{command:buildCommandWithGlobalFlags(client.argv,"vcr image ls <repository>"),when:"List images to pick an image id (replace <repository>)"}]},1),outputError(client,jsonOutput,"MISSING_ARGUMENTS",`Usage: \`vercel ${usage}\``)}var import_which=__toESM(require_lib(),1),import_execa=__toESM(require_execa(),1);var VCR_ENGINES=["docker","podman","buildah"],VCR_LOGIN_USERNAME="oidc";function resolveRegistry(){return process.env.VERCEL_VCR_REGISTRY||VCR_REGISTRY}function isEngineInstalled(engine){return import_which.default.sync(engine,{nothrow:!0})!==null}function splitPassthrough(argv){let idx=argv.indexOf("--");return idx===-1?{own:argv.slice(2),passthrough:[]}:{own:argv.slice(2,idx),passthrough:argv.slice(idx+1)}}async function isBuildxAvailable(){let result=await(0,import_execa.default)("docker",["buildx","version"],{reject:!1,stdio:"ignore"});return result instanceof Error?!1:result.exitCode===0}function pushCompressionArgs(engine){return engine==="docker"?[]:["--compression-format","zstd","--compression-level","3"]}var AUTH_FAILURE=/\b(?:unauthorized|denied|forbidden)\b\s*:|authentication required|access to the resource is denied|\b(?:401 unauthorized|403 forbidden)\b/i,CREDENTIAL_STORE_CONFLICT=/already exists in the keychain|errSecDuplicateItem/i;function stderrTail(stderr){return stderr.trim().split(`
|
|
8
|
-
`).slice(-5).join(`
|
|
9
|
-
`)}async function engineLogin(engine,registry,token){let result=await(0,import_execa.default)(engine,["login",registry,"--username",VCR_LOGIN_USERNAME,"--password-stdin"],{input:token,reject:!1});return result instanceof Error&&typeof result.exitCode!="number"?{exitCode:1,stderr:result.message}:{exitCode:typeof result.exitCode=="number"?result.exitCode:1,stderr:result.stderr??""}}async function engineLogout(engine,registry){await(0,import_execa.default)(engine,["logout",registry],{reject:!1,stdio:"ignore"})}async function runEngine(engine,args,opts){if(opts.captureStderr){let subprocess=(0,import_execa.default)(engine,args,{cwd:opts.cwd,stdio:["inherit","inherit","pipe"],reject:!1});subprocess.stderr?.pipe(process.stderr);let result2=await subprocess;return result2 instanceof Error&&typeof result2.exitCode!="number"?{exitCode:1,stderr:result2.message}:{exitCode:typeof result2.exitCode=="number"?result2.exitCode:1,stderr:result2.stderr??""}}let result=await(0,import_execa.default)(engine,args,{cwd:opts.cwd,stdio:"inherit",reject:!1});return result instanceof Error&&typeof result.exitCode!="number"?{exitCode:1,stderr:result.message}:{exitCode:typeof result.exitCode=="number"?result.exitCode:1,stderr:""}}var NOT_AUTHORIZED_MESSAGE="You do not have access to the container registry in this scope. Ensure your role can manage the project, or pass --token and --scope.",NOT_AUTHORIZED_HINT="Confirm team scope with whoami; use --scope <team-slug> if the repository lives under another team.",genericMessage=err=>err.serverMessage||`API error (${err.status}).`,STATUS_INFO={401:{reason:"not_authorized",message:()=>NOT_AUTHORIZED_MESSAGE,hint:NOT_AUTHORIZED_HINT,suggestWhoami:!0},403:{reason:"forbidden",message:()=>NOT_AUTHORIZED_MESSAGE,hint:NOT_AUTHORIZED_HINT,suggestWhoami:!0},404:{reason:AGENT_REASON.NOT_FOUND,message:genericMessage},409:{reason:"conflict",message:genericMessage},429:{reason:"rate_limited",message:genericMessage}};function resolveStatusInfo(err){return STATUS_INFO[err.status]?STATUS_INFO[err.status]:err.status>=500?{reason:AGENT_REASON.API_ERROR,message:()=>`The container registry endpoint failed (${err.status}). Re-run with --debug and share the x-vercel-id from the failed request.`}:{reason:AGENT_REASON.API_ERROR,message:genericMessage}}function handleVcrApiError(client,err,jsonOutput,opts={}){let info=resolveStatusInfo(err),message=info.message(err),next=[];return info.suggestWhoami&&next.push({command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"See current user and team"}),opts.retry&&next.push(opts.retry),outputAgentError(client,{status:"error",reason:info.reason,message,...info.hint?{hint:info.hint}:{},...next.length>0?{next}:{}},1),outputError(client,jsonOutput,err.code||"API_ERROR",message)}function reportEngineCommandFailure(client,engine,verb,result){let tail=stderrTail(result.stderr),message=`\`${engine} ${verb}\` failed (exit code ${result.exitCode}).${tail?`
|
|
10
|
-
${tail}`:""}`;return outputAgentError(client,{status:"error",reason:"command_failed",message},1),outputError(client,!1,"COMMAND_FAILED",message)}function reportEnginePushFailure(client,engine,verb,result){if(AUTH_FAILURE.test(result.stderr)){let message=`Push to ${resolveRegistry()} was rejected. Your registry credentials may be missing or expired.`;return outputAgentError(client,{status:"error",reason:"not_authorized",message,next:[{command:buildCommandWithGlobalFlags(client.argv,`vcr login ${engine}`),when:"Refresh registry credentials (valid ~12 hours)"}]},1),outputError(client,!1,"NOT_AUTHORIZED",message)}return reportEngineCommandFailure(client,engine,verb,result)}function emitVcrArgParseError(client,err,recoverTemplate){let msg=err instanceof Error?err.message:String(err),projectFlagMissingArg=msg.includes("--project")&&msg.includes("requires argument");outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:projectFlagMissingArg?"`--project` requires a project name or id (for example `--project my-app`).":msg,next:[{command:buildCommandWithGlobalFlags(client.argv,recoverTemplate),when:projectFlagMissingArg?"Re-run with a project name or id (replace placeholder)":"See valid usage"}]},1)}export{resolveVcrScope,formatBytes,formatRelativeTime,formatDigest,formatImageStatus,formatImageReference,formatTagReference,validateVcrJsonOutput,validateVcrChoice,requireVcrRepository,requireVcrRepositoryAndTag,requireVcrRepositoryAndImageId,VCR_ENGINES,VCR_LOGIN_USERNAME,resolveRegistry,isEngineInstalled,splitPassthrough,isBuildxAvailable,pushCompressionArgs,AUTH_FAILURE,CREDENTIAL_STORE_CONFLICT,stderrTail,engineLogin,engineLogout,runEngine,handleVcrApiError,reportEngineCommandFailure,reportEnginePushFailure,emitVcrArgParseError};
|
|
@@ -1,7 +0,0 @@
|
|
|
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}from"./chunk-FA6O7FPC.js";import{AGENT_REASON}from"./chunk-CVX5X5RI.js";import{getScope}from"./chunk-ALXWJ7XN.js";import{getLinkedProject,getProjectByNameOrId}from"./chunk-7IRKF3ZG.js";import{buildCommandWithGlobalFlags,outputAgentError}from"./chunk-5VWK73R6.js";import{ProjectNotFound,isAPIError}from"./chunk-RINZXCDJ.js";function emitAlertsScopeError(client,jsonOutput,code,message,agent){return outputAgentError(client,{status:"error",reason:agent.reason,message,hint:agent.hint,next:agent.next},1),outputError(client,jsonOutput,code,message)}async function resolveAlertsScope(client,opts){let command=opts.command??"alerts",projectCommand=`${command} --project <name_or_id>`,allCommand=`${command} --all`;if(opts.all||opts.project){let{team}=await getScope(client);if(!team){let msg="No team context found. Run `vercel switch` to select a team, or use `vercel link` in a project directory.";return emitAlertsScopeError(client,opts.jsonOutput,"NO_TEAM",msg,{reason:AGENT_REASON.MISSING_SCOPE,hint:"Select a team scope before using --project or --all with alerts.",next:[{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"See current user and team"},{command:buildCommandWithGlobalFlags(client.argv,"teams switch"),when:"Switch to a team that owns the project"}]})}if(opts.all)return{teamId:team.id};let projectResult;try{projectResult=await getProjectByNameOrId(client,opts.project,team.id)}catch(err){if(isAPIError(err)){let msg=err.serverMessage||(err.status===403?`You do not have permission to access project "${opts.project}" in team "${team.slug}".`:`API error (${err.status}).`),reason=err.status===401?"not_authorized":err.status===403?"forbidden":AGENT_REASON.API_ERROR;return emitAlertsScopeError(client,opts.jsonOutput,err.code||"API_ERROR",msg,{reason,next:[{command:buildCommandWithGlobalFlags(client.argv,projectCommand),when:"Retry with a project you can access (replace <name_or_id>)"}]})}throw err}if(projectResult instanceof ProjectNotFound){let msg=`Project "${opts.project}" was not found in team "${team.slug}".`;return emitAlertsScopeError(client,opts.jsonOutput,"PROJECT_NOT_FOUND",msg,{reason:AGENT_REASON.NOT_FOUND,next:[{command:buildCommandWithGlobalFlags(client.argv,projectCommand),when:"Retry with a valid project (replace <name_or_id>)"}]})}return{teamId:team.id,projectId:projectResult.id,projectName:projectResult.name}}let linkedProject=await getLinkedProject(client);if(linkedProject.status==="error")return linkedProject.exitCode;if(linkedProject.status==="not_linked"){let msg="No linked project found. Run `vercel link` to link a project, or use --project <name> or --all.";return emitAlertsScopeError(client,opts.jsonOutput,"NOT_LINKED",msg,{reason:AGENT_REASON.NOT_LINKED,hint:"Agents should pass --project or --all when no .vercel link exists in --cwd.",next:[{command:buildCommandWithGlobalFlags(client.argv,"link"),when:"Link this directory to a Vercel project"},{command:buildCommandWithGlobalFlags(client.argv,projectCommand),when:"Retry with an explicit project (replace <name_or_id>)"},{command:buildCommandWithGlobalFlags(client.argv,allCommand),when:"Use team-wide scope without a linked project"}]})}return{teamId:linkedProject.org.id,projectId:linkedProject.project.id,projectName:linkedProject.project.name}}export{emitAlertsScopeError,resolveAlertsScope};
|