vercel 59.23.2 → 59.24.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-7Y2KUKBS.js +8 -0
- package/dist/chunks/{add-Z3CJT63N.js → add-AH7CCGI4.js} +1 -1
- package/dist/chunks/add-PZQFNEK6.js +8 -0
- package/dist/chunks/build-J2L7FBF6.js +7 -0
- package/dist/chunks/{chunk-6LE44WCK.js → chunk-5H3QCVK5.js} +1 -1
- package/dist/chunks/{chunk-GRDPI246.js → chunk-66KGIWDY.js} +1 -1
- package/dist/chunks/{chunk-UXCTETFN.js → chunk-6NPXWN5F.js} +1 -1
- package/dist/chunks/{chunk-UWZ5VIIQ.js → chunk-6QNPNUTJ.js} +1 -1
- package/dist/chunks/{chunk-UUM2N6IG.js → chunk-7DNHVDK2.js} +1 -1
- package/dist/chunks/{chunk-JGPECEYY.js → chunk-7S6R3LL4.js} +1 -1
- package/dist/chunks/{chunk-WDVSYGZS.js → chunk-B6RDQTJF.js} +1 -1
- package/dist/chunks/{chunk-6C7LA5RA.js → chunk-BG25VOLN.js} +1 -1
- package/dist/chunks/{chunk-TOGR3HUB.js → chunk-BK7VICZ5.js} +1 -1
- package/dist/chunks/{chunk-GHULCYAR.js → chunk-C5KVTG2O.js} +1 -1
- package/dist/chunks/{chunk-QI3JSWD6.js → chunk-DBABUG2N.js} +1 -1
- package/dist/chunks/{chunk-HOYHUMBD.js → chunk-DPTTW6AM.js} +1 -1
- package/dist/chunks/{chunk-T4AZ3U7O.js → chunk-EUJWN3RB.js} +1 -1
- package/dist/chunks/{chunk-E4X2DH4K.js → chunk-F4PQSGJG.js} +1 -1
- package/dist/chunks/{chunk-2HEC5TDU.js → chunk-FXYCV7SI.js} +1 -1
- package/dist/chunks/{chunk-ZKWM4JBE.js → chunk-HW4QHETG.js} +1 -1
- package/dist/chunks/{chunk-VIR3KDCQ.js → chunk-I46LFJJG.js} +1 -1
- package/dist/chunks/{chunk-SOQ5DE44.js → chunk-J7DOWLLD.js} +1 -1
- package/dist/chunks/{chunk-4YVA7TSY.js → chunk-JPIB7NB6.js} +1 -1
- package/dist/chunks/{chunk-32QBGZ2Z.js → chunk-K2MXVUWY.js} +1 -1
- package/dist/chunks/{chunk-PS645CWM.js → chunk-KE3S2RRY.js} +1 -1
- package/dist/chunks/{chunk-2SLHYWMC.js → chunk-KF62ZVXT.js} +1 -1
- package/dist/chunks/{chunk-TJKM3345.js → chunk-KJ6MUEGB.js} +1 -1
- package/dist/chunks/{chunk-GR3DLKYP.js → chunk-LAKQ6JG3.js} +1 -1
- package/dist/chunks/{chunk-X4X5RB2V.js → chunk-LL2XUFCY.js} +1 -1
- package/dist/chunks/{chunk-ABSRS5KC.js → chunk-LN7DRS3D.js} +1 -1
- package/dist/chunks/chunk-MHDVUE2Q.js +7 -0
- package/dist/chunks/{chunk-RRQTVE2P.js → chunk-MKY5IBKK.js} +1 -1
- package/dist/chunks/{chunk-GGNZLN4R.js → chunk-MQO32DYF.js} +1 -1
- package/dist/chunks/{chunk-GL2AUBAI.js → chunk-MV6LWP5R.js} +1 -1
- package/dist/chunks/{chunk-64NJHVA3.js → chunk-NOYJJRDK.js} +4 -4
- package/dist/chunks/{chunk-M6A7UH4U.js → chunk-NWL3VI5O.js} +2 -2
- package/dist/chunks/{chunk-UGXNE4YE.js → chunk-OI5JAHZK.js} +1 -1
- package/dist/chunks/{chunk-Z6LKARXP.js → chunk-P5EKTDOS.js} +1 -1
- package/dist/chunks/chunk-P7GPJFZ7.js +22 -0
- package/dist/chunks/chunk-PGF7MQK6.js +9 -0
- package/dist/chunks/{chunk-DL665Q3Z.js → chunk-QHKY2XXG.js} +1 -1
- package/dist/chunks/{chunk-Z7PBDQNR.js → chunk-QRBAWXHP.js} +5 -5
- package/dist/chunks/{chunk-73G2MHUX.js → chunk-QYFRPNL2.js} +1 -1
- package/dist/chunks/chunk-RINZXCDJ.js +19 -0
- package/dist/chunks/{chunk-FZH7RIRX.js → chunk-RSHNACJX.js} +2 -2
- package/dist/chunks/{chunk-NZKBBY2A.js → chunk-RYVVD7GM.js} +1 -1
- package/dist/chunks/{chunk-EHTHHCNG.js → chunk-RYZ5FAUA.js} +1 -0
- package/dist/chunks/{chunk-6SA6SOHU.js → chunk-SKAUCH5L.js} +1 -1
- package/dist/chunks/{chunk-V5DCSHYJ.js → chunk-SM5JI6QM.js} +1 -1
- package/dist/chunks/chunk-SQXB2UM4.js +10 -0
- package/dist/chunks/{chunk-66RYR2GI.js → chunk-SURYRPWO.js} +1 -1
- package/dist/chunks/{chunk-EQP3SW72.js → chunk-T4LZS75P.js} +1 -1
- package/dist/chunks/{chunk-ZDORSGCG.js → chunk-U2EJBAGE.js} +1 -1
- package/dist/chunks/{chunk-SFTXBTMI.js → chunk-U7RBKXKN.js} +1 -1
- package/dist/chunks/{chunk-NYOQMU3P.js → chunk-V3YAU6ES.js} +3 -3
- package/dist/chunks/{chunk-KXYR43H5.js → chunk-V62NLRIZ.js} +1 -1
- package/dist/chunks/{chunk-J5X5YRBH.js → chunk-VXPEFLJ6.js} +1 -1
- package/dist/chunks/{chunk-KBKN7EI7.js → chunk-WTMSMKT5.js} +1 -1
- package/dist/chunks/{chunk-7B5NNJ2P.js → chunk-WVXO435I.js} +1 -1
- package/dist/chunks/{chunk-YGJO25LP.js → chunk-X3KGMGDA.js} +1 -1
- package/dist/chunks/{chunk-4WSAOLBH.js → chunk-XQQGQ55A.js} +1 -1
- package/dist/chunks/{chunk-FB5TMOLQ.js → chunk-XU5QGRSL.js} +1 -1
- package/dist/chunks/{chunk-GTJ2OLYI.js → chunk-YOQFHAWX.js} +1 -1
- package/dist/chunks/clear-K7ORVDOX.js +8 -0
- package/dist/chunks/{compile-vercel-config-ZFMPTU47.js → compile-vercel-config-JNODRT2C.js} +1 -1
- package/dist/chunks/{config-HLVJQKP7.js → config-JTA2VZHH.js} +1 -1
- package/dist/chunks/config-RWVPD75M.js +8 -0
- package/dist/chunks/{connect-git-provider-P3SGOW6X.js → connect-git-provider-VYU65KTS.js} +1 -1
- package/dist/chunks/delete-2TO7EK2C.js +10 -0
- package/dist/chunks/delete-KB2GQRD2.js +9 -0
- package/dist/chunks/{detect-projects-WLAFT5HC.js → detect-projects-BTDKBOU4.js} +1 -1
- package/dist/chunks/{detect-services-YYT3LUUX.js → detect-services-S4EMRGXM.js} +1 -1
- package/dist/chunks/disable-OECXCINH.js +7 -0
- package/dist/chunks/discard-TQ2BYSPA.js +14 -0
- package/dist/chunks/edit-GJY2Q7DK.js +8 -0
- package/dist/chunks/edit-OARSMUGS.js +9 -0
- package/dist/chunks/enable-CHWCHWYK.js +7 -0
- package/dist/chunks/{export-QCBAQNTT.js → export-ZKRSU23G.js} +1 -1
- package/dist/chunks/future-7RNP7ZP6.js +7 -0
- package/dist/chunks/{generate-cert-for-deploy-U7JF3HF3.js → generate-cert-for-deploy-SNWO4UCL.js} +1 -1
- package/dist/chunks/image-XJJMFNS3.js +7 -0
- package/dist/chunks/{import-builders-IFZM44NL.js → import-builders-BJTHQZFZ.js} +1 -1
- package/dist/chunks/{inspect-CPOFKE4X.js → inspect-GUUFDCF6.js} +1 -1
- package/dist/chunks/inspect-KL6E4NYB.js +13 -0
- package/dist/chunks/{inspect-EMWJLBAW.js → inspect-OFHABZ6D.js} +1 -1
- package/dist/chunks/inspect-PAQAACPV.js +9 -0
- package/dist/chunks/{inspect-IVJOEZC4.js → inspect-SZ4HH7QY.js} +1 -1
- package/dist/chunks/{list-ZE2VPPXI.js → list-O5E5ZYAN.js} +1 -1
- package/dist/chunks/list-R3UBCTNJ.js +11 -0
- package/dist/chunks/{list-KYZNCXBM.js → list-W2TEW25J.js} +1 -1
- package/dist/chunks/{login-RMAISH4F.js → login-FA3ZCLNA.js} +1 -1
- package/dist/chunks/login-NN7X6ATG.js +9 -0
- package/dist/chunks/{logs-3LTU2N25.js → logs-XXEVORNG.js} +1 -1
- package/dist/chunks/{ls-HWUYP3XY.js → ls-6DBJ4O2U.js} +1 -1
- package/dist/chunks/{ls-DU5QTKKA.js → ls-GNZ5XC5V.js} +1 -1
- package/dist/chunks/{ls-Y4QR3I6O.js → ls-I7TEWFFI.js} +1 -1
- package/dist/chunks/{ls-4M2OBNG6.js → ls-OC2YVP7U.js} +1 -1
- package/dist/chunks/{ls-P6LKMT33.js → ls-Q6TGKOW6.js} +1 -1
- package/dist/chunks/{ls-AKGRKWHM.js → ls-WTAMOBVG.js} +1 -1
- package/dist/chunks/{ls-7O63WIES.js → ls-X53N2CIG.js} +1 -1
- package/dist/chunks/{mutate-KOAALPIL.js → mutate-TYDZXN6D.js} +1 -1
- package/dist/chunks/notifications-ISH6L4LN.js +7 -0
- package/dist/chunks/open-NP6JK7D3.js +7 -0
- package/dist/chunks/{openapi-DKMCRF2V.js → openapi-QJEB6PRW.js} +1 -1
- package/dist/chunks/permissions-CDHSBRVG.js +7 -0
- package/dist/chunks/{prompt-missing-credentials-QY4MZDT6.js → prompt-missing-credentials-FX2H3SHO.js} +1 -1
- package/dist/chunks/{publish-YXVJXBQT.js → publish-JZHSWOHM.js} +1 -1
- package/dist/chunks/pull-MCOEV5HI.js +7 -0
- package/dist/chunks/{purchase-domain-if-available-74ZYVVBE.js → purchase-domain-if-available-G7SE7C2F.js} +1 -1
- package/dist/chunks/push-XSQNASL2.js +7 -0
- package/dist/chunks/{query-PHAGR43V.js → query-3GCRJN4Q.js} +1 -1
- package/dist/chunks/reauthenticate-QYJGKCGV.js +7 -0
- package/dist/chunks/reorder-DHP3CTN2.js +10 -0
- package/dist/chunks/reply-WKPVJAWP.js +9 -0
- package/dist/chunks/resolve-QF5SMBPD.js +12 -0
- package/dist/chunks/{restore-MO4B2EQV.js → restore-A5UQIGNA.js} +1 -1
- package/dist/chunks/{rm-SZ4HWA4R.js → rm-FIZ56DQC.js} +1 -1
- package/dist/chunks/{rm-GMG2DZOV.js → rm-L5KYP6JP.js} +1 -1
- package/dist/chunks/rm-MRIJKX4E.js +8 -0
- package/dist/chunks/rm-VQ2ESDWM.js +8 -0
- package/dist/chunks/rm-WEOLZ2OC.js +8 -0
- package/dist/chunks/routes-IPGKJ2E4.js +1 -1
- package/dist/chunks/{rule-inspect-JKAXOBII.js → rule-inspect-WY667VBH.js} +1 -1
- package/dist/chunks/rules-7PJ5PHRB.js +7 -0
- package/dist/chunks/{schema-5CZLK6NI.js → schema-HCHBRZFG.js} +1 -1
- package/dist/chunks/{schema-S2ZAREKF.js → schema-KWNBTTXA.js} +1 -1
- package/dist/chunks/select-org-JEXIDHLI.js +7 -0
- package/dist/chunks/{set-PIKLGKT6.js → set-BRG2L4NA.js} +1 -1
- package/dist/chunks/setup-and-link-R6IRKMYF.js +7 -0
- package/dist/chunks/tags-Y5KMBUYT.js +7 -0
- package/dist/chunks/{types-H3B56MH6.js → types-L37GS4JI.js} +1 -1
- package/dist/chunks/{update-5HE4X45O.js → update-GITCTREW.js} +1 -1
- package/dist/commands/build/index.js +1 -1
- package/dist/commands/deploy/index.js +4 -4
- package/dist/commands/dev/index.js +2 -2
- package/dist/commands/env/index.js +1 -1
- package/dist/commands/link/index.js +1 -1
- package/dist/commands/list/index.js +1 -1
- package/dist/commands-bulk.js +97 -89
- package/dist/help.js +1 -1
- package/dist/index.js +2 -2
- package/dist/version.mjs +1 -1
- package/package.json +20 -20
- package/dist/chunks/add-JVSHQKWC.js +0 -8
- package/dist/chunks/add-UKFIETLE.js +0 -8
- package/dist/chunks/build-SMQYQX23.js +0 -7
- package/dist/chunks/chunk-5YA32S6K.js +0 -7
- package/dist/chunks/chunk-BX5KDMLT.js +0 -10
- package/dist/chunks/chunk-LKI6FRNM.js +0 -19
- package/dist/chunks/chunk-TBBU37TD.js +0 -9
- package/dist/chunks/chunk-WHYH7DVI.js +0 -20
- package/dist/chunks/clear-6IXTTZO6.js +0 -8
- package/dist/chunks/config-XXHMPW46.js +0 -8
- package/dist/chunks/delete-52QKO73X.js +0 -10
- package/dist/chunks/delete-6VOUZDIR.js +0 -9
- package/dist/chunks/disable-7FGR2S56.js +0 -7
- package/dist/chunks/discard-XKPTY3DC.js +0 -14
- package/dist/chunks/edit-A3HJCNPW.js +0 -8
- package/dist/chunks/edit-A7WGTO6K.js +0 -9
- package/dist/chunks/enable-NGKLGHJ2.js +0 -7
- package/dist/chunks/future-BB7OE645.js +0 -7
- package/dist/chunks/image-DU7GJZR2.js +0 -7
- package/dist/chunks/inspect-PHUMEO4A.js +0 -9
- package/dist/chunks/inspect-Q7OVSWFO.js +0 -13
- package/dist/chunks/list-G4JM2TYX.js +0 -11
- package/dist/chunks/login-AVVJFLSC.js +0 -9
- package/dist/chunks/notifications-3RDFNJSD.js +0 -7
- package/dist/chunks/open-VD4F6MAO.js +0 -7
- package/dist/chunks/permissions-AE5JO26V.js +0 -7
- package/dist/chunks/pull-QLC2CV4J.js +0 -7
- package/dist/chunks/push-TMPPU5NU.js +0 -7
- package/dist/chunks/reauthenticate-O6C2AW3J.js +0 -7
- package/dist/chunks/reorder-OAJ3NXQQ.js +0 -10
- package/dist/chunks/reply-Q3JFRFA3.js +0 -9
- package/dist/chunks/resolve-XXJVOXNE.js +0 -12
- package/dist/chunks/rm-63LFH6NA.js +0 -8
- package/dist/chunks/rm-F2XD2XKB.js +0 -8
- package/dist/chunks/rm-P6KA5RSP.js +0 -8
- package/dist/chunks/rules-6TZ6GSKT.js +0 -7
- package/dist/chunks/select-org-F2A5JJFH.js +0 -7
- package/dist/chunks/setup-and-link-O5QSQ5K2.js +0 -7
- package/dist/chunks/tags-C3HWJLJ4.js +0 -7
|
@@ -4,7 +4,7 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{Separator}from"./chunk-M2W3HKV3.js";import{require_strip_ansi}from"./chunk-OSCCYU74.js";import{isAPIError}from"./chunk-
|
|
7
|
+
import{Separator}from"./chunk-M2W3HKV3.js";import{require_strip_ansi}from"./chunk-OSCCYU74.js";import{isAPIError}from"./chunk-RINZXCDJ.js";import{eraseLines,link_default,output_manager_default}from"./chunk-EWWFNMPZ.js";import{require_source}from"./chunk-U7KCDTCH.js";import{__toESM}from"./chunk-6L236MNA.js";var import_chalk=__toESM(require_source(),1);import{URL}from"url";var import_strip_ansi=__toESM(require_strip_ansi(),1);function getLength(input){let biggestLength=0;for(let line of input.split(`
|
|
8
8
|
`)){let str=(0,import_strip_ansi.default)(line);str.length>biggestLength&&(biggestLength=str.length)}return biggestLength}async function list(client,{message="the question",choices:_choices=[{name:`something
|
|
9
9
|
description
|
|
10
10
|
details
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{require_dist,require_dist2}from"./chunk-Z7PBDQNR.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}}}},schedulesSchema={type:"array",minItems:0,maxItems:100,items:{type:"object",additionalProperties:!1,required:["expression","target","name"],properties:{expression:{type:"object",additionalProperties:!1,required:["cron"],properties:{cron:{type:"string"},jitter:{type:"integer",minimum:1,maximum:15}}},target:{oneOf:[{type:"object",additionalProperties:!1,required:["function"],properties:{function:{type:"string",minLength:1}}},{type:"object",additionalProperties:!1,required:["topic"],properties:{topic:{type:"string",minLength:1,maxLength:256}}}]},name:{type:"string",minLength:1,maxLength:256},timezone:{type:"string",minLength:1,maxLength:50,description:"IANA timezone for cron evaluation. Defaults to UTC."},payload:{}}}},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}}),getServicesSchema=()=>({type:"object",propertyNames:{pattern:servicesServiceNamePattern,maxLength:64},additionalProperties:getServicesServiceConfigSchema()}),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()}}}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}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.`})}for(let[pattern,fn]of Object.entries(config.functions??{}))if(fn.affinity!==void 0)return new import_build_utils.NowBuildError({code:"FUNCTION_AFFINITY_REQUIRES_SERVICE",message:`Function affinity can only be configured under a service. Move functions[${JSON.stringify(pattern)}].affinity into the relevant service's functions configuration.`,link:"https://vercel.com/docs/concepts/projects/project-configuration#functions"});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(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}export{require_dist3 as require_dist,validateConfig};
|
|
7
|
+
import{require_dist,require_dist2}from"./chunk-QRBAWXHP.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}}}},schedulesSchema={type:"array",minItems:0,maxItems:100,items:{type:"object",additionalProperties:!1,required:["expression","target","name"],properties:{expression:{type:"object",additionalProperties:!1,required:["cron"],properties:{cron:{type:"string"},jitter:{type:"integer",minimum:1,maximum:15}}},target:{oneOf:[{type:"object",additionalProperties:!1,required:["function"],properties:{function:{type:"string",minLength:1}}},{type:"object",additionalProperties:!1,required:["topic"],properties:{topic:{type:"string",minLength:1,maxLength:256}}}]},name:{type:"string",minLength:1,maxLength:256},timezone:{type:"string",minLength:1,maxLength:50,description:"IANA timezone for cron evaluation. Defaults to UTC."},payload:{}}}},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}}),getServicesSchema=()=>({type:"object",propertyNames:{pattern:servicesServiceNamePattern,maxLength:64},additionalProperties:getServicesServiceConfigSchema()}),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()}}}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}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.`})}for(let[pattern,fn]of Object.entries(config.functions??{}))if(fn.affinity!==void 0)return new import_build_utils.NowBuildError({code:"FUNCTION_AFFINITY_REQUIRES_SERVICE",message:`Function affinity can only be configured under a service. Move functions[${JSON.stringify(pattern)}].affinity into the relevant service's functions configuration.`,link:"https://vercel.com/docs/concepts/projects/project-configuration#functions"});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(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}export{require_dist3 as require_dist,validateConfig};
|
|
@@ -4,7 +4,7 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{agentErrorMetadata,buildCommandWithGlobalFlags,getErrorRecovery,observabilityPlusRecovery,trackAgentError}from"./chunk-
|
|
7
|
+
import{agentErrorMetadata,buildCommandWithGlobalFlags,getErrorRecovery,observabilityPlusRecovery,trackAgentError}from"./chunk-SQXB2UM4.js";import{isAPIError}from"./chunk-RINZXCDJ.js";import{output_manager_default}from"./chunk-EWWFNMPZ.js";function getRollupColumnName(metric,aggregation){return`${metric}_${aggregation}`.replace(/[./]/g,"_")}function getResolvedOrderMetadata(query,response){let orderBy=query.orderBy??(response.orderBy?"count":void 0),orderDirection=response.orderDirection??query.orderDirection;return{...orderBy?{orderBy}:{},...orderDirection?{orderDirection}:{}}}function formatQueryJson(query,response){let orderMetadata=getResolvedOrderMetadata(query,response),queryWithResponseMetadata={...query,...orderMetadata};return JSON.stringify({query:queryWithResponseMetadata,summary:response.summary??[],data:response.data??[],...orderMetadata},null,2)}function formatErrorJson(code,message,allowedValues,recovery={}){let error={code,message};return allowedValues&&allowedValues.length>0&&(error.allowedValues=allowedValues),JSON.stringify({error:{...error,...recovery}},null,2)}function handleApiError(err,jsonOutput,client,overrides={}){let code,message,override=overrides[err.status];if(override)code=override.code||err.code||"BAD_REQUEST",message=override.message;else switch(err.status){case 402:code=err.code||"PAYMENT_REQUIRED",message=err.serverMessage||"This feature requires an Observability Plus subscription.";break;case 429:code=err.code||"RATE_LIMITED",message=err.serverMessage||"You have reached the metrics query rate limit. Please wait and try again. If you need a higher limit, request one from your Vercel account team.";break;case 403:code="FORBIDDEN",message=err.serverMessage&&err.serverMessage!=="Response Error"?err.serverMessage:"You do not have permission to query metrics for this project/team.";break;case 500:code="INTERNAL_ERROR",message="An internal error occurred. Please try again later.";break;case 504:code="TIMEOUT",message="The query timed out. Try a shorter time range or fewer groups.";break;case 400:code=err.code||"BAD_REQUEST",message=err.serverMessage||`API error (${err.status})`;break;default:code=err.code||"BAD_REQUEST",message=err.serverMessage||`API error (${err.status})`}let recovery=getErrorRecovery({...err,serverMessage:message},client),billing=err.status===402?observabilityPlusRecovery(message):void 0,next=billing?.command?[{command:buildCommandWithGlobalFlags(client.argv.filter(arg=>!/^(?:--yes|--force|-y)(?:=|$)/.test(arg)),billing.command),when:billing.when}]:void 0,details={...recovery,...next&&{next},...agentErrorMetadata(client)};if(trackAgentError(client,{reason:err.status===403?"forbidden":err.status===402?"payment_required":err.status===429?"rate_limited":code,...recovery}),jsonOutput||client.nonInteractive)client.stdout.write(formatErrorJson(code,message,err.allowedValues,details));else{output_manager_default.fatal(message),recovery.hint&&output_manager_default.print(` ${recovery.hint}
|
|
8
8
|
`);for(let step of next??[])output_manager_default.print(` ${step.command}
|
|
9
9
|
`);err.allowedValues&&err.allowedValues.length>0&&output_manager_default.print(`
|
|
10
10
|
Available values: ${err.allowedValues.join(", ")}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{repositoryPermissionsClearPath}from"./chunk-DFVNL5ML.js";import{emitVcrArgParseError,handleVcrApiError,requireVcrRepository,resolveVcrScope,validateVcrJsonOutput}from"./chunk-MV6LWP5R.js";import"./chunk-FA6O7FPC.js";import"./chunk-D4MW3RDW.js";import{permissionsClearSubcommand}from"./chunk-YMVDWVMO.js";import"./chunk-HWWHR7H3.js";import"./chunk-2I64AYHG.js";import"./chunk-QTKJC2O5.js";import{AGENT_REASON}from"./chunk-T4LZS75P.js";import"./chunk-SOJCELXH.js";import"./chunk-K2MXVUWY.js";import"./chunk-5XJNPXQK.js";import{printError}from"./chunk-PGF7MQK6.js";import{parseArguments}from"./chunk-EUJWN3RB.js";import"./chunk-MY4MONOH.js";import"./chunk-NOYJJRDK.js";import"./chunk-F2ZWW2IO.js";import"./chunk-B4ATVYZW.js";import"./chunk-PPCFQQSU.js";import{buildCommandWithYes,outputAgentError}from"./chunk-SQXB2UM4.js";import{getFlagsSpecification}from"./chunk-JAJW3P42.js";import"./chunk-YMM3VY3J.js";import"./chunk-SM5JI6QM.js";import"./chunk-VOZEB6PD.js";import{isAPIError}from"./chunk-RINZXCDJ.js";import"./chunk-FI772UVH.js";import{output_manager_default}from"./chunk-EWWFNMPZ.js";import"./chunk-QGIQK47P.js";import"./chunk-AVSPFBLM.js";import"./chunk-XCJDGQO7.js";import"./chunk-YPTLSODC.js";import"./chunk-7HL2RPUO.js";import"./chunk-U7KCDTCH.js";import"./chunk-N3ZZ7FHQ.js";import"./chunk-GU6VIFR5.js";import"./chunk-6L236MNA.js";async function clear(client,argv,telemetry){let parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(permissionsClearSubcommand.options))}catch(err){return emitVcrArgParseError(client,err,"vcr permissions <repository> clear"),printError(err),1}let fr=validateVcrJsonOutput(client,parsedArgs.flags);if(typeof fr=="number")return fr;let repository=parsedArgs.args[0],project=parsedArgs.flags["--project"],skipConfirmation=!!parsedArgs.flags["--yes"];telemetry.trackCliOptionProject(project),telemetry.trackCliFlagYes(parsedArgs.flags["--yes"]),telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]);let missingRepository=requireVcrRepository(client,repository,fr.jsonOutput,"vcr permissions <repository> clear");if(typeof missingRepository=="number")return missingRepository;let scope=await resolveVcrScope(client,{project,jsonOutput:fr.jsonOutput});if(typeof scope=="number")return scope;if(!skipConfirmation&&(outputAgentError(client,{status:"error",reason:AGENT_REASON.CONFIRMATION_REQUIRED,message:"Clearing repository permissions removes access for every team. Re-run with --yes.",next:[{command:buildCommandWithYes(client.argv)}]},1),!await client.input.confirm(`Remove access to ${repository} for all teams? They will no longer be able to pull its images.`,!1)))return output_manager_default.log("Canceled"),0;let path=repositoryPermissionsClearPath(scope,repository);output_manager_default.spinner("Clearing repository permissions...");try{return await client.fetch(path,{method:"DELETE"}),fr.jsonOutput?client.stdout.write(`${JSON.stringify({repository,cleared:!0},null,2)}
|
|
8
|
+
`):output_manager_default.success(`Cleared repository permissions for ${repository}`),0}catch(err){if(isAPIError(err))return handleVcrApiError(client,err,fr.jsonOutput);throw err}finally{output_manager_default.stopSpinner()}}export{clear as default};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{compileVercelConfig,findSourceVercelConfigFile,getVercelConfigPath,normalizeConfig}from"./chunk-
|
|
7
|
+
import{compileVercelConfig,findSourceVercelConfigFile,getVercelConfigPath,normalizeConfig}from"./chunk-QYFRPNL2.js";import{DEFAULT_VERCEL_CONFIG_FILENAME,VERCEL_CONFIG_EXTENSIONS}from"./chunk-QR7QPUFN.js";import"./chunk-NOYJJRDK.js";import"./chunk-F2ZWW2IO.js";import"./chunk-B4ATVYZW.js";import"./chunk-PPCFQQSU.js";import"./chunk-YMM3VY3J.js";import"./chunk-SM5JI6QM.js";import"./chunk-VOZEB6PD.js";import"./chunk-RINZXCDJ.js";import"./chunk-FI772UVH.js";import"./chunk-EWWFNMPZ.js";import"./chunk-QGIQK47P.js";import"./chunk-AVSPFBLM.js";import"./chunk-XCJDGQO7.js";import"./chunk-YPTLSODC.js";import"./chunk-7HL2RPUO.js";import"./chunk-U7KCDTCH.js";import"./chunk-N3ZZ7FHQ.js";import"./chunk-GU6VIFR5.js";import"./chunk-6L236MNA.js";export{DEFAULT_VERCEL_CONFIG_FILENAME,VERCEL_CONFIG_EXTENSIONS,compileVercelConfig,findSourceVercelConfigFile,getVercelConfigPath,normalizeConfig};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{getSubcommand}from"./chunk-ETV3C2CV.js";import{getCommandAliases}from"./chunk-
|
|
7
|
+
import{getSubcommand}from"./chunk-ETV3C2CV.js";import{getCommandAliases}from"./chunk-LN7DRS3D.js";import{tracesCommand}from"./chunk-M5AV545M.js";import"./chunk-65JYSI26.js";import"./chunk-YMVDWVMO.js";import"./chunk-O7G3CZ42.js";import"./chunk-N3N5UHIL.js";import{lsSubcommand,rmSubcommand,setSubcommand,tracesConfigCommand}from"./chunk-IVWPQYIH.js";import"./chunk-WUZD4KBL.js";import"./chunk-3QHJYVCY.js";import"./chunk-NBVY237X.js";import"./chunk-MEAY2K5Z.js";import"./chunk-EQ52F4LH.js";import"./chunk-EIXOJUNN.js";import"./chunk-OAKO6LVS.js";import"./chunk-CVKB54WW.js";import"./chunk-JKTQV2QJ.js";import"./chunk-AZ6NRDHG.js";import"./chunk-FAW6NBLQ.js";import"./chunk-ZKYS7EAB.js";import"./chunk-6LE3FU2P.js";import"./chunk-KUVMCIR4.js";import{help}from"./chunk-V6IKQCOT.js";import"./chunk-6TAQ6OWD.js";import"./chunk-WPS6JZF6.js";import{TelemetryClient}from"./chunk-A5VLP25I.js";import"./chunk-RCTYVKM5.js";import"./chunk-7T6TL3GQ.js";import"./chunk-F2ZWW2IO.js";import"./chunk-BRK4OB4B.js";import"./chunk-OSCCYU74.js";import"./chunk-JAJW3P42.js";import"./chunk-FI772UVH.js";import{output_manager_default}from"./chunk-EWWFNMPZ.js";import"./chunk-QGIQK47P.js";import"./chunk-AVSPFBLM.js";import"./chunk-XCJDGQO7.js";import"./chunk-YPTLSODC.js";import"./chunk-7HL2RPUO.js";import"./chunk-U7KCDTCH.js";import"./chunk-N3ZZ7FHQ.js";import"./chunk-GU6VIFR5.js";import"./chunk-6L236MNA.js";var TracesConfigTelemetryClient=class extends TelemetryClient{trackCliSubcommandLs(actual){this.trackCliSubcommand({subcommand:"ls",value:actual})}trackCliSubcommandSet(actual){this.trackCliSubcommand({subcommand:"set",value:actual})}trackCliSubcommandRm(actual){this.trackCliSubcommand({subcommand:"rm",value:actual})}};var COMMAND_CONFIG={ls:getCommandAliases(lsSubcommand),set:getCommandAliases(setSubcommand),rm:getCommandAliases(rmSubcommand)},SUBCOMMAND_METADATA={ls:lsSubcommand,set:setSubcommand,rm:rmSubcommand};async function config(client,{args,needHelp,subcommandOriginal,telemetry}){let{subcommand:action,subcommandOriginal:actionOriginal}=getSubcommand(args,COMMAND_CONFIG),actionMetadata=typeof action=="string"?SUBCOMMAND_METADATA[action]:void 0;function printHelp(command,nested){return output_manager_default.print(help(command,{parent:nested?{...tracesCommand,name:"traces config"}:tracesCommand,columns:client.stderr.columns})),2}if(needHelp)return telemetry.trackCliFlagHelp("traces",subcommandOriginal),actionMetadata?printHelp(actionMetadata,!0):printHelp(tracesConfigCommand,!1);telemetry.trackCliSubcommandConfig(subcommandOriginal);let configTelemetry=new TracesConfigTelemetryClient({opts:{store:client.telemetryEventStore}});switch(action){case"ls":return configTelemetry.trackCliSubcommandLs(actionOriginal),(await import("./ls-OC2YVP7U.js")).default(client);case"set":return configTelemetry.trackCliSubcommandSet(actionOriginal),(await import("./set-BRG2L4NA.js")).default(client);case"rm":return configTelemetry.trackCliSubcommandRm(actionOriginal),(await import("./rm-L5KYP6JP.js")).default(client);default:return printHelp(tracesConfigCommand,!1)}}export{config as default};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{repositoryPath}from"./chunk-DFVNL5ML.js";import{emitVcrArgParseError,handleVcrApiError,requireVcrRepository,resolveVcrScope,validateVcrChoice,validateVcrJsonOutput}from"./chunk-MV6LWP5R.js";import{outputError}from"./chunk-FA6O7FPC.js";import"./chunk-D4MW3RDW.js";import{configSubcommand}from"./chunk-65JYSI26.js";import"./chunk-YMVDWVMO.js";import"./chunk-O7G3CZ42.js";import"./chunk-N3N5UHIL.js";import"./chunk-HWWHR7H3.js";import"./chunk-2I64AYHG.js";import"./chunk-QTKJC2O5.js";import{AGENT_REASON}from"./chunk-T4LZS75P.js";import"./chunk-SOJCELXH.js";import"./chunk-K2MXVUWY.js";import"./chunk-5XJNPXQK.js";import{printError}from"./chunk-PGF7MQK6.js";import{parseArguments}from"./chunk-EUJWN3RB.js";import"./chunk-MY4MONOH.js";import"./chunk-NOYJJRDK.js";import"./chunk-F2ZWW2IO.js";import"./chunk-B4ATVYZW.js";import"./chunk-PPCFQQSU.js";import{buildCommandWithGlobalFlags,outputAgentError}from"./chunk-SQXB2UM4.js";import{getFlagsSpecification}from"./chunk-JAJW3P42.js";import"./chunk-YMM3VY3J.js";import"./chunk-SM5JI6QM.js";import"./chunk-VOZEB6PD.js";import{isAPIError}from"./chunk-RINZXCDJ.js";import"./chunk-FI772UVH.js";import{output_manager_default}from"./chunk-EWWFNMPZ.js";import"./chunk-QGIQK47P.js";import"./chunk-AVSPFBLM.js";import"./chunk-XCJDGQO7.js";import"./chunk-YPTLSODC.js";import"./chunk-7HL2RPUO.js";import"./chunk-U7KCDTCH.js";import"./chunk-N3ZZ7FHQ.js";import"./chunk-GU6VIFR5.js";import"./chunk-6L236MNA.js";var USAGE="vcr config <repository> --public <true|false>";async function config(client,argv,telemetry){let parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(configSubcommand.options))}catch(err){return emitVcrArgParseError(client,err,USAGE),printError(err),1}let fr=validateVcrJsonOutput(client,parsedArgs.flags);if(typeof fr=="number")return fr;let repository=parsedArgs.args[0],project=parsedArgs.flags["--project"],publicValue=parsedArgs.flags["--public"],invalidChoice=validateVcrChoice(client,"--public",publicValue,["true","false"],fr.jsonOutput);if(typeof invalidChoice=="number")return invalidChoice;telemetry.trackCliOptionProject(project),telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]),telemetry.trackCliOptionPublic(publicValue);let missingRepository=requireVcrRepository(client,repository,fr.jsonOutput,USAGE);if(typeof missingRepository=="number")return missingRepository;if(publicValue===void 0){let message="Missing a setting to change. Pass --public true to make the repository public, or --public false to make it private.";return outputAgentError(client,{status:"error",reason:AGENT_REASON.MISSING_ARGUMENTS,message,next:[{command:buildCommandWithGlobalFlags(client.argv,USAGE),when:"Re-run with --public true or --public false"}]},1),outputError(client,fr.jsonOutput,"MISSING_ARGUMENTS",message)}let desiredPublic=publicValue==="true",scope=await resolveVcrScope(client,{project,jsonOutput:fr.jsonOutput});if(typeof scope=="number")return scope;let path=repositoryPath(scope,repository);output_manager_default.spinner("Updating repository...");try{let updated=await client.fetch(path,{method:"PATCH",body:{public:desiredPublic}});if(fr.jsonOutput)client.stdout.write(`${JSON.stringify(updated,null,2)}
|
|
8
|
+
`);else{let isPublic=updated.repository?.public??desiredPublic;output_manager_default.success(`Repository ${updated.repository?.name??repository} is now ${isPublic?"public":"private"}`)}return 0}catch(err){if(isAPIError(err))return handleVcrApiError(client,err,fr.jsonOutput,{retry:{command:buildCommandWithGlobalFlags(client.argv,"vcr ls"),when:"List repositories to confirm the name or id"}});throw err}finally{output_manager_default.stopSpinner()}}export{config as default};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{buildRepoUrl,checkExistsAndConnect,connectGitProvider,disconnectGitProvider,formatProvider,parseRepoUrl,printRemoteUrls,selectAndParseRemoteUrl,selectRemoteUrl}from"./chunk-
|
|
7
|
+
import{buildRepoUrl,checkExistsAndConnect,connectGitProvider,disconnectGitProvider,formatProvider,parseRepoUrl,printRemoteUrls,selectAndParseRemoteUrl,selectRemoteUrl}from"./chunk-XQQGQ55A.js";import"./chunk-2H77IRPI.js";import"./chunk-OHDEHZLX.js";import"./chunk-M2W3HKV3.js";import"./chunk-PHW54NU5.js";import"./chunk-WPS6JZF6.js";import"./chunk-OSCCYU74.js";import"./chunk-RINZXCDJ.js";import"./chunk-FI772UVH.js";import"./chunk-EWWFNMPZ.js";import"./chunk-QGIQK47P.js";import"./chunk-AVSPFBLM.js";import"./chunk-XCJDGQO7.js";import"./chunk-YPTLSODC.js";import"./chunk-7HL2RPUO.js";import"./chunk-U7KCDTCH.js";import"./chunk-N3ZZ7FHQ.js";import"./chunk-GU6VIFR5.js";import"./chunk-6L236MNA.js";export{buildRepoUrl,checkExistsAndConnect,connectGitProvider,disconnectGitProvider,formatProvider,parseRepoUrl,printRemoteUrls,selectAndParseRemoteUrl,selectRemoteUrl};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{getRouteVersions}from"./chunk-BVH2AEFE.js";import{getRouteTypeLabel,getRoutes,offerAutoPromote,parseSubcommandArgs,requireProjectContext,resolveRoutes,withGlobalFlags}from"./chunk-DPTTW6AM.js";import{deleteSubcommand}from"./chunk-3QHJYVCY.js";import{stamp_default}from"./chunk-XPXOV5UO.js";import"./chunk-JZRMH5UA.js";import"./chunk-QTKJC2O5.js";import"./chunk-SURYRPWO.js";import"./chunk-LAKQ6JG3.js";import{AGENT_REASON,AGENT_STATUS}from"./chunk-T4LZS75P.js";import"./chunk-K2MXVUWY.js";import"./chunk-5XJNPXQK.js";import"./chunk-PGF7MQK6.js";import"./chunk-EUJWN3RB.js";import"./chunk-MY4MONOH.js";import"./chunk-NOYJJRDK.js";import"./chunk-F2ZWW2IO.js";import"./chunk-B4ATVYZW.js";import"./chunk-PPCFQQSU.js";import{outputAgentError}from"./chunk-SQXB2UM4.js";import"./chunk-JAJW3P42.js";import"./chunk-YMM3VY3J.js";import"./chunk-SM5JI6QM.js";import"./chunk-VOZEB6PD.js";import"./chunk-RINZXCDJ.js";import"./chunk-FI772UVH.js";import{output_manager_default}from"./chunk-EWWFNMPZ.js";import"./chunk-QGIQK47P.js";import"./chunk-AVSPFBLM.js";import"./chunk-XCJDGQO7.js";import"./chunk-YPTLSODC.js";import"./chunk-7HL2RPUO.js";import{require_source}from"./chunk-U7KCDTCH.js";import"./chunk-N3ZZ7FHQ.js";import"./chunk-GU6VIFR5.js";import{__toESM}from"./chunk-6L236MNA.js";var import_chalk=__toESM(require_source(),1);async function deleteRoutes(client,projectId,routeIds,options={}){let{teamId}=options,query=new URLSearchParams;teamId&&query.set("teamId",teamId);let queryString=query.toString(),url=`/v1/projects/${projectId}/routes${queryString?`?${queryString}`:""}`;return await client.fetch(url,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({routeIds})})}async function deleteRoute(client,argv){let parsed=await parseSubcommandArgs(argv,deleteSubcommand,client);if(typeof parsed=="number")return parsed;let link=await requireProjectContext(client,"routes",parsed.flags["--project"]);if(typeof link=="number")return link;let{project,org}=link,teamId=org.type==="team"?org.id:void 0,{args,flags}=parsed,skipConfirmation=flags["--yes"];if(args.length===0)return client.nonInteractive&&outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.MISSING_ARGUMENTS,message:"At least one route name or ID is required.",next:[{command:withGlobalFlags(client,"routes delete <name-or-id> --yes"),when:"pass one or more ids/names and --yes to skip confirm"}]},1),output_manager_default.error(`At least one route name or ID is required. Usage: ${withGlobalFlags(client,"routes delete <name-or-id> [...]")}`),1;let{versions}=await getRouteVersions(client,project.id,{teamId}),existingStagingVersion=versions.find(v=>v.isStaging);output_manager_default.spinner("Fetching routes");let{routes}=await getRoutes(client,project.id,{teamId});if(output_manager_default.stopSpinner(),routes.length===0)return client.nonInteractive&&outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.NOT_FOUND,message:"No routes found in this project."},1),output_manager_default.error("No routes found in this project."),1;let resolved=await resolveRoutes(client,routes,args);if(!resolved)return 1;output_manager_default.print(`
|
|
8
|
+
`),output_manager_default.log(`The following ${resolved.length===1?"route":`${resolved.length} routes`} will be deleted:`);for(let route of resolved){let typeLabels=getRouteTypeLabel(route);output_manager_default.print(` ${import_chalk.default.red("\xD7")} ${route.name} ${import_chalk.default.gray(`(${route.route.src})`)} ${import_chalk.default.gray(`[${typeLabels}]`)}
|
|
9
|
+
`)}if(output_manager_default.print(`
|
|
10
|
+
`),!skipConfirmation&&(client.nonInteractive&&outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.CONFIRMATION_REQUIRED,message:"Deletion requires confirmation. Pass --yes to skip the prompt in non-interactive mode.",next:[{command:withGlobalFlags(client,`routes delete ${args.join(" ")} --yes`),when:"re-run with --yes to confirm without prompt"}]},1),!await client.input.confirm(`Delete ${resolved.length===1?"this route":`these ${resolved.length} routes`}?`,!1)))return output_manager_default.log("Aborted."),0;let deleteStamp=stamp_default();output_manager_default.spinner(`Deleting ${resolved.length===1?"route":`${resolved.length} routes`}`);try{let{deletedCount,version}=await deleteRoutes(client,project.id,resolved.map(r=>r.id),{teamId});return output_manager_default.log(`${import_chalk.default.cyan("Deleted")} ${deletedCount} ${deletedCount===1?"route":"routes"} ${import_chalk.default.gray(deleteStamp())}`),await offerAutoPromote(client,project.id,version,!!existingStagingVersion,{teamId,skipPrompts:skipConfirmation}),0}catch(e){let error=e;return client.nonInteractive&&outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.API_ERROR,message:"Failed to delete routes for this project. See hint for error details.",hint:error.message||"Retry with the same command once transient issues are resolved."},1),output_manager_default.error(error.message||"Failed to delete routes"),1}}export{deleteRoute as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{parseThreadArg}from"./chunk-2S6PE6GB.js";import{deleteMessage,handleCommentsParseError,resolveCommentsScope,threadNotFoundMessage,toApiErrorParts}from"./chunk-6QNPNUTJ.js";import{canPrompt}from"./chunk-XD2LZRBS.js";import{outputError}from"./chunk-FA6O7FPC.js";import{validateJsonOutput}from"./chunk-D4MW3RDW.js";import{deleteSubcommand}from"./chunk-NBVY237X.js";import"./chunk-QTKJC2O5.js";import"./chunk-SURYRPWO.js";import"./chunk-LAKQ6JG3.js";import"./chunk-T4LZS75P.js";import"./chunk-K2MXVUWY.js";import"./chunk-5XJNPXQK.js";import"./chunk-PGF7MQK6.js";import{parseArguments}from"./chunk-EUJWN3RB.js";import"./chunk-MY4MONOH.js";import"./chunk-NOYJJRDK.js";import"./chunk-F2ZWW2IO.js";import"./chunk-B4ATVYZW.js";import"./chunk-PPCFQQSU.js";import"./chunk-SQXB2UM4.js";import{getFlagsSpecification}from"./chunk-JAJW3P42.js";import"./chunk-YMM3VY3J.js";import"./chunk-SM5JI6QM.js";import"./chunk-VOZEB6PD.js";import{isAPIError}from"./chunk-RINZXCDJ.js";import"./chunk-FI772UVH.js";import{output_manager_default}from"./chunk-EWWFNMPZ.js";import"./chunk-QGIQK47P.js";import"./chunk-AVSPFBLM.js";import"./chunk-XCJDGQO7.js";import"./chunk-YPTLSODC.js";import"./chunk-7HL2RPUO.js";import{require_source}from"./chunk-U7KCDTCH.js";import"./chunk-N3ZZ7FHQ.js";import"./chunk-GU6VIFR5.js";import{__toESM}from"./chunk-6L236MNA.js";var import_chalk=__toESM(require_source(),1);async function deleteCommentMessage(client,telemetry){let parsedArgs,flagsSpecification=getFlagsSpecification(deleteSubcommand.options);try{parsedArgs=parseArguments(client.argv.slice(2),flagsSpecification)}catch(err){return handleCommentsParseError(err,"delete")}let formatResult=validateJsonOutput(parsedArgs.flags);if(!formatResult.valid)return output_manager_default.error(formatResult.error),1;let jsonOutput=formatResult.jsonOutput,yes=!!parsedArgs.flags["--yes"];telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]),telemetry.trackCliFlagYes(parsedArgs.flags["--yes"]);let[threadInput,messageId]=parsedArgs.args.slice(2);if(telemetry.trackCliArgumentThread(threadInput),telemetry.trackCliArgumentMessageId(messageId),!threadInput||!messageId)return outputError(client,jsonOutput,"MISSING_ARGUMENT","Usage: `vercel comments delete <thread> <message-id>` \u2014 message IDs are shown in `vercel comments inspect`.");let threadRef=parseThreadArg(threadInput);if(!threadRef)return outputError(client,jsonOutput,"INVALID_THREAD",`Could not extract a thread ID from "${threadInput}".`);let threadId=threadRef.id,scope=await resolveCommentsScope(client,{project:parsedArgs.flags["--project"],requireProject:!1,jsonOutput,urlTeamSlug:threadRef.teamSlug});if(typeof scope=="number")return scope;if(!yes){if(!canPrompt(client)||jsonOutput)return outputError(client,jsonOutput,"CONFIRMATION_REQUIRED","Pass --yes to delete the message non-interactively.");if(!await client.input.confirm(`${import_chalk.default.red("Delete")} message ${messageId} from ${threadId} in team ${scope.teamSlug??scope.teamId}? This cannot be undone.`,!1))return output_manager_default.log("Canceled."),0}telemetry.trackCliOptionProject(parsedArgs.flags["--project"]);try{let result=await deleteMessage(client,scope.teamId,threadId,messageId);return jsonOutput?(client.stdout.write(`${JSON.stringify(result,null,2)}
|
|
8
|
+
`),0):(output_manager_default.print(`${import_chalk.default.green("\u2713")} Deleted message ${messageId}
|
|
9
|
+
`),0)}catch(err){if(isAPIError(err)){let{code,message}=toApiErrorParts(err);return outputError(client,jsonOutput,code,err.status===404?threadNotFoundMessage(threadId,scope):message)}throw err}}export{deleteCommentMessage as default};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{detectProjects}from"./chunk-
|
|
7
|
+
import{detectProjects}from"./chunk-B6RDQTJF.js";import"./chunk-QRBAWXHP.js";import"./chunk-L3JDEHCQ.js";import"./chunk-KK4AJES5.js";import"./chunk-SOJCELXH.js";import"./chunk-QGIQK47P.js";import"./chunk-6L236MNA.js";export{detectProjects};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{getServicesConfigWriteBlocker,isExperimentalServicesEnabled,tryDetectServices,writeServicesConfig}from"./chunk-
|
|
7
|
+
import{getServicesConfigWriteBlocker,isExperimentalServicesEnabled,tryDetectServices,writeServicesConfig}from"./chunk-DBABUG2N.js";import"./chunk-KJ6MUEGB.js";import"./chunk-XU5QGRSL.js";import"./chunk-QRBAWXHP.js";import"./chunk-QYFRPNL2.js";import"./chunk-GHM7V3GG.js";import"./chunk-L3JDEHCQ.js";import"./chunk-QR7QPUFN.js";import"./chunk-N6CNMMSZ.js";import"./chunk-KK4AJES5.js";import"./chunk-SOJCELXH.js";import"./chunk-NOYJJRDK.js";import"./chunk-F2ZWW2IO.js";import"./chunk-B4ATVYZW.js";import"./chunk-PPCFQQSU.js";import"./chunk-YMM3VY3J.js";import"./chunk-SM5JI6QM.js";import"./chunk-VOZEB6PD.js";import"./chunk-RINZXCDJ.js";import"./chunk-FI772UVH.js";import"./chunk-EWWFNMPZ.js";import"./chunk-QGIQK47P.js";import"./chunk-AVSPFBLM.js";import"./chunk-XCJDGQO7.js";import"./chunk-YPTLSODC.js";import"./chunk-7HL2RPUO.js";import"./chunk-U7KCDTCH.js";import"./chunk-N3ZZ7FHQ.js";import"./chunk-GU6VIFR5.js";import"./chunk-6L236MNA.js";export{getServicesConfigWriteBlocker,isExperimentalServicesEnabled,tryDetectServices,writeServicesConfig};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{editRoute}from"./chunk-AM46JVVN.js";import{getRouteVersions}from"./chunk-BVH2AEFE.js";import{getRoutes,offerAutoPromote,parseSubcommandArgs,requireProjectContext,resolveRoute,withGlobalFlags}from"./chunk-DPTTW6AM.js";import{disableSubcommand}from"./chunk-3QHJYVCY.js";import{stamp_default}from"./chunk-XPXOV5UO.js";import"./chunk-JZRMH5UA.js";import"./chunk-QTKJC2O5.js";import"./chunk-SURYRPWO.js";import"./chunk-LAKQ6JG3.js";import"./chunk-T4LZS75P.js";import"./chunk-K2MXVUWY.js";import"./chunk-5XJNPXQK.js";import"./chunk-PGF7MQK6.js";import"./chunk-EUJWN3RB.js";import"./chunk-MY4MONOH.js";import"./chunk-NOYJJRDK.js";import"./chunk-F2ZWW2IO.js";import"./chunk-B4ATVYZW.js";import"./chunk-PPCFQQSU.js";import{outputAgentError}from"./chunk-SQXB2UM4.js";import"./chunk-JAJW3P42.js";import"./chunk-YMM3VY3J.js";import"./chunk-SM5JI6QM.js";import"./chunk-VOZEB6PD.js";import"./chunk-RINZXCDJ.js";import"./chunk-FI772UVH.js";import{output_manager_default}from"./chunk-EWWFNMPZ.js";import"./chunk-QGIQK47P.js";import"./chunk-AVSPFBLM.js";import"./chunk-XCJDGQO7.js";import"./chunk-YPTLSODC.js";import"./chunk-7HL2RPUO.js";import{require_source}from"./chunk-U7KCDTCH.js";import"./chunk-N3ZZ7FHQ.js";import"./chunk-GU6VIFR5.js";import{__toESM}from"./chunk-6L236MNA.js";var import_chalk=__toESM(require_source(),1);async function disable(client,argv){let parsed=await parseSubcommandArgs(argv,disableSubcommand,client);if(typeof parsed=="number")return parsed;let link=await requireProjectContext(client,"routes",parsed.flags["--project"]);if(typeof link=="number")return link;let{project,org}=link,teamId=org.type==="team"?org.id:void 0,{args}=parsed,identifier=args[0];if(!identifier)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"missing_arguments",message:"Route name or ID is required.",next:[{command:withGlobalFlags(client,"routes disable <name-or-id>"),when:"replace <name-or-id>"},{command:withGlobalFlags(client,"routes list"),when:"list routes"}]},1),output_manager_default.error(`Route name or ID is required. Usage: ${withGlobalFlags(client,"routes disable <name-or-id>")}`),1;let{versions}=await getRouteVersions(client,project.id,{teamId}),existingStagingVersion=versions.find(v=>v.isStaging);output_manager_default.spinner("Fetching routes");let{routes}=await getRoutes(client,project.id,{teamId});if(output_manager_default.stopSpinner(),routes.length===0)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"not_found",message:"No routes found in this project."},1),output_manager_default.error("No routes found in this project."),1;let route=await resolveRoute(client,routes,identifier);if(!route)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"not_found",message:`No route found matching "${identifier}".`,next:[{command:withGlobalFlags(client,"routes list"),when:"list routes"}]},1),output_manager_default.error(`No route found matching "${identifier}". Run ${import_chalk.default.cyan(withGlobalFlags(client,"routes list"))} to see all routes.`),1;if(route.enabled===!1)return output_manager_default.log(`Route "${route.name}" is already disabled.`),0;let disableStamp=stamp_default();output_manager_default.spinner(`Disabling route "${route.name}"`);try{let{version}=await editRoute(client,project.id,route.id,{route:{name:route.name,description:route.description,enabled:!1,srcSyntax:route.srcSyntax,route:route.route}},{teamId});return output_manager_default.log(`${import_chalk.default.cyan("Disabled")} route "${route.name}" ${import_chalk.default.gray(disableStamp())}`),await offerAutoPromote(client,project.id,version,!!existingStagingVersion,{teamId}),0}catch(e){let error=e;return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"api_error",message:error.message||"Failed to disable route"},1),output_manager_default.error(error.message||"Failed to disable route"),1}}export{disable as default};
|
|
@@ -0,0 +1,14 @@
|
|
|
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{updateRouteVersion}from"./chunk-6QKS6QK7.js";import{getRouteVersions}from"./chunk-BVH2AEFE.js";import{confirmAction,getRoutes,parseSubcommandArgs,printDiffSummary,requireProjectContext,withGlobalFlags}from"./chunk-DPTTW6AM.js";import{discardSubcommand}from"./chunk-3QHJYVCY.js";import{stamp_default}from"./chunk-XPXOV5UO.js";import"./chunk-JZRMH5UA.js";import"./chunk-QTKJC2O5.js";import"./chunk-SURYRPWO.js";import"./chunk-LAKQ6JG3.js";import"./chunk-T4LZS75P.js";import"./chunk-K2MXVUWY.js";import"./chunk-5XJNPXQK.js";import"./chunk-PGF7MQK6.js";import"./chunk-EUJWN3RB.js";import"./chunk-MY4MONOH.js";import"./chunk-NOYJJRDK.js";import"./chunk-F2ZWW2IO.js";import"./chunk-B4ATVYZW.js";import"./chunk-PPCFQQSU.js";import{outputAgentError}from"./chunk-SQXB2UM4.js";import"./chunk-JAJW3P42.js";import"./chunk-YMM3VY3J.js";import"./chunk-SM5JI6QM.js";import"./chunk-VOZEB6PD.js";import"./chunk-RINZXCDJ.js";import"./chunk-FI772UVH.js";import{output_manager_default}from"./chunk-EWWFNMPZ.js";import"./chunk-QGIQK47P.js";import"./chunk-AVSPFBLM.js";import"./chunk-XCJDGQO7.js";import"./chunk-YPTLSODC.js";import"./chunk-7HL2RPUO.js";import{require_source}from"./chunk-U7KCDTCH.js";import"./chunk-N3ZZ7FHQ.js";import"./chunk-GU6VIFR5.js";import{__toESM}from"./chunk-6L236MNA.js";var import_chalk=__toESM(require_source(),1);async function discard(client,argv){let parsed=await parseSubcommandArgs(argv,discardSubcommand,client);if(typeof parsed=="number")return parsed;let link=await requireProjectContext(client,"routes",parsed.flags["--project"]);if(typeof link=="number")return link;let{project,org}=link,teamId=org.type==="team"?org.id:void 0;output_manager_default.spinner(`Fetching route versions for ${import_chalk.default.bold(project.name)}`);let{versions}=await getRouteVersions(client,project.id,{teamId}),stagingVersion=versions.find(v=>v.isStaging);if(!stagingVersion)return output_manager_default.warn(`No staged changes to discard. Make changes first with ${import_chalk.default.cyan(withGlobalFlags(client,"routes add"))}.`),0;output_manager_default.spinner("Fetching staged changes");let{routes:diffRoutes}=await getRoutes(client,project.id,{teamId,versionId:stagingVersion.id,diff:!0}),changedRoutes=diffRoutes.filter(r=>r.action!==void 0);if(changedRoutes.length>0?(output_manager_default.print(`
|
|
8
|
+
${import_chalk.default.bold("Changes to be discarded:")}
|
|
9
|
+
|
|
10
|
+
`),printDiffSummary(changedRoutes),output_manager_default.print(`
|
|
11
|
+
`)):output_manager_default.print(`
|
|
12
|
+
${import_chalk.default.gray("No changes detected in staging version.")}
|
|
13
|
+
|
|
14
|
+
`),!await confirmAction(client,parsed.flags["--yes"],"Discard all staged changes?","This action cannot be undone."))return output_manager_default.log("Canceled"),0;let updateStamp=stamp_default();output_manager_default.spinner("Discarding staged changes");try{return await updateRouteVersion(client,project.id,stagingVersion.id,"discard",{teamId}),output_manager_default.log(`${import_chalk.default.cyan("Success!")} Staged changes discarded ${import_chalk.default.gray(updateStamp())}`),0}catch(e){let msg=e.message||"Failed to discard staged changes";return client.nonInteractive?(outputAgentError(client,{status:"error",reason:"api_error",message:msg,next:[{command:withGlobalFlags(client,"routes discard --yes")}]}),process.exit(1),1):(output_manager_default.error(msg),1)}}export{discard as default};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{editRoute}from"./chunk-AM46JVVN.js";import{applyFlagMutations,cloneRoute,convertRouteToCurrentRoute,generateRoute,generatedRouteToAddInput,hasAnyTransformFlags,populateRouteEnv,printGeneratedRoutePreview,printRouteConfig,routingRuleToCurrentRoute,runInteractiveEditLoop}from"./chunk-V62NLRIZ.js";import{getRouteVersions}from"./chunk-BVH2AEFE.js";import{getRoutes,offerAutoPromote,parseSubcommandArgs,requireProjectContext,resolveRoute,shellQuoteRouteIdentifierForSuggestion,withGlobalFlags}from"./chunk-DPTTW6AM.js";import{editSubcommand}from"./chunk-3QHJYVCY.js";import{stamp_default}from"./chunk-XPXOV5UO.js";import"./chunk-JZRMH5UA.js";import"./chunk-QTKJC2O5.js";import"./chunk-SURYRPWO.js";import"./chunk-LAKQ6JG3.js";import"./chunk-T4LZS75P.js";import"./chunk-K2MXVUWY.js";import"./chunk-5XJNPXQK.js";import"./chunk-PGF7MQK6.js";import"./chunk-EUJWN3RB.js";import"./chunk-MY4MONOH.js";import"./chunk-NOYJJRDK.js";import"./chunk-F2ZWW2IO.js";import"./chunk-B4ATVYZW.js";import"./chunk-PPCFQQSU.js";import{outputAgentError}from"./chunk-SQXB2UM4.js";import"./chunk-JAJW3P42.js";import"./chunk-YMM3VY3J.js";import"./chunk-SM5JI6QM.js";import"./chunk-VOZEB6PD.js";import"./chunk-RINZXCDJ.js";import"./chunk-FI772UVH.js";import{output_manager_default}from"./chunk-EWWFNMPZ.js";import"./chunk-QGIQK47P.js";import"./chunk-AVSPFBLM.js";import"./chunk-XCJDGQO7.js";import"./chunk-YPTLSODC.js";import"./chunk-7HL2RPUO.js";import{require_source}from"./chunk-U7KCDTCH.js";import"./chunk-N3ZZ7FHQ.js";import"./chunk-GU6VIFR5.js";import{__toESM}from"./chunk-6L236MNA.js";var import_chalk=__toESM(require_source(),1);async function edit(client,argv){let parsed=await parseSubcommandArgs(argv,editSubcommand,client);if(typeof parsed=="number")return parsed;let link=await requireProjectContext(client,"routes",parsed.flags["--project"]);if(typeof link=="number")return link;let{project,org}=link,teamId=org.type==="team"?org.id:void 0,{args,flags}=parsed,skipConfirmation=flags["--yes"],identifier=args[0],{RoutesEditTelemetryClient}=await import("./routes-IPGKJ2E4.js"),telemetry=new RoutesEditTelemetryClient({opts:{store:client.telemetryEventStore}});if(telemetry.trackCliArgumentNameOrId(identifier),telemetry.trackCliFlagYes(skipConfirmation),telemetry.trackCliOptionName(flags["--name"]),telemetry.trackCliOptionDescription(flags["--description"]),telemetry.trackCliOptionSrc(flags["--src"]),telemetry.trackCliOptionSrcSyntax(flags["--src-syntax"]),telemetry.trackCliOptionAction(flags["--action"]),telemetry.trackCliOptionDest(flags["--dest"]),telemetry.trackCliOptionStatus(flags["--status"]),telemetry.trackCliFlagNoDest(flags["--no-dest"]),telemetry.trackCliFlagNoStatus(flags["--no-status"]),telemetry.trackCliFlagClearConditions(flags["--clear-conditions"]),telemetry.trackCliFlagClearHeaders(flags["--clear-headers"]),telemetry.trackCliFlagClearTransforms(flags["--clear-transforms"]),telemetry.trackCliOptionSetResponseHeader(flags["--set-response-header"]),telemetry.trackCliOptionAppendResponseHeader(flags["--append-response-header"]),telemetry.trackCliOptionDeleteResponseHeader(flags["--delete-response-header"]),telemetry.trackCliOptionSetRequestHeader(flags["--set-request-header"]),telemetry.trackCliOptionAppendRequestHeader(flags["--append-request-header"]),telemetry.trackCliOptionDeleteRequestHeader(flags["--delete-request-header"]),telemetry.trackCliOptionSetRequestQuery(flags["--set-request-query"]),telemetry.trackCliOptionAppendRequestQuery(flags["--append-request-query"]),telemetry.trackCliOptionDeleteRequestQuery(flags["--delete-request-query"]),telemetry.trackCliOptionHas(flags["--has"]),telemetry.trackCliOptionMissing(flags["--missing"]),telemetry.trackCliOptionAi(flags["--ai"]),!identifier)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"missing_arguments",message:"Route name or ID is required as the first argument after routes edit.",next:[{command:withGlobalFlags(client,"routes edit <name-or-id>"),when:"replace <name-or-id> with route name or id from routes list"},{command:withGlobalFlags(client,"routes list"),when:"to list routes"}]},1),output_manager_default.error(`Route name or ID is required. Usage: ${withGlobalFlags(client,"routes edit <name-or-id>")}`),1;let{versions}=await getRouteVersions(client,project.id,{teamId}),existingStagingVersion=versions.find(v=>v.isStaging);output_manager_default.spinner("Fetching routes");let{routes}=await getRoutes(client,project.id,{teamId});if(output_manager_default.stopSpinner(),routes.length===0)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"not_found",message:"No routes found in this project.",next:[{command:withGlobalFlags(client,"routes add --ai <description> --yes"),when:"add a route first (or use full flags)"}]},1),output_manager_default.error("No routes found in this project."),1;let originalRoute=await resolveRoute(client,routes,identifier);if(!originalRoute)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"not_found",message:`No route found matching "${identifier}".`,next:[{command:withGlobalFlags(client,"routes list"),when:"to list routes and pick an exact name or id"},{command:withGlobalFlags(client,"routes edit <name-or-id>"),when:"retry with a unique name or id"}]},1),output_manager_default.error(`No route found matching "${identifier}". Run ${import_chalk.default.cyan(withGlobalFlags(client,"routes list"))} to see all routes.`),1;let aiPrompt=flags["--ai"];if(aiPrompt){let usedConflicts=["--name","--description","--src","--src-syntax","--action","--dest","--status","--no-dest","--no-status","--has","--missing","--set-response-header","--append-response-header","--delete-response-header","--set-request-header","--append-request-header","--delete-request-header","--set-request-query","--append-request-query","--delete-request-query","--clear-conditions","--clear-headers","--clear-transforms"].filter(f=>flags[f]!==void 0);return usedConflicts.length>0?(client.nonInteractive&&outputAgentError(client,{status:"error",reason:"invalid_arguments",message:`Cannot use --ai with ${usedConflicts.join(", ")}. Use --ai alone to describe changes.`,next:[{command:withGlobalFlags(client,`routes edit ${shellQuoteRouteIdentifierForSuggestion(identifier)} --ai <description> --yes`),when:"use only --ai with route id/name already set"}]},1),output_manager_default.error(`Cannot use --ai with ${usedConflicts.join(", ")}. Use --ai alone to describe changes.`),1):await handleAIEdit(client,project.id,teamId,originalRoute,aiPrompt,skipConfirmation,existingStagingVersion)}let route=cloneRoute(originalRoute);if(flags["--name"]!==void 0||flags["--description"]!==void 0||flags["--src"]!==void 0||flags["--src-syntax"]!==void 0||flags["--action"]!==void 0||flags["--dest"]!==void 0||flags["--status"]!==void 0||flags["--no-dest"]!==void 0||flags["--no-status"]!==void 0||flags["--has"]!==void 0||flags["--missing"]!==void 0||flags["--clear-conditions"]!==void 0||flags["--clear-headers"]!==void 0||flags["--clear-transforms"]!==void 0||hasAnyTransformFlags(flags)){let error=applyFlagMutations(route,flags);if(error)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"invalid_arguments",message:error,next:[{command:withGlobalFlags(client,`routes edit ${shellQuoteRouteIdentifierForSuggestion(identifier)} ...`),when:"fix flags per message; see routes edit --help"}]},1),output_manager_default.error(error),1}else{if(!client.stdin.isTTY||client.nonInteractive)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"missing_arguments",message:"No edit flags provided. In non-interactive mode pass flags such as --name, --src, --dest, --action, header flags, or --ai <description> --yes.",next:[{command:withGlobalFlags(client,`routes edit ${shellQuoteRouteIdentifierForSuggestion(identifier)} --dest <dest> --yes`),when:"example: set destination; see routes edit --help"}],hint:"Run vercel routes edit --help for all flag options."},1),output_manager_default.error(`No edit flags provided. When running non-interactively, use flags like --name, --dest, --src, etc. Run ${withGlobalFlags(client,"routes edit --help")} for all options.`),1;if(output_manager_default.log(`
|
|
8
|
+
Editing route "${originalRoute.name}"`),printRouteConfig(route),await client.input.select({message:"How would you like to edit this route?",choices:[{name:"Describe changes (AI-powered)",value:"ai"},{name:"Edit manually (field by field)",value:"manual"}]})==="ai")return telemetry.trackCliOptionAi("interactive"),await handleAIEdit(client,project.id,teamId,originalRoute,void 0,skipConfirmation,existingStagingVersion);await runInteractiveEditLoop(client,route)}if(populateRouteEnv(route.route,route.srcSyntax),JSON.stringify(route)===JSON.stringify(originalRoute))return output_manager_default.log("No changes made."),0;let editStamp=stamp_default();output_manager_default.spinner(`Updating route "${route.name}"`);try{let{version}=await editRoute(client,project.id,originalRoute.id,{route:{name:route.name,description:route.description,enabled:route.enabled,srcSyntax:route.srcSyntax,route:route.route}},{teamId});return output_manager_default.log(`${import_chalk.default.cyan("Updated")} route "${route.name}" ${import_chalk.default.gray(editStamp())}`),await offerAutoPromote(client,project.id,version,!!existingStagingVersion,{teamId,skipPrompts:skipConfirmation}),0}catch(e){let error=e;return output_manager_default.error(error.message||"Failed to update route"),1}}async function handleAIEdit(client,projectId,teamId,originalRoute,aiPrompt,skipConfirmation,existingStagingVersion){let currentRoute=routingRuleToCurrentRoute(originalRoute),prompt=aiPrompt,currentGenerated;for(;;){prompt||(prompt=await client.input.text({message:"Describe what you'd like to change:",validate:val=>val?val.length>2e3?"Description must be 2000 characters or less":!0:"A description is required"})),output_manager_default.spinner("Generating updated route...");let errorMessage;try{let result=await generateRoute(client,projectId,{prompt,currentRoute},{teamId});result.error?errorMessage=result.error:result.route?currentGenerated=result.route:errorMessage="Could not apply changes. Try rephrasing."}catch(e){errorMessage=e.message||"Failed to generate updated route"}if(currentGenerated)break;if(output_manager_default.error(errorMessage),skipConfirmation||!client.stdin.isTTY)return 1;if(await client.input.select({message:"What would you like to do?",choices:[{name:"Try again with a different description",value:"retry"},{name:"Cancel",value:"cancel"}]})==="cancel")return output_manager_default.log("No changes made."),0;prompt=void 0}if(printGeneratedRoutePreview(currentGenerated),skipConfirmation)return await applyAIEdit(client,projectId,teamId,originalRoute,currentGenerated,existingStagingVersion,skipConfirmation);if(!client.stdin.isTTY)return output_manager_default.error(`Cannot interactively confirm route changes in a non-TTY environment. Use ${withGlobalFlags(client,'routes edit <name-or-id> --ai "..." --yes')} to skip confirmation.`),1;for(;;){let choice=await client.input.select({message:"What would you like to do?",choices:[{name:"Confirm changes",value:"confirm"},{name:"Edit again with AI",value:"ai-edit"},{name:"Edit manually",value:"manual"},{name:"Discard",value:"discard"}],pageSize:4,loop:!1});if(choice==="confirm")return await applyAIEdit(client,projectId,teamId,originalRoute,currentGenerated,existingStagingVersion,skipConfirmation);if(choice==="ai-edit"){let editPrompt=await client.input.text({message:"Describe what you'd like to change:",validate:val=>val?val.length>2e3?"Description must be 2000 characters or less":!0:"A description is required"});output_manager_default.spinner("Updating route...");try{let editResult=await generateRoute(client,projectId,{prompt:editPrompt,currentRoute:convertRouteToCurrentRoute(currentGenerated)},{teamId});if(editResult.error){output_manager_default.error(editResult.error),output_manager_default.log("Keeping previous route:"),printGeneratedRoutePreview(currentGenerated);continue}if(!editResult.route){output_manager_default.error("Could not apply changes. Try rephrasing."),output_manager_default.log("Keeping previous route:"),printGeneratedRoutePreview(currentGenerated);continue}currentGenerated=editResult.route,printGeneratedRoutePreview(currentGenerated)}catch(e){let error=e;output_manager_default.error(error.message||"Failed to update route"),output_manager_default.log("Keeping previous route:"),printGeneratedRoutePreview(currentGenerated)}continue}if(choice==="manual"){let routeInput=generatedRouteToAddInput(currentGenerated),manualRoute=cloneRoute(originalRoute);manualRoute.name=routeInput.name,manualRoute.description=routeInput.description,manualRoute.srcSyntax=routeInput.srcSyntax,manualRoute.route=routeInput.route,await runInteractiveEditLoop(client,manualRoute),populateRouteEnv(manualRoute.route,manualRoute.srcSyntax);let editStamp=stamp_default();output_manager_default.spinner(`Updating route "${manualRoute.name}"`);try{let{version}=await editRoute(client,projectId,originalRoute.id,{route:{name:manualRoute.name,description:manualRoute.description,enabled:manualRoute.enabled,srcSyntax:manualRoute.srcSyntax,route:manualRoute.route}},{teamId});return output_manager_default.log(`${import_chalk.default.cyan("Updated")} route "${manualRoute.name}" ${import_chalk.default.gray(editStamp())}`),await offerAutoPromote(client,projectId,version,!!existingStagingVersion,{teamId,skipPrompts:skipConfirmation}),0}catch(e){let error=e;return output_manager_default.error(error.message||"Failed to update route"),1}}return output_manager_default.log("No changes made."),0}}async function applyAIEdit(client,projectId,teamId,originalRoute,generated,existingStagingVersion,skipConfirmation){let routeInput=generatedRouteToAddInput(generated);populateRouteEnv(routeInput.route,routeInput.srcSyntax);let editStamp=stamp_default();output_manager_default.spinner(`Updating route "${routeInput.name}"`);try{let{version}=await editRoute(client,projectId,originalRoute.id,{route:{name:routeInput.name,description:routeInput.description,enabled:originalRoute.enabled,srcSyntax:routeInput.srcSyntax,route:routeInput.route}},{teamId});return output_manager_default.log(`${import_chalk.default.cyan("Updated")} route "${routeInput.name}" ${import_chalk.default.gray(editStamp())}`),await offerAutoPromote(client,projectId,version,!!existingStagingVersion,{teamId,skipPrompts:skipConfirmation}),0}catch(e){let error=e;return output_manager_default.error(error.message||"Failed to update route"),1}}export{edit as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{resolveMessageContent}from"./chunk-U6N2RNDI.js";import{parseThreadArg}from"./chunk-2S6PE6GB.js";import{handleCommentsParseError,resolveCommentsScope,threadNotFoundMessage,toApiErrorParts,updateMessage}from"./chunk-6QNPNUTJ.js";import"./chunk-XD2LZRBS.js";import{outputError}from"./chunk-FA6O7FPC.js";import{validateJsonOutput}from"./chunk-D4MW3RDW.js";import{editSubcommand}from"./chunk-NBVY237X.js";import"./chunk-QTKJC2O5.js";import"./chunk-SURYRPWO.js";import"./chunk-LAKQ6JG3.js";import"./chunk-T4LZS75P.js";import"./chunk-K2MXVUWY.js";import"./chunk-5XJNPXQK.js";import"./chunk-PGF7MQK6.js";import{parseArguments}from"./chunk-EUJWN3RB.js";import"./chunk-MY4MONOH.js";import"./chunk-NOYJJRDK.js";import"./chunk-F2ZWW2IO.js";import"./chunk-B4ATVYZW.js";import"./chunk-PPCFQQSU.js";import"./chunk-SQXB2UM4.js";import{getFlagsSpecification}from"./chunk-JAJW3P42.js";import"./chunk-YMM3VY3J.js";import"./chunk-SM5JI6QM.js";import"./chunk-VOZEB6PD.js";import{isAPIError}from"./chunk-RINZXCDJ.js";import"./chunk-FI772UVH.js";import{output_manager_default}from"./chunk-EWWFNMPZ.js";import"./chunk-QGIQK47P.js";import"./chunk-AVSPFBLM.js";import"./chunk-XCJDGQO7.js";import"./chunk-YPTLSODC.js";import"./chunk-7HL2RPUO.js";import{require_source}from"./chunk-U7KCDTCH.js";import"./chunk-N3ZZ7FHQ.js";import"./chunk-GU6VIFR5.js";import{__toESM}from"./chunk-6L236MNA.js";var import_chalk=__toESM(require_source(),1);async function edit(client,telemetry){let parsedArgs,flagsSpecification=getFlagsSpecification(editSubcommand.options);try{parsedArgs=parseArguments(client.argv.slice(2),flagsSpecification)}catch(err){return handleCommentsParseError(err,"edit")}let formatResult=validateJsonOutput(parsedArgs.flags);if(!formatResult.valid)return output_manager_default.error(formatResult.error),1;let jsonOutput=formatResult.jsonOutput;telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]),telemetry.trackCliOptionMessage(parsedArgs.flags["--message"]),telemetry.trackCliOptionFile(parsedArgs.flags["--file"]);let[threadInput,messageId]=parsedArgs.args.slice(2);if(telemetry.trackCliArgumentThread(threadInput),telemetry.trackCliArgumentMessageId(messageId),!threadInput||!messageId)return outputError(client,jsonOutput,"MISSING_ARGUMENT","Usage: `vercel comments edit <thread> <message-id> -m <text>` \u2014 message IDs are shown in `vercel comments inspect`.");let threadRef=parseThreadArg(threadInput);if(!threadRef)return outputError(client,jsonOutput,"INVALID_THREAD",`Could not extract a thread ID from "${threadInput}".`);let threadId=threadRef.id,content=await resolveMessageContent(client,{message:parsedArgs.flags["--message"],file:parsedArgs.flags["--file"]},jsonOutput);if(typeof content=="number")return content;if(content===void 0)return outputError(client,jsonOutput,"MISSING_CONTENT","Pass the new content with -m <text> or --file <path>.");telemetry.trackCliOptionProject(parsedArgs.flags["--project"]);let scope=await resolveCommentsScope(client,{project:parsedArgs.flags["--project"],requireProject:!1,jsonOutput,urlTeamSlug:threadRef.teamSlug});if(typeof scope=="number")return scope;try{let message=await updateMessage(client,scope.teamId,threadId,messageId,{markdown:content});return jsonOutput?(client.stdout.write(`${JSON.stringify(message,null,2)}
|
|
8
|
+
`),0):(output_manager_default.print(`${import_chalk.default.green("\u2713")} Edited message ${messageId}
|
|
9
|
+
`),0)}catch(err){if(isAPIError(err)){let{code,message}=toApiErrorParts(err);return outputError(client,jsonOutput,code,err.status===404?threadNotFoundMessage(threadId,scope):message)}throw err}}export{edit as default};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{editRoute}from"./chunk-AM46JVVN.js";import{getRouteVersions}from"./chunk-BVH2AEFE.js";import{getRoutes,offerAutoPromote,parseSubcommandArgs,requireProjectContext,resolveRoute,withGlobalFlags}from"./chunk-DPTTW6AM.js";import{enableSubcommand}from"./chunk-3QHJYVCY.js";import{stamp_default}from"./chunk-XPXOV5UO.js";import"./chunk-JZRMH5UA.js";import"./chunk-QTKJC2O5.js";import"./chunk-SURYRPWO.js";import"./chunk-LAKQ6JG3.js";import"./chunk-T4LZS75P.js";import"./chunk-K2MXVUWY.js";import"./chunk-5XJNPXQK.js";import"./chunk-PGF7MQK6.js";import"./chunk-EUJWN3RB.js";import"./chunk-MY4MONOH.js";import"./chunk-NOYJJRDK.js";import"./chunk-F2ZWW2IO.js";import"./chunk-B4ATVYZW.js";import"./chunk-PPCFQQSU.js";import{outputAgentError}from"./chunk-SQXB2UM4.js";import"./chunk-JAJW3P42.js";import"./chunk-YMM3VY3J.js";import"./chunk-SM5JI6QM.js";import"./chunk-VOZEB6PD.js";import"./chunk-RINZXCDJ.js";import"./chunk-FI772UVH.js";import{output_manager_default}from"./chunk-EWWFNMPZ.js";import"./chunk-QGIQK47P.js";import"./chunk-AVSPFBLM.js";import"./chunk-XCJDGQO7.js";import"./chunk-YPTLSODC.js";import"./chunk-7HL2RPUO.js";import{require_source}from"./chunk-U7KCDTCH.js";import"./chunk-N3ZZ7FHQ.js";import"./chunk-GU6VIFR5.js";import{__toESM}from"./chunk-6L236MNA.js";var import_chalk=__toESM(require_source(),1);async function enable(client,argv){let parsed=await parseSubcommandArgs(argv,enableSubcommand,client);if(typeof parsed=="number")return parsed;let link=await requireProjectContext(client,"routes",parsed.flags["--project"]);if(typeof link=="number")return link;let{project,org}=link,teamId=org.type==="team"?org.id:void 0,{args}=parsed,identifier=args[0];if(!identifier)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"missing_arguments",message:"Route name or ID is required.",next:[{command:withGlobalFlags(client,"routes enable <name-or-id>"),when:"replace <name-or-id>"},{command:withGlobalFlags(client,"routes list"),when:"list routes"}]},1),output_manager_default.error(`Route name or ID is required. Usage: ${withGlobalFlags(client,"routes enable <name-or-id>")}`),1;let{versions}=await getRouteVersions(client,project.id,{teamId}),existingStagingVersion=versions.find(v=>v.isStaging);output_manager_default.spinner("Fetching routes");let{routes}=await getRoutes(client,project.id,{teamId});if(output_manager_default.stopSpinner(),routes.length===0)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"not_found",message:"No routes found in this project.",next:[{command:withGlobalFlags(client,"routes add --help"),when:"add routes first"}]},1),output_manager_default.error("No routes found in this project."),1;let route=await resolveRoute(client,routes,identifier);if(!route)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"not_found",message:`No route found matching "${identifier}".`,next:[{command:withGlobalFlags(client,"routes list"),when:"list routes"}]},1),output_manager_default.error(`No route found matching "${identifier}". Run ${import_chalk.default.cyan(withGlobalFlags(client,"routes list"))} to see all routes.`),1;if(route.enabled!==!1)return output_manager_default.log(`Route "${route.name}" is already enabled.`),0;let enableStamp=stamp_default();output_manager_default.spinner(`Enabling route "${route.name}"`);try{let{version}=await editRoute(client,project.id,route.id,{route:{name:route.name,description:route.description,enabled:!0,srcSyntax:route.srcSyntax,route:route.route}},{teamId});return output_manager_default.log(`${import_chalk.default.cyan("Enabled")} route "${route.name}" ${import_chalk.default.gray(enableStamp())}`),await offerAutoPromote(client,project.id,version,!!existingStagingVersion,{teamId}),0}catch(e){let error=e;return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"api_error",message:error.message||"Failed to enable route"},1),output_manager_default.error(error.message||"Failed to enable route"),1}}export{enable as default};
|
|
@@ -4,7 +4,7 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{getRoutes,parseSubcommandArgs,requireProjectContext,withGlobalFlags}from"./chunk-
|
|
7
|
+
import{getRoutes,parseSubcommandArgs,requireProjectContext,withGlobalFlags}from"./chunk-DPTTW6AM.js";import{exportSubcommand}from"./chunk-3QHJYVCY.js";import"./chunk-SURYRPWO.js";import"./chunk-LAKQ6JG3.js";import"./chunk-T4LZS75P.js";import"./chunk-K2MXVUWY.js";import"./chunk-5XJNPXQK.js";import"./chunk-PGF7MQK6.js";import"./chunk-EUJWN3RB.js";import"./chunk-MY4MONOH.js";import"./chunk-NOYJJRDK.js";import"./chunk-F2ZWW2IO.js";import"./chunk-B4ATVYZW.js";import"./chunk-PPCFQQSU.js";import{outputAgentError}from"./chunk-SQXB2UM4.js";import"./chunk-JAJW3P42.js";import"./chunk-YMM3VY3J.js";import"./chunk-SM5JI6QM.js";import"./chunk-VOZEB6PD.js";import"./chunk-RINZXCDJ.js";import"./chunk-FI772UVH.js";import{output_manager_default}from"./chunk-EWWFNMPZ.js";import"./chunk-QGIQK47P.js";import"./chunk-AVSPFBLM.js";import"./chunk-XCJDGQO7.js";import"./chunk-YPTLSODC.js";import"./chunk-7HL2RPUO.js";import"./chunk-U7KCDTCH.js";import"./chunk-N3ZZ7FHQ.js";import"./chunk-GU6VIFR5.js";import"./chunk-6L236MNA.js";function cleanRoute(route){let cleaned={};for(let[key,value]of Object.entries(route))value!==void 0&&(key==="middlewarePath"||key==="middlewareRawSrc"||key==="middleware"||key==="check"||key==="important"||(cleaned[key]=value));return cleaned}function routesToVercelJson(rules){let config={routes:rules.filter(r=>r.enabled!==!1).map(r=>cleanRoute(r.route))};return JSON.stringify(config,null,2)}function routesToVercelTs(rules){let routeEntries=rules.filter(r=>r.enabled!==!1).map(r=>{let cleaned=cleanRoute(r.route),indented=JSON.stringify(cleaned,null,2).split(`
|
|
8
8
|
`).map((line,i)=>i===0?line:` ${line}`).join(`
|
|
9
9
|
`);return r.description?` // ${r.description.replace(/\n/g," ")}
|
|
10
10
|
${indented}`:` ${indented}`});return`import type { VercelConfig } from '@vercel/config/v1';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{getSignupVerificationUrl,login,performDeviceCodeFlow,saveDeviceCodeTokens}from"./chunk-P7GPJFZ7.js";import"./chunk-ULLWCOYC.js";import"./chunk-I46LFJJG.js";import"./chunk-5XJNPXQK.js";import"./chunk-PGF7MQK6.js";import"./chunk-EUJWN3RB.js";import"./chunk-MY4MONOH.js";import"./chunk-PPCFQQSU.js";import"./chunk-SQXB2UM4.js";import"./chunk-JAJW3P42.js";import"./chunk-SM5JI6QM.js";import"./chunk-VOZEB6PD.js";import"./chunk-RINZXCDJ.js";import"./chunk-FI772UVH.js";import"./chunk-EWWFNMPZ.js";import"./chunk-QGIQK47P.js";import"./chunk-AVSPFBLM.js";import"./chunk-XCJDGQO7.js";import"./chunk-YPTLSODC.js";import"./chunk-7HL2RPUO.js";import"./chunk-U7KCDTCH.js";import"./chunk-N3ZZ7FHQ.js";import"./chunk-GU6VIFR5.js";import"./chunk-6L236MNA.js";export{getSignupVerificationUrl,login,performDeviceCodeFlow,saveDeviceCodeTokens};
|
package/dist/chunks/{generate-cert-for-deploy-U7JF3HF3.js → generate-cert-for-deploy-SNWO4UCL.js}
RENAMED
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{createCertForCns,require_cjs,setupDomain}from"./chunk-
|
|
7
|
+
import{createCertForCns,require_cjs,setupDomain}from"./chunk-OI5JAHZK.js";import"./chunk-SKAUCH5L.js";import"./chunk-TRTEXGVN.js";import"./chunk-T3GQAMBJ.js";import"./chunk-XPXOV5UO.js";import"./chunk-JZRMH5UA.js";import"./chunk-QTKJC2O5.js";import"./chunk-SXUEGVWB.js";import"./chunk-6NPXWN5F.js";import"./chunk-K2MXVUWY.js";import"./chunk-5XJNPXQK.js";import"./chunk-MY4MONOH.js";import"./chunk-NOYJJRDK.js";import"./chunk-F2ZWW2IO.js";import"./chunk-B4ATVYZW.js";import"./chunk-PPCFQQSU.js";import"./chunk-YMM3VY3J.js";import"./chunk-SM5JI6QM.js";import"./chunk-VOZEB6PD.js";import{InvalidDomain,NowError}from"./chunk-RINZXCDJ.js";import"./chunk-FI772UVH.js";import{output_manager_default}from"./chunk-EWWFNMPZ.js";import"./chunk-QGIQK47P.js";import"./chunk-AVSPFBLM.js";import"./chunk-XCJDGQO7.js";import"./chunk-YPTLSODC.js";import"./chunk-7HL2RPUO.js";import"./chunk-U7KCDTCH.js";import"./chunk-N3ZZ7FHQ.js";import"./chunk-GU6VIFR5.js";import{__toESM}from"./chunk-6L236MNA.js";var import_tldts=__toESM(require_cjs(),1);async function generateCertForDeploy(client,contextName,deployURL){let parsedDomain=(0,import_tldts.parse)(deployURL),{domain}=parsedDomain;if(!domain)return new InvalidDomain(deployURL);output_manager_default.spinner(`Setting custom suffix domain ${domain}`);let result=await setupDomain(client,domain,contextName);if(output_manager_default.stopSpinner(),result instanceof NowError)return result;output_manager_default.spinner(`Generating a wildcard certificate for ${domain}`);let cert=await createCertForCns(client,[domain,`*.${domain}`],contextName);if(output_manager_default.stopSpinner(),cert instanceof NowError)return cert}export{generateCertForDeploy as default};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{getInvalidSubcommand}from"./chunk-TG2RCYTH.js";import{getSubcommand}from"./chunk-ETV3C2CV.js";import{AGENT_REASON}from"./chunk-T4LZS75P.js";import{buildCommandWithGlobalFlags,outputAgentError}from"./chunk-SQXB2UM4.js";import"./chunk-JAJW3P42.js";import"./chunk-VOZEB6PD.js";import"./chunk-RINZXCDJ.js";import"./chunk-FI772UVH.js";import{output_manager_default}from"./chunk-EWWFNMPZ.js";import"./chunk-QGIQK47P.js";import"./chunk-AVSPFBLM.js";import"./chunk-XCJDGQO7.js";import"./chunk-YPTLSODC.js";import"./chunk-7HL2RPUO.js";import"./chunk-U7KCDTCH.js";import"./chunk-N3ZZ7FHQ.js";import"./chunk-GU6VIFR5.js";import"./chunk-6L236MNA.js";var IMAGE_CONFIG={ls:["ls","list"],inspect:["inspect","get"],rm:["rm","remove","delete"]};async function image(client,argv,telemetry){let{subcommand,args}=getSubcommand(argv,IMAGE_CONFIG);if(subcommand==null){let message=argv.length===0?getInvalidSubcommand(IMAGE_CONFIG):`Unknown "vcr image" subcommand "${argv[0]}".`;return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message,next:[{command:buildCommandWithGlobalFlags(client.argv,"vcr image --help"),when:"Show valid image subcommands"}]},1),output_manager_default.error(`${message} Run \`vercel vcr image --help\`.`),1}switch(subcommand){case"ls":return(await import("./ls-WTAMOBVG.js")).default(client,args,telemetry);case"inspect":return(await import("./inspect-SZ4HH7QY.js")).default(client,args,telemetry);case"rm":return(await import("./rm-VQ2ESDWM.js")).default(client,args,telemetry);default:return output_manager_default.error(`Unhandled image subcommand: ${subcommand}`),1}}export{image as default};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{importBuilders,import_import_builders}from"./chunk-
|
|
7
|
+
import{importBuilders,import_import_builders}from"./chunk-BK7VICZ5.js";import"./chunk-CJPM2DXZ.js";import"./chunk-KKS7XWEX.js";import"./chunk-KJ6MUEGB.js";import"./chunk-HWWHR7H3.js";import"./chunk-2I64AYHG.js";import"./chunk-QRBAWXHP.js";import"./chunk-QYFRPNL2.js";import"./chunk-L3JDEHCQ.js";import"./chunk-QR7QPUFN.js";import"./chunk-N6CNMMSZ.js";import"./chunk-KK4AJES5.js";import"./chunk-SOJCELXH.js";import"./chunk-7T6TL3GQ.js";import"./chunk-NOYJJRDK.js";import"./chunk-F2ZWW2IO.js";import"./chunk-B4ATVYZW.js";import"./chunk-PPCFQQSU.js";import"./chunk-BRK4OB4B.js";import"./chunk-YMM3VY3J.js";import"./chunk-SM5JI6QM.js";import"./chunk-VOZEB6PD.js";import"./chunk-RINZXCDJ.js";import"./chunk-FI772UVH.js";import"./chunk-EWWFNMPZ.js";import"./chunk-QGIQK47P.js";import"./chunk-AVSPFBLM.js";import"./chunk-XCJDGQO7.js";import"./chunk-YPTLSODC.js";import"./chunk-7HL2RPUO.js";import"./chunk-U7KCDTCH.js";import"./chunk-N3ZZ7FHQ.js";import"./chunk-GU6VIFR5.js";import"./chunk-6L236MNA.js";var export_formatResolvedBuilders=import_import_builders.formatResolvedBuilders;var export_getBuildersDir=import_import_builders.getBuildersDir;export{export_formatResolvedBuilders as formatResolvedBuilders,export_getBuildersDir as getBuildersDir,importBuilders};
|
|
@@ -4,7 +4,7 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{repositoryPath,repositoryTagPath}from"./chunk-DFVNL5ML.js";import{emitVcrArgParseError,formatBytes,formatImageStatus,formatRelativeTime,formatTagReference,handleVcrApiError,requireVcrRepositoryAndTag,resolveVcrScope,validateVcrJsonOutput}from"./chunk-
|
|
7
|
+
import{repositoryPath,repositoryTagPath}from"./chunk-DFVNL5ML.js";import{emitVcrArgParseError,formatBytes,formatImageStatus,formatRelativeTime,formatTagReference,handleVcrApiError,requireVcrRepositoryAndTag,resolveVcrScope,validateVcrJsonOutput}from"./chunk-MV6LWP5R.js";import"./chunk-FA6O7FPC.js";import"./chunk-D4MW3RDW.js";import{tagsInspectSubcommand}from"./chunk-O7G3CZ42.js";import"./chunk-HWWHR7H3.js";import"./chunk-2I64AYHG.js";import"./chunk-QTKJC2O5.js";import"./chunk-T4LZS75P.js";import"./chunk-SOJCELXH.js";import"./chunk-K2MXVUWY.js";import"./chunk-5XJNPXQK.js";import{printError}from"./chunk-PGF7MQK6.js";import{parseArguments}from"./chunk-EUJWN3RB.js";import"./chunk-MY4MONOH.js";import"./chunk-NOYJJRDK.js";import"./chunk-F2ZWW2IO.js";import"./chunk-B4ATVYZW.js";import"./chunk-PPCFQQSU.js";import"./chunk-SQXB2UM4.js";import{getFlagsSpecification}from"./chunk-JAJW3P42.js";import"./chunk-YMM3VY3J.js";import"./chunk-SM5JI6QM.js";import"./chunk-VOZEB6PD.js";import{isAPIError}from"./chunk-RINZXCDJ.js";import"./chunk-FI772UVH.js";import{output_manager_default}from"./chunk-EWWFNMPZ.js";import"./chunk-QGIQK47P.js";import"./chunk-AVSPFBLM.js";import"./chunk-XCJDGQO7.js";import"./chunk-YPTLSODC.js";import"./chunk-7HL2RPUO.js";import{require_source}from"./chunk-U7KCDTCH.js";import"./chunk-N3ZZ7FHQ.js";import"./chunk-GU6VIFR5.js";import{__toESM}from"./chunk-6L236MNA.js";var import_chalk=__toESM(require_source(),1);function printTag(tag,scope,repository){output_manager_default.print(`
|
|
8
8
|
`),output_manager_default.print(` ${import_chalk.default.cyan("ID")} ${tag.imageId}
|
|
9
9
|
`),output_manager_default.print(` ${import_chalk.default.cyan("Digest")} ${tag.manifestDigest}
|
|
10
10
|
`),output_manager_default.print(` ${import_chalk.default.cyan("Image")} ${formatTagReference(scope.teamSlug,scope.projectName,repository.name,tag.tag)}
|
|
@@ -0,0 +1,13 @@
|
|
|
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{formatTriggerOperator,getGroupStartedAt,getGroupTitle,getGroupType,humanizeReference,normalizeTimestamp,renderAlertTable}from"./chunk-7PNYOSDU.js";import{resolveAlertsScope}from"./chunk-KF62ZVXT.js";import{formatGranularity}from"./chunk-IVSSTHB6.js";import{formatDate}from"./chunk-6PFC3KWQ.js";import"./chunk-GZNDA6SV.js";import"./chunk-WRILLB46.js";import{outputError}from"./chunk-FA6O7FPC.js";import"./chunk-GHAY4PSD.js";import{truncateEnd,truncateMiddle}from"./chunk-MBL6TXEJ.js";import{validateJsonOutput}from"./chunk-D4MW3RDW.js";import{inspectSubcommand}from"./chunk-EIXOJUNN.js";import"./chunk-OAKO6LVS.js";import"./chunk-QTKJC2O5.js";import{AGENT_REASON}from"./chunk-T4LZS75P.js";import"./chunk-6TAQ6OWD.js";import"./chunk-WPS6JZF6.js";import"./chunk-K2MXVUWY.js";import"./chunk-5XJNPXQK.js";import{printError}from"./chunk-PGF7MQK6.js";import{parseArguments}from"./chunk-EUJWN3RB.js";import"./chunk-MY4MONOH.js";import"./chunk-NOYJJRDK.js";import"./chunk-F2ZWW2IO.js";import"./chunk-B4ATVYZW.js";import"./chunk-PPCFQQSU.js";import"./chunk-OSCCYU74.js";import{buildCommandWithGlobalFlags,outputAgentError}from"./chunk-SQXB2UM4.js";import{getFlagsSpecification}from"./chunk-JAJW3P42.js";import"./chunk-YMM3VY3J.js";import"./chunk-SM5JI6QM.js";import"./chunk-VOZEB6PD.js";import{isAPIError}from"./chunk-RINZXCDJ.js";import{packageName}from"./chunk-FI772UVH.js";import{output_manager_default}from"./chunk-EWWFNMPZ.js";import"./chunk-QGIQK47P.js";import"./chunk-AVSPFBLM.js";import"./chunk-XCJDGQO7.js";import"./chunk-YPTLSODC.js";import"./chunk-7HL2RPUO.js";import{require_source}from"./chunk-U7KCDTCH.js";import"./chunk-N3ZZ7FHQ.js";import"./chunk-GU6VIFR5.js";import{__toESM}from"./chunk-6L236MNA.js";var import_chalk=__toESM(require_source(),1);var aggregationLabels={sum:"Sum",avg:"Average",min:"Min",max:"Max",p50:"P50",p75:"P75",p90:"P90",p95:"P95",p99:"P99",stddev:"Std Dev",unique:"Unique",persecond:"Per Second",percent:"Percent"},formatCustomAlertRatioBelowFivePercent=new Intl.NumberFormat("en-US",{maximumFractionDigits:2,minimumFractionDigits:2,style:"percent"}),formatCustomAlertRatioThresholdValue=new Intl.NumberFormat("en-US",{maximumFractionDigits:4,minimumFractionDigits:0,style:"percent"});function getGroupStatus(group){if(group.status)return group.status;let alerts=group.alerts??[];return alerts.some(alert=>alert.status==="active")?"active":alerts.length>0?"resolved":"-"}function humanizeLabel(value){return humanizeReference(value,{case:"title"})}function formatAlertFieldValue(value,maxLength=64){if(value==null)return;let displayValue=typeof value=="number"?formatNumber(value):String(value);if(displayValue)return truncateMiddle(displayValue,maxLength)}function formatNumber(value){let absValue=Math.abs(value),sign=value<0?"-":"";for(let[threshold,suffix]of[[1e9,"B"],[1e6,"M"],[1e3,"k"]])if(absValue>=threshold)return`${sign}${(absValue/threshold).toFixed(1).replace(/\.0$/,"")}${suffix}`;return Number.isInteger(value)?String(value):value.toFixed(2).replace(/\.?0+$/,"")}function parseFormattedNumber(value){let trimmed=value.trim();if(!trimmed)return;let number=Number(trimmed.replace(/,/g,""));return Number.isFinite(number)?number:void 0}function formatRatio(value){if(value.trim().endsWith("%"))return value;let number=parseFormattedNumber(value);if(number===void 0)return value;let percent=number*100;return percent>=5?`${Math.floor(percent)}%`:formatCustomAlertRatioBelowFivePercent.format(number)}function formatRatioThreshold(value){if(value.trim().endsWith("%"))return value;let number=parseFormattedNumber(value);return number===void 0?value:formatCustomAlertRatioThresholdValue.format(number)}function getAlertSonarQuery(alert){return alert.sonarQuery??alert.data?.sonarQuery}function getCustomAlertBaselineTitle(alert){let granularity=getAlertSonarQuery(alert)?.granularity;return(granularity&&("hours"in granularity||"days"in granularity)?"7-day baseline":"24-hour baseline").replace(/\b[a-z]/g,character=>character.toUpperCase())}function appendUnit(value,unit){return!unit||unit==="score"?value:unit==="ratio"?formatRatio(value):unit==="%"?value.endsWith("%")?value:`${value}%`:value.toLowerCase().includes(unit.toLowerCase())?value:`${value} ${unit}`}function formatThreshold(alert){let data=alert.data,formatted=alert.formattedValues?.formattedThreshold??(data?.triggerThreshold===void 0?void 0:formatNumber(data.triggerThreshold));if(!formatted)return;let operator=formatTriggerOperator(data?.triggerOperator),threshold=data?.triggerType==="anomaly"?`${formatted} z-score`:alert.unit==="ratio"?formatRatioThreshold(formatted):appendUnit(formatted,alert.unit);return[operator,threshold].filter(Boolean).join(" ")}function getRuleIds(alert){let ids=new Set,dataRuleId=alert.data?.ruleId;dataRuleId&&ids.add(dataRuleId);for(let ruleId of alert.rules??[])ruleId&&ids.add(ruleId);return[...ids]}function getAlertResolvedAt(alert){return normalizeTimestamp(alert.recordedResolvedAt??alert.resolvedAt)}function getSignalRows(alert){let rows=[],formattedValues=alert.formattedValues??{},observed=formattedValues.formattedCount,baseline=formattedValues.formattedAvg,change=[formattedValues.changeDirection,formattedValues.changeAmount].filter(Boolean).join(" "),zscore=alert.data?.zscore,threshold=formatThreshold(alert),minThreshold=alert.data?.minThreshold,isRatioFormulaAlert=!!getCustomAlertFormula(alert);return alert.eventLabel&&rows.push(["Event",alert.eventLabel]),alert.measureLabel&&rows.push(["Measure",alert.measureLabel]),observed&&rows.push(["Observed Value",appendUnit(observed,alert.unit)]),baseline&&rows.push([alert.type==="custom_alert"&&alert.data?.triggerType==="anomaly"?getCustomAlertBaselineTitle(alert):"Baseline",appendUnit(baseline,alert.unit)]),change&&rows.push(["Change",change]),zscore!==void 0&&rows.push(["Observed Deviation",`${formatNumber(zscore)} z-score`]),threshold&&rows.push(["Threshold",threshold]),minThreshold!==void 0&&!isRatioFormulaAlert&&rows.push(["Minimum",alert.unit==="ratio"?formatNumber(minThreshold):appendUnit(formatNumber(minThreshold),alert.unit)]),formattedValues.errorRate&&rows.push(["Error Rate",formattedValues.errorRate]),formattedValues.avgErrorRate&&rows.push(["Baseline Error Rate",formattedValues.avgErrorRate]),rows.push(...getFieldRows(alert)),rows}function getFieldRows(alert){let fields=alert.data?.fields;if(!fields)return[];let groupBy=getAlertSonarQuery(alert)?.groupBy??[];return[...groupBy,...Object.keys(fields).filter(key=>!groupBy.includes(key))].flatMap(key=>{let value=fields[key],displayValue=formatAlertFieldValue(value);return displayValue?[[humanizeLabel(key),displayValue]]:[]})}function formatAggregation(value){return value?aggregationLabels[value]??humanizeLabel(value):void 0}function formatQueryReference(value){return value?humanizeLabel(value):void 0}function formatRollupDetail(rollup,fallbackMeasure){if(!rollup)return;let aggregation=formatAggregation(rollup.aggregation),measure=fallbackMeasure??formatQueryReference(rollup.measure);return[aggregation,measure].filter(Boolean).join(" ")||void 0}function getPrimaryRollup(rollups){return Object.values(rollups??{})[0]}function getCustomAlertFormula(alert){let formula=alert.data?.formula;if(formula?.operator==="divide"&&formula.left&&formula.right)return{operator:formula.operator,left:formula.left,right:formula.right}}function getQueryRows(alert){if(alert.type!=="custom_alert")return[];let query=getAlertSonarQuery(alert);if(!query)return[];let formula=getCustomAlertFormula(alert),rows=[],addRow=(label,value)=>{value&&rows.push([label,truncateMiddle(value,120)])};if(addRow("Event",alert.eventLabel??formatQueryReference(query.event)),formula)addRow("Numerator",formatRollupDetail(query.rollups?.[formula.left])),addRow("Denominator",formatRollupDetail(query.rollups?.[formula.right]));else{let primaryRollup=getPrimaryRollup(query.rollups);addRow("Measure",alert.measureLabel??formatQueryReference(primaryRollup?.measure)),addRow("Aggregation",formatAggregation(primaryRollup?.aggregation))}addRow("Granularity",formatGranularity(query.granularity));let groupBy=query.groupBy?.filter(Boolean)??[];if(groupBy.length>0&&addRow("Group by",groupBy.map(humanizeLabel).join(", ")),formula&&typeof alert.data?.minThreshold=="number"&&addRow("Minimum Numerator",formatNumber(alert.data.minThreshold)),addRow("Filter by",query.filter?.trim()),formula)for(let[label,rollupName]of[["Numerator filter",formula.left],["Denominator filter",formula.right]])addRow(label,query.rollups?.[rollupName]?.filter?.trim());return rows}function getDetailRows(alert){let data=alert.data;if(!data)return[];let rows=[],addRow=(label,value)=>{let displayValue=formatAlertFieldValue(value);displayValue&&rows.push([label,displayValue])};return addRow("Route",data.route),addRow("Status Group",data.statusGroup),addRow("Deployment ID",data.deploymentId),rows}function renderAlertSections(alert){let lines=[],signalRows=getSignalRows(alert);signalRows.length>0&&(lines.push(import_chalk.default.cyan("Signals")),lines.push(renderAlertTable(signalRows,3)));let queryRows=getQueryRows(alert);return queryRows.length>0&&(lines.push(import_chalk.default.cyan("Query")),lines.push(renderAlertTable(queryRows,3))),lines.join(`
|
|
8
|
+
`)}function renderAlert(alert,index,totalAlerts){let title=alert.title||`Alert ${index+1}`,ruleIds=getRuleIds(alert),resolvedAt=getAlertResolvedAt(alert),sections=renderAlertSections(alert),summaryRows=[["Alert id",alert.id||"-"],["Type",alert.type||"-"],["Status",alert.status||"-"],["Started At",formatDate(normalizeTimestamp(alert.recordedStartedAt??alert.startedAt))],...resolvedAt!==void 0?[["Resolved At",formatDate(resolvedAt)]]:[],...ruleIds.length>0?[["Rule id",ruleIds.map(id=>truncateMiddle(id,48)).join(", ")]]:[],...getDetailRows(alert)];return[import_chalk.default.bold(totalAlerts>1?`Alert ${index+1}: ${title}`:title),renderAlertTable(summaryRows,3),...sections?[sections]:[]].join(`
|
|
9
|
+
`)}function printAlertGroup(group,groupId){let alerts=group.alerts??[],singleAlert=alerts.length===1?alerts[0]:void 0,singleAlertRuleIds=singleAlert?getRuleIds(singleAlert):[],singleAlertResolvedAt=singleAlert?getAlertResolvedAt(singleAlert):void 0,summaryRows=[["Title",truncateEnd(getGroupTitle(group),80)],["Group id",group.id||groupId],["Type",getGroupType(group)],["Status",getGroupStatus(group)],["Started At",formatDate(getGroupStartedAt(group))],...singleAlertResolvedAt!==void 0?[["Resolved At",formatDate(singleAlertResolvedAt)]]:[],["Alerts",String(alerts.length)],...singleAlert?.id?[["Alert id",singleAlert.id]]:[],...singleAlertRuleIds.length>0?[["Rule id",singleAlertRuleIds.map(id=>truncateMiddle(id,48)).join(", ")]]:[],...singleAlert?getDetailRows(singleAlert):[]],renderedAlerts=alerts.length>0?alerts.length===1?renderAlertSections(alerts[0]):alerts.map((alert,index)=>renderAlert(alert,index,alerts.length)).join(`
|
|
10
|
+
|
|
11
|
+
`):"No alerts in this group.";output_manager_default.print(["",`${import_chalk.default.bold("Alert group")} ${import_chalk.default.cyan(group.id||groupId)}`,renderAlertTable(summaryRows,3),"",renderedAlerts,""].join(`
|
|
12
|
+
`))}async function inspect(client,argv){let parsedArgs,spec=getFlagsSpecification(inspectSubcommand.options);try{parsedArgs=parseArguments(argv,spec)}catch(e){let msg=e instanceof Error?e.message:String(e),projectFlagMissingArg=msg.includes("--project")&&msg.includes("requires argument");return 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:projectFlagMissingArg?[{command:buildCommandWithGlobalFlags(client.argv,"alerts inspect <groupId> --project <name-or-id>"),when:"Re-run with placeholders replaced"}]:[{command:buildCommandWithGlobalFlags(client.argv,"alerts inspect --help"),when:"See valid `alerts inspect` usage"}]},1),printError(e),1}let groupId=parsedArgs.args[0],fr=validateJsonOutput(parsedArgs.flags);if(!fr.valid)return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:fr.error},1),output_manager_default.error(fr.error),1;if(!groupId)return outputAgentError(client,{status:"error",reason:AGENT_REASON.MISSING_ARGUMENTS,message:`Missing group id. Example: ${packageName} alerts inspect <groupId>`,next:[{command:buildCommandWithGlobalFlags(client.argv,"alerts inspect <groupId>"),when:"Replace <groupId> with a group id from `vercel alerts`"}]},1),outputError(client,fr.jsonOutput,"MISSING_ARGUMENTS","Usage: `vercel alerts inspect <groupId>`");let scope=await resolveAlertsScope(client,{project:parsedArgs.flags["--project"],all:parsedArgs.flags["--all"],jsonOutput:fr.jsonOutput,command:`alerts inspect ${groupId}`});if(typeof scope=="number")return scope;let query=new URLSearchParams({teamId:scope.teamId});scope.projectId&&query.set("projectId",scope.projectId);let path=`/alerts/v3/groups/${encodeURIComponent(groupId)}?${query.toString()}`;output_manager_default.spinner("Fetching alert group...");try{let group=await client.fetch(path);return fr.jsonOutput?client.stdout.write(`${JSON.stringify({group},null,2)}
|
|
13
|
+
`):printAlertGroup(group,groupId),0}catch(err){if(isAPIError(err)){let msg=err.serverMessage||`API error (${err.status}).`,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;return outputAgentError(client,{status:"error",reason,message:msg,...err.status===401||err.status===403?{hint:"Confirm team scope; use --scope <team-slug> if the group belongs to another team.",next:[{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"See current user and team"},{command:buildCommandWithGlobalFlags(client.argv,`alerts inspect ${groupId}`),when:"Retry after fixing scope or permissions"}]}:{}},1),outputError(client,fr.jsonOutput,err.code||"API_ERROR",msg)}throw err}finally{output_manager_default.stopSpinner()}}export{inspect as default};
|
|
@@ -4,7 +4,7 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{repositoryPath}from"./chunk-DFVNL5ML.js";import{emitVcrArgParseError,formatRelativeTime,handleVcrApiError,requireVcrRepository,resolveVcrScope,validateVcrJsonOutput}from"./chunk-
|
|
7
|
+
import{repositoryPath}from"./chunk-DFVNL5ML.js";import{emitVcrArgParseError,formatRelativeTime,handleVcrApiError,requireVcrRepository,resolveVcrScope,validateVcrJsonOutput}from"./chunk-MV6LWP5R.js";import"./chunk-FA6O7FPC.js";import"./chunk-D4MW3RDW.js";import{inspectSubcommand}from"./chunk-65JYSI26.js";import"./chunk-YMVDWVMO.js";import"./chunk-O7G3CZ42.js";import"./chunk-N3N5UHIL.js";import"./chunk-HWWHR7H3.js";import"./chunk-2I64AYHG.js";import"./chunk-QTKJC2O5.js";import"./chunk-T4LZS75P.js";import"./chunk-SOJCELXH.js";import"./chunk-K2MXVUWY.js";import"./chunk-5XJNPXQK.js";import{printError}from"./chunk-PGF7MQK6.js";import{parseArguments}from"./chunk-EUJWN3RB.js";import"./chunk-MY4MONOH.js";import"./chunk-NOYJJRDK.js";import"./chunk-F2ZWW2IO.js";import"./chunk-B4ATVYZW.js";import"./chunk-PPCFQQSU.js";import"./chunk-SQXB2UM4.js";import{getFlagsSpecification}from"./chunk-JAJW3P42.js";import"./chunk-YMM3VY3J.js";import"./chunk-SM5JI6QM.js";import"./chunk-VOZEB6PD.js";import{isAPIError}from"./chunk-RINZXCDJ.js";import"./chunk-FI772UVH.js";import{output_manager_default}from"./chunk-EWWFNMPZ.js";import"./chunk-QGIQK47P.js";import"./chunk-AVSPFBLM.js";import"./chunk-XCJDGQO7.js";import"./chunk-YPTLSODC.js";import"./chunk-7HL2RPUO.js";import{require_source}from"./chunk-U7KCDTCH.js";import"./chunk-N3ZZ7FHQ.js";import"./chunk-GU6VIFR5.js";import{__toESM}from"./chunk-6L236MNA.js";var import_chalk=__toESM(require_source(),1);function printRepository(repository){output_manager_default.print(`
|
|
8
8
|
`),output_manager_default.print(` ${import_chalk.default.cyan("Name")} ${repository.name}
|
|
9
9
|
`),output_manager_default.print(` ${import_chalk.default.cyan("ID")} ${repository.id}
|
|
10
10
|
`),output_manager_default.print(` ${import_chalk.default.cyan("Project ID")} ${repository.projectId}
|