vercel 59.17.0 → 59.18.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-EVIN2PRI.js → add-G2FG4MZK.js} +1 -1
- package/dist/chunks/{add-KHUJ5BSP.js → add-JYMUUDWF.js} +1 -1
- package/dist/chunks/{add-7VKP56JJ.js → add-PMMNU7RN.js} +1 -1
- package/dist/chunks/{build-JX4MLRH3.js → build-IVYHMLHB.js} +1 -1
- package/dist/chunks/{chunk-XGWR4HFH.js → chunk-22NPN6VB.js} +1 -1
- package/dist/chunks/{chunk-G7Y77DFH.js → chunk-254TC5HX.js} +1 -1
- package/dist/chunks/{chunk-ZYTGXCXP.js → chunk-2NOOW6ZP.js} +1 -1
- package/dist/chunks/{chunk-JTVVBRW7.js → chunk-2Q47GHFX.js} +1 -1
- package/dist/chunks/{chunk-PCFGV4Y7.js → chunk-2YBNGUYY.js} +1 -1
- package/dist/chunks/chunk-46NPQBNU.js +27 -0
- package/dist/chunks/{chunk-EGMJRU5P.js → chunk-4A5YIRNE.js} +1 -1
- package/dist/chunks/{chunk-XSVBYDYI.js → chunk-4VGOAPFY.js} +1 -1
- package/dist/chunks/{chunk-HJWWMWLL.js → chunk-66K6BTX2.js} +1 -1
- package/dist/chunks/{chunk-G77VJ754.js → chunk-72ZDPBW5.js} +1 -1
- package/dist/chunks/{chunk-GRNTLNC7.js → chunk-7NYQ7CTP.js} +1 -1
- package/dist/chunks/{chunk-HBFPLBTX.js → chunk-7O3KGTQ3.js} +1 -1
- package/dist/chunks/{chunk-3EZENL67.js → chunk-7VWHD7WQ.js} +1 -1
- package/dist/chunks/chunk-AL5JWXZE.js +9 -0
- package/dist/chunks/{chunk-KH4SXKLD.js → chunk-BDCZFSP2.js} +1 -1
- package/dist/chunks/{chunk-R2TGGVCT.js → chunk-CBWDIZAF.js} +1 -1
- package/dist/chunks/chunk-CJ3LL5E7.js +7 -0
- package/dist/chunks/chunk-CJPM2DXZ.js +7 -0
- package/dist/chunks/{chunk-JSFWLEP3.js → chunk-CRNMRUJK.js} +1 -1
- package/dist/chunks/{chunk-5QNKMAN3.js → chunk-DD5EEWWR.js} +3 -3
- package/dist/chunks/{chunk-YV6CTDHR.js → chunk-DLKR2CG6.js} +1 -1
- package/dist/chunks/chunk-EEKVUD55.js +8 -0
- package/dist/chunks/{chunk-6YAADRQB.js → chunk-EGG7SPNM.js} +1 -1
- package/dist/chunks/{chunk-V3N37D4D.js → chunk-FEV4CIBN.js} +1 -1
- package/dist/chunks/{chunk-PQCAYAZ3.js → chunk-FM2ODCMZ.js} +1 -1
- package/dist/chunks/{chunk-ZB6NNKOB.js → chunk-FOUWMNT7.js} +1 -1
- package/dist/chunks/{chunk-OTSU5NS3.js → chunk-FZIRRUBO.js} +1 -1
- package/dist/chunks/{chunk-4QX77CP7.js → chunk-GGZODU6S.js} +1 -1
- package/dist/chunks/{chunk-ZZQRMRWD.js → chunk-GWPIATTW.js} +1 -1
- package/dist/chunks/{chunk-3DRX67W4.js → chunk-H7S7TVBZ.js} +1 -1
- package/dist/chunks/{chunk-ZJLMBHD6.js → chunk-HFDQ3P7T.js} +1 -1
- package/dist/chunks/{chunk-UMCKAEPK.js → chunk-HQEAROJN.js} +1 -1
- package/dist/chunks/chunk-HUHUQXHY.js +7 -0
- package/dist/chunks/{chunk-A5SVOPQK.js → chunk-HUI32UNA.js} +4 -4
- package/dist/chunks/chunk-I7QY6ROQ.js +9 -0
- package/dist/chunks/{chunk-QY4UZGLW.js → chunk-IG7TNQGL.js} +1 -1
- package/dist/chunks/{chunk-K3KJZLBD.js → chunk-JDQP267R.js} +1 -1
- package/dist/chunks/{chunk-AJQZAHAG.js → chunk-JNFC2ASC.js} +1 -1
- package/dist/chunks/{chunk-ZIPVX7LD.js → chunk-KACMQTK7.js} +1 -1
- package/dist/chunks/{chunk-L243RUIR.js → chunk-KCSMPBFZ.js} +1 -1
- package/dist/chunks/chunk-KNQ3Y22G.js +10 -0
- package/dist/chunks/{chunk-HEE6XLHF.js → chunk-LASMHNUP.js} +2 -2
- package/dist/chunks/chunk-LX5GOY7N.js +8 -0
- package/dist/chunks/{chunk-UVOVAU43.js → chunk-MOPFNLFK.js} +1 -1
- package/dist/chunks/{chunk-QMY5EY5M.js → chunk-Q2TOOW5N.js} +1 -1
- package/dist/chunks/chunk-QDE5CFRC.js +11 -0
- package/dist/chunks/{chunk-ZCPBIHDL.js → chunk-QE5VDLPY.js} +2 -2
- package/dist/chunks/{chunk-75CPY75D.js → chunk-QTSRDWKO.js} +1 -1
- package/dist/chunks/{chunk-O67S7BW6.js → chunk-QVINTB7T.js} +1 -1
- package/dist/chunks/{chunk-UZBQDJR7.js → chunk-QYPQGOSO.js} +1 -1
- package/dist/chunks/chunk-RCHRY3CN.js +7 -0
- package/dist/chunks/{chunk-Z6Y55QJW.js → chunk-RTRCTYW6.js} +2 -2
- package/dist/chunks/{chunk-4NE5IQ25.js → chunk-RVJ2E3BM.js} +1 -1
- package/dist/chunks/{chunk-RAIBQIKB.js → chunk-SA2SQV6P.js} +1 -1
- package/dist/chunks/{chunk-G6CTAHKY.js → chunk-SECZRAWX.js} +1 -1
- package/dist/chunks/{chunk-V6GSMYQB.js → chunk-SJ6ZELKN.js} +1 -1
- package/dist/chunks/{chunk-LVWXFCBP.js → chunk-SQ5VXZP6.js} +1 -1
- package/dist/chunks/{chunk-3TXEXPUW.js → chunk-TCS3FDID.js} +1 -1
- package/dist/chunks/{chunk-XQ73QIQ3.js → chunk-U6TAKLJ6.js} +1 -1
- package/dist/chunks/{chunk-NUGLE4QY.js → chunk-UED2PPFP.js} +1 -1
- package/dist/chunks/chunk-VOZEB6PD.js +7 -0
- package/dist/chunks/chunk-W2XUH2WW.js +25 -0
- package/dist/chunks/{chunk-EVZRQGNK.js → chunk-WSNDO7JA.js} +1 -1
- package/dist/chunks/{chunk-MVAM5QXS.js → chunk-WTXJ4X2D.js} +1 -1
- package/dist/chunks/{chunk-CKKCHHEZ.js → chunk-WUMV6WRR.js} +1 -1
- package/dist/chunks/{chunk-TJCIHDPZ.js → chunk-XQWBEAKZ.js} +1 -1
- package/dist/chunks/{chunk-2B2MN3U5.js → chunk-XV6SDZIO.js} +1 -1
- package/dist/chunks/{chunk-6MSXYTO7.js → chunk-XZYKYDQO.js} +1 -1
- package/dist/chunks/{chunk-CN2QZO4U.js → chunk-Y7SVAW54.js} +1 -1
- package/dist/chunks/{chunk-MPV7JL34.js → chunk-YCFYVPFP.js} +1 -1
- package/dist/chunks/{chunk-JYAUUIR4.js → chunk-YNINVUX2.js} +1 -1
- package/dist/chunks/{chunk-QGIGNMII.js → chunk-YWDSQTGK.js} +1 -1
- package/dist/chunks/{chunk-QIM3U2QM.js → chunk-YYH7OWMO.js} +1 -1
- package/dist/chunks/{chunk-AB4GEWGP.js → chunk-ZQGW6A7G.js} +1 -1
- package/dist/chunks/{chunk-6RIQPTJA.js → chunk-ZVFZIWBV.js} +1 -1
- package/dist/chunks/{clear-X4OSHTWA.js → clear-QWLAXTZ2.js} +1 -1
- package/dist/chunks/{compile-vercel-config-QSK54DR5.js → compile-vercel-config-7Z4U2GXV.js} +1 -1
- package/dist/chunks/{config-CYB2D7JW.js → config-DWUI22HZ.js} +1 -1
- package/dist/chunks/config-S2ZQRGUM.js +7 -0
- package/dist/chunks/connect-git-provider-WOJ5VGWD.js +7 -0
- package/dist/chunks/{delete-FGAGJXOB.js → delete-DKXWEXSY.js} +1 -1
- package/dist/chunks/{delete-VCTCCONO.js → delete-LJFDZG3J.js} +1 -1
- package/dist/chunks/{detect-projects-KARO5GUW.js → detect-projects-64MZJZ6M.js} +1 -1
- package/dist/chunks/{detect-services-E6YHXKW4.js → detect-services-OYKTY23L.js} +1 -1
- package/dist/chunks/{disable-HH54G52S.js → disable-5ZNYIRQ6.js} +1 -1
- package/dist/chunks/{discard-5WINBWIU.js → discard-VGPXMVDP.js} +1 -1
- package/dist/chunks/{edit-VRGGDLHE.js → edit-OAUR6VZN.js} +1 -1
- package/dist/chunks/{edit-XPCNKJWN.js → edit-PZJIUQUQ.js} +1 -1
- package/dist/chunks/{enable-YDUGO5UD.js → enable-XHKXM6ZO.js} +1 -1
- package/dist/chunks/{exec-4AISDHUV.js → exec-ZLT5KH2Z.js} +1 -1
- package/dist/chunks/{export-NHFTH2RG.js → export-WJ5AOD5D.js} +1 -1
- package/dist/chunks/future-CFQTZYLF.js +7 -0
- package/dist/chunks/{generate-cert-for-deploy-XRP7KJJT.js → generate-cert-for-deploy-MLBCRZP7.js} +1 -1
- package/dist/chunks/{image-F7YIEOEF.js → image-O62TT3WT.js} +1 -1
- package/dist/chunks/import-builders-XBF4XRUV.js +7 -0
- package/dist/chunks/{inspect-PG2FOH2K.js → inspect-37P6UWRK.js} +1 -1
- package/dist/chunks/{inspect-2ODMUOBD.js → inspect-5UD3BTCK.js} +1 -1
- package/dist/chunks/{inspect-3FLLLXNZ.js → inspect-JNAVK3W2.js} +1 -1
- package/dist/chunks/{inspect-IGC2Q4VF.js → inspect-PTE3AJIM.js} +1 -1
- package/dist/chunks/{inspect-BDBUAW64.js → inspect-ZEQB7B56.js} +1 -1
- package/dist/chunks/{list-XTWDVN6W.js → list-BCNACV7V.js} +1 -1
- package/dist/chunks/{list-DPSVL3LB.js → list-D4WFKHXH.js} +1 -1
- package/dist/chunks/{list-DPLMC7O6.js → list-NFRKB6ZN.js} +1 -1
- package/dist/chunks/{login-XBBIV5CZ.js → login-IN4CKJYT.js} +1 -1
- package/dist/chunks/login-YBF2T6BO.js +7 -0
- package/dist/chunks/{logs-ZMEAEAT2.js → logs-3ULFZW4S.js} +1 -1
- package/dist/chunks/{ls-AD6U4YKQ.js → ls-454PHZ45.js} +1 -1
- package/dist/chunks/{ls-AOKYY6S4.js → ls-6P2SJGIV.js} +1 -1
- package/dist/chunks/{ls-TQCHJ433.js → ls-A2FWZ3NF.js} +1 -1
- package/dist/chunks/{ls-ITZ7B6PN.js → ls-AOXH6ROK.js} +1 -1
- package/dist/chunks/{ls-FGCLFYVB.js → ls-KOJYZ2MR.js} +1 -1
- package/dist/chunks/{ls-HV6R6EFU.js → ls-M4AAACDP.js} +1 -1
- package/dist/chunks/{ls-M6LA6GW2.js → ls-SQLHYCYD.js} +1 -1
- package/dist/chunks/{mutate-ECYH3M3M.js → mutate-VRGKUIKY.js} +1 -1
- package/dist/chunks/{notifications-ZOG67PRF.js → notifications-EWKMY3H6.js} +1 -1
- package/dist/chunks/{open-H6UQKAZ4.js → open-WLDHUEDQ.js} +1 -1
- package/dist/chunks/openapi-V5CKADGX.js +7 -0
- package/dist/chunks/{permissions-UXSL3L5W.js → permissions-6GBDJTT6.js} +1 -1
- package/dist/chunks/prompt-missing-credentials-BTUGE7QE.js +7 -0
- package/dist/chunks/{publish-LVRMJU7C.js → publish-2UPLM3TI.js} +1 -1
- package/dist/chunks/pull-Y5CUBUU7.js +7 -0
- package/dist/chunks/{purchase-domain-if-available-GLGUG72T.js → purchase-domain-if-available-IMVQLQ5H.js} +1 -1
- package/dist/chunks/{push-BR24ODVX.js → push-CAAKZO2C.js} +1 -1
- package/dist/chunks/{query-CDQJX2Z7.js → query-UFFZMZWM.js} +2 -2
- package/dist/chunks/reauthenticate-BUEUJA3T.js +7 -0
- package/dist/chunks/{reorder-4CT3NI3X.js → reorder-YMD7BWAB.js} +1 -1
- package/dist/chunks/{reply-6SBUWKEV.js → reply-3KG3AZCJ.js} +1 -1
- package/dist/chunks/{resolve-4YRSE3DN.js → resolve-JBH2ULOU.js} +1 -1
- package/dist/chunks/{restore-HKI7YSAI.js → restore-Y4Z3F6HQ.js} +1 -1
- package/dist/chunks/{rm-ZZYVVAWZ.js → rm-G2VITZWG.js} +1 -1
- package/dist/chunks/{rm-H3UFGM5B.js → rm-OPYE65YL.js} +1 -1
- package/dist/chunks/{rm-EHWULTJ4.js → rm-RG2M3HCR.js} +1 -1
- package/dist/chunks/{rm-4WGNHC36.js → rm-S2XKAZ2G.js} +1 -1
- package/dist/chunks/{rm-7YF4FPRG.js → rm-SUIELRWK.js} +1 -1
- package/dist/chunks/routes-ZD7XUKLY.js +7 -0
- package/dist/chunks/{rule-inspect-QJKXA6GM.js → rule-inspect-NUSKPGGY.js} +1 -1
- package/dist/chunks/{rules-LG2IKQ7A.js → rules-HRB2B2DX.js} +1 -1
- package/dist/chunks/{schema-BIFEX4HY.js → schema-HISMGDPE.js} +1 -1
- package/dist/chunks/{schema-2OJNI6A5.js → schema-MAANM5RD.js} +1 -1
- package/dist/chunks/{select-org-KSCYSESV.js → select-org-EMVG2OX2.js} +1 -1
- package/dist/chunks/{set-GYCTXDOC.js → set-FVZSBB5K.js} +1 -1
- package/dist/chunks/setup-and-link-V2VNR6UN.js +7 -0
- package/dist/chunks/{tags-C7RMO53H.js → tags-GH3U4E6I.js} +1 -1
- package/dist/chunks/{types-LRXQEDYI.js → types-6SBDA4SL.js} +1 -1
- package/dist/chunks/{update-4ZU5XKA2.js → update-R536DPNI.js} +1 -1
- package/dist/chunks/{chunk-XFVGX5HG.js → vlt-builder-graph-B4DFIUS6.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 +12 -11
- 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 +594 -566
- package/dist/index.js +5 -5
- package/dist/version.mjs +1 -1
- package/package.json +16 -16
- package/dist/chunks/chunk-3AKI2QN6.js +0 -13
- package/dist/chunks/chunk-57GHYR4Y.js +0 -25
- package/dist/chunks/chunk-6SLI6JAA.js +0 -8
- package/dist/chunks/chunk-HODOBPBQ.js +0 -7
- package/dist/chunks/chunk-HTC6KO2B.js +0 -7
- package/dist/chunks/chunk-LNPMDXBJ.js +0 -7
- package/dist/chunks/chunk-LSBEGBBX.js +0 -9
- package/dist/chunks/chunk-NS4FH2TY.js +0 -11
- package/dist/chunks/chunk-OMHZEZGJ.js +0 -8
- package/dist/chunks/chunk-UETTIYUQ.js +0 -8
- package/dist/chunks/chunk-WIOGEJOJ.js +0 -9
- package/dist/chunks/chunk-YKZLKOOD.js +0 -12
- package/dist/chunks/config-OMS5PWMD.js +0 -7
- package/dist/chunks/connect-git-provider-GIU5WZ52.js +0 -7
- package/dist/chunks/future-E2FHKPJN.js +0 -7
- package/dist/chunks/import-builders-QRQT4S2U.js +0 -7
- package/dist/chunks/login-DEAEVUHM.js +0 -7
- package/dist/chunks/native-self-update-KOJVRMHR.js +0 -7
- package/dist/chunks/openapi-MO5HYMHR.js +0 -7
- package/dist/chunks/prompt-missing-credentials-IUHLYSQU.js +0 -7
- package/dist/chunks/pull-N73PO6QD.js +0 -7
- package/dist/chunks/reauthenticate-SH4XR7NH.js +0 -7
- package/dist/chunks/routes-5DERZV5M.js +0 -7
- package/dist/chunks/setup-and-link-FV35BKJV.js +0 -7
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
-
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
-
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
-
const require = __createRequire(import.meta.url);
|
|
5
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
-
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{parseRetryAfterHeaderAsMillis,require_bytes}from"./chunk-R2TGGVCT.js";import{getCommandName}from"./chunk-FI772UVH.js";import{output_manager_default}from"./chunk-Z6Y55QJW.js";import{require_source}from"./chunk-U7KCDTCH.js";import{__toESM}from"./chunk-6L236MNA.js";var import_chalk=__toESM(require_source(),1);var import_bytes=__toESM(require_bytes(),1);async function responseError(res,fallbackMessage=null,parsedBody={}){let message="",bodyError;if(res.status>=400&&res.status<500){let body;try{body=await res.json()}catch{body=parsedBody}bodyError=body.error||body.err||{},message=bodyError.message}message||(message=fallbackMessage===null?"Response Error":fallbackMessage);let err=new Error(`${message} (${res.status})`);if(err.status=res.status,err.serverMessage=message,bodyError)for(let field of Object.keys(bodyError))field!=="message"&&(err[field]=bodyError[field]);if(res.status===429||res.status===503){let parsed=parseRetryAfterHeaderAsMillis(res.headers.get("Retry-After"));err.retryAfterMs=parsed??(res.status===429?0:void 0)}return err}function toEnumerableError(err){let enumerable={};enumerable.name=err.name;for(let key of Object.getOwnPropertyNames(err))enumerable[key]=err[key];return enumerable}function printError(error2){typeof error2=="string"&&(error2=new Error(error2));let apiError=error2,{message,stack,status,code,sizeLimit}=apiError;output_manager_default.debug(`handling error: ${stack}`),message!=="User force closed the prompt with 0 null"&&(status===403?output_manager_default.error(message||`Authentication error. Run ${getCommandName("login")} to log-in again.`):status===429?output_manager_default.error(message):code==="size_limit_exceeded"?output_manager_default.error(`File size limit exceeded (${(0,import_bytes.default)(sizeLimit)})`):message?output_manager_default.prettyError(apiError):status===500?output_manager_default.error("Unexpected server error. Please retry."):code==="USER_ABORT"?output_manager_default.log("Canceled"):output_manager_default.error(`Unexpected error. Please try again later. (${message})`))}export{responseError,toEnumerableError,printError};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
-
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
-
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
-
const require = __createRequire(import.meta.url);
|
|
5
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
-
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{isAPIError}from"./chunk-R2TGGVCT.js";import{getCommandName}from"./chunk-FI772UVH.js";import{output_manager_default}from"./chunk-Z6Y55QJW.js";var OBSERVABILITY_PLUS_PURCHASE_COMMAND="buy addon observability-plus";function mentionsObservabilityPlus(message){return/observability\s+plus/i.test(message)}function observabilityPlusPurchaseHint(){return`Subscribe with ${getCommandName(OBSERVABILITY_PLUS_PURCHASE_COMMAND)}.`}function observabilityPlusPurchaseFix(){return{command:OBSERVABILITY_PLUS_PURCHASE_COMMAND,hint:observabilityPlusPurchaseHint(),when:"a person has approved buying the add-on"}}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){let error={code,message};return allowedValues&&allowedValues.length>0&&(error.allowedValues=allowedValues),JSON.stringify({error},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="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})`}return jsonOutput?client.stdout.write(formatErrorJson(code,message,err.allowedValues)):(output_manager_default.error(message),err.status===402&&mentionsObservabilityPlus(message)&&output_manager_default.log(observabilityPlusPurchaseHint()),err.allowedValues&&err.allowedValues.length>0&&output_manager_default.print(`
|
|
8
|
-
Available values: ${err.allowedValues.join(", ")}
|
|
9
|
-
`)),1}var OBSERVABILITY_METRICS_PATH="/metrics/v1",METRIC_CATALOG_PAGE_SIZE=250;function toMetricDetail(metric){return{id:metric.id,description:metric.description,dimensions:metric.dimensions,unit:metric.unit,aggregations:metric.aggregations,defaultAggregation:metric.defaultAggregation}}function getDefaultAggregation(detail,metricId){return detail.find(metric=>metric.id===metricId)?.defaultAggregation}async function fetchMetricList(client,accountId){let{metrics}=await client.fetch("/v2/observability/schema",{accountId});return metrics}async function fetchMetricCatalog(client,accountId,kind,search,activeSince){let metrics=[],cursor=null;do{let searchParams=new URLSearchParams({limit:String(METRIC_CATALOG_PAGE_SIZE),kind});search&&searchParams.set("search",search),activeSince&&searchParams.set("activeSince",activeSince),cursor&&searchParams.set("cursor",cursor);let response=await client.fetch(`${OBSERVABILITY_METRICS_PATH}?${searchParams}`,{accountId,bailOn429:!0});metrics.push(...response.metrics.map(metric=>({id:metric.id,description:metric.description,dimensions:metric.dimensions,unit:metric.unit,aggregations:metric.aggregations}))),cursor=response.pagination.hasMore?response.pagination.nextCursor:null}while(cursor);return metrics.filter(metric=>(kind==="all"||(kind==="system"?metric.id.startsWith("vercel."):!metric.id.startsWith("vercel.")))&&(!search||metric.id.startsWith(search))).sort((left,right)=>left.id.localeCompare(right.id))}function fetchCustomMetricCatalog(client,accountId,search,activeSince){return fetchMetricCatalog(client,accountId,"custom",search,activeSince)}async function fetchCatalogMetricDetail(client,accountId,metricId,kind,activeSince){let metrics=await fetchMetricCatalog(client,accountId,kind,metricId,activeSince),exactMetric=metrics.find(metric=>metric.id===metricId);return exactMetric?[exactMetric]:metrics}async function fetchMetricDetail(client,accountId,metricId){return(await client.fetch(`/v2/observability/schema/${encodeURIComponent(metricId)}`,{accountId})).map(toMetricDetail)}async function fetchSchemaOrExit(client,jsonOutput,operation){try{return await operation()}catch(err){if(isAPIError(err))return handleApiError(err,jsonOutput,client,{401:{code:"SCHEMA_UNAUTHORIZED",message:"The metrics schema API request was not authorized. Run `vercel login` to authenticate and `vercel switch` to select a team, then try again."},403:{code:"SCHEMA_UNAUTHORIZED",message:"The metrics schema API request was not authorized. Run `vercel login` to authenticate and `vercel switch` to select a team, then try again."}});let message=err instanceof Error?`Failed to fetch metrics schema: ${err.message}`:`Failed to fetch metrics schema: ${String(err)}`;return jsonOutput?client.stdout.write(formatErrorJson("SCHEMA_FETCH_FAILED",message)):output_manager_default.error(message),1}}function fetchCustomMetricDetailOrExit(client,accountId,jsonOutput,metricId){return fetchSchemaOrExit(client,jsonOutput,()=>fetchCatalogMetricDetail(client,accountId,metricId,"custom"))}function fetchCatalogMetricDetailOrExit(client,accountId,jsonOutput,metricId,kind,activeSince){return fetchSchemaOrExit(client,jsonOutput,()=>fetchCatalogMetricDetail(client,accountId,metricId,kind,activeSince))}function fetchMetricCatalogListOrExit(client,accountId,jsonOutput){return fetchSchemaOrExit(client,jsonOutput,()=>fetchMetricCatalog(client,accountId,"all").then(metrics=>metrics.map(({id,description})=>({id,description}))))}function fetchCombinedMetricListOrExit(client,accountId,jsonOutput){return fetchSchemaOrExit(client,jsonOutput,async()=>{let[platformMetrics,customMetrics]=await Promise.all([fetchMetricList(client,accountId),fetchCustomMetricCatalog(client,accountId).catch(()=>[])]);return[...platformMetrics.filter(metric=>metric.id.startsWith("vercel.")),...customMetrics.map(({id,description})=>({id,description}))].sort((left,right)=>left.id.localeCompare(right.id))})}async function fetchMetricDetailOrExit(client,accountId,metricId,jsonOutput){return fetchSchemaOrExit(client,jsonOutput,()=>fetchMetricDetail(client,accountId,metricId))}export{mentionsObservabilityPlus,observabilityPlusPurchaseFix,getRollupColumnName,getResolvedOrderMetadata,formatQueryJson,formatErrorJson,handleApiError,OBSERVABILITY_METRICS_PATH,getDefaultAggregation,fetchCustomMetricDetailOrExit,fetchCatalogMetricDetailOrExit,fetchMetricCatalogListOrExit,fetchCombinedMetricListOrExit,fetchMetricDetailOrExit};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
-
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
-
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
-
const require = __createRequire(import.meta.url);
|
|
5
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
-
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{getGlobalFlagsFromArgs,stripSensitiveAuthArgs,suggestionFlagTakesSeparateValue}from"./chunk-JAJW3P42.js";import{LinkRequiredError,ProjectNotFound,isAPIError}from"./chunk-R2TGGVCT.js";import{packageName}from"./chunk-FI772UVH.js";import{require_dist}from"./chunk-QGIQK47P.js";import{__toESM}from"./chunk-6L236MNA.js";function quoteArg(value){return/^[A-Za-z0-9_./@:-]+$/.test(value)?value:`'${value.replace(/'/g,"'\\''")}'`}var import_error_utils=__toESM(require_dist(),1);function buildCommandWithYes(argv,pkgName=packageName){let args=stripSensitiveAuthArgs(argv.slice(2)),out=args.some(a=>a==="--yes"||a==="-y")?args:[...args,"--yes"];return`${pkgName} ${out.join(" ")}`.trim()}function redactEnvValueArgs(argv){let redacted=[...argv];for(let i=0;i<redacted.length;i++)redacted[i]==="--value"&&i+1<redacted.length?(redacted[i+1]='"<value>"',i++):redacted[i].startsWith("--value=")&&(redacted[i]='--value="<value>"');return redacted}var GLOBAL_FLAG_NAMES=new Set(["--cwd","--config","--yes","-y","--non-interactive","--scope","--team","-S","-T"]),GLOBAL_FLAG_SHORTHANDS={"-y":"--yes","-S":"--scope","-T":"--team"};function canonicalGlobalFlagName(name){return GLOBAL_FLAG_SHORTHANDS[name]??name}function getGlobalFlagsFromArgv(argv){let args=getGlobalFlagsFromArgs(argv.slice(2),{preserveConfig:!0,preserveYes:!0}),out=[];for(let i=0;i<args.length;i++){let arg=args[i],name=arg.startsWith("--")?arg.split("=")[0]:arg;GLOBAL_FLAG_NAMES.has(name)&&(out.push(arg),suggestionFlagTakesSeparateValue(name)&&!arg.includes("=")&&i+1<args.length&&!args[i+1].startsWith("-")&&(out.push(args[i+1]),i++))}return out}function omitGlobalFlagsFromArgs(args){let safeArgs=stripSensitiveAuthArgs(args),out=[];for(let i=0;i<safeArgs.length;i++){let arg=safeArgs[i],name=arg.startsWith("--")?arg.split("=")[0]:arg;if(GLOBAL_FLAG_NAMES.has(name)){suggestionFlagTakesSeparateValue(name)&&!arg.includes("=")&&i+1<safeArgs.length&&!safeArgs[i+1].startsWith("-")&&i++;continue}out.push(arg)}return out}function buildIntegrationCommandTailFromArgv(argv){let args=argv.slice(2),idx=args.indexOf("integration");return idx===-1?"integration":omitGlobalFlagsFromArgs(args.slice(idx)).join(" ")}function buildCommandWithGlobalFlags(argv,commandTemplate,pkgName=packageName,options){let preserved=options?.globalFlags==="all"?getGlobalFlagsFromArgs(argv.slice(2),{preserveProject:options.preserveProject}):getGlobalFlagsFromArgv(argv);if(options?.globalFlags!=="all"&&options?.preserveProject){let globalArgs=getGlobalFlagsFromArgs(argv.slice(2)),contextArgs=getGlobalFlagsFromArgs(argv.slice(2),{preserveProject:!0});preserved.push(...contextArgs.slice(globalArgs.length))}let exclude=new Set(commandTemplate.split(/\s+/).filter(token=>token.startsWith("-")).map(token=>canonicalGlobalFlagName(token.split("=")[0])));for(let flag of options?.excludeFlags??[])exclude.add(canonicalGlobalFlagName(flag));if(exclude.size){let out=[];for(let i=0;i<preserved.length;i++){let arg=preserved[i],name=arg.startsWith("--")?arg.split("=")[0]:arg;if(exclude.has(canonicalGlobalFlagName(name))){!arg.includes("=")&&i+1<preserved.length&&!preserved[i+1].startsWith("-")&&i++;continue}out.push(arg)}preserved=out}let base=`${pkgName} ${commandTemplate}`;return preserved.length===0?base:options?.prependGlobalFlags?`${pkgName} ${preserved.join(" ")} ${commandTemplate}`:`${base} ${preserved.join(" ")}`}function withGlobalFlags(client,commandTemplate,options={}){return buildCommandWithGlobalFlags(client.argv,commandTemplate,packageName,{globalFlags:"all",preserveProject:options.preserveProject})}function getPreservedArgsAfterEnvSubcommand(argv,subcommands,positionalCount){let args=stripSensitiveAuthArgs(argv.slice(2)),envIdx=args.findIndex((arg,index)=>arg==="env"&&subcommands.includes(args[index+1])),subcommandIdx=envIdx+1;if(envIdx===-1)return args;let preserved=[],positionals=0,optionsEnded=!1;for(let i=subcommandIdx+1;i<args.length;i++){let arg=args[i];if(arg==="--"&&!optionsEnded){optionsEnded=!0;continue}if(!optionsEnded&&arg.startsWith("-")){preserved.push(arg),!arg.includes("=")&&suggestionFlagTakesSeparateValue(arg)&&i+1<args.length&&!args[i+1].startsWith("-")&&preserved.push(args[++i]);continue}if(positionals<positionalCount){positionals++;continue}optionsEnded&&!preserved.includes("--")&&preserved.push("--"),preserved.push(arg)}return preserved}function omitPreservedFlagsAlreadyInTemplate(args,commandTemplate){let templateFlags=new Set(commandTemplate.split(/\s+/).filter(token=>token.startsWith("-")).map(token=>canonicalGlobalFlagName(token.split("=")[0]))),out=[];for(let i=0;i<args.length;i++){let arg=args[i],name=arg.startsWith("-")?arg.split("=")[0]:arg;if(!templateFlags.has(canonicalGlobalFlagName(name))){out.push(arg);continue}!arg.includes("=")&&suggestionFlagTakesSeparateValue(name)&&i+1<args.length&&!args[i+1].startsWith("-")&&i++}return out}function getPreservedArgsForEnvAdd(argv){return getPreservedArgsAfterEnvSubcommand(argv,["add"],3)}function buildEnvAddCommandWithPreservedArgs(argv,commandTemplate,pkgName=packageName){let preserved=omitPreservedFlagsAlreadyInTemplate(getPreservedArgsForEnvAdd(argv),commandTemplate),base=`${pkgName} ${commandTemplate}`;return preserved.length===0?base:`${base} ${preserved.map(quoteArg).join(" ")}`}function getPreservedArgsForEnvPull(argv){return getPreservedArgsAfterEnvSubcommand(argv,["pull"],1)}function getPreservedArgsForEnvRm(argv){return getPreservedArgsAfterEnvSubcommand(argv,["rm","remove"],3)}function buildEnvRmCommandWithPreservedArgs(argv,commandTemplate,pkgName=packageName){let preserved=omitPreservedFlagsAlreadyInTemplate(getPreservedArgsForEnvRm(argv),commandTemplate),base=`${pkgName} ${commandTemplate}`;return preserved.length===0?base:`${base} ${preserved.map(quoteArg).join(" ")}`}function getPreservedArgsForEnvUpdate(argv){return getPreservedArgsAfterEnvSubcommand(argv,["update"],3)}function buildEnvUpdateCommandWithPreservedArgs(argv,commandTemplate,pkgName=packageName){let preserved=omitPreservedFlagsAlreadyInTemplate(getPreservedArgsForEnvUpdate(argv),commandTemplate),base=`${pkgName} ${commandTemplate}`;return preserved.length===0?base:`${base} ${preserved.map(quoteArg).join(" ")}`}function buildCommandWithScope(argv,scopeSlug,pkgName=packageName){let args=stripSensitiveAuthArgs(argv.slice(2)),out=[];for(let i=0;i<args.length;i++){if(args[i]==="--scope"||args[i]==="--team"||args[i]==="-S"||args[i]==="-T"){i++;continue}args[i].startsWith("--scope=")||args[i].startsWith("--team=")||out.push(args[i])}return out.push("--scope",scopeSlug),`${pkgName} ${out.join(" ")}`}function enrichActionRequiredWithInvokingCommand(payload,argv){if(!payload.choices?.length)return payload;let next=[],linkArgv=[...argv.slice(0,2),"link",...argv.slice(3)];for(let choice of payload.choices){let slug=choice.name;next.push({command:buildCommandWithScope(linkArgv,slug),when:"Link first (then run any command without --scope)"}),next.push({command:buildCommandWithScope(argv,slug),when:"Run this command with scope (no link)"})}return{...payload,next}}function outputActionRequired(client,payload,exitCode=1){if(!shouldEmitNonInteractiveCommandError(client))return;let enriched=enrichActionRequiredWithInvokingCommand(payload,client.argv);!enriched.hint&&enriched.next?.length&&(enriched.hint="Run one of the commands in next[] to complete without prompting."),client.stdout.write(`${JSON.stringify(enriched,null,2)}
|
|
8
|
-
`),process.exit(exitCode)}function argvHasNonInteractive(argv){if(!argv?.length)return!1;for(let i=0;i<argv.length;i++){let a=argv[i];if(a==="--non-interactive")return argv[i+1]!=="false";if(a.startsWith("--non-interactive="))return a.slice(18)!=="false"}return!1}function shouldEmitNonInteractiveCommandError(client){return client.nonInteractive||argvHasNonInteractive(client.argv??[])}function outputAgentError(client,payload,exitCode=1){shouldEmitNonInteractiveCommandError(client)&&(client.stdout.write(`${JSON.stringify(payload,null,2)}
|
|
9
|
-
`),process.exit(exitCode))}function outputAgentSuccess(client,payload,exitCode=0){shouldEmitNonInteractiveCommandError(client)&&(!payload.hint&&payload.next?.length&&(payload.hint="Follow up with one of the commands in next[]."),client.stdout.write(`${JSON.stringify(payload,null,2)}
|
|
10
|
-
`),process.exit(exitCode))}function buildNextStepsForGlobalConfig(client){return[{command:buildCommandWithGlobalFlags(client.argv,"global-config list"),when:"List Global Config stores in the current team scope"},{command:buildCommandWithGlobalFlags(client.argv,"teams switch"),when:"Switch to the team that owns the Global Config"},{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"Verify the current team or user scope"}]}var GLOBAL_CONFIG_NON_INTERACTIVE_HINT="Global Config commands use your current team scope. Pass --scope or run `vercel teams switch` if the store is missing.",LIST_ERROR_HINT="Project names are team-scoped. Use --scope when the project belongs to another team, or `list --all` to list deployments across all projects.";function buildNextStepsForList(client,projectName){return[projectName?{command:buildCommandWithGlobalFlags(client.argv,`project ls --filter ${projectName}`),when:"Search projects matching the attempted name to find the right one"}:{command:buildCommandWithGlobalFlags(client.argv,"project ls --filter <name>"),when:"Search projects by name substring to find the right one (replace <name>)"},{command:buildCommandWithGlobalFlags(client.argv,"list --all"),when:"List deployments across all projects in the current scope"},{command:buildCommandWithGlobalFlags(client.argv,"link"),when:"Re-link this directory to the correct Vercel project"}]}function buildNextStepsForProjectSubcommands(client,variant){let byName=variant==="access-groups"?{template:"project access-groups <name>",when:"List access groups by project name (replace <name>)"}:variant==="access-summary"?{template:"project access-summary <name>",when:"Show role counts by project name (replace <name>)"}:variant==="protection"?{template:"project protection <name>",when:"Show deployment protection by project name (replace <name>)"}:variant==="update"?{template:"project update <name> --framework <slug>",when:"Update a framework preset by project name (replace <name> and <slug>)"}:variant==="speed-insights"?{template:"project speed-insights <name>",when:"Enable Speed Insights by project name (replace <name>)"}:variant==="web-analytics"?{template:"project web-analytics <name>",when:"Enable Web Analytics by project name (replace <name>)"}:variant==="observability"?{template:"project observability enable <name>",when:"Enable Observability Plus by project name (replace <name>)"}:variant==="checks"?{template:"project checks add <name>",when:"Create a deployment check by project name (replace <name>)"}:variant==="inspect"?{template:"project inspect <name>",when:"Inspect a project by name (replace <name>)"}:variant==="resume"?{template:"project resume <name>",when:"Resume production traffic by project name (replace <name>)"}:{template:"project members <name>",when:"List members by project name (replace <name>)"};return[{command:buildCommandWithGlobalFlags(client.argv,"link"),when:"Re-link this directory to the correct Vercel project"},{command:buildCommandWithGlobalFlags(client.argv,byName.template),when:byName.when},{command:buildCommandWithGlobalFlags(client.argv,"project ls"),when:"List projects in the current team to pick a name"}]}var PROJECT_SUBCOMMAND_ERROR_HINT="If you use --cwd, ensure that folder is linked to the right project, or pass an explicit project name. Use --scope when the project belongs to another team.";function resolveNonInteractiveDefaults(client,variant){return variant==="global-config"?{next:buildNextStepsForGlobalConfig(client),hint:GLOBAL_CONFIG_NON_INTERACTIVE_HINT}:variant==="list"?{next:buildNextStepsForList(client),hint:LIST_ERROR_HINT}:{next:buildNextStepsForProjectSubcommands(client,variant),hint:PROJECT_SUBCOMMAND_ERROR_HINT}}function writeAgentErrorPayloadAndExit(client,payload,exitCode,variant){let defaults=resolveNonInteractiveDefaults(client,variant),out={...payload,next:payload.next??defaults.next,hint:payload.hint??defaults.hint};client.stdout.write(`${JSON.stringify(out,null,2)}
|
|
11
|
-
`),process.exit(exitCode)}function isProjectNotFoundLike(err){return!!(err instanceof ProjectNotFound||(0,import_error_utils.isError)(err)&&"code"in err&&err.code==="PROJECT_NOT_FOUND")}function isLinkRequiredLike(err){return err instanceof LinkRequiredError}function normalizeApiErrorText(message){return message.replace(/\s*\(\d{3}\)\s*$/,"").trim()}function exitWithNonInteractiveError(client,err,exitCode=1,options={variant:"members"}){if(!shouldEmitNonInteractiveCommandError(client))return;let{variant}=options;if(isLinkRequiredLike(err)){if(variant==="global-config"){writeAgentErrorPayloadAndExit(client,{status:"error",reason:"link_required",message:err instanceof Error?err.message:String(err),next:buildNextStepsForGlobalConfig(client),hint:GLOBAL_CONFIG_NON_INTERACTIVE_HINT},exitCode,"global-config");return}writeAgentErrorPayloadAndExit(client,{status:"error",reason:"link_required",message:err instanceof Error?err.message:String(err)},exitCode,variant);return}if(isProjectNotFoundLike(err)){writeAgentErrorPayloadAndExit(client,{status:"error",reason:"project_not_found",message:err instanceof Error?err.message:String(err),...variant==="list"&&options.projectName?{next:buildNextStepsForList(client,options.projectName)}:{}},exitCode,variant);return}if(isAPIError(err)){let rawMessage=err.serverMessage||err.message,message=normalizeApiErrorText(rawMessage),reason=err.status===403?"forbidden":err.status===401?"not_authorized":err.status===404?variant==="global-config"?"not_found":"project_not_found":err.status===429?"rate_limited":"api_error";writeAgentErrorPayloadAndExit(client,{status:"error",reason,message,...err.action&&{action:err.action},...err.resource&&{resource:err.resource}},exitCode,variant)}writeAgentErrorPayloadAndExit(client,{status:"error",reason:"unexpected_error",message:err instanceof Error?err.message:String(err)},exitCode,variant)}function openUrlInBrowserCommand(url){return process.platform==="win32"?`start ${url}`:process.platform==="darwin"?`open '${url}'`:`xdg-open '${url}'`}export{quoteArg,buildCommandWithYes,redactEnvValueArgs,omitGlobalFlagsFromArgs,buildIntegrationCommandTailFromArgv,buildCommandWithGlobalFlags,withGlobalFlags,getPreservedArgsForEnvAdd,buildEnvAddCommandWithPreservedArgs,getPreservedArgsForEnvPull,getPreservedArgsForEnvRm,buildEnvRmCommandWithPreservedArgs,getPreservedArgsForEnvUpdate,buildEnvUpdateCommandWithPreservedArgs,outputActionRequired,argvHasNonInteractive,shouldEmitNonInteractiveCommandError,outputAgentError,outputAgentSuccess,exitWithNonInteractiveError,openUrlInBrowserCommand};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
-
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
-
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
-
const require = __createRequire(import.meta.url);
|
|
5
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
-
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{require_dist2,require_minimatch}from"./chunk-HEE6XLHF.js";import{require_semver}from"./chunk-KKS7XWEX.js";import{readJSONFile}from"./chunk-MVAM5QXS.js";import{VERCEL_CONFIG_EXTENSIONS}from"./chunk-QR7QPUFN.js";import{require_execa}from"./chunk-HBFPLBTX.js";import{isNativeBinaryInstall}from"./chunk-7T6TL3GQ.js";import{VERCEL_DIR,require_lib,require_pluralize}from"./chunk-A5SVOPQK.js";import{CantParseJSONFile,code}from"./chunk-R2TGGVCT.js";import{cmd}from"./chunk-FI772UVH.js";import{output_manager_default}from"./chunk-Z6Y55QJW.js";import{require_dist}from"./chunk-QGIQK47P.js";import{pkg_default}from"./chunk-AVSPFBLM.js";import{__commonJS,__export,__require,__toESM}from"./chunk-6L236MNA.js";var require_builtins=__commonJS({"../../node_modules/.pnpm/builtins@1.0.3/node_modules/builtins/builtins.json"(exports,module){module.exports=["assert","buffer","child_process","cluster","console","constants","crypto","dgram","dns","domain","events","fs","http","https","module","net","os","path","process","punycode","querystring","readline","repl","stream","string_decoder","timers","tls","tty","url","util","v8","vm","zlib"]}});var require_validate_npm_package_name=__commonJS({"../../node_modules/.pnpm/validate-npm-package-name@3.0.0/node_modules/validate-npm-package-name/index.js"(exports,module){"use strict";var scopedPackagePattern=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),builtins=require_builtins(),blacklist=["node_modules","favicon.ico"],validate=module.exports=function(name){var warnings=[],errors=[];if(name===null)return errors.push("name cannot be null"),done(warnings,errors);if(name===void 0)return errors.push("name cannot be undefined"),done(warnings,errors);if(typeof name!="string")return errors.push("name must be a string"),done(warnings,errors);if(name.length||errors.push("name length must be greater than zero"),name.match(/^\./)&&errors.push("name cannot start with a period"),name.match(/^_/)&&errors.push("name cannot start with an underscore"),name.trim()!==name&&errors.push("name cannot contain leading or trailing spaces"),blacklist.forEach(function(blacklistedName){name.toLowerCase()===blacklistedName&&errors.push(blacklistedName+" is a blacklisted name")}),builtins.forEach(function(builtin){name.toLowerCase()===builtin&&warnings.push(builtin+" is a core module name")}),name.length>214&&warnings.push("name can no longer contain more than 214 characters"),name.toLowerCase()!==name&&warnings.push("name can no longer contain capital letters"),/[~'!()*]/.test(name.split("/").slice(-1)[0])&&warnings.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(name)!==name){var nameMatch=name.match(scopedPackagePattern);if(nameMatch){var user=nameMatch[1],pkg=nameMatch[2];if(encodeURIComponent(user)===user&&encodeURIComponent(pkg)===pkg)return done(warnings,errors)}errors.push("name can only contain URL-friendly characters")}return done(warnings,errors)};validate.scopedPackagePattern=scopedPackagePattern;var done=function(warnings,errors){var result={validForNewPackages:errors.length===0&&warnings.length===0,validForOldPackages:errors.length===0,warnings,errors};return result.warnings.length||delete result.warnings,result.errors.length||delete result.errors,result}}});var require_git_host_info=__commonJS({"../../node_modules/.pnpm/hosted-git-info@2.8.9/node_modules/hosted-git-info/git-host-info.js"(exports,module){"use strict";var gitHosts=module.exports={github:{protocols:["git","http","git+ssh","git+https","ssh","https"],domain:"github.com",treepath:"tree",filetemplate:"https://{auth@}raw.githubusercontent.com/{user}/{project}/{committish}/{path}",bugstemplate:"https://{domain}/{user}/{project}/issues",gittemplate:"git://{auth@}{domain}/{user}/{project}.git{#committish}",tarballtemplate:"https://codeload.{domain}/{user}/{project}/tar.gz/{committish}"},bitbucket:{protocols:["git+ssh","git+https","ssh","https"],domain:"bitbucket.org",treepath:"src",tarballtemplate:"https://{domain}/{user}/{project}/get/{committish}.tar.gz"},gitlab:{protocols:["git+ssh","git+https","ssh","https"],domain:"gitlab.com",treepath:"tree",bugstemplate:"https://{domain}/{user}/{project}/issues",httpstemplate:"git+https://{auth@}{domain}/{user}/{projectPath}.git{#committish}",tarballtemplate:"https://{domain}/{user}/{project}/repository/archive.tar.gz?ref={committish}",pathmatch:/^[/]([^/]+)[/]((?!.*(\/-\/|\/repository\/archive\.tar\.gz\?=.*|\/repository\/[^/]+\/archive.tar.gz$)).*?)(?:[.]git|[/])?$/},gist:{protocols:["git","git+ssh","git+https","ssh","https"],domain:"gist.github.com",pathmatch:/^[/](?:([^/]+)[/])?([a-z0-9]{32,})(?:[.]git)?$/,filetemplate:"https://gist.githubusercontent.com/{user}/{project}/raw{/committish}/{path}",bugstemplate:"https://{domain}/{project}",gittemplate:"git://{domain}/{project}.git{#committish}",sshtemplate:"git@{domain}:/{project}.git{#committish}",sshurltemplate:"git+ssh://git@{domain}/{project}.git{#committish}",browsetemplate:"https://{domain}/{project}{/committish}",browsefiletemplate:"https://{domain}/{project}{/committish}{#path}",docstemplate:"https://{domain}/{project}{/committish}",httpstemplate:"git+https://{domain}/{project}.git{#committish}",shortcuttemplate:"{type}:{project}{#committish}",pathtemplate:"{project}{#committish}",tarballtemplate:"https://codeload.github.com/gist/{project}/tar.gz/{committish}",hashformat:function(fragment){return"file-"+formatHashFragment(fragment)}}},gitHostDefaults={sshtemplate:"git@{domain}:{user}/{project}.git{#committish}",sshurltemplate:"git+ssh://git@{domain}/{user}/{project}.git{#committish}",browsetemplate:"https://{domain}/{user}/{project}{/tree/committish}",browsefiletemplate:"https://{domain}/{user}/{project}/{treepath}/{committish}/{path}{#fragment}",docstemplate:"https://{domain}/{user}/{project}{/tree/committish}#readme",httpstemplate:"git+https://{auth@}{domain}/{user}/{project}.git{#committish}",filetemplate:"https://{domain}/{user}/{project}/raw/{committish}/{path}",shortcuttemplate:"{type}:{user}/{project}{#committish}",pathtemplate:"{user}/{project}{#committish}",pathmatch:/^[/]([^/]+)[/]([^/]+?)(?:[.]git|[/])?$/,hashformat:formatHashFragment};Object.keys(gitHosts).forEach(function(name){Object.keys(gitHostDefaults).forEach(function(key){gitHosts[name][key]||(gitHosts[name][key]=gitHostDefaults[key])}),gitHosts[name].protocols_re=RegExp("^("+gitHosts[name].protocols.map(function(protocol){return protocol.replace(/([\\+*{}()[\]$^|])/g,"\\$1")}).join("|")+"):$")});function formatHashFragment(fragment){return fragment.toLowerCase().replace(/^\W+|\/|\W+$/g,"").replace(/\W+/g,"-")}}});var require_git_host=__commonJS({"../../node_modules/.pnpm/hosted-git-info@2.8.9/node_modules/hosted-git-info/git-host.js"(exports,module){"use strict";var gitHosts=require_git_host_info(),extend=Object.assign||function(target,source){if(source===null||typeof source!="object")return target;for(var keys=Object.keys(source),i=keys.length;i--;)target[keys[i]]=source[keys[i]];return target};module.exports=GitHost;function GitHost(type,user,auth,project,committish,defaultRepresentation,opts){var gitHostInfo=this;gitHostInfo.type=type,Object.keys(gitHosts[type]).forEach(function(key){gitHostInfo[key]=gitHosts[type][key]}),gitHostInfo.user=user,gitHostInfo.auth=auth,gitHostInfo.project=project,gitHostInfo.committish=committish,gitHostInfo.default=defaultRepresentation,gitHostInfo.opts=opts||{}}GitHost.prototype.hash=function(){return this.committish?"#"+this.committish:""};GitHost.prototype._fill=function(template,opts){if(template){var vars=extend({},opts);vars.path=vars.path?vars.path.replace(/^[/]+/g,""):"",opts=extend(extend({},this.opts),opts);var self=this;Object.keys(this).forEach(function(key){self[key]!=null&&vars[key]==null&&(vars[key]=self[key])});var rawAuth=vars.auth,rawcommittish=vars.committish,rawFragment=vars.fragment,rawPath=vars.path,rawProject=vars.project;Object.keys(vars).forEach(function(key){var value=vars[key];(key==="path"||key==="project")&&typeof value=="string"?vars[key]=value.split("/").map(function(pathComponent){return encodeURIComponent(pathComponent)}).join("/"):vars[key]=encodeURIComponent(value)}),vars["auth@"]=rawAuth?rawAuth+"@":"",vars["#fragment"]=rawFragment?"#"+this.hashformat(rawFragment):"",vars.fragment=vars.fragment?vars.fragment:"",vars["#path"]=rawPath?"#"+this.hashformat(rawPath):"",vars["/path"]=vars.path?"/"+vars.path:"",vars.projectPath=rawProject.split("/").map(encodeURIComponent).join("/"),opts.noCommittish?(vars["#committish"]="",vars["/tree/committish"]="",vars["/committish"]="",vars.committish=""):(vars["#committish"]=rawcommittish?"#"+rawcommittish:"",vars["/tree/committish"]=vars.committish?"/"+vars.treepath+"/"+vars.committish:"",vars["/committish"]=vars.committish?"/"+vars.committish:"",vars.committish=vars.committish||"master");var res=template;return Object.keys(vars).forEach(function(key){res=res.replace(new RegExp("[{]"+key+"[}]","g"),vars[key])}),opts.noGitPlus?res.replace(/^git[+]/,""):res}};GitHost.prototype.ssh=function(opts){return this._fill(this.sshtemplate,opts)};GitHost.prototype.sshurl=function(opts){return this._fill(this.sshurltemplate,opts)};GitHost.prototype.browse=function(P,F,opts){return typeof P=="string"?(typeof F!="string"&&(opts=F,F=null),this._fill(this.browsefiletemplate,extend({fragment:F,path:P},opts))):this._fill(this.browsetemplate,P)};GitHost.prototype.docs=function(opts){return this._fill(this.docstemplate,opts)};GitHost.prototype.bugs=function(opts){return this._fill(this.bugstemplate,opts)};GitHost.prototype.https=function(opts){return this._fill(this.httpstemplate,opts)};GitHost.prototype.git=function(opts){return this._fill(this.gittemplate,opts)};GitHost.prototype.shortcut=function(opts){return this._fill(this.shortcuttemplate,opts)};GitHost.prototype.path=function(opts){return this._fill(this.pathtemplate,opts)};GitHost.prototype.tarball=function(opts_){var opts=extend({},opts_,{noCommittish:!1});return this._fill(this.tarballtemplate,opts)};GitHost.prototype.file=function(P,opts){return this._fill(this.filetemplate,extend({path:P},opts))};GitHost.prototype.getDefaultRepresentation=function(){return this.default};GitHost.prototype.toString=function(opts){return this.default&&typeof this[this.default]=="function"?this[this.default](opts):this.sshurl(opts)}}});var require_hosted_git_info=__commonJS({"../../node_modules/.pnpm/hosted-git-info@2.8.9/node_modules/hosted-git-info/index.js"(exports,module){"use strict";var url=__require("url"),gitHosts=require_git_host_info(),GitHost=module.exports=require_git_host(),protocolToRepresentationMap={"git+ssh:":"sshurl","git+https:":"https","ssh:":"sshurl","git:":"git"};function protocolToRepresentation(protocol){return protocolToRepresentationMap[protocol]||protocol.slice(0,-1)}var authProtocols={"git:":!0,"https:":!0,"git+https:":!0,"http:":!0,"git+http:":!0},cache={};module.exports.fromUrl=function(giturl,opts){if(typeof giturl=="string"){var key=giturl+JSON.stringify(opts||{});return key in cache||(cache[key]=fromUrl(giturl,opts)),cache[key]}};function fromUrl(giturl,opts){if(!(giturl==null||giturl==="")){var url2=fixupUnqualifiedGist(isGitHubShorthand(giturl)?"github:"+giturl:giturl),parsed=parseGitUrl(url2),shortcutMatch=url2.match(/^([^:]+):(?:[^@]+@)?(?:([^/]*)\/)?([^#]+)/),matches=Object.keys(gitHosts).map(function(gitHostName){try{var gitHostInfo=gitHosts[gitHostName],auth=null;parsed.auth&&authProtocols[parsed.protocol]&&(auth=parsed.auth);var committish=parsed.hash?decodeURIComponent(parsed.hash.substr(1)):null,user=null,project=null,defaultRepresentation=null;if(shortcutMatch&&shortcutMatch[1]===gitHostName)user=shortcutMatch[2]&&decodeURIComponent(shortcutMatch[2]),project=decodeURIComponent(shortcutMatch[3].replace(/\.git$/,"")),defaultRepresentation="shortcut";else{if(parsed.host&&parsed.host!==gitHostInfo.domain&&parsed.host.replace(/^www[.]/,"")!==gitHostInfo.domain||!gitHostInfo.protocols_re.test(parsed.protocol)||!parsed.path)return;var pathmatch=gitHostInfo.pathmatch,matched=parsed.path.match(pathmatch);if(!matched)return;matched[1]!==null&&matched[1]!==void 0&&(user=decodeURIComponent(matched[1].replace(/^:/,""))),project=decodeURIComponent(matched[2]),defaultRepresentation=protocolToRepresentation(parsed.protocol)}return new GitHost(gitHostName,user,auth,project,committish,defaultRepresentation,opts)}catch(ex){if(!(ex instanceof URIError))throw ex}}).filter(function(gitHostInfo){return gitHostInfo});if(matches.length===1)return matches[0]}}function isGitHubShorthand(arg){return/^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(arg)}function fixupUnqualifiedGist(giturl){var parsed=url.parse(giturl);return parsed.protocol==="gist:"&&parsed.host&&!parsed.path?parsed.protocol+"/"+parsed.host:giturl}function parseGitUrl(giturl){var matched=giturl.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/);if(!matched){var legacy=url.parse(giturl);if(legacy.auth&&typeof url.URL=="function"){var authmatch=giturl.match(/[^@]+@[^:/]+/);if(authmatch){var whatwg=new url.URL(authmatch[0]);legacy.auth=whatwg.username||"",whatwg.password&&(legacy.auth+=":"+whatwg.password)}}return legacy}return{protocol:"git+ssh:",slashes:!0,auth:matched[1],host:matched[2],port:null,hostname:matched[2],hash:matched[4],search:null,query:null,pathname:"/"+matched[3],path:"/"+matched[3],href:"git+ssh://"+matched[1]+"@"+matched[2]+"/"+matched[3]+(matched[4]||"")}}}});var require_os_tmpdir=__commonJS({"../../node_modules/.pnpm/os-tmpdir@1.0.2/node_modules/os-tmpdir/index.js"(exports,module){"use strict";var isWindows=process.platform==="win32",trailingSlashRe=isWindows?/[^:]\\$/:/.\/$/;module.exports=function(){var path;return isWindows?path=process.env.TEMP||process.env.TMP||(process.env.SystemRoot||process.env.windir)+"\\temp":path=process.env.TMPDIR||process.env.TMP||process.env.TEMP||"/tmp",trailingSlashRe.test(path)&&(path=path.slice(0,-1)),path}}});var require_os_homedir=__commonJS({"../../node_modules/.pnpm/os-homedir@1.0.2/node_modules/os-homedir/index.js"(exports,module){"use strict";var os=__require("os");function homedir(){var env=process.env,home=env.HOME,user=env.LOGNAME||env.USER||env.LNAME||env.USERNAME;return process.platform==="win32"?env.USERPROFILE||env.HOMEDRIVE+env.HOMEPATH||home||null:process.platform==="darwin"?home||(user?"/Users/"+user:null):process.platform==="linux"?home||(process.getuid()===0?"/root":user?"/home/"+user:null):home||null}module.exports=typeof os.homedir=="function"?os.homedir:homedir}});var require_osenv=__commonJS({"../../node_modules/.pnpm/osenv@0.1.5/node_modules/osenv/osenv.js"(exports){var isWindows=process.platform==="win32",path=__require("path"),exec=__require("child_process").exec,osTmpdir=require_os_tmpdir(),osHomedir=require_os_homedir();function memo(key,lookup,fallback){var fell=!1,falling=!1;exports[key]=function(cb){var val=lookup();return!val&&!fell&&!falling&&fallback&&(fell=!0,falling=!0,exec(fallback,function(er,output,stderr){falling=!1,!er&&(val=output.trim())})),exports[key]=function(cb2){return cb2&&process.nextTick(cb2.bind(null,null,val)),val},cb&&!falling&&process.nextTick(cb.bind(null,null,val)),val}}memo("user",function(){return isWindows?process.env.USERDOMAIN+"\\"+process.env.USERNAME:process.env.USER},"whoami");memo("prompt",function(){return isWindows?process.env.PROMPT:process.env.PS1});memo("hostname",function(){return isWindows?process.env.COMPUTERNAME:process.env.HOSTNAME},"hostname");memo("tmpdir",function(){return osTmpdir()});memo("home",function(){return osHomedir()});memo("path",function(){return(process.env.PATH||process.env.Path||process.env.path).split(isWindows?";":":")});memo("editor",function(){return process.env.EDITOR||process.env.VISUAL||(isWindows?"notepad.exe":"vi")});memo("shell",function(){return isWindows?process.env.ComSpec||"cmd":process.env.SHELL||"bash"})}});var require_npa=__commonJS({"../../node_modules/.pnpm/npm-package-arg@6.1.0/node_modules/npm-package-arg/npa.js"(exports,module){"use strict";module.exports=npa2;module.exports.resolve=resolve;module.exports.Result=Result;var url,HostedGit,semver,path,validatePackageName,osenv,isWindows=process.platform==="win32"||global.FAKE_WINDOWS,hasSlashes=isWindows?/\\|[/]/:/[/]/,isURL=/^(?:git[+])?[a-z]+:/i,isFilename=/[.](?:tgz|tar.gz|tar)$/i;function npa2(arg,where){let name,spec;if(typeof arg=="object")return arg instanceof Result&&(!where||where===arg.where)?arg:arg.name&&arg.rawSpec?npa2.resolve(arg.name,arg.rawSpec,where||arg.where):npa2(arg.raw,where||arg.where);let nameEndsAt=arg[0]==="@"?arg.slice(1).indexOf("@")+1:arg.indexOf("@"),namePart=nameEndsAt>0?arg.slice(0,nameEndsAt):arg;return isURL.test(arg)||namePart[0]!=="@"&&(hasSlashes.test(namePart)||isFilename.test(namePart))?spec=arg:nameEndsAt>0?(name=namePart,spec=arg.slice(nameEndsAt+1)):(validatePackageName||(validatePackageName=require_validate_npm_package_name()),validatePackageName(arg).validForOldPackages?name=arg:spec=arg),resolve(name,spec,where,arg)}var isFilespec=isWindows?/^(?:[.]|~[/]|[/\\]|[a-zA-Z]:)/:/^(?:[.]|~[/]|[/]|[a-zA-Z]:)/;function resolve(name,spec,where,arg){let res=new Result({raw:arg,name,rawSpec:spec,fromArgument:arg!=null});if(name&&res.setName(name),spec&&(isFilespec.test(spec)||/^file:/i.test(spec)))return fromFile(res,where);if(spec&&/^npm:/i.test(spec))return fromAlias(res,where);HostedGit||(HostedGit=require_hosted_git_info());let hosted=HostedGit.fromUrl(spec,{noGitPlus:!0,noCommittish:!0});return hosted?fromHostedGit(res,hosted):spec&&isURL.test(spec)?fromURL(res):spec&&(hasSlashes.test(spec)||isFilename.test(spec))?fromFile(res,where):fromRegistry(res)}function invalidPackageName(name,valid){let err=new Error(`Invalid package name "${name}": ${valid.errors.join("; ")}`);return err.code="EINVALIDPACKAGENAME",err}function invalidTagName(name){let err=new Error(`Invalid tag name "${name}": Tags may not have any characters that encodeURIComponent encodes.`);return err.code="EINVALIDTAGNAME",err}function Result(opts){this.type=opts.type,this.registry=opts.registry,this.where=opts.where,opts.raw==null?this.raw=opts.name?opts.name+"@"+opts.rawSpec:opts.rawSpec:this.raw=opts.raw,this.name=void 0,this.escapedName=void 0,this.scope=void 0,this.rawSpec=opts.rawSpec==null?"":opts.rawSpec,this.saveSpec=opts.saveSpec,this.fetchSpec=opts.fetchSpec,opts.name&&this.setName(opts.name),this.gitRange=opts.gitRange,this.gitCommittish=opts.gitCommittish,this.hosted=opts.hosted}Result.prototype={};Result.prototype.setName=function(name){validatePackageName||(validatePackageName=require_validate_npm_package_name());let valid=validatePackageName(name);if(!valid.validForOldPackages)throw invalidPackageName(name,valid);return this.name=name,this.scope=name[0]==="@"?name.slice(0,name.indexOf("/")):void 0,this.escapedName=name.replace("/","%2f"),this};Result.prototype.toString=function(){let full=[];this.name!=null&&this.name!==""&&full.push(this.name);let spec=this.saveSpec||this.fetchSpec||this.rawSpec;return spec!=null&&spec!==""&&full.push(spec),full.length?full.join("@"):this.raw};Result.prototype.toJSON=function(){let result=Object.assign({},this);return delete result.hosted,result};function setGitCommittish(res,committish){return committish!=null&&committish.length>=7&&committish.slice(0,7)==="semver:"?(res.gitRange=decodeURIComponent(committish.slice(7)),res.gitCommittish=null):res.gitCommittish=committish===""?null:committish,res}var isAbsolutePath=/^[/]|^[A-Za-z]:/;function resolvePath(where,spec){return isAbsolutePath.test(spec)?spec:(path||(path=__require("path")),path.resolve(where,spec))}function isAbsolute(dir){return!!(dir[0]==="/"||/^[A-Za-z]:/.test(dir))}function fromFile(res,where){where||(where=process.cwd()),res.type=isFilename.test(res.rawSpec)?"file":"directory",res.where=where;let spec=res.rawSpec.replace(/\\/g,"/").replace(/^file:[/]*([A-Za-z]:)/,"$1").replace(/^file:(?:[/]*([~./]))?/,"$1");return/^~[/]/.test(spec)?(osenv||(osenv=require_osenv()),res.fetchSpec=resolvePath(osenv.home(),spec.slice(2)),res.saveSpec="file:"+spec):(res.fetchSpec=resolvePath(where,spec),isAbsolute(spec)?res.saveSpec="file:"+spec:(path||(path=__require("path")),res.saveSpec="file:"+path.relative(where,res.fetchSpec))),res}function fromHostedGit(res,hosted){return res.type="git",res.hosted=hosted,res.saveSpec=hosted.toString({noGitPlus:!1,noCommittish:!1}),res.fetchSpec=hosted.getDefaultRepresentation()==="shortcut"?null:hosted.toString(),setGitCommittish(res,hosted.committish)}function unsupportedURLType(protocol,spec){let err=new Error(`Unsupported URL Type "${protocol}": ${spec}`);return err.code="EUNSUPPORTEDPROTOCOL",err}function matchGitScp(spec){let matched=spec.match(/^git\+ssh:\/\/([^:#]+:[^#]+(?:\.git)?)(?:#(.*))?$/i);return matched&&!matched[1].match(/:[0-9]+\/?.*$/i)&&{fetchSpec:matched[1],gitCommittish:matched[2]==null?null:matched[2]}}function fromURL(res){url||(url=__require("url"));let urlparse=url.parse(res.rawSpec);switch(res.saveSpec=res.rawSpec,urlparse.protocol){case"git:":case"git+http:":case"git+https:":case"git+rsync:":case"git+ftp:":case"git+file:":case"git+ssh:":res.type="git";let match=urlparse.protocol==="git+ssh:"&&matchGitScp(res.rawSpec);match?(setGitCommittish(res,match.gitCommittish),res.fetchSpec=match.fetchSpec):(setGitCommittish(res,urlparse.hash!=null?urlparse.hash.slice(1):""),urlparse.protocol=urlparse.protocol.replace(/^git[+]/,""),delete urlparse.hash,res.fetchSpec=url.format(urlparse));break;case"http:":case"https:":res.type="remote",res.fetchSpec=res.saveSpec;break;default:throw unsupportedURLType(urlparse.protocol,res.rawSpec)}return res}function fromAlias(res,where){let subSpec=npa2(res.rawSpec.substr(4),where);if(subSpec.type==="alias")throw new Error("nested aliases not supported");if(!subSpec.registry)throw new Error("aliases only work for registry deps");return res.subSpec=subSpec,res.registry=!0,res.type="alias",res.saveSpec=null,res.fetchSpec=null,res}function fromRegistry(res){res.registry=!0;let spec=res.rawSpec===""?"latest":res.rawSpec;res.saveSpec=null,res.fetchSpec=spec,semver||(semver=require_semver());let version2=semver.valid(spec,!0),range=semver.validRange(spec,!0);if(version2)res.type="version";else if(range)res.type="range";else{if(encodeURIComponent(spec)!==spec)throw invalidTagName(spec);res.type="tag"}return res}}});var require_import_builders=__commonJS({"../../internals/builder-orchestration/dist/import-builders.js"(exports,module){"use strict";var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export2=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toESM2=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),import_builders_exports={};__export2(import_builders_exports,{createImportBuilders:()=>createImportBuilders2,formatResolvedBuilders:()=>formatResolvedBuilders2,getBuildersDir:()=>getBuildersDir2,pinBuilderSpecs:()=>pinBuilderSpecs});module.exports=__toCommonJS(import_builders_exports);var import_npm_package_arg2=__toESM2(require_npa()),import_semver=require_semver(),import_path=__require("path"),import_fs_extra=require_lib(),import_fs_detectors=require_dist2(),import_error_utils=require_dist();function isRemoteBuilderPin(pin){return/^https?:\/\//i.test(pin)}function isDefaultSpec(parsed){return parsed.type==="tag"&&(parsed.rawSpec===""||parsed.rawSpec==="latest")}function formatResolvedBuilders2(builders){return Array.from(builders.values(),b=>b.pkgPath?`${b.pkg.name}@${b.pkg.version}=${(0,import_path.dirname)(b.pkgPath)}`:`${b.pkg.name}=built-in`).join(",")}function pinBuilderSpecs(specs,pins){let pinnedSpecs=new Map;for(let spec of specs){let parsed=(0,import_npm_package_arg2.default)(spec);if(parsed.name&&isDefaultSpec(parsed)){let version2=pins.get(parsed.name);version2&&pinnedSpecs.set(spec,isRemoteBuilderPin(version2)?version2:`${parsed.name}@${version2}`)}}return pinnedSpecs}function getBuildersDir2(cwd,vercelDir=".vercel"){let override=process.env.VERCEL_BUILDERS_DIR;return override?(0,import_path.isAbsolute)(override)?override:(0,import_path.resolve)(cwd,override):(0,import_path.join)(cwd,vercelDir,"builders")}function createImportBuilders2(dependencies){let{debug,installBuilders:installBuilders2,isNativeBinaryInstall:isNativeBinaryInstall2,require:require2,staticBuilder,vercelDir}=dependencies,builderPins=new Map;for(let[name,version2]of Object.entries(dependencies.builderPins))((0,import_semver.validRange)(version2)||isRemoteBuilderPin(version2))&&builderPins.set(name,version2);let resolveDependencies={builderPins,debug,isNativeBinaryInstall:isNativeBinaryInstall2,require:require2,staticBuilder};return async function(builderSpecs,cwd,span){let buildersDir=getBuildersDir2(cwd,vercelDir),importResult=await resolveBuilders(buildersDir,builderSpecs,resolveDependencies);if("buildersToAdd"in importResult){let{buildersToAdd,installReasons}=importResult,pinnedSpecs=pinBuilderSpecs(buildersToAdd,builderPins),installResult=await installBuilders2(buildersDir,new Set(Array.from(buildersToAdd,spec=>pinnedSpecs.get(spec)??spec)),span,installReasons,pinnedSpecs),allowedPinDriftSpecs=new Set(Array.from(pinnedSpecs.keys()).filter(spec=>installResult.has(spec)));if(importResult=await resolveBuilders(buildersDir,builderSpecs,resolveDependencies,installResult,allowedPinDriftSpecs),"buildersToAdd"in importResult){let{buildersToAdd:failed,installReasons:reasons}=importResult,failures=Array.from(failed,spec=>{let reason=reasons.get(spec);return reason?`${spec} (${reason})`:spec}),err=new Error(`Failed to load Builders after installing them: ${failures.join(", ")}. Retry the build. If the failure persists, contact Vercel Support.`);throw Object.assign(err,{link:"https://vercel.link/builder-dependencies-install-failed"}),err}}let resolvedBuildersDebug=[];for(let[spec,builderSpec]of importResult.builders)resolvedBuildersDebug.push(`${spec} => ${builderSpec.pkg.version}`);return debug(`Resolved builders: "${resolvedBuildersDebug.join(", ")}"`),importResult.builders}}function missingModuleId(err){let id=/Cannot find module '([^']+)'/.exec(err.message)?.[1];if(id&&!(id.startsWith("/")||id.startsWith(".")||/^[A-Za-z]:[\\/]/.test(id)))return id.replace(/[,=]/g,"_").slice(0,100)}async function resolveBuilders(buildersDir,builderSpecs,dependencies,resolvedSpecs,allowedPinDriftSpecs){let builders=new Map,buildersToAdd=new Set,installReasons=new Map;for(let spec of builderSpecs){let resolvedSpec=resolvedSpecs?.get(spec)||spec,parsed=(0,import_npm_package_arg2.default)(resolvedSpec),{name}=parsed;if(!name){buildersToAdd.add(spec),installReasons.set(spec,"url-spec");continue}if((0,import_fs_detectors.isStaticRuntime)(name)){builders.set(name,{builder:dependencies.staticBuilder,pkg:{name},path:"",pkgPath:"",dynamicallyInstalled:!1});continue}let entrypointLoadFailed=!1;try{let pkgPath,builderPkg;try{pkgPath=(0,import_path.join)(buildersDir,"node_modules",name,"package.json"),builderPkg=await(0,import_fs_extra.readJSON)(pkgPath)}catch(error){if(!(0,import_error_utils.isErrnoException)(error)||error.code!=="ENOENT")throw error;if(dependencies.isNativeBinaryInstall()){buildersToAdd.add(spec),installReasons.set(spec,"not-installed");continue}pkgPath=dependencies.require.resolve(`${name}/package.json`),builderPkg=await(0,import_fs_extra.readJSON)(pkgPath)}if(!builderPkg||!pkgPath)throw new Error(`Failed to load \`package.json\` for "${name}"`);if(typeof builderPkg.version!="string")throw new Error(`\`package.json\` for "${name}" does not contain a "version" field`);let peerVersion=dependencies.builderPins.get(name);if(isDefaultSpec(parsed)&&peerVersion&&(0,import_semver.valid)(peerVersion)&&builderPkg.version!==peerVersion&&!allowedPinDriftSpecs?.has(spec)){dependencies.debug(`Resolved "${name}@${builderPkg.version}" does not match pin "${peerVersion}"`),buildersToAdd.add(spec),installReasons.set(spec,"pin-version-mismatch");continue}if(isDefaultSpec(parsed)&&peerVersion&&isRemoteBuilderPin(peerVersion)&&pkgPath.startsWith(buildersDir)&&!allowedPinDriftSpecs?.has(spec)){let installedSpec;try{installedSpec=(await(0,import_fs_extra.readJSON)((0,import_path.join)(buildersDir,"package.json"))).dependencies?.[name]}catch(error){if(!(0,import_error_utils.isErrnoException)(error)||error.code!=="ENOENT")throw error}if(installedSpec!==peerVersion){if(dependencies.debug(`Installed source for "${name}@${builderPkg.version}" is "${installedSpec??"unknown"}", not pin "${peerVersion}"`),dependencies.isNativeBinaryInstall()){buildersToAdd.add(spec),installReasons.set(spec,"preview-pack-mismatch");continue}try{pkgPath=dependencies.require.resolve(`${name}/package.json`),builderPkg=await(0,import_fs_extra.readJSON)(pkgPath)}catch(resolveError){if((0,import_error_utils.isErrnoException)(resolveError)&&(resolveError.code==="MODULE_NOT_FOUND"||resolveError.code==="ENOENT")){buildersToAdd.add(spec),installReasons.set(spec,"preview-pack-mismatch");continue}throw resolveError}}}if(!builderPkg||!pkgPath)throw new Error(`Failed to load \`package.json\` for "${name}"`);if(typeof builderPkg.version!="string")throw new Error(`\`package.json\` for "${name}" does not contain a "version" field`);if(parsed.type==="version"&&parsed.rawSpec!==builderPkg.version){dependencies.debug(`Installed version "${name}@${builderPkg.version}" does not match "${parsed.rawSpec}"`),buildersToAdd.add(spec),installReasons.set(spec,"version-mismatch");continue}if(parsed.type==="range"&&!(0,import_semver.satisfies)(builderPkg.version,parsed.rawSpec)){dependencies.debug(`Installed version "${name}@${builderPkg.version}" is not compatible with "${parsed.rawSpec}"`),buildersToAdd.add(spec),installReasons.set(spec,"range-mismatch");continue}let path=(0,import_path.join)((0,import_path.dirname)(pkgPath),builderPkg.main||"index.js"),builder;try{builder=dependencies.require(path)}catch(requireErr){throw entrypointLoadFailed=!0,requireErr}let dynamicallyInstalled=pkgPath.startsWith(buildersDir);builders.set(spec,{builder,pkg:{name,...builderPkg},path,pkgPath,dynamicallyInstalled}),dependencies.debug(`Imported Builder "${name}" from "${(0,import_path.dirname)(pkgPath)}"`)}catch(error){if(!(error instanceof Error))throw error;let err=error;if((err.code==="MODULE_NOT_FOUND"||err.code==="ENOENT")&&!resolvedSpecs)if(dependencies.debug(`Failed to import "${name}": ${err}`),buildersToAdd.add(spec),entrypointLoadFailed){let missing=missingModuleId(err);installReasons.set(spec,missing?`entrypoint-load-failed:${missing}`:"entrypoint-load-failed")}else installReasons.set(spec,"not-installed");else throw err.message=`Importing "${name}": ${err.message}`,err}}return buildersToAdd.size>0?{buildersToAdd,installReasons}:{builders}}}});var require_static_builder=__commonJS({"../../internals/builder-orchestration/dist/static-builder.js"(exports,module){"use strict";var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export2=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toESM2=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),static_builder_exports2={};__export2(static_builder_exports2,{createStaticBuilder:()=>createStaticBuilder2,version:()=>version2});module.exports=__toCommonJS(static_builder_exports2);var import_minimatch=__toESM2(require_minimatch()),import_build_utils=__require("@vercel/build-utils"),version2=2,ALWAYS_EXCLUDED_PREFIXES=[".git/","node_modules/"],DEFAULT_EXCLUDED_FILES=[".gitignore","package.json","package-lock.json","yarn.lock","pnpm-lock.yaml","bun.lock","bun.lockb","README.md"];function createStaticBuilder2(vercelConfigExtensions){let alwaysExcludedFiles=["vercel.json","vercel.toml",...vercelConfigExtensions.map(ext=>`vercel.${ext}`),".vercelignore","now.json",".nowignore"];return{version:version2,build:async({entrypoint,files,config})=>{let output={},outputDirectory=config.zeroConfig?config.outputDirectory:"";for(let[srcFilename,fileFsRef]of Object.entries(files)){if(entrypoint&&!(entrypoint===srcFilename||(0,import_minimatch.default)(srcFilename,entrypoint,{dot:!0})))continue;let filename=srcFilename;if(outputDirectory){let outputMatch=outputDirectory+"/";filename.startsWith(outputMatch)&&(filename=filename.slice(outputMatch.length))}ALWAYS_EXCLUDED_PREFIXES.some(prefix=>filename.startsWith(prefix))||alwaysExcludedFiles.includes(filename)||DEFAULT_EXCLUDED_FILES.includes(filename)||filename.startsWith(".env")||(output[filename]=fileFsRef)}return{output}},shouldServe:_opts=>{let opts={..._opts},{config:{zeroConfig,outputDirectory}}=opts;return zeroConfig&&outputDirectory&&(opts.entrypoint=`${outputDirectory}/${opts.entrypoint}`,opts.requestPath=`${outputDirectory}/${opts.requestPath}`),(0,import_build_utils.shouldServe)(opts)},diagnostics:async({service})=>({[import_build_utils.MANIFEST_FILENAME]:new import_build_utils.FileBlob({data:JSON.stringify({version:import_build_utils.MANIFEST_VERSION,runtime:"static",buildType:"app",dependencies:[],serviceType:service!==void 0?(0,import_build_utils.getReportedServiceType)(service):void 0})})})}}}});var require_install_builders=__commonJS({"../../internals/builder-orchestration/dist/install-builders.js"(exports,module){"use strict";var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export2=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toESM2=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),install_builders_exports={};__export2(install_builders_exports,{createInstallBuilders:()=>createInstallBuilders2,getBuildUtilsSpec:()=>getBuildUtilsSpec,getBuildUtilsVersionForInstall:()=>getBuildUtilsVersionForInstall,shouldFallbackBuilderPins:()=>shouldFallbackBuilderPins});module.exports=__toCommonJS(install_builders_exports);var import_url=__require("url"),import_pluralize=__toESM2(require_pluralize()),import_path=__require("path"),import_npm_package_arg2=__toESM2(require_npa()),import_semver=require_semver(),import_fs_extra=require_lib(),import_error_utils=require_dist();function getBuildUtilsVersionForInstall(dependencies,usePinnedVersion){return usePinnedVersion?dependencies.pinnedBuildUtilsVersion??dependencies.buildUtilsVersion:dependencies.buildUtilsVersion}function shouldFallbackBuilderPins(dependencies,pinnedSpecCount){return pinnedSpecCount>0&&!dependencies.strictBuilderPins}function getBuildUtilsSpec(buildUtilsVersion){if(!buildUtilsVersion)return"@vercel/build-utils";if((0,import_semver.validRange)(buildUtilsVersion))return`@vercel/build-utils@${buildUtilsVersion}`;try{if((0,import_npm_package_arg2.default)(buildUtilsVersion).type==="remote")return`@vercel/build-utils@${buildUtilsVersion}`}catch{}return"@vercel/build-utils"}function getErrorMessage(err,execaMessage){return!err||!("stderr"in err)?execaMessage:typeof err.stderr=="string"?err.stderr:execaMessage}async function untracedInstallBuilders(buildersDir,buildersToAdd,dependencies,buildUtilsVersion=dependencies.buildUtilsVersion){let{code:code2,cmd:cmd2,output,readJSONFile:readJSONFile2,run}=dependencies,resolvedSpecs=new Map,buildersPkgPath=(0,import_path.join)(buildersDir,"package.json");try{let emptyPkgJson={private:!0,license:"UNLICENSED"};await(0,import_fs_extra.outputJSON)(buildersPkgPath,emptyPkgJson,{flag:"wx"})}catch(error){if(!(0,import_error_utils.isErrnoException)(error)||error.code!=="EEXIST")throw error}output.log(`Installing ${(0,import_pluralize.default)("Builder",buildersToAdd.size)}: ${Array.from(buildersToAdd).join(", ")}`);let installArgs=["install",getBuildUtilsSpec(buildUtilsVersion),...buildersToAdd];try{let{stderr}=await run("npm",installArgs,{cwd:buildersDir,stdio:"pipe",reject:!0});stderr.split(`/\r?
|
|
8
|
-
/`).filter(line=>line.includes("npm WARN deprecated")).forEach(line=>{output.warn(line)})}catch(err){if((0,import_error_utils.isError)(err)){let execaMessage=err.message,message=getErrorMessage(err,execaMessage);if(execaMessage.startsWith("Command failed with ENOENT"))message=`Please install ${cmd2("npm")} before continuing`;else{let notFoundUrl=/GET (.*) - Not found/.exec(message)?.[1];if(notFoundUrl){let url=new import_url.URL(notFoundUrl),packagePath=decodeURIComponent(url.pathname),packageName=/(@[^/]+\/[^/]+)$/.exec(packagePath)?.[1]??packagePath.split("/").filter(Boolean).at(-1)??packagePath;message=`The package ${code2(packageName)} is not published on the npm registry`}}err.message=message,Object.assign(err,{link:"https://vercel.link/builder-dependencies-install-failed"})}throw err}let nowScopePath=(0,import_path.join)(buildersDir,"node_modules/@now");await(0,import_fs_extra.mkdirp)(nowScopePath);try{await(0,import_fs_extra.symlink)("../@vercel/build-utils",(0,import_path.join)(nowScopePath,"build-utils"))}catch(err){if(!(0,import_error_utils.isErrnoException)(err)||err.code!=="EEXIST")throw err}let buildersPkg=await readJSONFile2(buildersPkgPath);if(dependencies.isCantParseJSONFile(buildersPkg))throw buildersPkg;if(!buildersPkg)throw new Error(`Failed to load "${buildersPkgPath}"`);for(let spec of buildersToAdd)for(let[name,version2]of Object.entries(buildersPkg.dependencies||{}))version2===spec&&(output.debug(`Resolved Builder spec "${spec}" to name "${name}"`),resolvedSpecs.set(spec,name));return resolvedSpecs}function createInstallBuilders2(dependencies){let{output}=dependencies;return async function(buildersDir,buildersToAdd,span,installReasons,pinnedSpecs){let install=async()=>{try{return await untracedInstallBuilders(buildersDir,buildersToAdd,dependencies,getBuildUtilsVersionForInstall(dependencies,!!pinnedSpecs?.size))}catch(err){let fallbackPins=pinnedSpecs;if(!fallbackPins||!shouldFallbackBuilderPins(dependencies,fallbackPins.size))throw err;let fallbackSpecs=new Set(Array.from(buildersToAdd,spec=>{for(let[originalSpec,pinnedSpec]of fallbackPins)if(pinnedSpec===spec)return originalSpec;return spec}));output.warn("Could not install the Builder versions pinned by this Vercel CLI release. Retrying with versions allowed by your npm settings.");let resolvedSpecs=await untracedInstallBuilders(buildersDir,fallbackSpecs,dependencies,dependencies.buildUtilsVersion);for(let originalSpec of fallbackPins.keys())fallbackSpecs.has(originalSpec)&&resolvedSpecs.set(originalSpec,originalSpec);return resolvedSpecs}};if(!span)return install();let attributes={packages:Array.from(buildersToAdd).join(",")};return installReasons&&installReasons.size>0&&(attributes.reasons=Array.from(installReasons).map(([spec,reason])=>`${spec}=${reason}`).join(",")),pinnedSpecs&&pinnedSpecs.size>0&&(attributes.pinned="true",attributes.pinnedPackages=Array.from(pinnedSpecs.values()).join(",")),span.child("vc.installBuilders",attributes).trace(async s=>{try{return await install()}catch(err){throw s.setAttributes({error:(0,import_error_utils.isError)(err)?err.message:String(err)}),err}})}}}});var import_import_builders=__toESM(require_import_builders(),1);var static_builder_exports={};__export(static_builder_exports,{build:()=>build,diagnostics:()=>diagnostics,shouldServe:()=>shouldServe,version:()=>version});var import_static_builder=__toESM(require_static_builder(),1);var{version,build,shouldServe,diagnostics}=(0,import_static_builder.createStaticBuilder)(VERCEL_CONFIG_EXTENSIONS);var import_install_builders=__toESM(require_install_builders(),1);var import_execa=__toESM(require_execa(),1),binaryPkg=pkg_default,installBuilders=(0,import_install_builders.createInstallBuilders)({buildUtilsVersion:pkg_default.dependencies?.["@vercel/build-utils"],pinnedBuildUtilsVersion:binaryPkg.pinnedBuildUtilsVersion,strictBuilderPins:binaryPkg.strictBuilderPins,code,cmd,isCantParseJSONFile:value=>value instanceof CantParseJSONFile,output:output_manager_default,readJSONFile,run:import_execa.default});import{createRequire}from"module";import{brotliDecompress}from"node:zlib";import{promisify}from"node:util";import{readFile}from"node:fs/promises";import{join}from"node:path";var decompress=promisify(brotliDecompress),embeddedGraphs;function defaultGraphPaths(){return[join(__dirname,"builder-graph.json.br"),join(__dirname,"..","builders","builder-graph.json.br")]}async function readDefaultGraph(){let lastError;for(let path of defaultGraphPaths())try{return await readFile(path)}catch(error){lastError=error}throw lastError}function loadEmbeddedBuilderGraphs(readGraph=readDefaultGraph){return embeddedGraphs??=(async()=>{try{let compressed=await readGraph(),graphs=JSON.parse((await decompress(new Uint8Array(compressed))).toString("utf8"));if(graphs.schemaVersion!==1||!graphs.builders||typeof graphs.builders!="object")throw new Error("invalid schema");return graphs}catch(error){throw embeddedGraphs=void 0,new Error("Could not load the embedded vlt Builder graphs.",{cause:error})}})(),embeddedGraphs}var import_npm_package_arg=__toESM(require_npa(),1);function isManagedSpec(spec,managedNames){let parsed=(0,import_npm_package_arg.default)(spec);return!!parsed.name&&managedNames.has(parsed.name)&&parsed.type==="tag"&&(parsed.rawSpec===""||parsed.rawSpec==="latest")}function partitionBuilderSpecs(specs,managedNames){let managed=new Map,legacy=new Set;for(let spec of specs)isManagedSpec(spec,managedNames)?managed.set(spec,(0,import_npm_package_arg.default)(spec).name):legacy.add(spec);return{managed,legacy}}var require_=createRequire(__filename);var legacyImportBuilders=(0,import_import_builders.createImportBuilders)({builderPins:pkg_default.builders??{},debug:message=>output_manager_default.debug(message),installBuilders,isNativeBinaryInstall,require:require_,staticBuilder:static_builder_exports,vercelDir:VERCEL_DIR}),managedBuilderNames=new Set(Object.keys(pkg_default.builders??{}));async function importBuilders(builderSpecs,cwd,span){if(!isNativeBinaryInstall()||process.env.VERCEL_EXPERIMENTAL_VLT_BUILDERS!=="1")return legacyImportBuilders(builderSpecs,cwd,span);let{managed,legacy}=partitionBuilderSpecs(builderSpecs,managedBuilderNames);if(output_manager_default.debug(`Builder import routing: vlt=[${[...managed].map(([spec])=>spec).join(", ")}], legacy=[${[...legacy].join(", ")}]`),managed.size===0)return legacyImportBuilders(legacy,cwd,span);let[{createVltBuilderImporter},graphs]=await Promise.all([import("./vlt-builder-importer-YVCYYRVV.js"),loadEmbeddedBuilderGraphs()]),vltImportBuilders=createVltBuilderImporter({loadGraphs:async()=>graphs,require:require_,debug:message=>output_manager_default.debug(message)}),[vltBuilders,legacyBuilders]=await Promise.all([vltImportBuilders(managed),legacy.size?legacyImportBuilders(legacy,cwd,span):Promise.resolve(new Map)]);return new Map([...vltBuilders,...legacyBuilders])}export{require_npa,import_import_builders,importBuilders};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
-
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
-
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
-
const require = __createRequire(import.meta.url);
|
|
5
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
-
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{getTeams}from"./chunk-CN2QZO4U.js";import{param}from"./chunk-SXUEGVWB.js";import{outputActionRequired}from"./chunk-NS4FH2TY.js";import{printAlignedLabel}from"./chunk-XSVBYDYI.js";import{getUser}from"./chunk-EVZRQGNK.js";import{getCommandName,packageName}from"./chunk-FI772UVH.js";import{require_build_utils}from"./chunk-XFVGX5HG.js";import{emoji,output_manager_default}from"./chunk-Z6Y55QJW.js";import{require_source}from"./chunk-U7KCDTCH.js";import{__toESM}from"./chunk-6L236MNA.js";var import_chalk=__toESM(require_source(),1);var import_build_utils=__toESM(require_build_utils(),1);function getScopeOrTeamFromArgv(argv){let args=argv.slice(2);for(let i=0;i<args.length;i++){let arg=args[i];if(arg==="--scope"||arg==="--team"||arg==="-S"||arg==="-T"){let next=args[i+1];if(typeof next=="string"&&!next.startsWith("-"))return next;continue}if(arg.startsWith("--scope="))return arg.slice(8);if(arg.startsWith("--team="))return arg.slice(7)}return null}async function selectOrg(client,question,autoConfirm,searchable=!1,meta,description){let{config:{currentTeam}}=client;output_manager_default.spinner("Loading teams\u2026",1e3);let user,teams;try{[user,teams]=await Promise.all([getUser(client),getTeams(client)])}finally{output_manager_default.stopSpinner()}let formatChoiceName=(name,slug,isCurrent,limited)=>{let title=`${name} (${slug})`;return isCurrent&&(title+=` ${import_chalk.default.bold("(current)")}`),limited&&(title+=` ${emoji("locked")}`),title},choices=[...user.version==="northstar"?[]:[{name:formatChoiceName(user.name||user.username,user.username,!currentTeam,user.limited),value:{type:"user",id:user.id,slug:user.username}}],...teams.sort(a=>a.id===user.defaultTeamId?-1:1).map(team=>({name:formatChoiceName(team.name||team.slug,team.slug,team.id===currentTeam,team.limited),value:{type:"team",id:team.id,slug:team.slug}}))],defaultChoiceIndex=Math.max(choices.findIndex(choice=>choice.value.id===currentTeam),0);meta&&(meta.choiceCount=choices.length);let localConfigScope=client.localConfig?.scope,explicitScope=getScopeOrTeamFromArgv(client.argv)??(typeof localConfigScope=="string"?localConfigScope:null)??(0,import_build_utils.getPlatformEnv)("ORG_ID")??null,matchExplicitScope=()=>{if(!explicitScope)return;let match=choices.find(c=>c.value.id===explicitScope||c.value.slug===explicitScope);if(match)return match.value;if(user.id===explicitScope||user.email===explicitScope||user.username===explicitScope)return choices.find(c=>c.value.type==="user")?.value};if(client.nonInteractive||!client.stdin.isTTY){let match=matchExplicitScope();if(match)return match;if(choices.length===1)return choices[0].value;let actionRequired={status:"action_required",reason:"missing_scope",message:choices.length>0?"Provide --team or --scope explicitly. No default is applied in non-interactive mode.":"No teams available.",choices:choices.map(c=>({id:c.value.id,name:c.value.slug})),next:choices.map(c=>({command:`${packageName} link --team ${c.value.slug}`}))};outputActionRequired(client,actionRequired),output_manager_default.error(choices.length>0?`Multiple teams found. Teams are never auto-selected when the CLI runs without an interactive terminal. Re-run this command with ${param("--team <slug>")}, or run ${getCommandName("teams ls")} to list your teams.`:"No teams available."),process.exit(1)}let explicitOrg=matchExplicitScope();if(explicitOrg)return explicitOrg;if(choices.length===1)return printAlignedLabel("Team",choices[0].value.slug),choices[0].value;let descriptionLine=description?`
|
|
8
|
-
${import_chalk.default.dim(` ${description}`)}`:"";if(!searchable)return await client.input.select({message:`${question}${descriptionLine}`,choices,default:choices[defaultChoiceIndex].value});let defaultChoice=choices[defaultChoiceIndex],initialChoices=defaultChoice?[defaultChoice,...choices.filter(choice=>choice!==defaultChoice)]:choices,pageSize=15,countHint=choices.length>pageSize?` ${import_chalk.default.dim(`(${choices.length} teams)`)}`:"";return await client.input.search({message:`${question}${countHint}${descriptionLine}`,pageSize,source:term=>{let searchTerm=term?.trim().toLowerCase();return searchTerm?choices.filter(choice=>choice.name.toLowerCase().includes(searchTerm)||choice.value.slug.toLowerCase().includes(searchTerm)):initialChoices}})}export{selectOrg};
|