@microsoft/managed-apps-cli 0.21.0 → 0.23.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 +3 -1
- package/dist/AddConfig-GZO2UMFR.js +12 -0
- package/dist/AddConnector-HJCCENAM.js +23 -0
- package/dist/{AuthStatus-ZZIP3LBD.js → AuthStatus-WCICFN6O.js} +2 -2
- package/dist/{AuthSwitch-HK7JU2FR.js → AuthSwitch-5PKHCTM2.js} +2 -2
- package/dist/Bin.js +1 -1
- package/dist/BuildMaafApp-Q74EFM3Q.js +11 -0
- package/dist/Cli-7EVTIORX.js +54 -0
- package/dist/CloneMaafApp-EKHHLMWD.js +11 -0
- package/dist/CreateMaafApp-L3XX2UVT.js +20 -0
- package/dist/DeleteMaafApp-YCDKWFRG.js +11 -0
- package/dist/DeployMaafApp-HF67BQRZ.js +14 -0
- package/dist/{Dev-SHIA5S7X.js → Dev-BTJUJGP5.js} +2 -2
- package/dist/{EnvironmentVariableAuthenticationProvider-5YTMRAE4.js → EnvironmentVariableAuthenticationProvider-VNN4AG2E.js} +2 -2
- package/dist/GetMaafBuildStatus-7B6ZNSEA.js +11 -0
- package/dist/{GetSettings-NM6H2U5F.js → GetSettings-GJWIPK2T.js} +2 -2
- package/dist/InfoMaafApp-WGNDYYGN.js +13 -0
- package/dist/Init-TJOSV5DE.js +11 -0
- package/dist/ListConnectorActions-HTD6YSCY.js +11 -0
- package/dist/ListConnectors-OET7STMW.js +11 -0
- package/dist/{ListMaafApps-RT3PGZSJ.js → ListMaafApps-KRXJMAEU.js} +2 -2
- package/dist/{Login-HG5S7LBC.js → Login-5TFNB24B.js} +2 -2
- package/dist/{Logout-BUPHLOAH.js → Logout-35U4J627.js} +2 -2
- package/dist/{MockFetch-4CYTSNJ7.js → MockFetch-XSZECQYX.js} +2 -2
- package/dist/{NodeMsalAuthenticationProvider-HTH3V3G2.js → NodeMsalAuthenticationProvider-OUL57BVL.js} +2 -2
- package/dist/Pack-S7P4MIT6.js +8 -0
- package/dist/PlayMaafApp-D4KLJKLT.js +12 -0
- package/dist/RefreshDataSource-N5CEH23S.js +11 -0
- package/dist/{RefreshGitAuth-5A3SX2HC.js → RefreshGitAuth-2VL6VBLU.js} +2 -2
- package/dist/{RemoveDataSource-57JJLK5I.js → RemoveDataSource-XR5Q4O3F.js} +2 -2
- package/dist/{ServicePrincipalAuthenticationProvider-SVKDZG6X.js → ServicePrincipalAuthenticationProvider-H3PTPXYY.js} +2 -2
- package/dist/{SetSetting-RB3F7IXG.js → SetSetting-HXY4YSKC.js} +2 -2
- package/dist/{ShareLinkCreate-7BCDPWY6.js → ShareLinkCreate-YG3DACP2.js} +2 -2
- package/dist/{ShareLinkList-4BI3WMNN.js → ShareLinkList-XF6BIB3M.js} +2 -2
- package/dist/ShareLinkRevoke-4USAQKLB.js +11 -0
- package/dist/ShareList-6QI7ZAMZ.js +11 -0
- package/dist/{ShareMaafApp-QFRXLYUD.js → ShareMaafApp-PZI5MCBA.js} +2 -2
- package/dist/{TelemetrySettings-A474HALH.js → TelemetrySettings-WWVPRF7T.js} +2 -2
- package/dist/{UnshareMaafApp-423RNXCN.js → UnshareMaafApp-MHBIV5OR.js} +2 -2
- package/dist/chunk-2FNWZUPW.js +15 -0
- package/dist/chunk-2HSJ2XAQ.js +13 -0
- package/dist/{chunk-U36HMOQW.js → chunk-3FP37TPE.js} +10 -10
- package/dist/chunk-5XRK3F43.js +11 -0
- package/dist/{chunk-EV3TTTOT.js → chunk-7PH2NK5K.js} +2 -2
- package/dist/chunk-DAG6RPOF.js +11 -0
- package/dist/{chunk-5AUOEXAR.js → chunk-DD7E4ADI.js} +2 -2
- package/dist/chunk-F3HGM3IU.js +106 -0
- package/dist/chunk-FMJDKXNM.js +12 -0
- package/dist/chunk-HCPTQP7J.js +11 -0
- package/dist/chunk-I22E6YZT.js +11 -0
- package/dist/chunk-LDP2SHPJ.js +11 -0
- package/dist/{chunk-3BRAT6NP.js → chunk-PKDXP7CL.js} +2 -2
- package/dist/chunk-SBVJ4SMO.js +20 -0
- package/dist/chunk-SCJXITCN.js +12 -0
- package/dist/chunk-TZRZFNLH.js +38 -0
- package/dist/{chunk-G33Q5FWT.js → chunk-UIW77LMA.js} +234 -234
- package/dist/chunk-WQKDXHGX.js +11 -0
- package/dist/{chunk-MFPX2RFH.js → chunk-X5O77GZS.js} +2 -2
- package/dist/{chunk-7NXJAIJX.js → chunk-Y7TZZLPW.js} +2 -2
- package/dist/chunk-ZIONKKAV.js +44 -0
- package/package.json +4 -4
- package/dist/AddConnector-4AMM746J.js +0 -41
- package/dist/BuildMaafApp-MOTZOLJZ.js +0 -11
- package/dist/Cli-6CCXMCPX.js +0 -54
- package/dist/CreateMaafApp-TUO72CW7.js +0 -20
- package/dist/DeleteMaafApp-MZVGIAX3.js +0 -11
- package/dist/DeployMaafApp-KXATM3E3.js +0 -14
- package/dist/GetMaafApp-ELB5KMHW.js +0 -11
- package/dist/GetMaafBuildStatus-3W7LI5TJ.js +0 -11
- package/dist/Init-CH5DUQWA.js +0 -11
- package/dist/ListConnectorActions-7SIFGPYR.js +0 -11
- package/dist/ListConnectors-TRKIWRVQ.js +0 -11
- package/dist/Pack-AHKC2MYF.js +0 -8
- package/dist/PlayMaafApp-LWKJU2IN.js +0 -12
- package/dist/RefreshDataSource-ZFZJXJ5L.js +0 -11
- package/dist/ShareLinkRevoke-EEJVCRCY.js +0 -11
- package/dist/ShareList-LJDAEGI3.js +0 -11
- package/dist/ShowMaafApp-3KK6NUG2.js +0 -11
- package/dist/chunk-6FFQN2SO.js +0 -13
- package/dist/chunk-6MXOK2LG.js +0 -11
- package/dist/chunk-DREO7EYO.js +0 -20
- package/dist/chunk-NP2KJOYC.js +0 -12
- package/dist/chunk-QAFCXGBD.js +0 -11
- package/dist/chunk-QSB5P4RM.js +0 -38
- package/dist/chunk-S5HEU7XK.js +0 -11
- package/dist/chunk-UBTSW22U.js +0 -11
- package/dist/chunk-VFSTQAZ2.js +0 -12
- package/dist/chunk-VNEZZ3RI.js +0 -11
- package/dist/chunk-W7EWOZPO.js +0 -104
- package/dist/chunk-YIKNM523.js +0 -15
|
@@ -1,20 +0,0 @@
|
|
|
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 ue}from"./chunk-OL6CTXQR.js";import{a as ae,b as pe,d as ce}from"./chunk-VFSTQAZ2.js";import{a as oe,b as se}from"./chunk-YIKNM523.js";import{a as ke}from"./chunk-TYRVM4PP.js";import{a as re}from"./chunk-3BRAT6NP.js";import"./chunk-UBTSW22U.js";import"./chunk-MFPX2RFH.js";import{a as d,e as F}from"./chunk-DREO7EYO.js";import{e as T,i as ie}from"./chunk-5AUOEXAR.js";import{Z as ee,d as K,f as Q,q as X,ua as te,va as ne}from"./chunk-G33Q5FWT.js";import{a as I,b as p,c as U,d as E,e as Z}from"./chunk-RBG2H562.js";import"./chunk-S5HEU7XK.js";import{a as _}from"./chunk-EV3TTTOT.js";import"./chunk-7NXJAIJX.js";import{k as i}from"./chunk-6MXOK2LG.js";import{c as Y,d as J,e as z,h as v,i as V}from"./chunk-PVAIJSAI.js";import{a as g}from"./chunk-VNEZZ3RI.js";import{a as q,g as W}from"./chunk-U36HMOQW.js";import"./chunk-Y5AMO72S.js";import{d as Te}from"./chunk-UT667QSU.js";import*as l from"fs";import*as he from"os";import*as x from"path";import*as w from"fs";import*as le from"os";import*as k from"path";function G(e){if(!e)throw new p("Template source is empty. Use --template to specify one.");if(/^https?:\/\//i.test(e)){let c;try{c=new URL(e)}catch{throw new p(`Template source '${e}' is not a valid URL.`)}if(c.hostname.toLowerCase()!=="github.com")throw new p(`Template source '${e}' uses host '${c.hostname}'; only github.com URLs are supported.`);let S=c.pathname.split("/").filter(Boolean);if(S.length<2)throw new p(`Template source '${e}' is missing the owner/repo path. Use 'https://github.com/<owner>/<repo>'.`);let[y,R,...f]=S,$=R.endsWith(".git")?R.slice(0,-4):R,O=c.hash?c.hash.slice(1):void 0;if(f.length===0)return{owner:y,repo:$,subdir:"",ref:O};if(f[0].toLowerCase()==="tree"&&f.length>=2)return{owner:y,repo:$,subdir:f.slice(2).join("/"),ref:O??f[1]};throw f[0].toLowerCase()==="blob"?new p(`Template source '${e}' points at a file ('/blob/...'). Templates must be a directory \u2014 use the '/tree/<branch>/<subdir>' URL form instead.`):new p(`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 c=t[1].toLowerCase();if(c!=="github"&&c!=="gh")throw new p(`Template source '${e}' uses unsupported provider prefix '${t[1]}:'. Only 'github:' (or 'gh:' shorthand) templates are supported.`)}let n=e.replace(/^(?:github|gh):/i,""),[r,s]=n.split("#",2),o=r.split("/").filter(Boolean);if(o.length<2)throw new p(`Template source '${e}' is missing the owner/repo path. Expected 'github:<owner>/<repo>[/<subdir>]'.`);let[h,A,...a]=o;return{owner:h,repo:A,subdir:a.join("/"),ref:s||void 0}}function de(e,t){let n=G(e),r=`https://github.com/${n.owner}/${n.repo}.git`,s=w.mkdtempSync(k.join(le.tmpdir(),"ms-template-"));try{let o=["clone","--depth=1","--filter=blob:none"];n.subdir&&o.push("--sparse"),n.ref&&o.push("--branch",n.ref),o.push(r,s),d(o,{network:!0}),n.subdir&&d(["-C",s,"sparse-checkout","set",n.subdir]);let h=n.subdir?k.join(s,n.subdir):s;if(!w.existsSync(h))throw new p(`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(h,t.dir,{recursive:!0,force:!0,filter:A=>k.basename(A)!==".git"})}finally{w.rmSync(s,{recursive:!0,force:!0})}}var M=Te(ke(),1);function fe(){let e=d(["--version"],{captureStdout:!0,allowFailure:!0,emitStderr:!1});if(!e.success)throw new E("'git' is required but was not found on PATH.");let t=e.stdout,n=_.engines.git;if(!M.default.validRange(n))return;let r=M.default.coerce(t);if(r&&!M.default.satisfies(r,n))throw new E(`Git ${n} is required (found ${r.version}). Please upgrade git.`)}var Oe="github:microsoft/Managed-Apps/templates/vite8",H="Initial scaffold from 'ms app create'";async function Et(e){Ye(e),await e.runVerb();let t=await e.getTenantIdAsync();if(!t)throw new p("Unable to determine tenant ID. Ensure you are logged in.");let n=te(),{region:r}=X(),s=await e.getOption("displayName");if(!s)throw new p("Argument displayName is required. Use --display-name or -n to specify it.");let o=e.getPositionalArg(0)??process.cwd(),h=await e.getOption("template",!0),A=await e.getOption("repo",!0),{repoType:a,remoteUrl:c}=ce(A),S=await e.getOption("repositoryId",!0),y=e.isJsonMode();if(!y){let u=W(r),b=u?`cloud ${u}`:`region ${r}`;v(`About to create app '${s}' in tenant ${t} (${b}).`)}let R=!y&&process.stdout.isTTY;!y&&!R&&v("Running preflight checks...");let f=R?new ue:null;f?.start("Running preflight checks...");try{if(a==="none"&&S)throw new p("'--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.");f?.update("Validating template source..."),_e(h),f?.update("Checking git installation..."),fe(),f?.update("Verifying target directory is writable..."),We(o),a==="github"?(f?.update("Verifying target directory is empty..."),ge(o),f?.update(`Verifying ${c} is empty...`),qe(c)):(f?.update("Verifying target directory is empty..."),me(o))}finally{f?.stop()}let $=await ie(e,{failIfMissing:!1}),O=$?void 0:oe(e,t,n,"CreateMaafApp"),ve=await e.getOption("description",!0),Ee=await e.getOption("buildPath",!0),Re=await e.getOption("buildCommand",!0),Ae=await e.getOption("buildEntryPoint",!0),L=await se($,O);e.updateEnvironmentId(L),a==="github"?ge(o):me(o);let Se=await e.getOption(i.OpenBrowser.camelName,!0)??!1,$e=await e.getOption(i.ForceReauth.camelName,!0)??!1;y&&a==="github"&&z({phase:"create-validation"});let Ce={displayName:s,description:ve,repositoryId:S,remoteUrl:c,repoType:a,origin:ne().origin},Ie=({isRetry:u})=>ee({tenantId:t,environmentId:L,logger:n,actionsParams:{...Ce,...$e&&!u&&{forceReauth:!0}}}),j;try{j=await re(Ie,{repoType:a,externalRepoUrl:c,tenantId:t,jsonMode:y,openBrowser:Se,verb:"app create"})}catch(u){let b=je(u,{repoType:a,environmentId:L});throw b||u}let{app:m,cloneUrl:C}=j;if(a==="native"&&!C){let u=P(m.id,m.environmentId);throw new I(`App '${m.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
|
-
`+u)}let B=null;try{if(a==="github"){if(Pe({directory:o,repoUrl:c}),l.readdirSync(o).filter(N=>N!==".git").length>0)throw new p(`Repository ${c} 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
|
-
|
|
10
|
-
`+P(m.id,m.environmentId))}else a==="native"?F({directory:o,gitUrl:C,loginAuthority:e.getLoginAuthority(t),authResource:e.getAuthResourceUrl()}):l.mkdirSync(o,{recursive:!0});y||v(`Fetching template '${h}' into ${o}...`),de(h,{dir:o}),await pe(o,y,e.getHttpClient());let u=ae({appId:m.id,appDisplayName:m.displayName,description:m.description,environmentId:m.environmentId,repoType:a,cloud:e.getCloud(),buildPath:Ee,buildCommand:Re,buildEntryPoint:Ae,repositoryId:a==="native"?m.repositoryId:void 0,externalRepoUrl:a==="github"?c:void 0});await K(x.join(o,q),u),a!=="none"&&(B=await Ne(o,y,a==="native"?C:void 0))}catch(u){if(u instanceof p&&a!=="native")throw u;let b=u instanceof Error?u.message:String(u),N=`App '${m.displayName}' was created, but local setup failed: ${b}
|
|
11
|
-
The local directory ${o} may contain partial files; remove them or choose a new directory before retrying.
|
|
12
|
-
`+P(m.id,m.environmentId);throw u instanceof I?(u.message=N,u):new I(N)}y?J({appId:m.id,repoType:a,...a==="github"&&c&&{externalRepoUrl:c},...a==="native"&&C&&{gitRemoteUrl:C},appDir:o,...B&&{push:B}}):(Y(`Created app '${m.displayName}' in ${o}.`),a==="github"?v(`Bound to external repository: ${c}.`):a==="none"&&v("Your app has been created. Run `git init` (or your VCS of choice) when ready; subsequent `ms app deploy` calls do not require a git remote."))}async function Ne(e,t,n){let r=n?void 0:`git add . && git commit -m "${H}" && git push -u origin HEAD`;try{return d(["add","."],{cwd:e}),d(["commit","-m",H],{cwd:e}),n&&Me(e,n,t),d(["push","-u","origin","HEAD"],{cwd:e,network:!0,classify:n?{action:`pushing to ${D(n)}`}:void 0}),{success:!0}}catch(s){let o=s instanceof Error?{name:s.name,message:s.message,stack:s.stack}:typeof s=="object"&&s!==null?{...s}:{message:String(s)};if(!t){s instanceof I&&V(s.message);let h=r?`To finish wiring it up, run:
|
|
13
|
-
${r}`:`Resolve the git issue above, then finish the initial push from ${e}.`;V("Could not commit and push the initial scaffold. Your app and local scaffold are ready. "+h)}return{success:!1,error:o,retryCommand:r}}}function Me(e,t,n){He(t,n,"the initial git fetch and push"),Le(e,t),d(["rev-parse","--verify","origin/main"],{cwd:e,allowFailure:!0,emitStderr:!1}).success&&(d(["reset","--soft","origin/main"],{cwd:e}),d(["commit","-m",H],{cwd:e}))}function Le(e,t){d(["fetch","origin"],{cwd:e,network:!0,allowFailure:!0,emitStderr:!1}).success||d(["fetch","origin"],{cwd:e,network:!0,classify:{action:`fetching from ${D(t)}`}})}var Be=["repository not found","fatal: repository","could not read username","terminal prompts disabled","authentication failed","permission denied","403","remote: not found"];function Ve(e){let t=e.stderr;return typeof t=="string"?t:Buffer.isBuffer(t)?t.toString():t instanceof Uint8Array?Buffer.from(t).toString():""}function ye(e,t){let n=e instanceof Error?e.message:String(e),r=t.trim();return!r||n.includes(r)?n:`${n}
|
|
14
|
-
${r}`}function we(e){let t=e.toLowerCase();return Be.some(n=>t.includes(n))}function be(){return"Make sure the repository exists and that you have access to it."}function Ue({directory:e,repoUrl:t}){return`Failed to clone '${t}' into '${e}'. `+be()}function Fe(e){return`Cannot access repository '${e}', so no app was created. `+be()}function Ge({directory:e,repoUrl:t}){return`Failed to clone '${t}' into '${e}'. See the git output above for details.`}function Pe({directory:e,repoUrl:t}){try{d(["clone",t,e],{emitStderr:!1})}catch(n){let r=Ve(n);r&&process.stderr.write(r);let s=we(r)?Ue({directory:e,repoUrl:t}):Ge({directory:e,repoUrl:t});throw new E(s,{underlyingError:ye(n,r)})}}function D(e){try{return new URL(e).host}catch{return e}}function He(e,t,n){t||v(`Authenticating to ${D(e)} for ${n}. A browser window may open. Sign in with the account associated with this tenant.`)}function P(e,t){return`The server app is still in environment ${t} (id: ${e}).
|
|
15
|
-
If you want to clean it up before retrying, run the following command:
|
|
16
|
-
${"ms"} app delete --app ${e} --environment-id ${t} --force`}function De(e){if(e.body)try{let t=JSON.parse(e.body);if(typeof t?.error?.message=="string"&&t.error.message.trim())return t.error.message}catch{}}function je(e,t){if(!(e instanceof Q))return null;let{environmentId:n}=t,r=De(e),s=t.repoType==="native",o="Ask an admin to grant you the required permission in this environment.";if(e.status===401)return new U(r??"Your sign-in session has expired or is invalid. Run `ms auth login` and try again.");if(e.status===403){let h=r??(s?`You do not have permission to create repositories in environment ${n}.`:`You do not have permission to create an app in environment ${n}.`);return new U(`${h} ${o}`)}return e.status===404?new p(r??`Environment ${n} was not found. Verify the environment id and that you have access to it.`):e.status===409?new p(r??`An app with the same name already exists in environment ${n}. Choose a different name.`):e.status===429||e.status===503?new Z(r??"The service is temporarily unavailable or rate-limited. Wait a moment and try again."):null}function _e(e){G(e)}function me(e){if(!l.existsSync(e))return;if(l.readdirSync(e).length>0)throw new p(`'${e}' is not empty. Specify an empty directory as the first argument, or run 'ms app init' to bind an existing project to a new app.`)}function ge(e){if(!l.existsSync(e))return;if(l.readdirSync(e).length>0)throw new p(`'${e}' is not empty. --repo requires an empty target directory; specify an empty directory as the first argument, move to one before running, or run 'ms app init' to bind an existing project to a new app.`)}function qe(e){let t;try{t=l.mkdtempSync(x.join(he.tmpdir(),"ms-app-create-probe-"))}catch{return}try{let n=d(["clone","--depth=1","--filter=blob:none","--no-checkout",e,t],{allowFailure:!0,emitStderr:!1});if(!n.success){let o=n.stderr;if(we(o))throw new E(Fe(e),{underlyingError:ye(n.error,o)});return}let r=d(["-C",t,"ls-tree","-r","HEAD"],{captureStdout:!0,allowFailure:!0,emitStderr:!1});if(!r.success)return;if(r.stdout.trim().length>0)throw new p(`Repository ${e} is not empty (must contain no tracked 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.`)}finally{try{l.rmSync(t,{recursive:!0,force:!0})}catch{}}}function We(e){let t=e;for(;!l.existsSync(t);){let n=x.dirname(t);if(n===t)break;t=n}try{l.accessSync(t,l.constants.W_OK)}catch{throw new E(`'${e}' is not writable. Choose a different directory or fix the permissions and retry.`)}}function Ye(e){e.setDescription(g.app.create.description),e.addExamples(g.app.create.examples),e.consumePositionalArg("[directory]"),e.addOptions([{flags:{key:i.EnvironmentId.name,alias:i.EnvironmentId.alias},env:i.EnvironmentId.envVar,description:g.app.create.options.environmentId,optionalInNonInteractive:!0},T({flags:{key:i.DisplayName.name,alias:i.DisplayName.alias},env:i.DisplayName.envVar,message:i.DisplayName.promptMessage,description:g.app.create.options.displayName}),{flags:{key:i.Description.name,alias:i.Description.alias},env:i.Description.envVar,description:g.app.create.options.description,optionalInNonInteractive:!0},{flags:{key:i.RepositoryId.name,alias:i.RepositoryId.alias},env:i.RepositoryId.envVar,description:g.app.create.options.repositoryId,optionalInNonInteractive:!0},{flags:{key:i.Template.name,alias:i.Template.alias},env:i.Template.envVar,default:Oe,description:g.app.create.options.template,optionalInNonInteractive:!0},{flags:{key:i.Repo.name},env:i.Repo.envVar,description:g.app.create.options.repo,optionalInNonInteractive:!0},T({flags:{key:i.BuildPath.name,alias:i.BuildPath.alias},env:i.BuildPath.envVar,message:i.BuildPath.promptMessage,initialValue:i.BuildPath.initialValue,default:"./dist",description:g.app.create.options.buildPath}),T({flags:{key:i.BuildCommand.name,alias:i.BuildCommand.alias},env:i.BuildCommand.envVar,message:i.BuildCommand.promptMessage,initialValue:i.BuildCommand.initialValue,default:"npm run build",description:g.app.create.options.buildCommand}),T({flags:{key:i.BuildEntryPoint.name},env:i.BuildEntryPoint.envVar,message:i.BuildEntryPoint.promptMessage,initialValue:i.BuildEntryPoint.initialValue,default:"index.html",description:g.app.create.options.buildEntryPoint})]),e.addSwitch({flags:{key:i.OpenBrowser.name},description:g.app.create.options.openBrowser}),e.addSwitch({flags:{key:i.ForceReauth.name},description:g.app.create.options.forceReauth})}export{P as buildOrphanedAppRecoveryHint,Pe as cloneRepo,Ne as commitAndPushScaffoldAsync,Et as createMaafAppAsync,qe as ensureExternalRepoIsEmpty,ge as ensureRepoTargetDirectoryEmpty,me as ensureTargetDirectoryEmpty,We as ensureTargetDirectoryWritable,_e as ensureTemplateSourceValid,F as initLocalRepo};
|
|
17
|
-
/*!
|
|
18
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
19
|
-
*/
|
|
20
|
-
//# sourceMappingURL=CreateMaafApp-TUO72CW7.js.map
|
|
@@ -1,11 +0,0 @@
|
|
|
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 g,h as v}from"./chunk-5AUOEXAR.js";import{_ as m,ua as l,va as f}from"./chunk-G33Q5FWT.js";import{b as c}from"./chunk-RBG2H562.js";import"./chunk-S5HEU7XK.js";import"./chunk-EV3TTTOT.js";import"./chunk-7NXJAIJX.js";import{q as o}from"./chunk-6MXOK2LG.js";import{c as s,d,i as p}from"./chunk-PVAIJSAI.js";import{a as t}from"./chunk-VNEZZ3RI.js";import"./chunk-U36HMOQW.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
|
-
/*!
|
|
9
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
-
*/
|
|
11
|
-
//# sourceMappingURL=DeleteMaafApp-MZVGIAX3.js.map
|
|
@@ -1,14 +0,0 @@
|
|
|
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 q}from"./chunk-QAFCXGBD.js";import{a as it,b as W,c as j}from"./chunk-W7EWOZPO.js";import"./chunk-HBLO3WDD.js";import"./chunk-OL6CTXQR.js";import{a as J}from"./chunk-3BRAT6NP.js";import"./chunk-UBTSW22U.js";import"./chunk-MFPX2RFH.js";import{b as H,g as V}from"./chunk-DREO7EYO.js";import{b as T,h as G}from"./chunk-5AUOEXAR.js";import{$ as _,X as L,f as O,fa as P,ua as R,va as I}from"./chunk-G33Q5FWT.js";import{a as p,b as o,d as C,g as B}from"./chunk-RBG2H562.js";import"./chunk-S5HEU7XK.js";import"./chunk-EV3TTTOT.js";import{a as z}from"./chunk-7NXJAIJX.js";import{p as l}from"./chunk-6MXOK2LG.js";import{c as k,d as U,e as x,h as m,i as N}from"./chunk-PVAIJSAI.js";import{a as g}from"./chunk-VNEZZ3RI.js";import{a as A}from"./chunk-U36HMOQW.js";import"./chunk-Y5AMO72S.js";import{d as et}from"./chunk-UT667QSU.js";import{promises as K}from"node:fs";import*as S from"node:path";import{promises as Y}from"node:fs";var X=et(it(),1);function ot(t){return t?.code==="ENOENT"?"continue":t instanceof Error?t:new Error(String(t))}function nt(t){return`zipBuildArtifact: skipping missing entry: ${t?.path??"<unknown>"}`}async function Z(t,e,r){let i=await Y.stat(t).catch(()=>null);if(!i)throw new o(`buildPath not found: ${t}`);if(!i.isDirectory())throw new o(`buildPath is not a directory: ${t}`);let a=await Y.stat(e).catch(()=>null);if(!a||!a.isFile())throw new o(`appConfigPath does not point to a file: ${e}`);let s=r?.maxBytes;return new Promise((h,c)=>{let w=[],u=0,y=!1,n=(0,X.default)("zip",{zlib:{level:9}});n.on("data",d=>{if(!y){if(u+=d.length,s!==void 0&&u>s){y=!0,n.abort(),c(new B({capBytes:s,bytes:u}));return}w.push(d)}}),n.on("warning",d=>{if(y)return;let v=ot(d);if(v==="continue"){N(nt(d));return}c(v)}),n.on("error",d=>{y||c(d)}),n.on("end",()=>{y||h(Buffer.concat(w))}),n.directory(t,!1),n.file(e,{name:A}),n.finalize()})}var at=1200*1e3,rt=6e4,st=2e3,Q=`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 $(t){return`${(t/(1024*1024)).toFixed(1)} MB`}function F(t,e){return t!==void 0?`Build artifact is ${$(t)}, which exceeds the ${$(e)} limit.`:`Build artifact exceeds the ${$(e)} limit.`}function pt(t){let e=t.id||t.name;if(!e)throw new p("Deploy succeeded but the server response did not include an app identifier.");return{appId:e,displayName:t.displayName,commitHash:t.commitHash??null,appPlayUri:t.appPlayUri??null}}function tt(t){return{appId:t.appId,displayName:t.name,commitHash:t.commitSha,appPlayUri:t.appPlayUri}}function b(t){if(t.body)try{let e=JSON.parse(t.body);if(typeof e?.error?.message=="string")return e.error.message}catch{}}function lt(t,e){if(t instanceof B)return new o(F(t.bytes,t.capBytes));if(!(t instanceof O))return null;let r=e.repoType!=="none";if(t.status===400&&t.code==="ArtifactNotAllowedForGitRepo"){let i=b(t);return new p(i?`Artifact upload rejected for this git-backed app: ${i}`:`The server reports this app is git-backed; --artifact uploads are not allowed. Update \`${A}\` so \`repoType\` matches the server's record, then re-run with --commit.`)}if(t.status===400&&t.code==="CommitNotAllowedForArtifactDeploy")return new o("This app uses external artifact deployment. Pass --artifact <path> instead of --commit.");if(t.status===400&&t.code==="InvalidRequestContent")return new o("Invalid deploy request \u2014 verify the environment and app id.");if(t.status===400&&t.code==="ServicePrincipalNotSupportedForMaafOperations")return new o("Service principal callers are not supported for `ms app deploy`. Use interactive auth.");if(t.status===400&&t.code==="BadRequest"){let i=b(t);return r?new o(i??"Invalid commit ID. Use a 40-character lowercase hex value."):new o(`Build artifact rejected: ${i??t.message}`)}if(t.status===400&&t.code==="BuildNotAvailable")return new p("No completed build is available for this commit. Run `ms app build` first, or wait for the build to complete before retrying.");if(t.status===403&&t.code==="ExternalArtifactDeploymentDisabled")return new p(Q);if(t.status===403&&t.code==="InsufficientPrivilege"){let i=b(t);return new p(i?`${i} 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(t.status===403&&t.code==="CodeAppOperationNotAllowedInEnvironment")return new p(Q);if(t.status===403&&t.code==="Forbidden")return new p("You don't have permission to deploy this app. Ask an admin to grant you Contributor on the repo.");if(t.status===404&&t.code==="CommitNotFound"){let i=b(t);return new o(i??"Commit not found on main.")}if(t.status===404&&t.code==="ApplicationNotFound")return new o(`App '${e.appName}' not found in environment ${e.environmentId}.`);if(t.status===404&&t.code==="PowerConfigNotFound")return new p(`Build output is missing the app config (\`${A}\`). Ensure the config is present at the root of the build output and re-run the build.`);if(t.status===404&&t.code==="OperationNotFound")return new p("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(t.status===409&&t.code==="BuildInProgress")return new p("A build is currently in progress for this app. Run `ms app build-status` to check progress, then retry the deploy.");if(t.status===409&&t.code==="NoGreenBuildAvailable")return new p("No successful build is available to deploy. Push a commit and wait for the build to succeed before retrying.");if(t.status===409&&t.code==="RepoTypeMismatch"){let i=b(t);return new o(i?`Repo type mismatch: ${i}`:"The app's repoType in ms.config.json doesn't match the server's record. Update ms.config.json to match.")}if(t.status===413)return new p(F(void 0,524288e3));if(t.status===422&&t.code==="ArtifactInvalid"){let i=b(t)??t.message;return new o(`Artifact validation failed: ${i}`)}return t.status===502&&t.code==="MaafBuildServiceUnavailable"?new p("Build service is temporarily unavailable. Try again."):t.status===503&&t.code==="AuthorizationCheckFailed"?new p("Authorization service is temporarily unavailable. Try again."):null}async function ct(t){let{provider:e,appName:r,force:i,forceReauth:a}=t,s=t.commitFromFlag,h,c=!1;if(!s){let n=H();if(!n)throw new o("Could not determine the latest commit ID. Use --commit or -c to specify it.");s=n.commitSha,h=n.detached?void 0:n.branch,c=!0}if(c&&!e.isJsonMode()&&m(h?`Using branch '${h}' at commit ${s}.`:`Detached HEAD at commit ${s}.`),!i){let n=mt();if(n&&I().interactive&&!e.isJsonMode()){if(N(n),!await T({message:"Deploy anyway?",initialValue:!1}))return m("Deploy cancelled."),null}else if(n)throw new o(`${n} Run again with --force to deploy anyway.`)}let w=R(),u=await L({logger:w,actionsParams:{appName:r,commitSha:s,...a&&{forceReauth:!0}}});if(u===null)e.isJsonMode()||m(`A cached build exists for commit ${s}; deploying it.`);else{e.isJsonMode()||m("Build queued; waiting for completion...");let n=await q({appName:r,commitSha:s,initialWaitMs:u.retryAfterMs??st,isJsonMode:e.isJsonMode(),deadlineMs:at,maxIntervalMs:rt,spinnerLabel:"Waiting for build..."});if(n.status!=="Succeeded")throw new p(`Unexpected terminal build status "${n.status}". Commit ID: ${s}.`)}let y=await _({logger:w,actionsParams:{appName:r,commitSha:s,...a&&{forceReauth:!0}}});return pt(y)}async function ut(t){let e=S.resolve(t.artifactPath);if(S.extname(e).toLowerCase()!==".zip")throw new o(`--artifact must point to a .zip file. Received: ${t.artifactPath}`);let r=await K.stat(e).catch(()=>null);if(!r||!r.isFile())throw new o(`--artifact file not found or not a regular file: ${t.artifactPath}`);if(r.size>524288e3)throw new o(F(r.size,524288e3));let i=await K.readFile(e);t.provider.isJsonMode()||m("Uploading artifact and deploying...");let a=await P({logger:R(),actionsParams:{appName:t.appName,zipBuffer:i}});return tt(a)}async function ft(t){if(W(t.appConfig),!(t.provider.isJsonMode()||!I().interactive)&&!await T({message:`This will build the app and deploy the resulting artifact to environment ${t.environmentId}. Continue?`,initialValue:!1}))return m("Aborted."),null;let{packAppOutputDir:r}=await j({quiet:t.provider.isJsonMode()}),i=await Z(r,t.appConfigPath,{maxBytes:524288e3});t.provider.isJsonMode()||m("Uploading build artifact and deploying...");let a=await P({logger:R(),actionsParams:{appName:t.appName,zipBuffer:i}});return tt(a)}async function xt(t){dt(t),await t.runVerb(),t.isManagedDevOpsDeployEnabled()&&process.stderr.write(`[debug] ${z("MAAF_DEPLOY_VIA_MANAGED_DEVOPS")} is set; deploying via the '/manageddevops' route.
|
|
10
|
-
`);let{appConfig:e,fileConfig:r}=I();if(!e)throw new C(`${A} is required. Run this command from a directory created by \`ms app create\`.`);if(!r?.appConfigPath)throw new C(`${A} path is unavailable.`);let i=t.getEnvironmentId();if(!i)throw new o(`No environment ID found. Run this command from a directory with a ${A} (created by \`ms app create\`).`);let a=e.repoType??"native",s=e.externalRepoUrl,h=await t.getOption("commit",!0),c=await t.getOption("artifact",!0);if(h&&c)throw new o("Pass either --commit or --artifact, not both. --commit triggers a build for the commit; --artifact deploys a pre-built zip.");if(a==="none"&&h)throw new o("This app uses external artifact deployment. Pass --artifact <path> instead of --commit.");if(c&&a!=="none")throw new o(`--artifact is only valid for apps created with \`repoType: 'none'\`. This app's repoType is \`${a}\`; deploy via \`--commit\` (or omit it to use the current HEAD).`);let w=await t.getTenantIdAsync();if(!w)throw new o("Unable to determine tenant ID. Ensure you are logged in.");let u=await G(t),y=await t.getOption(l.OpenBrowser.camelName,!0)??!1,n=await t.getOption(l.ForceReauth.camelName,!0)??!1,d=await t.getOption(l.Force.name,!0)??!1,v=t.isJsonMode();v&&a==="github"&&x({phase:"deploy-validation"});let f;try{c?f=await ut({provider:t,appName:u,artifactPath:c}):a==="native"||a==="github"?f=await J(({isRetry:D})=>ct({provider:t,appName:u,commitFromFlag:h,force:d,forceReauth:n&&!D&&a==="github"}),{repoType:a,externalRepoUrl:s,tenantId:w,jsonMode:v,openBrowser:y,verb:"app deploy"}):f=await ft({provider:t,appName:u,appConfig:e,appConfigPath:r.appConfigPath,environmentId:i})}catch(M){let D=lt(M,{repoType:a,appName:u,environmentId:i});throw D||M}f!==null&&(v?U({...f,repoType:a}):(k(`Deployed app '${f.displayName}' (${f.appId}).`),f.commitHash&&m(`Commit: ${f.commitHash}`),f.appPlayUri&&m(`Play URL: ${f.appPlayUri}`)))}function dt(t){t.setDescription(g.app.deploy.description),t.addExamples(g.app.deploy.examples),t.addOptions([{flags:{key:l.AppName.name},env:l.AppName.envVar,description:g.app.deploy.options.app,optionalInNonInteractive:!0},{flags:{key:l.CommitSha.name,alias:l.CommitSha.alias},env:l.CommitSha.envVar,description:g.app.deploy.options.commit,optionalInNonInteractive:!0},{flags:{key:l.Artifact.name},env:l.Artifact.envVar,description:g.app.deploy.options.artifact,optionalInNonInteractive:!0}]),t.addSwitch({flags:{key:l.OpenBrowser.name},description:g.app.deploy.options.openBrowser}),t.addSwitch({flags:{key:l.Force.name},description:g.app.deploy.options.force}),t.addSwitch({flags:{key:l.ForceReauth.name},description:g.app.deploy.options.forceReauth})}function mt(){let t=V(),e=[];return t.hasUncommittedChanges===!0&&e.push("There are uncommitted changes in the working tree."),t.isMainAheadOfOrigin===!0&&e.push("Local 'main' is ahead of 'origin/main'. Push the local commits before deploying."),e.length>0?e.join(" "):null}export{xt as deployMaafAppAsync};
|
|
11
|
-
/*!
|
|
12
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
13
|
-
*/
|
|
14
|
-
//# sourceMappingURL=DeployMaafApp-KXATM3E3.js.map
|
|
@@ -1,11 +0,0 @@
|
|
|
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 y}from"./chunk-USRRI5H4.js";import{h as d,i as I}from"./chunk-5AUOEXAR.js";import{ba as l,ua as f}from"./chunk-G33Q5FWT.js";import{b as c}from"./chunk-RBG2H562.js";import"./chunk-S5HEU7XK.js";import"./chunk-EV3TTTOT.js";import"./chunk-7NXJAIJX.js";import{l as i}from"./chunk-6MXOK2LG.js";import{c as s,d as m,h as p}from"./chunk-PVAIJSAI.js";import{a as t}from"./chunk-VNEZZ3RI.js";import"./chunk-U36HMOQW.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function M(n){g(n),await n.runVerb();let v=await I(n,{failIfMissing:!1}),a=await n.getTenantIdAsync();if(!a)throw new c("Unable to determine tenant ID. Ensure you are logged in.");let A=await d(n),e=await l({tenantId:a,environmentId:v,logger:f(),actionsParams:{appName:A}}),r=e.description,o=y(e);n.isJsonMode()?m({appId:e.id,displayName:e.displayName,description:r,environmentId:e.environmentId,...o&&{repoType:o.repoType,cloneUrl:o.cloneUrl}}):(s(`App '${e.displayName}' (${e.id}).`),r&&p(`Description: ${r}`),o?.repoType&&p(`Repo type: ${o.repoType}`),o?.cloneUrl&&p(`Clone URL: ${o.cloneUrl}`))}function g(n){n.setDescription(t.app.info.description),n.addExamples(t.app.info.examples),n.addOptions([{flags:{key:i.App.name},env:i.App.envVar,description:t.app.info.options.app,optionalInNonInteractive:!0},{flags:{key:i.EnvironmentId.name,alias:i.EnvironmentId.alias},env:i.EnvironmentId.envVar,description:t.app.info.options.environmentId,optionalInNonInteractive:!0}])}export{M as getMaafAppInfoAsync};
|
|
8
|
-
/*!
|
|
9
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
-
*/
|
|
11
|
-
//# sourceMappingURL=GetMaafApp-ELB5KMHW.js.map
|
|
@@ -1,11 +0,0 @@
|
|
|
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 I}from"./chunk-YMXXWGRV.js";import{a as L}from"./chunk-QAFCXGBD.js";import"./chunk-OL6CTXQR.js";import{b as D}from"./chunk-DREO7EYO.js";import{h as v}from"./chunk-5AUOEXAR.js";import{Y as S,aa as A,ua as f}from"./chunk-G33Q5FWT.js";import{b as l}from"./chunk-RBG2H562.js";import"./chunk-S5HEU7XK.js";import"./chunk-EV3TTTOT.js";import"./chunk-7NXJAIJX.js";import{n as s}from"./chunk-6MXOK2LG.js";import{d as y,h as i}from"./chunk-PVAIJSAI.js";import{a as r}from"./chunk-VNEZZ3RI.js";import{a as c}from"./chunk-U36HMOQW.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function J(t){if(O(t),await t.runVerb(),!t.getEnvironmentId())throw new l(`\`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 l("Unable to determine tenant ID. Ensure you are logged in.");let g=await v(t),b=await t.getOption("commit"),d=b?void 0:D(),n=b||d?.commitSha;if(!n)throw new l("Unable to infer the current commit ID. Use --commit or -c to specify it.");let m=await t.getOption("showLog")===!0;!t.isJsonMode()&&d&&i(d.detached?`Detached HEAD at commit ${n}.`:`Using branch '${d.branch}' at commit ${n}.`);let e=await S({logger:f(),actionsParams:{appName:g,commitSha:n}}),o=L(e.result),h=E(e.result),a;if(m&&h&&(a=(await A({logger:f(),actionsParams:{appName:g,commitSha:n}})).log),t.isJsonMode()){let w=!!(o.errorMessage||o.buildOutput)?{...e,...o}:{...e};if(a!==void 0){let k=typeof e.result=="object"&&e.result!==null?e.result:{};w.result={...k,log:a}}y(w)}else i(o.errorMessage?`Build status: ${e.status}: ${o.errorMessage}`:`Build status: ${e.status}`),h&&!m&&e.status!=="Succeeded"&&i("Run `ms app build-status --show-log` to display the build log."),o.buildOutput&&i(o.buildOutput),m&&(a&&a.trim()?await I(a):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 ${n}\` to make this app live.`)}function E(t){if(typeof t!="object"||t===null||!("buildLogUri"in t))return;let p=t.buildLogUri;if(typeof p!="string")return;let u=p.trim();return u||void 0}function O(t){t.setDescription(r.deprecated.Verbs["Get-build-status"].Description),t.addExamples(r.deprecated.Verbs["Get-build-status"].Examples),t.addOptions([{flags:{key:s.AppName.name},env:s.AppName.envVar,description:r.deprecated.Verbs["Get-build-status"].Options.AppName,optionalInNonInteractive:!0},{flags:{key:s.CommitSha.name,alias:s.CommitSha.alias},env:s.CommitSha.envVar,description:r.deprecated.Verbs["Get-build-status"].Options.CommitSha}]),t.addSwitch({flags:{key:s.ShowLog.name},description:r.app.buildStatus.options.showLog})}export{J as getMaafBuildStatusAsync};
|
|
8
|
-
/*!
|
|
9
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
-
*/
|
|
11
|
-
//# sourceMappingURL=GetMaafBuildStatus-3W7LI5TJ.js.map
|
package/dist/Init-CH5DUQWA.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
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 Y,b as _,c as K,d as Q}from"./chunk-VFSTQAZ2.js";import{a as j,b as H}from"./chunk-YIKNM523.js";import"./chunk-TYRVM4PP.js";import{a as P}from"./chunk-3BRAT6NP.js";import"./chunk-UBTSW22U.js";import"./chunk-MFPX2RFH.js";import{c as J,d as W,f as q}from"./chunk-DREO7EYO.js";import{b as T,e as d,i as F}from"./chunk-5AUOEXAR.js";import{E as S,Z as L,d as x,oa as G,ua as M,va as z}from"./chunk-G33Q5FWT.js";import{a as D,b as f,e as V,f as O}from"./chunk-RBG2H562.js";import"./chunk-S5HEU7XK.js";import"./chunk-EV3TTTOT.js";import"./chunk-7NXJAIJX.js";import{y as e}from"./chunk-6MXOK2LG.js";import{c as B,d as $,h as s,i as A}from"./chunk-PVAIJSAI.js";import{a}from"./chunk-VNEZZ3RI.js";import{a as b}from"./chunk-U36HMOQW.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";import*as h from"fs";import*as m from"path";async function Ue(t){pe(t),await t.runVerb();let l=z();if(l.appConfig)throw new f(`${b} already exists in this directory. Use a new directory or delete the existing config.`);let g=M(),o=t.isJsonMode(),y=await t.getTenantIdAsync();if(!y)throw new f("Unable to determine tenant ID. Ensure you are logged in.");let u=await F(t,{failIfMissing:!1});if(u){let i;try{i=await S(u)}catch(r){throw r instanceof D?r:new V(`Failed to validate environment '${u}': ${r instanceof Error?r.message:String(r)}`)}if(!i?.properties)throw new O(`Environment '${u}' not found. Please verify the environment ID and ensure you have access to it.`)}let U=u===void 0?j(t,y,g,"Init"):void 0;U?.catch(i=>{g.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&&K(w))k=w,n="native",o||s("Using provided repository ID for the app's platform-managed source control.");else if(w!==void 0){let i=Q(C);if(i.repoType==="github"){let r=process.cwd();if(h.readdirSync(r).length===0)throw new f(`--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(r,".git")))throw new f(`--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||s(`Using provided repository URL '${i.remoteUrl}' for app source control.`)}else i.repoType==="none"&&!o?s("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&&s("A new platform-managed git repo will be provisioned and linked to the app.");n=i.repoType,p=i.remoteUrl}else{let i=J();i&&(o||s(`Detected git remote URL: ${i}`),(l.interactive?await T({message:"Use this existing repository for app source control?",initialValue:!0}):!0)?(o||s("Will use the existing git repo and link it to the app."),n="github",p=i):o||s("Will not use the existing git repo. A new platform-managed git repo will be provisioned and linked to the app instead."))}let N=await t.getOption("displayName"),Z=await t.getOption("description"),ee=await t.getOption("buildPath"),ie=await t.getOption("buildCommand"),te=await t.getOption("buildEntryPoint"),R=X(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 f(`--icon-path must reference a .png or .jpg file (received '${R}').`)}let ne=X(await t.getOption(e.LocalAppUrl.camelName,!0)),oe=await t.getOption(e.OpenBrowser.camelName,!0)??!1,ae=await t.getOption(e.ForceReauth.camelName,!0)??!1,v=await H(u,U);t.updateEnvironmentId(v);let re={displayName:N,description:Z,repositoryId:k,remoteUrl:p,repoType:n,origin:l.origin},c=await P(({isRetry:i})=>L({tenantId:y,environmentId:v,logger:g,actionsParams:{...re,...ae&&!i&&n==="github"&&{forceReauth:!0}}}),{repoType:n,externalRepoUrl:p,tenantId:y,jsonMode:o,openBrowser:oe,verb:"app init"}),se=Y({appId:c.app.id,appDisplayName:c.app.displayName,description:c.app.description,environmentId:v,repoType:n,repositoryId:n==="native"?c.app.repositoryId:void 0,externalRepoUrl:n==="github"?p:void 0,cloud:t.getCloud(),buildPath:ee,buildCommand:ie,buildEntryPoint:te,iconPath:R,localAppUrl:ne,connectionReferences:{},appSettings:G(void 0)});await x(l.fileConfig.appConfigPath,se);let I=m.dirname(l.fileConfig.appConfigPath);if(await _(I,o,t.getHttpClient()),n==="native"&&c.cloneUrl){let i=q({directory:I,gitUrl:c.cloneUrl,loginAuthority:t.getLoginAuthority(y),authResource:t.getAuthResourceUrl()});if(i.success&&!o)s("Configured the platform-managed git remote and credentials.");else if(!i.success&&(g.trackErrorEvent("Init.LocalGitRepoInitializationFailed",{repoType:n,error:i.error??"Unknown git initialization error"}),!o)){let r=i.error?` Reason: ${i.error}`:"";A(`Could not initialize a local git repository automatically.${r} ${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=W(p,I);if(i.success&&!o)s("Initialized a local git repository and configured the remote.");else if(!i.success&&(g.trackErrorEvent("Init.LocalGitRepoInitializationFailed",{repoType:n,error:i.error??"Unknown git initialization error"}),!o)){let r=i.error?` Reason: ${i.error}`:"";A(`Could not initialize a local git repository automatically.${r} Run 'git init' and 'git remote add origin <remote-url>' manually.`)}}o?$({appId:c.app.id,environmentId:v,repoType:n,...p&&{externalRepoUrl:p}}):(B(`Created ${b} for ${N}.`),s("Hint: Run 'npm install' (or your package manager's install) to install the project-local CLI."),s(`Hint: Run '${"ms"} app add data-source' to connect data, or '${"ms"} app dev' to start the app locally.`),n!=="none"&&s("Hint: Commit and push to wire your app to the remote repository: git add . && git commit -m '<message>' && git push -u origin HEAD."))}function X(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{Ue as initAsync};
|
|
8
|
-
/*!
|
|
9
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
-
*/
|
|
11
|
-
//# sourceMappingURL=Init-CH5DUQWA.js.map
|
|
@@ -1,11 +0,0 @@
|
|
|
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 y}from"./chunk-YMXXWGRV.js";import{c as h}from"./chunk-YIKNM523.js";import{e as r}from"./chunk-5AUOEXAR.js";import{R as A,ua as g}from"./chunk-G33Q5FWT.js";import{b as f}from"./chunk-RBG2H562.js";import"./chunk-S5HEU7XK.js";import"./chunk-EV3TTTOT.js";import"./chunk-7NXJAIJX.js";import{b as s,j as n}from"./chunk-6MXOK2LG.js";import{f as d}from"./chunk-PVAIJSAI.js";import{a as e}from"./chunk-VNEZZ3RI.js";import"./chunk-U36HMOQW.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function k(o){w(o),await o.runVerb();let i=g(),a=await o.getTenantIdAsync();if(!a)throw new f("Unable to determine tenant ID. Ensure you are logged in.");let u=await h(o,i,{jsonMode:o.isJsonMode(),telemetryNamespace:"ListConnectorActions"}),c=await o.getOption("connector",!1),v=await o.getOption(n.Search.name,!0),C={tenantId:a,environmentId:u,actionsParams:{connectorId:c,search:v},logger:i},{actions:I,docsUrl:m}=await A(C),p=I.slice().sort((t,l)=>t.behavior!==l.behavior?t.behavior==="Allow"?-1:1:t.summary.localeCompare(l.summary));if(o.isJsonMode()){d(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(t=>[t.deprecated?`[Deprecated] ${t.summary}`:t.summary,t.behavior,t.id]),emptyMessage:"No actions found.",totalLabel:"action(s)"})}function w(o){o.setDescription(e.connector["list-actions"].description),o.addExamples(e.connector["list-actions"].examples),o.addOptions([r({flags:{key:s.Connector.name},env:s.Connector.envVar,message:s.Connector.promptMessage,description:e.connector["list-actions"].options.connector}),{flags:{key:n.EnvironmentId.name,alias:n.EnvironmentId.alias},env:n.EnvironmentId.envVar,description:e.connector["list-actions"].options.environmentId,optionalInNonInteractive:!0},r({flags:{key:n.Search.name,alias:n.Search.alias},env:n.Search.envVar,message:n.Search.promptMessage,description:e.connector["list-actions"].options.search})])}export{k as listConnectorActionsCliAsync};
|
|
8
|
-
/*!
|
|
9
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
-
*/
|
|
11
|
-
//# sourceMappingURL=ListConnectorActions-7SIFGPYR.js.map
|
|
@@ -1,11 +0,0 @@
|
|
|
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-YIKNM523.js";import{e as f}from"./chunk-5AUOEXAR.js";import{S as p,ua as d}from"./chunk-G33Q5FWT.js";import{b as m}from"./chunk-RBG2H562.js";import"./chunk-S5HEU7XK.js";import"./chunk-EV3TTTOT.js";import"./chunk-7NXJAIJX.js";import{h as o}from"./chunk-6MXOK2LG.js";import{f as l}from"./chunk-PVAIJSAI.js";import{a as n}from"./chunk-VNEZZ3RI.js";import"./chunk-U36HMOQW.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,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-TRKIWRVQ.js.map
|
package/dist/Pack-AHKC2MYF.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
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 a,c as b,d as c}from"./chunk-W7EWOZPO.js";import"./chunk-HBLO3WDD.js";import"./chunk-OL6CTXQR.js";import"./chunk-G33Q5FWT.js";import"./chunk-RBG2H562.js";import"./chunk-S5HEU7XK.js";import"./chunk-EV3TTTOT.js";import"./chunk-7NXJAIJX.js";import"./chunk-PVAIJSAI.js";import"./chunk-VNEZZ3RI.js";import"./chunk-U36HMOQW.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";export{a as assertPackPreconditions,b as packAppArtifactAsync,c as packAsync};
|
|
8
|
-
//# sourceMappingURL=Pack-AHKC2MYF.js.map
|
|
@@ -1,12 +0,0 @@
|
|
|
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 I,i as h}from"./chunk-5AUOEXAR.js";import{ba as w,ua as g}from"./chunk-G33Q5FWT.js";import{b as s}from"./chunk-RBG2H562.js";import"./chunk-S5HEU7XK.js";import"./chunk-EV3TTTOT.js";import"./chunk-7NXJAIJX.js";import{o}from"./chunk-6MXOK2LG.js";import{c as y,d as u,h as f,i as v}from"./chunk-PVAIJSAI.js";import{a as r}from"./chunk-VNEZZ3RI.js";import"./chunk-U36HMOQW.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";import A from"open";async function E(e){C(e),await e.runVerb();let n=await I(e),t=await h(e),p=await e.getTenantIdAsync();if(!p)throw new s("Unable to determine tenant ID. Ensure you are logged in.");let a=await $(e),c=await e.getOption(o.NoBrowser.camelName,!0)===!1,i=e.isJsonMode(),l=await e.getOption(o.CommitSha.name,!0);if(a==="live"&&l)throw new s("--commit is only valid with --mode preview.");await b({appName:n,environmentId:t,tenantId:p,noBrowser:c,isJson:i,mode:a,commitId:l})}async function b(e){let{appName:n,environmentId:t,tenantId:p,noBrowser:a,isJson:c,mode:i,commitId:l}=e,d=await w({tenantId:p,environmentId:t,logger:g(),actionsParams:{appName:n}}),m=N(d.appPlayUri,i,l);if(!m)throw new s(i==="live"?`No live build is available for app '${n}' yet. Run 'ms app deploy' to deploy one, then re-run 'ms app play'.`:`No appPlayUri is available for app '${n}' in environment '${t}'.`);if(c){u({appName:n,mode:i,url:m,commitHash:d.commitHash??null});return}y(`${i==="live"?"Live":"Preview"} URL for '${d.displayName??n}': ${m}`),i==="live"&&v("Live does not auto-update. Run 'ms app deploy' to publish a new version to the live URL."),await M(m,a)}function N(e,n,t,p="main"){if(!e)return;if(n==="live")return e;let a=e.replace(/\/$/,"");return t?`${a}/commit/${t}`:`${a}/branch/${encodeURIComponent(p)}`}async function M(e,n){if(!n){f(`Opening browser at ${e}`);try{await A(e,{wait:!1})}catch{f(`Could not open browser automatically. Please navigate to:
|
|
8
|
-
${e}`)}}}async function $(e){let n=await e.getOption(o.Mode.name,!0),t=(n??o.Mode.defaultValue).trim().toLowerCase();if(t!=="live"&&t!=="preview")throw new s(`Invalid --mode value '${n}'. Expected 'live' or 'preview'.`);return t}function C(e){e.setDescription(r.app.play.description),e.addExamples(r.app.play.examples),e.addSwitch({flags:{key:o.NoBrowser.name},description:r.app.play.options.noBrowser}),e.addOptions([{flags:{key:o.AppName.name},env:o.AppName.envVar,description:r.app.play.options.app,optionalInNonInteractive:!0},{flags:{key:o.Mode.name,alias:o.Mode.alias},env:o.Mode.envVar,default:o.Mode.defaultValue,description:r.app.play.options.mode,optionalInNonInteractive:!0},{flags:{key:o.CommitSha.name,alias:o.CommitSha.alias},env:o.CommitSha.envVar,description:r.app.play.options.commit,optionalInNonInteractive:!0}])}export{N as buildPlayUrl,E as playMaafAppAsync};
|
|
9
|
-
/*!
|
|
10
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
11
|
-
*/
|
|
12
|
-
//# sourceMappingURL=PlayMaafApp-LWKJU2IN.js.map
|
|
@@ -1,11 +0,0 @@
|
|
|
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{g as A}from"./chunk-5AUOEXAR.js";import{V as u,W as g,q as d,ua as h,va as S}from"./chunk-G33Q5FWT.js";import"./chunk-RBG2H562.js";import"./chunk-S5HEU7XK.js";import"./chunk-EV3TTTOT.js";import"./chunk-7NXJAIJX.js";import{e as t}from"./chunk-6MXOK2LG.js";import{c as p,h as l,j as m}from"./chunk-PVAIJSAI.js";import{a}from"./chunk-VNEZZ3RI.js";import"./chunk-U36HMOQW.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function H(e){let N=S(),{fileConfig:n,cliFs:y}=N;P(e),await e.runVerb(),A();let i=!!await e.getOption("offline",!0),s=await e.getOption("name",!0)||void 0,c=d(),f={vfs:y,authProvider:e.getAuthenticationProvider(),httpClient:e.getHttpClient(),region:c.region,environmentName:c.environmentName,localFilePaths:{appConfigPath:n.appConfigPath,schemaPath:n.schemaPath,codeGenPath:n.codeGenPath},logger:h()},o=i?await g({...f,actionsParams:{dataSource:s}}):await u({...f,actionsParams:{dataSourceName:s}}),v=i?"regenerated":"refreshed",C=i?"regenerate":"refresh";for(let r of o.succeeded)p(`'${r}' ${v} successfully.`);for(let r of o.failed)m(`Failed to ${C} '${r.dataSourceName}': ${r.error}`);o.succeeded.length>0&&o.failed.length===0&&l(`Hint: Run '${"ms"} app dev' to test locally.`)}function P(e){e.setDescription(a.app.refresh.dataSource.description),e.addExamples(a.app.refresh.dataSource.examples),e.addOptions([{flags:{key:t.DataSourceName.name,alias:t.DataSourceName.alias},env:t.DataSourceName.envVar,description:a.app.refresh.dataSource.options.name,optionalInNonInteractive:!0}]),e.addSwitch({flags:{key:t.Offline.name},env:t.Offline.env,description:a.app.refresh.dataSource.options.offline})}export{H as refreshDataSourceAsync};
|
|
8
|
-
/*!
|
|
9
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
-
*/
|
|
11
|
-
//# sourceMappingURL=RefreshDataSource-ZFZJXJ5L.js.map
|
|
@@ -1,11 +0,0 @@
|
|
|
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,h as u,i as I}from"./chunk-5AUOEXAR.js";import{f,ia as k,ua as m,va as v}from"./chunk-G33Q5FWT.js";import{b as p}from"./chunk-RBG2H562.js";import"./chunk-S5HEU7XK.js";import"./chunk-EV3TTTOT.js";import"./chunk-7NXJAIJX.js";import{x as n}from"./chunk-6MXOK2LG.js";import{c as l,d as a,i as s}from"./chunk-PVAIJSAI.js";import{a as i}from"./chunk-VNEZZ3RI.js";import"./chunk-U36HMOQW.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function F(e){g(e),await e.runVerb();let c=await I(e),d=await e.getTenantIdAsync();if(!d)throw new p("Unable to determine tenant ID. Ensure you are logged in.");let r=await u(e),o=await e.getOption(n.LinkId.name);if(!o)throw new p("Provide a share link ID via --link-id.");if(!await e.getOption(n.Force.name,!0)&&v().interactive&&!await h({message:`Revoke share link '${o}' for app '${r}'? Anyone who has not yet redeemed it will lose access; redeemers will have their Microsoft App Reader role revoked.`})){s("Revoke cancelled.");return}try{await k({tenantId:d,environmentId:c,logger:m(),actionsParams:{appName:r,appShareLinkId:o}})}catch(t){if(w(t)){if(e.isJsonMode()){a({appName:r,linkId:o,existed:!1});return}s(`Share link '${o}' was not found on '${r}'; nothing was revoked.`);return}throw t}if(e.isJsonMode()){a({appName:r,linkId:o,existed:!0});return}l(`Share link '${o}' revoked for '${r}'.`)}function w(e){if(!(e instanceof f)||e.status!==404||!e.body)return!1;try{return JSON.parse(e.body).error?.code==="AppShareLinkNotFound"}catch{return!1}}function g(e){e.setDescription(i.app.shareLink.revoke.description),e.addExamples(i.app.shareLink.revoke.examples),e.addSwitch({flags:{key:n.Force.name,alias:n.Force.alias},description:i.app.shareLink.revoke.options.force}),e.addOptions([{flags:{key:n.LinkId.name,alias:n.LinkId.alias},env:n.LinkId.envVar,description:i.app.shareLink.revoke.options.linkId},{flags:{key:n.AppName.name},env:n.AppName.envVar,description:i.app.shareLink.revoke.options.app,optionalInNonInteractive:!0},{flags:{key:n.EnvironmentId.name,alias:n.EnvironmentId.alias},env:n.EnvironmentId.envVar,description:i.app.shareLink.revoke.options.environmentId,optionalInNonInteractive:!0}])}export{F as shareLinkRevokeAsync};
|
|
8
|
-
/*!
|
|
9
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
-
*/
|
|
11
|
-
//# sourceMappingURL=ShareLinkRevoke-EEJVCRCY.js.map
|
|
@@ -1,11 +0,0 @@
|
|
|
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 L,b as O,c as y,d as x,e as $,f as P,g as k}from"./chunk-6FFQN2SO.js";import{h as E,i as b}from"./chunk-5AUOEXAR.js";import{I as h,J as I,K as g,da as C,ka as M,ua as R,va as S}from"./chunk-G33Q5FWT.js";import{b as u}from"./chunk-RBG2H562.js";import"./chunk-S5HEU7XK.js";import"./chunk-EV3TTTOT.js";import"./chunk-7NXJAIJX.js";import{w as r}from"./chunk-6MXOK2LG.js";import{a as v,d as w,h as D,i as T}from"./chunk-PVAIJSAI.js";import{a as l}from"./chunk-VNEZZ3RI.js";import"./chunk-U36HMOQW.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function Z(e){V(e),await e.runVerb();let i=await b(e),p=await e.getTenantIdAsync();if(!p)throw new u("Unable to determine tenant ID. Ensure you are logged in.");let o=await E(e),f=!!await e.getOption("app",!0),d=await e.getOption("access",!0);if(!d||!d.trim())throw new u("The --access option is required. Use --access play to list app (play) access, or --access edit to list edit access.");let t=x(d),s,a="none",m;if(f)(t==="edit"||e.isJsonMode())&&(s=await P({tenantId:p,environmentId:i,appName:o}),a=F(s));else{let n=S().appConfig??{};m=y(n.repositoryId)?n.repositoryId:void 0,a=t==="edit"?$(n):n.repoType??"none"}let G=W(t,a);!e.isJsonMode()&&t==="edit"&&a==="github"&&T(O);let A=await Promise.all(G.map(n=>U({target:n,tenantId:p,environmentId:i,appName:o,appInfo:s,configRepoId:m})));if(e.isJsonMode()){w({appName:o,access:t,repoType:a,results:A.map(n=>({scope:n.scope,roleDefinitionName:n.roleDefinitionName,...n.repoId?{repoId:n.repoId}:{},unclassifiedCount:n.unclassifiedCount,value:n.assignments}))});return}let J=A.flatMap(n=>n.assignments.map(c=>[n.scope,c.principalObjectId??"-",c.principalType??"-",B(c.roleDefinitionName),c.createdOn??"-"]));v({title:`${t==="play"?"Play":"Edit"} shares for '${o}'`,columns:[{header:"SCOPE"},{header:"PRINCIPAL ID"},{header:"TYPE"},{header:"ROLE"},{header:"CREATED ON"}],rows:J,emptyMessage:`No ${t} shares for '${o}'.`,totalLabel:"assignment(s)"});let N=A.reduce((n,c)=>n+c.unclassifiedCount,0);N>0&&D(`${N} assignment(s) with an unrecognized role definition were not shown.`)}async function U(e){let{target:i,tenantId:p,environmentId:o,appName:f,appInfo:d,configRepoId:t}=e;if(i.scope==="app"){let m=await C({tenantId:p,environmentId:o,logger:R(),actionsParams:{appName:f,roleDefinitionName:i.roleDefinitionName}});return{scope:"app",roleDefinitionName:i.roleDefinitionName,assignments:m.assignments,unclassifiedCount:m.unclassifiedCount}}let s=[t,d?.repositoryId].find(y);if(s||(s=(await k({tenantId:p,environmentId:o,appName:f})).repositoryId),!y(s))throw new u(`App '${f}' has no associated repository, so edit access cannot be listed.`);let a=await M({tenantId:p,environmentId:o,logger:R(),actionsParams:{repoId:s}});return{scope:"repo",roleDefinitionName:i.roleDefinitionName,repoId:s,assignments:a.assignments,unclassifiedCount:a.unclassifiedCount}}function V(e){e.setDescription(l.app.share.list.description),e.addExamples(l.app.share.list.examples),e.addOptions([{flags:{key:r.AppName.name},env:r.AppName.envVar,description:l.app.share.list.options.app,optionalInNonInteractive:!0},{flags:{key:r.EnvironmentId.name,alias:r.EnvironmentId.alias},env:r.EnvironmentId.envVar,description:l.app.share.list.options.environmentId,optionalInNonInteractive:!0},{flags:{key:r.Access.name},env:r.Access.envVar,description:l.app.share.list.options.access}])}function F(e){switch(e.repoType){case"Native":return"native";case"ExternalGitProviderBound":case"ExternallyProvidedBuild":return"github";default:return"none"}}function B(e){switch(e){case I:return"App Reader";case g:return"App Contributor";case h:return"Repository Contributor";default:return e??"-"}}function W(e,i){if(e==="play")return[{scope:"app",roleDefinitionName:I}];if(i==="none")throw new u(L);return i!=="native"?[{scope:"app",roleDefinitionName:g}]:[{scope:"repo",roleDefinitionName:h},{scope:"app",roleDefinitionName:g}]}export{Z as shareListAsync};
|
|
8
|
-
/*!
|
|
9
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
-
*/
|
|
11
|
-
//# sourceMappingURL=ShareList-LJDAEGI3.js.map
|
|
@@ -1,11 +0,0 @@
|
|
|
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 $}from"./chunk-USRRI5H4.js";import{i as w}from"./chunk-5AUOEXAR.js";import{ba as y,ua as h,va as b}from"./chunk-G33Q5FWT.js";import{b as d}from"./chunk-RBG2H562.js";import"./chunk-S5HEU7XK.js";import"./chunk-EV3TTTOT.js";import"./chunk-7NXJAIJX.js";import{d as g,h as o}from"./chunk-PVAIJSAI.js";import{a as m}from"./chunk-VNEZZ3RI.js";import{a as f}from"./chunk-U36HMOQW.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";var I=7;async function O(e){e.setDescription(m.app.show.description),e.addExamples(m.app.show.examples),await e.runVerb();let t=b();if(!t.appConfig)throw new d(`No ${f} found in the current directory. Run "${"ms"} app init" first.`);let n=t.appConfig.appId;if(!n)throw new d(`${f} has no appId. Run "${"ms"} app create" or set appId manually.`);let i=await w(e),r=await e.getTenantIdAsync();if(!r)throw new d("Unable to determine tenant ID. Ensure you are logged in.");let a=await y({tenantId:r,environmentId:i,logger:h(),actionsParams:{appName:n}}),s=S(a,t.appConfig,i);e.isJsonMode()?g(s):E(s)}function S(e,t,n){let i=e.connectionReferences??{},r=Object.entries(i).map(([c,p])=>N(c,p)),a=e.commitHash,s=$(e);return{name:e.displayName,environmentId:e.environmentId??n,appId:e.id,commit:a?a.slice(0,I):void 0,build:C(t),connectors:r,repoType:s?.repoType,cloneUrl:s?.cloneUrl}}function C(e){let{buildPath:t,buildEntryPoint:n}=e;if(t&&n)return{path:t,entryPoint:n};if(t)return{path:t};if(n)return{entryPoint:n}}function N(e,t){let n={connector:e};t.displayName&&(n.displayName=t.displayName),t.actions?.length&&(n.actions=t.actions);let i=t.dataSets??{},r=[],a=[],s=new Set;for(let[c,p]of Object.entries(i))if(!(!p||typeof p!="object"))for(let[l,u]of Object.entries(p.dataSources??{}))s.add(l),u.tableName?r.push({dataset:c,table:u.tableName}):a.push({dataset:c,procedure:l});for(let c of t.dataSources??[])s.has(c)||r.push({table:c});return r.length&&(n.tables=r),a.length&&(n.procedures=a),n}function E(e){o(`Name: ${e.name}`),o(`Environment: ${e.environmentId}`),o(`App ID: ${e.appId}`),e.commit&&o(`Commit: ${e.commit}`);let t=T(e.build);if(t&&o(`Build: ${t}`),e.repoType&&o(`Repo type: ${e.repoType}`),e.cloneUrl&&o(`Clone URL: ${e.cloneUrl}`),e.connectors.length===0){o(""),o("(no connectors bound)");return}for(let n of e.connectors){o("");let i=n.connector.replace(/^shared_/,"");o(n.displayName?`${i} (${n.displayName})`:i),n.actions?.length&&o(` actions: ${n.actions.join(", ")}`),n.tables?.length&&o(` tables: ${n.tables.map(P).join(", ")}`),n.procedures?.length&&o(` procedures: ${n.procedures.map(V).join(", ")}`)}}function P(e){return e.dataset?`${e.table} (${e.dataset})`:e.table}function V(e){return`${e.procedure} (${e.dataset})`}function T(e){if(!e)return;let t="path"in e?e.path:void 0,n="entryPoint"in e?e.entryPoint:void 0;if(t&&n){let i=t.includes("\\")&&!t.includes("/")?"\\":"/",r=t.replace(/[/\\]+$/,""),a=n.replace(/^[/\\]+/,"");return`${r}${i}${a}`}return t??n}export{S as buildAppShowView,O as showMaafAppAsync};
|
|
8
|
-
/*!
|
|
9
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
-
*/
|
|
11
|
-
//# sourceMappingURL=ShowMaafApp-3KK6NUG2.js.map
|
package/dist/chunk-6FFQN2SO.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
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{ba as r,ua as i}from"./chunk-G33Q5FWT.js";import{b as t}from"./chunk-RBG2H562.js";import{a as n}from"./chunk-U36HMOQW.js";var u=`Cannot share source code \u2014 no repository linked.
|
|
8
|
-
|
|
9
|
-
This app has no linked repository, so source code isn't stored on the platform. To collaborate on code, run 'ms app init' to create an app instance with a repo, or share the source with your collaborator directly.`,g="This app is not backed by a platform managed repo. Repository access must be configured in the external repository.",s="00000000-0000-0000-0000-000000000000";function p(e){return!!e&&e!==s}function h(e){let o=(e??"play").trim().toLowerCase();if(o==="play"||o==="edit")return o;throw new t(`Unknown --access value '${e}'. Use 'play' (default \u2014 app access) or 'edit' (edit access).`)}function A(e){if(e.repoType)return e.repoType;if(p(e.repositoryId))throw new t(`${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 c(e){return r({tenantId:e.tenantId,environmentId:e.environmentId,logger:i(),actionsParams:{appName:e.appName}})}async function I(e){let o=await c(e);if(!p(o.repositoryId))throw new t(`App '${e.appName}' has no associated repository.`);return o}export{u as a,g as b,p as c,h as d,A as e,c as f,I as g};
|
|
10
|
-
/*!
|
|
11
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
12
|
-
*/
|
|
13
|
-
//# sourceMappingURL=chunk-6FFQN2SO.js.map
|
package/dist/chunk-6MXOK2LG.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
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
|
-
var p={Account:{name:"account"},DeviceCode:{name:"device-code",camelName:"deviceCode"}},e={Help:{name:"help",alias:"h"},Connector:{name:"connector",promptMessage:"Please provide the connector (e.g. shared_office365):",envVar:"CONNECTOR"},SolutionId:{name:"solution-id",alias:"s",promptMessage:"Please provide the Solution ID:",envVar:"SOLUTION_ID"},ConnectionId:{name:"connection-id",alias:"c",promptMessage:"Please provide the Connection ID:",envVar:"CONNECTION_ID"},Dataset:{name:"dataset",alias:"d",promptMessage:"Please provide the dataset:",envVar:"DATASET"},SqlStoredProcedure:{name:"sql-stored-procedure",alias:"sp",promptMessage:"Please provide the SQL stored procedure name:",envVar:"SQL_STORED_PROCEDURE"},ResourceName:{name:"resource-name",alias:"t",promptMessage:"Please provide the resource name:",envVar:"TABLE"},Search:{name:"search",alias:"s",promptMessage:"Please provide a search term:",envVar:"SEARCH_TERM"}},a={SkipCodegen:{name:"skip-codegen",env:"SKIP_CODEGEN"},UseV1Codegen:{name:"use-v1-codegen",env:"USE_V1_CODEGEN"}},m={...a},t={Table:{name:"table",alias:"t",promptMessage:"Please provide the table name:",envVar:"TABLE_NAME"},...a},i={As:{name:"as",promptMessage:"Add as table or action?",envVar:"ADD_CONNECTOR_AS"},Table:t.Table,DataverseEnvironmentId:{name:"dataverse-environment-id",promptMessage:"Please provide the Dataverse environment ID:",envVar:"DATAVERSE_ENVIRONMENT_ID"},UseSso:{name:"use-sso",env:"USE_SSO"},...a},c={ConnectionRef:{name:"connection-ref",alias:"cr",promptMessage:"Please provide the Connection Reference:",envVar:"CONNECTION_REF"},...a},l={DataSourceName:{name:"name",alias:"n",promptMessage:"Please provide the data source or table name:",envVar:"DATA_SOURCE_NAME"}},A={DataSourceName:{name:"name",alias:"n",promptMessage:"Please provide the data source name to regenerate:",envVar:"DATA_SOURCE_NAME"},Offline:{name:"offline",env:"OFFLINE"}},d={Cloud:{name:"cloud",promptMessage:"Please select the cloud instance:",envVar:"CLOUD_INSTANCE"}},v={Port:{name:"port",alias:"p",promptMessage:"Please provide the port number:",envVar:"PORT",initialValue:"8080"},LocalAppUrl:{name:"local-app-url",alias:"l",promptMessage:"Please provide the local app URL:",envVar:"LOCAL_APP_URL",initialValue:"http://localhost:3000"},ConfigOnly:{name:"config-only",alias:"C",envVar:"CONFIG_ONLY"}},M={Search:{...e.Search,promptMessage:"Please provide a search term to filter flows by name:",envVar:"FLOW_SEARCH"}};var P={SearchTerm:{...e.Search,promptMessage:"Please provide a search term to filter Dataverse operations by name:",envVar:"DATAVERSE_API_SEARCH_TERM"}},_={Search:{...e.Search,promptMessage:"Please provide a search term to filter connectors by name or ID:",envVar:"CONNECTOR_SEARCH"},EnvironmentId:{name:"environment-id",alias:"e",envVar:"MAAF_ENVIRONMENT_ID"},OnlyAllowed:{name:"only-allowed",camelName:"onlyAllowed"}},u={EnvironmentId:{name:"environment-id",camelName:"environmentId",alias:"e",promptMessage:"Please provide the environment ID to filter by:",envVar:"LIST_ENVIRONMENT_ID"},Permission:{name:"permission",alias:"p",promptMessage:"Please provide the permission filter (edit or play):",envVar:"LIST_PERMISSION"}},N={Search:{...e.Search,promptMessage:"Please provide a search term to filter actions by summary or action ID:",envVar:"CONNECTOR_ACTION_SEARCH"},EnvironmentId:{name:"environment-id",alias:"e",envVar:"MAAF_ENVIRONMENT_ID"}};var r={EnvironmentId:{name:"environment-id",alias:"e",promptMessage:"Please provide the environment ID:",envVar:"ENVIRONMENT_ID"},DisplayName:{name:"display-name",alias:"n",promptMessage:"Please provide the display name for the app:",envVar:"APP_DISPLAY_NAME"},Description:{name:"description",alias:"d",promptMessage:"Please provide a description for the app (optional):",envVar:"APP_DESCRIPTION"},BuildPath:{name:"build-path",alias:"b",promptMessage:"Please provide the build output path:",envVar:"BUILD_PATH",initialValue:"./dist"},BuildCommand:{name:"build-command",alias:"S",promptMessage:"Please provide the full command used to build your app:",envVar:"BUILD_COMMAND",initialValue:"npm run build"},BuildEntryPoint:{name:"build-entry-point",promptMessage:"Please provide the entry point HTML file:",envVar:"BUILD_ENTRY_POINT",initialValue:"index.html"},IconPath:{name:"icon-path",camelName:"iconPath",envVar:"APP_ICON_PATH"},LocalAppUrl:{name:"local-app-url",camelName:"localAppUrl",envVar:"LOCAL_APP_URL"}},n={name:"force-reauth",camelName:"forceReauth"},g={...r,AppId:{name:"app-id",alias:"i",promptMessage:"Please provide an app ID (letters, numbers, and underscores only, 1-64 chars):",envVar:"APP_ID"},Template:{name:"template",alias:"t",promptMessage:"Please provide the template name:",envVar:"APP_TEMPLATE"},RepositoryId:{name:"repository-id",alias:"r",promptMessage:"Please provide the repository ID:",envVar:"APP_REPOSITORY_ID"},Repo:{name:"repo",envVar:"APP_REPO"},OpenBrowser:{name:"open-browser",camelName:"openBrowser"},ForceReauth:n},E={App:{name:"app",promptMessage:"Please provide the app name or app ID:",envVar:"MAAF_APP_NAME"},EnvironmentId:{name:"environment-id",alias:"e",envVar:"MAAF_ENVIRONMENT_ID"}},h={AppName:{name:"app",promptMessage:"Please provide the app name:",envVar:"MAAF_APP_NAME"},CommitSha:{name:"commit",alias:"c",envVar:"MAAF_COMMIT_SHA"},OpenBrowser:{name:"open-browser",camelName:"openBrowser"},NoWait:{name:"no-wait",camelName:"wait"},ForceReauth:n},I={AppName:{name:"app",promptMessage:"Please provide the app name:",envVar:"MAAF_APP_NAME"},CommitSha:{name:"commit",alias:"c",envVar:"MAAF_COMMIT_SHA"},ShowLog:{name:"show-log"}},V={AppName:{name:"app",envVar:"MAAF_APP_NAME"},Mode:{name:"mode",alias:"m",envVar:"MAAF_PLAY_MODE",defaultValue:"live"},CommitSha:{name:"commit",alias:"c",envVar:"MAAF_COMMIT_SHA"},NoBrowser:{name:"no-browser",camelName:"browser"}},S={AppName:{name:"app",promptMessage:"Please provide the app name:",envVar:"MAAF_APP_NAME"},CommitSha:{name:"commit",alias:"c",envVar:"MAAF_COMMIT_SHA"},Artifact:{name:"artifact",envVar:"MAAF_DEPLOY_ARTIFACT"},OpenBrowser:{name:"open-browser",camelName:"openBrowser"},Force:{name:"force"},ForceReauth:n},C={AppName:{name:"app",promptMessage:"Please provide the app name:",envVar:"MAAF_APP_NAME"},EnvironmentId:{name:"environment-id",alias:"e",envVar:"MAAF_ENVIRONMENT_ID"}},O={AppName:{name:"app",promptMessage:"Please provide the app name:",envVar:"MAAF_APP_NAME"},Access:{name:"access",envVar:"MAAF_APP_ACCESS",defaultValue:"play"}},D={AppName:{name:"app",promptMessage:"Please provide the app name:",envVar:"MAAF_APP_NAME"},Access:{name:"access",envVar:"MAAF_APP_ACCESS",defaultValue:"play"}},R={Repo:{name:"repo",alias:"r",promptMessage:"Please provide the GitHub repository URL (e.g. https://contoso.ghe.com/owner/repo or https://github.com/owner/repo):",envVar:"MAAF_GITHUB_REPO"},OpenBrowser:{name:"open-browser",camelName:"openBrowser"}},o={name:"app",promptMessage:"Please provide the app name:",envVar:"MAAF_APP_NAME"},s={name:"environment-id",alias:"e",envVar:"MAAF_ENVIRONMENT_ID"},T={AppName:o,EnvironmentId:s},f={AppName:o,EnvironmentId:s},L={AppName:o,EnvironmentId:s,Access:{name:"access",envVar:"MAAF_APP_ACCESS"}},F={AppName:o,EnvironmentId:s,LinkId:{name:"link-id",alias:"l",promptMessage:"Please provide the share link ID:",envVar:"MAAF_SHARE_LINK_ID"},Force:{name:"force",alias:"f"}},w={...r,Repo:{name:"repo",envVar:"APP_REPO"},OpenBrowser:{name:"open-browser",camelName:"openBrowser"},ForceReauth:n};export{p as a,e as b,i as c,l as d,A as e,d as f,v as g,_ as h,u as i,N as j,g as k,E as l,h as m,I as n,V as o,S as p,C as q,O as r,D as s,R as t,T as u,f as v,L as w,F as x,w as y};
|
|
8
|
-
/*!
|
|
9
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
-
*/
|
|
11
|
-
//# sourceMappingURL=chunk-6MXOK2LG.js.map
|
package/dist/chunk-DREO7EYO.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
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{c as E,d as w,e as y}from"./chunk-RBG2H562.js";import{m as R}from"./chunk-S5HEU7XK.js";import{execFileSync as D}from"child_process";var k=[{patterns:[/403 forbidden/i,/returned error: 403/i,/access denied/i],bucket:"auth-403",build:t=>`Git reached the remote but access was denied while ${t} (HTTP 403). This usually means one of:
|
|
8
|
-
- the signed-in account is in the wrong tenant, or lacks permission to this app's repo; or
|
|
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
|
-
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",build:t=>`Git could not obtain a credential while ${t}: 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",build:t=>`Git authentication failed while ${t}: 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.`}],A=[/could not resolve host/i,/could not resolve proxy/i,/failed to connect/i,/connection timed out/i,/connection refused/i,/network is unreachable/i,/temporary failure in name resolution/i];function L(t){return t.replace(/(\b[a-z][a-z0-9+.-]*:\/\/)[^/\s@]+@/gi,"$1[REDACTED]@")}function S(t,e){let r=L(t.trimEnd());if(!r)return null;for(let i of k)if(i.patterns.some(o=>o.test(r)))return new E(`${i.build(e.action)}
|
|
11
|
-
|
|
12
|
-
Git output:
|
|
13
|
-
${r}`,{classifierBucket:i.bucket,action:e.action});return A.some(i=>i.test(r))?new y(`Git could not reach the remote while ${e.action}. Check your network connection (and proxy settings, if any) and try again.
|
|
14
|
-
|
|
15
|
-
Git output:
|
|
16
|
-
${r}`,{classifierBucket:"network",action:e.action}):null}function g(t){return t==null?"":Buffer.isBuffer(t)?t.toString():t}var I=64*1024*1024;function f(t,e={}){let{cwd:r,allowFailure:i=!1,captureStdout:o=!1,emitStderr:d=!0,classify:u,network:s=!1}=e,c=s&&!u&&!i;try{let n=D("git",t,{cwd:r,stdio:["ignore",o?"pipe":"ignore",c?"inherit":"pipe"],maxBuffer:I});return{success:!0,status:0,stdout:o?g(n):"",stderr:""}}catch(n){let a=n,l=g(a.stderr);if(u&&!i){let $=l||g(a.stdout)||(n instanceof Error?n.message:String(n)),G=S($,u);if(G)throw G}if(d&&l&&process.stderr.write(l),!i)throw n;return{success:!1,status:typeof a.status=="number"?a.status:null,stdout:g(a.stdout),stderr:l,error:n instanceof Error?n:new Error(String(n))}}}import{execFileSync as p}from"child_process";import*as m from"fs";import*as C from"path";function b({gitUrl:t,loginAuthority:e,authResource:r,platform:i=process.platform}){let o;try{o=new URL(t)}catch(n){throw new Error(`Git credential helper setup requires a valid HTTPS remote URL: ${n instanceof Error?n.message:String(n)}`)}if(o.protocol!=="https:")throw new Error(`Git credential helper setup requires an HTTPS remote URL, got '${o.protocol}'.`);let d=o.host,u=`${e}/oauth2/v2.0`,s=`credential.https://${d}`,c=[[`${s}.oauthAuthorizeEndpoint`,`${u}/authorize?prompt=select_account`],[`${s}.oauthTokenEndpoint`,`${u}/token`],[`${s}.oauthDeviceEndpoint`,`${u}/devicecode`],[`${s}.oauthClientId`,R],[`${s}.oauthScopes`,`${r}/.default offline_access`],[`${s}.oauthRedirectUri`,"http://localhost"]];return i==="win32"&&c.push([`${s}.credentialStore`,"dpapi"]),c}function K(){let t=f(["rev-parse","HEAD"],{captureStdout:!0,allowFailure:!0,emitStderr:!1});if(!t.success)return null;let e=f(["rev-parse","--abbrev-ref","HEAD"],{captureStdout:!0,allowFailure:!0,emitStderr:!1});if(!e.success)return null;let r=t.stdout.trim(),i=e.stdout.trim();return{branch:i,commitSha:r,detached:i==="HEAD"}}function X(){let t=f(["config","--get","remote.origin.url"],{captureStdout:!0,allowFailure:!0,emitStderr:!1});if(t.success)return t.stdout.trim()||void 0}var O=["https://","ssh://","git@"];function T(t){return O.some(e=>t.startsWith(e))&&t.trim()===t&&!t.startsWith("-")&&!/[\r\n\0]/.test(t)}function h(t){return t.replace(/:\/\/[^\s/]+@/g,"://[REDACTED]@")}function Y(t,e=process.cwd()){try{return t!==void 0&&!T(t)?{success:!1,error:"Unsafe git remote URL."}:(v({remoteUrl:t,cwd:e}),{success:!0})}catch(r){return{success:!1,error:h(r instanceof Error?r.message:String(r))}}}function B({directory:t,gitUrl:e,loginAuthority:r,authResource:i}){let o=z({gitUrl:e,loginAuthority:r,authResource:i});v({remoteUrl:e,cwd:t,createDirectory:!0,initialBranch:"main",localConfig:o,updateExistingRemote:!0,emitRemoteError:!0,skipInitIfRepoExists:!0})}function Q(t){try{return B(t),{success:!0}}catch(e){return{success:!1,error:h(e instanceof Error?e.message:String(e))}}}function z({gitUrl:t,loginAuthority:e,authResource:r}){try{return b({gitUrl:t,loginAuthority:e,authResource:r})}catch(i){throw new w(`Git credential helper setup failed: ${i instanceof Error?i.message:String(i)}`)}}function v({remoteUrl:t,cwd:e,createDirectory:r=!1,initialBranch:i,localConfig:o=[],updateExistingRemote:d=!1,emitRemoteError:u=!1,skipInitIfRepoExists:s=!1}){r&&m.mkdirSync(e,{recursive:!0});let c={stdio:"pipe",windowsHide:!0,cwd:e};s&&m.existsSync(C.join(e,".git"))||(p("git",["init"],c),i&&p("git",["symbolic-ref","HEAD",`refs/heads/${i}`],c));for(let[a,l]of o)p("git",["config","--local",a,l],c);if(t)try{p("git",["remote","add","origin",t],c)}catch(a){if(!d||!x(a).includes("already exists"))throw u&&process.stderr.write(h(x(a))),a;p("git",["remote","set-url","origin",t],c)}}function x(t){return typeof t=="object"&&t!==null&&"stderr"in t&&Buffer.isBuffer(t.stderr)?t.stderr.toString():""}function V(){let t=f(["status","--porcelain"],{captureStdout:!0,allowFailure:!0,emitStderr:!1}),e=f(["rev-list","--count","origin/main..main"],{captureStdout:!0,allowFailure:!0,emitStderr:!1}),r=e.stdout.trim();return{hasUncommittedChanges:t.success?t.stdout.trim().length>0:null,isMainAheadOfOrigin:e.success&&/^\d+$/.test(r)?Number(r)>0:null}}export{f as a,K as b,X as c,Y as d,B as e,Q as f,V as g};
|
|
17
|
-
/*!
|
|
18
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
19
|
-
*/
|
|
20
|
-
//# sourceMappingURL=chunk-DREO7EYO.js.map
|
package/dist/chunk-NP2KJOYC.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
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 b,b as $,d as K,e as W,g as D}from"./chunk-6FFQN2SO.js";import{a as H}from"./chunk-USRRI5H4.js";import{h as J,i as V,j as q}from"./chunk-5AUOEXAR.js";import{I as M,J as I,K as P,L as E,ba as T,ea as N,f as j,ja as x,la as L,ma as B,ua as g,va as O}from"./chunk-G33Q5FWT.js";import{b as y}from"./chunk-RBG2H562.js";import{r as S,s as U}from"./chunk-6MXOK2LG.js";import{c as k,d as G,h,i as R}from"./chunk-PVAIJSAI.js";import{a as C}from"./chunk-VNEZZ3RI.js";import{a as F}from"./chunk-U36HMOQW.js";async function Ce(e,n){de(e,n),await e.runVerb();let s=O();if(!s.appConfig)throw new y(`No ${F} found in the current directory. Run "${"ms"} app init" first.`);let i=await V(e),c=await e.getTenantIdAsync();if(!c)throw new y("Unable to determine tenant ID. Ensure you are logged in.");let p=await J(e),l=K(await e.getOption("access")),f=l==="edit"?W(s.appConfig):s.appConfig.repoType??"none",u=oe(e.getPositionalArgs(0));if(u.length===0)throw new y("Provide at least one principal (Entra object ID or user/group email address). Separate multiple entries with commas, spaces, or both.");let o=n==="share"&&(l==="play"||f!=="native"),a=g(),m=a.trackScenario("MaafApp.SharePermissions",{mode:n,access:l,repoType:f,inputCount:u.length});try{let t=[],r=await se(u,t,o);if(a.trackActivityEvent("MaafApp.SharePermissions.PrincipalResolution",{mode:n,inputCount:u.length,resolvedCount:r.length,failedCount:t.length,emailPassthrough:o}),r.length===0)throw new y(z(t));t.length>0&&R(z(t));let d=await(n==="share"?Z:ee)({tenantId:c,environmentId:i,appName:p,access:l,refs:r,repoType:f,jsonMode:e.isJsonMode()});m.complete({resolvedCount:r.length,failedResolutionCount:t.length,scope:d.scope,role:d.role,appScopeContributorFallback:l==="edit"&&d.scope==="app",...n==="unshare"&&{revokedCount:d.revokedCount??0,revokedPrincipalCount:d.revokedPrincipalCount??0,notFoundCount:d.notFound?.length??0,skippedCount:d.skipped?.length??0}});let v=n==="share"&&l==="edit"?await ne({appInfo:d.appInfo,tenantId:c,environmentId:i,appName:p,jsonMode:e.isJsonMode()}):void 0;e.isJsonMode()?G({access:l,partialFailure:t.length>0,...d.result,...n==="unshare"&&{revokedCount:d.revokedCount??0,revokedPrincipalCount:d.revokedPrincipalCount??0,notFound:(d.notFound??[]).map(Q),skipped:(d.skipped??[]).map(Q)},...v&&{repoType:v.repoType,cloneUrl:v.cloneUrl},warnings:t}):(ue({appName:p,mode:n,access:l,inputCount:r.length,outcome:d}),te(v))}catch(t){throw m.failure(t),t}}async function Z(e){let{tenantId:n,environmentId:s,appName:i,access:c,refs:p,repoType:l,jsonMode:f}=e;if(c==="play"){let m=p.map(r=>Y(r,I));return{result:await N({tenantId:n,environmentId:s,logger:g(),actionsParams:{appName:i,put:m,delete:[]}}),scope:"app",role:I}}if(l==="none")throw new y(b);if(l!=="native"){f||R($);let m=p.map(r=>Y(r,P));return{result:await N({tenantId:n,environmentId:s,logger:g(),actionsParams:{appName:i,put:m,delete:[]}}),scope:"app",role:P}}let u=await D({tenantId:n,environmentId:s,appName:i}),o=p.map(ce);return{result:await L({tenantId:n,environmentId:s,logger:g(),actionsParams:{repoId:u.repositoryId,put:o,delete:[]}}),scope:"repo",role:M,appInfo:u}}async function ee(e){let{tenantId:n,environmentId:s,appName:i,access:c,refs:p,repoType:l,jsonMode:f}=e,u=p.map(_),o=new Map(p.map(r=>[_(r),r]));if(c==="edit"&&l==="none")throw new y(b);let a=c==="play"||l!=="native",m=a?c==="play"?I:P:M,t;if(a)c==="edit"&&l!=="native"&&(f||R($)),t=await x({tenantId:n,environmentId:s,logger:g(),actionsParams:{appName:i,principalIds:u,roleDefinitionName:m}});else{let r=await D({tenantId:n,environmentId:s,appName:i});t=await B({tenantId:n,environmentId:s,logger:g(),actionsParams:{repoId:r.repositoryId,principalIds:u}})}return{result:t.result,scope:a?"app":"repo",role:m,revokedCount:t.revokedCount,revokedPrincipalCount:t.revokedPrincipalCount,notFound:t.notFoundPrincipalIds.map(r=>o.get(r)??{id:r,input:r}),skipped:t.skippedNullRoleAssignments.map(r=>o.get(r.principalObjectId)??{id:r.principalObjectId,input:r.principalObjectId})}}function _(e){if(!e.id)throw new y(`Could not resolve '${e.input}' to an AAD object ID. Unshare requires object IDs.`);return e.id}async function ne(e){let n=e.appInfo;if(!n)try{n=await T({tenantId:e.tenantId,environmentId:e.environmentId,logger:g(),actionsParams:{appName:e.appName}})}catch{e.jsonMode||R(`Share succeeded, but repository details for '${e.appName}' could not be read.`);return}return H(n)}function te(e){e&&(e.repoType&&h(`Repo type: ${e.repoType}`),e.cloneUrl&&h(`Clone URL: ${e.cloneUrl}`))}function oe(e){let n=new Set;for(let s of e)for(let i of s.split(",")){let c=i.trim();c&&n.add(c)}return[...n]}async function se(e,n,s){let i=new Map,c=new Map,l=(await Promise.all(e.map(async o=>{let a=o.toLowerCase(),m=i.get(a);if(m)return m;if(q(o)){let t={id:o,input:o};return i.set(a,t),t}if(!pe(o))return n.push({input:o,reason:"not an AAD object ID (GUID) or a valid email address"}),null;if(s){let t={input:o,email:o};return i.set(a,t),t}try{let t=c.get(a);t||(t=E(o,g()),c.set(a,t));let r=await t;if(!r)return n.push({input:o,reason:"no user or group found in this tenant (invite as a guest in Entra ID first if external)"}),null;let w={id:r.id,input:o,type:r.type,email:o,displayName:r.displayName};return i.set(a,w),w}catch(t){return n.push({input:o,reason:ie(t)}),null}}))).filter(o=>o!==null),f=[],u=new Set;for(let o of l){let a=(o.id??o.email??o.input).toLowerCase();u.has(a)||(u.add(a),f.push(o))}return f}function z(e){let n=e.length===1?"entry":"entries",s=e.map(i=>` - ${i.input}: ${i.reason}`);return[`Could not resolve ${e.length} ${n}:`,...s].join(`
|
|
8
|
-
`)}function ie(e){if(e instanceof j){if(e.status===403)return ae(e.status);let n=re(e.body);return n!==void 0?`Graph ${e.status}: ${n}`:e.message}return e instanceof Error?e.message:String(e)}function ae(e){return`Graph ${e}: your sign-in lacks permission to look up accounts by email. Pass the AAD object ID (GUID) instead, or have an admin grant the User.ReadBasic.All and Group.Read.All Graph permissions.`}function re(e){if(e)try{let s=JSON.parse(e)?.error?.message;return typeof s=="string"?s:void 0}catch{return}}function pe(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}function Y(e,n){return{name:e.displayName??e.input,properties:{roleName:n,principal:le(e)}}}function le(e){return e.id?e.email?{id:e.id,email:e.email}:{id:e.id}:{email:e.email??e.input}}function ce(e){let n=e.id??e.input;return{name:e.displayName??e.input,properties:{roleName:M,principal:e.type?{id:n,type:e.type}:{id:n}}}}function Q(e){return{id:e.id??e.input,label:e.displayName??e.input}}function ue(e){let{appName:n,mode:s,access:i,inputCount:c,outcome:p}=e,l=i==="play"?"play":"edit";if(s==="share"){let a=p.result.put?.length??0;if(a===0){h("No changes were applied.");return}k(`Shared app '${n}' with ${a} ${A("principal",a)}. They can now ${l} the app.`);return}let f=p.revokedCount??0,u=p.revokedPrincipalCount??f;if(u===0){h(`No ${l} assignments to revoke on '${n}' \u2014 none of the ${c} ${A("principal",c)} had existing access.`);return}if(k(`Revoked ${l} permissions for ${u} ${A("principal",u)} on '${n}'.`),p.notFound&&p.notFound.length>0){let o=p.notFound.map(a=>a.displayName??a.input).join(", ");h(`${p.notFound.length} ${A("principal",p.notFound.length)} had no existing ${l} access (no-op): ${o}`)}if(p.skipped&&p.skipped.length>0){let o=p.skipped.map(a=>a.displayName??a.input).join(", ");h(`${p.skipped.length} ${A("principal",p.skipped.length)} had a role assignment with an unknown role definition; ${l} access was not modified for: ${o}. Investigate via the role-assignments API.`)}}function A(e,n){return n===1?e:`${e}s`}function de(e,n){let s=n==="share"?C.app.share:C.app.unshare,i=n==="share"?S:U;e.setDescription(s.description),e.addExamples(s.examples),e.consumePositionalArgs("principal"),e.addOptions([{flags:{key:i.AppName.name},env:i.AppName.envVar,description:s.options.app,optionalInNonInteractive:!0},{flags:{key:i.Access.name},env:i.Access.envVar,default:i.Access.defaultValue,description:s.options.access,optionalInNonInteractive:!0}])}export{Ce as a};
|
|
9
|
-
/*!
|
|
10
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
11
|
-
*/
|
|
12
|
-
//# sourceMappingURL=chunk-NP2KJOYC.js.map
|
package/dist/chunk-QAFCXGBD.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
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 f}from"./chunk-OL6CTXQR.js";import{Y as c,ua as p}from"./chunk-G33Q5FWT.js";import{a as l}from"./chunk-RBG2H562.js";import{h as m}from"./chunk-PVAIJSAI.js";var b=1e3;function w(t){if(typeof t=="string"){let r=t.trim();return r?{errorMessage:r}:{}}if(!t||typeof t!="object")return{};let e=t,a=typeof e.code=="string"&&e.code.trim()?e.code.trim():void 0;if(typeof e.error=="string"){let r=e.error.trim(),n=g(a,r||void 0);return n?{errorMessage:n}:{}}let d,i,o;if(e.error&&typeof e.error=="object"){let r=e.error.code,n=e.error.message,u=e.error.buildOutput;d=typeof r=="string"&&r.trim()?r.trim():void 0,i=typeof n=="string"&&n.trim()?n.trim():void 0,o=typeof u=="string"&&u.trim()?u.trim():void 0}!i&&typeof e.message=="string"&&e.message.trim()&&(i=e.message.trim()),!o&&typeof e.buildOutput=="string"&&e.buildOutput.trim()&&(o=e.buildOutput.trim());let s=g(d??a,i);return s||o?{errorMessage:s,buildOutput:o}:{}}async function L(t){let e=p(),a=b,d=t.maxIntervalMs??1/0,i=Math.min(d,Math.max(a,t.initialWaitMs)),o=t.deadlineMs!=null?Date.now()+t.deadlineMs:null,s=t.isJsonMode?null:new f;s?.start(t.spinnerLabel??"Waiting for build status...");try{for(;;){if(o!==null&&Date.now()>=o)throw new l(`Build did not complete within ${Math.round(t.deadlineMs/6e4)} minutes. Commit SHA: ${t.commitSha}.`);await S(i);let r=await c({logger:e,actionsParams:{appName:t.appName,commitSha:t.commitSha}});switch(r.status){case"Succeeded":return r;case"Failed":case"Canceled":{s?.stop();let n=w(r.result);!t.isJsonMode&&n.buildOutput&&m(n.buildOutput);let u=n.errorMessage??"",M=u?`Build ${r.status.toLowerCase()}: ${u}.`:`Build ${r.status.toLowerCase()}.`;throw new l(M+(t.commitSha?` Commit SHA: ${t.commitSha}.`:""))}case"NotStarted":case"Running":{let n=r.retryAfterMs??i;i=Math.min(d,Math.max(a,n));break}default:return y(r.status)}}}finally{s?.stop()}}function y(t){throw new l(`Unexpected build status from server: ${String(t)}.`)}function g(t,e){return t&&e?`${t}: ${e}`:t??e}function S(t){return new Promise(e=>setTimeout(e,t))}export{w as a,L as b};
|
|
8
|
-
/*!
|
|
9
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
-
*/
|
|
11
|
-
//# sourceMappingURL=chunk-QAFCXGBD.js.map
|