@microsoft/cmr-cli 0.0.0-stage → 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/LICENSE +21 -0
- package/README.md +172 -2
- package/THIRD-PARTY-NOTICES.txt +9751 -0
- package/dist/Add-75RSJNM4.js +11 -0
- package/dist/AddConfig-4SAYYOBQ.js +12 -0
- package/dist/AddConnector-P4R4NJ5P.js +16 -0
- package/dist/AddDeployment-TBA3AAGD.js +11 -0
- package/dist/AddDeploymentBinding-6FZ7Y5JM.js +18 -0
- package/dist/AddRayfin-35GBGCWF.js +38 -0
- package/dist/Alter-U7WDVOMU.js +11 -0
- package/dist/AuthStatus-XA6RGYYZ.js +11 -0
- package/dist/AuthSwitch-2FXB7WFU.js +13 -0
- package/dist/Bin.js +12 -0
- package/dist/BuildMaafApp-3EGRD23G.js +11 -0
- package/dist/Clear-MZGQZ2XK.js +11 -0
- package/dist/Cli-6A2HUP7R.js +47 -0
- package/dist/CloneMaafApp-YAEYSP23.js +12 -0
- package/dist/CreateMaafApp-2XYROOHB.js +23 -0
- package/dist/CreateMaafProject-Q7KIVAR2.js +11 -0
- package/dist/DeleteMaafApp-G3SL3GGP.js +11 -0
- package/dist/DeployMaafApp-DBJONCUH.js +8 -0
- package/dist/DeployMaafProject-SOMMKVJO.js +11 -0
- package/dist/DeploymentApprovals-Y67LSQQG.js +11 -0
- package/dist/Dev-TXJLPT7K.js +15 -0
- package/dist/EnvironmentVariableAuthenticationProvider-EBRBQ5I2.js +11 -0
- package/dist/FeatureSettings-LYV6QUZB.js +11 -0
- package/dist/GenerateCode-Z2OY3SZR.js +13 -0
- package/dist/GetMaafBuildStatus-ZR5GCREL.js +11 -0
- package/dist/GetMaafProjectDeployStatus-OJ56DPZ6.js +12 -0
- package/dist/GetSettings-64N4P6L7.js +11 -0
- package/dist/InfoMaafApp-FJM7UI5H.js +13 -0
- package/dist/InfoMaafProject-EU6OQ7DX.js +11 -0
- package/dist/Init-MTONJT7V.js +11 -0
- package/dist/ListConnectorActions-PJTNNWLH.js +11 -0
- package/dist/ListConnectors-JYNVPB3O.js +11 -0
- package/dist/ListDeployments-UV6J6WA5.js +11 -0
- package/dist/ListMaafApps-QPEX7JA4.js +11 -0
- package/dist/ListMaafProjects-RDR2S3HD.js +11 -0
- package/dist/ListSchema-IR7FTBRR.js +8 -0
- package/dist/ListSettings-3M7UOOLI.js +12 -0
- package/dist/Login-G7TNQISG.js +11 -0
- package/dist/Logout-AOOISVWK.js +11 -0
- package/dist/MockFetch-GKQMNDW3.js +13 -0
- package/dist/NoOpAuthenticationProvider-ZZK2OB27.js +11 -0
- package/dist/NodeMsalAuthenticationProvider-6ABSS6QK.js +17 -0
- package/dist/Pack-QJZCMVEM.js +8 -0
- package/dist/PackProject-Y3Q3KOTC.js +14 -0
- package/dist/PlayMaafApp-MH66OLOV.js +8 -0
- package/dist/ProjectApprovals-NTFYLH3W.js +13 -0
- package/dist/ProjectRoleAssignments-7IDK6SGJ.js +11 -0
- package/dist/RefreshDataSource-CISFHQNA.js +11 -0
- package/dist/RefreshGitAuth-NUQ7JNJA.js +11 -0
- package/dist/Remove-IYDTKDJE.js +11 -0
- package/dist/RemoveDataSource-T2AG7ZWC.js +14 -0
- package/dist/RemoveDeployment-K3GDRCXJ.js +11 -0
- package/dist/ServicePrincipalAuthenticationProvider-CEHIAANL.js +11 -0
- package/dist/SetSetting-KOWAPJWX.js +11 -0
- package/dist/SetSetting-PD76MA6O.js +11 -0
- package/dist/ShareLinkCreate-VCWVBQ4B.js +11 -0
- package/dist/ShareLinkList-5VG5CG34.js +11 -0
- package/dist/ShareLinkRevoke-KYUNMTG5.js +11 -0
- package/dist/ShareList-M25UE6LD.js +11 -0
- package/dist/ShareMaafApp-QMEJEXPZ.js +11 -0
- package/dist/TelemetrySettings-FVJUK5MR.js +11 -0
- package/dist/UnshareMaafApp-RIUUYHIL.js +11 -0
- package/dist/acorn-CYBWGE5M.js +23 -0
- package/dist/angular-Q62TJP23.js +11 -0
- package/dist/babel-AOXBHIIS.js +22 -0
- package/dist/chunk-2UMD5IAQ.js +11 -0
- package/dist/chunk-2VJIWD7V.js +11 -0
- package/dist/chunk-36YYCVFC.js +12 -0
- package/dist/chunk-3UIUI5Q2.js +11 -0
- package/dist/chunk-3YRE4IQ3.js +132 -0
- package/dist/chunk-4AO24KKT.js +77 -0
- package/dist/chunk-4C6DWU2Y.js +11 -0
- package/dist/chunk-4JTUAUHI.js +12 -0
- package/dist/chunk-4UHMKZLH.js +11 -0
- package/dist/chunk-4WQT5P2M.js +11 -0
- package/dist/chunk-5BE4TLDK.js +54 -0
- package/dist/chunk-A57M2UGH.js +11 -0
- package/dist/chunk-ATUGCFVC.js +11 -0
- package/dist/chunk-B6REHI77.js +11 -0
- package/dist/chunk-BREK3DVB.js +18 -0
- package/dist/chunk-C7V6WEZM.js +11 -0
- package/dist/chunk-CER3QPDN.js +15 -0
- package/dist/chunk-CONEIY4I.js +11 -0
- package/dist/chunk-DOCWK326.js +44 -0
- package/dist/chunk-E2O4YZX2.js +42915 -0
- package/dist/chunk-EFTF4FA7.js +11 -0
- package/dist/chunk-ELHOJBVT.js +94 -0
- package/dist/chunk-FGB6GFXI.js +14 -0
- package/dist/chunk-GVLAG66W.js +13 -0
- package/dist/chunk-HBLO3WDD.js +13 -0
- package/dist/chunk-HWEMI6JI.js +12 -0
- package/dist/chunk-IM7SC23O.js +38 -0
- package/dist/chunk-JDRULLI3.js +11 -0
- package/dist/chunk-JMF444BA.js +12 -0
- package/dist/chunk-JWSX7DVU.js +11 -0
- package/dist/chunk-MWN7R4VR.js +12 -0
- package/dist/chunk-O4G2KO7E.js +11 -0
- package/dist/chunk-OB6WEE2V.js +11 -0
- package/dist/chunk-OBATM5M4.js +11 -0
- package/dist/chunk-OL6CTXQR.js +11 -0
- package/dist/chunk-OTXBVG3E.js +17 -0
- package/dist/chunk-OUKOEUZA.js +12 -0
- package/dist/chunk-PBXK6LJO.js +11 -0
- package/dist/chunk-SQI4XLR7.js +11 -0
- package/dist/chunk-TYRVM4PP.js +8 -0
- package/dist/chunk-UT667QSU.js +8 -0
- package/dist/chunk-VAKAW5BD.js +12 -0
- package/dist/chunk-WS6TGUH7.js +11 -0
- package/dist/chunk-WV7D7PTW.js +12 -0
- package/dist/chunk-WV7KDGLS.js +11 -0
- package/dist/chunk-Y5AMO72S.js +10 -0
- package/dist/chunk-YMRQPXY7.js +32 -0
- package/dist/chunk-YYXAAA2U.js +11 -0
- package/dist/chunk-ZREDMBLO.js +11 -0
- package/dist/dist-7N5TXK2L.js +45 -0
- package/dist/estree-HPTPQIMZ.js +51 -0
- package/dist/flow-B6JUMONE.js +27 -0
- package/dist/glimmer-36KZ3DJ5.js +44 -0
- package/dist/graphql-E6CIFZFV.js +35 -0
- package/dist/html-BUTTPQE6.js +32 -0
- package/dist/markdown-K2C5OZHT.js +69 -0
- package/dist/meriyah-27UE2OSX.js +12 -0
- package/dist/native/arm64/dpapi.node +0 -0
- package/dist/native/ia32/dpapi.node +0 -0
- package/dist/native/x64/dpapi.node +0 -0
- package/dist/postcss-QUHZLBB7.js +68 -0
- package/dist/rayfin-pack-HOUOLOHQ.js +164 -0
- package/dist/typescript-G2G6TDZF.js +28 -0
- package/dist/yaml-W5P5CGFK.js +166 -0
- package/package.json +62 -4
|
@@ -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 d,c as O,d as m,f as C,h as S}from"./chunk-FGB6GFXI.js";import{i as c}from"./chunk-5BE4TLDK.js";import{Ab as h,wb as A,y as w,zb as g}from"./chunk-E2O4YZX2.js";import"./chunk-OB6WEE2V.js";import"./chunk-OUKOEUZA.js";import{b as o}from"./chunk-WS6TGUH7.js";import{a as u}from"./chunk-3UIUI5Q2.js";import{G as s,H as p,M as f}from"./chunk-4AO24KKT.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function L(e){D(e),await e.runVerb();let t=await e.getOption(o.Collection.name),i=await e.getOption(o.Property.name,!0),r=await e.getOption(o.Type.name,!0),n=await C(e);if(i===void 0){if(r!==void 0||Object.values(n).some(a=>a!==void 0))throw new w("Property options require --property.");await $(e,t);return}r??=await e.getOption(o.Type.name),await b(e,t,i,r,n)}async function $(e,t){let{schemaPath:i}=await m(async()=>{let n=await d(),a=await g({...n.actionOptions,tableName:t,initialLocale:r()});return await n.commitConfigAsync(),a});if(e.isJsonMode()){p({schemaPath:i,collection:t,created:!0});return}function r(){let n=Intl.DateTimeFormat().resolvedOptions().locale;return/^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$/.test(n)?n:"en-US"}s(`Collection '${t}' added to ${i}`),f(`Run "${"ms"} project state add --collection ${t} --property <name> --type <type>" to define a property.`)}async function b(e,t,i,r,n){let a=O(()=>A(r)),{schemaPath:l}=await m(async()=>{let y=await d(),I=await h({...y.actionOptions,...n,tableName:t,columnName:i,type:a});return await y.commitConfigAsync(),I});if(e.isJsonMode()){p({schemaPath:l,collection:t,property:i,type:a,created:!0});return}s(`Property '${i}' (${a}) added to collection '${t}' in ${l}`)}function D(e){let t=u.project.state.add;e.setDescription(t.description),e.addExamples(t.examples),e.addOptions([c({flags:{key:o.Collection.name},message:o.Collection.promptMessage,description:t.options.collection}),{flags:{key:o.Property.name},description:t.options.property,optionalInNonInteractive:!0},c({flags:{key:o.Type.name},message:o.Type.promptMessage,description:t.options.type,optionalInNonInteractive:!0}),...S(t.options)])}export{L as dataAddAsync};
|
|
8
|
+
/*!
|
|
9
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
+
*/
|
|
11
|
+
//# sourceMappingURL=Add-75RSJNM4.js.map
|
|
@@ -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 P}from"./chunk-4UHMKZLH.js";import{a as y,b as f,c as W,d as s,e as w,f as B,g}from"./chunk-JWSX7DVU.js";import{A as o,Na as I,Ob as N,y as v}from"./chunk-E2O4YZX2.js";import"./chunk-OB6WEE2V.js";import"./chunk-OUKOEUZA.js";import{f as u}from"./chunk-WS6TGUH7.js";import{a as c}from"./chunk-3UIUI5Q2.js";import{G as m,H as l,O as T,c as C,l as D}from"./chunk-4AO24KKT.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";import*as d from"node:fs";import*as p from"node:fs/promises";import*as F from"node:path";async function oe(e){H(e),await e.runVerb();let t=await e.getOption(u.Target.name),n=y();if(!t?.trim()){await J(e,n);return}let i=w(t),r=g(n,i);await L(n.appRoot,r);let a=await x(e,n,i);if(e.isJsonMode()){l({...a});return}_(a)}async function J(e,t){for(let r of s)await L(t.appRoot,g(t,r));let n=new Map;for(let r of s)r!==f&&n.set(r,await R(e,t,r));let i=[];for(let r of s)i.push(await x(e,t,r,n.get(r)));if(e.isJsonMode()){l({targets:i});return}for(let r of i)_(r)}async function R(e,t,n){let i=await G(e,t.config),r=i.projectId?.trim();if(!r)throw new o(`App '${i.displayName}' is not associated with a managed project, so a target cannot be configured.`);return e.updateEnvironmentId(i.environmentId),P(r,n)}async function x(e,t,n,i){let r=g(t,n);if(n===f){let U=`Target '${n}' is already provisioned.`,h=await M(r);return{target:n,targetCreated:!1,configCreated:h.created,configPath:r,...$(b(U,r,h.error))}}let{projectId:a,deploymentCreated:A}=i??await R(e,t,n),E=await M(r),j=A?`Registered target '${n}' with app '${a}'.`:`Target '${n}' is already registered with app '${a}'.`;return{target:n,projectId:a,targetCreated:A,configCreated:E.created,configPath:r,...$(b(j,r,E.error))}}function _(e){if(e.warning){T(e.warning);return}e.projectId&&m(e.targetCreated?`Registered target '${e.target}' with app '${e.projectId}'.`:`Target '${e.target}' is already registered with app '${e.projectId}'.`),m(`Created target config '${e.configPath}'.`)}function $(e){return e?{warning:e}:{}}var Y=/^default-/i;function O(e,t,n=!1){if(e==null)return;if(typeof e!="string")throw new o(`The base app config field '${t}' must be a string, but is of type ${typeof e}.`);let i=e.trim();if(!i)return;let r=n?i.replace(Y,""):i;if(!D(r))throw new o(`The base app config field '${t}' must be a GUID, but is '${i}'.`);return i}async function G(e,t){let n=O(t.appId,"appId");if(!n)throw new o("The base app config does not contain an appId.");let i=O(t.environmentId,"environmentId",!0),r=await e.getTenantIdAsync();if(!r)throw new v("Unable to determine tenant ID. Ensure you are logged in.");return I({tenantId:r,environmentId:i,logger:N(),actionsParams:{appName:n}})}function S(e){return new o(`${F.basename(e)} already exists. Edit it directly, or delete it and rerun to recreate it.`)}async function L(e,t){if(d.existsSync(t))throw S(t);try{await p.access(e,d.constants.W_OK)}catch(n){throw new o(`App directory '${e}' is not writable.`,{underlyingError:n})}}async function k(e,t){await p.writeFile(e,t,{encoding:"utf8",flag:"wx"})}async function X(e){await k(e,`${JSON.stringify({$schema:C},null,2)}
|
|
8
|
+
`)}async function M(e){try{return await X(e),{created:!0}}catch(t){if(V(t))throw S(e);return{created:!1,error:t instanceof Error?t.message:String(t)}}}function V(e){return typeof e=="object"&&e!==null&&e.code==="EEXIST"}function b(e,t,n){if(n!==void 0)return`${e} The target config '${t}' could not be created. Fix the filesystem error and rerun the command; the existing target will be reused. Reason: ${n}`}function H(e){e.setDescription(c.app.add.config.description),e.addExamples(c.app.add.config.examples),e.addOptions([{flags:{key:u.Target.name},description:c.app.add.config.options.target,optionalInNonInteractive:!0}])}export{f as DEFAULT_DEPLOYMENT_NAME,s as DEFAULT_DEPLOYMENT_NAMES,W as TEST_DEPLOYMENT_NAME,oe as addConfigAsync,B as assertOverlayNameNotReserved,y as resolveBaseConfig,O as validateConfigGuid,w as validateDeploymentName};
|
|
9
|
+
/*!
|
|
10
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
11
|
+
*/
|
|
12
|
+
//# sourceMappingURL=AddConfig-4SAYYOBQ.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
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 be,b as Ce,c as Q,d as W,e as X,f as L}from"./chunk-DOCWK326.js";import{a as Y,c as K}from"./chunk-EFTF4FA7.js";import{a as pe,b as J,d as V,e as me,f as fe,h as ue,i as ge,k as ve}from"./chunk-5BE4TLDK.js";import{Ba as ce,Ca as de,L as G,Ob as O,Pb as F,Qb as le,aa as se,ba as ie,k as oe,ta as j,ua as re,w as ae,y as u}from"./chunk-E2O4YZX2.js";import"./chunk-OB6WEE2V.js";import"./chunk-OUKOEUZA.js";import{c as C,d as p}from"./chunk-WS6TGUH7.js";import{a as l}from"./chunk-3UIUI5Q2.js";import{E as _,G as P,H as q,M as U,O as te,P as ne}from"./chunk-4AO24KKT.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";var we=["shared_commondataserviceforapps","commondataserviceforapps"];function H(e){let o=e.toLowerCase();return we.some(s=>o===s||o.endsWith(`/${s}`))}function Z(e){e.length!==0&&te(`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:o,methodName:s})=>` \u2022 ${o} (generates ${s}())`).join(`
|
|
10
|
+
`))}async function Ae(e){let{argumentProvider:o,connector:s,apiId:a,connectionIdFlag:v,datasetFlag:A,tableFlags:S=[],skipCodegen:D,useV1Codegen:I,useSso:N}=e,h=F(),{fileConfig:f,cliFs:g}=h,y=G(),x=o.getAuthenticationProvider(),E=O(),R={appConfigPath:f.appConfigPath,schemaPath:f.schemaPath,codeGenPath:f.codeGenPath},T={vfs:g,authProvider:x,httpClient:o.getHttpClient(),region:y.region,environmentName:y.environmentName,localFilePaths:R,logger:E},c=s.properties.displayName??a,d=v,b=!1,$={};if(!d){let t=await Q({argumentProvider:o,apiId:a,connector:s,useSso:N,beforeConnectionTest:async r=>{$.connectionId=r.name,await L({apiId:a,connectionId:r.name,impact:X})}});d=t.connectionId,b=t.autoSelected}let M={autoSelected:b,connectionId:d,connectorLabel:c};d!==$.connectionId&&await L({apiId:a,connectionId:d});let m=A;if(m&&V(m,"Dataset"),!m){let t={...T,actionsParams:{apiId:a,connectionId:d}},{value:r}=await W(()=>ce(t),M);if(!h.interactive)throw _({title:`Available datasets for ${c}`,columns:[{header:"Display Name",maxWidth:40},{header:"Dataset Name"}],rows:r.map(i=>[i.DisplayName||i.Name,i.Name]),emptyMessage:"No datasets found for this connection.",totalLabel:"dataset(s) found"}),new u("Re-run with --dataset <name> or -d <name>.");let k=await ue({message:"Select a dataset:",options:r.map(i=>({value:i.Name,label:i.DisplayName||i.Name,hint:i.Name})),manualPromptMessage:"Enter dataset name:"});m=k.value,k.source==="manual"&&V(m,"Dataset")}let w=S;for(let t of w)V(t,"Table name");if(w.length===0){let t={...T,actionsParams:{apiId:a,connectionId:d,dataset:m}},{value:r}=await W(()=>de(t),M);if(!h.interactive)throw _({title:`Available tables in dataset '${m}'`,columns:[{header:"Display Name",maxWidth:40},{header:"Table Name"}],rows:r.map(i=>[i.DisplayName||i.Name,i.Name]),emptyMessage:"No tables found in this dataset.",totalLabel:"table(s) found"}),new u("Re-run with --table <name> or -t <name>.");let k=await fe({message:"Select one or more tables:",options:r.map(i=>({value:i.Name,label:i.DisplayName||i.Name,hint:i.Name})),manualPromptMessage:"Enter table name:"});for(let i of k)i.source==="manual"&&V(i.value,"Table name");w=k.map(({value:i})=>i)}let B={...T,actionsParams:{apiId:a,connectionId:d,dataset:m,tableNames:w,skipCodegen:D,useV1Codegen:I}},n=await W(()=>re(B),M);if(o.isJsonMode())q({connector:a,dataset:m,succeeded:n.succeeded.map(({tableName:t,dataSourceName:r})=>({table:t,dataSource:r})),failed:n.failed.map(({tableName:t,error:r})=>({table:t,error:r}))});else{if(n.succeeded.length===1){let[t]=n.succeeded;P(`Data source '${t.dataSourceName}' added successfully (table '${t.tableName}' from connector '${c}').`)}else n.succeeded.length>1&&(P(`Added ${n.succeeded.length} data sources from connector '${c}' and dataset '${m}'.`),_({title:"Added tables",columns:[{header:"Table"},{header:"Data Source"}],rows:n.succeeded.map(({tableName:t,dataSourceName:r})=>[t,r]),totalLabel:"table(s) added"}));for(let t of n.failed)ne(`Failed to add table '${t.tableName}': ${t.error}`)}if(n.failed.length>0){let t={failedCount:n.failed.length,succeededCount:n.succeeded.length,failures:n.failed.map(({tableName:r})=>({tableName:r,errorCode:"DataSourceTableAddFailed",errorCategory:"configuration"}))};throw new le(`${n.failed.length} table(s) could not be added; ${n.succeeded.length} succeeded.`,t,{errorCode:"DataSourceTableAddFailed",errorCategory:ae.Configuration,telemetryDetails:{failedCount:n.failed.length,succeededCount:n.succeeded.length,failures:n.failed.map(()=>({errorCode:"DataSourceTableAddFailed",errorCategory:"configuration"}))}})}o.isJsonMode()||U(`Hint: Run '${"ms"} app dev' to test locally, or '${"ms"} app deploy' to deploy.`)}async function ee(e){let{argumentProvider:o,connector:s,apiId:a,connectionIdFlag:v,skipCodegen:A,useV1Codegen:S,useSso:D,policy:I,dataverseEnvironmentId:N,dataverseTable:h,forceTableBinding:f}=e,g=F(),{fileConfig:y,cliFs:x}=g,E=G(),R=o.getAuthenticationProvider(),T=O(),c=o.isJsonMode(),d=(s.properties.connectionParameterSets?.values?.length??0)>1,b=v,$={};d&&!b&&(b=(await Q({argumentProvider:o,apiId:a,connector:s,useSso:D,interactive:c?!1:g.interactive,quiet:c,nonInteractiveReason:c?"json-mode":"cli-mode",beforeConnectionTest:async r=>{$.connectionId=r.name,await L({apiId:a,connectionId:r.name,impact:X})}})).connectionId),d&&b&&b!==$.connectionId&&await L({apiId:a,connectionId:b});let M=I?ie(I,s.name??a):void 0,m=H(a),w=await Ie({isCommonDataServiceForApps:m,isJsonMode:c,forceTableBinding:!!f,dataverseEnvironmentId:N,dataverseTable:h}),B=t=>({vfs:x,authProvider:R,httpClient:o.getHttpClient(),region:E.region,environmentName:E.environmentName,actionsParams:{apiId:a,connectionId:b,skipCodegen:A,useV1Codegen:S,actionPolicy:M,...t},localFilePaths:{appConfigPath:y.appConfigPath,schemaPath:y.schemaPath,codeGenPath:y.codeGenPath},logger:T}),n;try{n=await j(B(w))}catch(t){throw t instanceof se?K(t.message,Y.ConnectorActionsPolicyBlocked,"connector_action_filter"):t instanceof oe?K(t.message,Y.ConnectorHasNoPublicActions,"connector_capability"):t}if(c){Z(n.skippedDataverseMethods),q({connector:a,dataSource:n.dataSourceName,policyFilteredActionCount:n.filteredCount,totalActionCount:n.totalCount});return}if(n.filteredCount>0&&U(`Skipped ${n.filteredCount} of ${n.totalCount} actions due to your organization's connector policy.`),Z(n.skippedDataverseMethods),P(`Data source '${n.dataSourceName}' added successfully (connector '${s.properties.displayName??a}').`),w?.dataverseTable&&P(`Dataverse table '${w.dataverseTable}' bound successfully.`),m&&g.interactive&&!w&&await J({message:"Connect this to a specific Dataverse table?",initialValue:!0})){let r=await j(B(await he({})));P("Dataverse table binding added successfully."),Z(r.skippedDataverseMethods)}U(`Hint: Run '${"ms"} app dev' to test locally, or '${"ms"} app deploy' to deploy.`)}async function Ie(e){if(!e.isCommonDataServiceForApps)return;let o=F(),s=!!e.dataverseTable;if(!o.interactive||e.isJsonMode)return s?{dataverseEnvironmentId:e.dataverseEnvironmentId,dataverseTable:e.dataverseTable}:void 0;if(!(!s&&!e.forceTableBinding))return he({dataverseEnvironmentId:e.dataverseEnvironmentId,dataverseTable:e.dataverseTable})}async function he(e){let o=e.dataverseTable??await pe({message:"Dataverse table logical name:"});return{dataverseEnvironmentId:e.dataverseEnvironmentId,dataverseTable:o}}function ye(e){return e.properties.capabilities?.some(o=>o.toLowerCase()==="tabular")??!1}async function qe(e){Se(e),await e.runVerb(),ve();let o=await e.getOption("connector"),s=await e.getOption("connectionId",!0),a=await e.getOption("dataset",!0),v=De(await e.getOption("table",!0)),A=await e.getOption("as",!0),S=await e.getOption("dataverseEnvironmentId",!0),D=!!await e.getOption("skipCodegen",!0),I=!!await e.getOption("useV1Codegen",!0),N=!!await e.getOption("useSso",!0),h;if(A!==void 0&&A!==""){let c=A.toLowerCase();if(c!=="table"&&c!=="action")throw new u(`Invalid value for --as: '${A}'. Expected 'table' or 'action'.`);h=c}let f=await be(o,O(),{jsonMode:e.isJsonMode()}),{connector:g,policy:y}=await Ce(e,f),x=g.properties.displayName??f,E=ye(g);if(H(f)){if(v.length>1)throw new u("Adding multiple Dataverse tables in one invocation is not supported yet. Re-run once per Dataverse table.");let c=v[0];if(a)throw new u("--dataset is not used with the Common Data Service for Apps connector. Use --table to specify a Dataverse logical name.");let d=h==="table";if((!F().interactive||e.isJsonMode())&&(d||S)&&!c)throw new u("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 ee({argumentProvider:e,connector:g,apiId:f,connectionIdFlag:s,skipCodegen:D,useV1Codegen:I,useSso:N,policy:y,dataverseEnvironmentId:S,dataverseTable:c,forceTableBinding:d});return}if(S)throw new u("--dataverse-environment-id can only be used with the Common Data Service for Apps connector (--connector shared_commondataserviceforapps or --connector commondataserviceforapps).");let T=await Te({isTabular:E,asFlag:h,connectorLabel:x});if(T==="action"&&(a||v.length>0))throw new u("--dataset and --table cannot be used with --as action. Re-run with --as table, or omit those flags.");T==="table"?await Ae({argumentProvider:e,connector:g,apiId:f,connectionIdFlag:s,datasetFlag:a,tableFlags:v,skipCodegen:D,useV1Codegen:I,useSso:N}):await ee({argumentProvider:e,connector:g,apiId:f,connectionIdFlag:s,skipCodegen:D,useV1Codegen:I,useSso:N,policy:y})}async function Te(e){let{isTabular:o,asFlag:s,connectorLabel:a}=e,v=F();if(!o){if(s==="table")throw new u(`Connector '${a}' does not support tabular data sources. Re-run without --as table, or with --as action.`);return"action"}if(s)return s;if(!v.interactive)throw new u(`Connector '${a}' supports both tables and actions. Specify --as table or --as action.`);return await J({message:`Connector '${a}' supports tables. Add a table? (No \u2192 add actions instead)`,initialValue:!0})?"table":"action"}function Se(e){e.getResolvedCommand()?.path.at(-1)==="connector"?(e.setDescription(`${l.app.add.connector.deprecation}
|
|
11
|
+
|
|
12
|
+
${l.app.add.connector.description}`),e.addExamples(l.app.add.connector.deprecatedExamples)):(e.setDescription(l.app.add.connector.description),e.addExamples(l.app.add.connector.examples)),e.addOptions([ge({flags:{key:C.Connector.name},env:C.Connector.envVar,message:C.Connector.promptMessage,description:l.app.add.connector.options.connector}),{flags:{key:C.ConnectionId.name,alias:C.ConnectionId.alias},env:C.ConnectionId.envVar,description:l.app.add.connector.options.connectionId,optionalInNonInteractive:!0},{flags:{key:C.Dataset.name,alias:C.Dataset.alias},env:C.Dataset.envVar,description:l.app.add.connector.options.dataset,optionalInNonInteractive:!0},{flags:{key:p.Table.name,alias:p.Table.alias},env:p.Table.envVar,description:l.app.add.connector.options.table,parseArg:me,optionalInNonInteractive:!0},{flags:{key:p.As.name},env:p.As.envVar,description:l.app.add.connector.options.as,optionalInNonInteractive:!0},{flags:{key:p.DataverseEnvironmentId.name},env:p.DataverseEnvironmentId.envVar,description:l.app.add.connector.options.dataverseEnvironmentId,optionalInNonInteractive:!0}]),e.addSwitch({flags:{key:p.SkipCodegen.name},env:p.SkipCodegen.env,description:l.app.add.connector.options.skipCodegen}),e.addSwitch({flags:{key:p.UseSso.name},env:p.UseSso.env,description:l.app.add.connector.options.useSso}),e.addSwitch({flags:{key:p.UseV1Codegen.name},env:p.UseV1Codegen.env,description:"Use V1 (legacy) code generation instead of V2.",hidden:!0})}function De(e){return e===void 0?[]:Array.isArray(e)?e:[e]}export{qe as addConnectorAsync};
|
|
13
|
+
/*!
|
|
14
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
15
|
+
*/
|
|
16
|
+
//# sourceMappingURL=AddConnector-P4R4NJ5P.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __pathDirname } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{a as g}from"./chunk-YYXAAA2U.js";import"./chunk-BREK3DVB.js";import{a as j}from"./chunk-4UHMKZLH.js";import{b as l,e as y}from"./chunk-JWSX7DVU.js";import"./chunk-MWN7R4VR.js";import"./chunk-5BE4TLDK.js";import{A as c,Pb as f}from"./chunk-E2O4YZX2.js";import"./chunk-IM7SC23O.js";import"./chunk-B6REHI77.js";import"./chunk-C7V6WEZM.js";import"./chunk-OB6WEE2V.js";import"./chunk-OUKOEUZA.js";import{h as i}from"./chunk-WS6TGUH7.js";import{a as r}from"./chunk-3UIUI5Q2.js";import{G as d,H as a,M as s}from"./chunk-4AO24KKT.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function O(e){I(e),await e.runVerb();let n=f();if(n.projectConfigError)throw new c(`Unable to read ${n.fileConfig.projectConfigPath}. ${n.projectConfigError.message}`);let A=await e.getOption(i.Name.name),t=y(A,"--name"),p=await g(e);e.updateEnvironmentId(p.environmentId);let o=t===l?{projectId:p.projectId,deploymentCreated:!1}:await j(p.projectId,t),m=`${"ms"} app add config --target ${t}`;if(e.isJsonMode()){a({projectId:o.projectId,deploymentName:t,deploymentCreated:o.deploymentCreated,nextCommand:m});return}d(o.deploymentCreated?`Added deployment '${t}' to project '${o.projectId}'.`:`Deployment '${t}' already exists in project '${o.projectId}'.`),s(`Run '${m}' from an app in this project to create its override configuration.`)}function I(e){e.setDescription(r.project.add.deployment.description),e.addExamples(r.project.add.deployment.examples),e.addOptions([{flags:{key:i.Name.name},description:r.project.add.deployment.options.name}])}export{O as addDeploymentAsync};
|
|
8
|
+
/*!
|
|
9
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
+
*/
|
|
11
|
+
//# sourceMappingURL=AddDeployment-TBA3AAGD.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
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{f as $e}from"./chunk-DOCWK326.js";import{a as ve,d as ye,e as Se,g as Ce}from"./chunk-JWSX7DVU.js";import"./chunk-EFTF4FA7.js";import{a as V,d as A,e as be,g as J}from"./chunk-5BE4TLDK.js";import{L as fe,Ob as $,Pb as P,S as ge,T as ue,U as me,_ as pe,l as le,va as he,y as a,ya as we}from"./chunk-E2O4YZX2.js";import"./chunk-OB6WEE2V.js";import"./chunk-OUKOEUZA.js";import{c as p,d as R,e as E}from"./chunk-WS6TGUH7.js";import{a as ie}from"./chunk-3UIUI5Q2.js";import{A as ae,E as oe,G as re,H as se,M as ce,O as de,x as F,y as L,z as ne}from"./chunk-4AO24KKT.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";import*as Ie from"node:path";var Ae=200,xe=/^[A-Za-z0-9_$-]+$/;async function ct(e){let t=ie.app.override.dataSource;if(e.setDescription(t.description),e.addExamples(t.examples),e.consumePositionalArg(E.Name),e.addOptions([{flags:{key:E.Target.name},description:t.options.target},{flags:{key:p.ConnectionId.name,alias:p.ConnectionId.alias},env:p.ConnectionId.envVar,description:t.options.connectionId},{flags:{key:p.Dataset.name,alias:p.Dataset.alias},env:p.Dataset.envVar,description:t.options.dataset},{flags:{key:R.Table.name,alias:R.Table.alias},env:R.Table.envVar,description:t.options.table,parseArg:be,optionalInNonInteractive:!0}]),await e.runVerb(),!c(e.getPositionalArg(0)))throw new a(`Data source name is required. Run '${"ms"} app override data-source <name> --target <target>'.`);let n=await e.getOption(E.Target.name,!0);if(!c(n)){if(!P().interactive||e.isJsonMode())throw new a("--target is required. Specify --target prod or --target test.");n=await J({message:"Select a deployment target:",options:ye.map(o=>({value:o,label:o})),manualPromptMessage:"Enter deployment target:"})}await Be(e,n)}async function Be(e,t){let n=Se(t,"--target"),o=ve(),s=Ce(o,n),f=Ie.basename(s),S=P(),D=e.isJsonMode(),_=S.interactive&&!D,x=we(o.config).all.filter(i=>i.kind==="table"&&!i.sqlStoredProcedure),r=je({argumentProvider:e,target:n,eligibleDataSources:x,isJsonMode:D}),g=x.find(i=>i.name===r);if(!g)throw D||Ne(x),new a(`Data source '${r}' not found in the base app config. Run '${"ms"} app add data-source' to add it first.`);if(!await S.cliFs.exists(s))throw new a(`Target '${n}' has no config file ('${f}'). Run '${"ms"} app add config --target ${n}' first, then re-run this command.`);let U=await qe(s,f),I=F(o.config),H=F(U);ke(I,H,f);let W=Object.entries(I.connectionReferences??{}).find(([,i])=>i.dataSources?.includes(r));if(!W)throw new a(`Data source '${r}' is not associated with a connection reference in the base app config.`);let[G,Oe]=W,N=c(Oe.sharedConnectionId),Te=ne(I,H).connectionReferences?.[G],Fe=await e.getOption("connectionId",!0),d=await e.getOption("dataset",!0),z=He(await e.getOption("table",!0));if(z.length>1)throw new a("--table can be specified only once with --target because one logical data source is being rebound.");let l=z[0];if(d&&A(d,"Dataset"),l!==void 0&&(A(l,"Table name"),!l.trim()))throw new a("Table names cannot be empty.");let X=g.dataverseTable===void 0,C=y(Fe);if(!_){if(C===void 0)throw new a("--connection-id is required. Provide an existing connection ID.");if(X&&!c(d))throw new a("--dataset is required for this data source. Provide a dataset name or site URL.")}let Y,Z=async()=>(Y??=await ge(g.connectorId,$()),Y);if(C===void 0){let i=await Z(),te=(await me(g.connectorId,$())??[]).filter(b=>!N||De(b,i));if(te.length===0)throw new a(`No compatible existing connections were found for '${r}'. Create a connection first, then re-run with --connection-id <id>.`);if(C=y(await J({message:"Select an existing connection:",options:te.map(b=>({value:b.name,label:b.properties.displayName||b.name,hint:b.name})),manualPromptMessage:"Enter existing connection ID:"})),C===void 0)throw new a("--connection-id is required. Provide an existing connection ID.")}let u=Ve(C);Je(u,"connectionId");let B;try{B=await ue(u,g.connectorId,$())}catch(i){throw i instanceof le&&i.status===404?new a(`Connection '${u}' was not found for connector '${g.connectorId}'.`):i}if(!B)throw new a(`Connection '${u}' was not found for connector '${g.connectorId}'.`);if(N&&!De(B,await Z()))throw new a(Me(r,u));if(_){if(X&&!c(d)){if(d=await V({message:"Dataset name or site URL for this target:"}),!c(d))throw new a("--dataset is required for this data source. Provide a dataset name or site URL.");A(d,"Dataset")}l??=await Ge("Table for this target (required when changing the dataset; otherwise leave blank to keep the current value for this target):"),l!==void 0&&A(l,"Table name")}We({target:n,datasetFlag:d,tableFlag:l,persistsSharedConnection:N});let M=Le(Te,r),j=y(d),K=y(l);if(j!==void 0&&j!==M.dataset&&K===void 0)throw new a(`Changing the dataset for '${r}' requires --table because table identifiers are dataset-specific.`);let h=j??M.dataset,m=K??M.tableName;if(!h||!m?.trim()){let i=[h?void 0:"--dataset",m?.trim()?void 0:"--table"].filter(w=>w!==void 0).join(" and ");throw new a(`The effective binding for '${r}' is missing ${i}. Provide the missing value and re-run the command.`)}for(let[i,w]of[["--dataset",d??h],["--table",l??m],["--dataset",h],["--table",m]])if(/[\p{Cc}\p{Cs}]/u.test(w))throw new a(`${i} must not contain control characters or malformed Unicode.`);let Re=await $e({apiId:g.connectorId,connectionId:u,impact:"The target binding was saved, but later calls",defer:!0}),Q=fe(),O=await he({vfs:S.cliFs,authProvider:e.getAuthenticationProvider(),httpClient:e.getHttpClient(),region:Q.region,environmentName:Q.environmentName,actionsParams:{apiId:g.connectorId,connectionId:u,dataset:h,tableName:m,dataSourceName:r},localFilePaths:S.fileConfig,logger:$()});if(O.drift.length>0)throw new a(`Table '${m}' for target '${n}' does not match the base schema for '${r}'.
|
|
8
|
+
${O.drift.map(i=>` - ${i}`).join(`
|
|
9
|
+
`)}`);let Ee=O.baseSchemaMissing?`Schema parity could not be evaluated for '${r}' because its base schema file is missing.`:void 0,q=_e(U),Pe=q.connectionReferences??={},T=Pe[G]??={};if(N?T.sharedConnectionId=u:delete T.sharedConnectionId,c(d)||c(l)){Ue(T,r);let i=T.dataSets??={},w=i[h]??={dataSources:{}};w.dataSources[r]={tableName:O.tableName??m}}let ee=L(I,F(q));if(!ee.valid)throw new a(`The updated target config '${f}' is invalid:
|
|
10
|
+
${ee.errors.join(`
|
|
11
|
+
`)}`);await S.cliFs.writeFile(s,`${JSON.stringify(q,null,2)}
|
|
12
|
+
`);let k=[Ee,Re].filter(i=>i!==void 0);if(D){se({target:n,dataSource:r,path:s,...k.length===0?{}:{warnings:k}});return}re(`Data source '${r}' bound for target '${n}' in '${f}'.`);for(let i of k)de(i);ce(`Hint: Run '${"ms"} app dev' to test locally, or '${"ms"} app deploy' to deploy.`)}function De(e,t){let n=t.properties.connectionParameterSets?.values,o=y(e.properties.connectionParametersSet?.name),s=n?.find(f=>f.name.toLowerCase()===o?.toLowerCase())?.name??o??(n?.length===1?n[0].name:void 0);return pe(t,s)}function Me(e,t){return`${t?`Connection '${t}' is not compatible`:"No existing connection is compatible"} with data source '${e}'. Connections for this binding must support connection sharing.`}function je(e){let t=y(e.argumentProvider.getPositionalArg(0));if(c(t))return t;throw e.isJsonMode||Ne(e.eligibleDataSources),new a(`Data source name is required. Re-run with '${"ms"} app override data-source <name> --target ${e.target}'.`)}function Ne(e){oe({title:"Available tabular data sources",columns:[{header:"Data Source"},{header:"Connector",maxWidth:30}],rows:e.map(t=>[t.name,t.connectorDisplayName]),emptyMessage:"No tabular data sources found in the base app config.",totalLabel:"data source(s) found"})}async function qe(e,t){let n;try{n=ae(await P().cliFs.readFile(e,"utf-8"))}catch(o){throw o instanceof Error&&o.message==="file is not valid JSON"?new a(`Target config '${t}' is not valid JSON.`):o}if(!ze(n))throw new a(`Target config '${t}' must contain a JSON object.`);if("$schema"in n&&n.$schema!==void 0&&typeof n.$schema!="string")throw new a(`Target config '${t}' has a non-string $schema value.`);return n}function ke(e,t,n){let o=L(e,t);if(!o.valid)throw new a(`Target config '${n}' is invalid:
|
|
13
|
+
${o.errors.join(`
|
|
14
|
+
`)}`)}function Le(e,t){for(let[n,o]of Object.entries(e?.dataSets??{})){let s=o.dataSources[t];if(s)return{dataset:n,tableName:s.tableName}}return{}}function Ve(e){return e.split("/").filter(Boolean).at(-1)??e}function Je(e,t){if(e.length===0||e.length>Ae||!xe.test(e))throw new a(`${t} must be 1-${Ae} characters using only letters, numbers, underscores, hyphens, or dollar signs.`)}function _e(e){let{$schema:t,...n}=e;return{...t===void 0?{}:{$schema:t},...structuredClone(n)}}function Ue(e,t){for(let[n,o]of Object.entries(e.dataSets??{}))delete o.dataSources[t],Object.keys(o.dataSources).length===0&&delete e.dataSets?.[n]}function He(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function We(e){let{target:t,datasetFlag:n,tableFlag:o,persistsSharedConnection:s}=e;if(s||[n,o].some(c))return;let f=s?"--connection-id, --dataset, or --table":"--dataset or --table";throw new a(`Nothing to bind for target '${t}'. Provide at least one of ${f}.`)}async function Ge(e){let t=await V({message:e});return c(t)?t:void 0}function y(e){return c(e)?e.trim():void 0}function c(e){return typeof e=="string"&&e.trim().length>0}function ze(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}export{ct as overrideDataSourceAsync,Be as runAddDeploymentBindingFlowAsync};
|
|
15
|
+
/*!
|
|
16
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
17
|
+
*/
|
|
18
|
+
//# sourceMappingURL=AddDeploymentBinding-6FZ7Y5JM.js.map
|
|
@@ -0,0 +1,38 @@
|
|
|
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-JWSX7DVU.js";import{a as te}from"./chunk-TYRVM4PP.js";import{b as K}from"./chunk-EFTF4FA7.js";import{A as y,B as M,F as Y,Ob as w,ga as L,l as j,y as J,z as N}from"./chunk-E2O4YZX2.js";import"./chunk-OB6WEE2V.js";import"./chunk-OUKOEUZA.js";import{g as p}from"./chunk-WS6TGUH7.js";import{a as E}from"./chunk-3UIUI5Q2.js";import{G as $,H as T,O as h}from"./chunk-4AO24KKT.js";import"./chunk-Y5AMO72S.js";import{d as ne}from"./chunk-UT667QSU.js";import{randomBytes as ae}from"node:crypto";import*as m from"node:fs";import*as o from"node:fs/promises";import*as r from"node:path";var R=ne(te(),1);var A="rayfin",X="rayfin",re="rayfin.yml",ie="tsconfig.json",oe="package.json",se="data",ce=".rayfin-scaffold.lock",de="@microsoft/rayfin-client",S="1.37.0-alpha.2148",_="@microsoft/rayfin-core",b=S,le="@types/node",fe="^24.0.0",pe="@microsoft/rayfin-auth-provider-fabric",ue=S;function ye(e,t){return`# Rayfin backend configuration for this Managed App.
|
|
8
|
+
#
|
|
9
|
+
# This file was scaffolded by \`ms app add backend --provider rayfin\`. Its full schema is still
|
|
10
|
+
# being defined with the Rayfin team; this is a minimal, valid starting point (data service
|
|
11
|
+
# only). Declaring data entities under 'rayfin/data/' is what tells the CLI and host this app
|
|
12
|
+
# has a Rayfin backend.
|
|
13
|
+
id: ${V(e)}
|
|
14
|
+
name: ${V(t)}
|
|
15
|
+
version: 1.0.0
|
|
16
|
+
services:
|
|
17
|
+
auth:
|
|
18
|
+
enabled: true
|
|
19
|
+
fabric:
|
|
20
|
+
enabled: true
|
|
21
|
+
externalEntraExchange: true
|
|
22
|
+
data:
|
|
23
|
+
enabled: true
|
|
24
|
+
dialect: mssql
|
|
25
|
+
staticHosting:
|
|
26
|
+
enabled: false
|
|
27
|
+
folder: dist
|
|
28
|
+
indexDocument: index.html
|
|
29
|
+
assetAccess: protected
|
|
30
|
+
`}function V(e){let t="";for(let n of e){let a=n.codePointAt(0);switch(n){case"\\":t+="\\\\";break;case'"':t+='\\"';break;case`
|
|
31
|
+
`:t+="\\n";break;case"\r":t+="\\r";break;case" ":t+="\\t";break;default:a<32||a===127||a>=128&&a<=159&&a!==133?t+=`\\x${a.toString(16).padStart(2,"0")}`:a>=55296&&a<=57343||a===65534||a===65535?t+=`\\u${a.toString(16).padStart(4,"0")}`:t+=n}}return`"${t}"`}var me=`${JSON.stringify({compilerOptions:{target:"ES2022",lib:["ES2022","DOM","ESNext.Decorators"],types:["node"],outDir:".temp/compiled",rootDir:".",declaration:!0,composite:!0,noEmit:!1,module:"nodenext",moduleResolution:"nodenext"},include:["**/*"],exclude:[".temp/**/*"]},null,2)}
|
|
32
|
+
`,ge=`${JSON.stringify({type:"module"},null,2)}
|
|
33
|
+
`;async function G(e,t){try{return await o.mkdir(e),!0}catch(n){if(n.code==="EEXIST"){if(!(await o.lstat(e)).isDirectory())throw new y(`'${r.relative(t,e)}' already exists and is not a directory (it may be a file, symlink, or junction). Remove or rename it before running this command again.`);return!1}throw n}}async function he(e,t){try{await(await o.open(e,"wx")).close()}catch(n){throw n.code==="EEXIST"?new y(`Another 'ms app add backend --provider rayfin' run appears to already be in progress for this app ('${r.relative(t,e)}' exists). Wait for it to finish, or remove the lock file and retry if a previous run was interrupted before it could clean up.`):n}}async function Ee(e,t){try{await o.rm(e,{force:!0})}catch(n){w().trackErrorEvent("Rayfin.Add.LockReleaseFailed",k(n)),t||h(`Could not remove the scaffold lock file '${r.basename(e)}'. Remove it manually, or future 'ms app add backend --provider rayfin' runs for this app will fail with an "already in progress" error.`)}}function we(e){let t=e.toLowerCase().replace(/[^a-z0-9]+/g,"");return t.length>0?t:"app"}async function je(e){Ie(e),await e.runVerb();let t=await e.getOption(p.Provider.name);if(t!==A){let f=`--${p.Provider.name}`;throw new J(t===void 0?`Missing required option ${f}. Only '${A}' is currently supported, e.g. 'ms app add backend ${f} ${A}'.`:`Unsupported ${f} value '${t}'. Only '${A}' is currently supported.`)}let n=W(),a=r.join(n.appRoot,X),i=r.join(a,re),d=r.join(a,ie),s=r.join(a,oe),u=r.join(a,se);if(m.existsSync(i))throw new y(`${r.relative(n.appRoot,i)} already exists. This app already has a Rayfin backend scaffold.`);let g=m.existsSync(s);if(g&&!H(s))throw new y(`${r.relative(n.appRoot,s)} must set "type": "module" for Rayfin schema output.`);let c=!g&&!H(r.join(n.appRoot,"package.json")),l=e.getEnvironmentId()??n.config.environmentId;if(!l)throw new y("An environment is required to check backend availability. Set environmentId in ms.config.json or pass --environment-id, then retry.");await Ae(l);let F=n.config.appDisplayName??r.basename(n.appRoot),z=we(F),P=r.join(n.appRoot,ce);await he(P,n.appRoot);try{let f=!1,C=!1,O=!1,D=!1,x=!1;try{x=await G(a,n.appRoot),D=await G(u,n.appRoot),await I(i,()=>{f=!0},ye(z,F)),await I(d,()=>{C=!0},me),c&&await I(s,()=>{O=!0},ge)}catch(ee){throw await Re({rayfinFolder:a,configPath:i,tsconfigPath:d,packageJsonPath:s,dataFolder:u,configWritten:f,tsconfigWritten:C,packageJsonWritten:O,createdDataFolder:D,createdRayfinFolder:x,jsonMode:e.isJsonMode()}),ee}}finally{await Ee(P,e.isJsonMode())}let{sdkInstalled:Q,warnings:v}=await be(n.appRoot,e.isJsonMode()),Z={rayfinFolder:a,configPath:i,dataFolder:u,sdkInstalled:Q,...v.length>0&&{warnings:v}};if(e.isJsonMode()){T({...Z});return}for(let f of v)h(f);$(`Scaffolded a Rayfin backend at '${r.relative(n.appRoot,a)}'.`)}async function Ae(e){let t;try{t=await L(e)}catch(n){throw n instanceof Error&&n.name==="AbortError"?n:(w().trackErrorEvent("Rayfin.Add.AvailabilityCheckFailed",k(n)),n instanceof N||n instanceof Y||n instanceof j&&(n.status===401||n.status===403)?new N("Unable to check backend availability. Sign in with an account that has access to the selected environment, then retry. No backend files were created.",void 0,{errorCode:"RayfinAvailabilityAccessDenied"}):new M("Unable to check backend availability for the selected environment. Check your connection and retry. If the problem persists, contact your Power Platform administrator. No backend files were created.",void 0,{errorCode:"RayfinAvailabilityCheckFailed"}))}if(!t)throw new y("Rayfin backends are not enabled for the selected environment. Ask your Power Platform administrator to enable backend support or select an environment where it is available, then retry. No backend files were created.",void 0,{errorCode:"RayfinBackendNotEnabled",telemetryDetails:K("environment_configuration")})}async function I(e,t,n){let a=await o.open(e,"wx");t();try{await a.writeFile(n,"utf8")}finally{await a.close()}}function H(e){if(!m.existsSync(e))return!1;try{let t=JSON.parse(m.readFileSync(e,"utf8").replace(/^\uFEFF/u,""));return typeof t=="object"&&t!==null&&"type"in t&&t.type==="module"}catch(t){if(t instanceof SyntaxError)return!1;throw t}}async function Re(e){let t,n=async a=>{try{await a()}catch(i){t??=i}};e.configWritten&&await n(()=>o.rm(e.configPath,{force:!0})),e.tsconfigWritten&&await n(()=>o.rm(e.tsconfigPath,{force:!0})),e.packageJsonWritten&&await n(()=>o.rm(e.packageJsonPath,{force:!0})),e.createdDataFolder&&await n(()=>U(e.dataFolder)),e.createdRayfinFolder&&await n(()=>U(e.rayfinFolder)),t!==void 0&&(w().trackErrorEvent("Rayfin.Add.RollbackCleanupFailed",k(t)),e.jsonMode||h(`Scaffolding failed and the partial '${X}' folder could not be fully cleaned up. Remove it manually before retrying.`))}function k(e){return{errorCode:typeof e=="object"&&e!==null&&"code"in e&&typeof e.code=="string"?e.code:"UNKNOWN",errorName:e instanceof Error?e.name:typeof e}}async function U(e){try{await o.rmdir(e)}catch(t){let n=t.code;if(n!=="ENOTEMPTY"&&n!=="ENOENT"&&n!=="ENOTDIR")throw t}}var B=[{name:de,version:S},{name:pe,version:ue}],q=[{name:_,version:b},{name:le,version:fe}];async function be(e,t){let n=[],a=r.join(e,"package.json");if(!m.existsSync(a))return{sdkInstalled:!1,warnings:n};try{let i=JSON.parse(await o.readFile(a,"utf8")),d=ve(i);d!==void 0&&n.push(d);let s=c=>i.dependencies?.[c]!==void 0||i.devDependencies?.[c]!==void 0,u=B.filter(({name:c})=>!s(c)),g=q.filter(({name:c})=>!s(c));return u.length===0&&g.length===0?{sdkInstalled:!0,warnings:n}:(u.length>0&&(i.dependencies=Object.fromEntries(Object.entries({...i.dependencies,...Object.fromEntries(u.map(({name:c,version:l})=>[c,l]))}).sort(([c],[l])=>c.localeCompare(l,"en")))),g.length>0&&(i.devDependencies=Object.fromEntries(Object.entries({...i.devDependencies,...Object.fromEntries(g.map(({name:c,version:l})=>[c,l]))}).sort(([c],[l])=>c.localeCompare(l,"en")))),await Ne(a,`${JSON.stringify(i,null,2)}
|
|
34
|
+
`),{sdkInstalled:!0,warnings:n})}catch(i){if(w().trackErrorEvent("Rayfin.Add.SdkPinFailed",k(i)),!t){for(let{name:d,version:s}of B)h(`Could not add '${d}' to the app's package.json. Add "${d}": "${s}" to dependencies manually.`);for(let{name:d,version:s}of q)h(`Could not add '${d}' to the app's package.json. Add "${d}": "${s}" to devDependencies manually.`)}return{sdkInstalled:!1,warnings:n}}}var ke="typescript";function ve(e){let t=d=>{let s=e.devDependencies?.[d]??e.dependencies?.[d];return typeof s=="string"&&R.default.validRange(s)!==null?s:void 0},n=t(_),a=t(ke);if(n===void 0||a===void 0)return;let i=R.default.minVersion(a);if(!(i===null||i.major<6)&&R.default.gtr(b,n,{includePrerelease:!0}))return`The app's package.json pins '${_}' to '${n}' but only allows TypeScript '${a}'. Releases older than ${b} can declare support for TypeScript 5 only, so installs that enforce peer dependencies (such as npm) can fail. The existing pin was left unchanged; update it to '${b}' or later.`}async function Ne(e,t){let n=r.join(r.dirname(e),`.${r.basename(e)}.${ae(6).toString("hex")}.tmp`);try{await o.writeFile(n,t,"utf8"),await o.rename(n,e)}catch(a){throw await o.rm(n,{force:!0}),a}}function Ie(e){e.setDescription(E.app.add.backend.description),e.addExamples(E.app.add.backend.examples),e.addOptions([{flags:{key:p.EnvironmentId.name,alias:p.EnvironmentId.alias},env:p.EnvironmentId.envVar,description:E.app.add.backend.options.environmentId,optionalInNonInteractive:!0},{flags:{key:p.Provider.name},env:p.Provider.envVar,description:E.app.add.backend.options.provider}])}export{je as addRayfinAsync};
|
|
35
|
+
/*!
|
|
36
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
37
|
+
*/
|
|
38
|
+
//# sourceMappingURL=AddRayfin-35GBGCWF.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __pathDirname } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{a as h,c as w,d as A,f as C,g as S,h as O}from"./chunk-FGB6GFXI.js";import{i as a}from"./chunk-5BE4TLDK.js";import{Bb as g,wb as y,y as u}from"./chunk-E2O4YZX2.js";import"./chunk-OB6WEE2V.js";import"./chunk-OUKOEUZA.js";import{b as n}from"./chunk-WS6TGUH7.js";import{a as s}from"./chunk-3UIUI5Q2.js";import{G as m,H as l,M as d,O as f}from"./chunk-4AO24KKT.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function k(e){N(e),await e.runVerb();let t=await e.getOption(n.Collection.name),o=await e.getOption(n.Property.name),p=await e.getOption(n.Type.name,!0),i=p===void 0?void 0:w(()=>y(p)),r=await C(e);if(!S(r,i))throw new u(`Nothing to change on property '${o}'. Pass --type or at least one validation switch.`);i!==void 0&&!e.isJsonMode()&&f(`Changing the type of '${o}' can leave existing stored values invalid.`);let{schemaPath:c}=await A(async()=>await g({...h(),...r,tableName:t,columnName:o,type:i}));if(e.isJsonMode()){l({schemaPath:c,collection:t,property:o,updated:!0});return}m(`Property '${o}' updated in collection '${t}' in ${c}`),x(r)&&d(s.project.state.alter.hint)}function x(e){return e.index!==void 0||e.ignoreCase!==void 0||e.ignoreAccents!==void 0}function N(e){let t=s.project.state.alter;e.setDescription(t.description),e.addExamples(t.examples),e.addOptions([a({flags:{key:n.Collection.name},message:n.Collection.promptMessage,description:t.options.collection}),a({flags:{key:n.Property.name},message:n.Property.promptMessage,description:t.options.property}),{flags:{key:n.Type.name},description:t.options.type,optionalInNonInteractive:!0},...O(t.options)])}export{k as dataAlterAsync};
|
|
8
|
+
/*!
|
|
9
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
+
*/
|
|
11
|
+
//# sourceMappingURL=Alter-U7WDVOMU.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __pathDirname } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{a as o}from"./chunk-3UIUI5Q2.js";import{E as i,H as u,M as a,O as s}from"./chunk-4AO24KKT.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
|
+
/*!
|
|
9
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
+
*/
|
|
11
|
+
//# sourceMappingURL=AuthStatus-XA6RGYYZ.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __pathDirname } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{c as f}from"./chunk-5BE4TLDK.js";import{Pb as h,y as l}from"./chunk-E2O4YZX2.js";import"./chunk-OB6WEE2V.js";import"./chunk-OUKOEUZA.js";import{a as u}from"./chunk-WS6TGUH7.js";import{a as i}from"./chunk-3UIUI5Q2.js";import{G as p,H as r,O as A}from"./chunk-4AO24KKT.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
|
+
`+e.map(c=>` - ${c.username}`).join(`
|
|
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
|
+
/*!
|
|
11
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
12
|
+
*/
|
|
13
|
+
//# sourceMappingURL=AuthSwitch-2FXB7WFU.js.map
|
package/dist/Bin.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
4
|
+
import { dirname as __pathDirname } from 'node:path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{a}from"./chunk-4WQT5P2M.js";import"./chunk-IM7SC23O.js";import"./chunk-B6REHI77.js";import"./chunk-C7V6WEZM.js";import"./chunk-OB6WEE2V.js";import"./chunk-OUKOEUZA.js";import"./chunk-3UIUI5Q2.js";import"./chunk-4AO24KKT.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";if(!a(process.argv)){let{boot:o}=await import("./Cli-6A2HUP7R.js");await o()}
|
|
9
|
+
/*!
|
|
10
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
11
|
+
*/
|
|
12
|
+
//# sourceMappingURL=Bin.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __pathDirname } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{b as W}from"./chunk-ZREDMBLO.js";import"./chunk-OL6CTXQR.js";import{a as U}from"./chunk-OBATM5M4.js";import"./chunk-2UMD5IAQ.js";import"./chunk-A57M2UGH.js";import{e as k,f as F,m as O}from"./chunk-OTXBVG3E.js";import{l as D}from"./chunk-5BE4TLDK.js";import{Fa as T,Na as x,Ob as v,Pb as j,y as a}from"./chunk-E2O4YZX2.js";import"./chunk-OB6WEE2V.js";import"./chunk-OUKOEUZA.js";import{v as o}from"./chunk-WS6TGUH7.js";import{a as f}from"./chunk-3UIUI5Q2.js";import{G as w,H as b,I as R,M as A,O as E,a as m,q as S}from"./chunk-4AO24KKT.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";import*as u from"node:path";async function st(t){await J(t,!1)}async function rt(t){await J(t,!0)}async function J(t,e){z(t,e),await t.runVerb();let n=await t.getOption("commit",!0),s=j().appConfig,c=s?.repoType,h=n?F(n,c!=="none"):void 0,i=e?await V(t):void 0;if(!(t.getEnvironmentId()??i?.environmentId))throw new a(e?`No environment ID found. Use \`ms project build\` from a directory with a valid ${m}.`:`\`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 ${m}) followed by \`ms app deploy\`. To run this deprecated command, invoke it from a directory with a ${m} (created by \`ms app create\`).`);!t.getEnvironmentId()&&i?.environmentId&&t.updateEnvironmentId(i.environmentId);let N=i?.tenantId??await t.getTenantIdAsync();if(!N)throw new a("Unable to determine tenant ID. Ensure you are logged in.");let y=i?.appName??await D(t),M=await t.getOption(o.NoWait.camelName)===!1,r=h,I,B=!1;if(!r){let p=k();if(!p)throw new a("Could not determine the latest commit ID. Use --commit or -c to specify it.");r=p.commitSha,I=p.detached?void 0:p.branch,B=!0}let g=t.isJsonMode();if(B&&!g&&A(I?`Using branch '${I}' at commit ${r}.`:`Detached HEAD at commit ${r}.`),!g){let p=O();p&&E(p)}let G=s?.externalRepoUrl,H=await t.getOption(o.OpenBrowser.camelName,!0)??!1,L=await t.getOption(o.ForceReauth.camelName,!0)??!1;g&&c==="github"&&R({phase:"build-validation"});let $=await U(({isRetry:p})=>T({logger:v(),actionsParams:{appName:y,commitSha:r,...L&&!p&&c==="github"&&{forceReauth:!0}}}),{repoType:c,externalRepoUrl:G,tenantId:N,jsonMode:g,openBrowser:H,verb:e?"project build":"app build"});if($===null){K(t.isJsonMode(),r);return}if(M){q(t.isJsonMode(),y,r,e);return}let C=await W({appName:y,commitSha:r,initialWaitMs:$.retryAfterMs??1e3,isJsonMode:t.isJsonMode()});t.isJsonMode()?b(C):(w(`Build status: ${C.status}`),!e&&C.status==="Succeeded"&&A(`Run \`ms app dev\` to run your app locally, or \`ms app deploy --commit ${r}\` to make this app live.`))}async function V(t){let e=j(),n=e.appConfig;if(!n)throw new a(`This app is not associated with a project. A valid ${m} is required.`);if(e.projectConfig||e.projectConfigError){let l=e.fileConfig.projectConfigPath;if(!l||u.dirname(u.resolve(l))!==u.dirname(u.resolve(e.fileConfig.appConfigPath)))throw new a(`${S} must be in the same directory as ${m} for \`ms project build\`.`);if(e.projectConfigError)throw new a("This app is not associated with a project.")}let s=d(n.appId);if(!s)throw new a("This app is not associated with a project.");let c=d(e.projectConfig?.projectId)??d(n.projectId),h=d(t.getEnvironmentId())??d(n.environmentId)??d(e.projectConfig?.environmentId),i;if(!c){if(i=await t.getTenantIdAsync(),!i)throw new a("Unable to determine tenant ID. Ensure you are logged in.");let l=await x({tenantId:i,environmentId:h,logger:v(),actionsParams:{appName:s}});c=d(l.projectId),h??=d(l.environmentId)}if(!c)throw new a("This app is not associated with a project.");if(i??=await t.getTenantIdAsync(),!i)throw new a("Unable to determine tenant ID. Ensure you are logged in.");return{appName:s,tenantId:i,environmentId:h}}function d(t){return typeof t=="string"&&t.trim()||void 0}function z(t,e){let n=e?f.project.build:f.app.build;t.setDescription(n.description),t.addExamples(n.examples),t.addOptions([...e?[]:[{flags:{key:o.AppName.name},env:o.AppName.envVar,description:f.app.build.options.appName,optionalInNonInteractive:!0}],{flags:{key:o.CommitSha.name,alias:o.CommitSha.alias},env:o.CommitSha.envVar,description:n.options.commitSha,optionalInNonInteractive:!0}]),t.addSwitch({flags:{key:o.NoWait.name},description:n.options.noWait}),e||(t.addSwitch({flags:{key:o.OpenBrowser.name},description:f.app.build.options.openBrowser}),t.addSwitch({flags:{key:o.ForceReauth.name},description:f.app.build.options.forceReauth}))}function q(t,e,n,s){if(t){b({commitSha:n,buildStatusCommand:s?"ms project build-status":`ms app build-status --app ${e} --commit ${n}`});return}w(s?`Build started for commit ${n}. Run \`ms project build-status\` to check status.`:`Build started for commit ${n}. Run \`ms app build-status --app ${e} --commit ${n}\` to check status.`)}function K(t,e){if(t){b({cached:!0,commitSha:e});return}w("Build already up to date for this commit.")}export{st as buildMaafAppAsync,rt as buildMaafProjectAsync};
|
|
8
|
+
/*!
|
|
9
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
+
*/
|
|
11
|
+
//# sourceMappingURL=BuildMaafApp-3EGRD23G.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __pathDirname } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{b as y,l as I}from"./chunk-5BE4TLDK.js";import{Ob as g,Pb as w,Ta as u,y as p}from"./chunk-E2O4YZX2.js";import"./chunk-OB6WEE2V.js";import"./chunk-OUKOEUZA.js";import{C as i}from"./chunk-WS6TGUH7.js";import{a as m}from"./chunk-3UIUI5Q2.js";import{G as f,H as v,M as a,O as c}from"./chunk-4AO24KKT.js";import"./chunk-Y5AMO72S.js";import"./chunk-UT667QSU.js";async function $(e){b(e),await e.runVerb();let n=e.isJsonMode(),l=await e.getOption("force",!0)===!0;if(!l&&(n||!w().interactive))throw new p("Resetting Preview data for all users requires explicit confirmation. Use --force to acknowledge this Preview-only destructive action in JSON or non-interactive mode. Live data is unchanged.");let h=await I(e),A=e.getEnvironmentId({includeConfig:!1}),d=await e.getTenantIdAsync();if(!d)throw new p("Unable to determine tenant ID. Ensure you are logged in.");let s=new AbortController,r=()=>s.abort();process.once("SIGINT",r),process.once("SIGTERM",r);try{let t=await u({tenantId:d,environmentId:A,logger:g(),actionsParams:{appId:h},signal:s.signal,confirm:l?void 0:async o=>await y({message:`Discard Preview data for app '${o.appId}' in environment '${o.environmentId}'? This affects all users and all item types in Preview state and cannot be undone. Live data is unchanged. Background deletion may continue after the request returns.`,initialValue:!1,signal:s.signal})});if(t===null){c("Preview reset cancelled. No reset request was sent.");return}if(n)v(t);else{let o=`app '${t.appId}' in environment '${t.environmentId}'`;t.isComplete?f(`Preview reset completion confirmed by the service for ${o}.`):a(t.observedEmpty?`Preview emptiness observed for ${o}.`:`Preview reset request succeeded for ${o}. Emptiness was not observed.`),t.wasAlreadyEmpty&&a("Preview state was already empty at the initial observation.")}t.isComplete||c("Background completion is unconfirmed (isComplete: false). Request success and observed emptiness are not purge completion. Do not automatically retry or start Preview, writes, reindexing, or deployment while the reset is unconfirmed. There is no reset status endpoint.")}finally{process.removeListener("SIGINT",r),process.removeListener("SIGTERM",r)}}function b(e){let n=m.project.state.clear;e.setDescription(n.description),e.addExamples(n.examples),e.addSwitch({flags:{key:"force",alias:"f"},description:n.options.force}),e.addOptions([{flags:{key:i.App.name},env:i.App.envVar,description:n.options.app,optionalInNonInteractive:!0},{flags:{key:i.EnvironmentId.name,alias:i.EnvironmentId.alias},env:i.EnvironmentId.envVar,description:n.options.environmentId,optionalInNonInteractive:!0}])}export{$ as clearDataAsync};
|
|
8
|
+
/*!
|
|
9
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
+
*/
|
|
11
|
+
//# sourceMappingURL=Clear-MZGQZ2XK.js.map
|