@microsoft/managed-apps-cli 0.23.0 → 0.24.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 (67) hide show
  1. package/README.md +7 -0
  2. package/dist/AddConfig-ZIDAN5AS.js +12 -0
  3. package/dist/{AddConnector-HJCCENAM.js → AddConnector-YNHO2HAW.js} +2 -2
  4. package/dist/{AuthStatus-WCICFN6O.js → AuthStatus-S3K6JJG6.js} +2 -2
  5. package/dist/{AuthSwitch-5PKHCTM2.js → AuthSwitch-RSQ777N2.js} +2 -2
  6. package/dist/Bin.js +1 -1
  7. package/dist/{BuildMaafApp-Q74EFM3Q.js → BuildMaafApp-MKHYNTJN.js} +2 -2
  8. package/dist/{Cli-7EVTIORX.js → Cli-7SHW4PIZ.js} +12 -12
  9. package/dist/{CloneMaafApp-EKHHLMWD.js → CloneMaafApp-N5NBJDO4.js} +2 -2
  10. package/dist/{CreateMaafApp-L3XX2UVT.js → CreateMaafApp-OY6P6WIY.js} +2 -2
  11. package/dist/{DeleteMaafApp-YCDKWFRG.js → DeleteMaafApp-SJE7YRQZ.js} +2 -2
  12. package/dist/DeployMaafApp-VK4MJKVY.js +14 -0
  13. package/dist/{Dev-BTJUJGP5.js → Dev-75M4ANEA.js} +2 -2
  14. package/dist/{GetMaafBuildStatus-7B6ZNSEA.js → GetMaafBuildStatus-I5Y6STGB.js} +2 -2
  15. package/dist/{GetSettings-GJWIPK2T.js → GetSettings-5T3STEOV.js} +2 -2
  16. package/dist/{InfoMaafApp-WGNDYYGN.js → InfoMaafApp-OHDDS3OQ.js} +2 -2
  17. package/dist/{Init-TJOSV5DE.js → Init-NLNDZJBN.js} +2 -2
  18. package/dist/{ListConnectorActions-HTD6YSCY.js → ListConnectorActions-N2IX4VWY.js} +2 -2
  19. package/dist/ListConnectors-YVJRDRID.js +11 -0
  20. package/dist/{ListMaafApps-KRXJMAEU.js → ListMaafApps-3DEVXWSG.js} +2 -2
  21. package/dist/{Login-5TFNB24B.js → Login-CYDAY6K7.js} +2 -2
  22. package/dist/{Logout-35U4J627.js → Logout-OB4QJDAY.js} +2 -2
  23. package/dist/{MockFetch-XSZECQYX.js → MockFetch-PJWH2XTJ.js} +2 -2
  24. package/dist/{NodeMsalAuthenticationProvider-OUL57BVL.js → NodeMsalAuthenticationProvider-NT7XAXTC.js} +2 -2
  25. package/dist/{Pack-S7P4MIT6.js → Pack-O5U5MPSJ.js} +2 -2
  26. package/dist/{PlayMaafApp-D4KLJKLT.js → PlayMaafApp-DLD27TQL.js} +2 -2
  27. package/dist/{RefreshDataSource-N5CEH23S.js → RefreshDataSource-JU3V5L2Y.js} +2 -2
  28. package/dist/{RefreshGitAuth-2VL6VBLU.js → RefreshGitAuth-N5RQYP3P.js} +2 -2
  29. package/dist/{RemoveDataSource-XR5Q4O3F.js → RemoveDataSource-LXIOJFX4.js} +2 -2
  30. package/dist/{ServicePrincipalAuthenticationProvider-H3PTPXYY.js → ServicePrincipalAuthenticationProvider-QJJ5WSV5.js} +2 -2
  31. package/dist/{SetSetting-HXY4YSKC.js → SetSetting-GNWY5HWU.js} +2 -2
  32. package/dist/{ShareLinkCreate-YG3DACP2.js → ShareLinkCreate-HJV3TLI3.js} +2 -2
  33. package/dist/{ShareLinkList-XF6BIB3M.js → ShareLinkList-2NJLTXFX.js} +2 -2
  34. package/dist/{ShareLinkRevoke-4USAQKLB.js → ShareLinkRevoke-G2EXN5WH.js} +2 -2
  35. package/dist/ShareList-CDGJCXBF.js +11 -0
  36. package/dist/{ShareMaafApp-PZI5MCBA.js → ShareMaafApp-TMTGLD5F.js} +2 -2
  37. package/dist/{TelemetrySettings-WWVPRF7T.js → TelemetrySettings-KWEGCAGS.js} +2 -2
  38. package/dist/{UnshareMaafApp-MHBIV5OR.js → UnshareMaafApp-YZPPEA32.js} +2 -2
  39. package/dist/chunk-7DFBXNI7.js +11 -0
  40. package/dist/{chunk-UIW77LMA.js → chunk-CBXGTKIE.js} +206 -206
  41. package/dist/{chunk-FMJDKXNM.js → chunk-EKMZGVZA.js} +2 -2
  42. package/dist/{chunk-SBVJ4SMO.js → chunk-EQHSV77H.js} +2 -2
  43. package/dist/{chunk-7PH2NK5K.js → chunk-HO6LX3K7.js} +2 -2
  44. package/dist/chunk-II367GCP.js +11 -0
  45. package/dist/{chunk-HCPTQP7J.js → chunk-IMBY742Q.js} +2 -2
  46. package/dist/{chunk-2FNWZUPW.js → chunk-IXZUOQPP.js} +2 -2
  47. package/dist/{chunk-WQKDXHGX.js → chunk-KZIKF2VH.js} +2 -2
  48. package/dist/chunk-LGJ3PMWD.js +11 -0
  49. package/dist/{chunk-F3HGM3IU.js → chunk-LSAJM3LO.js} +17 -16
  50. package/dist/chunk-MAWTAPQE.js +12 -0
  51. package/dist/{chunk-2HSJ2XAQ.js → chunk-MKCTKQZA.js} +2 -2
  52. package/dist/{chunk-3FP37TPE.js → chunk-MPRAPBI2.js} +7 -7
  53. package/dist/{chunk-TZRZFNLH.js → chunk-MVRNQN2O.js} +3 -3
  54. package/dist/{chunk-LDP2SHPJ.js → chunk-PDS5FYC4.js} +2 -2
  55. package/dist/{chunk-ZIONKKAV.js → chunk-PVGICWWI.js} +2 -2
  56. package/dist/chunk-QKHCRDMM.js +11 -0
  57. package/dist/{chunk-DD7E4ADI.js → chunk-WADQ54KB.js} +2 -2
  58. package/package.json +4 -4
  59. package/dist/AddConfig-GZO2UMFR.js +0 -12
  60. package/dist/DeployMaafApp-HF67BQRZ.js +0 -14
  61. package/dist/ListConnectors-OET7STMW.js +0 -11
  62. package/dist/ShareList-6QI7ZAMZ.js +0 -11
  63. package/dist/chunk-5XRK3F43.js +0 -11
  64. package/dist/chunk-DAG6RPOF.js +0 -11
  65. package/dist/chunk-I22E6YZT.js +0 -11
  66. package/dist/chunk-PKDXP7CL.js +0 -11
  67. package/dist/chunk-SCJXITCN.js +0 -12
@@ -0,0 +1,12 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __pathDirname } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a as $,b as D,d as W,e as _,g as F}from"./chunk-MKCTKQZA.js";import{a as K}from"./chunk-USRRI5H4.js";import{h as V,i as q,j as H}from"./chunk-WADQ54KB.js";import{Ga as g,Ha as J,Q as P,T,g as E,ma as x,pa as b,va as L,x as k,xa as O,y as I,ya as B,z as N}from"./chunk-CBXGTKIE.js";import{b as y}from"./chunk-RBG2H562.js";import{u as U,v as j}from"./chunk-LGJ3PMWD.js";import{c as C,d as S,h,i as A}from"./chunk-PVAIJSAI.js";import{a as w}from"./chunk-KZIKF2VH.js";import{a as G}from"./chunk-MPRAPBI2.js";async function ke(e,n){fe(e,n),await e.runVerb();let s=J();if(!s.appConfig)throw new y(`No ${G} found in the current directory. Run "${"ms"} app init" first.`);let i=await q(e),c=await e.getTenantIdAsync();if(!c)throw new y("Unable to determine tenant ID. Ensure you are logged in.");let p=await V(e),l=W(await e.getOption("access")),m=l==="edit"?_(s.appConfig):s.appConfig.repoType??"none",u=se(e.getPositionalArgs(0));if(u.length===0)throw new y("Provide at least one principal (Entra object ID or user/group email address). Separate multiple entries with commas, spaces, or both.");let o=n==="share"&&(l!=="edit"||m!=="native"),a=g(),f=a.trackScenario("MaafApp.SharePermissions",{mode:n,access:l,repoType:m,inputCount:u.length});try{let t=[],r=await ie(u,t,o);if(a.trackActivityEvent("MaafApp.SharePermissions.PrincipalResolution",{mode:n,inputCount:u.length,resolvedCount:r.length,failedCount:t.length,emailPassthrough:o}),r.length===0)throw new y(Y(t));t.length>0&&A(Y(t));let d=await(n==="share"?ee:ne)({tenantId:c,environmentId:i,appName:p,access:l,refs:r,repoType:m,jsonMode:e.isJsonMode()});f.complete({resolvedCount:r.length,failedResolutionCount:t.length,scope:d.scope,role:d.role,appScopeContributorFallback:l==="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 M=n==="share"&&l==="edit"?await te({appInfo:d.appInfo,tenantId:c,environmentId:i,appName:p,jsonMode:e.isJsonMode()}):void 0;e.isJsonMode()?S({access:l,partialFailure:t.length>0,...d.result,...n==="unshare"&&{revokedCount:d.revokedCount??0,revokedPrincipalCount:d.revokedPrincipalCount??0,notFound:(d.notFound??[]).map(X),skipped:(d.skipped??[]).map(X)},...M&&{repoType:M.repoType,cloneUrl:M.cloneUrl},warnings:t}):(de({appName:p,mode:n,access:l,inputCount:r.length,outcome:d}),oe(M))}catch(t){throw f.failure(t),t}}async function ee(e){let{tenantId:n,environmentId:s,appName:i,access:c,refs:p,repoType:l,jsonMode:m}=e;if(c==="play"||c==="test"){let f=c==="test"?N:k,t=p.map(R=>Q(R,f));return{result:await b({tenantId:n,environmentId:s,logger:g(),actionsParams:{appName:i,put:t,delete:[]}}),scope:"app",role:f}}if(l==="none")throw new y($);if(l!=="native"){m||A(D);let f=p.map(r=>Q(r,I));return{result:await b({tenantId:n,environmentId:s,logger:g(),actionsParams:{appName:i,put:f,delete:[]}}),scope:"app",role:I}}let u=await F({tenantId:n,environmentId:s,appName:i}),o=p.map(ue);return{result:await O({tenantId:n,environmentId:s,logger:g(),actionsParams:{repoId:u.repositoryId,put:o,delete:[]}}),scope:"repo",role:P,appInfo:u}}async function ne(e){let{tenantId:n,environmentId:s,appName:i,access:c,refs:p,repoType:l,jsonMode:m}=e,u=p.map(z),o=new Map(p.map(r=>[z(r),r]));if(c==="edit"&&l==="none")throw new y($);let a=c!=="edit"||l!=="native",f=a?c==="test"?N:c==="play"?k:I:P,t;if(a)c==="edit"&&l!=="native"&&(m||A(D)),t=await L({tenantId:n,environmentId:s,logger:g(),actionsParams:{appName:i,principalIds:u,roleDefinitionName:f}});else{let r=await F({tenantId:n,environmentId:s,appName:i});t=await B({tenantId:n,environmentId:s,logger:g(),actionsParams:{repoId:r.repositoryId,principalIds:u}})}return{result:t.result,scope:a?"app":"repo",role:f,revokedCount:t.revokedCount,revokedPrincipalCount:t.revokedPrincipalCount,notFound:t.notFoundPrincipalIds.map(r=>o.get(r)??{id:r,input:r}),skipped:t.skippedNullRoleAssignments.map(r=>o.get(r.principalObjectId)??{id:r.principalObjectId,input:r.principalObjectId})}}function z(e){if(!e.id)throw new y(`Could not resolve '${e.input}' to an AAD object ID. Unshare requires object IDs.`);return e.id}async function te(e){let n=e.appInfo;if(!n)try{n=await x({tenantId:e.tenantId,environmentId:e.environmentId,logger:g(),actionsParams:{appName:e.appName}})}catch{e.jsonMode||A(`Share succeeded, but repository details for '${e.appName}' could not be read.`);return}return K(n)}function oe(e){e&&(e.repoType&&h(`Repo type: ${e.repoType}`),e.cloneUrl&&h(`Clone URL: ${e.cloneUrl}`))}function se(e){let n=new Set;for(let s of e)for(let i of s.split(",")){let c=i.trim();c&&n.add(c)}return[...n]}async function ie(e,n,s){let i=new Map,c=new Map,l=(await Promise.all(e.map(async o=>{let a=o.toLowerCase(),f=i.get(a);if(f)return f;if(H(o)){let t={id:o,input:o};return i.set(a,t),t}if(!le(o))return n.push({input:o,reason:"not an AAD object ID (GUID) or a valid email address"}),null;if(s){let t={input:o,email:o};return i.set(a,t),t}try{let t=c.get(a);t||(t=T(o,g()),c.set(a,t));let r=await t;if(!r)return n.push({input:o,reason:"no user or group found in this tenant (invite as a guest in Entra ID first if external)"}),null;let R={id:r.id,input:o,type:r.type,email:o,displayName:r.displayName};return i.set(a,R),R}catch(t){return n.push({input:o,reason:ae(t)}),null}}))).filter(o=>o!==null),m=[],u=new Set;for(let o of l){let a=(o.id??o.email??o.input).toLowerCase();u.has(a)||(u.add(a),m.push(o))}return m}function Y(e){let n=e.length===1?"entry":"entries",s=e.map(i=>` - ${i.input}: ${i.reason}`);return[`Could not resolve ${e.length} ${n}:`,...s].join(`
8
+ `)}function ae(e){if(e instanceof E){if(e.status===403)return re(e.status);let n=pe(e.body);return n!==void 0?`Graph ${e.status}: ${n}`:e.message}return e instanceof Error?e.message:String(e)}function re(e){return`Graph ${e}: your sign-in lacks permission to look up accounts by email. Pass the AAD object ID (GUID) instead, or have an admin grant the User.ReadBasic.All and Group.Read.All Graph permissions.`}function pe(e){if(e)try{let s=JSON.parse(e)?.error?.message;return typeof s=="string"?s:void 0}catch{return}}function le(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}function Q(e,n){return{name:e.displayName??e.input,properties:{roleName:n,principal:ce(e)}}}function ce(e){return e.id?e.email?{id:e.id,email:e.email}:{id:e.id}:{email:e.email??e.input}}function ue(e){let n=e.id??e.input;return{name:e.displayName??e.input,properties:{roleName:P,principal:e.type?{id:n,type:e.type}:{id:n}}}}function X(e){return{id:e.id??e.input,label:e.displayName??e.input}}function de(e){let{appName:n,mode:s,access:i,inputCount:c,outcome:p}=e,l=i==="play"?"play":i==="test"?"test":"edit";if(s==="share"){let a=p.result.put?.length??0;if(a===0){h("No changes were applied.");return}C(`Shared app '${n}' with ${a} ${v("principal",a)}. They can now ${l} the app.`);return}let m=p.revokedCount??0,u=p.revokedPrincipalCount??m;if(u===0){h(`No ${l} assignments to revoke on '${n}' \u2014 none of the ${c} ${v("principal",c)} had existing access.`);return}if(C(`Revoked ${l} permissions for ${u} ${v("principal",u)} on '${n}'.`),p.notFound&&p.notFound.length>0){let o=p.notFound.map(a=>a.displayName??a.input).join(", ");h(`${p.notFound.length} ${v("principal",p.notFound.length)} had no existing ${l} access (no-op): ${o}`)}if(p.skipped&&p.skipped.length>0){let o=p.skipped.map(a=>a.displayName??a.input).join(", ");h(`${p.skipped.length} ${v("principal",p.skipped.length)} had a role assignment with an unknown role definition; ${l} access was not modified for: ${o}. Investigate via the role-assignments API.`)}}function v(e,n){return n===1?e:`${e}s`}function fe(e,n){let s=n==="share"?w.app.share:w.app.unshare,i=n==="share"?U:j;e.setDescription(s.description),e.addExamples(s.examples),e.consumePositionalArgs("principal"),e.addOptions([{flags:{key:i.AppName.name},env:i.AppName.envVar,description:s.options.app,optionalInNonInteractive:!0},{flags:{key:i.Access.name},env:i.Access.envVar,default:i.Access.defaultValue,description:s.options.access,optionalInNonInteractive:!0}])}export{ke as a};
9
+ /*!
10
+ * Copyright (C) Microsoft Corporation. All rights reserved.
11
+ */
12
+ //# sourceMappingURL=chunk-MAWTAPQE.js.map
@@ -4,10 +4,10 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __pathDirname(__filename);
7
- import{Ga as i,ma as r}from"./chunk-UIW77LMA.js";import{b as t}from"./chunk-RBG2H562.js";import{a as n}from"./chunk-3FP37TPE.js";var u=`Cannot share source code \u2014 no repository linked.
7
+ import{Ga as i,ma as r}from"./chunk-CBXGTKIE.js";import{b as t}from"./chunk-RBG2H562.js";import{a as n}from"./chunk-MPRAPBI2.js";var u=`Cannot share source code \u2014 no repository linked.
8
8
 
9
9
  This app has no linked repository, so source code isn't stored on the platform. To collaborate on code, run 'ms app init' to create an app instance with a repo, or share the source with your collaborator directly.`,g="This app is not backed by a platform managed repo. Repository access must be configured in the external repository.",s="00000000-0000-0000-0000-000000000000";function p(e){return!!e&&e!==s}function h(e){let o=(e??"play").trim().toLowerCase();if(o==="play"||o==="edit"||o==="test")return o;throw new t(`Unknown --access value '${e}'. Use 'play' (default \u2014 app access), 'edit', or 'test'.`)}function A(e){if(e.repoType)return e.repoType;if(p(e.repositoryId))throw new t(`${n} is missing the 'repoType' field but has a 'repositoryId' set. This usually means the file was written by an older CLI. Re-run "${"ms"} app init" to migrate the config, then retry.`);return"none"}async function c(e){return r({tenantId:e.tenantId,environmentId:e.environmentId,logger:i(),actionsParams:{appName:e.appName}})}async function I(e){let o=await c(e);if(!p(o.repositoryId))throw new t(`App '${e.appName}' has no associated repository.`);return o}export{u as a,g as b,p as c,h as d,A as e,c as f,I as g};
10
10
  /*!
11
11
  * Copyright (C) Microsoft Corporation. All rights reserved.
12
12
  */
13
- //# sourceMappingURL=chunk-2HSJ2XAQ.js.map
13
+ //# sourceMappingURL=chunk-MKCTKQZA.js.map