@microsoft/cmr-cli 0.32.3 → 0.33.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/{Add-FU57YE5G.js → Add-75RSJNM4.js} +2 -2
- package/dist/{AddConfig-CI7KNLIG.js → AddConfig-4SAYYOBQ.js} +2 -2
- package/dist/{AddConnector-WH4IU3ND.js → AddConnector-P4R4NJ5P.js} +2 -2
- package/dist/{AddDeployment-GWFCPAL5.js → AddDeployment-TBA3AAGD.js} +2 -2
- package/dist/{AddDeploymentBinding-RFLI6DKH.js → AddDeploymentBinding-6FZ7Y5JM.js} +2 -2
- package/dist/{AddRayfin-VRCFEOIL.js → AddRayfin-35GBGCWF.js} +2 -2
- package/dist/{Alter-JFFT5JOA.js → Alter-U7WDVOMU.js} +2 -2
- package/dist/{AuthStatus-WCZYGI5G.js → AuthStatus-XA6RGYYZ.js} +2 -2
- package/dist/{AuthSwitch-XJMG7IUR.js → AuthSwitch-2FXB7WFU.js} +2 -2
- package/dist/Bin.js +1 -1
- package/dist/{BuildMaafApp-7AUZHYOQ.js → BuildMaafApp-3EGRD23G.js} +2 -2
- package/dist/{Clear-7B7CDIPV.js → Clear-MZGQZ2XK.js} +2 -2
- package/dist/{Cli-XZ4SJKBZ.js → Cli-6A2HUP7R.js} +3 -3
- package/dist/{CloneMaafApp-7W246RZA.js → CloneMaafApp-YAEYSP23.js} +2 -2
- package/dist/CreateMaafApp-2XYROOHB.js +23 -0
- package/dist/CreateMaafProject-Q7KIVAR2.js +11 -0
- package/dist/{DeleteMaafApp-TFGWGJO3.js → DeleteMaafApp-G3SL3GGP.js} +2 -2
- package/dist/DeployMaafApp-DBJONCUH.js +8 -0
- package/dist/DeployMaafProject-SOMMKVJO.js +11 -0
- package/dist/{DeploymentApprovals-WTXBXCKE.js → DeploymentApprovals-Y67LSQQG.js} +2 -2
- package/dist/{Dev-CIEWFRXR.js → Dev-TXJLPT7K.js} +3 -3
- package/dist/FeatureSettings-LYV6QUZB.js +11 -0
- package/dist/{GenerateCode-UQCHTRGP.js → GenerateCode-Z2OY3SZR.js} +2 -2
- package/dist/{GetMaafBuildStatus-6ZSLIZCH.js → GetMaafBuildStatus-ZR5GCREL.js} +2 -2
- package/dist/{GetMaafProjectDeployStatus-NZEMVQGJ.js → GetMaafProjectDeployStatus-OJ56DPZ6.js} +2 -2
- package/dist/{GetSettings-MVVEXMJC.js → GetSettings-64N4P6L7.js} +2 -2
- package/dist/{InfoMaafApp-7Z6OJCHD.js → InfoMaafApp-FJM7UI5H.js} +2 -2
- package/dist/InfoMaafProject-EU6OQ7DX.js +11 -0
- package/dist/{Init-PBH2IXVK.js → Init-MTONJT7V.js} +2 -2
- package/dist/{ListConnectorActions-UERYZ2C7.js → ListConnectorActions-PJTNNWLH.js} +2 -2
- package/dist/{ListConnectors-2FUTJMHY.js → ListConnectors-JYNVPB3O.js} +2 -2
- package/dist/{ListDeployments-4YWCHVKF.js → ListDeployments-UV6J6WA5.js} +2 -2
- package/dist/ListMaafApps-QPEX7JA4.js +11 -0
- package/dist/{ListMaafProjects-GNUXZSYL.js → ListMaafProjects-RDR2S3HD.js} +2 -2
- package/dist/{ListSchema-QKVHVPHB.js → ListSchema-IR7FTBRR.js} +2 -2
- package/dist/{ListSettings-IIA5OGMP.js → ListSettings-3M7UOOLI.js} +2 -2
- package/dist/{Login-BT6UTPCZ.js → Login-G7TNQISG.js} +2 -2
- package/dist/{Logout-FBJE35Q5.js → Logout-AOOISVWK.js} +2 -2
- package/dist/{MockFetch-LQLQGTNT.js → MockFetch-GKQMNDW3.js} +2 -2
- package/dist/{NodeMsalAuthenticationProvider-5TJFMHR4.js → NodeMsalAuthenticationProvider-6ABSS6QK.js} +2 -2
- package/dist/{Pack-TSFHSTB5.js → Pack-QJZCMVEM.js} +2 -2
- package/dist/{PackProject-T575KJQ4.js → PackProject-Y3Q3KOTC.js} +2 -2
- package/dist/{PlayMaafApp-74TQEAO5.js → PlayMaafApp-MH66OLOV.js} +2 -2
- package/dist/ProjectApprovals-NTFYLH3W.js +13 -0
- package/dist/{ProjectRoleAssignments-AI2FQ2VX.js → ProjectRoleAssignments-7IDK6SGJ.js} +2 -2
- package/dist/{RefreshDataSource-VARFN3IV.js → RefreshDataSource-CISFHQNA.js} +2 -2
- package/dist/{RefreshGitAuth-DC5NAZBJ.js → RefreshGitAuth-NUQ7JNJA.js} +2 -2
- package/dist/{Remove-MCQZVI3K.js → Remove-IYDTKDJE.js} +2 -2
- package/dist/{RemoveDataSource-RRND46QZ.js → RemoveDataSource-T2AG7ZWC.js} +2 -2
- package/dist/{RemoveDeployment-STNFNNZF.js → RemoveDeployment-K3GDRCXJ.js} +2 -2
- package/dist/{ServicePrincipalAuthenticationProvider-7RBHTYYY.js → ServicePrincipalAuthenticationProvider-CEHIAANL.js} +2 -2
- package/dist/{SetSetting-Q7EQNOTI.js → SetSetting-KOWAPJWX.js} +2 -2
- package/dist/{SetSetting-CEH44OT3.js → SetSetting-PD76MA6O.js} +2 -2
- package/dist/{ShareLinkCreate-ZUVHUQLH.js → ShareLinkCreate-VCWVBQ4B.js} +2 -2
- package/dist/{ShareLinkList-IEYU6NZW.js → ShareLinkList-5VG5CG34.js} +2 -2
- package/dist/ShareLinkRevoke-KYUNMTG5.js +11 -0
- package/dist/ShareList-M25UE6LD.js +11 -0
- package/dist/{ShareMaafApp-SFNOOMOD.js → ShareMaafApp-QMEJEXPZ.js} +2 -2
- package/dist/{TelemetrySettings-XCT73DEI.js → TelemetrySettings-FVJUK5MR.js} +2 -2
- package/dist/{UnshareMaafApp-TU7U3LQ3.js → UnshareMaafApp-RIUUYHIL.js} +2 -2
- package/dist/{chunk-Q3ONTUZ7.js → chunk-2UMD5IAQ.js} +2 -2
- package/dist/chunk-36YYCVFC.js +12 -0
- package/dist/chunk-3UIUI5Q2.js +11 -0
- package/dist/{chunk-KKC5ZK4D.js → chunk-4AO24KKT.js} +21 -21
- package/dist/{chunk-TMYOZDLM.js → chunk-4C6DWU2Y.js} +2 -2
- package/dist/{chunk-SIEI2EB5.js → chunk-4JTUAUHI.js} +2 -2
- package/dist/{chunk-UXKJNXTZ.js → chunk-4UHMKZLH.js} +2 -2
- package/dist/{chunk-3E7QQ2BR.js → chunk-4WQT5P2M.js} +2 -2
- package/dist/{chunk-GE3UFHZ5.js → chunk-5BE4TLDK.js} +2 -2
- package/dist/{chunk-XIX2O22O.js → chunk-A57M2UGH.js} +2 -2
- package/dist/chunk-B6REHI77.js +11 -0
- package/dist/{chunk-DKSLWH4O.js → chunk-BREK3DVB.js} +2 -2
- package/dist/{chunk-RFLXPXBN.js → chunk-C7V6WEZM.js} +2 -2
- package/dist/{chunk-DGUO74I3.js → chunk-CER3QPDN.js} +2 -2
- package/dist/{chunk-PEZMQ2A3.js → chunk-CONEIY4I.js} +2 -2
- package/dist/{chunk-UEZV46GZ.js → chunk-DOCWK326.js} +2 -2
- package/dist/{chunk-4XKA5APP.js → chunk-E2O4YZX2.js} +192 -192
- package/dist/{chunk-2LKCCYRF.js → chunk-EFTF4FA7.js} +2 -2
- package/dist/{chunk-6EF722GY.js → chunk-ELHOJBVT.js} +11 -11
- package/dist/{chunk-ADRQC63G.js → chunk-FGB6GFXI.js} +2 -2
- package/dist/chunk-GVLAG66W.js +13 -0
- package/dist/{chunk-PLFDUGBA.js → chunk-HWEMI6JI.js} +2 -2
- package/dist/{chunk-BRRT2E75.js → chunk-IM7SC23O.js} +3 -3
- package/dist/{chunk-KT2SUHGM.js → chunk-JDRULLI3.js} +2 -2
- package/dist/{chunk-EFY2BSWB.js → chunk-JMF444BA.js} +2 -2
- package/dist/{chunk-QLK3ZVWP.js → chunk-JWSX7DVU.js} +2 -2
- package/dist/chunk-MWN7R4VR.js +12 -0
- package/dist/{chunk-HSNRWBA6.js → chunk-O4G2KO7E.js} +2 -2
- package/dist/{chunk-FHE3OXIP.js → chunk-OB6WEE2V.js} +2 -2
- package/dist/{chunk-RDXQ3ZPT.js → chunk-OBATM5M4.js} +2 -2
- package/dist/{chunk-ZB6MB7GZ.js → chunk-OTXBVG3E.js} +2 -2
- package/dist/{chunk-5MHBEEMZ.js → chunk-PBXK6LJO.js} +2 -2
- package/dist/chunk-VAKAW5BD.js +12 -0
- package/dist/{chunk-4U53RYJJ.js → chunk-WS6TGUH7.js} +2 -2
- package/dist/{chunk-WTTK2GTG.js → chunk-WV7KDGLS.js} +2 -2
- package/dist/{chunk-NYPHWF7Q.js → chunk-YMRQPXY7.js} +2 -2
- package/dist/{chunk-WWVAS3DS.js → chunk-YYXAAA2U.js} +2 -2
- package/dist/{chunk-PZIEJEF5.js → chunk-ZREDMBLO.js} +2 -2
- package/package.json +4 -4
- package/dist/CreateMaafApp-6MSPHUU4.js +0 -22
- package/dist/CreateMaafProject-JKMF5TH3.js +0 -11
- package/dist/DeployMaafApp-K2APWFOD.js +0 -8
- package/dist/DeployMaafProject-6WRKGIIW.js +0 -11
- package/dist/FeatureSettings-77LZQSKD.js +0 -11
- package/dist/InfoMaafProject-SQYB736C.js +0 -11
- package/dist/ListMaafApps-ZATO77G3.js +0 -11
- package/dist/ProjectApprovals-5KLYEM7V.js +0 -13
- package/dist/ShareLinkRevoke-22RFGOFJ.js +0 -11
- package/dist/ShareList-6UWIHPBM.js +0 -11
- package/dist/chunk-2LDU3F6O.js +0 -11
- package/dist/chunk-A4PVXTJS.js +0 -13
- package/dist/chunk-BA52TY55.js +0 -12
- package/dist/chunk-HOIFXUTG.js +0 -11
- package/dist/chunk-TXMTKOEJ.js +0 -12
- package/dist/chunk-YRPTITKD.js +0 -12
|
@@ -4,11 +4,11 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __pathDirname(__filename);
|
|
7
|
-
import{
|
|
7
|
+
import{Pb as d,a as S,h as C,i as w,sb as A,tb as c,ub as b,xb as x,y as u,yb as O}from"./chunk-E2O4YZX2.js";import{b as i}from"./chunk-WS6TGUH7.js";import v from"node:path";var k=new Map([["'state.schemaPath' and 'data.schemaPath' must have exactly the same value when both are configured.","state.schemaPath and data.schemaPath must match exactly when both are configured."],["'state.schemaPath' and legacy 'db.schemaPath' must have exactly the same value when both are configured.","state.schemaPath and db.schemaPath must match exactly when both are configured."],["'data.schemaPath' and legacy 'db.schemaPath' must have exactly the same value.","data.schemaPath and db.schemaPath must match exactly when both are configured."],["No state schema is configured. Set 'state.schemaPath' in ms.config.json.","Configure state.schemaPath in ms.config.json before using the 'ms project state' commands."]]),R="state/schema.json",p=["state","data","db"];function H(){let{appConfig:e,fileConfig:n}=d();return g(n.appConfigPath,e??{})}async function z(){let{appConfig:e,cliFs:n,fileConfig:t}=d();if(e===void 0)return{actionOptions:g(t.appConfigPath,{}),commitConfigAsync:async()=>{}};let a=await C(t.appConfigPath),r=E(a),f=!1;if(r===void 0){let s=N(a);for(let m of new Set(["state",...s]))a[m]={...a[m]??{},schemaPath:R};f=!0,r=o(()=>c(a))}if(!V(a)){let s=L(r.schemaConfigPath);a[s]={...a[s]??{},enabled:!0},f=!0}let P=g(t.appConfigPath,a),y=await F(P,n);return{actionOptions:P,commitConfigAsync:async()=>{if(f)try{await w(t.appConfigPath,a)}catch(s){try{await D(y,n)}catch(m){throw new AggregateError([s,m],`Failed to update app configuration and roll back schema '${y.schemaPath}'.`)}throw s}}}}function o(e){try{return e()}catch(n){throw j(n)}}async function G(e){try{return await e()}catch(n){throw j(n)}}function g(e,n){let t=v.dirname(v.resolve(e)),{configuredPath:a,schemaConfigPath:r}=o(()=>c(n));return{appRoot:t,configuredPath:a,configuredPathLabel:r}}async function F(e,n){let t=o(()=>b(e));return await n.exists(t)?{schemaPath:t,existed:!0,contents:await n.readFile(t,"utf-8")}:{schemaPath:t,existed:!1}}async function D(e,n){if(e.existed){await n.writeFile(e.schemaPath,e.contents??"",{encoding:"utf-8"});return}await n.exists(e.schemaPath)&&await n.unlink(e.schemaPath)}function E(e){if($(e))return o(()=>c(e))}function $(e){return p.some(n=>{let t=e[n];return t===void 0?!1:(l(t)||o(()=>c(e)),Object.prototype.hasOwnProperty.call(t,"schemaPath")&&typeof t.schemaPath!="string"&&o(()=>c(e)),typeof t.schemaPath=="string")})}function N(e){return p.filter(n=>{let t=e[n];return t===void 0?!1:(l(t)||o(()=>c(e)),!0)})}function V(e){return p.some(n=>{let t=e[n];return l(t)&&t.enabled!==void 0})}function L(e){return e.slice(0,e.indexOf("."))}function l(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function j(e){if(A(e))return new u(e.message,{code:e.code,jsonPath:e.jsonPath});if(S(e)){let n=e.code==="CodegenConfigInvalid"?k.get(e.message)??e.message:e.message,t=e.recoveryPaths?.length?`
|
|
8
8
|
Recovery paths:
|
|
9
9
|
${e.recoveryPaths.map(a=>` ${a}`).join(`
|
|
10
10
|
`)}`:"";return new u(`${n}${t}`,{code:e.code,jsonPath:e.jsonPath,recoveryPaths:e.recoveryPaths})}return e}function h(e,n){if(n!==void 0){if(n==="true")return!0;if(n==="false")return!1;throw new u(`--${e} must be 'true' or 'false', but was '${n}'.`)}}function I(e,n){if(n===void 0)return;if(n==="")return null;let t=Number(n);if(!Number.isInteger(t)||t<0)throw new u(`--${e} must be a non-negative whole number, but was '${n}'.`);return t}function T(e){if(e===void 0)return;if(e==="")return null;let n=Number(e);return e.trim().length>0&&Number.isFinite(n)?n:e}async function J(e){let n=async r=>await e.getOption(r,!0),t=await n("format"),a=await n("kind");return{required:h("required",await n("required")),index:h("index",await n("index")),ignoreCase:h("index-ignore-case",await n("indexIgnoreCase")),ignoreAccents:h("index-ignore-accents",await n("indexIgnoreAccents")),maxLength:I("max-length",await n("maxLength")),minLength:I("min-length",await n("minLength")),maxValue:T(await n("maxValue")),minValue:T(await n("minValue")),format:t===void 0?void 0:t===""?null:o(()=>x(t)),kind:a===void 0?void 0:a===""?null:o(()=>O(a))}}function Q(e,n){return n!==void 0?!0:Object.values(e).some(t=>t!==void 0)}function W(e){return[i.Required.name,i.Index.name,i.IndexIgnoreCase.name,i.IndexIgnoreAccents.name,i.MaxLength.name,i.MinLength.name,i.MaxValue.name,i.MinValue.name,i.Format.name,i.Kind.name].map(t=>({flags:{key:t},description:e[t],optionalInNonInteractive:!0}))}export{H as a,z as b,o as c,G as d,h as e,J as f,Q as g,W as h};
|
|
11
11
|
/*!
|
|
12
12
|
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
13
13
|
*/
|
|
14
|
-
//# sourceMappingURL=chunk-
|
|
14
|
+
//# sourceMappingURL=chunk-FGB6GFXI.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __pathDirname } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{h as we,i as ve,k as De}from"./chunk-YMRQPXY7.js";import{b as Ae}from"./chunk-HWEMI6JI.js";import{a as Oe}from"./chunk-ELHOJBVT.js";import{e as he}from"./chunk-JWSX7DVU.js";import{b as ge}from"./chunk-ZREDMBLO.js";import{a as K}from"./chunk-OL6CTXQR.js";import{a as ye}from"./chunk-OBATM5M4.js";import{e as ce,f as me,m as ue}from"./chunk-OTXBVG3E.js";import{b as z}from"./chunk-EFTF4FA7.js";import{b as Z,l as de}from"./chunk-5BE4TLDK.js";import{A as I,B as V,E as O,Fa as se,Ka as pe,La as le,Ob as M,Pb as U,Ra as q,Sa as Y,da as re,l as ie,w as J,x as A,y as p}from"./chunk-E2O4YZX2.js";import{b as fe,n as X}from"./chunk-B6REHI77.js";import{y as f,z as N}from"./chunk-WS6TGUH7.js";import{a as g}from"./chunk-3UIUI5Q2.js";import{G as B,H as x,I as ae,M as u,O as F,a as C}from"./chunk-4AO24KKT.js";import{d as xe}from"./chunk-UT667QSU.js";import{promises as Pe}from"node:fs";import*as _ from"node:path";import*as be from"node:zlib";var Me=10*1024*1024;function Ce(e,t){try{return Ue(e,t)}catch{return}}function Ue(e,t){let o=He(e);if(o<0)return;let a=33639248,n=e.readUInt16LE(o+10),r=e.readUInt32LE(o+16);for(let s=0;s<n;s++){if(e.readUInt32LE(r)!==a)return;let i=e.readUInt16LE(r+10),d=e.readUInt32LE(r+20),c=e.readUInt16LE(r+28),v=e.readUInt16LE(r+30),h=e.readUInt16LE(r+32),l=e.readUInt32LE(r+42);if(e.subarray(r+46,r+46+c).toString("utf8")===t){let k=e.readUInt16LE(l+26),S=e.readUInt16LE(l+28),m=l+30+k+S,w=e.subarray(m,m+d);return i===0?w.toString("utf8"):i===8?be.inflateRawSync(w,{maxOutputLength:Me}).toString("utf8"):void 0}r+=46+c+v+h}}function He(e){let o=Math.max(0,e.length-22-65535);for(let a=e.length-22;a>=o;a--){if(e.readUInt32LE(a)!==101010256)continue;let n=e.readUInt16LE(a+20);if(a+22+n===e.length)return a}return-1}import{promises as Ie}from"node:fs";var ke=xe(Oe(),1);function Le(e){return e?.code==="ENOENT"?"continue":e instanceof Error?e:new Error(String(e))}function _e(e){return`zipBuildArtifact: skipping missing entry: ${e?.path??"<unknown>"}`}async function Se(e,t,o){let a=await Ie.stat(e).catch(()=>null);if(!a)throw new p(`buildPath not found: ${e}`);if(!a.isDirectory())throw new p(`buildPath is not a directory: ${e}`);let n=await Ie.stat(t).catch(()=>null);if(!n||!n.isFile())throw new p(`appConfigPath does not point to a file: ${t}`);let r=o?.maxBytes;return new Promise((s,i)=>{let d=[],c=0,v=!1,h=(0,ke.default)("zip",{zlib:{level:9}});h.on("data",l=>{if(!v){if(c+=l.length,r!==void 0&&c>r){v=!0,h.abort(),i(new O({capBytes:r,bytes:c}));return}d.push(l)}}),h.on("warning",l=>{if(v)return;let b=Le(l);if(b==="continue"){F(_e(l));return}i(b)}),h.on("error",l=>{v||i(l)}),h.on("end",()=>{v||s(Buffer.concat(d))}),h.directory(e,!1),h.file(t,{name:C}),h.finalize()})}var je=1200*1e3,Ge=6e4,We=2e3,Je="--no-wait requires Managed DevOps deployment; the selected backend does not return a trackable deployment ID.",Ee=`External artifact deployment is not enabled for this environment.
|
|
8
|
+
To enable it, contact your administrator to turn on the
|
|
9
|
+
AllowExternalArtifactDeployment environment setting.`;function Q(e){return`${(e/(1024*1024)).toFixed(1)} MB`}function ee(e,t){return e!==void 0?`Build artifact is ${Q(e)}, which exceeds the ${Q(t)} limit.`:`Build artifact exceeds the ${Q(t)} limit.`}function Ve(e){let t=e.id||e.name;if(!t)throw new A("Deploy succeeded but the server response did not include an app identifier.");return{appId:t,displayName:e.displayName,commitHash:e.commitHash??null,appPlayUri:e.appPlayUri??null}}function Ne(e){return{appId:e.appId,displayName:e.name,commitHash:e.commitSha,appPlayUri:e.appPlayUri}}function te(e,t=e.commitSha){return{deploymentId:e.deploymentId,appName:e.appName,commitHash:t}}function oe(e){let t,o;return{onProgress:a=>{e?.(a),a.type==="submitted"&&(o=a.commitSha),a.type==="status"&&a.deploymentStatus==="AwaitingApproval"&&(t=a.deploymentId)},getHandoff:()=>t?{deploymentId:t,commitHash:o}:void 0}}function P(e){if(e.body)try{let t=JSON.parse(e.body);if(typeof t?.error?.message=="string")return t.error.message}catch{}}var qe={AwaitingApproval:"awaitingApproval",Pending:"inProgress",ValidatingAssets:"inProgress",ValidationCompleted:"inProgress",Running:"inProgress",RollingBack:"inProgress"};function Ye(e){let t=P(e);if(!t)return"unknown";for(let[o,a]of Object.entries(qe))if(t.includes(`'${o}'`))return a;return"unknown"}function Ze(e,t){let{targetName:o}=t,a=o?` to target '${o}'`:"",n=` --project ${t.projectId??"<project-id>"} --environment-id ${t.environmentId}`,r=o?` --target ${o}`:"",s="The deployment could not be completed.";switch(e){case"awaitingApproval":return`${s} There is an existing deployment${a} awaiting approval. Wait for this deployment to complete or cancel the deployment before attempting to deploy again. Run \`${"ms"} deployment cancel${n}${r}\` to cancel it.`;case"inProgress":return`${s} There is an existing deployment${a} in progress. Wait for this deployment to complete before attempting to deploy again.`;case"unknown":return`${s} There is an existing deployment${a} that has not finished. Wait for this deployment to complete, or cancel it if it is awaiting approval, before attempting to deploy again. Run \`${"ms"} deployment list${n}\` to view it.`}}function Ke(e){let t=e.reason==="resultUnavailable"?`Run \`${"ms"} app info\` to view the deployed app.`:e.operationId?`Run \`${"ms"} app info\` to check which commit is live before deploying again.`:void 0;return t&&(e.message=`${e.message} ${t}`),e}function ze(e,t){if(e instanceof O)return new p(ee(e.bytes,e.capBytes),e.errorData,{errorCode:"BuildArtifactTooLarge",telemetryDetails:e.errorData});if(e instanceof re)return Ke(e);if(!(e instanceof ie))return null;let o={httpStatus:e.status,serverErrorCode:e.code},a=t.repoType!=="none";if(e.status===400&&e.code==="ArtifactNotAllowedForGitRepo"){let n=P(e);return new I(n?`Artifact upload rejected for this git-backed app: ${n}`:`The server reports this app is git-backed; --artifact uploads are not allowed. Update \`${C}\` so \`repoType\` matches the server's record, then re-run with --commit.`,{httpStatus:e.status,serverErrorCode:e.code},{errorCode:"DeploymentModeMismatch",exitCode:1,telemetryDetails:o})}if(e.status===400&&e.code==="CommitNotAllowedForArtifactDeploy")return new p("This app uses external artifact deployment. Pass --artifact <path> instead of --commit.",{httpStatus:e.status,serverErrorCode:e.code},{errorCode:"DeploymentModeMismatch",telemetryDetails:o});if(e.status===400&&e.code==="InvalidRequestContent")return new p("Invalid deploy request \u2014 verify the environment and app id.",{httpStatus:e.status,serverErrorCode:e.code},{errorCode:"InvalidDeployRequest",telemetryDetails:o});if(e.status===400&&e.code==="ServicePrincipalNotSupportedForMaafOperations")return new p("Service principal callers are not supported for `ms app deploy`. Use interactive auth.",{httpStatus:e.status,serverErrorCode:e.code},{errorCode:"UnsupportedCallerType",telemetryDetails:o});if(e.status===400&&e.code==="BadRequest"){let n=P(e);return a?new p(n??"Invalid commit ID. Use a 40-character lowercase hex value.",{httpStatus:e.status,serverErrorCode:e.code},{errorCode:"InvalidCommitSha",telemetryDetails:o}):new p(`Build artifact rejected: ${n??e.message}`,{httpStatus:e.status,serverErrorCode:e.code},{errorCode:"BuildArtifactRejected",telemetryDetails:o})}if(e.status===400&&e.code==="BuildNotAvailable")return new A("No completed build is available for this commit. Run `ms app build` first, or wait for the build to complete before retrying.",void 0,{httpStatus:e.status,serverErrorCode:e.code},{errorCode:"BuildNotAvailable",errorCategory:J.Platform,retryable:!0,telemetryDetails:o});if(e.status===403&&e.code==="ExternalArtifactDeploymentDisabled")return new I(Ee,{httpStatus:e.status,serverErrorCode:e.code},{errorCode:"ExternalArtifactDeploymentDisabled",exitCode:1,telemetryDetails:z("deployment_configuration",o)});if(e.status===403&&e.code==="InsufficientPrivilege"){let n=P(e);return new I(n?`${n} Ask an admin to grant the required privilege.`:"You don't have the required privilege to deploy this app. Ask an admin to grant deploy permission on the environment.",{httpStatus:e.status,serverErrorCode:e.code},{errorCode:"InsufficientPrivilege",exitCode:1,telemetryDetails:o})}if(e.status===403&&e.code==="CodeAppOperationNotAllowedInEnvironment")return new I(Ee,{httpStatus:e.status,serverErrorCode:e.code},{errorCode:"CodeAppOperationNotAllowedInEnvironment",exitCode:1,telemetryDetails:z("environment_configuration",o)});if(e.status===403&&e.code==="Forbidden")return new I("You don't have permission to deploy this app. Ask an admin to grant you Contributor on the repo.",{httpStatus:e.status,serverErrorCode:e.code},{errorCode:"RepositoryPermissionDenied",exitCode:1,telemetryDetails:o});if(e.status===404&&e.code==="CommitNotFound"){let n=P(e);return new p(n??"Commit not found on main.",{httpStatus:e.status,serverErrorCode:e.code},{errorCode:"CommitNotFound",telemetryDetails:o})}if(e.status===404&&e.code==="ApplicationNotFound")return new p(`App '${t.appName}' not found in environment ${t.environmentId}.`);if(e.status===404&&e.code==="PowerConfigNotFound")return new A(`Build output is missing the app config (\`${C}\`). Ensure the config is present at the root of the build output and re-run the build.`);if(e.status===404&&e.code==="OperationNotFound")return new A("Build operation not found on the server. The operation may have been cleaned up; re-run `ms app deploy` to start a fresh build.");if(e.status===409&&e.code==="BuildInProgress")return new A("A build is currently in progress for this app. Run `ms app build-status` to check progress, then retry the deploy.");if(e.status===409&&e.code==="NoGreenBuildAvailable")return new A("No successful build is available to deploy. Push a commit and wait for the build to succeed before retrying.");if(e.status===409&&e.code==="DeploymentTargetBusy"){let n=Ye(e);return new A(Ze(n,t),void 0,{httpStatus:e.status,serverErrorCode:e.code},{errorCode:"DeploymentTargetBusy",errorCategory:J.User,telemetryDetails:{...o,blockingDeploymentState:n}})}if(e.status===409&&e.code==="RepoTypeMismatch"){let n=P(e);return new p(n?`Repo type mismatch: ${n}`:"The app's repoType in ms.config.json doesn't match the server's record. Update ms.config.json to match.")}if(e.status===413)return new A(ee(void 0,524288e3));if(e.status===422&&e.code==="ArtifactInvalid"){let n=P(e)??e.message;return new p(`Artifact validation failed: ${n}`)}return e.status===502&&e.code==="MaafBuildServiceUnavailable"?new V("Build service is temporarily unavailable. Try again.",{httpStatus:e.status,serverErrorCode:e.code},{errorCode:"BuildServiceUnavailable",exitCode:1,retryable:!0,telemetryDetails:o}):e.status===503&&e.code==="AuthorizationCheckFailed"?new V("Authorization service is temporarily unavailable. Try again.",{httpStatus:e.status,serverErrorCode:e.code},{errorCode:"AuthorizationServiceUnavailable",exitCode:1,retryable:!0,telemetryDetails:o}):null}async function Xe(e){let{provider:t,appName:o,force:a,forceReauth:n,waitForDeployment:r,onDeployProgress:s}=e,i=e.commitFromFlag,d,c=!1;if(!i){let m=ce();if(!m)throw new p("Could not determine the latest commit ID. Use --commit or -c to specify it.");i=m.commitSha,d=m.detached?void 0:m.branch,c=!0}if(c&&!t.isJsonMode()&&u(d?`Using branch '${d}' at commit ${i}.`:`Detached HEAD at commit ${i}.`),!a){let m=ue();if(m&&U().interactive&&!t.isJsonMode()){if(F(m),!await Z({message:"Deploy anyway?",initialValue:!1}))return u("Deploy cancelled."),null}else if(m)throw new p(`${m} Run again with --force to deploy anyway.`)}let v=M(),h=await se({logger:v,actionsParams:{appName:o,commitSha:i,...n&&{forceReauth:!0}}});if(h===null)t.isJsonMode()||u(`A cached build exists for commit ${i}; `+(r?"deploying it.":"submitting its deployment."));else{t.isJsonMode()||u("Build queued; waiting for completion...");let m=await ge({appName:o,commitSha:i,initialWaitMs:h.retryAfterMs??We,isJsonMode:t.isJsonMode(),deadlineMs:je,maxIntervalMs:Ge,spinnerLabel:"Waiting for build..."});if(m.status!=="Succeeded")throw new A(`Unexpected terminal build status "${m.status}". Commit ID: ${i}.`)}let l={appName:o,commitSha:i,...e.targetName!==void 0&&{deploymentName:e.targetName},...n&&{forceReauth:!0}};if(!r){let m=await le({logger:v,actionsParams:l});return{kind:"submitted",value:te(m)}}let b=e.useManagedDevOpsDeployment?oe(s):void 0,k;try{k=await pe({logger:v,actionsParams:l,onProgress:b?.onProgress??s,onAppFrameworkProgress:e.onAppFrameworkProgress})}catch(m){let w=b?.getHandoff();if(!w)throw m;return{kind:"awaitingApproval",value:{deploymentId:w.deploymentId,appName:o,commitHash:i}}}let S=b?.getHandoff();return S?{kind:"awaitingApproval",value:{deploymentId:S.deploymentId,appName:o,commitHash:i}}:{kind:"deployed",value:Ve(k)}}function Qe(e){let t=Ce(e,"manifest.json");if(t===void 0)return;let o;try{o=JSON.parse(t)}catch{return}let a=o?.backends?.default?.kind;if(!(typeof a!="string"||a.toLowerCase()!=="rayfin")&&!X("rayfin"))throw new p(`This artifact packages a Rayfin backend (manifest.json "backends.default.kind": "rayfin"), but the rayfin CLI feature is not enabled in this environment. Enable it (${fe("rayfin")}=1 or \`ms feature enable rayfin\`) before deploying a pre-built Rayfin artifact, or rebuild the artifact without a Rayfin backend.`)}async function et(e){let t=_.resolve(e.artifactPath);if(_.extname(t).toLowerCase()!==".zip")throw new p(`--artifact must point to a .zip file. Received: ${e.artifactPath}`);let o=await tt(t);if(!o||!o.isFile())throw new p(`--artifact file not found or not a regular file: ${e.artifactPath}`);if(o.size>524288e3)throw new p(ee(o.size,524288e3));let a=await Pe.readFile(t);Qe(a),e.provider.isJsonMode()||u(e.waitForDeployment?"Uploading artifact and deploying...":"Uploading artifact and submitting deployment...");let n={logger:M(),actionsParams:{appName:e.appName,zipBuffer:a,...e.targetName!==void 0&&{deploymentName:e.targetName}}};if(!e.waitForDeployment){let{commitSha:d,submission:c}=await Y(n);return{kind:"submitted",value:te(c,d)}}let r=oe(e.onDeployProgress),s;try{s=await q({...n,onProgress:r.onProgress,onAppFrameworkProgress:e.onAppFrameworkProgress})}catch(d){let c=r.getHandoff();if(!c?.commitHash)throw d;return{kind:"awaitingApproval",value:{deploymentId:c.deploymentId,appName:e.appName,commitHash:c.commitHash}}}let i=r.getHandoff();return i?{kind:"awaitingApproval",value:{deploymentId:i.deploymentId,appName:e.appName,commitHash:s.commitSha}}:{kind:"deployed",value:Ne(s)}}async function tt(e){try{return await Pe.stat(e)}catch(t){if(t instanceof Error&&"code"in t&&t.code==="ENOENT")return null;throw t}}async function ot(e){if(we(e.appConfig),!(e.provider.isJsonMode()||!U().interactive)){let d=e.appConfig.buildType==="none"?"package the prebuilt app assets and deploy the resulting artifact":"build the app and deploy the resulting artifact";if(!await Z({message:`This will ${d} to environment ${e.environmentId}. Continue?`,initialValue:!1}))return u("Aborted."),null}let{packAppOutputDir:o}=await De({quiet:e.provider.isJsonMode()}),a=await Se(o,e.appConfigPath,{maxBytes:524288e3});e.provider.isJsonMode()||u(e.waitForDeployment?"Uploading build artifact and deploying...":"Uploading build artifact and submitting deployment...");let n={logger:M(),actionsParams:{appName:e.appName,zipBuffer:a,...e.targetName!==void 0&&{deploymentName:e.targetName}}};if(!e.waitForDeployment){let{commitSha:d,submission:c}=await Y(n);return{kind:"submitted",value:te(c,d)}}let r=oe(e.onDeployProgress),s;try{s=await q({...n,onProgress:r.onProgress,onAppFrameworkProgress:e.onAppFrameworkProgress})}catch(d){let c=r.getHandoff();if(!c?.commitHash)throw d;return{kind:"awaitingApproval",value:{deploymentId:c.deploymentId,appName:e.appName,commitHash:c.commitHash}}}let i=r.getHandoff();return i?{kind:"awaitingApproval",value:{deploymentId:i.deploymentId,appName:e.appName,commitHash:s.commitSha}}:{kind:"deployed",value:Ne(s)}}async function Ht(e){await nt(e,!1,at)}async function nt(e,t,o){lt(e,t),await e.runVerb();let a=t||e.isManagedDevOpsDeploymentEnabled(),n=await e.getOption(f.NoWait.camelName,!0)!==!1;if(!n&&!a)throw new p(Je);let r=await e.getOption("commit",!0),s=t?void 0:await e.getOption("artifact",!0);if(r&&s)throw new p("Pass either --commit or --artifact, not both. --commit triggers a build for the commit; --artifact deploys a pre-built zip.");let i=await o(e),{appName:d,tenantId:c,environmentId:v,projectId:h,repoType:l,externalRepoUrl:b,appConfig:k,appConfigPath:S,interactive:m}=i,w=(await e.getOption(f.Target.name,!0))?.trim();if(w!==void 0&&he(w,`--${f.Target.name}`),l==="none"&&r)throw new p("This app uses external artifact deployment. Pass --artifact <path> instead of --commit.");if(s&&l!=="none")throw new p(`--artifact is only valid for apps created with \`repoType: 'none'\`. This app's repoType is \`${l}\`; deploy via \`--commit\` (or omit it to use the current HEAD).`);let Re=r&&l!=="none"?me(r,!0):r,Fe=await e.getOption(f.OpenBrowser.camelName,!0)??!1,$e=await e.getOption(f.ForceReauth.camelName,!0)??!1,Te=await e.getOption(f.Force.name,!0)??!1,E=e.isJsonMode(),ne=m&&process.stdout.isTTY===!0,j=a&&!E&&n?st(ne):void 0,G=j?.onProgress,$=n?rt({print:!E,animate:ne}):void 0,W=$?.onProgress;E&&l==="github"&&ae({phase:"deploy-validation"});let y;try{if(s)y=await et({provider:e,appName:d,artifactPath:s,waitForDeployment:n,targetName:w,onDeployProgress:G,onAppFrameworkProgress:W});else if(l==="native"||l==="github")y=await ye(async({isRetry:T})=>{try{return await Xe({provider:e,appName:d,commitFromFlag:Re,force:Te,forceReauth:$e&&!T&&l==="github",waitForDeployment:n,targetName:w,useManagedDevOpsDeployment:a,onDeployProgress:G,onAppFrameworkProgress:W})}catch(Be){throw j?.stop(),$?.stop(),Be}},{repoType:l,externalRepoUrl:b,tenantId:c,jsonMode:E,openBrowser:Fe,verb:t?"project deploy":"app deploy"});else{if(!k||!S)throw new p("`ms project deploy` currently supports only git-backed managed projects.");y=await ot({provider:e,appName:d,appConfig:k,appConfigPath:S,environmentId:v,waitForDeployment:n,targetName:w,onDeployProgress:G,onAppFrameworkProgress:W})}}catch(R){let T=ze(R,{repoType:l,appName:d,environmentId:v,targetName:w,projectId:h});throw T||R}finally{j?.stop(),$?.stop()}if(y===null)return;if(y.kind==="submitted"){E?x({status:"submitted",deploymentId:y.value.deploymentId,appName:y.value.appName,commitHash:y.value.commitHash,repoType:l}):(B(`Deployment submitted for app '${y.value.appName}'.`),u(`Deployment ID: ${y.value.deploymentId}`),u(`Commit: ${y.value.commitHash}`));return}if(y.kind==="awaitingApproval"){E?x({status:"awaitingApproval",deploymentId:y.value.deploymentId,appName:y.value.appName,commitHash:y.value.commitHash,repoType:l}):(B(`Deployment is awaiting approval for app '${y.value.appName}'.`),u(`Deployment ID: ${y.value.deploymentId}`),u(`Commit: ${y.value.commitHash}`));return}let D=it(y.value,$?.getCompletion());if(w&&D.appPlayUri&&(D.appPlayUri=Ae(D.appPlayUri,"live",void 0,"main",w)??D.appPlayUri),E)x({...D,repoType:l});else{B(`Deployed app '${D.displayName}' (${D.appId}).`),D.commitHash&&u(`Commit: ${D.commitHash}`),D.appPlayUri&&u(`Play URL: ${D.appPlayUri}`),D.operationId&&u(`Operation: ${D.operationId}`);for(let R of D.warnings??[])F(R)}}async function at(e){let{appConfig:t,fileConfig:o,interactive:a}=U();if(!t)throw new I(`${C} is required. Run this command from a directory created by \`ms app create\`.`);if(!o?.appConfigPath)throw new I(`${C} path is unavailable.`);ve(t,s=>new p(s));let n=e.getEnvironmentId();if(!n)throw new p(`No environment ID found. Run this command from a directory with a ${C} (created by \`ms app create\`).`);let r=await e.getTenantIdAsync();if(!r)throw new p("Unable to determine tenant ID. Ensure you are logged in.");return{appName:await de(e),tenantId:r,environmentId:n,projectId:t.projectId?.trim()||void 0,repoType:t.repoType??"native",externalRepoUrl:t.externalRepoUrl,appConfig:t,appConfigPath:o.appConfigPath,interactive:a}}function it(e,t){return t?{...e,commitHash:t.commitHash,operationId:t.operationId,...t.warnings.length>0&&{warnings:t.warnings}}:e}function rt(e){let t,o=!1,a,n=()=>{o&&(t?.stop(),o=!1)},r=()=>{e.animate&&(t??=new K,t.start("Waiting for deployment..."),o=!0)},s=i=>i==="Pending"||i==="Running"||i==="Recovering";return{onProgress:i=>{switch(i.type){case"accepted":if(a=void 0,!e.print||!s(i.operationStatus))return;n(),u(`Deployment accepted. The service is migrating app data; commit ${i.commitHash} goes live when the migration finishes.`),u(`Operation: ${i.operationId}`),r();return;case"status":if(!e.print)return;n(),u(`Deployment status: ${i.operationStatus}`),s(i.operationStatus)&&r();return;case"completed":n(),a=i;return}},getCompletion:()=>a,stop:n}}function st(e){let t,o=!1,a,n=()=>{o&&(t?.stop(),o=!1)},r=()=>{e&&(t??=new K,t.start("Waiting for deployment..."),o=!0)};return{onProgress:i=>{let d=pt(i);if(d!==a)switch(a=d,i.type){case"submitting":n(),u("Submitting deployment...");break;case"submitted":n(),u(`Deployment ID: ${i.deploymentId}`),r();break;case"status":switch(n(),u(`Deployment status: ${i.deploymentStatus}`),i.deploymentStatus){case"Pending":case"AwaitingApproval":case"ValidatingAssets":case"ValidationCompleted":case"Running":case"RollingBack":r();break}break}},stop:()=>{n(),a=void 0}}}function pt(e){switch(e.type){case"submitting":return e.type;case"submitted":return`${e.type}:${e.deploymentId}`;case"status":return`${e.type}:${e.deploymentId}:${e.deploymentStatus}`}}function lt(e,t){let o=X("alm"),a=t?g.project.deploy:g.app.deploy;e.setDescription(a.description),e.addExamples(t?g.project.deploy.examples:o?g.app.deploy.examples:g.app.deploy.examples.filter(n=>!n.includes(" --target "))),e.addOptions([...t?[{flags:{key:N.ProjectId.name,alias:N.ProjectId.alias},description:g.project.deploy.options.projectId,optionalInNonInteractive:!0},{flags:{key:N.EnvironmentId.name,alias:N.EnvironmentId.alias},env:N.EnvironmentId.envVar,description:g.project.deploy.options.environmentId,optionalInNonInteractive:!0}]:[{flags:{key:f.AppName.name},env:f.AppName.envVar,description:g.app.deploy.options.app,optionalInNonInteractive:!0}],{flags:{key:f.CommitSha.name,alias:f.CommitSha.alias},env:f.CommitSha.envVar,description:g.app.deploy.options.commit,optionalInNonInteractive:!0},...t?[]:[{flags:{key:f.Artifact.name},env:f.Artifact.envVar,description:g.app.deploy.options.artifact,optionalInNonInteractive:!0}],...t||o?[{flags:{key:f.Target.name},env:f.Target.envVar,description:g.app.deploy.options.target,optionalInNonInteractive:!0}]:[]]),e.addSwitch({flags:{key:f.OpenBrowser.name},description:g.app.deploy.options.openBrowser}),e.addSwitch({flags:{key:f.Force.name},description:g.app.deploy.options.force}),e.addSwitch({flags:{key:f.NoWait.name},description:t?g.project.deploy.options.noWait:g.app.deploy.options.noWait}),e.addSwitch({flags:{key:f.ForceReauth.name},description:g.app.deploy.options.forceReauth})}export{Ht as a,nt as b};
|
|
10
|
+
/*!
|
|
11
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
12
|
+
*/
|
|
13
|
+
//# sourceMappingURL=chunk-GVLAG66W.js.map
|
|
@@ -4,9 +4,9 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __pathDirname(__filename);
|
|
7
|
-
import{b as $,e as E}from"./chunk-
|
|
7
|
+
import{b as $,e as E}from"./chunk-JWSX7DVU.js";import{l as C,m as R}from"./chunk-5BE4TLDK.js";import{Na as M,Ob as L,y as p}from"./chunk-E2O4YZX2.js";import{n as U}from"./chunk-B6REHI77.js";import{x as o}from"./chunk-WS6TGUH7.js";import{a as i}from"./chunk-3UIUI5Q2.js";import{G as N,H as A,M as h,O as b}from"./chunk-4AO24KKT.js";import S from"open";async function q(e){k(e),await e.runVerb();let n=await C(e),r=await R(e),l=await e.getTenantIdAsync();if(!l)throw new p("Unable to determine tenant ID. Ensure you are logged in.");let m=await e.getOption(o.NoBrowser.camelName,!0)===!1,c=e.isJsonMode(),a=await e.getOption(o.CommitSha.name,!0),d=await e.getOption(o.Branch.name,!0),g=await e.getOption(o.Mode.name,!0),t=await e.getOption(o.Target.name,!0),s=t===void 0?void 0:E(t);if(s&&(g||a||d))throw new p("--target cannot be used with --mode, --commit, or --branch.");let f=T(g);if(!s&&f==="live"&&(a||d))throw new p("--commit and --branch are only valid with --mode preview.");if(a&&d)throw new p("--commit and --branch cannot be used together.");await x({appName:n,environmentId:r,tenantId:l,noBrowser:m,isJson:c,mode:f,commitId:a,branch:d,target:s})}async function x(e){let{appName:n,environmentId:r,tenantId:l,noBrowser:m,isJson:c,mode:a,commitId:d,branch:g,target:t}=e,s=await M({tenantId:l,environmentId:r,logger:L(),actionsParams:{appName:n}}),f=t!==void 0&&t!==$,u=f?s.stages?.find(v=>v.stageName.toLowerCase()===t):void 0;if(f&&!u)throw new p(`Deployment target '${t}' does not exist for app '${n}'. Run 'ms app add config --target ${t}' to create it.`);let I=u?u.commitHash:s.commitHash,y=B(s.appPlayUri,a,d,g,f?t:void 0);if(!y)throw new p(!t&&a==="live"?`No live build is available for app '${n}' yet. Run 'ms app deploy' to deploy one, then re-run 'ms app play'.`:t?`No play URL is available for app '${n}' on target '${t}'.`:`No appPlayUri is available for app '${n}' in environment '${r}'.`);let w=a==="live"&&!I?[`App '${n}' has not been deployed to target '${t??$}'. Run 'ms app deploy${t?` --target ${t}`:""}' to deploy it.`]:[];if(c){A({appName:n,mode:t?"target":a,...t?{target:t}:{},url:y,commitHash:I??null,...w.length>0?{warnings:w}:{}});return}N(`${t?"Target":a==="live"?"Live":"Preview"} URL for '${s.displayName??n}': ${y}`);for(let v of w)b(v);!t&&a==="live"&&b("Live does not auto-update. Run 'ms app deploy' to publish a new version to the live URL."),await O(y,m)}function B(e,n,r,l="main",m){if(!e)return;if(m){let a;try{a=new URL(e)}catch{throw new p("The app play URL returned by the service is not a valid absolute URL.")}return a.pathname=`${a.pathname.replace(/\/$/,"")}/target/${encodeURIComponent(m)}`,a.toString()}if(n==="live")return e;let c=e.replace(/\/$/,"");return r?`${c}/commit/${r}`:`${c}/branch/${encodeURIComponent(l)}`}async function O(e,n){if(!n){h(`Opening browser at ${e}`);try{await S(e,{wait:!1})}catch{h(`Could not open browser automatically. Please navigate to:
|
|
8
8
|
${e}`)}}}function T(e){let n=(e??o.Mode.defaultValue).trim().toLowerCase();if(n!=="live"&&n!=="preview")throw new p(`Invalid --mode value '${e}'. Expected 'live' or 'preview'.`);return n}function k(e){let n=U("alm");e.setDescription(i.app.play.description),e.addExamples(n?i.app.play.examples:i.app.play.examples.filter(r=>!r.includes(" --target "))),e.addSwitch({flags:{key:o.NoBrowser.name},description:i.app.play.options.noBrowser}),e.addOptions([{flags:{key:o.AppName.name},env:o.AppName.envVar,description:i.app.play.options.app,optionalInNonInteractive:!0},{flags:{key:o.Mode.name,alias:o.Mode.alias},env:o.Mode.envVar,description:i.app.play.options.mode,optionalInNonInteractive:!0},...n?[{flags:{key:o.Target.name},description:i.app.play.options.target,optionalInNonInteractive:!0}]:[],{flags:{key:o.CommitSha.name,alias:o.CommitSha.alias},env:o.CommitSha.envVar,description:i.app.play.options.commit,optionalInNonInteractive:!0},{flags:{key:o.Branch.name},description:i.app.play.options.branch,optionalInNonInteractive:!0}])}export{q as a,B as b};
|
|
9
9
|
/*!
|
|
10
10
|
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
11
11
|
*/
|
|
12
|
-
//# sourceMappingURL=chunk-
|
|
12
|
+
//# sourceMappingURL=chunk-HWEMI6JI.js.map
|
|
@@ -4,7 +4,7 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __pathDirname(__filename);
|
|
7
|
-
import{
|
|
7
|
+
import{n as z}from"./chunk-B6REHI77.js";import{a as D}from"./chunk-OB6WEE2V.js";import{a as l}from"./chunk-3UIUI5Q2.js";import{a as H,b as x,d as xe}from"./chunk-UT667QSU.js";var v=x(M=>{var S=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},P=class extends S{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};M.CommanderError=S;M.InvalidArgumentError=P});var F=x(L=>{var{InvalidArgumentError:we}=v(),q=class{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:t.concat(e)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,n)=>{if(!this.argChoices.includes(t))throw new we(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,n):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Oe(a){let e=a.name()+(a.variadic===!0?"...":"");return a.required?"<"+e+">":"["+e+"]"}L.Argument=q;L.humanReadableArgName=Oe});var W=x(se=>{var{humanReadableArgName:He}=F(),I=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(e){let t=e.commands.filter(n=>!n._hidden);if(e._hasImplicitHelpCommand()){let[,n,i]=e._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/),r=e.createCommand(n).helpOption(!1);r.description(e._helpCommandDescription),i&&r.arguments(i),t.push(r)}return this.sortSubcommands&&t.sort((n,i)=>n.name().localeCompare(i.name())),t}compareOptions(e,t){let n=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(r=>!r.hidden),n=e._hasHelpOption&&e._helpShortFlag&&!e._findOption(e._helpShortFlag),i=e._hasHelpOption&&!e._findOption(e._helpLongFlag);if(n||i){let r;n?i?r=e.createOption(e._helpFlags,e._helpDescription):r=e.createOption(e._helpShortFlag,e._helpDescription):r=e.createOption(e._helpLongFlag,e._helpDescription),t.push(r)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let i=n.options.filter(r=>!r.hidden);t.push(...i)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e._args.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e._args.find(t=>t.description)?e._args:[]}subcommandTerm(e){let t=e._args.map(n=>He(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((n,i)=>Math.max(n,t.subcommandTerm(i).length),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((n,i)=>Math.max(n,t.optionTerm(i).length),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((n,i)=>Math.max(n,t.optionTerm(i).length),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((n,i)=>Math.max(n,t.argumentTerm(i).length),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let n="";for(let i=e.parent;i;i=i.parent)n=i.name()+" "+n;return n+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];return e.argChoices&&t.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0?`${e.description} (${t.join(", ")})`:e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatHelp(e,t){let n=t.padWidth(e,t),i=t.helpWidth||80,r=2,s=2;function p(m,b){if(b){let j=`${m.padEnd(n+s)}${b}`;return t.wrap(j,i-r,n+s)}return m}function o(m){return m.join(`
|
|
8
8
|
`).replace(/^/gm," ".repeat(r))}let c=[`Usage: ${t.commandUsage(e)}`,""],u=t.commandDescription(e);u.length>0&&(c=c.concat([t.wrap(u,i,0),""]));let h=t.visibleArguments(e).map(m=>p(t.argumentTerm(m),t.argumentDescription(m)));h.length>0&&(c=c.concat(["Arguments:",o(h),""]));let f=t.visibleOptions(e).map(m=>p(t.optionTerm(m),t.optionDescription(m)));if(f.length>0&&(c=c.concat(["Options:",o(f),""])),this.showGlobalOptions){let m=t.visibleGlobalOptions(e).map(b=>p(t.optionTerm(b),t.optionDescription(b)));m.length>0&&(c=c.concat(["Global Options:",o(m),""]))}let C=t.visibleCommands(e).map(m=>p(t.subcommandTerm(m),t.subcommandDescription(m)));return C.length>0&&(c=c.concat(["Commands:",o(C),""])),c.join(`
|
|
9
9
|
`)}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}wrap(e,t,n,i=40){let r=" \\f\\t\\v\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF",s=new RegExp(`[\\n][${r}]+`);if(e.match(s))return e;let p=t-n;if(p<i)return e;let o=e.slice(0,n),c=e.slice(n).replace(`\r
|
|
10
10
|
`,`
|
|
@@ -24,7 +24,7 @@ Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._life
|
|
|
24
24
|
`),this.outputHelp({error:!0}));let n=t||{},i=n.exitCode||1,r=n.code||"commander.error";this._exit(i,r,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in d.env){let t=e.attributeName();(this.getOptionValue(t)===void 0||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,d.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new je(this.options),t=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&t(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(i=>!t(i)).forEach(i=>{this.setOptionValueWithSource(i,n.implied[i],"implied")})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){let n=s=>{let p=s.attributeName(),o=this.getOptionValue(p),c=this.options.find(h=>h.negate&&p===h.attributeName()),u=this.options.find(h=>!h.negate&&p===h.attributeName());return c&&(c.presetArg===void 0&&o===!1||c.presetArg!==void 0&&o===c.presetArg)?c:u||s},i=s=>{let p=n(s),o=p.attributeName();return this.getOptionValueSource(o)==="env"?`environment variable '${p.envVar}'`:`option '${p.flags}'`},r=`error: ${i(e)} cannot be used with ${i(t)}`;this.error(r,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let i=[],r=this;do{let s=r.createHelp().visibleOptions(r).filter(p=>p.long).map(p=>p.long);i=i.concat(s),r=r.parent}while(r&&!r._enablePositionalOptions);t=ce(e,i)}let n=`error: unknown option '${e}'${t}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this._args.length,n=t===1?"":"s",r=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${t} argument${n} but got ${e.length}.`;this.error(r,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],t="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(r=>{i.push(r.name()),r.alias()&&i.push(r.alias())}),t=ce(e,i)}let n=`error: unknown command '${e}'${t}`;this.error(n,{code:"commander.unknownCommand"})}version(e,t,n){if(e===void 0)return this._version;this._version=e,t=t||"-V, --version",n=n||"output the version number";let i=this.createOption(t,n);return this._versionOptionName=i.attributeName(),this.options.push(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${e}
|
|
25
25
|
`),this._exit(0,"commander.version",e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(t=>this.alias(t)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let t=this._args.map(n=>Se(n));return[].concat(this.options.length||this._hasHelpOption?"[options]":[],this.commands.length?"[command]":[],this._args.length?t:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=_.basename(e,_.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp();return t.helpWidth===void 0&&(t.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),t.formatHelp(this,t)}_getHelpContext(e){e=e||{};let t={error:!!e.error},n;return t.error?n=i=>this._outputConfiguration.writeErr(i):n=i=>this._outputConfiguration.writeOut(i),t.write=e.write||n,t.command=this,t}outputHelp(e){let t;typeof e=="function"&&(t=e,e=void 0);let n=this._getHelpContext(e);E(this).reverse().forEach(r=>r.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let i=this.helpInformation(n);if(t&&(i=t(i),typeof i!="string"&&!Buffer.isBuffer(i)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(i),this.emit(this._helpLongFlag),this.emit("afterHelp",n),E(this).forEach(r=>r.emit("afterAllHelp",n))}helpOption(e,t){if(typeof e=="boolean")return this._hasHelpOption=e,this;this._helpFlags=e||this._helpFlags,this._helpDescription=t||this._helpDescription;let n=ke(this._helpFlags);return this._helpShortFlag=n.shortFlag,this._helpLongFlag=n.longFlag,this}help(e){this.outputHelp(e);let t=d.exitCode||0;t===0&&e&&typeof e!="function"&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){let n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText.
|
|
26
26
|
Expecting one of '${n.join("', '")}'`);let i=`${e}Help`;return this.on(i,r=>{let s;typeof t=="function"?s=t({error:r.error,command:r.command}):s=t,s&&r.write(`${s}
|
|
27
|
-
`)}),this}};function ue(a,e){a._hasHelpOption&&e.find(n=>n===a._helpLongFlag||n===a._helpShortFlag)&&(a.outputHelp(),a._exit(0,"commander.helpDisplayed","(outputHelp)"))}function he(a){return a.map(e=>{if(!e.startsWith("--inspect"))return e;let t,n="127.0.0.1",i="9229",r;return(r=e.match(/^(--inspect(-brk)?)$/))!==null?t=r[1]:(r=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(t=r[1],/^\d+$/.test(r[3])?i=r[3]:n=r[3]):(r=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=r[1],n=r[3],i=r[4]),t&&i!=="0"?`${t}=${n}:${parseInt(i)+1}`:e})}function E(a){let e=[];for(let t=a;t;t=t.parent)e.push(t);return e}de.Command=Y});var _e=x((g,ye)=>{var{Argument:ze}=F(),{Command:fe}=me(),{CommanderError:Ne,InvalidArgumentError:ge}=v(),{Help:Pe}=W(),{Option:Me}=G();g=ye.exports=new fe;g.program=g;g.Argument=ze;g.Command=fe;g.CommanderError=Ne;g.Help=Pe;g.InvalidArgumentError=ge;g.InvalidOptionArgumentError=ge;g.Option=Me});function te(a){return a.requiresFeature===void 0||z(a.requiresFeature)}function A(a){return a.typed===!0}function V(a){return typeof a.lazyHandler=="function"}function w(a,e){if(!Object.prototype.hasOwnProperty.call(a,e))return;let t=a[e];return te(t)?t:void 0}function $(a){return Object.entries(a).filter(([,e])=>te(e))}function N(a){return a.requiresFeature!==void 0&&!z(a.requiresFeature)?!1:$(a.commands).length>0}function ne(a){return Object.entries(a).filter(([,e])=>N(e))}function We(a,e){let t=a.slice(2);if(t.length===0||t[0].startsWith("-"))return null;let[n]=t;return T(n,e)?ie(e[n].commands,t,1,[n]):null}function ie(a,e,t,n){if(t>=e.length)return null;let i=e[t];if(i.startsWith("-"))return null;let r=w(a,i);if(!r)return null;let s=[...n,i];if(!A(r))return{path:s,lazyHandler:r.lazyHandler,tokensConsumed:t+1,...r.localOnly?{localOnly:r.localOnly}:{}};let p=e[t+1];return p!==void 0&&!p.startsWith("-")&&w(r.commands,p)!==void 0?ie(r.commands,e,t+1,s):V(r)?{path:s,lazyHandler:r.lazyHandler,tokensConsumed:t+1}:null}function Re(a,e){let t=a.slice(2),n=t.findIndex(u=>u.startsWith("-")),i=n===-1?t:t.slice(0,n);if(i.length<2)return null;let[r,...s]=i;if(!T(r,e))return null;let p=e[r].commands,o=[r],c=!1;for(let u of s){let h=w(p,u);if(!h)return c?{pathTokens:o,unknownToken:u}:null;if(!A(h))return null;o.push(u),p=h.commands,c=!0}return c?{pathTokens:o,unknownToken:void 0}:null}function T(a,e){return Object.prototype.hasOwnProperty.call(e,a)?N(e[a]):!1}var O={auth:{"@description":"Manage authentication state.",commands:{login:{"@helpText":l.auth.login.description,lazyHandler:async()=>(await import("./Login-BT6UTPCZ.js")).loginAsync},logout:{"@helpText":l.auth.logout.description,lazyHandler:async()=>(await import("./Logout-FBJE35Q5.js")).logoutAsync},status:{"@helpText":l.auth.status.description,lazyHandler:async()=>(await import("./AuthStatus-WCZYGI5G.js")).authStatusAsync},switch:{"@helpText":l.auth.switch.description,lazyHandler:async()=>(await import("./AuthSwitch-XJMG7IUR.js")).authSwitchAsync}}},app:{"@description":"Manage apps and their resources.",commands:{clone:{"@helpText":l.app.clone.description,lazyHandler:async()=>(await import("./CloneMaafApp-7W246RZA.js")).cloneMaafAppAsync},create:{"@helpText":l.app.create.description,lazyHandler:async()=>(await import("./CreateMaafApp-6MSPHUU4.js")).createMaafAppAsync},init:{"@helpText":l.app.init.description,lazyHandler:async()=>(await import("./Init-PBH2IXVK.js")).initAsync},list:{"@helpText":l.app.list.description,lazyHandler:async()=>(await import("./ListMaafApps-ZATO77G3.js")).listMaafAppsAsync},show:{"@helpText":l.app.show.deprecation,lazyHandler:async()=>(await import("./InfoMaafApp-7Z6OJCHD.js")).showMaafAppAsync},share:{typed:!0,"@helpText":l.app.share.description,lazyHandler:async()=>(await import("./ShareMaafApp-SFNOOMOD.js")).shareMaafAppAsync,commands:{link:{typed:!0,"@helpText":l.app.shareLink.description,commands:{create:{"@helpText":l.app.shareLink.create.description,lazyHandler:async()=>(await import("./ShareLinkCreate-ZUVHUQLH.js")).shareLinkCreateAsync},list:{"@helpText":l.app.shareLink.list.description,lazyHandler:async()=>(await import("./ShareLinkList-IEYU6NZW.js")).shareLinkListAsync},revoke:{"@helpText":l.app.shareLink.revoke.description,lazyHandler:async()=>(await import("./ShareLinkRevoke-22RFGOFJ.js")).shareLinkRevokeAsync}}},list:{"@helpText":l.app.share.list.description,lazyHandler:async()=>(await import("./ShareList-6UWIHPBM.js")).shareListAsync}}},unshare:{"@helpText":l.app.unshare.description,lazyHandler:async()=>(await import("./UnshareMaafApp-TU7U3LQ3.js")).unshareMaafAppAsync},info:{"@helpText":l.app.info.description,lazyHandler:async()=>(await import("./InfoMaafApp-7Z6OJCHD.js")).infoMaafAppAsync},build:{"@helpText":l.app.build.description,lazyHandler:async()=>(await import("./BuildMaafApp-7AUZHYOQ.js")).buildMaafAppAsync},"build-status":{"@helpText":l.app.buildStatus.description,lazyHandler:async()=>(await import("./GetMaafBuildStatus-6ZSLIZCH.js")).getMaafBuildStatusAsync},deploy:{"@helpText":l.app.deploy.description,lazyHandler:async()=>(await import("./DeployMaafApp-K2APWFOD.js")).deployMaafAppAsync},pack:{"@helpText":l.app.pack.description,lazyHandler:async()=>(await import("./Pack-TSFHSTB5.js")).packAsync},play:{"@helpText":l.app.play.description,lazyHandler:async()=>(await import("./PlayMaafApp-74TQEAO5.js")).playMaafAppAsync},dev:{"@helpText":l.app.dev.description,lazyHandler:async()=>(await import("./Dev-CIEWFRXR.js")).devAsync},delete:{"@helpText":l.app.delete.description,lazyHandler:async()=>(await import("./DeleteMaafApp-TFGWGJO3.js")).deleteMaafAppAsync},refresh:{typed:!0,commands:{"data-source":{"@helpText":l.app.refresh.dataSource.description,lazyHandler:async()=>(await import("./RefreshDataSource-VARFN3IV.js")).refreshDataSourceAsync}}},override:{typed:!0,requiresFeature:"alm",commands:{"data-source":{"@helpText":l.app.override.dataSource.description,lazyHandler:async()=>(await import("./AddDeploymentBinding-RFLI6DKH.js")).overrideDataSourceAsync}}},add:{typed:!0,commands:{config:{"@helpText":l.app.add.config.description,requiresFeature:"alm",lazyHandler:async()=>(await import("./AddConfig-CI7KNLIG.js")).addConfigAsync},backend:{"@helpText":l.app.add.backend.description,requiresFeature:"rayfin",lazyHandler:async()=>(await import("./AddRayfin-VRCFEOIL.js")).addRayfinAsync},"data-source":{"@helpText":l.app.add.connector.description,lazyHandler:async()=>(await import("./AddConnector-WH4IU3ND.js")).addConnectorAsync},connector:{"@helpText":"(deprecated) Use 'data-source' instead.",lazyHandler:async()=>(await import("./AddConnector-WH4IU3ND.js")).addConnectorAsync}}},remove:{typed:!0,commands:{"data-source":{"@helpText":l.app.remove.description,lazyHandler:async()=>(await import("./RemoveDataSource-RRND46QZ.js")).removeDataSourceAsync},connector:{"@helpText":"(deprecated) Use 'data-source' instead.",lazyHandler:async()=>(await import("./RemoveDataSource-RRND46QZ.js")).removeDataSourceAsync}}},"set-setting":{"@helpText":l.app["set-setting"].description,lazyHandler:async()=>(await import("./SetSetting-CEH44OT3.js")).setSettingAsync},"get-settings":{"@helpText":l.app["get-settings"].description,lazyHandler:async()=>(await import("./GetSettings-MVVEXMJC.js")).getSettingsAsync}}},project:{"@description":"Manage projects.",commands:{assign:{"@helpText":l.project.assign.description,requiresFeature:"projects",lazyHandler:async()=>(await import("./ProjectRoleAssignments-AI2FQ2VX.js")).assignProjectRoleAsyncVerb},unassign:{"@helpText":l.project.unassign.description,requiresFeature:"projects",lazyHandler:async()=>(await import("./ProjectRoleAssignments-AI2FQ2VX.js")).unassignProjectRoleAsyncVerb},add:{typed:!0,requiresFeature:"projects",commands:{"deployment-target":{"@helpText":l.project.add.deployment.description,lazyHandler:async()=>(await import("./AddDeployment-GWFCPAL5.js")).addDeploymentAsync},approval:{"@helpText":l.project.add.approval.description,lazyHandler:async()=>(await import("./ProjectApprovals-5KLYEM7V.js")).addProjectApprovalAsync}}},create:{"@helpText":l.project.create.description,requiresFeature:"projects",lazyHandler:async()=>(await import("./CreateMaafProject-JKMF5TH3.js")).createMaafProjectAsync},info:{"@helpText":l.project.info.description,requiresFeature:"projects",lazyHandler:async()=>(await import("./InfoMaafProject-SQYB736C.js")).infoMaafProjectAsync},list:{typed:!0,"@helpText":l.project.list.description,requiresFeature:"projects",lazyHandler:async()=>(await import("./ListMaafProjects-GNUXZSYL.js")).listMaafProjectsAsync,commands:{approval:{"@helpText":l.project.list.approval.description,lazyHandler:async()=>(await import("./ProjectApprovals-5KLYEM7V.js")).listProjectApprovalAsync}}},remove:{typed:!0,requiresFeature:"projects",commands:{"deployment-target":{"@helpText":l.project.remove.deployment.description,lazyHandler:async()=>(await import("./RemoveDeployment-STNFNNZF.js")).removeDeploymentAsync},approval:{"@helpText":l.project.remove.approval.description,lazyHandler:async()=>(await import("./ProjectApprovals-5KLYEM7V.js")).removeProjectApprovalAsync}}},build:{"@helpText":l.project.build.description,requiresFeature:"projects",lazyHandler:async()=>(await import("./BuildMaafApp-7AUZHYOQ.js")).buildMaafProjectAsync},deploy:{"@helpText":l.project.deploy.description,requiresFeature:"projects",lazyHandler:async()=>(await import("./DeployMaafProject-6WRKGIIW.js")).deployMaafProjectAsync},"deployment-status":{"@helpText":l.project.deployStatus.description,requiresFeature:"projects",lazyHandler:async()=>(await import("./GetMaafProjectDeployStatus-NZEMVQGJ.js")).getMaafProjectDeployStatusAsync},"build-status":{"@helpText":l.project.buildStatus.description,requiresFeature:"projects",lazyHandler:async()=>(await import("./GetMaafBuildStatus-6ZSLIZCH.js")).getMaafProjectBuildStatusAsync},pack:{"@helpText":l.project.pack.description,requiresFeature:"projects",lazyHandler:async()=>(await import("./PackProject-T575KJQ4.js")).packProjectAsync},state:{typed:!0,"@helpText":l.project.state.description,requiresFeature:"state",commands:{clear:{"@helpText":l.project.state.clear.description,lazyHandler:async()=>(await import("./Clear-7B7CDIPV.js")).clearDataAsync},"generate-code":{"@helpText":l.project.state["generate-code"].description,localOnly:!0,lazyHandler:async()=>(await import("./GenerateCode-UQCHTRGP.js")).dataGenerateCodeAsync},add:{"@helpText":l.project.state.add.description,lazyHandler:async()=>(await import("./Add-FU57YE5G.js")).dataAddAsync},alter:{"@helpText":l.project.state.alter.description,lazyHandler:async()=>(await import("./Alter-JFFT5JOA.js")).dataAlterAsync},remove:{"@helpText":l.project.state.remove.description,lazyHandler:async()=>(await import("./Remove-MCQZVI3K.js")).dataRemoveAsync},"list-schema":{"@helpText":l.project.state["list-schema"].description,lazyHandler:async()=>(await import("./ListSchema-QKVHVPHB.js")).dataListSchemaAsync},"list-settings":{"@helpText":l.project.state["list-settings"].description,lazyHandler:async()=>(await import("./ListSettings-IIA5OGMP.js")).dataListSettingsAsync},"set-setting":{"@helpText":l.project.state["set-setting"].description,lazyHandler:async()=>(await import("./SetSetting-Q7EQNOTI.js")).dataSetSettingAsync}}}}},connector:{"@description":"Discover available connectors and their operations.",commands:{list:{"@helpText":l.connector.list.description,lazyHandler:async()=>(await import("./ListConnectors-2FUTJMHY.js")).listConnectorsCliAsync},"list-actions":{"@helpText":l.connector["list-actions"].description,lazyHandler:async()=>(await import("./ListConnectorActions-UERYZ2C7.js")).listConnectorActionsCliAsync}}},deployment:{"@description":"Inspect deployment history and manage deployment approvals.",requiresFeature:"projects",commands:{list:{"@helpText":l.deployment.list.description,requiresFeature:"projects",lazyHandler:async()=>(await import("./ListDeployments-4YWCHVKF.js")).listDeploymentsAsync},status:{"@helpText":l.deployment.status.description,lazyHandler:async()=>(await import("./GetMaafProjectDeployStatus-NZEMVQGJ.js")).getMaafProjectDeployStatusAsync},approve:{"@helpText":l.deployment.approve.description,lazyHandler:async()=>(await import("./DeploymentApprovals-WTXBXCKE.js")).approveDeploymentAsync},reject:{"@helpText":l.deployment.reject.description,lazyHandler:async()=>(await import("./DeploymentApprovals-WTXBXCKE.js")).rejectDeploymentAsync},cancel:{"@helpText":l.deployment.cancel.description,lazyHandler:async()=>(await import("./DeploymentApprovals-WTXBXCKE.js")).cancelDeploymentAsync}}},git:{"@description":"Manage GitHub integration for apps.",commands:{auth:{typed:!0,commands:{refresh:{"@helpText":l.git.auth.refresh.description,lazyHandler:async()=>(await import("./RefreshGitAuth-DC5NAZBJ.js")).refreshGitAuthAsync}}}}},telemetry:{"@description":"Manage CLI telemetry settings.",commands:{enable:{"@helpText":l.telemetry.enable.description,lazyHandler:async()=>(await import("./TelemetrySettings-XCT73DEI.js")).telemetryEnableAsync},disable:{"@helpText":l.telemetry.disable.description,lazyHandler:async()=>(await import("./TelemetrySettings-XCT73DEI.js")).telemetryDisableAsync},status:{"@helpText":l.telemetry.status.description,lazyHandler:async()=>(await import("./TelemetrySettings-XCT73DEI.js")).telemetryStatusAsync}}},feature:{"@description":"Manage experimental and preview CLI features.",commands:{list:{"@helpText":l.feature.list.description,lazyHandler:async()=>(await import("./FeatureSettings-77LZQSKD.js")).featureListAsync},status:{"@helpText":l.feature.status.description,lazyHandler:async()=>(await import("./FeatureSettings-77LZQSKD.js")).featureStatusAsync},enable:{"@helpText":l.feature.enable.description,lazyHandler:async()=>(await import("./FeatureSettings-77LZQSKD.js")).featureEnableAsync},disable:{"@helpText":l.feature.disable.description,lazyHandler:async()=>(await import("./FeatureSettings-77LZQSKD.js")).featureDisableAsync},reset:{"@helpText":l.feature.reset.description,lazyHandler:async()=>(await import("./FeatureSettings-77LZQSKD.js")).featureResetAsync}}}};function re(){return`${"ms"} v${D.version} (preview)`}var be=xe(_e(),1),{program:it,createCommand:rt,createArgument:st,createOption:at,CommanderError:ot,InvalidArgumentError:lt,InvalidOptionArgumentError:pt,Command:Q,Argument:ct,Option:ut,Help:Ae}=be.default;function X(a,e,t){let n=new Ae;n.helpWidth=process.stdout.columns??80;let i=Math.max(...t.map(([p])=>p.length),8),r=2,s=2;a.push(e);for(let[p,o]of t){let c=`${p.padEnd(i+s)}${o}`;a.push(n.wrap(c,n.helpWidth-r,i+s,1).replace(/^/gm," ".repeat(r)))}}function Ce(){let a=[],e=ne(O);if(e.length>0){let t=Math.max(...e.map(([i])=>i.length)),n=Math.max(t+2,10);a.push("Command Groups:"),a.push("");for(let[i,r]of e)a.push(` ${i.padEnd(n)} ${r["@description"]}`);a.push(""),a.push(`Run '${"ms"} <group> --help' for commands within a group.`)}return a.join(`
|
|
27
|
+
`)}),this}};function ue(a,e){a._hasHelpOption&&e.find(n=>n===a._helpLongFlag||n===a._helpShortFlag)&&(a.outputHelp(),a._exit(0,"commander.helpDisplayed","(outputHelp)"))}function he(a){return a.map(e=>{if(!e.startsWith("--inspect"))return e;let t,n="127.0.0.1",i="9229",r;return(r=e.match(/^(--inspect(-brk)?)$/))!==null?t=r[1]:(r=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(t=r[1],/^\d+$/.test(r[3])?i=r[3]:n=r[3]):(r=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=r[1],n=r[3],i=r[4]),t&&i!=="0"?`${t}=${n}:${parseInt(i)+1}`:e})}function E(a){let e=[];for(let t=a;t;t=t.parent)e.push(t);return e}de.Command=Y});var _e=x((g,ye)=>{var{Argument:ze}=F(),{Command:fe}=me(),{CommanderError:Ne,InvalidArgumentError:ge}=v(),{Help:Pe}=W(),{Option:Me}=G();g=ye.exports=new fe;g.program=g;g.Argument=ze;g.Command=fe;g.CommanderError=Ne;g.Help=Pe;g.InvalidArgumentError=ge;g.InvalidOptionArgumentError=ge;g.Option=Me});function te(a){return a.requiresFeature===void 0||z(a.requiresFeature)}function A(a){return a.typed===!0}function V(a){return typeof a.lazyHandler=="function"}function w(a,e){if(!Object.prototype.hasOwnProperty.call(a,e))return;let t=a[e];return te(t)?t:void 0}function $(a){return Object.entries(a).filter(([,e])=>te(e))}function N(a){return a.requiresFeature!==void 0&&!z(a.requiresFeature)?!1:$(a.commands).length>0}function ne(a){return Object.entries(a).filter(([,e])=>N(e))}function We(a,e){let t=a.slice(2);if(t.length===0||t[0].startsWith("-"))return null;let[n]=t;return T(n,e)?ie(e[n].commands,t,1,[n]):null}function ie(a,e,t,n){if(t>=e.length)return null;let i=e[t];if(i.startsWith("-"))return null;let r=w(a,i);if(!r)return null;let s=[...n,i];if(!A(r))return{path:s,lazyHandler:r.lazyHandler,tokensConsumed:t+1,...r.localOnly?{localOnly:r.localOnly}:{}};let p=e[t+1];return p!==void 0&&!p.startsWith("-")&&w(r.commands,p)!==void 0?ie(r.commands,e,t+1,s):V(r)?{path:s,lazyHandler:r.lazyHandler,tokensConsumed:t+1}:null}function Re(a,e){let t=a.slice(2),n=t.findIndex(u=>u.startsWith("-")),i=n===-1?t:t.slice(0,n);if(i.length<2)return null;let[r,...s]=i;if(!T(r,e))return null;let p=e[r].commands,o=[r],c=!1;for(let u of s){let h=w(p,u);if(!h)return c?{pathTokens:o,unknownToken:u}:null;if(!A(h))return null;o.push(u),p=h.commands,c=!0}return c?{pathTokens:o,unknownToken:void 0}:null}function T(a,e){return Object.prototype.hasOwnProperty.call(e,a)?N(e[a]):!1}var O={auth:{"@description":"Manage authentication state.",commands:{login:{"@helpText":l.auth.login.description,lazyHandler:async()=>(await import("./Login-G7TNQISG.js")).loginAsync},logout:{"@helpText":l.auth.logout.description,lazyHandler:async()=>(await import("./Logout-AOOISVWK.js")).logoutAsync},status:{"@helpText":l.auth.status.description,lazyHandler:async()=>(await import("./AuthStatus-XA6RGYYZ.js")).authStatusAsync},switch:{"@helpText":l.auth.switch.description,lazyHandler:async()=>(await import("./AuthSwitch-2FXB7WFU.js")).authSwitchAsync}}},app:{"@description":"Manage apps and their resources.",commands:{clone:{"@helpText":l.app.clone.description,lazyHandler:async()=>(await import("./CloneMaafApp-YAEYSP23.js")).cloneMaafAppAsync},create:{"@helpText":l.app.create.description,lazyHandler:async()=>(await import("./CreateMaafApp-2XYROOHB.js")).createMaafAppAsync},init:{"@helpText":l.app.init.description,lazyHandler:async()=>(await import("./Init-MTONJT7V.js")).initAsync},list:{"@helpText":l.app.list.description,lazyHandler:async()=>(await import("./ListMaafApps-QPEX7JA4.js")).listMaafAppsAsync},show:{"@helpText":l.app.show.deprecation,lazyHandler:async()=>(await import("./InfoMaafApp-FJM7UI5H.js")).showMaafAppAsync},share:{typed:!0,"@helpText":l.app.share.description,lazyHandler:async()=>(await import("./ShareMaafApp-QMEJEXPZ.js")).shareMaafAppAsync,commands:{link:{typed:!0,"@helpText":l.app.shareLink.description,commands:{create:{"@helpText":l.app.shareLink.create.description,lazyHandler:async()=>(await import("./ShareLinkCreate-VCWVBQ4B.js")).shareLinkCreateAsync},list:{"@helpText":l.app.shareLink.list.description,lazyHandler:async()=>(await import("./ShareLinkList-5VG5CG34.js")).shareLinkListAsync},revoke:{"@helpText":l.app.shareLink.revoke.description,lazyHandler:async()=>(await import("./ShareLinkRevoke-KYUNMTG5.js")).shareLinkRevokeAsync}}},list:{"@helpText":l.app.share.list.description,lazyHandler:async()=>(await import("./ShareList-M25UE6LD.js")).shareListAsync}}},unshare:{"@helpText":l.app.unshare.description,lazyHandler:async()=>(await import("./UnshareMaafApp-RIUUYHIL.js")).unshareMaafAppAsync},info:{"@helpText":l.app.info.description,lazyHandler:async()=>(await import("./InfoMaafApp-FJM7UI5H.js")).infoMaafAppAsync},build:{"@helpText":l.app.build.description,lazyHandler:async()=>(await import("./BuildMaafApp-3EGRD23G.js")).buildMaafAppAsync},"build-status":{"@helpText":l.app.buildStatus.description,lazyHandler:async()=>(await import("./GetMaafBuildStatus-ZR5GCREL.js")).getMaafBuildStatusAsync},deploy:{"@helpText":l.app.deploy.description,lazyHandler:async()=>(await import("./DeployMaafApp-DBJONCUH.js")).deployMaafAppAsync},pack:{"@helpText":l.app.pack.description,lazyHandler:async()=>(await import("./Pack-QJZCMVEM.js")).packAsync},play:{"@helpText":l.app.play.description,lazyHandler:async()=>(await import("./PlayMaafApp-MH66OLOV.js")).playMaafAppAsync},dev:{"@helpText":l.app.dev.description,lazyHandler:async()=>(await import("./Dev-TXJLPT7K.js")).devAsync},delete:{"@helpText":l.app.delete.description,lazyHandler:async()=>(await import("./DeleteMaafApp-G3SL3GGP.js")).deleteMaafAppAsync},refresh:{typed:!0,commands:{"data-source":{"@helpText":l.app.refresh.dataSource.description,lazyHandler:async()=>(await import("./RefreshDataSource-CISFHQNA.js")).refreshDataSourceAsync}}},override:{typed:!0,requiresFeature:"alm",commands:{"data-source":{"@helpText":l.app.override.dataSource.description,lazyHandler:async()=>(await import("./AddDeploymentBinding-6FZ7Y5JM.js")).overrideDataSourceAsync}}},add:{typed:!0,commands:{config:{"@helpText":l.app.add.config.description,requiresFeature:"alm",lazyHandler:async()=>(await import("./AddConfig-4SAYYOBQ.js")).addConfigAsync},backend:{"@helpText":l.app.add.backend.description,requiresFeature:"rayfin",lazyHandler:async()=>(await import("./AddRayfin-35GBGCWF.js")).addRayfinAsync},"data-source":{"@helpText":l.app.add.connector.description,lazyHandler:async()=>(await import("./AddConnector-P4R4NJ5P.js")).addConnectorAsync},connector:{"@helpText":"(deprecated) Use 'data-source' instead.",lazyHandler:async()=>(await import("./AddConnector-P4R4NJ5P.js")).addConnectorAsync}}},remove:{typed:!0,commands:{"data-source":{"@helpText":l.app.remove.description,lazyHandler:async()=>(await import("./RemoveDataSource-T2AG7ZWC.js")).removeDataSourceAsync},connector:{"@helpText":"(deprecated) Use 'data-source' instead.",lazyHandler:async()=>(await import("./RemoveDataSource-T2AG7ZWC.js")).removeDataSourceAsync}}},"set-setting":{"@helpText":l.app["set-setting"].description,lazyHandler:async()=>(await import("./SetSetting-PD76MA6O.js")).setSettingAsync},"get-settings":{"@helpText":l.app["get-settings"].description,lazyHandler:async()=>(await import("./GetSettings-64N4P6L7.js")).getSettingsAsync}}},project:{"@description":"Manage projects.",commands:{assign:{"@helpText":l.project.assign.description,requiresFeature:"projects",lazyHandler:async()=>(await import("./ProjectRoleAssignments-7IDK6SGJ.js")).assignProjectRoleAsyncVerb},unassign:{"@helpText":l.project.unassign.description,requiresFeature:"projects",lazyHandler:async()=>(await import("./ProjectRoleAssignments-7IDK6SGJ.js")).unassignProjectRoleAsyncVerb},add:{typed:!0,requiresFeature:"projects",commands:{"deployment-target":{"@helpText":l.project.add.deployment.description,lazyHandler:async()=>(await import("./AddDeployment-TBA3AAGD.js")).addDeploymentAsync},approval:{"@helpText":l.project.add.approval.description,lazyHandler:async()=>(await import("./ProjectApprovals-NTFYLH3W.js")).addProjectApprovalAsync}}},create:{"@helpText":l.project.create.description,requiresFeature:"projects",lazyHandler:async()=>(await import("./CreateMaafProject-Q7KIVAR2.js")).createMaafProjectAsync},info:{"@helpText":l.project.info.description,requiresFeature:"projects",lazyHandler:async()=>(await import("./InfoMaafProject-EU6OQ7DX.js")).infoMaafProjectAsync},list:{typed:!0,"@helpText":l.project.list.description,requiresFeature:"projects",lazyHandler:async()=>(await import("./ListMaafProjects-RDR2S3HD.js")).listMaafProjectsAsync,commands:{approval:{"@helpText":l.project.list.approval.description,lazyHandler:async()=>(await import("./ProjectApprovals-NTFYLH3W.js")).listProjectApprovalAsync}}},remove:{typed:!0,requiresFeature:"projects",commands:{"deployment-target":{"@helpText":l.project.remove.deployment.description,lazyHandler:async()=>(await import("./RemoveDeployment-K3GDRCXJ.js")).removeDeploymentAsync},approval:{"@helpText":l.project.remove.approval.description,lazyHandler:async()=>(await import("./ProjectApprovals-NTFYLH3W.js")).removeProjectApprovalAsync}}},build:{"@helpText":l.project.build.description,requiresFeature:"projects",lazyHandler:async()=>(await import("./BuildMaafApp-3EGRD23G.js")).buildMaafProjectAsync},deploy:{"@helpText":l.project.deploy.description,requiresFeature:"projects",lazyHandler:async()=>(await import("./DeployMaafProject-SOMMKVJO.js")).deployMaafProjectAsync},"deployment-status":{"@helpText":l.project.deployStatus.description,requiresFeature:"projects",lazyHandler:async()=>(await import("./GetMaafProjectDeployStatus-OJ56DPZ6.js")).getMaafProjectDeployStatusAsync},"build-status":{"@helpText":l.project.buildStatus.description,requiresFeature:"projects",lazyHandler:async()=>(await import("./GetMaafBuildStatus-ZR5GCREL.js")).getMaafProjectBuildStatusAsync},pack:{"@helpText":l.project.pack.description,requiresFeature:"projects",lazyHandler:async()=>(await import("./PackProject-Y3Q3KOTC.js")).packProjectAsync},state:{typed:!0,"@helpText":l.project.state.description,requiresFeature:"state",commands:{clear:{"@helpText":l.project.state.clear.description,lazyHandler:async()=>(await import("./Clear-MZGQZ2XK.js")).clearDataAsync},"generate-code":{"@helpText":l.project.state["generate-code"].description,localOnly:!0,lazyHandler:async()=>(await import("./GenerateCode-Z2OY3SZR.js")).dataGenerateCodeAsync},add:{"@helpText":l.project.state.add.description,lazyHandler:async()=>(await import("./Add-75RSJNM4.js")).dataAddAsync},alter:{"@helpText":l.project.state.alter.description,lazyHandler:async()=>(await import("./Alter-U7WDVOMU.js")).dataAlterAsync},remove:{"@helpText":l.project.state.remove.description,lazyHandler:async()=>(await import("./Remove-IYDTKDJE.js")).dataRemoveAsync},"list-schema":{"@helpText":l.project.state["list-schema"].description,lazyHandler:async()=>(await import("./ListSchema-IR7FTBRR.js")).dataListSchemaAsync},"list-settings":{"@helpText":l.project.state["list-settings"].description,lazyHandler:async()=>(await import("./ListSettings-3M7UOOLI.js")).dataListSettingsAsync},"set-setting":{"@helpText":l.project.state["set-setting"].description,lazyHandler:async()=>(await import("./SetSetting-KOWAPJWX.js")).dataSetSettingAsync}}}}},connector:{"@description":"Discover available connectors and their operations.",commands:{list:{"@helpText":l.connector.list.description,lazyHandler:async()=>(await import("./ListConnectors-JYNVPB3O.js")).listConnectorsCliAsync},"list-actions":{"@helpText":l.connector["list-actions"].description,lazyHandler:async()=>(await import("./ListConnectorActions-PJTNNWLH.js")).listConnectorActionsCliAsync}}},deployment:{"@description":"Inspect deployment history and manage deployment approvals.",requiresFeature:"projects",commands:{list:{"@helpText":l.deployment.list.description,requiresFeature:"projects",lazyHandler:async()=>(await import("./ListDeployments-UV6J6WA5.js")).listDeploymentsAsync},status:{"@helpText":l.deployment.status.description,lazyHandler:async()=>(await import("./GetMaafProjectDeployStatus-OJ56DPZ6.js")).getMaafProjectDeployStatusAsync},approve:{"@helpText":l.deployment.approve.description,lazyHandler:async()=>(await import("./DeploymentApprovals-Y67LSQQG.js")).approveDeploymentAsync},reject:{"@helpText":l.deployment.reject.description,lazyHandler:async()=>(await import("./DeploymentApprovals-Y67LSQQG.js")).rejectDeploymentAsync},cancel:{"@helpText":l.deployment.cancel.description,lazyHandler:async()=>(await import("./DeploymentApprovals-Y67LSQQG.js")).cancelDeploymentAsync}}},git:{"@description":"Manage GitHub integration for apps.",commands:{auth:{typed:!0,commands:{refresh:{"@helpText":l.git.auth.refresh.description,lazyHandler:async()=>(await import("./RefreshGitAuth-NUQ7JNJA.js")).refreshGitAuthAsync}}}}},telemetry:{"@description":"Manage CLI telemetry settings.",commands:{enable:{"@helpText":l.telemetry.enable.description,lazyHandler:async()=>(await import("./TelemetrySettings-FVJUK5MR.js")).telemetryEnableAsync},disable:{"@helpText":l.telemetry.disable.description,lazyHandler:async()=>(await import("./TelemetrySettings-FVJUK5MR.js")).telemetryDisableAsync},status:{"@helpText":l.telemetry.status.description,lazyHandler:async()=>(await import("./TelemetrySettings-FVJUK5MR.js")).telemetryStatusAsync}}},feature:{"@description":"Manage experimental and preview CLI features.",commands:{list:{"@helpText":l.feature.list.description,lazyHandler:async()=>(await import("./FeatureSettings-LYV6QUZB.js")).featureListAsync},status:{"@helpText":l.feature.status.description,lazyHandler:async()=>(await import("./FeatureSettings-LYV6QUZB.js")).featureStatusAsync},enable:{"@helpText":l.feature.enable.description,lazyHandler:async()=>(await import("./FeatureSettings-LYV6QUZB.js")).featureEnableAsync},disable:{"@helpText":l.feature.disable.description,lazyHandler:async()=>(await import("./FeatureSettings-LYV6QUZB.js")).featureDisableAsync},reset:{"@helpText":l.feature.reset.description,lazyHandler:async()=>(await import("./FeatureSettings-LYV6QUZB.js")).featureResetAsync}}}};function re(){return`${"ms"} v${D.version} (preview)`}var be=xe(_e(),1),{program:it,createCommand:rt,createArgument:st,createOption:at,CommanderError:ot,InvalidArgumentError:lt,InvalidOptionArgumentError:pt,Command:Q,Argument:ct,Option:ut,Help:Ae}=be.default;function X(a,e,t){let n=new Ae;n.helpWidth=process.stdout.columns??80;let i=Math.max(...t.map(([p])=>p.length),8),r=2,s=2;a.push(e);for(let[p,o]of t){let c=`${p.padEnd(i+s)}${o}`;a.push(n.wrap(c,n.helpWidth-r,i+s,1).replace(/^/gm," ".repeat(r)))}}function Ce(){let a=[],e=ne(O);if(e.length>0){let t=Math.max(...e.map(([i])=>i.length)),n=Math.max(t+2,10);a.push("Command Groups:"),a.push("");for(let[i,r]of e)a.push(` ${i.padEnd(n)} ${r["@description"]}`);a.push(""),a.push(`Run '${"ms"} <group> --help' for commands within a group.`)}return a.join(`
|
|
28
28
|
`)}function _t(a){if(!T(a,O))return"";let e=O[a],t=[];t.push(`Usage: ${"ms"} ${a} <command> [flags]`),t.push(""),t.push(e["@description"]),t.push("");let n=[],i=[];for(let[r,s]of $(e.commands))if(A(s)){let p=s["@helpText"];V(s)&&p!==void 0?(n.push([r,p]),i.push([r,s])):p!==void 0?n.push([r,p]):i.push([r,s])}else n.push([r,s["@helpText"]]);if(n.length>0&&X(t,"Commands:",n),i.length>0){t.push("");for(let[r,s]of i)X(t,`${r} <type>:`,Z(s,r).map(([p,o])=>[p,o]))}return t.push(""),t.push(`Run '${"ms"} ${a} <command> --help' for command-specific flags.`),t.join(`
|
|
29
29
|
`)}function Z(a,e){let t=[];for(let[n,i]of $(a.commands)){let r=e?`${e} ${n}`:n;A(i)?t.push(...Z(i,r)):t.push([r,i["@helpText"]])}return t}function bt(a){if(a.length<2)return null;let[e,...t]=a;if(!T(e,O))return null;let n=O[e].commands,i;for(let p of t){let o=w(n,p);if(!o)return null;if(i=o,A(o))n=o.commands;else return null}if(!i||!A(i))return null;let r=a.join(" "),s=[];return s.push(`Usage: ${"ms"} ${r} <type> [flags]`),s.push(""),X(s,"Types:",Z(i,"")),s.push(""),s.push(`Run '${"ms"} ${r} <type> --help' for type-specific flags.`),s.join(`
|
|
30
30
|
`)}var ee=class extends Q{parseOptions(e){let t=super.parseOptions(e),n=t.unknown.indexOf("--"),i=t.unknown.slice(0,n===-1?void 0:n).find(r=>r==="--version"||r==="-v");return i&&this.error(`unknown option '${i}'`,{code:"commander.unknownOption"}),t}};function vt(a){let e=a?new ee:new Q;return e.option("--non-interactive","Run in non-interactive mode (no prompts, all parameters must be provided via flags or environment variables)"),e.option("--json","Format output as JSON"),e.option("--no-color","Disable colored output"),a?(e.name(`${"ms"} ${a.path.join(" ")}`),a.localOnly&&e.allowExcessArguments(!1)):(e.name("ms"),e.usage("[option] [command] [<args>]"),e.version(D.version,"-v, --version","output the current version")),e.description(l.global.programDescription),e.addHelpText("beforeAll",()=>`${re()}
|
|
@@ -35,4 +35,4 @@ Expecting one of '${n.join("', '")}'`);let i=`${e}Help`;return this.on(i,r=>{let
|
|
|
35
35
|
/*!
|
|
36
36
|
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
37
37
|
*/
|
|
38
|
-
//# sourceMappingURL=chunk-
|
|
38
|
+
//# sourceMappingURL=chunk-IM7SC23O.js.map
|
|
@@ -4,8 +4,8 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __pathDirname(__filename);
|
|
7
|
-
import{
|
|
7
|
+
import{ea as k}from"./chunk-E2O4YZX2.js";import{E as u,M as x,N as n}from"./chunk-4AO24KKT.js";import*as b from"readline";var P=20;async function w(){return new Promise(i=>{b.emitKeypressEvents(process.stdin),process.stdin.isTTY&&process.stdin.setRawMode(!0),process.stdin.resume();let e=(a,t)=>{process.stdin.removeListener("keypress",e),process.stdin.isTTY&&process.stdin.setRawMode(!1),process.stdin.pause(),t.ctrl&&t.name==="c"&&process.exit(0),t.name==="escape"||t.name==="q"?i("exit"):i("continue")};process.stdin.on("keypress",e)})}async function S(i){let e=i.split(/\r?\n/);if(!process.stdout.isTTY){for(let s of e)x(s);return}let a=e.length,t=Math.max(1,Math.ceil(a/P));for(let s=0;s<t;s++){let c=s*P,f=e.slice(c,c+P),r=s===t-1;for(let m of f)x(m);if(r||(n(" Press Enter for more, Esc or q to exit"),await w()==="exit"))break}}async function v(i){let{title:e,metadata:a,columns:t,firstPage:s,fetchNextPage:c,toRow:f,emptyMessage:r,totalLabel:l}=i,m=process.stdout.isTTY??!1,o=s,d=0,p=0;for(;;){d++;let g=o.items.map(f);(g.length>0||!o.nextSkipToken&&p===0)&&(u({title:e,metadata:a,columns:t,rows:g,emptyMessage:r}),p+=g.length,n(` Showing ${p} ${l}`));let{nextSkipToken:T}=o;if(!T)break;if(d>=200)throw new k(`printServerPagedTable: exceeded ${200}-page cap for ${e}; the server is likely returning a $skiptoken cycle.`,200);if(m&&g.length>0&&(n(" Press Enter for more, Esc or q to exit"),await w()==="exit"))break;o=await c(T)}return p}async function M(i){let{title:e,metadata:a,columns:t,rows:s,emptyMessage:c,totalLabel:f,hint:r}=i,l=s.length;if(!process.stdout.isTTY){u({title:e,metadata:a,columns:t,rows:s,emptyMessage:c}),n(` Showing ${l} of ${l} ${f}`),r&&n(` ${r}`);return}let m=Math.max(1,Math.ceil(l/P));for(let o=0;o<m;o++){let d=o*P,p=s.slice(d,d+P),g=o===m-1;if(u({title:e,metadata:a,columns:t,rows:p,emptyMessage:c}),n(` Showing ${d+p.length} of ${l} ${f}`),r&&n(` ${r}`),g||n(" Press Enter for more, Esc or q to exit"),g||await w()==="exit")break}}export{S as a,v as b,M as c};
|
|
8
8
|
/*!
|
|
9
9
|
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
10
|
*/
|
|
11
|
-
//# sourceMappingURL=chunk-
|
|
11
|
+
//# sourceMappingURL=chunk-JDRULLI3.js.map
|
|
@@ -4,9 +4,9 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __pathDirname(__filename);
|
|
7
|
-
import{d as i}from"./chunk-
|
|
7
|
+
import{d as i}from"./chunk-OTXBVG3E.js";import{A as o}from"./chunk-E2O4YZX2.js";var a=["repository not found","fatal: repository","could not read username","terminal prompts disabled","authentication failed","permission denied","403","remote: not found"];function u(r){let t=r.stderr;return typeof t=="string"?t:Buffer.isBuffer(t)?t.toString():t instanceof Uint8Array?Buffer.from(t).toString():""}function c(r,t){let e=r instanceof Error?r.message:String(r),n=t.trim();return!n||e.includes(n)?e:`${e}
|
|
8
8
|
${n}`}function d(r){let t=r.toLowerCase();return a.some(e=>t.includes(e))}function f(){return"Make sure the repository exists and that you have access to it."}function g({directory:r,repoUrl:t}){try{i(["-c","http.sslVersion=tlsv1.3","clone","--",t,r],{emitStderr:!1})}catch(e){let n=u(e);n&&process.stderr.write(n);let s=d(n)?`Failed to clone '${t}' into '${r}'. ${f()}`:`Failed to clone '${t}' into '${r}'. See the git output above for details.`;throw new o(s,{underlyingError:c(e,n)})}}export{c as a,d as b,f as c,g as d};
|
|
9
9
|
/*!
|
|
10
10
|
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
11
11
|
*/
|
|
12
|
-
//# sourceMappingURL=chunk-
|
|
12
|
+
//# sourceMappingURL=chunk-JMF444BA.js.map
|
|
@@ -4,8 +4,8 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __pathDirname(__filename);
|
|
7
|
-
import{
|
|
7
|
+
import{A as p,Pb as m,y as i}from"./chunk-E2O4YZX2.js";import{u as f,v as g}from"./chunk-4AO24KKT.js";import*as a from"node:fs";import*as n from"node:path";function y(){let{fileConfig:o,appConfig:t}=m(),e=n.resolve(o.appConfigPath);if(!a.existsSync(e))throw new i("No Managed app configuration was found. Run this command from an app directory.");let r=t;if(!r)try{r=JSON.parse(a.readFileSync(e,"utf8"))}catch(s){let d=s instanceof Error?s.message:String(s);throw new p(`'${e}' is not a valid app configuration: ${d}`)}if(r===null||typeof r!="object"||Array.isArray(r))throw new p(`'${e}' is not a valid app configuration: the file must contain a JSON object.`);return{appRoot:n.dirname(e),fileName:n.basename(e),filePath:e,config:r}}var c="prod",l="test",w=[c,l];function C(o,t="--target"){let e=o?.trim();if(!e)throw new i(`${t} is required.`);if(e!==c&&e!==l)throw new i(`'${e}' is not a valid target name. Supported target names are 'prod' and 'test'.`);return e}function u(o,t){if(f.includes(t))throw new i(`'${o}' is a reserved target name because its config file would be named '${t}', which is a base app config filename. Choose a different target name.`)}function A(o,t){let e=g(t,o.fileName);return u(t,e),n.join(o.appRoot,e)}export{y as a,c as b,l as c,w as d,C as e,u as f,A as g};
|
|
8
8
|
/*!
|
|
9
9
|
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
10
|
*/
|
|
11
|
-
//# sourceMappingURL=chunk-
|
|
11
|
+
//# sourceMappingURL=chunk-JWSX7DVU.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __pathDirname } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{y as t}from"./chunk-E2O4YZX2.js";import{s as i}from"./chunk-4AO24KKT.js";import*as r from"node:fs";function a(o){switch(o){case"Native":return"native";case"ExternalGitProviderBound":return"github";case"ExternallyProvidedBuild":return"none"}}function f(o,n,e){return{projectId:o.projectId,displayName:o.displayName,repositoryId:o.repositoryId,repoType:a(o.repoType),...o.repoType==="ExternalGitProviderBound"&&e&&{externalRepoUrl:e},environmentId:o.environmentId,cloud:n}}function s(o,n){if(o.repoType==="ExternallyProvidedBuild")throw new t("Projects without source control are not supported.");return i.parse({version:"1.0",displayName:o.displayName,...o.repoType==="ExternalGitProviderBound"&&{externalBinding:{environmentId:o.environmentId,projectId:o.projectId,cloud:n}}})}function m(o,n){let e=`${o}.${process.pid}.tmp`;try{r.writeFileSync(e,`${JSON.stringify(n,null,2)}
|
|
8
|
+
`,{encoding:"utf8",flag:"wx"}),r.renameSync(e,o)}catch(p){try{r.rmSync(e,{force:!0})}catch{}throw p}}export{a,f as b,s as c,m as d};
|
|
9
|
+
/*!
|
|
10
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
11
|
+
*/
|
|
12
|
+
//# sourceMappingURL=chunk-MWN7R4VR.js.map
|
|
@@ -4,8 +4,8 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __pathDirname(__filename);
|
|
7
|
-
import{
|
|
7
|
+
import{Na as r,Ob as p,y as o}from"./chunk-E2O4YZX2.js";import{a as n}from"./chunk-4AO24KKT.js";var u="This app is not backed by a platform managed repo. Repository access must be configured in the external repository.",a="00000000-0000-0000-0000-000000000000";function i(e){return!!e&&e!==a}function g(e){let t=(e??"play").trim().toLowerCase();if(t==="play"||t==="edit"||t==="test")return t;throw new o(`Unknown --access value '${e}'. Use 'play' (default \u2014 app access), 'edit', or 'test'.`)}function A(e){if(e.repoType)return e.repoType;if(i(e.repositoryId))throw new o(`${n} is missing the 'repoType' field but has a 'repositoryId' set. This usually means the file was written by an older CLI. Re-run "${"ms"} app init" to migrate the config, then retry.`);return"none"}async function m(e){return r({tenantId:e.tenantId,environmentId:e.environmentId,logger:p(),actionsParams:{appName:e.appName}})}async function I(e){let t=await m(e);if(!i(t.repositoryId))throw new o(`App '${e.appName}' has no associated repository.`);return t}export{u as a,i as b,g as c,A as d,m as e,I as f};
|
|
8
8
|
/*!
|
|
9
9
|
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
10
|
*/
|
|
11
|
-
//# sourceMappingURL=chunk-
|
|
11
|
+
//# sourceMappingURL=chunk-O4G2KO7E.js.map
|
|
@@ -4,8 +4,8 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __pathDirname(__filename);
|
|
7
|
-
import{b as t,e as s}from"./chunk-OUKOEUZA.js";var o={name:"@microsoft/cmr-cli",version:"0.
|
|
7
|
+
import{b as t,e as s}from"./chunk-OUKOEUZA.js";var o={name:"@microsoft/cmr-cli",version:"0.33.0",type:"module",description:"Command-line interface for building and managing Copilot Managed Runtime",license:"MIT",bin:{ms:"./dist/Bin.js"},files:["dist","!dist/*.map","LICENSE","README.md","THIRD-PARTY-NOTICES.txt"],scripts:{build:"bun scripts/build.ts","generate:cgmanifest":"bun scripts/generate-cgmanifest.ts","benchmark:startup":"bun scripts/benchmark-startup.ts",dev:"tsc -p tsconfig.json --watch","check-types":"tsc --noEmit",lint:"eslint src/",test:"bun test --isolate src/","test:e2e":"bun test src/__tests__/e2e/",clean:"bun ../../scripts/clean.ts dist .turbo tsconfig.tsbuildinfo THIRD-PARTY-NOTICES.txt"},dependencies:{"@azure/msal-node-runtime":"0.20.6","@napi-rs/keyring":"2.1.0",esbuild:"catalog:build",open:"11.0.0"},engines:{node:">=24.11.0",git:">=2.27.0"},devDependencies:{"@microsoft/cmr-apps-actions":"workspace:*","@microsoft/cmr-apps-codegen":"workspace:*","@microsoft/cmr-apps-common":"workspace:*","@azure/msal-node":"5.2.2","@azure/msal-node-extensions":"5.2.2","@clack/prompts":"1.4.0","@microsoft/1ds-core-js":"4.3.11","@microsoft/1ds-post-js":"4.3.11","@repo/repo-config":"workspace:*","@rnx-kit/third-party-notices":"3.0.0","@types/archiver":"6.0.3","@types/bun":"1.3.13","@types/node":"catalog:","@types/semver":"7.7.1",archiver:"7.0.1",commander:"10.0.1",json5:"2.2.3",memfs:"^4.57.2",semver:"7.7.4","tsc-esm-fix":"catalog:build",typescript:"5.9.3","typescript-5-7":"npm:typescript@5.7.2","typescript-5-8":"npm:typescript@5.8.3","typescript-6":"npm:typescript@6.0.2"}};import*as c from"os";import*as e from"path";var m=t("WORKING_DIRECTORY")??process.cwd(),n=t("CONFIG_DIR")??e.join(c.homedir(),".ms-cli"),E=e.join(n,"cache","auth"),d=e.join(n,"telemetry"),_="microsoft-managed-apps-cli",l="msal-token-cache",I="x-ms-client-request-id",R="x-ms-client-session-id",T="x-ms-target-url",C="x-ms-auth-resource",u="x-ms-body-token-resource",g="userSettings.json",x=`managed-apps-cli/${o.version}`,f=s("USE_MMA_APP_ID")?"c4ee713f-aede-4371-91fc-921aa3a5ded9":"9cee029c-6210-4654-90bb-17e6e9d36617",N="managedappscli";export{o as a,m as b,n as c,E as d,d as e,_ as f,l as g,I as h,R as i,T as j,C as k,u as l,g as m,x as n,f as o,N as p};
|
|
8
8
|
/*!
|
|
9
9
|
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
10
|
*/
|
|
11
|
-
//# sourceMappingURL=chunk-
|
|
11
|
+
//# sourceMappingURL=chunk-OB6WEE2V.js.map
|
|
@@ -4,8 +4,8 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __pathDirname(__filename);
|
|
7
|
-
import{a as x,b as l,c as v}from"./chunk-
|
|
7
|
+
import{a as x,b as l,c as v}from"./chunk-2UMD5IAQ.js";import{a as R,b as E}from"./chunk-A57M2UGH.js";import{Kb as H,Lb as G,Ob as j,d as D,ha as h,z as g}from"./chunk-E2O4YZX2.js";import{M as b}from"./chunk-4AO24KKT.js";async function T(r){let{remoteUrl:p,tenantId:m,jsonMode:t,openBrowser:s,verb:f}=r,{host:n,owner:u,repo:i}=D(p),o=u&&i?H(u,i):"",c=j(),e=I(f);c.trackActivityEvent(e,{repoHost:n,repoHash:o}),t||b("GitHub authentication is required for this action.");let y=A({isJson:t,openBrowser:s}),a=new AbortController,d=()=>{a.abort()};process.once("SIGINT",d);try{await G({remoteUrl:p,tenantId:m,logger:c,display:y,skipBrowser:!1,signal:a.signal})}catch(w){throw c.trackActivityEvent(`${e}.Failed`,{repoHost:n,repoHash:o}),l(w)??w}finally{process.removeListener("SIGINT",d)}c.trackActivityEvent(`${e}.Complete`,{repoHost:n,repoHash:o}),t||b(M(f))}function M(r){switch(r){case"app create":return"Resuming create...";case"app init":return"Resuming init...";case"app build":case"project build":return"Resuming build...";case"app deploy":case"project deploy":return"Resuming deploy...";case"project create":return"Resuming project create..."}}function A(r){return r.isJson?new E:r.openBrowser?R:{...R,openVerificationUri:void 0}}function I(r){switch(r){case"app create":return"Maaf.Create.GitHubDcfRecovery";case"app init":return"Maaf.Init.GitHubDcfRecovery";case"app build":case"project build":return"Maaf.Build.GitHubDcfRecovery";case"app deploy":case"project deploy":return"Maaf.Deploy.GitHubDcfRecovery";case"project create":return"Maaf.ProjectCreate.GitHubDcfRecovery"}}async function F(r,p,m=T){let{repoType:t,externalRepoUrl:s,tenantId:f,jsonMode:n,openBrowser:u,verb:i}=p;try{return await r({isRetry:!1})}catch(o){if(t!=="github")throw o;if(!v(o)){if(o instanceof h)throw o;let e=l(o);throw e||o}if(!s)throw new g(`GitHub authentication is required, but the app config does not record the external repository URL needed to recover the identity mapping. This app may have been created before the URL was persisted to \`ms.config.json\`. Either add \`externalRepoUrl: "<your repo url>"\` to \`ms.config.json\`, or recreate the app with \`ms app create --repo <your repo url>\`, then run \`ms ${i}\` again.`);await m({remoteUrl:s,tenantId:f,jsonMode:n,openBrowser:u,verb:i});try{return await r({isRetry:!0})}catch(e){if(e instanceof h)throw e;let y=v(e);if(y)throw x(y.payload)??e;let a=l(e);throw a||e}}}export{F as a};
|
|
8
8
|
/*!
|
|
9
9
|
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
10
|
*/
|
|
11
|
-
//# sourceMappingURL=chunk-
|
|
11
|
+
//# sourceMappingURL=chunk-OBATM5M4.js.map
|
|
@@ -4,7 +4,7 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __pathDirname(__filename);
|
|
7
|
-
import{A as B,
|
|
7
|
+
import{A as h,B,v,x as R,y as $,z as L}from"./chunk-E2O4YZX2.js";import{o as _}from"./chunk-OB6WEE2V.js";import{f as D,j as F}from"./chunk-OUKOEUZA.js";import{M as I}from"./chunk-4AO24KKT.js";function C(e){try{return new URL(e).host}catch{return e}}function fe(e,t,i){t||I(`Authenticating to ${C(e)} for ${i}. A browser window may open. Sign in with the account associated with this tenant.`)}import{execFileSync as P}from"child_process";var j=[{patterns:[/403 forbidden/i,/returned error: 403/i,/remote:.*access denied/i],bucket:"auth-403",retryable:!1,errorCode:"GitAccessDenied",build:e=>`Git reached the remote but access was denied while ${e} (HTTP 403). This usually means one of:
|
|
8
8
|
- the signed-in account is in the wrong tenant, or lacks permission to this app's repo; or
|
|
9
9
|
- Git Credential Manager returned a cached credential for a different account than your current 'ms auth' sign-in (a stale or mismatched credential).
|
|
10
10
|
Confirm 'ms auth status' shows the account and tenant for this environment. If it doesn't match, clear the cached git credential for the host ('git credential-manager erase', or remove it from your OS credential store) so Git re-prompts, then re-run.`},{patterns:[/terminal prompts disabled/i,/could not read username/i,/could not read password/i],bucket:"auth-prompt-unavailable",retryable:!1,errorCode:"GitCredentialPromptUnavailable",build:e=>`Git could not obtain a credential while ${e}: there is no cached credential and the session can't prompt for one. Make sure Git Credential Manager is installed, then re-run in an interactive terminal so the browser sign-in can complete.`},{patterns:[/authentication failed/i,/invalid username or password/i],bucket:"auth-invalid-credential",retryable:!0,errorCode:"GitAuthenticationFailed",build:e=>`Git authentication failed while ${e}: the credential was missing, invalid, or expired. When the browser opens, sign in with the account for this environment's tenant; if a stale credential is cached, clear it in Git Credential Manager and re-run.`}],W=[/could not resolve host/i,/failed to connect/i,/connection timed out/i,/operation timed out after \d+ milliseconds/i,/connection refused/i,/network is unreachable/i,/temporary failure in name resolution/i,/recv failure: connection was reset/i,/connection reset by peer/i,/requested url returned error: 50[234]/i],Y=[/ssl certificate problem/i,/certificate verify failed/i,/server certificate verification failed/i,/unable to get local issuer certificate/i,/schannel:.*certificate/i,/peer certificate cannot be authenticated/i,/ssl peer certificate or ssh remote key was not ok/i,/problem with the ssl ca cert/i],X=[/could not resolve proxy/i,/failed to connect to .* proxy/i,/failed to connect to \S*proxy\S*/i,/proxy authentication required/i,/received http code 407 from proxy/i],q=[/could not create work tree dir/i,/destination path .* already exists/i,/permission denied/i,/access(?: is)? denied/i,/unable to create (?:file|directory)/i,/unable to write new index file/i,/invalid path/i,/filename too long/i,/no space left on device/i,/read-only file system/i];function J(e,t){if(typeof e!="object"||e===null)return null;let{code:i,errno:r}=e,n={action:t.action};return i==="ENOENT"?new h(`Git could not be started while ${t.action} because the executable was not found. Install Git and make sure 'git' is available on PATH, then retry.`,{...n,classifierBucket:"process-not-found"},{errorCode:"GitProcessNotFound",retryable:!1,telemetryDetails:{classifierBucket:"process-not-found"}}):i==="EACCES"?new h(`Git could not be started while ${t.action} because the executable is not permitted to run. Check the Git executable's permissions and your endpoint security policy, then retry.`,{...n,classifierBucket:"process-access-denied"},{errorCode:"GitProcessAccessDenied",retryable:!1,telemetryDetails:{classifierBucket:"process-access-denied"}}):i==="EBADARCH"||r===86||r===-86?new h(`Git could not be started while ${t.action} because the executable is incompatible with this Mac. Install a Git build for this Mac's architecture, then retry.`,{...n,classifierBucket:"process-bad-architecture"},{errorCode:"GitProcessBadArchitecture",retryable:!1,telemetryDetails:{classifierBucket:"process-bad-architecture"}}):null}function K(e){return e.replace(/(\b[a-z][a-z0-9+.-]*:\/\/)[^/\s@]+@/gi,"$1[REDACTED]@")}function b(e,t,i){let r=J(i,t);if(r)return r;let n=K(e.trimEnd());if(!n)return null;for(let o of j)if(o.patterns.some(u=>u.test(n)))return new L(o.build(t.action),{classifierBucket:o.bucket,action:t.action},{errorCode:o.errorCode,retryable:o.retryable,telemetryDetails:{classifierBucket:o.bucket}});return Y.some(o=>o.test(n))?new h(`Git could not establish a trusted TLS connection while ${t.action}. Check the system clock, certificate trust store, and any corporate TLS inspection configuration. The CLI will not disable certificate verification.`,{classifierBucket:"tls-certificate",action:t.action},{errorCode:"GitTlsCertificateError",retryable:!1,telemetryDetails:{classifierBucket:"tls-certificate"}}):X.some(o=>o.test(n))?new h(`Git could not use the configured proxy while ${t.action}. Check Git and system proxy settings, including proxy authentication, then retry.`,{classifierBucket:"proxy-configuration",action:t.action},{errorCode:"GitProxyConfigurationError",retryable:!1,telemetryDetails:{classifierBucket:"proxy-configuration"}}):q.some(o=>o.test(n))?new h(`Git could not write the local repository while ${t.action}. Check that the target directory is empty and writable, that its path is supported by Git, and that sufficient disk space is available.`,{classifierBucket:"local-filesystem",action:t.action},{errorCode:"GitFilesystemError",retryable:!1,telemetryDetails:{classifierBucket:"local-filesystem"}}):W.some(o=>o.test(n))?new B(`Git could not reach the remote while ${t.action}. Check your network connection (and proxy settings, if any) and try again.`,{classifierBucket:"network",action:t.action},{errorCode:"GitNetworkError",retryable:!0,telemetryDetails:{classifierBucket:"network"}}):null}function M(e){return e?.retryable===!0}function S(e){return e==null?"":Buffer.isBuffer(e)?e.toString():e}var Q=64*1024*1024,T=[2,31,0];function Z(){try{let t=P("git",["--version"],{stdio:["ignore","pipe","ignore"],encoding:"utf8"}).match(/git version (\d+)\.(\d+)(?:\.(\d+))?/);if(!t)return!0;let i=[Number(t[1]),Number(t[2]),Number(t[3]??0)];for(let r=0;r<T.length;r++)if(i[r]!==T[r])return i[r]>T[r];return!0}catch{return!0}}function ee(e,t){let i=t?.filter(o=>o.length>0);if(!i?.length)return{args:[...e]};if(!Z())return{args:[...i.flatMap(o=>["-c",`http.extraHeader=${o}`]),...e]};let r=Number(D("GIT_CONFIG_COUNT")??"0");if(!Number.isSafeInteger(r)||r<0)throw new Error("GIT_CONFIG_COUNT must be a non-negative integer.");let n=F();for(let[o,u]of i.entries()){let a=r+o;n[`GIT_CONFIG_KEY_${a}`]="http.extraHeader",n[`GIT_CONFIG_VALUE_${a}`]=u}return n.GIT_CONFIG_COUNT=String(r+i.length),{args:[...e],env:n}}function m(e,t={}){let{cwd:i,allowFailure:r=!1,captureStdout:n=!1,emitStderr:o=!0,classify:u,network:a=!1,httpExtraHeaders:s}=t,d=a&&!u&&!r,f=ee(e,s);try{let l=P("git",f.args,{cwd:i,stdio:["ignore",n?"pipe":"ignore",d?"inherit":"pipe"],maxBuffer:Q,env:f.env});return{success:!0,status:0,stdout:n?S(l):"",stderr:""}}catch(l){let g=l,y=S(g.stderr);if(u&&!r){let E=y||S(g.stdout)||(l instanceof Error?l.message:String(l)),G=b(E,u,l);if(G)throw G}if(o&&y&&process.stderr.write(y),!r)throw l;return{success:!1,status:typeof g.status=="number"?g.status:null,stdout:S(g.stdout),stderr:y,error:l instanceof Error?l:new Error(String(l))}}}import{execFileSync as w}from"child_process";import*as c from"fs";import*as p from"path";function U({gitUrl:e,loginAuthority:t,authResource:i,platform:r=process.platform}){let n;try{n=new URL(e)}catch(d){throw new Error(`Git credential helper setup requires a valid HTTPS remote URL: ${d instanceof Error?d.message:String(d)}`)}if(n.protocol!=="https:")throw new Error(`Git credential helper setup requires an HTTPS remote URL, got '${n.protocol}'.`);let o=n.host,u=`${t}/oauth2/v2.0`,a=`credential.https://${o}`,s=[[`${a}.oauthAuthorizeEndpoint`,`${u}/authorize?prompt=select_account`],[`${a}.oauthTokenEndpoint`,`${u}/token`],[`${a}.oauthDeviceEndpoint`,`${u}/devicecode`],[`${a}.oauthClientId`,_],[`${a}.oauthScopes`,`${i}/.default offline_access`],[`${a}.oauthRedirectUri`,"http://localhost"]];return r==="win32"&&s.push([`${a}.credentialStore`,"dpapi"]),s}var te=/^[0-9a-f]{4,39}$/i;function xe(){let e=m(["rev-parse","HEAD"],{captureStdout:!0,allowFailure:!0,emitStderr:!1});if(!e.success)return null;let t=m(["rev-parse","--abbrev-ref","HEAD"],{captureStdout:!0,allowFailure:!0,emitStderr:!1});if(!t.success)return null;let i=e.stdout.trim(),r=t.stdout.trim();return{branch:r,commitSha:i,detached:r==="HEAD"}}function Ne(e,t){if(!t||!te.test(e))return e;let i=m(["rev-parse","--verify","--end-of-options",`${e}^{commit}`],{captureStdout:!0,allowFailure:!0,emitStderr:!1}),r=i.stdout.trim();if(!i.success||!/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/i.test(r))throw new $("The abbreviated --commit value could not be resolved to a unique commit in the current Git repository. Use a full commit SHA, or run this command from the repository that contains the commit.");return r}function Oe(){let e=m(["config","--get","remote.origin.url"],{captureStdout:!0,allowFailure:!0,emitStderr:!1});if(e.success)return e.stdout.trim()||void 0}var re=["https://","ssh://","git@"],ie=["-c","http.sslVersion=tlsv1.3"];function ne(e){return re.some(t=>e.startsWith(t))&&e.trim()===e&&!e.startsWith("-")&&!/[\r\n\0]/.test(e)}function O(e){return e.replace(/:\/\/[^\s/]+@/g,"://[REDACTED]@")}function Ae(e,t=process.cwd()){try{return e!==void 0&&!ne(e)?{success:!1,error:"Unsafe git remote URL."}:(A({remoteUrl:e,cwd:t}),{success:!0})}catch(i){return{success:!1,error:O(i instanceof Error?i.message:String(i))}}}function oe({directory:e,gitUrl:t,loginAuthority:i,authResource:r,emitRemoteError:n=!0}){let o=V({gitUrl:t,loginAuthority:i,authResource:r});A({remoteUrl:t,cwd:e,createDirectory:!0,initialBranch:"main",localConfig:o,updateExistingRemote:!0,emitRemoteError:n,skipInitIfRepoExists:!0})}function Ie(e,t,i,r,n=!0){let o=[...ie,"fetch","origin",...i?[i]:[]];m(o,{cwd:e,network:!0,allowFailure:!0,emitStderr:!1,httpExtraHeaders:r}).success||m(o,{cwd:e,network:!0,classify:{action:`fetching from ${C(t)}`},emitStderr:n,httpExtraHeaders:r})}function $e({directory:e,gitUrl:t,loginAuthority:i,authResource:r,onProgress:n}){let o=V({gitUrl:t,loginAuthority:i,authResource:r}),a=[...o.flatMap(([g,y])=>["-c",`${g}=${y}`]),"-c","http.sslVersion=tlsv1.3","clone","--",t],s=ce(e);n?.(`Cloning platform-managed repository into temporary folder '${s}'...`);let d=m([...a,s],{network:!0,allowFailure:!0,emitStderr:!1});if(!d.success){let g=`cloning from ${C(t)}`,y=b(d.stderr||d.stdout||d.error.message,{action:g},d.error);if(H(s,d,t),!M(y))throw y??k(g);n?.("Retrying platform-managed repository clone...");let E=m([...a,s],{network:!0,allowFailure:!0,emitStderr:!1});if(!E.success){let G=b(E.stderr||E.stdout||E.error.message,{action:g},E.error);throw H(s,E,t),G??k(g)}}n?.("Saving Git Credential Manager configuration...");let f;try{A({cwd:s,localConfig:o,skipInitIfRepoExists:!0})}catch{f="the repository-local Git configuration could not be updated"}n?.(`Moving cloned repository into '${p.resolve(e)}'...`);let l=le(s,e);return{configPersisted:f===void 0,...f?{configError:f}:{},...l?{cleanupWarning:l}:{}}}function H(e,t,i){try{c.rmSync(e,{recursive:!0,force:!0})}catch{throw se({cloneStderr:t.stderr||t.stdout||t.error.message,cloneError:t.error,gitUrl:i})}}function k(e){return new R(`Git failed while ${e}. The failure was not recognized as safely retryable, so the CLI did not retry it. Check the target directory, Git configuration, and network settings, then run the command again.`,v.GeneralError,{classifierBucket:"unclassified",action:e},{errorCode:"GitCloneUnclassified",retryable:!1,telemetryDetails:{classifierBucket:"unclassified"}})}function se({cloneStderr:e,cloneError:t,gitUrl:i}){let r=`cloning from ${C(i)}`,n=b(e,{action:r},t),o=n?.message??k(r).message;return new R(`Git clone failed, and the CLI could not remove its temporary clone storage safely. Close any process using Git files, remove the '.ms-clone-*' directory beside the target directory, and run the command again.
|
|
@@ -14,4 +14,4 @@ ${o}`,n?.exitCode??v.GeneralError,{...n?.errorData,cleanupFailed:!0},{errorCode:
|
|
|
14
14
|
/*!
|
|
15
15
|
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
16
16
|
*/
|
|
17
|
-
//# sourceMappingURL=chunk-
|
|
17
|
+
//# sourceMappingURL=chunk-OTXBVG3E.js.map
|
|
@@ -4,8 +4,8 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __pathDirname(__filename);
|
|
7
|
-
import{
|
|
7
|
+
import{y as n}from"./chunk-E2O4YZX2.js";var s="none",p="native",a=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,i=2048;function c(r){return a.test(r.trim())}function m(r,e="--repo"){let o=r.trim();if(o.length===0||o.length>i)throw new n(`${e} must be a repository URL no longer than ${i} characters.`);let t;try{t=new URL(o)}catch{throw new n(`${e} must be a valid repository URL.`)}if(t.protocol!=="https:"||!t.hostname||t.pathname.split("/").filter(Boolean).length<2)throw new n(`${e} must be an HTTPS repository URL with a host and repository path.`);if(t.username||t.password)throw new n(`${e} must not include credentials.`);if(t.search)throw new n(`${e} must not include a query string.`);if(t.hash)throw new n(`${e} must not include a fragment.`);return o}function u(r){if(r===void 0||r==="")return{repoType:"native",remoteUrl:void 0};let e=r.trim();return e.toLowerCase()===p?{repoType:"native",remoteUrl:void 0}:e.toLowerCase()===s?{repoType:"none",remoteUrl:void 0}:{repoType:"github",remoteUrl:m(e)}}export{c as a,m as b,u as c};
|
|
8
8
|
/*!
|
|
9
9
|
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
10
|
*/
|
|
11
|
-
//# sourceMappingURL=chunk-
|
|
11
|
+
//# sourceMappingURL=chunk-PBXK6LJO.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __pathDirname } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{a as P}from"./chunk-TYRVM4PP.js";import{b as C}from"./chunk-EFTF4FA7.js";import{B as y,l as m,y as p,z as g}from"./chunk-E2O4YZX2.js";import{a as t}from"./chunk-OB6WEE2V.js";import{O as l,m as h,o as f}from"./chunk-4AO24KKT.js";import{d as R}from"./chunk-UT667QSU.js";function S(e){if(e.body)try{let n=JSON.parse(e.body);if(typeof n?.error?.message=="string"&&n.error.message.trim())return n.error.message}catch{}}var b=new Set(["NetworkConnectionRefused","NetworkConnectionReset","NetworkConnectionTimedOut","NetworkDnsResolutionFailed","ENOTFOUND","EAI_AGAIN","ECONNREFUSED","ETIMEDOUT","ECONNRESET","ConnectionRefused","ConnectionClosed","FailedToOpenSocket"]);function N(e){if(!(e instanceof Error)||e instanceof m)return!1;let n=e.code;return typeof n=="string"&&b.has(n)||b.has(e.name)}function j(e,n){let{environmentId:i}=n;if(N(e))return new y(`Could not reach environment ${i}. Its endpoint did not resolve or did not respond, which usually means the environment id is wrong or the environment does not exist in this cloud \u2014 verify the id and the --cloud value. If the id is correct, check your network connection, VPN, or proxy.`,{underlyingError:e.message,environmentId:i},{errorCode:"EnvironmentUnreachable",retryable:!0});if(!(e instanceof m))return null;let o=S(e),s=n.repoType==="native",r="Ask an admin to grant you the required permission in this environment.";if(e.status===401)return new g(o??"Your sign-in session has expired or is invalid. Run `ms auth login` and try again.",void 0,{errorCode:"AuthenticationRequired"});if(e.status===403){let a=o??(s?`You do not have permission to create repositories in environment ${i}.`:`You do not have permission to create an app in environment ${i}.`);return new g(`${a} ${r}`,void 0,{errorCode:"EnvironmentPermissionDenied",telemetryDetails:C("environment_permission",{httpStatus:e.status})})}return e.status===404?new p(o??`Environment ${i} was not found. Verify the environment id and that you have access to it.`,{environmentId:i},{errorCode:"EnvironmentNotFound"}):e.status===409?new p(o??`An app with the same name already exists in environment ${i}. Choose a different name.`,{environmentId:i},{errorCode:"AppAlreadyExists"}):e.status===429||e.status===503?new y(o??"The service is temporarily unavailable or rate-limited. Wait a moment and try again.",{httpStatus:e.status},{errorCode:"ServiceUnavailable",retryable:!0,telemetryDetails:{httpStatus:e.status}}):null}import*as c from"path";function v(e){let n=e.buildType?.trim().toLowerCase()||void 0;if(n!==void 0&&n!=="build"&&n!=="none")throw new p("'--build-type' must be one of: build, none.");let i=n;return{...i!==void 0&&{buildType:i},buildPath:e.buildPath??(i==="none"?"./artifacts":"./dist"),...i!=="none"&&{buildCommand:e.buildCommand??"npm run build"},buildEntryPoint:e.buildEntryPoint??"index.html"}}function V(e){let n=v(e),i={version:h,appId:e.appId,appDisplayName:e.appDisplayName,environmentId:e.environmentId,description:e.description,repoType:e.repoType,cloud:e.cloud,buildPath:n.buildPath};return n.buildCommand!==void 0&&(i.buildCommand=n.buildCommand),i.buildEntryPoint=n.buildEntryPoint,n.buildType!==void 0&&(i.buildType=n.buildType),e.repositoryId&&(i.repositoryId=e.repositoryId),e.externalRepoUrl&&(i.externalRepoUrl=e.externalRepoUrl),e.iconPath&&(i.iconPath=e.iconPath),e.localAppUrl&&(i.localAppUrl=e.localAppUrl),e.connectionReferences!==void 0&&(i.connectionReferences=e.connectionReferences),e.appSettings!==void 0&&(i.appSettings=e.appSettings),i}function H(e,n){let i=f.shape.projectLocalAppId.safeParse(n??c.basename(c.resolve(e)));if(!i.success)throw new p("Project-local app IDs must be non-empty and contain only ASCII letters, digits, hyphens, and underscores. Specify --project-local-app-id.");return i.data}function F(e){return f.parse({version:"1.0",projectLocalAppId:e.projectLocalAppId,displayName:e.appDisplayName,description:e.description,...v(e)})}import*as d from"fs";import*as A from"path";var u=R(P(),1);var D="https://registry.npmjs.org",$=5e3;async function E(e,n=t.version){if(!u.default.valid(n))return;if(u.default.prerelease(n)===null)return n;let i=await k(e);return i?`^${i}`:void 0}async function k(e){try{let{data:n}=await e.get(`${D}/${t.name}/latest`,{headers:{"user-agent":`${t.name}/${t.version}`},signal:AbortSignal.timeout($)});return typeof n?.version=="string"&&u.default.valid(n.version)?n.version:void 0}catch{return}}async function z(e,n,i){let o=A.join(e,"package.json");if(!d.existsSync(o))return;let s=await E(i);if(!s){n||l(`Skipping the project-local CLI pin: '${t.version}' is not a published release and no published version could be resolved. Install '${t.name}' into the project manually if you want a project-local CLI.`);return}!n&&s!==t.version&&l(`'${t.version}' is a prerelease build; pinning the latest published CLI ('${s}') into the app instead.`);try{let r=JSON.parse(d.readFileSync(o,"utf8")),a="@microsoft/managed-apps-cli",I=r.dependencies?.[a]!==void 0||r.devDependencies?.[a]!==void 0;delete r.dependencies?.[a],delete r.devDependencies?.[a],r.devDependencies=Object.fromEntries(Object.entries({...r.devDependencies,[t.name]:s}).sort(([w],[T])=>w.localeCompare(T,"en"))),d.writeFileSync(o,`${JSON.stringify(r,null,2)}
|
|
8
|
+
`),I&&!n&&l(`Replaced '${a}' with '${t.name}' because both provide 'ms'. Migrate SDK dependencies, imports, generated sources, and Vite configuration together.`)}catch(r){n||l(`Could not pin '${t.name}' into ${o} (${r instanceof Error?r.message:String(r)}). Add "${t.name}": "${s}" to devDependencies manually.`)}}export{j as a,v as b,V as c,H as d,F as e,z as f};
|
|
9
|
+
/*!
|
|
10
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
11
|
+
*/
|
|
12
|
+
//# sourceMappingURL=chunk-VAKAW5BD.js.map
|