@microsoft/cmr-cli 0.32.3 → 0.34.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 +37 -14
- package/THIRD-PARTY-NOTICES.txt +287 -30
- package/dist/Add-4RULNL6A.js +11 -0
- package/dist/AddConfig-D2DCR3JH.js +12 -0
- package/dist/AddConnector-5ZR5AF6H.js +19 -0
- package/dist/AddDeployment-7U4I5IC4.js +11 -0
- package/dist/AddDeploymentBinding-BZVRRZ7H.js +18 -0
- package/dist/AddRayfin-45ASHNIX.js +87 -0
- package/dist/Alter-36TSNZ4M.js +11 -0
- package/dist/{AuthStatus-WCZYGI5G.js → AuthStatus-W5ZHOAVD.js} +2 -2
- package/dist/AuthSwitch-7HRPTGEG.js +13 -0
- package/dist/Bin.js +1 -1
- package/dist/BuildMaafApp-TLQXOVQC.js +11 -0
- package/dist/Clear-X55BZKYF.js +11 -0
- package/dist/Cli-EEO7V3MZ.js +47 -0
- package/dist/CloneMaafApp-4EHW3HE2.js +12 -0
- package/dist/CreateMaafApp-VNXWCAP4.js +23 -0
- package/dist/CreateMaafProject-WVBNZPVL.js +11 -0
- package/dist/DeleteMaafApp-UGUKARMO.js +11 -0
- package/dist/DeployMaafApp-GJO567TK.js +8 -0
- package/dist/DeployMaafProject-4TSW2SFJ.js +11 -0
- package/dist/DeploymentApprovals-SZKNJT76.js +11 -0
- package/dist/Dev-ZD3L6WYY.js +15 -0
- package/dist/{EnvironmentVariableAuthenticationProvider-EBRBQ5I2.js → EnvironmentVariableAuthenticationProvider-EURTERVX.js} +2 -2
- package/dist/FeatureSettings-GG7JGFIY.js +11 -0
- package/dist/{GenerateCode-UQCHTRGP.js → GenerateCode-PNYC45SK.js} +2 -2
- package/dist/GetMaafBuildStatus-UTPVWF5L.js +11 -0
- package/dist/GetMaafProjectDeployStatus-PLK52YC4.js +12 -0
- package/dist/{GetSettings-MVVEXMJC.js → GetSettings-RLRDJEC7.js} +2 -2
- package/dist/InfoMaafApp-CTB6IPRU.js +13 -0
- package/dist/InfoMaafProject-TULH566X.js +11 -0
- package/dist/Init-TYWP2E6U.js +11 -0
- package/dist/ListConnectorActions-UQS6D4UN.js +11 -0
- package/dist/ListConnectors-OCDO64AT.js +11 -0
- package/dist/ListDeployments-PDLJ3IEI.js +11 -0
- package/dist/ListMaafApps-UAWTTCGB.js +11 -0
- package/dist/ListMaafProjects-T3Q2GEDX.js +11 -0
- package/dist/{ListSchema-QKVHVPHB.js → ListSchema-G673LK5Q.js} +2 -2
- package/dist/{ListSettings-IIA5OGMP.js → ListSettings-EXCK5ZS6.js} +2 -2
- package/dist/{Login-BT6UTPCZ.js → Login-XZATPT4L.js} +2 -2
- package/dist/{Logout-FBJE35Q5.js → Logout-2XM4IMZF.js} +2 -2
- package/dist/{MockFetch-LQLQGTNT.js → MockFetch-LW3KYEGC.js} +2 -2
- package/dist/NodeMsalAuthenticationProvider-ALMFNUEV.js +17 -0
- package/dist/Pack-RH4D4C7W.js +8 -0
- package/dist/PackProject-5DUWSBFA.js +14 -0
- package/dist/PlayMaafApp-5BXGXE6O.js +8 -0
- package/dist/ProjectApprovals-K3JF6D72.js +13 -0
- package/dist/ProjectRoleAssignments-7IUDEVBN.js +11 -0
- package/dist/RefreshDataSource-CMHDF2GP.js +11 -0
- package/dist/RefreshGitAuth-4TRO5IOQ.js +11 -0
- package/dist/Remove-KZD3SDDC.js +11 -0
- package/dist/{RemoveDataSource-RRND46QZ.js → RemoveDataSource-C7UXOUNH.js} +3 -3
- package/dist/RemoveDeployment-ZQJWQPD6.js +11 -0
- package/dist/ServicePrincipalAuthenticationProvider-3NPJTLF5.js +11 -0
- package/dist/SetSetting-3XO6HPG7.js +11 -0
- package/dist/{SetSetting-Q7EQNOTI.js → SetSetting-ZW7F43GC.js} +2 -2
- package/dist/ShareLinkCreate-JXPW5H7A.js +11 -0
- package/dist/ShareLinkList-ICYPRIQV.js +11 -0
- package/dist/ShareLinkRevoke-JVMQZF7K.js +11 -0
- package/dist/ShareList-YGSTFMVE.js +11 -0
- package/dist/ShareMaafApp-ZCY72WHK.js +11 -0
- package/dist/{TelemetrySettings-XCT73DEI.js → TelemetrySettings-P6WYWGW4.js} +2 -2
- package/dist/UnshareMaafApp-N4UR6Q4A.js +11 -0
- package/dist/{chunk-QLK3ZVWP.js → chunk-2SRFM7D6.js} +2 -2
- package/dist/chunk-3YCPXSCO.js +11 -0
- package/dist/chunk-45EZLDPE.js +147 -0
- package/dist/{chunk-2LKCCYRF.js → chunk-4PI5THLA.js} +2 -2
- package/dist/{chunk-TMYOZDLM.js → chunk-6KOL66SF.js} +2 -2
- package/dist/{chunk-2VJIWD7V.js → chunk-74RNALDY.js} +2 -2
- package/dist/{chunk-SIEI2EB5.js → chunk-7AEULMP2.js} +2 -2
- package/dist/chunk-7LAMG4KK.js +12 -0
- package/dist/chunk-A5INC5TY.js +11 -0
- package/dist/chunk-AICYZHWK.js +11 -0
- package/dist/chunk-B4NTYKGH.js +12 -0
- package/dist/chunk-BAQPANON.js +11 -0
- package/dist/{chunk-DKSLWH4O.js → chunk-BMOTNINY.js} +6 -6
- package/dist/{chunk-OUKOEUZA.js → chunk-C7UWPNC3.js} +1 -1
- package/dist/{chunk-Q3ONTUZ7.js → chunk-CLY3OASM.js} +2 -2
- package/dist/chunk-DLUQVMUE.js +11 -0
- package/dist/{chunk-KT2SUHGM.js → chunk-ENDUKF4E.js} +2 -2
- package/dist/{chunk-UEZV46GZ.js → chunk-FESGOCAP.js} +7 -7
- package/dist/{chunk-BRRT2E75.js → chunk-GO22IDEN.js} +6 -6
- package/dist/{chunk-WTTK2GTG.js → chunk-HHW4SKVU.js} +2 -2
- package/dist/{chunk-PEZMQ2A3.js → chunk-HZGDQAKA.js} +2 -2
- package/dist/{chunk-HSNRWBA6.js → chunk-IMVZRBSQ.js} +2 -2
- package/dist/chunk-K77VBHFP.js +12 -0
- package/dist/{chunk-DGUO74I3.js → chunk-KD4NQIYX.js} +3 -3
- package/dist/{chunk-3E7QQ2BR.js → chunk-KN66FSQK.js} +2 -2
- package/dist/{chunk-UXKJNXTZ.js → chunk-KPKJZKWW.js} +2 -2
- package/dist/chunk-NMZFJESU.js +12 -0
- package/dist/{chunk-PZIEJEF5.js → chunk-NNYOT7IR.js} +2 -2
- package/dist/{chunk-EFY2BSWB.js → chunk-OH3TCDCC.js} +2 -2
- package/dist/{chunk-XIX2O22O.js → chunk-OHQNTYJG.js} +2 -2
- package/dist/{chunk-KKC5ZK4D.js → chunk-PYPCPMCR.js} +21 -21
- package/dist/{chunk-ZB6MB7GZ.js → chunk-R2IECDVU.js} +3 -3
- package/dist/{chunk-ADRQC63G.js → chunk-RA74M3YD.js} +2 -2
- package/dist/{chunk-4XKA5APP.js → chunk-RSHOMYG6.js} +228 -227
- package/dist/chunk-UHNOINTO.js +11 -0
- package/dist/{chunk-4U53RYJJ.js → chunk-WS6TGUH7.js} +2 -2
- package/dist/{chunk-6EF722GY.js → chunk-XC7Y6E2C.js} +11 -11
- package/dist/chunk-XJXWNOJR.js +11 -0
- package/dist/chunk-Y2D37EFX.js +13 -0
- package/dist/{chunk-RFLXPXBN.js → chunk-YEWRCEPT.js} +2 -2
- package/dist/chunk-Z4UX3JOS.js +12 -0
- package/dist/chunk-ZBQT5XZJ.js +32 -0
- package/dist/chunk-ZGBTKTTU.js +11 -0
- package/dist/{chunk-GE3UFHZ5.js → chunk-ZLK2CMMJ.js} +23 -23
- package/dist/chunk-ZWJ5T5VI.js +11 -0
- package/dist/node-PLZPXPD7.js +29 -0
- package/dist/typescript-6OTSQQEW.js +458 -0
- package/package.json +5 -4
- package/dist/Add-FU57YE5G.js +0 -11
- package/dist/AddConfig-CI7KNLIG.js +0 -12
- package/dist/AddConnector-WH4IU3ND.js +0 -16
- package/dist/AddDeployment-GWFCPAL5.js +0 -11
- package/dist/AddDeploymentBinding-RFLI6DKH.js +0 -18
- package/dist/AddRayfin-VRCFEOIL.js +0 -38
- package/dist/Alter-JFFT5JOA.js +0 -11
- package/dist/AuthSwitch-XJMG7IUR.js +0 -13
- package/dist/BuildMaafApp-7AUZHYOQ.js +0 -11
- package/dist/Clear-7B7CDIPV.js +0 -11
- package/dist/Cli-XZ4SJKBZ.js +0 -47
- package/dist/CloneMaafApp-7W246RZA.js +0 -12
- package/dist/CreateMaafApp-6MSPHUU4.js +0 -22
- package/dist/CreateMaafProject-JKMF5TH3.js +0 -11
- package/dist/DeleteMaafApp-TFGWGJO3.js +0 -11
- package/dist/DeployMaafApp-K2APWFOD.js +0 -8
- package/dist/DeployMaafProject-6WRKGIIW.js +0 -11
- package/dist/DeploymentApprovals-WTXBXCKE.js +0 -11
- package/dist/Dev-CIEWFRXR.js +0 -15
- package/dist/FeatureSettings-77LZQSKD.js +0 -11
- package/dist/GetMaafBuildStatus-6ZSLIZCH.js +0 -11
- package/dist/GetMaafProjectDeployStatus-NZEMVQGJ.js +0 -12
- package/dist/InfoMaafApp-7Z6OJCHD.js +0 -13
- package/dist/InfoMaafProject-SQYB736C.js +0 -11
- package/dist/Init-PBH2IXVK.js +0 -11
- package/dist/ListConnectorActions-UERYZ2C7.js +0 -11
- package/dist/ListConnectors-2FUTJMHY.js +0 -11
- package/dist/ListDeployments-4YWCHVKF.js +0 -11
- package/dist/ListMaafApps-ZATO77G3.js +0 -11
- package/dist/ListMaafProjects-GNUXZSYL.js +0 -11
- package/dist/NodeMsalAuthenticationProvider-5TJFMHR4.js +0 -17
- package/dist/Pack-TSFHSTB5.js +0 -8
- package/dist/PackProject-T575KJQ4.js +0 -14
- package/dist/PlayMaafApp-74TQEAO5.js +0 -8
- package/dist/ProjectApprovals-5KLYEM7V.js +0 -13
- package/dist/ProjectRoleAssignments-AI2FQ2VX.js +0 -11
- package/dist/RefreshDataSource-VARFN3IV.js +0 -11
- package/dist/RefreshGitAuth-DC5NAZBJ.js +0 -11
- package/dist/Remove-MCQZVI3K.js +0 -11
- package/dist/RemoveDeployment-STNFNNZF.js +0 -11
- package/dist/ServicePrincipalAuthenticationProvider-7RBHTYYY.js +0 -11
- package/dist/SetSetting-CEH44OT3.js +0 -11
- package/dist/ShareLinkCreate-ZUVHUQLH.js +0 -11
- package/dist/ShareLinkList-IEYU6NZW.js +0 -11
- package/dist/ShareLinkRevoke-22RFGOFJ.js +0 -11
- package/dist/ShareList-6UWIHPBM.js +0 -11
- package/dist/ShareMaafApp-SFNOOMOD.js +0 -11
- package/dist/UnshareMaafApp-TU7U3LQ3.js +0 -11
- package/dist/chunk-2LDU3F6O.js +0 -11
- package/dist/chunk-5MHBEEMZ.js +0 -11
- package/dist/chunk-A4PVXTJS.js +0 -13
- package/dist/chunk-BA52TY55.js +0 -12
- package/dist/chunk-FHE3OXIP.js +0 -11
- package/dist/chunk-HOIFXUTG.js +0 -11
- package/dist/chunk-NYPHWF7Q.js +0 -32
- package/dist/chunk-PLFDUGBA.js +0 -12
- package/dist/chunk-RDXQ3ZPT.js +0 -11
- package/dist/chunk-TXMTKOEJ.js +0 -12
- package/dist/chunk-WV7D7PTW.js +0 -12
- package/dist/chunk-WWVAS3DS.js +0 -11
- package/dist/chunk-YRPTITKD.js +0 -12
- package/dist/rayfin-pack-HOUOLOHQ.js +0 -164
|
@@ -1,22 +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 Me,b as De,c as Pe,d as Ue}from"./chunk-EFY2BSWB.js";import{b as xe}from"./chunk-PEZMQ2A3.js";import{b as Be}from"./chunk-TXMTKOEJ.js";import{a as Ee}from"./chunk-2VJIWD7V.js";import{a as Te}from"./chunk-OL6CTXQR.js";import{a as $e,b as Le,c as Ve,d as Fe}from"./chunk-BA52TY55.js";import{b as Ge,c as _e}from"./chunk-5MHBEEMZ.js";import{a as Ne,b as ke}from"./chunk-DGUO74I3.js";import{a as je}from"./chunk-RDXQ3ZPT.js";import"./chunk-Q3ONTUZ7.js";import"./chunk-XIX2O22O.js";import{a as Re,b as Ie}from"./chunk-TMYOZDLM.js";import"./chunk-TYRVM4PP.js";import{a as ve,b as Ae,d as S,i as Q,j as Se}from"./chunk-ZB6MB7GZ.js";import"./chunk-2LKCCYRF.js";import{i as U,m as Ce}from"./chunk-GE3UFHZ5.js";import{A as z,Ga as ye,K as ge,Nb as Y,Ob as K,Pb as be,i as me,na as he,w as M,x as d,y as q,z as D}from"./chunk-4XKA5APP.js";import{m as Oe}from"./chunk-2LDU3F6O.js";import"./chunk-RFLXPXBN.js";import"./chunk-FHE3OXIP.js";import{e as we}from"./chunk-OUKOEUZA.js";import{s as i}from"./chunk-4U53RYJJ.js";import{a as v}from"./chunk-HOIFXUTG.js";import{C as le,D as ue,E as W,I as x,K as fe,a as se,i as pe,o as ce,y as de,z as J}from"./chunk-KKC5ZK4D.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";import*as m from"fs";import*as Ye from"os";import*as g from"path";import*as I from"fs";import*as He from"os";import*as L from"path";function X(e){if(!e)throw new d("Template source is empty. Use --template to specify one.");if(/^https?:\/\//i.test(e)){let n;try{n=new URL(e)}catch{throw new d(`Template source '${e}' is not a valid URL.`)}if(n.hostname.toLowerCase()!=="github.com")throw new d(`Template source '${e}' uses host '${n.hostname}'; only github.com URLs are supported.`);let y=n.pathname.split("/").filter(Boolean);if(y.length<2)throw new d(`Template source '${e}' is missing the owner/repo path. Use 'https://github.com/<owner>/<repo>'.`);let[$,u,...E]=y,c=u.endsWith(".git")?u.slice(0,-4):u,C=n.hash?n.hash.slice(1):void 0;if(E.length===0)return{owner:$,repo:c,subdir:"",ref:C};if(E[0].toLowerCase()==="tree"&&E.length>=2)return{owner:$,repo:c,subdir:E.slice(2).join("/"),ref:C??E[1]};throw E[0].toLowerCase()==="blob"?new d(`Template source '${e}' points at a file ('/blob/...'). Templates must be a directory \u2014 use the '/tree/<branch>/<subdir>' URL form instead.`):new d(`Template source '${e}' has an unrecognised path. Use 'https://github.com/<owner>/<repo>' or 'https://github.com/<owner>/<repo>/tree/<branch>/<subdir>'.`)}let r=/^([a-z][a-z0-9+.-]*):/i.exec(e);if(r){let n=r[1].toLowerCase();if(n!=="github"&&n!=="gh")throw new d(`Template source '${e}' uses unsupported provider prefix '${r[1]}:'. Only 'github:' (or 'gh:' shorthand) templates are supported.`)}let t=e.replace(/^(?:github|gh):/i,""),[a,l]=t.split("#",2),s=a.split("/").filter(Boolean);if(s.length<2)throw new d(`Template source '${e}' is missing the owner/repo path. Expected 'github:<owner>/<repo>[/<subdir>]'.`);let[w,h,...p]=s;return{owner:w,repo:h,subdir:p.join("/"),ref:l||void 0}}function Je(e,r){let t=X(e),a=`https://github.com/${t.owner}/${t.repo}.git`,l=I.mkdtempSync(L.join(He.tmpdir(),"ms-template-"));try{let s=["clone","--depth=1","--filter=blob:none"];t.subdir&&s.push("--sparse"),t.ref&&s.push("--branch",t.ref),s.push(a,l),S(s,{network:!0}),t.subdir&&S(["-C",l,"sparse-checkout","set",t.subdir]);let w=t.subdir?L.join(l,t.subdir):l;if(!I.existsSync(w))throw new d(`Template subdirectory '${t.subdir}' was not found in https://github.com/${t.owner}/${t.repo}${t.ref?` at ref '${t.ref}'`:""}. If the branch name contains '/', use the 'github:<owner>/<repo>/<subdir>#<branch>' form to disambiguate.`);I.mkdirSync(r.dir,{recursive:!0}),I.cpSync(w,r.dir,{recursive:!0,force:!0,filter:h=>L.basename(h)!==".git"})}finally{I.rmSync(l,{recursive:!0,force:!0})}}var ot="github:microsoft/Managed-Apps/templates/vite8",at=new Set([".ds_store","desktop.ini","thumbs.db"]),st=new Set([ce,".git","README.md"]),te="Initial scaffold from 'ms app create'";async function Qt(e){de();try{await pt(e)}catch(r){throw r instanceof be||J()&&xe(r),r}}async function pt(e){wt(e),await e.runVerb();let r=await e.getTenantIdAsync();if(!r)throw new d("Unable to determine tenant ID. Ensure you are logged in.");let t=Y(),a=K(),{region:l}=ge(),s=await e.getOption("displayName");if(!s)throw new d("Argument displayName is required. Use --display-name or -n to specify it.");let w=e.getPositionalArg(0),h=await e.getOption("template",!0),p=await e.getOption("repo",!0),{repoType:n,remoteUrl:y}=_e(p),$=p!==void 0&&p.trim().length>0,u=a.projectConfig;if(a.projectConfigError)throw new D(`Unable to read ${a.fileConfig.projectConfigPath}. ${a.projectConfigError.message}`);if(u&&$)throw new d("'--repo' cannot be specified inside a managed project. Omit '--repo' to use the project's repository, or run the command outside the managed project to create a standalone app.");if(u)if(n=u.repoType,n==="github"){if(!u.externalRepoUrl)throw new D("The current GitHub-backed managed project is missing externalRepoUrl.");y=Ge(u.externalRepoUrl,"The current managed project's externalRepoUrl")}else y=void 0;let E=w===void 0&&u!==void 0;if(w===void 0&&!E&&!Ee(s))throw new d("The display name cannot be used as a directory name. Specify a target directory as the first argument.");let c=w??(E?".":s),C=await e.getOption("repositoryId",!0),V=u?.projectId,A=u!==void 0,O,G=!1,re=[];if(A){let o=a.fileConfig.projectConfigPath;if(!o)throw new D("Unable to locate ms.project.config.json for the current managed project.");O=g.dirname(g.resolve(o));let f=ee(O,c),k=ee(O,O);G=f===k}let Ke=await e.getOption(i.BuildType.camelName,!0),ne=await e.getOption("buildCommand",!0),P=Le({buildType:Ke,buildPath:await e.getOption("buildPath",!0),buildCommand:ne,buildEntryPoint:await e.getOption("buildEntryPoint",!0)});P.buildType==="none"&&ne?.trim()&&fe("--build-command is ignored when --build-type none is selected.");let R=e.isJsonMode();if(!R){let o=pe(l),f=o?`cloud ${o}`:`region ${l}`;x(`About to create app '${s}' in tenant ${r} (${f}).`)}let ie=!R&&process.stdout.isTTY;!R&&!ie&&x("Running preflight checks...");let T=ie?new Te:null;T?.start("Running preflight checks...");try{if(n==="none"&&C)throw new d("'--repo none' is incompatible with '--repository-id'. Use '--repo none' for an app with no git binding, or omit '--repo' (or pass a repo URL) to use a backing repository.");if(C&&V)throw new d("A managed project is incompatible with '--repository-id'. Use a managed project or a standalone platform-managed repository, not both.");P.buildType!=="none"&&(T?.update("Validating template source..."),mt(h)),(n!=="none"||P.buildType!=="none")&&(T?.update("Checking git installation..."),Re()),n==="native"&&(T?.update("Checking Git Credential Manager..."),Ie()),T?.update("Verifying target directory is writable..."),ht(c),n==="github"&&!A?(T?.update("Verifying target directory is empty..."),qe(c),T?.update(`Verifying ${y} is empty...`),gt(y)):(T?.update("Verifying target directory is empty..."),We(c,G))}finally{T?.stop()}let B=await Ce(e,{failIfMissing:!1});if(u&&B&&B.toLowerCase()!==u.environmentId.toLowerCase())throw new d(`Environment '${B}' does not match the current managed project's environment '${u.environmentId}'.`);let _=u?.environmentId??B,oe=we("MAAF_DOGFOOD");if(oe&&_)throw new d("MS_CLI_MAAF_DOGFOOD cannot be used with an explicit or configured environment ID.");let Qe=_?void 0:Ne(e,r,t,"CreateMaafApp",{dogfood:oe}),Xe=await e.getOption("description",!0),H=await ke(_,Qe);e.updateEnvironmentId(H),n==="github"&&!A?qe(c):re=We(c,G);let Ze=await e.getOption(i.OpenBrowser.camelName,!0)??!1,et=await e.getOption(i.ForceReauth.camelName,!0)??!1,F=V;if(n==="native"&&!F&&Oe("alm")){let o=await he({displayName:s});u=Be(o,e.getCloud()),F=u.projectId}R&&n==="github"&&W({phase:"create-validation"});let tt={displayName:s,description:Xe,repositoryId:C,remoteUrl:y,repoType:n,origin:a.origin,...F&&{projectId:F}},rt=({isRetry:o})=>ye({tenantId:r,environmentId:H,logger:t,actionsParams:{...tt,...et&&!o&&{forceReauth:!0}}}),ae;try{ae=await je(rt,{repoType:n,externalRepoUrl:y,tenantId:r,jsonMode:R,openBrowser:Ze,verb:"app create"})}catch(o){let f=$e(o,{repoType:n,environmentId:H});throw f||o}let{app:b,cloneUrl:j}=ae;if(n==="native"&&!A&&!j){let o=Z(b.id,b.environmentId);throw new M(`App '${b.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
|
-
`+o)}R||x(`App '${b.displayName}' (${b.id}) was created on the server. Setting up local files.`);let N=null;try{let o=()=>O?ee(O,c):c,f=o();if(n==="github"&&!A){if(ft({directory:f,repoUrl:y}),m.readdirSync(f).filter(nt=>nt!==".git").length>0)throw new d(`Repository ${y} 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
|
-
`+Z(b.id,b.environmentId))}else n==="native"&&!A?Q({directory:f,gitUrl:j,loginAuthority:e.getLoginAuthority(r),authResource:e.getAuthResourceUrl()}):m.mkdirSync(f,{recursive:!0});P.buildType!=="none"&&(f=o(),R||x(`Fetching template '${h}' into ${f}...`),Je(h,{dir:f}),f=o(),await Fe(f,R,e.getHttpClient()));let k=Ve({appId:b.id,appDisplayName:b.displayName,description:b.description,environmentId:b.environmentId,repoType:n,cloud:e.getCloud(),...P,repositoryId:n==="native"?b.repositoryId:void 0,externalRepoUrl:n==="github"?y:void 0});f=o(),await me(g.join(f,se),k),n!=="none"&&(f=o(),N=await ct(f,R,n==="native"&&!A?j:void 0,n==="native"&&!A?K().sessionId:void 0,n==="native",re))}catch(o){if(o instanceof d&&n!=="native")throw o;let f=o instanceof Error?o.message:String(o),k=`App '${b.displayName}' was created, but local setup failed: ${f}
|
|
11
|
-
The local directory ${c} may contain partial files; remove them or choose a new directory before retrying.
|
|
12
|
-
`+Z(b.id,b.environmentId);throw o instanceof M?(o.message=k,o):new M(k)}if(N&&!N.success)throw dt({appDisplayName:b.displayName,appId:b.id,appDir:c,jsonMode:R,gitRemoteUrl:n==="native"&&!A?j:void 0,externalRepoUrl:n==="github"?y:void 0,pushOutcome:N});if(R){let o={appId:b.id,repoType:n,...n==="github"&&y&&{externalRepoUrl:y},...n==="native"&&!A&&j&&{gitRemoteUrl:j},appDir:c,...N&&{push:N}};J()?W({success:!0,...o}):ue(o)}else{let o=c==="."?"the current folder":c;le(`Created app '${b.displayName}' in ${o}.`),n==="github"?x(`Bound to external repository: ${y}.`):n==="none"&&x("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 ct(e,r,t,a,l=t!==void 0,s=[]){let w=s.map(C=>`:(exclude)${C}`),h=["-c","core.autocrlf=false"],p="git -c core.autocrlf=false",n=[...h,"add","--",".",...w],y=[`${p} add -- .`,...w.map(C=>`"${C}"`)].join(" ").trim(),$=`${p} commit -m "${te}" -- .`,u="git push -u origin HEAD",E=t&&a?[`x-ms-client-session-id: ${a}`]:void 0,c="add";try{return S(n,{cwd:e}),c="commit",S([...h,"commit","-m",te,"--","."],{cwd:e}),t&&(c="fetch",Ae(t,r,"the initial git fetch and push"),Se(e,t,void 0,E),c="reconcile",lt(e)),c="push",S([...l?["-c","http.sslVersion=tlsv1.3"]:[],"push","-u","origin","HEAD"],{cwd:e,network:!0,classify:t?{action:`pushing to ${ve(t)}`}:void 0,httpExtraHeaders:E}),{success:!0}}catch(C){Y().trackErrorEvent("Maaf.Create.ScaffoldPushFailed",{error:C instanceof Error?C.stack??`${C.name}: ${C.message}`:String(C)});let V={code:"GitOperationFailed",message:`The initial Git synchronization failed during '${c}'. Review the Git output and retry.`},A=t?void 0:[...c==="add"?[y]:[],...c==="add"||c==="commit"?[$]:[],u].join(" && ");return{success:!1,failedStage:c,error:V,retryCommand:A,cause:C}}}function dt(e){let{appDisplayName:r,appId:t,appDir:a,jsonMode:l,gitRemoteUrl:s,externalRepoUrl:w,pushOutcome:h}=e,p=h.cause instanceof M?h.cause:void 0,n=h.error?.message??"Review the Git output and retry.",y=l?n:p?.message??n,$=h.retryCommand?`To finish wiring it up, run:
|
|
13
|
-
${h.retryCommand}`:`Resolve the git issue above, then finish the initial push from ${a}.`,u=`App '${r}' was provisioned and the local scaffold was created, but the initial repository synchronization failed.
|
|
14
|
-
Failed stage: ${h.failedStage}.
|
|
15
|
-
${y}
|
|
16
|
-
${$}`,E={appId:t,projectPath:a,...s&&{gitRemoteUrl:s},...w&&{externalRepoUrl:w},appCreated:!0,scaffoldCreated:!0,initialPushSucceeded:!1,recoveryRequired:"git-initial-push",failedStage:h.failedStage,...h.retryCommand&&{retryCommand:h.retryCommand}};return p instanceof q?new q(u,p.errorData,{errorCode:p.errorCode,exitCode:p.exitCode,retryable:p.retryable,outputDetails:E}):p instanceof z?new z(u,p.errorData,{errorCode:p.errorCode,exitCode:p.exitCode,retryable:p.retryable,outputDetails:E}):new M(u,p?.exitCode,p?.errorData,{errorCode:p?.errorCode??"GitOperationFailed",errorCategory:p?.errorCategory,exitCode:p?.exitCode,retryable:p?.retryable,outputDetails:E})}function lt(e){S(["rev-parse","--verify","origin/main"],{cwd:e,allowFailure:!0,emitStderr:!1}).success&&(S(["reset","--soft","origin/main"],{cwd:e}),S(["commit","-m",te],{cwd:e}))}function ut(e){return`Cannot access repository '${e}', so no app was created. `+Pe()}function ft(e){Ue(e)}function Z(e,r){return`The server app is still in environment ${r} (id: ${e}).
|
|
17
|
-
If you want to clean it up before retrying, run the following command:
|
|
18
|
-
${"ms"} app delete --app ${e} --environment-id ${r} --force`}function mt(e){X(e)}function We(e,r=!1){if(!m.existsSync(e))return[];let t=r?st:new Set,a=m.readdirSync(e),l=a.filter(w=>at.has(w.toLowerCase()));if(a.filter(w=>!t.has(w)&&!l.includes(w)).length>0)throw new d(`'${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.`);return l}function qe(e){if(!m.existsSync(e))return;if(m.readdirSync(e).length>0)throw new d(`'${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 gt(e){let r;try{r=m.mkdtempSync(g.join(Ye.tmpdir(),"ms-app-create-probe-"))}catch{return}try{let t=S(["clone","--depth=1","--filter=blob:none","--no-checkout",e,r],{allowFailure:!0,emitStderr:!1});if(!t.success){let s=t.stderr;if(De(s))throw new D(ut(e),{underlyingError:Me(t.error,s)});return}let a=S(["-C",r,"ls-tree","-r","HEAD"],{captureStdout:!0,allowFailure:!0,emitStderr:!1});if(!a.success)return;if(a.stdout.trim().length>0)throw new d(`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{m.rmSync(r,{recursive:!0,force:!0})}catch{}}}function ht(e){let r=e;for(;!m.existsSync(r);){let t=g.dirname(r);if(t===r)break;r=t}try{m.accessSync(r,m.constants.W_OK)}catch{throw new D(`'${e}' is not writable. Choose a different directory or fix the permissions and retry.`)}}function ee(e,r){let t=ze(e),a=ze(r),l=g.relative(t,a);if(l===".."||l.startsWith(`..${g.sep}`)||g.isAbsolute(l))throw new d(`The app directory '${g.resolve(r)}' must be inside the managed project at '${g.resolve(e)}'.`);return a}function ze(e){let t=g.resolve(e),a=[];for(;!yt(t);){let s=g.dirname(t);if(s===t)break;a.unshift(g.basename(t)),t=s}let l=m.realpathSync.native(t);return g.resolve(l,...a)}function yt(e){try{return m.lstatSync(e),!0}catch(r){if(r.code==="ENOENT")return!1;throw r}}function wt(e){e.setDescription(v.app.create.description),e.addExamples(v.app.create.examples),e.consumePositionalArg("[directory]"),e.addOptions([{flags:{key:i.EnvironmentId.name,alias:i.EnvironmentId.alias},env:i.EnvironmentId.envVar,description:v.app.create.options.environmentId,optionalInNonInteractive:!0},U({flags:{key:i.DisplayName.name,alias:i.DisplayName.alias},env:i.DisplayName.envVar,message:i.DisplayName.promptMessage,description:v.app.create.options.displayName}),{flags:{key:i.Description.name,alias:i.Description.alias},env:i.Description.envVar,description:v.app.create.options.description,optionalInNonInteractive:!0},{flags:{key:i.RepositoryId.name,alias:i.RepositoryId.alias},env:i.RepositoryId.envVar,description:v.app.create.options.repositoryId,optionalInNonInteractive:!0},{flags:{key:i.Template.name,alias:i.Template.alias},env:i.Template.envVar,default:ot,description:v.app.create.options.template,optionalInNonInteractive:!0},{flags:{key:i.Repo.name},env:i.Repo.envVar,description:v.app.create.options.repo,optionalInNonInteractive:!0},{flags:{key:i.BuildType.name},env:i.BuildType.envVar,description:v.app.create.options.buildType,optionalInNonInteractive:!0,hidden:!0},U({flags:{key:i.BuildPath.name,alias:i.BuildPath.alias},env:i.BuildPath.envVar,message:i.BuildPath.promptMessage,initialValue:i.BuildPath.initialValue,description:v.app.create.options.buildPath}),U({flags:{key:i.BuildCommand.name,alias:i.BuildCommand.alias},env:i.BuildCommand.envVar,message:i.BuildCommand.promptMessage,initialValue:i.BuildCommand.initialValue,description:v.app.create.options.buildCommand}),U({flags:{key:i.BuildEntryPoint.name},env:i.BuildEntryPoint.envVar,message:i.BuildEntryPoint.promptMessage,initialValue:i.BuildEntryPoint.initialValue,default:"index.html",description:v.app.create.options.buildEntryPoint})]),e.addSwitch({flags:{key:i.OpenBrowser.name},description:v.app.create.options.openBrowser}),e.addSwitch({flags:{key:i.ForceReauth.name},description:v.app.create.options.forceReauth})}export{Z as buildOrphanedAppRecoveryHint,ee as canonicalizeAndValidateManagedProjectAppDirectory,ft as cloneRepo,ct as commitAndPushScaffoldAsync,Qt as createMaafAppAsync,gt as ensureExternalRepoIsEmpty,qe as ensureRepoTargetDirectoryEmpty,We as ensureTargetDirectoryEmpty,ht as ensureTargetDirectoryWritable,mt as ensureTemplateSourceValid,Q as initLocalRepo};
|
|
19
|
-
/*!
|
|
20
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
21
|
-
*/
|
|
22
|
-
//# sourceMappingURL=CreateMaafApp-6MSPHUU4.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{d as Q}from"./chunk-EFY2BSWB.js";import{b as z}from"./chunk-PEZMQ2A3.js";import{b as A,c as M}from"./chunk-TXMTKOEJ.js";import{a as H}from"./chunk-2VJIWD7V.js";import{a as _}from"./chunk-OL6CTXQR.js";import{b as X,c as Z}from"./chunk-5MHBEEMZ.js";import{a as K,b as Y}from"./chunk-DGUO74I3.js";import{a as q}from"./chunk-RDXQ3ZPT.js";import"./chunk-Q3ONTUZ7.js";import"./chunk-XIX2O22O.js";import{a as F}from"./chunk-TMYOZDLM.js";import"./chunk-TYRVM4PP.js";import{d as j,i as V,j as W}from"./chunk-ZB6MB7GZ.js";import{i as J,m as B}from"./chunk-GE3UFHZ5.js";import{Nb as G,Pb as L,ja as P,ma as N,na as T,x as l,z as S}from"./chunk-4XKA5APP.js";import"./chunk-FHE3OXIP.js";import"./chunk-OUKOEUZA.js";import{L as s}from"./chunk-4U53RYJJ.js";import{a as f}from"./chunk-HOIFXUTG.js";import{C as O,D,E as $,I as k,o as c,y as v,z as U}from"./chunk-KKC5ZK4D.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";import*as a from"fs";import*as I from"path";var ae="Initial scaffold from 'ms project create'";function se(e){e.setDescription(f.project.create.description),e.addExamples(f.project.create.examples),e.consumePositionalArg("[directory]"),e.addOptions([J({flags:{key:s.DisplayName.name,alias:s.DisplayName.alias},message:s.DisplayName.promptMessage,description:f.project.create.options.displayName}),{flags:{key:s.EnvironmentId.name,alias:s.EnvironmentId.alias},env:s.EnvironmentId.envVar,description:f.project.create.options.environmentId,optionalInNonInteractive:!0},{flags:{key:s.Repo.name},description:f.project.create.options.repo,optionalInNonInteractive:!0}]),e.addSwitch({flags:{key:s.OpenBrowser.name},description:f.project.create.options.openBrowser}),e.addSwitch({flags:{key:s.ForceReauth.name},description:f.project.create.options.forceReauth})}async function xe(e){v();try{await ce(e)}catch(o){throw o instanceof L||U()&&z(o),o}}async function ce(e){se(e),await e.runVerb();let o=(await e.getOption("displayName"))?.trim();if(!o)throw new l("Argument displayName is required. Use --display-name or -n to specify it.");if(o.length>N)throw new l(`Argument displayName must not exceed ${N} characters.`);let g=e.getPositionalArg(0);if(g===void 0&&!H(o))throw new l("The display name cannot be used as a directory name. Specify a target directory as the first argument.");let n=g??o,C=await e.getOption(s.Repo.name,!0),{repoType:p,remoteUrl:b}=Z(C);if(p==="none")throw new l("'--repo none' is not supported for managed projects. Omit '--repo' for a platform-managed repository or pass an external GitHub repository URL.");F(),E(n);let R=await e.getTenantIdAsync();if(!R)throw new l("Unable to determine tenant ID. Ensure you are logged in.");let w=e.isJsonMode(),ee=await e.getOption(s.OpenBrowser.camelName,!0)??!1,te=await e.getOption(s.ForceReauth.camelName,!0)??!1,y=!w&&process.stdout.isTTY?new _:null,m=w?void 0:d=>{y?y.update(d):k(d)},re=d=>{y?y.start(d):m?.(d)};try{re("Resolving environment...");let d=await B(e,{failIfMissing:!1}),oe=d?void 0:K(e,R,G(),"CreateMaafProject"),ie=await Y(d,oe);e.updateEnvironmentId(ie),m?.("Creating managed project..."),w&&p==="github"&&$({phase:"project-create-validation"});let t=await q(({isRetry:r})=>T({displayName:o,...p==="github"&&{externalRepo:{provider:"GitHubEnterprise",remoteUrl:b}},...p==="github"&&te&&!r&&{forceReauth:!0}}),{repoType:p,externalRepoUrl:b,tenantId:R,jsonMode:w,openBrowser:ee,verb:"project create"}),x=t.repositoryId?.trim();if(!x)throw new S(`Managed project '${t.displayName}' (${t.projectId}) was created, but the service response did not include a repository ID.`,{partialSuccess:!0,projectId:t.projectId,phase:"repository-metadata"});let i;if(p==="github"){let r=t.cloneUrl?.trim()||b;try{i=X(r,"The service clone URL")}catch(ne){throw u(t,b,"repository-metadata",`Managed project '${t.displayName}' (${t.projectId}) was created, but the service returned an invalid external repository clone URL.`,ne)}}else i=P(x);let h;if(p==="github"){try{m?.("Cloning external project repository..."),E(n),Q({directory:n,repoUrl:i})}catch(r){throw u(t,i,"git-clone",`Managed project '${t.displayName}' (${t.projectId}) was created, but the external repository could not be cloned. Clone ${i} manually before creating ${c}.`,r)}try{m?.("Writing project configuration...");let r=I.join(n,c);if(a.existsSync(r))throw new l(`Repository '${i}' already contains ${c}. Use the existing managed project configuration instead of creating another project.`);h=A(t,e.getCloud(),i),M(r,h)}catch(r){throw u(t,i,"local-files",`Managed project '${t.displayName}' (${t.projectId}) was created and the external repository was cloned, but ${c} could not be created.`,r)}}else{try{m?.("Writing project configuration..."),E(n),a.mkdirSync(n,{recursive:!0}),h=A(t,e.getCloud());let r=I.join(n,c);M(r,h)}catch(r){throw u(t,i,"local-files",`Managed project '${t.displayName}' (${t.projectId}) was created, but its local files could not be prepared. Use ${i} to set up the local working tree manually.`,r)}try{m?.("Initializing project repository..."),V({directory:n,gitUrl:i,loginAuthority:e.getLoginAuthority(R),authResource:e.getAuthResourceUrl(),emitRemoteError:!1}),W(n,i,"main",void 0,!1),j(["checkout","-B","main","origin/main"],{cwd:n,emitStderr:!1})}catch(r){throw u(t,i,"git-setup",`Managed project '${t.displayName}' and ${c} were created, but local Git setup failed. Use ${i} to set up the local working tree manually.`,r)}}try{m?.("Committing project configuration..."),j(["add","--",c],{cwd:n,emitStderr:!1}),j(["commit","-m",ae,"--",c],{cwd:n,emitStderr:!1})}catch(r){throw u(t,i,"git-commit",`Managed project '${t.displayName}', ${c}, and the local repository were created, but the local commit was not completed. Complete git add and git commit manually.`,r)}try{m?.("Pushing project repository..."),j(["-c","http.sslVersion=tlsv1.3","push","-u","origin",p==="github"?"HEAD":"main"],{cwd:n,network:!0,...p==="native"&&{classify:{action:"pushing the managed project repository"}},emitStderr:!1})}catch(r){throw u(t,i,"git-push",`Managed project '${t.displayName}', ${c}, the local repository, and the local commit were created, but git push failed. Retry git push.`,r)}y?.stop(),w?p==="github"?$({success:!0,...h}):D(h):O(`Created project '${t.displayName}'.`)}finally{y?.stop()}}function E(e){if(a.existsSync(e)){if(!a.statSync(e).isDirectory())throw new l(`'${e}' exists and is not a directory.`);if(a.readdirSync(e).length>0)throw new l(`'${e}' is not empty. Specify an empty directory.`)}let o=e;for(;!a.existsSync(o);){let g=I.dirname(o);if(g===o)break;o=g}try{a.accessSync(o,a.constants.W_OK)}catch{throw new S(`'${e}' is not writable. Choose a different directory or fix its permissions.`)}}function pe(e){return e instanceof Error?e.message:String(e)}function u(e,o,g,n,C){return new S(n,{partialSuccess:!0,projectId:e.projectId,cloneUrl:o,phase:g,underlyingError:pe(C)})}export{c as ProjectConfigFileName,xe as createMaafProjectAsync,E as ensureProjectTargetDirectory};
|
|
8
|
-
/*!
|
|
9
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
-
*/
|
|
11
|
-
//# sourceMappingURL=CreateMaafProject-JKMF5TH3.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 v,l as u}from"./chunk-GE3UFHZ5.js";import{Ha as c,Nb as l,Ob as f,x as m}from"./chunk-4XKA5APP.js";import"./chunk-FHE3OXIP.js";import"./chunk-OUKOEUZA.js";import{B as r}from"./chunk-4U53RYJJ.js";import{a as o}from"./chunk-HOIFXUTG.js";import{C as p,D as d,K as i}from"./chunk-KKC5ZK4D.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function D(e){I(e),await e.runVerb();let t=await u(e),a=e.getEnvironmentId({includeConfig:!1}),s=await e.getTenantIdAsync();if(!s)throw new m("Unable to determine tenant ID. Ensure you are logged in.");let g=f();if(!await e.getOption("force",!0)&&g.interactive){let A=a?`app '${t}' from environment '${a}'`:`app '${t}'`;if(!await v({message:`Are you sure you want to delete ${A}? This cannot be undone. Your source code in the repo will not be deleted.`})){i("Delete cancelled.");return}}let n=await c({tenantId:s,environmentId:a,logger:l(),actionsParams:{appName:t}});if(e.isJsonMode()){d({appName:t,environmentId:n.environmentId,existed:n.existed,...n.recovered?{recovered:!0}:{}});return}n.recovered&&n.existed?p(`App '${t}' deleted from environment '${n.environmentId}' after recovering from an interrupted request.`):n.recovered?i(`App '${t}' is already absent from environment '${n.environmentId}'; a bounded recovery replay confirmed the final state after an interrupted request.`):n.existed?p(`App '${t}' deleted from environment '${n.environmentId}'.`):i(`App '${t}' did not exist in environment '${n.environmentId}'; nothing was deleted.`)}function I(e){e.setDescription(o.app.delete.description),e.addExamples(o.app.delete.examples),e.addSwitch({flags:{key:"force",alias:"f"},description:o.app.delete.options.force}),e.addOptions([{flags:{key:r.AppName.name},env:r.AppName.envVar,description:o.app.delete.options.app,optionalInNonInteractive:!0},{flags:{key:r.EnvironmentId.name,alias:r.EnvironmentId.alias},env:r.EnvironmentId.envVar,description:o.app.delete.options.environmentId,optionalInNonInteractive:!0}])}export{D as deleteMaafAppAsync};
|
|
8
|
-
/*!
|
|
9
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
-
*/
|
|
11
|
-
//# sourceMappingURL=DeleteMaafApp-TFGWGJO3.js.map
|
|
@@ -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{a,b}from"./chunk-A4PVXTJS.js";import"./chunk-NYPHWF7Q.js";import"./chunk-PLFDUGBA.js";import"./chunk-6EF722GY.js";import"./chunk-HBLO3WDD.js";import"./chunk-QLK3ZVWP.js";import"./chunk-PZIEJEF5.js";import"./chunk-OL6CTXQR.js";import"./chunk-RDXQ3ZPT.js";import"./chunk-Q3ONTUZ7.js";import"./chunk-XIX2O22O.js";import"./chunk-TYRVM4PP.js";import"./chunk-ZB6MB7GZ.js";import"./chunk-2LKCCYRF.js";import"./chunk-GE3UFHZ5.js";import"./chunk-4XKA5APP.js";import"./chunk-2LDU3F6O.js";import"./chunk-RFLXPXBN.js";import"./chunk-FHE3OXIP.js";import"./chunk-OUKOEUZA.js";import"./chunk-4U53RYJJ.js";import"./chunk-HOIFXUTG.js";import"./chunk-KKC5ZK4D.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";export{a as deployMaafAppAsync,b as executeDeployAsync};
|
|
8
|
-
//# sourceMappingURL=DeployMaafApp-K2APWFOD.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 U}from"./chunk-A4PVXTJS.js";import"./chunk-NYPHWF7Q.js";import"./chunk-PLFDUGBA.js";import"./chunk-6EF722GY.js";import"./chunk-HBLO3WDD.js";import"./chunk-QLK3ZVWP.js";import"./chunk-PZIEJEF5.js";import{a as l}from"./chunk-TXMTKOEJ.js";import"./chunk-OL6CTXQR.js";import{a as E,b as P}from"./chunk-DGUO74I3.js";import"./chunk-RDXQ3ZPT.js";import"./chunk-Q3ONTUZ7.js";import"./chunk-XIX2O22O.js";import"./chunk-TYRVM4PP.js";import"./chunk-ZB6MB7GZ.js";import"./chunk-2LKCCYRF.js";import"./chunk-GE3UFHZ5.js";import{Ma as A,Nb as d,Ob as h,fb as v,qa as C,x as r,z as w}from"./chunk-4XKA5APP.js";import"./chunk-2LDU3F6O.js";import"./chunk-RFLXPXBN.js";import"./chunk-FHE3OXIP.js";import"./chunk-OUKOEUZA.js";import{z as g}from"./chunk-4U53RYJJ.js";import"./chunk-HOIFXUTG.js";import"./chunk-KKC5ZK4D.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function G(e){await U(e,!0,M)}async function M(e){let n=h(),i=o(await e.getOption(g.ProjectId.camelName,!0)),c=o(await e.getOption(g.EnvironmentId.camelName,!0));if(c&&e.updateEnvironmentId(c),!i&&n.projectConfigError)throw new w(`Unable to read ${n.fileConfig.projectConfigPath}. ${n.projectConfigError.message}`);let x=o(n.appConfig?.projectId),T=o(n.projectConfig?.projectId),p=i??x??T,m=o(n.appConfig?.appId);if(!p&&!m)throw new r("Argument project is required. Use --project or -p to specify it, or run from a directory containing ms.project.config.json or an ms.config.json associated with a managed project.");let s=await e.getTenantIdAsync();if(!s)throw new r("Unable to determine tenant ID. Ensure you are logged in.");if(!i&&m){let t=await A({tenantId:s,environmentId:c??o(n.appConfig?.environmentId),logger:d(),actionsParams:{appName:m}});if(o(t.projectId)){let u=t.repoType?l(t.repoType):n.appConfig?.repoType??"native";if(u==="none")throw new r("`ms project deploy` currently supports only git-backed managed projects.");return e.updateEnvironmentId(t.environmentId),{appName:t.id,tenantId:o(t.tenantId)??s,environmentId:t.environmentId,repoType:u,externalRepoUrl:o(t.externalRepo?.remoteUrl)??o(t.cloneUrl)??o(n.appConfig?.externalRepoUrl),interactive:n.interactive}}if(!p)throw new r("The current app is not associated with a managed project.")}if(!p)throw new r("Unable to determine the managed project ID.");let F=n.projectConfig?.projectId.toLowerCase()===p.toLowerCase()?n.projectConfig:void 0,I=o(n.appConfig?.projectId)?.toLowerCase()===p.toLowerCase()?n.appConfig:void 0,j=c??o(F?.environmentId)??o(I?.environmentId),L=j?void 0:E(e,s,d(),"DeployMaafProject"),D=await P(j,L);e.updateEnvironmentId(D);let a=await v({projectId:p,logger:d()});e.updateEnvironmentId(a.environmentId);let R=await C(a.projectId),f=b(R),y=l(f.repoType??a.repoType);if(y==="none")throw new r("`ms project deploy` currently supports only git-backed managed projects.");return{appName:f.id,tenantId:a.tenantId,environmentId:a.environmentId,repoType:y,externalRepoUrl:o(f.cloneUrl)??o(I?.externalRepoUrl),interactive:n.interactive}}function b(e){if(e.length===0)throw new r("Project contains no deployable apps.");if(e.length>1){let n=e.map(i=>`${i.displayName} (${i.id})`).join(", ");throw new r(`\`ms project deploy\` currently supports projects containing exactly one app. Found: ${n}.`)}return e[0]}function o(e){return typeof e=="string"&&e.trim()||void 0}export{G as deployMaafProjectAsync};
|
|
8
|
-
/*!
|
|
9
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
-
*/
|
|
11
|
-
//# sourceMappingURL=DeployMaafProject-6WRKGIIW.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{c as y}from"./chunk-WTTK2GTG.js";import"./chunk-DKSLWH4O.js";import"./chunk-GE3UFHZ5.js";import{Nb as f,ab as I,lb as g,mb as u}from"./chunk-4XKA5APP.js";import"./chunk-BRRT2E75.js";import"./chunk-2LDU3F6O.js";import"./chunk-RFLXPXBN.js";import"./chunk-FHE3OXIP.js";import"./chunk-OUKOEUZA.js";import{Q as o}from"./chunk-4U53RYJJ.js";import{a as p}from"./chunk-HOIFXUTG.js";import{C as m,D as l}from"./chunk-KKC5ZK4D.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function v(e,n){w(e,n),await e.runVerb();let{target:t,deploymentId:i}=await A(e),a=(await e.getOption(o.Comment.name,!0))?.trim(),{projectId:r,tenantId:s,environmentId:c}=await y(e),d=f();if(await g({tenantId:s,environmentId:c,logger:d,actionsParams:{projectId:r,decision:n,...a?{comment:a}:{},...t?{target:t}:{},...i?{deploymentId:i}:{}}}),e.isJsonMode()){l({projectId:r,decision:n,...t?{target:t}:{},...i?{deploymentId:i}:{}});return}let j=n==="Approved"?"Approved":"Rejected",D=t?` to the '${t}' target`:"",S=i?` (deployment '${i}')`:"";m(`${j} the deployment${D} of project '${r}'${S}.`)}async function O(e){await v(e,"Approved")}async function C(e){await v(e,"Rejected")}async function M(e){P(e),await e.runVerb();let{target:n,deploymentId:t}=await A(e),{projectId:i,tenantId:a,environmentId:r}=await y(e),s=f();if(await u({tenantId:a,environmentId:r,logger:s,actionsParams:{projectId:i,...n?{target:n}:{},...t?{deploymentId:t}:{}}}),e.isJsonMode()){l({projectId:i,...n?{target:n}:{},...t?{deploymentId:t}:{}});return}let c=n?` to the '${n}' target`:"",d=t?` (deployment '${t}')`:"";m(`Cancelled the deployment${c} of project '${i}'${d}.`)}async function A(e){let n=(await e.getOption(o.Target.name,!0))?.trim(),t=(await e.getOption("deploymentId",!0))?.trim();return{target:n||(t?void 0:I),deploymentId:t||void 0}}function w(e,n){let t=n==="Approved"?p.deployment.approve:p.deployment.reject;e.setDescription(t.description),e.addExamples(t.examples),e.addOptions([{flags:{key:o.ProjectId.name,alias:o.ProjectId.alias},description:t.options.projectId,optionalInNonInteractive:!0},{flags:{key:o.EnvironmentId.name,alias:o.EnvironmentId.alias},env:o.EnvironmentId.envVar,description:t.options.environmentId,optionalInNonInteractive:!0},{flags:{key:o.Target.name},description:t.options.target,optionalInNonInteractive:!0},{flags:{key:o.Comment.name},description:t.options.comment,optionalInNonInteractive:!0},{flags:{key:o.DeploymentId.name},description:t.options.deploymentId,optionalInNonInteractive:!0,hidden:!0}])}function P(e){let n=p.deployment.cancel;e.setDescription(n.description),e.addExamples(n.examples),e.addOptions([{flags:{key:o.ProjectId.name,alias:o.ProjectId.alias},description:n.options.projectId,optionalInNonInteractive:!0},{flags:{key:o.EnvironmentId.name,alias:o.EnvironmentId.alias},env:o.EnvironmentId.envVar,description:n.options.environmentId,optionalInNonInteractive:!0},{flags:{key:o.Target.name},description:n.options.target,optionalInNonInteractive:!0},{flags:{key:o.DeploymentId.name},description:n.options.deploymentId,optionalInNonInteractive:!0,hidden:!0}])}export{O as approveDeploymentAsync,M as cancelDeploymentAsync,C as rejectDeploymentAsync};
|
|
8
|
-
/*!
|
|
9
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
-
*/
|
|
11
|
-
//# sourceMappingURL=DeploymentApprovals-WTXBXCKE.js.map
|
package/dist/Dev-CIEWFRXR.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{a as Y,b as X}from"./chunk-ATUGCFVC.js";import{b as W,d as $,e as k,f as D,g as R,h as T,j as q,l as G}from"./chunk-6EF722GY.js";import"./chunk-HBLO3WDD.js";import{C as U,Ob as j,o as V,z as E}from"./chunk-4XKA5APP.js";import{m as B}from"./chunk-2LDU3F6O.js";import"./chunk-RFLXPXBN.js";import{a as L}from"./chunk-FHE3OXIP.js";import{g as J,k as H}from"./chunk-OUKOEUZA.js";import{m as p}from"./chunk-4U53RYJJ.js";import{a as v}from"./chunk-HOIFXUTG.js";import{I as w,K as A,L as O,a as y,h as _}from"./chunk-KKC5ZK4D.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";import{spawn as lt}from"node:child_process";import{createRequire as ct}from"node:module";import*as nt from"node:path";import{setTimeout as pt}from"node:timers/promises";import{pathToFileURL as dt}from"node:url";import{styleText as P}from"node:util";import*as I from"fs";import*as ot from"http";import*as z from"node:net";var S=65535;async function st(t){return!Number.isInteger(t)||t<1||t>S?!1:new Promise(n=>{let e=z.createServer();e.once("error",()=>{n(!1)}),e.once("listening",()=>{e.close(()=>n(!0))});try{e.listen({port:t,exclusive:!0})}catch{n(!1)}})}async function x(t,n=100){if(!Number.isInteger(t)||t<1||t>S)throw new Error(`Invalid port "${t}". Pass a valid --port between 1 and ${S} and try again.`);for(let e=0;e<n;e++){let r=t+e;if(r>S)break;if(await st(r))return r}throw new Error(`Could not find an available port in the range ${t}-${Math.min(t+n-1,S)}. Close some processes or pass a different --port and try again.`)}function K(t,n=80){try{let e=new URL(t);return e.port?parseInt(e.port,10):e.protocol==="https:"?443:n}catch{return n}}function Q(t,n){try{let e=new URL(t);e.port=String(n);let r=e.toString();return!t.endsWith("/")&&r.endsWith("/")&&(r=r.slice(0,-1)),r}catch{return t}}var ft=["powerApps","managedApps"];async function Jt(t){let n=j(),{appConfig:e,fileConfig:r}=n,o=nt.dirname(r.appConfigPath);gt(t,e?.localAppUrl),await t.runVerb();let d=await t.getOption("configOnly"),i=new AbortController;process.once("SIGINT",()=>i.abort()),process.once("SIGTERM",()=>i.abort());let l=B("rayfin");if(l&&await W(o)&&await G({projectRoot:o,cliVersion:L.version,env:H(await q(o)),onDetail:t.isJsonMode()?m=>process.stderr.write(`${m}
|
|
8
|
-
`):w}),J("FEATURE_RAYFIN",l?"true":"false"),d){await tt(o)&&A("Warning: --config-only is not needed when using the vite plugin. The plugin already serves the config and prints the play URL.");let m=await t.getOption("localAppUrl");await Z(t,r.appConfigPath,e,i.signal,m);return}let u=X(o);if(!u.scripts?.dev)throw new E('No "dev" script found in package.json. Add a "dev" script to start your app.');if(await tt(o)){await et(o,i.signal,u,[],{captureDiagnostics:t.isJsonMode()||!n.interactive,jsonMode:t.isJsonMode()});return}let s=await t.getOption("localAppUrl"),a=K(s,3e3),f=await x(a),h=[],g=s;f!==a&&(g=Q(s,f),h=["--port",String(f),"--strictPort"],A(`Warning: port ${a} is already in use. Starting the app dev server on port ${f} instead.`)),await Promise.all([et(o,i.signal,u,h,{captureDiagnostics:t.isJsonMode()||!n.interactive,jsonMode:t.isJsonMode()}),Z(t,r.appConfigPath,e,i.signal,g)])}async function Z(t,n,e,r,o){if(!e)throw new E(`${y} is required to run an app`);if(!e.environmentId)throw new E(`Environment ID is required in ${y} to run an app`);e.cloud||(e.cloud="public");let d=await t.getOption("port"),i=parseInt(d,10),l=await x(i);l!==i&&A(`Warning: port ${i} is already in use. Using port ${l} for the config server instead.`),await ut(n,l,e,o,r)}async function ut(t,n,e,r,o){return new Promise((d,i)=>{let l=ot.createServer((s,a)=>{if(a.setHeader("Access-Control-Allow-Origin","*"),a.setHeader("Access-Control-Allow-Methods","GET, OPTIONS"),a.setHeader("Access-Control-Allow-Headers","*"),s.method==="OPTIONS"){a.writeHead(200),a.end();return}try{if(!I.existsSync(t)){a.writeHead(404,{"Content-Type":"application/json"}),a.end(JSON.stringify({error:`${y} not found`}));return}let f=I.readFileSync(t,"utf8");a.writeHead(200,{"Content-Type":"application/json"}),a.end(f)}catch(f){O(`Error serving ${y}: ${f.message}`),a.writeHead(500,{"Content-Type":"application/json"}),a.end(JSON.stringify({error:"Internal server error"}))}});l.listen(n,"localhost",async()=>{if(await mt(r,o),!o.aborted){let s=_(e.cloud),a=V(s,{appUrl:r,appConfigUrl:`http://localhost:${n}`});w(`
|
|
9
|
-
Ready. You can play your app locally at:
|
|
10
|
-
${P(["blueBright","bold"],` \u279C ${a}`)}`)}}),l.on("error",s=>{O(`Server error: ${s.message}`),i(s)});let u=()=>{w(P("dim",`
|
|
11
|
-
Shutting down config server...`)),l.closeAllConnections(),l.close(()=>{w(P("dim","Config server stopped.")),d()}),setTimeout(d,2e3).unref()};o.aborted?u():o.addEventListener("abort",u,{once:!0})})}function gt(t,n){t.setDescription(v.app.dev.description),t.addExamples(v.app.dev.examples),t.addOptions([{flags:{key:p.Port.name,alias:p.Port.alias},env:p.Port.envVar,default:p.Port.initialValue,description:v.app.dev.options.port},{flags:{key:p.LocalAppUrl.name,alias:p.LocalAppUrl.alias},env:p.LocalAppUrl.envVar,default:n||p.LocalAppUrl.initialValue,description:v.app.dev.options.localAppUrl}]),t.addSwitch({flags:{key:p.ConfigOnly.name,alias:p.ConfigOnly.alias},env:p.ConfigOnly.envVar,description:v.app.dev.options.configOnly})}async function mt(t,n,e=300,r=1e4){w(P("dim",`Waiting for app to be available at ${t}...`));let o=AbortSignal.timeout(r),d=AbortSignal.any([n,o]);try{for(;!d.aborted;){await pt(e,void 0,{signal:d});try{let i=await fetch(t,{method:"HEAD"});if(i.ok||i.status<500)return}catch{}}}catch{}finally{o.aborted&&A(`Warning: timed out looking for app running at ${t}`)}}async function tt(t){let n;try{let r=ct(`${t}/package.json`).resolve("vite");n=(await import(dt(r).href)).loadConfigFromFile}catch{return!1}try{return((await n({command:"serve",mode:"development"},void 0,t))?.config?.plugins??[]).flat().some(o=>typeof o=="object"&&o!==null&&ft.includes(o.name))}catch{return!1}}var vt=new Set([130,143,1073807364,-1,4294967295]);function wt(t,n,e){return t===0||e||n==="SIGINT"||n==="SIGTERM"?!0:t!==null&&vt.has(t)}async function et(t,n,e,r=[],o={}){let d=Y(t,e),i=o.captureDiagnostics??!1,l=o.jsonMode??!1,u=o.writeStdout??(a=>process.stdout.write(a)),s=o.writeStderr??(a=>process.stderr.write(a));return new Promise((a,f)=>{let h=r.length>0?` -- ${r.join(" ")}`:"",g=lt(`${d} run dev${h}`,{cwd:t,stdio:yt(i),shell:!0}),m=k(),M=k();i&&(g.stdout?.on("data",c=>{D(m,c,$),(l?s:u)(c)}),g.stderr?.on("data",c=>{D(M,c,$),s(c)})),g.on("close",(c,F)=>{if(wt(c,F,n.aborted))a();else{let b=i?T(R(M),t):"",C=i?T(R(m),t):"",rt={commandExitCode:c,diagnosticCapture:i?"captured":"unavailable_interactive",...b&&{stderrTail:b},...C&&{stdoutTail:C}},it={commandExitCode:c,diagnosticCapture:i?"captured":"unavailable_interactive"},at=i?{...b&&{stderrTail:b},...C&&{stdoutTail:C}}:void 0;f(new U(`Dev server exited unexpectedly with code ${c??"unknown"}.`,1,rt,{errorCode:"DevServerExited",telemetryDetails:it,outputDetails:at}))}}),g.on("error",c=>{let F={underlyingError:T(c.message,t)};f(new U("Could not start the app dev server.",1,F,{errorCode:"DevServerStartFailed",telemetryDetails:{diagnosticCapture:"unavailable_start_failure"}}))});let N=()=>{g.kill("SIGINT")};n.aborted?N():n.addEventListener("abort",N,{once:!0})})}function yt(t){return t?["ignore","pipe","pipe"]:"inherit"}export{Jt as devAsync,yt as getDevServerStdio,wt as isIntentionalDevExit,et as runDevScriptAsync};
|
|
12
|
-
/*!
|
|
13
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
14
|
-
*/
|
|
15
|
-
//# sourceMappingURL=Dev-CIEWFRXR.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{Nb as w,x as F,z as V}from"./chunk-4XKA5APP.js";import{b as a,c as u,d as l,e as D,f as M,g as c,h as d,k as b,l as P}from"./chunk-2LDU3F6O.js";import{a as R,b as x,c as L,d as O,e as J,f as T}from"./chunk-RFLXPXBN.js";import"./chunk-FHE3OXIP.js";import{c as I,d as j}from"./chunk-OUKOEUZA.js";import{N as S}from"./chunk-4U53RYJJ.js";import{a as f}from"./chunk-HOIFXUTG.js";import{A as U,B as A,C as g,D as m,F as k,I as N,K as p}from"./chunk-KKC5ZK4D.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";var h={environment:"environment variable",userSettings:"user settings",tenant:"tenant default",workspace:"used by this app or project",default:"default"};async function le(e){e.setDescription(f.feature.list.description),e.addExamples(f.feature.list.examples),await e.runVerb();let t=E(),n=P(d(t));if(e.isJsonMode()){k(n);return}U({title:"CLI features",columns:[{header:"Name"},{header:"Stage"},{header:"State"},{header:"Source"},{header:"Description"}],rows:n.map(r=>[r.name,r.stage,v(r.enabled),h[r.source],r.description]),emptyMessage:"This version of the CLI has no experimental or preview features."});for(let r of Z(t))p(r)}async function ce(e){$(e,"status"),await e.runVerb();let t=K(await C(e)),n=E(),r=b(t,d(n));if(e.isJsonMode()){m({feature:r});return}A({title:`CLI feature '${r.name}'`,items:[r],fields:[{label:"Stage",value:i=>i.stage},{label:"Description",value:i=>i.description},{label:"State",value:i=>v(i.enabled)},{label:"Source",value:i=>h[i.source]},{label:"Environment variable",value:H},{label:"User setting",value:i=>Q(i,n)},{label:"Tenant default",value:X},{label:"Used by this app or project",value:i=>i.usedInWorkspace?"yes":"no"}]})}async function de(e){await _(e,"enable","enabled")}async function fe(e){await _(e,"disable","disabled")}async function ge(e){$(e,"reset"),await e.runVerb();let t=await C(e),n=E(),r=Y(c(n),t);if(!r&&!l(t))throw W(t);r&&(n=z(s=>G(s,t)));let i=l(t)?b(t,d(n)):void 0;if(e.isJsonMode()){m({name:t,removed:r,...i&&{feature:i}});return}if(!r){N(`Feature '${t}' has no saved setting; nothing to reset.`);return}if(!i){g(`Removed the saved setting for unknown feature '${t}'.`);return}g(`Removed the saved setting for feature '${t}'. It is now ${v(i.enabled)} (${h[i.source]}).`)}async function _(e,t,n){$(e,t),await e.runVerb();let r=K(await C(e)),i=z(o=>({...o,[a]:{...q(c(o),r),[r]:n}})),s=b(r,d(i));if(w().trackActivityEvent("Feature.SettingSaved",{featureName:r,setting:n,stage:s.stage}),e.isJsonMode()){m({feature:s});return}g(`Feature '${r}' is now ${n} for future runs.`),s.source==="environment"?p(`${s.envVar}=${s.envValue} is set and takes precedence over saved settings, so '${r}' stays ${v(s.enabled)} while it is set.`):s.source==="workspace"&&p(`This app or project already uses '${r}', so it stays enabled here.`)}function $(e,t){let n=f.feature[t];e.setDescription(n.description),e.addExamples(n.examples),e.addOptions([{flags:{key:S.Name.name},description:n.options.name}])}async function C(e){let t=await e.getOption(S.Name.name,!0),n=typeof t=="string"?u(t):"";if(!n)throw new F(`Provide a feature name via --${S.Name.name}. Run '${"ms"} feature list' to see available features.`);return n}function K(e){if(!l(e))throw W(e);return e}function W(e){let t=D().join(", ")||"none";return new F(`Unknown feature '${e}'. Available features: ${t}. Run '${"ms"} feature list' for details.`)}function E(){try{return O()}catch(e){throw B("read",e)}}function z(e){try{return T(e)}catch(t){throw B("update",t)}}function B(e,t){return w().trackErrorEvent("Feature.SettingsFileFailed",{operation:e,...J(t)}),x(),new V(e==="read"?"Couldn't read the CLI's userSettings.json. Make sure it contains a valid JSON object, or delete it to clear your saved settings.":"Couldn't save your feature settings to the CLI's userSettings.json. Make sure it contains a valid JSON object and can be written.")}function Y(e,t){return Object.keys(e).some(n=>u(n)===t)}function q(e,t){return Object.fromEntries(Object.entries(e).filter(([n])=>u(n)!==t))}function G(e,t){let n={...e},r=q(c(e),t);return Object.keys(r).length>0?n[a]=r:delete n[a],n}function v(e){return e?"enabled":"disabled"}function H(e){if(e.envValue===void 0)return`${e.envVar} (not set)`;let t=`${e.envVar}=${e.envValue}`;return I(e.envValue)||j(e.envValue)?t:`${t} (ignored: not a recognized true/false value)`}function Q(e,t){return e.userSetting?e.userSetting:Y(c(t),e.name)?'ignored (expected "enabled" or "disabled")':"not set"}function X(e){return e.tenantId===void 0?"not signed in":`${e.tenantDefault??"not set"} (tenant ${e.tenantId})`}function Z(e){let t=e?.[a];if(t===void 0)return[];let n=R();if(!L(t))return[`Ignoring '${a}' in ${n}: expected a JSON object.`];let r=[];for(let[i,s]of Object.entries(t)){let o=u(i);l(o)?M(s)||r.push(`Ignoring saved setting for feature '${i}' in ${n}: expected "enabled" or "disabled".`):r.push(`Ignoring saved setting for unknown feature '${i}' in ${n}. Remove it with '${"ms"} feature reset --name ${o}'.`)}return r}export{fe as featureDisableAsync,de as featureEnableAsync,le as featureListAsync,ge as featureResetAsync,ce as featureStatusAsync};
|
|
8
|
-
/*!
|
|
9
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
-
*/
|
|
11
|
-
//# sourceMappingURL=FeatureSettings-77LZQSKD.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 U}from"./chunk-KT2SUHGM.js";import{a as $}from"./chunk-PZIEJEF5.js";import"./chunk-OL6CTXQR.js";import{e as k,f as L}from"./chunk-ZB6MB7GZ.js";import{l as D}from"./chunk-GE3UFHZ5.js";import{Fa as v,La as I,Nb as f,Ob as g,x as l}from"./chunk-4XKA5APP.js";import"./chunk-FHE3OXIP.js";import"./chunk-OUKOEUZA.js";import{w as s}from"./chunk-4U53RYJJ.js";import{a as m}from"./chunk-HOIFXUTG.js";import{D as A,I as a,a as d}from"./chunk-KKC5ZK4D.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function W(t){await B(t,!1)}async function X(t){await B(t,!0)}async function B(t,e){R(t,e),await t.runVerb();let o=await t.getOption("commit"),N=g().appConfig?.repoType!=="none",h=o?L(o,N):void 0,w=e?E(g().appConfig?.appId):void 0;if(e&&!w)throw new l(`A valid ${d} with an app ID is required to check the project build status.`);if(!t.getEnvironmentId())throw new l(e?`No environment ID found. Use \`ms project build-status\` from a directory with a valid ${d}.`:`\`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 ${d}) followed by \`ms app deploy\`. To run this deprecated command, invoke it from a directory with a ${d} (created by \`ms app create\`).`);if(!await t.getTenantIdAsync())throw new l("Unable to determine tenant ID. Ensure you are logged in.");let b=w??await D(t),p=h?void 0:k(),r=h??p?.commitSha;if(!r)throw new l("Unable to infer the current commit ID. Use --commit or -c to specify it.");let c=await t.getOption("showLog")===!0;!t.isJsonMode()&&p&&a(p.detached?`Detached HEAD at commit ${r}.`:`Using branch '${p.branch}' at commit ${r}.`);let i=await v({logger:f(),actionsParams:{appName:b,commitSha:r}}),n=$(i.result),y=O(i.result),u;if(c&&y&&(u=(await I({logger:f(),actionsParams:{appName:b,commitSha:r}})).log),t.isJsonMode()){let S=!!(n.errorMessage||n.buildOutput)?{...i,...n}:{...i};if(u!==void 0){let x=typeof i.result=="object"&&i.result!==null?i.result:{};S.result={...x,log:u}}A(S)}else a(n.errorMessage?`Build status: ${i.status}: ${n.errorMessage}`:`Build status: ${i.status}`),y&&!c&&i.status!=="Succeeded"&&a(`Run \`ms ${e?"project":"app"} build-status --show-log\` to display the build log.`),n.buildOutput&&a(n.buildOutput),c&&(u&&u.trim()?await U(u):a("No build log is available for this build.")),!e&&i.status==="Succeeded"&&a(`Run \`ms app dev\` to run your app locally, or \`ms app deploy --commit ${r}\` to make this app live.`)}function E(t){return typeof t=="string"&&t.trim()||void 0}function O(t){if(typeof t!="object"||t===null||!("buildLogUri"in t))return;let e=t.buildLogUri;if(typeof e!="string")return;let o=e.trim();return o||void 0}function R(t,e){let o=e?m.project.buildStatus:m.app.buildStatus;t.setDescription(o.description),t.addExamples(o.examples),t.addOptions([...e?[]:[{flags:{key:s.AppName.name},env:s.AppName.envVar,description:m.app.buildStatus.options.appName,optionalInNonInteractive:!0}],{flags:{key:s.CommitSha.name,alias:s.CommitSha.alias},env:s.CommitSha.envVar,description:o.options.commitSha}]),t.addSwitch({flags:{key:s.ShowLog.name},description:o.options.showLog})}export{W as getMaafBuildStatusAsync,X as getMaafProjectBuildStatusAsync};
|
|
8
|
-
/*!
|
|
9
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
-
*/
|
|
11
|
-
//# sourceMappingURL=GetMaafBuildStatus-6ZSLIZCH.js.map
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
-
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
-
import { dirname as __pathDirname } from 'node:path';
|
|
4
|
-
const require = __createRequire(import.meta.url);
|
|
5
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
-
const __dirname = __pathDirname(__filename);
|
|
7
|
-
import{a as m,b as P,c as S,d as T,e as b,f as $}from"./chunk-WV7D7PTW.js";import{$a as A,Ma as y,Nb as C,Ob as w,Xa as I,x as l,z as f}from"./chunk-4XKA5APP.js";import"./chunk-FHE3OXIP.js";import"./chunk-OUKOEUZA.js";import{A as p}from"./chunk-4U53RYJJ.js";import{a as u}from"./chunk-HOIFXUTG.js";import{D,I as a}from"./chunk-KKC5ZK4D.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function H(e){B(e),await e.runVerb();let t=c(await e.getOption(p.DeploymentId.camelName,!0)),o=await E(e),i,n;if(t){let r=await I({tenantId:o.tenantId,projectId:o.projectId,...o.localProject&&{localProject:o.localProject},deploymentId:t,includeAssets:!0,source:"cli"});i=r.project,n=r.deployment}else{let r=await A({tenantId:o.tenantId,projectId:o.projectId,...o.localProject&&{localProject:o.localProject},top:1,includeAssets:!0,source:"cli"});if(r.scope!=="project")throw new f("Unable to resolve the managed project deployment scope.");i=r.project,n=r.page.items[0]?.deployment,n&&(n=await M(o.tenantId,i,n))}if(e.updateEnvironmentId(i.environmentId),!n)throw new l(t?`Deployment '${t}' was not found in project '${i.displayName}'.`:`Project '${i.displayName}' has no deployments.`);if(e.isJsonMode()){D({projectId:i.projectId,project:i.displayName,...V(n)});return}a(`Project: ${i.displayName} (${i.projectId})`),n.deploymentId&&a(`Deployment ID: ${n.deploymentId}`),n.target&&a(`Target: ${n.target}`),n.buildVersion&&a(`Commit: ${n.buildVersion}`),a(`Status: ${n.deploymentStatus}`),n.startedTime&&a(`Started: ${m(n.startedTime)}`),n.completedTime&&a(`Completed: ${m(n.completedTime)}`),h(n)}function h(e){e.approvalDecision&&e.approvalDecision!=="NotRequired"&&a(`Decision: ${e.approvalDecision}`);let t=$(e);t.by&&a(`Decided by: ${t.by}`),t.time&&a(`Decided: ${m(t.time)}`);let o=S(e.approvalComment);if(o){let[n,...r]=o.split(`
|
|
8
|
-
`);a(`Comment: ${n}`);for(let s of r)a(` ${s}`)}let i=P(e.approvalUrl);i&&a(`Approval URL: ${i}`)}async function M(e,t,o){if(!(o.approvalDecision==="Approved"||o.approvalDecision==="Rejected")||o.approvalComment!==void 0||!o.approvalDecidedBy?.objectId||!o.deploymentId)return o;try{let r=(await I({tenantId:e,projectId:t.projectId,localProject:t,deploymentId:o.deploymentId,source:"cli"})).deployment?.approvalComment;return r===void 0?o:{...o,approvalComment:r}}catch{return o}}async function E(e){let t=w(),o=c(await e.getOption(p.ProjectId.camelName,!0)),i=c(await e.getOption(p.EnvironmentId.camelName,!0));if(i&&e.updateEnvironmentId(i),!o&&t.projectConfigError)throw new f(`Unable to read ${t.fileConfig.projectConfigPath}. ${t.projectConfigError.message}`);let n=await e.getTenantIdAsync();if(!n)throw new l("Unable to determine tenant ID. Ensure you are logged in.");let r=c(t.appConfig?.appId);if(!o&&r){let v=await y({tenantId:n,environmentId:i??c(t.appConfig?.environmentId),logger:C(),actionsParams:{appName:r}}),d=c(v.projectId);if(d)return{tenantId:n,projectId:d,localProject:{projectId:d,displayName:d,environmentId:v.environmentId}}}let s=o??c(t.appConfig?.projectId)??c(t.projectConfig?.projectId);if(!s)throw new l("Argument project is required. Use --project or -p, or run from an app or managed project directory.");let N=t.projectConfig?.projectId.toLowerCase()===s.toLowerCase()?t.projectConfig:void 0,g=c(t.appConfig?.projectId)?.toLowerCase()===s.toLowerCase()?c(t.appConfig?.environmentId):void 0,j=o?void 0:N??(g?{projectId:s,displayName:s,environmentId:g}:void 0);return{tenantId:n,projectId:s,...j&&{localProject:j}}}function V(e){return{...e.deploymentId?{deploymentId:e.deploymentId}:{},...e.target?{target:e.target}:{},...e.buildVersion?{commitHash:e.buildVersion}:{},deploymentStatus:e.deploymentStatus,...e.approvalRequired!==void 0?{approvalRequired:e.approvalRequired}:{},...e.approvalDecision?{approvalDecision:e.approvalDecision}:{},...e.approvalDecidedBy?{approvalDecidedBy:e.approvalDecidedBy}:{},...e.approvalDecidedTime?{approvalDecidedTime:e.approvalDecidedTime}:{},...e.approvalComment!==void 0?{approvalComment:e.approvalComment}:{},...e.approvalUrl?{approvalUrl:e.approvalUrl}:{},...e.startedTime?{startedTime:e.startedTime}:{},...e.completedTime?{completedTime:e.completedTime}:{},...T(e)?{cancelledBy:e.cancelledBy}:{},...b(e)?{cancelledTime:e.cancelledTime}:{},...e.assets?{assets:e.assets.map(U)}:{}}}function U(e){return{...e.deploymentId?{deploymentId:e.deploymentId}:{},...e.assetId?{assetId:e.assetId}:{},assetType:e.assetType,assetStatus:e.assetStatus,...e.buildVersion?{buildVersion:e.buildVersion}:{},...e.previousBuildVersion?{previousBuildVersion:e.previousBuildVersion}:{},...e.buildStatus?{buildStatus:e.buildStatus}:{},attempts:e.attempts}}function B(e){let t=u.project.deployStatus,o=e.getResolvedCommand()?.path.join(" ")==="deployment status";e.setDescription(t.description),e.addExamples(o?u.deployment.status.examples:t.examples),e.addOptions([{flags:{key:p.ProjectId.name,alias:p.ProjectId.alias},description:t.options.projectId,optionalInNonInteractive:!0},{flags:{key:p.EnvironmentId.name,alias:p.EnvironmentId.alias},env:p.EnvironmentId.envVar,description:t.options.environmentId,optionalInNonInteractive:!0},{flags:{key:p.DeploymentId.name},description:t.options.deploymentId,optionalInNonInteractive:!0}])}function c(e){return typeof e=="string"&&e.trim()||void 0}export{H as getMaafProjectDeployStatusAsync};
|
|
9
|
-
/*!
|
|
10
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
11
|
-
*/
|
|
12
|
-
//# sourceMappingURL=GetMaafProjectDeployStatus-NZEMVQGJ.js.map
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
-
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
-
import { dirname as __pathDirname } from 'node:path';
|
|
4
|
-
const require = __createRequire(import.meta.url);
|
|
5
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
-
const __dirname = __pathDirname(__filename);
|
|
7
|
-
import{a as $}from"./chunk-SQI4XLR7.js";import{l as N,m as h}from"./chunk-GE3UFHZ5.js";import{Ma as y,Nb as b,Ob as A,x as I}from"./chunk-4XKA5APP.js";import"./chunk-FHE3OXIP.js";import"./chunk-OUKOEUZA.js";import{u as d}from"./chunk-4U53RYJJ.js";import{a}from"./chunk-HOIFXUTG.js";import{D as u,I as t,K as g}from"./chunk-KKC5ZK4D.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";var j=7;async function L(e){await E(e,!1)}async function _(e){await E(e,!0)}async function E(e,n){V(e,n),await e.runVerb(),n&&g(a.app.show.deprecation);let o=await N(e),f=await h(e,{failIfMissing:!1}),i=await e.getTenantIdAsync();if(!i)throw new I("Unable to determine tenant ID. Ensure you are logged in.");let s=await y({tenantId:i,environmentId:f,logger:b(),actionsParams:{appName:o}}),c=A(),r=c.projectConfig!==void 0&&c.appConfig?.appId===o,p=C(s,r);e.isJsonMode()?u(p):T(p)}function C(e,n=!1){let o=e.connectionReferences??{},f=Object.entries(o).map(([c,r])=>S(c,r)),i=e.commitHash,s=$(e);return{displayName:e.displayName,description:e.description??void 0,environmentId:e.environmentId,appId:e.id,projectId:e.projectId??void 0,commit:i?i.slice(0,j):void 0,connectors:f,repoType:n?void 0:s?.repoType,cloneUrl:n?void 0:s?.cloneUrl}}function S(e,n){let o={connector:e};n.displayName&&(o.displayName=n.displayName),n.actions?.length&&(o.actions=n.actions);let f=n.dataSets??{},i=[],s=[],c=new Set;for(let[r,p]of Object.entries(f))if(!(!p||typeof p!="object"))for(let[m,l]of Object.entries(p.dataSources??{}))c.add(m),l.tableName?i.push({dataset:r,table:l.tableName}):s.push({dataset:r,procedure:m});for(let r of n.dataSources??[])c.has(r)||i.push({table:r});return i.length&&(o.tables=i),s.length&&(o.procedures=s),o}function T(e){if(t(`Name: ${e.displayName}`),e.description&&t(`Description: ${e.description}`),t(`Environment: ${e.environmentId}`),t(`App ID: ${e.appId}`),e.projectId&&t(`Project ID: ${e.projectId}`),e.commit&&t(`Commit: ${e.commit}`),e.repoType&&t(`Repo type: ${e.repoType}`),e.cloneUrl&&t(`Clone URL: ${e.cloneUrl}`),e.connectors.length===0){t(""),t("(no connectors bound)");return}for(let n of e.connectors){t("");let o=n.connector.replace(/^shared_/,"");t(n.displayName?`${o} (${n.displayName})`:o),n.actions?.length&&t(` actions: ${n.actions.join(", ")}`),n.tables?.length&&t(` tables: ${n.tables.map(x).join(", ")}`),n.procedures?.length&&t(` procedures: ${n.procedures.map(D).join(", ")}`)}}function V(e,n){e.setDescription(n?`${a.app.show.deprecation}
|
|
8
|
-
|
|
9
|
-
${a.app.info.description}`:a.app.info.description),e.addExamples(n?a.app.show.examples:a.app.info.examples),e.addOptions([{flags:{key:d.App.name},env:d.App.envVar,description:a.app.info.options.app,optionalInNonInteractive:!0},{flags:{key:d.EnvironmentId.name,alias:d.EnvironmentId.alias},env:d.EnvironmentId.envVar,description:a.app.info.options.environmentId,optionalInNonInteractive:!0}])}function x(e){return e.dataset?`${e.table} (${e.dataset})`:e.table}function D(e){return`${e.procedure} (${e.dataset})`}export{C as buildAppInfoView,L as infoMaafAppAsync,_ as showMaafAppAsync};
|
|
10
|
-
/*!
|
|
11
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
12
|
-
*/
|
|
13
|
-
//# sourceMappingURL=InfoMaafApp-7Z6OJCHD.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 V}from"./chunk-WTTK2GTG.js";import{a as I}from"./chunk-DKSLWH4O.js";import{b as F}from"./chunk-KT2SUHGM.js";import{i as R,m as O}from"./chunk-GE3UFHZ5.js";import{A,Nb as h,Ob as b,da as L,fb as x,gb as $,hb as u,k as w,oa as U,x as l,z as M}from"./chunk-4XKA5APP.js";import"./chunk-BRRT2E75.js";import"./chunk-2LDU3F6O.js";import"./chunk-RFLXPXBN.js";import"./chunk-FHE3OXIP.js";import"./chunk-OUKOEUZA.js";import{M as s}from"./chunk-4U53RYJJ.js";import{a as f}from"./chunk-HOIFXUTG.js";import{D as C,I as a,K as D,l as E}from"./chunk-KKC5ZK4D.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function se(e){W(e),await e.runVerb();let o=b(),i=(await e.getOption("project",!0))?.trim();if(o.projectConfigError)throw new M(`Unable to read ${o.fileConfig.projectConfigPath}. ${o.projectConfigError.message} Fix the project configuration before retrying.`);let n=!i||o.projectConfig?.projectId.toLowerCase()===i.toLowerCase()?o.projectConfig:void 0,p=!i||o.appConfig?.projectId?.toLowerCase()===i.toLowerCase()?o.appConfig:void 0,c=I(o.appConfig?.appId),r=i||n?.projectId||I(p?.projectId),y=I(n?.projectId?n.environmentId:p?.environmentId);if(!r&&!c)throw new l("Argument project is required. Use --project or -p to specify it, or run from a directory containing ms.project.config.json or ms.config.json.");let j=await e.getTenantIdAsync();if(!j)throw new l("Unable to determine tenant ID. Ensure you are logged in.");let k=await O(e,{failIfMissing:!1,overridesOnly:!0});if(!r&&c){let t=await V(c,j,k??y);r=I(t.projectId),y=t.environmentId??y}if(!r)throw new l("The current app is not associated with a managed project.");if(!E(r))throw new l("The project ID must be a valid GUID.");let P=k??y;if(!P)try{P=(await U(j,r)).environmentId}catch(t){if(!(t instanceof w)&&!(t instanceof A))throw t;let d=t instanceof w?t:void 0,T=d?.code&&/^[A-Za-z][A-Za-z0-9_.]{0,63}$/.test(d.code)?d.code:void 0;throw h().trackErrorEvent("InfoMaafProject.LocateFailed",{errorName:d?"HttpClientError":"Error",...d&&{httpStatus:d.status},...T&&{serverErrorCode:T}}),new A("Unable to locate the environment hosting this project. Retry the command, or pass --environment-id <id> if you know the environment.")}e.updateEnvironmentId(P);let g=h(),H=u({projectId:r,logger:g}).then(t=>({ok:!0,page:t}),t=>({ok:!1,error:t})),[S,N]=await Promise.all([x({projectId:r,logger:g}),$({projectId:r,logger:g})]),m=await H;if(e.isJsonMode()){if(!m.ok)throw m.error;let t=await z(r,m.page,g);C(_(S,N,t));return}if(J(S,N),!m.ok){D(`Project details were retrieved, but its apps could not be listed. Try again. Operation ID: ${o.operationId}.`);return}await F({title:"Apps",columns:[{header:"App ID",maxWidth:38},{header:"Display Name"},{header:"Last Deployed"},{header:"URL"}],firstPage:G(m.page),fetchNextPage:async t=>G(await u({projectId:r,skipToken:t,logger:g})),toRow:t=>[t.id,t.displayName||"<No Name>",Z(t.lastDeployedTime??void 0),t.appPlayUri??"-"],emptyMessage:"No apps found in this project.",totalLabel:"app(s)"})>0&&a("Use `ms app info --app <GUID>` to get app details, including the clone URL.")}function G(e){return{items:e.apps,...e.nextSkipToken===void 0?{}:{nextSkipToken:e.nextSkipToken}}}async function z(e,o,i){let n=[...o.apps],p=o.nextSkipToken,c=1;for(;p;){if(c>=200)throw new L(`drainAppsAsync: exceeded ${200}-page cap for project ${e}; the server is likely returning a $skiptoken cycle.`,200);let r=await u({projectId:e,skipToken:p,logger:i});n.push(...r.apps),p=r.nextSkipToken,c++}return n}function _(e,o,i){return{projectId:e.projectId,displayName:e.displayName,environmentId:e.environmentId,tenantId:e.tenantId,repositoryId:e.repositoryId,repoType:e.repoType,...e.storageSource?{storageSource:e.storageSource}:{},stages:o.map(n=>({stageName:n.stageName,stageUrl:n.stageUrl})),apps:i.map(n=>({appId:n.id,displayName:n.displayName,...n.lastDeployedTime?{lastDeployedTime:n.lastDeployedTime}:{},...n.appPlayUri?{appPlayUri:n.appPlayUri}:{}}))}}function J(e,o){a(`Name: ${e.displayName}`),a(`Project ID: ${e.projectId}`),a(`Environment: ${e.environmentId}`),a(`Repository: ${e.repositoryId}`),a(`Repo type: ${e.repoType}`),e.storageSource&&a(`Storage: ${e.storageSource}`),o.length>0&&a(`Targets: ${o.map(i=>i.stageName).join(", ")}`)}function W(e){e.setDescription(f.project.info.description),e.addExamples(f.project.info.examples),e.addOptions([R({flags:{key:s.ProjectId.name,alias:s.ProjectId.alias},message:s.ProjectId.promptMessage,description:f.project.info.options.project}),{flags:{key:s.EnvironmentId.name,alias:s.EnvironmentId.alias},env:s.EnvironmentId.envVar,description:f.project.info.options.environmentId,optionalInNonInteractive:!0}])}function Z(e){if(!e)return"-";let o=new Date(e);return Number.isNaN(o.getTime())?e:o.toLocaleDateString()}export{_ as buildProjectInfoView,se as infoMaafProjectAsync};
|
|
8
|
-
/*!
|
|
9
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
-
*/
|
|
11
|
-
//# sourceMappingURL=InfoMaafProject-SQYB736C.js.map
|
package/dist/Init-PBH2IXVK.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 K,b as k,c as ee,d as ie}from"./chunk-BA52TY55.js";import{a as te,c as ne}from"./chunk-5MHBEEMZ.js";import{a as X,b as Z}from"./chunk-DGUO74I3.js";import{a as Q}from"./chunk-RDXQ3ZPT.js";import"./chunk-Q3ONTUZ7.js";import"./chunk-XIX2O22O.js";import{a as q,b as Y}from"./chunk-TMYOZDLM.js";import"./chunk-TYRVM4PP.js";import{g as _,h as J,l as W}from"./chunk-ZB6MB7GZ.js";import"./chunk-2LKCCYRF.js";import{b as P,i as m,m as H}from"./chunk-GE3UFHZ5.js";import{Ga as L,Hb as S,Nb as F,Ob as j,i as $,x as c}from"./chunk-4XKA5APP.js";import"./chunk-FHE3OXIP.js";import{e as z}from"./chunk-OUKOEUZA.js";import{K as e}from"./chunk-4U53RYJJ.js";import{a as o}from"./chunk-HOIFXUTG.js";import{C as M,D as G,I as r,K as C,a as B}from"./chunk-KKC5ZK4D.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";import*as h from"fs";import*as u from"path";async function Ve(t){me(t),await t.runVerb();let s=j();if(s.appConfig)throw new c(`${B} already exists in this directory. Use a new directory or delete the existing config.`);let f=F(),a=t.isJsonMode(),g=await t.getTenantIdAsync();if(!g)throw new c("Unable to determine tenant ID. Ensure you are logged in.");let A=await H(t,{failIfMissing:!1}),O=z("MAAF_DOGFOOD");if(O&&A)throw new c("MS_CLI_MAAF_DOGFOOD cannot be used with an explicit or configured environment ID.");let N=A===void 0?X(t,g,f,"Init",{dogfood:O}):void 0;N?.catch(i=>{f.trackErrorEvent("Init.RoutingEnvironmentBackgroundFailure",{error:i instanceof Error?i.message:String(i)})});let E=await t.getOption("repo",!0),w=E?.trim()?E.trim():void 0,l,D,n="native";if(w!==void 0&&te(w))D=w,n="native",a||r("Using provided repository ID for the app's platform-managed source control.");else if(w!==void 0){let i=ne(E);if(i.repoType==="github"){let p=process.cwd();if(h.readdirSync(p).length===0)throw new c(`--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(u.join(p,".git")))throw new c(`--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.`);a||r(`Using provided repository URL '${i.remoteUrl}' for app source control.`)}else i.repoType==="none"&&!a?r("No git repo will be linked to the app. You will be able to upload build artifacts manually when you want to publish the app."):i.repoType==="native"&&!a&&r("A new platform-managed git repo will be provisioned and linked to the app.");n=i.repoType,l=i.remoteUrl}else{let i=_();i&&(a||r(`Detected git remote URL: ${i}`),(s.interactive?await P({message:"Use this existing repository for app source control?",initialValue:!0}):!0)?(a||r("Will use the existing git repo and link it to the app."),n="github",l=i):a||r("Will not use the existing git repo. A new platform-managed git repo will be provisioned and linked to the app instead."))}n==="native"&&(q(),Y());let T=await t.getOption("displayName"),ae=await t.getOption("description"),V=await t.getOption(e.BuildType.camelName,!0),U=k({buildType:V}).buildType==="none"||!s.interactive,x=await t.getOption("buildCommand",U),R=k({buildType:V,buildPath:await t.getOption("buildPath",U),buildCommand:x,buildEntryPoint:await t.getOption("buildEntryPoint",U)});R.buildType==="none"&&x?.trim()&&C("--build-command is ignored when --build-type none is selected.");let I=oe(await t.getOption(e.IconPath.camelName,!0));if(I!==void 0){let i=u.extname(I).toLowerCase();if(i!==".png"&&i!==".jpg"&&i!==".jpeg")throw new c(`--icon-path must reference a .png or .jpg file (received '${I}').`)}let re=oe(await t.getOption(e.LocalAppUrl.camelName,!0)),pe=await t.getOption(e.OpenBrowser.camelName,!0)??!1,se=await t.getOption(e.ForceReauth.camelName,!0)??!1,y=await Z(A,N);t.updateEnvironmentId(y);let le={displayName:T,description:ae,repositoryId:D,remoteUrl:l,repoType:n,origin:s.origin},de=({isRetry:i})=>L({tenantId:g,environmentId:y,logger:f,actionsParams:{...le,...se&&!i&&n==="github"&&{forceReauth:!0}}}),d;try{d=await Q(de,{repoType:n,externalRepoUrl:l,tenantId:g,jsonMode:a,openBrowser:pe,verb:"app init"})}catch(i){let p=K(i,{repoType:n,environmentId:y});throw p||i}let ce=ee({appId:d.app.id,appDisplayName:d.app.displayName,description:d.app.description,environmentId:y,repoType:n,repositoryId:n==="native"?d.app.repositoryId:void 0,externalRepoUrl:n==="github"?l:void 0,cloud:t.getCloud(),...R,iconPath:I,localAppUrl:re,connectionReferences:{},appSettings:S(void 0)});await $(s.fileConfig.appConfigPath,ce);let v=u.dirname(s.fileConfig.appConfigPath);if(R.buildType!=="none"&&await ie(v,a,t.getHttpClient()),n==="native"&&d.cloneUrl){let i=W({directory:v,gitUrl:d.cloneUrl,loginAuthority:t.getLoginAuthority(g),authResource:t.getAuthResourceUrl()});if(i.success&&!a)r("Configured the platform-managed git remote and credentials.");else if(!i.success&&(f.trackErrorEvent("Init.LocalGitRepoInitializationFailed",{repoType:n,error:i.error??"Unknown git initialization error"}),!a)){let p=i.error?` Reason: ${i.error}`:"";C(`Could not initialize a local git repository automatically.${p} ${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"&&l&&!h.existsSync(u.join(v,".git"))){let i=J(l,v);if(i.success&&!a)r("Initialized a local git repository and configured the remote.");else if(!i.success&&(f.trackErrorEvent("Init.LocalGitRepoInitializationFailed",{repoType:n,error:i.error??"Unknown git initialization error"}),!a)){let p=i.error?` Reason: ${i.error}`:"";C(`Could not initialize a local git repository automatically.${p} Run 'git init' and 'git remote add origin <remote-url>' manually.`)}}a?G({appId:d.app.id,environmentId:y,repoType:n,...l&&{externalRepoUrl:l}}):(M(`Created ${B} for ${T}.`),R.buildType!=="none"&&r("Hint: Run 'npm install' (or your package manager's install) to install the project-local CLI."),r(`Hint: Run '${"ms"} app add data-source' to connect data, or '${"ms"} app dev' to start the app locally.`),n!=="none"&&r("Hint: Commit and push to wire your app to the remote repository: git add . && git commit -m '<message>' && git push -u origin HEAD."))}function oe(t){let s=t?.trim();return s||void 0}function me(t){t.setDescription(o.app.init.description),t.addExamples(o.app.init.examples),t.addOptions([m({flags:{key:e.EnvironmentId.name,alias:e.EnvironmentId.alias},env:e.EnvironmentId.envVar,message:e.EnvironmentId.promptMessage,description:o.app.init.options.environmentId}),m({flags:{key:e.DisplayName.name,alias:e.DisplayName.alias},env:e.DisplayName.envVar,message:e.DisplayName.promptMessage,description:o.app.init.options.displayName}),m({flags:{key:e.Description.name,alias:e.Description.alias},env:e.Description.envVar,default:" ",message:e.Description.promptMessage,description:o.app.init.options.description}),{flags:{key:e.BuildType.name},env:e.BuildType.envVar,description:o.app.init.options.buildType,optionalInNonInteractive:!0,hidden:!0},m({flags:{key:e.BuildPath.name,alias:e.BuildPath.alias},env:e.BuildPath.envVar,message:e.BuildPath.promptMessage,initialValue:e.BuildPath.initialValue,description:o.app.init.options.buildPath}),m({flags:{key:e.BuildCommand.name,alias:e.BuildCommand.alias},env:e.BuildCommand.envVar,message:e.BuildCommand.promptMessage,initialValue:e.BuildCommand.initialValue,description:o.app.init.options.buildCommand}),m({flags:{key:e.BuildEntryPoint.name},env:e.BuildEntryPoint.envVar,message:e.BuildEntryPoint.promptMessage,initialValue:e.BuildEntryPoint.initialValue,description:o.app.init.options.buildEntryPoint}),{flags:{key:e.Repo.name},env:e.Repo.envVar,description:o.app.init.options.repo,optionalInNonInteractive:!0},{flags:{key:e.IconPath.name},env:e.IconPath.envVar,description:o.app.init.options.iconPath,optionalInNonInteractive:!0},{flags:{key:e.LocalAppUrl.name},env:e.LocalAppUrl.envVar,description:o.app.init.options.localAppUrl,optionalInNonInteractive:!0}]),t.addSwitch({flags:{key:e.OpenBrowser.name},description:o.app.init.options.openBrowser}),t.addSwitch({flags:{key:e.ForceReauth.name},description:o.app.init.options.forceReauth})}export{Ve as initAsync};
|
|
8
|
-
/*!
|
|
9
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
-
*/
|
|
11
|
-
//# sourceMappingURL=Init-PBH2IXVK.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 u}from"./chunk-UEZV46GZ.js";import{c as h}from"./chunk-KT2SUHGM.js";import{c as g}from"./chunk-DGUO74I3.js";import"./chunk-2LKCCYRF.js";import{i}from"./chunk-GE3UFHZ5.js";import{Nb as y,x as f,ya as A}from"./chunk-4XKA5APP.js";import"./chunk-FHE3OXIP.js";import"./chunk-OUKOEUZA.js";import{c as s,r as n}from"./chunk-4U53RYJJ.js";import{a as e}from"./chunk-HOIFXUTG.js";import{F as d}from"./chunk-KKC5ZK4D.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function U(o){x(o),await o.runVerb();let r=y(),c=await o.getTenantIdAsync();if(!c)throw new f("Unable to determine tenant ID. Ensure you are logged in.");let C=await g(o,r,{jsonMode:o.isJsonMode(),telemetryNamespace:"ListConnectorActions"}),v=await o.getOption("connector",!1),a=await u(v,r,{jsonMode:o.isJsonMode()}),I=await o.getOption(n.Search.name,!0),w={tenantId:c,environmentId:C,actionsParams:{connectorId:a,search:I},logger:r},{actions:S,docsUrl:m}=await A(w),p=S.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 h({title:`Connector Actions \u2014 ${a}`,metadata:m?[`Docs: ${m}`]:void 0,columns:[{header:"Summary",maxWidth:50},{header:"Policy Status"},{header:"Action ID",maxWidth:40}],rows:p.map(t=>[t.deprecated?`[Deprecated] ${t.summary}`:t.summary,t.behavior==="Block"?"Blocked":"Allowed",t.id]),emptyMessage:"No actions found.",totalLabel:"action(s)"})}function x(o){o.setDescription(e.connector["list-actions"].description),o.addExamples(e.connector["list-actions"].examples),o.addOptions([i({flags:{key:s.Connector.name},env:s.Connector.envVar,message:s.Connector.promptMessage,description:e.connector["list-actions"].options.connector}),{flags:{key:n.EnvironmentId.name,alias:n.EnvironmentId.alias},env:n.EnvironmentId.envVar,description:e.connector["list-actions"].options.environmentId,optionalInNonInteractive:!0},i({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{U as listConnectorActionsCliAsync};
|
|
8
|
-
/*!
|
|
9
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
-
*/
|
|
11
|
-
//# sourceMappingURL=ListConnectorActions-UERYZ2C7.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{c as h}from"./chunk-KT2SUHGM.js";import{c as y}from"./chunk-DGUO74I3.js";import{i as f}from"./chunk-GE3UFHZ5.js";import{Nb as d,x as m,za as p}from"./chunk-4XKA5APP.js";import"./chunk-FHE3OXIP.js";import"./chunk-OUKOEUZA.js";import{n as o}from"./chunk-4U53RYJJ.js";import{a as n}from"./chunk-HOIFXUTG.js";import{F as l}from"./chunk-KKC5ZK4D.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),r=await p({tenantId:i,environmentId:g,actionsParams:{search:w},logger:s}),a=(A?r.filter(t=>!t.isBlocked):r).slice().sort((t,c)=>t.isBlocked!==c.isBlocked?t.isBlocked?1:-1:t.displayName.localeCompare(c.displayName));if(e.isJsonMode()){l(a);return}await h({title:"Connectors",columns:[{header:"Display Name",maxWidth:38},{header:"Connector",maxWidth:38},{header:"Policy Status"},{header:"Tabular"}],rows:a.map(t=>[t.displayName,t.name.replace(/^shared_/i,""),t.isBlocked?"Blocked":"Allowed",t.isTabular?"Yes":"No"]),emptyMessage:"No connectors found.",totalLabel:"connector(s)",hint:n.connector.list.hint})}function C(e){e.setDescription(n.connector.list.description),e.addExamples(n.connector.list.examples),e.addSwitch({flags:{key:o.OnlyAllowed.name},description:n.connector.list.options.onlyAllowed}),e.addOptions([{flags:{key:o.EnvironmentId.name,alias:o.EnvironmentId.alias},env:o.EnvironmentId.envVar,description:n.connector.list.options.environmentId,optionalInNonInteractive:!0},f({flags:{key:o.Search.name,alias:o.Search.alias},env:o.Search.envVar,message:o.Search.promptMessage,description:n.connector.list.options.search})])}export{b as listConnectorsCliAsync};
|
|
8
|
-
/*!
|
|
9
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
-
*/
|
|
11
|
-
//# sourceMappingURL=ListConnectors-2FUTJMHY.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 C,b as v,d as Q,e as W,f as O}from"./chunk-WV7D7PTW.js";import{a as K}from"./chunk-WTTK2GTG.js";import{a as y}from"./chunk-DKSLWH4O.js";import{c as X}from"./chunk-DGUO74I3.js";import{j as h}from"./chunk-GE3UFHZ5.js";import{$a as J,Nb as G,Ob as z,Ya as Y,Za as E,_a as x,c as $,g as U,la as B,x as g,z as b}from"./chunk-4XKA5APP.js";import"./chunk-BRRT2E75.js";import"./chunk-2LDU3F6O.js";import"./chunk-RFLXPXBN.js";import"./chunk-FHE3OXIP.js";import"./chunk-OUKOEUZA.js";import{q as p}from"./chunk-4U53RYJJ.js";import{a as f}from"./chunk-HOIFXUTG.js";import{A as F,D as S,I as i,l as _}from"./chunk-KKC5ZK4D.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function Be(t){ae(t),await t.runVerb();let e=await t.getOption(p.Project.camelName,!0),n=e===void 0?void 0:y(e);if(e!==void 0&&(!n||!_(n)))throw new g("Invalid --project value. Provide a managed project ID.");let o=n,r=y(await t.getOption(p.EnvironmentId.camelName,!0)),s=ce(r),u=y(await t.getOption(p.Target.name,!0)),l=y(await t.getOption(p.Status.name,!0)),a=y(await t.getOption(p.Top.name,!0)),d=await t.getOption(p.ContinuationToken.camelName,!0),D=le(l),re=me(a),m=z(),k=y(m.appConfig?.appId);if(!o&&!s&&m.projectConfigError)throw new b("Unable to read the managed project configuration. Fix or remove the project configuration file and retry.");let P=await t.getTenantIdAsync();if(!P)throw new g("Unable to determine tenant ID. Ensure you are logged in.");let w=o,A,I=s;if(o)A=m.projectConfig?.projectId&&U(o,m.projectConfig.projectId)?m.projectConfig:void 0,I??=A?.environmentId;else if(!s&&m.projectConfig)A=m.projectConfig,w=m.projectConfig.projectId,I=A.environmentId;else if(!s&&k){let j=pe(m.appConfig?.environmentId),H=await K(k,P,j);if(w=H.projectId,!w)throw new g("The current app is not associated with a managed project.");I=de(H.environmentId)}!w&&!s&&(I=ue(await X(t,G(),{jsonMode:t.isJsonMode(),telemetryNamespace:"ListDeployments"})));let L=w!==void 0,M=L&&u!==void 0&&D===void 0&&a===void 0&&d===void 0,q=L&&u!==void 0&&D==="AwaitingApproval"&&a===void 0&&d===void 0;I&&t.updateEnvironmentId(I);let c=await J({tenantId:P,environmentId:I,projectId:w,localProject:A,target:u,status:D,top:M?1:re,continuationToken:d,includeAssets:M||q,source:"cli"}),se=c.scope==="project"?c.project.environmentId:c.environmentId;t.updateEnvironmentId(se);let N=c.page.items.map(j=>fe(j,c.filter.target));if(c.scope==="project"){if(q){let j=await t.getAuthenticationProvider().getCachedAccountAsync()??"current account";ye(t,c.project,N,j,c.page);return}ge(t,c.project,N,M,c.page);return}ve(t,c.environmentId,N,c.page,c.projectNamesUnavailable)}function ae(t){t.setDescription(f.deployment.list.description),t.addExamples(f.deployment.list.examples),t.addOptions([T(p.Project.name,f.deployment.list.options.project),{...T(p.EnvironmentId.name,f.deployment.list.options.environmentId),flags:{key:p.EnvironmentId.name,alias:p.EnvironmentId.alias},env:p.EnvironmentId.envVar},T(p.Target.name,f.deployment.list.options.target),T(p.Status.name,f.deployment.list.options.status),T(p.Top.name,f.deployment.list.options.top),T(p.ContinuationToken.name,f.deployment.list.options.continuationToken)])}function de(t){if(!t)throw new b("The current app returned an invalid environment identifier.");let e=$(h(t));if(!e)throw new b("The current app returned an invalid environment identifier.");return e}function pe(t){let e=y(t);if(!e)return;let n=$(h(e));if(!n)throw new g("Invalid environment ID. Use a GUID or Default-<GUID>.");return n}function T(t,e){return{flags:{key:t},description:e,optionalInNonInteractive:!0}}function ce(t){if(t===void 0)return;let e=$(h(t));if(!e)throw new g("Invalid --environment-id value.");return e}function ue(t){let e=$(h(t));if(!e)throw new b("The resolved environment identifier is invalid.");return e}function le(t){if(!t)return;let e=B.find(n=>U(n,t));if(!e)throw new g(`Invalid --status value. Must be one of: ${B.join(", ")}.`);return e}function me(t){if(!t)return Y;if(!/^\d+$/.test(t))throw new g(`--top must be an integer between 1 and ${E}.`);let e=Number(t);if(!Number.isSafeInteger(e)||e<1||e>E)throw new g(`--top must be an integer between 1 and ${E}.`);return e}function fe(t,e){let n=t.deployment,o=n.target??e;return{source:n,...n.deploymentId?{deploymentId:n.deploymentId}:{},...n.projectId?{projectId:n.projectId}:{},...t.projectDisplayName?{project:t.projectDisplayName}:{},...o?{target:o}:{},commitId:Te(n.buildVersion),status:n.deploymentStatus,deploymentStart:n.startedTime?C(n.startedTime):"N/A",deploymentEnd:n.completedTime?C(n.completedTime):"Pending",...t.appSummary?{apps:t.appSummary}:{}}}function ge(t,e,n,o,r){if(t.isJsonMode()){o?S({project:e.displayName,environmentId:e.environmentId,deployment:n[0]?R(n[0]):null,continuationToken:r.continuationToken,pageLimitReached:r.pageLimitReached}):S({project:e.displayName,environmentId:e.environmentId,order:"descendingByDeploymentStart",items:n.map(R),continuationToken:r.continuationToken,pageLimitReached:r.pageLimitReached});return}if(o){let s=n[0];s?.status==="AwaitingApproval"?De(e.displayName,e.environmentId,s):we(e.displayName,s),ie(r);return}ee(`Project: ${e.displayName}`,n,!1,r)}function ve(t,e,n,o,r){if(t.isJsonMode()){S({environmentId:e,order:"descendingByDeploymentStart",items:n.map(R),continuationToken:o.continuationToken,pageLimitReached:o.pageLimitReached,projectNamesUnavailable:r});return}ee(`Environment: ${e}`,n,!0,o,r)}function ye(t,e,n,o,r){if(t.isJsonMode()){S({visibleTo:o,count:n.length,project:e.displayName,environmentId:e.environmentId,items:n.map(R),continuationToken:r.continuationToken,pageLimitReached:r.pageLimitReached});return}i(`Pending requests visible to: ${o} | Count: ${n.length}`),ie(r),n.forEach((s,u)=>{u>0&&i(""),Ie(e.displayName,s)})}function Ie(t,e){i(`Project: ${t} | Target: ${e.target??"-"}`),i(`Commit: ${e.commitId} | Status: ${e.status}`),e.source.repositoryUrl&&i(`Repository: ${e.source.repositoryUrl}`),e.source.cloneUrl&&i(`Clone URL: ${e.source.cloneUrl}`),e.source.buildVersion&&i(`Source commit: ${e.source.buildVersion}`),e.source.reviewUrl&&i(`Review URL: ${e.source.reviewUrl}`),V(e.source);let n=oe(e.source);i(`Requested by: ${n??"Unknown"} | Created: ${e.deploymentStart}`)}function R(t){let e=t.source;return{...e.deploymentId?{deploymentId:e.deploymentId}:{},...e.projectId?{projectId:e.projectId}:{},...e.repositoryId?{repositoryId:e.repositoryId}:{},...e.repositoryUrl?{repositoryUrl:e.repositoryUrl}:{},...e.cloneUrl?{cloneUrl:e.cloneUrl}:{},...e.reviewUrl?{reviewUrl:e.reviewUrl}:{},...e.sourceUrl?{sourceUrl:e.sourceUrl}:{},...e.buildVersion?{buildVersion:e.buildVersion}:{},...e.buildVersion?{sourceCommit:e.buildVersion}:{},deploymentStatus:e.deploymentStatus,forceReauth:e.forceReauth,...e.assetManifest?{assetManifest:e.assetManifest}:{},...e.activeOperationId?{activeOperationId:e.activeOperationId}:{},...e.initiatedBy?{initiatedBy:e.initiatedBy}:{},...e.requestedBy?{requestedBy:e.requestedBy}:{},...e.approvalRequired!==void 0?{approvalRequired:e.approvalRequired}:{},...e.approvalDecision?{approvalDecision:e.approvalDecision}:{},...e.approvalDecidedBy?{approvalDecidedBy:e.approvalDecidedBy}:{},...e.approvalDecidedTime?{approvalDecidedTime:e.approvalDecidedTime}:{},...e.approvalUrl?{approvalUrl:e.approvalUrl}:{},...e.startedTime?{startedTime:e.startedTime}:{},...e.completedTime?{completedTime:e.completedTime}:{},...Q(e)?{cancelledBy:e.cancelledBy}:{},...W(e)?{cancelledTime:e.cancelledTime}:{},...e.assets?{assets:e.assets.map(n=>({...n.deploymentId?{deploymentId:n.deploymentId}:{},...n.assetId?{assetId:n.assetId}:{},assetType:n.assetType,assetStatus:n.assetStatus,...n.buildVersion?{buildVersion:n.buildVersion}:{},...n.previousBuildVersion?{previousBuildVersion:n.previousBuildVersion}:{},...n.buildStatus?{buildStatus:n.buildStatus}:{},attempts:n.attempts}))}:{},...t.project?{project:t.project}:{},...t.target?{target:t.target}:{},...t.apps?{appSummary:t.apps}:{}}}function De(t,e,n){i(`Project: ${t} | Target: ${n.target??"-"}`),i(`Environment ID: ${e}`),i(`Created: ${n.deploymentStart}`),i(`Commit: ${n.commitId}`),n.source.repositoryUrl&&i(`Repository: ${n.source.repositoryUrl}`),n.source.cloneUrl&&i(`Clone URL: ${n.source.cloneUrl}`),n.source.buildVersion&&i(`Source commit: ${n.source.buildVersion}`),n.source.reviewUrl&&i(`Review URL: ${n.source.reviewUrl}`),n.source.sourceUrl&&i(`Browse source: ${n.source.sourceUrl}`);let o=oe(n.source);o&&i(`Requested by: ${o}`),n.source.approvalRequired!==void 0&&i(`Approval required: ${n.source.approvalRequired?"Yes":"No"}`),V(n.source);let r=s(n.source.assets);i(`Build: ${r??"Unknown"} | Status: ${n.status}`),Z(n);function s(u){let l=u?.map(a=>a.buildStatus).filter(a=>a!==void 0);if(l?.length)return l.some(a=>a==="buildFailure"||a==="pollingFailure")?"Failed":l.some(a=>a==="inProgress")?"In progress":l.every(a=>a==="success")?"Passed":l.some(a=>a==="notStarted")?"Not started":"Unknown"}}function we(t,e){if(!e){i(`No deployments found for project '${t}'.`);return}i(`Project: ${t} | Target: ${e.target??"-"}`),i(`Deployment start: ${e.deploymentStart} | Deployment end: ${e.deploymentEnd}`),i(`Status: ${e.status} | Commit: ${e.commitId}`),U(e.target??"","prod")&&e.source.approvalDecision&&i(`Decision: ${e.source.approvalDecision}`);let n=O(e.source);if(n.by||n.time){let[o,r]=te(n);i(`Decided by: ${o} | Decided: ${r}`)}V(e.source),Z(e)}function V(t){let e=v(t.approvalUrl);e&&i(`Approval URL: ${e}`)}function Z(t){if(!t.apps)return;let{succeeded:e,failed:n,rolledBack:o,inProgress:r,notDeployed:s,total:u}=t.apps;u===e?i(`Apps: ${e} succeeded`):i([`Apps: ${e} succeeded`,`${n} failed`,`${o} rolled back`,...s>0?[`${s} not deployed`]:[],...r>0?[`${r} in progress`]:[]].join(" | "))}function ee(t,e,n,o,r=!1){let s=e.map(d=>O(d.source)),u=s.some(d=>d.by||d.time),l=[{header:"Number"},...n?[{header:"Project"}]:[],{header:"Target"},{header:"Commit"},{header:"Decision"},...u?[{header:"Decided by"},{header:"Decided time"}]:[],{header:"Result"},{header:"Deployment start"},{header:"Deployment end"}],a=[...r?["Project display names are unavailable; project IDs are shown instead."]:[],...ne(o)];F({title:`${t} | Order: Descending by deployment start`,...a.length>0?{metadata:a}:{},columns:l,rows:e.map((d,D)=>[`[${D}]`,...n?[d.project??d.projectId??"-"]:[],d.target??"-",d.commitId,d.source.approvalDecision??"-",...u?te(s[D]):[],d.status,d.deploymentStart,d.deploymentEnd]),emptyMessage:"No deployments found.",totalLabel:"deployment(s)",width:120})}function te(t){return[t?.by??"-",t?.time?C(t.time):"-"]}function ne(t){return t.continuationToken?[t.pageLimitReached?`Traversal stopped after ${x} pages; results are partial.`:"More deployment history is available.",`Continuation token: ${t.continuationToken}`]:[]}function ie(t){for(let e of ne(t))i(e)}function oe(t){let e=t.requestedBy,n=t.initiatedBy;return v(e?.email)??v(e?.userPrincipalName)??v(e?.displayName)??v(e?.objectId)??v(n?.email)??v(n?.displayName)??v(n?.objectId)}function Te(t){return t?/^[0-9a-f]{8,64}$/i.test(t)?t.slice(0,7):t:"-"}export{Be as listDeploymentsAsync};
|
|
8
|
-
/*!
|
|
9
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
-
*/
|
|
11
|
-
//# sourceMappingURL=ListDeployments-4YWCHVKF.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{i as g}from"./chunk-GE3UFHZ5.js";import{Na as l,Nb as m,Ob as h,x as f}from"./chunk-4XKA5APP.js";import"./chunk-FHE3OXIP.js";import"./chunk-OUKOEUZA.js";import{o as t}from"./chunk-4U53RYJJ.js";import{a as r}from"./chunk-HOIFXUTG.js";import{A as I,F as L,I as M}from"./chunk-KKC5ZK4D.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";var D="edit",v={edit:"write",play:"read"},E=Object.keys(v);async function _(e){S(e),await e.runVerb();let s=await e.getTenantIdAsync();if(!s)throw new f("Unable to determine tenant ID. Ensure you are logged in.");let a=e.getEnvironmentId({includeConfig:!1}),p=await e.getOption(t.Permission.name,!0),w=!!p?.trim(),o;if(w){let i=U(p),d=await l({tenantId:s,environmentId:a,permission:i,logger:m()}),c=i==="write";o=d.map(n=>u(n,c))}else{let[i,d]=await Promise.all([l({tenantId:s,environmentId:a,permission:"write",logger:m()}),l({tenantId:s,environmentId:a,permission:"read",logger:m()})]),c=new Set(i.map(n=>n.id));o=[...i.map(n=>u(n,!0)),...d.filter(n=>!c.has(n.id)).map(n=>u(n,!1))]}if(e.isJsonMode()){L(o);return}let y=h().interactive,A=!y;I({title:a?`Copilot Managed Runtime (environment: ${a})`:"Copilot Managed Runtime",columns:[{header:"App ID",maxWidth:38},{header:"Display Name"},{header:"Last Deployed"},{header:"URL"},{header:A?"Repo":"Edit Access"}],rows:o.map(i=>[i.appId,i.displayName||"<No Name>",P(i.lastDeployedTime),i.appPlayUri??"-",A?i.cloneUrl??"-":i.hasEditAccess?"Yes":"No"]),emptyMessage:"No managed apps found.",totalLabel:"Managed app(s) found"}),y&&o.length>0&&M("Use `ms app info --app <GUID>` to get app details, including the clone URL.")}function S(e){e.setDescription(r.app.list.description),e.addExamples(r.app.list.examples),e.addOptions([g({flags:{key:t.EnvironmentId.name,alias:t.EnvironmentId.alias},env:t.EnvironmentId.envVar,message:t.EnvironmentId.promptMessage,description:r.app.list.options.environmentId}),g({flags:{key:t.Permission.name,alias:t.Permission.alias},env:t.Permission.envVar,message:t.Permission.promptMessage,description:r.app.list.options.permission})])}function U(e){let s=e?e.toLowerCase():D,a=E.find(p=>p===s);if(a)return v[a];throw new f(`Invalid --permission value '${e}'. Must be one of: ${E.join(", ")}.`)}function u(e,s=!0){return{appId:e.id,displayName:e.displayName,lastDeployedTime:e.lastDeployedTime??void 0,appPlayUri:e.appPlayUri??void 0,hasEditAccess:s,...s?{cloneUrl:e.cloneUrl??void 0}:{}}}function P(e){if(!e)return"-";let s=new Date(e);return Number.isNaN(s.getTime())?e:s.toLocaleDateString()}export{_ as listMaafAppsAsync,U as resolvePermission,u as toRow};
|
|
8
|
-
/*!
|
|
9
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
-
*/
|
|
11
|
-
//# sourceMappingURL=ListMaafApps-ZATO77G3.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 P}from"./chunk-KT2SUHGM.js";import{i as I}from"./chunk-GE3UFHZ5.js";import{Nb as j,da as f,ib as p,x as l}from"./chunk-4XKA5APP.js";import"./chunk-FHE3OXIP.js";import"./chunk-OUKOEUZA.js";import{p as c}from"./chunk-4U53RYJJ.js";import{a as m}from"./chunk-HOIFXUTG.js";import{F as g}from"./chunk-KKC5ZK4D.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function T(e){k(e),await e.runVerb();let n=await e.getTenantIdAsync();if(!n)throw new l("Unable to determine tenant ID. Ensure you are logged in.");let t=e.getEnvironmentId({includeConfig:!1}),a=j(),s=await p({tenantId:n,environmentId:t,logger:a}),o=t===void 0;if(e.isJsonMode()){let r=await v(n,t,s,a);g(r.map(i=>y(i,o)));return}await P({title:t?`Managed Projects (environment: ${t})`:"Managed Projects",columns:[{header:"Project ID",maxWidth:38},{header:"Display Name"},...o?[{header:"Environment ID",maxWidth:46}]:[]],firstPage:u(s),fetchNextPage:async r=>u(await p({tenantId:n,environmentId:t,skipToken:r,logger:a})),toRow:r=>{let i=y(r,o);return[i.projectId,i.displayName||"<No Name>",...o?[i.environmentId??"-"]:[]]},emptyMessage:"No managed projects found.",totalLabel:"managed project(s)"})}function u(e){return{items:e.projects,...e.nextSkipToken===void 0?{}:{nextSkipToken:e.nextSkipToken}}}async function v(e,n,t,a){let s=[...t.projects],o=t.nextSkipToken,r=1;for(;o;){if(r>=200)throw new f(`ms project list exceeded the ${200}-page cap; the server is likely returning a $skiptoken cycle.`,200);let i=await p({tenantId:e,environmentId:n,skipToken:o,logger:a});s.push(...i.projects),o=i.nextSkipToken,r++}return s}function y(e,n){return{projectId:e.projectId??"",displayName:e.displayName??"",...n?{environmentId:e.environmentId}:{}}}function k(e){e.setDescription(m.project.list.description),e.addExamples(m.project.list.examples),e.addOptions([I({flags:{key:c.EnvironmentId.name,alias:c.EnvironmentId.alias},env:c.EnvironmentId.envVar,message:c.EnvironmentId.promptMessage,description:m.project.list.options.environmentId})])}export{T as listMaafProjectsAsync,y as toRow};
|
|
8
|
-
/*!
|
|
9
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
-
*/
|
|
11
|
-
//# sourceMappingURL=ListMaafProjects-GNUXZSYL.js.map
|
|
@@ -1,17 +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 w,b as y}from"./chunk-3YRE4IQ3.js";import"./chunk-HBLO3WDD.js";import{a as v}from"./chunk-OL6CTXQR.js";import"./chunk-TYRVM4PP.js";import{o as I}from"./chunk-GE3UFHZ5.js";import{Ob as m,x as u}from"./chunk-4XKA5APP.js";import{d,f,g,o as _}from"./chunk-FHE3OXIP.js";import"./chunk-OUKOEUZA.js";import{K as p,L as A}from"./chunk-KKC5ZK4D.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";import*as S from"node:fs";import*as R from"node:path";import T from"open";import*as c from"fs";import*as C from"path";var E="active-account.json";function P(s){let e=s.lastIndexOf(".");if(!(e<=0))return s.slice(e+1).trim()||void 0}var h=class{constructor(e=d){this._cacheDir=e;this._filePath=C.join(this._cacheDir,E)}_cacheDir;_filePath;read(){if(c.existsSync(this._filePath))try{let e=c.readFileSync(this._filePath,"utf-8"),t=JSON.parse(e);return typeof t.homeAccountId=="string"&&typeof t.username=="string"&&t.homeAccountId.length>0?{homeAccountId:t.homeAccountId,username:t.username}:void 0}catch{return}}write(e){c.mkdirSync(this._cacheDir,{recursive:!0});let t=`${this._filePath}.${process.pid}.tmp`;c.writeFileSync(t,JSON.stringify(e,null,2),"utf-8"),c.renameSync(t,this._filePath)}clear(){let e=c.existsSync(this._filePath);return c.rmSync(this._filePath,{force:!0}),e}};var b=class{_msalClient;_tenantId;_region;_persistence;_activeStore;_cacheDirectory;_isJsonMode=()=>process.argv.includes("--json");constructor(e=d){this._cacheDirectory=e,this._activeStore=new h(e)}async initAsync(e){this._region=e;let{DataProtectionScope:t,PersistenceCachePlugin:n,PersistenceCreator:i}=await import("./dist-7N5TXK2L.js"),r={cachePath:R.join(this._cacheDirectory,"msal_cache.json"),dataProtectionScope:t.CurrentUser,serviceName:f,accountName:g,usePlaintextFileOnLinux:!1},o=await i.createPersistence(r);this._persistence=o;let l={auth:{authority:I(this._region,this._tenantId),clientId:_},cache:{cachePlugin:new n(o)}};this._msalClient=new y(l)}setJsonModeResolver(e){this._isJsonMode=e}async getAccessTokenForResource(e,t){let n=await this._acquireTokenInternal(e+"/.default",t);return this._tenantId=n.tenantId,n.accessToken}getUserTenantId(){if(this._tenantId!==void 0)return this._tenantId;let e=this._activeStore.read()?.homeAccountId;return e===void 0?void 0:P(e)}async getCachedAccountAsync(){let e=await this._getAccounts();return this._pickActiveAccount(e)?.username}async listCachedAccountsAsync(){let e=await this._getAccounts();if(e.length===0)return[];let t=this._pickActiveAccount(e);return e.map(n=>({homeAccountId:n.homeAccountId,username:n.username,isActive:n.homeAccountId===t?.homeAccountId}))}async setActiveAccountAsync(e){let t=await this._getAccounts(),n=this._findAccount(t,e);if(!n)throw new u(`No cached account matches '${e}'. Run \`${"ms"} auth status\` to list cached accounts.`);return this._activeStore.write({homeAccountId:n.homeAccountId,username:n.username}),{homeAccountId:n.homeAccountId,username:n.username,isActive:!0}}async loginInteractiveAsync(e,t,n){let i=e+"/.default";if(n){let o=await this._signInWithDeviceCodeAndPersist(i);return{homeAccountId:o.account.homeAccountId,username:o.account.username,isActive:!0}}let r=await this._signInInteractiveAndPersist(i,t,{prompt:t?void 0:"select_account"});if(!r.account)throw new Error("Interactive sign-in did not return an account.");return{homeAccountId:r.account.homeAccountId,username:r.account.username,isActive:!0}}async clearCacheAsync(){let e=await this._clearPersistenceAsync(),t=this._activeStore.clear();return S.rmSync(this._cacheDirectory,{recursive:!0,force:!0}),e||t}async _clearPersistenceAsync(){if(!this._persistence)throw new Error("Authentication not initialized yet");let e;try{e=await this._persistence.load()!==null}catch{e=!0}return await this._persistence.delete(),e}async _getAccounts(){if(!this._msalClient)throw new Error("Authentication not initialized yet");try{return await this._msalClient.getTokenCache().getAllAccounts()}catch(e){return p(`Could not read the MSAL token cache (${e.message}). It may have been written by an older CLI version. Run \`${"ms"} auth logout\` and sign in again to reset it.`),[]}}_findAccount(e,t){let n=t.toLowerCase();return e.find(i=>i.homeAccountId.toLowerCase()===n)??e.find(i=>i.username.toLowerCase()===n)}_pickActiveAccount(e){if(e.length===0)return;if(e.length===1)return e[0];let t=this._activeStore.read();if(t)return e.find(n=>n.homeAccountId===t.homeAccountId)}_ensureActivePointer(e){this._activeStore.read()?.homeAccountId!==e.homeAccountId&&this._activeStore.write({homeAccountId:e.homeAccountId,username:e.username})}async _acquireTokenInternal(e,t){if(!this._msalClient)throw new Error("Authentication not initialized yet");let n=await this._getAccounts();if(n.length===0)return this._ensureInteractiveSignInAllowed("no-account"),this._signInInteractiveAndPersist(e,t);let i=this._pickActiveAccount(n);if(!i){let r=n.map(l=>` - ${l.username}`).join(`
|
|
8
|
-
`),o=m().interactive?`Run \`${"ms"} auth switch\` to choose one, or \`${"ms"} auth logout\` to clear all cached accounts and start over.`:`Run \`${"ms"} auth switch --account <email>\` to resolve, then retry.`;throw new u(`Multiple accounts are cached and no active account is selected:
|
|
9
|
-
${r}
|
|
10
|
-
${o}`)}try{let r=await this._msalClient.acquireTokenSilent({account:i,scopes:[e]});return this._ensureActivePointer(r.account??i),r}catch(r){if(r instanceof w||k(r))return this._ensureInteractiveSignInAllowed("expired"),this._signInInteractiveAndPersist(e,t??i.username);throw r}}_ensureInteractiveSignInAllowed(e){if(m().interactive)return;let t=e==="no-account"?"You are not signed in":"Your sign-in session has expired and could not be renewed silently";throw new u(`${t}. Interactive sign-in is required, but the CLI is running in non-interactive mode. Run \`${"ms"} auth login\` to sign in, then retry.`)}async _signInInteractiveAndPersist(e,t,n){if(!this._msalClient)throw new Error("Authentication not initialized yet");let i=this._getInteractiveLoginRequest(e,t);n?.prompt&&(i.prompt=n.prompt);let r=process.stdout.isTTY&&!this._isJsonMode()?new v:null;r?.start("Opening your browser to sign in \u2014 complete the sign-in there to continue...");try{let o=await this._msalClient.acquireTokenInteractive(i);return this._tenantId=o.tenantId,o.account&&this._ensureActivePointer(o.account),o}finally{r?.stop()}}async _signInWithDeviceCodeAndPersist(e){if(!this._msalClient)throw new Error("Authentication not initialized yet");let t={scopes:[e],deviceCodeCallback:i=>process.stderr.write(i.message+`
|
|
11
|
-
`)},n=await this._msalClient.acquireTokenByDeviceCode(t);if(!n?.account)throw new Error("Device code sign-in did not return an account.");return this._tenantId=n.tenantId,this._ensureActivePointer(n.account),{...n,account:n.account}}_getInteractiveLoginRequest(e,t){return{scopes:[e],openBrowser:async i=>{try{await T(i,{wait:!1})}catch(r){A(`Couldn't open a browser automatically (${String(r)}).
|
|
12
|
-
Open this URL to finish signing in:
|
|
13
|
-
${i}`)}},successTemplate:"You can close this window now.",...t&&{loginHint:t}}}};function k(s){if(!(s instanceof Error))return!1;let e=s.errorCode;if(e===3400073247||e==="3400073247")return!0;let t=(s.message??"").toLowerCase();return t.includes("integrated windows auth")&&t.includes("federation")}export{b as NodeMsalAuthenticationProvider};
|
|
14
|
-
/*!
|
|
15
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
16
|
-
*/
|
|
17
|
-
//# sourceMappingURL=NodeMsalAuthenticationProvider-5TJFMHR4.js.map
|
package/dist/Pack-TSFHSTB5.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{h as a,i as b,j as c,k as d,l as e}from"./chunk-NYPHWF7Q.js";import"./chunk-6EF722GY.js";import"./chunk-HBLO3WDD.js";import"./chunk-OL6CTXQR.js";import"./chunk-TYRVM4PP.js";import"./chunk-4XKA5APP.js";import"./chunk-2LDU3F6O.js";import"./chunk-RFLXPXBN.js";import"./chunk-FHE3OXIP.js";import"./chunk-OUKOEUZA.js";import"./chunk-HOIFXUTG.js";import"./chunk-KKC5ZK4D.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";export{b as assertAppConfigSchemaValid,a as assertPackPreconditions,d as packAppArtifactAsync,e as packAsync,c as tryPackAppArtifactAsync};
|
|
8
|
-
//# sourceMappingURL=Pack-TSFHSTB5.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{a as H,b as R,c as Q,d as Z,e as O,f as q,g as tt,h as rt,i as ot,j as at}from"./chunk-NYPHWF7Q.js";import{a as nt,b as st}from"./chunk-ATUGCFVC.js";import{i as et}from"./chunk-6EF722GY.js";import"./chunk-HBLO3WDD.js";import"./chunk-OL6CTXQR.js";import"./chunk-TYRVM4PP.js";import{Nb as $,Ob as X,Pb as Y,w as D,z as m}from"./chunk-4XKA5APP.js";import"./chunk-2LDU3F6O.js";import"./chunk-RFLXPXBN.js";import{a as G}from"./chunk-FHE3OXIP.js";import"./chunk-OUKOEUZA.js";import{a as N}from"./chunk-HOIFXUTG.js";import{C as z,D as V,G as W,I as F,K as h,o as C,q as I}from"./chunk-KKC5ZK4D.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";import{randomUUID as J}from"node:crypto";import*as s from"node:fs/promises";import*as u from"node:path";function A(t){return typeof t=="object"&&t!==null&&"code"in t&&t.code==="ENOENT"}var ht=new Set([".git",".ms","node_modules"]),ft="project-pack-",lt=".log",T=50*1024*1024,yt=5,At=1440*60*1e3;async function kt(t){try{return(await s.stat(t)).isFile()}catch(e){if(A(e))return!1;throw e}}async function jt(t){try{let e=await s.realpath(t),r=await s.readdir(e,{withFileTypes:!0}),a=new Set(r.filter(o=>o.isFile()).map(o=>o.name)),n=I.find(o=>a.has(o));if(!n)throw new m(`An app config (${I.join(" or ")}) is required at the project root: ${e}`);return await s.realpath(u.join(e,n))}catch(e){throw A(e)?new m(`Unable to resolve the project root or app config: ${e.message}`):e}}async function dt(t){let e;try{e=await s.readFile(t,"utf-8")}catch(r){throw new m(`Failed to read ${t}: ${r.message}`)}try{let r=JSON.parse(e);return ot(r),rt(r,u.basename(t)),{appConfigPath:t,appId:tt(r.appId,u.basename(t)),environmentId:r.environmentId,buildType:r.buildType}}catch(r){throw r instanceof D?(r.message=`${t}: ${r.message}`,r):new m(`${t}: ${r.message}`)}}async function ut(t,e){let r=await s.realpath(e);if(!R(t,r,!0))throw new m(`Project app directory resolves outside the project root: ${e}`);let a=await s.readdir(r,{withFileTypes:!0}),n=new Set(a.filter(p=>p.isFile()).map(p=>p.name)),o=I.find(p=>n.has(p));if(!o)return;let c=u.join(r,o),i=await s.realpath(c);if(!R(t,i))throw new m(`Discovered app config resolves outside the project root: ${c}`);return i}async function Et(t){let e=[],r=await s.realpath(t);async function a(n){let o=await ut(r,n);o&&e.push(o)}try{await a(r);let o=(await s.readdir(r,{withFileTypes:!0})).filter(c=>c.isDirectory()&&!ht.has(c.name)).sort((c,i)=>c.name.localeCompare(i.name));for(let c of o)await a(u.join(r,c.name))}catch(n){throw A(n)?new m(`Project contents changed while discovering app configurations: ${n.message}`):n}return e}async function Ct(t,e){let r=await s.realpath(t),a=[],n=new Set;for(let o of e){let c=u.resolve(r,o);if(!R(r,c,!0))throw new m(`Project app directory must be the project root or one of its descendants: ${o}`);let i;try{i=await s.realpath(c)}catch(P){throw A(P)?new m(`Project app directory does not exist: ${o}`):P}if(!R(r,i,!0))throw new m(`Project app directory resolves outside the project root: ${o}`);if(n.has(i))continue;n.add(i);let p=await ut(r,i);if(!p)throw new m(`Project app directory does not contain ${I.join(" or ")}: ${o}`);a.push(p)}return a}async function it(t){let e=await Promise.all(t.map(dt)),r=new Map;for(let{appId:a,appConfigPath:n}of e){let o=r.get(a);if(o)throw new m(`Duplicate appId "${a}" in ${o} and ${n}`);r.set(a,n)}return e}async function mt(t=!1){let{fileConfig:e,projectConfig:r,projectConfigError:a}=X();if(a)throw new m(`Invalid ${C}: ${a.message}`);let n;if(r){if(!e.projectConfigPath)throw new m(`Unable to resolve the path to ${C}.`);n=u.dirname(u.resolve(e.projectConfigPath));let c=r.components?.apps;return c?(t||F(`Using app directories listed in ${C}.`),{projectRoot:n,apps:await it(await Ct(n,c))}):(t||F(`No app directories are listed in ${C}; discovering apps at the project root and in immediate child directories.`),{projectRoot:n,apps:await it(await Et(n))})}else n=u.dirname(u.resolve(e.appConfigPath));let o=await jt(n);return{projectRoot:n,apps:[await dt(o)]}}async function It(t){try{return await s.stat(t),!0}catch(e){if(A(e))return!1;throw e}}function gt(t){return{errorCode:typeof t=="object"&&t!==null&&"code"in t&&typeof t.code=="string"?t.code:"UNKNOWN",errorName:t instanceof Error?t.name:typeof t}}async function ct(t,e){if(!t)return{};try{let r=(await s.stat(t)).size,a=Math.max(0,T-r);return a>0?{logFilePath:t,logFileMaxBytes:a,onLogError:e}:{}}catch(r){return A(r)?{logFilePath:t,logFileMaxBytes:T,onLogError:e}:(e(r),{})}}async function B(t,e,r,a,n){if($().trackErrorEvent("ProjectPack.AppFailed",{stage:e,...gt(r)}),!!a)try{let o=(await s.stat(a)).size,c=T-o;if(c<=0)return;let i=Buffer.from(`
|
|
8
|
-
[ms project pack] ${e} failed for app ${t}: ${y(r)}
|
|
9
|
-
`);await s.appendFile(a,i.subarray(0,c))}catch(o){if(!A(o)){n(o);return}try{let c=Buffer.from(`[ms project pack] ${e} failed for app ${t}: ${y(r)}
|
|
10
|
-
`);await s.writeFile(a,c.subarray(0,T))}catch(c){n(c)}}}async function Ft(t,e,r){try{let a=await s.readdir(t,{withFileTypes:!0}),n=[],o=[],c=Date.now();for(let i of a){let p=u.join(t,i.name);i.isFile()&&i.name.startsWith(ft)&&i.name.endsWith(lt)?n.push({path:p,modifiedAt:(await s.stat(p)).mtimeMs}):i.isDirectory()&&i.name.startsWith("packed-staging-")&&p!==e&&c-(await s.stat(p)).mtimeMs>=At&&o.push(p)}n.sort((i,p)=>p.modifiedAt-i.modifiedAt);for(let i of n.slice(yt))await s.rm(i.path,{force:!0});for(let i of o)await s.rm(i,{recursive:!0,force:!0})}catch(a){$().trackErrorEvent("ProjectPack.ArtifactPruneFailed",gt(a)),r||h(`Unable to prune old project-pack diagnostics: ${y(a)}`)}}async function Dt(t,e){let r=`${e}-backup-${J()}`,a=await It(e);a&&await s.rename(e,r);try{await s.rename(t,e)}catch(n){if(a)try{await s.rename(r,e)}catch(o){throw new D(`Failed to promote the new project artifact and restore the previous artifact. The previous artifact remains at ${r}. Promotion error: ${n.message}. Restore error: ${o.message}`)}throw n}if(a)try{await s.rm(r,{recursive:!0,force:!0})}catch(n){return{retainedBackupFolder:r,cleanupError:n}}return{}}async function Pt(t,e,r=t.apps){let a=Date.now(),{projectRoot:n}=t,o=r;if(o.length===0)throw new m("No apps were found to pack. Add an app config or list app directories in ms.project.config.json.");let c=Q(n),i=q(n,J()),p=e?u.join(u.dirname(c),`${ft}${J()}${lt}`):void 0,P=k=>{let L="code"in k&&typeof k.code=="string"?k.code:"LOG_CAPTURE_FAILED";$().trackErrorEvent("ProjectPack.LogCaptureFailed",{errorCode:L,errorName:k.name}),p=void 0},j=new Map,K=new Set,_=0,v=0,E=0,M=!1;try{await s.mkdir(i,{recursive:!0});let k=Date.now();for(let[d,f]of o.entries()){let g=u.dirname(f.appConfigPath);if(f.buildType==="none"||!await kt(u.join(g,"package.json")))continue;let l=nt(g,st(g)),w=l==="npm"?"npm install --prefer-offline":`${l} install`;e||F(`Installing dependencies for app ${d+1} of ${o.length} (${f.appId})...`);let wt=Date.now();try{let x=await ct(p,P);await et(w,g,{quiet:e,...x})}catch(x){await B(f.appId,"dependencyInstall",x,p,P),K.add(f.appId),j.set(f.appId,{success:!1,appId:f.appId,error:{code:"APP_DEPENDENCY_INSTALL_FAILED",message:`Dependency installation failed for app ${f.appId}.`},timings:pt(Date.now()-wt)}),e||h(`Dependency installation failed for app ${f.appId}: ${y(x)}`)}}_=Date.now()-k;let L=Date.now();for(let[d,f]of o.entries()){if(K.has(f.appId))continue;e||F(`Packing app ${d+1} of ${o.length} (${f.appId})...`);let g=Date.now();try{let l=await ct(p,P),w=await at({quiet:e,commandLogFilePath:l.logFilePath,commandLogFileMaxBytes:l.logFileMaxBytes,onCommandLogError:l.onLogError,appConfigPath:f.appConfigPath,packedFolder:i,cleanPackedFolder:!1});w.success?j.set(f.appId,{success:!0,...w.result}):(await B(f.appId,"pack",w.error,p,P),j.set(f.appId,{success:!1,appId:f.appId,error:{code:"APP_PACK_FAILED",message:`Packing failed for app ${f.appId}.`},timings:w.timings}),e||h(`Packing failed for app ${f.appId}: ${y(w.error)}`))}catch(l){await B(f.appId,"pack",l,p,P),j.set(f.appId,{success:!1,appId:f.appId,error:{code:"APP_PACK_FAILED",message:`Packing failed for app ${f.appId}.`},timings:pt(Date.now()-g)}),e||h(`Packing failed for app ${f.appId}: ${y(l)}`)}}v=Date.now()-L;let S=o.map(({appId:d})=>{let f=j.get(d);if(!f)throw new D(`Project pack did not produce a result for app ${d}.`);return f});if(S.some(d=>!d.success))return M=S.some(d=>d.success),{success:!1,...p?{logFile:p}:{},components:{apps:S},timings:{dependencyInstallMs:_,appPackingMs:v,finalizationMs:E,totalMs:Date.now()-a},error:{code:"PROJECT_PACK_FAILED",message:"One or more apps failed to pack."}};let b=S.filter(d=>d.success),U=Date.now();try{let d=b.map(({appId:l})=>({appId:l,path:Z(l)})),f={cliVersion:G.version,manifestVersion:H,apps:d};await s.writeFile(O(i),JSON.stringify(f,null,2));let g=await Dt(i,c);if(g.cleanupError&&g.retainedBackupFolder){let l=g.cleanupError;$().trackErrorEvent("ProjectPack.BackupCleanupFailed",{errorCode:typeof l=="object"&&l!==null&&"code"in l&&typeof l.code=="string"?l.code:"BACKUP_CLEANUP_FAILED",errorName:l instanceof Error?l.name:typeof l}),e||h(`Project packed successfully, but the previous artifact backup could not be removed: ${g.retainedBackupFolder}`)}E=Date.now()-U}catch(d){return E=Date.now()-U,M=b.length>0,e||h(`Project artifact finalization failed: ${y(d)}`),{success:!1,...p?{logFile:p}:{},components:{apps:b},timings:{dependencyInstallMs:_,appPackingMs:v,finalizationMs:E,totalMs:Date.now()-a},error:{code:"PROJECT_PACK_FAILED",message:"Project artifact finalization failed."}}}return{success:!0,...p?{logFile:p}:{},packedFolder:c,projectManifestPath:O(c),components:{apps:b.map(d=>({...d,packedFolder:c,packAppOutputDir:d.packAppOutputDir.replace(i,c),packClientOutputDir:d.packClientOutputDir.replace(i,c)}))},timings:{dependencyInstallMs:_,appPackingMs:v,finalizationMs:E,totalMs:Date.now()-a}}}finally{M||await s.rm(i,{recursive:!0,force:!0}),await Ft(u.dirname(c),M?i:void 0,e)}}function pt(t){return{clientBuildMs:0,clientCopyMs:0,dataSourcesMs:0,functionsDiscoveryMs:0,middletierBuildMs:0,functionsArchiveMs:0,rayfinPackMs:0,totalMs:t}}function y(t){return t instanceof Error?t.message:String(t)}async function Jt(t={}){let{quiet:e=!1}=t;return Pt(await mt(e),e)}async function Kt(t){t.setDescription(N.project.pack.description),t.addExamples(N.project.pack.examples),await t.runVerb();let e=t.isJsonMode(),r=await mt(e),a=await Pt(r,e);if(e)if(a.success){let{success:n,...o}=a;V(o)}else{let{success:n,...o}=a;throw W(o),new Y(a.error.message)}else if(a.success)z("Project successfully packed.");else throw new D(a.error.message)}export{Et as discoverProjectAppConfigsAsync,Jt as packProjectArtifactAsync,Kt as packProjectAsync,Pt as packResolvedProjectArtifactAsync};
|
|
11
|
-
/*!
|
|
12
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
13
|
-
*/
|
|
14
|
-
//# sourceMappingURL=PackProject-T575KJQ4.js.map
|
|
@@ -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{a,b}from"./chunk-PLFDUGBA.js";import"./chunk-QLK3ZVWP.js";import"./chunk-GE3UFHZ5.js";import"./chunk-4XKA5APP.js";import"./chunk-2LDU3F6O.js";import"./chunk-RFLXPXBN.js";import"./chunk-FHE3OXIP.js";import"./chunk-OUKOEUZA.js";import"./chunk-4U53RYJJ.js";import"./chunk-HOIFXUTG.js";import"./chunk-KKC5ZK4D.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";export{b as buildPlayUrl,a as playMaafAppAsync};
|
|
8
|
-
//# sourceMappingURL=PlayMaafApp-74TQEAO5.js.map
|