@microsoft/managed-apps-cli 0.22.0 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/README.md +3 -1
  2. package/dist/AddConfig-GZO2UMFR.js +12 -0
  3. package/dist/AddConnector-HJCCENAM.js +23 -0
  4. package/dist/{AuthStatus-6DMK7O6W.js → AuthStatus-WCICFN6O.js} +2 -2
  5. package/dist/{AuthSwitch-NUQIIRCG.js → AuthSwitch-5PKHCTM2.js} +2 -2
  6. package/dist/Bin.js +1 -1
  7. package/dist/BuildMaafApp-Q74EFM3Q.js +11 -0
  8. package/dist/Cli-7EVTIORX.js +54 -0
  9. package/dist/CloneMaafApp-EKHHLMWD.js +11 -0
  10. package/dist/CreateMaafApp-L3XX2UVT.js +20 -0
  11. package/dist/DeleteMaafApp-YCDKWFRG.js +11 -0
  12. package/dist/DeployMaafApp-HF67BQRZ.js +14 -0
  13. package/dist/{Dev-ICCA5DEJ.js → Dev-BTJUJGP5.js} +2 -2
  14. package/dist/{EnvironmentVariableAuthenticationProvider-LYCQ5D47.js → EnvironmentVariableAuthenticationProvider-VNN4AG2E.js} +2 -2
  15. package/dist/GetMaafBuildStatus-7B6ZNSEA.js +11 -0
  16. package/dist/{GetSettings-ZI2IBKV5.js → GetSettings-GJWIPK2T.js} +2 -2
  17. package/dist/{InfoMaafApp-FL5PICDD.js → InfoMaafApp-WGNDYYGN.js} +2 -2
  18. package/dist/Init-TJOSV5DE.js +11 -0
  19. package/dist/ListConnectorActions-HTD6YSCY.js +11 -0
  20. package/dist/ListConnectors-OET7STMW.js +11 -0
  21. package/dist/{ListMaafApps-3W6W6UYP.js → ListMaafApps-KRXJMAEU.js} +2 -2
  22. package/dist/{Login-7RW6OEST.js → Login-5TFNB24B.js} +2 -2
  23. package/dist/{Logout-IXK2TMRL.js → Logout-35U4J627.js} +2 -2
  24. package/dist/{MockFetch-THQJ4KFB.js → MockFetch-XSZECQYX.js} +2 -2
  25. package/dist/{NodeMsalAuthenticationProvider-VVQ6CCZ5.js → NodeMsalAuthenticationProvider-OUL57BVL.js} +2 -2
  26. package/dist/Pack-S7P4MIT6.js +8 -0
  27. package/dist/{PlayMaafApp-5H3DCJ2C.js → PlayMaafApp-D4KLJKLT.js} +2 -2
  28. package/dist/RefreshDataSource-N5CEH23S.js +11 -0
  29. package/dist/{RefreshGitAuth-IQBAFR37.js → RefreshGitAuth-2VL6VBLU.js} +2 -2
  30. package/dist/{RemoveDataSource-PGPLMJUX.js → RemoveDataSource-XR5Q4O3F.js} +2 -2
  31. package/dist/{ServicePrincipalAuthenticationProvider-IZZRJFZQ.js → ServicePrincipalAuthenticationProvider-H3PTPXYY.js} +2 -2
  32. package/dist/{SetSetting-SEWDA4TF.js → SetSetting-HXY4YSKC.js} +2 -2
  33. package/dist/{ShareLinkCreate-T5FN47J2.js → ShareLinkCreate-YG3DACP2.js} +2 -2
  34. package/dist/{ShareLinkList-6JCVEYNC.js → ShareLinkList-XF6BIB3M.js} +2 -2
  35. package/dist/ShareLinkRevoke-4USAQKLB.js +11 -0
  36. package/dist/ShareList-6QI7ZAMZ.js +11 -0
  37. package/dist/{ShareMaafApp-6MKZ33HW.js → ShareMaafApp-PZI5MCBA.js} +2 -2
  38. package/dist/{TelemetrySettings-RXPPIEVO.js → TelemetrySettings-WWVPRF7T.js} +2 -2
  39. package/dist/{UnshareMaafApp-OSE2TOBJ.js → UnshareMaafApp-MHBIV5OR.js} +2 -2
  40. package/dist/chunk-2FNWZUPW.js +15 -0
  41. package/dist/chunk-2HSJ2XAQ.js +13 -0
  42. package/dist/{chunk-PPW4XUZO.js → chunk-3FP37TPE.js} +9 -9
  43. package/dist/chunk-5XRK3F43.js +11 -0
  44. package/dist/{chunk-6RSE3J4X.js → chunk-7PH2NK5K.js} +2 -2
  45. package/dist/chunk-DAG6RPOF.js +11 -0
  46. package/dist/{chunk-SNWTSI75.js → chunk-DD7E4ADI.js} +2 -2
  47. package/dist/{chunk-6LKH5WE7.js → chunk-F3HGM3IU.js} +23 -21
  48. package/dist/chunk-FMJDKXNM.js +12 -0
  49. package/dist/chunk-HCPTQP7J.js +11 -0
  50. package/dist/chunk-I22E6YZT.js +11 -0
  51. package/dist/chunk-LDP2SHPJ.js +11 -0
  52. package/dist/{chunk-KYL2Y5G4.js → chunk-PKDXP7CL.js} +2 -2
  53. package/dist/chunk-SBVJ4SMO.js +20 -0
  54. package/dist/chunk-SCJXITCN.js +12 -0
  55. package/dist/chunk-TZRZFNLH.js +38 -0
  56. package/dist/{chunk-4LIR3ZYP.js → chunk-UIW77LMA.js} +251 -251
  57. package/dist/chunk-WQKDXHGX.js +11 -0
  58. package/dist/{chunk-4VBFOKV6.js → chunk-X5O77GZS.js} +2 -2
  59. package/dist/{chunk-EX6IKPAO.js → chunk-Y7TZZLPW.js} +2 -2
  60. package/dist/chunk-ZIONKKAV.js +44 -0
  61. package/package.json +4 -4
  62. package/dist/AddConnector-5DUBFLEK.js +0 -41
  63. package/dist/BuildMaafApp-A4IUU6LI.js +0 -11
  64. package/dist/Cli-LYSWG64H.js +0 -54
  65. package/dist/CloneMaafApp-B672N7T5.js +0 -11
  66. package/dist/CreateMaafApp-RWL7FXSP.js +0 -20
  67. package/dist/DeleteMaafApp-GT4CEFAE.js +0 -11
  68. package/dist/DeployMaafApp-E4TQU6RO.js +0 -14
  69. package/dist/GetMaafBuildStatus-UGAHVANE.js +0 -11
  70. package/dist/Init-XCSK3WQM.js +0 -11
  71. package/dist/ListConnectorActions-B2YD24RX.js +0 -11
  72. package/dist/ListConnectors-MYUEVJPT.js +0 -11
  73. package/dist/Pack-IWU3PFQL.js +0 -8
  74. package/dist/RefreshDataSource-XQT7LVMO.js +0 -11
  75. package/dist/ShareLinkRevoke-OH5DZDHR.js +0 -11
  76. package/dist/ShareList-QCEL7QNJ.js +0 -11
  77. package/dist/chunk-23T63QIT.js +0 -15
  78. package/dist/chunk-3JIZGVCA.js +0 -11
  79. package/dist/chunk-47LJLFDF.js +0 -11
  80. package/dist/chunk-7BRIEYGR.js +0 -20
  81. package/dist/chunk-7GGFN2IW.js +0 -11
  82. package/dist/chunk-AQLFVAFU.js +0 -38
  83. package/dist/chunk-EQCYKUEU.js +0 -12
  84. package/dist/chunk-IQGMFWXB.js +0 -12
  85. package/dist/chunk-LQ65CHNN.js +0 -13
  86. package/dist/chunk-UNJJUCSA.js +0 -11
  87. package/dist/chunk-VMSJG53Y.js +0 -11
package/README.md CHANGED
@@ -12,7 +12,7 @@ Run commands with `ms <command>`.
12
12
 
13
13
  ## Commands
14
14
 
15
- - **`ms app …`** — app lifecycle and configuration: create, clone platform-managed repositories, init, list, info (`show` is a deprecated alias), build, deploy, play (including branch or commit previews), dev, delete, share/unshare, share list, add data-source, refresh data-source (`--offline`), and settings.
15
+ - **`ms app …`** — app lifecycle and configuration: create, clone platform-managed repositories, init, list, info (`show` is a deprecated alias), build, deploy, play (including branch or commit previews), dev, delete, share/unshare, share list, add config (preview, requires `MS_CLI_ALM=true`; registers a project deployment and creates its local overlay), add data-source (including preview `--deployment <name> --for <logical-name>` binding updates), refresh data-source (`--offline`), and settings.
16
16
  - **`ms connector …`** — discover connector actions and functions in the environment.
17
17
  - **`ms auth …`** — sign in/out and manage cached accounts (login, logout, status, switch).
18
18
  - **`ms git auth …`** — establish the Entra↔GitHub identity mapping for external repos.
@@ -22,6 +22,8 @@ Run `ms <command> --help` for the options on any command.
22
22
 
23
23
  `ms app deploy` guards git-backed deployments when the working tree has uncommitted changes or local `main` is ahead of `origin/main`. Interactive runs can confirm and continue; non-interactive runs must pass `--force` to bypass the guard.
24
24
 
25
+ `ms app deploy --no-wait` is available only when `MS_CLI_MAAF_DEPLOY_VIA_MANAGED_DEVOPS` is `2` or `3`. It skips deployment polling, but still waits for a queued prerequisite build on git-backed apps and still packs/uploads external artifacts before submitting the deployment. After the service accepts the deployment, the command returns its stable operation ID for later tracking.
26
+
25
27
  ## Global options
26
28
 
27
29
  | Option | Alias | Description |
@@ -0,0 +1,12 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __pathDirname } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a as E,b as g,c as C,d as W,e as F}from"./chunk-5XRK3F43.js";import{a as T}from"./chunk-DD7E4ADI.js";import{Ga as M,T as P,b,g as I,ma as x}from"./chunk-UIW77LMA.js";import{b as O,d as r}from"./chunk-RBG2H562.js";import"./chunk-LDP2SHPJ.js";import"./chunk-7PH2NK5K.js";import"./chunk-Y7TZZLPW.js";import{e as m}from"./chunk-DAG6RPOF.js";import{c,d as h,i as A}from"./chunk-PVAIJSAI.js";import{a as f}from"./chunk-WQKDXHGX.js";import{c as N}from"./chunk-3FP37TPE.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";import*as l from"node:fs";import*as y from"node:fs/promises";import*as L from"node:path";async function ie(e){V(e),await e.runVerb();let n=await e.getOption(m.Deployment.name),t=C(n),o=E(),i=F(o,t);if(await G(o.appRoot,i),t===g){let p=`Deployment '${t}' is already provisioned.`,$=await U(i),d=_(p,i,$);if(e.isJsonMode()){h({deployment:t,deploymentCreated:!1,configCreated:$===void 0,configPath:i,...d?{warning:d}:{}});return}if(d){A(d);return}c(`Created deployment config '${i}'.`);return}let u=await R(e,o.config),a=u.projectId?.trim();if(!a)throw new r(`App '${u.displayName}' is not associated with a managed project, so a deployment cannot be configured.`);e.updateEnvironmentId(u.environmentId);let w=!0;try{await P(a,{stageName:t})}catch(p){if(B(p))w=!1;else throw p}let D=await U(i),v=w?`Registered deployment '${t}' with project '${a}'.`:`Deployment '${t}' is already registered with project '${a}'.`,s=_(v,i,D);if(e.isJsonMode()){h({deployment:t,projectId:a,deploymentCreated:w,configCreated:D===void 0,configPath:i,...s?{warning:s}:{}});return}if(s){A(s);return}c(v),c(`Created deployment config '${i}'.`)}var j=/^default-/i;function S(e,n,t=!1){if(e==null)return;if(typeof e!="string")throw new r(`The base app config field '${n}' must be a string, but is of type ${typeof e}.`);let o=e.trim();if(!o)return;let i=t?o.replace(j,""):o;if(!b(i))throw new r(`The base app config field '${n}' must be a GUID, but is '${o}'.`);return o}async function R(e,n){let t=S(n.appId,"appId");if(!t)throw new r("The base app config does not contain an appId.");let o=S(n.environmentId,"environmentId",!0),i=await e.getTenantIdAsync();if(!i)throw new O("Unable to determine tenant ID. Ensure you are logged in.");return x({tenantId:i,environmentId:o,logger:M(),actionsParams:{appName:t}})}async function G(e,n){if(l.existsSync(n))throw new r(`${L.basename(n)} already exists. Edit it directly or choose another deployment.`);try{await y.access(e,l.constants.W_OK)}catch(t){throw new r(`App directory '${e}' is not writable.`,{underlyingError:t})}}async function J(e,n){await y.writeFile(e,n,{encoding:"utf8",flag:"wx"})}async function k(e){await J(e,`${JSON.stringify({$schema:N},null,2)}
8
+ `)}async function U(e){try{await k(e);return}catch(n){return n instanceof Error?n.message:String(n)}}function _(e,n,t){if(t!==void 0)return`${e} The deployment config '${n}' could not be created. Fix the filesystem error and rerun the command; the existing deployment will be reused. Reason: ${t}`}function B(e){return e instanceof I&&e.status===409&&e.code==="StageNameConflict"}function V(e){e.setDescription(f.app.add.config.description),e.addExamples(f.app.add.config.examples),e.addOptions([{flags:{key:m.Deployment.name},description:f.app.add.config.options.deployment,customPrompt:async()=>await T({message:m.Deployment.promptMessage,initialValue:g})}])}export{g as DEFAULT_DEPLOYMENT_NAME,ie as addConfigAsync,W as assertOverlayNameNotReserved,E as resolveBaseConfig,S as validateConfigGuid,C as validateDeploymentName};
9
+ /*!
10
+ * Copyright (C) Microsoft Corporation. All rights reserved.
11
+ */
12
+ //# sourceMappingURL=AddConfig-GZO2UMFR.js.map
@@ -0,0 +1,23 @@
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 ke,b as Be,c as H,d as ee,e as _}from"./chunk-ZIONKKAV.js";import{a as Ee,c as xe,e as Pe}from"./chunk-5XRK3F43.js";import{a as X,b as Z,d as J,e as Te,g as Oe}from"./chunk-DD7E4ADI.js";import{B as we,Ga as B,Ha as E,J as Ce,K as Ae,V as le,W as Se,X as Ie,_ as De,ba as $e,ca as Ne,f as ye,u as q}from"./chunk-UIW77LMA.js";import{b as a}from"./chunk-RBG2H562.js";import"./chunk-LDP2SHPJ.js";import"./chunk-7PH2NK5K.js";import{c as Fe}from"./chunk-Y7TZZLPW.js";import{b as D,c as A,d as V}from"./chunk-DAG6RPOF.js";import{a as W,c as M,d as he,h as j,i as Q}from"./chunk-PVAIJSAI.js";import{a as p}from"./chunk-WQKDXHGX.js";import{o as K,p as de,q as ve,r as be}from"./chunk-3FP37TPE.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";var Ye=["shared_commondataserviceforapps","commondataserviceforapps"];function te(e){let n=e.toLowerCase();return Ye.some(t=>n===t||n.endsWith(`/${t}`))}function Re(e){e.length!==0&&Q(`The following connector operations are blocked by your organization's policy and were not generated.
8
+ Ask your admin to allow them on 'Microsoft Dataverse' to restore the missing service methods:
9
+ `+e.map(({operationId:n,methodName:t})=>` \u2022 ${n} (generates ${t}())`).join(`
10
+ `))}async function Me(e){let{argumentProvider:n,connector:t,apiId:o,connectionIdFlag:c,datasetFlag:m,tableFlag:f,skipCodegen:v,useV1Codegen:h,useSso:$}=e,i=E(),{fileConfig:l,cliFs:S}=i,g=q(),y=n.getAuthenticationProvider(),F=B(),k={appConfigPath:l.appConfigPath,schemaPath:l.schemaPath,codeGenPath:l.codeGenPath},T={vfs:S,authProvider:y,httpClient:n.getHttpClient(),region:g.region,environmentName:g.environmentName,localFilePaths:k,logger:F},x=t.properties.displayName??o,s=c,b=!1;if(!s){let N=await H({argumentProvider:n,apiId:o,connector:t,useSso:$});s=N.connectionId,b=N.autoSelected}let w={autoSelected:b,connectionId:s,connectorLabel:x};await _({apiId:o,connectionId:s});let I=m;if(!I){let N={...T,actionsParams:{apiId:o,connectionId:s}},{value:L}=await ee(()=>$e(N),w);if(!i.interactive)throw W({title:`Available datasets for ${x}`,columns:[{header:"Display Name",maxWidth:40},{header:"Dataset Name"}],rows:L.map(r=>[r.DisplayName||r.Name,r.Name]),emptyMessage:"No datasets found for this connection.",totalLabel:"dataset(s) found"}),new a("Re-run with --dataset <name> or -d <name>.");I=await J({message:"Select a dataset:",options:L.map(r=>({value:r.Name,label:r.DisplayName||r.Name,hint:r.Name})),manualPromptMessage:"Enter dataset name:"})}let O=f;if(!O){let N={...T,actionsParams:{apiId:o,connectionId:s,dataset:I}},{value:L}=await ee(()=>Ne(N),w);if(!i.interactive)throw W({title:`Available tables in dataset '${I}'`,columns:[{header:"Display Name",maxWidth:40},{header:"Table Name"}],rows:L.map(r=>[r.DisplayName||r.Name,r.Name]),emptyMessage:"No tables found in this dataset.",totalLabel:"table(s) found"}),new a("Re-run with --table <name> or -t <name>.");O=await J({message:"Select a table:",options:L.map(r=>({value:r.Name,label:r.DisplayName||r.Name,hint:r.Name})),manualPromptMessage:"Enter table name:"})}let C={...T,actionsParams:{apiId:o,connectionId:s,dataset:I,tableName:O,skipCodegen:v,useV1Codegen:h}},u=await ee(()=>Se(C),w);M(`Data source '${u}' added successfully (table '${O}' from connector '${x}').`),j(`Hint: Run '${"ms"} app dev' to test locally, or '${"ms"} app deploy' to deploy.`)}async function pe(e){let{argumentProvider:n,connector:t,apiId:o,connectionIdFlag:c,skipCodegen:m,useV1Codegen:f,useSso:v,policy:h,dataverseEnvironmentId:$,dataverseTable:i,forceTableBinding:l}=e,S=E(),{fileConfig:g,cliFs:y}=S,F=q(),k=n.getAuthenticationProvider(),T=B(),x=(t.properties.connectionParameterSets?.values?.length??0)>1,s=c;x&&!s&&(s=(await H({argumentProvider:n,apiId:o,connector:t,useSso:v})).connectionId),x&&s&&await _({apiId:o,connectionId:s});let b=h?Ae(h,t.name??o):void 0,w=te(o),I=await Ke({isCommonDataServiceForApps:w,forceTableBinding:!!l,dataverseEnvironmentId:$,dataverseTable:i}),O=u=>({vfs:y,authProvider:k,httpClient:n.getHttpClient(),region:F.region,environmentName:F.environmentName,actionsParams:{apiId:o,connectionId:s,skipCodegen:m,useV1Codegen:f,actionPolicy:b,...u},localFilePaths:{appConfigPath:g.appConfigPath,schemaPath:g.schemaPath,codeGenPath:g.codeGenPath},logger:T}),C;try{C=await le(O(I))}catch(u){throw u instanceof Ce||u instanceof ye?new a(u.message):u}if(C.filteredCount>0&&j(`Skipped ${C.filteredCount} of ${C.totalCount} actions due to your organization's connector policy.`),Re(C.skippedDataverseMethods),M(`Data source '${C.dataSourceName}' added successfully (connector '${t.properties.displayName??o}').`),I?.dataverseTable&&M(`Dataverse table '${I.dataverseTable}' bound successfully.`),w&&S.interactive&&!I&&await Z({message:"Connect this to a specific Dataverse table?",initialValue:!0})){let N=await le(O(await Ve({})));M("Dataverse table binding added successfully."),Re(N.skippedDataverseMethods)}j(`Hint: Run '${"ms"} app dev' to test locally, or '${"ms"} app deploy' to deploy.`)}async function Ke(e){if(!e.isCommonDataServiceForApps)return;let n=E(),t=!!e.dataverseTable;if(!n.interactive)return t?{dataverseEnvironmentId:e.dataverseEnvironmentId,dataverseTable:e.dataverseTable}:void 0;if(!(!t&&!e.forceTableBinding))return Ve({dataverseEnvironmentId:e.dataverseEnvironmentId,dataverseTable:e.dataverseTable})}async function Ve(e){let n=e.dataverseTable??await X({message:"Dataverse table logical name:"});return{dataverseEnvironmentId:e.dataverseEnvironmentId,dataverseTable:n}}function Le(e){return e.properties.capabilities?.some(n=>n.toLowerCase()==="tabular")??!1}import*as We from"node:path";async function qe(e,n){let t=xe(n,"--deployment"),o=Ee(),c=Pe(o,t),m=We.basename(c),f=E(),v=e.isJsonMode(),h=f.interactive&&!v,$=De(o.config).all.filter(d=>d.kind==="table"&&!d.sqlStoredProcedure),i=await Qe({argumentProvider:e,deployment:t,eligibleDataSources:$,interactive:h,isJsonMode:v}),l=$.find(d=>d.name===i);if(!l)throw v||Je($),new a(`Data source '${i}' not found in the base app config. Run '${"ms"} app add data-source' (without --deployment) to add it first.`);let S=await e.getOption(D.Connector.name,!0);if(R(S)&&!tt(S,l))throw new a(`Connector '${S}' does not match data source '${i}', which uses connector '${l.connectorId}'.`);if(!await f.cliFs.exists(c))throw new a(`Deployment '${t}' has no config file ('${m}'). Run '${"ms"} app add config --deployment ${t}' first, then re-run this command.`);let g=await Xe(c,m),y=K(o.config),F=K(g);Ze(y,F,m);let k=Object.entries(y.connectionReferences??{}).find(([,d])=>d.dataSources?.includes(i));if(!k)throw new a(`Data source '${i}' is not associated with a connection reference in the base app config.`);let[T,x]=k,s=R(x.sharedConnectionId),w=ve(y,F).connectionReferences?.[T],I=s?z(w?.sharedConnectionId??void 0):void 0,O=await e.getOption("connectionId",!0),C=await e.getOption("dataset",!0),u=await e.getOption("table",!0);h||je({deployment:t,datasetFlag:C,tableFlag:u,persistsSharedConnection:s,connectionIsBindingInput:s&&R(O)});let N=z(O),r=N??(h?void 0:I),He=N===void 0&&r!==void 0;if(r===void 0){let d=await we(l.connectorId,B());r=(await H({argumentProvider:e,apiId:l.connectorId,connector:d,interactive:h,quiet:v,nonInteractiveReason:v?"json-mode":"cli-mode"})).connectionId}let ne=me(r);h&&(C??=await Ue("Dataset for this deployment (leave blank to keep the current value for this deployment):"),u??=await Ue("Table for this deployment (required when changing the dataset; otherwise leave blank to keep the current value for this deployment):"),je({deployment:t,datasetFlag:C,tableFlag:u,persistsSharedConnection:s,connectionIsBindingInput:s}));let oe=et(w,i),ae=z(C),fe=z(u);if(ae!==void 0&&ae!==oe.dataset&&fe===void 0)throw new a(`Changing the dataset for '${i}' requires --table because table identifiers are dataset-specific.`);let G=ae??oe.dataset,U=fe??oe.tableName;if(!G||!U){let d=[G?void 0:"--dataset",U?void 0:"--table"].filter(ce=>ce!==void 0).join(" and ");throw new a(`The effective binding for '${i}' is missing ${d}. Provide the missing value and re-run the command.`)}let _e=await _({apiId:l.connectorId,connectionId:ne,impact:"The deployment binding was saved, but later calls",defer:!0}),ge=q(),ie=await Ie({vfs:f.cliFs,authProvider:e.getAuthenticationProvider(),httpClient:e.getHttpClient(),region:ge.region,environmentName:ge.environmentName,actionsParams:{apiId:l.connectorId,connectionId:ne,dataset:G,tableName:U,dataSourceName:i},localFilePaths:f.fileConfig,logger:B()});if(ie.drift.length>0)throw new a(`Table '${U}' for deployment '${t}' does not match the base schema for '${i}'.
11
+ ${ie.drift.map(d=>` - ${d}`).join(`
12
+ `)}`);let ze=ie.baseSchemaMissing?`Schema parity could not be evaluated for '${i}' because its base schema file is missing.`:void 0,se=nt(g),Ge=se.connectionReferences??={},Y=Ge[T]??={};if(s?He||(Y.sharedConnectionId=ne):delete Y.sharedConnectionId,R(C)||R(u)){ot(Y,i);let d=Y.dataSets??={},ce=d[G]??={dataSources:{}};ce.dataSources[i]={tableName:U}}let ue=de(y,K(se));if(!ue.valid)throw new a(`The updated deployment config '${m}' is invalid:
13
+ ${ue.errors.join(`
14
+ `)}`);await f.cliFs.writeFile(c,`${JSON.stringify(se,null,2)}
15
+ `);let re=[ze,_e].filter(d=>d!==void 0);if(v){he({deployment:t,dataSource:i,path:c,...re.length===0?{}:{warnings:re}});return}M(`Data source '${i}' bound for deployment '${t}' in '${m}'.`);for(let d of re)Q(d);j(`Hint: Run '${"ms"} app dev' to test locally, or '${"ms"} app deploy' to deploy.`)}async function Qe(e){let n=await e.argumentProvider.getOption(V.For.name,!0);if(R(n))return n;if(!e.interactive)throw e.isJsonMode||Je(e.eligibleDataSources),new a(`--for is required. Re-run with --deployment ${e.deployment} --for <logical-name>.`);return await J({message:`Which data source would you like to bind for deployment '${e.deployment}'?`,options:e.eligibleDataSources.map(t=>({value:t.name,label:`${t.name} (${t.connectorDisplayName})`,hint:t.kind})),manualPromptMessage:"Enter the data source logical name:"})}function Je(e){W({title:"Available tabular data sources",columns:[{header:"Data Source"},{header:"Connector",maxWidth:30}],rows:e.map(n=>[n.name,n.connectorDisplayName]),emptyMessage:"No tabular data sources found in the base app config.",totalLabel:"data source(s) found"})}async function Xe(e,n){let t;try{t=be(await E().cliFs.readFile(e,"utf-8"))}catch(o){throw o instanceof Error&&o.message==="file is not valid JSON"?new a(`Deployment config '${n}' is not valid JSON.`):o}if(!at(t))throw new a(`Deployment config '${n}' must contain a JSON object.`);if("$schema"in t&&t.$schema!==void 0&&typeof t.$schema!="string")throw new a(`Deployment config '${n}' has a non-string $schema value.`);return t}function Ze(e,n,t){let o=de(e,n);if(!o.valid)throw new a(`Deployment config '${t}' is invalid:
16
+ ${o.errors.join(`
17
+ `)}`)}function et(e,n){for(let[t,o]of Object.entries(e?.dataSets??{})){let c=o.dataSources[n];if(c)return{dataset:t,tableName:c.tableName}}return{}}function me(e){return e.split("/").filter(Boolean).at(-1)??e}function tt(e,n){return me(e).toLowerCase()===me(n.connectorId).toLowerCase()}function nt(e){let{$schema:n,...t}=e;return{...n===void 0?{}:{$schema:n},...structuredClone(t)}}function ot(e,n){for(let[t,o]of Object.entries(e.dataSets??{}))delete o.dataSources[n],Object.keys(o.dataSources).length===0&&delete e.dataSets?.[t]}function je(e){let{deployment:n,datasetFlag:t,tableFlag:o,persistsSharedConnection:c,connectionIsBindingInput:m}=e;if(m||[t,o].some(R))return;let f=c?"--connection-id, --dataset, or --table":"--dataset or --table";throw new a(`Nothing to bind for deployment '${n}'. Provide at least one of ${f}.`)}async function Ue(e){return z(await X({message:e}))}function z(e){return R(e)?e.trim():void 0}function R(e){return typeof e=="string"&&e.trim().length>0}function at(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}async function Vt(e){st(e),await e.runVerb(),Oe();let n=await e.getOption(V.Deployment.name,!0),t=await e.getOption(V.For.name,!0);if(n!==void 0||t!==void 0){if(n===void 0)throw new a("--for can only be used with --deployment <name>.");let b=[["--as",await e.getOption("as",!0)],["--skip-codegen",await e.getOption("skipCodegen",!0)],["--use-v1-codegen",await e.getOption("useV1Codegen",!0)],["--use-sso",await e.getOption("useSso",!0)],["--dataverse-environment-id",await e.getOption("dataverseEnvironmentId",!0)]].filter(([,w])=>w!==void 0);if(b.length>0)throw new a(`${b.map(([w])=>w).join(", ")} cannot be used with --deployment. Deployment binding updates never run code generation or add a new connector.`);await qe(e,n);return}let o=await e.getOption("connector"),c=await e.getOption("connectionId",!0),m=await e.getOption("dataset",!0),f=await e.getOption("table",!0),v=await e.getOption("as",!0),h=await e.getOption("dataverseEnvironmentId",!0),$=!!await e.getOption("skipCodegen",!0),i=!!await e.getOption("useV1Codegen",!0),l=!!await e.getOption("useSso",!0),S;if(v!==void 0&&v!==""){let b=v.toLowerCase();if(b!=="table"&&b!=="action")throw new a(`Invalid value for --as: '${v}'. Expected 'table' or 'action'.`);S=b}let g=await ke(o,B()),{connector:y,policy:F}=await Be(e,g),k=y.properties.displayName??g,T=Le(y);if(te(g)){if(m)throw new a("--dataset is not used with the Common Data Service for Apps connector. Use --table to specify a Dataverse logical name.");let b=S==="table";if(!E().interactive&&(b||h)&&!f)throw new a("Adding a Dataverse table requires --table <logical-name> for the Common Data Service for Apps connector. --dataverse-environment-id is optional and defaults to the app environment.");await pe({argumentProvider:e,connector:y,apiId:g,connectionIdFlag:c,skipCodegen:$,useV1Codegen:i,useSso:l,policy:F,dataverseEnvironmentId:h,dataverseTable:f,forceTableBinding:b});return}if(h)throw new a("--dataverse-environment-id can only be used with the Common Data Service for Apps connector (--connector shared_commondataserviceforapps or --connector commondataserviceforapps).");let s=await it({isTabular:T,asFlag:S,connectorLabel:k});if(s==="action"&&(m||f))throw new a("--dataset and --table cannot be used with --as action. Re-run with --as table, or omit those flags.");s==="table"?await Me({argumentProvider:e,connector:y,apiId:g,connectionIdFlag:c,datasetFlag:m,tableFlag:f,skipCodegen:$,useV1Codegen:i,useSso:l}):await pe({argumentProvider:e,connector:y,apiId:g,connectionIdFlag:c,skipCodegen:$,useV1Codegen:i,useSso:l,policy:F})}async function it(e){let{isTabular:n,asFlag:t,connectorLabel:o}=e,c=E();if(!n){if(t==="table")throw new a(`Connector '${o}' does not support tabular data sources. Re-run without --as table, or with --as action.`);return"action"}if(t)return t;if(!c.interactive)throw new a(`Connector '${o}' supports both tables and actions. Specify --as table or --as action.`);return await Z({message:`Connector '${o}' supports tables. Add a table? (No \u2192 add actions instead)`,initialValue:!0})?"table":"action"}function st(e){let n=e.getResolvedCommand()?.path.at(-1)==="connector",t=Fe("ALM");n?(e.setDescription(`${p.app.add.connector.deprecation}
18
+
19
+ ${p.app.add.connector.description}`),e.addExamples(p.app.add.connector.deprecatedExamples)):(e.setDescription(p.app.add.connector.description),e.addExamples(t?p.app.add.connector.examples:p.app.add.connector.examples.filter(o=>!o.includes(" --deployment ")))),e.addOptions([Te({flags:{key:D.Connector.name},env:D.Connector.envVar,message:D.Connector.promptMessage,description:p.app.add.connector.options.connector}),{flags:{key:D.ConnectionId.name,alias:D.ConnectionId.alias},env:D.ConnectionId.envVar,description:p.app.add.connector.options.connectionId,optionalInNonInteractive:!0},{flags:{key:D.Dataset.name,alias:D.Dataset.alias},env:D.Dataset.envVar,description:p.app.add.connector.options.dataset,optionalInNonInteractive:!0},{flags:{key:A.Table.name,alias:A.Table.alias},env:A.Table.envVar,description:p.app.add.connector.options.table,optionalInNonInteractive:!0},...t?[{flags:{key:V.Deployment.name},description:p.app.add.connector.options.deployment,optionalInNonInteractive:!0},{flags:{key:V.For.name},description:p.app.add.connector.options.for,optionalInNonInteractive:!0}]:[],{flags:{key:A.As.name},env:A.As.envVar,description:p.app.add.connector.options.as,optionalInNonInteractive:!0},{flags:{key:A.DataverseEnvironmentId.name},env:A.DataverseEnvironmentId.envVar,description:p.app.add.connector.options.dataverseEnvironmentId,optionalInNonInteractive:!0}]),e.addSwitch({flags:{key:A.SkipCodegen.name},env:A.SkipCodegen.env,description:p.app.add.connector.options.skipCodegen}),e.addSwitch({flags:{key:A.UseSso.name},env:A.UseSso.env,description:p.app.add.connector.options.useSso}),e.addSwitch({flags:{key:A.UseV1Codegen.name},env:A.UseV1Codegen.env,description:"Use V1 (legacy) code generation instead of V2.",hidden:!0})}export{Vt as addConnectorAsync};
20
+ /*!
21
+ * Copyright (C) Microsoft Corporation. All rights reserved.
22
+ */
23
+ //# sourceMappingURL=AddConnector-HJCCENAM.js.map
@@ -4,8 +4,8 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __pathDirname(__filename);
7
- import{a as i,d as u,h as a,i as s}from"./chunk-PVAIJSAI.js";import{a as o}from"./chunk-47LJLFDF.js";import"./chunk-PPW4XUZO.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function l(n){n.setDescription(o.auth.status.description),n.addExamples(o.auth.status.examples),await n.runVerb();let t=await n.getAccountManager().listCachedAccountsAsync();if(n.isJsonMode()){let e=t.find(c=>c.isActive);u({signedIn:t.length>0,activeAccount:e?{username:e.username,homeAccountId:e.homeAccountId}:null,accounts:t.map(c=>({username:c.username,homeAccountId:c.homeAccountId,isActive:c.isActive}))});return}if(t.length===0){s(`Not signed in. Run \`${"ms"} auth login\` to authenticate.`);return}if(t.length===1){a(`Signed in as ${t[0].username} (account ID: ${t[0].homeAccountId})`);return}let m=t.some(e=>e.isActive);i({title:"Cached accounts",columns:[{header:"Active"},{header:"Username"},{header:"Account ID"}],rows:t.map(e=>[e.isActive?"*":"",e.username,e.homeAccountId])}),m||s(`No active account selected. Run \`${"ms"} auth switch\` to choose one.`)}export{l as authStatusAsync};
7
+ import{a as i,d as u,h as a,i as s}from"./chunk-PVAIJSAI.js";import{a as o}from"./chunk-WQKDXHGX.js";import"./chunk-3FP37TPE.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function l(n){n.setDescription(o.auth.status.description),n.addExamples(o.auth.status.examples),await n.runVerb();let t=await n.getAccountManager().listCachedAccountsAsync();if(n.isJsonMode()){let e=t.find(c=>c.isActive);u({signedIn:t.length>0,activeAccount:e?{username:e.username,homeAccountId:e.homeAccountId}:null,accounts:t.map(c=>({username:c.username,homeAccountId:c.homeAccountId,isActive:c.isActive}))});return}if(t.length===0){s(`Not signed in. Run \`${"ms"} auth login\` to authenticate.`);return}if(t.length===1){a(`Signed in as ${t[0].username} (account ID: ${t[0].homeAccountId})`);return}let m=t.some(e=>e.isActive);i({title:"Cached accounts",columns:[{header:"Active"},{header:"Username"},{header:"Account ID"}],rows:t.map(e=>[e.isActive?"*":"",e.username,e.homeAccountId])}),m||s(`No active account selected. Run \`${"ms"} auth switch\` to choose one.`)}export{l as authStatusAsync};
8
8
  /*!
9
9
  * Copyright (C) Microsoft Corporation. All rights reserved.
10
10
  */
11
- //# sourceMappingURL=AuthStatus-6DMK7O6W.js.map
11
+ //# sourceMappingURL=AuthStatus-WCICFN6O.js.map
@@ -4,10 +4,10 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __pathDirname(__filename);
7
- import{c as f}from"./chunk-SNWTSI75.js";import{va as h}from"./chunk-4LIR3ZYP.js";import{b as l}from"./chunk-RBG2H562.js";import"./chunk-UNJJUCSA.js";import"./chunk-6RSE3J4X.js";import"./chunk-EX6IKPAO.js";import{a as u}from"./chunk-3JIZGVCA.js";import{c as p,d as r,i as A}from"./chunk-PVAIJSAI.js";import{a as i}from"./chunk-47LJLFDF.js";import"./chunk-PPW4XUZO.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function b(t){t.setDescription(i.auth.switch.description),t.addExamples(i.auth.switch.examples),t.addOption({flags:{key:u.Account.name},description:i.auth.switch.options.account,optionalInNonInteractive:!0}),await t.runVerb();let n=t.getAccountManager(),s=await t.getOption(u.Account.name,!0),o=t.isJsonMode(),e=await n.listCachedAccountsAsync();if(e.length===0){if(o){r({activeAccount:null});return}A(`No cached accounts. Run \`${"ms"} auth login\` first.`);return}let a=s;if(!a){if(e.length===1){let c=await n.setActiveAccountAsync(e[0].homeAccountId);d(c.username,c.homeAccountId,o);return}if(o||!h().interactive)throw new l(`Multiple accounts are cached. Pass --account <email> to choose one.
7
+ import{c as f}from"./chunk-DD7E4ADI.js";import{Ha as h}from"./chunk-UIW77LMA.js";import{b as l}from"./chunk-RBG2H562.js";import"./chunk-LDP2SHPJ.js";import"./chunk-7PH2NK5K.js";import"./chunk-Y7TZZLPW.js";import{a as u}from"./chunk-DAG6RPOF.js";import{c as p,d as r,i as A}from"./chunk-PVAIJSAI.js";import{a as i}from"./chunk-WQKDXHGX.js";import"./chunk-3FP37TPE.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function b(t){t.setDescription(i.auth.switch.description),t.addExamples(i.auth.switch.examples),t.addOption({flags:{key:u.Account.name},description:i.auth.switch.options.account,optionalInNonInteractive:!0}),await t.runVerb();let n=t.getAccountManager(),s=await t.getOption(u.Account.name,!0),o=t.isJsonMode(),e=await n.listCachedAccountsAsync();if(e.length===0){if(o){r({activeAccount:null});return}A(`No cached accounts. Run \`${"ms"} auth login\` first.`);return}let a=s;if(!a){if(e.length===1){let c=await n.setActiveAccountAsync(e[0].homeAccountId);d(c.username,c.homeAccountId,o);return}if(o||!h().interactive)throw new l(`Multiple accounts are cached. Pass --account <email> to choose one.
8
8
  `+e.map(c=>` - ${c.username}`).join(`
9
9
  `));a=await f({message:"Choose the active account:",options:e.map(c=>({value:c.homeAccountId,label:c.username,hint:c.isActive?"currently active":void 0}))})}let m=await n.setActiveAccountAsync(a);d(m.username,m.homeAccountId,o)}function d(t,n,s){s?r({activeAccount:{username:t,homeAccountId:n}}):p(`Active account is ${t}.`)}export{b as authSwitchAsync};
10
10
  /*!
11
11
  * Copyright (C) Microsoft Corporation. All rights reserved.
12
12
  */
13
- //# sourceMappingURL=AuthSwitch-NUQIIRCG.js.map
13
+ //# sourceMappingURL=AuthSwitch-5PKHCTM2.js.map
package/dist/Bin.js CHANGED
@@ -5,7 +5,7 @@ import { dirname as __pathDirname } from 'node:path';
5
5
  const require = __createRequire(import.meta.url);
6
6
  const __filename = __fileURLToPath(import.meta.url);
7
7
  const __dirname = __pathDirname(__filename);
8
- import{i as a}from"./chunk-AQLFVAFU.js";import"./chunk-6RSE3J4X.js";import"./chunk-EX6IKPAO.js";import"./chunk-47LJLFDF.js";import"./chunk-PPW4XUZO.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";if(!a(process.argv)){let{boot:o}=await import("./Cli-LYSWG64H.js");await o()}
8
+ import{i as a}from"./chunk-TZRZFNLH.js";import"./chunk-7PH2NK5K.js";import"./chunk-Y7TZZLPW.js";import"./chunk-WQKDXHGX.js";import"./chunk-3FP37TPE.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";if(!a(process.argv)){let{boot:o}=await import("./Cli-7EVTIORX.js");await o()}
9
9
  /*!
10
10
  * Copyright (C) Microsoft Corporation. All rights reserved.
11
11
  */
@@ -0,0 +1,11 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __pathDirname } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{b as v}from"./chunk-I22E6YZT.js";import"./chunk-OL6CTXQR.js";import{a as $}from"./chunk-PKDXP7CL.js";import"./chunk-HCPTQP7J.js";import"./chunk-X5O77GZS.js";import{d as I,j as R}from"./chunk-SBVJ4SMO.js";import{h as C}from"./chunk-DD7E4ADI.js";import{Ga as N,Ha as B,fa as M}from"./chunk-UIW77LMA.js";import{b as l}from"./chunk-RBG2H562.js";import"./chunk-LDP2SHPJ.js";import"./chunk-7PH2NK5K.js";import"./chunk-Y7TZZLPW.js";import{p as e}from"./chunk-DAG6RPOF.js";import{c as r,d as c,e as A,h as b,i as S}from"./chunk-PVAIJSAI.js";import{a}from"./chunk-WQKDXHGX.js";import{a as h}from"./chunk-3FP37TPE.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function Y(t){if(J(t),await t.runVerb(),!t.getEnvironmentId())throw new l(`\`ms app build-app\` is deprecated and the \`--environment-id\` flag has been removed. The replacement flow is \`ms app create\` (scaffolds the app and writes ${h}) followed by \`ms app deploy\`. To run this deprecated command, invoke it from a directory with a ${h} (created by \`ms app create\`).`);let n=await t.getTenantIdAsync();if(!n)throw new l("Unable to determine tenant ID. Ensure you are logged in.");let m=await C(t),F=await t.getOption(e.NoWait.camelName)===!1,o=await t.getOption("commit",!0),d,g=!1;if(!o){let i=I();if(!i)throw new l("Could not determine the latest commit ID. Use --commit or -c to specify it.");o=i.commitSha,d=i.detached?void 0:i.branch,g=!0}let p=t.isJsonMode();if(g&&!p&&b(d?`Using branch '${d}' at commit ${o}.`:`Detached HEAD at commit ${o}.`),!p){let i=R();i&&S(i)}let y=B().appConfig,u=y?.repoType,W=y?.externalRepoUrl,k=await t.getOption(e.OpenBrowser.camelName,!0)??!1,D=await t.getOption(e.ForceReauth.camelName,!0)??!1;p&&u==="github"&&A({phase:"build-validation"});let w=await $(({isRetry:i})=>M({logger:N(),actionsParams:{appName:m,commitSha:o,...D&&!i&&u==="github"&&{forceReauth:!0}}}),{repoType:u,externalRepoUrl:W,tenantId:n,jsonMode:p,openBrowser:k,verb:"app build"});if(w===null){T(t.isJsonMode(),o);return}if(F){O(t.isJsonMode(),m,o);return}let f=await v({appName:m,commitSha:o,initialWaitMs:w.retryAfterMs??1e3,isJsonMode:t.isJsonMode()});t.isJsonMode()?c(f):(r(`Build status: ${f.status}`),f.status==="Succeeded"&&b(`Run \`ms app dev\` to run your app locally, or \`ms app deploy --commit ${o}\` to make this app live.`))}function J(t){t.setDescription(a.app.build.description),t.addExamples(a.app.build.examples),t.addOptions([{flags:{key:e.AppName.name},env:e.AppName.envVar,description:a.app.build.options.appName,optionalInNonInteractive:!0},{flags:{key:e.CommitSha.name,alias:e.CommitSha.alias},env:e.CommitSha.envVar,description:a.app.build.options.commitSha,optionalInNonInteractive:!0}]),t.addSwitch({flags:{key:e.NoWait.name},description:a.app.build.options.noWait}),t.addSwitch({flags:{key:e.OpenBrowser.name},description:a.app.build.options.openBrowser}),t.addSwitch({flags:{key:e.ForceReauth.name},description:a.app.build.options.forceReauth})}function O(t,s,n){if(t){c({commitSha:n,buildStatusCommand:`ms app build-status --app ${s} --commit ${n}`});return}r(`Build started for commit ${n}. Run \`ms app build-status --app ${s} --commit ${n}\` to check status.`)}function T(t,s){if(t){c({cached:!0,commitSha:s});return}r("Build already up to date for this commit.")}export{Y as buildMaafAppAsync};
8
+ /*!
9
+ * Copyright (C) Microsoft Corporation. All rights reserved.
10
+ */
11
+ //# sourceMappingURL=BuildMaafApp-Q74EFM3Q.js.map