@microsoft/cmr-cli 0.32.3 → 0.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Add-FU57YE5G.js → Add-75RSJNM4.js} +2 -2
- package/dist/{AddConfig-CI7KNLIG.js → AddConfig-4SAYYOBQ.js} +2 -2
- package/dist/{AddConnector-WH4IU3ND.js → AddConnector-P4R4NJ5P.js} +2 -2
- package/dist/{AddDeployment-GWFCPAL5.js → AddDeployment-TBA3AAGD.js} +2 -2
- package/dist/{AddDeploymentBinding-RFLI6DKH.js → AddDeploymentBinding-6FZ7Y5JM.js} +2 -2
- package/dist/{AddRayfin-VRCFEOIL.js → AddRayfin-35GBGCWF.js} +2 -2
- package/dist/{Alter-JFFT5JOA.js → Alter-U7WDVOMU.js} +2 -2
- package/dist/{AuthStatus-WCZYGI5G.js → AuthStatus-XA6RGYYZ.js} +2 -2
- package/dist/{AuthSwitch-XJMG7IUR.js → AuthSwitch-2FXB7WFU.js} +2 -2
- package/dist/Bin.js +1 -1
- package/dist/{BuildMaafApp-7AUZHYOQ.js → BuildMaafApp-3EGRD23G.js} +2 -2
- package/dist/{Clear-7B7CDIPV.js → Clear-MZGQZ2XK.js} +2 -2
- package/dist/{Cli-XZ4SJKBZ.js → Cli-6A2HUP7R.js} +3 -3
- package/dist/{CloneMaafApp-7W246RZA.js → CloneMaafApp-YAEYSP23.js} +2 -2
- package/dist/CreateMaafApp-2XYROOHB.js +23 -0
- package/dist/CreateMaafProject-Q7KIVAR2.js +11 -0
- package/dist/{DeleteMaafApp-TFGWGJO3.js → DeleteMaafApp-G3SL3GGP.js} +2 -2
- package/dist/DeployMaafApp-DBJONCUH.js +8 -0
- package/dist/DeployMaafProject-SOMMKVJO.js +11 -0
- package/dist/{DeploymentApprovals-WTXBXCKE.js → DeploymentApprovals-Y67LSQQG.js} +2 -2
- package/dist/{Dev-CIEWFRXR.js → Dev-TXJLPT7K.js} +3 -3
- package/dist/FeatureSettings-LYV6QUZB.js +11 -0
- package/dist/{GenerateCode-UQCHTRGP.js → GenerateCode-Z2OY3SZR.js} +2 -2
- package/dist/{GetMaafBuildStatus-6ZSLIZCH.js → GetMaafBuildStatus-ZR5GCREL.js} +2 -2
- package/dist/{GetMaafProjectDeployStatus-NZEMVQGJ.js → GetMaafProjectDeployStatus-OJ56DPZ6.js} +2 -2
- package/dist/{GetSettings-MVVEXMJC.js → GetSettings-64N4P6L7.js} +2 -2
- package/dist/{InfoMaafApp-7Z6OJCHD.js → InfoMaafApp-FJM7UI5H.js} +2 -2
- package/dist/InfoMaafProject-EU6OQ7DX.js +11 -0
- package/dist/{Init-PBH2IXVK.js → Init-MTONJT7V.js} +2 -2
- package/dist/{ListConnectorActions-UERYZ2C7.js → ListConnectorActions-PJTNNWLH.js} +2 -2
- package/dist/{ListConnectors-2FUTJMHY.js → ListConnectors-JYNVPB3O.js} +2 -2
- package/dist/{ListDeployments-4YWCHVKF.js → ListDeployments-UV6J6WA5.js} +2 -2
- package/dist/ListMaafApps-QPEX7JA4.js +11 -0
- package/dist/{ListMaafProjects-GNUXZSYL.js → ListMaafProjects-RDR2S3HD.js} +2 -2
- package/dist/{ListSchema-QKVHVPHB.js → ListSchema-IR7FTBRR.js} +2 -2
- package/dist/{ListSettings-IIA5OGMP.js → ListSettings-3M7UOOLI.js} +2 -2
- package/dist/{Login-BT6UTPCZ.js → Login-G7TNQISG.js} +2 -2
- package/dist/{Logout-FBJE35Q5.js → Logout-AOOISVWK.js} +2 -2
- package/dist/{MockFetch-LQLQGTNT.js → MockFetch-GKQMNDW3.js} +2 -2
- package/dist/{NodeMsalAuthenticationProvider-5TJFMHR4.js → NodeMsalAuthenticationProvider-6ABSS6QK.js} +2 -2
- package/dist/{Pack-TSFHSTB5.js → Pack-QJZCMVEM.js} +2 -2
- package/dist/{PackProject-T575KJQ4.js → PackProject-Y3Q3KOTC.js} +2 -2
- package/dist/{PlayMaafApp-74TQEAO5.js → PlayMaafApp-MH66OLOV.js} +2 -2
- package/dist/ProjectApprovals-NTFYLH3W.js +13 -0
- package/dist/{ProjectRoleAssignments-AI2FQ2VX.js → ProjectRoleAssignments-7IDK6SGJ.js} +2 -2
- package/dist/{RefreshDataSource-VARFN3IV.js → RefreshDataSource-CISFHQNA.js} +2 -2
- package/dist/{RefreshGitAuth-DC5NAZBJ.js → RefreshGitAuth-NUQ7JNJA.js} +2 -2
- package/dist/{Remove-MCQZVI3K.js → Remove-IYDTKDJE.js} +2 -2
- package/dist/{RemoveDataSource-RRND46QZ.js → RemoveDataSource-T2AG7ZWC.js} +2 -2
- package/dist/{RemoveDeployment-STNFNNZF.js → RemoveDeployment-K3GDRCXJ.js} +2 -2
- package/dist/{ServicePrincipalAuthenticationProvider-7RBHTYYY.js → ServicePrincipalAuthenticationProvider-CEHIAANL.js} +2 -2
- package/dist/{SetSetting-Q7EQNOTI.js → SetSetting-KOWAPJWX.js} +2 -2
- package/dist/{SetSetting-CEH44OT3.js → SetSetting-PD76MA6O.js} +2 -2
- package/dist/{ShareLinkCreate-ZUVHUQLH.js → ShareLinkCreate-VCWVBQ4B.js} +2 -2
- package/dist/{ShareLinkList-IEYU6NZW.js → ShareLinkList-5VG5CG34.js} +2 -2
- package/dist/ShareLinkRevoke-KYUNMTG5.js +11 -0
- package/dist/ShareList-M25UE6LD.js +11 -0
- package/dist/{ShareMaafApp-SFNOOMOD.js → ShareMaafApp-QMEJEXPZ.js} +2 -2
- package/dist/{TelemetrySettings-XCT73DEI.js → TelemetrySettings-FVJUK5MR.js} +2 -2
- package/dist/{UnshareMaafApp-TU7U3LQ3.js → UnshareMaafApp-RIUUYHIL.js} +2 -2
- package/dist/{chunk-Q3ONTUZ7.js → chunk-2UMD5IAQ.js} +2 -2
- package/dist/chunk-36YYCVFC.js +12 -0
- package/dist/chunk-3UIUI5Q2.js +11 -0
- package/dist/{chunk-KKC5ZK4D.js → chunk-4AO24KKT.js} +21 -21
- package/dist/{chunk-TMYOZDLM.js → chunk-4C6DWU2Y.js} +2 -2
- package/dist/{chunk-SIEI2EB5.js → chunk-4JTUAUHI.js} +2 -2
- package/dist/{chunk-UXKJNXTZ.js → chunk-4UHMKZLH.js} +2 -2
- package/dist/{chunk-3E7QQ2BR.js → chunk-4WQT5P2M.js} +2 -2
- package/dist/{chunk-GE3UFHZ5.js → chunk-5BE4TLDK.js} +2 -2
- package/dist/{chunk-XIX2O22O.js → chunk-A57M2UGH.js} +2 -2
- package/dist/chunk-B6REHI77.js +11 -0
- package/dist/{chunk-DKSLWH4O.js → chunk-BREK3DVB.js} +2 -2
- package/dist/{chunk-RFLXPXBN.js → chunk-C7V6WEZM.js} +2 -2
- package/dist/{chunk-DGUO74I3.js → chunk-CER3QPDN.js} +2 -2
- package/dist/{chunk-PEZMQ2A3.js → chunk-CONEIY4I.js} +2 -2
- package/dist/{chunk-UEZV46GZ.js → chunk-DOCWK326.js} +2 -2
- package/dist/{chunk-4XKA5APP.js → chunk-E2O4YZX2.js} +192 -192
- package/dist/{chunk-2LKCCYRF.js → chunk-EFTF4FA7.js} +2 -2
- package/dist/{chunk-6EF722GY.js → chunk-ELHOJBVT.js} +11 -11
- package/dist/{chunk-ADRQC63G.js → chunk-FGB6GFXI.js} +2 -2
- package/dist/chunk-GVLAG66W.js +13 -0
- package/dist/{chunk-PLFDUGBA.js → chunk-HWEMI6JI.js} +2 -2
- package/dist/{chunk-BRRT2E75.js → chunk-IM7SC23O.js} +3 -3
- package/dist/{chunk-KT2SUHGM.js → chunk-JDRULLI3.js} +2 -2
- package/dist/{chunk-EFY2BSWB.js → chunk-JMF444BA.js} +2 -2
- package/dist/{chunk-QLK3ZVWP.js → chunk-JWSX7DVU.js} +2 -2
- package/dist/chunk-MWN7R4VR.js +12 -0
- package/dist/{chunk-HSNRWBA6.js → chunk-O4G2KO7E.js} +2 -2
- package/dist/{chunk-FHE3OXIP.js → chunk-OB6WEE2V.js} +2 -2
- package/dist/{chunk-RDXQ3ZPT.js → chunk-OBATM5M4.js} +2 -2
- package/dist/{chunk-ZB6MB7GZ.js → chunk-OTXBVG3E.js} +2 -2
- package/dist/{chunk-5MHBEEMZ.js → chunk-PBXK6LJO.js} +2 -2
- package/dist/chunk-VAKAW5BD.js +12 -0
- package/dist/{chunk-4U53RYJJ.js → chunk-WS6TGUH7.js} +2 -2
- package/dist/{chunk-WTTK2GTG.js → chunk-WV7KDGLS.js} +2 -2
- package/dist/{chunk-NYPHWF7Q.js → chunk-YMRQPXY7.js} +2 -2
- package/dist/{chunk-WWVAS3DS.js → chunk-YYXAAA2U.js} +2 -2
- package/dist/{chunk-PZIEJEF5.js → chunk-ZREDMBLO.js} +2 -2
- package/package.json +4 -4
- package/dist/CreateMaafApp-6MSPHUU4.js +0 -22
- package/dist/CreateMaafProject-JKMF5TH3.js +0 -11
- package/dist/DeployMaafApp-K2APWFOD.js +0 -8
- package/dist/DeployMaafProject-6WRKGIIW.js +0 -11
- package/dist/FeatureSettings-77LZQSKD.js +0 -11
- package/dist/InfoMaafProject-SQYB736C.js +0 -11
- package/dist/ListMaafApps-ZATO77G3.js +0 -11
- package/dist/ProjectApprovals-5KLYEM7V.js +0 -13
- package/dist/ShareLinkRevoke-22RFGOFJ.js +0 -11
- package/dist/ShareList-6UWIHPBM.js +0 -11
- package/dist/chunk-2LDU3F6O.js +0 -11
- package/dist/chunk-A4PVXTJS.js +0 -13
- package/dist/chunk-BA52TY55.js +0 -12
- package/dist/chunk-HOIFXUTG.js +0 -11
- package/dist/chunk-TXMTKOEJ.js +0 -12
- package/dist/chunk-YRPTITKD.js +0 -12
package/dist/chunk-A4PVXTJS.js
DELETED
|
@@ -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 he,i as we,k as ve}from"./chunk-NYPHWF7Q.js";import{b as Ae}from"./chunk-PLFDUGBA.js";import{a as $e}from"./chunk-6EF722GY.js";import{e as ge}from"./chunk-QLK3ZVWP.js";import{b as ye}from"./chunk-PZIEJEF5.js";import{a as Y}from"./chunk-OL6CTXQR.js";import{a as fe}from"./chunk-RDXQ3ZPT.js";import{e as de,f as ce,m as ue}from"./chunk-ZB6MB7GZ.js";import{b as Z}from"./chunk-2LKCCYRF.js";import{b as q,l as le}from"./chunk-GE3UFHZ5.js";import{A as V,D as O,Ea as re,Ja as se,Ka as pe,Nb as U,Ob as M,Qa as W,Ra as j,ca as ie,k as ne,v as ae,w as D,x as s,z as I}from"./chunk-4XKA5APP.js";import{a as me,m as z}from"./chunk-2LDU3F6O.js";import{y as f,z as P}from"./chunk-4U53RYJJ.js";import{a as g}from"./chunk-HOIFXUTG.js";import{C as B,D as $,E as oe,I as m,K as F,a as C}from"./chunk-KKC5ZK4D.js";import{d as Be}from"./chunk-UT667QSU.js";import{promises as Pe}from"node:fs";import*as L from"node:path";import*as De from"node:zlib";var Oe=10*1024*1024;function be(e,t){try{return Ue(e,t)}catch{return}}function Ue(e,t){let o=Me(e);if(o<0)return;let a=33639248,n=e.readUInt16LE(o+10),r=e.readUInt32LE(o+16);for(let d=0;d<n;d++){if(e.readUInt32LE(r)!==a)return;let i=e.readUInt16LE(r+10),c=e.readUInt32LE(r+20),u=e.readUInt16LE(r+28),w=e.readUInt16LE(r+30),p=e.readUInt16LE(r+32),h=e.readUInt32LE(r+42);if(e.subarray(r+46,r+46+u).toString("utf8")===t){let k=e.readUInt16LE(h+26),S=e.readUInt16LE(h+28),l=h+30+k+S,b=e.subarray(l,l+c);return i===0?b.toString("utf8"):i===8?De.inflateRawSync(b,{maxOutputLength:Oe}).toString("utf8"):void 0}r+=46+u+w+p}}function Me(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 Ce}from"node:fs";var Ie=Be($e(),1);function He(e){return e?.code==="ENOENT"?"continue":e instanceof Error?e:new Error(String(e))}function Le(e){return`zipBuildArtifact: skipping missing entry: ${e?.path??"<unknown>"}`}async function ke(e,t,o){let a=await Ce.stat(e).catch(()=>null);if(!a)throw new s(`buildPath not found: ${e}`);if(!a.isDirectory())throw new s(`buildPath is not a directory: ${e}`);let n=await Ce.stat(t).catch(()=>null);if(!n||!n.isFile())throw new s(`appConfigPath does not point to a file: ${t}`);let r=o?.maxBytes;return new Promise((d,i)=>{let c=[],u=0,w=!1,p=(0,Ie.default)("zip",{zlib:{level:9}});p.on("data",h=>{if(!w){if(u+=h.length,r!==void 0&&u>r){w=!0,p.abort(),i(new O({capBytes:r,bytes:u}));return}c.push(h)}}),p.on("warning",h=>{if(w)return;let A=He(h);if(A==="continue"){F(Le(h));return}i(A)}),p.on("error",h=>{w||i(h)}),p.on("end",()=>{w||d(Buffer.concat(c))}),p.directory(e,!1),p.file(t,{name:C}),p.finalize()})}var _e=1200*1e3,Ge=6e4,Je=2e3,Ve="--no-wait requires Managed DevOps deployment; the selected backend does not return a trackable deployment ID.",Se=`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 K(e){return`${(e/(1024*1024)).toFixed(1)} MB`}function X(e,t){return e!==void 0?`Build artifact is ${K(e)}, which exceeds the ${K(t)} limit.`:`Build artifact exceeds the ${K(t)} limit.`}function We(e){let t=e.id||e.name;if(!t)throw new D("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 Q(e,t=e.commitSha){return{deploymentId:e.deploymentId,appName:e.appName,commitHash:t}}function ee(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 N(e){if(e.body)try{let t=JSON.parse(e.body);if(typeof t?.error?.message=="string")return t.error.message}catch{}}function je(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 qe(e,t){if(e instanceof O)return new s(X(e.bytes,e.capBytes),e.errorData,{errorCode:"BuildArtifactTooLarge",telemetryDetails:e.errorData});if(e instanceof ie)return je(e);if(!(e instanceof ne))return null;let o={httpStatus:e.status,serverErrorCode:e.code},a=t.repoType!=="none";if(e.status===400&&e.code==="ArtifactNotAllowedForGitRepo"){let n=N(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 s("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 s("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 s("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=N(e);return a?new s(n??"Invalid commit ID. Use a 40-character lowercase hex value.",{httpStatus:e.status,serverErrorCode:e.code},{errorCode:"InvalidCommitSha",telemetryDetails:o}):new s(`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 D("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:ae.Platform,retryable:!0,telemetryDetails:o});if(e.status===403&&e.code==="ExternalArtifactDeploymentDisabled")return new I(Se,{httpStatus:e.status,serverErrorCode:e.code},{errorCode:"ExternalArtifactDeploymentDisabled",exitCode:1,telemetryDetails:Z("deployment_configuration",o)});if(e.status===403&&e.code==="InsufficientPrivilege"){let n=N(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(Se,{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=N(e);return new s(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 s(`App '${t.appName}' not found in environment ${t.environmentId}.`);if(e.status===404&&e.code==="PowerConfigNotFound")return new D(`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 D("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 D("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 D("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==="RepoTypeMismatch"){let n=N(e);return new s(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 D(X(void 0,524288e3));if(e.status===422&&e.code==="ArtifactInvalid"){let n=N(e)??e.message;return new s(`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 Ye(e){let{provider:t,appName:o,force:a,forceReauth:n,waitForDeployment:r,onDeployProgress:d}=e,i=e.commitFromFlag,c,u=!1;if(!i){let l=de();if(!l)throw new s("Could not determine the latest commit ID. Use --commit or -c to specify it.");i=l.commitSha,c=l.detached?void 0:l.branch,u=!0}if(u&&!t.isJsonMode()&&m(c?`Using branch '${c}' at commit ${i}.`:`Detached HEAD at commit ${i}.`),!a){let l=ue();if(l&&M().interactive&&!t.isJsonMode()){if(F(l),!await q({message:"Deploy anyway?",initialValue:!1}))return m("Deploy cancelled."),null}else if(l)throw new s(`${l} Run again with --force to deploy anyway.`)}let w=U(),p=await re({logger:w,actionsParams:{appName:o,commitSha:i,...n&&{forceReauth:!0}}});if(p===null)t.isJsonMode()||m(`A cached build exists for commit ${i}; `+(r?"deploying it.":"submitting its deployment."));else{t.isJsonMode()||m("Build queued; waiting for completion...");let l=await ye({appName:o,commitSha:i,initialWaitMs:p.retryAfterMs??Je,isJsonMode:t.isJsonMode(),deadlineMs:_e,maxIntervalMs:Ge,spinnerLabel:"Waiting for build..."});if(l.status!=="Succeeded")throw new D(`Unexpected terminal build status "${l.status}". Commit ID: ${i}.`)}let h={appName:o,commitSha:i,...e.targetName!==void 0&&{deploymentName:e.targetName},...n&&{forceReauth:!0}};if(!r){let l=await pe({logger:w,actionsParams:h});return{kind:"submitted",value:Q(l)}}let A=e.useManagedDevOpsDeployment?ee(d):void 0,k;try{k=await se({logger:w,actionsParams:h,onProgress:A?.onProgress??d,onAppFrameworkProgress:e.onAppFrameworkProgress})}catch(l){let b=A?.getHandoff();if(!b)throw l;return{kind:"awaitingApproval",value:{deploymentId:b.deploymentId,appName:o,commitHash:i}}}let S=A?.getHandoff();return S?{kind:"awaitingApproval",value:{deploymentId:S.deploymentId,appName:o,commitHash:i}}:{kind:"deployed",value:We(k)}}function Ze(e){let t=be(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")&&!z("rayfin"))throw new s(`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 (${me("rayfin")}=1 or \`ms feature enable rayfin\`) before deploying a pre-built Rayfin artifact, or rebuild the artifact without a Rayfin backend.`)}async function ze(e){let t=L.resolve(e.artifactPath);if(L.extname(t).toLowerCase()!==".zip")throw new s(`--artifact must point to a .zip file. Received: ${e.artifactPath}`);let o=await Ke(t);if(!o||!o.isFile())throw new s(`--artifact file not found or not a regular file: ${e.artifactPath}`);if(o.size>524288e3)throw new s(X(o.size,524288e3));let a=await Pe.readFile(t);Ze(a),e.provider.isJsonMode()||m(e.waitForDeployment?"Uploading artifact and deploying...":"Uploading artifact and submitting deployment...");let n={logger:U(),actionsParams:{appName:e.appName,zipBuffer:a,...e.targetName!==void 0&&{deploymentName:e.targetName}}};if(!e.waitForDeployment){let{commitSha:c,submission:u}=await j(n);return{kind:"submitted",value:Q(u,c)}}let r=ee(e.onDeployProgress),d;try{d=await W({...n,onProgress:r.onProgress,onAppFrameworkProgress:e.onAppFrameworkProgress})}catch(c){let u=r.getHandoff();if(!u?.commitHash)throw c;return{kind:"awaitingApproval",value:{deploymentId:u.deploymentId,appName:e.appName,commitHash:u.commitHash}}}let i=r.getHandoff();return i?{kind:"awaitingApproval",value:{deploymentId:i.deploymentId,appName:e.appName,commitHash:d.commitSha}}:{kind:"deployed",value:Ne(d)}}async function Ke(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 Xe(e){if(he(e.appConfig),!(e.provider.isJsonMode()||!M().interactive)){let c=e.appConfig.buildType==="none"?"package the prebuilt app assets and deploy the resulting artifact":"build the app and deploy the resulting artifact";if(!await q({message:`This will ${c} to environment ${e.environmentId}. Continue?`,initialValue:!1}))return m("Aborted."),null}let{packAppOutputDir:o}=await ve({quiet:e.provider.isJsonMode()}),a=await ke(o,e.appConfigPath,{maxBytes:524288e3});e.provider.isJsonMode()||m(e.waitForDeployment?"Uploading build artifact and deploying...":"Uploading build artifact and submitting deployment...");let n={logger:U(),actionsParams:{appName:e.appName,zipBuffer:a,...e.targetName!==void 0&&{deploymentName:e.targetName}}};if(!e.waitForDeployment){let{commitSha:c,submission:u}=await j(n);return{kind:"submitted",value:Q(u,c)}}let r=ee(e.onDeployProgress),d;try{d=await W({...n,onProgress:r.onProgress,onAppFrameworkProgress:e.onAppFrameworkProgress})}catch(c){let u=r.getHandoff();if(!u?.commitHash)throw c;return{kind:"awaitingApproval",value:{deploymentId:u.deploymentId,appName:e.appName,commitHash:u.commitHash}}}let i=r.getHandoff();return i?{kind:"awaitingApproval",value:{deploymentId:i.deploymentId,appName:e.appName,commitHash:d.commitSha}}:{kind:"deployed",value:Ne(d)}}async function $t(e){await Qe(e,!1,et)}async function Qe(e,t,o){it(e,t),await e.runVerb();let a=t||e.isManagedDevOpsDeploymentEnabled(),n=await e.getOption(f.NoWait.camelName,!0)!==!1;if(!n&&!a)throw new s(Ve);let r=await e.getOption("commit",!0),d=t?void 0:await e.getOption("artifact",!0);if(r&&d)throw new s("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:c,tenantId:u,environmentId:w,repoType:p,externalRepoUrl:h,appConfig:A,appConfigPath:k,interactive:S}=i,l=(await e.getOption(f.Target.name,!0))?.trim();if(l!==void 0&&ge(l,`--${f.Target.name}`),p==="none"&&r)throw new s("This app uses external artifact deployment. Pass --artifact <path> instead of --commit.");if(d&&p!=="none")throw new s(`--artifact is only valid for apps created with \`repoType: 'none'\`. This app's repoType is \`${p}\`; deploy via \`--commit\` (or omit it to use the current HEAD).`);let b=r&&p!=="none"?ce(r,!0):r,Re=await e.getOption(f.OpenBrowser.camelName,!0)??!1,Fe=await e.getOption(f.ForceReauth.camelName,!0)??!1,xe=await e.getOption(f.Force.name,!0)??!1,E=e.isJsonMode(),te=S&&process.stdout.isTTY===!0,_=a&&!E&&n?nt(te):void 0,G=_?.onProgress,x=n?ot({print:!E,animate:te}):void 0,J=x?.onProgress;E&&p==="github"&&oe({phase:"deploy-validation"});let y;try{if(d)y=await ze({provider:e,appName:c,artifactPath:d,waitForDeployment:n,targetName:l,onDeployProgress:G,onAppFrameworkProgress:J});else if(p==="native"||p==="github")y=await fe(async({isRetry:T})=>{try{return await Ye({provider:e,appName:c,commitFromFlag:b,force:xe,forceReauth:Fe&&!T&&p==="github",waitForDeployment:n,targetName:l,useManagedDevOpsDeployment:a,onDeployProgress:G,onAppFrameworkProgress:J})}catch(Te){throw _?.stop(),x?.stop(),Te}},{repoType:p,externalRepoUrl:h,tenantId:u,jsonMode:E,openBrowser:Re,verb:t?"project deploy":"app deploy"});else{if(!A||!k)throw new s("`ms project deploy` currently supports only git-backed managed projects.");y=await Xe({provider:e,appName:c,appConfig:A,appConfigPath:k,environmentId:w,waitForDeployment:n,targetName:l,onDeployProgress:G,onAppFrameworkProgress:J})}}catch(R){let T=qe(R,{repoType:p,appName:c,environmentId:w});throw T||R}finally{_?.stop(),x?.stop()}if(y===null)return;if(y.kind==="submitted"){E?$({status:"submitted",deploymentId:y.value.deploymentId,appName:y.value.appName,commitHash:y.value.commitHash,repoType:p}):(B(`Deployment submitted for app '${y.value.appName}'.`),m(`Deployment ID: ${y.value.deploymentId}`),m(`Commit: ${y.value.commitHash}`));return}if(y.kind==="awaitingApproval"){E?$({status:"awaitingApproval",deploymentId:y.value.deploymentId,appName:y.value.appName,commitHash:y.value.commitHash,repoType:p}):(B(`Deployment is awaiting approval for app '${y.value.appName}'.`),m(`Deployment ID: ${y.value.deploymentId}`),m(`Commit: ${y.value.commitHash}`));return}let v=tt(y.value,x?.getCompletion());if(l&&v.appPlayUri&&(v.appPlayUri=Ae(v.appPlayUri,"live",void 0,"main",l)??v.appPlayUri),E)$({...v,repoType:p});else{B(`Deployed app '${v.displayName}' (${v.appId}).`),v.commitHash&&m(`Commit: ${v.commitHash}`),v.appPlayUri&&m(`Play URL: ${v.appPlayUri}`),v.operationId&&m(`Operation: ${v.operationId}`);for(let R of v.warnings??[])F(R)}}async function et(e){let{appConfig:t,fileConfig:o,interactive:a}=M();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.`);we(t,d=>new s(d));let n=e.getEnvironmentId();if(!n)throw new s(`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 s("Unable to determine tenant ID. Ensure you are logged in.");return{appName:await le(e),tenantId:r,environmentId:n,repoType:t.repoType??"native",externalRepoUrl:t.externalRepoUrl,appConfig:t,appConfigPath:o.appConfigPath,interactive:a}}function tt(e,t){return t?{...e,commitHash:t.commitHash,operationId:t.operationId,...t.warnings.length>0&&{warnings:t.warnings}}:e}function ot(e){let t,o=!1,a,n=()=>{o&&(t?.stop(),o=!1)},r=()=>{e.animate&&(t??=new Y,t.start("Waiting for deployment..."),o=!0)},d=i=>i==="Pending"||i==="Running"||i==="Recovering";return{onProgress:i=>{switch(i.type){case"accepted":if(a=void 0,!e.print||!d(i.operationStatus))return;n(),m(`Deployment accepted. The service is migrating app data; commit ${i.commitHash} goes live when the migration finishes.`),m(`Operation: ${i.operationId}`),r();return;case"status":if(!e.print)return;n(),m(`Deployment status: ${i.operationStatus}`),d(i.operationStatus)&&r();return;case"completed":n(),a=i;return}},getCompletion:()=>a,stop:n}}function nt(e){let t,o=!1,a,n=()=>{o&&(t?.stop(),o=!1)},r=()=>{e&&(t??=new Y,t.start("Waiting for deployment..."),o=!0)};return{onProgress:i=>{let c=at(i);if(c!==a)switch(a=c,i.type){case"submitting":n(),m("Submitting deployment...");break;case"submitted":n(),m(`Deployment ID: ${i.deploymentId}`),r();break;case"status":switch(n(),m(`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 at(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 it(e,t){let o=z("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:P.ProjectId.name,alias:P.ProjectId.alias},description:g.project.deploy.options.projectId,optionalInNonInteractive:!0},{flags:{key:P.EnvironmentId.name,alias:P.EnvironmentId.alias},env:P.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{$t as a,Qe as b};
|
|
10
|
-
/*!
|
|
11
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
12
|
-
*/
|
|
13
|
-
//# sourceMappingURL=chunk-A4PVXTJS.js.map
|
package/dist/chunk-BA52TY55.js
DELETED
|
@@ -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 w}from"./chunk-TYRVM4PP.js";import{b as y}from"./chunk-2LKCCYRF.js";import{A as m,k as c,x as l,y as f}from"./chunk-4XKA5APP.js";import{a as t}from"./chunk-FHE3OXIP.js";import{K as p,m as g}from"./chunk-KKC5ZK4D.js";import{d as T}from"./chunk-UT667QSU.js";function I(e){if(e.body)try{let n=JSON.parse(e.body);if(typeof n?.error?.message=="string"&&n.error.message.trim())return n.error.message}catch{}}var h=new Set(["NetworkConnectionRefused","NetworkConnectionReset","NetworkConnectionTimedOut","NetworkDnsResolutionFailed","ENOTFOUND","EAI_AGAIN","ECONNREFUSED","ETIMEDOUT","ECONNRESET","ConnectionRefused","ConnectionClosed","FailedToOpenSocket"]);function A(e){if(!(e instanceof Error)||e instanceof c)return!1;let n=e.code;return typeof n=="string"&&h.has(n)||h.has(e.name)}function x(e,n){let{environmentId:i}=n;if(A(e))return new m(`Could not reach environment ${i}. Its endpoint did not resolve or did not respond, which usually means the environment id is wrong or the environment does not exist in this cloud \u2014 verify the id and the --cloud value. If the id is correct, check your network connection, VPN, or proxy.`,{underlyingError:e.message,environmentId:i},{errorCode:"EnvironmentUnreachable",retryable:!0});if(!(e instanceof c))return null;let o=I(e),s=n.repoType==="native",r="Ask an admin to grant you the required permission in this environment.";if(e.status===401)return new f(o??"Your sign-in session has expired or is invalid. Run `ms auth login` and try again.",void 0,{errorCode:"AuthenticationRequired"});if(e.status===403){let a=o??(s?`You do not have permission to create repositories in environment ${i}.`:`You do not have permission to create an app in environment ${i}.`);return new f(`${a} ${r}`,void 0,{errorCode:"EnvironmentPermissionDenied",telemetryDetails:y("environment_permission",{httpStatus:e.status})})}return e.status===404?new l(o??`Environment ${i} was not found. Verify the environment id and that you have access to it.`,{environmentId:i},{errorCode:"EnvironmentNotFound"}):e.status===409?new l(o??`An app with the same name already exists in environment ${i}. Choose a different name.`,{environmentId:i},{errorCode:"AppAlreadyExists"}):e.status===429||e.status===503?new m(o??"The service is temporarily unavailable or rate-limited. Wait a moment and try again.",{httpStatus:e.status},{errorCode:"ServiceUnavailable",retryable:!0,telemetryDetails:{httpStatus:e.status}}):null}function S(e){let n=e.buildType?.trim().toLowerCase()||void 0;if(n!==void 0&&n!=="build"&&n!=="none")throw new l("'--build-type' must be one of: build, none.");let i=n;return{...i!==void 0&&{buildType:i},buildPath:e.buildPath??(i==="none"?"./artifacts":"./dist"),...i!=="none"&&{buildCommand:e.buildCommand??"npm run build"},buildEntryPoint:e.buildEntryPoint??"index.html"}}function V(e){let n=S(e),i={version:g,appId:e.appId,appDisplayName:e.appDisplayName,environmentId:e.environmentId,description:e.description,repoType:e.repoType,cloud:e.cloud,buildPath:n.buildPath};return n.buildCommand!==void 0&&(i.buildCommand=n.buildCommand),i.buildEntryPoint=n.buildEntryPoint,n.buildType!==void 0&&(i.buildType=n.buildType),e.repositoryId&&(i.repositoryId=e.repositoryId),e.externalRepoUrl&&(i.externalRepoUrl=e.externalRepoUrl),e.iconPath&&(i.iconPath=e.iconPath),e.localAppUrl&&(i.localAppUrl=e.localAppUrl),e.connectionReferences!==void 0&&(i.connectionReferences=e.connectionReferences),e.appSettings!==void 0&&(i.appSettings=e.appSettings),i}import*as d from"fs";import*as v from"path";var u=T(w(),1);var P="https://registry.npmjs.org",N=5e3;async function C(e,n=t.version){if(!u.default.valid(n))return;if(u.default.prerelease(n)===null)return n;let i=await $(e);return i?`^${i}`:void 0}async function $(e){try{let{data:n}=await e.get(`${P}/${t.name}/latest`,{headers:{"user-agent":`${t.name}/${t.version}`},signal:AbortSignal.timeout(N)});return typeof n?.version=="string"&&u.default.valid(n.version)?n.version:void 0}catch{return}}async function Y(e,n,i){let o=v.join(e,"package.json");if(!d.existsSync(o))return;let s=await C(i);if(!s){n||p(`Skipping the project-local CLI pin: '${t.version}' is not a published release and no published version could be resolved. Install '${t.name}' into the project manually if you want a project-local CLI.`);return}!n&&s!==t.version&&p(`'${t.version}' is a prerelease build; pinning the latest published CLI ('${s}') into the app instead.`);try{let r=JSON.parse(d.readFileSync(o,"utf8")),a="@microsoft/managed-apps-cli",b=r.dependencies?.[a]!==void 0||r.devDependencies?.[a]!==void 0;delete r.dependencies?.[a],delete r.devDependencies?.[a],r.devDependencies=Object.fromEntries(Object.entries({...r.devDependencies,[t.name]:s}).sort(([E],[R])=>E.localeCompare(R,"en"))),d.writeFileSync(o,`${JSON.stringify(r,null,2)}
|
|
8
|
-
`),b&&!n&&p(`Replaced '${a}' with '${t.name}' because both provide 'ms'. Migrate SDK dependencies, imports, generated sources, and Vite configuration together.`)}catch(r){n||p(`Could not pin '${t.name}' into ${o} (${r instanceof Error?r.message:String(r)}). Add "${t.name}": "${s}" to devDependencies manually.`)}}export{x as a,S as b,V as c,Y as d};
|
|
9
|
-
/*!
|
|
10
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
11
|
-
*/
|
|
12
|
-
//# sourceMappingURL=chunk-BA52TY55.js.map
|
package/dist/chunk-HOIFXUTG.js
DELETED
|
@@ -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-KKC5ZK4D.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.",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/Managed-Apps/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 whether each is enabled. Features in development are listed only while enabled.",examples:[`${"ms"} feature list`,`${"ms"} feature list --json`]},status:{description:"Show whether a CLI feature is enabled, and which setting decides 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:"Enable a CLI feature for all future runs by saving it to your user settings. An MS_CLI_FEATURE_<NAME> environment variable still takes precedence.",options:{name:`Feature name to enable, as shown by '${"ms"} feature list'.`},examples:[`${"ms"} feature enable --name state`]},disable:{description:"Disable a CLI feature for all future runs by saving it to your user settings. An MS_CLI_FEATURE_<NAME> environment variable still takes precedence, and an app or project that already uses the feature keeps it on.",options:{name:`Feature name to disable, as shown by '${"ms"} feature list'.`},examples:[`${"ms"} feature disable --name state`]},reset:{description:"Remove the saved setting for a CLI feature, returning it to its default unless an MS_CLI_FEATURE_<NAME> environment variable is set.",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-HOIFXUTG.js.map
|
package/dist/chunk-TXMTKOEJ.js
DELETED
|
@@ -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*as r from"node:fs";function i(e){switch(e){case"Native":return"native";case"ExternalGitProviderBound":return"github";case"ExternallyProvidedBuild":return"none"}}function p(e,t,o){return{projectId:e.projectId,displayName:e.displayName,repositoryId:e.repositoryId,repoType:i(e.repoType),...e.repoType==="ExternalGitProviderBound"&&o&&{externalRepoUrl:o},environmentId:e.environmentId,cloud:t}}function c(e,t){let o=`${e}.${process.pid}.tmp`;try{r.writeFileSync(o,`${JSON.stringify(t,null,2)}
|
|
8
|
-
`,{encoding:"utf8",flag:"wx"}),r.renameSync(o,e)}catch(n){try{r.rmSync(o,{force:!0})}catch{}throw n}}export{i as a,p as b,c};
|
|
9
|
-
/*!
|
|
10
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
11
|
-
*/
|
|
12
|
-
//# sourceMappingURL=chunk-TXMTKOEJ.js.map
|
package/dist/chunk-YRPTITKD.js
DELETED
|
@@ -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-HSNRWBA6.js";import{b as V}from"./chunk-2LKCCYRF.js";import{a as z}from"./chunk-SQI4XLR7.js";import{l as q,m as J,n as H}from"./chunk-GE3UFHZ5.js";import{Ma as x,N as k,Nb as R,O as w,Ob as _,P as $,Pa as b,Wa as O,k as N,ka as I,pb as L,qb as B,ra as U,x as y,z as j}from"./chunk-4XKA5APP.js";import{D as F,E as T}from"./chunk-4U53RYJJ.js";import{a as C}from"./chunk-HOIFXUTG.js";import{C as P,D as G,I as A,K as v,a as E}from"./chunk-KKC5ZK4D.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-YRPTITKD.js.map
|