@microsoft/cmr-cli 0.0.0-stage → 0.32.3

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.
Files changed (133) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +172 -2
  3. package/THIRD-PARTY-NOTICES.txt +9751 -0
  4. package/dist/Add-FU57YE5G.js +11 -0
  5. package/dist/AddConfig-CI7KNLIG.js +12 -0
  6. package/dist/AddConnector-WH4IU3ND.js +16 -0
  7. package/dist/AddDeployment-GWFCPAL5.js +11 -0
  8. package/dist/AddDeploymentBinding-RFLI6DKH.js +18 -0
  9. package/dist/AddRayfin-VRCFEOIL.js +38 -0
  10. package/dist/Alter-JFFT5JOA.js +11 -0
  11. package/dist/AuthStatus-WCZYGI5G.js +11 -0
  12. package/dist/AuthSwitch-XJMG7IUR.js +13 -0
  13. package/dist/Bin.js +12 -0
  14. package/dist/BuildMaafApp-7AUZHYOQ.js +11 -0
  15. package/dist/Clear-7B7CDIPV.js +11 -0
  16. package/dist/Cli-XZ4SJKBZ.js +47 -0
  17. package/dist/CloneMaafApp-7W246RZA.js +12 -0
  18. package/dist/CreateMaafApp-6MSPHUU4.js +22 -0
  19. package/dist/CreateMaafProject-JKMF5TH3.js +11 -0
  20. package/dist/DeleteMaafApp-TFGWGJO3.js +11 -0
  21. package/dist/DeployMaafApp-K2APWFOD.js +8 -0
  22. package/dist/DeployMaafProject-6WRKGIIW.js +11 -0
  23. package/dist/DeploymentApprovals-WTXBXCKE.js +11 -0
  24. package/dist/Dev-CIEWFRXR.js +15 -0
  25. package/dist/EnvironmentVariableAuthenticationProvider-EBRBQ5I2.js +11 -0
  26. package/dist/FeatureSettings-77LZQSKD.js +11 -0
  27. package/dist/GenerateCode-UQCHTRGP.js +13 -0
  28. package/dist/GetMaafBuildStatus-6ZSLIZCH.js +11 -0
  29. package/dist/GetMaafProjectDeployStatus-NZEMVQGJ.js +12 -0
  30. package/dist/GetSettings-MVVEXMJC.js +11 -0
  31. package/dist/InfoMaafApp-7Z6OJCHD.js +13 -0
  32. package/dist/InfoMaafProject-SQYB736C.js +11 -0
  33. package/dist/Init-PBH2IXVK.js +11 -0
  34. package/dist/ListConnectorActions-UERYZ2C7.js +11 -0
  35. package/dist/ListConnectors-2FUTJMHY.js +11 -0
  36. package/dist/ListDeployments-4YWCHVKF.js +11 -0
  37. package/dist/ListMaafApps-ZATO77G3.js +11 -0
  38. package/dist/ListMaafProjects-GNUXZSYL.js +11 -0
  39. package/dist/ListSchema-QKVHVPHB.js +8 -0
  40. package/dist/ListSettings-IIA5OGMP.js +12 -0
  41. package/dist/Login-BT6UTPCZ.js +11 -0
  42. package/dist/Logout-FBJE35Q5.js +11 -0
  43. package/dist/MockFetch-LQLQGTNT.js +13 -0
  44. package/dist/NoOpAuthenticationProvider-ZZK2OB27.js +11 -0
  45. package/dist/NodeMsalAuthenticationProvider-5TJFMHR4.js +17 -0
  46. package/dist/Pack-TSFHSTB5.js +8 -0
  47. package/dist/PackProject-T575KJQ4.js +14 -0
  48. package/dist/PlayMaafApp-74TQEAO5.js +8 -0
  49. package/dist/ProjectApprovals-5KLYEM7V.js +13 -0
  50. package/dist/ProjectRoleAssignments-AI2FQ2VX.js +11 -0
  51. package/dist/RefreshDataSource-VARFN3IV.js +11 -0
  52. package/dist/RefreshGitAuth-DC5NAZBJ.js +11 -0
  53. package/dist/Remove-MCQZVI3K.js +11 -0
  54. package/dist/RemoveDataSource-RRND46QZ.js +14 -0
  55. package/dist/RemoveDeployment-STNFNNZF.js +11 -0
  56. package/dist/ServicePrincipalAuthenticationProvider-7RBHTYYY.js +11 -0
  57. package/dist/SetSetting-CEH44OT3.js +11 -0
  58. package/dist/SetSetting-Q7EQNOTI.js +11 -0
  59. package/dist/ShareLinkCreate-ZUVHUQLH.js +11 -0
  60. package/dist/ShareLinkList-IEYU6NZW.js +11 -0
  61. package/dist/ShareLinkRevoke-22RFGOFJ.js +11 -0
  62. package/dist/ShareList-6UWIHPBM.js +11 -0
  63. package/dist/ShareMaafApp-SFNOOMOD.js +11 -0
  64. package/dist/TelemetrySettings-XCT73DEI.js +11 -0
  65. package/dist/UnshareMaafApp-TU7U3LQ3.js +11 -0
  66. package/dist/acorn-CYBWGE5M.js +23 -0
  67. package/dist/angular-Q62TJP23.js +11 -0
  68. package/dist/babel-AOXBHIIS.js +22 -0
  69. package/dist/chunk-2LDU3F6O.js +11 -0
  70. package/dist/chunk-2LKCCYRF.js +11 -0
  71. package/dist/chunk-2VJIWD7V.js +11 -0
  72. package/dist/chunk-3E7QQ2BR.js +11 -0
  73. package/dist/chunk-3YRE4IQ3.js +132 -0
  74. package/dist/chunk-4U53RYJJ.js +11 -0
  75. package/dist/chunk-4XKA5APP.js +42915 -0
  76. package/dist/chunk-5MHBEEMZ.js +11 -0
  77. package/dist/chunk-6EF722GY.js +94 -0
  78. package/dist/chunk-A4PVXTJS.js +13 -0
  79. package/dist/chunk-ADRQC63G.js +14 -0
  80. package/dist/chunk-ATUGCFVC.js +11 -0
  81. package/dist/chunk-BA52TY55.js +12 -0
  82. package/dist/chunk-BRRT2E75.js +38 -0
  83. package/dist/chunk-DGUO74I3.js +15 -0
  84. package/dist/chunk-DKSLWH4O.js +18 -0
  85. package/dist/chunk-EFY2BSWB.js +12 -0
  86. package/dist/chunk-FHE3OXIP.js +11 -0
  87. package/dist/chunk-GE3UFHZ5.js +54 -0
  88. package/dist/chunk-HBLO3WDD.js +13 -0
  89. package/dist/chunk-HOIFXUTG.js +11 -0
  90. package/dist/chunk-HSNRWBA6.js +11 -0
  91. package/dist/chunk-KKC5ZK4D.js +77 -0
  92. package/dist/chunk-KT2SUHGM.js +11 -0
  93. package/dist/chunk-NYPHWF7Q.js +32 -0
  94. package/dist/chunk-OL6CTXQR.js +11 -0
  95. package/dist/chunk-OUKOEUZA.js +12 -0
  96. package/dist/chunk-PEZMQ2A3.js +11 -0
  97. package/dist/chunk-PLFDUGBA.js +12 -0
  98. package/dist/chunk-PZIEJEF5.js +11 -0
  99. package/dist/chunk-Q3ONTUZ7.js +11 -0
  100. package/dist/chunk-QLK3ZVWP.js +11 -0
  101. package/dist/chunk-RDXQ3ZPT.js +11 -0
  102. package/dist/chunk-RFLXPXBN.js +11 -0
  103. package/dist/chunk-SIEI2EB5.js +12 -0
  104. package/dist/chunk-SQI4XLR7.js +11 -0
  105. package/dist/chunk-TMYOZDLM.js +11 -0
  106. package/dist/chunk-TXMTKOEJ.js +12 -0
  107. package/dist/chunk-TYRVM4PP.js +8 -0
  108. package/dist/chunk-UEZV46GZ.js +44 -0
  109. package/dist/chunk-UT667QSU.js +8 -0
  110. package/dist/chunk-UXKJNXTZ.js +11 -0
  111. package/dist/chunk-WTTK2GTG.js +11 -0
  112. package/dist/chunk-WV7D7PTW.js +12 -0
  113. package/dist/chunk-WWVAS3DS.js +11 -0
  114. package/dist/chunk-XIX2O22O.js +11 -0
  115. package/dist/chunk-Y5AMO72S.js +10 -0
  116. package/dist/chunk-YRPTITKD.js +12 -0
  117. package/dist/chunk-ZB6MB7GZ.js +17 -0
  118. package/dist/dist-7N5TXK2L.js +45 -0
  119. package/dist/estree-HPTPQIMZ.js +51 -0
  120. package/dist/flow-B6JUMONE.js +27 -0
  121. package/dist/glimmer-36KZ3DJ5.js +44 -0
  122. package/dist/graphql-E6CIFZFV.js +35 -0
  123. package/dist/html-BUTTPQE6.js +32 -0
  124. package/dist/markdown-K2C5OZHT.js +69 -0
  125. package/dist/meriyah-27UE2OSX.js +12 -0
  126. package/dist/native/arm64/dpapi.node +0 -0
  127. package/dist/native/ia32/dpapi.node +0 -0
  128. package/dist/native/x64/dpapi.node +0 -0
  129. package/dist/postcss-QUHZLBB7.js +68 -0
  130. package/dist/rayfin-pack-HOUOLOHQ.js +164 -0
  131. package/dist/typescript-G2G6TDZF.js +28 -0
  132. package/dist/yaml-W5P5CGFK.js +166 -0
  133. package/package.json +62 -4
@@ -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"./chunk-UT667QSU.js";var i=class e{static FAKE_ACCESS_TOKEN="noop-access-token";static FAKE_TENANT_ID="00000000-0000-0000-0000-000000000000";async initAsync(n){}async getAccessTokenForResource(n,r){return e.FAKE_ACCESS_TOKEN}getUserTenantId(){return e.FAKE_TENANT_ID}async getCachedAccountAsync(){return"No-Op Auth"}};export{i as NoOpAuthenticationProvider};
8
+ /*!
9
+ * Copyright (C) Microsoft Corporation. All rights reserved.
10
+ */
11
+ //# sourceMappingURL=NoOpAuthenticationProvider-ZZK2OB27.js.map
@@ -0,0 +1,17 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __pathDirname } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a as w,b as y}from"./chunk-3YRE4IQ3.js";import"./chunk-HBLO3WDD.js";import{a as v}from"./chunk-OL6CTXQR.js";import"./chunk-TYRVM4PP.js";import{o as I}from"./chunk-GE3UFHZ5.js";import{Ob as m,x as u}from"./chunk-4XKA5APP.js";import{d,f,g,o as _}from"./chunk-FHE3OXIP.js";import"./chunk-OUKOEUZA.js";import{K as p,L as A}from"./chunk-KKC5ZK4D.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";import*as S from"node:fs";import*as R from"node:path";import T from"open";import*as c from"fs";import*as C from"path";var E="active-account.json";function P(s){let e=s.lastIndexOf(".");if(!(e<=0))return s.slice(e+1).trim()||void 0}var h=class{constructor(e=d){this._cacheDir=e;this._filePath=C.join(this._cacheDir,E)}_cacheDir;_filePath;read(){if(c.existsSync(this._filePath))try{let e=c.readFileSync(this._filePath,"utf-8"),t=JSON.parse(e);return typeof t.homeAccountId=="string"&&typeof t.username=="string"&&t.homeAccountId.length>0?{homeAccountId:t.homeAccountId,username:t.username}:void 0}catch{return}}write(e){c.mkdirSync(this._cacheDir,{recursive:!0});let t=`${this._filePath}.${process.pid}.tmp`;c.writeFileSync(t,JSON.stringify(e,null,2),"utf-8"),c.renameSync(t,this._filePath)}clear(){let e=c.existsSync(this._filePath);return c.rmSync(this._filePath,{force:!0}),e}};var b=class{_msalClient;_tenantId;_region;_persistence;_activeStore;_cacheDirectory;_isJsonMode=()=>process.argv.includes("--json");constructor(e=d){this._cacheDirectory=e,this._activeStore=new h(e)}async initAsync(e){this._region=e;let{DataProtectionScope:t,PersistenceCachePlugin:n,PersistenceCreator:i}=await import("./dist-7N5TXK2L.js"),r={cachePath:R.join(this._cacheDirectory,"msal_cache.json"),dataProtectionScope:t.CurrentUser,serviceName:f,accountName:g,usePlaintextFileOnLinux:!1},o=await i.createPersistence(r);this._persistence=o;let l={auth:{authority:I(this._region,this._tenantId),clientId:_},cache:{cachePlugin:new n(o)}};this._msalClient=new y(l)}setJsonModeResolver(e){this._isJsonMode=e}async getAccessTokenForResource(e,t){let n=await this._acquireTokenInternal(e+"/.default",t);return this._tenantId=n.tenantId,n.accessToken}getUserTenantId(){if(this._tenantId!==void 0)return this._tenantId;let e=this._activeStore.read()?.homeAccountId;return e===void 0?void 0:P(e)}async getCachedAccountAsync(){let e=await this._getAccounts();return this._pickActiveAccount(e)?.username}async listCachedAccountsAsync(){let e=await this._getAccounts();if(e.length===0)return[];let t=this._pickActiveAccount(e);return e.map(n=>({homeAccountId:n.homeAccountId,username:n.username,isActive:n.homeAccountId===t?.homeAccountId}))}async setActiveAccountAsync(e){let t=await this._getAccounts(),n=this._findAccount(t,e);if(!n)throw new u(`No cached account matches '${e}'. Run \`${"ms"} auth status\` to list cached accounts.`);return this._activeStore.write({homeAccountId:n.homeAccountId,username:n.username}),{homeAccountId:n.homeAccountId,username:n.username,isActive:!0}}async loginInteractiveAsync(e,t,n){let i=e+"/.default";if(n){let o=await this._signInWithDeviceCodeAndPersist(i);return{homeAccountId:o.account.homeAccountId,username:o.account.username,isActive:!0}}let r=await this._signInInteractiveAndPersist(i,t,{prompt:t?void 0:"select_account"});if(!r.account)throw new Error("Interactive sign-in did not return an account.");return{homeAccountId:r.account.homeAccountId,username:r.account.username,isActive:!0}}async clearCacheAsync(){let e=await this._clearPersistenceAsync(),t=this._activeStore.clear();return S.rmSync(this._cacheDirectory,{recursive:!0,force:!0}),e||t}async _clearPersistenceAsync(){if(!this._persistence)throw new Error("Authentication not initialized yet");let e;try{e=await this._persistence.load()!==null}catch{e=!0}return await this._persistence.delete(),e}async _getAccounts(){if(!this._msalClient)throw new Error("Authentication not initialized yet");try{return await this._msalClient.getTokenCache().getAllAccounts()}catch(e){return p(`Could not read the MSAL token cache (${e.message}). It may have been written by an older CLI version. Run \`${"ms"} auth logout\` and sign in again to reset it.`),[]}}_findAccount(e,t){let n=t.toLowerCase();return e.find(i=>i.homeAccountId.toLowerCase()===n)??e.find(i=>i.username.toLowerCase()===n)}_pickActiveAccount(e){if(e.length===0)return;if(e.length===1)return e[0];let t=this._activeStore.read();if(t)return e.find(n=>n.homeAccountId===t.homeAccountId)}_ensureActivePointer(e){this._activeStore.read()?.homeAccountId!==e.homeAccountId&&this._activeStore.write({homeAccountId:e.homeAccountId,username:e.username})}async _acquireTokenInternal(e,t){if(!this._msalClient)throw new Error("Authentication not initialized yet");let n=await this._getAccounts();if(n.length===0)return this._ensureInteractiveSignInAllowed("no-account"),this._signInInteractiveAndPersist(e,t);let i=this._pickActiveAccount(n);if(!i){let r=n.map(l=>` - ${l.username}`).join(`
8
+ `),o=m().interactive?`Run \`${"ms"} auth switch\` to choose one, or \`${"ms"} auth logout\` to clear all cached accounts and start over.`:`Run \`${"ms"} auth switch --account <email>\` to resolve, then retry.`;throw new u(`Multiple accounts are cached and no active account is selected:
9
+ ${r}
10
+ ${o}`)}try{let r=await this._msalClient.acquireTokenSilent({account:i,scopes:[e]});return this._ensureActivePointer(r.account??i),r}catch(r){if(r instanceof w||k(r))return this._ensureInteractiveSignInAllowed("expired"),this._signInInteractiveAndPersist(e,t??i.username);throw r}}_ensureInteractiveSignInAllowed(e){if(m().interactive)return;let t=e==="no-account"?"You are not signed in":"Your sign-in session has expired and could not be renewed silently";throw new u(`${t}. Interactive sign-in is required, but the CLI is running in non-interactive mode. Run \`${"ms"} auth login\` to sign in, then retry.`)}async _signInInteractiveAndPersist(e,t,n){if(!this._msalClient)throw new Error("Authentication not initialized yet");let i=this._getInteractiveLoginRequest(e,t);n?.prompt&&(i.prompt=n.prompt);let r=process.stdout.isTTY&&!this._isJsonMode()?new v:null;r?.start("Opening your browser to sign in \u2014 complete the sign-in there to continue...");try{let o=await this._msalClient.acquireTokenInteractive(i);return this._tenantId=o.tenantId,o.account&&this._ensureActivePointer(o.account),o}finally{r?.stop()}}async _signInWithDeviceCodeAndPersist(e){if(!this._msalClient)throw new Error("Authentication not initialized yet");let t={scopes:[e],deviceCodeCallback:i=>process.stderr.write(i.message+`
11
+ `)},n=await this._msalClient.acquireTokenByDeviceCode(t);if(!n?.account)throw new Error("Device code sign-in did not return an account.");return this._tenantId=n.tenantId,this._ensureActivePointer(n.account),{...n,account:n.account}}_getInteractiveLoginRequest(e,t){return{scopes:[e],openBrowser:async i=>{try{await T(i,{wait:!1})}catch(r){A(`Couldn't open a browser automatically (${String(r)}).
12
+ Open this URL to finish signing in:
13
+ ${i}`)}},successTemplate:"You can close this window now.",...t&&{loginHint:t}}}};function k(s){if(!(s instanceof Error))return!1;let e=s.errorCode;if(e===3400073247||e==="3400073247")return!0;let t=(s.message??"").toLowerCase();return t.includes("integrated windows auth")&&t.includes("federation")}export{b as NodeMsalAuthenticationProvider};
14
+ /*!
15
+ * Copyright (C) Microsoft Corporation. All rights reserved.
16
+ */
17
+ //# sourceMappingURL=NodeMsalAuthenticationProvider-5TJFMHR4.js.map
@@ -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{h as a,i as b,j as c,k as d,l as e}from"./chunk-NYPHWF7Q.js";import"./chunk-6EF722GY.js";import"./chunk-HBLO3WDD.js";import"./chunk-OL6CTXQR.js";import"./chunk-TYRVM4PP.js";import"./chunk-4XKA5APP.js";import"./chunk-2LDU3F6O.js";import"./chunk-RFLXPXBN.js";import"./chunk-FHE3OXIP.js";import"./chunk-OUKOEUZA.js";import"./chunk-HOIFXUTG.js";import"./chunk-KKC5ZK4D.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";export{b as assertAppConfigSchemaValid,a as assertPackPreconditions,d as packAppArtifactAsync,e as packAsync,c as tryPackAppArtifactAsync};
8
+ //# sourceMappingURL=Pack-TSFHSTB5.js.map
@@ -0,0 +1,14 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __pathDirname } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a as H,b as R,c as Q,d as Z,e as O,f as q,g as tt,h as rt,i as ot,j as at}from"./chunk-NYPHWF7Q.js";import{a as nt,b as st}from"./chunk-ATUGCFVC.js";import{i as et}from"./chunk-6EF722GY.js";import"./chunk-HBLO3WDD.js";import"./chunk-OL6CTXQR.js";import"./chunk-TYRVM4PP.js";import{Nb as $,Ob as X,Pb as Y,w as D,z as m}from"./chunk-4XKA5APP.js";import"./chunk-2LDU3F6O.js";import"./chunk-RFLXPXBN.js";import{a as G}from"./chunk-FHE3OXIP.js";import"./chunk-OUKOEUZA.js";import{a as N}from"./chunk-HOIFXUTG.js";import{C as z,D as V,G as W,I as F,K as h,o as C,q as I}from"./chunk-KKC5ZK4D.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";import{randomUUID as J}from"node:crypto";import*as s from"node:fs/promises";import*as u from"node:path";function A(t){return typeof t=="object"&&t!==null&&"code"in t&&t.code==="ENOENT"}var ht=new Set([".git",".ms","node_modules"]),ft="project-pack-",lt=".log",T=50*1024*1024,yt=5,At=1440*60*1e3;async function kt(t){try{return(await s.stat(t)).isFile()}catch(e){if(A(e))return!1;throw e}}async function jt(t){try{let e=await s.realpath(t),r=await s.readdir(e,{withFileTypes:!0}),a=new Set(r.filter(o=>o.isFile()).map(o=>o.name)),n=I.find(o=>a.has(o));if(!n)throw new m(`An app config (${I.join(" or ")}) is required at the project root: ${e}`);return await s.realpath(u.join(e,n))}catch(e){throw A(e)?new m(`Unable to resolve the project root or app config: ${e.message}`):e}}async function dt(t){let e;try{e=await s.readFile(t,"utf-8")}catch(r){throw new m(`Failed to read ${t}: ${r.message}`)}try{let r=JSON.parse(e);return ot(r),rt(r,u.basename(t)),{appConfigPath:t,appId:tt(r.appId,u.basename(t)),environmentId:r.environmentId,buildType:r.buildType}}catch(r){throw r instanceof D?(r.message=`${t}: ${r.message}`,r):new m(`${t}: ${r.message}`)}}async function ut(t,e){let r=await s.realpath(e);if(!R(t,r,!0))throw new m(`Project app directory resolves outside the project root: ${e}`);let a=await s.readdir(r,{withFileTypes:!0}),n=new Set(a.filter(p=>p.isFile()).map(p=>p.name)),o=I.find(p=>n.has(p));if(!o)return;let c=u.join(r,o),i=await s.realpath(c);if(!R(t,i))throw new m(`Discovered app config resolves outside the project root: ${c}`);return i}async function Et(t){let e=[],r=await s.realpath(t);async function a(n){let o=await ut(r,n);o&&e.push(o)}try{await a(r);let o=(await s.readdir(r,{withFileTypes:!0})).filter(c=>c.isDirectory()&&!ht.has(c.name)).sort((c,i)=>c.name.localeCompare(i.name));for(let c of o)await a(u.join(r,c.name))}catch(n){throw A(n)?new m(`Project contents changed while discovering app configurations: ${n.message}`):n}return e}async function Ct(t,e){let r=await s.realpath(t),a=[],n=new Set;for(let o of e){let c=u.resolve(r,o);if(!R(r,c,!0))throw new m(`Project app directory must be the project root or one of its descendants: ${o}`);let i;try{i=await s.realpath(c)}catch(P){throw A(P)?new m(`Project app directory does not exist: ${o}`):P}if(!R(r,i,!0))throw new m(`Project app directory resolves outside the project root: ${o}`);if(n.has(i))continue;n.add(i);let p=await ut(r,i);if(!p)throw new m(`Project app directory does not contain ${I.join(" or ")}: ${o}`);a.push(p)}return a}async function it(t){let e=await Promise.all(t.map(dt)),r=new Map;for(let{appId:a,appConfigPath:n}of e){let o=r.get(a);if(o)throw new m(`Duplicate appId "${a}" in ${o} and ${n}`);r.set(a,n)}return e}async function mt(t=!1){let{fileConfig:e,projectConfig:r,projectConfigError:a}=X();if(a)throw new m(`Invalid ${C}: ${a.message}`);let n;if(r){if(!e.projectConfigPath)throw new m(`Unable to resolve the path to ${C}.`);n=u.dirname(u.resolve(e.projectConfigPath));let c=r.components?.apps;return c?(t||F(`Using app directories listed in ${C}.`),{projectRoot:n,apps:await it(await Ct(n,c))}):(t||F(`No app directories are listed in ${C}; discovering apps at the project root and in immediate child directories.`),{projectRoot:n,apps:await it(await Et(n))})}else n=u.dirname(u.resolve(e.appConfigPath));let o=await jt(n);return{projectRoot:n,apps:[await dt(o)]}}async function It(t){try{return await s.stat(t),!0}catch(e){if(A(e))return!1;throw e}}function gt(t){return{errorCode:typeof t=="object"&&t!==null&&"code"in t&&typeof t.code=="string"?t.code:"UNKNOWN",errorName:t instanceof Error?t.name:typeof t}}async function ct(t,e){if(!t)return{};try{let r=(await s.stat(t)).size,a=Math.max(0,T-r);return a>0?{logFilePath:t,logFileMaxBytes:a,onLogError:e}:{}}catch(r){return A(r)?{logFilePath:t,logFileMaxBytes:T,onLogError:e}:(e(r),{})}}async function B(t,e,r,a,n){if($().trackErrorEvent("ProjectPack.AppFailed",{stage:e,...gt(r)}),!!a)try{let o=(await s.stat(a)).size,c=T-o;if(c<=0)return;let i=Buffer.from(`
8
+ [ms project pack] ${e} failed for app ${t}: ${y(r)}
9
+ `);await s.appendFile(a,i.subarray(0,c))}catch(o){if(!A(o)){n(o);return}try{let c=Buffer.from(`[ms project pack] ${e} failed for app ${t}: ${y(r)}
10
+ `);await s.writeFile(a,c.subarray(0,T))}catch(c){n(c)}}}async function Ft(t,e,r){try{let a=await s.readdir(t,{withFileTypes:!0}),n=[],o=[],c=Date.now();for(let i of a){let p=u.join(t,i.name);i.isFile()&&i.name.startsWith(ft)&&i.name.endsWith(lt)?n.push({path:p,modifiedAt:(await s.stat(p)).mtimeMs}):i.isDirectory()&&i.name.startsWith("packed-staging-")&&p!==e&&c-(await s.stat(p)).mtimeMs>=At&&o.push(p)}n.sort((i,p)=>p.modifiedAt-i.modifiedAt);for(let i of n.slice(yt))await s.rm(i.path,{force:!0});for(let i of o)await s.rm(i,{recursive:!0,force:!0})}catch(a){$().trackErrorEvent("ProjectPack.ArtifactPruneFailed",gt(a)),r||h(`Unable to prune old project-pack diagnostics: ${y(a)}`)}}async function Dt(t,e){let r=`${e}-backup-${J()}`,a=await It(e);a&&await s.rename(e,r);try{await s.rename(t,e)}catch(n){if(a)try{await s.rename(r,e)}catch(o){throw new D(`Failed to promote the new project artifact and restore the previous artifact. The previous artifact remains at ${r}. Promotion error: ${n.message}. Restore error: ${o.message}`)}throw n}if(a)try{await s.rm(r,{recursive:!0,force:!0})}catch(n){return{retainedBackupFolder:r,cleanupError:n}}return{}}async function Pt(t,e,r=t.apps){let a=Date.now(),{projectRoot:n}=t,o=r;if(o.length===0)throw new m("No apps were found to pack. Add an app config or list app directories in ms.project.config.json.");let c=Q(n),i=q(n,J()),p=e?u.join(u.dirname(c),`${ft}${J()}${lt}`):void 0,P=k=>{let L="code"in k&&typeof k.code=="string"?k.code:"LOG_CAPTURE_FAILED";$().trackErrorEvent("ProjectPack.LogCaptureFailed",{errorCode:L,errorName:k.name}),p=void 0},j=new Map,K=new Set,_=0,v=0,E=0,M=!1;try{await s.mkdir(i,{recursive:!0});let k=Date.now();for(let[d,f]of o.entries()){let g=u.dirname(f.appConfigPath);if(f.buildType==="none"||!await kt(u.join(g,"package.json")))continue;let l=nt(g,st(g)),w=l==="npm"?"npm install --prefer-offline":`${l} install`;e||F(`Installing dependencies for app ${d+1} of ${o.length} (${f.appId})...`);let wt=Date.now();try{let x=await ct(p,P);await et(w,g,{quiet:e,...x})}catch(x){await B(f.appId,"dependencyInstall",x,p,P),K.add(f.appId),j.set(f.appId,{success:!1,appId:f.appId,error:{code:"APP_DEPENDENCY_INSTALL_FAILED",message:`Dependency installation failed for app ${f.appId}.`},timings:pt(Date.now()-wt)}),e||h(`Dependency installation failed for app ${f.appId}: ${y(x)}`)}}_=Date.now()-k;let L=Date.now();for(let[d,f]of o.entries()){if(K.has(f.appId))continue;e||F(`Packing app ${d+1} of ${o.length} (${f.appId})...`);let g=Date.now();try{let l=await ct(p,P),w=await at({quiet:e,commandLogFilePath:l.logFilePath,commandLogFileMaxBytes:l.logFileMaxBytes,onCommandLogError:l.onLogError,appConfigPath:f.appConfigPath,packedFolder:i,cleanPackedFolder:!1});w.success?j.set(f.appId,{success:!0,...w.result}):(await B(f.appId,"pack",w.error,p,P),j.set(f.appId,{success:!1,appId:f.appId,error:{code:"APP_PACK_FAILED",message:`Packing failed for app ${f.appId}.`},timings:w.timings}),e||h(`Packing failed for app ${f.appId}: ${y(w.error)}`))}catch(l){await B(f.appId,"pack",l,p,P),j.set(f.appId,{success:!1,appId:f.appId,error:{code:"APP_PACK_FAILED",message:`Packing failed for app ${f.appId}.`},timings:pt(Date.now()-g)}),e||h(`Packing failed for app ${f.appId}: ${y(l)}`)}}v=Date.now()-L;let S=o.map(({appId:d})=>{let f=j.get(d);if(!f)throw new D(`Project pack did not produce a result for app ${d}.`);return f});if(S.some(d=>!d.success))return M=S.some(d=>d.success),{success:!1,...p?{logFile:p}:{},components:{apps:S},timings:{dependencyInstallMs:_,appPackingMs:v,finalizationMs:E,totalMs:Date.now()-a},error:{code:"PROJECT_PACK_FAILED",message:"One or more apps failed to pack."}};let b=S.filter(d=>d.success),U=Date.now();try{let d=b.map(({appId:l})=>({appId:l,path:Z(l)})),f={cliVersion:G.version,manifestVersion:H,apps:d};await s.writeFile(O(i),JSON.stringify(f,null,2));let g=await Dt(i,c);if(g.cleanupError&&g.retainedBackupFolder){let l=g.cleanupError;$().trackErrorEvent("ProjectPack.BackupCleanupFailed",{errorCode:typeof l=="object"&&l!==null&&"code"in l&&typeof l.code=="string"?l.code:"BACKUP_CLEANUP_FAILED",errorName:l instanceof Error?l.name:typeof l}),e||h(`Project packed successfully, but the previous artifact backup could not be removed: ${g.retainedBackupFolder}`)}E=Date.now()-U}catch(d){return E=Date.now()-U,M=b.length>0,e||h(`Project artifact finalization failed: ${y(d)}`),{success:!1,...p?{logFile:p}:{},components:{apps:b},timings:{dependencyInstallMs:_,appPackingMs:v,finalizationMs:E,totalMs:Date.now()-a},error:{code:"PROJECT_PACK_FAILED",message:"Project artifact finalization failed."}}}return{success:!0,...p?{logFile:p}:{},packedFolder:c,projectManifestPath:O(c),components:{apps:b.map(d=>({...d,packedFolder:c,packAppOutputDir:d.packAppOutputDir.replace(i,c),packClientOutputDir:d.packClientOutputDir.replace(i,c)}))},timings:{dependencyInstallMs:_,appPackingMs:v,finalizationMs:E,totalMs:Date.now()-a}}}finally{M||await s.rm(i,{recursive:!0,force:!0}),await Ft(u.dirname(c),M?i:void 0,e)}}function pt(t){return{clientBuildMs:0,clientCopyMs:0,dataSourcesMs:0,functionsDiscoveryMs:0,middletierBuildMs:0,functionsArchiveMs:0,rayfinPackMs:0,totalMs:t}}function y(t){return t instanceof Error?t.message:String(t)}async function Jt(t={}){let{quiet:e=!1}=t;return Pt(await mt(e),e)}async function Kt(t){t.setDescription(N.project.pack.description),t.addExamples(N.project.pack.examples),await t.runVerb();let e=t.isJsonMode(),r=await mt(e),a=await Pt(r,e);if(e)if(a.success){let{success:n,...o}=a;V(o)}else{let{success:n,...o}=a;throw W(o),new Y(a.error.message)}else if(a.success)z("Project successfully packed.");else throw new D(a.error.message)}export{Et as discoverProjectAppConfigsAsync,Jt as packProjectArtifactAsync,Kt as packProjectAsync,Pt as packResolvedProjectArtifactAsync};
11
+ /*!
12
+ * Copyright (C) Microsoft Corporation. All rights reserved.
13
+ */
14
+ //# sourceMappingURL=PackProject-T575KJQ4.js.map
@@ -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-PLFDUGBA.js";import"./chunk-QLK3ZVWP.js";import"./chunk-GE3UFHZ5.js";import"./chunk-4XKA5APP.js";import"./chunk-2LDU3F6O.js";import"./chunk-RFLXPXBN.js";import"./chunk-FHE3OXIP.js";import"./chunk-OUKOEUZA.js";import"./chunk-4U53RYJJ.js";import"./chunk-HOIFXUTG.js";import"./chunk-KKC5ZK4D.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";export{b as buildPlayUrl,a as playMaafAppAsync};
8
+ //# sourceMappingURL=PlayMaafApp-74TQEAO5.js.map
@@ -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{b as A}from"./chunk-WTTK2GTG.js";import"./chunk-DKSLWH4O.js";import{a as V,b as J}from"./chunk-2LKCCYRF.js";import{n as D}from"./chunk-GE3UFHZ5.js";import{A as O,Nb as w,Pb as G,ab as y,bb as M,cb as $,db as k,k as E,u as C,v as x,w as j,x as v,y as L}from"./chunk-4XKA5APP.js";import"./chunk-BRRT2E75.js";import"./chunk-2LDU3F6O.js";import"./chunk-RFLXPXBN.js";import"./chunk-FHE3OXIP.js";import"./chunk-OUKOEUZA.js";import{O as p}from"./chunk-4U53RYJJ.js";import{a as d}from"./chunk-HOIFXUTG.js";import{A as T,C as h,D as I,G as S,I as F,K as R}from"./chunk-KKC5ZK4D.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function ue(e){Q(e),await e.runVerb();let o=B(e.getPositionalArgs(0));if(o.length===0)throw new v("Provide at least one approver (object ID or user/group email address). Separate multiple entries with commas, spaces, or both.");let r=w(),a=r.trackScenario("ProjectApproval.Add",{inputCount:o.length});try{let t=[],c=Z(o,t);if(c.length===0)throw new v(b(t));t.length>0&&R(b(t));let{projectId:n,tenantId:l,environmentId:s}=await A(e),u=await N(e);try{await M({tenantId:l,environmentId:s,logger:r,actionsParams:{projectId:n,approvers:c.map(i=>i.entry),...u?{target:u}:{}}})}catch(i){throw Y(i)}if(a.complete({addedCount:c.length,failedResolutionCount:t.length}),e.isJsonMode()){I({projectId:n,...u?{target:u}:{},partialFailure:t.length>0,added:c.map(i=>({input:i.input})),warnings:t});return}h(`Added ${c.length} approver${c.length===1?"":"s"} to the ${u??y} target of project '${n}'.`);for(let i of c)F(` + ${i.input}`)}catch(t){throw H(a,t),t}}function H(e,o){o instanceof E?e.failure(void 0,{status:o.status,errorCode:o.code}):e.failure(o)}var W={PrincipalNotFound:"An approver was not found in the tenant directory. Check the email address or object ID.",InvalidPrincipalId:"An approver ID is not a valid object ID (GUID).",InvalidPrincipalType:"An approver is a kind of principal that cannot be an approver, or its type does not match.",InvalidRequestContent:"An approver entry was not accepted. An email address may be malformed or match more than one account; pass the object ID instead."};function z(e){return e.code&&/^[A-Za-z][A-Za-z0-9_.]{0,63}$/.test(e.code)?e.code:void 0}function Y(e){if(!(e instanceof E))return e;let o=z(e),r={telemetryDetails:{status:e.status,serviceErrorCode:o}};if(e.status===400){let a=e.code?W[e.code]:void 0;return new v(`The service rejected the approvers; none were added. ${a??`The request was not accepted${o?` (${o})`:""}.`}`,void 0,r)}return e.status===502&&e.code==="BadGateway"?new v("The tenant directory could not be reached to resolve an approver; none were added. Try again.",void 0,r):e.status===401?new L(`The service did not accept your sign-in. Run \`${"ms"} auth login\`, then try again.`,void 0,r):e.status===403?new j("You do not have permission to manage approvers on this project.",C.GeneralError,void 0,{errorCode:V.ProjectApprovalPermissionDenied,errorCategory:x.User,telemetryDetails:J("project_approvals",r.telemetryDetails)}):e.status===429?new O("The service is limiting requests right now. Wait a moment, then try again.",void 0,r):new j(`The service could not complete the request (HTTP ${e.status}). Run \`${"ms"} project list approval\` to see which approvers are configured, then try again.`,C.GeneralError,void 0,{errorCode:"ServiceError",...r})}async function me(e){X(e),await e.runVerb();let o=await e.getOption(p.All.name,!0),r=B(e.getPositionalArgs(0));if(o&&r.length>0)throw new v("Provide either explicit approvers or --all, not both.");if(!o&&r.length===0)throw new v("Provide at least one approver (object ID or user/group email address) to remove, or pass --all to remove every approver.");let{projectId:a,tenantId:t,environmentId:c}=await A(e),n=await N(e),l=n??y,s=w(),u=s.trackScenario("ProjectApproval.Remove",{all:!!o,inputCount:r.length});try{let i,m=[],f=[];if(o)i=await $({tenantId:t,environmentId:c,logger:s,actionsParams:{projectId:a,all:!0,...n?{target:n}:{}}});else{if(m=[],f=await K(r,m,()=>k({tenantId:t,environmentId:c,logger:s,actionsParams:{projectId:a,...n?{target:n}:{}}})),f.length===0)throw new v(b(m));m.length>0&&R(b(m)),i=await $({tenantId:t,environmentId:c,logger:s,actionsParams:{projectId:a,principalIds:f.map(g=>g.objectId),...n?{target:n}:{}}})}u.complete({all:!!o,removedCount:i.removed.length,failureCount:i.failures.length,failedResolutionCount:m.length});let P=i.failures.length>0;if(e.isJsonMode()){let g={projectId:a,...n?{target:n}:{},all:!!o,partialFailure:m.length>0||P,removed:i.removed,failures:i.failures,warnings:m};if(P)throw S(g),new G(_(i.failures,f));I(g);return}if(o)h(`Removed every approver from the ${l} target of project '${a}'.`);else if(i.removed.length>0&&h(`Removed ${i.removed.length} approver${i.removed.length===1?"":"s"} from the ${l} target of project '${a}'.`),P)throw new j(_(i.failures,f))}catch(i){throw u.failure(i),i}}async function ve(e){ee(e),await e.runVerb();let{projectId:o,tenantId:r,environmentId:a}=await A(e),t=await N(e),c=w(),n=c.trackScenario("ProjectApproval.List");try{let l=await k({tenantId:r,environmentId:a,logger:c,actionsParams:{projectId:o,...t?{target:t}:{}}});if(n.complete({approverCount:l.length}),e.isJsonMode()){I({projectId:o,...t?{target:t}:{},approvers:l.map(s=>({objectId:s.objectId,objectType:s.objectType,...s.email?{email:s.email}:{},...s.displayName?{displayName:s.displayName}:{}}))});return}T({title:`Approvers \u2014 project '${o}' (${t??y} target)`,columns:[{header:"Name"},{header:"Email"},{header:"Type"},{header:"Object ID",maxWidth:38}],rows:l.map(s=>[s.displayName??"-",s.email??"-",s.objectType,s.objectId]),emptyMessage:"No approvers are configured for this project.",totalLabel:"approver(s)"})}catch(l){throw n.failure(l),l}}function B(e){let o=new Set;for(let r of e)for(let a of r.split(",")){let t=a.trim();t&&o.add(t)}return[...o]}function Z(e,o){let r=[],a=new Set;for(let t of e){let c=t.toLowerCase();if(!a.has(c)){if(D(t))r.push({input:t,entry:{objectId:t}});else if(q(t))r.push({input:t,entry:{email:t}});else{o.push({input:t,reason:"not an object ID (GUID) or a valid email address"});continue}a.add(c)}}return r}async function K(e,o,r){let a,t=[];for(let n of e){if(D(n)){t.push({objectId:n,input:n});continue}if(!q(n)){o.push({input:n,reason:"not an object ID (GUID) or a valid email address"});continue}a??=await r();let l=new Map;for(let u of a)if(u.email?.toLowerCase()===n.toLowerCase()){let i=u.objectId.trim().toLowerCase();l.has(i)||l.set(i,u.objectId)}let s=[...l.values()];if(s.length===0){o.push({input:n,reason:"not a current approver, or the service reports a different address for them (pass the object ID shown by `project list approval` instead)"});continue}if(s.length>1){o.push({input:n,reason:`matches ${s.length} approvers (${s.join(", ")}); none was removed. Pass the object ID of the one to remove instead`});continue}t.push({objectId:s[0],input:n})}let c=new Set;return t.filter(n=>{let l=n.objectId.toLowerCase();return c.has(l)?!1:(c.add(l),!0)})}function _(e,o){let r=e.length===1?"approver":"approvers",a=e.map(t=>` - ${o.find(n=>n.objectId===t.principalId)?.input??t.principalId}`);return[`Failed to remove ${e.length} ${r}:`,...a].join(`
8
+ `)}function b(e){let o=e.length===1?"entry":"entries",r=e.map(a=>` - ${a.input}: ${a.reason}`);return[`Could not resolve ${e.length} ${o}:`,...r].join(`
9
+ `)}function q(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}async function N(e){return(await e.getOption(p.Target.name,!0))?.trim()||void 0}function Q(e){e.setDescription(d.project.add.approval.description),e.addExamples(d.project.add.approval.examples),e.consumePositionalArgs("principal"),e.addOptions([{flags:{key:p.ProjectId.name,alias:p.ProjectId.alias},description:d.project.add.approval.options.projectId,optionalInNonInteractive:!0},{flags:{key:p.EnvironmentId.name,alias:p.EnvironmentId.alias},env:p.EnvironmentId.envVar,description:d.project.add.approval.options.environmentId,optionalInNonInteractive:!0},{flags:{key:p.Target.name},description:d.project.add.approval.options.target,optionalInNonInteractive:!0,hidden:!0}])}function X(e){e.setDescription(d.project.remove.approval.description),e.addExamples(d.project.remove.approval.examples),e.consumePositionalArgs("principal"),e.addSwitch({flags:{key:p.All.name},description:d.project.remove.approval.options.all}),e.addOptions([{flags:{key:p.ProjectId.name,alias:p.ProjectId.alias},description:d.project.remove.approval.options.projectId,optionalInNonInteractive:!0},{flags:{key:p.EnvironmentId.name,alias:p.EnvironmentId.alias},env:p.EnvironmentId.envVar,description:d.project.remove.approval.options.environmentId,optionalInNonInteractive:!0},{flags:{key:p.Target.name},description:d.project.remove.approval.options.target,optionalInNonInteractive:!0,hidden:!0}])}function ee(e){e.setDescription(d.project.list.approval.description),e.addExamples(d.project.list.approval.examples),e.addOptions([{flags:{key:p.ProjectId.name,alias:p.ProjectId.alias},description:d.project.list.approval.options.projectId,optionalInNonInteractive:!0},{flags:{key:p.EnvironmentId.name,alias:p.EnvironmentId.alias},env:p.EnvironmentId.envVar,description:d.project.list.approval.options.environmentId,optionalInNonInteractive:!0},{flags:{key:p.Target.name},description:d.project.list.approval.options.target,optionalInNonInteractive:!0,hidden:!0}])}export{ue as addProjectApprovalAsync,ve as listProjectApprovalAsync,me as removeProjectApprovalAsync};
10
+ /*!
11
+ * Copyright (C) Microsoft Corporation. All rights reserved.
12
+ */
13
+ //# sourceMappingURL=ProjectApprovals-5KLYEM7V.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 I}from"./chunk-WTTK2GTG.js";import"./chunk-DKSLWH4O.js";import"./chunk-GE3UFHZ5.js";import{Nb as A,eb as u,nb as j,x as p}from"./chunk-4XKA5APP.js";import"./chunk-BRRT2E75.js";import"./chunk-2LDU3F6O.js";import"./chunk-RFLXPXBN.js";import"./chunk-FHE3OXIP.js";import"./chunk-OUKOEUZA.js";import{P as n}from"./chunk-4U53RYJJ.js";import{a as g}from"./chunk-HOIFXUTG.js";import{C as r,D as a,I as c,K as f}from"./chunk-KKC5ZK4D.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function C(e){await y(e,"assign")}async function E(e){await y(e,"unassign")}async function y(e,l){let s=g.project[l];e.setDescription(s.description),e.addExamples(s.examples),e.consumePositionalArgs("principal"),e.addOptions([{flags:{key:n.Role.name},description:s.options.role},{flags:{key:n.ProjectId.name,alias:n.ProjectId.alias},description:s.options.projectId,optionalInNonInteractive:!0},{flags:{key:n.EnvironmentId.name,alias:n.EnvironmentId.alias},env:n.EnvironmentId.envVar,description:s.options.environmentId,optionalInNonInteractive:!0}]),await e.runVerb();let o=await e.getOption(n.Role.name,!0);if(o!=="contributor"&&o!=="owner"&&o!=="reader")throw new p("--role is required. Choose contributor, owner, or reader.");let m=e.getPositionalArgs(0);if(m.length===0)throw new p("Provide at least one principal (object ID or email address).");let{projectId:i}=await I(e),d={projectId:i,role:o,principals:m,logger:A()};if(l==="unassign"){let{result:h,...t}=await j(d);if(e.isJsonMode()){a({projectId:i,role:o,...h,...t});return}t.revokedCount>0?r(`Unassigned the ${o} role from ${t.revokedPrincipalCount} principal(s) on project '${i}'.`):c(`No ${o} role assignments were removed from project '${i}'.`),t.notFound.length>0&&c(`No matching ${o} assignment found (no-op): ${t.notFound.join(", ")}. If an email was not listed, retry using the principal's object ID.`),t.skipped.length>0&&f(`${t.skipped.length} assignment(s) had no role-definition ID and were skipped. Inspect the project's role assignments before retrying.`);return}let w=await u(d);if(e.isJsonMode()){a({projectId:i,role:o,...w});return}r(`Assigned the ${o} role on project '${i}'.`)}export{C as assignProjectRoleAsyncVerb,E as unassignProjectRoleAsyncVerb};
8
+ /*!
9
+ * Copyright (C) Microsoft Corporation. All rights reserved.
10
+ */
11
+ //# sourceMappingURL=ProjectRoleAssignments-AI2FQ2VX.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{k as D}from"./chunk-GE3UFHZ5.js";import{Ca as y,Da as N,K as A,Nb as c,Ob as v,Pb as C}from"./chunk-4XKA5APP.js";import"./chunk-FHE3OXIP.js";import"./chunk-OUKOEUZA.js";import{k as a}from"./chunk-4U53RYJJ.js";import{a as o}from"./chunk-HOIFXUTG.js";import{C as u,D as m,G as h,I as g,L as S}from"./chunk-KKC5ZK4D.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function L(e){let w=v(),{fileConfig:n,cliFs:$}=w;b(e),await e.runVerb(),D();let i=!!await e.getOption("offline",!0),f=await e.getOption("name",!0)||void 0,p=A(),l={vfs:$,authProvider:e.getAuthenticationProvider(),httpClient:e.getHttpClient(),region:p.region,environmentName:p.environmentName,localFilePaths:{appConfigPath:n.appConfigPath,schemaPath:n.schemaPath,codeGenPath:n.codeGenPath},logger:c()},t=i?await N({...l,actionsParams:{dataSource:f}}):await y({...l,actionsParams:{dataSourceName:f}}),s=i?"regenerated":"refreshed",P=i?"regenerate":"refresh";if(e.isJsonMode()){if(t.failed.length===0){m(t);return}let r=t.failed.map(({dataSourceName:d,error:O})=>{try{c().trackErrorEvent("RefreshDataSource.Failure",{dataSourceName:d,error:O})}catch{}return{dataSourceName:d,error:`Data source could not be ${s}.`}});h({succeeded:t.succeeded,failed:r})}else{for(let r of t.succeeded)u(`'${r}' ${s} successfully.`);for(let r of t.failed)S(`Failed to ${P} '${r.dataSourceName}': ${r.error}`)}if(t.failed.length>0)throw new C(`${t.failed.length} data source(s) could not be ${s}; ${t.succeeded.length} succeeded.`);t.succeeded.length>0&&t.failed.length===0&&g(`Hint: Run '${"ms"} app dev' to test locally.`)}function b(e){e.setDescription(o.app.refresh.dataSource.description),e.addExamples(o.app.refresh.dataSource.examples),e.addOptions([{flags:{key:a.DataSourceName.name,alias:a.DataSourceName.alias},env:a.DataSourceName.envVar,description:o.app.refresh.dataSource.options.name,optionalInNonInteractive:!0}]),e.addSwitch({flags:{key:a.Offline.name},env:a.Offline.env,description:o.app.refresh.dataSource.options.offline})}export{L as refreshDataSourceAsync};
8
+ /*!
9
+ * Copyright (C) Microsoft Corporation. All rights reserved.
10
+ */
11
+ //# sourceMappingURL=RefreshDataSource-VARFN3IV.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 f,b as D}from"./chunk-XIX2O22O.js";import{i as b}from"./chunk-GE3UFHZ5.js";import{Jb as y,Kb as A,Nb as m,d as w,x as p}from"./chunk-4XKA5APP.js";import"./chunk-FHE3OXIP.js";import"./chunk-OUKOEUZA.js";import{F as o}from"./chunk-4U53RYJJ.js";import{a as n}from"./chunk-HOIFXUTG.js";import{C as c,D as d}from"./chunk-KKC5ZK4D.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function C(e){H(e),await e.runVerb();let l=await e.getTenantIdAsync();if(!l)throw new p("Unable to determine tenant ID. Ensure you are logged in.");if(!e.getEnvironmentId())throw new p("Environment id is required for ms git auth refresh. Set 'environmentId' in ms.config.json, or set the MS_CLI_MAAF_DEBUG_ENVIRONMENT_ID env var for debug runs.");let i=await e.getOption(o.Repo.name);if(!i)throw new p("Argument repo is required. Use --repo or -r to specify the GitHub repository (e.g. --repo https://contoso.ghe.com/contoso/my-app).");let{host:a,owner:t,repo:r}=w(i),I=t&&r?y(t,r):"";m().trackActivityEvent("Git.Auth.Refresh.Start",{repoHost:a,repoHash:I});let E=await e.getOption(o.OpenBrowser.camelName,!0)??!1,g=e.isJsonMode(),R=v({isJson:g,openBrowser:E}),u=new AbortController,h=()=>{u.abort()};process.once("SIGINT",h);let S=a&&t&&r?`https://${a}/${t}/${r}`:i,G=t&&r?`${t}/${r}`:i;try{let s=await A({remoteUrl:S,tenantId:l,logger:m(),display:R,skipBrowser:!1,signal:u.signal});g?d({githubLogin:s.githubLogin,mappingExpiresAt:s.mappingExpiresAt}):(c(`Authenticated as ${s.githubLogin} for ${G}.`),c(`Mapping established; expires around ${s.mappingExpiresAt}.`))}finally{process.removeListener("SIGINT",h)}}function v(e){return e.isJson?new D:e.openBrowser?f:{...f,openVerificationUri:void 0}}function H(e){e.setDescription(n.git.auth.refresh.description),e.addExamples(n.git.auth.refresh.examples),e.addOptions([b({flags:{key:o.Repo.name,alias:o.Repo.alias},env:o.Repo.envVar,message:o.Repo.promptMessage,description:n.git.auth.refresh.options.repo})]),e.addSwitch({flags:{key:o.OpenBrowser.name},description:n.git.auth.refresh.options.openBrowser})}export{C as refreshGitAuthAsync};
8
+ /*!
9
+ * Copyright (C) Microsoft Corporation. All rights reserved.
10
+ */
11
+ //# sourceMappingURL=RefreshGitAuth-DC5NAZBJ.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 w,d as a}from"./chunk-ADRQC63G.js";import{b as u,i as g}from"./chunk-GE3UFHZ5.js";import{Bb as f,Cb as d,Ob as y,x as l}from"./chunk-4XKA5APP.js";import"./chunk-FHE3OXIP.js";import"./chunk-OUKOEUZA.js";import{b as t}from"./chunk-4U53RYJJ.js";import{a as n}from"./chunk-HOIFXUTG.js";import{C as m,D as p,I as r}from"./chunk-KKC5ZK4D.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function x(e){v(e),await e.runVerb();let o=await e.getOption(t.Collection.name),i=await e.getOption(t.Property.name,!0),h=await e.getOption("force",!0),c=w();if(i===void 0){await a(async()=>await f({...c,tableName:o}));return}if(!h){if(!y().interactive)throw new l("Removing a property requires confirmation. Re-run with --force in non-interactive mode.");if(!await u({message:`Remove property '${i}' from collection '${o}'? Stored values are not deleted, but they will no longer be validated or indexed by this definition.`})){r("Remove cancelled.");return}}let{schemaPath:s}=await a(async()=>await d({...c,tableName:o,columnName:i}));if(e.isJsonMode()){p({schemaPath:s,collection:o,property:i,removed:!0});return}m(`Property '${i}' removed from collection '${o}' in ${s}`),r(n.project.state.remove.hint)}function v(e){let o=n.project.state.remove;e.setDescription(o.description),e.addExamples(o.examples),e.addOptions([g({flags:{key:t.Collection.name},message:t.Collection.promptMessage,description:o.options.collection}),{flags:{key:t.Property.name},description:o.options.property,optionalInNonInteractive:!0}]),e.addSwitch({flags:{key:"force",alias:"f"},description:o.options.force})}export{x as dataRemoveAsync};
8
+ /*!
9
+ * Copyright (C) Microsoft Corporation. All rights reserved.
10
+ */
11
+ //# sourceMappingURL=Remove-MCQZVI3K.js.map
@@ -0,0 +1,14 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __pathDirname } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{b as C,g as E,k as R}from"./chunk-GE3UFHZ5.js";import{K as w,Nb as b,Ob as A,h as y,wa as $,x as u,xa as N}from"./chunk-4XKA5APP.js";import"./chunk-FHE3OXIP.js";import"./chunk-OUKOEUZA.js";import{j as f}from"./chunk-4U53RYJJ.js";import{a as r}from"./chunk-HOIFXUTG.js";import{A as D,C as S,K as p}from"./chunk-KKC5ZK4D.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function z(e){let o=A(),{fileConfig:i,cliFs:m}=o;W(e),await e.runVerb(),R();let t=await e.getOption("force",!0),s=await O(i.appConfigPath);if(s.length===0){p("No data sources found in ms.config.json. Nothing to remove.");return}let l;if(o.interactive)l=await F(s);else{let a=await e.getOption("name");if(!a)throw x(s),new u(`Re-run with --name <name>. Example:
8
+ ${"ms"} app remove data-source --name ${s[0]?.name??"<name>"}`);let c=s.find(P=>P.name===a);if(!c)throw x(s),new u(`Data source '${a}' not found in ms.config.json. See available data sources above.`);l=c}let{name:d,kind:v,connectorId:I,connectorDisplayName:g}=l,n=l.dataverseTable?[]:s.filter(a=>a.dataverseTable&&a.connectorId===l.connectorId);if(n.length>0){let a=n.map(c=>c.name).join(", ");p(`Removing '${d}' will also remove ${n.length} associated Dataverse table(s): ${a}.`)}if(!t&&o.interactive){let a=n.length>0?`Remove '${g}' and its ${n.length} Dataverse table(s)?`:`Are you sure you want to remove the ${v} '${d}' from '${g}'?`;if(!await C({message:a})){p("Remove cancelled.");return}}let h=w(),k=e.getAuthenticationProvider(),j={vfs:m,authProvider:k,region:h.region,environmentName:h.environmentName,localFilePaths:i,actionsParams:{apiId:I,dataSourceName:d,sqlStoredProcedure:""},logger:b()};if(await $(j)){if(S(`Removed ${v} '${d}' from '${g}'.`),n.length>0){let a=n.map(c=>c.name).join(", ");S(`Also removed ${n.length} Dataverse table(s): ${a}.`)}}else p(`The ${v} '${d}' was not found or could not be removed.`)}async function O(e){let o;try{o=await y(e)}catch{throw new u(`Could not read ms.config.json at '${e}'. Run this command from your app directory after adding a data source.`)}let{all:i}=N(o);return i.filter(m=>!m.sqlStoredProcedure)}async function F(e){let o=e.map(t=>({value:t.name,label:`${t.name} (${t.connectorDisplayName})`,hint:t.kind})),i=await E({message:"Which data source would you like to remove?",options:o,manualPromptMessage:"Enter the data source name:"}),m=e.find(t=>t.name===i);if(!m)throw new u(`Data source '${i}' not found in ms.config.json.`);return m}function x(e){D({title:"Available data sources",columns:[{header:"Data Source"},{header:"Connector",maxWidth:30},{header:"Type",maxWidth:6}],rows:e.map(o=>[o.name,o.connectorDisplayName,o.kind]),emptyMessage:"No data sources found in ms.config.json.",totalLabel:"data source(s) found"})}function W(e){e.getResolvedCommand()?.path.at(-1)==="connector"?(e.setDescription(`${r.app.remove.deprecation}
9
+
10
+ ${r.app.remove.description}`),e.addExamples(r.app.remove.deprecatedExamples)):(e.setDescription(r.app.remove.description),e.addExamples(r.app.remove.examples)),e.addSwitch({flags:{key:"force",alias:"f"},description:r.app.remove.options.force}),e.addOptions([{flags:{key:f.DataSourceName.name,alias:f.DataSourceName.alias},env:f.DataSourceName.envVar,description:r.app.remove.options.dataSourceName,optionalInNonInteractive:!0}])}export{z as removeDataSourceAsync};
11
+ /*!
12
+ * Copyright (C) Microsoft Corporation. All rights reserved.
13
+ */
14
+ //# sourceMappingURL=RemoveDataSource-RRND46QZ.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 I}from"./chunk-WWVAS3DS.js";import"./chunk-DKSLWH4O.js";import"./chunk-TXMTKOEJ.js";import{b as D}from"./chunk-GE3UFHZ5.js";import{B as c,Nb as d,Ob as E,jb as w,k as s,kb as h,w as j,x as p,z as f}from"./chunk-4XKA5APP.js";import"./chunk-BRRT2E75.js";import"./chunk-2LDU3F6O.js";import"./chunk-RFLXPXBN.js";import"./chunk-FHE3OXIP.js";import"./chunk-OUKOEUZA.js";import{i as m}from"./chunk-4U53RYJJ.js";import{a as l}from"./chunk-HOIFXUTG.js";import{C as y,D as g,K as v}from"./chunk-KKC5ZK4D.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function U(e){let t=l.project.remove.deployment;e.setDescription(t.description),e.addExamples(t.examples),e.addOptions([{flags:{key:m.Target.name},description:t.options.target}]),e.addSwitch({flags:{key:"force",alias:"f"},description:t.options.force}),await e.runVerb();let o=w(await e.getOption(m.Target.name)),r=E();if(r.projectConfigError)throw new f("Unable to read the managed project configuration. Fix or remove the project configuration file and retry.");let a=e.isJsonMode(),u=await e.getOption("force",!0)===!0;if(!u&&(a||!r.interactive))throw new p("Removing a deployment target requires confirmation. Pass --force in JSON or non-interactive mode.");let i;try{i=await I(e,!1,k(d()))}catch(n){throw n instanceof p||n instanceof f?n:b(n)}e.updateEnvironmentId(i.environmentId);try{if(await h({projectId:i.projectId,deploymentTargetName:o,logger:d(),...u?{}:{confirm:async()=>await D({message:`Remove deployment target '${o}' from project '${i.projectId}' in environment '${i.environmentId}'? This removal cannot be undone.`,initialValue:!1})}})===null){v("Deployment target removal cancelled. No removal request was sent.");return}}catch(n){throw b(n)}if(a){g({projectId:i.projectId,deploymentTargetName:o,deletionRequested:!0});return}y(`Removal started for deployment target '${o}'. Its name and URL remain reserved until removal completes.`)}function k(e){return{trackActivityEvent:(t,o,r)=>e.trackActivityEvent(t,o,r),trackVerboseEvent:(t,o,r)=>e.trackVerboseEvent(t,o,r),trackErrorEvent:(t,o,r)=>e.trackErrorEvent(t,o,r),trackScenario:(t,o)=>{let r=e.trackScenario(t,o);return{...r,failure:a=>r.failure(void 0,{status:a instanceof s?a.status:void 0})}},identifyUser:t=>e.identifyUser(t),get sessionId(){return e.sessionId},set sessionId(t){e.sessionId=t},flush:async()=>await e.flush(),withDefaults:t=>k(e.withDefaults(t)),addDefaults:t=>e.addDefaults(t)}}function b(e){let t=e instanceof s?e.status:void 0;return d().trackErrorEvent("ManagedProject.RemoveDeployment.Failed",{status:t}),e instanceof s&&t===404?e.code==="ProjectNotFound"?new c("The current project could not be found.",void 0,{errorCode:"ProjectNotFound",outputDetails:{code:"ProjectNotFound"}}):e.code==="StageNotFound"?new c("Deployment target 'test' could not be found in the current project.",void 0,{errorCode:"DeploymentTargetNotFound",outputDetails:{code:"DeploymentTargetNotFound"}}):new c("The project or deployment target could not be found."):new j("The deployment target removal request failed. Inspect its current state before retrying; background teardown may already have started.")}export{U as removeDeploymentAsync};
8
+ /*!
9
+ * Copyright (C) Microsoft Corporation. All rights reserved.
10
+ */
11
+ //# sourceMappingURL=RemoveDeployment-STNFNNZF.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}from"./chunk-3YRE4IQ3.js";import"./chunk-HBLO3WDD.js";import"./chunk-TYRVM4PP.js";import{o as s}from"./chunk-GE3UFHZ5.js";import"./chunk-4XKA5APP.js";import"./chunk-FHE3OXIP.js";import{a as n,b as r}from"./chunk-OUKOEUZA.js";import"./chunk-KKC5ZK4D.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";var a=class{_msalClient;_clientId;_clientSecret;_tenantId;_region;constructor(){let t=r("SP_CLIENT_ID"),e=r("SP_CLIENT_SECRET"),i=r("SP_TENANT_ID");if(!t||!e||!i)throw new Error(`Service principal environment variables ${n("SP_CLIENT_ID")}, ${n("SP_CLIENT_SECRET")}, and ${n("SP_TENANT_ID")} must be set`);this._clientId=t,this._clientSecret=e,this._tenantId=i}async initAsync(t){this._region=t;let e={auth:{clientId:this._clientId,clientSecret:this._clientSecret,authority:s(this._region,this._tenantId)}};this._msalClient=new c(e)}async getAccessTokenForResource(t,e){if(!this._msalClient)throw new Error("Authentication not initialized yet");let i={scopes:[t+"/.default"]},o=await this._msalClient.acquireTokenByClientCredential(i);if(!o?.accessToken)throw new Error("Failed to acquire token using service principal");return o.accessToken}getUserTenantId(){return this._tenantId}async getCachedAccountAsync(){return`Service Principal:${this._clientId}`}};export{a as ServicePrincipalAuthenticationProvider};
8
+ /*!
9
+ * Copyright (C) Microsoft Corporation. All rights reserved.
10
+ */
11
+ //# sourceMappingURL=ServicePrincipalAuthenticationProvider-7RBHTYYY.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{Gb as s,Ib as S,Ob as v,h,i as w,x as r}from"./chunk-4XKA5APP.js";import"./chunk-FHE3OXIP.js";import"./chunk-OUKOEUZA.js";import{a as c}from"./chunk-HOIFXUTG.js";import{D as m,I as f,a as d}from"./chunk-KKC5ZK4D.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";function R(t){let o=new Set(s.map(n=>`--${n.name}`)),e=t.getRegisteredFlags();for(let n of process.argv.slice(2))if(n.startsWith("--")&&n!=="--help"&&!o.has(n)&&!e.has(n))return n;return null}function E(){for(let t of s){let o=`--${t.name}`;if(process.argv.filter(n=>n===o).length>1)return t.name}return null}var A="The setting value or name you have input is invalid. Check your input, and try again.",N="You have input duplicate setting flags. Try again with one value per setting.";async function O(t){if(F(t),R(t))throw new r(A);if(E())throw new r(N);await t.runVerb();let n=v();if(!n.appConfig)throw new r(`No ${d} found in the current directory. Run "${"ms"} app init" first.`);let a={},u=[];for(let i of s){let p=S(i.name),g=await t.getOption(p,!0);g!==void 0&&i.type==="boolean"&&(g!=="true"&&g!=="false"?u.push(i.name):a[i.configKey]=g==="true")}if(u.length>0)throw new r(A);if(Object.keys(a).length===0){f("No settings provided. Use --<setting> <value> to update a setting, e.g. --show-header false."),f(`Run "${"ms"} app get-settings" to see available settings.`);return}let l=await h(n.fileConfig.appConfigPath);if(l.appSettings={...l.appSettings??{},...a},await w(n.fileConfig.appConfigPath,l),t.isJsonMode())m({settings:a});else for(let i of s){let p=a[i.configKey];p!==void 0&&f(`${i.name} = ${p}`)}}var C={"show-header":"APP_SHOW_HEADER"};function F(t){t.setDescription(c.app["set-setting"].description),t.addExamples(c.app["set-setting"].examples??[]);let o=c.app["set-setting"].options;t.addOptions(s.map(e=>({flags:{key:e.name},env:C[e.name],description:o?.[e.name]??e.description})))}export{O as setSettingAsync};
8
+ /*!
9
+ * Copyright (C) Microsoft Corporation. All rights reserved.
10
+ */
11
+ //# sourceMappingURL=SetSetting-CEH44OT3.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 s,d as r,e as h}from"./chunk-ADRQC63G.js";import{Db as f,Eb as g,x as m}from"./chunk-4XKA5APP.js";import"./chunk-FHE3OXIP.js";import"./chunk-OUKOEUZA.js";import{b as e}from"./chunk-4U53RYJJ.js";import{a as d}from"./chunk-HOIFXUTG.js";import{C as a,D as o,K as p}from"./chunk-KKC5ZK4D.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function O(n){u(n),await n.runVerb();let t=await n.getOption(e.Locale.name,!0),i=h(e.Validation.name,await n.getOption(e.Validation.name,!0));if(t===void 0==(i===void 0))throw new m("Pass exactly one of --locale or --validation.");if(t!==void 0){let{schemaPath:l}=await r(async()=>await f({...s(),locale:t}));if(n.isJsonMode()){o({schemaPath:l,locale:t});return}a(`Locale set to '${t}' in ${l}`),p("Changing locale changes string-index collation. Validate the change in Preview before deploying.");return}let{schemaPath:c}=await r(async()=>await g({...s(),validationEnabled:i}));if(n.isJsonMode()){o({schemaPath:c,validation:i});return}a(`Schema validation ${i?"enabled":"disabled"} in ${c}`)}function u(n){let t=d.project.state["set-setting"];n.setDescription(t.description),n.addExamples(t.examples),n.addOptions([{flags:{key:e.Locale.name},description:t.options.locale,optionalInNonInteractive:!0},{flags:{key:e.Validation.name},description:t.options.validation,optionalInNonInteractive:!0}])}export{O as dataSetSettingAsync};
8
+ /*!
9
+ * Copyright (C) Microsoft Corporation. All rights reserved.
10
+ */
11
+ //# sourceMappingURL=SetSetting-Q7EQNOTI.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{d as I}from"./chunk-2LKCCYRF.js";import{l as f,m as h}from"./chunk-GE3UFHZ5.js";import{Nb as d,Ta as l,x as c}from"./chunk-4XKA5APP.js";import"./chunk-FHE3OXIP.js";import"./chunk-OUKOEUZA.js";import{G as n}from"./chunk-4U53RYJJ.js";import{a as r}from"./chunk-HOIFXUTG.js";import{C as s,D as p,I as m}from"./chunk-KKC5ZK4D.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function N(e){A(e),await e.runVerb();let k=await h(e),i=await e.getTenantIdAsync();if(!i)throw new c("Unable to determine tenant ID. Ensure you are logged in.");let o=await f(e),t;try{t=await l({tenantId:i,environmentId:k,logger:d(),actionsParams:{appName:o}})}catch(a){throw I(a)??a}if(e.isJsonMode()){p({appName:o,...t});return}s(`Share link created for '${o}' (id: ${t.appShareLinkId}). Anyone in your tenant who opens this link will be granted Microsoft App Reader access. Share URL:`),m(t.shareLinkUrl)}function A(e){e.setDescription(r.app.shareLink.create.description),e.addExamples(r.app.shareLink.create.examples),e.addOptions([{flags:{key:n.AppName.name},env:n.AppName.envVar,description:r.app.shareLink.create.options.app,optionalInNonInteractive:!0},{flags:{key:n.EnvironmentId.name,alias:n.EnvironmentId.alias},env:n.EnvironmentId.envVar,description:r.app.shareLink.create.options.environmentId,optionalInNonInteractive:!0}])}export{N as shareLinkCreateAsync};
8
+ /*!
9
+ * Copyright (C) Microsoft Corporation. All rights reserved.
10
+ */
11
+ //# sourceMappingURL=ShareLinkCreate-ZUVHUQLH.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{d as f}from"./chunk-2LKCCYRF.js";import{l as c,m as h}from"./chunk-GE3UFHZ5.js";import{Nb as d,Ua as l,x as m}from"./chunk-4XKA5APP.js";import"./chunk-FHE3OXIP.js";import"./chunk-OUKOEUZA.js";import{H as r}from"./chunk-4U53RYJJ.js";import{a as t}from"./chunk-HOIFXUTG.js";import{A as s,D as p}from"./chunk-KKC5ZK4D.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function w(e){g(e),await e.runVerb();let I=await h(e),o=await e.getTenantIdAsync();if(!o)throw new m("Unable to determine tenant ID. Ensure you are logged in.");let i=await c(e),a;try{a=await l({tenantId:o,environmentId:I,logger:d(),actionsParams:{appName:i}})}catch(n){throw f(n)??n}if(e.isJsonMode()){p({appName:i,...a});return}s({title:`Share links for '${i}'`,columns:[{header:"LINK ID"},{header:"ROLE"},{header:"REDEEMERS"},{header:"CREATED BY",maxWidth:36}],rows:a.value.map(n=>[n.appShareLinkId,n.managedAppRoleName,String(n.redeemedPrincipalIds.length),n.createdByObjectId]),emptyMessage:`No share links issued for '${i}'.`,totalLabel:"link(s)"})}function g(e){e.setDescription(t.app.shareLink.list.description),e.addExamples(t.app.shareLink.list.examples),e.addOptions([{flags:{key:r.AppName.name},env:r.AppName.envVar,description:t.app.shareLink.list.options.app,optionalInNonInteractive:!0},{flags:{key:r.EnvironmentId.name,alias:r.EnvironmentId.alias},env:r.EnvironmentId.envVar,description:t.app.shareLink.list.options.environmentId,optionalInNonInteractive:!0}])}export{w as shareLinkListAsync};
8
+ /*!
9
+ * Copyright (C) Microsoft Corporation. All rights reserved.
10
+ */
11
+ //# sourceMappingURL=ShareLinkList-IEYU6NZW.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{d as w}from"./chunk-2LKCCYRF.js";import{b as v,l as u,m as I}from"./chunk-GE3UFHZ5.js";import{Nb as k,Ob as h,Va as m,k as f,x as p}from"./chunk-4XKA5APP.js";import"./chunk-FHE3OXIP.js";import"./chunk-OUKOEUZA.js";import{J as n}from"./chunk-4U53RYJJ.js";import{a as r}from"./chunk-HOIFXUTG.js";import{C as l,D as a,K as s}from"./chunk-KKC5ZK4D.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function R(e){L(e),await e.runVerb();let c=await I(e),d=await e.getTenantIdAsync();if(!d)throw new p("Unable to determine tenant ID. Ensure you are logged in.");let i=await u(e),o=await e.getOption(n.LinkId.name);if(!o)throw new p("Provide a share link ID via --link-id.");if(!await e.getOption(n.Force.name,!0)&&h().interactive&&!await v({message:`Revoke share link '${o}' for app '${i}'? Anyone who has not yet redeemed it will lose access; redeemers will have their Microsoft App Reader role revoked.`})){s("Revoke cancelled.");return}try{await m({tenantId:d,environmentId:c,logger:k(),actionsParams:{appName:i,appShareLinkId:o}})}catch(t){if(g(t)){if(e.isJsonMode()){a({appName:i,linkId:o,existed:!1});return}s(`Share link '${o}' was not found on '${i}'; nothing was revoked.`);return}throw w(t)??t}if(e.isJsonMode()){a({appName:i,linkId:o,existed:!0});return}l(`Share link '${o}' revoked for '${i}'.`)}function g(e){if(!(e instanceof f)||e.status!==404||!e.body)return!1;try{return JSON.parse(e.body).error?.code==="AppShareLinkNotFound"}catch{return!1}}function L(e){e.setDescription(r.app.shareLink.revoke.description),e.addExamples(r.app.shareLink.revoke.examples),e.addSwitch({flags:{key:n.Force.name,alias:n.Force.alias},description:r.app.shareLink.revoke.options.force}),e.addOptions([{flags:{key:n.LinkId.name,alias:n.LinkId.alias},env:n.LinkId.envVar,description:r.app.shareLink.revoke.options.linkId},{flags:{key:n.AppName.name},env:n.AppName.envVar,description:r.app.shareLink.revoke.options.app,optionalInNonInteractive:!0},{flags:{key:n.EnvironmentId.name,alias:n.EnvironmentId.alias},env:n.EnvironmentId.envVar,description:r.app.shareLink.revoke.options.environmentId,optionalInNonInteractive:!0}])}export{R as shareLinkRevokeAsync};
8
+ /*!
9
+ * Copyright (C) Microsoft Corporation. All rights reserved.
10
+ */
11
+ //# sourceMappingURL=ShareLinkRevoke-22RFGOFJ.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 L,b as y,c as x,d as $,e as P,f as G}from"./chunk-HSNRWBA6.js";import{l as b,m as O}from"./chunk-GE3UFHZ5.js";import{N as I,Nb as N,O as g,Oa as M,Ob as E,P as h,ka as R,ob as S,x as u}from"./chunk-4XKA5APP.js";import"./chunk-FHE3OXIP.js";import"./chunk-OUKOEUZA.js";import{I as r}from"./chunk-4U53RYJJ.js";import{a as l}from"./chunk-HOIFXUTG.js";import{A as w,D,I as T,K as C}from"./chunk-KKC5ZK4D.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function Z(e){k(e),await e.runVerb();let i=await O(e),p=await e.getTenantIdAsync();if(!p)throw new u("Unable to determine tenant ID. Ensure you are logged in.");let o=await b(e),f=!!await e.getOption("app",!0),m=await e.getOption("access",!0);if(!m||!m.trim())throw new u("The --access option is required. Use --access play, --access edit, or --access test.");let t=x(m),s,a="none",d;if(f)(t==="edit"||e.isJsonMode())&&(s=await P({tenantId:p,environmentId:i,appName:o}),a=F(s));else{let n=E().appConfig??{};d=y(n.repositoryId)?n.repositoryId:void 0,a=t==="edit"?$(n):n.repoType??"none"}let J=W(t,a);!e.isJsonMode()&&t==="edit"&&a==="github"&&C(L);let A=await Promise.all(J.map(n=>V({target:n,tenantId:p,environmentId:i,appName:o,appInfo:s,configRepoId:d})));if(e.isJsonMode()){D({appName:o,access:t,repoType:a,results:A.map(n=>({scope:n.scope,roleDefinitionName:n.roleDefinitionName,...n.repoId?{repoId:n.repoId}:{},unclassifiedCount:n.unclassifiedCount,value:n.assignments}))});return}let U=A.flatMap(n=>n.assignments.map(c=>[n.scope,c.principalObjectId??"-",String(c.principalType??"-"),B(c.roleDefinitionName),c.createdOn??"-"]));w({title:`${t==="play"?"Play":t==="test"?"Test":"Edit"} shares for '${o}'`,columns:[{header:"SCOPE"},{header:"PRINCIPAL ID"},{header:"TYPE"},{header:"ROLE"},{header:"CREATED ON"}],rows:U,emptyMessage:`No ${t} shares for '${o}'.`,totalLabel:"assignment(s)"});let v=A.reduce((n,c)=>n+c.unclassifiedCount,0);v>0&&T(`${v} assignment(s) with an unrecognized role definition were not shown.`)}async function V(e){let{target:i,tenantId:p,environmentId:o,appName:f,appInfo:m,configRepoId:t}=e;if(i.scope==="app"){let d=await M({tenantId:p,environmentId:o,logger:N(),actionsParams:{appName:f,roleDefinitionName:i.roleDefinitionName}});return{scope:"app",roleDefinitionName:i.roleDefinitionName,assignments:d.assignments,unclassifiedCount:d.unclassifiedCount}}let s=[t,m?.repositoryId].find(y);if(s||(s=(await G({tenantId:p,environmentId:o,appName:f})).repositoryId),!y(s))throw new u(`App '${f}' has no associated repository, so edit access cannot be listed.`);let a=await S({tenantId:p,environmentId:o,logger:N(),actionsParams:{repoId:s}});return{scope:"repo",roleDefinitionName:i.roleDefinitionName,repoId:s,assignments:a.assignments,unclassifiedCount:a.unclassifiedCount}}function k(e){e.setDescription(l.app.share.list.description),e.addExamples(l.app.share.list.examples),e.addOptions([{flags:{key:r.AppName.name},env:r.AppName.envVar,description:l.app.share.list.options.app,optionalInNonInteractive:!0},{flags:{key:r.EnvironmentId.name,alias:r.EnvironmentId.alias},env:r.EnvironmentId.envVar,description:l.app.share.list.options.environmentId,optionalInNonInteractive:!0},{flags:{key:r.Access.name},env:r.Access.envVar,description:l.app.share.list.options.access}])}function F(e){switch(e.repoType){case"Native":return"native";case"ExternalGitProviderBound":return"github";default:return"none"}}function B(e){switch(e){case I:return"App Reader";case g:return"App Contributor";case h:return"App Test Operator";case R:return"Repository Contributor";default:return e??"-"}}function W(e,i){return e==="play"||e==="test"?[{scope:"app",roleDefinitionName:e==="test"?h:I}]:i!=="native"?[{scope:"app",roleDefinitionName:g}]:[{scope:"repo",roleDefinitionName:R},{scope:"app",roleDefinitionName:g}]}export{Z as shareListAsync};
8
+ /*!
9
+ * Copyright (C) Microsoft Corporation. All rights reserved.
10
+ */
11
+ //# sourceMappingURL=ShareList-6UWIHPBM.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 r}from"./chunk-YRPTITKD.js";import"./chunk-HSNRWBA6.js";import"./chunk-2LKCCYRF.js";import"./chunk-SQI4XLR7.js";import"./chunk-GE3UFHZ5.js";import"./chunk-4XKA5APP.js";import"./chunk-FHE3OXIP.js";import"./chunk-OUKOEUZA.js";import"./chunk-4U53RYJJ.js";import"./chunk-HOIFXUTG.js";import"./chunk-KKC5ZK4D.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function i(e){await r(e,"share")}export{i as shareMaafAppAsync};
8
+ /*!
9
+ * Copyright (C) Microsoft Corporation. All rights reserved.
10
+ */
11
+ //# sourceMappingURL=ShareMaafApp-SFNOOMOD.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{Nb as d,z as m}from"./chunk-4XKA5APP.js";import{b as p,d as u,e as y,f as g}from"./chunk-RFLXPXBN.js";import"./chunk-FHE3OXIP.js";import"./chunk-OUKOEUZA.js";import{a as s}from"./chunk-HOIFXUTG.js";import{B as a,D as o,K as c}from"./chunk-KKC5ZK4D.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";var l={remote:!0,console:!1};async function C(e){f(e,s.telemetry.enable.options),e.setDescription(s.telemetry.enable.description),e.addExamples(s.telemetry.enable.examples),await e.runVerb();let t=S(await e.getOption("remote",!0),await e.getOption("console",!0),!0);b(t)}async function v(e){f(e,s.telemetry.disable.options),e.setDescription(s.telemetry.disable.description),e.addExamples(s.telemetry.disable.examples),await e.runVerb();let t=S(await e.getOption("remote",!0),await e.getOption("console",!0),!1);b(t)}async function k(e){e.setDescription(s.telemetry.status.description),e.addExamples(s.telemetry.status.examples),await e.runVerb(),U(e.isJsonMode())}function f(e,t){e.addSwitches([{flags:{key:"remote"},description:t.remote},{flags:{key:"console"},description:t.console}])}function S(e,t,r){let i=!e&&!t,n={};return(e||i)&&(n.remote=r),t&&(n.console=r),n}function U(e){try{let t=u();if(t&&("remote"in t||"console"in t)){let r=t,i={remote:r.remote??l.remote,console:r.console??l.console};if(e){o({settings:i});return}a({title:"Telemetry Settings:",items:[i],fields:[{label:"Remote",value:n=>String(n.remote)},{label:"Console",value:n=>String(n.console)}]})}else{if(e){o({settings:null});return}c("No telemetry settings found. Using default settings.")}}catch(t){throw T("read",t)}}function b(e){try{g(t=>({...l,...t,...e}))}catch(t){throw T("update",t)}}function T(e,t){return d().trackErrorEvent("Telemetry.SettingsFileFailed",{operation:e,...y(t)}),p(),new m(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 telemetry settings to the CLI's userSettings.json. Make sure it contains a valid JSON object and can be written.")}export{v as telemetryDisableAsync,C as telemetryEnableAsync,k as telemetryStatusAsync};
8
+ /*!
9
+ * Copyright (C) Microsoft Corporation. All rights reserved.
10
+ */
11
+ //# sourceMappingURL=TelemetrySettings-XCT73DEI.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 r}from"./chunk-YRPTITKD.js";import"./chunk-HSNRWBA6.js";import"./chunk-2LKCCYRF.js";import"./chunk-SQI4XLR7.js";import"./chunk-GE3UFHZ5.js";import"./chunk-4XKA5APP.js";import"./chunk-FHE3OXIP.js";import"./chunk-OUKOEUZA.js";import"./chunk-4U53RYJJ.js";import"./chunk-HOIFXUTG.js";import"./chunk-KKC5ZK4D.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function i(e){await r(e,"unshare")}export{i as unshareMaafAppAsync};
8
+ /*!
9
+ * Copyright (C) Microsoft Corporation. All rights reserved.
10
+ */
11
+ //# sourceMappingURL=UnshareMaafApp-TU7U3LQ3.js.map