@microsoft/managed-apps-cli 0.22.0 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/README.md +3 -1
  2. package/dist/AddConfig-GZO2UMFR.js +12 -0
  3. package/dist/AddConnector-HJCCENAM.js +23 -0
  4. package/dist/{AuthStatus-6DMK7O6W.js → AuthStatus-WCICFN6O.js} +2 -2
  5. package/dist/{AuthSwitch-NUQIIRCG.js → AuthSwitch-5PKHCTM2.js} +2 -2
  6. package/dist/Bin.js +1 -1
  7. package/dist/BuildMaafApp-Q74EFM3Q.js +11 -0
  8. package/dist/Cli-7EVTIORX.js +54 -0
  9. package/dist/CloneMaafApp-EKHHLMWD.js +11 -0
  10. package/dist/CreateMaafApp-L3XX2UVT.js +20 -0
  11. package/dist/DeleteMaafApp-YCDKWFRG.js +11 -0
  12. package/dist/DeployMaafApp-HF67BQRZ.js +14 -0
  13. package/dist/{Dev-ICCA5DEJ.js → Dev-BTJUJGP5.js} +2 -2
  14. package/dist/{EnvironmentVariableAuthenticationProvider-LYCQ5D47.js → EnvironmentVariableAuthenticationProvider-VNN4AG2E.js} +2 -2
  15. package/dist/GetMaafBuildStatus-7B6ZNSEA.js +11 -0
  16. package/dist/{GetSettings-ZI2IBKV5.js → GetSettings-GJWIPK2T.js} +2 -2
  17. package/dist/{InfoMaafApp-FL5PICDD.js → InfoMaafApp-WGNDYYGN.js} +2 -2
  18. package/dist/Init-TJOSV5DE.js +11 -0
  19. package/dist/ListConnectorActions-HTD6YSCY.js +11 -0
  20. package/dist/ListConnectors-OET7STMW.js +11 -0
  21. package/dist/{ListMaafApps-3W6W6UYP.js → ListMaafApps-KRXJMAEU.js} +2 -2
  22. package/dist/{Login-7RW6OEST.js → Login-5TFNB24B.js} +2 -2
  23. package/dist/{Logout-IXK2TMRL.js → Logout-35U4J627.js} +2 -2
  24. package/dist/{MockFetch-THQJ4KFB.js → MockFetch-XSZECQYX.js} +2 -2
  25. package/dist/{NodeMsalAuthenticationProvider-VVQ6CCZ5.js → NodeMsalAuthenticationProvider-OUL57BVL.js} +2 -2
  26. package/dist/Pack-S7P4MIT6.js +8 -0
  27. package/dist/{PlayMaafApp-5H3DCJ2C.js → PlayMaafApp-D4KLJKLT.js} +2 -2
  28. package/dist/RefreshDataSource-N5CEH23S.js +11 -0
  29. package/dist/{RefreshGitAuth-IQBAFR37.js → RefreshGitAuth-2VL6VBLU.js} +2 -2
  30. package/dist/{RemoveDataSource-PGPLMJUX.js → RemoveDataSource-XR5Q4O3F.js} +2 -2
  31. package/dist/{ServicePrincipalAuthenticationProvider-IZZRJFZQ.js → ServicePrincipalAuthenticationProvider-H3PTPXYY.js} +2 -2
  32. package/dist/{SetSetting-SEWDA4TF.js → SetSetting-HXY4YSKC.js} +2 -2
  33. package/dist/{ShareLinkCreate-T5FN47J2.js → ShareLinkCreate-YG3DACP2.js} +2 -2
  34. package/dist/{ShareLinkList-6JCVEYNC.js → ShareLinkList-XF6BIB3M.js} +2 -2
  35. package/dist/ShareLinkRevoke-4USAQKLB.js +11 -0
  36. package/dist/ShareList-6QI7ZAMZ.js +11 -0
  37. package/dist/{ShareMaafApp-6MKZ33HW.js → ShareMaafApp-PZI5MCBA.js} +2 -2
  38. package/dist/{TelemetrySettings-RXPPIEVO.js → TelemetrySettings-WWVPRF7T.js} +2 -2
  39. package/dist/{UnshareMaafApp-OSE2TOBJ.js → UnshareMaafApp-MHBIV5OR.js} +2 -2
  40. package/dist/chunk-2FNWZUPW.js +15 -0
  41. package/dist/chunk-2HSJ2XAQ.js +13 -0
  42. package/dist/{chunk-PPW4XUZO.js → chunk-3FP37TPE.js} +9 -9
  43. package/dist/chunk-5XRK3F43.js +11 -0
  44. package/dist/{chunk-6RSE3J4X.js → chunk-7PH2NK5K.js} +2 -2
  45. package/dist/chunk-DAG6RPOF.js +11 -0
  46. package/dist/{chunk-SNWTSI75.js → chunk-DD7E4ADI.js} +2 -2
  47. package/dist/{chunk-6LKH5WE7.js → chunk-F3HGM3IU.js} +23 -21
  48. package/dist/chunk-FMJDKXNM.js +12 -0
  49. package/dist/chunk-HCPTQP7J.js +11 -0
  50. package/dist/chunk-I22E6YZT.js +11 -0
  51. package/dist/chunk-LDP2SHPJ.js +11 -0
  52. package/dist/{chunk-KYL2Y5G4.js → chunk-PKDXP7CL.js} +2 -2
  53. package/dist/chunk-SBVJ4SMO.js +20 -0
  54. package/dist/chunk-SCJXITCN.js +12 -0
  55. package/dist/chunk-TZRZFNLH.js +38 -0
  56. package/dist/{chunk-4LIR3ZYP.js → chunk-UIW77LMA.js} +251 -251
  57. package/dist/chunk-WQKDXHGX.js +11 -0
  58. package/dist/{chunk-4VBFOKV6.js → chunk-X5O77GZS.js} +2 -2
  59. package/dist/{chunk-EX6IKPAO.js → chunk-Y7TZZLPW.js} +2 -2
  60. package/dist/chunk-ZIONKKAV.js +44 -0
  61. package/package.json +4 -4
  62. package/dist/AddConnector-5DUBFLEK.js +0 -41
  63. package/dist/BuildMaafApp-A4IUU6LI.js +0 -11
  64. package/dist/Cli-LYSWG64H.js +0 -54
  65. package/dist/CloneMaafApp-B672N7T5.js +0 -11
  66. package/dist/CreateMaafApp-RWL7FXSP.js +0 -20
  67. package/dist/DeleteMaafApp-GT4CEFAE.js +0 -11
  68. package/dist/DeployMaafApp-E4TQU6RO.js +0 -14
  69. package/dist/GetMaafBuildStatus-UGAHVANE.js +0 -11
  70. package/dist/Init-XCSK3WQM.js +0 -11
  71. package/dist/ListConnectorActions-B2YD24RX.js +0 -11
  72. package/dist/ListConnectors-MYUEVJPT.js +0 -11
  73. package/dist/Pack-IWU3PFQL.js +0 -8
  74. package/dist/RefreshDataSource-XQT7LVMO.js +0 -11
  75. package/dist/ShareLinkRevoke-OH5DZDHR.js +0 -11
  76. package/dist/ShareList-QCEL7QNJ.js +0 -11
  77. package/dist/chunk-23T63QIT.js +0 -15
  78. package/dist/chunk-3JIZGVCA.js +0 -11
  79. package/dist/chunk-47LJLFDF.js +0 -11
  80. package/dist/chunk-7BRIEYGR.js +0 -20
  81. package/dist/chunk-7GGFN2IW.js +0 -11
  82. package/dist/chunk-AQLFVAFU.js +0 -38
  83. package/dist/chunk-EQCYKUEU.js +0 -12
  84. package/dist/chunk-IQGMFWXB.js +0 -12
  85. package/dist/chunk-LQ65CHNN.js +0 -13
  86. package/dist/chunk-UNJJUCSA.js +0 -11
  87. package/dist/chunk-VMSJG53Y.js +0 -11
@@ -4,7 +4,7 @@ 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 w,b as y}from"./chunk-3YRE4IQ3.js";import"./chunk-HBLO3WDD.js";import{a as I}from"./chunk-OL6CTXQR.js";import"./chunk-TYRVM4PP.js";import{k as v}from"./chunk-SNWTSI75.js";import{va as m}from"./chunk-4LIR3ZYP.js";import{b as u}from"./chunk-RBG2H562.js";import{c as h,e as f,f as g,m as _}from"./chunk-UNJJUCSA.js";import"./chunk-6RSE3J4X.js";import"./chunk-EX6IKPAO.js";import{i as p,j as A}from"./chunk-PVAIJSAI.js";import"./chunk-PPW4XUZO.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";import*as b from"node:fs";import*as R from"node:path";import E from"open";import*as c from"fs";import*as C from"path";var S="active-account.json",d=class{constructor(e=h){this._cacheDir=e;this._filePath=C.join(this._cacheDir,S)}_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 P=class{_msalClient;_tenantId;_region;_persistence;_activeStore;_cacheDirectory;_isJsonMode=()=>process.argv.includes("--json");constructor(e=h){this._cacheDirectory=e,this._activeStore=new d(e)}async initAsync(e){this._region=e;let{DataProtectionScope:t,PersistenceCachePlugin:n,PersistenceCreator:i}=await import("@azure/msal-node-extensions"),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:v(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(){return this._tenantId}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 b.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(`
7
+ import{a as w,b as y}from"./chunk-3YRE4IQ3.js";import"./chunk-HBLO3WDD.js";import{a as I}from"./chunk-OL6CTXQR.js";import"./chunk-TYRVM4PP.js";import{k as v}from"./chunk-DD7E4ADI.js";import{Ha as m}from"./chunk-UIW77LMA.js";import{b as u}from"./chunk-RBG2H562.js";import{c as h,e as f,f as g,n as _}from"./chunk-LDP2SHPJ.js";import"./chunk-7PH2NK5K.js";import"./chunk-Y7TZZLPW.js";import{i as p,j as A}from"./chunk-PVAIJSAI.js";import"./chunk-3FP37TPE.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";import*as b from"node:fs";import*as R from"node:path";import E from"open";import*as c from"fs";import*as C from"path";var S="active-account.json",d=class{constructor(e=h){this._cacheDir=e;this._filePath=C.join(this._cacheDir,S)}_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 P=class{_msalClient;_tenantId;_region;_persistence;_activeStore;_cacheDirectory;_isJsonMode=()=>process.argv.includes("--json");constructor(e=h){this._cacheDirectory=e,this._activeStore=new d(e)}async initAsync(e){this._region=e;let{DataProtectionScope:t,PersistenceCachePlugin:n,PersistenceCreator:i}=await import("@azure/msal-node-extensions"),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:v(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(){return this._tenantId}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 b.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
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
9
  ${r}
10
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||T(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 I: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+`
@@ -14,4 +14,4 @@ ${i}`)}},successTemplate:"You can close this window now.",...t&&{loginHint:t}}}}
14
14
  /*!
15
15
  * Copyright (C) Microsoft Corporation. All rights reserved.
16
16
  */
17
- //# sourceMappingURL=NodeMsalAuthenticationProvider-VVQ6CCZ5.js.map
17
+ //# sourceMappingURL=NodeMsalAuthenticationProvider-OUL57BVL.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{b as a,c as b,d as c,e as d}from"./chunk-F3HGM3IU.js";import"./chunk-HBLO3WDD.js";import"./chunk-OL6CTXQR.js";import"./chunk-UIW77LMA.js";import"./chunk-RBG2H562.js";import"./chunk-LDP2SHPJ.js";import"./chunk-7PH2NK5K.js";import"./chunk-Y7TZZLPW.js";import"./chunk-PVAIJSAI.js";import"./chunk-WQKDXHGX.js";import"./chunk-3FP37TPE.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";export{b as assertAppConfigSchemaValid,a as assertPackPreconditions,c as packAppArtifactAsync,d as packAsync};
8
+ //# sourceMappingURL=Pack-S7P4MIT6.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{h as b,i as I}from"./chunk-SNWTSI75.js";import{ba as g,ua as h}from"./chunk-4LIR3ZYP.js";import{b as s}from"./chunk-RBG2H562.js";import"./chunk-UNJJUCSA.js";import"./chunk-6RSE3J4X.js";import"./chunk-EX6IKPAO.js";import{p as n}from"./chunk-3JIZGVCA.js";import{c as w,d as u,h as y,i as v}from"./chunk-PVAIJSAI.js";import{a}from"./chunk-47LJLFDF.js";import"./chunk-PPW4XUZO.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";import A from"open";async function E(e){B(e),await e.runVerb();let o=await b(e),t=await I(e),p=await e.getTenantIdAsync();if(!p)throw new s("Unable to determine tenant ID. Ensure you are logged in.");let i=await C(e),d=await e.getOption(n.NoBrowser.camelName,!0)===!1,r=e.isJsonMode(),l=await e.getOption(n.CommitSha.name,!0),m=await e.getOption(n.Branch.name,!0);if(i==="live"&&(l||m))throw new s("--commit and --branch are only valid with --mode preview.");if(l&&m)throw new s("--commit and --branch cannot be used together.");await N({appName:o,environmentId:t,tenantId:p,noBrowser:d,isJson:r,mode:i,commitId:l,branch:m})}async function N(e){let{appName:o,environmentId:t,tenantId:p,noBrowser:i,isJson:d,mode:r,commitId:l,branch:m}=e,f=await g({tenantId:p,environmentId:t,logger:h(),actionsParams:{appName:o}}),c=M(f.appPlayUri,r,l,m);if(!c)throw new s(r==="live"?`No live build is available for app '${o}' yet. Run 'ms app deploy' to deploy one, then re-run 'ms app play'.`:`No appPlayUri is available for app '${o}' in environment '${t}'.`);if(d){u({appName:o,mode:r,url:c,commitHash:f.commitHash??null});return}w(`${r==="live"?"Live":"Preview"} URL for '${f.displayName??o}': ${c}`),r==="live"&&v("Live does not auto-update. Run 'ms app deploy' to publish a new version to the live URL."),await $(c,i)}function M(e,o,t,p="main"){if(!e)return;if(o==="live")return e;let i=e.replace(/\/$/,"");return t?`${i}/commit/${t}`:`${i}/branch/${encodeURIComponent(p)}`}async function $(e,o){if(!o){y(`Opening browser at ${e}`);try{await A(e,{wait:!1})}catch{y(`Could not open browser automatically. Please navigate to:
7
+ import{h as b,i as I}from"./chunk-DD7E4ADI.js";import{Ga as h,ma as g}from"./chunk-UIW77LMA.js";import{b as s}from"./chunk-RBG2H562.js";import"./chunk-LDP2SHPJ.js";import"./chunk-7PH2NK5K.js";import"./chunk-Y7TZZLPW.js";import{r as n}from"./chunk-DAG6RPOF.js";import{c as w,d as u,h as y,i as v}from"./chunk-PVAIJSAI.js";import{a}from"./chunk-WQKDXHGX.js";import"./chunk-3FP37TPE.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";import A from"open";async function E(e){B(e),await e.runVerb();let o=await b(e),t=await I(e),p=await e.getTenantIdAsync();if(!p)throw new s("Unable to determine tenant ID. Ensure you are logged in.");let i=await C(e),d=await e.getOption(n.NoBrowser.camelName,!0)===!1,r=e.isJsonMode(),l=await e.getOption(n.CommitSha.name,!0),m=await e.getOption(n.Branch.name,!0);if(i==="live"&&(l||m))throw new s("--commit and --branch are only valid with --mode preview.");if(l&&m)throw new s("--commit and --branch cannot be used together.");await N({appName:o,environmentId:t,tenantId:p,noBrowser:d,isJson:r,mode:i,commitId:l,branch:m})}async function N(e){let{appName:o,environmentId:t,tenantId:p,noBrowser:i,isJson:d,mode:r,commitId:l,branch:m}=e,f=await g({tenantId:p,environmentId:t,logger:h(),actionsParams:{appName:o}}),c=M(f.appPlayUri,r,l,m);if(!c)throw new s(r==="live"?`No live build is available for app '${o}' yet. Run 'ms app deploy' to deploy one, then re-run 'ms app play'.`:`No appPlayUri is available for app '${o}' in environment '${t}'.`);if(d){u({appName:o,mode:r,url:c,commitHash:f.commitHash??null});return}w(`${r==="live"?"Live":"Preview"} URL for '${f.displayName??o}': ${c}`),r==="live"&&v("Live does not auto-update. Run 'ms app deploy' to publish a new version to the live URL."),await $(c,i)}function M(e,o,t,p="main"){if(!e)return;if(o==="live")return e;let i=e.replace(/\/$/,"");return t?`${i}/commit/${t}`:`${i}/branch/${encodeURIComponent(p)}`}async function $(e,o){if(!o){y(`Opening browser at ${e}`);try{await A(e,{wait:!1})}catch{y(`Could not open browser automatically. Please navigate to:
8
8
  ${e}`)}}}async function C(e){let o=await e.getOption(n.Mode.name,!0),t=(o??n.Mode.defaultValue).trim().toLowerCase();if(t!=="live"&&t!=="preview")throw new s(`Invalid --mode value '${o}'. Expected 'live' or 'preview'.`);return t}function B(e){e.setDescription(a.app.play.description),e.addExamples(a.app.play.examples),e.addSwitch({flags:{key:n.NoBrowser.name},description:a.app.play.options.noBrowser}),e.addOptions([{flags:{key:n.AppName.name},env:n.AppName.envVar,description:a.app.play.options.app,optionalInNonInteractive:!0},{flags:{key:n.Mode.name,alias:n.Mode.alias},env:n.Mode.envVar,default:n.Mode.defaultValue,description:a.app.play.options.mode,optionalInNonInteractive:!0},{flags:{key:n.CommitSha.name,alias:n.CommitSha.alias},env:n.CommitSha.envVar,description:a.app.play.options.commit,optionalInNonInteractive:!0},{flags:{key:n.Branch.name},description:a.app.play.options.branch,optionalInNonInteractive:!0}])}export{M as buildPlayUrl,E as playMaafAppAsync};
9
9
  /*!
10
10
  * Copyright (C) Microsoft Corporation. All rights reserved.
11
11
  */
12
- //# sourceMappingURL=PlayMaafApp-5H3DCJ2C.js.map
12
+ //# sourceMappingURL=PlayMaafApp-D4KLJKLT.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{g as A}from"./chunk-DD7E4ADI.js";import{Ga as h,Ha as S,da as u,ea as g,u as d}from"./chunk-UIW77LMA.js";import"./chunk-RBG2H562.js";import"./chunk-LDP2SHPJ.js";import"./chunk-7PH2NK5K.js";import"./chunk-Y7TZZLPW.js";import{g as t}from"./chunk-DAG6RPOF.js";import{c as p,h as l,j as m}from"./chunk-PVAIJSAI.js";import{a}from"./chunk-WQKDXHGX.js";import"./chunk-3FP37TPE.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function H(e){let N=S(),{fileConfig:n,cliFs:y}=N;P(e),await e.runVerb(),A();let i=!!await e.getOption("offline",!0),s=await e.getOption("name",!0)||void 0,c=d(),f={vfs:y,authProvider:e.getAuthenticationProvider(),httpClient:e.getHttpClient(),region:c.region,environmentName:c.environmentName,localFilePaths:{appConfigPath:n.appConfigPath,schemaPath:n.schemaPath,codeGenPath:n.codeGenPath},logger:h()},o=i?await g({...f,actionsParams:{dataSource:s}}):await u({...f,actionsParams:{dataSourceName:s}}),v=i?"regenerated":"refreshed",C=i?"regenerate":"refresh";for(let r of o.succeeded)p(`'${r}' ${v} successfully.`);for(let r of o.failed)m(`Failed to ${C} '${r.dataSourceName}': ${r.error}`);o.succeeded.length>0&&o.failed.length===0&&l(`Hint: Run '${"ms"} app dev' to test locally.`)}function P(e){e.setDescription(a.app.refresh.dataSource.description),e.addExamples(a.app.refresh.dataSource.examples),e.addOptions([{flags:{key:t.DataSourceName.name,alias:t.DataSourceName.alias},env:t.DataSourceName.envVar,description:a.app.refresh.dataSource.options.name,optionalInNonInteractive:!0}]),e.addSwitch({flags:{key:t.Offline.name},env:t.Offline.env,description:a.app.refresh.dataSource.options.offline})}export{H as refreshDataSourceAsync};
8
+ /*!
9
+ * Copyright (C) Microsoft Corporation. All rights reserved.
10
+ */
11
+ //# sourceMappingURL=RefreshDataSource-N5CEH23S.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 f,b as D}from"./chunk-4VBFOKV6.js";import{e as b}from"./chunk-SNWTSI75.js";import{b as w,qa as y,ra as A,ua as m}from"./chunk-4LIR3ZYP.js";import{b as p}from"./chunk-RBG2H562.js";import"./chunk-UNJJUCSA.js";import"./chunk-6RSE3J4X.js";import"./chunk-EX6IKPAO.js";import{u as o}from"./chunk-3JIZGVCA.js";import{c,d}from"./chunk-PVAIJSAI.js";import{a as n}from"./chunk-47LJLFDF.js";import"./chunk-PPW4XUZO.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function 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};
7
+ import{a as f,b as D}from"./chunk-X5O77GZS.js";import{e as b}from"./chunk-DD7E4ADI.js";import{Ca as y,Da as A,Ga as m,c as w}from"./chunk-UIW77LMA.js";import{b as p}from"./chunk-RBG2H562.js";import"./chunk-LDP2SHPJ.js";import"./chunk-7PH2NK5K.js";import"./chunk-Y7TZZLPW.js";import{w as o}from"./chunk-DAG6RPOF.js";import{c,d}from"./chunk-PVAIJSAI.js";import{a as n}from"./chunk-WQKDXHGX.js";import"./chunk-3FP37TPE.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
8
  /*!
9
9
  * Copyright (C) Microsoft Corporation. All rights reserved.
10
10
  */
11
- //# sourceMappingURL=RefreshGitAuth-IQBAFR37.js.map
11
+ //# sourceMappingURL=RefreshGitAuth-2VL6VBLU.js.map
@@ -4,11 +4,11 @@ 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 C,d as E,g as R}from"./chunk-SNWTSI75.js";import{P as $,Q as N,c as y,q as w,ua as b,va as A}from"./chunk-4LIR3ZYP.js";import{b as u}from"./chunk-RBG2H562.js";import"./chunk-UNJJUCSA.js";import"./chunk-6RSE3J4X.js";import"./chunk-EX6IKPAO.js";import{d as f}from"./chunk-3JIZGVCA.js";import{a as D,c as S,i as p}from"./chunk-PVAIJSAI.js";import{a as r}from"./chunk-47LJLFDF.js";import"./chunk-PPW4XUZO.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:
7
+ import{b as C,d as E,g as R}from"./chunk-DD7E4ADI.js";import{Ga as b,Ha as A,Z as $,_ as N,d as y,u as w}from"./chunk-UIW77LMA.js";import{b as u}from"./chunk-RBG2H562.js";import"./chunk-LDP2SHPJ.js";import"./chunk-7PH2NK5K.js";import"./chunk-Y7TZZLPW.js";import{f}from"./chunk-DAG6RPOF.js";import{a as D,c as S,i as p}from"./chunk-PVAIJSAI.js";import{a as r}from"./chunk-WQKDXHGX.js";import"./chunk-3FP37TPE.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
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
9
 
10
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
11
  /*!
12
12
  * Copyright (C) Microsoft Corporation. All rights reserved.
13
13
  */
14
- //# sourceMappingURL=RemoveDataSource-PGPLMJUX.js.map
14
+ //# sourceMappingURL=RemoveDataSource-XR5Q4O3F.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{c}from"./chunk-3YRE4IQ3.js";import"./chunk-HBLO3WDD.js";import"./chunk-TYRVM4PP.js";import{k as s}from"./chunk-SNWTSI75.js";import"./chunk-4LIR3ZYP.js";import"./chunk-RBG2H562.js";import"./chunk-UNJJUCSA.js";import"./chunk-6RSE3J4X.js";import{a as n,b as r}from"./chunk-EX6IKPAO.js";import"./chunk-PVAIJSAI.js";import"./chunk-PPW4XUZO.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};
7
+ import{c}from"./chunk-3YRE4IQ3.js";import"./chunk-HBLO3WDD.js";import"./chunk-TYRVM4PP.js";import{k as s}from"./chunk-DD7E4ADI.js";import"./chunk-UIW77LMA.js";import"./chunk-RBG2H562.js";import"./chunk-LDP2SHPJ.js";import"./chunk-7PH2NK5K.js";import{a as n,b as r}from"./chunk-Y7TZZLPW.js";import"./chunk-PVAIJSAI.js";import"./chunk-3FP37TPE.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
8
  /*!
9
9
  * Copyright (C) Microsoft Corporation. All rights reserved.
10
10
  */
11
- //# sourceMappingURL=ServicePrincipalAuthenticationProvider-IZZRJFZQ.js.map
11
+ //# sourceMappingURL=ServicePrincipalAuthenticationProvider-H3PTPXYY.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{c as h,d as w,na as s,pa as S,va as v}from"./chunk-4LIR3ZYP.js";import{b as r}from"./chunk-RBG2H562.js";import"./chunk-UNJJUCSA.js";import"./chunk-6RSE3J4X.js";import"./chunk-EX6IKPAO.js";import{d as m,h as f}from"./chunk-PVAIJSAI.js";import{a as c}from"./chunk-47LJLFDF.js";import{a as d}from"./chunk-PPW4XUZO.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};
7
+ import{Ba as S,Ha as v,d as h,e as w,za as s}from"./chunk-UIW77LMA.js";import{b as r}from"./chunk-RBG2H562.js";import"./chunk-LDP2SHPJ.js";import"./chunk-7PH2NK5K.js";import"./chunk-Y7TZZLPW.js";import{d as m,h as f}from"./chunk-PVAIJSAI.js";import{a as c}from"./chunk-WQKDXHGX.js";import{a as d}from"./chunk-3FP37TPE.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
8
  /*!
9
9
  * Copyright (C) Microsoft Corporation. All rights reserved.
10
10
  */
11
- //# sourceMappingURL=SetSetting-SEWDA4TF.js.map
11
+ //# sourceMappingURL=SetSetting-HXY4YSKC.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{h as l,i as f}from"./chunk-SNWTSI75.js";import{ga as m,ua as d}from"./chunk-4LIR3ZYP.js";import{b as c}from"./chunk-RBG2H562.js";import"./chunk-UNJJUCSA.js";import"./chunk-6RSE3J4X.js";import"./chunk-EX6IKPAO.js";import{v as n}from"./chunk-3JIZGVCA.js";import{c as a,d as s,h as p}from"./chunk-PVAIJSAI.js";import{a as r}from"./chunk-47LJLFDF.js";import"./chunk-PPW4XUZO.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function w(e){I(e),await e.runVerb();let h=await f(e),o=await e.getTenantIdAsync();if(!o)throw new c("Unable to determine tenant ID. Ensure you are logged in.");let t=await l(e),i=await m({tenantId:o,environmentId:h,logger:d(),actionsParams:{appName:t}});if(e.isJsonMode()){s({appName:t,...i});return}a(`Share link created for '${t}' (id: ${i.appShareLinkId}). Anyone in your tenant who opens this link will be granted Microsoft App Reader access. Share URL:`),p(i.shareLinkUrl)}function I(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{w as shareLinkCreateAsync};
7
+ import{h as l,i as f}from"./chunk-DD7E4ADI.js";import{Ga as d,sa as m}from"./chunk-UIW77LMA.js";import{b as c}from"./chunk-RBG2H562.js";import"./chunk-LDP2SHPJ.js";import"./chunk-7PH2NK5K.js";import"./chunk-Y7TZZLPW.js";import{x as n}from"./chunk-DAG6RPOF.js";import{c as a,d as s,h as p}from"./chunk-PVAIJSAI.js";import{a as r}from"./chunk-WQKDXHGX.js";import"./chunk-3FP37TPE.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function w(e){I(e),await e.runVerb();let h=await f(e),o=await e.getTenantIdAsync();if(!o)throw new c("Unable to determine tenant ID. Ensure you are logged in.");let t=await l(e),i=await m({tenantId:o,environmentId:h,logger:d(),actionsParams:{appName:t}});if(e.isJsonMode()){s({appName:t,...i});return}a(`Share link created for '${t}' (id: ${i.appShareLinkId}). Anyone in your tenant who opens this link will be granted Microsoft App Reader access. Share URL:`),p(i.shareLinkUrl)}function I(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{w as shareLinkCreateAsync};
8
8
  /*!
9
9
  * Copyright (C) Microsoft Corporation. All rights reserved.
10
10
  */
11
- //# sourceMappingURL=ShareLinkCreate-T5FN47J2.js.map
11
+ //# sourceMappingURL=ShareLinkCreate-YG3DACP2.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{h as c,i as h}from"./chunk-SNWTSI75.js";import{ha as d,ua as l}from"./chunk-4LIR3ZYP.js";import{b as m}from"./chunk-RBG2H562.js";import"./chunk-UNJJUCSA.js";import"./chunk-6RSE3J4X.js";import"./chunk-EX6IKPAO.js";import{w as n}from"./chunk-3JIZGVCA.js";import{a as s,d as p}from"./chunk-PVAIJSAI.js";import{a as t}from"./chunk-47LJLFDF.js";import"./chunk-PPW4XUZO.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function k(e){f(e),await e.runVerb();let I=await h(e),r=await e.getTenantIdAsync();if(!r)throw new m("Unable to determine tenant ID. Ensure you are logged in.");let i=await c(e),o=await d({tenantId:r,environmentId:I,logger:l(),actionsParams:{appName:i}});if(e.isJsonMode()){p({appName:i,...o});return}s({title:`Share links for '${i}'`,columns:[{header:"LINK ID"},{header:"ROLE"},{header:"REDEEMERS"},{header:"CREATED BY",maxWidth:36}],rows:o.value.map(a=>[a.appShareLinkId,a.managedAppRoleName,String(a.redeemedPrincipalIds.length),a.createdByObjectId]),emptyMessage:`No share links issued for '${i}'.`,totalLabel:"link(s)"})}function f(e){e.setDescription(t.app.shareLink.list.description),e.addExamples(t.app.shareLink.list.examples),e.addOptions([{flags:{key:n.AppName.name},env:n.AppName.envVar,description:t.app.shareLink.list.options.app,optionalInNonInteractive:!0},{flags:{key:n.EnvironmentId.name,alias:n.EnvironmentId.alias},env:n.EnvironmentId.envVar,description:t.app.shareLink.list.options.environmentId,optionalInNonInteractive:!0}])}export{k as shareLinkListAsync};
7
+ import{h as c,i as h}from"./chunk-DD7E4ADI.js";import{Ga as l,ta as d}from"./chunk-UIW77LMA.js";import{b as m}from"./chunk-RBG2H562.js";import"./chunk-LDP2SHPJ.js";import"./chunk-7PH2NK5K.js";import"./chunk-Y7TZZLPW.js";import{y as n}from"./chunk-DAG6RPOF.js";import{a as s,d as p}from"./chunk-PVAIJSAI.js";import{a as t}from"./chunk-WQKDXHGX.js";import"./chunk-3FP37TPE.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function k(e){f(e),await e.runVerb();let I=await h(e),r=await e.getTenantIdAsync();if(!r)throw new m("Unable to determine tenant ID. Ensure you are logged in.");let i=await c(e),o=await d({tenantId:r,environmentId:I,logger:l(),actionsParams:{appName:i}});if(e.isJsonMode()){p({appName:i,...o});return}s({title:`Share links for '${i}'`,columns:[{header:"LINK ID"},{header:"ROLE"},{header:"REDEEMERS"},{header:"CREATED BY",maxWidth:36}],rows:o.value.map(a=>[a.appShareLinkId,a.managedAppRoleName,String(a.redeemedPrincipalIds.length),a.createdByObjectId]),emptyMessage:`No share links issued for '${i}'.`,totalLabel:"link(s)"})}function f(e){e.setDescription(t.app.shareLink.list.description),e.addExamples(t.app.shareLink.list.examples),e.addOptions([{flags:{key:n.AppName.name},env:n.AppName.envVar,description:t.app.shareLink.list.options.app,optionalInNonInteractive:!0},{flags:{key:n.EnvironmentId.name,alias:n.EnvironmentId.alias},env:n.EnvironmentId.envVar,description:t.app.shareLink.list.options.environmentId,optionalInNonInteractive:!0}])}export{k as shareLinkListAsync};
8
8
  /*!
9
9
  * Copyright (C) Microsoft Corporation. All rights reserved.
10
10
  */
11
- //# sourceMappingURL=ShareLinkList-6JCVEYNC.js.map
11
+ //# sourceMappingURL=ShareLinkList-XF6BIB3M.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 h,h as u,i as I}from"./chunk-DD7E4ADI.js";import{Ga as m,Ha as v,g as f,ua as k}from"./chunk-UIW77LMA.js";import{b as p}from"./chunk-RBG2H562.js";import"./chunk-LDP2SHPJ.js";import"./chunk-7PH2NK5K.js";import"./chunk-Y7TZZLPW.js";import{A as n}from"./chunk-DAG6RPOF.js";import{c as l,d as a,i as s}from"./chunk-PVAIJSAI.js";import{a as i}from"./chunk-WQKDXHGX.js";import"./chunk-3FP37TPE.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function F(e){g(e),await e.runVerb();let c=await I(e),d=await e.getTenantIdAsync();if(!d)throw new p("Unable to determine tenant ID. Ensure you are logged in.");let r=await u(e),o=await e.getOption(n.LinkId.name);if(!o)throw new p("Provide a share link ID via --link-id.");if(!await e.getOption(n.Force.name,!0)&&v().interactive&&!await h({message:`Revoke share link '${o}' for app '${r}'? Anyone who has not yet redeemed it will lose access; redeemers will have their Microsoft App Reader role revoked.`})){s("Revoke cancelled.");return}try{await k({tenantId:d,environmentId:c,logger:m(),actionsParams:{appName:r,appShareLinkId:o}})}catch(t){if(w(t)){if(e.isJsonMode()){a({appName:r,linkId:o,existed:!1});return}s(`Share link '${o}' was not found on '${r}'; nothing was revoked.`);return}throw t}if(e.isJsonMode()){a({appName:r,linkId:o,existed:!0});return}l(`Share link '${o}' revoked for '${r}'.`)}function w(e){if(!(e instanceof f)||e.status!==404||!e.body)return!1;try{return JSON.parse(e.body).error?.code==="AppShareLinkNotFound"}catch{return!1}}function g(e){e.setDescription(i.app.shareLink.revoke.description),e.addExamples(i.app.shareLink.revoke.examples),e.addSwitch({flags:{key:n.Force.name,alias:n.Force.alias},description:i.app.shareLink.revoke.options.force}),e.addOptions([{flags:{key:n.LinkId.name,alias:n.LinkId.alias},env:n.LinkId.envVar,description:i.app.shareLink.revoke.options.linkId},{flags:{key:n.AppName.name},env:n.AppName.envVar,description:i.app.shareLink.revoke.options.app,optionalInNonInteractive:!0},{flags:{key:n.EnvironmentId.name,alias:n.EnvironmentId.alias},env:n.EnvironmentId.envVar,description:i.app.shareLink.revoke.options.environmentId,optionalInNonInteractive:!0}])}export{F as shareLinkRevokeAsync};
8
+ /*!
9
+ * Copyright (C) Microsoft Corporation. All rights reserved.
10
+ */
11
+ //# sourceMappingURL=ShareLinkRevoke-4USAQKLB.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 O,b as x,c as y,d as $,e as P,f as k,g as G}from"./chunk-2HSJ2XAQ.js";import{h as b,i as L}from"./chunk-DD7E4ADI.js";import{Ga as N,Ha as E,R,oa as M,wa as S,x as h,y as g,z as I}from"./chunk-UIW77LMA.js";import{b as u}from"./chunk-RBG2H562.js";import"./chunk-LDP2SHPJ.js";import"./chunk-7PH2NK5K.js";import"./chunk-Y7TZZLPW.js";import{z as r}from"./chunk-DAG6RPOF.js";import{a as w,d as D,h as T,i as C}from"./chunk-PVAIJSAI.js";import{a as l}from"./chunk-WQKDXHGX.js";import"./chunk-3FP37TPE.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function _(e){F(e),await e.runVerb();let t=await L(e),p=await e.getTenantIdAsync();if(!p)throw new u("Unable to determine tenant ID. Ensure you are logged in.");let i=await b(e),f=!!await e.getOption("app",!0),d=await e.getOption("access",!0);if(!d||!d.trim())throw new u("The --access option is required. Use --access play, --access edit, or --access test.");let o=$(d),s,a="none",m;if(f)(o==="edit"||e.isJsonMode())&&(s=await k({tenantId:p,environmentId:t,appName:i}),a=B(s));else{let n=E().appConfig??{};m=y(n.repositoryId)?n.repositoryId:void 0,a=o==="edit"?P(n):n.repoType??"none"}let J=j(o,a);!e.isJsonMode()&&o==="edit"&&a==="github"&&C(x);let A=await Promise.all(J.map(n=>V({target:n,tenantId:p,environmentId:t,appName:i,appInfo:s,configRepoId:m})));if(e.isJsonMode()){D({appName:i,access:o,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??"-",c.principalType??"-",W(c.roleDefinitionName),c.createdOn??"-"]));w({title:`${o==="play"?"Play":o==="test"?"Test":"Edit"} shares for '${i}'`,columns:[{header:"SCOPE"},{header:"PRINCIPAL ID"},{header:"TYPE"},{header:"ROLE"},{header:"CREATED ON"}],rows:U,emptyMessage:`No ${o} shares for '${i}'.`,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:t,tenantId:p,environmentId:i,appName:f,appInfo:d,configRepoId:o}=e;if(t.scope==="app"){let m=await M({tenantId:p,environmentId:i,logger:N(),actionsParams:{appName:f,roleDefinitionName:t.roleDefinitionName}});return{scope:"app",roleDefinitionName:t.roleDefinitionName,assignments:m.assignments,unclassifiedCount:m.unclassifiedCount}}let s=[o,d?.repositoryId].find(y);if(s||(s=(await G({tenantId:p,environmentId:i,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:i,logger:N(),actionsParams:{repoId:s}});return{scope:"repo",roleDefinitionName:t.roleDefinitionName,repoId:s,assignments:a.assignments,unclassifiedCount:a.unclassifiedCount}}function F(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 B(e){switch(e.repoType){case"Native":return"native";case"ExternalGitProviderBound":case"ExternallyProvidedBuild":return"github";default:return"none"}}function W(e){switch(e){case h:return"App Reader";case g:return"App Contributor";case I:return"App Test Operator";case R:return"Repository Contributor";default:return e??"-"}}function j(e,t){if(e==="play"||e==="test")return[{scope:"app",roleDefinitionName:e==="test"?I:h}];if(t==="none")throw new u(O);return t!=="native"?[{scope:"app",roleDefinitionName:g}]:[{scope:"repo",roleDefinitionName:R},{scope:"app",roleDefinitionName:g}]}export{_ as shareListAsync};
8
+ /*!
9
+ * Copyright (C) Microsoft Corporation. All rights reserved.
10
+ */
11
+ //# sourceMappingURL=ShareList-6QI7ZAMZ.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 r}from"./chunk-EQCYKUEU.js";import"./chunk-LQ65CHNN.js";import"./chunk-USRRI5H4.js";import"./chunk-SNWTSI75.js";import"./chunk-4LIR3ZYP.js";import"./chunk-RBG2H562.js";import"./chunk-UNJJUCSA.js";import"./chunk-6RSE3J4X.js";import"./chunk-EX6IKPAO.js";import"./chunk-3JIZGVCA.js";import"./chunk-PVAIJSAI.js";import"./chunk-47LJLFDF.js";import"./chunk-PPW4XUZO.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function i(e){await r(e,"share")}export{i as shareMaafAppAsync};
7
+ import{a as r}from"./chunk-SCJXITCN.js";import"./chunk-2HSJ2XAQ.js";import"./chunk-USRRI5H4.js";import"./chunk-DD7E4ADI.js";import"./chunk-UIW77LMA.js";import"./chunk-RBG2H562.js";import"./chunk-LDP2SHPJ.js";import"./chunk-7PH2NK5K.js";import"./chunk-Y7TZZLPW.js";import"./chunk-DAG6RPOF.js";import"./chunk-PVAIJSAI.js";import"./chunk-WQKDXHGX.js";import"./chunk-3FP37TPE.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function i(e){await r(e,"share")}export{i as shareMaafAppAsync};
8
8
  /*!
9
9
  * Copyright (C) Microsoft Corporation. All rights reserved.
10
10
  */
11
- //# sourceMappingURL=ShareMaafApp-6MKZ33HW.js.map
11
+ //# sourceMappingURL=ShareMaafApp-PZI5MCBA.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{d as c}from"./chunk-RBG2H562.js";import{b as l,k as m}from"./chunk-UNJJUCSA.js";import"./chunk-6RSE3J4X.js";import"./chunk-EX6IKPAO.js";import{b as y,d as a,i as f}from"./chunk-PVAIJSAI.js";import{a as n}from"./chunk-47LJLFDF.js";import"./chunk-PPW4XUZO.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";import*as s from"fs";import*as p from"path";var d={remote:!0,console:!1};async function h(e){u(e,n.telemetry.enable.options),e.setDescription(n.telemetry.enable.description),e.addExamples(n.telemetry.enable.examples),await e.runVerb();let t=S(await e.getOption("remote",!0),await e.getOption("console",!0),!0);g(t)}async function E(e){u(e,n.telemetry.disable.options),e.setDescription(n.telemetry.disable.description),e.addExamples(n.telemetry.disable.examples),await e.runVerb();let t=S(await e.getOption("remote",!0),await e.getOption("console",!0),!1);g(t)}async function A(e){e.setDescription(n.telemetry.status.description),e.addExamples(n.telemetry.status.examples),await e.runVerb(),b(e.isJsonMode())}function u(e,t){e.addSwitches([{flags:{key:"remote"},description:t.remote},{flags:{key:"console"},description:t.console}])}function S(e,t,r){let o=!e&&!t,i={};return(e||o)&&(i.remote=r),t&&(i.console=r),i}function b(e){try{let t=p.join(l,m);if(s.existsSync(t)){let r=s.readFileSync(t,"utf-8"),o=JSON.parse(r);if(e){a({settings:o});return}y({title:"Telemetry Settings:",items:[o],fields:[{label:"Remote",value:i=>String(i.remote)},{label:"Console",value:i=>String(i.console)}]})}else{if(e){a({settings:null});return}f("No telemetry settings found. Using default settings.")}}catch(t){throw new c(`Failed to read telemetry settings: ${t.message}`)}}function g(e){try{s.existsSync(l)||s.mkdirSync(l,{recursive:!0});let t=p.join(l,m),r={...d};if(s.existsSync(t)){let o=s.readFileSync(t,"utf-8"),i=JSON.parse(o);r={...d,...i}}s.writeFileSync(t,JSON.stringify({...r,...e},null,2),"utf-8")}catch(t){throw new c(`Failed to update telemetry settings: ${t.message}`)}}export{E as telemetryDisableAsync,h as telemetryEnableAsync,A as telemetryStatusAsync};
7
+ import{d as c}from"./chunk-RBG2H562.js";import{b as l,l as m}from"./chunk-LDP2SHPJ.js";import"./chunk-7PH2NK5K.js";import"./chunk-Y7TZZLPW.js";import{b as y,d as a,i as f}from"./chunk-PVAIJSAI.js";import{a as n}from"./chunk-WQKDXHGX.js";import"./chunk-3FP37TPE.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";import*as s from"fs";import*as p from"path";var d={remote:!0,console:!1};async function h(e){u(e,n.telemetry.enable.options),e.setDescription(n.telemetry.enable.description),e.addExamples(n.telemetry.enable.examples),await e.runVerb();let t=S(await e.getOption("remote",!0),await e.getOption("console",!0),!0);g(t)}async function E(e){u(e,n.telemetry.disable.options),e.setDescription(n.telemetry.disable.description),e.addExamples(n.telemetry.disable.examples),await e.runVerb();let t=S(await e.getOption("remote",!0),await e.getOption("console",!0),!1);g(t)}async function A(e){e.setDescription(n.telemetry.status.description),e.addExamples(n.telemetry.status.examples),await e.runVerb(),b(e.isJsonMode())}function u(e,t){e.addSwitches([{flags:{key:"remote"},description:t.remote},{flags:{key:"console"},description:t.console}])}function S(e,t,r){let o=!e&&!t,i={};return(e||o)&&(i.remote=r),t&&(i.console=r),i}function b(e){try{let t=p.join(l,m);if(s.existsSync(t)){let r=s.readFileSync(t,"utf-8"),o=JSON.parse(r);if(e){a({settings:o});return}y({title:"Telemetry Settings:",items:[o],fields:[{label:"Remote",value:i=>String(i.remote)},{label:"Console",value:i=>String(i.console)}]})}else{if(e){a({settings:null});return}f("No telemetry settings found. Using default settings.")}}catch(t){throw new c(`Failed to read telemetry settings: ${t.message}`)}}function g(e){try{s.existsSync(l)||s.mkdirSync(l,{recursive:!0});let t=p.join(l,m),r={...d};if(s.existsSync(t)){let o=s.readFileSync(t,"utf-8"),i=JSON.parse(o);r={...d,...i}}s.writeFileSync(t,JSON.stringify({...r,...e},null,2),"utf-8")}catch(t){throw new c(`Failed to update telemetry settings: ${t.message}`)}}export{E as telemetryDisableAsync,h as telemetryEnableAsync,A as telemetryStatusAsync};
8
8
  /*!
9
9
  * Copyright (C) Microsoft Corporation. All rights reserved.
10
10
  */
11
- //# sourceMappingURL=TelemetrySettings-RXPPIEVO.js.map
11
+ //# sourceMappingURL=TelemetrySettings-WWVPRF7T.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 r}from"./chunk-EQCYKUEU.js";import"./chunk-LQ65CHNN.js";import"./chunk-USRRI5H4.js";import"./chunk-SNWTSI75.js";import"./chunk-4LIR3ZYP.js";import"./chunk-RBG2H562.js";import"./chunk-UNJJUCSA.js";import"./chunk-6RSE3J4X.js";import"./chunk-EX6IKPAO.js";import"./chunk-3JIZGVCA.js";import"./chunk-PVAIJSAI.js";import"./chunk-47LJLFDF.js";import"./chunk-PPW4XUZO.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function i(e){await r(e,"unshare")}export{i as unshareMaafAppAsync};
7
+ import{a as r}from"./chunk-SCJXITCN.js";import"./chunk-2HSJ2XAQ.js";import"./chunk-USRRI5H4.js";import"./chunk-DD7E4ADI.js";import"./chunk-UIW77LMA.js";import"./chunk-RBG2H562.js";import"./chunk-LDP2SHPJ.js";import"./chunk-7PH2NK5K.js";import"./chunk-Y7TZZLPW.js";import"./chunk-DAG6RPOF.js";import"./chunk-PVAIJSAI.js";import"./chunk-WQKDXHGX.js";import"./chunk-3FP37TPE.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function i(e){await r(e,"unshare")}export{i as unshareMaafAppAsync};
8
8
  /*!
9
9
  * Copyright (C) Microsoft Corporation. All rights reserved.
10
10
  */
11
- //# sourceMappingURL=UnshareMaafApp-OSE2TOBJ.js.map
11
+ //# sourceMappingURL=UnshareMaafApp-MHBIV5OR.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{i as E}from"./chunk-DD7E4ADI.js";import{l as u,m as f,o as l,p,u as w}from"./chunk-UIW77LMA.js";import{b as a,f as c}from"./chunk-RBG2H562.js";import{o as y}from"./chunk-LDP2SHPJ.js";import{h as m,j as v}from"./chunk-PVAIJSAI.js";async function R(n,r,t){try{let e=await n;if(e.status===200){if(e.data.operationSuccess===!1||e.data.environmentFound===!1||e.data.errorCode)throw new u(200,e.data.message,e.data.errorCode);let i=e.data.environment?.name;if(!i)throw new c("Routing service returned 200 with no environment name.");return i}let o=await p(r,e.pollingUrl,e.authResource,t);if(!o.environment?.name)throw new c("Routing service finished provisioning but returned no environment name.");return o.environment.name}catch(e){throw A(e)}}function A(n){if(n instanceof u){let r=n.apiMessage?` ${n.apiMessage}`:" Ensure your account has the required permissions to create a Developer environment.";return new a(`Could not provision a Developer environment for your tenant (status ${n.status}).${r}`)}return n instanceof f?new a("Timed out waiting for a Developer environment to provision. Try again."):n instanceof Error?n:new Error(String(n))}function P(n,r,t,e,o){let{trackBackgroundFailure:i=!0}=o??{},g=n.getHttpClient(),{region:I}=w(),d=R(l(g,r,y,{provisionDataverse:!1},I,t),g,t);return i&&d.catch(s=>{t.trackErrorEvent(`${e}.RoutingEnvironmentBackgroundFailure`,{error:s instanceof Error?s.message:String(s)})}),d}function h(n){let r=n instanceof Error?n.message:String(n);v(`Failed to resolve a developer environment.
8
+
9
+ ${r}
10
+
11
+ To retry, run the same command again. Alternatively, pass --environment-id <id> to use a known environment.`)}async function b(n,r){if(n)return n;if(!r)throw new a("Unable to resolve a developer environment. Pass --environment-id <id> to specify one explicitly.");try{return await r}catch(t){throw h(t),t}}async function D(n,r,t){let e=await E(n,{failIfMissing:!1});if(e)return e;let o=await n.getTenantIdAsync();if(!o)throw new a("Unable to determine tenant ID. Ensure you are logged in.");t?.jsonMode||m("No environment specified \u2014 resolving your developer environment\u2026");let i=await k(n,o,r,t?.telemetryNamespace??"BrowseVerb");return n.updateEnvironmentId(i),t?.jsonMode||m(`Using developer environment ${i}.`),i}async function k(n,r,t,e){try{return await P(n,r,t,e,{trackBackgroundFailure:!1})}catch(o){throw h(o),o}}export{P as a,b,D as c};
12
+ /*!
13
+ * Copyright (C) Microsoft Corporation. All rights reserved.
14
+ */
15
+ //# sourceMappingURL=chunk-2FNWZUPW.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{Ga as i,ma as r}from"./chunk-UIW77LMA.js";import{b as t}from"./chunk-RBG2H562.js";import{a as n}from"./chunk-3FP37TPE.js";var u=`Cannot share source code \u2014 no repository linked.
8
+
9
+ This app has no linked repository, so source code isn't stored on the platform. To collaborate on code, run 'ms app init' to create an app instance with a repo, or share the source with your collaborator directly.`,g="This app is not backed by a platform managed repo. Repository access must be configured in the external repository.",s="00000000-0000-0000-0000-000000000000";function p(e){return!!e&&e!==s}function h(e){let o=(e??"play").trim().toLowerCase();if(o==="play"||o==="edit"||o==="test")return o;throw new t(`Unknown --access value '${e}'. Use 'play' (default \u2014 app access), 'edit', or 'test'.`)}function A(e){if(e.repoType)return e.repoType;if(p(e.repositoryId))throw new t(`${n} is missing the 'repoType' field but has a 'repositoryId' set. This usually means the file was written by an older CLI. Re-run "${"ms"} app init" to migrate the config, then retry.`);return"none"}async function c(e){return r({tenantId:e.tenantId,environmentId:e.environmentId,logger:i(),actionsParams:{appName:e.appName}})}async function I(e){let o=await c(e);if(!p(o.repositoryId))throw new t(`App '${e.appName}' has no associated repository.`);return o}export{u as a,g as b,p as c,h as d,A as e,c as f,I as g};
10
+ /*!
11
+ * Copyright (C) Microsoft Corporation. All rights reserved.
12
+ */
13
+ //# sourceMappingURL=chunk-2HSJ2XAQ.js.map