@microsoft/managed-apps-cli 0.23.0 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/dist/AddConfig-ZIDAN5AS.js +12 -0
- package/dist/{AddConnector-HJCCENAM.js → AddConnector-YNHO2HAW.js} +2 -2
- package/dist/{AuthStatus-WCICFN6O.js → AuthStatus-S3K6JJG6.js} +2 -2
- package/dist/{AuthSwitch-5PKHCTM2.js → AuthSwitch-RSQ777N2.js} +2 -2
- package/dist/Bin.js +1 -1
- package/dist/{BuildMaafApp-Q74EFM3Q.js → BuildMaafApp-MKHYNTJN.js} +2 -2
- package/dist/{Cli-7EVTIORX.js → Cli-7SHW4PIZ.js} +12 -12
- package/dist/{CloneMaafApp-EKHHLMWD.js → CloneMaafApp-N5NBJDO4.js} +2 -2
- package/dist/{CreateMaafApp-L3XX2UVT.js → CreateMaafApp-OY6P6WIY.js} +2 -2
- package/dist/{DeleteMaafApp-YCDKWFRG.js → DeleteMaafApp-SJE7YRQZ.js} +2 -2
- package/dist/DeployMaafApp-VK4MJKVY.js +14 -0
- package/dist/{Dev-BTJUJGP5.js → Dev-75M4ANEA.js} +2 -2
- package/dist/{GetMaafBuildStatus-7B6ZNSEA.js → GetMaafBuildStatus-I5Y6STGB.js} +2 -2
- package/dist/{GetSettings-GJWIPK2T.js → GetSettings-5T3STEOV.js} +2 -2
- package/dist/{InfoMaafApp-WGNDYYGN.js → InfoMaafApp-OHDDS3OQ.js} +2 -2
- package/dist/{Init-TJOSV5DE.js → Init-NLNDZJBN.js} +2 -2
- package/dist/{ListConnectorActions-HTD6YSCY.js → ListConnectorActions-N2IX4VWY.js} +2 -2
- package/dist/ListConnectors-YVJRDRID.js +11 -0
- package/dist/{ListMaafApps-KRXJMAEU.js → ListMaafApps-3DEVXWSG.js} +2 -2
- package/dist/{Login-5TFNB24B.js → Login-CYDAY6K7.js} +2 -2
- package/dist/{Logout-35U4J627.js → Logout-OB4QJDAY.js} +2 -2
- package/dist/{MockFetch-XSZECQYX.js → MockFetch-PJWH2XTJ.js} +2 -2
- package/dist/{NodeMsalAuthenticationProvider-OUL57BVL.js → NodeMsalAuthenticationProvider-NT7XAXTC.js} +2 -2
- package/dist/{Pack-S7P4MIT6.js → Pack-O5U5MPSJ.js} +2 -2
- package/dist/{PlayMaafApp-D4KLJKLT.js → PlayMaafApp-DLD27TQL.js} +2 -2
- package/dist/{RefreshDataSource-N5CEH23S.js → RefreshDataSource-JU3V5L2Y.js} +2 -2
- package/dist/{RefreshGitAuth-2VL6VBLU.js → RefreshGitAuth-N5RQYP3P.js} +2 -2
- package/dist/{RemoveDataSource-XR5Q4O3F.js → RemoveDataSource-LXIOJFX4.js} +2 -2
- package/dist/{ServicePrincipalAuthenticationProvider-H3PTPXYY.js → ServicePrincipalAuthenticationProvider-QJJ5WSV5.js} +2 -2
- package/dist/{SetSetting-HXY4YSKC.js → SetSetting-GNWY5HWU.js} +2 -2
- package/dist/{ShareLinkCreate-YG3DACP2.js → ShareLinkCreate-HJV3TLI3.js} +2 -2
- package/dist/{ShareLinkList-XF6BIB3M.js → ShareLinkList-2NJLTXFX.js} +2 -2
- package/dist/{ShareLinkRevoke-4USAQKLB.js → ShareLinkRevoke-G2EXN5WH.js} +2 -2
- package/dist/ShareList-CDGJCXBF.js +11 -0
- package/dist/{ShareMaafApp-PZI5MCBA.js → ShareMaafApp-TMTGLD5F.js} +2 -2
- package/dist/{TelemetrySettings-WWVPRF7T.js → TelemetrySettings-KWEGCAGS.js} +2 -2
- package/dist/{UnshareMaafApp-MHBIV5OR.js → UnshareMaafApp-YZPPEA32.js} +2 -2
- package/dist/chunk-7DFBXNI7.js +11 -0
- package/dist/{chunk-UIW77LMA.js → chunk-CBXGTKIE.js} +206 -206
- package/dist/{chunk-FMJDKXNM.js → chunk-EKMZGVZA.js} +2 -2
- package/dist/{chunk-SBVJ4SMO.js → chunk-EQHSV77H.js} +2 -2
- package/dist/{chunk-7PH2NK5K.js → chunk-HO6LX3K7.js} +2 -2
- package/dist/chunk-II367GCP.js +11 -0
- package/dist/{chunk-HCPTQP7J.js → chunk-IMBY742Q.js} +2 -2
- package/dist/{chunk-2FNWZUPW.js → chunk-IXZUOQPP.js} +2 -2
- package/dist/{chunk-WQKDXHGX.js → chunk-KZIKF2VH.js} +2 -2
- package/dist/chunk-LGJ3PMWD.js +11 -0
- package/dist/{chunk-F3HGM3IU.js → chunk-LSAJM3LO.js} +17 -16
- package/dist/chunk-MAWTAPQE.js +12 -0
- package/dist/{chunk-2HSJ2XAQ.js → chunk-MKCTKQZA.js} +2 -2
- package/dist/{chunk-3FP37TPE.js → chunk-MPRAPBI2.js} +7 -7
- package/dist/{chunk-TZRZFNLH.js → chunk-MVRNQN2O.js} +3 -3
- package/dist/{chunk-LDP2SHPJ.js → chunk-PDS5FYC4.js} +2 -2
- package/dist/{chunk-ZIONKKAV.js → chunk-PVGICWWI.js} +2 -2
- package/dist/chunk-QKHCRDMM.js +11 -0
- package/dist/{chunk-DD7E4ADI.js → chunk-WADQ54KB.js} +2 -2
- package/package.json +4 -4
- package/dist/AddConfig-GZO2UMFR.js +0 -12
- package/dist/DeployMaafApp-HF67BQRZ.js +0 -14
- package/dist/ListConnectors-OET7STMW.js +0 -11
- package/dist/ShareList-6QI7ZAMZ.js +0 -11
- package/dist/chunk-5XRK3F43.js +0 -11
- package/dist/chunk-DAG6RPOF.js +0 -11
- package/dist/chunk-I22E6YZT.js +0 -11
- package/dist/chunk-PKDXP7CL.js +0 -11
- package/dist/chunk-SCJXITCN.js +0 -12
|
@@ -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 T}from"./chunk-OL6CTXQR.js";import{b as E,h as b}from"./chunk-
|
|
7
|
+
import{a as T}from"./chunk-OL6CTXQR.js";import{b as E,h as b}from"./chunk-EQHSV77H.js";import{e as I,i as v}from"./chunk-WADQ54KB.js";import{Ga as A,ma as w}from"./chunk-CBXGTKIE.js";import{b as t}from"./chunk-RBG2H562.js";import"./chunk-PDS5FYC4.js";import"./chunk-HO6LX3K7.js";import"./chunk-Y7TZZLPW.js";import{n}from"./chunk-LGJ3PMWD.js";import{c as m,d as u,h as y,i as h}from"./chunk-PVAIJSAI.js";import{a as s}from"./chunk-KZIKF2VH.js";import"./chunk-MPRAPBI2.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";import*as c from"fs";var D=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;async function B(o){S(o),await o.runVerb();let l=await o.getOption(n.App.name);if(!l)throw new t("Argument app is required. Use --app to specify the app ID.");if(!D.test(l))throw new t("--app must be an app ID.");let R=await v(o,{failIfMissing:!1}),f=await o.getTenantIdAsync();if(!f)throw new t("Unable to determine tenant ID. Ensure you are logged in.");let a=o.getPositionalArg(0)??process.cwd();M(a);let r=o.isJsonMode(),i=!r&&process.stdout.isTTY?new T:null,d=r?void 0:e=>{i?i.update(e):y(e)},g=e=>{i?i.start(e):d?.(e)};try{g("Looking up app details...");let e=await w({tenantId:f,environmentId:R,logger:A(),actionsParams:{appName:l}});if(d?.("Validating platform-managed repository..."),e.repoType==="ExternalGitProviderBound")throw new t("This app is bound to an external GitHub repository. Use git clone for this app instead.");if(e.repoType==="ExternallyProvidedBuild")throw new t("This app has no source repository because it uses no source-control binding.");if(e.repoType!=="Native"||!e.cloneUrl)throw new t("This app does not have a usable platform-managed repository.");let U=o.getAuthResourceUrl();r||(i?.stop(),E(e.cloneUrl,r,"the repository clone"),g("Configuring Git Credential Manager..."));let p=b({directory:a,gitUrl:e.cloneUrl,loginAuthority:o.getLoginAuthority(f),authResource:U,onProgress:d});i?.stop(),r?u({appId:e.id,directory:a,...p.configError?{warning:"Repository cloned, but Git Credential Manager configuration could not be saved. Run git config --local in the cloned repository after resolving the error: "+p.configError}:{}}):(p.configError&&h(`Repository cloned, but Git Credential Manager configuration could not be saved. Run git config --local in the cloned repository after resolving the error. Reason: ${p.configError}`),m(`Cloned platform-managed repository into ${a}.`))}finally{i?.stop()}}function M(o){if(c.existsSync(o)&&c.readdirSync(o).length>0)throw new t(`'${o}' is not empty. Specify an empty target directory or run this command from a new empty directory.`)}function S(o){o.setDescription(s.app.clone.description),o.addExamples(s.app.clone.examples),o.consumePositionalArg(n.Directory),o.addOptions([I({flags:{key:n.App.name},message:n.App.promptMessage,description:s.app.clone.options.app}),{flags:{key:n.EnvironmentId.name,alias:n.EnvironmentId.alias},env:n.EnvironmentId.envVar,description:s.app.clone.options.environmentId,optionalInNonInteractive:!0}])}export{B as cloneMaafAppAsync};
|
|
8
8
|
/*!
|
|
9
9
|
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
10
|
*/
|
|
11
|
-
//# sourceMappingURL=CloneMaafApp-
|
|
11
|
+
//# sourceMappingURL=CloneMaafApp-N5NBJDO4.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 se}from"./chunk-OL6CTXQR.js";import{a as ae,b as le,c as ue,d as fe,e as me,g as ge}from"./chunk-
|
|
7
|
+
import{a as se}from"./chunk-OL6CTXQR.js";import{a as ae,b as le,c as ue,d as fe,e as me,g as ge}from"./chunk-EKMZGVZA.js";import"./chunk-TYRVM4PP.js";import{a as ce,b as de}from"./chunk-IXZUOQPP.js";import{a as pe}from"./chunk-QKHCRDMM.js";import"./chunk-IMBY742Q.js";import"./chunk-X5O77GZS.js";import{a as P,b as oe,c as m,g as G}from"./chunk-EQHSV77H.js";import{e as T,i as ie,j as re}from"./chunk-WADQ54KB.js";import{Ga as ne,Ha as U,R as Z,e as Q,ga as ee,u as X}from"./chunk-CBXGTKIE.js";import{a as k,b as c,d as N}from"./chunk-RBG2H562.js";import"./chunk-PDS5FYC4.js";import"./chunk-HO6LX3K7.js";import{c as te}from"./chunk-Y7TZZLPW.js";import{m as i}from"./chunk-LGJ3PMWD.js";import{c as J,d as Y,e as K,h as E,i as j}from"./chunk-PVAIJSAI.js";import{a as f}from"./chunk-KZIKF2VH.js";import{a as z,i as q}from"./chunk-MPRAPBI2.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";import*as d from"fs";import*as ve from"os";import*as O from"path";import*as w from"fs";import*as he from"os";import*as x from"path";function F(e){if(!e)throw new c("Template source is empty. Use --template to specify one.");if(/^https?:\/\//i.test(e)){let r;try{r=new URL(e)}catch{throw new c(`Template source '${e}' is not a valid URL.`)}if(r.hostname.toLowerCase()!=="github.com")throw new c(`Template source '${e}' uses host '${r.hostname}'; only github.com URLs are supported.`);let g=r.pathname.split("/").filter(Boolean);if(g.length<2)throw new c(`Template source '${e}' is missing the owner/repo path. Use 'https://github.com/<owner>/<repo>'.`);let[I,R,...y]=g,h=R.endsWith(".git")?R.slice(0,-4):R,S=r.hash?r.hash.slice(1):void 0;if(y.length===0)return{owner:I,repo:h,subdir:"",ref:S};if(y[0].toLowerCase()==="tree"&&y.length>=2)return{owner:I,repo:h,subdir:y.slice(2).join("/"),ref:S??y[1]};throw y[0].toLowerCase()==="blob"?new c(`Template source '${e}' points at a file ('/blob/...'). Templates must be a directory \u2014 use the '/tree/<branch>/<subdir>' URL form instead.`):new c(`Template source '${e}' has an unrecognised path. Use 'https://github.com/<owner>/<repo>' or 'https://github.com/<owner>/<repo>/tree/<branch>/<subdir>'.`)}let t=/^([a-z][a-z0-9+.-]*):/i.exec(e);if(t){let r=t[1].toLowerCase();if(r!=="github"&&r!=="gh")throw new c(`Template source '${e}' uses unsupported provider prefix '${t[1]}:'. Only 'github:' (or 'gh:' shorthand) templates are supported.`)}let n=e.replace(/^(?:github|gh):/i,""),[s,p]=n.split("#",2),l=s.split("/").filter(Boolean);if(l.length<2)throw new c(`Template source '${e}' is missing the owner/repo path. Expected 'github:<owner>/<repo>[/<subdir>]'.`);let[o,b,...A]=l;return{owner:o,repo:b,subdir:A.join("/"),ref:p||void 0}}function ye(e,t){let n=F(e),s=`https://github.com/${n.owner}/${n.repo}.git`,p=w.mkdtempSync(x.join(he.tmpdir(),"ms-template-"));try{let l=["clone","--depth=1","--filter=blob:none"];n.subdir&&l.push("--sparse"),n.ref&&l.push("--branch",n.ref),l.push(s,p),m(l,{network:!0}),n.subdir&&m(["-C",p,"sparse-checkout","set",n.subdir]);let o=n.subdir?x.join(p,n.subdir):p;if(!w.existsSync(o))throw new c(`Template subdirectory '${n.subdir}' was not found in https://github.com/${n.owner}/${n.repo}${n.ref?` at ref '${n.ref}'`:""}. If the branch name contains '/', use the 'github:<owner>/<repo>/<subdir>#<branch>' form to disambiguate.`);w.mkdirSync(t.dir,{recursive:!0}),w.cpSync(o,t.dir,{recursive:!0,force:!0,filter:b=>x.basename(b)!==".git"})}finally{w.rmSync(p,{recursive:!0,force:!0})}}var Ne="github:microsoft/Managed-Apps/templates/vite8",D="Initial scaffold from 'ms app create'";async function Ct(e){Je(e),await e.runVerb();let t=await e.getTenantIdAsync();if(!t)throw new c("Unable to determine tenant ID. Ensure you are logged in.");let n=ne(),{region:s}=X(),p=await e.getOption("displayName");if(!p)throw new c("Argument displayName is required. Use --display-name or -n to specify it.");let l=e.getPositionalArg(0);if(l===void 0&&!Be(p))throw new c("The display name cannot be used as a directory name. Specify a target directory as the first argument.");let o=l??p,b=await e.getOption("template",!0),A=await e.getOption("repo",!0),{repoType:r,remoteUrl:g}=ge(A),I=await e.getOption("repositoryId",!0),R=await e.getOption(i.ProjectId.camelName,!0),y;if(R!==void 0&&(y=R.trim(),!re(y)))throw new c("'--project-id' must be a valid GUID.");let h=e.isJsonMode();if(!h){let a=q(s),C=a?`cloud ${a}`:`region ${s}`;E(`About to create app '${p}' in tenant ${t} (${C}).`)}let S=!h&&process.stdout.isTTY;!h&&!S&&E("Running preflight checks...");let v=S?new se:null;v?.start("Running preflight checks...");try{if(r==="none"&&I)throw new c("'--repo none' is incompatible with '--repository-id'. Use '--repo none' for an app with no git binding, or omit '--repo' (or pass a repo URL) to use a backing repository.");if(r==="native"&&I&&y)throw new c("'--project-id' is incompatible with '--repository-id'. Use a managed project or a standalone platform-managed repository, not both.");v?.update("Validating template source..."),We(b),v?.update("Checking git installation..."),le(),r==="native"&&(v?.update("Checking Git Credential Manager..."),ue()),v?.update("Verifying target directory is writable..."),qe(o),r==="github"?(v?.update("Verifying target directory is empty..."),be(o),v?.update(`Verifying ${g} is empty...`),ze(g)):(v?.update("Verifying target directory is empty..."),we(o))}finally{v?.stop()}let _=await ie(e,{failIfMissing:!1}),Ee=_?void 0:ce(e,t,n,"CreateMaafApp"),Ae=await e.getOption("description",!0),Se=await e.getOption("buildPath",!0),$e=await e.getOption("buildCommand",!0),ke=await e.getOption("buildEntryPoint",!0),B=await de(_,Ee);e.updateEnvironmentId(B),r==="github"?be(o):we(o);let Te=await e.getOption(i.OpenBrowser.camelName,!0)??!1,xe=await e.getOption(i.ForceReauth.camelName,!0)??!1,M=r==="native"?y:void 0;r==="native"&&!M&&te("ALM")&&(M=(await Z({displayName:p})).projectId),h&&r==="github"&&K({phase:"create-validation"});let Oe={displayName:p,description:Ae,repositoryId:I,remoteUrl:g,repoType:r,origin:U().origin,...M&&{projectId:M}},Me=({isRetry:a})=>ee({tenantId:t,environmentId:B,logger:n,actionsParams:{...Oe,...xe&&!a&&{forceReauth:!0}}}),W;try{W=await pe(Me,{repoType:r,externalRepoUrl:g,tenantId:t,jsonMode:h,openBrowser:Te,verb:"app create"})}catch(a){let C=ae(a,{repoType:r,environmentId:B});throw C||a}let{app:u,cloneUrl:$}=W;if(r==="native"&&!$){let a=H(u.id,u.environmentId);throw new k(`App '${u.displayName}' was created on the server, but creating a git repository failed. This is a platform-side issue; please report it. In the meantime, the partial app needs to be cleaned up.
|
|
8
8
|
`+a)}let V=null;try{if(r==="github"){if(_e({directory:o,repoUrl:g}),d.readdirSync(o).filter(L=>L!==".git").length>0)throw new c(`Repository ${g} is not empty (must contain no files of any kind, including hidden files like .gitignore, .gitattributes, README, or LICENSE). Choose a different repository to create an app or run 'ms app init' to update the existing app.
|
|
9
9
|
|
|
10
10
|
`+H(u.id,u.environmentId))}else r==="native"?G({directory:o,gitUrl:$,loginAuthority:e.getLoginAuthority(t),authResource:e.getAuthResourceUrl()}):d.mkdirSync(o,{recursive:!0});h||E(`Fetching template '${b}' into ${o}...`),ye(b,{dir:o}),await me(o,h,e.getHttpClient());let a=fe({appId:u.id,appDisplayName:u.displayName,description:u.description,environmentId:u.environmentId,repoType:r,cloud:e.getCloud(),buildPath:Se,buildCommand:$e,buildEntryPoint:ke,repositoryId:r==="native"?u.repositoryId:void 0,externalRepoUrl:r==="github"?g:void 0});await Q(O.join(o,z),a),r!=="none"&&(V=await Ve(o,h,r==="native"?$:void 0,r==="native"?U().sessionId:void 0))}catch(a){if(a instanceof c&&r!=="native")throw a;let C=a instanceof Error?a.message:String(a),L=`App '${u.displayName}' was created, but local setup failed: ${C}
|
|
@@ -17,4 +17,4 @@ If you want to clean it up before retrying, run the following command:
|
|
|
17
17
|
/*!
|
|
18
18
|
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
19
19
|
*/
|
|
20
|
-
//# sourceMappingURL=CreateMaafApp-
|
|
20
|
+
//# sourceMappingURL=CreateMaafApp-OY6P6WIY.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 g,h as v}from"./chunk-
|
|
7
|
+
import{b as g,h as v}from"./chunk-WADQ54KB.js";import{Ga as l,Ha as f,ha as m}from"./chunk-CBXGTKIE.js";import{b as c}from"./chunk-RBG2H562.js";import"./chunk-PDS5FYC4.js";import"./chunk-HO6LX3K7.js";import"./chunk-Y7TZZLPW.js";import{t as o}from"./chunk-LGJ3PMWD.js";import{c as s,d,i as p}from"./chunk-PVAIJSAI.js";import{a as t}from"./chunk-KZIKF2VH.js";import"./chunk-MPRAPBI2.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function D(e){I(e),await e.runVerb();let n=await v(e),r=e.getEnvironmentId({includeConfig:!1}),a=await e.getTenantIdAsync();if(!a)throw new c("Unable to determine tenant ID. Ensure you are logged in.");let u=f();if(!await e.getOption("force",!0)&&u.interactive){let A=r?`app '${n}' from environment '${r}'`:`app '${n}'`;if(!await g({message:`Are you sure you want to delete ${A}? This cannot be undone. Your source code in the repo will not be deleted.`})){p("Delete cancelled.");return}}let i=await m({tenantId:a,environmentId:r,logger:l(),actionsParams:{appName:n}});if(e.isJsonMode()){d({appName:n,environmentId:i.environmentId,existed:i.existed});return}i.existed?s(`App '${n}' deleted from environment '${i.environmentId}'.`):p(`App '${n}' did not exist in environment '${i.environmentId}'; nothing was deleted.`)}function I(e){e.setDescription(t.app.delete.description),e.addExamples(t.app.delete.examples),e.addSwitch({flags:{key:"force",alias:"f"},description:t.app.delete.options.force}),e.addOptions([{flags:{key:o.AppName.name},env:o.AppName.envVar,description:t.app.delete.options.app,optionalInNonInteractive:!0},{flags:{key:o.EnvironmentId.name,alias:o.EnvironmentId.alias},env:o.EnvironmentId.envVar,description:t.app.delete.options.environmentId,optionalInNonInteractive:!0}])}export{D as deleteMaafAppAsync};
|
|
8
8
|
/*!
|
|
9
9
|
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
10
|
*/
|
|
11
|
-
//# sourceMappingURL=DeleteMaafApp-
|
|
11
|
+
//# sourceMappingURL=DeleteMaafApp-SJE7YRQZ.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
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{b as ne}from"./chunk-II367GCP.js";import{a as he,b as ie,c as ae,d as re}from"./chunk-LSAJM3LO.js";import"./chunk-HBLO3WDD.js";import{a as te}from"./chunk-OL6CTXQR.js";import{a as oe}from"./chunk-QKHCRDMM.js";import"./chunk-IMBY742Q.js";import"./chunk-X5O77GZS.js";import{d as Q,j as ee}from"./chunk-EQHSV77H.js";import{b as L,h as Z}from"./chunk-WADQ54KB.js";import{Ga as E,Ha as M,L as W,ea as q,g as J,ja as Y,ka as j,qa as x,ra as U}from"./chunk-CBXGTKIE.js";import{a as u,b as i,d as T,g as R}from"./chunk-RBG2H562.js";import"./chunk-PDS5FYC4.js";import"./chunk-HO6LX3K7.js";import{a as K,c as X}from"./chunk-Y7TZZLPW.js";import{s}from"./chunk-LGJ3PMWD.js";import{c as F,d as O,e as G,h as m,i as I}from"./chunk-PVAIJSAI.js";import{a as g}from"./chunk-KZIKF2VH.js";import{a as D}from"./chunk-MPRAPBI2.js";import"./chunk-Y5AMO72S.js";import{d as ye}from"./chunk-UT667QSU.js";import{promises as ue}from"node:fs";import*as k from"node:path";import{promises as se}from"node:fs";var pe=ye(he(),1);function ge(e){return e?.code==="ENOENT"?"continue":e instanceof Error?e:new Error(String(e))}function we(e){return`zipBuildArtifact: skipping missing entry: ${e?.path??"<unknown>"}`}async function le(e,t,a){let n=await se.stat(e).catch(()=>null);if(!n)throw new i(`buildPath not found: ${e}`);if(!n.isDirectory())throw new i(`buildPath is not a directory: ${e}`);let r=await se.stat(t).catch(()=>null);if(!r||!r.isFile())throw new i(`appConfigPath does not point to a file: ${t}`);let d=a?.maxBytes;return new Promise((y,o)=>{let w=[],v=0,f=!1,l=(0,pe.default)("zip",{zlib:{level:9}});l.on("data",h=>{if(!f){if(v+=h.length,d!==void 0&&v>d){f=!0,l.abort(),o(new R({capBytes:d,bytes:v}));return}w.push(h)}}),l.on("warning",h=>{if(f)return;let b=ge(h);if(b==="continue"){I(we(h));return}o(b)}),l.on("error",h=>{f||o(h)}),l.on("end",()=>{f||y(Buffer.concat(w))}),l.directory(e,!1),l.file(t,{name:D}),l.finalize()})}var ve=1200*1e3,be=6e4,De=2e3,Ae="--no-wait requires Managed DevOps API v2 or v3; the selected backend does not return a trackable operation ID.",ce=`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 _(e){return`${(e/(1024*1024)).toFixed(1)} MB`}function V(e,t){return e!==void 0?`Build artifact is ${_(e)}, which exceeds the ${_(t)} limit.`:`Build artifact exceeds the ${_(t)} limit.`}function Ne(e){let t=e.id||e.name;if(!t)throw new u("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 de(e){return{appId:e.appId,displayName:e.name,commitHash:e.commitSha,appPlayUri:e.appPlayUri}}function H(e,t=e.commitSha){return{operationId:e.operation.operationId,appName:e.appName,commitHash:t}}function A(e){if(e.body)try{let t=JSON.parse(e.body);if(typeof t?.error?.message=="string")return t.error.message}catch{}}function Se(e,t){if(e instanceof R)return new i(V(e.bytes,e.capBytes));if(!(e instanceof J))return null;let a=t.repoType!=="none";if(e.status===400&&e.code==="ArtifactNotAllowedForGitRepo"){let n=A(e);return new u(n?`Artifact upload rejected for this git-backed app: ${n}`:`The server reports this app is git-backed; --artifact uploads are not allowed. Update \`${D}\` so \`repoType\` matches the server's record, then re-run with --commit.`)}if(e.status===400&&e.code==="CommitNotAllowedForArtifactDeploy")return new i("This app uses external artifact deployment. Pass --artifact <path> instead of --commit.");if(e.status===400&&e.code==="InvalidRequestContent")return new i("Invalid deploy request \u2014 verify the environment and app id.");if(e.status===400&&e.code==="ServicePrincipalNotSupportedForMaafOperations")return new i("Service principal callers are not supported for `ms app deploy`. Use interactive auth.");if(e.status===400&&e.code==="BadRequest"){let n=A(e);return a?new i(n??"Invalid commit ID. Use a 40-character lowercase hex value."):new i(`Build artifact rejected: ${n??e.message}`)}if(e.status===400&&e.code==="BuildNotAvailable")return new u("No completed build is available for this commit. Run `ms app build` first, or wait for the build to complete before retrying.");if(e.status===403&&e.code==="ExternalArtifactDeploymentDisabled")return new u(ce);if(e.status===403&&e.code==="InsufficientPrivilege"){let n=A(e);return new u(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.")}if(e.status===403&&e.code==="CodeAppOperationNotAllowedInEnvironment")return new u(ce);if(e.status===403&&e.code==="Forbidden")return new u("You don't have permission to deploy this app. Ask an admin to grant you Contributor on the repo.");if(e.status===404&&e.code==="CommitNotFound"){let n=A(e);return new i(n??"Commit not found on main.")}if(e.status===404&&e.code==="ApplicationNotFound")return new i(`App '${t.appName}' not found in environment ${t.environmentId}.`);if(e.status===404&&e.code==="PowerConfigNotFound")return new u(`Build output is missing the app config (\`${D}\`). 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 u("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 u("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 u("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==="RepoTypeMismatch"){let n=A(e);return new i(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 u(V(void 0,524288e3));if(e.status===422&&e.code==="ArtifactInvalid"){let n=A(e)??e.message;return new i(`Artifact validation failed: ${n}`)}return e.status===502&&e.code==="MaafBuildServiceUnavailable"?new u("Build service is temporarily unavailable. Try again."):e.status===503&&e.code==="AuthorizationCheckFailed"?new u("Authorization service is temporarily unavailable. Try again."):null}async function Pe(e){let{provider:t,appName:a,force:n,forceReauth:r,waitForDeployment:d,onDeployProgress:y}=e,o=e.commitFromFlag,w,v=!1;if(!o){let c=Q();if(!c)throw new i("Could not determine the latest commit ID. Use --commit or -c to specify it.");o=c.commitSha,w=c.detached?void 0:c.branch,v=!0}if(v&&!t.isJsonMode()&&m(w?`Using branch '${w}' at commit ${o}.`:`Detached HEAD at commit ${o}.`),!n){let c=ee();if(c&&M().interactive&&!t.isJsonMode()){if(I(c),!await L({message:"Deploy anyway?",initialValue:!1}))return m("Deploy cancelled."),null}else if(c)throw new i(`${c} Run again with --force to deploy anyway.`)}let f=E(),l=await q({logger:f,actionsParams:{appName:a,commitSha:o,...r&&{forceReauth:!0}}});if(l===null)t.isJsonMode()||m(`A cached build exists for commit ${o}; `+(d?"deploying it.":"submitting its deployment."));else{t.isJsonMode()||m("Build queued; waiting for completion...");let c=await ne({appName:a,commitSha:o,initialWaitMs:l.retryAfterMs??De,isJsonMode:t.isJsonMode(),deadlineMs:ve,maxIntervalMs:be,spinnerLabel:"Waiting for build..."});if(c.status!=="Succeeded")throw new u(`Unexpected terminal build status "${c.status}". Commit ID: ${o}.`)}let h={appName:a,commitSha:o,...e.deploymentName!==void 0&&{deploymentName:e.deploymentName},...r&&{forceReauth:!0}};if(!d){let c=await j({logger:f,actionsParams:h});return{kind:"submitted",value:H(c)}}let b=await Y({logger:f,actionsParams:h,onProgress:y});return{kind:"deployed",value:Ne(b)}}async function Ie(e){let t=k.resolve(e.artifactPath);if(k.extname(t).toLowerCase()!==".zip")throw new i(`--artifact must point to a .zip file. Received: ${e.artifactPath}`);let a=await Re(t);if(!a||!a.isFile())throw new i(`--artifact file not found or not a regular file: ${e.artifactPath}`);if(a.size>524288e3)throw new i(V(a.size,524288e3));let n=await ue.readFile(t);e.provider.isJsonMode()||m(e.waitForDeployment?"Uploading artifact and deploying...":"Uploading artifact and submitting deployment...");let r={logger:E(),actionsParams:{appName:e.appName,zipBuffer:n,...e.deploymentName!==void 0&&{deploymentName:e.deploymentName}}};if(!e.waitForDeployment){let{commitSha:y,submission:o}=await U(r);return{kind:"submitted",value:H(o,y)}}let d=await x({...r,onProgress:e.onDeployProgress});return{kind:"deployed",value:de(d)}}async function Re(e){try{return await ue.stat(e)}catch(t){if(t instanceof Error&&"code"in t&&t.code==="ENOENT")return null;throw t}}async function Ee(e){if(ie(e.appConfig),!(e.provider.isJsonMode()||!M().interactive)&&!await L({message:`This will build the app and deploy the resulting artifact to environment ${e.environmentId}. Continue?`,initialValue:!1}))return m("Aborted."),null;let{packAppOutputDir:a}=await re({quiet:e.provider.isJsonMode()}),n=await le(a,e.appConfigPath,{maxBytes:524288e3});e.provider.isJsonMode()||m(e.waitForDeployment?"Uploading build artifact and deploying...":"Uploading build artifact and submitting deployment...");let r={logger:E(),actionsParams:{appName:e.appName,zipBuffer:n,...e.deploymentName!==void 0&&{deploymentName:e.deploymentName}}};if(!e.waitForDeployment){let{commitSha:y,submission:o}=await U(r);return{kind:"submitted",value:H(o,y)}}let d=await x({...r,onProgress:e.onDeployProgress});return{kind:"deployed",value:de(d)}}async function tt(e){ke(e),await e.runVerb();let t=e.getManagedDevOpsDeployVersion(),a=await e.getOption(s.NoWait.camelName,!0)!==!1;if(!a&&t!==2&&t!==3)throw new i(Ae);t!==void 0&&process.stderr.write(`[debug] ${K("MAAF_DEPLOY_VIA_MANAGED_DEVOPS")} selects Managed DevOps API v${t}; deploying via the '/manageddevops' route.
|
|
10
|
+
`);let{appConfig:n,fileConfig:r,interactive:d}=M();if(!n)throw new T(`${D} is required. Run this command from a directory created by \`ms app create\`.`);if(!r?.appConfigPath)throw new T(`${D} path is unavailable.`);ae(n,S=>new i(S));let y=e.getEnvironmentId();if(!y)throw new i(`No environment ID found. Run this command from a directory with a ${D} (created by \`ms app create\`).`);let o=n.repoType??"native",w=n.externalRepoUrl,v=await e.getOption("commit",!0),f=await e.getOption("artifact",!0),l=(await e.getOption(s.Deployment.name,!0))?.trim();if(l!==void 0&&W(l),v&&f)throw new i("Pass either --commit or --artifact, not both. --commit triggers a build for the commit; --artifact deploys a pre-built zip.");if(o==="none"&&v)throw new i("This app uses external artifact deployment. Pass --artifact <path> instead of --commit.");if(f&&o!=="none")throw new i(`--artifact is only valid for apps created with \`repoType: 'none'\`. This app's repoType is \`${o}\`; deploy via \`--commit\` (or omit it to use the current HEAD).`);let h=await e.getTenantIdAsync();if(!h)throw new i("Unable to determine tenant ID. Ensure you are logged in.");let b=await Z(e),c=await e.getOption(s.OpenBrowser.camelName,!0)??!1,z=await e.getOption(s.ForceReauth.camelName,!0)??!1,me=await e.getOption(s.Force.name,!0)??!1,N=e.isJsonMode(),B=(t===2||t===3)&&!N&&a?Me(d&&process.stdout.isTTY===!0):void 0,$=B?.onProgress;N&&o==="github"&&G({phase:"deploy-validation"});let p;try{f?p=await Ie({provider:e,appName:b,artifactPath:f,waitForDeployment:a,deploymentName:l,onDeployProgress:$}):o==="native"||o==="github"?p=await oe(async({isRetry:P})=>{try{return await Pe({provider:e,appName:b,commitFromFlag:v,force:me,forceReauth:z&&!P&&o==="github",waitForDeployment:a,deploymentName:l,onDeployProgress:$})}catch(fe){throw B?.stop(),fe}},{repoType:o,externalRepoUrl:w,tenantId:h,jsonMode:N,openBrowser:c,verb:"app deploy"}):p=await Ee({provider:e,appName:b,appConfig:n,appConfigPath:r.appConfigPath,environmentId:y,waitForDeployment:a,deploymentName:l,onDeployProgress:$})}catch(S){let P=Se(S,{repoType:o,appName:b,environmentId:y});throw P||S}finally{B?.stop()}if(p!==null){if(p.kind==="submitted"){N?O({status:"submitted",operationId:p.value.operationId,appName:p.value.appName,commitHash:p.value.commitHash,repoType:o}):(F(`Deployment submitted for app '${p.value.appName}'.`),m(`Operation ID: ${p.value.operationId}`),m(`Commit: ${p.value.commitHash}`));return}N?O({...p.value,repoType:o}):(F(`Deployed app '${p.value.displayName}' (${p.value.appId}).`),p.value.commitHash&&m(`Commit: ${p.value.commitHash}`),p.value.appPlayUri&&m(`Play URL: ${p.value.appPlayUri}`))}}function Me(e){let t,a=!1,n,r=()=>{a&&(t?.stop(),a=!1)},d=()=>{e&&(t??=new te,t.start("Waiting for deployment..."),a=!0)};return{onProgress:o=>{let w=Ce(o);if(w!==n)switch(n=w,o.type){case"submitting":r(),m("Submitting deployment...");break;case"submitted":r(),m(`Operation: ${o.operationId}`),d();break;case"status":r(),m(`Deployment status: ${o.operationStatus}`),(o.operationStatus==="NotStarted"||o.operationStatus==="Running")&&d();break}},stop:()=>{r(),n=void 0}}}function Ce(e){switch(e.type){case"submitting":return e.type;case"submitted":return`${e.type}:${e.operationId}`;case"status":return`${e.type}:${e.operationId}:${e.operationStatus}`}}function ke(e){let t=X("ALM");e.setDescription(g.app.deploy.description),e.addExamples(t?g.app.deploy.examples:g.app.deploy.examples.filter(a=>!a.includes(" --deployment "))),e.addOptions([{flags:{key:s.AppName.name},env:s.AppName.envVar,description:g.app.deploy.options.app,optionalInNonInteractive:!0},{flags:{key:s.CommitSha.name,alias:s.CommitSha.alias},env:s.CommitSha.envVar,description:g.app.deploy.options.commit,optionalInNonInteractive:!0},{flags:{key:s.Artifact.name},env:s.Artifact.envVar,description:g.app.deploy.options.artifact,optionalInNonInteractive:!0},...t?[{flags:{key:s.Deployment.name},env:s.Deployment.envVar,description:g.app.deploy.options.deployment,optionalInNonInteractive:!0}]:[]]),e.addSwitch({flags:{key:s.OpenBrowser.name},description:g.app.deploy.options.openBrowser}),e.addSwitch({flags:{key:s.Force.name},description:g.app.deploy.options.force}),e.addSwitch({flags:{key:s.NoWait.name},description:g.app.deploy.options.noWait}),e.addSwitch({flags:{key:s.ForceReauth.name},description:g.app.deploy.options.forceReauth})}export{tt as deployMaafAppAsync};
|
|
11
|
+
/*!
|
|
12
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
13
|
+
*/
|
|
14
|
+
//# sourceMappingURL=DeployMaafApp-VK4MJKVY.js.map
|
|
@@ -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{Ha as O,k as $}from"./chunk-
|
|
7
|
+
import{Ha as O,k as $}from"./chunk-CBXGTKIE.js";import{d as A}from"./chunk-RBG2H562.js";import"./chunk-PDS5FYC4.js";import"./chunk-HO6LX3K7.js";import"./chunk-Y7TZZLPW.js";import{i as p}from"./chunk-LGJ3PMWD.js";import{h as u,i as y,j as k}from"./chunk-PVAIJSAI.js";import{a as d}from"./chunk-KZIKF2VH.js";import{a as m,h as U}from"./chunk-MPRAPBI2.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";import{spawn as _}from"node:child_process";import{createRequire as j}from"node:module";import*as V from"node:path";import{setTimeout as q}from"node:timers/promises";import{pathToFileURL as K}from"node:url";import{styleText as b}from"node:util";import*as S from"fs";import*as G from"http";import*as v from"fs";import*as h from"path";var D=["bun","pnpm","yarn","npm"];function T(n,e){let t=e?.packageManager?.split("@")[0];return t&&D.includes(t)?t:v.existsSync(h.join(n,"bun.lockb"))||v.existsSync(h.join(n,"bun.lock"))?"bun":v.existsSync(h.join(n,"pnpm-lock.yaml"))?"pnpm":v.existsSync(h.join(n,"yarn.lock"))?"yarn":"npm"}import*as F from"node:net";var w=65535;async function W(n){return!Number.isInteger(n)||n<1||n>w?!1:new Promise(e=>{let t=F.createServer();t.once("error",()=>{e(!1)}),t.once("listening",()=>{t.close(()=>e(!0))});try{t.listen({port:n,exclusive:!0})}catch{e(!1)}})}async function C(n,e=100){if(!Number.isInteger(n)||n<1||n>w)throw new Error(`Invalid port "${n}". Pass a valid --port between 1 and ${w} and try again.`);for(let t=0;t<e;t++){let o=n+t;if(o>w)break;if(await W(o))return o}throw new Error(`Could not find an available port in the range ${n}-${Math.min(n+e-1,w)}. Close some processes or pass a different --port and try again.`)}function I(n,e=80){try{let t=new URL(n);return t.port?parseInt(t.port,10):t.protocol==="https:"?443:e}catch{return e}}function x(n,e){try{let t=new URL(n);t.port=String(e);let o=t.toString();return!n.endsWith("/")&&o.endsWith("/")&&(o=o.slice(0,-1)),o}catch{return n}}import*as P from"fs";import*as N from"path";function R(n){let e=N.join(n,"package.json");return P.existsSync(e)?JSON.parse(P.readFileSync(e,"utf8")):{}}var B=["powerApps","managedApps"];async function vn(n){let e=O(),{appConfig:t,fileConfig:o}=e,r=V.dirname(o.appConfigPath);Y(n,t?.localAppUrl),await n.runVerb();let l=await n.getOption("configOnly"),a=new AbortController;if(process.once("SIGINT",()=>a.abort()),process.once("SIGTERM",()=>a.abort()),l){await L(r)&&y("Warning: --config-only is not needed when using the vite plugin. The plugin already serves the config and prints the play URL.");let H=await n.getOption("localAppUrl");await M(n,o.appConfigPath,t,a.signal,H);return}let s=R(r);if(!s.scripts?.dev)throw new A('No "dev" script found in package.json. Add a "dev" script to start your app.');if(await L(r)){await J(r,a.signal,s);return}let f=await n.getOption("localAppUrl"),c=I(f,3e3),i=await C(c),g=[],E=f;i!==c&&(E=x(f,i),g=["--port",String(i),"--strictPort"],y(`Warning: port ${c} is already in use. Starting the app dev server on port ${i} instead.`)),await Promise.all([J(r,a.signal,s,g),M(n,o.appConfigPath,t,a.signal,E)])}async function M(n,e,t,o,r){if(!t)throw new A(`${m} is required to run an app`);if(!t.environmentId)throw new A(`Environment ID is required in ${m} to run an app`);t.cloud||(t.cloud="public");let l=await n.getOption("port"),a=parseInt(l,10),s=await C(a);s!==a&&y(`Warning: port ${a} is already in use. Using port ${s} for the config server instead.`),await X(e,s,t,r,o)}async function X(n,e,t,o,r){return new Promise((l,a)=>{let s=G.createServer((c,i)=>{if(i.setHeader("Access-Control-Allow-Origin","*"),i.setHeader("Access-Control-Allow-Methods","GET, OPTIONS"),i.setHeader("Access-Control-Allow-Headers","*"),c.method==="OPTIONS"){i.writeHead(200),i.end();return}try{if(!S.existsSync(n)){i.writeHead(404,{"Content-Type":"application/json"}),i.end(JSON.stringify({error:`${m} not found`}));return}let g=S.readFileSync(n,"utf8");i.writeHead(200,{"Content-Type":"application/json"}),i.end(g)}catch(g){k(`Error serving ${m}: ${g.message}`),i.writeHead(500,{"Content-Type":"application/json"}),i.end(JSON.stringify({error:"Internal server error"}))}});s.listen(e,"localhost",async()=>{if(await z(o,r),!r.aborted){let c=U(t.cloud),i=$(c,{appUrl:o,appConfigUrl:`http://localhost:${e}`});u(`
|
|
8
8
|
Ready. You can play your app locally at:
|
|
9
9
|
${b(["blueBright","bold"],` \u279C ${i}`)}`)}}),s.on("error",c=>{k(`Server error: ${c.message}`),a(c)});let f=()=>{u(b("dim",`
|
|
10
10
|
Shutting down config server...`)),s.closeAllConnections(),s.close(()=>{u(b("dim","Config server stopped.")),l()}),setTimeout(l,2e3).unref()};r.aborted?f():r.addEventListener("abort",f,{once:!0})})}function Y(n,e){n.setDescription(d.app.dev.description),n.addExamples(d.app.dev.examples),n.addOptions([{flags:{key:p.Port.name,alias:p.Port.alias},env:p.Port.envVar,default:p.Port.initialValue,description:d.app.dev.options.port},{flags:{key:p.LocalAppUrl.name,alias:p.LocalAppUrl.alias},env:p.LocalAppUrl.envVar,default:e||p.LocalAppUrl.initialValue,description:d.app.dev.options.localAppUrl}]),n.addSwitch({flags:{key:p.ConfigOnly.name,alias:p.ConfigOnly.alias},env:p.ConfigOnly.envVar,description:d.app.dev.options.configOnly})}async function z(n,e,t=300,o=1e4){u(b("dim",`Waiting for app to be available at ${n}...`));let r=AbortSignal.timeout(o),l=AbortSignal.any([e,r]);try{for(;!l.aborted;){await q(t,void 0,{signal:l});try{let a=await fetch(n,{method:"HEAD"});if(a.ok||a.status<500)return}catch{}}}catch{}finally{r.aborted&&y(`Warning: timed out looking for app running at ${n}`)}}async function L(n){let e;try{let o=j(`${n}/package.json`).resolve("vite");e=(await import(K(o).href)).loadConfigFromFile}catch{return!1}try{return((await e({command:"serve",mode:"development"},void 0,n))?.config?.plugins??[]).flat().some(r=>typeof r=="object"&&r!==null&&B.includes(r.name))}catch{return!1}}async function J(n,e,t,o=[]){let r=T(n,t);return new Promise((l,a)=>{let s=o.length>0?` -- ${o.join(" ")}`:"",f=_(`${r} run dev${s}`,{cwd:n,stdio:"inherit",shell:!0});f.on("close",(i,g)=>{i===0||g==="SIGINT"?l():a(new Error(`Dev server exited unexpectedly with code ${i??"unknown"}.`))}),f.on("error",a);let c=()=>{f.kill("SIGINT")};e.aborted?c():e.addEventListener("abort",c,{once:!0})})}export{vn as devAsync};
|
|
11
11
|
/*!
|
|
12
12
|
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
13
13
|
*/
|
|
14
|
-
//# sourceMappingURL=Dev-
|
|
14
|
+
//# sourceMappingURL=Dev-75M4ANEA.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 I}from"./chunk-YMXXWGRV.js";import{a as D}from"./chunk-
|
|
7
|
+
import{a as I}from"./chunk-YMXXWGRV.js";import{a as D}from"./chunk-II367GCP.js";import"./chunk-OL6CTXQR.js";import{d as L}from"./chunk-EQHSV77H.js";import{h as v}from"./chunk-WADQ54KB.js";import{Ga as f,fa as S,la as A}from"./chunk-CBXGTKIE.js";import{b as p}from"./chunk-RBG2H562.js";import"./chunk-PDS5FYC4.js";import"./chunk-HO6LX3K7.js";import"./chunk-Y7TZZLPW.js";import{q as n}from"./chunk-LGJ3PMWD.js";import{d as y,h as i}from"./chunk-PVAIJSAI.js";import{a as r}from"./chunk-KZIKF2VH.js";import{a as c}from"./chunk-MPRAPBI2.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function j(t){if(E(t),await t.runVerb(),!t.getEnvironmentId())throw new p(`\`ms app get-build-status\` is deprecated and the \`--environment-id\` flag has been removed. The replacement flow is \`ms app create\` (scaffolds the app and writes ${c}) followed by \`ms app deploy\`. To run this deprecated command, invoke it from a directory with a ${c} (created by \`ms app create\`).`);if(!await t.getTenantIdAsync())throw new p("Unable to determine tenant ID. Ensure you are logged in.");let g=await v(t),h=await t.getOption("commit"),l=h?void 0:L(),a=h||l?.commitSha;if(!a)throw new p("Unable to infer the current commit ID. Use --commit or -c to specify it.");let m=await t.getOption("showLog")===!0;!t.isJsonMode()&&l&&i(l.detached?`Detached HEAD at commit ${a}.`:`Using branch '${l.branch}' at commit ${a}.`);let e=await S({logger:f(),actionsParams:{appName:g,commitSha:a}}),o=D(e.result),b=$(e.result),s;if(m&&b&&(s=(await A({logger:f(),actionsParams:{appName:g,commitSha:a}})).log),t.isJsonMode()){let w=!!(o.errorMessage||o.buildOutput)?{...e,...o}:{...e};if(s!==void 0){let k=typeof e.result=="object"&&e.result!==null?e.result:{};w.result={...k,log:s}}y(w)}else i(o.errorMessage?`Build status: ${e.status}: ${o.errorMessage}`:`Build status: ${e.status}`),b&&!m&&e.status!=="Succeeded"&&i("Run `ms app build-status --show-log` to display the build log."),o.buildOutput&&i(o.buildOutput),m&&(s&&s.trim()?await I(s):i("No build log is available for this build.")),e.status==="Succeeded"&&i(`Run \`ms app dev\` to run your app locally, or \`ms app deploy --commit ${a}\` to make this app live.`)}function $(t){if(typeof t!="object"||t===null||!("buildLogUri"in t))return;let d=t.buildLogUri;if(typeof d!="string")return;let u=d.trim();return u||void 0}function E(t){t.setDescription(r.app.buildStatus.description),t.addExamples(r.app.buildStatus.examples),t.addOptions([{flags:{key:n.AppName.name},env:n.AppName.envVar,description:r.app.buildStatus.options.appName,optionalInNonInteractive:!0},{flags:{key:n.CommitSha.name,alias:n.CommitSha.alias},env:n.CommitSha.envVar,description:r.app.buildStatus.options.commitSha}]),t.addSwitch({flags:{key:n.ShowLog.name},description:r.app.buildStatus.options.showLog})}export{j as getMaafBuildStatusAsync};
|
|
8
8
|
/*!
|
|
9
9
|
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
10
|
*/
|
|
11
|
-
//# sourceMappingURL=GetMaafBuildStatus-
|
|
11
|
+
//# sourceMappingURL=GetMaafBuildStatus-I5Y6STGB.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{Aa as m,Ha as c,za as g}from"./chunk-
|
|
7
|
+
import{Aa as m,Ha as c,za as g}from"./chunk-CBXGTKIE.js";import{b as f}from"./chunk-RBG2H562.js";import"./chunk-PDS5FYC4.js";import"./chunk-HO6LX3K7.js";import"./chunk-Y7TZZLPW.js";import{d as r,h as s}from"./chunk-PVAIJSAI.js";import{a as e}from"./chunk-KZIKF2VH.js";import{a as p}from"./chunk-MPRAPBI2.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function E(t){S(t),await t.runVerb();let i=c();if(!i.appConfig)throw new f(`No ${p} found in the current directory. Run "${"ms"} app init" first.`);let o=m(i.appConfig.appSettings);if(t.isJsonMode())r({settings:o});else for(let n of g)s(`${n.name} = ${o[n.configKey]}`)}function S(t){t.setDescription(e.app["get-settings"].description),t.addExamples(e.app["get-settings"].examples??[])}export{E as getSettingsAsync};
|
|
8
8
|
/*!
|
|
9
9
|
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
10
|
*/
|
|
11
|
-
//# sourceMappingURL=GetSettings-
|
|
11
|
+
//# sourceMappingURL=GetSettings-5T3STEOV.js.map
|
|
@@ -4,10 +4,10 @@ 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 h}from"./chunk-USRRI5H4.js";import{h as A,i as N}from"./chunk-
|
|
7
|
+
import{a as h}from"./chunk-USRRI5H4.js";import{h as A,i as N}from"./chunk-WADQ54KB.js";import{Ga as I,ma as b}from"./chunk-CBXGTKIE.js";import{b as y}from"./chunk-RBG2H562.js";import"./chunk-PDS5FYC4.js";import"./chunk-HO6LX3K7.js";import"./chunk-Y7TZZLPW.js";import{o as p}from"./chunk-LGJ3PMWD.js";import{d as u,h as t,i as g}from"./chunk-PVAIJSAI.js";import{a as r}from"./chunk-KZIKF2VH.js";import"./chunk-MPRAPBI2.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";var E=7;async function H(e){await $(e,!1)}async function L(e){await $(e,!0)}async function $(e,n){v(e,n),await e.runVerb(),n&&g(r.app.show.deprecation);let o=await A(e),c=await N(e,{failIfMissing:!1}),i=await e.getTenantIdAsync();if(!i)throw new y("Unable to determine tenant ID. Ensure you are logged in.");let a=await b({tenantId:i,environmentId:c,logger:I(),actionsParams:{appName:o}}),s=T(a);e.isJsonMode()?u(s):V(s)}function T(e){let n=e.connectionReferences??{},o=Object.entries(n).map(([a,s])=>S(a,s)),c=e.commitHash,i=h(e);return{displayName:e.displayName,description:e.description??void 0,environmentId:e.environmentId,appId:e.id,commit:c?c.slice(0,E):void 0,connectors:o,repoType:i?.repoType,cloneUrl:i?.cloneUrl}}function S(e,n){let o={connector:e};n.displayName&&(o.displayName=n.displayName),n.actions?.length&&(o.actions=n.actions);let c=n.dataSets??{},i=[],a=[],s=new Set;for(let[d,f]of Object.entries(c))if(!(!f||typeof f!="object"))for(let[m,l]of Object.entries(f.dataSources??{}))s.add(m),l.tableName?i.push({dataset:d,table:l.tableName}):a.push({dataset:d,procedure:m});for(let d of n.dataSources??[])s.has(d)||i.push({table:d});return i.length&&(o.tables=i),a.length&&(o.procedures=a),o}function V(e){if(t(`Name: ${e.displayName}`),e.description&&t(`Description: ${e.description}`),t(`Environment: ${e.environmentId}`),t(`App ID: ${e.appId}`),e.commit&&t(`Commit: ${e.commit}`),e.repoType&&t(`Repo type: ${e.repoType}`),e.cloneUrl&&t(`Clone URL: ${e.cloneUrl}`),e.connectors.length===0){t(""),t("(no connectors bound)");return}for(let n of e.connectors){t("");let o=n.connector.replace(/^shared_/,"");t(n.displayName?`${o} (${n.displayName})`:o),n.actions?.length&&t(` actions: ${n.actions.join(", ")}`),n.tables?.length&&t(` tables: ${n.tables.map(w).join(", ")}`),n.procedures?.length&&t(` procedures: ${n.procedures.map(x).join(", ")}`)}}function v(e,n){e.setDescription(n?`${r.app.show.deprecation}
|
|
8
8
|
|
|
9
9
|
${r.app.info.description}`:r.app.info.description),e.addExamples(n?r.app.show.examples:r.app.info.examples),e.addOptions([{flags:{key:p.App.name},env:p.App.envVar,description:r.app.info.options.app,optionalInNonInteractive:!0},{flags:{key:p.EnvironmentId.name,alias:p.EnvironmentId.alias},env:p.EnvironmentId.envVar,description:r.app.info.options.environmentId,optionalInNonInteractive:!0}])}function w(e){return e.dataset?`${e.table} (${e.dataset})`:e.table}function x(e){return`${e.procedure} (${e.dataset})`}export{T as buildAppInfoView,H as infoMaafAppAsync,L as showMaafAppAsync};
|
|
10
10
|
/*!
|
|
11
11
|
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
12
12
|
*/
|
|
13
|
-
//# sourceMappingURL=InfoMaafApp-
|
|
13
|
+
//# sourceMappingURL=InfoMaafApp-OHDDS3OQ.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 j,b as J,c as W,d as q,e as Y,f as _,g as K}from"./chunk-
|
|
7
|
+
import{a as j,b as J,c as W,d as q,e as Y,f as _,g as K}from"./chunk-EKMZGVZA.js";import"./chunk-TYRVM4PP.js";import{a as F,b as H}from"./chunk-IXZUOQPP.js";import{a as P}from"./chunk-QKHCRDMM.js";import"./chunk-IMBY742Q.js";import"./chunk-X5O77GZS.js";import{e as S,f as z,i as T}from"./chunk-EQHSV77H.js";import{b as L,e as d,i as M}from"./chunk-WADQ54KB.js";import{Aa as O,Ga as $,Ha as G,e as V,ga as D}from"./chunk-CBXGTKIE.js";import{b as u}from"./chunk-RBG2H562.js";import"./chunk-PDS5FYC4.js";import"./chunk-HO6LX3K7.js";import"./chunk-Y7TZZLPW.js";import{B as e}from"./chunk-LGJ3PMWD.js";import{c as B,d as x,h as r,i as b}from"./chunk-PVAIJSAI.js";import{a}from"./chunk-KZIKF2VH.js";import{a as E}from"./chunk-MPRAPBI2.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";import*as h from"fs";import*as m from"path";async function ke(t){pe(t),await t.runVerb();let l=G();if(l.appConfig)throw new u(`${E} already exists in this directory. Use a new directory or delete the existing config.`);let f=$(),o=t.isJsonMode(),g=await t.getTenantIdAsync();if(!g)throw new u("Unable to determine tenant ID. Ensure you are logged in.");let A=await M(t,{failIfMissing:!1}),U=A===void 0?F(t,g,f,"Init"):void 0;U?.catch(i=>{f.trackErrorEvent("Init.RoutingEnvironmentBackgroundFailure",{error:i instanceof Error?i.message:String(i)})});let C=await t.getOption("repo",!0),w=C?.trim()?C.trim():void 0,p,k,n="native";if(w!==void 0&&_(w))k=w,n="native",o||r("Using provided repository ID for the app's platform-managed source control.");else if(w!==void 0){let i=K(C);if(i.repoType==="github"){let s=process.cwd();if(h.readdirSync(s).length===0)throw new u(`--repo requires a non-empty current directory. Clone the repository here first, or use '${"ms"} app create --repo <url>' to scaffold and clone in one step.`);if(!h.existsSync(m.join(s,".git")))throw new u(`--repo requires the current directory to be a git working copy (no .git directory found). Clone '${i.remoteUrl}' here first, or use '${"ms"} app create --repo <url>' to scaffold and clone in one step.`);o||r(`Using provided repository URL '${i.remoteUrl}' for app source control.`)}else i.repoType==="none"&&!o?r("No git repo will be linked to the app. You will be able to upload build artifacts manually when you want to publish the app."):i.repoType==="native"&&!o&&r("A new platform-managed git repo will be provisioned and linked to the app.");n=i.repoType,p=i.remoteUrl}else{let i=S();i&&(o||r(`Detected git remote URL: ${i}`),(l.interactive?await L({message:"Use this existing repository for app source control?",initialValue:!0}):!0)?(o||r("Will use the existing git repo and link it to the app."),n="github",p=i):o||r("Will not use the existing git repo. A new platform-managed git repo will be provisioned and linked to the app instead."))}n==="native"&&(J(),W());let N=await t.getOption("displayName"),X=await t.getOption("description"),Z=await t.getOption("buildPath"),ee=await t.getOption("buildCommand"),ie=await t.getOption("buildEntryPoint"),R=Q(await t.getOption(e.IconPath.camelName,!0));if(R!==void 0){let i=m.extname(R).toLowerCase();if(i!==".png"&&i!==".jpg"&&i!==".jpeg")throw new u(`--icon-path must reference a .png or .jpg file (received '${R}').`)}let te=Q(await t.getOption(e.LocalAppUrl.camelName,!0)),ne=await t.getOption(e.OpenBrowser.camelName,!0)??!1,oe=await t.getOption(e.ForceReauth.camelName,!0)??!1,y=await H(A,U);t.updateEnvironmentId(y);let ae={displayName:N,description:X,repositoryId:k,remoteUrl:p,repoType:n,origin:l.origin},re=({isRetry:i})=>D({tenantId:g,environmentId:y,logger:f,actionsParams:{...ae,...oe&&!i&&n==="github"&&{forceReauth:!0}}}),c;try{c=await P(re,{repoType:n,externalRepoUrl:p,tenantId:g,jsonMode:o,openBrowser:ne,verb:"app init"})}catch(i){let s=j(i,{repoType:n,environmentId:y});throw s||i}let se=q({appId:c.app.id,appDisplayName:c.app.displayName,description:c.app.description,environmentId:y,repoType:n,repositoryId:n==="native"?c.app.repositoryId:void 0,externalRepoUrl:n==="github"?p:void 0,cloud:t.getCloud(),buildPath:Z,buildCommand:ee,buildEntryPoint:ie,iconPath:R,localAppUrl:te,connectionReferences:{},appSettings:O(void 0)});await V(l.fileConfig.appConfigPath,se);let I=m.dirname(l.fileConfig.appConfigPath);if(await Y(I,o,t.getHttpClient()),n==="native"&&c.cloneUrl){let i=T({directory:I,gitUrl:c.cloneUrl,loginAuthority:t.getLoginAuthority(g),authResource:t.getAuthResourceUrl()});if(i.success&&!o)r("Configured the platform-managed git remote and credentials.");else if(!i.success&&(f.trackErrorEvent("Init.LocalGitRepoInitializationFailed",{repoType:n,error:i.error??"Unknown git initialization error"}),!o)){let s=i.error?` Reason: ${i.error}`:"";b(`Could not initialize a local git repository automatically.${s} ${n==="native"?"Run 'git init', configure Git Credential Manager (GCM) for this native repository, and run 'git remote add origin <remote-url>' or 'git remote set-url origin <remote-url>' manually.":"Run 'git init' and 'git remote add origin <remote-url>' manually."}`)}}else if(n==="github"&&p&&!h.existsSync(m.join(I,".git"))){let i=z(p,I);if(i.success&&!o)r("Initialized a local git repository and configured the remote.");else if(!i.success&&(f.trackErrorEvent("Init.LocalGitRepoInitializationFailed",{repoType:n,error:i.error??"Unknown git initialization error"}),!o)){let s=i.error?` Reason: ${i.error}`:"";b(`Could not initialize a local git repository automatically.${s} Run 'git init' and 'git remote add origin <remote-url>' manually.`)}}o?x({appId:c.app.id,environmentId:y,repoType:n,...p&&{externalRepoUrl:p}}):(B(`Created ${E} for ${N}.`),r("Hint: Run 'npm install' (or your package manager's install) to install the project-local CLI."),r(`Hint: Run '${"ms"} app add data-source' to connect data, or '${"ms"} app dev' to start the app locally.`),n!=="none"&&r("Hint: Commit and push to wire your app to the remote repository: git add . && git commit -m '<message>' && git push -u origin HEAD."))}function Q(t){let l=t?.trim();return l||void 0}function pe(t){t.setDescription(a.app.init.description),t.addExamples(a.app.init.examples),t.addOptions([d({flags:{key:e.EnvironmentId.name,alias:e.EnvironmentId.alias},env:e.EnvironmentId.envVar,message:e.EnvironmentId.promptMessage,description:a.app.init.options.environmentId}),d({flags:{key:e.DisplayName.name,alias:e.DisplayName.alias},env:e.DisplayName.envVar,message:e.DisplayName.promptMessage,description:a.app.init.options.displayName}),d({flags:{key:e.Description.name,alias:e.Description.alias},env:e.Description.envVar,default:" ",message:e.Description.promptMessage,description:a.app.init.options.description}),d({flags:{key:e.BuildPath.name,alias:e.BuildPath.alias},env:e.BuildPath.envVar,message:e.BuildPath.promptMessage,initialValue:e.BuildPath.initialValue,default:"./dist",description:a.app.init.options.buildPath}),d({flags:{key:e.BuildCommand.name,alias:e.BuildCommand.alias},env:e.BuildCommand.envVar,message:e.BuildCommand.promptMessage,initialValue:e.BuildCommand.initialValue,default:"npm run build",description:a.app.init.options.buildCommand}),d({flags:{key:e.BuildEntryPoint.name},env:e.BuildEntryPoint.envVar,message:e.BuildEntryPoint.promptMessage,initialValue:e.BuildEntryPoint.initialValue,default:"index.html",description:a.app.init.options.buildEntryPoint}),{flags:{key:e.Repo.name},env:e.Repo.envVar,description:a.app.init.options.repo,optionalInNonInteractive:!0},{flags:{key:e.IconPath.name},env:e.IconPath.envVar,description:a.app.init.options.iconPath,optionalInNonInteractive:!0},{flags:{key:e.LocalAppUrl.name},env:e.LocalAppUrl.envVar,description:a.app.init.options.localAppUrl,optionalInNonInteractive:!0}]),t.addSwitch({flags:{key:e.OpenBrowser.name},description:a.app.init.options.openBrowser}),t.addSwitch({flags:{key:e.ForceReauth.name},description:a.app.init.options.forceReauth})}export{ke as initAsync};
|
|
8
8
|
/*!
|
|
9
9
|
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
10
|
*/
|
|
11
|
-
//# sourceMappingURL=Init-
|
|
11
|
+
//# sourceMappingURL=Init-NLNDZJBN.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 u}from"./chunk-
|
|
7
|
+
import{a as u}from"./chunk-PVGICWWI.js";import{b as y}from"./chunk-YMXXWGRV.js";import{c as h}from"./chunk-IXZUOQPP.js";import{e as i}from"./chunk-WADQ54KB.js";import{Ga as g,_ as A}from"./chunk-CBXGTKIE.js";import{b as f}from"./chunk-RBG2H562.js";import"./chunk-PDS5FYC4.js";import"./chunk-HO6LX3K7.js";import"./chunk-Y7TZZLPW.js";import{b as s,l as t}from"./chunk-LGJ3PMWD.js";import{f as l}from"./chunk-PVAIJSAI.js";import{a as e}from"./chunk-KZIKF2VH.js";import"./chunk-MPRAPBI2.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function U(o){x(o),await o.runVerb();let r=g(),a=await o.getTenantIdAsync();if(!a)throw new f("Unable to determine tenant ID. Ensure you are logged in.");let C=await h(o,r,{jsonMode:o.isJsonMode(),telemetryNamespace:"ListConnectorActions"}),v=await o.getOption("connector",!1),c=await u(v,r,{jsonMode:o.isJsonMode()}),I=await o.getOption(t.Search.name,!0),w={tenantId:a,environmentId:C,actionsParams:{connectorId:c,search:I},logger:r},{actions:S,docsUrl:m}=await A(w),p=S.slice().sort((n,d)=>n.behavior!==d.behavior?n.behavior==="Allow"?-1:1:n.summary.localeCompare(d.summary));if(o.isJsonMode()){l(p);return}await y({title:`Connector Actions \u2014 ${c}`,metadata:m?[`Docs: ${m}`]:void 0,columns:[{header:"Summary",maxWidth:50},{header:"Behavior"},{header:"Action ID",maxWidth:40}],rows:p.map(n=>[n.deprecated?`[Deprecated] ${n.summary}`:n.summary,n.behavior,n.id]),emptyMessage:"No actions found.",totalLabel:"action(s)"})}function x(o){o.setDescription(e.connector["list-actions"].description),o.addExamples(e.connector["list-actions"].examples),o.addOptions([i({flags:{key:s.Connector.name},env:s.Connector.envVar,message:s.Connector.promptMessage,description:e.connector["list-actions"].options.connector}),{flags:{key:t.EnvironmentId.name,alias:t.EnvironmentId.alias},env:t.EnvironmentId.envVar,description:e.connector["list-actions"].options.environmentId,optionalInNonInteractive:!0},i({flags:{key:t.Search.name,alias:t.Search.alias},env:t.Search.envVar,message:t.Search.promptMessage,description:e.connector["list-actions"].options.search})])}export{U as listConnectorActionsCliAsync};
|
|
8
8
|
/*!
|
|
9
9
|
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
10
|
*/
|
|
11
|
-
//# sourceMappingURL=ListConnectorActions-
|
|
11
|
+
//# sourceMappingURL=ListConnectorActions-N2IX4VWY.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
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{b as h}from"./chunk-YMXXWGRV.js";import{c as y}from"./chunk-IXZUOQPP.js";import{e as f}from"./chunk-WADQ54KB.js";import{$ as p,Ga as d}from"./chunk-CBXGTKIE.js";import{b as m}from"./chunk-RBG2H562.js";import"./chunk-PDS5FYC4.js";import"./chunk-HO6LX3K7.js";import"./chunk-Y7TZZLPW.js";import{j as o}from"./chunk-LGJ3PMWD.js";import{f as l}from"./chunk-PVAIJSAI.js";import{a as n}from"./chunk-KZIKF2VH.js";import"./chunk-MPRAPBI2.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function b(e){C(e),await e.runVerb();let s=d(),i=await e.getTenantIdAsync();if(!i)throw new m("Unable to determine tenant ID. Ensure you are logged in.");let g=await y(e,s,{jsonMode:e.isJsonMode(),telemetryNamespace:"ListConnectors"}),w=await e.getOption(o.Search.name,!0),A=await e.getOption(o.OnlyAllowed.camelName,!0),a=await p({tenantId:i,environmentId:g,actionsParams:{search:w},logger:s}),r=(A?a.filter(t=>!t.isBlocked):a).slice().sort((t,c)=>t.isBlocked!==c.isBlocked?t.isBlocked?1:-1:t.displayName.localeCompare(c.displayName));if(e.isJsonMode()){l(r);return}await h({title:"Connectors",columns:[{header:"Display Name",maxWidth:38},{header:"Connector",maxWidth:38},{header:"Policy Status"},{header:"Tabular"}],rows:r.map(t=>[t.displayName,t.name.replace(/^shared_/i,""),t.isBlocked?"Blocked":"Allowed",t.isTabular?"Yes":"No"]),emptyMessage:"No connectors found.",totalLabel:"connector(s)",hint:n.connector.list.hint})}function C(e){e.setDescription(n.connector.list.description),e.addExamples(n.connector.list.examples),e.addSwitch({flags:{key:o.OnlyAllowed.name},description:n.connector.list.options.onlyAllowed}),e.addOptions([{flags:{key:o.EnvironmentId.name,alias:o.EnvironmentId.alias},env:o.EnvironmentId.envVar,description:n.connector.list.options.environmentId,optionalInNonInteractive:!0},f({flags:{key:o.Search.name,alias:o.Search.alias},env:o.Search.envVar,message:o.Search.promptMessage,description:n.connector.list.options.search})])}export{b as listConnectorsCliAsync};
|
|
8
|
+
/*!
|
|
9
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
+
*/
|
|
11
|
+
//# sourceMappingURL=ListConnectors-YVJRDRID.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{e as g}from"./chunk-
|
|
7
|
+
import{e as g}from"./chunk-WADQ54KB.js";import{Ga as m,Ha as h,na as l}from"./chunk-CBXGTKIE.js";import{b as f}from"./chunk-RBG2H562.js";import"./chunk-PDS5FYC4.js";import"./chunk-HO6LX3K7.js";import"./chunk-Y7TZZLPW.js";import{k as t}from"./chunk-LGJ3PMWD.js";import{a as I,f as L,h as M}from"./chunk-PVAIJSAI.js";import{a as r}from"./chunk-KZIKF2VH.js";import"./chunk-MPRAPBI2.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";var D="edit",v={edit:"write",play:"read"},E=Object.keys(v);async function _(e){S(e),await e.runVerb();let s=await e.getTenantIdAsync();if(!s)throw new f("Unable to determine tenant ID. Ensure you are logged in.");let a=e.getEnvironmentId({includeConfig:!1}),p=await e.getOption(t.Permission.name,!0),w=!!p?.trim(),o;if(w){let i=U(p),d=await l({tenantId:s,environmentId:a,permission:i,logger:m()}),c=i==="write";o=d.map(n=>A(n,c))}else{let[i,d]=await Promise.all([l({tenantId:s,environmentId:a,permission:"write",logger:m()}),l({tenantId:s,environmentId:a,permission:"read",logger:m()})]),c=new Set(i.map(n=>n.id));o=[...i.map(n=>A(n,!0)),...d.filter(n=>!c.has(n.id)).map(n=>A(n,!1))]}if(e.isJsonMode()){L(o);return}let u=h().interactive,y=!u;I({title:a?`Managed Apps (environment: ${a})`:"Managed Apps",columns:[{header:"App ID",maxWidth:38},{header:"Display Name"},{header:"Last Deployed"},{header:"URL"},{header:y?"Repo":"Edit Access"}],rows:o.map(i=>[i.appId,i.displayName||"<No Name>",P(i.lastDeployedTime),i.appPlayUri??"-",y?i.cloneUrl??"-":i.hasEditAccess?"Yes":"No"]),emptyMessage:"No managed apps found.",totalLabel:"Managed app(s) found"}),u&&o.length>0&&M("Use `ms app info --app <GUID>` to get app details, including the clone URL.")}function S(e){e.setDescription(r.app.list.description),e.addExamples(r.app.list.examples),e.addOptions([g({flags:{key:t.EnvironmentId.name,alias:t.EnvironmentId.alias},env:t.EnvironmentId.envVar,message:t.EnvironmentId.promptMessage,description:r.app.list.options.environmentId}),g({flags:{key:t.Permission.name,alias:t.Permission.alias},env:t.Permission.envVar,message:t.Permission.promptMessage,description:r.app.list.options.permission})])}function U(e){let s=e?e.toLowerCase():D,a=E.find(p=>p===s);if(a)return v[a];throw new f(`Invalid --permission value '${e}'. Must be one of: ${E.join(", ")}.`)}function A(e,s=!0){return{appId:e.id,displayName:e.displayName,lastDeployedTime:e.lastDeployedTime??void 0,appPlayUri:e.appPlayUri??void 0,hasEditAccess:s,...s?{cloneUrl:e.cloneUrl??void 0}:{}}}function P(e){if(!e)return"-";let s=new Date(e);return Number.isNaN(s.getTime())?e:s.toLocaleDateString()}export{_ as listMaafAppsAsync,U as resolvePermission,A as toRow};
|
|
8
8
|
/*!
|
|
9
9
|
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
10
|
*/
|
|
11
|
-
//# sourceMappingURL=ListMaafApps-
|
|
11
|
+
//# sourceMappingURL=ListMaafApps-3DEVXWSG.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 o}from"./chunk-
|
|
7
|
+
import{a as o}from"./chunk-LGJ3PMWD.js";import{c,d as i}from"./chunk-PVAIJSAI.js";import{a as t}from"./chunk-KZIKF2VH.js";import"./chunk-MPRAPBI2.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function d(n){n.setDescription(t.auth.login.description),n.addExamples(t.auth.login.examples),n.addOption({flags:{key:o.Account.name},description:t.auth.login.options.account,optionalInNonInteractive:!0}),n.addSwitch({flags:{key:o.DeviceCode.name},description:t.auth.login.options.deviceCode}),await n.runVerb();let s=n.getAccountManager(),a=n.getAuthResourceUrl(),u=await n.getOption(o.Account.name,!0),p=!!await n.getOption(o.DeviceCode.camelName,!0),e=await s.loginInteractiveAsync(a,u,p);if(n.isJsonMode()){i({account:{username:e.username,homeAccountId:e.homeAccountId}});return}c(`Signed in as ${e.username}.`)}export{d as loginAsync};
|
|
8
8
|
/*!
|
|
9
9
|
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
10
|
*/
|
|
11
|
-
//# sourceMappingURL=Login-
|
|
11
|
+
//# sourceMappingURL=Login-CYDAY6K7.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{c as n,d as s,h as a,i,j as c}from"./chunk-PVAIJSAI.js";import{a as t}from"./chunk-
|
|
7
|
+
import{c as n,d as s,h as a,i,j as c}from"./chunk-PVAIJSAI.js";import{a as t}from"./chunk-KZIKF2VH.js";import"./chunk-MPRAPBI2.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function g(e){e.setDescription(t.auth.logout.description),e.addExamples(t.auth.logout.examples),await e.runVerb();let l=e.getAccountManager(),u=e.isJsonMode(),o;try{o=await l.clearCacheAsync()}catch(r){throw c(`Failed to log out: ${r.message}`),r}if(u){s({cleared:o});return}o?(n("Successfully logged out. All cached credentials have been cleared."),a("On next command, you will be prompted to sign in via the browser. If your browser has a single account session, it will be used automatically.")):i("No user found.")}export{g as logoutAsync};
|
|
8
8
|
/*!
|
|
9
9
|
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
10
|
*/
|
|
11
|
-
//# sourceMappingURL=Logout-
|
|
11
|
+
//# sourceMappingURL=Logout-OB4QJDAY.js.map
|