@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{a as E}from"./chunk-TYRVM4PP.js";import{c as m,d as c}from"./chunk-OTXBVG3E.js";import{A as s}from"./chunk-E2O4YZX2.js";import{a as p}from"./chunk-OB6WEE2V.js";import{d as w}from"./chunk-UT667QSU.js";var l=w(E(),1);import{execFileSync as G}from"child_process";import{dirname as u,join as a}from"path";function x(){let e=c(["--version"],{captureStdout:!0,allowFailure:!0,emitStderr:!1});if(!e.success){if(e.error.code!=="ENOENT"){let i=m("",{action:"checking the Git version"},e.error);throw i||new s("Git could not be started while checking its version. Check the Git executable and your endpoint security policy, then retry.",{prerequisite:"git"},{errorCode:"GitProcessLaunchFailed",retryable:!1,telemetryDetails:{prerequisite:"git"}})}throw new s("'git' is required but was not found on PATH.",{prerequisite:"git"},{errorCode:"GitNotInstalled",telemetryDetails:{prerequisite:"git"}})}let r=e.stdout,t=p.engines.git;if(!l.default.validRange(t))return;let n=l.default.coerce(r);if(n&&!l.default.satisfies(n,t))throw new s(`Git ${t} is required (found ${n.version}). Please upgrade git.`,{prerequisite:"git",requiredVersion:t,foundVersion:n.version},{errorCode:"GitVersionUnsupported",telemetryDetails:{prerequisite:"git",requiredVersion:t,foundVersion:n.version}})}function B(){let e=b(),r=h("git-credential-manager",e),t=r.success?r:h("git-credential-manager-core",e);if(!t.success){let i=!r.success&&d(r.error),y=d(t.error);if(i&&y)throw new s("Git Credential Manager is required for the native app flow but was not found. Install Git Credential Manager, then run `git-credential-manager configure` and retry.",{prerequisite:"git-credential-manager"},{errorCode:"GitCredentialManagerNotInstalled",telemetryDetails:{prerequisite:"git-credential-manager"}});let f=[r,t].filter(o=>!o.success).map(o=>o.error).find(o=>o.code!=="ENOENT");throw f?M(f):new s("Git Credential Manager is required for the native app flow but was not found. Install Git Credential Manager, then run `git-credential-manager configure` and retry.",{prerequisite:"git-credential-manager"},{errorCode:"GitCredentialManagerNotInstalled",telemetryDetails:{prerequisite:"git-credential-manager"}})}let n=c(["config","--get-all","credential.helper"],{captureStdout:!0,allowFailure:!0,emitStderr:!1});if(!(n.success?n.stdout.split(/\r?\n/).some(i=>/(?:^|[\\/])git-credential-manager(?:-core)?(?:\.exe)?(?:["']|\s|$)/i.test(i.trim())||/^(?:manager|manager-core)$/i.test(i.trim())):!1))throw new s("Git Credential Manager is installed but not configured as a Git credential helper. Run `git-credential-manager configure` and retry.",{prerequisite:"git-credential-manager"},{errorCode:"GitCredentialManagerNotConfigured",telemetryDetails:{prerequisite:"git-credential-manager"}})}function b(){let e=c(["--exec-path"],{captureStdout:!0,allowFailure:!0,emitStderr:!1});return e.success&&e.stdout.trim()?e.stdout.trim():void 0}function h(e,r){let t=C(e);if(t.success||!d(t.error)||!r)return t;let n=process.platform==="win32"?[a(r,`${e}.exe`),a(r,e),a(u(u(r)),"bin",`${e}.exe`),a(u(u(r)),"bin",e)]:[a(r,e)];for(let g of n){let i=C(g);if(i.success||!d(i.error))return i}return t}function C(e){try{return G(e,["--version"],{stdio:["ignore","ignore","ignore"]}),{success:!0}}catch(r){return{success:!1,error:r instanceof Error?r:new Error(String(r))}}}function d(e){return e.code==="ENOENT"}function M(e){let r="git-credential-manager";return e.code==="EACCES"?new s("Git Credential Manager is installed but is not permitted to run. Check its executable permissions and your endpoint security policy, then retry.",{prerequisite:r,classifierBucket:"process-access-denied"},{errorCode:"GitCredentialManagerProcessAccessDenied",retryable:!1,telemetryDetails:{prerequisite:r,classifierBucket:"process-access-denied"}}):e.code==="EBADARCH"||e.errno===86||e.errno===-86?new s("Git Credential Manager is installed but is incompatible with this Mac. Install a build for this Mac's architecture, then retry.",{prerequisite:r,classifierBucket:"process-bad-architecture"},{errorCode:"GitCredentialManagerProcessBadArchitecture",retryable:!1,telemetryDetails:{prerequisite:r,classifierBucket:"process-bad-architecture"}}):new s("Git Credential Manager was found but could not be started. Check its installation and your endpoint security policy, then retry.",{prerequisite:r,classifierBucket:"process-launch-failed"},{errorCode:"GitCredentialManagerProcessLaunchFailed",retryable:!1,telemetryDetails:{prerequisite:r,classifierBucket:"process-launch-failed"}})}export{x as a,B as b};
|
|
8
|
+
/*!
|
|
9
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
+
*/
|
|
11
|
+
//# sourceMappingURL=chunk-4C6DWU2Y.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,d}from"./chunk-FGB6GFXI.js";import{Gb as m}from"./chunk-E2O4YZX2.js";import{a as s}from"./chunk-3UIUI5Q2.js";import{E as o,H as c,M as r,O as a}from"./chunk-4AO24KKT.js";var f="*";async function C(e){D(e),await e.runVerb();let t=await d(async()=>await m(p()));if(e.isJsonMode()){c(u(t));return}b(t)}function u(e){let{tables:t,...n}=e;return{...n,collections:t.map(({columns:i,...h})=>({...h,properties:i}))}}function b(e){if(r(`Schema: ${e.schemaPath}`),!e.exists){r("No state schema found. Create the file to start defining collections.");return}if(r(`Locale: ${e.locale}`),e.validationEnabled||a("Write validation is disabled ('x-ms-validation' is false). Declared indexes remain active."),e.tables.length===0){r("No collections defined.");return}let t=!1;for(let n of e.tables)t||=n.columns.some(i=>i.automatic),o({title:n.name,columns:[{header:"Property",maxWidth:32},{header:"Type"},{header:"Required"},{header:"Index"},{header:"Constraints",maxWidth:40}],rows:n.columns.map(i=>[i.automatic?`${i.name}${f}`:i.name,i.type,i.required?"Yes":"No",g(i),x(i)]),emptyMessage:"No properties defined.",totalLabel:"properties"}),n.representable||a(`Collection '${n.name}' also uses schema constructs not shown in the scalar-property view (${n.unrepresentableAt}).`);t&&r(`
|
|
8
|
+
${f} set by the platform on every collection.`),r(s.project.state["list-schema"].hint),r(`Run "${"ms"} project state list-schema --json" for the full definition.`)}function g(e){if(!e.indexed)return"No";let t=[];return e.index?.ignoreCase&&t.push("ignore case"),e.index?.ignoreAccents&&t.push("ignore accents"),t.length===0?"Yes":`Yes (${t.join(", ")})`}function x(e){let t=[];return e.format!==void 0&&t.push(`format=${e.format}`),e.minLength!==void 0&&t.push(`minLength=${e.minLength}`),e.maxLength!==void 0&&t.push(`maxLength=${e.maxLength}`),e.minValue!==void 0&&t.push(`min=${e.minValue}`),e.maxValue!==void 0&&t.push(`max=${e.maxValue}`),e.resourceKind!==void 0&&t.push(`kind=${e.resourceKind}`),t.join(", ")}function D(e){e.setDescription(s.project.state["list-schema"].description),e.addExamples(s.project.state["list-schema"].examples)}export{C as a,u as b};
|
|
9
|
+
/*!
|
|
10
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
11
|
+
*/
|
|
12
|
+
//# sourceMappingURL=chunk-4JTUAUHI.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{l as o,qa as r}from"./chunk-E2O4YZX2.js";async function m(e,a){let t=!0;try{await r(e,{stageName:a})}catch(n){if(i(n))t=!1;else throw n}return{projectId:e,deploymentCreated:t}}function i(e){return e instanceof o&&e.status===409&&e.code==="StageNameConflict"}export{m as a};
|
|
8
|
+
/*!
|
|
9
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
+
*/
|
|
11
|
+
//# sourceMappingURL=chunk-4UHMKZLH.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{h as s}from"./chunk-IM7SC23O.js";import{h as n}from"./chunk-OUKOEUZA.js";var l=new Set(["--help","-h","--version","-v","--json","--no-color","--non-interactive"]);function t(e){let o=e.slice(2);return o.some(r=>r==="--help"||r==="-h"||r==="--version"||r==="-v")&&o.every(r=>l.has(r))}function u(e){return t(e)?(e.includes("--no-color")&&n("NO_COLOR","1"),s(null).parse([...e]),!0):!1}export{u as a};
|
|
8
|
+
/*!
|
|
9
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
+
*/
|
|
11
|
+
//# sourceMappingURL=chunk-4WQT5P2M.js.map
|
|
@@ -0,0 +1,54 @@
|
|
|
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{Pb as et,v as Q,x as tt,y as N}from"./chunk-E2O4YZX2.js";import{O as D,a as j}from"./chunk-4AO24KKT.js";import{b as Ut,d as dt}from"./chunk-UT667QSU.js";var ot=Ut((Re,Mt)=>{"use strict";var nt={to(t,e){return e?`\x1B[${e+1};${t+1}H`:`\x1B[${t+1}G`},move(t,e){let s="";return t<0?s+=`\x1B[${-t}D`:t>0&&(s+=`\x1B[${t}C`),e<0?s+=`\x1B[${-e}A`:e>0&&(s+=`\x1B[${e}B`),s},up:(t=1)=>`\x1B[${t}A`,down:(t=1)=>`\x1B[${t}B`,forward:(t=1)=>`\x1B[${t}C`,backward:(t=1)=>`\x1B[${t}D`,nextLine:(t=1)=>"\x1B[E".repeat(t),prevLine:(t=1)=>"\x1B[F".repeat(t),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},ie={up:(t=1)=>"\x1B[S".repeat(t),down:(t=1)=>"\x1B[T".repeat(t)},re={screen:"\x1B[2J",up:(t=1)=>"\x1B[1J".repeat(t),down:(t=1)=>"\x1B[J".repeat(t),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(t){let e="";for(let s=0;s<t;s++)e+=this.line+(s<t-1?nt.up():"");return t&&(e+=nt.left),e}};Mt.exports={cursor:nt,scroll:ie,erase:re,beep:"\x07"}});import{styleText as at}from"node:util";import{stdout as Pt,stdin as ne}from"node:process";import oe from"node:readline";var mt=(()=>{let t=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return e=>{let s=0;for(t.lastIndex=0;t.test(e);)s+=1;return e.length-s}})(),gt=t=>t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510,ft=t=>t===8987||t===9001||t>=12272&&t<=12287||t>=12289&&t<=12350||t>=12441&&t<=12543||t>=12549&&t<=12591||t>=12593&&t<=12686||t>=12688&&t<=12771||t>=12783&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=19903||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=127488&&t<=127490||t>=127504&&t<=127547||t>=127552&&t<=127560||t>=131072&&t<=196605||t>=196608&&t<=262141;var Bt=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,Kt=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,$t=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,Ht=/\t{1,1000}/y,vt=new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*","yu"),qt=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,zt=new RegExp("\\p{M}+","gu"),Jt={limit:1/0,ellipsis:""},yt=(t,e={},s={})=>{let i=e.limit??1/0,r=e.ellipsis??"",o=e?.ellipsisWidth??(r?yt(r,Jt,s).width:0),n=0,a=s.controlWidth??0,l=s.tabWidth??8,h=s.emojiWidth??2,d=2,c=s.regularWidth??1,p=s.wideWidth??d,v=[[qt,c],[Bt,n],[Kt,a],[Ht,l],[vt,h],[$t,p]],f=0,$=0,I=t.length,S=0,P=!1,F=I,_=Math.max(0,i-o),y=0,b=0,w=0,x=0;t:for(;;){if(b>y||$>=I&&$>f){let C=t.slice(y,b)||t.slice(f,$);S=0;for(let O of C.replaceAll(zt,"")){let E=O.codePointAt(0)||0;if(gt(E)?x=d:ft(E)?x=p:x=c,w+x>_&&(F=Math.min(F,Math.max(y,f)+S)),w+x>i){P=!0;break t}S+=O.length,w+=x}y=b=0}if($>=I)break t;for(let C=0,O=v.length;C<O;C++){let[E,pt]=v[C];if(E.lastIndex=$,E.test(t)){if(S=E===$t?mt(t.slice($,E.lastIndex)):E===vt?1:E.lastIndex-$,x=S*pt,w+x>_&&(F=Math.min(F,$+Math.floor((_-w)/pt))),w+x>i){P=!0;break t}w+=x,y=f,b=$,$=f=E.lastIndex;continue t}}$+=1}return{width:P?_:w,index:P?F:I,truncated:P,ellipsed:P&&i>=o}},wt=yt;var Yt={limit:1/0,ellipsis:"",ellipsisWidth:0},Xt=(t,e={})=>wt(t,Yt,e).width,A=Xt;var U="\x1B",xt="\x9B",Zt=39,it="\x07",Ct="[",Qt="]",Et="m",rt=`${Qt}8;;`,It=new RegExp(`(?:\\${Ct}(?<code>\\d+)m|\\${rt}(?<uri>.*)${it})`,"y"),bt=t=>{if(t>=30&&t<=37||t>=90&&t<=97)return 39;if(t>=40&&t<=47||t>=100&&t<=107)return 49;if(t===1||t===2)return 22;if(t===3)return 23;if(t===4)return 24;if(t===7)return 27;if(t===8)return 28;if(t===9)return 29;if(t===0)return 0},St=t=>`${U}${Ct}${t}${Et}`,_t=t=>`${U}${rt}${t}${it}`,st=(t,e,s)=>{let i=e[Symbol.iterator](),r=!1,o=!1,n=t.at(-1),a=n===void 0?0:A(n),l=i.next(),h=i.next(),d=0;for(;!l.done;){let c=l.value,p=A(c);a+p<=s?t[t.length-1]+=c:(t.push(c),a=0),(c===U||c===xt)&&(r=!0,o=e.startsWith(rt,d+1)),r?o?c===it&&(r=!1,o=!1):c===Et&&(r=!1):(a+=p,a===s&&!h.done&&(t.push(""),a=0)),l=h,h=i.next(),d+=c.length}n=t.at(-1),!a&&n!==void 0&&n.length&&t.length>1&&(t[t.length-2]+=t.pop())},te=t=>{let e=t.split(" "),s=e.length;for(;s&&!A(e[s-1]);)s--;return s===e.length?t:e.slice(0,s).join(" ")+e.slice(s).join("")},ee=(t,e,s={})=>{if(s.trim!==!1&&t.trim()==="")return"";let i="",r,o,n=t.split(" "),a=[""],l=0;for(let c=0;c<n.length;c++){let p=n[c];if(s.trim!==!1){let f=a.at(-1)??"",$=f.trimStart();f.length!==$.length&&(a[a.length-1]=$,l=A($))}c!==0&&(l>=e&&(s.wordWrap===!1||s.trim===!1)&&(a.push(""),l=0),(l||s.trim===!1)&&(a[a.length-1]+=" ",l++));let v=A(p);if(s.hard&&v>e){let f=e-l,$=1+Math.floor((v-f-1)/e);Math.floor((v-1)/e)<$&&a.push(""),st(a,p,e),l=A(a.at(-1)??"");continue}if(l+v>e&&l&&v){if(s.wordWrap===!1&&l<e){st(a,p,e),l=A(a.at(-1)??"");continue}a.push(""),l=0}if(l+v>e&&s.wordWrap===!1){st(a,p,e),l=A(a.at(-1)??"");continue}a[a.length-1]+=p,l+=v}s.trim!==!1&&(a=a.map(c=>te(c)));let h=a.join(`
|
|
8
|
+
`),d=!1;for(let c=0;c<h.length;c++){let p=h[c];if(i+=p,d)d=!1;else if(d=p>="\uD800"&&p<="\uDBFF",d)continue;if(p===U||p===xt){It.lastIndex=c+1;let f=It.exec(h)?.groups;if(f?.code!==void 0){let $=Number.parseFloat(f.code);r=$===Zt?void 0:$}else f?.uri!==void 0&&(o=f.uri.length===0?void 0:f.uri)}if(h[c+1]===`
|
|
9
|
+
`){o&&(i+=_t(""));let v=r?bt(r):void 0;r&&v&&(i+=St(v))}else p===`
|
|
10
|
+
`&&(r&&bt(r)&&(i+=St(r)),o&&(i+=_t(o)))}return i},se=/\r?\n/;function R(t,e,s){return String(t).normalize().split(se).map(i=>ee(i,e,s)).join(`
|
|
11
|
+
`)}var M=dt(ot(),1);function L(t,e,s){if(!s.some(n=>!n.disabled))return t;let i=t+e,r=Math.max(s.length-1,0),o=i<0?r:i>r?0:i;return s[o].disabled?L(o,e<0?-1:1,s):o}var ae=["up","down","left","right","space","enter","cancel"],ue=["January","February","March","April","May","June","July","August","September","October","November","December"],V={actions:new Set(ae),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"},withGuide:!0,date:{monthNames:[...ue],messages:{required:"Please enter a valid date",invalidMonth:"There are only 12 months in a year",invalidDay:(t,e)=>`There are only ${t} days in ${e}`,afterMin:t=>`Date must be on or after ${t.toISOString().slice(0,10)}`,beforeMax:t=>`Date must be on or before ${t.toISOString().slice(0,10)}`}}};function Tt(t,e){if(typeof t=="string")return V.aliases.get(t)===e;for(let s of t)if(s!==void 0&&Tt(s,e))return!0;return!1}function le(t,e){if(t===e)return;let s=t.split(`
|
|
12
|
+
`),i=e.split(`
|
|
13
|
+
`),r=Math.max(s.length,i.length),o=[];for(let n=0;n<r;n++)s[n]!==i[n]&&o.push(n);return{lines:o,numLinesBefore:s.length,numLinesAfter:i.length,numLines:r}}var We=globalThis.process.platform.startsWith("win"),ut=Symbol("clack:cancel");function k(t){return t===ut}function B(t,e){let s=t;s.isTTY&&s.setRawMode(e)}var lt=t=>"columns"in t&&typeof t.columns=="number"?t.columns:80,ct=t=>"rows"in t&&typeof t.rows=="number"?t.rows:20;function G(t,e,s,i=s,r=s,o){let n=lt(t??Pt);return R(e,n-s.length,{hard:!0,trim:!1}).split(`
|
|
14
|
+
`).map((a,l,h)=>{let d=o?o(a,l):a;return l===0?`${i}${d}`:l===h.length-1?`${r}${d}`:`${s}${d}`}).join(`
|
|
15
|
+
`)}var z=class{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame="";_subscribers=new Map;_cursor=0;state="initial";error="";value;userInput="";constructor(t,e=!0){let{input:s=ne,output:i=Pt,render:r,signal:o,...n}=t;this.opts=n,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=r.bind(this),this._track=e,this._abortSignal=o,this.input=s,this.output=i}unsubscribe(){this._subscribers.clear()}setSubscriber(t,e){let s=this._subscribers.get(t)??[];s.push(e),this._subscribers.set(t,s)}on(t,e){this.setSubscriber(t,{cb:e})}once(t,e){this.setSubscriber(t,{cb:e,once:!0})}emit(t,...e){let s=this._subscribers.get(t)??[],i=[];for(let r of s)r.cb(...e),r.once&&i.push(()=>s.splice(s.indexOf(r),1));for(let r of i)r()}prompt(){return new Promise(t=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),t(ut);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}this.rl=oe.createInterface({input:this.input,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0&&this._setUserInput(this.opts.initialUserInput,!0),this.input.on("keypress",this.onKeypress),B(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(M.cursor.show),this.output.off("resize",this.render),B(this.input,!1),t(this.value)}),this.once("cancel",()=>{this.output.write(M.cursor.show),this.output.off("resize",this.render),B(this.input,!1),t(ut)})})}_isActionKey(t,e){return t===" "}_shouldSubmit(t,e){return!0}_setValue(t){this.value=t,this.emit("value",this.value)}_setUserInput(t,e){this.userInput=t??"",this.emit("userInput",this.userInput),e&&this._track&&this.rl&&(this.rl.write(this.userInput),this._cursor=this.rl.cursor)}_clearUserInput(){this.rl?.write(null,{ctrl:!0,name:"u"}),this._setUserInput("")}onKeypress(t,e){if(this._track&&e.name!=="return"&&(e.name&&this._isActionKey(t,e)&&this.rl?.write(null,{ctrl:!0,name:"h"}),this._cursor=this.rl?.cursor??0,this._setUserInput(this.rl?.line)),this.state==="error"&&(this.state="active"),e?.name&&(!this._track&&V.aliases.has(e.name)&&this.emit("cursor",V.aliases.get(e.name)),V.actions.has(e.name)&&this.emit("cursor",e.name)),t&&(t.toLowerCase()==="y"||t.toLowerCase()==="n")&&this.emit("confirm",t.toLowerCase()==="y"),this.emit("key",t?.toLowerCase(),e),e?.name==="return"&&this._shouldSubmit(t,e)){if(this.opts.validate){let s=this.opts.validate(this.value);s&&(this.error=s instanceof Error?s.message:s,this.state="error",this.rl?.write(this.userInput))}this.state!=="error"&&(this.state="submit")}Tt([t,e?.name,e?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
|
|
16
|
+
`),B(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let t=R(this._prevFrame,process.stdout.columns,{hard:!0,trim:!1}).split(`
|
|
17
|
+
`).length-1;this.output.write(M.cursor.move(-999,t*-1))}render(){let t=R(this._render(this)??"",process.stdout.columns,{hard:!0,trim:!1});if(t!==this._prevFrame){if(this.state==="initial")this.output.write(M.cursor.hide);else{let e=le(this._prevFrame,t),s=ct(this.output);if(this.restoreCursor(),e){let i=Math.max(0,e.numLinesAfter-s),r=Math.max(0,e.numLinesBefore-s),o=e.lines.find(n=>n>=i);if(o===void 0){this._prevFrame=t;return}if(e.lines.length===1){this.output.write(M.cursor.move(0,o-r)),this.output.write(M.erase.lines(1));let n=t.split(`
|
|
18
|
+
`);this.output.write(n[o]),this._prevFrame=t,this.output.write(M.cursor.move(0,n.length-o-1));return}else if(e.lines.length>1){if(i<r)o=i;else{let a=o-r;a>0&&this.output.write(M.cursor.move(0,a))}this.output.write(M.erase.down());let n=t.split(`
|
|
19
|
+
`).slice(o);this.output.write(n.join(`
|
|
20
|
+
`)),this._prevFrame=t;return}}this.output.write(M.erase.down())}this.output.write(t),this.state==="initial"&&(this.state="active"),this._prevFrame=t}}};function ce(t,e){if(t===void 0||e.length===0)return 0;let s=e.findIndex(i=>i.value===t);return s!==-1?s:0}function he(t,e){return(e.label??String(e.value)).toLowerCase().includes(t.toLowerCase())}function pe(t,e){if(e)return t?e:e[0]}var At=class extends z{filteredOptions;multiple;isNavigating=!1;selectedValues=[];focusedValue;#t=0;#i="";#e;#s;#r;get cursor(){return this.#t}get userInputWithCursor(){if(!this.userInput)return at(["inverse","hidden"],"_");if(this._cursor>=this.userInput.length)return`${this.userInput}\u2588`;let t=this.userInput.slice(0,this._cursor),[e,...s]=this.userInput.slice(this._cursor);return`${t}${at("inverse",e)}${s.join("")}`}get options(){return typeof this.#s=="function"?this.#s():this.#s}constructor(t){super(t),this.#s=t.options,this.#r=t.placeholder;let e=this.options;this.filteredOptions=[...e],this.multiple=t.multiple===!0,this.#e=typeof t.options=="function"?t.filter:t.filter??he;let s;if(t.initialValue&&Array.isArray(t.initialValue)?this.multiple?s=t.initialValue:s=t.initialValue.slice(0,1):!this.multiple&&this.options.length>0&&(s=[this.options[0].value]),s)for(let i of s){let r=e.findIndex(o=>o.value===i);r!==-1&&(this.toggleSelected(i),this.#t=r)}this.focusedValue=this.options[this.#t]?.value,this.on("key",(i,r)=>this.#n(i,r)),this.on("userInput",i=>this.#o(i))}_isActionKey(t,e){return t===" "||this.multiple&&this.isNavigating&&e.name==="space"&&t!==void 0&&t!==""}#n(t,e){let s=e.name==="up",i=e.name==="down",r=e.name==="return",o=this.userInput===""||this.userInput===" ",n=this.#r,a=this.options,l=n!==void 0&&n!==""&&a.some(h=>!h.disabled&&(this.#e?this.#e(n,h):!0));if(e.name==="tab"&&o&&l){this.userInput===" "&&this._clearUserInput(),this._setUserInput(n,!0),this.isNavigating=!1;return}s||i?(this.#t=L(this.#t,s?-1:1,this.filteredOptions),this.focusedValue=this.filteredOptions[this.#t]?.value,this.multiple||(this.selectedValues=[this.focusedValue]),this.isNavigating=!0):r?this.value=pe(this.multiple,this.selectedValues):this.multiple?this.focusedValue!==void 0&&(e.name==="tab"||this.isNavigating&&e.name==="space")?this.toggleSelected(this.focusedValue):this.isNavigating=!1:(this.focusedValue&&(this.selectedValues=[this.focusedValue]),this.isNavigating=!1)}deselectAll(){this.selectedValues=[]}toggleSelected(t){this.filteredOptions.length!==0&&(this.multiple?this.selectedValues.includes(t)?this.selectedValues=this.selectedValues.filter(e=>e!==t):this.selectedValues=[...this.selectedValues,t]:this.selectedValues=[t])}#o(t){if(t!==this.#i){this.#i=t;let e=this.options;t&&this.#e?this.filteredOptions=e.filter(r=>this.#e?.(t,r)):this.filteredOptions=[...e];let s=ce(this.focusedValue,this.filteredOptions);this.#t=L(s,0,this.filteredOptions);let i=this.filteredOptions[this.#t];i&&!i.disabled?this.focusedValue=i.value:this.focusedValue=void 0,this.multiple||(this.focusedValue!==void 0?this.toggleSelected(this.focusedValue):this.deselectAll())}}},K=class extends z{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(e){super(e,!1),this.value=!!e.initialValue,this.on("userInput",()=>{this.value=this._value}),this.on("confirm",s=>{this.output.write(M.cursor.move(0,-1)),this.value=s,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};var H=class extends z{options;cursor=0;get _selectedValue(){return this.options[this.cursor]}changeValue(){this.value=this._selectedValue.value}constructor(e){super(e,!1),this.options=e.options;let s=this.options.findIndex(({value:r})=>r===e.initialValue),i=s===-1?0:s;this.cursor=this.options[i].disabled?L(i,1,this.options):i,this.changeValue(),this.on("cursor",r=>{switch(r){case"left":case"up":this.cursor=L(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=L(this.cursor,1,this.options);break}this.changeValue()})}};var q=class extends z{get userInputWithCursor(){if(this.state==="submit")return this.userInput;let e=this.userInput;if(this.cursor>=e.length)return`${this.userInput}\u2588`;let s=e.slice(0,this.cursor),[i,...r]=e.slice(this.cursor);return`${s}${at("inverse",i)}${r.join("")}`}get cursor(){return this._cursor}constructor(e){super({...e,initialUserInput:e.initialUserInput??e.initialValue}),this.on("userInput",s=>{this._setValue(s)}),this.on("finalize",()=>{this.value||(this.value=e.defaultValue),this.value===void 0&&(this.value="")})}};import{styleText as u,stripVTControlCharacters as es}from"node:util";import T from"node:process";var Ot=dt(ot(),1);function de(){return T.platform!=="win32"?T.env.TERM!=="linux":!!T.env.CI||!!T.env.WT_SESSION||!!T.env.TERMINUS_SUBLIME||T.env.ConEmuTask==="{cmd::Cmder}"||T.env.TERM_PROGRAM==="Terminus-Sublime"||T.env.TERM_PROGRAM==="vscode"||T.env.TERM==="xterm-256color"||T.env.TERM==="alacritty"||T.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var me=de();var m=(t,e)=>me?t:e,ge=m("\u25C6","*"),fe=m("\u25A0","x"),$e=m("\u25B2","x"),ve=m("\u25C7","o"),ns=m("\u250C","T"),g=m("\u2502","|"),W=m("\u2514","\u2014"),os=m("\u2510","T"),as=m("\u2518","\u2014"),ht=m("\u25CF",">"),Y=m("\u25CB"," "),us=m("\u25FB","[\u2022]"),ye=m("\u25FC","[+]"),Vt=m("\u25FB","[ ]"),ls=m("\u25AA","\u2022"),cs=m("\u2500","-"),hs=m("\u256E","+"),ps=m("\u251C","+"),ds=m("\u256F","+"),ms=m("\u2570","+"),gs=m("\u256D","+"),fs=m("\u25CF","\u2022"),$s=m("\u25C6","*"),vs=m("\u25B2","!"),ys=m("\u25A0","x"),X=t=>{switch(t){case"initial":case"active":return u("cyan",ge);case"cancel":return u("red",fe);case"error":return u("yellow",$e);case"submit":return u("green",ve)}},we=t=>{switch(t){case"initial":case"active":return u("cyan",g);case"cancel":return u("red",g);case"error":return u("yellow",g);case"submit":return u("green",g)}},Ft=(t,e,s,i,r,o=!1)=>{let n=e,a=0;if(o)for(let l=i-1;l>=s&&(n-=t[l].length,a++,!(n<=r));l--);else for(let l=s;l<i&&(n-=t[l].length,a++,!(n<=r));l++);return{lineCount:n,removals:a}},kt=({cursor:t,options:e,style:s,output:i=process.stdout,maxItems:r=Number.POSITIVE_INFINITY,columnPadding:o=0,rowPadding:n=4})=>{let a=lt(i)-o,l=ct(i),h=u("dim","..."),d=Math.max(l-n,0),c=Math.max(Math.min(r,d),5),p=0;t>=c-3&&(p=Math.max(Math.min(t-c+3,e.length-c),0));let v=c<e.length&&p>0,f=c<e.length&&p+c<e.length,$=Math.min(p+c,e.length),I=[],S=0;v&&S++,f&&S++;let P=p+(v?1:0),F=$-(f?1:0);for(let y=P;y<F;y++){let b=R(s(e[y],y===t),a,{hard:!0,trim:!1}).split(`
|
|
21
|
+
`);I.push(b),S+=b.length}if(S>d){let y=0,b=0,w=S,x=t-P,C=d,O=()=>Ft(I,w,0,x,C),E=()=>Ft(I,w,x+1,I.length,C,!0);v?({lineCount:w,removals:y}=O(),w>C&&(f||(C-=1),{lineCount:w,removals:b}=E())):(f||(C-=1),{lineCount:w,removals:b}=E(),w>C&&(C-=1,{lineCount:w,removals:y}=O())),y>0&&(v=!0,I.splice(0,y)),b>0&&(f=!0,I.splice(I.length-b,b))}let _=[];v&&_.push(h);for(let y of I)for(let b of y)_.push(b);return f&&_.push(h),_};function Ie(t,e){if(!t)return!0;let s=(e.label??String(e.value??"")).toLowerCase(),i=(e.hint??"").toLowerCase(),r=String(e.value).toLowerCase(),o=t.toLowerCase();return s.includes(o)||i.includes(o)||r.includes(o)}var Rt=t=>{let e=(i,r,o,n)=>{let a=o.includes(i.value),l=i.label??String(i.value??""),h=i.hint&&n!==void 0&&i.value===n?u("dim",` (${i.hint})`):"",d=a?u("green",ye):u("dim",Vt);return i.disabled?`${u("gray",Vt)} ${u(["strikethrough","gray"],l)}`:r?`${d} ${l}${h}`:`${d} ${u("dim",l)}`},s=new At({options:t.options,multiple:!0,placeholder:t.placeholder,filter:t.filter??((i,r)=>Ie(i,r)),validate:()=>{if(t.required&&s.selectedValues.length===0)return"Please select at least one item"},initialValue:t.initialValues,signal:t.signal,input:t.input,output:t.output,render(){let i=t.withGuide??V.withGuide,r=`${i?`${u("gray",g)}
|
|
22
|
+
`:""}${X(this.state)} ${t.message}
|
|
23
|
+
`,o=this.userInput,n=t.placeholder,a=o===""&&n!==void 0,l=this.isNavigating||a?u("dim",a?n:o):this.userInputWithCursor,h=this.options,d=this.filteredOptions.length!==h.length?u("dim",` (${this.filteredOptions.length} match${this.filteredOptions.length===1?"":"es"})`):"";switch(this.state){case"submit":return`${r}${i?`${u("gray",g)} `:""}${u("dim",`${this.selectedValues.length} items selected`)}`;case"cancel":return`${r}${i?`${u("gray",g)} `:""}${u(["strikethrough","dim"],o)}`;default:{let c=this.state==="error"?"yellow":"cyan",p=i?`${u(c,g)} `:"",v=i?u(c,W):"",f=[`${u("dim","\u2191/\u2193")} to navigate`,`${u("dim",this.isNavigating?"Space/Tab:":"Tab:")} select`,`${u("dim","Enter:")} confirm`,`${u("dim","Type:")} to search`],$=this.filteredOptions.length===0&&o?[`${p}${u("yellow","No matches found")}`]:[],I=this.state==="error"?[`${p}${u("yellow",this.error)}`]:[],S=[...`${r}${i?u(c,g):""}`.split(`
|
|
24
|
+
`),`${p}${u("dim","Search:")} ${l}${d}`,...$,...I],P=[`${p}${f.join(" \u2022 ")}`,v],F=kt({cursor:this.cursor,options:this.filteredOptions,style:(_,y)=>e(_,y,this.selectedValues,this.focusedValue),maxItems:t.maxItems,output:t.output,rowPadding:S.length+P.length});return[...S,...F.map(_=>`${p}${_}`),...P].join(`
|
|
25
|
+
`)}}}});return s.prompt()};var Lt=t=>{let e=t.active??"Yes",s=t.inactive??"No";return new K({active:e,inactive:s,signal:t.signal,input:t.input,output:t.output,initialValue:t.initialValue??!0,render(){let i=t.withGuide??V.withGuide,r=`${X(this.state)} `,o=i?`${u("gray",g)} `:"",n=G(t.output,t.message,o,r),a=`${i?`${u("gray",g)}
|
|
26
|
+
`:""}${n}
|
|
27
|
+
`,l=this.value?e:s;switch(this.state){case"submit":{let h=i?`${u("gray",g)} `:"";return`${a}${h}${u("dim",l)}`}case"cancel":{let h=i?`${u("gray",g)} `:"";return`${a}${h}${u(["strikethrough","dim"],l)}${i?`
|
|
28
|
+
${u("gray",g)}`:""}`}default:{let h=i?`${u("cyan",g)} `:"",d=i?u("cyan",W):"";return`${a}${h}${this.value?`${u("green",ht)} ${e}`:`${u("dim",Y)} ${u("dim",e)}`}${t.vertical?i?`
|
|
29
|
+
${u("cyan",g)} `:`
|
|
30
|
+
`:` ${u("dim","/")} `}${this.value?`${u("dim",Y)} ${u("dim",s)}`:`${u("green",ht)} ${s}`}
|
|
31
|
+
${d}
|
|
32
|
+
`}}}}).prompt()};var ws={light:m("\u2500","-"),heavy:m("\u2501","="),block:m("\u2588","#")};var J=(t,e)=>t.includes(`
|
|
33
|
+
`)?t.split(`
|
|
34
|
+
`).map(s=>e(s)).join(`
|
|
35
|
+
`):e(t),Dt=t=>{let e=(s,i)=>{let r=s.label??String(s.value);switch(i){case"disabled":return`${u("gray",Y)} ${J(r,o=>u("gray",o))}${s.hint?` ${u("dim",`(${s.hint??"disabled"})`)}`:""}`;case"selected":return`${J(r,o=>u("dim",o))}`;case"active":return`${u("green",ht)} ${r}${s.hint?` ${u("dim",`(${s.hint})`)}`:""}`;case"cancelled":return`${J(r,o=>u(["strikethrough","dim"],o))}`;default:return`${u("dim",Y)} ${J(r,o=>u("dim",o))}`}};return new H({options:t.options,signal:t.signal,input:t.input,output:t.output,initialValue:t.initialValue,render(){let s=t.withGuide??V.withGuide,i=`${X(this.state)} `,r=`${we(this.state)} `,o=G(t.output,t.message,r,i),n=`${s?`${u("gray",g)}
|
|
36
|
+
`:""}${o}
|
|
37
|
+
`;switch(this.state){case"submit":{let a=s?`${u("gray",g)} `:"",l=G(t.output,e(this.options[this.cursor],"selected"),a);return`${n}${l}`}case"cancel":{let a=s?`${u("gray",g)} `:"",l=G(t.output,e(this.options[this.cursor],"cancelled"),a);return`${n}${l}${s?`
|
|
38
|
+
${u("gray",g)}`:""}`}default:{let a=s?`${u("cyan",g)} `:"",l=s?u("cyan",W):"",h=n.split(`
|
|
39
|
+
`).length,d=s?2:1;return`${n}${a}${kt({output:t.output,cursor:this.cursor,options:this.options,maxItems:t.maxItems,columnPadding:a.length,rowPadding:h+d,style:(c,p)=>e(c,c.disabled?"disabled":p?"active":"inactive")}).join(`
|
|
40
|
+
${a}`)}
|
|
41
|
+
${l}
|
|
42
|
+
`}}}}).prompt()};var Is=`${u("gray",g)} `;var Nt=t=>new q({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,output:t.output,signal:t.signal,input:t.input,render(){let e=t?.withGuide??V.withGuide,s=`${`${e?`${u("gray",g)}
|
|
43
|
+
`:""}${X(this.state)} `}${t.message}
|
|
44
|
+
`,i=t.placeholder?u("inverse",t.placeholder[0])+u("dim",t.placeholder.slice(1)):u(["inverse","hidden"],"_"),r=this.userInput?this.userInputWithCursor:i,o=this.value??"";switch(this.state){case"error":{let n=this.error?` ${u("yellow",this.error)}`:"",a=e?`${u("yellow",g)} `:"",l=e?u("yellow",W):"";return`${s.trim()}
|
|
45
|
+
${a}${r}
|
|
46
|
+
${l}${n}
|
|
47
|
+
`}case"submit":{let n=o?` ${u("dim",o)}`:"",a=e?u("gray",g):"";return`${s}${a}${n}`}case"cancel":{let n=o?` ${u(["strikethrough","dim"],o)}`:"",a=e?u("gray",g):"";return`${s}${a}${n}${o.trim()?`
|
|
48
|
+
${a}`:""}`}default:{let n=e?`${u("cyan",g)} `:"",a=e?u("cyan",W):"";return`${s}${n}${r}
|
|
49
|
+
${a}
|
|
50
|
+
`}}}}).prompt();async function Z(t){let e=await Nt(t);return k(e)&&(D("Operation cancelled by user."),process.exit(0)),e}async function Ps(t){if(t.signal?.aborted)throw new tt("Operation cancelled by user.",Q.Interrupted);let e=await Lt(t);if(t.signal?.aborted)throw new tt("Operation cancelled by user.",Q.Interrupted);return k(e)&&(D("Operation cancelled by user."),process.exit(0)),e}async function _e(t){let e=await Dt(t);return k(e)&&(D("Operation cancelled by user."),process.exit(0)),e}var xe=new Set(["__enter_manually__","__prev_page__","__next_page__","__search_again__"]),Gt=10;function Ts(t,e){if(xe.has(t))throw new N(`${e} uses a reserved internal prompt value. Choose or enter a different value.`)}async function Wt(t){let e={enterManually:"(Enter manually...)",previousPage:"\u2190 Previous page",nextPage:"Next page \u2192",searchAgain:"(Search / filter...)"},s=await _e({message:t.message,options:[...t.items.map(i=>({...i,value:{kind:"value",value:i.value,source:"option"}})),...t.controls.map(({control:i,label:r})=>({value:{kind:"control",control:i},label:r??e[i]}))]});return s.kind==="control"&&s.control==="enterManually"?{kind:"value",value:await Z({message:t.manualPromptMessage??t.message}),source:"manual"}:s.kind==="control"?{kind:"control",control:s.control}:s}function As(t,e){return[...Array.isArray(e)?e:[],t]}async function Vs(t){let e=[...t.options.map(n=>({...n,value:{kind:"value",value:n.value}})),{value:{kind:"manual"},label:"(Enter a table name manually...)"}],s=await Rt({message:t.message,options:e,maxItems:t.maxItems??Gt,required:!0,filter:(n,a)=>{let l=n.toLowerCase(),h=a.value.kind==="value"?a.value.value:"";return[a.label??"",a.hint??"",h].some(d=>d.toLowerCase().includes(l))}});k(s)&&(D("Operation cancelled by user."),process.exit(0));let i=s,r=i.flatMap(n=>n.kind==="value"?[{value:n.value,source:"option"}]:[]);i.some(n=>n.kind==="manual")&&r.push({value:await Z({message:t.manualPromptMessage??t.message}),source:"manual"});let o=new Map;for(let n of r)o.has(n.value)||o.set(n.value,n);return[...o.values()]}async function Fs(t){return(await Ce(t)).value}async function Ce(t){let e=t.pageSize??Gt,s=t.options;if(s.length<=e){let o=await jt(t.message,s,t.manualPromptMessage,!1);if(o.kind!=="value")throw new Error("Prompt returned an unexpected control selection.");return{value:o.value,source:o.source}}let i="",r={kind:"control",control:"searchAgain"};for(;r.kind==="control"&&r.control==="searchAgain";){let o=i.toLowerCase(),n=i?s.filter(l=>l.label.toLowerCase().includes(o)||l.value.toLowerCase().includes(o)):s,a=i?` \u2014 filtering "${i}" (${n.length}/${s.length})`:` (${s.length} total)`;r=await Ee(`${t.message}${a}`,n,t.manualPromptMessage,e),r.kind==="control"&&r.control==="searchAgain"&&(i=await Z({message:"Filter (leave blank to show all):"}))}if(r.kind!=="value")throw new Error("Prompt returned an unexpected control selection.");return{value:r.value,source:r.source}}async function Ee(t,e,s,i){if(e.length<=i)return jt(t,e,s,!0);let r=Math.ceil(e.length/i),o=0,n={kind:"control",control:"previousPage"};for(;n.kind==="control"&&(n.control==="previousPage"||n.control==="nextPage");){let a=o*i,l=e.slice(a,a+i),h=[];if(o>0&&h.push({control:"previousPage"}),o<r-1){let c=e.length-(a+i);h.push({control:"nextPage",label:`Next page \u2192 (${c} more)`})}h.push({control:"searchAgain"},{control:"enterManually"});let d=`${t} [page ${o+1}/${r}]`;n=await Wt({message:d,items:l,controls:h,manualPromptMessage:s}),n.kind==="control"&&n.control==="previousPage"?o--:n.kind==="control"&&n.control==="nextPage"&&o++}return n}async function jt(t,e,s,i){return Wt({message:t,items:e,controls:i?[{control:"searchAgain"},{control:"enterManually"}]:[{control:"enterManually"}],manualPromptMessage:s})}function Os(t){let{flags:e,env:s,message:i,initialValue:r,description:o,default:n}=t;return{flags:e,env:s,description:o,default:n,customPrompt:async()=>await Z({message:i,initialValue:r})}}function Me(t){let e=t.match(/\/environments\/([^/]+)\/?$/);return e?e[1]:t}function ks(){if(!et().appConfig)throw new N(`No ${j} found in the current directory. Run \`${"ms"} app create\` to scaffold an app, or run this command from an existing app directory.`)}async function Rs(t){let e=await t.getOption("app",!0),s=et().appConfig?.appId,i=e??s;if(!i)throw new N(`Argument app is required. Use --app to specify it, or run this command from a directory with a ${j} (created by \`ms app create\`).`);return i}async function Ls(t,e={}){let{failIfMissing:s=!0}=e,i=e.overridesOnly?t.getEnvironmentId({overridesOnly:!0}):t.getEnvironmentId();if(!i){if(s)throw new N(`No environment ID found. Use --environment-id or -e to specify it, or run this command from a directory with a ${j} (created by \`ms app create\`).`);return}return Me(i)}function Ds(t){return/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function Ns(t,e){switch(t){case"gcchigh":case"dod":return`https://login.microsoftonline.us/${e||"organizations"}`;case"mooncake":return`https://login.partner.microsoftonline.cn/${e||"organizations"}`;default:return`https://login.microsoftonline.com/${e||"organizations"}`}}export{Z as a,Ps as b,_e as c,Ts as d,As as e,Vs as f,Fs as g,Ce as h,Os as i,Me as j,ks as k,Rs as l,Ls as m,Ds as n,Ns as o};
|
|
51
|
+
/*!
|
|
52
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
53
|
+
*/
|
|
54
|
+
//# sourceMappingURL=chunk-5BE4TLDK.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{f as s}from"./chunk-OUKOEUZA.js";import{I as a,M as i}from"./chunk-4AO24KKT.js";import{spawn as c}from"node:child_process";var g={showUserCode({userCode:t,verificationUri:e,expiresIn:r}){i(""),i("First copy your one-time code:"),i(""),i(` ${t}`),i(""),i("Then visit this URL to sign in to GitHub:"),i(""),i(` ${e}`),i(""),i(`(Code expires in ${Math.round(r/60)} minutes.)`)},showWaiting(){i("Waiting for authentication...")},openVerificationUri(t){return f(t,{skip:!1})}},p=class{showUserCode(e){this._emit({phase:"github-auth-initiated",sessionId:e.sessionId,userCode:e.userCode,verificationUri:e.verificationUri,expiresIn:e.expiresIn,pollIntervalSeconds:e.pollIntervalSeconds})}showWaiting(){}showPollIteration(){this._emit({phase:"github-auth-pending"})}showComplete(e){this._emit({phase:"github-auth-complete",githubLogin:e.githubLogin,mappingExpiresAt:e.mappingExpiresAt})}_emit(e){a(e)}};function f(t,e){if(e.skip||process.stdin.isTTY===!1||s("MS_NO_BROWSER")==="1"||s("CI")==="true")return!1;let r;try{r=new URL(t)}catch{return!1}if(r.protocol!=="https:")return!1;try{let n=l(t,process.platform);if(!n)return!1;let o=c(n.file,n.args,{shell:!1,detached:!0,stdio:"ignore"});return o.on("error",()=>{}),o.unref(),!0}catch{return!1}}function l(t,e){switch(e){case"win32":return{file:"cmd.exe",args:["/c","start","",t]};case"darwin":return{file:"open",args:[t]};case"linux":return{file:"xdg-open",args:[t]};default:return}}export{g as a,p as b};
|
|
8
|
+
/*!
|
|
9
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
+
*/
|
|
11
|
+
//# sourceMappingURL=chunk-A57M2UGH.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*as n from"fs";import*as e from"path";var i=["bun","pnpm","yarn","npm"];function p(a,s){let t=s?.packageManager?.split("@")[0];return t&&i.includes(t)?t:n.existsSync(e.join(a,"bun.lockb"))||n.existsSync(e.join(a,"bun.lock"))?"bun":n.existsSync(e.join(a,"pnpm-lock.yaml"))?"pnpm":n.existsSync(e.join(a,"yarn.lock"))?"yarn":"npm"}import*as r from"fs";import*as c from"path";function g(a){let s=c.join(a,"package.json");return r.existsSync(s)?JSON.parse(r.readFileSync(s,"utf8")):{}}export{p as a,g as b};
|
|
8
|
+
/*!
|
|
9
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
+
*/
|
|
11
|
+
//# sourceMappingURL=chunk-ATUGCFVC.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 C,c as F,d as S}from"./chunk-C7V6WEZM.js";import{a as c,b as f,c as g,d as m}from"./chunk-OUKOEUZA.js";import{O as p}from"./chunk-4AO24KKT.js";var o={ga:{stage:"development",displayName:"Portable Definitions",description:"Adds portable app and project definitions",isEnabledInWorkspace:async()=>!1},codegenv3:{stage:"development",displayName:"Simplified Codegen",description:"Adds simplified code generation",isEnabledInWorkspace:async()=>!1},state:{stage:"experimental",displayName:"App State",description:"Adds the ms project state commands",isEnabledInWorkspace:async e=>[e?.state,e?.data,e?.db].some(t=>t?.enabled===!0)},alm:{stage:"development",displayName:"Application Lifecycle Management",description:"Adds deployment target and other project-based capabilities",isEnabledInWorkspace:async e=>!!e?.projectId},projects:{stage:"development",displayName:"Managed Projects",description:"Adds managed project commands and Managed DevOps app deployments",isEnabledInWorkspace:async(e,t)=>t!==void 0||!!e?.projectId},rayfin:{stage:"development",displayName:"Rayfin",description:"Adds Rayfin backend support",isEnabledInWorkspace:async()=>!1}},u={"72f988bf-86f1-41af-91ab-2d7cd011db47":{}};function T(e){return`FEATURE_${e.toUpperCase()}`}var I="features";function x(e){return e.trim().toLowerCase()}function L(e){return Object.hasOwn(o,e)}function O(){return Object.keys(o).filter(e=>o[e].stage!=="development")}function U(e){if(typeof e!="string")return;let t=e.trim().toLowerCase();return t==="enabled"||t==="disabled"?t:void 0}function k(e){let t=e?.[I];return F(t)?t:{}}function j(e){let t=new Map;for(let[n,r]of Object.entries(k(e))){let a=U(r);a&&t.set(x(n),a)}return t}var y=!1;function v(){try{return j(S())}catch{return y||(y=!0,p(`Ignoring saved feature settings: couldn't read ${C()}. Make sure it contains a valid JSON object, or delete it to clear your saved settings.`)),new Map}}var b;function M(e){b=e}function E(){return b?.getUserTenantId()?.trim().toLowerCase()||void 0}function R(e,t){if(!(t===void 0||!Object.hasOwn(u,t)))return u[t][e]}var N=new Set;async function $(e,t){let n=new Set;for(let r of Object.keys(o))await o[r].isEnabledInWorkspace(e,t)&&n.add(r);N=n}function D(e,t,n,r){let a=T(e),i=f(a),d=n.get(e),l=R(e,r),s={name:e,stage:t.stage,description:t.description,envVar:c(a),...i!==void 0&&{envValue:i},...d&&{userSetting:d},...r!==void 0&&{tenantId:r},...l&&{tenantDefault:l}};return g(i)?{...s,enabled:!0,source:"environment"}:m(i)?{...s,enabled:!1,source:"environment"}:d?{...s,enabled:d==="enabled",source:"userSettings"}:l?{...s,enabled:l==="enabled",source:"tenant"}:{...s,enabled:!1,source:"default"}}function A(e,t,n){let r=o[e],a=D(e,r,t,n),i=N.has(e);return i&&!a.enabled?{...a,usedInWorkspace:i,enabled:!0,source:"workspace"}:{...a,usedInWorkspace:i}}function _(e,t=v()){return A(e,t,E())}function z(e=v()){let t=E();return Object.keys(o).map(n=>A(n,e,t)).filter(n=>n.enabled||n.stage!=="development")}function B(e){return _(e).enabled}export{o as a,T as b,I as c,x as d,L as e,O as f,U as g,k as h,j as i,M as j,$ as k,_ as l,z as m,B as n};
|
|
8
|
+
/*!
|
|
9
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
+
*/
|
|
11
|
+
//# sourceMappingURL=chunk-B6REHI77.js.map
|
|
@@ -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{j as P,o as k}from"./chunk-5BE4TLDK.js";import{K as N,M as A,N as w,Pb as I,R as b,c as v,y as l}from"./chunk-E2O4YZX2.js";import{a as O,b as x,c as S,d as L,e as T,f as M,g as $,h as z}from"./chunk-IM7SC23O.js";import{n as D}from"./chunk-B6REHI77.js";import{a as C,b as _}from"./chunk-OUKOEUZA.js";import{l as h}from"./chunk-WS6TGUH7.js";import{a as R}from"./chunk-3UIUI5Q2.js";import{M as f,e as m,f as p}from"./chunk-4AO24KKT.js";var F={treatment:"presenceOnly"};function E(s){let e=s.trim();if(!e)return"path:empty";let t=/^([a-zA-Z]:[\\/]|\\\\|\/)/.test(e),n=e.lastIndexOf("."),i=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\")),r=n>i?e.slice(n).toLowerCase():"";return`path:${t?"absolute":"relative"}${r?`:${r}`:""}`}function H(s){try{let e=new URL(s),t=e.hostname.toLowerCase(),n=t==="localhost"||t==="127.0.0.1"||t==="::1"?"localhost":"remote",i=e.protocol.replace(":","")||"unknown";return`url:${n}:${i}`}catch{return"url:unparseable"}}function G(s){let e=s.trim().toLowerCase();if(!e||e==="none")return"repo:none";if(e==="native")return"repo:native";try{let t=new URL(s).hostname.toLowerCase();return t==="github.com"?"repo:github.com":t.includes("ghe")?"repo:ghe":"repo:other"}catch{return"repo:other"}}function J(s){let e=s.trim().toLowerCase();return e==="build"||e==="none"?e:"invalid"}function Y(s){let e=s.trim(),t=e.match(/\/environments\/([^/]+)\/?$/i);return v(t?t[1]:e)}var B={connector:{treatment:"full"},solutionId:{treatment:"full"},connectionId:{treatment:"full"},connection:{treatment:"full"},connectionRef:{treatment:"full"},as:{treatment:"full"},dataverseEnvironmentId:{treatment:"full"},environmentId:{treatment:"full",normalize:Y},linkId:{treatment:"full"},repositoryId:{treatment:"full"},appId:{treatment:"full"},template:{treatment:"full"},commit:{treatment:"full"},cloud:{treatment:"full"},port:{treatment:"full"},mode:{treatment:"full"},permission:{treatment:"full"},access:{treatment:"full"},skipCodegen:{treatment:"full"},useV1Codegen:{treatment:"full"},useSso:{treatment:"full"},offline:{treatment:"full"},configOnly:{treatment:"full"},onlyAllowed:{treatment:"full"},force:{treatment:"full"},forceReauth:{treatment:"full"},openBrowser:{treatment:"full"},wait:{treatment:"full"},browser:{treatment:"full"},showLog:{treatment:"full"},deviceCode:{treatment:"full"},nonInteractive:{treatment:"full"},json:{treatment:"full"},color:{treatment:"full"},buildPath:{treatment:"descriptor",describe:E},buildEntryPoint:{treatment:"descriptor",describe:E},iconPath:{treatment:"descriptor",describe:E},artifact:{treatment:"descriptor",describe:E},localAppUrl:{treatment:"descriptor",describe:H},repo:{treatment:"descriptor",describe:G},buildType:{treatment:"descriptor",describe:J},displayName:{treatment:"presenceOnly"},description:{treatment:"presenceOnly"},search:{treatment:"presenceOnly"},app:{treatment:"presenceOnly"},name:{treatment:"presenceOnly"},buildCommand:{treatment:"presenceOnly"},dataset:{treatment:"presenceOnly"},sqlStoredProcedure:{treatment:"presenceOnly"},resourceName:{treatment:"presenceOnly"},stage:{treatment:"presenceOnly"},status:{treatment:"presenceOnly"},table:{treatment:"presenceOnly"},top:{treatment:"presenceOnly"}};function W(s){return B[s]??F}function V(s,e){let t=W(s);if(e==null||e==="")return{treatment:t.treatment};switch(t.treatment){case"full":{if(typeof e=="string"||typeof e=="number"||typeof e=="boolean"){if(t.normalize){if(typeof e!="string")return{treatment:"presenceOnly"};let n=t.normalize(e);return n===void 0?{treatment:"presenceOnly"}:{treatment:"full",value:n}}return{treatment:"full",value:e}}return{treatment:"presenceOnly"}}case"descriptor":{let n=typeof e=="string"?e:String(e);try{return{treatment:"descriptor",value:t.describe(n)}}catch{return{treatment:"descriptor",value:"unparseable"}}}default:return{treatment:"presenceOnly"}}}function c(s){return typeof s!="string"?void 0:s.trim()||void 0}function q(s){return s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}var j=class{constructor(e,t,n,i,r=x(process.argv,T)){this._httpClient=e;this._logger=t;this._authenticationProvider=n;this._accountManager=i;this._resolvedCommand=r,this._resolvedCommand&&(this._verb=this._resolvedCommand.path.join(" "),this._tokensConsumed=this._resolvedCommand.tokensConsumed),this._program=z(this._resolvedCommand);let o=I(),a=c(o.appConfig?.environmentId),d=c(_("MAAF_DEBUG_ENVIRONMENT_ID"));this._configEnvironmentId=a,this._debugEnvironmentId=d,this._environmentId=a??d,!a&&d&&!this._resolvedCommand?.localOnly&&f(`[debug] ${C("MAAF_DEBUG_ENVIRONMENT_ID")} is set to '${d}'.`);let u=this._resolvedCommand?.localOnly?void 0:o.appConfig?.cloud;if(u){let y=u.toLowerCase();if(!m.includes(y))throw new l(`Invalid cloud value '${u}' in the local config. Valid values are: ${m.join(", ")}.`);this._cloud=y,this._region=p(this._cloud)}this._cloud||this.addOption({flags:{key:h.Cloud.name},env:h.Cloud.envVar,default:"public",description:R.global.cloud}),this._resolvedCommand?.localOnly||N({httpClient:this._httpClient,logger:this._logger,region:this._region??p("public"),environmentName:this._resolveEnvironmentId()||"default",featureGates:{useManagedDevOpsDeployment:this.isManagedDevOpsDeploymentEnabled()}})}_httpClient;_logger;_authenticationProvider;_accountManager;_environmentId;_configEnvironmentId;_debugEnvironmentId;_environmentIdNotified=!1;_cloud;_region;_verb;_resolvedCommand;_tokensConsumed=0;_program;_options={};_positionalArgNames=[];_isParsed=!1;_parameterTelemetry=new Map;isManagedDevOpsDeploymentEnabled(){return D("projects")}addSwitch(e){this._createOption(e,!1)}addSwitches(e){e.forEach(t=>this._createOption(t,!1))}consumePositionalArg(e){let t=e.startsWith("[")||e.startsWith("<")?e.slice(1,-1):e;this._program.argument(`[${t}]`),this._positionalArgNames.push(e),this._program.usage(`${this._positionalArgNames.join(" ")} [options]`)}consumePositionalArgs(e){this._program.argument(`[${e}...]`),this._positionalArgNames.push(`<${e}...>`),this._program.usage(`${this._positionalArgNames.join(" ")} [options]`)}getPositionalArg(e){let t=this._program.processedArgs[e];return typeof t=="string"?t:void 0}getPositionalArgs(e){let t=this._program.processedArgs[e];return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}addOption(e){this._createOption(e)}addOptions(e){e.forEach(t=>this._createOption(t))}async runVerb(){if(this._tokensConsumed>0){let e=[process.argv[0],process.argv[1],...process.argv.slice(2+this._tokensConsumed)];this._program.parse(e)}else this._program.parse();if(this._isParsed=!0,this._captureExplicitCliParameters(),this.useProjectConfigDefaults(),await this._getRequiredVariables(),!this._region)throw new l(`Region is not set. Use --cloud or set the ${C("CLOUD_INSTANCE")} environment variable.`);this._resolvedCommand?.localOnly||(this._logger.setTelemetryContext({region:this._region}),await this._authenticationProvider.initAsync(this._region)),this._logger.trackActivityEvent("Initialize",{verb:this._verb})}handleGlobalHelpOrFlagsAndExit(){let e=process.argv[2];if(e||this._program.help(),e.startsWith("-")){this._program.parse(process.argv),this._isParsed=!0;return}if(this._resolvedCommand||this._rejectNonRootVersionFlag(),this._tryPrintDeepTypedHelp()&&process.exit(0),!this._resolvedCommand){let t=S(process.argv,T);if(t){if(t.unknownToken!==void 0)throw new l(`Unknown type '${t.unknownToken}' for '${"ms"} ${t.pathTokens.join(" ")}'. Run "${"ms"} ${t.pathTokens.join(" ")} --help" for available types.`);let n=$(t.pathTokens);n&&(f(`${O()}
|
|
8
|
+
|
|
9
|
+
${n}`),process.exit(0))}if(L(e,T)){let n=process.argv[3];if(n&&!n.startsWith("-"))throw new l(`Unknown command '${n}' under '${"ms"} ${e}'. Run "${"ms"} ${e} --help" for available commands.`);f(`${O()}
|
|
10
|
+
|
|
11
|
+
${M(e)}`),process.exit(0)}throw new l(`Unknown command '${e}'. Run "${"ms"} --help" for available commands.`)}}_tryPrintDeepTypedHelp(){let e=process.argv.slice(2),t=e.findIndex(r=>r==="--help"||r==="-h");if(t===-1)return!1;let n=e.slice(0,t).filter(r=>!r.startsWith("-"));if(this._resolvedCommand&&n.length<=this._resolvedCommand.tokensConsumed)return!1;let i=$(n);return i?(this._rejectNonRootVersionFlag(),f(`${O()}
|
|
12
|
+
|
|
13
|
+
${i}`),!0):!1}_rejectNonRootVersionFlag(){let e=process.argv.slice(2),t=e.indexOf("--"),n=e.slice(0,t===-1?void 0:t).find(i=>i==="--version"||i==="-v");n&&this._program.error(`unknown option '${n}'`,{code:"commander.unknownOption"})}getVerb(){if(!this._resolvedCommand)throw new l(`No command specified. Run "${"ms"} --help" for available commands.`);return this._verb}getResolvedCommand(){return this._resolvedCommand}async getOption(e,t){let n=I(),i=this._program.getOptionValueSource(e),r=i==="cli"?this._program.getOptionValue(e):void 0,o=this._options[e],a=i==="cli"?"cli":void 0;if(r===void 0&&o&&o.env&&(r=_(o.env),r!==void 0&&(a="env")),r===void 0&&o&&o.default!==void 0&&(r=o.default),!r&&!t&&o?.customPrompt){if(n.interactive)r=await o.customPrompt(),r&&(a="prompt");else if(!o.optionalInNonInteractive){let d=o.flags.key,u=o.flags.alias,y=u?`--${d} (-${u})`:`--${d}`,U=o.env?` or environment variable (${C(o.env)})`:"";throw new l(`Missing required option ${y}${U}. In non-interactive mode, all parameters must be provided via flags or environment variables.`)}}return a&&this._recordParameter(e,a,r),r}getAuthenticationProvider(){return this._authenticationProvider}getAccountManager(){if(!this._accountManager)throw new l("Account management commands (auth login/logout/status/switch) are only available in interactive mode. They cannot be used with service principal or HTTP forward authentication.");return this._accountManager}getHttpClient(){return this._httpClient}async getTenantIdAsync(){if(!(this._accountManager!==void 0)){let t=this._authenticationProvider.getUserTenantId();if(t)return t}if(this._region&&this._region!=="local"&&this._region!=="dev"){let t=b()[this._region];await this._authenticationProvider.getAccessTokenForResource(t)}return this._authenticationProvider.getUserTenantId()}getAuthResourceUrl(){let e=this._region??p("public");return e==="local"||e==="dev"?b().test:b()[e]}getCloud(){return this._cloud}useProjectConfigDefaults(){let e=I().projectConfig;if(!e||this._resolvedCommand?.localOnly)return;if(!this._configEnvironmentId){let n=c(e.environmentId);n&&(this._configEnvironmentId=n,this._environmentId=n,A(P(n)))}let t=this._program.getOptionValueSource(h.Cloud.name)==="cli"||_(h.Cloud.envVar)!==void 0;if(!this._cloud&&!t&&e.cloud){let n=e.cloud.toLowerCase();if(!m.includes(n))throw new l(`Invalid cloud value '${e.cloud}' in the local project config. Valid values are: ${m.join(", ")}.`);this._cloud=n,this._region=p(this._cloud),w(this._region)}}getLoginAuthority(e){return k(this._region,e)}setDescription(e){this._program.description(e)}isJsonMode(){return this._isParsed?this._program.opts().json===!0:process.argv.includes("--json")}addExamples(e){!e||e.length===0||this._program.addHelpText("after",()=>{let t=["","Examples:"];return e.forEach(n=>{t.push(` $ ${n}`)}),t.join(`
|
|
14
|
+
`)})}getRegisteredFlags(){let e=new Set;for(let t of this._program.options)t.long&&e.add(t.long),t.negate&&t.long?.startsWith("--no-")&&e.add(`--${t.long.slice(5)}`);return e}getEnvironmentId(e={}){let t=this._resolveEnvironmentId(e);return t&&this.updateEnvironmentId(t),t}_resolveEnvironmentId(e={}){let t=this._options.environmentId,n=c(this._program.getOptionValue("environmentId")),i=c(t?.env?_(t.env):void 0),r=e.overridesOnly?void 0:c(e.includeConfig===!1?this._debugEnvironmentId:this._environmentId),o=n??i??r;if(!o)return;let a;n?a="cli":i?a="env":e.includeConfig===!1?a="debug-env":c(this._configEnvironmentId)===o?a="config":c(this._debugEnvironmentId)===o&&(a="debug-env");let d=v(P(o));if(!d)throw new l("Invalid environment ID. Use a GUID or Default-<GUID>.");return a&&this._recordParameter("environmentId",a,d),d}updateEnvironmentId(e){if(this._environmentIdNotified)return;let t=v(P(e.trim()));if(!t)throw new l("Invalid environment ID. Use a GUID or Default-<GUID>.");this._environmentId=t,A(t),this._region&&this._logger.setTelemetryContext({environmentId:t,region:this._region}),this._environmentIdNotified=!0}async _getRequiredVariables(){if(!this._cloud){let e=await this.getOption("cloud");if(e){let t=e.toLowerCase();if(!m.includes(t))throw new l(`Invalid --cloud value '${e}'. Valid values are: ${m.join(", ")}.`);this._cloud=t,this._region=p(this._cloud),this._resolvedCommand?.localOnly||w(this._region)}}}_recordParameter(e,t,n){n==null||n===""||this._parameterTelemetry.set(e,{source:t,value:n})}_captureExplicitCliParameters(){for(let e of Object.keys(this._options))this._program.getOptionValueSource(e)==="cli"&&this._recordParameter(e,"cli",this._program.getOptionValue(e))}buildParameterTelemetryPayload(){let e={};for(let[t,n]of this._parameterTelemetry.entries()){let i=this._options[t]?.flags.key??q(t),r=V(t,n.value);e[i]=r.value!==void 0?{source:n.source,value:r.value}:{source:n.source}}return this._finalizeParameterTelemetryPayload(e)}_finalizeParameterTelemetryPayload(e){let n=JSON.stringify(e);if(n.length<=4e3)return{paramsJson:n,paramsTruncated:!1};let i={};for(let[r,o]of Object.entries(e))i[r]={source:o.source};return{paramsJson:JSON.stringify(i),paramsTruncated:!0}}_createOption(e,t=!0){let i=t&&(e.default!==void 0||e.optionalInNonInteractive===!0)?`[optional] ${e.description??""}`:e.description,r=this._program.createOption(t?this._createFlags(e.flags):this._createSwitchFlags(e.flags),i);e.parseArg&&r.argParser(e.parseArg),(!this._resolvedCommand||e.hidden)&&r.hideHelp(),this._program.addOption(r),this._options[r.attributeName()]=e}_createFlags(e){let{key:t,alias:n}=e;return n?`-${n}, --${t} <${t}>`:`--${t} <${t}>`}_createSwitchFlags(e){let{key:t,alias:n}=e;return n?`-${n}, --${t}`:`--${t}`}};export{c as a,j as b};
|
|
15
|
+
/*!
|
|
16
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
17
|
+
*/
|
|
18
|
+
//# sourceMappingURL=chunk-BREK3DVB.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{c as r,m as i}from"./chunk-OB6WEE2V.js";import{O as o}from"./chunk-4AO24KKT.js";import*as e from"fs";import*as u from"path";function s(){return u.join(r,i)}function g(){o(`The CLI's settings file is at ${s()}.`)}function f(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function a(){let t=s();if(!e.existsSync(t))return;let n=JSON.parse(e.readFileSync(t,"utf-8"));if(!f(n))throw new Error(`${i} must contain a JSON object.`);return n}function S(t){return{errorName:t instanceof Error?t.name:typeof t,errorCode:t?.code}}function d(t){let n=t(a()??{});return e.mkdirSync(r,{recursive:!0}),e.writeFileSync(s(),JSON.stringify(n,null,2),"utf-8"),n}export{s as a,g as b,f as c,a as d,S as e,d as f};
|
|
8
|
+
/*!
|
|
9
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
+
*/
|
|
11
|
+
//# sourceMappingURL=chunk-C7V6WEZM.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
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{m as E}from"./chunk-5BE4TLDK.js";import{C as u,L as w,q as c,r as v,t as l,u as p,y as a}from"./chunk-E2O4YZX2.js";import{p as y}from"./chunk-OB6WEE2V.js";import{M as m,P as f}from"./chunk-4AO24KKT.js";async function A(n,r,t){try{let e=await n;if(e.status===200){if(e.data.operationSuccess===!1||e.data.environmentFound===!1||e.data.errorCode)throw new c(200,e.data.message,e.data.errorCode);let i=e.data.environment?.name;if(!i)throw new u("Routing service returned 200 with no environment name.");return i}let o=await p(r,e.pollingUrl,e.authResource,t);if(!o.environment?.name)throw new u("Routing service finished provisioning but returned no environment name.");return o.environment.name}catch(e){throw P(e)}}function P(n){if(n instanceof c){let r=n.apiMessage?` ${n.apiMessage}`:" Ensure your account has the required permissions to create a Developer environment.";return new a(`Could not provision a Developer environment for your tenant (status ${n.status}).${r}`)}return n instanceof v?new a("Timed out waiting for a Developer environment to provision. Try again."):n instanceof Error?n:new Error(String(n))}function k(n,r,t,e,o){let{trackBackgroundFailure:i=!0,dogfood:I=!1}=o??{},g=n.getHttpClient(),{region:R}=w(),d=A(l(g,r,y,{provisionDataverse:!1,...I?{dogfood:!0}:{}},R,t),g,t);return i&&d.catch(s=>{t.trackErrorEvent(`${e}.RoutingEnvironmentBackgroundFailure`,{error:s instanceof Error?s.message:String(s)})}),d}function h(n){let r=n instanceof Error?n.message:String(n);f(`Failed to resolve a developer environment.
|
|
8
|
+
|
|
9
|
+
${r}
|
|
10
|
+
|
|
11
|
+
To retry, run the same command again. Alternatively, pass --environment-id <id> to use a known environment.`)}async function D(n,r){if(n)return n;if(!r)throw new a("Unable to resolve a developer environment. Pass --environment-id <id> to specify one explicitly.");try{return await r}catch(t){throw h(t),t}}async function L(n,r,t){let e=await E(n,{failIfMissing:!1});if(e)return e;let o=await n.getTenantIdAsync();if(!o)throw new a("Unable to determine tenant ID. Ensure you are logged in.");t?.jsonMode||m("No environment specified \u2014 resolving your developer environment\u2026");let i=await C(n,o,r,t?.telemetryNamespace??"BrowseVerb");return n.updateEnvironmentId(i),t?.jsonMode||m(`Using developer environment ${i}.`),i}async function C(n,r,t,e){try{return await k(n,r,t,e,{trackBackgroundFailure:!1})}catch(o){throw h(o),o}}export{k as a,D as b,L as c};
|
|
12
|
+
/*!
|
|
13
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
14
|
+
*/
|
|
15
|
+
//# sourceMappingURL=chunk-CER3QPDN.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 p}from"./chunk-2UMD5IAQ.js";import{Qb as f,l as u,v as l,w as s,x as i}from"./chunk-E2O4YZX2.js";import{I as a}from"./chunk-4AO24KKT.js";function c(t){if(t instanceof Error)return t.message;if(typeof t=="string")return t;if(t==null)return String(t);try{let e=new WeakSet;return JSON.stringify(t,(n,r)=>{if(typeof r=="object"&&r!==null){if(e.has(r))return"[Circular]";e.add(r)}return r})}catch{return String(t)}}function m(t){if(!(t instanceof u))return null;let e="HttpRequestFailed",n=s.Platform,r=!1;return t.status===401?(e="HttpAuthenticationFailed",n=s.User):t.status===403?(e="HttpAuthorizationFailed",n=s.User):t.status===404?(e="HttpResourceNotFound",n=s.User):t.status===408?e="HttpRequestTimedOut":t.status===429?(e="HttpRequestThrottled",r=!0):t.status>=400&&t.status<500?(e="HttpRequestRejected",n=s.User):t.status>=500&&t.status<600&&(e="HttpServiceUnavailable"),new i(t.message,l.GeneralError,void 0,{errorCode:e,errorCategory:n,retryable:r,telemetryDetails:{httpStatus:t.status}})}function C(t){let e=p(t)??m(t)??t;return{error:e,message:c(e),exitCode:e instanceof i?e.exitCode:1}}function h(t){let{error:e,message:n,exitCode:r}=C(t),o=e instanceof i?e.outputDetails:void 0;a({success:!1,exitCode:r,errorMessage:n,...o!==void 0&&{errorData:o}});let d=e instanceof i?{errorCode:e.errorCode,errorCategory:e.errorCategory,exitCode:r,telemetryDetails:e.telemetryDetails,retryable:e.retryable}:{exitCode:r};throw new f(n,e instanceof i?e.errorData:void 0,d,e)}export{C as a,h as b};
|
|
8
|
+
/*!
|
|
9
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
10
|
+
*/
|
|
11
|
+
//# sourceMappingURL=chunk-CONEIY4I.js.map
|
|
@@ -0,0 +1,44 @@
|
|
|
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 K,c as Q}from"./chunk-EFTF4FA7.js";import{c as _}from"./chunk-5BE4TLDK.js";import{$ as G,C as F,L as E,Ob as I,Pb as M,S as H,U as W,V as Y,W as V,X as x,Y as R,Z as O,l as D,o as j,wa as J,x as B,y as m}from"./chunk-E2O4YZX2.js";import{e as z}from"./chunk-OUKOEUZA.js";import{E as q,G as $,M as g,O as v}from"./chunk-4AO24KKT.js";import*as ee from"http";import ne from"open";var X={defaultBehavior:"Allow",allowedConnectors:[]},T="Reason: The connector service rejected the automatic connection request.";function k(r,t){I().trackErrorEvent("Connection.AutoCreateFailed",{apiId:r,error:t instanceof Error?t.message:String(t)})}async function ge(r,t,e){if(r.toLowerCase().startsWith("shared_"))return r;let n=await Y(void 0,t??void 0),o=r.toLowerCase(),s=n.find(c=>c.name.toLowerCase()===`shared_${o}`);if(s)return s.name;let u=n.filter(c=>c.properties.displayName.toLowerCase()===o),a=u.length===0,f=a?n.filter(c=>c.properties.displayName.toLowerCase().includes(o)):u;if(f.length===0)return r;if(f.length===1)return a&&!e?.jsonMode&&g(`Resolved '${r}' \u2192 '${f[0].properties.displayName}' (${f[0].name})`),f[0].name;if(M().interactive&&!e?.jsonMode)return await _({message:`Multiple connectors match '${r}'. Select a connector:`,options:f.map(c=>({value:c.name,label:c.properties.displayName,hint:c.name}))});let l=f.map(c=>` ${c.name} (${c.properties.displayName})`).join(`
|
|
8
|
+
`);throw new m(`Multiple connectors match '${r}'. Specify the connector ID directly:
|
|
9
|
+
${l}`)}var Z="__create__",oe=600*1e3,L="1";async function Ce(r,t){let e=I(),n=await r.getTenantIdAsync();n||(e.trackErrorEvent("DlpSkippedNoTenantId",{apiId:t}),v(`Could not resolve tenant ID; skipping connector policy check. Sign in with '${"ms"} auth login' for full enforcement.`));let[o,s]=await Promise.all([H(t,e),n?G(e,n).catch(()=>(v("Could not verify connector policy; proceeding without enforcement."),X)):Promise.resolve(X)]);if(!o)throw new F(`Connector '${t}' not found. Run '${"ms"} connector list' to see available connector IDs.`);let u=(o.name??t).toLowerCase(),a=new Map(s.allowedConnectors.map(c=>[c.connectorId.toLowerCase(),c])),f=new Set((s.blockedConnectors??[]).map(c=>c.connectorId.toLowerCase()));if(s.defaultBehavior==="Block"?!a.has(u):f.has(u))throw Q(`Connector '${o.properties.displayName??t}' is blocked by your organization's connector policy.`,K.ConnectorPolicyBlocked,"connector_preflight");return{connector:o,tenantId:n,policy:s}}async function ye(r){let t=M(),{argumentProvider:e,apiId:n,connector:o,useSso:s,interactive:u=t.interactive,quiet:a=!1,nonInteractiveReason:f="cli-mode",connectionFilter:l,noMatchingConnectionMessage:c,beforeConnectionTest:i}=r,d=I(),C=E(),w=await W(n,d)??[],S=l?w.filter(l):w;if(!u&&l&&w.length>0&&S.length===0)throw new m(c??`No existing connections for '${o.properties.displayName??n}' satisfy the required connection settings.`);if(!u)return te({argumentProvider:e,apiId:n,connector:o,connections:S,useSso:s,quiet:a,nonInteractiveReason:f,beforeConnectionTest:i});if(s){if(!R(o))throw new m(`--use-sso was set but '${o.properties.displayName??n}' does not support single sign-on (SSO) authentication.
|
|
10
|
+
To fix: Re-run without --use-sso to create a connection interactively.`);let h=S.filter(p=>O(p,o));if(h.length>0){let[p]=h;return g(`Using existing SSO connection '${p.properties.displayName}' (${p.name}).`),h.length>1&&v(`Multiple SSO connections found for '${o.properties.displayName??n}'. Re-run with --connection-id <id> or -c <id> to use a specific one.`),{connectionId:p.name,autoSelected:!0}}let y=await A(e,n,i);return $(`Created a new connection '${y.properties.displayName}' (${y.name}).`),{connectionId:y.name,autoSelected:!1}}let N=[...S.map(h=>({value:h.name,label:h.properties.displayName,hint:h.name})),{value:Z,label:"(Create a new connection)"}],b=await _({message:"Select a connection:",options:N});if(b===Z){if(x(o))try{return{connectionId:(await A(e,n,i)).name,autoSelected:!1}}catch(U){k(n,U),v("Silent connection creation failed."),g(`Falling back to browser-based connection creation...
|
|
11
|
+
`)}else g(`This connector requires manual interaction. Opening browser for connection creation...
|
|
12
|
+
`);let h=n.startsWith("shared_")?n:`shared_${n}`,y=e.getEnvironmentId();if(!y)throw new m("Missing required information. Make sure you are running this command in a Copilot Managed Runtime directory.");let p=await re({connectorName:h,region:C.region,environmentId:y});if(p.status==="created"&&p.connectionName)return $("Connection created successfully!"),p.displayName&&g(` Display Name: ${p.displayName}`),g(` Connection ID: ${p.connectionName}`),{connectionId:p.connectionName,autoSelected:!1};throw p.status==="error"?new B(p.errorMessage??"Connection creation failed in the browser."):new m("Connection creation was cancelled.")}return{connectionId:b,autoSelected:!1}}async function te(r){let{argumentProvider:t,apiId:e,connector:n,connections:o,useSso:s,quiet:u=!1,nonInteractiveReason:a,beforeConnectionTest:f}=r,l=n.properties.displayName??e;if(s){if(!R(n))throw a==="json-mode"?new m(`--use-sso was set but '${l}' does not support single sign-on (SSO) authentication.
|
|
13
|
+
To fix: Re-run without --use-sso and provide --connection-id <id> or -c <id>.`):new m(`--use-sso was set but '${l}' does not support single sign-on (SSO) authentication.
|
|
14
|
+
To fix: Re-run without both --use-sso and --non-interactive to create a connection interactively.`);let i=o.filter(d=>O(d,n));if(i.length>0){let[d]=i;return u||g(`Using existing SSO connection '${d.properties.displayName}' (${d.name}).`),!u&&i.length>1&&v(`Multiple SSO connections found for '${l}'. Re-run with --connection-id <id> or -c <id> to use a specific one.`),{connectionId:d.name,autoSelected:!0}}try{let d=await A(t,e,f);return u||$(`Created a new connection '${d.properties.displayName}' (${d.name}).`),{connectionId:d.name,autoSelected:!1}}catch(d){throw k(e,d),a==="json-mode"?new m(`No SSO connection exists for '${l}' and automatic connection creation failed.
|
|
15
|
+
${T}
|
|
16
|
+
To fix: Create a connection, then re-run with --connection-id <id> or -c <id>.`):new m(`No SSO connection exists for '${l}' and automatic connection creation failed.
|
|
17
|
+
${T}
|
|
18
|
+
To fix: Create one interactively (re-run without --non-interactive),
|
|
19
|
+
then re-run with --connection-id <id> or -c <id>.`)}}if(o.length===1){let[i]=o;return u||g(`Using existing connection '${i.properties.displayName}' (${i.name}).`),{connectionId:i.name,autoSelected:!0}}if(o.length===0&&x(n))try{let i=await A(t,e,f);return u||$(`Created a new connection '${i.properties.displayName}' (${i.name}).`),{connectionId:i.name,autoSelected:!1}}catch(i){throw k(e,i),a==="json-mode"?new m(`No connection exists for '${l}' and automatic connection creation failed.
|
|
20
|
+
${T}
|
|
21
|
+
To fix: Create a connection, then re-run with --connection-id <id> or -c <id>.`):new m(`No connection exists for '${l}' and automatic connection creation failed.
|
|
22
|
+
${T}
|
|
23
|
+
To fix: Create one interactively (re-run without --non-interactive),
|
|
24
|
+
then re-run with --connection-id <id> or -c <id>.`)}throw o.length>1?(u||q({title:`Available connections for ${l}`,columns:[{header:"Display Name",maxWidth:40},{header:"Connection ID"}],rows:o.map(i=>[i.properties.displayName,i.name]),totalLabel:"connection(s) found"}),a==="json-mode"?new m(`Multiple connections exist for '${l}', so one cannot be selected automatically.
|
|
25
|
+
To fix: Re-run with --connection-id <id> or -c <id> to choose one.`):new m(`Multiple connections exist for '${l}', so one cannot be selected automatically.
|
|
26
|
+
To fix: Re-run with --connection-id <id> or -c <id> to choose one,
|
|
27
|
+
or re-run without --non-interactive to select one interactively.`)):a==="json-mode"?new m(`'${l}' requires a connection that cannot be created automatically in JSON mode.
|
|
28
|
+
To fix: Create a connection, then re-run with --connection-id <id> or -c <id>.
|
|
29
|
+
Tip: Run '${"ms"} connector list' to browse available connectors.`):new m(`'${l}' requires a connection that cannot be created automatically in non-interactive mode.
|
|
30
|
+
To fix: Create one interactively (re-run without --non-interactive),
|
|
31
|
+
then re-run with --connection-id <id> or -c <id>.
|
|
32
|
+
Tip: Run '${"ms"} connector list' to browse available connectors.`)}async function A(r,t,e){let n=I(),o=E();return J({authProvider:r.getAuthenticationProvider(),region:o.region,environmentName:o.environmentName,actionsParams:{connectorId:t},logger:n,beforeConnectionTest:e})}function ie(r,t){return`Note: connection '${r}' was auto-selected for connector '${t}' because no --connection-id was provided. For tabular connectors, the connection needs to have access to the target resource, so this failure may not clearly indicate the root cause:
|
|
33
|
+
- If the connection is broken or expired, re-authenticate it and re-run.
|
|
34
|
+
- If the connection is valid but targets the wrong resource, re-run with an explicit --connection-id <id> for the intended resource.`}async function we(r,t){try{return await r()}catch(e){throw t.autoSelected&&e instanceof Error&&!(e instanceof m)&&(e.message=`${e.message}
|
|
35
|
+
|
|
36
|
+
${ie(t.connectionId,t.connectorLabel)}`),e}}var ve="The connection test and later calls";async function Se(r){if(!z("ENABLE_CONNECTOR_USER_CONSENT"))return;let{apiId:t,connectionId:e}=r,n=r.impact??"The data source was added, but later calls",o=I(),s=o.trackScenario("ConnectorUserConsent",{apiId:t,connectionId:e}),u=a=>(r.defer||v(a),a);try{await V(t,e,o),s.complete();return}catch(a){return s.failure(a),a instanceof D&&a.status===403?u(`Could not request user consent on connection '${e}' (HTTP 403). ${n} against this connection may fail until your tenant admin grants the calling application the 'Connectivity.Connections.UserConsent' delegated permission.`):u(`Could not request user consent on connection '${e}'. ${n} against this connection may fail.`)}}async function re(r){let{connectorName:t,region:e,environmentId:n}=r,o=crypto.randomUUID();return new Promise((s,u)=>{let a=ee.createServer((i,d)=>{let C=new URL(i.url??"/","http://localhost");if(C.pathname==="/callback"&&i.method==="GET"){if(C.searchParams.get("nonce")!==o){d.writeHead(403,{"Content-Type":"text/html; charset=utf-8"}),d.end("<html><body><h2>Connection request verification failed. Please run the CLI command again.</h2></body></html>"),c(),s({status:"cancelled"});return}let S=C.searchParams.get("v");S!==L&&v(`Warning: callback protocol version mismatch (expected ${L}, got ${S??"none"}). Update the CLI to the latest version.`);let N=C.searchParams.get("status"),b=C.searchParams.get("message")??void 0;d.writeHead(200,{"Content-Type":"text/html; charset=utf-8"});let h;if(N==="created")h="<html><body><h2>Connection created! You can close this tab.</h2></body></html>";else if(N==="error"){let y=b?b.replace(/[&<>"']/g,p=>`&#${p.charCodeAt(0)};`):"";h=y?`<html><body><h2>Connection creation failed. You can close this tab.</h2><p>${y}</p></body></html>`:"<html><body><h2>Connection creation failed. You can close this tab.</h2></body></html>"}else h="<html><body><h2>Connection creation cancelled. You can close this tab.</h2></body></html>";d.end(h),c(),s(N==="created"?{status:"created",connectionId:C.searchParams.get("connectionId")??void 0,connectionName:C.searchParams.get("connectionName")??void 0,displayName:C.searchParams.get("displayName")??void 0}:N==="error"?{status:"error",errorMessage:b}:{status:"cancelled"});return}d.writeHead(404),d.end("Not found")});a.listen(0,"localhost",async()=>{let i=a.address(),C=`http://localhost:${typeof i=="object"&&i?i.port:0}/callback`,w=j(e,{connector:t,callbackUrl:C,nonce:o,protocolVersion:L,environmentId:n});g(`Opening browser at ${w}`);try{await ne(w,{wait:!1})}catch{g(`Could not open browser automatically. Please navigate to:
|
|
37
|
+
${w}`)}g(`Waiting for connection creation... (press Ctrl+C to cancel)
|
|
38
|
+
`)}),a.on("error",i=>{c(),u(i)});let f=setTimeout(()=>{g(`
|
|
39
|
+
Connection creation timed out after 10 minutes.`),c(),s({status:"cancelled"})},oe),l=()=>{g(`
|
|
40
|
+
Cancelling...`),c(),s({status:"cancelled"})};function c(){clearTimeout(f),process.off("SIGINT",l),a.close()}process.on("SIGINT",l)})}export{ge as a,Ce as b,ye as c,we as d,ve as e,Se as f};
|
|
41
|
+
/*!
|
|
42
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
43
|
+
*/
|
|
44
|
+
//# sourceMappingURL=chunk-DOCWK326.js.map
|