@microsoft/managed-apps-cli 0.22.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-6DMK7O6W.js → AuthStatus-WCICFN6O.js} +2 -2
- package/dist/{AuthSwitch-NUQIIRCG.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-ICCA5DEJ.js → Dev-BTJUJGP5.js} +2 -2
- package/dist/{EnvironmentVariableAuthenticationProvider-LYCQ5D47.js → EnvironmentVariableAuthenticationProvider-VNN4AG2E.js} +2 -2
- package/dist/GetMaafBuildStatus-7B6ZNSEA.js +11 -0
- package/dist/{GetSettings-ZI2IBKV5.js → GetSettings-GJWIPK2T.js} +2 -2
- package/dist/{InfoMaafApp-FL5PICDD.js → InfoMaafApp-WGNDYYGN.js} +2 -2
- package/dist/Init-TJOSV5DE.js +11 -0
- package/dist/ListConnectorActions-HTD6YSCY.js +11 -0
- package/dist/ListConnectors-OET7STMW.js +11 -0
- package/dist/{ListMaafApps-3W6W6UYP.js → ListMaafApps-KRXJMAEU.js} +2 -2
- package/dist/{Login-7RW6OEST.js → Login-5TFNB24B.js} +2 -2
- package/dist/{Logout-IXK2TMRL.js → Logout-35U4J627.js} +2 -2
- package/dist/{MockFetch-THQJ4KFB.js → MockFetch-XSZECQYX.js} +2 -2
- package/dist/{NodeMsalAuthenticationProvider-VVQ6CCZ5.js → NodeMsalAuthenticationProvider-OUL57BVL.js} +2 -2
- package/dist/Pack-S7P4MIT6.js +8 -0
- package/dist/{PlayMaafApp-5H3DCJ2C.js → PlayMaafApp-D4KLJKLT.js} +2 -2
- package/dist/RefreshDataSource-N5CEH23S.js +11 -0
- package/dist/{RefreshGitAuth-IQBAFR37.js → RefreshGitAuth-2VL6VBLU.js} +2 -2
- package/dist/{RemoveDataSource-PGPLMJUX.js → RemoveDataSource-XR5Q4O3F.js} +2 -2
- package/dist/{ServicePrincipalAuthenticationProvider-IZZRJFZQ.js → ServicePrincipalAuthenticationProvider-H3PTPXYY.js} +2 -2
- package/dist/{SetSetting-SEWDA4TF.js → SetSetting-HXY4YSKC.js} +2 -2
- package/dist/{ShareLinkCreate-T5FN47J2.js → ShareLinkCreate-YG3DACP2.js} +2 -2
- package/dist/{ShareLinkList-6JCVEYNC.js → ShareLinkList-XF6BIB3M.js} +2 -2
- package/dist/ShareLinkRevoke-4USAQKLB.js +11 -0
- package/dist/ShareList-6QI7ZAMZ.js +11 -0
- package/dist/{ShareMaafApp-6MKZ33HW.js → ShareMaafApp-PZI5MCBA.js} +2 -2
- package/dist/{TelemetrySettings-RXPPIEVO.js → TelemetrySettings-WWVPRF7T.js} +2 -2
- package/dist/{UnshareMaafApp-OSE2TOBJ.js → UnshareMaafApp-MHBIV5OR.js} +2 -2
- package/dist/chunk-2FNWZUPW.js +15 -0
- package/dist/chunk-2HSJ2XAQ.js +13 -0
- package/dist/{chunk-PPW4XUZO.js → chunk-3FP37TPE.js} +9 -9
- package/dist/chunk-5XRK3F43.js +11 -0
- package/dist/{chunk-6RSE3J4X.js → chunk-7PH2NK5K.js} +2 -2
- package/dist/chunk-DAG6RPOF.js +11 -0
- package/dist/{chunk-SNWTSI75.js → chunk-DD7E4ADI.js} +2 -2
- package/dist/{chunk-6LKH5WE7.js → chunk-F3HGM3IU.js} +23 -21
- 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-KYL2Y5G4.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-4LIR3ZYP.js → chunk-UIW77LMA.js} +251 -251
- package/dist/chunk-WQKDXHGX.js +11 -0
- package/dist/{chunk-4VBFOKV6.js → chunk-X5O77GZS.js} +2 -2
- package/dist/{chunk-EX6IKPAO.js → chunk-Y7TZZLPW.js} +2 -2
- package/dist/chunk-ZIONKKAV.js +44 -0
- package/package.json +4 -4
- package/dist/AddConnector-5DUBFLEK.js +0 -41
- package/dist/BuildMaafApp-A4IUU6LI.js +0 -11
- package/dist/Cli-LYSWG64H.js +0 -54
- package/dist/CloneMaafApp-B672N7T5.js +0 -11
- package/dist/CreateMaafApp-RWL7FXSP.js +0 -20
- package/dist/DeleteMaafApp-GT4CEFAE.js +0 -11
- package/dist/DeployMaafApp-E4TQU6RO.js +0 -14
- package/dist/GetMaafBuildStatus-UGAHVANE.js +0 -11
- package/dist/Init-XCSK3WQM.js +0 -11
- package/dist/ListConnectorActions-B2YD24RX.js +0 -11
- package/dist/ListConnectors-MYUEVJPT.js +0 -11
- package/dist/Pack-IWU3PFQL.js +0 -8
- package/dist/RefreshDataSource-XQT7LVMO.js +0 -11
- package/dist/ShareLinkRevoke-OH5DZDHR.js +0 -11
- package/dist/ShareList-QCEL7QNJ.js +0 -11
- package/dist/chunk-23T63QIT.js +0 -15
- package/dist/chunk-3JIZGVCA.js +0 -11
- package/dist/chunk-47LJLFDF.js +0 -11
- package/dist/chunk-7BRIEYGR.js +0 -20
- package/dist/chunk-7GGFN2IW.js +0 -11
- package/dist/chunk-AQLFVAFU.js +0 -38
- package/dist/chunk-EQCYKUEU.js +0 -12
- package/dist/chunk-IQGMFWXB.js +0 -12
- package/dist/chunk-LQ65CHNN.js +0 -13
- package/dist/chunk-UNJJUCSA.js +0 -11
- package/dist/chunk-VMSJG53Y.js +0 -11
|
@@ -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 oe}from"./chunk-OL6CTXQR.js";import{a as ce,b as ue,d as le}from"./chunk-IQGMFWXB.js";import{a as ae,b as pe}from"./chunk-23T63QIT.js";import{a as xe}from"./chunk-TYRVM4PP.js";import{a as se}from"./chunk-KYL2Y5G4.js";import"./chunk-7GGFN2IW.js";import"./chunk-4VBFOKV6.js";import{a as F,b as re,c as d,g as G}from"./chunk-7BRIEYGR.js";import{e as T,i as ie}from"./chunk-SNWTSI75.js";import{Z as ee,d as K,f as Q,q as X,ua as te,va as ne}from"./chunk-4LIR3ZYP.js";import{a as I,b as p,c as U,d as v,e as Z}from"./chunk-RBG2H562.js";import"./chunk-UNJJUCSA.js";import{a as _}from"./chunk-6RSE3J4X.js";import"./chunk-EX6IKPAO.js";import{k as i}from"./chunk-3JIZGVCA.js";import{c as Y,d as J,e as z,h as R,i as V}from"./chunk-PVAIJSAI.js";import{a as g}from"./chunk-47LJLFDF.js";import{a as q,g as W}from"./chunk-PPW4XUZO.js";import"./chunk-Y5AMO72S.js";import{d as ke}from"./chunk-UT667QSU.js";import*as l from"fs";import*as ye from"os";import*as x from"path";import*as w from"fs";import*as de from"os";import*as k from"path";function P(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,E,...f]=S,C=E.endsWith(".git")?E.slice(0,-4):E,O=c.hash?c.hash.slice(1):void 0;if(f.length===0)return{owner:y,repo:C,subdir:"",ref:O};if(f[0].toLowerCase()==="tree"&&f.length>=2)return{owner:y,repo:C,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 fe(e,t){let n=P(e),r=`https://github.com/${n.owner}/${n.repo}.git`,s=w.mkdtempSync(k.join(de.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=ke(xe(),1);function me(){let e=d(["--version"],{captureStdout:!0,allowFailure:!0,emitStderr:!1});if(!e.success)throw new v("'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 v(`Git ${n} is required (found ${r.version}). Please upgrade git.`)}var Ne="github:microsoft/Managed-Apps/templates/vite8",D="Initial scaffold from 'ms app create'";async function Rt(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}=le(A),S=await e.getOption("repositoryId",!0),y=e.isJsonMode();if(!y){let u=W(r),b=u?`cloud ${u}`:`region ${r}`;R(`About to create app '${s}' in tenant ${t} (${b}).`)}let E=!y&&process.stdout.isTTY;!y&&!E&&R("Running preflight checks...");let f=E?new oe: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..."),me(),f?.update("Verifying target directory is writable..."),We(o),a==="github"?(f?.update("Verifying target directory is empty..."),he(o),f?.update(`Verifying ${c} is empty...`),qe(c)):(f?.update("Verifying target directory is empty..."),ge(o))}finally{f?.stop()}let C=await ie(e,{failIfMissing:!1}),O=C?void 0:ae(e,t,n,"CreateMaafApp"),Ee=await e.getOption("description",!0),Re=await e.getOption("buildPath",!0),Ae=await e.getOption("buildCommand",!0),Se=await e.getOption("buildEntryPoint",!0),L=await pe(C,O);e.updateEnvironmentId(L),a==="github"?he(o):ge(o);let Ce=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 Ie={displayName:s,description:Ee,repositoryId:S,remoteUrl:c,repoType:a,origin:ne().origin},Te=({isRetry:u})=>ee({tenantId:t,environmentId:L,logger:n,actionsParams:{...Ie,...$e&&!u&&{forceReauth:!0}}}),j;try{j=await se(Te,{repoType:a,externalRepoUrl:c,tenantId:t,jsonMode:y,openBrowser:Ce,verb:"app create"})}catch(u){let b=je(u,{repoType:a,environmentId:L});throw b||u}let{app:m,cloneUrl:$}=j;if(a==="native"&&!$){let u=H(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(He({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
|
-
`+H(m.id,m.environmentId))}else a==="native"?G({directory:o,gitUrl:$,loginAuthority:e.getLoginAuthority(t),authResource:e.getAuthResourceUrl()}):l.mkdirSync(o,{recursive:!0});y||R(`Fetching template '${h}' into ${o}...`),fe(h,{dir:o}),await ue(o,y,e.getHttpClient());let u=ce({appId:m.id,appDisplayName:m.displayName,description:m.description,environmentId:m.environmentId,repoType:a,cloud:e.getCloud(),buildPath:Re,buildCommand:Ae,buildEntryPoint:Se,repositoryId:a==="native"?m.repositoryId:void 0,externalRepoUrl:a==="github"?c:void 0});await K(x.join(o,q),u),a!=="none"&&(B=await Me(o,y,a==="native"?$: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
|
-
`+H(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"&&$&&{gitRemoteUrl:$},appDir:o,...B&&{push:B}}):(Y(`Created app '${m.displayName}' in ${o}.`),a==="github"?R(`Bound to external repository: ${c}.`):a==="none"&&R("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 Me(e,t,n){let r=n?void 0:`git add . && git commit -m "${D}" && git push -u origin HEAD`;try{return d(["add","."],{cwd:e}),d(["commit","-m",D],{cwd:e}),n&&Le(e,n,t),d(["push","-u","origin","HEAD"],{cwd:e,network:!0,classify:n?{action:`pushing to ${F(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 Le(e,t,n){re(t,n,"the initial git fetch and push"),Be(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",D],{cwd:e}))}function Be(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 ${F(t)}`}})}var Ve=["repository not found","fatal: repository","could not read username","terminal prompts disabled","authentication failed","permission denied","403","remote: not found"];function Ue(e){let t=e.stderr;return typeof t=="string"?t:Buffer.isBuffer(t)?t.toString():t instanceof Uint8Array?Buffer.from(t).toString():""}function we(e,t){let n=e instanceof Error?e.message:String(e),r=t.trim();return!r||n.includes(r)?n:`${n}
|
|
14
|
-
${r}`}function be(e){let t=e.toLowerCase();return Ve.some(n=>t.includes(n))}function ve(){return"Make sure the repository exists and that you have access to it."}function Fe({directory:e,repoUrl:t}){return`Failed to clone '${t}' into '${e}'. `+ve()}function Ge(e){return`Cannot access repository '${e}', so no app was created. `+ve()}function Pe({directory:e,repoUrl:t}){return`Failed to clone '${t}' into '${e}'. See the git output above for details.`}function He({directory:e,repoUrl:t}){try{d(["clone",t,e],{emitStderr:!1})}catch(n){let r=Ue(n);r&&process.stderr.write(r);let s=be(r)?Fe({directory:e,repoUrl:t}):Pe({directory:e,repoUrl:t});throw new v(s,{underlyingError:we(n,r)})}}function H(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){P(e)}function ge(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 he(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(ye.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(be(o))throw new v(Ge(e),{underlyingError:we(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 v(`'${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:Ne,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{H as buildOrphanedAppRecoveryHint,He as cloneRepo,Me as commitAndPushScaffoldAsync,Rt as createMaafAppAsync,qe as ensureExternalRepoIsEmpty,he as ensureRepoTargetDirectoryEmpty,ge as ensureTargetDirectoryEmpty,We as ensureTargetDirectoryWritable,_e as ensureTemplateSourceValid,G as initLocalRepo};
|
|
17
|
-
/*!
|
|
18
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
19
|
-
*/
|
|
20
|
-
//# sourceMappingURL=CreateMaafApp-RWL7FXSP.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-SNWTSI75.js";import{_ as m,ua as l,va as f}from"./chunk-4LIR3ZYP.js";import{b as c}from"./chunk-RBG2H562.js";import"./chunk-UNJJUCSA.js";import"./chunk-6RSE3J4X.js";import"./chunk-EX6IKPAO.js";import{r as o}from"./chunk-3JIZGVCA.js";import{c as s,d,i as p}from"./chunk-PVAIJSAI.js";import{a as t}from"./chunk-47LJLFDF.js";import"./chunk-PPW4XUZO.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-GT4CEFAE.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-VMSJG53Y.js";import{a as it,b as W,c as j}from"./chunk-6LKH5WE7.js";import"./chunk-HBLO3WDD.js";import"./chunk-OL6CTXQR.js";import{a as V}from"./chunk-KYL2Y5G4.js";import"./chunk-7GGFN2IW.js";import"./chunk-4VBFOKV6.js";import{d as J,j as H}from"./chunk-7BRIEYGR.js";import{b as T,h as G}from"./chunk-SNWTSI75.js";import{$ as _,X as L,f as O,fa as P,ua as R,va as I}from"./chunk-4LIR3ZYP.js";import{a as p,b as o,d as C,g as B}from"./chunk-RBG2H562.js";import"./chunk-UNJJUCSA.js";import"./chunk-6RSE3J4X.js";import{a as z}from"./chunk-EX6IKPAO.js";import{q as l}from"./chunk-3JIZGVCA.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-47LJLFDF.js";import{a as A}from"./chunk-PPW4XUZO.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=J();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 V(({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=H(),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-E4TQU6RO.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-VMSJG53Y.js";import"./chunk-OL6CTXQR.js";import{d as D}from"./chunk-7BRIEYGR.js";import{h as v}from"./chunk-SNWTSI75.js";import{Y as S,aa as A,ua as f}from"./chunk-4LIR3ZYP.js";import{b as l}from"./chunk-RBG2H562.js";import"./chunk-UNJJUCSA.js";import"./chunk-6RSE3J4X.js";import"./chunk-EX6IKPAO.js";import{o as s}from"./chunk-3JIZGVCA.js";import{d as y,h as i}from"./chunk-PVAIJSAI.js";import{a as r}from"./chunk-47LJLFDF.js";import{a as c}from"./chunk-PPW4XUZO.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-UGAHVANE.js.map
|
package/dist/Init-XCSK3WQM.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-IQGMFWXB.js";import{a as W,b as q}from"./chunk-23T63QIT.js";import"./chunk-TYRVM4PP.js";import{a as J}from"./chunk-KYL2Y5G4.js";import"./chunk-7GGFN2IW.js";import"./chunk-4VBFOKV6.js";import{e as P,f as j,i as H}from"./chunk-7BRIEYGR.js";import{b as T,e as d,i as F}from"./chunk-SNWTSI75.js";import{E as S,Z as L,d as x,oa as G,ua as M,va as z}from"./chunk-4LIR3ZYP.js";import{a as D,b as f,e as V,f as O}from"./chunk-RBG2H562.js";import"./chunk-UNJJUCSA.js";import"./chunk-6RSE3J4X.js";import"./chunk-EX6IKPAO.js";import{z as e}from"./chunk-3JIZGVCA.js";import{c as B,d as $,h as s,i as A}from"./chunk-PVAIJSAI.js";import{a}from"./chunk-47LJLFDF.js";import{a as b}from"./chunk-PPW4XUZO.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?W(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=P();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 q(u,U);t.updateEnvironmentId(v);let re={displayName:N,description:Z,repositoryId:k,remoteUrl:p,repoType:n,origin:l.origin},c=await J(({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=H({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=j(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-XCSK3WQM.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-23T63QIT.js";import{e as r}from"./chunk-SNWTSI75.js";import{R as A,ua as g}from"./chunk-4LIR3ZYP.js";import{b as f}from"./chunk-RBG2H562.js";import"./chunk-UNJJUCSA.js";import"./chunk-6RSE3J4X.js";import"./chunk-EX6IKPAO.js";import{b as s,j as n}from"./chunk-3JIZGVCA.js";import{f as d}from"./chunk-PVAIJSAI.js";import{a as e}from"./chunk-47LJLFDF.js";import"./chunk-PPW4XUZO.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-B2YD24RX.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-23T63QIT.js";import{e as f}from"./chunk-SNWTSI75.js";import{S as p,ua as d}from"./chunk-4LIR3ZYP.js";import{b as m}from"./chunk-RBG2H562.js";import"./chunk-UNJJUCSA.js";import"./chunk-6RSE3J4X.js";import"./chunk-EX6IKPAO.js";import{h as o}from"./chunk-3JIZGVCA.js";import{f as l}from"./chunk-PVAIJSAI.js";import{a as n}from"./chunk-47LJLFDF.js";import"./chunk-PPW4XUZO.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-MYUEVJPT.js.map
|
package/dist/Pack-IWU3PFQL.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-6LKH5WE7.js";import"./chunk-HBLO3WDD.js";import"./chunk-OL6CTXQR.js";import"./chunk-4LIR3ZYP.js";import"./chunk-RBG2H562.js";import"./chunk-UNJJUCSA.js";import"./chunk-6RSE3J4X.js";import"./chunk-EX6IKPAO.js";import"./chunk-PVAIJSAI.js";import"./chunk-47LJLFDF.js";import"./chunk-PPW4XUZO.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";export{a as assertPackPreconditions,b as packAppArtifactAsync,c as packAsync};
|
|
8
|
-
//# sourceMappingURL=Pack-IWU3PFQL.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-SNWTSI75.js";import{V as u,W as g,q as d,ua as h,va as S}from"./chunk-4LIR3ZYP.js";import"./chunk-RBG2H562.js";import"./chunk-UNJJUCSA.js";import"./chunk-6RSE3J4X.js";import"./chunk-EX6IKPAO.js";import{e as t}from"./chunk-3JIZGVCA.js";import{c as p,h as l,j as m}from"./chunk-PVAIJSAI.js";import{a}from"./chunk-47LJLFDF.js";import"./chunk-PPW4XUZO.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-XQT7LVMO.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-SNWTSI75.js";import{f,ia as k,ua as m,va as v}from"./chunk-4LIR3ZYP.js";import{b as p}from"./chunk-RBG2H562.js";import"./chunk-UNJJUCSA.js";import"./chunk-6RSE3J4X.js";import"./chunk-EX6IKPAO.js";import{y as n}from"./chunk-3JIZGVCA.js";import{c as l,d as a,i as s}from"./chunk-PVAIJSAI.js";import{a as i}from"./chunk-47LJLFDF.js";import"./chunk-PPW4XUZO.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-OH5DZDHR.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-LQ65CHNN.js";import{h as E,i as b}from"./chunk-SNWTSI75.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-4LIR3ZYP.js";import{b as u}from"./chunk-RBG2H562.js";import"./chunk-UNJJUCSA.js";import"./chunk-6RSE3J4X.js";import"./chunk-EX6IKPAO.js";import{x as r}from"./chunk-3JIZGVCA.js";import{a as v,d as w,h as D,i as T}from"./chunk-PVAIJSAI.js";import{a as l}from"./chunk-47LJLFDF.js";import"./chunk-PPW4XUZO.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-QCEL7QNJ.js.map
|
package/dist/chunk-23T63QIT.js
DELETED
|
@@ -1,15 +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{i as E}from"./chunk-SNWTSI75.js";import{k as u,l as f,n as l,o as p,q as w}from"./chunk-4LIR3ZYP.js";import{b as a,f as c}from"./chunk-RBG2H562.js";import{n as y}from"./chunk-UNJJUCSA.js";import{h as m,j as v}from"./chunk-PVAIJSAI.js";async function R(n,r,t){try{let e=await n;if(e.status===200){if(e.data.operationSuccess===!1||e.data.environmentFound===!1||e.data.errorCode)throw new u(200,e.data.message,e.data.errorCode);let i=e.data.environment?.name;if(!i)throw new c("Routing service returned 200 with no environment name.");return i}let o=await p(r,e.pollingUrl,e.authResource,t);if(!o.environment?.name)throw new c("Routing service finished provisioning but returned no environment name.");return o.environment.name}catch(e){throw A(e)}}function A(n){if(n instanceof u){let r=n.apiMessage?` ${n.apiMessage}`:" Ensure your account has the required permissions to create a Developer environment.";return new a(`Could not provision a Developer environment for your tenant (status ${n.status}).${r}`)}return n instanceof f?new a("Timed out waiting for a Developer environment to provision. Try again."):n instanceof Error?n:new Error(String(n))}function P(n,r,t,e,o){let{trackBackgroundFailure:i=!0}=o??{},g=n.getHttpClient(),{region:I}=w(),d=R(l(g,r,y,{provisionDataverse:!1},I,t),g,t);return i&&d.catch(s=>{t.trackErrorEvent(`${e}.RoutingEnvironmentBackgroundFailure`,{error:s instanceof Error?s.message:String(s)})}),d}function h(n){let r=n instanceof Error?n.message:String(n);v(`Failed to resolve a developer environment.
|
|
8
|
-
|
|
9
|
-
${r}
|
|
10
|
-
|
|
11
|
-
To retry, run the same command again. Alternatively, pass --environment-id <id> to use a known environment.`)}async function b(n,r){if(n)return n;if(!r)throw new a("Unable to resolve a developer environment. Pass --environment-id <id> to specify one explicitly.");try{return await r}catch(t){throw h(t),t}}async function D(n,r,t){let e=await E(n,{failIfMissing:!1});if(e)return e;let o=await n.getTenantIdAsync();if(!o)throw new a("Unable to determine tenant ID. Ensure you are logged in.");t?.jsonMode||m("No environment specified \u2014 resolving your developer environment\u2026");let i=await k(n,o,r,t?.telemetryNamespace??"BrowseVerb");return n.updateEnvironmentId(i),t?.jsonMode||m(`Using developer environment ${i}.`),i}async function k(n,r,t,e){try{return await P(n,r,t,e,{trackBackgroundFailure:!1})}catch(o){throw h(o),o}}export{P as a,b,D as c};
|
|
12
|
-
/*!
|
|
13
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
14
|
-
*/
|
|
15
|
-
//# sourceMappingURL=chunk-23T63QIT.js.map
|
package/dist/chunk-3JIZGVCA.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"}},r={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"}},e={SkipCodegen:{name:"skip-codegen",env:"SKIP_CODEGEN"},UseV1Codegen:{name:"use-v1-codegen",env:"USE_V1_CODEGEN"}},m={...e},t={Table:{name:"table",alias:"t",promptMessage:"Please provide the table name:",envVar:"TABLE_NAME"},...e},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"},...e},c={ConnectionRef:{name:"connection-ref",alias:"cr",promptMessage:"Please provide the Connection Reference:",envVar:"CONNECTION_REF"},...e},A={DataSourceName:{name:"name",alias:"n",promptMessage:"Please provide the data source or table name:",envVar:"DATA_SOURCE_NAME"}},l={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={SearchTerm:{...r.Search,promptMessage:"Please provide a search term to filter Dataverse operations by name:",envVar:"DATAVERSE_API_SEARCH_TERM"}},P={Search:{...r.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"}},_={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:{...r.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 s={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"}},a={name:"force-reauth",camelName:"forceReauth"},u={...s,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:a},E={App:{name:"app",promptMessage:"Please provide the app ID:"},EnvironmentId:{name:"environment-id",alias:"e",envVar:"MAAF_ENVIRONMENT_ID"},Directory:"[directory]"},g={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:a},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"},Branch:{name:"branch"},NoBrowser:{name:"no-browser",camelName:"browser"}},C={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:a},S={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"}},n={name:"app",promptMessage:"Please provide the app name:",envVar:"MAAF_APP_NAME"},o={name:"environment-id",alias:"e",envVar:"MAAF_ENVIRONMENT_ID"},T={AppName:n,EnvironmentId:o},f={AppName:n,EnvironmentId:o},L={AppName:n,EnvironmentId:o,Access:{name:"access",envVar:"MAAF_APP_ACCESS"}},F={AppName:n,EnvironmentId:o,LinkId:{name:"link-id",alias:"l",promptMessage:"Please provide the share link ID:",envVar:"MAAF_SHARE_LINK_ID"},Force:{name:"force",alias:"f"}},b={...s,Repo:{name:"repo",envVar:"APP_REPO"},OpenBrowser:{name:"open-browser",camelName:"openBrowser"},ForceReauth:a};export{p as a,r as b,i as c,A as d,l as e,d as f,v as g,P as h,_ as i,N as j,u as k,E as l,g as m,h as n,I as o,V as p,C as q,S as r,O as s,D as t,R as u,T as v,f as w,L as x,F as y,b as z};
|
|
8
|
-
/*!
|
|
9
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
-
*/
|
|
11
|
-
//# sourceMappingURL=chunk-3JIZGVCA.js.map
|
package/dist/chunk-47LJLFDF.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 t}from"./chunk-PPW4XUZO.js";var n={global:{programDescription:"CLI for Microsoft managed apps.",cloud:"Cloud environment to target. Valid values include: public, usgov, usgovhigh, usgovdod, china. Defaults to public."},auth:{login:{description:"Sign in to Microsoft Entra ID.",examples:[`${"ms"} auth login`,`${"ms"} auth login --account user@contoso.com`,`${"ms"} auth login --device-code`],options:{account:"Username (email) to pre-fill in the browser sign-in prompt. This is a hint passed to the identity provider, not validated against cached accounts \u2014 use `auth switch --account` to choose between cached accounts.",deviceCode:"Sign in using the device code flow instead of opening a browser. Prints a URL and a code to enter on another device \u2014 use this on headless machines or over SSH where no browser is available."}},logout:{description:"Clear all cached credentials. Removes every cached account and the active-account pointer. Use `auth switch` to change which cached account is active without logging out.",examples:[`${"ms"} auth logout`]},status:{description:"Show cached accounts. The active account (used by other CLI commands) is marked.",examples:[`${"ms"} auth status`,`${"ms"} auth status --json`]},switch:{description:"Choose which cached account other CLI commands run as. When more than one account is cached and --account is omitted, prompts interactively; in non-interactive mode --account is required.",examples:[`${"ms"} auth switch`,`${"ms"} auth switch --account user@contoso.com`],options:{account:"Username (email) or home account ID of the account to make active."}}},app:{clone:{description:"Clone an existing app with a platform-managed repository into an empty target directory and configure Git Credential Manager. Apps bound to external repositories or without source control are not supported.",options:{app:"App ID (GUID) of the app to clone.",environmentId:"Environment ID containing the app (optional)."},examples:[`${"ms"} app clone --app <app-id>`,`${"ms"} app clone ./my-app --app <app-id>`]},create:{description:`Create a new managed app and scaffold the app template into an empty target directory. Provisions a platform-managed git repo by default; see --repo to bind an external GitHub repo or skip git scaffolding. To bind an existing project instead, use '${"ms"} app init'.`,options:{environmentId:"Target environment ID for the new managed app (optional).",displayName:"Display name for the managed app.",description:"Optional description for the managed app.",repositoryId:"Repository ID to associate with the managed app for source control.",template:"GitHub repository or subpath to scaffold the managed app from (e.g. github:owner/repo/subdir). Defaults to github:microsoft/Managed-Apps/templates/vite8. Applies to all --repo modes (native, --repo <url>, and --repo none).",buildPath:"Path to the build output directory. Defaults to ./dist.",buildCommand:'Full shell command used to build the app. Defaults to "npm run build".',buildEntryPoint:"Entry point HTML file for the app. Defaults to index.html.",repo:"Source-control binding for the new app. Omit to use the default platform-managed flow. Pass a repository URL \u2014 for example a GitHub Enterprise Cloud tenant URL (e.g. https://myorg.ghe.com/contoso/expense-tracker) or github.com (e.g. https://github.com/contoso/expense-tracker) \u2014 to bind to an external repo; the repo must already exist and must be empty, and the CLI clones it into [directory] and overlays the template. The server is the authority on which hosts/schemes are accepted. Pass '--repo none' to skip all git binding: the CLI scaffolds the template and writes ms.config.json into [directory] but does not init a local git repo or bind to a remote. The target directory must be empty in every mode \u2014 to bind an existing project to a new app, use 'ms app init' instead. Cannot be combined with --repository-id.",openBrowser:"Launch the browser to complete the GitHub device code flow during inline GitHub authentication. Default: do not launch. Has no effect when `--json` is set (JSON mode never launches a browser).",forceReauth:"Bypass the stored GitHub authentication mapping and force re-authentication via device code flow, as if the mapping had expired. Has no effect on apps not bound to an external GitHub repository."},examples:[`${"ms"} app create --display-name "My App" --repository-id <id>`,`${"ms"} app create ./my-app --display-name "My App" --repository-id <id>`,`${"ms"} app create ./my-app --display-name "My App" --repository-id <id> --description "A description"`,`${"ms"} app create ./my-app --display-name "My App" --repo https://myorg.ghe.com/contoso/expense-tracker`,`${"ms"} app create ./my-app --display-name "My App" --repo none`]},init:{description:"Convert an existing project into a managed app.",options:{environmentId:"Target environment ID for the new managed app (optional).",cloud:"Cloud environment to target. Valid values include: public, usgov, usgovhigh, usgovdod, china. Defaults to public.",displayName:"Display name for the managed app.",description:"Optional description for the managed app.",buildPath:"Path to the build output directory. Defaults to ./dist.",buildCommand:'Full shell command used to build the app. Defaults to "npm run build".',fileEntryPoint:"Entry point HTML file for the app. Defaults to index.html.",appUrl:"Local development URL for the app. Defaults to http://localhost:3000.",buildEntryPoint:"Entry point HTML file for the app. Defaults to index.html.",repo:"Repository behavior for init. Pass '--repo native' to force a platform-managed repo without inspecting the current git setup. Pass '--repo none' to use BYO build flow (no platform-managed repo). Pass '--repo <repo-url>' to bind to an existing GitHub repo (current directory must already contain the cloned repo). Omit to auto-detect current git setup and prompt in interactive mode.",iconPath:"Optional path to a .png or .jpg app icon, written to ms.config.json as iconPath.",localAppUrl:"Optional local development URL for the app, written to ms.config.json as localAppUrl.",openBrowser:"Launch the browser to complete the GitHub device code flow during inline GitHub authentication. Default: do not launch. Has no effect when `--json` is set (JSON mode never launches a browser).",forceReauth:"Bypass the stored GitHub authentication mapping and force re-authentication via device code flow, as if the mapping had expired. Has no effect on apps not bound to an external GitHub repository."},examples:[`${"ms"} app init --display-name "My App" --environment-id <id>`,`${"ms"} app init --display-name "My App" --environment-id <id> --description "A description"`,`${"ms"} app init --display-name "My App" --environment-id <id> --build-path ./out`,`${"ms"} app init --display-name "My App" --repo none`,`${"ms"} app init --display-name "My App" --repo https://myorg.ghe.com/contoso/expense-tracker`]},list:{description:"List all apps you have access to with play URLs. Interactive text output shows edit access; non-interactive and JSON output include clone URL details when available for edit access. By default returns both edit and play access apps across the tenant; pass --environment-id to filter to a single environment.",options:{environmentId:"Optional environment ID to scope the listing to. When omitted, all apps the user can access across the tenant are returned.",permission:"Optional permission filter. Use `edit` for apps the user can contribute to, or `play` for apps the user can play/view. Omit to return both. Case-insensitive."},examples:[`${"ms"} app list`,`${"ms"} app list --json`,`${"ms"} app list --environment-id <id>`,`${"ms"} app list --permission play`]},info:{description:"Show an app's configuration and bound resources.",options:{app:`The app identifier to retrieve (logical name or app ID GUID). Defaults to the current app in ${t}.`,environmentId:`Override the environment ID. Defaults to environmentId in ${t}; when neither is set, the environment is resolved automatically from the app identifier.`},examples:[`${"ms"} app info --app my-app`,`${"ms"} app info --app <guid>`,`${"ms"} app info --app my-app --json`]},show:{deprecation:`(deprecated) '${"ms"} app show' is deprecated. Use '${"ms"} app info' instead.`,examples:[`${"ms"} app show`,`${"ms"} app show --json`]},delete:{description:"Delete an app. Soft-deletes the app and cleans up related metadata.",options:{app:`The app name to delete. Defaults to the current app in ${t}.`,environmentId:"Override the environment ID. When omitted, the environment is resolved automatically from the app. Useful for deleting an app from outside its scaffolded directory.",force:"Skip the confirmation prompt."},examples:[`${"ms"} app delete`,`${"ms"} app delete --app my-app`,`${"ms"} app delete --app my-app --environment-id <id> --force`,`${"ms"} app delete --json --force`]},share:{description:"Share an app with users, groups, or service principals. Provide a comma-separated list of user or group email addresses or Entra object IDs. Service principals must be specified by object ID, not application (client) ID. Use --access play (default) to grant play access to the app, or --access edit to grant edit access to the underlying repository. To distribute access via a tenant-wide link instead of named principals, use `ms app share link create` (run `ms app share link --help` for the full link surface).",options:{app:`The app name to share. Defaults to the current app in ${t}.`,access:'Access level to grant: "play" (default \u2014 run the app) or "edit" (modify the app).'},examples:[`${"ms"} app share alice@contoso.com,bob@contoso.com`,`${"ms"} app share --app my-app <aad-id>`,`${"ms"} app share <service-principal-object-id>`,`${"ms"} app share alice@contoso.com --access edit`,`${"ms"} app share alice@contoso.com --json`,`${"ms"} app share link create`],list:{description:"List the users, groups, and service principals an app is shared with at a given access level.",options:{app:`The app name. Defaults to the current app in ${t}.`,environmentId:`Override the environment ID. Defaults to environmentId in ${t}.`,access:'Access level to list (required): "play" (run the app) or "edit" (modify the app).'},examples:[`${"ms"} app share list --access play`,`${"ms"} app share list --access edit`,`${"ms"} app share list --access edit --app my-app`,`${"ms"} app share list --access play --json`]}},unshare:{description:"Unshare an app from users, groups, or service principals. Provide a comma-separated list of user or group email addresses or Entra object IDs. Service principals must be specified by object ID, not application (client) ID. Use --access play (default) to revoke play access on the app, or --access edit to revoke edit access on the underlying repository. Each invocation only touches the requested access level.",options:{app:`The app name to unshare. Defaults to the current app in ${t}.`,access:'Access level to revoke: "play" (default \u2014 app access) or "edit" (repository access).'},examples:[`${"ms"} app unshare alice@contoso.com,bob@contoso.com`,`${"ms"} app unshare --app my-app <aad-id>`,`${"ms"} app unshare alice@contoso.com --access edit`,`${"ms"} app unshare alice@contoso.com --json`]},shareLink:{description:"Manage tenant-wide share links for a managed app. A share link is a JIT-redemption URL: the first time a recipient opens it, they are granted the configured role at the app scope. Links can be listed and revoked at any time.",create:{description:'Create a share link for a managed app. The link grants the "Microsoft App Reader" role at the app scope on redemption. Only this role is supported today; the enum is open server-side for future expansion.',options:{app:`The app name to share. Defaults to the current app in ${t}.`,environmentId:`Override the environment ID. Defaults to environmentId in ${t}.`},examples:[`${"ms"} app share link create`,`${"ms"} app share link create --app my-app`,`${"ms"} app share link create --json`]},list:{description:"List all share links currently issued for a managed app.",options:{app:`The app name. Defaults to the current app in ${t}.`,environmentId:`Override the environment ID. Defaults to environmentId in ${t}.`},examples:[`${"ms"} app share link list`,`${"ms"} app share link list --app my-app`,`${"ms"} app share link list --json`]},revoke:{description:"Revoke a share link by ID. The server attempts to remove the role assignment for every prior redeemer before tearing down the link record; new recipients can no longer redeem the link.",options:{app:`The app name. Defaults to the current app in ${t}.`,environmentId:`Override the environment ID. Defaults to environmentId in ${t}.`,linkId:"The share link ID (4-char lowercase hex) returned at creation time.",force:"Skip the confirmation prompt."},examples:[`${"ms"} app share link revoke --link-id a3f1`,`${"ms"} app share link revoke --link-id a3f1 --force`,`${"ms"} app share link revoke --link-id a3f1 --app my-app --json`]}},build:{description:"Initiate a build for an app. By default the CLI waits for build-status to reach a terminal state; pass --no-wait to return immediately after submission.",options:{appName:"The app name to build.",commitSha:"The commit ID to build from.",openBrowser:"Launch the browser to complete the GitHub device code flow during inline GitHub authentication. Default: do not launch. Has no effect when `--json` is set (JSON mode never launches a browser). Only relevant for apps bound to an external GitHub repository.",noWait:"Return immediately after submitting the build and print a build-status hint.",forceReauth:"Bypass the stored GitHub authentication mapping and force re-authentication via device code flow, as if the mapping had expired. Has no effect on apps not bound to an external GitHub repository."},examples:[`${"ms"} app build --app my-app --commit abc1234`,`${"ms"} app build --app my-app --commit abc1234 --no-wait`,`${"ms"} app build --app my-app --commit abc1234 --json`]},buildStatus:{description:"Check the status of a build.",options:{appName:"The app name.",commitSha:"The commit ID for which a build was initiated by app build.",showLog:"Fetch and print the build log when available."},examples:[`${"ms"} app build-status --app my-app --commit <sha>`,`${"ms"} app build-status --app my-app --commit <sha> --show-log`,`${"ms"} app build-status --app my-app --commit <sha> --json`]},deploy:{description:`Build and deploy an app to live. Behavior depends on the app's repoType in ${t}: git-backed apps (native/github) deploy a commit (default HEAD; override with --commit). External-artifact apps (repoType: 'none') pack and upload locally, or upload a pre-built .zip when --artifact is supplied.`,options:{app:`The app name to deploy. Defaults to the current app in ${t}.`,commit:"The commit ID to deploy (git-backed apps only). Defaults to the commit at HEAD.",artifact:"Path to a local .zip build artifact to upload and deploy. Only valid for apps created with repoType: 'none'; rejected on git-backed apps. Mutually exclusive with --commit.",force:"Deploy even when the working tree has uncommitted changes or local main is ahead of origin/main. Skips the confirmation prompt in interactive mode and the validation error in non-interactive mode.",openBrowser:"Launch the browser to complete the GitHub device code flow during inline GitHub authentication. Default: do not launch. Has no effect when `--json` is set (JSON mode never launches a browser). Only relevant for apps bound to an external GitHub repository.",forceReauth:"Bypass the stored GitHub authentication mapping and force re-authentication via device code flow, as if the mapping had expired. Has no effect on apps not bound to an external GitHub repository."},examples:[`${"ms"} app deploy`,`${"ms"} app deploy --app my-app --commit abc1234`,`${"ms"} app deploy --force`,`${"ms"} app deploy --artifact ./build.zip`,`${"ms"} app deploy --app my-app --commit abc1234 --json`]},pack:{description:"Build the app and copy the output to .ms/packed/apps/<appId>/client/ for local inspection.",examples:[`${"ms"} app pack`]},play:{description:"Open a managed app in the browser. Use --mode live (default) to launch the deployed version, or --mode preview to preview the app on the main branch, a provided branch, or a provided commit ID.",options:{app:`The app name to play. Defaults to the current app in ${t}.`,mode:"Which app to open: 'live' (default \u2014 the deployed version) or 'preview'.",commit:"Preview mode only. The commit ID to open. Cannot be combined with --branch.",branch:"Preview mode only. The branch to open. Defaults to main and cannot be combined with --commit.",noBrowser:"Print the URL but do not open a browser window."},examples:[`${"ms"} app play`,`${"ms"} app play --mode preview`,`${"ms"} app play --mode preview --branch feature/my-change`,`${"ms"} app play --mode preview --commit abc1234`,`${"ms"} app play --app my-app --no-browser`,`${"ms"} app play --json`]},dev:{description:"Start local development.",options:{port:"Port number for the local config server.",localAppUrl:"Local URL where the app is running.",configOnly:"Start only the config server without running the dev script. Use this if you want to manage your dev server separately."},examples:[`${"ms"} app dev`,`${"ms"} app dev --port 8080 --local-app-url http://localhost:3000`,`${"ms"} app dev --local-app-url http://localhost:3000 --config-only`]},refresh:{description:"Refresh data sources in an app.",dataSource:{description:"Re-fetch data source metadata from the service and regenerate TypeScript.",options:{offline:"Regenerate TypeScript from the local schemas in '.ms/schemas' without contacting the service (no network or authentication). Omit to re-fetch metadata from the service and regenerate.",name:"Name of a specific data source to refresh. Omit to refresh all."},examples:[`${"ms"} app refresh data-source`,`${"ms"} app refresh data-source --name teams`,`${"ms"} app refresh data-source --offline`]}},add:{description:"Add a data source to the current app.",options:{connector:"Connector identifier.",connectionId:"Connection identifier.",connectionRef:"Connection reference name.",resourceName:"Table or resource name.",dataset:"Dataset identifier.",sqlStoredProcedure:"SQL stored procedure name.",solutionId:"Solution identifier.",skipCodegen:"Skip TypeScript code generation after adding the data source."},examples:[`${"ms"} app add data-source --connector shared_office365`,`${"ms"} app add table --connector shared_sql --connection-id <id> --dataset <db> --table <tbl>`,`${"ms"} app add procedure --connector shared_sql --connection-id <id> --dataset <db>`],action:{description:"Add a connector to the app as an action data source.",options:{connector:"Connector identifier (e.g. shared_office365).",connectionId:"Connection identifier. Required for multi-auth connectors; prompted interactively when omitted.",skipCodegen:"Skip TypeScript code generation after adding the connector."},examples:[`${"ms"} app add action --connector shared_office365`,`${"ms"} app add action --connector shared_sql --connection-id <id>`,`${"ms"} app add action --connector shared_office365 --skip-codegen`]},table:{description:"Add a connector table to the app as a tabular data source.",options:{connector:"Connector identifier (e.g. shared_sql, shared_sharepointonline).",connectionId:"Connection ID to use. If omitted, you will be prompted to select one.",dataset:"Dataset name (e.g. a SQL server/database or SharePoint site URL). If omitted, you will be prompted.",table:"Table name. If omitted, you will be prompted to select one.",skipCodegen:"Skip TypeScript model service generation after adding the table."},examples:[`${"ms"} app add table --connector shared_sql`,`${"ms"} app add table --connector shared_sql --connection-id <id> --dataset <db> --table <tbl>`,`${"ms"} app add table --connector shared_sharepointonline --skip-codegen`]},connector:{description:"Add a data source (a connector table or action) to the app.",options:{connector:'Connector ID (e.g. shared_office365, shared_sql) or display name (e.g. "Office 365 Users"). Run `ms connector list` to browse connectors.',connectionId:"Connection ID to use. If omitted: interactive mode prompts you to pick or create one; non-interactive mode reuses your only connection, silently creates one for connectors whose sole authentication type is single sign-on when none exist, or errors when the choice is ambiguous. Pass --use-sso to reuse an existing SSO connection (or silently create one) for any SSO-capable connector, not just SSO-only ones.",dataset:"Dataset name (only used when adding as a table). If omitted in table mode, you will be prompted.",table:"Table name. In table mode this is the table name within the dataset. With --connector shared_commondataserviceforapps it is the Dataverse table logical name (e.g. account). If omitted, you will be prompted.",as:'Force the dispatch to "table" or "action". Required in non-interactive mode when the connector supports tables.',dataverseEnvironmentId:"Dataverse environment ID (GUID). Only used with --connector shared_commondataserviceforapps to bind to a specific table.",useSso:"Prefer a single sign-on (Entra ID) connection: reuse the first existing SSO connection when one exists, otherwise silently create one. Works even when the connector offers other authentication types. Errors if the connector is not SSO-capable. Ignored when --connection-id is supplied.",skipCodegen:"Skip TypeScript code generation after adding the data source."},examples:[`${"ms"} app add data-source --connector shared_office365`,`${"ms"} app add data-source --connector "Office 365 Users"`,`${"ms"} app add data-source --connector shared_sql --as table --connection-id <id> --dataset <db> --table <tbl>`,`${"ms"} app add data-source --connector "SQL Server" --as table --connection-id <id> --dataset <db> --table <tbl>`,`${"ms"} app add data-source --connector shared_sharepointonline --as action`,`${"ms"} app add data-source --connector "SharePoint" --as action`,`${"ms"} app add data-source --connector shared_office365 --as action --use-sso`,`${"ms"} app add data-source --connector shared_sql --as table --skip-codegen`,`${"ms"} app add data-source --connector shared_commondataserviceforapps --as action --connection-id <id> --dataverse-environment-id <env-guid> --table account`],deprecation:`(deprecated) '${"ms"} app add connector' is deprecated. Use '${"ms"} app add data-source' instead.`,deprecatedExamples:[`${"ms"} app add connector --connector shared_office365`,`${"ms"} app add connector --connector shared_sql --as table --connection-id <id> --dataset <db> --table <tbl>`,`${"ms"} app add connector --connector shared_sharepointonline --as action`,`${"ms"} app add connector --connector shared_sql --as table --skip-codegen`,`${"ms"} app add connector --connector shared_commondataserviceforapps --as action --connection-id <id> --dataverse-environment-id <env-guid> --table account`]}},remove:{description:"Remove a data source (table or action) from the app.",options:{dataSourceName:"Name of the data source to remove.",force:"Skip confirmation prompt."},examples:[`${"ms"} app remove data-source`,`${"ms"} app remove data-source --name documents`,`${"ms"} app remove data-source --name orders --force`],deprecation:`(deprecated) '${"ms"} app remove connector' is deprecated. Use '${"ms"} app remove data-source' instead.`,deprecatedExamples:[`${"ms"} app remove connector`,`${"ms"} app remove connector --name documents`,`${"ms"} app remove connector --name orders --force`]},"get-settings":{description:"View all app settings.",examples:[`${"ms"} app get-settings`,`${"ms"} app get-settings --json`]},"set-setting":{description:`Update app settings. Changes are written to ${t} and take effect the next time you run '${"ms"} app dev' or '${"ms"} app deploy'.`,options:{"show-header":"Show or hide the app header bar (true or false)."},examples:[`${"ms"} app set-setting --show-header false`]}},connector:{list:{description:"List connectors available in the environment. By default all connectors are shown, including those blocked by tenant policy; pass --only-allowed to list only connectors allowed by tenant policy.",hint:'Use the value in the "Connector" column as the ID (e.g. shared_office365), or pass the display name directly (e.g. "Office 365 Users") to add commands.',options:{environmentId:"Environment ID (optional).",search:"Filter connectors by display name or connector ID (case-insensitive).",onlyAllowed:"List only connectors allowed by tenant policy. By default all connectors are listed, including blocked ones."},examples:[`${"ms"} connector list`,`${"ms"} connector list --search "sql"`,`${"ms"} connector list --only-allowed`,`${"ms"} connector list --environment-id <env-id>`,`${"ms"} connector list --json`]},"list-actions":{description:"List actions available on a connector with their policy behavior.",options:{connector:"Connector identifier (e.g. shared_office365).",environmentId:"Environment ID (optional).",search:"Filter actions by summary or action ID (case-insensitive)."},examples:[`${"ms"} connector list-actions --connector shared_office365`,`${"ms"} connector list-actions --connector shared_sql --search "execute"`,`${"ms"} connector list-actions --connector shared_office365 --environment-id <env-id>`,`${"ms"} connector list-actions --connector shared_office365 --json`]}},telemetry:{enable:{description:"Enable telemetry collection. Defaults to --remote if no target is specified.",options:{remote:"Enable sending telemetry to the cloud service (default).",console:"Enable outputting telemetry to the local console."},examples:[`${"ms"} telemetry enable`,`${"ms"} telemetry enable --console`,`${"ms"} telemetry enable --remote --console`]},disable:{description:"Disable telemetry collection. Defaults to --remote if no target is specified.",options:{remote:"Disable sending telemetry to the cloud service (default).",console:"Disable outputting telemetry to the local console."},examples:[`${"ms"} telemetry disable`,`${"ms"} telemetry disable --console`,`${"ms"} telemetry disable --remote --console`]},status:{description:"Show the current telemetry settings.",examples:[`${"ms"} telemetry status`,`${"ms"} telemetry status --json`]}},deprecated:{Verbs:{"Build-app":{Description:"Initiate a build for the app. By default waits for the build to reach a terminal state; pass --no-wait to return immediately after submission.",Options:{AppName:"The app name to build.",CommitSha:"The commit ID to build. Defaults to the commit at HEAD.",NoWait:"Return immediately after submitting the build."},Examples:[`${"ms"} app build --app my-app --commit abc1234`,`${"ms"} app build --app my-app --commit abc1234 --no-wait`,`${"ms"} app build --app my-app --commit abc1234 --json`]},"Get-build-status":{Description:"Get the status of an app build operation.",Options:{AppName:"The app name.",CommitSha:"The commit ID for which a build was initiated by app build."},Examples:[`${"ms"} app build-status --app my-app --commit <sha>`,`${"ms"} app build-status --app my-app --commit <sha> --json`]},"List-connection-references":{Description:"List all connection references in the environment.",Options:{SolutionId:"Solution identifier to filter by."},Examples:[`${"ms"} connection list-references`,`${"ms"} connection list-references --json`]},"List-datasets":{Description:"List all datasets for a connection.",Options:{Connector:"Connector identifier.",Connection:"Connection identifier."},Examples:[`${"ms"} connection list-datasets --connector shared_sql --connection <id>`,`${"ms"} connection list-datasets --connector shared_sql --connection <id> --json`]},"List-environment-variables":{Description:"List all environment variables in the environment.",Examples:[`${"ms"} environment list-variables`,`${"ms"} environment list-variables --json`]},"List-sqlStoredProcedures":{Description:"List all SQL stored procedures for a dataset.",Options:{Connection:"Connection identifier.",Dataset:"Dataset name."},Examples:[`${"ms"} connection list-procedures --connection <id> --dataset <db>`,`${"ms"} connection list-procedures --connection <id> --dataset <db> --json`]},"List-tables":{Description:"List all tables for a dataset.",Options:{Connector:"Connector identifier.",Connection:"Connection identifier.",Dataset:"Dataset name."},Examples:[`${"ms"} connection list-tables --connector shared_sql --connection <id> --dataset <db>`,`${"ms"} connection list-tables --connector shared_sql --connection <id> --dataset <db> --json`]}}},git:{auth:{refresh:{description:"Authenticate against a GitHub repository so subsequent app create / deploy / preview / build commands targeting that repo know your GitHub identity. Runs the GitHub device code flow via the Managed Apps GitHub App; no GitHub token is stored locally.",options:{repo:"GitHub repository URL (e.g. https://contoso.ghe.com/contoso/my-app or https://github.com/contoso/my-app). The Managed Apps GitHub App is the only supported provider; the server enforces which hosts/tenants are accepted.",openBrowser:"Launch the browser to complete the GitHub device code flow. Default: do not launch."},examples:[`${"ms"} git auth refresh --repo https://contoso.ghe.com/contoso/my-app`,`${"ms"} git auth refresh -r https://contoso.ghe.com/contoso/my-app --open-browser`,`${"ms"} git auth refresh --repo https://contoso.ghe.com/contoso/my-app --json`]}}}};export{n as a};
|
|
8
|
-
/*!
|
|
9
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
-
*/
|
|
11
|
-
//# sourceMappingURL=chunk-47LJLFDF.js.map
|
package/dist/chunk-7BRIEYGR.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 b,e as S}from"./chunk-RBG2H562.js";import{m as x}from"./chunk-UNJJUCSA.js";import{h as y}from"./chunk-PVAIJSAI.js";function G(t){try{return new URL(t).host}catch{return t}}function U(t,e,r){e||y(`Authenticating to ${G(t)} for ${r}. A browser window may open. Sign in with the account associated with this tenant.`)}import{execFileSync as N}from"child_process";var I=[{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.`}],O=[/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 D(t){return t.replace(/(\b[a-z][a-z0-9+.-]*:\/\/)[^/\s@]+@/gi,"$1[REDACTED]@")}function C(t,e){let r=D(t.trimEnd());if(!r)return null;for(let i of I)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 O.some(i=>i.test(r))?new S(`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 T=64*1024*1024;function f(t,e={}){let{cwd:r,allowFailure:i=!1,captureStdout:o=!1,emitStderr:l=!0,classify:c,network:n=!1}=e,a=n&&!c&&!i;try{let s=N("git",t,{cwd:r,stdio:["ignore",o?"pipe":"ignore",a?"inherit":"pipe"],maxBuffer:T});return{success:!0,status:0,stdout:o?g(s):"",stderr:""}}catch(s){let u=s,d=g(u.stderr);if(c&&!i){let L=d||g(u.stdout)||(s instanceof Error?s.message:String(s)),R=C(L,c);if(R)throw R}if(l&&d&&process.stderr.write(d),!i)throw s;return{success:!1,status:typeof u.status=="number"?u.status:null,stdout:g(u.stdout),stderr:d,error:s instanceof Error?s:new Error(String(s))}}}import{execFileSync as p}from"child_process";import*as h from"fs";import*as A from"path";function v({gitUrl:t,loginAuthority:e,authResource:r,platform:i=process.platform}){let o;try{o=new URL(t)}catch(s){throw new Error(`Git credential helper setup requires a valid HTTPS remote URL: ${s instanceof Error?s.message:String(s)}`)}if(o.protocol!=="https:")throw new Error(`Git credential helper setup requires an HTTPS remote URL, got '${o.protocol}'.`);let l=o.host,c=`${e}/oauth2/v2.0`,n=`credential.https://${l}`,a=[[`${n}.oauthAuthorizeEndpoint`,`${c}/authorize?prompt=select_account`],[`${n}.oauthTokenEndpoint`,`${c}/token`],[`${n}.oauthDeviceEndpoint`,`${c}/devicecode`],[`${n}.oauthClientId`,x],[`${n}.oauthScopes`,`${r}/.default offline_access`],[`${n}.oauthRedirectUri`,"http://localhost"]];return i==="win32"&&a.push([`${n}.credentialStore`,"dpapi"]),a}function tt(){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 et(){let t=f(["config","--get","remote.origin.url"],{captureStdout:!0,allowFailure:!0,emitStderr:!1});if(t.success)return t.stdout.trim()||void 0}var B=["https://","ssh://","git@"];function z(t){return B.some(e=>t.startsWith(e))&&t.trim()===t&&!t.startsWith("-")&&!/[\r\n\0]/.test(t)}function m(t){return t.replace(/:\/\/[^\s/]+@/g,"://[REDACTED]@")}function rt(t,e=process.cwd()){try{return t!==void 0&&!z(t)?{success:!1,error:"Unsafe git remote URL."}:(w({remoteUrl:t,cwd:e}),{success:!0})}catch(r){return{success:!1,error:m(r instanceof Error?r.message:String(r))}}}function H({directory:t,gitUrl:e,loginAuthority:r,authResource:i}){let o=k({gitUrl:e,loginAuthority:r,authResource:i});w({remoteUrl:e,cwd:t,createDirectory:!0,initialBranch:"main",localConfig:o,updateExistingRemote:!0,emitRemoteError:!0,skipInitIfRepoExists:!0})}function it({directory:t,gitUrl:e,loginAuthority:r,authResource:i,onProgress:o}){let l=k({gitUrl:e,loginAuthority:r,authResource:i}),c=l.flatMap(([n,a])=>["-c",`${n}=${a}`]);o?.("Cloning platform-managed repository..."),f([...c,"-c","http.sslVersion=tlsv1.3","clone",e,t],{network:!0,classify:{action:`cloning from ${G(e)}`}}),o?.("Saving Git Credential Manager configuration...");try{return w({cwd:t,localConfig:l,skipInitIfRepoExists:!0}),{configPersisted:!0}}catch(n){return{configPersisted:!1,configError:m(n instanceof Error?n.message:String(n))}}}function nt(t){try{return H(t),{success:!0}}catch(e){return{success:!1,error:m(e instanceof Error?e.message:String(e))}}}function k({gitUrl:t,loginAuthority:e,authResource:r}){try{return v({gitUrl:t,loginAuthority:e,authResource:r})}catch(i){throw new b(`Git credential helper setup failed: ${i instanceof Error?i.message:String(i)}`)}}function w({remoteUrl:t,cwd:e,createDirectory:r=!1,initialBranch:i,localConfig:o=[],updateExistingRemote:l=!1,emitRemoteError:c=!1,skipInitIfRepoExists:n=!1}){r&&h.mkdirSync(e,{recursive:!0});let a={stdio:"pipe",windowsHide:!0,cwd:e};n&&h.existsSync(A.join(e,".git"))||(p("git",["init"],a),i&&p("git",["symbolic-ref","HEAD",`refs/heads/${i}`],a));for(let[u,d]of o)p("git",["config","--local",u,d],a);if(t)try{p("git",["remote","add","origin",t],a)}catch(u){if(!l||!$(u).includes("already exists"))throw c&&process.stderr.write(m($(u))),u;p("git",["remote","set-url","origin",t],a)}}function $(t){return typeof t=="object"&&t!==null&&"stderr"in t&&Buffer.isBuffer(t.stderr)?t.stderr.toString():""}function ot(){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{G as a,U as b,f as c,tt as d,et as e,rt as f,H as g,it as h,nt as i,ot as j};
|
|
17
|
-
/*!
|
|
18
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
19
|
-
*/
|
|
20
|
-
//# sourceMappingURL=chunk-7BRIEYGR.js.map
|
package/dist/chunk-7GGFN2IW.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{H as s,f as o}from"./chunk-4LIR3ZYP.js";import{a as r,b as i,c as u,d as c,e as l}from"./chunk-RBG2H562.js";var f=["GitHubMappingMissing","GitHubMappingExpired","GitHubMappingStale"];function g(e){return typeof e=="string"&&f.includes(e)}function E(e){let n=e.code;if(!n)return null;let t=e.message;if(!t||!t.trim())return null;switch(n){case"GitHubMappingMissing":case"GitHubMappingExpired":case"GitHubMappingStale":case"GitHubUserLacksAccess":case"GitHubUserLacksRequiredLevel":case"GitHubAuthSessionExpired":case"GitHubAuthSessionNotFound":case"GitHubAuthDenied":case"GitHubAuthCancelled":return new u(t);case"GitHubAppNotInstalled":case"GitHubInstallationSuspended":return new c(t);case"GitHubRateLimited":case"GitHubEvaluationError":case"GitHubUpstreamError":return new l(t);case"GitHubRepoArchived":case"GitHubRepoNotEnterprise":case"GitHubRepoNotFound":return new i(t);case"OperationNotFound":return new r(t);default:return null}}function H(e){if(e instanceof r)return null;let n=p(e);return n?E(n):null}function v(e){let n=p(e);if(!n)return null;let t=n.code;return!g(t)||!(e instanceof s)&&n.status!==401?null:{code:t,payload:n}}function p(e){if(e instanceof s)return{code:e.code,message:e.message,status:e.status,details:e.details};if(e instanceof o){let n=d(e.body);return n?{code:n.code,message:n.message??"",status:e.status,details:n.details}:null}if(e instanceof Error){let n=e.message.match(/\{[\s\S]*\}/);if(!n)return null;let t=d(n[0]);if(!t?.code)return null;let a=e.message.match(/status:\s*(\d+)/i);return{code:t.code,message:t.message??"",status:a?Number(a[1]):0,details:t.details}}return null}function d(e){if(!e)return null;try{let t=JSON.parse(e)?.error;return!t||typeof t!="object"?null:{code:typeof t.code=="string"?t.code:void 0,message:typeof t.message=="string"?t.message:void 0,details:t.details&&typeof t.details=="object"?t.details:void 0}}catch{return null}}export{E as a,H as b,v as c};
|
|
8
|
-
/*!
|
|
9
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
-
*/
|
|
11
|
-
//# sourceMappingURL=chunk-7GGFN2IW.js.map
|