@microsoft/cmr-cli 0.33.0 → 0.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. package/README.md +37 -14
  2. package/THIRD-PARTY-NOTICES.txt +287 -30
  3. package/dist/Add-4RULNL6A.js +11 -0
  4. package/dist/AddConfig-D2DCR3JH.js +12 -0
  5. package/dist/AddConnector-5ZR5AF6H.js +19 -0
  6. package/dist/AddDeployment-7U4I5IC4.js +11 -0
  7. package/dist/AddDeploymentBinding-BZVRRZ7H.js +18 -0
  8. package/dist/AddRayfin-45ASHNIX.js +87 -0
  9. package/dist/Alter-36TSNZ4M.js +11 -0
  10. package/dist/{AuthStatus-XA6RGYYZ.js → AuthStatus-W5ZHOAVD.js} +2 -2
  11. package/dist/AuthSwitch-7HRPTGEG.js +13 -0
  12. package/dist/Bin.js +1 -1
  13. package/dist/BuildMaafApp-TLQXOVQC.js +11 -0
  14. package/dist/Clear-X55BZKYF.js +11 -0
  15. package/dist/Cli-EEO7V3MZ.js +47 -0
  16. package/dist/CloneMaafApp-4EHW3HE2.js +12 -0
  17. package/dist/CreateMaafApp-VNXWCAP4.js +23 -0
  18. package/dist/CreateMaafProject-WVBNZPVL.js +11 -0
  19. package/dist/DeleteMaafApp-UGUKARMO.js +11 -0
  20. package/dist/DeployMaafApp-GJO567TK.js +8 -0
  21. package/dist/DeployMaafProject-4TSW2SFJ.js +11 -0
  22. package/dist/DeploymentApprovals-SZKNJT76.js +11 -0
  23. package/dist/Dev-ZD3L6WYY.js +15 -0
  24. package/dist/{EnvironmentVariableAuthenticationProvider-EBRBQ5I2.js → EnvironmentVariableAuthenticationProvider-EURTERVX.js} +2 -2
  25. package/dist/FeatureSettings-GG7JGFIY.js +11 -0
  26. package/dist/{GenerateCode-Z2OY3SZR.js → GenerateCode-PNYC45SK.js} +2 -2
  27. package/dist/GetMaafBuildStatus-UTPVWF5L.js +11 -0
  28. package/dist/GetMaafProjectDeployStatus-PLK52YC4.js +12 -0
  29. package/dist/{GetSettings-64N4P6L7.js → GetSettings-RLRDJEC7.js} +2 -2
  30. package/dist/InfoMaafApp-CTB6IPRU.js +13 -0
  31. package/dist/InfoMaafProject-TULH566X.js +11 -0
  32. package/dist/Init-TYWP2E6U.js +11 -0
  33. package/dist/ListConnectorActions-UQS6D4UN.js +11 -0
  34. package/dist/ListConnectors-OCDO64AT.js +11 -0
  35. package/dist/ListDeployments-PDLJ3IEI.js +11 -0
  36. package/dist/ListMaafApps-UAWTTCGB.js +11 -0
  37. package/dist/ListMaafProjects-T3Q2GEDX.js +11 -0
  38. package/dist/{ListSchema-IR7FTBRR.js → ListSchema-G673LK5Q.js} +2 -2
  39. package/dist/{ListSettings-3M7UOOLI.js → ListSettings-EXCK5ZS6.js} +2 -2
  40. package/dist/{Login-G7TNQISG.js → Login-XZATPT4L.js} +2 -2
  41. package/dist/{Logout-AOOISVWK.js → Logout-2XM4IMZF.js} +2 -2
  42. package/dist/{MockFetch-GKQMNDW3.js → MockFetch-LW3KYEGC.js} +2 -2
  43. package/dist/NodeMsalAuthenticationProvider-ALMFNUEV.js +17 -0
  44. package/dist/Pack-RH4D4C7W.js +8 -0
  45. package/dist/PackProject-5DUWSBFA.js +14 -0
  46. package/dist/PlayMaafApp-5BXGXE6O.js +8 -0
  47. package/dist/ProjectApprovals-K3JF6D72.js +13 -0
  48. package/dist/ProjectRoleAssignments-7IUDEVBN.js +11 -0
  49. package/dist/RefreshDataSource-CMHDF2GP.js +11 -0
  50. package/dist/RefreshGitAuth-4TRO5IOQ.js +11 -0
  51. package/dist/Remove-KZD3SDDC.js +11 -0
  52. package/dist/{RemoveDataSource-T2AG7ZWC.js → RemoveDataSource-C7UXOUNH.js} +3 -3
  53. package/dist/RemoveDeployment-ZQJWQPD6.js +11 -0
  54. package/dist/ServicePrincipalAuthenticationProvider-3NPJTLF5.js +11 -0
  55. package/dist/SetSetting-3XO6HPG7.js +11 -0
  56. package/dist/{SetSetting-KOWAPJWX.js → SetSetting-ZW7F43GC.js} +2 -2
  57. package/dist/ShareLinkCreate-JXPW5H7A.js +11 -0
  58. package/dist/ShareLinkList-ICYPRIQV.js +11 -0
  59. package/dist/ShareLinkRevoke-JVMQZF7K.js +11 -0
  60. package/dist/ShareList-YGSTFMVE.js +11 -0
  61. package/dist/ShareMaafApp-ZCY72WHK.js +11 -0
  62. package/dist/{TelemetrySettings-FVJUK5MR.js → TelemetrySettings-P6WYWGW4.js} +2 -2
  63. package/dist/UnshareMaafApp-N4UR6Q4A.js +11 -0
  64. package/dist/{chunk-JWSX7DVU.js → chunk-2SRFM7D6.js} +2 -2
  65. package/dist/chunk-3YCPXSCO.js +11 -0
  66. package/dist/chunk-45EZLDPE.js +147 -0
  67. package/dist/{chunk-EFTF4FA7.js → chunk-4PI5THLA.js} +2 -2
  68. package/dist/{chunk-4C6DWU2Y.js → chunk-6KOL66SF.js} +2 -2
  69. package/dist/{chunk-2VJIWD7V.js → chunk-74RNALDY.js} +2 -2
  70. package/dist/{chunk-4JTUAUHI.js → chunk-7AEULMP2.js} +2 -2
  71. package/dist/{chunk-MWN7R4VR.js → chunk-7LAMG4KK.js} +2 -2
  72. package/dist/chunk-A5INC5TY.js +11 -0
  73. package/dist/chunk-AICYZHWK.js +11 -0
  74. package/dist/chunk-B4NTYKGH.js +12 -0
  75. package/dist/chunk-BAQPANON.js +11 -0
  76. package/dist/{chunk-BREK3DVB.js → chunk-BMOTNINY.js} +6 -6
  77. package/dist/{chunk-OUKOEUZA.js → chunk-C7UWPNC3.js} +1 -1
  78. package/dist/{chunk-2UMD5IAQ.js → chunk-CLY3OASM.js} +2 -2
  79. package/dist/chunk-DLUQVMUE.js +11 -0
  80. package/dist/{chunk-JDRULLI3.js → chunk-ENDUKF4E.js} +2 -2
  81. package/dist/{chunk-DOCWK326.js → chunk-FESGOCAP.js} +7 -7
  82. package/dist/{chunk-IM7SC23O.js → chunk-GO22IDEN.js} +6 -6
  83. package/dist/{chunk-WV7KDGLS.js → chunk-HHW4SKVU.js} +2 -2
  84. package/dist/{chunk-CONEIY4I.js → chunk-HZGDQAKA.js} +2 -2
  85. package/dist/{chunk-O4G2KO7E.js → chunk-IMVZRBSQ.js} +2 -2
  86. package/dist/chunk-K77VBHFP.js +12 -0
  87. package/dist/{chunk-CER3QPDN.js → chunk-KD4NQIYX.js} +3 -3
  88. package/dist/{chunk-4WQT5P2M.js → chunk-KN66FSQK.js} +2 -2
  89. package/dist/{chunk-4UHMKZLH.js → chunk-KPKJZKWW.js} +2 -2
  90. package/dist/chunk-NMZFJESU.js +12 -0
  91. package/dist/{chunk-ZREDMBLO.js → chunk-NNYOT7IR.js} +2 -2
  92. package/dist/{chunk-JMF444BA.js → chunk-OH3TCDCC.js} +2 -2
  93. package/dist/{chunk-A57M2UGH.js → chunk-OHQNTYJG.js} +2 -2
  94. package/dist/{chunk-4AO24KKT.js → chunk-PYPCPMCR.js} +5 -5
  95. package/dist/{chunk-OTXBVG3E.js → chunk-R2IECDVU.js} +3 -3
  96. package/dist/{chunk-FGB6GFXI.js → chunk-RA74M3YD.js} +2 -2
  97. package/dist/{chunk-E2O4YZX2.js → chunk-RSHOMYG6.js} +228 -227
  98. package/dist/chunk-UHNOINTO.js +11 -0
  99. package/dist/{chunk-ELHOJBVT.js → chunk-XC7Y6E2C.js} +11 -11
  100. package/dist/chunk-XJXWNOJR.js +11 -0
  101. package/dist/chunk-Y2D37EFX.js +13 -0
  102. package/dist/{chunk-C7V6WEZM.js → chunk-YEWRCEPT.js} +2 -2
  103. package/dist/chunk-Z4UX3JOS.js +12 -0
  104. package/dist/chunk-ZBQT5XZJ.js +32 -0
  105. package/dist/chunk-ZGBTKTTU.js +11 -0
  106. package/dist/{chunk-5BE4TLDK.js → chunk-ZLK2CMMJ.js} +23 -23
  107. package/dist/chunk-ZWJ5T5VI.js +11 -0
  108. package/dist/node-PLZPXPD7.js +29 -0
  109. package/dist/typescript-6OTSQQEW.js +458 -0
  110. package/package.json +5 -4
  111. package/dist/Add-75RSJNM4.js +0 -11
  112. package/dist/AddConfig-4SAYYOBQ.js +0 -12
  113. package/dist/AddConnector-P4R4NJ5P.js +0 -16
  114. package/dist/AddDeployment-TBA3AAGD.js +0 -11
  115. package/dist/AddDeploymentBinding-6FZ7Y5JM.js +0 -18
  116. package/dist/AddRayfin-35GBGCWF.js +0 -38
  117. package/dist/Alter-U7WDVOMU.js +0 -11
  118. package/dist/AuthSwitch-2FXB7WFU.js +0 -13
  119. package/dist/BuildMaafApp-3EGRD23G.js +0 -11
  120. package/dist/Clear-MZGQZ2XK.js +0 -11
  121. package/dist/Cli-6A2HUP7R.js +0 -47
  122. package/dist/CloneMaafApp-YAEYSP23.js +0 -12
  123. package/dist/CreateMaafApp-2XYROOHB.js +0 -23
  124. package/dist/CreateMaafProject-Q7KIVAR2.js +0 -11
  125. package/dist/DeleteMaafApp-G3SL3GGP.js +0 -11
  126. package/dist/DeployMaafApp-DBJONCUH.js +0 -8
  127. package/dist/DeployMaafProject-SOMMKVJO.js +0 -11
  128. package/dist/DeploymentApprovals-Y67LSQQG.js +0 -11
  129. package/dist/Dev-TXJLPT7K.js +0 -15
  130. package/dist/FeatureSettings-LYV6QUZB.js +0 -11
  131. package/dist/GetMaafBuildStatus-ZR5GCREL.js +0 -11
  132. package/dist/GetMaafProjectDeployStatus-OJ56DPZ6.js +0 -12
  133. package/dist/InfoMaafApp-FJM7UI5H.js +0 -13
  134. package/dist/InfoMaafProject-EU6OQ7DX.js +0 -11
  135. package/dist/Init-MTONJT7V.js +0 -11
  136. package/dist/ListConnectorActions-PJTNNWLH.js +0 -11
  137. package/dist/ListConnectors-JYNVPB3O.js +0 -11
  138. package/dist/ListDeployments-UV6J6WA5.js +0 -11
  139. package/dist/ListMaafApps-QPEX7JA4.js +0 -11
  140. package/dist/ListMaafProjects-RDR2S3HD.js +0 -11
  141. package/dist/NodeMsalAuthenticationProvider-6ABSS6QK.js +0 -17
  142. package/dist/Pack-QJZCMVEM.js +0 -8
  143. package/dist/PackProject-Y3Q3KOTC.js +0 -14
  144. package/dist/PlayMaafApp-MH66OLOV.js +0 -8
  145. package/dist/ProjectApprovals-NTFYLH3W.js +0 -13
  146. package/dist/ProjectRoleAssignments-7IDK6SGJ.js +0 -11
  147. package/dist/RefreshDataSource-CISFHQNA.js +0 -11
  148. package/dist/RefreshGitAuth-NUQ7JNJA.js +0 -11
  149. package/dist/Remove-IYDTKDJE.js +0 -11
  150. package/dist/RemoveDeployment-K3GDRCXJ.js +0 -11
  151. package/dist/ServicePrincipalAuthenticationProvider-CEHIAANL.js +0 -11
  152. package/dist/SetSetting-PD76MA6O.js +0 -11
  153. package/dist/ShareLinkCreate-VCWVBQ4B.js +0 -11
  154. package/dist/ShareLinkList-5VG5CG34.js +0 -11
  155. package/dist/ShareLinkRevoke-KYUNMTG5.js +0 -11
  156. package/dist/ShareList-M25UE6LD.js +0 -11
  157. package/dist/ShareMaafApp-QMEJEXPZ.js +0 -11
  158. package/dist/UnshareMaafApp-RIUUYHIL.js +0 -11
  159. package/dist/chunk-36YYCVFC.js +0 -12
  160. package/dist/chunk-3UIUI5Q2.js +0 -11
  161. package/dist/chunk-B6REHI77.js +0 -11
  162. package/dist/chunk-GVLAG66W.js +0 -13
  163. package/dist/chunk-HWEMI6JI.js +0 -12
  164. package/dist/chunk-OB6WEE2V.js +0 -11
  165. package/dist/chunk-OBATM5M4.js +0 -11
  166. package/dist/chunk-PBXK6LJO.js +0 -11
  167. package/dist/chunk-VAKAW5BD.js +0 -12
  168. package/dist/chunk-WV7D7PTW.js +0 -12
  169. package/dist/chunk-YMRQPXY7.js +0 -32
  170. package/dist/chunk-YYXAAA2U.js +0 -11
  171. package/dist/rayfin-pack-HOUOLOHQ.js +0 -164
@@ -1,13 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __pathDirname } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __pathDirname(__filename);
7
- import{b as T}from"./chunk-WV7KDGLS.js";import"./chunk-BREK3DVB.js";import{a as L,b as q}from"./chunk-EFTF4FA7.js";import{n as M}from"./chunk-5BE4TLDK.js";import{B as N,Ob as E,Qb as H,bb as b,cb as B,db as F,eb as P,l as A,v as y,w as D,x as I,y as h,z as S}from"./chunk-E2O4YZX2.js";import"./chunk-IM7SC23O.js";import"./chunk-B6REHI77.js";import"./chunk-C7V6WEZM.js";import"./chunk-OB6WEE2V.js";import"./chunk-OUKOEUZA.js";import{O as c}from"./chunk-WS6TGUH7.js";import{a as l}from"./chunk-3UIUI5Q2.js";import{E as G,G as w,H as R,K as V,O as C}from"./chunk-4AO24KKT.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";function x(e){return e.trim().toLowerCase()}function Y(e){let t=new Map;for(let n of e){if(!n.email)continue;let r=n.email.toLowerCase(),o=t.get(r)??new Set;o.add(x(n.objectId)),t.set(r,o)}return t}function z(e,t){let n=new Set,r=Y(t);for(let o of e){if(typeof o.entry.objectId=="string"){n.add(x(o.entry.objectId));continue}let i=r.get(o.entry.email.toLowerCase());if(i)for(let a of i)n.add(a)}return n}function K(e,t,n){let r=new Set(e.map(a=>x(a.objectId))),o=z(n,t),i=0;for(let a of o)r.has(a)||(i+=1);return i}async function Ie(e){ae(e),await e.runVerb();let t=_(e.getPositionalArgs(0));if(t.length===0)throw new h("Provide at least one approver (object ID or user/group email address). Separate multiple entries with commas, spaces, or both.");let n=E(),r=n.trackScenario("ProjectApproval.Add",{inputCount:t.length});try{let o=[],i=ne(t,o);if(i.length===0)throw new h(k(o));o.length>0&&C(k(o));let{projectId:a,tenantId:d,environmentId:s}=await T(e),u=await O(e),p={tenantId:d,environmentId:s,logger:n},m={projectId:a,...u?{target:u}:{}},j=await Z(p,m,"before-add");try{await B({...p,actionsParams:{projectId:a,approvers:i.map(g=>g.entry),...u?{target:u}:{}}})}catch(g){throw oe(g)}let f,v;try{let g=await P({...p,actionsParams:m});f=K(j,g,i)}catch(g){v=X(g)}if(r.complete({...f!==void 0?{addedCount:f}:{},failedResolutionCount:o.length,postAddVerificationSucceeded:!v}),e.isJsonMode()){R({projectId:a,...u?{target:u}:{},partialFailure:o.length>0||!!v,...f!==void 0?{addedCount:f}:{},added:i.map(g=>({input:g.input})),warnings:o,...v?{verificationWarning:v}:{}});return}f===void 0?w(`Approver update was accepted for the ${u??b} target of project '${a}'.`):w(`Added ${f} approver${f===1?"":"s"} to the ${u??b} target of project '${a}'.`),v&&C(v)}catch(o){throw ee(r,o),o}}function Z(e,t,n){return P({...e,actionsParams:t}).catch(r=>{throw Q(r,n)})}function Q(e,t){if(!(e instanceof A))return e;let n=W(e),r={telemetryDetails:{status:e.status,serviceErrorCode:n}};return e.status===401?new S(`The service did not accept your sign-in. Run \`${"ms"} auth login\`, then try again.`,void 0,r):e.status===403?new I("You do not have permission to read approvers on this project.",y.GeneralError,void 0,{errorCode:L.ProjectApprovalPermissionDenied,errorCategory:D.User,telemetryDetails:q("project_approvals",r.telemetryDetails)}):e.status===429?new N("The service is limiting requests right now. Wait a moment, then try again.",void 0,r):t==="before-add"?new I(`The service could not read current approvers for this project (HTTP ${e.status}). No approvers were added.`,y.GeneralError,void 0,{errorCode:"ServiceError",...r}):new I(`The service could not read approvers for this project (HTTP ${e.status}).`,y.GeneralError,void 0,{errorCode:"ServiceError",...r})}function X(e){return e instanceof A?e.status===401?`The add request succeeded, but sign-in was not accepted while verifying approvers. Run \`${"ms"} auth login\` if needed.`:e.status===403?"The add request succeeded, but you do not have permission to list approvers for verification.":e.status===429?"The add request succeeded, but the service is limiting requests and verification could not complete.":`The add request succeeded, but approvers could not be listed afterward to verify the added count (HTTP ${e.status}).`:"The add request succeeded, but approvers could not be listed afterward to verify the added count."}function ee(e,t){t instanceof A?e.failure(void 0,{status:t.status,errorCode:t.code}):e.failure(t)}var te={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 W(e){return e.code&&/^[A-Za-z][A-Za-z0-9_.]{0,63}$/.test(e.code)?e.code:void 0}function oe(e){if(!(e instanceof A))return e;let t=W(e),n={telemetryDetails:{status:e.status,serviceErrorCode:t}};if(e.status===400){let r=e.code?te[e.code]:void 0;return new h(`The service rejected the approvers; none were added. ${r??`The request was not accepted${t?` (${t})`:""}.`}`,void 0,n)}return e.status===502&&e.code==="BadGateway"?new h("The tenant directory could not be reached to resolve an approver; none were added. Try again.",void 0,n):e.status===401?new S(`The service did not accept your sign-in. Run \`${"ms"} auth login\`, then try again.`,void 0,n):e.status===403?new I("You do not have permission to manage approvers on this project.",y.GeneralError,void 0,{errorCode:L.ProjectApprovalPermissionDenied,errorCategory:D.User,telemetryDetails:q("project_approvals",n.telemetryDetails)}):e.status===429?new N("The service is limiting requests right now. Wait a moment, then try again.",void 0,n):new I(`The service could not complete the request (HTTP ${e.status}). Run \`${"ms"} project list approval\` to see which approvers are configured, then try again.`,y.GeneralError,void 0,{errorCode:"ServiceError",...n})}async function ye(e){ie(e),await e.runVerb();let t=await e.getOption(c.All.name,!0),n=_(e.getPositionalArgs(0));if(t&&n.length>0)throw new h("Provide either explicit approvers or --all, not both.");if(!t&&n.length===0)throw new h("Provide at least one approver (object ID or user/group email address) to remove, or pass --all to remove every approver.");let{projectId:r,tenantId:o,environmentId:i}=await T(e),a=await O(e),d=a??b,s=E(),u=s.trackScenario("ProjectApproval.Remove",{all:!!t,inputCount:n.length});try{let p,m=[],j=[];if(t)p=await F({tenantId:o,environmentId:i,logger:s,actionsParams:{projectId:r,all:!0,...a?{target:a}:{}}});else{if(m=[],j=await re(n,m,()=>P({tenantId:o,environmentId:i,logger:s,actionsParams:{projectId:r,...a?{target:a}:{}}})),j.length===0)throw new h(k(m));m.length>0&&C(k(m)),p=await F({tenantId:o,environmentId:i,logger:s,actionsParams:{projectId:r,principalIds:j.map(v=>v.objectId),...a?{target:a}:{}}})}u.complete({all:!!t,removedCount:p.removed.length,failureCount:p.failures.length,failedResolutionCount:m.length});let f=p.failures.length>0;if(e.isJsonMode()){let v={projectId:r,...a?{target:a}:{},all:!!t,partialFailure:m.length>0||f,removed:p.removed,failures:p.failures,warnings:m};if(f)throw V(v),new H(U(p.failures,j));R(v);return}if(t)w(`Removed every approver from the ${d} target of project '${r}'.`);else if(p.removed.length>0&&w(`Removed ${p.removed.length} approver${p.removed.length===1?"":"s"} from the ${d} target of project '${r}'.`),f)throw new I(U(p.failures,j))}catch(p){throw u.failure(p),p}}async function we(e){se(e),await e.runVerb();let{projectId:t,tenantId:n,environmentId:r}=await T(e),o=await O(e),i=E(),a=i.trackScenario("ProjectApproval.List");try{let d=await P({tenantId:n,environmentId:r,logger:i,actionsParams:{projectId:t,...o?{target:o}:{}}});if(a.complete({approverCount:d.length}),e.isJsonMode()){R({projectId:t,...o?{target:o}:{},approvers:d.map(s=>({objectId:s.objectId,objectType:s.objectType,...s.email?{email:s.email}:{},...s.displayName?{displayName:s.displayName}:{}}))});return}G({title:`Approvers \u2014 project '${t}' (${o??b} target)`,columns:[{header:"Name"},{header:"Email"},{header:"Type"},{header:"Object ID",maxWidth:38}],rows:d.map(s=>[s.displayName??"-",s.email??"-",s.objectType,s.objectId]),emptyMessage:"No approvers are configured for this project.",totalLabel:"approver(s)"})}catch(d){throw a.failure(d),d}}function _(e){let t=new Set;for(let n of e)for(let r of n.split(",")){let o=r.trim();o&&t.add(o)}return[...t]}function ne(e,t){let n=[],r=new Set;for(let o of e){let i=o.toLowerCase();if(!r.has(i)){if(M(o))n.push({input:o,entry:{objectId:o}});else if(J(o))n.push({input:o,entry:{email:o}});else{t.push({input:o,reason:"not an object ID (GUID) or a valid email address"});continue}r.add(i)}}return n}async function re(e,t,n){let r,o=[];for(let a of e){if(M(a)){o.push({objectId:a,input:a});continue}if(!J(a)){t.push({input:a,reason:"not an object ID (GUID) or a valid email address"});continue}r??=await n();let d=new Map;for(let u of r)if(u.email?.toLowerCase()===a.toLowerCase()){let p=u.objectId.trim().toLowerCase();d.has(p)||d.set(p,u.objectId)}let s=[...d.values()];if(s.length===0){t.push({input:a,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){t.push({input:a,reason:`matches ${s.length} approvers (${s.join(", ")}); none was removed. Pass the object ID of the one to remove instead`});continue}o.push({objectId:s[0],input:a})}let i=new Set;return o.filter(a=>{let d=a.objectId.toLowerCase();return i.has(d)?!1:(i.add(d),!0)})}function U(e,t){let n=e.length===1?"approver":"approvers",r=e.map(o=>` - ${t.find(a=>a.objectId===o.principalId)?.input??o.principalId}`);return[`Failed to remove ${e.length} ${n}:`,...r].join(`
8
- `)}function k(e){let t=e.length===1?"entry":"entries",n=e.map(r=>` - ${r.input}: ${r.reason}`);return[`Could not resolve ${e.length} ${t}:`,...n].join(`
9
- `)}function J(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}async function O(e){return(await e.getOption(c.Target.name,!0))?.trim()||void 0}function ae(e){e.setDescription(l.project.add.approval.description),e.addExamples(l.project.add.approval.examples),e.consumePositionalArgs("principal"),e.addOptions([{flags:{key:c.ProjectId.name,alias:c.ProjectId.alias},description:l.project.add.approval.options.projectId,optionalInNonInteractive:!0},{flags:{key:c.EnvironmentId.name,alias:c.EnvironmentId.alias},env:c.EnvironmentId.envVar,description:l.project.add.approval.options.environmentId,optionalInNonInteractive:!0},{flags:{key:c.Target.name},description:l.project.add.approval.options.target,optionalInNonInteractive:!0,hidden:!0}])}function ie(e){e.setDescription(l.project.remove.approval.description),e.addExamples(l.project.remove.approval.examples),e.consumePositionalArgs("principal"),e.addSwitch({flags:{key:c.All.name},description:l.project.remove.approval.options.all}),e.addOptions([{flags:{key:c.ProjectId.name,alias:c.ProjectId.alias},description:l.project.remove.approval.options.projectId,optionalInNonInteractive:!0},{flags:{key:c.EnvironmentId.name,alias:c.EnvironmentId.alias},env:c.EnvironmentId.envVar,description:l.project.remove.approval.options.environmentId,optionalInNonInteractive:!0},{flags:{key:c.Target.name},description:l.project.remove.approval.options.target,optionalInNonInteractive:!0,hidden:!0}])}function se(e){e.setDescription(l.project.list.approval.description),e.addExamples(l.project.list.approval.examples),e.addOptions([{flags:{key:c.ProjectId.name,alias:c.ProjectId.alias},description:l.project.list.approval.options.projectId,optionalInNonInteractive:!0},{flags:{key:c.EnvironmentId.name,alias:c.EnvironmentId.alias},env:c.EnvironmentId.envVar,description:l.project.list.approval.options.environmentId,optionalInNonInteractive:!0},{flags:{key:c.Target.name},description:l.project.list.approval.options.target,optionalInNonInteractive:!0,hidden:!0}])}export{Ie as addProjectApprovalAsync,we as listProjectApprovalAsync,ye as removeProjectApprovalAsync};
10
- /*!
11
- * Copyright (C) Microsoft Corporation. All rights reserved.
12
- */
13
- //# sourceMappingURL=ProjectApprovals-NTFYLH3W.js.map
@@ -1,11 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __pathDirname } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __pathDirname(__filename);
7
- import{c as I}from"./chunk-WV7KDGLS.js";import"./chunk-BREK3DVB.js";import"./chunk-5BE4TLDK.js";import{Ob as A,fb as u,ob as j,y as p}from"./chunk-E2O4YZX2.js";import"./chunk-IM7SC23O.js";import"./chunk-B6REHI77.js";import"./chunk-C7V6WEZM.js";import"./chunk-OB6WEE2V.js";import"./chunk-OUKOEUZA.js";import{P as n}from"./chunk-WS6TGUH7.js";import{a as g}from"./chunk-3UIUI5Q2.js";import{G as r,H as a,M as c,O as f}from"./chunk-4AO24KKT.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-7IDK6SGJ.js.map
@@ -1,11 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __pathDirname } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __pathDirname(__filename);
7
- import{k as D}from"./chunk-5BE4TLDK.js";import{Da as y,Ea as N,L as A,Ob as c,Pb as v,Qb as C}from"./chunk-E2O4YZX2.js";import"./chunk-OB6WEE2V.js";import"./chunk-OUKOEUZA.js";import{k as a}from"./chunk-WS6TGUH7.js";import{a as o}from"./chunk-3UIUI5Q2.js";import{G as u,H as m,K as h,M as g,P as S}from"./chunk-4AO24KKT.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-CISFHQNA.js.map
@@ -1,11 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __pathDirname } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __pathDirname(__filename);
7
- import{a as f,b as D}from"./chunk-A57M2UGH.js";import{i as b}from"./chunk-5BE4TLDK.js";import{Kb as y,Lb as A,Ob as m,d as w,y as p}from"./chunk-E2O4YZX2.js";import"./chunk-OB6WEE2V.js";import"./chunk-OUKOEUZA.js";import{F as o}from"./chunk-WS6TGUH7.js";import{a as n}from"./chunk-3UIUI5Q2.js";import{G as c,H as d}from"./chunk-4AO24KKT.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-NUQ7JNJA.js.map
@@ -1,11 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __pathDirname } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __pathDirname(__filename);
7
- import{a as w,d as a}from"./chunk-FGB6GFXI.js";import{b as u,i as g}from"./chunk-5BE4TLDK.js";import{Cb as f,Db as d,Pb as y,y as l}from"./chunk-E2O4YZX2.js";import"./chunk-OB6WEE2V.js";import"./chunk-OUKOEUZA.js";import{b as t}from"./chunk-WS6TGUH7.js";import{a as n}from"./chunk-3UIUI5Q2.js";import{G as m,H as p,M as r}from"./chunk-4AO24KKT.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-IYDTKDJE.js.map
@@ -1,11 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __pathDirname } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __pathDirname(__filename);
7
- import{a as I}from"./chunk-YYXAAA2U.js";import"./chunk-BREK3DVB.js";import"./chunk-MWN7R4VR.js";import{b as D}from"./chunk-5BE4TLDK.js";import{A as f,C as c,Ob as d,Pb as E,kb as w,l as s,lb as h,x as j,y as p}from"./chunk-E2O4YZX2.js";import"./chunk-IM7SC23O.js";import"./chunk-B6REHI77.js";import"./chunk-C7V6WEZM.js";import"./chunk-OB6WEE2V.js";import"./chunk-OUKOEUZA.js";import{i as m}from"./chunk-WS6TGUH7.js";import{a as l}from"./chunk-3UIUI5Q2.js";import{G as y,H as g,O as v}from"./chunk-4AO24KKT.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-K3GDRCXJ.js.map
@@ -1,11 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __pathDirname } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __pathDirname(__filename);
7
- import{c}from"./chunk-3YRE4IQ3.js";import"./chunk-HBLO3WDD.js";import"./chunk-TYRVM4PP.js";import{o as s}from"./chunk-5BE4TLDK.js";import"./chunk-E2O4YZX2.js";import"./chunk-OB6WEE2V.js";import{a as n,b as r}from"./chunk-OUKOEUZA.js";import"./chunk-4AO24KKT.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-CEHIAANL.js.map
@@ -1,11 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __pathDirname } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __pathDirname(__filename);
7
- import{Hb as s,Jb as S,Pb as v,h,i as w,y as r}from"./chunk-E2O4YZX2.js";import"./chunk-OB6WEE2V.js";import"./chunk-OUKOEUZA.js";import{a as c}from"./chunk-3UIUI5Q2.js";import{H as m,M as f,a as d}from"./chunk-4AO24KKT.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-PD76MA6O.js.map
@@ -1,11 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __pathDirname } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __pathDirname(__filename);
7
- import{d as I}from"./chunk-EFTF4FA7.js";import{l as f,m as h}from"./chunk-5BE4TLDK.js";import{Ob as d,Ua as l,y as c}from"./chunk-E2O4YZX2.js";import"./chunk-OB6WEE2V.js";import"./chunk-OUKOEUZA.js";import{G as n}from"./chunk-WS6TGUH7.js";import{a as r}from"./chunk-3UIUI5Q2.js";import{G as s,H as p,M as m}from"./chunk-4AO24KKT.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-VCWVBQ4B.js.map
@@ -1,11 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __pathDirname } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __pathDirname(__filename);
7
- import{d as f}from"./chunk-EFTF4FA7.js";import{l as c,m as h}from"./chunk-5BE4TLDK.js";import{Ob as d,Va as l,y as m}from"./chunk-E2O4YZX2.js";import"./chunk-OB6WEE2V.js";import"./chunk-OUKOEUZA.js";import{H as r}from"./chunk-WS6TGUH7.js";import{a as t}from"./chunk-3UIUI5Q2.js";import{E as s,H as p}from"./chunk-4AO24KKT.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-5VG5CG34.js.map
@@ -1,11 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __pathDirname } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __pathDirname(__filename);
7
- import{d as w}from"./chunk-EFTF4FA7.js";import{b as v,l as u,m as I}from"./chunk-5BE4TLDK.js";import{Ob as k,Pb as h,Wa as f,l as m,y as p}from"./chunk-E2O4YZX2.js";import"./chunk-OB6WEE2V.js";import"./chunk-OUKOEUZA.js";import{J as n}from"./chunk-WS6TGUH7.js";import{a as r}from"./chunk-3UIUI5Q2.js";import{G as l,H as a,O as s}from"./chunk-4AO24KKT.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.camelName);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 f({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 m)||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-KYUNMTG5.js.map
@@ -1,11 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __pathDirname } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __pathDirname(__filename);
7
- import{a as L,b as y,c as x,d as $,e as P,f as G}from"./chunk-O4G2KO7E.js";import{l as b,m as O}from"./chunk-5BE4TLDK.js";import{O as I,Ob as N,P as g,Pa as M,Pb as E,Q as h,la as R,pb as S,y as u}from"./chunk-E2O4YZX2.js";import"./chunk-OB6WEE2V.js";import"./chunk-OUKOEUZA.js";import{I as r}from"./chunk-WS6TGUH7.js";import{a as l}from"./chunk-3UIUI5Q2.js";import{E as w,H as D,M as T,O as C}from"./chunk-4AO24KKT.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-M25UE6LD.js.map
@@ -1,11 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __pathDirname } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __pathDirname(__filename);
7
- import{a as r}from"./chunk-36YYCVFC.js";import"./chunk-O4G2KO7E.js";import"./chunk-EFTF4FA7.js";import"./chunk-SQI4XLR7.js";import"./chunk-5BE4TLDK.js";import"./chunk-E2O4YZX2.js";import"./chunk-OB6WEE2V.js";import"./chunk-OUKOEUZA.js";import"./chunk-WS6TGUH7.js";import"./chunk-3UIUI5Q2.js";import"./chunk-4AO24KKT.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-QMEJEXPZ.js.map
@@ -1,11 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __pathDirname } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __pathDirname(__filename);
7
- import{a as r}from"./chunk-36YYCVFC.js";import"./chunk-O4G2KO7E.js";import"./chunk-EFTF4FA7.js";import"./chunk-SQI4XLR7.js";import"./chunk-5BE4TLDK.js";import"./chunk-E2O4YZX2.js";import"./chunk-OB6WEE2V.js";import"./chunk-OUKOEUZA.js";import"./chunk-WS6TGUH7.js";import"./chunk-3UIUI5Q2.js";import"./chunk-4AO24KKT.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-RIUUYHIL.js.map
@@ -1,12 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __pathDirname } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __pathDirname(__filename);
7
- import{a as D,c as K,d as W,f as S}from"./chunk-O4G2KO7E.js";import{b as V}from"./chunk-EFTF4FA7.js";import{a as z}from"./chunk-SQI4XLR7.js";import{l as q,m as J,n as H}from"./chunk-5BE4TLDK.js";import{A as j,Na as x,O as k,Ob as R,P as w,Pb as _,Q as $,Qa as b,Xa as O,l as N,la as I,qb as L,rb as B,sa as U,y}from"./chunk-E2O4YZX2.js";import{D as F,E as T}from"./chunk-WS6TGUH7.js";import{a as C}from"./chunk-3UIUI5Q2.js";import{G as P,H as G,M as A,O as v,a as E}from"./chunk-4AO24KKT.js";var te=64*1024,X=1e3;async function Ee(e,n){Re(e,n),await e.runVerb();let t=_();if(!t.appConfig)throw new y(`No ${E} found in the current directory. Run "${"ms"} app init" first.`);let s=await J(e),c=await e.getTenantIdAsync();if(!c)throw new y("Unable to determine tenant ID. Ensure you are logged in.");let r=await q(e),p=K(await e.getOption("access")),m=p==="edit"?W(t.appConfig):t.appConfig.repoType??"none",f=le(e.getPositionalArgs(0));if(f.length===0)throw new y("Provide at least one principal (object ID or user/group email address). Separate multiple entries with commas, spaces, or both.");let a=p!=="edit"||m!=="native",l=R(),u=l.trackScenario("MaafApp.SharePermissions",{mode:n,access:p,repoType:m,inputCount:f.length});try{let o=[],i=await ce(f,o,a);if(l.trackActivityEvent("MaafApp.SharePermissions.PrincipalResolution",{mode:n,inputCount:f.length,resolvedCount:i.length,failedCount:o.length,emailPassthrough:a}),i.length===0)throw new y(Q(o));o.length>0&&v(Q(o));let d=await(n==="share"?ie:re)({tenantId:c,environmentId:s,appName:r,access:p,refs:i,repoType:m,jsonMode:e.isJsonMode()});u.complete({resolvedCount:i.length,failedResolutionCount:o.length,scope:d.scope,role:d.role,appScopeContributorFallback:p==="edit"&&d.scope==="app",...n==="unshare"&&{revokedCount:d.revokedCount??0,revokedPrincipalCount:d.revokedPrincipalCount??0,notFoundCount:d.notFound?.length??0,skippedCount:d.skipped?.length??0}});let g=n==="share"&&p==="edit"?await ae({appInfo:d.appInfo,tenantId:c,environmentId:s,appName:r,jsonMode:e.isJsonMode()}):void 0;e.isJsonMode()?G({access:p,partialFailure:o.length>0,...d.result,...n==="unshare"&&{revokedCount:d.revokedCount??0,revokedPrincipalCount:d.revokedPrincipalCount??0,notFound:(d.notFound??[]).map(ee),skipped:(d.skipped??[]).map(ee)},...g&&{repoType:g.repoType,cloneUrl:g.cloneUrl},warnings:o}):(ye({appName:r,mode:n,access:p,inputCount:i.length,outcome:d}),pe(g))}catch(o){let i=se(o);throw u.failure(i??o),i??o}}function se(e){if(!(e instanceof N)||e.status!==400)return null;let n=e.code,t;if(e.body&&e.body.length<=te)try{let m=JSON.parse(e.body);typeof m?.error?.code=="string"&&(n=m.error.code),typeof m?.error?.message=="string"&&m.error.message.trim()&&(t=m.error.message)}catch{}let s=`${n??""} ${t??""}`.toLowerCase(),c={httpStatus:e.status,...n&&{serverErrorCode:n},...t&&{serverMessage:t}},r={httpStatus:e.status},p=t?{serverMessage:oe(t)}:void 0;return s.includes("limit")||s.includes("quota")?new y("The sharing limit for this app has been reached.",c,{errorCode:"SharingLimitExceeded",exitCode:1,telemetryDetails:r,outputDetails:p}):s.includes("policy")||s.includes("not allowed")?new j("This sharing request is blocked by an environment or tenant policy.",c,{errorCode:"SharingRequestPolicyDenied",exitCode:1,telemetryDetails:V("app_sharing",r),outputDetails:p}):new y("The sharing request was rejected.",c,{errorCode:"SharingRequestRejected",exitCode:1,telemetryDetails:r,outputDetails:p})}function oe(e){let n=[...e].map(t=>{let s=t.codePointAt(0)??0;return s<=31||s>=127&&s<=159?" ":t}).join("").trim();return n.length<=X?n:`${n.slice(0,X)}\u2026`}async function ie(e){let{tenantId:n,environmentId:t,appName:s,access:c,refs:r,repoType:p,jsonMode:m}=e;if(c==="play"||c==="test"){let u=c==="test"?$:k,o=r.map(h=>Z(h,u));return{result:await b({tenantId:n,environmentId:t,logger:R(),actionsParams:{appName:s,put:o,delete:[]}}),scope:"app",role:u}}if(p!=="native"){!m&&p==="github"&&v(D);let u=r.map(i=>Z(i,w));return{result:await b({tenantId:n,environmentId:t,logger:R(),actionsParams:{appName:s,put:u,delete:[]}}),scope:"app",role:w}}let f=await S({tenantId:n,environmentId:t,appName:s}),a=r.map(he);return{result:await L({tenantId:n,environmentId:t,logger:R(),actionsParams:{repoId:f.repositoryId,put:a,delete:[]}}),scope:"repo",role:I,appInfo:f}}async function re(e){let{tenantId:n,environmentId:t,appName:s,access:c,refs:r,repoType:p,jsonMode:m}=e,f=c!=="edit"||p!=="native",a=f?c==="test"?$:c==="play"?k:w:I,l,u=[],o;if(f){c==="edit"&&p==="github"&&(m||v(D));let i=[],h=[];o=new Map;for(let g of r)if(g.id)i.push(g.id),o.set(`id:${g.id}`,g);else if(g.email)h.push(g.email),o.set(`email:${g.email.toLowerCase()}`,g);else throw new y(`Could not resolve '${g.input}' to an AAD object ID or email.`);let d=await O({tenantId:n,environmentId:t,logger:R(),actionsParams:{appName:s,principalIds:i,principalEmails:h,roleDefinitionName:a}});l=d,u=d.notFoundEmails}else{let i=r.map(Y);o=new Map(r.map(d=>[`id:${Y(d)}`,d]));let h=await S({tenantId:n,environmentId:t,appName:s});l=await B({tenantId:n,environmentId:t,logger:R(),actionsParams:{repoId:h.repositoryId,principalIds:i}})}return{result:l.result,scope:f?"app":"repo",role:a,revokedCount:l.revokedCount,revokedPrincipalCount:l.revokedPrincipalCount,notFound:[...l.notFoundPrincipalIds.map(i=>o.get(`id:${i}`)??{id:i,input:i}),...u.map(i=>o.get(`email:${i}`)??{email:i,input:i})],skipped:l.skippedNullRoleAssignments.map(i=>o.get(`id:${i.principalObjectId}`)??o.get(`email:${i.principalObjectId}`)??{id:i.principalObjectId,input:i.principalObjectId})}}function Y(e){if(!e.id)throw new y(`Could not resolve '${e.input}' to an object ID. Unshare requires object IDs.`);return e.id}async function ae(e){let n=e.appInfo;if(!n)try{n=await x({tenantId:e.tenantId,environmentId:e.environmentId,logger:R(),actionsParams:{appName:e.appName}})}catch{e.jsonMode||v(`Share succeeded, but repository details for '${e.appName}' could not be read.`);return}return z(n)}function pe(e){e&&(e.repoType&&A(`Repo type: ${e.repoType}`),e.cloneUrl&&A(`Clone URL: ${e.cloneUrl}`))}function le(e){let n=new Set;for(let t of e)for(let s of t.split(",")){let c=s.trim();c&&n.add(c)}return[...n]}async function ce(e,n,t){let s=new Map,c=new Map,p=(await Promise.all(e.map(async a=>{let l=a.toLowerCase(),u=s.get(l);if(u)return u;if(H(a)){let o={id:a,input:a};return s.set(l,o),o}if(!me(a))return n.push({input:a,reason:"not an object ID (GUID) or a valid email address"}),null;if(t){let o={input:a,email:a};return s.set(l,o),o}try{let o=c.get(l);o||(o=U(a,R()),c.set(l,o));let i=await o;if(!i)return n.push({input:a,reason:"no user or group found in this tenant (invite as a guest in Entra ID first if external)"}),null;let h={id:i.id,input:a,type:i.type,email:a,displayName:i.displayName};return s.set(l,h),h}catch(o){return n.push({input:a,reason:ue(o)}),null}}))).filter(a=>a!==null),m=[],f=new Set;for(let a of p){let l=(a.id??a.email??a.input).toLowerCase();f.has(l)||(f.add(l),m.push(a))}return m}function Q(e){let n=e.length===1?"entry":"entries",t=e.map(s=>` - ${s.input}: ${s.reason}`);return[`Could not resolve ${e.length} ${n}:`,...t].join(`
8
- `)}function ue(e){if(e instanceof N){if(e.status===403)return de(e.status);let n=fe(e.body);return n!==void 0?`Graph ${e.status}: ${n}`:e.message}return e instanceof Error?e.message:String(e)}function de(e){return`Graph ${e}: your sign-in lacks permission to look up accounts by email. Pass the object ID (GUID) instead, or have an admin grant the User.ReadBasic.All and Group.Read.All Graph permissions.`}function fe(e){if(e)try{let t=JSON.parse(e)?.error?.message;return typeof t=="string"?t:void 0}catch{return}}function me(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}function Z(e,n){return{name:e.displayName??e.input,properties:{roleName:n,principal:ge(e)}}}function ge(e){return e.id?e.email?{id:e.id,email:e.email}:{id:e.id}:{email:e.email??e.input}}function he(e){let n=e.id??e.input;return{name:e.displayName??e.input,properties:{roleName:I,principal:e.type?{id:n,type:e.type}:{id:n}}}}function ee(e){return{id:e.id??e.input,label:e.displayName??e.input}}function ye(e){let{appName:n,mode:t,access:s,inputCount:c,outcome:r}=e,p=s==="play"?"play":s==="test"?"test":"edit";if(t==="share"){let u=r.result.put?.length??0;if(u===0){A("No changes were applied.");return}P(`Shared app '${n}' with ${u} ${M("principal",u)}. They can now ${p} the app.`);return}let m=r.revokedCount??0,f=r.revokedPrincipalCount??m,a=(r.skipped?.length??0)>0;if(f===0&&!a){A(`No ${p} assignments to revoke on '${n}' \u2014 none of the ${c} ${M("principal",c)} had existing access.`);return}if(f>0?P(`Revoked ${p} permissions for ${f} ${M("principal",f)} on '${n}'.`):A(`No ${p} access changes were applied on '${n}'.`),r.notFound&&r.notFound.length>0){let l=r.notFound.map(u=>u.displayName??u.input).join(", ");A(`${r.notFound.length} ${M("principal",r.notFound.length)} had no existing ${p} access (no-op): ${l}`)}if(r.skipped&&r.skipped.length>0){let l=r.skipped.map(u=>u.displayName??u.input).join(", ");A(`${r.skipped.length} ${M("principal",r.skipped.length)} had a role assignment with an unknown role definition; ${p} access was not modified for: ${l}. Investigate via the role-assignments API.`)}}function M(e,n){return n===1?e:`${e}s`}function Re(e,n){let t=n==="share"?C.app.share:C.app.unshare,s=n==="share"?F:T;e.setDescription(t.description),e.addExamples(t.examples),e.consumePositionalArgs("principal"),e.addOptions([{flags:{key:s.AppName.name},env:s.AppName.envVar,description:t.options.app,optionalInNonInteractive:!0},{flags:{key:s.Access.name},env:s.Access.envVar,default:s.Access.defaultValue,description:t.options.access,optionalInNonInteractive:!0}])}export{Ee as a};
9
- /*!
10
- * Copyright (C) Microsoft Corporation. All rights reserved.
11
- */
12
- //# sourceMappingURL=chunk-36YYCVFC.js.map
@@ -1,11 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __pathDirname } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __pathDirname(__filename);
7
- import{a as t}from"./chunk-4AO24KKT.js";var n={global:{programDescription:"CLI for Microsoft managed apps.",cloud:"Cloud environment to target. Valid values include: public, usgov, usgovhigh, usgovdod, china. Defaults to public."},auth:{login:{description:"Sign in to Microsoft Entra ID.",examples:[`${"ms"} auth login`,`${"ms"} auth login --account user@contoso.com`,`${"ms"} auth login --device-code`],options:{account:"Username (email) to pre-fill in the browser sign-in prompt. This is a hint passed to the identity provider, not validated against cached accounts \u2014 use `auth switch --account` to choose between cached accounts.",deviceCode:"Sign in using the device code flow instead of opening a browser. Prints a URL and a code to enter on another device \u2014 use this on headless machines or over SSH where no browser is available."}},logout:{description:"Clear all cached credentials. Removes every cached account and the active-account pointer. Use `auth switch` to change which cached account is active without logging out.",examples:[`${"ms"} auth logout`]},status:{description:"Show cached accounts. The active account (used by other CLI commands) is marked.",examples:[`${"ms"} auth status`,`${"ms"} auth status --json`]},switch:{description:"Choose which cached account other CLI commands run as. When more than one account is cached and --account is omitted, prompts interactively; in non-interactive mode --account is required.",examples:[`${"ms"} auth switch`,`${"ms"} auth switch --account user@contoso.com`],options:{account:"Username (email) or home account ID of the account to make active."}}},app:{clone:{description:"Clone an existing app with a platform-managed repository into an empty target directory, which defaults to the app display name, and configure Git Credential Manager. To use the current directory, specify a single period. Apps bound to external repositories or without source control are not supported.",options:{app:"App ID (GUID) of the app to clone.",environmentId:"Environment ID containing the app (optional)."},examples:[`${"ms"} app clone --app <app-id>`,`${"ms"} app clone ./my-app --app <app-id>`,`${"ms"} app clone --app <app-id> .`]},create:{description:`Create a new managed app and scaffold the app template into a target directory, which defaults to the app display name. Native and no-repo targets ignore common OS metadata, and the default native flow supports the current managed-project root. External-repository targets must be empty. Provisions a platform-managed git repo by default; see --repo to bind an external GitHub repo or skip git scaffolding. To use the current directory, specify '.'. To bind any other existing project instead, use '${"ms"} app init'.`,options:{environmentId:"Target environment ID for the new managed app (optional).",displayName:"Display name for the managed app.",projectLocalAppId:"Project-local app identifier for the GA config (ASCII letters, digits, hyphens, and underscores; surrounding whitespace is trimmed). Defaults to the target directory name. Requires the ga feature.",description:"Optional description for the managed app.",repositoryId:"Repository ID to associate with the managed app for source control.",template:"GitHub repository or subpath to scaffold the managed app from (e.g. github:owner/repo/subdir). Defaults to github:microsoft/Copilot-Managed-Runtime/templates/vite8.",buildPath:"Path to the build output directory. Defaults to ./dist.",buildCommand:'Full shell command used to build the app. Defaults to "npm run build".',buildEntryPoint:"Entry point HTML file for the app. Defaults to index.html.",buildType:"Build behavior for the generated app config: build runs the build command; none packages prebuilt files from the build path without running a build command. Values are case-insensitive.",repo:"Source-control binding for the new app. Omit to use the default platform-managed flow, which supports the current managed-project root. Pass a repository URL \u2014 for example a GitHub Enterprise Cloud tenant URL (e.g. https://myorg.ghe.com/contoso/expense-tracker) or github.com (e.g. https://github.com/contoso/expense-tracker) \u2014 to bind to an external repo; the repo must already exist and the local target must be strictly empty because the CLI clones into it before overlaying the template. The server is the authority on which hosts/schemes are accepted. Pass '--repo none' to skip all git binding: the CLI writes ms.config.json and scaffolds the template into [directory]. Native and no-repo targets ignore common OS metadata. To bind any other existing project to a new app, use 'ms app init' instead. Cannot be combined with --repository-id.",openBrowser:"Launch the browser to complete the GitHub device code flow during inline GitHub authentication. Default: do not launch. Has no effect when `--json` is set (JSON mode never launches a browser).",forceReauth:"Bypass the stored GitHub authentication mapping and force re-authentication via device code flow, as if the mapping had expired. Has no effect on apps not bound to an external GitHub repository."},examples:[`${"ms"} app create --display-name "My App" --repository-id <id>`,`${"ms"} app create ./my-app --display-name "My App" --repository-id <id>`,`${"ms"} app create ./my-app --display-name "My App" --repository-id <id> --description "A description"`,`${"ms"} app create ./my-app --display-name "My App" --repo https://myorg.ghe.com/contoso/expense-tracker`,`${"ms"} app create ./my-app --display-name "My App" --repo none`]},init:{description:"Convert an existing project into a managed app.",options:{environmentId:"Target environment ID for the new managed app (optional).",cloud:"Cloud environment to target. Valid values include: public, usgov, usgovhigh, usgovdod, china. Defaults to public.",displayName:"Display name for the managed app.",description:"Optional description for the managed app.",buildPath:"Path to the build output directory. Defaults to ./dist.",buildCommand:'Full shell command used to build the app. Defaults to "npm run build".',fileEntryPoint:"Entry point HTML file for the app. Defaults to index.html.",appUrl:"Local development URL for the app. Defaults to http://localhost:3000.",buildEntryPoint:"Entry point HTML file for the app. Defaults to index.html.",buildType:"Build behavior for the generated app config: build runs the build command; none packages prebuilt files from the build path without running a build command. Values are case-insensitive.",repo:"Repository behavior for init. Pass '--repo native' to force a platform-managed repo without inspecting the current git setup. Pass '--repo none' to use BYO build flow (no platform-managed repo). Pass '--repo <repo-url>' to bind to an existing GitHub repo (current directory must already contain the cloned repo). Omit to auto-detect current git setup and prompt in interactive mode.",iconPath:"Optional path to a .png or .jpg app icon, written to ms.config.json as iconPath.",localAppUrl:"Optional local development URL for the app, written to ms.config.json as localAppUrl.",openBrowser:"Launch the browser to complete the GitHub device code flow during inline GitHub authentication. Default: do not launch. Has no effect when `--json` is set (JSON mode never launches a browser).",forceReauth:"Bypass the stored GitHub authentication mapping and force re-authentication via device code flow, as if the mapping had expired. Has no effect on apps not bound to an external GitHub repository."},examples:[`${"ms"} app init --display-name "My App" --environment-id <id>`,`${"ms"} app init --display-name "My App" --environment-id <id> --description "A description"`,`${"ms"} app init --display-name "My App" --environment-id <id> --build-path ./out`,`${"ms"} app init --display-name "My App" --repo none`,`${"ms"} app init --display-name "My App" --repo https://myorg.ghe.com/contoso/expense-tracker`]},list:{description:"List all apps you have access to with play URLs. Interactive text output shows edit access; non-interactive and JSON output include clone URL details when available for edit access. By default returns both edit and play access apps across the tenant; pass --environment-id to filter to a single environment.",options:{environmentId:"Optional environment ID to scope the listing to. When omitted, all apps the user can access across the tenant are returned.",permission:"Optional permission filter. Use `edit` for apps the user can contribute to, or `play` for apps the user can play/view. Omit to return both. Case-insensitive."},examples:[`${"ms"} app list`,`${"ms"} app list --json`,`${"ms"} app list --environment-id <id>`,`${"ms"} app list --permission play`]},info:{description:"Show an app's configuration and bound resources.",options:{app:`The app identifier to retrieve (logical name or app ID GUID). Defaults to the current app in ${t}.`,environmentId:`Override the environment ID. Defaults to environmentId in ${t}; when neither is set, the environment is resolved automatically from the app identifier.`},examples:[`${"ms"} app info --app my-app`,`${"ms"} app info --app <guid>`,`${"ms"} app info --app my-app --json`]},show:{deprecation:`(deprecated) '${"ms"} app show' is deprecated. Use '${"ms"} app info' instead.`,examples:[`${"ms"} app show`,`${"ms"} app show --json`]},delete:{description:"Delete an app. Soft-deletes the app and cleans up related metadata.",options:{app:`The app name to delete. Defaults to the current app in ${t}.`,environmentId:"Override the environment ID. When omitted, the environment is resolved automatically from the app. Useful for deleting an app from outside its scaffolded directory.",force:"Skip the confirmation prompt."},examples:[`${"ms"} app delete`,`${"ms"} app delete --app my-app`,`${"ms"} app delete --app my-app --environment-id <id> --force`,`${"ms"} app delete --json --force`]},share:{description:"Share an app with users, groups, or service principals. Provide a comma-separated list of user or group email addresses or object IDs. Service principals must be specified by object ID, not application (client) ID. Use --access play (default) to grant play access, --access edit to grant edit access, or --access test to grant test operator access. To distribute access via a tenant-wide link instead of named principals, use `ms app share link create` (run `ms app share link --help` for the full link surface).",options:{app:`The app name to share. Defaults to the current app in ${t}.`,access:'Access level to grant: "play" (default), "edit", or "test" (test operator access).'},examples:[`${"ms"} app share alice@contoso.com,bob@contoso.com`,`${"ms"} app share --app my-app <object-id>`,`${"ms"} app share <service-principal-object-id>`,`${"ms"} app share alice@contoso.com --access edit`,`${"ms"} app share alice@contoso.com --json`,`${"ms"} app share link create`],list:{description:"List the users, groups, and service principals an app is shared with at a given access level.",options:{app:`The app name. Defaults to the current app in ${t}.`,environmentId:`Override the environment ID. Defaults to environmentId in ${t}.`,access:'Access level to list (required): "play", "edit", or "test" (test operator access).'},examples:[`${"ms"} app share list --access play`,`${"ms"} app share list --access edit`,`${"ms"} app share list --access edit --app my-app`,`${"ms"} app share list --access play --json`]}},unshare:{description:"Unshare an app from users, groups, or service principals. Provide a comma-separated list of user or group email addresses or object IDs. Service principals must be specified by object ID, not application (client) ID. Use --access play (default) to revoke play access, --access edit to revoke edit access, or --access test to revoke test operator access. Each invocation only touches the requested access level.",options:{app:`The app name to unshare. Defaults to the current app in ${t}.`,access:'Access level to revoke: "play" (default), "edit", or "test" (test operator access).'},examples:[`${"ms"} app unshare alice@contoso.com,bob@contoso.com`,`${"ms"} app unshare --app my-app <object-id>`,`${"ms"} app unshare alice@contoso.com --access edit`,`${"ms"} app unshare alice@contoso.com --json`]},shareLink:{description:"Manage tenant-wide share links for a managed app. A share link is a JIT-redemption URL: the first time a recipient opens it, they are granted the configured role at the app scope. Links can be listed and revoked at any time.",create:{description:'Create a share link for a managed app. The link grants the "Microsoft App Reader" role at the app scope on redemption. Only this role is supported today; the enum is open server-side for future expansion.',options:{app:`The app name to share. Defaults to the current app in ${t}.`,environmentId:`Override the environment ID. Defaults to environmentId in ${t}.`},examples:[`${"ms"} app share link create`,`${"ms"} app share link create --app my-app`,`${"ms"} app share link create --json`]},list:{description:"List all share links currently issued for a managed app.",options:{app:`The app name. Defaults to the current app in ${t}.`,environmentId:`Override the environment ID. Defaults to environmentId in ${t}.`},examples:[`${"ms"} app share link list`,`${"ms"} app share link list --app my-app`,`${"ms"} app share link list --json`]},revoke:{description:"Revoke a share link by ID. The server attempts to remove the role assignment for every prior redeemer before tearing down the link record; new recipients can no longer redeem the link.",options:{app:`The app name. Defaults to the current app in ${t}.`,environmentId:`Override the environment ID. Defaults to environmentId in ${t}.`,linkId:"The share link ID (4-char lowercase hex) returned at creation time.",force:"Skip the confirmation prompt."},examples:[`${"ms"} app share link revoke --link-id a3f1`,`${"ms"} app share link revoke --link-id a3f1 --force`,`${"ms"} app share link revoke --link-id a3f1 --app my-app --json`]}},build:{description:"Initiate a build for an app. By default the CLI waits for build-status to reach a terminal state; pass --no-wait to return immediately after submission.",options:{appName:"The app name to build.",commitSha:"The commit ID to build from. Abbreviated hexadecimal Git commit IDs are expanded locally.",openBrowser:"Launch the browser to complete the GitHub device code flow during inline GitHub authentication. Default: do not launch. Has no effect when `--json` is set (JSON mode never launches a browser). Only relevant for apps bound to an external GitHub repository.",noWait:"Return immediately after submitting the build and print a build-status hint.",forceReauth:"Bypass the stored GitHub authentication mapping and force re-authentication via device code flow, as if the mapping had expired. Has no effect on apps not bound to an external GitHub repository."},examples:[`${"ms"} app build --app my-app --commit abc1234`,`${"ms"} app build --app my-app --commit abc1234 --no-wait`,`${"ms"} app build --app my-app --commit abc1234 --json`]},buildStatus:{description:"Check the status of a build.",options:{appName:"The app name.",commitSha:"The commit ID for which a build was initiated by app build. Abbreviated hexadecimal Git commit IDs are expanded locally.",showLog:"Fetch and print the build log when available."},examples:[`${"ms"} app build-status --app my-app --commit <sha>`,`${"ms"} app build-status --app my-app --commit <sha> --show-log`,`${"ms"} app build-status --app my-app --commit <sha> --json`]},deploy:{description:`Build and deploy an app to live. Behavior depends on the app's repoType in ${t}: git-backed apps (native/github) deploy a commit (default HEAD; override with --commit). External-artifact apps (repoType: 'none') pack and upload locally, or upload a pre-built .zip when --artifact is supplied. By default the CLI waits until deployment completes. With Managed DevOps, it instead returns a deployment ID when human approval is required; enable the projects feature and pass --no-wait to return immediately after submission.`,options:{app:`The app name to deploy. Defaults to the current app in ${t}.`,commit:"The commit ID to deploy (git-backed apps only). Abbreviated hexadecimal Git commit IDs are expanded locally. Defaults to the commit at HEAD.",artifact:"Path to a local .zip build artifact to upload and deploy. Only valid for apps created with repoType: 'none'; rejected on git-backed apps. Mutually exclusive with --commit.",target:"Target to deploy to: 'prod' or 'test'. The 'test' target must already be registered with `ms app add config --target test`. Defaults to 'prod'.",force:"Deploy even when the working tree has uncommitted changes or local main is ahead of origin/main. Skips the confirmation prompt in interactive mode and the validation error in non-interactive mode.",noWait:"With the projects feature enabled, return immediately after deployment submission and print the deployment ID without polling for completion or approval.",openBrowser:"Launch the browser to complete the GitHub device code flow during inline GitHub authentication. Default: do not launch. Has no effect when `--json` is set (JSON mode never launches a browser). Only relevant for apps bound to an external GitHub repository.",forceReauth:"Bypass the stored GitHub authentication mapping and force re-authentication via device code flow, as if the mapping had expired. Has no effect on apps not bound to an external GitHub repository."},examples:[`${"ms"} app deploy`,`${"ms"} app deploy --app my-app --commit abc1234`,`${"ms"} app deploy --force`,`${"ms"} app deploy --no-wait`,`${"ms"} app deploy --artifact ./build.zip`,`${"ms"} app deploy --target test`,`${"ms"} app deploy --app my-app --commit abc1234 --json`]},pack:{description:"Build the app and copy the output to .ms/packed/apps/<appId>/client/ for local inspection.",examples:[`${"ms"} app pack`]},play:{description:"Open a managed app in the browser. Use --mode live (default) to launch the deployed version, or --mode preview to preview the app on the main branch, a provided branch, or a provided commit ID.",options:{app:`The app name to play. Defaults to the current app in ${t}.`,mode:"Which app to open: 'live' (default \u2014 the deployed version) or 'preview'.",target:"The deployment target to open: 'prod' or 'test'. Cannot be combined with --mode, --commit, or --branch.",commit:"Preview mode only. The commit ID to open. Cannot be combined with --branch.",branch:"Preview mode only. The branch to open. Defaults to main and cannot be combined with --commit.",noBrowser:"Print the URL but do not open a browser window."},examples:[`${"ms"} app play`,`${"ms"} app play --mode preview`,`${"ms"} app play --target test`,`${"ms"} app play --mode preview --branch feature/my-change`,`${"ms"} app play --mode preview --commit abc1234`,`${"ms"} app play --app my-app --no-browser`,`${"ms"} app play --json`]},dev:{description:"Start local development.",options:{port:"Port number for the local config server.",localAppUrl:"Local URL where the app is running.",configOnly:"Start only the config server without running the dev script. Use this if you want to manage your dev server separately."},examples:[`${"ms"} app dev`,`${"ms"} app dev --port 8080 --local-app-url http://localhost:3000`,`${"ms"} app dev --local-app-url http://localhost:3000 --config-only`]},refresh:{description:"Refresh data sources in an app.",dataSource:{description:"Re-fetch data source metadata from the service and regenerate TypeScript.",options:{offline:"Regenerate TypeScript from the local schemas in '.ms/schemas' without contacting the service (no network or authentication). Omit to re-fetch metadata from the service and regenerate.",name:"Name of a specific data source to refresh. Omit to refresh all."},examples:[`${"ms"} app refresh data-source`,`${"ms"} app refresh data-source --name teams`,`${"ms"} app refresh data-source --offline`]}},override:{dataSource:{description:"Override an existing data source for a deployment target using an existing connection. Other targets keep their current bindings.",options:{target:"Deployment target: 'prod' or 'test'. Prompts when omitted.",connectionId:"Existing connection ID to use. Prompts when omitted; never creates a connection.",dataset:"Dataset name or site URL. Required for connectors that use datasets; prompts when omitted.",table:"Target-specific table name or list ID. Required when changing the dataset; otherwise omit to keep the effective table. Prompts when omitted."},examples:[`${"ms"} app override data-source orders --target prod --connection-id <id> --dataset <site> --table <list-id>`,`${"ms"} app override data-source orders`]}},add:{config:{description:"Register a deployment target with the current app project and create its local target configuration overlay.",options:{target:"Target to configure: 'prod' or 'test'. Omit to configure both targets."},examples:[`${"ms"} app add config`,`${"ms"} app add config --target prod`,`${"ms"} app add config --target test`]},backend:{description:"Scaffold a local backend for this app (in development, feature-gated). Currently the only supported provider is 'rayfin', which adds a Rayfin backend folder and the Rayfin client SDK dependency. Requires backend support to be enabled in the selected environment; checks availability before creating files.",options:{environmentId:"Environment to check for backend support (defaults to the app config).",provider:"Backend provider to scaffold. Only 'rayfin' is currently supported."},examples:[`${"ms"} app add backend --provider rayfin`,`${"ms"} app add backend --provider rayfin --environment-id <environment-id>`]},connector:{description:"Add a data source (a connector table or action) to the app.",options:{connector:'Connector ID (e.g. office365, sql) or display name (e.g. "Office 365 Users"). Run `ms connector list` to browse connectors.',connectionId:"Connection ID to use. If omitted: interactive mode prompts you to pick or create one; non-interactive mode reuses your only connection, silently creates one for connectors whose sole authentication type is single sign-on when none exist, or errors when the choice is ambiguous. Pass --use-sso to reuse an existing SSO connection (or silently create one) for any SSO-capable connector, not just SSO-only ones.",dataset:"Dataset name (only used when adding as a table). If omitted in table mode, you will be prompted.",table:"Table name. Repeat --table to add multiple tables from the same dataset. With --connector commondataserviceforapps, only one Dataverse table logical name is currently supported. If omitted, you will be prompted.",as:'Force the dispatch to "table" or "action". Required in non-interactive mode when the connector supports tables.',dataverseEnvironmentId:"Dataverse environment ID (GUID). Only used with --connector shared_commondataserviceforapps to bind to a specific table.",useSso:"Prefer a single sign-on (Entra ID) connection: reuse the first existing SSO connection when one exists, otherwise silently create one. Works even when the connector offers other authentication types. Errors if the connector is not SSO-capable. Ignored when --connection-id is supplied.",skipCodegen:"Skip TypeScript code generation after adding the data source."},examples:[`${"ms"} app add data-source --connector office365`,`${"ms"} app add data-source --connector "Office 365 Users"`,`${"ms"} app add data-source --connector sql --as table --connection-id <id> --dataset <db> --table <tbl>`,`${"ms"} app add data-source --connector sql --as table --connection-id <id> --dataset <db> --table Customers --table Orders`,`${"ms"} app add data-source --connector "SQL Server" --as table --connection-id <id> --dataset <db> --table <tbl>`,`${"ms"} app add data-source --connector sharepointonline --as action`,`${"ms"} app add data-source --connector "SharePoint" --as action`,`${"ms"} app add data-source --connector office365 --as action --use-sso`,`${"ms"} app add data-source --connector sql --as table --skip-codegen`,`${"ms"} app add data-source --connector commondataserviceforapps --as action --connection-id <id> --dataverse-environment-id <env-guid> --table account`],deprecation:`(deprecated) '${"ms"} app add connector' is deprecated. Use '${"ms"} app add data-source' instead.`,deprecatedExamples:[`${"ms"} app add connector --connector office365`,`${"ms"} app add connector --connector sql --as table --connection-id <id> --dataset <db> --table <tbl>`,`${"ms"} app add connector --connector sharepointonline --as action`,`${"ms"} app add connector --connector sql --as table --skip-codegen`,`${"ms"} app add connector --connector commondataserviceforapps --as action --connection-id <id> --dataverse-environment-id <env-guid> --table account`]}},remove:{description:"Remove a data source (table or action) from the app.",options:{dataSourceName:"Name of the data source to remove.",force:"Skip confirmation prompt."},examples:[`${"ms"} app remove data-source`,`${"ms"} app remove data-source --name documents`,`${"ms"} app remove data-source --name orders --force`],deprecation:`(deprecated) '${"ms"} app remove connector' is deprecated. Use '${"ms"} app remove data-source' instead.`,deprecatedExamples:[`${"ms"} app remove connector`,`${"ms"} app remove connector --name documents`,`${"ms"} app remove connector --name orders --force`]},"get-settings":{description:"View all app settings.",examples:[`${"ms"} app get-settings`,`${"ms"} app get-settings --json`]},"set-setting":{description:`Update app settings. Changes are written to ${t} and take effect the next time you run '${"ms"} app dev' or '${"ms"} app deploy'.`,options:{"show-header":"Show or hide the app header bar (true or false)."},examples:[`${"ms"} app set-setting --show-header false`]}},project:{unassign:{description:"Unassign a contributor, owner, or reader role from principals on a managed project. Provide email addresses or Microsoft Entra object IDs, separated by commas or spaces (at most 100 unique principals; emails at most 320 characters). Only the specified role is removed; other roles are preserved. At most 100 matching assignments can be removed per request. Missing assignments are reported as no-ops. Email matching uses the listed principal email; use an object ID when email enrichment is unavailable.",options:{role:"Project role to unassign (required): contributor, owner, or reader.",projectId:"Project ID. Defaults to the current ms.project.config.json.",environmentId:"Environment hosting the project. Defaults to the matching project configuration."},examples:[`${"ms"} project unassign alice@contoso.com --role contributor`,`${"ms"} project unassign <object-id> --role owner`,`${"ms"} project unassign alice@contoso.com --role reader`,`${"ms"} project unassign alice@contoso.com,bob@contoso.com --role contributor --project <project-id> --environment-id <environment-id> --json`]},assign:{description:"Assign a contributor, owner, or reader role to users, groups, or service principals on a managed project. Provide email addresses or Microsoft Entra object IDs, separated by commas or spaces (at most 100 unique principals; emails at most 320 characters). Service principals require their object ID, not application (client) ID. Roles apply to the project, not an individual app.",options:{role:"Project role to assign (required): contributor, owner, or reader.",projectId:"Project ID. Defaults to the current ms.project.config.json.",environmentId:"Environment hosting the project. Defaults to the matching project configuration."},examples:[`${"ms"} project assign alice@contoso.com --role contributor`,`${"ms"} project assign <object-id> --role owner`,`${"ms"} project assign alice@contoso.com --role reader`,`${"ms"} project assign alice@contoso.com,bob@contoso.com --role contributor --project <project-id> --environment-id <environment-id> --json`]},add:{deployment:{description:"Register a deployment with the current managed project.",options:{name:"Deployment name to register: 'prod' or 'test'. The 'prod' deployment already exists."},examples:[`${"ms"} project add deployment-target --name test`,`${"ms"} project add deployment-target --name test --json`]},approval:{description:"Add one or more approvers to a project's Prod target. Provide a comma-separated list of user or group email addresses, or object IDs (GUIDs), all of which the service resolves. Adding an approver that is already configured is a no-op. If the service rejects any entry, no approver is added. Approvals apply to Prod only; other targets do not support approvers.",options:{projectId:"ID of the managed project. Defaults to the project in ms.project.config.json.",environmentId:"Environment ID hosting the project. Required unless it can be read from ms.project.config.json.",target:"Hidden. Target whose approvers to manage. Defaults to Prod."},examples:[`${"ms"} project add approval alice@contoso.com,bob@contoso.com`,`${"ms"} project add approval --project <projectId> <object-id>`,`${"ms"} project add approval alice@contoso.com --json`]}},create:{description:"Creates a managed project in an empty target directory, which defaults to the project display name, and provisions or binds its repository. To use the current directory, specify '.'.",options:{displayName:"Display name for the managed project.",environmentId:"Target environment ID for the new managed project (optional).",repo:"External GitHub or GitHub Enterprise repository URL. Omit for a platform-managed repository.",openBrowser:"Open a browser during GitHub authentication when repository access must be refreshed.",forceReauth:"Force GitHub reauthentication before binding an external repository."},examples:[`${"ms"} project create --display-name "Field Service"`,`${"ms"} project create --display-name "Field Service" --repo https://github.com/contoso/field-service`,`${"ms"} project create --display-name "Field Service" --repo https://contoso.ghe.com/contoso/field-service --open-browser`,`${"ms"} project create . --display-name "Field Service"`,`${"ms"} project create ./custom-directory --display-name "Field Service" --environment-id <id> --json`]},info:{description:"Shows a managed project and its associated apps.",options:{project:"ID of the managed project to show. Defaults to the current project or app context.",environmentId:"Environment ID containing the project (optional)."},examples:[`${"ms"} project info --project <id>`,`${"ms"} project info --project <id> --environment-id <id>`,`${"ms"} project info --project <id> --json`]},list:{description:"Lists managed projects across the tenant, or within one environment when --environment-id is supplied.",options:{environmentId:"Environment ID to filter managed projects by (optional)."},examples:[`${"ms"} project list`,`${"ms"} project list --environment-id <id>`,`${"ms"} project list --json`],approval:{description:"Lists the approvers currently configured on a project's Prod target, with the name and email the service reports for each.",options:{projectId:"ID of the managed project. Defaults to the project in ms.project.config.json.",environmentId:"Environment ID hosting the project. Required unless it can be read from ms.project.config.json.",target:"Hidden. Target whose approvers to manage. Defaults to Prod."},examples:[`${"ms"} project list approval`,`${"ms"} project list approval --project <projectId>`,`${"ms"} project list approval --json`]}},remove:{deployment:{description:"Start removing a deployment target from the current project. Removal continues in the background. The production deployment target cannot be removed.",options:{target:"Deployment target to remove. Only 'test' is supported.",force:"Skip confirmation. Required in JSON or non-interactive mode."},examples:[`${"ms"} project remove deployment-target --target test`,`${"ms"} project remove deployment-target --target test --force --json`,`${"ms"} project remove deployment-target --target test --cloud public --force`]},approval:{description:"Remove one or more approvers from a project's Prod target. Provide a comma-separated list of user or group email addresses, matched against the emails shown by 'project list approval' (an address shared by more than one approver is skipped; use the object ID), or object IDs (GUIDs), or pass --all to remove every approver. Approvals apply to Prod only; other targets do not support approvers.",options:{projectId:"ID of the managed project. Defaults to the project in ms.project.config.json.",environmentId:"Environment ID hosting the project. Required unless it can be read from ms.project.config.json.",all:"Remove every approver configured on the project. Cannot be combined with an explicit list.",target:"Hidden. Target whose approvers to manage. Defaults to Prod."},examples:[`${"ms"} project remove approval alice@contoso.com`,`${"ms"} project remove approval --project <projectId> <object-id>`,`${"ms"} project remove approval --all`]}},build:{description:"Initiate a build for the current managed project. By default, the CLI waits for the build to reach a terminal state; pass --no-wait to return immediately after submission.",options:{commitSha:"The commit ID to build from.",noWait:"Return immediately after submitting the build and print a build-status hint."},examples:[`${"ms"} project build`,`${"ms"} project build --commit abc1234`,`${"ms"} project build --no-wait`,`${"ms"} project build --json`]},buildStatus:{description:"Check the build status for the current managed project.",options:{commitSha:"The commit ID for which a build was initiated by project build.",showLog:"Fetch and print the build log when available."},examples:[`${"ms"} project build-status --commit <sha>`,`${"ms"} project build-status --commit <sha> --show-log`,`${"ms"} project build-status --commit <sha> --json`]},deploy:{description:"Deploy the single app associated with a managed project through Managed DevOps. This temporary command uses the app deployment pipeline until multi-app project deployment is available.",options:{projectId:"ID of the managed project to deploy. Without this option, the current app association is preferred before ms.project.config.json.",environmentId:"Environment containing the managed project. When provided, this takes precedence over app config, project config, and developer-environment routing.",noWait:"Return after deployment submission and print the deployment ID instead of polling to completion."},examples:[`${"ms"} project deploy`,`${"ms"} project deploy --project <id>`,`${"ms"} project deploy --project <id> --environment-id <id>`,`${"ms"} project deploy --commit abc1234`,`${"ms"} project deploy --target test`,`${"ms"} project deploy --force --json`]},deployStatus:{description:"Show the latest deployment status for a managed project, including who decided its approval, when, and their comment.",options:{projectId:"ID of the managed project. Without this option, the current app association is preferred before ms.project.config.json.",environmentId:"Environment containing the managed project selected with --project. When omitted, the default environment is used.",deploymentId:"ID of a specific deployment to inspect. When omitted, shows the latest deployment."},examples:[`${"ms"} project deployment-status`,`${"ms"} project deployment-status --project <id>`,`${"ms"} project deployment-status --project <id> --environment-id <id>`,`${"ms"} project deployment-status --deployment-id <id>`,`${"ms"} project deployment-status --json`]},pack:{description:"Validate and pack the discovered project apps, staging the project artifact in .ms/packed/.",examples:[`${"ms"} project pack`,`${"ms"} project pack --json`]},state:{description:"Manage project state and its schema.",clear:{description:"Discard the app's Preview state for all users and all item types. Live data, the app, and source code are unchanged. Requires Update permission. Background deletion may continue after the request returns; request success is not confirmed purge completion.",options:{app:`Real app ID (non-zero GUID), without a -dev suffix. Defaults to appId in ${t}; an explicit ID works outside an app checkout.`,environmentId:"Override the environment ID. When omitted, locate the app before confirmation; never use the current directory's config environment for another app.",force:"Acknowledge the Preview-only destructive action and skip LOCAL confirmation only. Required in JSON/non-interactive mode; never bypasses authorization or data locks."},examples:[`${"ms"} project state clear`,`${"ms"} project state clear --app <app-id> --environment-id <id>`,`${"ms"} project state clear --app <app-id> --force --json --non-interactive`]},"generate-code":{description:"Generate TypeScript models, validators, and data services from the configured state schema.",examples:[`${"ms"} project state generate-code`,`${"ms"} project state generate-code --json`]},"list-schema":{description:"Show the collections and properties defined in the state schema configured by state.schemaPath.",hint:"Edit the schema file directly for anything these commands cannot express, such as nested objects or arrays.",examples:[`${"ms"} project state list-schema`,`${"ms"} project state list-schema --json`]},"list-settings":{description:"Show the state schema settings \u2014 the JSON Schema dialect, locale, and validation state \u2014 followed by each collection and the number of indices it claims.",examples:[`${"ms"} project state list-settings`,`${"ms"} project state list-settings --json`]},"set-setting":{description:"Update one state schema setting: locale or write validation.",options:{locale:"IETF BCP-47 language tag, such as en-US or fr-FR. Defaults to en-US.",validation:"Whether schema validation is enabled: 'true' validates writes; 'false' keeps indexes without validating writes."},examples:[`${"ms"} project state set-setting --locale en-US`,`${"ms"} project state set-setting --locale fr-FR`,`${"ms"} project state set-setting --validation false`]},add:{description:"Add a collection to the state schema, or add a property to an existing collection. Pass --collection on its own to add a collection, or with --property to add a property.",options:{collection:"Name of the collection to add, or the collection the new property belongs to.",property:"Name of the property to add. Omit to add a collection instead.",type:"Property type: string, number, integer, boolean, datetime, guid, or binary.",required:"Whether the property must be present on every item: 'true' or 'false'.",index:"Whether to index the property: 'true' or 'false'. A collection may define at most 4.","index-ignore-case":"Whether the index ignores case: 'true' or 'false'. String, guid, and binary properties only; defaults to true for guid.","index-ignore-accents":"Whether the index ignores accents: 'true' or 'false'. String, guid, and binary properties only.","max-length":"Longest permitted string. String properties only.","min-length":"Shortest permitted string. String properties only.","max-value":"Largest permitted value. A number for number and integer properties, an ISO 8601 instant for datetime.","min-value":"Smallest permitted value. A number for number and integer properties, an ISO 8601 instant for datetime.",format:"String format: date-time, uri, or uuid. String properties only.",kind:"How to treat the referenced resource: image or binary. Binary properties only."},examples:[`${"ms"} project state add --collection orders`,`${"ms"} project state add --collection orders --property customerName --type string --required true`,`${"ms"} project state add --collection orders --property total --type number --min-value 0`,`${"ms"} project state add --collection orders --property sku --type string --index true --index-ignore-case true`]},alter:{description:"Change an existing property in the state schema. Only the switches you pass are rewritten; the rest are left alone.",hint:"Adding an index to a previously deployed property may be rejected because its index plan is frozen. Test the change with a different Preview commit and Preview state store before deploying.",options:{collection:"Collection holding the property.",property:"Property to change.",type:"New property type. Omit to keep the existing one.",required:"Whether the property must be present on every item: 'true' or 'false'.",index:"Whether to index the property: 'true' or 'false'.","index-ignore-case":"Whether the index ignores case: 'true' or 'false'.","index-ignore-accents":"Whether the index ignores accents: 'true' or 'false'.","max-length":"Longest permitted string. String properties only.","min-length":"Shortest permitted string. String properties only.","max-value":"Largest permitted value. Number, integer, and datetime properties only.","min-value":"Smallest permitted value. Number, integer, and datetime properties only.",format:"String format: date-time, uri, or uuid. String properties only.",kind:"How to treat the referenced resource: image or binary. Binary properties only."},examples:[`${"ms"} project state alter --collection orders --property customerName --max-length 200`,`${"ms"} project state alter --collection orders --property customerName --required false`]},remove:{description:"Remove a property from the state schema. Declared collections cannot be removed after deployment.",hint:"Stored values are not deleted when a property definition is removed.",options:{collection:"Collection holding the property.",property:"Property to remove. Omitting it reports that declared collections cannot be removed.",force:"Remove the schema definition without prompting for confirmation."},examples:[`${"ms"} project state remove --collection orders --property customerName --force`]}}},deployment:{status:{description:"Show the latest deployment status for a managed project, including who decided its approval, when, and their comment.",examples:[`${"ms"} deployment status`,`${"ms"} deployment status --project <id>`,`${"ms"} deployment status --project <id> --environment-id <id>`,`${"ms"} deployment status --deployment-id <id>`,`${"ms"} deployment status --json`]},approve:{description:"Approves a pending deployment to a project. Targets Prod unless --target names another target.",options:{projectId:"ID of the managed project. Defaults to the project in ms.project.config.json.",environmentId:"Environment ID hosting the project. Required unless it can be read from ms.project.config.json.",target:"Name of the target to approve the pending deployment for. Defaults to Prod.",comment:"Optional comment to record with the approval.",deploymentId:"Directly identifies the deployment to approve by ID, bypassing --target resolution."},examples:[`${"ms"} deployment approve`,`${"ms"} deployment approve --target Prod`,`${"ms"} deployment approve --project <projectId> --target Prod --comment "LGTM"`,`${"ms"} deployment approve --target Prod --json`]},reject:{description:"Rejects a pending deployment to a project. Targets Prod unless --target names another target.",options:{projectId:"ID of the managed project. Defaults to the project in ms.project.config.json.",environmentId:"Environment ID hosting the project. Required unless it can be read from ms.project.config.json.",target:"Name of the target to reject the pending deployment for. Defaults to Prod.",comment:"Optional comment to record with the rejection.",deploymentId:"Directly identifies the deployment to reject by ID, bypassing --target resolution."},examples:[`${"ms"} deployment reject`,`${"ms"} deployment reject --target Prod`,`${"ms"} deployment reject --project <projectId> --target Prod --comment "Needs another look"`]},cancel:{description:"Cancels a pending deployment to a project. Targets Prod unless --target names another target.",options:{projectId:"ID of the managed project. Defaults to the project in ms.project.config.json.",environmentId:"Environment ID hosting the project. Required unless it can be read from ms.project.config.json.",target:"Name of the target to cancel the pending deployment for. Defaults to Prod.",deploymentId:"Directly identifies the deployment to cancel by ID, bypassing --target resolution."},examples:[`${"ms"} deployment cancel`,`${"ms"} deployment cancel --target Prod`,`${"ms"} deployment cancel --project <projectId> --target Prod`]},list:{description:"List deployment history for a managed project, or for the selected environment when no project context is available.",options:{project:"Managed project ID. Defaults to the current managed project context.",environmentId:"Environment to query when listing environment-wide history. When used with --project, the project must belong to this environment.",target:"Filter by deployment target. Use prod for production or a named target such as uat.",status:"Filter by deployment status: Pending, ValidatingAssets, AwaitingApproval, Running, RollingBack, Succeeded, Failed, RolledBack, PartiallyRolledBack, ValidationCompleted, Rejected, or Cancelled.",top:"Maximum number of the most recent deployments to return. Defaults to 50 and must be between 1 and 200.",continuationToken:"Resume deployment history from an opaque continuation token returned by an earlier request."},examples:[`${"ms"} deployment list`,`${"ms"} deployment list --project <project-id> --top 5`,`${"ms"} deployment list --project <project-id> --continuation-token <token>`,`${"ms"} deployment list --project <project-id> --target prod`,`${"ms"} deployment list --project <project-id> --target uat`,`${"ms"} deployment list --project <project-id> --status Running`]}},connector:{list:{description:"List connectors available in the environment. By default all connectors are shown, including those blocked by tenant policy; pass --only-allowed to list only connectors allowed by tenant policy.",hint:'Use the value in the "Connector" column as the ID (e.g. office365), or pass the display name directly (e.g. "Office 365 Users") to add commands.',options:{environmentId:"Environment ID (optional).",search:"Filter connectors by display name or connector ID (case-insensitive).",onlyAllowed:"List only connectors allowed by tenant policy. By default all connectors are listed, including blocked ones."},examples:[`${"ms"} connector list`,`${"ms"} connector list --search "sql"`,`${"ms"} connector list --only-allowed`,`${"ms"} connector list --environment-id <env-id>`,`${"ms"} connector list --json`]},"list-actions":{description:"List actions available on a connector with their policy behavior.",options:{connector:"Connector identifier (e.g. office365).",environmentId:"Environment ID (optional).",search:"Filter actions by summary or action ID (case-insensitive)."},examples:[`${"ms"} connector list-actions --connector office365`,`${"ms"} connector list-actions --connector sql --search "execute"`,`${"ms"} connector list-actions --connector office365 --environment-id <env-id>`,`${"ms"} connector list-actions --connector office365 --json`]}},telemetry:{enable:{description:"Enable telemetry collection. Defaults to --remote if no target is specified.",options:{remote:"Enable sending telemetry to the cloud service (default).",console:"Enable outputting telemetry to the local console."},examples:[`${"ms"} telemetry enable`,`${"ms"} telemetry enable --console`,`${"ms"} telemetry enable --remote --console`]},disable:{description:"Disable telemetry collection. Defaults to --remote if no target is specified.",options:{remote:"Disable sending telemetry to the cloud service (default).",console:"Disable outputting telemetry to the local console."},examples:[`${"ms"} telemetry disable`,`${"ms"} telemetry disable --console`,`${"ms"} telemetry disable --remote --console`]},status:{description:"Show the current telemetry settings.",examples:[`${"ms"} telemetry status`,`${"ms"} telemetry status --json`]}},feature:{list:{description:"List experimental and preview CLI features and their status. In-development features appear only when enabled.",examples:[`${"ms"} feature list`,`${"ms"} feature list --json`]},status:{description:"Show whether a CLI feature is enabled and which setting controls it.",options:{name:`Feature name, as shown by '${"ms"} feature list'.`},examples:[`${"ms"} feature status --name state`,`${"ms"} feature status --name state --json`]},enable:{description:"Turn on a CLI feature for future runs by saving it to your user settings. A MS_CLI_FEATURE_<NAME> environment variable overrides this setting.",options:{name:`Feature name to enable, as shown by '${"ms"} feature list'.`},examples:[`${"ms"} feature enable --name state`]},disable:{description:"Turn off a CLI feature for future runs by saving it to your user settings. A MS_CLI_FEATURE_<NAME> environment variable overrides this setting. Apps or projects that already use the feature keep it on.",options:{name:`Feature name to disable, as shown by '${"ms"} feature list'.`},examples:[`${"ms"} feature disable --name state`]},reset:{description:"Remove your saved setting for a CLI feature and return it to its default. A MS_CLI_FEATURE_<NAME> environment variable still overrides the default.",options:{name:`Feature name to reset, as shown by '${"ms"} feature list'.`},examples:[`${"ms"} feature reset --name state`]}},git:{auth:{refresh:{description:"Authenticate against a GitHub repository so subsequent app create / deploy / preview / build commands targeting that repo know your GitHub identity. Runs the GitHub device code flow via the Managed Apps GitHub App; no GitHub token is stored locally.",options:{repo:"GitHub repository URL (e.g. https://contoso.ghe.com/contoso/my-app or https://github.com/contoso/my-app). The Managed Apps GitHub App is the only supported provider; the server enforces which hosts/tenants are accepted.",openBrowser:"Launch the browser to complete the GitHub device code flow. Default: do not launch."},examples:[`${"ms"} git auth refresh --repo https://contoso.ghe.com/contoso/my-app`,`${"ms"} git auth refresh -r https://contoso.ghe.com/contoso/my-app --open-browser`,`${"ms"} git auth refresh --repo https://contoso.ghe.com/contoso/my-app --json`]}}}};export{n as a};
8
- /*!
9
- * Copyright (C) Microsoft Corporation. All rights reserved.
10
- */
11
- //# sourceMappingURL=chunk-3UIUI5Q2.js.map
@@ -1,11 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __pathDirname } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __pathDirname(__filename);
7
- import{a as C,c as F,d as S}from"./chunk-C7V6WEZM.js";import{a as c,b as f,c as g,d as m}from"./chunk-OUKOEUZA.js";import{O as p}from"./chunk-4AO24KKT.js";var o={ga:{stage:"development",displayName:"Portable Definitions",description:"Adds portable app and project definitions",isEnabledInWorkspace:async()=>!1},codegenv3:{stage:"development",displayName:"Simplified Codegen",description:"Adds simplified code generation",isEnabledInWorkspace:async()=>!1},state:{stage:"experimental",displayName:"App State",description:"Adds the ms project state commands",isEnabledInWorkspace:async e=>[e?.state,e?.data,e?.db].some(t=>t?.enabled===!0)},alm:{stage:"development",displayName:"Application Lifecycle Management",description:"Adds deployment target and other project-based capabilities",isEnabledInWorkspace:async e=>!!e?.projectId},projects:{stage:"development",displayName:"Managed Projects",description:"Adds managed project commands and Managed DevOps app deployments",isEnabledInWorkspace:async(e,t)=>t!==void 0||!!e?.projectId},rayfin:{stage:"development",displayName:"Rayfin",description:"Adds Rayfin backend support",isEnabledInWorkspace:async()=>!1}},u={"72f988bf-86f1-41af-91ab-2d7cd011db47":{}};function T(e){return`FEATURE_${e.toUpperCase()}`}var I="features";function x(e){return e.trim().toLowerCase()}function L(e){return Object.hasOwn(o,e)}function O(){return Object.keys(o).filter(e=>o[e].stage!=="development")}function U(e){if(typeof e!="string")return;let t=e.trim().toLowerCase();return t==="enabled"||t==="disabled"?t:void 0}function k(e){let t=e?.[I];return F(t)?t:{}}function j(e){let t=new Map;for(let[n,r]of Object.entries(k(e))){let a=U(r);a&&t.set(x(n),a)}return t}var y=!1;function v(){try{return j(S())}catch{return y||(y=!0,p(`Ignoring saved feature settings: couldn't read ${C()}. Make sure it contains a valid JSON object, or delete it to clear your saved settings.`)),new Map}}var b;function M(e){b=e}function E(){return b?.getUserTenantId()?.trim().toLowerCase()||void 0}function R(e,t){if(!(t===void 0||!Object.hasOwn(u,t)))return u[t][e]}var N=new Set;async function $(e,t){let n=new Set;for(let r of Object.keys(o))await o[r].isEnabledInWorkspace(e,t)&&n.add(r);N=n}function D(e,t,n,r){let a=T(e),i=f(a),d=n.get(e),l=R(e,r),s={name:e,stage:t.stage,description:t.description,envVar:c(a),...i!==void 0&&{envValue:i},...d&&{userSetting:d},...r!==void 0&&{tenantId:r},...l&&{tenantDefault:l}};return g(i)?{...s,enabled:!0,source:"environment"}:m(i)?{...s,enabled:!1,source:"environment"}:d?{...s,enabled:d==="enabled",source:"userSettings"}:l?{...s,enabled:l==="enabled",source:"tenant"}:{...s,enabled:!1,source:"default"}}function A(e,t,n){let r=o[e],a=D(e,r,t,n),i=N.has(e);return i&&!a.enabled?{...a,usedInWorkspace:i,enabled:!0,source:"workspace"}:{...a,usedInWorkspace:i}}function _(e,t=v()){return A(e,t,E())}function z(e=v()){let t=E();return Object.keys(o).map(n=>A(n,e,t)).filter(n=>n.enabled||n.stage!=="development")}function B(e){return _(e).enabled}export{o as a,T as b,I as c,x as d,L as e,O as f,U as g,k as h,j as i,M as j,$ as k,_ as l,z as m,B as n};
8
- /*!
9
- * Copyright (C) Microsoft Corporation. All rights reserved.
10
- */
11
- //# sourceMappingURL=chunk-B6REHI77.js.map
@@ -1,13 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __pathDirname } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __pathDirname(__filename);
7
- import{h as we,i as ve,k as De}from"./chunk-YMRQPXY7.js";import{b as Ae}from"./chunk-HWEMI6JI.js";import{a as Oe}from"./chunk-ELHOJBVT.js";import{e as he}from"./chunk-JWSX7DVU.js";import{b as ge}from"./chunk-ZREDMBLO.js";import{a as K}from"./chunk-OL6CTXQR.js";import{a as ye}from"./chunk-OBATM5M4.js";import{e as ce,f as me,m as ue}from"./chunk-OTXBVG3E.js";import{b as z}from"./chunk-EFTF4FA7.js";import{b as Z,l as de}from"./chunk-5BE4TLDK.js";import{A as I,B as V,E as O,Fa as se,Ka as pe,La as le,Ob as M,Pb as U,Ra as q,Sa as Y,da as re,l as ie,w as J,x as A,y as p}from"./chunk-E2O4YZX2.js";import{b as fe,n as X}from"./chunk-B6REHI77.js";import{y as f,z as N}from"./chunk-WS6TGUH7.js";import{a as g}from"./chunk-3UIUI5Q2.js";import{G as B,H as x,I as ae,M as u,O as F,a as C}from"./chunk-4AO24KKT.js";import{d as xe}from"./chunk-UT667QSU.js";import{promises as Pe}from"node:fs";import*as _ from"node:path";import*as be from"node:zlib";var Me=10*1024*1024;function Ce(e,t){try{return Ue(e,t)}catch{return}}function Ue(e,t){let o=He(e);if(o<0)return;let a=33639248,n=e.readUInt16LE(o+10),r=e.readUInt32LE(o+16);for(let s=0;s<n;s++){if(e.readUInt32LE(r)!==a)return;let i=e.readUInt16LE(r+10),d=e.readUInt32LE(r+20),c=e.readUInt16LE(r+28),v=e.readUInt16LE(r+30),h=e.readUInt16LE(r+32),l=e.readUInt32LE(r+42);if(e.subarray(r+46,r+46+c).toString("utf8")===t){let k=e.readUInt16LE(l+26),S=e.readUInt16LE(l+28),m=l+30+k+S,w=e.subarray(m,m+d);return i===0?w.toString("utf8"):i===8?be.inflateRawSync(w,{maxOutputLength:Me}).toString("utf8"):void 0}r+=46+c+v+h}}function He(e){let o=Math.max(0,e.length-22-65535);for(let a=e.length-22;a>=o;a--){if(e.readUInt32LE(a)!==101010256)continue;let n=e.readUInt16LE(a+20);if(a+22+n===e.length)return a}return-1}import{promises as Ie}from"node:fs";var ke=xe(Oe(),1);function Le(e){return e?.code==="ENOENT"?"continue":e instanceof Error?e:new Error(String(e))}function _e(e){return`zipBuildArtifact: skipping missing entry: ${e?.path??"<unknown>"}`}async function Se(e,t,o){let a=await Ie.stat(e).catch(()=>null);if(!a)throw new p(`buildPath not found: ${e}`);if(!a.isDirectory())throw new p(`buildPath is not a directory: ${e}`);let n=await Ie.stat(t).catch(()=>null);if(!n||!n.isFile())throw new p(`appConfigPath does not point to a file: ${t}`);let r=o?.maxBytes;return new Promise((s,i)=>{let d=[],c=0,v=!1,h=(0,ke.default)("zip",{zlib:{level:9}});h.on("data",l=>{if(!v){if(c+=l.length,r!==void 0&&c>r){v=!0,h.abort(),i(new O({capBytes:r,bytes:c}));return}d.push(l)}}),h.on("warning",l=>{if(v)return;let b=Le(l);if(b==="continue"){F(_e(l));return}i(b)}),h.on("error",l=>{v||i(l)}),h.on("end",()=>{v||s(Buffer.concat(d))}),h.directory(e,!1),h.file(t,{name:C}),h.finalize()})}var je=1200*1e3,Ge=6e4,We=2e3,Je="--no-wait requires Managed DevOps deployment; the selected backend does not return a trackable deployment ID.",Ee=`External artifact deployment is not enabled for this environment.
8
- To enable it, contact your administrator to turn on the
9
- AllowExternalArtifactDeployment environment setting.`;function Q(e){return`${(e/(1024*1024)).toFixed(1)} MB`}function ee(e,t){return e!==void 0?`Build artifact is ${Q(e)}, which exceeds the ${Q(t)} limit.`:`Build artifact exceeds the ${Q(t)} limit.`}function Ve(e){let t=e.id||e.name;if(!t)throw new A("Deploy succeeded but the server response did not include an app identifier.");return{appId:t,displayName:e.displayName,commitHash:e.commitHash??null,appPlayUri:e.appPlayUri??null}}function Ne(e){return{appId:e.appId,displayName:e.name,commitHash:e.commitSha,appPlayUri:e.appPlayUri}}function te(e,t=e.commitSha){return{deploymentId:e.deploymentId,appName:e.appName,commitHash:t}}function oe(e){let t,o;return{onProgress:a=>{e?.(a),a.type==="submitted"&&(o=a.commitSha),a.type==="status"&&a.deploymentStatus==="AwaitingApproval"&&(t=a.deploymentId)},getHandoff:()=>t?{deploymentId:t,commitHash:o}:void 0}}function P(e){if(e.body)try{let t=JSON.parse(e.body);if(typeof t?.error?.message=="string")return t.error.message}catch{}}var qe={AwaitingApproval:"awaitingApproval",Pending:"inProgress",ValidatingAssets:"inProgress",ValidationCompleted:"inProgress",Running:"inProgress",RollingBack:"inProgress"};function Ye(e){let t=P(e);if(!t)return"unknown";for(let[o,a]of Object.entries(qe))if(t.includes(`'${o}'`))return a;return"unknown"}function Ze(e,t){let{targetName:o}=t,a=o?` to target '${o}'`:"",n=` --project ${t.projectId??"<project-id>"} --environment-id ${t.environmentId}`,r=o?` --target ${o}`:"",s="The deployment could not be completed.";switch(e){case"awaitingApproval":return`${s} There is an existing deployment${a} awaiting approval. Wait for this deployment to complete or cancel the deployment before attempting to deploy again. Run \`${"ms"} deployment cancel${n}${r}\` to cancel it.`;case"inProgress":return`${s} There is an existing deployment${a} in progress. Wait for this deployment to complete before attempting to deploy again.`;case"unknown":return`${s} There is an existing deployment${a} that has not finished. Wait for this deployment to complete, or cancel it if it is awaiting approval, before attempting to deploy again. Run \`${"ms"} deployment list${n}\` to view it.`}}function Ke(e){let t=e.reason==="resultUnavailable"?`Run \`${"ms"} app info\` to view the deployed app.`:e.operationId?`Run \`${"ms"} app info\` to check which commit is live before deploying again.`:void 0;return t&&(e.message=`${e.message} ${t}`),e}function ze(e,t){if(e instanceof O)return new p(ee(e.bytes,e.capBytes),e.errorData,{errorCode:"BuildArtifactTooLarge",telemetryDetails:e.errorData});if(e instanceof re)return Ke(e);if(!(e instanceof ie))return null;let o={httpStatus:e.status,serverErrorCode:e.code},a=t.repoType!=="none";if(e.status===400&&e.code==="ArtifactNotAllowedForGitRepo"){let n=P(e);return new I(n?`Artifact upload rejected for this git-backed app: ${n}`:`The server reports this app is git-backed; --artifact uploads are not allowed. Update \`${C}\` so \`repoType\` matches the server's record, then re-run with --commit.`,{httpStatus:e.status,serverErrorCode:e.code},{errorCode:"DeploymentModeMismatch",exitCode:1,telemetryDetails:o})}if(e.status===400&&e.code==="CommitNotAllowedForArtifactDeploy")return new p("This app uses external artifact deployment. Pass --artifact <path> instead of --commit.",{httpStatus:e.status,serverErrorCode:e.code},{errorCode:"DeploymentModeMismatch",telemetryDetails:o});if(e.status===400&&e.code==="InvalidRequestContent")return new p("Invalid deploy request \u2014 verify the environment and app id.",{httpStatus:e.status,serverErrorCode:e.code},{errorCode:"InvalidDeployRequest",telemetryDetails:o});if(e.status===400&&e.code==="ServicePrincipalNotSupportedForMaafOperations")return new p("Service principal callers are not supported for `ms app deploy`. Use interactive auth.",{httpStatus:e.status,serverErrorCode:e.code},{errorCode:"UnsupportedCallerType",telemetryDetails:o});if(e.status===400&&e.code==="BadRequest"){let n=P(e);return a?new p(n??"Invalid commit ID. Use a 40-character lowercase hex value.",{httpStatus:e.status,serverErrorCode:e.code},{errorCode:"InvalidCommitSha",telemetryDetails:o}):new p(`Build artifact rejected: ${n??e.message}`,{httpStatus:e.status,serverErrorCode:e.code},{errorCode:"BuildArtifactRejected",telemetryDetails:o})}if(e.status===400&&e.code==="BuildNotAvailable")return new A("No completed build is available for this commit. Run `ms app build` first, or wait for the build to complete before retrying.",void 0,{httpStatus:e.status,serverErrorCode:e.code},{errorCode:"BuildNotAvailable",errorCategory:J.Platform,retryable:!0,telemetryDetails:o});if(e.status===403&&e.code==="ExternalArtifactDeploymentDisabled")return new I(Ee,{httpStatus:e.status,serverErrorCode:e.code},{errorCode:"ExternalArtifactDeploymentDisabled",exitCode:1,telemetryDetails:z("deployment_configuration",o)});if(e.status===403&&e.code==="InsufficientPrivilege"){let n=P(e);return new I(n?`${n} Ask an admin to grant the required privilege.`:"You don't have the required privilege to deploy this app. Ask an admin to grant deploy permission on the environment.",{httpStatus:e.status,serverErrorCode:e.code},{errorCode:"InsufficientPrivilege",exitCode:1,telemetryDetails:o})}if(e.status===403&&e.code==="CodeAppOperationNotAllowedInEnvironment")return new I(Ee,{httpStatus:e.status,serverErrorCode:e.code},{errorCode:"CodeAppOperationNotAllowedInEnvironment",exitCode:1,telemetryDetails:z("environment_configuration",o)});if(e.status===403&&e.code==="Forbidden")return new I("You don't have permission to deploy this app. Ask an admin to grant you Contributor on the repo.",{httpStatus:e.status,serverErrorCode:e.code},{errorCode:"RepositoryPermissionDenied",exitCode:1,telemetryDetails:o});if(e.status===404&&e.code==="CommitNotFound"){let n=P(e);return new p(n??"Commit not found on main.",{httpStatus:e.status,serverErrorCode:e.code},{errorCode:"CommitNotFound",telemetryDetails:o})}if(e.status===404&&e.code==="ApplicationNotFound")return new p(`App '${t.appName}' not found in environment ${t.environmentId}.`);if(e.status===404&&e.code==="PowerConfigNotFound")return new A(`Build output is missing the app config (\`${C}\`). Ensure the config is present at the root of the build output and re-run the build.`);if(e.status===404&&e.code==="OperationNotFound")return new A("Build operation not found on the server. The operation may have been cleaned up; re-run `ms app deploy` to start a fresh build.");if(e.status===409&&e.code==="BuildInProgress")return new A("A build is currently in progress for this app. Run `ms app build-status` to check progress, then retry the deploy.");if(e.status===409&&e.code==="NoGreenBuildAvailable")return new A("No successful build is available to deploy. Push a commit and wait for the build to succeed before retrying.");if(e.status===409&&e.code==="DeploymentTargetBusy"){let n=Ye(e);return new A(Ze(n,t),void 0,{httpStatus:e.status,serverErrorCode:e.code},{errorCode:"DeploymentTargetBusy",errorCategory:J.User,telemetryDetails:{...o,blockingDeploymentState:n}})}if(e.status===409&&e.code==="RepoTypeMismatch"){let n=P(e);return new p(n?`Repo type mismatch: ${n}`:"The app's repoType in ms.config.json doesn't match the server's record. Update ms.config.json to match.")}if(e.status===413)return new A(ee(void 0,524288e3));if(e.status===422&&e.code==="ArtifactInvalid"){let n=P(e)??e.message;return new p(`Artifact validation failed: ${n}`)}return e.status===502&&e.code==="MaafBuildServiceUnavailable"?new V("Build service is temporarily unavailable. Try again.",{httpStatus:e.status,serverErrorCode:e.code},{errorCode:"BuildServiceUnavailable",exitCode:1,retryable:!0,telemetryDetails:o}):e.status===503&&e.code==="AuthorizationCheckFailed"?new V("Authorization service is temporarily unavailable. Try again.",{httpStatus:e.status,serverErrorCode:e.code},{errorCode:"AuthorizationServiceUnavailable",exitCode:1,retryable:!0,telemetryDetails:o}):null}async function Xe(e){let{provider:t,appName:o,force:a,forceReauth:n,waitForDeployment:r,onDeployProgress:s}=e,i=e.commitFromFlag,d,c=!1;if(!i){let m=ce();if(!m)throw new p("Could not determine the latest commit ID. Use --commit or -c to specify it.");i=m.commitSha,d=m.detached?void 0:m.branch,c=!0}if(c&&!t.isJsonMode()&&u(d?`Using branch '${d}' at commit ${i}.`:`Detached HEAD at commit ${i}.`),!a){let m=ue();if(m&&U().interactive&&!t.isJsonMode()){if(F(m),!await Z({message:"Deploy anyway?",initialValue:!1}))return u("Deploy cancelled."),null}else if(m)throw new p(`${m} Run again with --force to deploy anyway.`)}let v=M(),h=await se({logger:v,actionsParams:{appName:o,commitSha:i,...n&&{forceReauth:!0}}});if(h===null)t.isJsonMode()||u(`A cached build exists for commit ${i}; `+(r?"deploying it.":"submitting its deployment."));else{t.isJsonMode()||u("Build queued; waiting for completion...");let m=await ge({appName:o,commitSha:i,initialWaitMs:h.retryAfterMs??We,isJsonMode:t.isJsonMode(),deadlineMs:je,maxIntervalMs:Ge,spinnerLabel:"Waiting for build..."});if(m.status!=="Succeeded")throw new A(`Unexpected terminal build status "${m.status}". Commit ID: ${i}.`)}let l={appName:o,commitSha:i,...e.targetName!==void 0&&{deploymentName:e.targetName},...n&&{forceReauth:!0}};if(!r){let m=await le({logger:v,actionsParams:l});return{kind:"submitted",value:te(m)}}let b=e.useManagedDevOpsDeployment?oe(s):void 0,k;try{k=await pe({logger:v,actionsParams:l,onProgress:b?.onProgress??s,onAppFrameworkProgress:e.onAppFrameworkProgress})}catch(m){let w=b?.getHandoff();if(!w)throw m;return{kind:"awaitingApproval",value:{deploymentId:w.deploymentId,appName:o,commitHash:i}}}let S=b?.getHandoff();return S?{kind:"awaitingApproval",value:{deploymentId:S.deploymentId,appName:o,commitHash:i}}:{kind:"deployed",value:Ve(k)}}function Qe(e){let t=Ce(e,"manifest.json");if(t===void 0)return;let o;try{o=JSON.parse(t)}catch{return}let a=o?.backends?.default?.kind;if(!(typeof a!="string"||a.toLowerCase()!=="rayfin")&&!X("rayfin"))throw new p(`This artifact packages a Rayfin backend (manifest.json "backends.default.kind": "rayfin"), but the rayfin CLI feature is not enabled in this environment. Enable it (${fe("rayfin")}=1 or \`ms feature enable rayfin\`) before deploying a pre-built Rayfin artifact, or rebuild the artifact without a Rayfin backend.`)}async function et(e){let t=_.resolve(e.artifactPath);if(_.extname(t).toLowerCase()!==".zip")throw new p(`--artifact must point to a .zip file. Received: ${e.artifactPath}`);let o=await tt(t);if(!o||!o.isFile())throw new p(`--artifact file not found or not a regular file: ${e.artifactPath}`);if(o.size>524288e3)throw new p(ee(o.size,524288e3));let a=await Pe.readFile(t);Qe(a),e.provider.isJsonMode()||u(e.waitForDeployment?"Uploading artifact and deploying...":"Uploading artifact and submitting deployment...");let n={logger:M(),actionsParams:{appName:e.appName,zipBuffer:a,...e.targetName!==void 0&&{deploymentName:e.targetName}}};if(!e.waitForDeployment){let{commitSha:d,submission:c}=await Y(n);return{kind:"submitted",value:te(c,d)}}let r=oe(e.onDeployProgress),s;try{s=await q({...n,onProgress:r.onProgress,onAppFrameworkProgress:e.onAppFrameworkProgress})}catch(d){let c=r.getHandoff();if(!c?.commitHash)throw d;return{kind:"awaitingApproval",value:{deploymentId:c.deploymentId,appName:e.appName,commitHash:c.commitHash}}}let i=r.getHandoff();return i?{kind:"awaitingApproval",value:{deploymentId:i.deploymentId,appName:e.appName,commitHash:s.commitSha}}:{kind:"deployed",value:Ne(s)}}async function tt(e){try{return await Pe.stat(e)}catch(t){if(t instanceof Error&&"code"in t&&t.code==="ENOENT")return null;throw t}}async function ot(e){if(we(e.appConfig),!(e.provider.isJsonMode()||!U().interactive)){let d=e.appConfig.buildType==="none"?"package the prebuilt app assets and deploy the resulting artifact":"build the app and deploy the resulting artifact";if(!await Z({message:`This will ${d} to environment ${e.environmentId}. Continue?`,initialValue:!1}))return u("Aborted."),null}let{packAppOutputDir:o}=await De({quiet:e.provider.isJsonMode()}),a=await Se(o,e.appConfigPath,{maxBytes:524288e3});e.provider.isJsonMode()||u(e.waitForDeployment?"Uploading build artifact and deploying...":"Uploading build artifact and submitting deployment...");let n={logger:M(),actionsParams:{appName:e.appName,zipBuffer:a,...e.targetName!==void 0&&{deploymentName:e.targetName}}};if(!e.waitForDeployment){let{commitSha:d,submission:c}=await Y(n);return{kind:"submitted",value:te(c,d)}}let r=oe(e.onDeployProgress),s;try{s=await q({...n,onProgress:r.onProgress,onAppFrameworkProgress:e.onAppFrameworkProgress})}catch(d){let c=r.getHandoff();if(!c?.commitHash)throw d;return{kind:"awaitingApproval",value:{deploymentId:c.deploymentId,appName:e.appName,commitHash:c.commitHash}}}let i=r.getHandoff();return i?{kind:"awaitingApproval",value:{deploymentId:i.deploymentId,appName:e.appName,commitHash:s.commitSha}}:{kind:"deployed",value:Ne(s)}}async function Ht(e){await nt(e,!1,at)}async function nt(e,t,o){lt(e,t),await e.runVerb();let a=t||e.isManagedDevOpsDeploymentEnabled(),n=await e.getOption(f.NoWait.camelName,!0)!==!1;if(!n&&!a)throw new p(Je);let r=await e.getOption("commit",!0),s=t?void 0:await e.getOption("artifact",!0);if(r&&s)throw new p("Pass either --commit or --artifact, not both. --commit triggers a build for the commit; --artifact deploys a pre-built zip.");let i=await o(e),{appName:d,tenantId:c,environmentId:v,projectId:h,repoType:l,externalRepoUrl:b,appConfig:k,appConfigPath:S,interactive:m}=i,w=(await e.getOption(f.Target.name,!0))?.trim();if(w!==void 0&&he(w,`--${f.Target.name}`),l==="none"&&r)throw new p("This app uses external artifact deployment. Pass --artifact <path> instead of --commit.");if(s&&l!=="none")throw new p(`--artifact is only valid for apps created with \`repoType: 'none'\`. This app's repoType is \`${l}\`; deploy via \`--commit\` (or omit it to use the current HEAD).`);let Re=r&&l!=="none"?me(r,!0):r,Fe=await e.getOption(f.OpenBrowser.camelName,!0)??!1,$e=await e.getOption(f.ForceReauth.camelName,!0)??!1,Te=await e.getOption(f.Force.name,!0)??!1,E=e.isJsonMode(),ne=m&&process.stdout.isTTY===!0,j=a&&!E&&n?st(ne):void 0,G=j?.onProgress,$=n?rt({print:!E,animate:ne}):void 0,W=$?.onProgress;E&&l==="github"&&ae({phase:"deploy-validation"});let y;try{if(s)y=await et({provider:e,appName:d,artifactPath:s,waitForDeployment:n,targetName:w,onDeployProgress:G,onAppFrameworkProgress:W});else if(l==="native"||l==="github")y=await ye(async({isRetry:T})=>{try{return await Xe({provider:e,appName:d,commitFromFlag:Re,force:Te,forceReauth:$e&&!T&&l==="github",waitForDeployment:n,targetName:w,useManagedDevOpsDeployment:a,onDeployProgress:G,onAppFrameworkProgress:W})}catch(Be){throw j?.stop(),$?.stop(),Be}},{repoType:l,externalRepoUrl:b,tenantId:c,jsonMode:E,openBrowser:Fe,verb:t?"project deploy":"app deploy"});else{if(!k||!S)throw new p("`ms project deploy` currently supports only git-backed managed projects.");y=await ot({provider:e,appName:d,appConfig:k,appConfigPath:S,environmentId:v,waitForDeployment:n,targetName:w,onDeployProgress:G,onAppFrameworkProgress:W})}}catch(R){let T=ze(R,{repoType:l,appName:d,environmentId:v,targetName:w,projectId:h});throw T||R}finally{j?.stop(),$?.stop()}if(y===null)return;if(y.kind==="submitted"){E?x({status:"submitted",deploymentId:y.value.deploymentId,appName:y.value.appName,commitHash:y.value.commitHash,repoType:l}):(B(`Deployment submitted for app '${y.value.appName}'.`),u(`Deployment ID: ${y.value.deploymentId}`),u(`Commit: ${y.value.commitHash}`));return}if(y.kind==="awaitingApproval"){E?x({status:"awaitingApproval",deploymentId:y.value.deploymentId,appName:y.value.appName,commitHash:y.value.commitHash,repoType:l}):(B(`Deployment is awaiting approval for app '${y.value.appName}'.`),u(`Deployment ID: ${y.value.deploymentId}`),u(`Commit: ${y.value.commitHash}`));return}let D=it(y.value,$?.getCompletion());if(w&&D.appPlayUri&&(D.appPlayUri=Ae(D.appPlayUri,"live",void 0,"main",w)??D.appPlayUri),E)x({...D,repoType:l});else{B(`Deployed app '${D.displayName}' (${D.appId}).`),D.commitHash&&u(`Commit: ${D.commitHash}`),D.appPlayUri&&u(`Play URL: ${D.appPlayUri}`),D.operationId&&u(`Operation: ${D.operationId}`);for(let R of D.warnings??[])F(R)}}async function at(e){let{appConfig:t,fileConfig:o,interactive:a}=U();if(!t)throw new I(`${C} is required. Run this command from a directory created by \`ms app create\`.`);if(!o?.appConfigPath)throw new I(`${C} path is unavailable.`);ve(t,s=>new p(s));let n=e.getEnvironmentId();if(!n)throw new p(`No environment ID found. Run this command from a directory with a ${C} (created by \`ms app create\`).`);let r=await e.getTenantIdAsync();if(!r)throw new p("Unable to determine tenant ID. Ensure you are logged in.");return{appName:await de(e),tenantId:r,environmentId:n,projectId:t.projectId?.trim()||void 0,repoType:t.repoType??"native",externalRepoUrl:t.externalRepoUrl,appConfig:t,appConfigPath:o.appConfigPath,interactive:a}}function it(e,t){return t?{...e,commitHash:t.commitHash,operationId:t.operationId,...t.warnings.length>0&&{warnings:t.warnings}}:e}function rt(e){let t,o=!1,a,n=()=>{o&&(t?.stop(),o=!1)},r=()=>{e.animate&&(t??=new K,t.start("Waiting for deployment..."),o=!0)},s=i=>i==="Pending"||i==="Running"||i==="Recovering";return{onProgress:i=>{switch(i.type){case"accepted":if(a=void 0,!e.print||!s(i.operationStatus))return;n(),u(`Deployment accepted. The service is migrating app data; commit ${i.commitHash} goes live when the migration finishes.`),u(`Operation: ${i.operationId}`),r();return;case"status":if(!e.print)return;n(),u(`Deployment status: ${i.operationStatus}`),s(i.operationStatus)&&r();return;case"completed":n(),a=i;return}},getCompletion:()=>a,stop:n}}function st(e){let t,o=!1,a,n=()=>{o&&(t?.stop(),o=!1)},r=()=>{e&&(t??=new K,t.start("Waiting for deployment..."),o=!0)};return{onProgress:i=>{let d=pt(i);if(d!==a)switch(a=d,i.type){case"submitting":n(),u("Submitting deployment...");break;case"submitted":n(),u(`Deployment ID: ${i.deploymentId}`),r();break;case"status":switch(n(),u(`Deployment status: ${i.deploymentStatus}`),i.deploymentStatus){case"Pending":case"AwaitingApproval":case"ValidatingAssets":case"ValidationCompleted":case"Running":case"RollingBack":r();break}break}},stop:()=>{n(),a=void 0}}}function pt(e){switch(e.type){case"submitting":return e.type;case"submitted":return`${e.type}:${e.deploymentId}`;case"status":return`${e.type}:${e.deploymentId}:${e.deploymentStatus}`}}function lt(e,t){let o=X("alm"),a=t?g.project.deploy:g.app.deploy;e.setDescription(a.description),e.addExamples(t?g.project.deploy.examples:o?g.app.deploy.examples:g.app.deploy.examples.filter(n=>!n.includes(" --target "))),e.addOptions([...t?[{flags:{key:N.ProjectId.name,alias:N.ProjectId.alias},description:g.project.deploy.options.projectId,optionalInNonInteractive:!0},{flags:{key:N.EnvironmentId.name,alias:N.EnvironmentId.alias},env:N.EnvironmentId.envVar,description:g.project.deploy.options.environmentId,optionalInNonInteractive:!0}]:[{flags:{key:f.AppName.name},env:f.AppName.envVar,description:g.app.deploy.options.app,optionalInNonInteractive:!0}],{flags:{key:f.CommitSha.name,alias:f.CommitSha.alias},env:f.CommitSha.envVar,description:g.app.deploy.options.commit,optionalInNonInteractive:!0},...t?[]:[{flags:{key:f.Artifact.name},env:f.Artifact.envVar,description:g.app.deploy.options.artifact,optionalInNonInteractive:!0}],...t||o?[{flags:{key:f.Target.name},env:f.Target.envVar,description:g.app.deploy.options.target,optionalInNonInteractive:!0}]:[]]),e.addSwitch({flags:{key:f.OpenBrowser.name},description:g.app.deploy.options.openBrowser}),e.addSwitch({flags:{key:f.Force.name},description:g.app.deploy.options.force}),e.addSwitch({flags:{key:f.NoWait.name},description:t?g.project.deploy.options.noWait:g.app.deploy.options.noWait}),e.addSwitch({flags:{key:f.ForceReauth.name},description:g.app.deploy.options.forceReauth})}export{Ht as a,nt as b};
10
- /*!
11
- * Copyright (C) Microsoft Corporation. All rights reserved.
12
- */
13
- //# sourceMappingURL=chunk-GVLAG66W.js.map
@@ -1,12 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __pathDirname } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __pathDirname(__filename);
7
- import{b as $,e as E}from"./chunk-JWSX7DVU.js";import{l as C,m as R}from"./chunk-5BE4TLDK.js";import{Na as M,Ob as L,y as p}from"./chunk-E2O4YZX2.js";import{n as U}from"./chunk-B6REHI77.js";import{x as o}from"./chunk-WS6TGUH7.js";import{a as i}from"./chunk-3UIUI5Q2.js";import{G as N,H as A,M as h,O as b}from"./chunk-4AO24KKT.js";import S from"open";async function q(e){k(e),await e.runVerb();let n=await C(e),r=await R(e),l=await e.getTenantIdAsync();if(!l)throw new p("Unable to determine tenant ID. Ensure you are logged in.");let m=await e.getOption(o.NoBrowser.camelName,!0)===!1,c=e.isJsonMode(),a=await e.getOption(o.CommitSha.name,!0),d=await e.getOption(o.Branch.name,!0),g=await e.getOption(o.Mode.name,!0),t=await e.getOption(o.Target.name,!0),s=t===void 0?void 0:E(t);if(s&&(g||a||d))throw new p("--target cannot be used with --mode, --commit, or --branch.");let f=T(g);if(!s&&f==="live"&&(a||d))throw new p("--commit and --branch are only valid with --mode preview.");if(a&&d)throw new p("--commit and --branch cannot be used together.");await x({appName:n,environmentId:r,tenantId:l,noBrowser:m,isJson:c,mode:f,commitId:a,branch:d,target:s})}async function x(e){let{appName:n,environmentId:r,tenantId:l,noBrowser:m,isJson:c,mode:a,commitId:d,branch:g,target:t}=e,s=await M({tenantId:l,environmentId:r,logger:L(),actionsParams:{appName:n}}),f=t!==void 0&&t!==$,u=f?s.stages?.find(v=>v.stageName.toLowerCase()===t):void 0;if(f&&!u)throw new p(`Deployment target '${t}' does not exist for app '${n}'. Run 'ms app add config --target ${t}' to create it.`);let I=u?u.commitHash:s.commitHash,y=B(s.appPlayUri,a,d,g,f?t:void 0);if(!y)throw new p(!t&&a==="live"?`No live build is available for app '${n}' yet. Run 'ms app deploy' to deploy one, then re-run 'ms app play'.`:t?`No play URL is available for app '${n}' on target '${t}'.`:`No appPlayUri is available for app '${n}' in environment '${r}'.`);let w=a==="live"&&!I?[`App '${n}' has not been deployed to target '${t??$}'. Run 'ms app deploy${t?` --target ${t}`:""}' to deploy it.`]:[];if(c){A({appName:n,mode:t?"target":a,...t?{target:t}:{},url:y,commitHash:I??null,...w.length>0?{warnings:w}:{}});return}N(`${t?"Target":a==="live"?"Live":"Preview"} URL for '${s.displayName??n}': ${y}`);for(let v of w)b(v);!t&&a==="live"&&b("Live does not auto-update. Run 'ms app deploy' to publish a new version to the live URL."),await O(y,m)}function B(e,n,r,l="main",m){if(!e)return;if(m){let a;try{a=new URL(e)}catch{throw new p("The app play URL returned by the service is not a valid absolute URL.")}return a.pathname=`${a.pathname.replace(/\/$/,"")}/target/${encodeURIComponent(m)}`,a.toString()}if(n==="live")return e;let c=e.replace(/\/$/,"");return r?`${c}/commit/${r}`:`${c}/branch/${encodeURIComponent(l)}`}async function O(e,n){if(!n){h(`Opening browser at ${e}`);try{await S(e,{wait:!1})}catch{h(`Could not open browser automatically. Please navigate to:
8
- ${e}`)}}}function T(e){let n=(e??o.Mode.defaultValue).trim().toLowerCase();if(n!=="live"&&n!=="preview")throw new p(`Invalid --mode value '${e}'. Expected 'live' or 'preview'.`);return n}function k(e){let n=U("alm");e.setDescription(i.app.play.description),e.addExamples(n?i.app.play.examples:i.app.play.examples.filter(r=>!r.includes(" --target "))),e.addSwitch({flags:{key:o.NoBrowser.name},description:i.app.play.options.noBrowser}),e.addOptions([{flags:{key:o.AppName.name},env:o.AppName.envVar,description:i.app.play.options.app,optionalInNonInteractive:!0},{flags:{key:o.Mode.name,alias:o.Mode.alias},env:o.Mode.envVar,description:i.app.play.options.mode,optionalInNonInteractive:!0},...n?[{flags:{key:o.Target.name},description:i.app.play.options.target,optionalInNonInteractive:!0}]:[],{flags:{key:o.CommitSha.name,alias:o.CommitSha.alias},env:o.CommitSha.envVar,description:i.app.play.options.commit,optionalInNonInteractive:!0},{flags:{key:o.Branch.name},description:i.app.play.options.branch,optionalInNonInteractive:!0}])}export{q as a,B as b};
9
- /*!
10
- * Copyright (C) Microsoft Corporation. All rights reserved.
11
- */
12
- //# sourceMappingURL=chunk-HWEMI6JI.js.map
@@ -1,11 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __pathDirname } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __pathDirname(__filename);
7
- import{b as t,e as s}from"./chunk-OUKOEUZA.js";var o={name:"@microsoft/cmr-cli",version:"0.33.0",type:"module",description:"Command-line interface for building and managing Copilot Managed Runtime",license:"MIT",bin:{ms:"./dist/Bin.js"},files:["dist","!dist/*.map","LICENSE","README.md","THIRD-PARTY-NOTICES.txt"],scripts:{build:"bun scripts/build.ts","generate:cgmanifest":"bun scripts/generate-cgmanifest.ts","benchmark:startup":"bun scripts/benchmark-startup.ts",dev:"tsc -p tsconfig.json --watch","check-types":"tsc --noEmit",lint:"eslint src/",test:"bun test --isolate src/","test:e2e":"bun test src/__tests__/e2e/",clean:"bun ../../scripts/clean.ts dist .turbo tsconfig.tsbuildinfo THIRD-PARTY-NOTICES.txt"},dependencies:{"@azure/msal-node-runtime":"0.20.6","@napi-rs/keyring":"2.1.0",esbuild:"catalog:build",open:"11.0.0"},engines:{node:">=24.11.0",git:">=2.27.0"},devDependencies:{"@microsoft/cmr-apps-actions":"workspace:*","@microsoft/cmr-apps-codegen":"workspace:*","@microsoft/cmr-apps-common":"workspace:*","@azure/msal-node":"5.2.2","@azure/msal-node-extensions":"5.2.2","@clack/prompts":"1.4.0","@microsoft/1ds-core-js":"4.3.11","@microsoft/1ds-post-js":"4.3.11","@repo/repo-config":"workspace:*","@rnx-kit/third-party-notices":"3.0.0","@types/archiver":"6.0.3","@types/bun":"1.3.13","@types/node":"catalog:","@types/semver":"7.7.1",archiver:"7.0.1",commander:"10.0.1",json5:"2.2.3",memfs:"^4.57.2",semver:"7.7.4","tsc-esm-fix":"catalog:build",typescript:"5.9.3","typescript-5-7":"npm:typescript@5.7.2","typescript-5-8":"npm:typescript@5.8.3","typescript-6":"npm:typescript@6.0.2"}};import*as c from"os";import*as e from"path";var m=t("WORKING_DIRECTORY")??process.cwd(),n=t("CONFIG_DIR")??e.join(c.homedir(),".ms-cli"),E=e.join(n,"cache","auth"),d=e.join(n,"telemetry"),_="microsoft-managed-apps-cli",l="msal-token-cache",I="x-ms-client-request-id",R="x-ms-client-session-id",T="x-ms-target-url",C="x-ms-auth-resource",u="x-ms-body-token-resource",g="userSettings.json",x=`managed-apps-cli/${o.version}`,f=s("USE_MMA_APP_ID")?"c4ee713f-aede-4371-91fc-921aa3a5ded9":"9cee029c-6210-4654-90bb-17e6e9d36617",N="managedappscli";export{o as a,m as b,n as c,E as d,d as e,_ as f,l as g,I as h,R as i,T as j,C as k,u as l,g as m,x as n,f as o,N as p};
8
- /*!
9
- * Copyright (C) Microsoft Corporation. All rights reserved.
10
- */
11
- //# sourceMappingURL=chunk-OB6WEE2V.js.map
@@ -1,11 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __pathDirname } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __pathDirname(__filename);
7
- import{a as x,b as l,c as v}from"./chunk-2UMD5IAQ.js";import{a as R,b as E}from"./chunk-A57M2UGH.js";import{Kb as H,Lb as G,Ob as j,d as D,ha as h,z as g}from"./chunk-E2O4YZX2.js";import{M as b}from"./chunk-4AO24KKT.js";async function T(r){let{remoteUrl:p,tenantId:m,jsonMode:t,openBrowser:s,verb:f}=r,{host:n,owner:u,repo:i}=D(p),o=u&&i?H(u,i):"",c=j(),e=I(f);c.trackActivityEvent(e,{repoHost:n,repoHash:o}),t||b("GitHub authentication is required for this action.");let y=A({isJson:t,openBrowser:s}),a=new AbortController,d=()=>{a.abort()};process.once("SIGINT",d);try{await G({remoteUrl:p,tenantId:m,logger:c,display:y,skipBrowser:!1,signal:a.signal})}catch(w){throw c.trackActivityEvent(`${e}.Failed`,{repoHost:n,repoHash:o}),l(w)??w}finally{process.removeListener("SIGINT",d)}c.trackActivityEvent(`${e}.Complete`,{repoHost:n,repoHash:o}),t||b(M(f))}function M(r){switch(r){case"app create":return"Resuming create...";case"app init":return"Resuming init...";case"app build":case"project build":return"Resuming build...";case"app deploy":case"project deploy":return"Resuming deploy...";case"project create":return"Resuming project create..."}}function A(r){return r.isJson?new E:r.openBrowser?R:{...R,openVerificationUri:void 0}}function I(r){switch(r){case"app create":return"Maaf.Create.GitHubDcfRecovery";case"app init":return"Maaf.Init.GitHubDcfRecovery";case"app build":case"project build":return"Maaf.Build.GitHubDcfRecovery";case"app deploy":case"project deploy":return"Maaf.Deploy.GitHubDcfRecovery";case"project create":return"Maaf.ProjectCreate.GitHubDcfRecovery"}}async function F(r,p,m=T){let{repoType:t,externalRepoUrl:s,tenantId:f,jsonMode:n,openBrowser:u,verb:i}=p;try{return await r({isRetry:!1})}catch(o){if(t!=="github")throw o;if(!v(o)){if(o instanceof h)throw o;let e=l(o);throw e||o}if(!s)throw new g(`GitHub authentication is required, but the app config does not record the external repository URL needed to recover the identity mapping. This app may have been created before the URL was persisted to \`ms.config.json\`. Either add \`externalRepoUrl: "<your repo url>"\` to \`ms.config.json\`, or recreate the app with \`ms app create --repo <your repo url>\`, then run \`ms ${i}\` again.`);await m({remoteUrl:s,tenantId:f,jsonMode:n,openBrowser:u,verb:i});try{return await r({isRetry:!0})}catch(e){if(e instanceof h)throw e;let y=v(e);if(y)throw x(y.payload)??e;let a=l(e);throw a||e}}}export{F as a};
8
- /*!
9
- * Copyright (C) Microsoft Corporation. All rights reserved.
10
- */
11
- //# sourceMappingURL=chunk-OBATM5M4.js.map