@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
|
@@ -0,0 +1,23 @@
|
|
|
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 Fe,b as Ge,c as _e,d as He}from"./chunk-OH3TCDCC.js";import{b as Le}from"./chunk-HZGDQAKA.js";import{b as Ye}from"./chunk-7LAMG4KK.js";import{a as Te,b as xe}from"./chunk-XJXWNOJR.js";import{a as Pe}from"./chunk-OL6CTXQR.js";import{a as Je,b as We,c as qe,d as ze,e as Ke}from"./chunk-NMZFJESU.js";import{b as Me,d as Qe,e as Xe}from"./chunk-BAQPANON.js";import{a as Ve,b as Be}from"./chunk-KD4NQIYX.js";import"./chunk-4PI5THLA.js";import{a as Ue}from"./chunk-3YCPXSCO.js";import"./chunk-CLY3OASM.js";import"./chunk-OHQNTYJG.js";import{a as ke,b as De}from"./chunk-6KOL66SF.js";import"./chunk-TYRVM4PP.js";import{a as Oe,b as je,d as S,i as ee,j as Ne}from"./chunk-R2IECDVU.js";import{i as U,m as $e}from"./chunk-ZLK2CMMJ.js";import"./chunk-A5INC5TY.js";import{A as P,B as Y,Ha as Ce,L as we,Ob as X,Pb as Z,Qb as Ie,i as he,j as ye,oa as be,x as D,y as d,z}from"./chunk-RSHOMYG6.js";import{s as r}from"./chunk-WS6TGUH7.js";import{n as _}from"./chunk-UHNOINTO.js";import"./chunk-YEWRCEPT.js";import"./chunk-DLUQVMUE.js";import{e as Ae}from"./chunk-C7UWPNC3.js";import{a as E}from"./chunk-AICYZHWK.js";import{D as Ee,E as K,H as ve,I as Se,J as Q,N as O,P as Re,a as ue,h as fe,r as me,u as ge}from"./chunk-PYPCPMCR.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";import*as g from"fs";import*as rt from"os";import*as m from"path";import*as $ from"fs";import*as Ze from"os";import*as V from"path";function te(e){if(!e)throw new d("Template source is empty. Use --template to specify one.");if(/^https?:\/\//i.test(e)){let i;try{i=new URL(e)}catch{throw new d(`Template source '${e}' is not a valid URL.`)}if(i.hostname.toLowerCase()!=="github.com")throw new d(`Template source '${e}' uses host '${i.hostname}'; only github.com URLs are supported.`);let y=i.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[x,f,...C]=y,s=f.endsWith(".git")?f.slice(0,-4):f,A=i.hash?i.hash.slice(1):void 0;if(C.length===0)return{owner:x,repo:s,subdir:"",ref:A};if(C[0].toLowerCase()==="tree"&&C.length>=2)return{owner:x,repo:s,subdir:C.slice(2).join("/"),ref:A??C[1]};throw C[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 n=/^([a-z][a-z0-9+.-]*):/i.exec(e);if(n){let i=n[1].toLowerCase();if(i!=="github"&&i!=="gh")throw new d(`Template source '${e}' uses unsupported provider prefix '${n[1]}:'. Only 'github:' (or 'gh:' shorthand) templates are supported.`)}let t=e.replace(/^(?:github|gh):/i,""),[a,u]=t.split("#",2),p=a.split("/").filter(Boolean);if(p.length<2)throw new d(`Template source '${e}' is missing the owner/repo path. Expected 'github:<owner>/<repo>[/<subdir>]'.`);let[b,h,...c]=p;return{owner:b,repo:h,subdir:c.join("/"),ref:u||void 0}}function et(e,n){let t=te(e),a=`https://github.com/${t.owner}/${t.repo}.git`,u=$.mkdtempSync(V.join(Ze.tmpdir(),"ms-template-"));try{let p=["clone","--depth=1","--filter=blob:none"];t.subdir&&p.push("--sparse"),t.ref&&p.push("--branch",t.ref),p.push(a,u),S(p,{network:!0}),t.subdir&&S(["-C",u,"sparse-checkout","set",t.subdir]);let b=t.subdir?V.join(u,t.subdir):u;if(!$.existsSync(b))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.`);$.mkdirSync(n.dir,{recursive:!0}),$.cpSync(b,n.dir,{recursive:!0,force:!0,filter:h=>V.basename(h)!==".git"})}finally{$.rmSync(u,{recursive:!0,force:!0})}}var mt="github:microsoft/Copilot-Managed-Runtime/templates/vite8",gt=new Set([".ds_store","desktop.ini","thumbs.db"]),ht=new Set([me,".git","README.md"]),re="Initial scaffold from 'ms app create'";async function an(e){Ee();try{await yt(e)}catch(n){throw n instanceof Ie||K()&&Le(n),n}}async function yt(e){$t(e),await e.runVerb();let n=await e.getTenantIdAsync();if(!n)throw new d("Unable to determine tenant ID. Ensure you are logged in.");let t=X(),a=Z(),{region:u}=we(),p=await e.getOption("displayName");if(!p)throw new d("Argument displayName is required. Use --display-name or -n to specify it.");let b=e.getPositionalArg(0),h=await e.getOption("template",!0),c=await e.getOption("repo",!0),{repoType:i,remoteUrl:y}=Xe(c),x=c!==void 0&&c.trim().length>0,f=a.projectConfig;if(a.projectConfigError)throw new P(`Unable to read ${a.fileConfig.projectConfigPath}. ${a.projectConfigError.message}`);if(f&&x)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(f)if(i=f.repoType,i==="github"){if(!f.externalRepoUrl)throw new P("The current GitHub-backed managed project is missing externalRepoUrl.");y=Qe(f.externalRepoUrl,"The current managed project's externalRepoUrl")}else y=void 0;let C=b===void 0&&f!==void 0;if(b===void 0&&!C&&!xe(p))throw new d("The display name cannot be used as a directory name. Specify a target directory as the first argument.");let s=b??(C?".":Te(p)),A=_("ga"),B=await e.getOption(r.ProjectLocalAppId.camelName,!0);if(B!==void 0&&!A)throw new d("--project-local-app-id requires the ga feature to be enabled.");let M=A?qe(s,B):void 0,H=await e.getOption("repositoryId",!0),oe=f?.projectId,R=f!==void 0,j,J=!1,ae=[];if(R){let o=a.fileConfig.projectConfigPath;if(!o)throw new P("Unable to locate ms.project.config.json for the current managed project.");j=m.dirname(m.resolve(o));let l=ie(j,s),I=ie(j,j);J=l===I}let ot=await e.getOption(r.BuildType.camelName,!0),se=await e.getOption("buildCommand",!0),L=Je({buildType:ot,buildPath:await e.getOption("buildPath",!0),buildCommand:se,buildEntryPoint:await e.getOption("buildEntryPoint",!0)});L.buildType==="none"&&se?.trim()&&Re("--build-command is ignored when --build-type none is selected.");let v=e.isJsonMode();if(!v){let o=fe(u),l=o?`cloud ${o}`:`region ${u}`;O(`About to create app '${p}' in tenant ${n} (${l}).`)}let pe=!v&&process.stdout.isTTY;!v&&!pe&&O("Running preflight checks...");let T=pe?new Pe:null;T?.start("Running preflight checks...");try{if(i==="none"&&H)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(H&&oe)throw new d("A managed project is incompatible with '--repository-id'. Use a managed project or a standalone platform-managed repository, not both.");L.buildType!=="none"&&(T?.update("Validating template source..."),vt(h)),(i!=="none"||L.buildType!=="none")&&(T?.update("Checking git installation..."),ke()),i==="native"&&(T?.update("Checking Git Credential Manager..."),De()),T?.update("Verifying target directory is writable..."),Rt(s),i==="github"&&!R?(T?.update("Verifying target directory is empty..."),nt(s),T?.update(`Verifying ${y} is empty...`),St(y)):(T?.update("Verifying target directory is empty..."),tt(s,J))}finally{T?.stop()}let F=await $e(e,{failIfMissing:!1});if(f&&F&&F.toLowerCase()!==f.environmentId.toLowerCase())throw new d(`Environment '${F}' does not match the current managed project's environment '${f.environmentId}'.`);let W=f?.environmentId??F,ce=Ae("MAAF_DOGFOOD");if(ce&&W)throw new d("MS_CLI_MAAF_DOGFOOD cannot be used with an explicit or configured environment ID.");let at=W?void 0:Ve(e,n,t,"CreateCmrApp",{dogfood:ce}),st=await e.getOption("description",!0),q=await Be(W,at);e.updateEnvironmentId(q),i==="github"&&!R?nt(s):ae=tt(s,J);let pt=await e.getOption(r.OpenBrowser.camelName,!0)??!1,ct=await e.getOption(r.ForceReauth.camelName,!0)??!1,G=oe;if(i==="native"&&!G&&_("alm")){let o=await be({displayName:p});f=Ye(o,e.getCloud()),G=f.projectId}v&&i==="github"&&Q({phase:"create-validation"});let dt={displayName:p,description:st,repositoryId:H,remoteUrl:y,repoType:i,origin:a.origin,...G&&{projectId:G}},lt=({isRetry:o})=>Ce({tenantId:n,environmentId:q,logger:t,actionsParams:{...dt,...ct&&!o&&{forceReauth:!0}}}),de;try{de=await Ue(lt,{repoType:i,externalRepoUrl:y,tenantId:n,jsonMode:v,openBrowser:pt,verb:"app create"})}catch(o){let l=Me(o,{repoType:i,environmentId:q});throw l||o}let{app:w,cloneUrl:N}=de;if(v&&M!==void 0&&i!=="none"&&await new Promise((o,l)=>{process.stderr.write(`${JSON.stringify({phase:"app-created",appId:w.id})}
|
|
8
|
+
`,I=>{if(I){l(I);return}o()})}),i==="native"&&!R&&!N){let o=ne(w.id,w.environmentId);throw new D(`App '${w.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.
|
|
9
|
+
`+o)}v||O(`App '${w.displayName}' (${w.id}) was created on the server. Setting up local files.`);let k=null;try{let o=()=>j?ie(j,s):s,l=o();if(i==="github"&&!R){if(Et({directory:l,repoUrl:y}),g.readdirSync(l).filter(ut=>ut!==".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.
|
|
10
|
+
|
|
11
|
+
`+ne(w.id,w.environmentId))}else i==="native"&&!R?ee({directory:l,gitUrl:N,loginAuthority:e.getLoginAuthority(n),authResource:e.getAuthResourceUrl()}):g.mkdirSync(l,{recursive:!0});L.buildType!=="none"&&(l=o(),v||O(`Fetching template '${h}' into ${l}...`),et(h,{dir:l}),l=o(),await Ke(l,v,e.getHttpClient()));let I={appDisplayName:w.displayName,description:w.description,...L};if(l=o(),M!==void 0)await ye(m.join(l,ge),ze({...I,projectLocalAppId:M}));else{let le=We({...I,appId:w.id,environmentId:w.environmentId,repoType:i,cloud:e.getCloud(),repositoryId:i==="native"?w.repositoryId:void 0,externalRepoUrl:i==="github"?y:void 0});await he(m.join(l,ue),le)}i!=="none"&&(l=o(),k=await wt(l,v,i==="native"&&!R?N:void 0,i==="native"&&!R?Z().sessionId:void 0,i==="native",ae))}catch(o){if(o instanceof d&&i!=="native")throw o;let l=o instanceof Error?o.message:String(o),I=`App '${w.displayName}' was created, but local setup failed: ${l}
|
|
12
|
+
The local directory ${s} may contain partial files; remove them or choose a new directory before retrying.
|
|
13
|
+
`+ne(w.id,w.environmentId);throw o instanceof D?(o.message=I,o):new D(I)}if(k&&!k.success)throw bt({appDisplayName:w.displayName,appId:w.id,appDir:s,jsonMode:v,gitRemoteUrl:i==="native"&&!R?N:void 0,externalRepoUrl:i==="github"?y:void 0,pushOutcome:k});if(v){let o={appId:w.id,repoType:i,...i==="github"&&y&&{externalRepoUrl:y},...i==="native"&&!R&&N&&{gitRemoteUrl:N},appDir:s,...k&&{push:k}};K()?Q({success:!0,...o}):Se(o)}else{let o=s==="."?"the current folder":s;ve(`Created app '${w.displayName}' in ${o}.`),i==="github"?O(`Bound to external repository: ${y}.`):i==="none"&&O("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 wt(e,n,t,a,u=t!==void 0,p=[]){let b=p.map(A=>`:(exclude)${A}`),h=["-c","core.autocrlf=false"],c="git -c core.autocrlf=false",i=[...h,"add","--",".",...b],y=[`${c} add -- .`,...b.map(A=>`"${A}"`)].join(" ").trim(),x=`${c} commit -m "${re}" -- .`,f="git push -u origin HEAD",C=t&&a?[`x-ms-client-session-id: ${a}`]:void 0,s="add";try{return S(i,{cwd:e}),s="commit",S([...h,"commit","-m",re,"--","."],{cwd:e}),t&&(s="fetch",je(t,n,"the initial git fetch and push"),Ne(e,t,void 0,C),s="reconcile",Ct(e)),s="push",S([...u?["-c","http.sslVersion=tlsv1.3"]:[],"push","-u","origin","HEAD"],{cwd:e,network:!0,classify:t?{action:`pushing to ${Oe(t)}`}:void 0,httpExtraHeaders:C}),{success:!0}}catch(A){X().trackErrorEvent("CmrApp.Create.ScaffoldPushFailed",{error:A instanceof Error?A.stack??`${A.name}: ${A.message}`:String(A)});let B={code:"GitOperationFailed",message:`The initial Git synchronization failed during '${s}'. Review the Git output and retry.`},M=t?void 0:[...s==="add"?[y]:[],...s==="add"||s==="commit"?[x]:[],f].join(" && ");return{success:!1,failedStage:s,error:B,retryCommand:M,cause:A}}}function bt(e){let{appDisplayName:n,appId:t,appDir:a,jsonMode:u,gitRemoteUrl:p,externalRepoUrl:b,pushOutcome:h}=e,c=h.cause instanceof D?h.cause:void 0,i=h.error?.message??"Review the Git output and retry.",y=u?i:c?.message??i,x=h.retryCommand?`To finish wiring it up, run:
|
|
14
|
+
${h.retryCommand}`:`Resolve the git issue above, then finish the initial push from ${a}.`,f=`App '${n}' was provisioned and the local scaffold was created, but the initial repository synchronization failed.
|
|
15
|
+
Failed stage: ${h.failedStage}.
|
|
16
|
+
${y}
|
|
17
|
+
${x}`,C={appId:t,projectPath:a,...p&&{gitRemoteUrl:p},...b&&{externalRepoUrl:b},appCreated:!0,scaffoldCreated:!0,initialPushSucceeded:!1,recoveryRequired:"git-initial-push",failedStage:h.failedStage,...h.retryCommand&&{retryCommand:h.retryCommand}};return c instanceof z?new z(f,c.errorData,{errorCode:c.errorCode,exitCode:c.exitCode,retryable:c.retryable,outputDetails:C}):c instanceof Y?new Y(f,c.errorData,{errorCode:c.errorCode,exitCode:c.exitCode,retryable:c.retryable,outputDetails:C}):new D(f,c?.exitCode,c?.errorData,{errorCode:c?.errorCode??"GitOperationFailed",errorCategory:c?.errorCategory,exitCode:c?.exitCode,retryable:c?.retryable,outputDetails:C})}function Ct(e){S(["rev-parse","--verify","origin/main"],{cwd:e,allowFailure:!0,emitStderr:!1}).success&&(S(["reset","--soft","origin/main"],{cwd:e}),S(["commit","-m",re],{cwd:e}))}function At(e){return`Cannot access repository '${e}', so no app was created. `+_e()}function Et(e){He(e)}function ne(e,n){return`The server app is still in environment ${n} (id: ${e}).
|
|
18
|
+
If you want to clean it up before retrying, run the following command:
|
|
19
|
+
${"ms"} app delete --app ${e} --environment-id ${n} --force`}function vt(e){te(e)}function tt(e,n=!1){if(!g.existsSync(e))return[];let t=n?ht:new Set,a=g.readdirSync(e),u=a.filter(b=>gt.has(b.toLowerCase()));if(a.filter(b=>!t.has(b)&&!u.includes(b)).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 u}function nt(e){if(!g.existsSync(e))return;if(g.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 St(e){let n;try{n=g.mkdtempSync(m.join(rt.tmpdir(),"ms-app-create-probe-"))}catch{return}try{let t=S(["clone","--depth=1","--filter=blob:none","--no-checkout",e,n],{allowFailure:!0,emitStderr:!1});if(!t.success){let p=t.stderr;if(Ge(p))throw new P(At(e),{underlyingError:Fe(t.error,p)});return}let a=S(["-C",n,"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{g.rmSync(n,{recursive:!0,force:!0})}catch{}}}function Rt(e){let n=e;for(;!g.existsSync(n);){let t=m.dirname(n);if(t===n)break;n=t}try{g.accessSync(n,g.constants.W_OK)}catch{throw new P(`'${e}' is not writable. Choose a different directory or fix the permissions and retry.`)}}function ie(e,n){let t=it(e),a=it(n),u=m.relative(t,a);if(u===".."||u.startsWith(`..${m.sep}`)||m.isAbsolute(u))throw new d(`The app directory '${m.resolve(n)}' must be inside the managed project at '${m.resolve(e)}'.`);return a}function it(e){let t=m.resolve(e),a=[];for(;!It(t);){let p=m.dirname(t);if(p===t)break;a.unshift(m.basename(t)),t=p}let u=g.realpathSync.native(t);return m.resolve(u,...a)}function It(e){try{return g.lstatSync(e),!0}catch(n){if(n.code==="ENOENT")return!1;throw n}}function $t(e){e.setDescription(E.app.create.description),e.addExamples(E.app.create.examples),e.consumePositionalArg("[directory]"),e.addOptions([{flags:{key:r.EnvironmentId.name,alias:r.EnvironmentId.alias},env:r.EnvironmentId.envVar,description:E.app.create.options.environmentId,optionalInNonInteractive:!0},U({flags:{key:r.DisplayName.name,alias:r.DisplayName.alias},env:r.DisplayName.envVar,message:r.DisplayName.promptMessage,description:E.app.create.options.displayName}),{flags:{key:r.ProjectLocalAppId.name},description:E.app.create.options.projectLocalAppId,optionalInNonInteractive:!0,hidden:!_("ga")},{flags:{key:r.Description.name,alias:r.Description.alias},env:r.Description.envVar,description:E.app.create.options.description,optionalInNonInteractive:!0},{flags:{key:r.RepositoryId.name,alias:r.RepositoryId.alias},env:r.RepositoryId.envVar,description:E.app.create.options.repositoryId,optionalInNonInteractive:!0},{flags:{key:r.Template.name,alias:r.Template.alias},env:r.Template.envVar,default:mt,description:E.app.create.options.template,optionalInNonInteractive:!0},{flags:{key:r.Repo.name},env:r.Repo.envVar,description:E.app.create.options.repo,optionalInNonInteractive:!0},{flags:{key:r.BuildType.name},env:r.BuildType.envVar,description:E.app.create.options.buildType,optionalInNonInteractive:!0,hidden:!0},U({flags:{key:r.BuildPath.name,alias:r.BuildPath.alias},env:r.BuildPath.envVar,message:r.BuildPath.promptMessage,initialValue:r.BuildPath.initialValue,description:E.app.create.options.buildPath}),U({flags:{key:r.BuildCommand.name,alias:r.BuildCommand.alias},env:r.BuildCommand.envVar,message:r.BuildCommand.promptMessage,initialValue:r.BuildCommand.initialValue,description:E.app.create.options.buildCommand}),U({flags:{key:r.BuildEntryPoint.name},env:r.BuildEntryPoint.envVar,message:r.BuildEntryPoint.promptMessage,initialValue:r.BuildEntryPoint.initialValue,default:"index.html",description:E.app.create.options.buildEntryPoint})]),e.addSwitch({flags:{key:r.OpenBrowser.name},description:E.app.create.options.openBrowser}),e.addSwitch({flags:{key:r.ForceReauth.name},description:E.app.create.options.forceReauth})}export{ne as buildOrphanedAppRecoveryHint,ie as canonicalizeAndValidateManagedProjectAppDirectory,Et as cloneRepo,wt as commitAndPushScaffoldAsync,an as createMaafAppAsync,St as ensureExternalRepoIsEmpty,nt as ensureRepoTargetDirectoryEmpty,tt as ensureTargetDirectoryEmpty,Rt as ensureTargetDirectoryWritable,vt as ensureTemplateSourceValid,ee as initLocalRepo};
|
|
20
|
+
/*!
|
|
21
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
22
|
+
*/
|
|
23
|
+
//# sourceMappingURL=CreateMaafApp-VNXWCAP4.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __pathDirname } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{a as se}from"./chunk-B4NTYKGH.js";import{d as oe}from"./chunk-OH3TCDCC.js";import{b as Z}from"./chunk-HZGDQAKA.js";import{b as ie,c as $,d as v}from"./chunk-7LAMG4KK.js";import{b as z}from"./chunk-XJXWNOJR.js";import{a as K}from"./chunk-OL6CTXQR.js";import{a as Q,d as ne,e as ae}from"./chunk-BAQPANON.js";import{a as te,b as re}from"./chunk-KD4NQIYX.js";import"./chunk-4PI5THLA.js";import{a as ee}from"./chunk-3YCPXSCO.js";import"./chunk-CLY3OASM.js";import"./chunk-OHQNTYJG.js";import{a as q}from"./chunk-6KOL66SF.js";import"./chunk-TYRVM4PP.js";import{d as w,i as X,j as Y}from"./chunk-R2IECDVU.js";import{i as J,m as V}from"./chunk-ZLK2CMMJ.js";import"./chunk-A5INC5TY.js";import{A as R,Ob as H,Qb as B,ka as P,l as D,na as S,oa as T,w as U,x as O,y as d}from"./chunk-RSHOMYG6.js";import{L as c}from"./chunk-WS6TGUH7.js";import{n as W}from"./chunk-UHNOINTO.js";import"./chunk-YEWRCEPT.js";import"./chunk-DLUQVMUE.js";import"./chunk-C7UWPNC3.js";import{a as u}from"./chunk-AICYZHWK.js";import{D as k,E as L,H as G,I as _,J as N,N as F,r as p}from"./chunk-PYPCPMCR.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";import*as s from"fs";import*as j from"path";var ge="Initial scaffold from 'ms project create'";function ye(e){e.setDescription(u.project.create.description),e.addExamples(u.project.create.examples),e.consumePositionalArg("[directory]"),e.addOptions([J({flags:{key:c.DisplayName.name,alias:c.DisplayName.alias},message:c.DisplayName.promptMessage,description:u.project.create.options.displayName}),{flags:{key:c.EnvironmentId.name,alias:c.EnvironmentId.alias},env:c.EnvironmentId.envVar,description:u.project.create.options.environmentId,optionalInNonInteractive:!0},{flags:{key:c.Repo.name},description:u.project.create.options.repo,optionalInNonInteractive:!0}]),e.addSwitch({flags:{key:c.OpenBrowser.name},description:u.project.create.options.openBrowser}),e.addSwitch({flags:{key:c.ForceReauth.name},description:u.project.create.options.forceReauth})}async function ze(e){k();try{await Ie(e)}catch(r){if(r instanceof B)throw r;let i=r instanceof D&&r.status===409&&r.code==="ProjectAlreadyExistsForRepository"?Ce(r,e):r;throw L()&&Z(i),i}}var he=64*1024,we=1e3;function je(e){let r=e.getEnvironmentId(),i=e.getCloud();return["ms project info --project <project id>",...r?[`--environment-id ${r}`]:[],...i&&i!=="public"?[`--cloud ${i}`]:[]].join(" ")}function Ce(e,r){let i=e.body&&e.body.length<=he?se(Q(e))?.slice(0,we):void 0;return new O("This repository is already linked to a project in this environment. "+(i?`Run \`${je(r)}\` for more details, or contact the project owner or your environment administrator.`:"Contact the project owner or your environment administrator for help accessing the existing project."),void 0,void 0,{errorCode:"ProjectAlreadyExistsForRepository",errorCategory:U.User,retryable:!1,telemetryDetails:{httpStatus:409},...i&&{outputDetails:{serverMessage:i}}})}async function Ie(e){ye(e),await e.runVerb();let r=(await e.getOption("displayName"))?.trim();if(!r)throw new d("Argument displayName is required. Use --display-name or -n to specify it.");if(r.length>S)throw new d(`Argument displayName must not exceed ${S} characters.`);let i=e.getPositionalArg(0);if(i===void 0&&!z(r))throw new d("The display name cannot be used as a directory name. Specify a target directory as the first argument.");let a=i??r,C=W("ga"),ce=await e.getOption(c.Repo.name,!0),{repoType:l,remoteUrl:I}=ae(ce);if(l==="none")throw new d("'--repo none' is not supported for managed projects. Omit '--repo' for a platform-managed repository or pass an external GitHub repository URL.");q(),M(a);let b=await e.getTenantIdAsync();if(!b)throw new d("Unable to determine tenant ID. Ensure you are logged in.");let h=e.isJsonMode(),pe=await e.getOption(c.OpenBrowser.camelName,!0)??!1,le=await e.getOption(c.ForceReauth.camelName,!0)??!1,y=!h&&process.stdout.isTTY?new K:null,m=h?void 0:f=>{y?y.update(f):F(f)},de=f=>{y?y.start(f):m?.(f)};try{de("Resolving environment...");let f=await V(e,{failIfMissing:!1}),me=f?void 0:te(e,b,H(),"CreateCmrAppProject"),fe=await re(f,me);e.updateEnvironmentId(fe),m?.("Creating managed project..."),h&&l==="github"&&N({phase:"project-create-validation"});let t=await ee(({isRetry:o})=>T({displayName:r,...l==="github"&&{externalRepo:{provider:"GitHubEnterprise",remoteUrl:I}},...l==="github"&&le&&!o&&{forceReauth:!0}}),{repoType:l,externalRepoUrl:I,tenantId:b,jsonMode:h,openBrowser:pe,verb:"project create"}),x=t.repositoryId?.trim();if(!x)throw new R(`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 n;if(l==="github"){let o=t.cloneUrl?.trim()||I;try{n=ne(o,"The service clone URL")}catch(ue){throw g(t,I,"repository-metadata",`Managed project '${t.displayName}' (${t.projectId}) was created, but the service returned an invalid external repository clone URL.`,ue)}}else n=P(x);let E=ie(t,e.getCloud(),l==="github"?n:void 0),A;if(l==="github"){try{m?.("Cloning external project repository..."),M(a),oe({directory:a,repoUrl:n})}catch(o){throw g(t,n,"git-clone",`Managed project '${t.displayName}' (${t.projectId}) was created, but the external repository could not be cloned. Clone ${n} manually before creating ${p}.`,o)}try{m?.("Writing project configuration...");let o=j.join(a,p);if(s.existsSync(o))throw new d(`Repository '${n}' already contains ${p}. Use the existing managed project configuration instead of creating another project.`);A=C?$(t,e.getCloud()):E,v(o,A)}catch(o){throw g(t,n,"local-files",`Managed project '${t.displayName}' (${t.projectId}) was created and the external repository was cloned, but ${p} could not be created.`,o)}}else{try{m?.("Writing project configuration..."),M(a),s.mkdirSync(a,{recursive:!0}),A=C?$(t,e.getCloud()):E;let o=j.join(a,p);v(o,A)}catch(o){throw g(t,n,"local-files",`Managed project '${t.displayName}' (${t.projectId}) was created, but its local files could not be prepared. Use ${n} to set up the local working tree manually.`,o)}try{m?.("Initializing project repository..."),X({directory:a,gitUrl:n,loginAuthority:e.getLoginAuthority(b),authResource:e.getAuthResourceUrl(),emitRemoteError:!1}),Y(a,n,"main",void 0,!1),w(["checkout","-B","main","origin/main"],{cwd:a,emitStderr:!1})}catch(o){throw g(t,n,"git-setup",`Managed project '${t.displayName}' and ${p} were created, but local Git setup failed. Use ${n} to set up the local working tree manually.`,o)}}try{m?.("Committing project configuration..."),w(["add","--",p],{cwd:a,emitStderr:!1}),w(["commit","-m",ge,"--",p],{cwd:a,emitStderr:!1})}catch(o){throw g(t,n,"git-commit",`Managed project '${t.displayName}', ${p}, and the local repository were created, but the local commit was not completed. Complete git add and git commit manually.`,o)}try{m?.("Pushing project repository..."),w(["-c","http.sslVersion=tlsv1.3","push","-u","origin",l==="github"?"HEAD":"main"],{cwd:a,network:!0,...l==="native"&&{classify:{action:"pushing the managed project repository"}},emitStderr:!1})}catch(o){throw g(t,n,"git-push",`Managed project '${t.displayName}', ${p}, the local repository, and the local commit were created, but git push failed. Retry git push.`,o)}y?.stop(),h?l==="github"?N({success:!0,...E}):_(E):G(`Created project '${t.displayName}'.`)}finally{y?.stop()}}function M(e){if(s.existsSync(e)){if(!s.statSync(e).isDirectory())throw new d(`'${e}' exists and is not a directory.`);if(s.readdirSync(e).length>0)throw new d(`'${e}' is not empty. Specify an empty directory.`)}let r=e;for(;!s.existsSync(r);){let i=j.dirname(r);if(i===r)break;r=i}try{s.accessSync(r,s.constants.W_OK)}catch{throw new R(`'${e}' is not writable. Choose a different directory or fix its permissions.`)}}function be(e){return e instanceof Error?e.message:String(e)}function g(e,r,i,a,C){return new R(a,{partialSuccess:!0,projectId:e.projectId,cloneUrl:r,phase:i,underlyingError:be(C)})}export{p as ProjectConfigFileName,ze as createMaafProjectAsync,M as ensureProjectTargetDirectory};
|
|
8
|
+
/*!
|
|
9
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
+
*/
|
|
11
|
+
//# sourceMappingURL=CreateMaafProject-WVBNZPVL.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __pathDirname } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{b as v,l as u}from"./chunk-ZLK2CMMJ.js";import"./chunk-A5INC5TY.js";import{Ia as m,Ob as l,Pb as f,y as d}from"./chunk-RSHOMYG6.js";import{B as r}from"./chunk-WS6TGUH7.js";import"./chunk-DLUQVMUE.js";import"./chunk-C7UWPNC3.js";import{a as o}from"./chunk-AICYZHWK.js";import{H as p,I as c,P as i}from"./chunk-PYPCPMCR.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 d("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 m({tenantId:s,environmentId:a,logger:l(),actionsParams:{appName:t}});if(e.isJsonMode()){c({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-UGUKARMO.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
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-Y2D37EFX.js";import"./chunk-ZBQT5XZJ.js";import"./chunk-Z4UX3JOS.js";import"./chunk-XC7Y6E2C.js";import"./chunk-HBLO3WDD.js";import"./chunk-ZWJ5T5VI.js";import"./chunk-2SRFM7D6.js";import"./chunk-NNYOT7IR.js";import"./chunk-OL6CTXQR.js";import"./chunk-4PI5THLA.js";import"./chunk-3YCPXSCO.js";import"./chunk-CLY3OASM.js";import"./chunk-OHQNTYJG.js";import"./chunk-TYRVM4PP.js";import"./chunk-R2IECDVU.js";import"./chunk-ZLK2CMMJ.js";import"./chunk-A5INC5TY.js";import"./chunk-RSHOMYG6.js";import"./chunk-WS6TGUH7.js";import"./chunk-UHNOINTO.js";import"./chunk-YEWRCEPT.js";import"./chunk-DLUQVMUE.js";import"./chunk-C7UWPNC3.js";import"./chunk-AICYZHWK.js";import"./chunk-PYPCPMCR.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";export{a as deployMaafAppAsync,b as executeDeployAsync};
|
|
8
|
+
//# sourceMappingURL=DeployMaafApp-GJO567TK.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __pathDirname } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{b as T}from"./chunk-Y2D37EFX.js";import"./chunk-ZBQT5XZJ.js";import"./chunk-Z4UX3JOS.js";import"./chunk-XC7Y6E2C.js";import"./chunk-HBLO3WDD.js";import"./chunk-ZWJ5T5VI.js";import"./chunk-2SRFM7D6.js";import"./chunk-NNYOT7IR.js";import{a as l}from"./chunk-7LAMG4KK.js";import"./chunk-OL6CTXQR.js";import{a as U,b as x}from"./chunk-KD4NQIYX.js";import"./chunk-4PI5THLA.js";import"./chunk-3YCPXSCO.js";import"./chunk-CLY3OASM.js";import"./chunk-OHQNTYJG.js";import"./chunk-TYRVM4PP.js";import"./chunk-R2IECDVU.js";import"./chunk-ZLK2CMMJ.js";import{a as P}from"./chunk-A5INC5TY.js";import{A as C,Na as v,Ob as d,Pb as E,gb as h,ra as A,y as r}from"./chunk-RSHOMYG6.js";import{z as g}from"./chunk-WS6TGUH7.js";import"./chunk-UHNOINTO.js";import"./chunk-YEWRCEPT.js";import"./chunk-DLUQVMUE.js";import"./chunk-C7UWPNC3.js";import"./chunk-AICYZHWK.js";import"./chunk-PYPCPMCR.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function J(e){await T(e,!0,N)}async function N(e){let n=E(),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 C(`Unable to read ${n.fileConfig.projectConfigPath}. ${n.projectConfigError.message}`);let L=o(n.appConfig?.projectId),D=o(n.projectConfig?.projectId),p=i??L??D,m=i||!n.appConfig?void 0:o(await P());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 v({tenantId:s,environmentId:c??o(n.appConfig?.environmentId),logger:d(),actionsParams:{appName:m}}),u=o(t.projectId);if(u){let w=t.repoType?l(t.repoType):n.appConfig?.repoType??"native";if(w==="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,projectId:u,repoType:w,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),R=j?void 0:U(e,s,d(),"DeployCmrAppProject"),b=await x(j,R);e.updateEnvironmentId(b);let a=await h({projectId:p,logger:d()});e.updateEnvironmentId(a.environmentId);let M=await A(a.projectId),f=$(M),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,projectId:a.projectId,repoType:y,externalRepoUrl:o(f.cloneUrl)??o(I?.externalRepoUrl),interactive:n.interactive}}function $(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{J as deployMaafProjectAsync};
|
|
8
|
+
/*!
|
|
9
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
+
*/
|
|
11
|
+
//# sourceMappingURL=DeployMaafProject-4TSW2SFJ.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __pathDirname } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{c as y}from"./chunk-HHW4SKVU.js";import"./chunk-BMOTNINY.js";import"./chunk-ZLK2CMMJ.js";import"./chunk-A5INC5TY.js";import{Ob as f,bb as I,mb as g,nb as u}from"./chunk-RSHOMYG6.js";import{Q as o}from"./chunk-WS6TGUH7.js";import"./chunk-GO22IDEN.js";import"./chunk-UHNOINTO.js";import"./chunk-YEWRCEPT.js";import"./chunk-DLUQVMUE.js";import"./chunk-C7UWPNC3.js";import{a as p}from"./chunk-AICYZHWK.js";import{H as m,I as l}from"./chunk-PYPCPMCR.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-SZKNJT76.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
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 U,e as $,f as x,g as M,h as T,j as q,l as G}from"./chunk-XC7Y6E2C.js";import"./chunk-HBLO3WDD.js";import"./chunk-ZWJ5T5VI.js";import{A as P,D as O,Pb as j,p as V}from"./chunk-RSHOMYG6.js";import{m as p}from"./chunk-WS6TGUH7.js";import{n as B}from"./chunk-UHNOINTO.js";import"./chunk-YEWRCEPT.js";import{a as L}from"./chunk-DLUQVMUE.js";import{g as J,k as H}from"./chunk-C7UWPNC3.js";import{a as v}from"./chunk-AICYZHWK.js";import{N as y,P as h,Q as R,a as w,g as _}from"./chunk-PYPCPMCR.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 k}from"node:util";import*as D from"fs";import*as ot from"http";import*as z from"node:net";var A=65535;async function st(t){return!Number.isInteger(t)||t<1||t>A?!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 N(t,n=100){if(!Number.isInteger(t)||t<1||t>A)throw new Error(`Invalid port "${t}". Pass a valid --port between 1 and ${A} and try again.`);for(let e=0;e<n;e++){let r=t+e;if(r>A)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,A)}. 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","copilotManagedRuntime"];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)){let m=t.isJsonMode()?b=>process.stderr.write(`${b}
|
|
8
|
+
`):y;await G({projectRoot:o,cliVersion:L.version,env:H(await q(o)),onDetail:m})||m("[rayfin] No Rayfin backend will be provisioned for this dev session. Add Rayfin content, such as an entity, then rerun `ms app dev`.")}if(J("FEATURE_RAYFIN",l?"true":"false"),d){await tt(o)&&h("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 P('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 N(a),S=[],g=s;f!==a&&(g=Q(s,f),S=["--port",String(f),"--strictPort"],h(`Warning: port ${a} is already in use. Starting the app dev server on port ${f} instead.`)),await Promise.all([et(o,i.signal,u,S,{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 P(`${w} is required to run an app`);if(!e.environmentId)throw new P(`Environment ID is required in ${w} to run an app`);e.cloud||(e.cloud="public");let d=await t.getOption("port"),i=parseInt(d,10),l=await N(i);l!==i&&h(`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(!D.existsSync(t)){a.writeHead(404,{"Content-Type":"application/json"}),a.end(JSON.stringify({error:`${w} not found`}));return}let f=D.readFileSync(t,"utf8");a.writeHead(200,{"Content-Type":"application/json"}),a.end(f)}catch(f){R(`Error serving ${w}: ${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}`});y(`
|
|
9
|
+
Ready. You can play your app locally at:
|
|
10
|
+
${k(["blueBright","bold"],` \u279C ${a}`)}`)}}),l.on("error",s=>{R(`Server error: ${s.message}`),i(s)});let u=()=>{y(k("dim",`
|
|
11
|
+
Shutting down config server...`)),l.closeAllConnections(),l.close(()=>{y(k("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){y(k("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&&h(`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 yt(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 S=r.length>0?` -- ${r.join(" ")}`:"",g=lt(`${d} run dev${S}`,{cwd:t,stdio:wt(i),shell:!0}),m=$(),I=$();i&&(g.stdout?.on("data",c=>{x(m,c,U),(l?s:u)(c)}),g.stderr?.on("data",c=>{x(I,c,U),s(c)})),g.on("close",(c,F)=>{if(yt(c,F,n.aborted))a();else{let C=i?T(M(I),t):"",E=i?T(M(m),t):"",rt={commandExitCode:c,diagnosticCapture:i?"captured":"unavailable_interactive",...C&&{stderrTail:C},...E&&{stdoutTail:E}},it={commandExitCode:c,diagnosticCapture:i?"captured":"unavailable_interactive"},at=i?{...C&&{stderrTail:C},...E&&{stdoutTail:E}}:void 0;f(new O(`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 O("Could not start the app dev server.",1,F,{errorCode:"DevServerStartFailed",telemetryDetails:{diagnosticCapture:"unavailable_start_failure"}}))});let b=()=>{g.kill("SIGINT")};n.aborted?b():n.addEventListener("abort",b,{once:!0})})}function wt(t){return t?["ignore","pipe","pipe"]:"inherit"}export{Jt as devAsync,wt as getDevServerStdio,yt as isIntentionalDevExit,tt as isUsingVitePlugin,et as runDevScriptAsync};
|
|
12
|
+
/*!
|
|
13
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
14
|
+
*/
|
|
15
|
+
//# sourceMappingURL=Dev-ZD3L6WYY.js.map
|
|
@@ -4,8 +4,8 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __pathDirname(__filename);
|
|
7
|
-
import{b as e}from"./chunk-
|
|
7
|
+
import{b as e}from"./chunk-C7UWPNC3.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";var n=class{async initAsync(r){}async getAccessTokenForResource(r,s){return e("HTTP_FORWARD_AUTH_TOKEN")??""}getUserTenantId(){return e("HTTP_FORWARD_TENANT_ID")}async getCachedAccountAsync(){}};export{n as EnvironmentVariableAuthenticationProvider};
|
|
8
8
|
/*!
|
|
9
9
|
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
10
|
*/
|
|
11
|
-
//# sourceMappingURL=EnvironmentVariableAuthenticationProvider-
|
|
11
|
+
//# sourceMappingURL=EnvironmentVariableAuthenticationProvider-EURTERVX.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __pathDirname } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{A,Ob as h,y as w}from"./chunk-RSHOMYG6.js";import{N as b}from"./chunk-WS6TGUH7.js";import{a as I,c as s,d as l,e as d,f as _,g as J,h as c,i as f,l as v,m as P}from"./chunk-UHNOINTO.js";import{a as R,b as x,c as j,d as T,e as O,f as D}from"./chunk-YEWRCEPT.js";import"./chunk-DLUQVMUE.js";import{c as U,d as k}from"./chunk-C7UWPNC3.js";import{a as g}from"./chunk-AICYZHWK.js";import{F as N,G as L,H as m,I as p,K as V,N as u,P as S}from"./chunk-PYPCPMCR.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";var M={environment:"environment variable",userSettings:"user settings",tenant:"tenant default",workspace:"used by this app or project",default:"default"},H={environment:"Environment variable",userSettings:"Your settings",tenant:"Tenant default",workspace:"This app or project",default:"Default"},Q={development:"Development",experimental:"Experimental",preview:"Preview"};async function ge(e){e.setDescription(g.feature.list.description),e.addExamples(g.feature.list.examples),await e.runVerb();let t=C(),n=P(f(t));if(e.isJsonMode()){V(n);return}N({title:"CLI features",columns:[{header:"Name"},{header:"Feature"},{header:"Stage"},{header:"Status"},{header:"Set by"},{header:"Description"}],rows:n.map(r=>[r.name,I[r.name].displayName,Q[r.stage],r.enabled?"Enabled":"Disabled",H[r.source],r.description]),emptyMessage:"This version of the CLI has no experimental or preview features."}),n.length>0&&(u(""),u("Experimental and development features can change or be removed without notice."),u(`To turn a feature on or off, run: ${"ms"} feature enable|disable --name <name>`));for(let r of ne(t))S(r)}async function me(e){y(e,"status"),await e.runVerb();let t=Y(await E(e)),n=C(),r=v(t,f(n));if(e.isJsonMode()){p({feature:r});return}L({title:`CLI feature '${r.name}'`,items:[r],fields:[{label:"Stage",value:i=>i.stage},{label:"Description",value:i=>i.description},{label:"State",value:i=>$(i.enabled)},{label:"Source",value:i=>M[i.source]},{label:"Environment variable",value:Z},{label:"User setting",value:i=>ee(i,n)},{label:"Tenant default",value:te},{label:"Used by this app or project",value:i=>i.usedInWorkspace?"yes":"no"}]})}async function pe(e){await B(e,"enable","enabled")}async function Se(e){await B(e,"disable","disabled")}async function ve(e){y(e,"reset"),await e.runVerb();let t=await E(e),n=C(),r=G(c(n),t);if(!r&&!d(t))throw K(t);r&&(n=W(a=>X(a,t)));let i=d(t)?v(t,f(n)):void 0;if(e.isJsonMode()){p({name:t,removed:r,...i&&{feature:i}});return}if(!r){u(`Feature '${t}' has no saved setting; nothing to reset.`);return}if(!i){m(`Removed the saved setting for unknown feature '${t}'.`);return}m(`Removed the saved setting for feature '${t}'. It is now ${$(i.enabled)} (${M[i.source]}).`)}async function B(e,t,n){y(e,t),await e.runVerb();let r=Y(await E(e)),i=W(o=>({...o,[s]:{...q(c(o),r),[r]:n}})),a=v(r,f(i));if(h().trackActivityEvent("Feature.SettingSaved",{featureName:r,setting:n,stage:a.stage}),e.isJsonMode()){p({feature:a});return}m(`Feature '${r}' is now ${n} for future runs.`),a.source==="environment"?S(`${a.envVar}=${a.envValue} is set and takes precedence over saved settings, so '${r}' stays ${$(a.enabled)} while it is set.`):a.source==="workspace"&&S(`This app or project already uses '${r}', so it stays enabled here.`)}function y(e,t){let n=g.feature[t];e.setDescription(n.description),e.addExamples(n.examples),e.addOptions([{flags:{key:b.Name.name},description:n.options.name}])}async function E(e){let t=await e.getOption(b.Name.name,!0),n=typeof t=="string"?l(t):"";if(!n)throw new w(`Provide a feature name via --${b.Name.name}. Run '${"ms"} feature list' to see available features.`);return n}function Y(e){if(!d(e))throw K(e);return e}function K(e){let t=_().join(", ")||"none";return new w(`Unknown feature '${e}'. Available features: ${t}. Run '${"ms"} feature list' for details.`)}function C(){try{return T()}catch(e){throw z("read",e)}}function W(e){try{return D(e)}catch(t){throw z("update",t)}}function z(e,t){return h().trackErrorEvent("Feature.SettingsFileFailed",{operation:e,...O(t)}),x(),new A(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 G(e,t){return Object.keys(e).some(n=>l(n)===t)}function q(e,t){return Object.fromEntries(Object.entries(e).filter(([n])=>l(n)!==t))}function X(e,t){let n={...e},r=q(c(e),t);return Object.keys(r).length>0?n[s]=r:delete n[s],n}function $(e){return e?"enabled":"disabled"}function Z(e){if(e.envValue===void 0)return`${e.envVar} (not set)`;let t=`${e.envVar}=${e.envValue}`;return U(e.envValue)||k(e.envValue)?t:`${t} (ignored: not a recognized true/false value)`}function ee(e,t){return e.userSetting?e.userSetting:G(c(t),e.name)?'ignored (expected "enabled" or "disabled")':"not set"}function te(e){return e.tenantId===void 0?"not signed in":`${e.tenantDefault??"not set"} (tenant ${e.tenantId})`}function ne(e){let t=e?.[s];if(t===void 0)return[];let n=R();if(!j(t))return[`Ignoring '${s}' in ${n}: expected a JSON object.`];let r=[];for(let[i,a]of Object.entries(t)){let o=l(i);d(o)?J(a)||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{Se as featureDisableAsync,pe as featureEnableAsync,ge as featureListAsync,ve as featureResetAsync,me as featureStatusAsync};
|
|
8
|
+
/*!
|
|
9
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
+
*/
|
|
11
|
+
//# sourceMappingURL=FeatureSettings-GG7JGFIY.js.map
|
|
@@ -4,10 +4,10 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __pathDirname(__filename);
|
|
7
|
-
import{d as m}from"./chunk-
|
|
7
|
+
import{d as m}from"./chunk-RA74M3YD.js";import{Ob as a,Pb as g,vb as n}from"./chunk-RSHOMYG6.js";import"./chunk-WS6TGUH7.js";import"./chunk-DLUQVMUE.js";import"./chunk-C7UWPNC3.js";import{a as o}from"./chunk-AICYZHWK.js";import{H as i,I as s,P as p}from"./chunk-PYPCPMCR.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function y(e){e.setDescription(o.project.state["generate-code"].description),e.addExamples(o.project.state["generate-code"].examples),await e.runVerb();let t=await m(async()=>n({appConfigPath:g().fileConfig.appConfigPath,logger:a()}));if(e.isJsonMode()){s(t);return}i(`Generated TypeScript for ${t.itemTypes.length} item types in ${t.outputPath}.`);for(let r of t.warnings??[])p(`${r.message}${r.paths.length?`
|
|
8
8
|
${r.paths.map(c=>` ${c}`).join(`
|
|
9
9
|
`)}`:""}`)}export{y as dataGenerateCodeAsync};
|
|
10
10
|
/*!
|
|
11
11
|
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
12
12
|
*/
|
|
13
|
-
//# sourceMappingURL=GenerateCode-
|
|
13
|
+
//# sourceMappingURL=GenerateCode-PNYC45SK.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __pathDirname } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{a as B}from"./chunk-ENDUKF4E.js";import{a as U}from"./chunk-NNYOT7IR.js";import"./chunk-OL6CTXQR.js";import{e as L,f as $}from"./chunk-R2IECDVU.js";import{l as k}from"./chunk-ZLK2CMMJ.js";import{a as D}from"./chunk-A5INC5TY.js";import{Ga as S,Ma as A,Ob as f,Pb as I,y as l}from"./chunk-RSHOMYG6.js";import{w as s}from"./chunk-WS6TGUH7.js";import"./chunk-DLUQVMUE.js";import"./chunk-C7UWPNC3.js";import{a as p}from"./chunk-AICYZHWK.js";import{I as v,N as a,a as d}from"./chunk-PYPCPMCR.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function Y(t){await N(t,!1)}async function Z(t){await N(t,!0)}async function N(t,e){F(t,e),await t.runVerb();let o=await t.getOption("commit"),C=I().appConfig?.repoType!=="none",g=o?$(o,C):void 0,h=e?O(await D()):void 0;if(e&&!h)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 w=h??await k(t),m=g?void 0:L(),r=g??m?.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()&&m&&a(m.detached?`Detached HEAD at commit ${r}.`:`Using branch '${m.branch}' at commit ${r}.`);let i=await S({logger:f(),actionsParams:{appName:w,commitSha:r}}),n=U(i.result),b=R(i.result),u;if(c&&b&&(u=(await A({logger:f(),actionsParams:{appName:w,commitSha:r}})).log),t.isJsonMode()){let y=!!(n.errorMessage||n.buildOutput)?{...i,...n}:{...i};if(u!==void 0){let E=typeof i.result=="object"&&i.result!==null?i.result:{};y.result={...E,log:u}}v(y)}else a(n.errorMessage?`Build status: ${i.status}: ${n.errorMessage}`:`Build status: ${i.status}`),b&&!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 B(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 O(t){return typeof t=="string"&&t.trim()||void 0}function R(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 F(t,e){let o=e?p.project.buildStatus:p.app.buildStatus;t.setDescription(o.description),t.addExamples(o.examples),t.addOptions([...e?[]:[{flags:{key:s.AppName.name},env:s.AppName.envVar,description:p.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{Y as getMaafBuildStatusAsync,Z as getMaafProjectBuildStatusAsync};
|
|
8
|
+
/*!
|
|
9
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
+
*/
|
|
11
|
+
//# sourceMappingURL=GetMaafBuildStatus-UTPVWF5L.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __pathDirname } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{a as m}from"./chunk-74RNALDY.js";import{a as S,b as T,c as b,d as $,e as N}from"./chunk-B4NTYKGH.js";import{a as P}from"./chunk-A5INC5TY.js";import{A as f,Na as y,Ob as C,Pb as w,Ya as I,ab as D,y as l}from"./chunk-RSHOMYG6.js";import{A as p}from"./chunk-WS6TGUH7.js";import"./chunk-DLUQVMUE.js";import"./chunk-C7UWPNC3.js";import{a as u}from"./chunk-AICYZHWK.js";import{I as A,N as a}from"./chunk-PYPCPMCR.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function G(e){L(e),await e.runVerb();let o=c(await e.getOption(p.DeploymentId.camelName,!0)),t=await V(e),i,n;if(o){let r=await I({tenantId:t.tenantId,projectId:t.projectId,...t.localProject&&{localProject:t.localProject},deploymentId:o,includeAssets:!0,source:"cli"});i=r.project,n=r.deployment}else{let r=await D({tenantId:t.tenantId,projectId:t.projectId,...t.localProject&&{localProject:t.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 E(t.tenantId,i,n))}if(e.updateEnvironmentId(i.environmentId),!n)throw new l(o?`Deployment '${o}' was not found in project '${i.displayName}'.`:`Project '${i.displayName}' has no deployments.`);if(e.isJsonMode()){A({projectId:i.projectId,project:i.displayName,...U(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)}`),M(n)}function M(e){e.approvalDecision&&e.approvalDecision!=="NotRequired"&&a(`Decision: ${e.approvalDecision}`);let o=N(e);o.by&&a(`Decided by: ${o.by}`),o.time&&a(`Decided: ${m(o.time)}`);let t=T(e.approvalComment);if(t){let[n,...r]=t.split(`
|
|
8
|
+
`);a(`Comment: ${n}`);for(let s of r)a(` ${s}`)}let i=S(e.approvalUrl);i&&a(`Approval URL: ${i}`)}async function E(e,o,t){if(!(t.approvalDecision==="Approved"||t.approvalDecision==="Rejected")||t.approvalComment!==void 0||!t.approvalDecidedBy?.objectId||!t.deploymentId)return t;try{let r=(await I({tenantId:e,projectId:o.projectId,localProject:o,deploymentId:t.deploymentId,source:"cli"})).deployment?.approvalComment;return r===void 0?t:{...t,approvalComment:r}}catch{return t}}async function V(e){let o=w(),t=c(await e.getOption(p.ProjectId.camelName,!0)),i=c(await e.getOption(p.EnvironmentId.camelName,!0));if(i&&e.updateEnvironmentId(i),!t&&o.projectConfigError)throw new f(`Unable to read ${o.fileConfig.projectConfigPath}. ${o.projectConfigError.message}`);let n=await e.getTenantIdAsync();if(!n)throw new l("Unable to determine tenant ID. Ensure you are logged in.");let r=t||!o.appConfig?void 0:c(await P());if(!t&&r){let v=await y({tenantId:n,environmentId:i??c(o.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=t??c(o.appConfig?.projectId)??c(o.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 h=o.projectConfig?.projectId.toLowerCase()===s.toLowerCase()?o.projectConfig:void 0,g=c(o.appConfig?.projectId)?.toLowerCase()===s.toLowerCase()?c(o.appConfig?.environmentId):void 0,j=t?void 0:h??(g?{projectId:s,displayName:s,environmentId:g}:void 0);return{tenantId:n,projectId:s,...j&&{localProject:j}}}function U(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}:{},...b(e)?{cancelledBy:e.cancelledBy}:{},...$(e)?{cancelledTime:e.cancelledTime}:{},...e.assets?{assets:e.assets.map(B)}:{}}}function B(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 L(e){let o=u.project.deployStatus,t=e.getResolvedCommand()?.path.join(" ")==="deployment status";e.setDescription(o.description),e.addExamples(t?u.deployment.status.examples:o.examples),e.addOptions([{flags:{key:p.ProjectId.name,alias:p.ProjectId.alias},description:o.options.projectId,optionalInNonInteractive:!0},{flags:{key:p.EnvironmentId.name,alias:p.EnvironmentId.alias},env:p.EnvironmentId.envVar,description:o.options.environmentId,optionalInNonInteractive:!0},{flags:{key:p.DeploymentId.name},description:o.options.deploymentId,optionalInNonInteractive:!0}])}function c(e){return typeof e=="string"&&e.trim()||void 0}export{G as getMaafProjectDeployStatusAsync};
|
|
9
|
+
/*!
|
|
10
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
11
|
+
*/
|
|
12
|
+
//# sourceMappingURL=GetMaafProjectDeployStatus-PLK52YC4.js.map
|
|
@@ -4,8 +4,8 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __pathDirname(__filename);
|
|
7
|
-
import{
|
|
7
|
+
import{Hb as s,Ib as f,Pb as c,y as r}from"./chunk-RSHOMYG6.js";import"./chunk-DLUQVMUE.js";import"./chunk-C7UWPNC3.js";import{a as e}from"./chunk-AICYZHWK.js";import{I as g,N as m,a as p}from"./chunk-PYPCPMCR.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function E(t){S(t),await t.runVerb();let i=c();if(!i.appConfig)throw new r(`No ${p} found in the current directory. Run "${"ms"} app init" first.`);let o=f(i.appConfig.appSettings);if(t.isJsonMode())g({settings:o});else for(let n of s)m(`${n.name} = ${o[n.configKey]}`)}function S(t){t.setDescription(e.app["get-settings"].description),t.addExamples(e.app["get-settings"].examples??[])}export{E as getSettingsAsync};
|
|
8
8
|
/*!
|
|
9
9
|
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
10
|
*/
|
|
11
|
-
//# sourceMappingURL=GetSettings-
|
|
11
|
+
//# sourceMappingURL=GetSettings-RLRDJEC7.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __pathDirname } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{a as $}from"./chunk-SQI4XLR7.js";import{l as N,m as h}from"./chunk-ZLK2CMMJ.js";import"./chunk-A5INC5TY.js";import{Na as g,Ob as b,Pb as A,y as u}from"./chunk-RSHOMYG6.js";import{u as d}from"./chunk-WS6TGUH7.js";import"./chunk-DLUQVMUE.js";import"./chunk-C7UWPNC3.js";import{a}from"./chunk-AICYZHWK.js";import{I,N as t,P as y}from"./chunk-PYPCPMCR.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&&y(a.app.show.deprecation);let o=await N(e),f=await h(e,{failIfMissing:!1}),i=await e.getTenantIdAsync();if(!i)throw new u("Unable to determine tenant ID. Ensure you are logged in.");let s=await g({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()?I(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-CTB6IPRU.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __pathDirname } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{b as G}from"./chunk-ENDUKF4E.js";import{a as V}from"./chunk-HHW4SKVU.js";import{a as I}from"./chunk-BMOTNINY.js";import{i as O,m as F}from"./chunk-ZLK2CMMJ.js";import{a as R}from"./chunk-A5INC5TY.js";import{A as E,B as A,Ob as h,Pb as b,ea as D,gb as M,hb as U,ib as y,l as P,pa as L,y as l}from"./chunk-RSHOMYG6.js";import{M as s}from"./chunk-WS6TGUH7.js";import"./chunk-GO22IDEN.js";import"./chunk-UHNOINTO.js";import"./chunk-YEWRCEPT.js";import"./chunk-DLUQVMUE.js";import"./chunk-C7UWPNC3.js";import{a as f}from"./chunk-AICYZHWK.js";import{I as x,N as a,P as $,l as C}from"./chunk-PYPCPMCR.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function ce(e){Z(e),await e.runVerb();let o=b(),i=(await e.getOption("project",!0))?.trim();if(o.projectConfigError)throw new E(`Unable to read ${o.fileConfig.projectConfigPath}. ${o.projectConfigError.message} Fix the project configuration before retrying.`);let r=!i||o.projectConfig?.projectId.toLowerCase()===i.toLowerCase()?o.projectConfig:void 0,p=!i||o.appConfig?.projectId?.toLowerCase()===i.toLowerCase()?o.appConfig:void 0,n=i||r?.projectId||I(p?.projectId),c=n?void 0:I(await R()),u=I(r?.projectId?r.environmentId:p?.environmentId);if(!n&&!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 F(e,{failIfMissing:!1,overridesOnly:!0});if(!n&&c){let t=await V(c,j,k??u);n=I(t.projectId),u=t.environmentId??u}if(!n)throw new l("The current app is not associated with a managed project.");if(!C(n))throw new l("The project ID must be a valid GUID.");let w=k??u;if(!w)try{w=(await L(j,n)).environmentId}catch(t){if(!(t instanceof P)&&!(t instanceof A))throw t;let d=t instanceof P?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("InfoCmrAppProject.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(w);let m=h(),z=y({projectId:n,logger:m}).then(t=>({ok:!0,page:t}),t=>({ok:!1,error:t})),[S,N]=await Promise.all([M({projectId:n,logger:m}),U({projectId:n,logger:m})]),g=await z;if(e.isJsonMode()){if(!g.ok)throw g.error;let t=await _(n,g.page,m);x(J(S,N,t));return}if(W(S,N),!g.ok){$(`Project details were retrieved, but its apps could not be listed. Try again. Operation ID: ${o.operationId}.`);return}await G({title:"Apps",columns:[{header:"App ID",maxWidth:38},{header:"Display Name"},{header:"Last Deployed"},{header:"URL"}],firstPage:H(g.page),fetchNextPage:async t=>H(await y({projectId:n,skipToken:t,logger:m})),toRow:t=>[t.id,t.displayName||"<No Name>",q(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 H(e){return{items:e.apps,...e.nextSkipToken===void 0?{}:{nextSkipToken:e.nextSkipToken}}}async function _(e,o,i){let r=[...o.apps],p=o.nextSkipToken,n=1;for(;p;){if(n>=200)throw new D(`drainAppsAsync: exceeded ${200}-page cap for project ${e}; the server is likely returning a $skiptoken cycle.`,200);let c=await y({projectId:e,skipToken:p,logger:i});r.push(...c.apps),p=c.nextSkipToken,n++}return r}function J(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(r=>({stageName:r.stageName,stageUrl:r.stageUrl})),apps:i.map(r=>({appId:r.id,displayName:r.displayName,...r.lastDeployedTime?{lastDeployedTime:r.lastDeployedTime}:{},...r.appPlayUri?{appPlayUri:r.appPlayUri}:{}}))}}function W(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 Z(e){e.setDescription(f.project.info.description),e.addExamples(f.project.info.examples),e.addOptions([O({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 q(e){if(!e)return"-";let o=new Date(e);return Number.isNaN(o.getTime())?e:o.toLocaleDateString()}export{J as buildProjectInfoView,ce as infoMaafProjectAsync};
|
|
8
|
+
/*!
|
|
9
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
+
*/
|
|
11
|
+
//# sourceMappingURL=InfoMaafProject-TULH566X.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __pathDirname } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{a as k,b as ee,e as ie}from"./chunk-NMZFJESU.js";import{b as K,c as te,e as ne}from"./chunk-BAQPANON.js";import{a as X,b as Z}from"./chunk-KD4NQIYX.js";import"./chunk-4PI5THLA.js";import{a as Q}from"./chunk-3YCPXSCO.js";import"./chunk-CLY3OASM.js";import"./chunk-OHQNTYJG.js";import{a as q,b as Y}from"./chunk-6KOL66SF.js";import"./chunk-TYRVM4PP.js";import{g as _,h as J,l as W}from"./chunk-R2IECDVU.js";import{b as P,i as m,m as H}from"./chunk-ZLK2CMMJ.js";import"./chunk-A5INC5TY.js";import{Ha as G,Ib as $,Ob as F,Pb as j,i as M,y as c}from"./chunk-RSHOMYG6.js";import{K as e}from"./chunk-WS6TGUH7.js";import"./chunk-DLUQVMUE.js";import{e as L}from"./chunk-C7UWPNC3.js";import{a as o}from"./chunk-AICYZHWK.js";import{H as S,I as z,N as r,P as C,a as B}from"./chunk-PYPCPMCR.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=L("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})=>G({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:$(void 0)});await M(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?z({appId:d.app.id,environmentId:y,repoType:n,...l&&{externalRepoUrl:l}}):(S(`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-TYWP2E6U.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __pathDirname } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{a as u}from"./chunk-FESGOCAP.js";import{c as h}from"./chunk-ENDUKF4E.js";import{c as g}from"./chunk-KD4NQIYX.js";import"./chunk-4PI5THLA.js";import{i}from"./chunk-ZLK2CMMJ.js";import"./chunk-A5INC5TY.js";import{Ob as y,y as d,za as f}from"./chunk-RSHOMYG6.js";import{c as s,r as n}from"./chunk-WS6TGUH7.js";import"./chunk-DLUQVMUE.js";import"./chunk-C7UWPNC3.js";import{a as e}from"./chunk-AICYZHWK.js";import{K as A}from"./chunk-PYPCPMCR.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 d("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 f(w),p=S.slice().sort((t,l)=>t.behavior!==l.behavior?t.behavior==="Allow"?-1:1:t.summary.localeCompare(l.summary));if(o.isJsonMode()){A(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-UQS6D4UN.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __pathDirname } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{c as h}from"./chunk-ENDUKF4E.js";import{c as y}from"./chunk-KD4NQIYX.js";import{i as f}from"./chunk-ZLK2CMMJ.js";import"./chunk-A5INC5TY.js";import{Aa as m,Ob as d,y as l}from"./chunk-RSHOMYG6.js";import{n as o}from"./chunk-WS6TGUH7.js";import"./chunk-DLUQVMUE.js";import"./chunk-C7UWPNC3.js";import{a as n}from"./chunk-AICYZHWK.js";import{K as p}from"./chunk-PYPCPMCR.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 l("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 m({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()){p(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-OCDO64AT.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __pathDirname } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{a as C}from"./chunk-74RNALDY.js";import{a as v,c as W,d as Z,e as O}from"./chunk-B4NTYKGH.js";import{c as Q}from"./chunk-KD4NQIYX.js";import{a as K}from"./chunk-HHW4SKVU.js";import{a as y}from"./chunk-BMOTNINY.js";import{j as h}from"./chunk-ZLK2CMMJ.js";import{a as X}from"./chunk-A5INC5TY.js";import{$a as Y,A as $,Ob as G,Pb as z,Za as F,_a as E,ab as x,c as S,g as U,ma as B,y as g}from"./chunk-RSHOMYG6.js";import{q as p}from"./chunk-WS6TGUH7.js";import"./chunk-GO22IDEN.js";import"./chunk-UHNOINTO.js";import"./chunk-YEWRCEPT.js";import"./chunk-DLUQVMUE.js";import"./chunk-C7UWPNC3.js";import{a as f}from"./chunk-AICYZHWK.js";import{F as J,I as b,N as i,l as _}from"./chunk-PYPCPMCR.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function Ve(t){de(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=ue(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=me(l),se=fe(a),m=z();if(!o&&!s&&m.projectConfigError)throw new $("Unable to read the managed project configuration. Fix or remove the project configuration file and retry.");let k=!o&&!s&&!m.projectConfig?y(await X()):void 0,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=ce(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=pe(H.environmentId)}!w&&!s&&(I=le(await Q(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 x({tenantId:P,environmentId:I,projectId:w,localProject:A,target:u,status:D,top:M?1:se,continuationToken:d,includeAssets:M||q,source:"cli"}),ae=c.scope==="project"?c.project.environmentId:c.environmentId;t.updateEnvironmentId(ae);let N=c.page.items.map(j=>ge(j,c.filter.target));if(c.scope==="project"){if(q){let j=await t.getAuthenticationProvider().getCachedAccountAsync()??"current account";Ie(t,c.project,N,j,c.page);return}ve(t,c.project,N,M,c.page);return}ye(t,c.environmentId,N,c.page,c.projectNamesUnavailable)}function de(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 pe(t){if(!t)throw new $("The current app returned an invalid environment identifier.");let e=S(h(t));if(!e)throw new $("The current app returned an invalid environment identifier.");return e}function ce(t){let e=y(t);if(!e)return;let n=S(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 ue(t){if(t===void 0)return;let e=S(h(t));if(!e)throw new g("Invalid --environment-id value.");return e}function le(t){let e=S(h(t));if(!e)throw new $("The resolved environment identifier is invalid.");return e}function me(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 fe(t){if(!t)return F;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 ge(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:Ae(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 ve(t,e,n,o,r){if(t.isJsonMode()){o?b({project:e.displayName,environmentId:e.environmentId,deployment:n[0]?R(n[0]):null,continuationToken:r.continuationToken,pageLimitReached:r.pageLimitReached}):b({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"?we(e.displayName,e.environmentId,s):Te(e.displayName,s),oe(r);return}te(`Project: ${e.displayName}`,n,!1,r)}function ye(t,e,n,o,r){if(t.isJsonMode()){b({environmentId:e,order:"descendingByDeploymentStart",items:n.map(R),continuationToken:o.continuationToken,pageLimitReached:o.pageLimitReached,projectNamesUnavailable:r});return}te(`Environment: ${e}`,n,!0,o,r)}function Ie(t,e,n,o,r){if(t.isJsonMode()){b({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}`),oe(r),n.forEach((s,u)=>{u>0&&i(""),De(e.displayName,s)})}function De(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=re(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}:{},...W(e)?{cancelledBy:e.cancelledBy}:{},...Z(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 we(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=re(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}`),ee(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 Te(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]=ne(n);i(`Decided by: ${o} | Decided: ${r}`)}V(e.source),ee(e)}function V(t){let e=v(t.approvalUrl);e&&i(`Approval URL: ${e}`)}function ee(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 te(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."]:[],...ie(o)];J({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?ne(s[D]):[],d.status,d.deploymentStart,d.deploymentEnd]),emptyMessage:"No deployments found.",totalLabel:"deployment(s)",width:120})}function ne(t){return[t?.by??"-",t?.time?C(t.time):"-"]}function ie(t){return t.continuationToken?[t.pageLimitReached?`Traversal stopped after ${Y} pages; results are partial.`:"More deployment history is available.",`Continuation token: ${t.continuationToken}`]:[]}function oe(t){for(let e of ie(t))i(e)}function re(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 Ae(t){return t?/^[0-9a-f]{8,64}$/i.test(t)?t.slice(0,7):t:"-"}export{Ve as listDeploymentsAsync};
|
|
8
|
+
/*!
|
|
9
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
+
*/
|
|
11
|
+
//# sourceMappingURL=ListDeployments-PDLJ3IEI.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __pathDirname } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{i as g}from"./chunk-ZLK2CMMJ.js";import"./chunk-A5INC5TY.js";import{Oa as l,Ob as m,Pb as h,y as f}from"./chunk-RSHOMYG6.js";import{o as t}from"./chunk-WS6TGUH7.js";import"./chunk-DLUQVMUE.js";import"./chunk-C7UWPNC3.js";import{a as r}from"./chunk-AICYZHWK.js";import{F as I,K as L,N as M}from"./chunk-PYPCPMCR.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-UAWTTCGB.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __pathDirname } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{b as P}from"./chunk-ENDUKF4E.js";import{i as I}from"./chunk-ZLK2CMMJ.js";import"./chunk-A5INC5TY.js";import{Ob as j,ea as l,jb as p,y as g}from"./chunk-RSHOMYG6.js";import{p as c}from"./chunk-WS6TGUH7.js";import"./chunk-DLUQVMUE.js";import"./chunk-C7UWPNC3.js";import{a as m}from"./chunk-AICYZHWK.js";import{K as f}from"./chunk-PYPCPMCR.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 g("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);f(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 l(`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-T3Q2GEDX.js.map
|
|
@@ -4,5 +4,5 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __pathDirname(__filename);
|
|
7
|
-
import{a,b}from"./chunk-
|
|
8
|
-
//# sourceMappingURL=ListSchema-
|
|
7
|
+
import{a,b}from"./chunk-7AEULMP2.js";import"./chunk-RA74M3YD.js";import"./chunk-RSHOMYG6.js";import"./chunk-WS6TGUH7.js";import"./chunk-DLUQVMUE.js";import"./chunk-C7UWPNC3.js";import"./chunk-AICYZHWK.js";import"./chunk-PYPCPMCR.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";export{a as dataListSchemaAsync,b as toStateSchemaDescription};
|
|
8
|
+
//# sourceMappingURL=ListSchema-G673LK5Q.js.map
|
|
@@ -4,9 +4,9 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __pathDirname(__filename);
|
|
7
|
-
import{b as l}from"./chunk-
|
|
7
|
+
import{b as l}from"./chunk-7AEULMP2.js";import{a as c,d as m}from"./chunk-RA74M3YD.js";import{Gb as a}from"./chunk-RSHOMYG6.js";import"./chunk-WS6TGUH7.js";import"./chunk-DLUQVMUE.js";import"./chunk-C7UWPNC3.js";import{a as o}from"./chunk-AICYZHWK.js";import{F as n,I as r,N as t,P as s}from"./chunk-PYPCPMCR.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function A(e){h(e),await e.runVerb();let i=await m(async()=>await a(c()));if(e.isJsonMode()){r(l(i));return}f(i)}function f(e){if(t(`Schema: ${e.schemaPath}`),!e.exists){t("No state schema found. Create the file to start defining collections.");return}t(`Dialect: ${e.dialect??"(not set)"}`),t(`Locale: ${e.locale}`),t(`Validation: ${e.validationEnabled?"enabled":"disabled"}`),e.validationEnabled||s("Write validation is disabled ('x-ms-validation' is false). Declared indexes remain active."),n({title:"Collections",columns:[{header:"Collection",maxWidth:40},{header:"Properties"},{header:"Indices"}],rows:e.tables.map(i=>[i.name,i.representable?String(i.columns.filter(d=>!d.automatic).length):"-",`${i.indexCount} of ${e.maxIndicesPerTable}`]),emptyMessage:"No collections defined.",totalLabel:"collection(s)"}),t(`
|
|
8
8
|
The four platform properties are indexed separately and do not count toward the limit.`),t(`Run "${"ms"} project state list-schema" to see the properties.`)}function h(e){e.setDescription(o.project.state["list-settings"].description),e.addExamples(o.project.state["list-settings"].examples)}export{A as dataListSettingsAsync};
|
|
9
9
|
/*!
|
|
10
10
|
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
11
11
|
*/
|
|
12
|
-
//# sourceMappingURL=ListSettings-
|
|
12
|
+
//# sourceMappingURL=ListSettings-EXCK5ZS6.js.map
|
|
@@ -4,8 +4,8 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __pathDirname(__filename);
|
|
7
|
-
import{a as o}from"./chunk-
|
|
7
|
+
import{a as o}from"./chunk-WS6TGUH7.js";import{a as t}from"./chunk-AICYZHWK.js";import{H as c,I as i}from"./chunk-PYPCPMCR.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function d(n){n.setDescription(t.auth.login.description),n.addExamples(t.auth.login.examples),n.addOption({flags:{key:o.Account.name},description:t.auth.login.options.account,optionalInNonInteractive:!0}),n.addSwitch({flags:{key:o.DeviceCode.name},description:t.auth.login.options.deviceCode}),await n.runVerb();let s=n.getAccountManager(),a=n.getAuthResourceUrl(),u=await n.getOption(o.Account.name,!0),p=!!await n.getOption(o.DeviceCode.camelName,!0),e=await s.loginInteractiveAsync(a,u,p);if(n.isJsonMode()){i({account:{username:e.username,homeAccountId:e.homeAccountId}});return}c(`Signed in as ${e.username}.`)}export{d as loginAsync};
|
|
8
8
|
/*!
|
|
9
9
|
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
10
|
*/
|
|
11
|
-
//# sourceMappingURL=Login-
|
|
11
|
+
//# sourceMappingURL=Login-XZATPT4L.js.map
|
|
@@ -4,8 +4,8 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __pathDirname(__filename);
|
|
7
|
-
import{a as t}from"./chunk-
|
|
7
|
+
import{a as t}from"./chunk-AICYZHWK.js";import{H as n,I as s,N as a,P as i,Q as c}from"./chunk-PYPCPMCR.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function g(e){e.setDescription(t.auth.logout.description),e.addExamples(t.auth.logout.examples),await e.runVerb();let l=e.getAccountManager(),u=e.isJsonMode(),o;try{o=await l.clearCacheAsync()}catch(r){throw c(`Failed to log out: ${r.message}`),r}if(u){s({cleared:o});return}o?(n("Successfully logged out. All cached credentials have been cleared."),a("On next command, you will be prompted to sign in via the browser. If your browser has a single account session, it will be used automatically.")):i("No user found.")}export{g as logoutAsync};
|
|
8
8
|
/*!
|
|
9
9
|
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
10
|
*/
|
|
11
|
-
//# sourceMappingURL=Logout-
|
|
11
|
+
//# sourceMappingURL=Logout-2XM4IMZF.js.map
|