@microsoft/managed-apps-cli 0.19.0 → 0.21.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 +17 -149
- package/THIRD-PARTY-NOTICES.txt +9549 -0
- package/dist/AddConnector-4AMM746J.js +41 -0
- package/dist/AuthStatus-ZZIP3LBD.js +11 -0
- package/dist/AuthSwitch-HK7JU2FR.js +13 -0
- package/dist/Bin.js +8 -3
- package/dist/BuildMaafApp-MOTZOLJZ.js +11 -0
- package/dist/Cli-6CCXMCPX.js +54 -0
- package/dist/CreateMaafApp-TUO72CW7.js +20 -0
- package/dist/DeleteMaafApp-MZVGIAX3.js +11 -0
- package/dist/DeployMaafApp-KXATM3E3.js +14 -0
- package/dist/Dev-SHIA5S7X.js +14 -0
- package/dist/EnvironmentVariableAuthenticationProvider-5YTMRAE4.js +11 -0
- package/dist/GetMaafApp-ELB5KMHW.js +11 -0
- package/dist/GetMaafBuildStatus-3W7LI5TJ.js +11 -0
- package/dist/GetSettings-NM6H2U5F.js +11 -0
- package/dist/Init-CH5DUQWA.js +11 -0
- package/dist/ListConnectorActions-7SIFGPYR.js +11 -0
- package/dist/ListConnectors-TRKIWRVQ.js +11 -0
- package/dist/ListMaafApps-RT3PGZSJ.js +11 -0
- package/dist/Login-HG5S7LBC.js +11 -0
- package/dist/Logout-BUPHLOAH.js +11 -0
- package/dist/MockFetch-4CYTSNJ7.js +13 -0
- package/dist/NoOpAuthenticationProvider-DX3XNXF5.js +11 -0
- package/dist/NodeMsalAuthenticationProvider-HTH3V3G2.js +17 -0
- package/dist/Pack-AHKC2MYF.js +8 -0
- package/dist/PlayMaafApp-LWKJU2IN.js +12 -0
- package/dist/RefreshDataSource-ZFZJXJ5L.js +11 -0
- package/dist/RefreshGitAuth-5A3SX2HC.js +11 -0
- package/dist/RemoveDataSource-57JJLK5I.js +14 -0
- package/dist/ServicePrincipalAuthenticationProvider-SVKDZG6X.js +11 -0
- package/dist/SetSetting-RB3F7IXG.js +11 -0
- package/dist/ShareLinkCreate-7BCDPWY6.js +11 -0
- package/dist/ShareLinkList-4BI3WMNN.js +11 -0
- package/dist/ShareLinkRevoke-EEJVCRCY.js +11 -0
- package/dist/ShareList-LJDAEGI3.js +11 -0
- package/dist/ShareMaafApp-QFRXLYUD.js +11 -0
- package/dist/ShowMaafApp-3KK6NUG2.js +11 -0
- package/dist/TelemetrySettings-A474HALH.js +11 -0
- package/dist/UnshareMaafApp-423RNXCN.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-3BRAT6NP.js +11 -0
- package/dist/chunk-3YRE4IQ3.js +132 -0
- package/dist/chunk-5AUOEXAR.js +50 -0
- package/dist/chunk-6FFQN2SO.js +13 -0
- package/dist/chunk-6MXOK2LG.js +11 -0
- package/dist/chunk-7NXJAIJX.js +11 -0
- package/dist/chunk-DREO7EYO.js +20 -0
- package/dist/chunk-EV3TTTOT.js +8 -0
- package/dist/chunk-G33Q5FWT.js +42325 -0
- package/dist/chunk-HBLO3WDD.js +13 -0
- package/dist/chunk-MFPX2RFH.js +11 -0
- package/dist/chunk-NP2KJOYC.js +12 -0
- package/dist/chunk-OL6CTXQR.js +11 -0
- package/dist/chunk-PVAIJSAI.js +11 -0
- package/dist/chunk-QAFCXGBD.js +11 -0
- package/dist/chunk-QSB5P4RM.js +38 -0
- package/dist/chunk-RBG2H562.js +11 -0
- package/dist/chunk-S5HEU7XK.js +11 -0
- package/dist/chunk-TYRVM4PP.js +8 -0
- package/dist/chunk-U36HMOQW.js +77 -0
- package/dist/chunk-UBTSW22U.js +11 -0
- package/dist/chunk-USRRI5H4.js +11 -0
- package/dist/chunk-UT667QSU.js +8 -0
- package/dist/chunk-VFSTQAZ2.js +12 -0
- package/dist/chunk-VNEZZ3RI.js +11 -0
- package/dist/chunk-W7EWOZPO.js +104 -0
- package/dist/chunk-Y5AMO72S.js +10 -0
- package/dist/chunk-YIKNM523.js +15 -0
- package/dist/chunk-YMXXWGRV.js +11 -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/postcss-QUHZLBB7.js +68 -0
- package/dist/typescript-G2G6TDZF.js +28 -0
- package/dist/yaml-W5P5CGFK.js +166 -0
- package/package.json +22 -17
- package/dist/ArgumentProvider.d.ts +0 -144
- package/dist/ArgumentProvider.d.ts.map +0 -1
- package/dist/ArgumentProvider.js +0 -493
- package/dist/ArgumentProvider.js.map +0 -1
- package/dist/Authentication/ActiveAccountStore.d.ts +0 -24
- package/dist/Authentication/ActiveAccountStore.d.ts.map +0 -1
- package/dist/Authentication/ActiveAccountStore.js +0 -54
- package/dist/Authentication/ActiveAccountStore.js.map +0 -1
- package/dist/Authentication/EnvironmentVariableAuthenticationProvider.d.ts +0 -26
- package/dist/Authentication/EnvironmentVariableAuthenticationProvider.d.ts.map +0 -1
- package/dist/Authentication/EnvironmentVariableAuthenticationProvider.js +0 -31
- package/dist/Authentication/EnvironmentVariableAuthenticationProvider.js.map +0 -1
- package/dist/Authentication/NoOpAuthenticationProvider.d.ts +0 -25
- package/dist/Authentication/NoOpAuthenticationProvider.d.ts.map +0 -1
- package/dist/Authentication/NoOpAuthenticationProvider.js +0 -31
- package/dist/Authentication/NoOpAuthenticationProvider.js.map +0 -1
- package/dist/Authentication/NodeMsalAuthenticationProvider.d.ts +0 -103
- package/dist/Authentication/NodeMsalAuthenticationProvider.d.ts.map +0 -1
- package/dist/Authentication/NodeMsalAuthenticationProvider.js +0 -391
- package/dist/Authentication/NodeMsalAuthenticationProvider.js.map +0 -1
- package/dist/Authentication/ServicePrincipalAuthenticationProvider.d.ts +0 -23
- package/dist/Authentication/ServicePrincipalAuthenticationProvider.d.ts.map +0 -1
- package/dist/Authentication/ServicePrincipalAuthenticationProvider.js +0 -60
- package/dist/Authentication/ServicePrincipalAuthenticationProvider.js.map +0 -1
- package/dist/Bin.d.ts +0 -6
- package/dist/Bin.d.ts.map +0 -1
- package/dist/Bin.js.map +0 -1
- package/dist/Cli.d.ts +0 -2
- package/dist/Cli.d.ts.map +0 -1
- package/dist/Cli.js +0 -207
- package/dist/Cli.js.map +0 -1
- package/dist/CliSettings.d.ts +0 -17
- package/dist/CliSettings.d.ts.map +0 -1
- package/dist/CliSettings.js +0 -103
- package/dist/CliSettings.js.map +0 -1
- package/dist/CliUtils.d.ts +0 -100
- package/dist/CliUtils.d.ts.map +0 -1
- package/dist/CliUtils.js +0 -204
- package/dist/CliUtils.js.map +0 -1
- package/dist/Constants/CliConstants.d.ts +0 -6
- package/dist/Constants/CliConstants.d.ts.map +0 -1
- package/dist/Constants/CliConstants.js +0 -6
- package/dist/Constants/CliConstants.js.map +0 -1
- package/dist/Constants/CommandRegistry.d.ts +0 -22
- package/dist/Constants/CommandRegistry.d.ts.map +0 -1
- package/dist/Constants/CommandRegistry.js +0 -245
- package/dist/Constants/CommandRegistry.js.map +0 -1
- package/dist/Constants/HelpStrings.d.ts +0 -432
- package/dist/Constants/HelpStrings.d.ts.map +0 -1
- package/dist/Constants/HelpStrings.js +0 -623
- package/dist/Constants/HelpStrings.js.map +0 -1
- package/dist/Constants.d.ts +0 -18
- package/dist/Constants.d.ts.map +0 -1
- package/dist/Constants.js +0 -41
- package/dist/Constants.js.map +0 -1
- package/dist/Errors/CliError.d.ts +0 -5
- package/dist/Errors/CliError.d.ts.map +0 -1
- package/dist/Errors/CliError.js +0 -7
- package/dist/Errors/CliError.js.map +0 -1
- package/dist/Errors/GitHubErrorMap.d.ts +0 -68
- package/dist/Errors/GitHubErrorMap.d.ts.map +0 -1
- package/dist/Errors/GitHubErrorMap.js +0 -238
- package/dist/Errors/GitHubErrorMap.js.map +0 -1
- package/dist/FS/CliFs.d.ts +0 -41
- package/dist/FS/CliFs.d.ts.map +0 -1
- package/dist/FS/CliFs.js +0 -136
- package/dist/FS/CliFs.js.map +0 -1
- package/dist/HttpClient/CliHttpClient.d.ts +0 -43
- package/dist/HttpClient/CliHttpClient.d.ts.map +0 -1
- package/dist/HttpClient/CliHttpClient.js +0 -320
- package/dist/HttpClient/CliHttpClient.js.map +0 -1
- package/dist/HttpClient/HttpForward.d.ts +0 -9
- package/dist/HttpClient/HttpForward.d.ts.map +0 -1
- package/dist/HttpClient/HttpForward.js +0 -56
- package/dist/HttpClient/HttpForward.js.map +0 -1
- package/dist/Logger/BufferedTelemetryWriter.d.ts +0 -20
- package/dist/Logger/BufferedTelemetryWriter.d.ts.map +0 -1
- package/dist/Logger/BufferedTelemetryWriter.js +0 -163
- package/dist/Logger/BufferedTelemetryWriter.js.map +0 -1
- package/dist/Logger/CliLogger.d.ts +0 -59
- package/dist/Logger/CliLogger.d.ts.map +0 -1
- package/dist/Logger/CliLogger.js +0 -364
- package/dist/Logger/CliLogger.js.map +0 -1
- package/dist/Logger/ConsoleWriter.d.ts +0 -23
- package/dist/Logger/ConsoleWriter.d.ts.map +0 -1
- package/dist/Logger/ConsoleWriter.js +0 -66
- package/dist/Logger/ConsoleWriter.js.map +0 -1
- package/dist/Logger/Constants.d.ts +0 -6
- package/dist/Logger/Constants.d.ts.map +0 -1
- package/dist/Logger/Constants.js +0 -15
- package/dist/Logger/Constants.js.map +0 -1
- package/dist/Logger/LoggerSettings.d.ts +0 -18
- package/dist/Logger/LoggerSettings.d.ts.map +0 -1
- package/dist/Logger/LoggerSettings.js +0 -78
- package/dist/Logger/LoggerSettings.js.map +0 -1
- package/dist/Logger/OneDSWriter.d.ts +0 -26
- package/dist/Logger/OneDSWriter.d.ts.map +0 -1
- package/dist/Logger/OneDSWriter.js +0 -211
- package/dist/Logger/OneDSWriter.js.map +0 -1
- package/dist/Logger/Scrubber/ScrubCustomDimensions.d.ts +0 -5
- package/dist/Logger/Scrubber/ScrubCustomDimensions.d.ts.map +0 -1
- package/dist/Logger/Scrubber/ScrubCustomDimensions.js +0 -46
- package/dist/Logger/Scrubber/ScrubCustomDimensions.js.map +0 -1
- package/dist/Logger/Scrubber/ScrubCustomDimensionsConfig.d.ts +0 -27
- package/dist/Logger/Scrubber/ScrubCustomDimensionsConfig.d.ts.map +0 -1
- package/dist/Logger/Scrubber/ScrubCustomDimensionsConfig.js +0 -168
- package/dist/Logger/Scrubber/ScrubCustomDimensionsConfig.js.map +0 -1
- package/dist/Logger/Scrubber/ScrubUtils.d.ts +0 -8
- package/dist/Logger/Scrubber/ScrubUtils.d.ts.map +0 -1
- package/dist/Logger/Scrubber/ScrubUtils.js +0 -34
- package/dist/Logger/Scrubber/ScrubUtils.js.map +0 -1
- package/dist/Middletier/FunctionsBundler.d.ts +0 -17
- package/dist/Middletier/FunctionsBundler.d.ts.map +0 -1
- package/dist/Middletier/FunctionsBundler.js +0 -169
- package/dist/Middletier/FunctionsBundler.js.map +0 -1
- package/dist/Middletier/PackFunctions.d.ts +0 -53
- package/dist/Middletier/PackFunctions.d.ts.map +0 -1
- package/dist/Middletier/PackFunctions.js +0 -123
- package/dist/Middletier/PackFunctions.js.map +0 -1
- package/dist/Testing/MockFetch.d.ts +0 -23
- package/dist/Testing/MockFetch.d.ts.map +0 -1
- package/dist/Testing/MockFetch.js +0 -177
- package/dist/Testing/MockFetch.js.map +0 -1
- package/dist/Testing/MockRoutes.d.ts +0 -34
- package/dist/Testing/MockRoutes.d.ts.map +0 -1
- package/dist/Testing/MockRoutes.js +0 -226
- package/dist/Testing/MockRoutes.js.map +0 -1
- package/dist/Testing/fixtures/connectors/commondataserviceforapps.d.ts +0 -6
- package/dist/Testing/fixtures/connectors/commondataserviceforapps.d.ts.map +0 -1
- package/dist/Testing/fixtures/connectors/commondataserviceforapps.js +0 -25
- package/dist/Testing/fixtures/connectors/commondataserviceforapps.js.map +0 -1
- package/dist/Testing/fixtures/connectors/dataverseContactEntity.d.ts +0 -6
- package/dist/Testing/fixtures/connectors/dataverseContactEntity.d.ts.map +0 -1
- package/dist/Testing/fixtures/connectors/dataverseContactEntity.js +0 -55
- package/dist/Testing/fixtures/connectors/dataverseContactEntity.js.map +0 -1
- package/dist/Testing/fixtures/connectors/excelonlinebusiness.d.ts +0 -6
- package/dist/Testing/fixtures/connectors/excelonlinebusiness.d.ts.map +0 -1
- package/dist/Testing/fixtures/connectors/excelonlinebusiness.js +0 -1970
- package/dist/Testing/fixtures/connectors/excelonlinebusiness.js.map +0 -1
- package/dist/Testing/fixtures/connectors/kusto.d.ts +0 -6
- package/dist/Testing/fixtures/connectors/kusto.d.ts.map +0 -1
- package/dist/Testing/fixtures/connectors/kusto.js +0 -1333
- package/dist/Testing/fixtures/connectors/kusto.js.map +0 -1
- package/dist/Testing/fixtures/connectors/msnweather.d.ts +0 -6
- package/dist/Testing/fixtures/connectors/msnweather.d.ts.map +0 -1
- package/dist/Testing/fixtures/connectors/msnweather.js +0 -917
- package/dist/Testing/fixtures/connectors/msnweather.js.map +0 -1
- package/dist/Testing/fixtures/connectors/office365groups.d.ts +0 -6
- package/dist/Testing/fixtures/connectors/office365groups.d.ts.map +0 -1
- package/dist/Testing/fixtures/connectors/office365groups.js +0 -2144
- package/dist/Testing/fixtures/connectors/office365groups.js.map +0 -1
- package/dist/Testing/fixtures/connectors/office365users.d.ts +0 -6
- package/dist/Testing/fixtures/connectors/office365users.d.ts.map +0 -1
- package/dist/Testing/fixtures/connectors/office365users.js +0 -1969
- package/dist/Testing/fixtures/connectors/office365users.js.map +0 -1
- package/dist/Testing/fixtures/connectors/onedriveforbusiness.d.ts +0 -6
- package/dist/Testing/fixtures/connectors/onedriveforbusiness.d.ts.map +0 -1
- package/dist/Testing/fixtures/connectors/onedriveforbusiness.js +0 -4873
- package/dist/Testing/fixtures/connectors/onedriveforbusiness.js.map +0 -1
- package/dist/Testing/fixtures/connectors/powerappsforappmakers.d.ts +0 -6
- package/dist/Testing/fixtures/connectors/powerappsforappmakers.d.ts.map +0 -1
- package/dist/Testing/fixtures/connectors/powerappsforappmakers.js +0 -4682
- package/dist/Testing/fixtures/connectors/powerappsforappmakers.js.map +0 -1
- package/dist/Testing/fixtures/connectors/sharepointTestListMetadata.d.ts +0 -6
- package/dist/Testing/fixtures/connectors/sharepointTestListMetadata.d.ts.map +0 -1
- package/dist/Testing/fixtures/connectors/sharepointTestListMetadata.js +0 -1078
- package/dist/Testing/fixtures/connectors/sharepointTestListMetadata.js.map +0 -1
- package/dist/Testing/fixtures/connectors/sharepointonline.d.ts +0 -6
- package/dist/Testing/fixtures/connectors/sharepointonline.d.ts.map +0 -1
- package/dist/Testing/fixtures/connectors/sharepointonline.js +0 -28
- package/dist/Testing/fixtures/connectors/sharepointonline.js.map +0 -1
- package/dist/Testing/fixtures/connectors/teams.d.ts +0 -6
- package/dist/Testing/fixtures/connectors/teams.d.ts.map +0 -1
- package/dist/Testing/fixtures/connectors/teams.js +0 -9987
- package/dist/Testing/fixtures/connectors/teams.js.map +0 -1
- package/dist/Testing/fixtures/connectors/translatorv2.d.ts +0 -6
- package/dist/Testing/fixtures/connectors/translatorv2.d.ts.map +0 -1
- package/dist/Testing/fixtures/connectors/translatorv2.js +0 -307
- package/dist/Testing/fixtures/connectors/translatorv2.js.map +0 -1
- package/dist/Testing/fixtures/index.d.ts +0 -23
- package/dist/Testing/fixtures/index.d.ts.map +0 -1
- package/dist/Testing/fixtures/index.js +0 -96
- package/dist/Testing/fixtures/index.js.map +0 -1
- package/dist/Types/Argument.types.d.ts +0 -28
- package/dist/Types/Argument.types.d.ts.map +0 -1
- package/dist/Types/Argument.types.js +0 -5
- package/dist/Types/Argument.types.js.map +0 -1
- package/dist/Types/Cli.types.d.ts +0 -82
- package/dist/Types/Cli.types.d.ts.map +0 -1
- package/dist/Types/Cli.types.js +0 -5
- package/dist/Types/Cli.types.js.map +0 -1
- package/dist/Types/Command.types.d.ts +0 -69
- package/dist/Types/Command.types.d.ts.map +0 -1
- package/dist/Types/Command.types.js +0 -20
- package/dist/Types/Command.types.js.map +0 -1
- package/dist/Types/Datasource.types.d.ts +0 -30
- package/dist/Types/Datasource.types.d.ts.map +0 -1
- package/dist/Types/Datasource.types.js +0 -5
- package/dist/Types/Datasource.types.js.map +0 -1
- package/dist/Types/LoggerTypes.types.d.ts +0 -18
- package/dist/Types/LoggerTypes.types.d.ts.map +0 -1
- package/dist/Types/LoggerTypes.types.js +0 -5
- package/dist/Types/LoggerTypes.types.js.map +0 -1
- package/dist/Utils/BuildPolling.d.ts +0 -43
- package/dist/Utils/BuildPolling.d.ts.map +0 -1
- package/dist/Utils/BuildPolling.js +0 -139
- package/dist/Utils/BuildPolling.js.map +0 -1
- package/dist/Utils/BuildVerbDescriptionTable.d.ts +0 -29
- package/dist/Utils/BuildVerbDescriptionTable.d.ts.map +0 -1
- package/dist/Utils/BuildVerbDescriptionTable.js +0 -147
- package/dist/Utils/BuildVerbDescriptionTable.js.map +0 -1
- package/dist/Utils/CoerceCliVersion.d.ts +0 -27
- package/dist/Utils/CoerceCliVersion.d.ts.map +0 -1
- package/dist/Utils/CoerceCliVersion.js +0 -67
- package/dist/Utils/CoerceCliVersion.js.map +0 -1
- package/dist/Utils/ConnectorIds.d.ts +0 -12
- package/dist/Utils/ConnectorIds.d.ts.map +0 -1
- package/dist/Utils/ConnectorIds.js +0 -20
- package/dist/Utils/ConnectorIds.js.map +0 -1
- package/dist/Utils/ConsoleOutput.d.ts +0 -86
- package/dist/Utils/ConsoleOutput.d.ts.map +0 -1
- package/dist/Utils/ConsoleOutput.js +0 -162
- package/dist/Utils/ConsoleOutput.js.map +0 -1
- package/dist/Utils/DcfRecovery.d.ts +0 -84
- package/dist/Utils/DcfRecovery.d.ts.map +0 -1
- package/dist/Utils/DcfRecovery.js +0 -246
- package/dist/Utils/DcfRecovery.js.map +0 -1
- package/dist/Utils/DetectPackageManager.d.ts +0 -9
- package/dist/Utils/DetectPackageManager.d.ts.map +0 -1
- package/dist/Utils/DetectPackageManager.js +0 -24
- package/dist/Utils/DetectPackageManager.js.map +0 -1
- package/dist/Utils/DownloadTemplate.d.ts +0 -45
- package/dist/Utils/DownloadTemplate.d.ts.map +0 -1
- package/dist/Utils/DownloadTemplate.js +0 -161
- package/dist/Utils/DownloadTemplate.js.map +0 -1
- package/dist/Utils/EnhanceNetworkError.d.ts +0 -14
- package/dist/Utils/EnhanceNetworkError.d.ts.map +0 -1
- package/dist/Utils/EnhanceNetworkError.js +0 -61
- package/dist/Utils/EnhanceNetworkError.js.map +0 -1
- package/dist/Utils/EnvVars.d.ts +0 -17
- package/dist/Utils/EnvVars.d.ts.map +0 -1
- package/dist/Utils/EnvVars.js +0 -38
- package/dist/Utils/EnvVars.js.map +0 -1
- package/dist/Utils/EnvironmentRoutingUtils.d.ts +0 -81
- package/dist/Utils/EnvironmentRoutingUtils.d.ts.map +0 -1
- package/dist/Utils/EnvironmentRoutingUtils.js +0 -204
- package/dist/Utils/EnvironmentRoutingUtils.js.map +0 -1
- package/dist/Utils/FindAvailablePort.d.ts +0 -39
- package/dist/Utils/FindAvailablePort.d.ts.map +0 -1
- package/dist/Utils/FindAvailablePort.js +0 -105
- package/dist/Utils/FindAvailablePort.js.map +0 -1
- package/dist/Utils/GitCredentialConfig.d.ts +0 -12
- package/dist/Utils/GitCredentialConfig.d.ts.map +0 -1
- package/dist/Utils/GitCredentialConfig.js +0 -32
- package/dist/Utils/GitCredentialConfig.js.map +0 -1
- package/dist/Utils/GitErrorClassifier.d.ts +0 -40
- package/dist/Utils/GitErrorClassifier.d.ts.map +0 -1
- package/dist/Utils/GitErrorClassifier.js +0 -120
- package/dist/Utils/GitErrorClassifier.js.map +0 -1
- package/dist/Utils/GitHubDcfFlow.d.ts +0 -59
- package/dist/Utils/GitHubDcfFlow.d.ts.map +0 -1
- package/dist/Utils/GitHubDcfFlow.js +0 -165
- package/dist/Utils/GitHubDcfFlow.js.map +0 -1
- package/dist/Utils/GitRunner.d.ts +0 -107
- package/dist/Utils/GitRunner.d.ts.map +0 -1
- package/dist/Utils/GitRunner.js +0 -89
- package/dist/Utils/GitRunner.js.map +0 -1
- package/dist/Utils/GitUtils.d.ts +0 -43
- package/dist/Utils/GitUtils.d.ts.map +0 -1
- package/dist/Utils/GitUtils.js +0 -120
- package/dist/Utils/GitUtils.js.map +0 -1
- package/dist/Utils/GitVersionChecker.d.ts +0 -38
- package/dist/Utils/GitVersionChecker.d.ts.map +0 -1
- package/dist/Utils/GitVersionChecker.js +0 -64
- package/dist/Utils/GitVersionChecker.js.map +0 -1
- package/dist/Utils/HelpBanner.d.ts +0 -11
- package/dist/Utils/HelpBanner.d.ts.map +0 -1
- package/dist/Utils/HelpBanner.js +0 -15
- package/dist/Utils/HelpBanner.js.map +0 -1
- package/dist/Utils/MaafAppConfig.d.ts +0 -24
- package/dist/Utils/MaafAppConfig.d.ts.map +0 -1
- package/dist/Utils/MaafAppConfig.js +0 -38
- package/dist/Utils/MaafAppConfig.js.map +0 -1
- package/dist/Utils/NodeVersionChecker.d.ts +0 -10
- package/dist/Utils/NodeVersionChecker.d.ts.map +0 -1
- package/dist/Utils/NodeVersionChecker.js +0 -21
- package/dist/Utils/NodeVersionChecker.js.map +0 -1
- package/dist/Utils/Paging.d.ts +0 -29
- package/dist/Utils/Paging.d.ts.map +0 -1
- package/dist/Utils/Paging.js +0 -102
- package/dist/Utils/Paging.js.map +0 -1
- package/dist/Utils/PinCli.d.ts +0 -33
- package/dist/Utils/PinCli.d.ts.map +0 -1
- package/dist/Utils/PinCli.js +0 -77
- package/dist/Utils/PinCli.js.map +0 -1
- package/dist/Utils/ReadPackageJson.d.ts +0 -9
- package/dist/Utils/ReadPackageJson.d.ts.map +0 -1
- package/dist/Utils/ReadPackageJson.js +0 -13
- package/dist/Utils/ReadPackageJson.js.map +0 -1
- package/dist/Utils/RepoDetails.d.ts +0 -29
- package/dist/Utils/RepoDetails.d.ts.map +0 -1
- package/dist/Utils/RepoDetails.js +0 -37
- package/dist/Utils/RepoDetails.js.map +0 -1
- package/dist/Utils/RepoOption.d.ts +0 -42
- package/dist/Utils/RepoOption.d.ts.map +0 -1
- package/dist/Utils/RepoOption.js +0 -63
- package/dist/Utils/RepoOption.js.map +0 -1
- package/dist/Utils/RepoUrl.d.ts +0 -18
- package/dist/Utils/RepoUrl.d.ts.map +0 -1
- package/dist/Utils/RepoUrl.js +0 -6
- package/dist/Utils/RepoUrl.js.map +0 -1
- package/dist/Utils/ResolveCommand.d.ts +0 -62
- package/dist/Utils/ResolveCommand.d.ts.map +0 -1
- package/dist/Utils/ResolveCommand.js +0 -141
- package/dist/Utils/ResolveCommand.js.map +0 -1
- package/dist/Utils/RunCommand.d.ts +0 -33
- package/dist/Utils/RunCommand.d.ts.map +0 -1
- package/dist/Utils/RunCommand.js +0 -83
- package/dist/Utils/RunCommand.js.map +0 -1
- package/dist/Utils/ShareAccessRouting.d.ts +0 -78
- package/dist/Utils/ShareAccessRouting.d.ts.map +0 -1
- package/dist/Utils/ShareAccessRouting.js +0 -93
- package/dist/Utils/ShareAccessRouting.js.map +0 -1
- package/dist/Utils/Spinner.d.ts +0 -23
- package/dist/Utils/Spinner.d.ts.map +0 -1
- package/dist/Utils/Spinner.js +0 -94
- package/dist/Utils/Spinner.js.map +0 -1
- package/dist/Utils/zipBuildArtifact.d.ts +0 -35
- package/dist/Utils/zipBuildArtifact.d.ts.map +0 -1
- package/dist/Utils/zipBuildArtifact.js +0 -100
- package/dist/Utils/zipBuildArtifact.js.map +0 -1
- package/dist/Verbs/AddAction.d.ts +0 -6
- package/dist/Verbs/AddAction.d.ts.map +0 -1
- package/dist/Verbs/AddAction.js +0 -58
- package/dist/Verbs/AddAction.js.map +0 -1
- package/dist/Verbs/AddConnector.d.ts +0 -26
- package/dist/Verbs/AddConnector.d.ts.map +0 -1
- package/dist/Verbs/AddConnector.js +0 -222
- package/dist/Verbs/AddConnector.js.map +0 -1
- package/dist/Verbs/AddConnectorFlows.d.ts +0 -97
- package/dist/Verbs/AddConnectorFlows.d.ts.map +0 -1
- package/dist/Verbs/AddConnectorFlows.js +0 -298
- package/dist/Verbs/AddConnectorFlows.js.map +0 -1
- package/dist/Verbs/AddDataSource.d.ts +0 -18
- package/dist/Verbs/AddDataSource.d.ts.map +0 -1
- package/dist/Verbs/AddDataSource.js +0 -162
- package/dist/Verbs/AddDataSource.js.map +0 -1
- package/dist/Verbs/AddFlow.d.ts +0 -12
- package/dist/Verbs/AddFlow.d.ts.map +0 -1
- package/dist/Verbs/AddFlow.js +0 -62
- package/dist/Verbs/AddFlow.js.map +0 -1
- package/dist/Verbs/AddTable.d.ts +0 -6
- package/dist/Verbs/AddTable.d.ts.map +0 -1
- package/dist/Verbs/AddTable.js +0 -78
- package/dist/Verbs/AddTable.js.map +0 -1
- package/dist/Verbs/AuthStatus.d.ts +0 -6
- package/dist/Verbs/AuthStatus.d.ts.map +0 -1
- package/dist/Verbs/AuthStatus.js +0 -49
- package/dist/Verbs/AuthStatus.js.map +0 -1
- package/dist/Verbs/AuthSwitch.d.ts +0 -6
- package/dist/Verbs/AuthSwitch.d.ts.map +0 -1
- package/dist/Verbs/AuthSwitch.js +0 -67
- package/dist/Verbs/AuthSwitch.js.map +0 -1
- package/dist/Verbs/BuildMaafApp.d.ts +0 -6
- package/dist/Verbs/BuildMaafApp.d.ts.map +0 -1
- package/dist/Verbs/BuildMaafApp.js +0 -172
- package/dist/Verbs/BuildMaafApp.js.map +0 -1
- package/dist/Verbs/ConnectorHelpers.d.ts +0 -164
- package/dist/Verbs/ConnectorHelpers.d.ts.map +0 -1
- package/dist/Verbs/ConnectorHelpers.js +0 -563
- package/dist/Verbs/ConnectorHelpers.js.map +0 -1
- package/dist/Verbs/CreateMaafApp.d.ts +0 -107
- package/dist/Verbs/CreateMaafApp.d.ts.map +0 -1
- package/dist/Verbs/CreateMaafApp.js +0 -1081
- package/dist/Verbs/CreateMaafApp.js.map +0 -1
- package/dist/Verbs/DeleteMaafApp.d.ts +0 -27
- package/dist/Verbs/DeleteMaafApp.d.ts.map +0 -1
- package/dist/Verbs/DeleteMaafApp.js +0 -114
- package/dist/Verbs/DeleteMaafApp.js.map +0 -1
- package/dist/Verbs/DeployMaafApp.d.ts +0 -6
- package/dist/Verbs/DeployMaafApp.d.ts.map +0 -1
- package/dist/Verbs/DeployMaafApp.js +0 -495
- package/dist/Verbs/DeployMaafApp.js.map +0 -1
- package/dist/Verbs/Dev.d.ts +0 -6
- package/dist/Verbs/Dev.d.ts.map +0 -1
- package/dist/Verbs/Dev.js +0 -276
- package/dist/Verbs/Dev.js.map +0 -1
- package/dist/Verbs/FindDataverseApi.d.ts +0 -12
- package/dist/Verbs/FindDataverseApi.d.ts.map +0 -1
- package/dist/Verbs/FindDataverseApi.js +0 -87
- package/dist/Verbs/FindDataverseApi.js.map +0 -1
- package/dist/Verbs/GetMaafApp.d.ts +0 -6
- package/dist/Verbs/GetMaafApp.d.ts.map +0 -1
- package/dist/Verbs/GetMaafApp.js +0 -80
- package/dist/Verbs/GetMaafApp.js.map +0 -1
- package/dist/Verbs/GetMaafBuildStatus.d.ts +0 -6
- package/dist/Verbs/GetMaafBuildStatus.d.ts.map +0 -1
- package/dist/Verbs/GetMaafBuildStatus.js +0 -132
- package/dist/Verbs/GetMaafBuildStatus.js.map +0 -1
- package/dist/Verbs/GetSettings.d.ts +0 -12
- package/dist/Verbs/GetSettings.d.ts.map +0 -1
- package/dist/Verbs/GetSettings.js +0 -39
- package/dist/Verbs/GetSettings.js.map +0 -1
- package/dist/Verbs/Init.d.ts +0 -6
- package/dist/Verbs/Init.d.ts.map +0 -1
- package/dist/Verbs/Init.js +0 -426
- package/dist/Verbs/Init.js.map +0 -1
- package/dist/Verbs/ListConnectionReferences.d.ts +0 -6
- package/dist/Verbs/ListConnectionReferences.d.ts.map +0 -1
- package/dist/Verbs/ListConnectionReferences.js +0 -56
- package/dist/Verbs/ListConnectionReferences.js.map +0 -1
- package/dist/Verbs/ListConnectorActions.d.ts +0 -6
- package/dist/Verbs/ListConnectorActions.d.ts.map +0 -1
- package/dist/Verbs/ListConnectorActions.js +0 -87
- package/dist/Verbs/ListConnectorActions.js.map +0 -1
- package/dist/Verbs/ListConnectors.d.ts +0 -6
- package/dist/Verbs/ListConnectors.d.ts.map +0 -1
- package/dist/Verbs/ListConnectors.js +0 -91
- package/dist/Verbs/ListConnectors.js.map +0 -1
- package/dist/Verbs/ListDatasets.d.ts +0 -6
- package/dist/Verbs/ListDatasets.d.ts.map +0 -1
- package/dist/Verbs/ListDatasets.js +0 -73
- package/dist/Verbs/ListDatasets.js.map +0 -1
- package/dist/Verbs/ListEnvironmentVariables.d.ts +0 -14
- package/dist/Verbs/ListEnvironmentVariables.d.ts.map +0 -1
- package/dist/Verbs/ListEnvironmentVariables.js +0 -52
- package/dist/Verbs/ListEnvironmentVariables.js.map +0 -1
- package/dist/Verbs/ListFlows.d.ts +0 -13
- package/dist/Verbs/ListFlows.d.ts.map +0 -1
- package/dist/Verbs/ListFlows.js +0 -73
- package/dist/Verbs/ListFlows.js.map +0 -1
- package/dist/Verbs/ListMaafApps.d.ts +0 -84
- package/dist/Verbs/ListMaafApps.d.ts.map +0 -1
- package/dist/Verbs/ListMaafApps.js +0 -221
- package/dist/Verbs/ListMaafApps.js.map +0 -1
- package/dist/Verbs/ListSqlStoredProcedures.d.ts +0 -6
- package/dist/Verbs/ListSqlStoredProcedures.d.ts.map +0 -1
- package/dist/Verbs/ListSqlStoredProcedures.js +0 -75
- package/dist/Verbs/ListSqlStoredProcedures.js.map +0 -1
- package/dist/Verbs/ListTables.d.ts +0 -6
- package/dist/Verbs/ListTables.d.ts.map +0 -1
- package/dist/Verbs/ListTables.js +0 -85
- package/dist/Verbs/ListTables.js.map +0 -1
- package/dist/Verbs/Login.d.ts +0 -6
- package/dist/Verbs/Login.d.ts.map +0 -1
- package/dist/Verbs/Login.js +0 -39
- package/dist/Verbs/Login.js.map +0 -1
- package/dist/Verbs/Logout.d.ts +0 -6
- package/dist/Verbs/Logout.d.ts.map +0 -1
- package/dist/Verbs/Logout.js +0 -34
- package/dist/Verbs/Logout.js.map +0 -1
- package/dist/Verbs/MaafAppPermissions.d.ts +0 -40
- package/dist/Verbs/MaafAppPermissions.d.ts.map +0 -1
- package/dist/Verbs/MaafAppPermissions.js +0 -651
- package/dist/Verbs/MaafAppPermissions.js.map +0 -1
- package/dist/Verbs/Pack.d.ts +0 -71
- package/dist/Verbs/Pack.d.ts.map +0 -1
- package/dist/Verbs/Pack.js +0 -370
- package/dist/Verbs/Pack.js.map +0 -1
- package/dist/Verbs/PlayMaafApp.d.ts +0 -22
- package/dist/Verbs/PlayMaafApp.d.ts.map +0 -1
- package/dist/Verbs/PlayMaafApp.js +0 -147
- package/dist/Verbs/PlayMaafApp.js.map +0 -1
- package/dist/Verbs/RefreshDataSource.d.ts +0 -21
- package/dist/Verbs/RefreshDataSource.d.ts.map +0 -1
- package/dist/Verbs/RefreshDataSource.js +0 -87
- package/dist/Verbs/RefreshDataSource.js.map +0 -1
- package/dist/Verbs/RefreshGitAuth.d.ts +0 -6
- package/dist/Verbs/RefreshGitAuth.d.ts.map +0 -1
- package/dist/Verbs/RefreshGitAuth.js +0 -155
- package/dist/Verbs/RefreshGitAuth.js.map +0 -1
- package/dist/Verbs/RemoveDataSource.d.ts +0 -6
- package/dist/Verbs/RemoveDataSource.d.ts.map +0 -1
- package/dist/Verbs/RemoveDataSource.js +0 -172
- package/dist/Verbs/RemoveDataSource.js.map +0 -1
- package/dist/Verbs/RemoveFlow.d.ts +0 -12
- package/dist/Verbs/RemoveFlow.d.ts.map +0 -1
- package/dist/Verbs/RemoveFlow.js +0 -94
- package/dist/Verbs/RemoveFlow.js.map +0 -1
- package/dist/Verbs/SetSetting.d.ts +0 -12
- package/dist/Verbs/SetSetting.d.ts.map +0 -1
- package/dist/Verbs/SetSetting.js +0 -131
- package/dist/Verbs/SetSetting.js.map +0 -1
- package/dist/Verbs/ShareLinkCreate.d.ts +0 -23
- package/dist/Verbs/ShareLinkCreate.d.ts.map +0 -1
- package/dist/Verbs/ShareLinkCreate.js +0 -73
- package/dist/Verbs/ShareLinkCreate.js.map +0 -1
- package/dist/Verbs/ShareLinkList.d.ts +0 -16
- package/dist/Verbs/ShareLinkList.d.ts.map +0 -1
- package/dist/Verbs/ShareLinkList.js +0 -84
- package/dist/Verbs/ShareLinkList.js.map +0 -1
- package/dist/Verbs/ShareLinkRevoke.d.ts +0 -22
- package/dist/Verbs/ShareLinkRevoke.d.ts.map +0 -1
- package/dist/Verbs/ShareLinkRevoke.js +0 -137
- package/dist/Verbs/ShareLinkRevoke.js.map +0 -1
- package/dist/Verbs/ShareList.d.ts +0 -10
- package/dist/Verbs/ShareList.d.ts.map +0 -1
- package/dist/Verbs/ShareList.js +0 -254
- package/dist/Verbs/ShareList.js.map +0 -1
- package/dist/Verbs/ShareMaafApp.d.ts +0 -12
- package/dist/Verbs/ShareMaafApp.d.ts.map +0 -1
- package/dist/Verbs/ShareMaafApp.js +0 -14
- package/dist/Verbs/ShareMaafApp.js.map +0 -1
- package/dist/Verbs/ShowMaafApp.d.ts +0 -100
- package/dist/Verbs/ShowMaafApp.d.ts.map +0 -1
- package/dist/Verbs/ShowMaafApp.js +0 -224
- package/dist/Verbs/ShowMaafApp.js.map +0 -1
- package/dist/Verbs/TelemetrySettings.d.ts +0 -8
- package/dist/Verbs/TelemetrySettings.d.ts.map +0 -1
- package/dist/Verbs/TelemetrySettings.js +0 -104
- package/dist/Verbs/TelemetrySettings.js.map +0 -1
- package/dist/Verbs/UnshareMaafApp.d.ts +0 -12
- package/dist/Verbs/UnshareMaafApp.d.ts.map +0 -1
- package/dist/Verbs/UnshareMaafApp.js +0 -14
- package/dist/Verbs/UnshareMaafApp.js.map +0 -1
- package/dist/Verbs/VerbConstants.d.ts +0 -628
- package/dist/Verbs/VerbConstants.d.ts.map +0 -1
- package/dist/Verbs/VerbConstants.js +0 -557
- package/dist/Verbs/VerbConstants.js.map +0 -1
- package/dist/Verbs/index.d.ts +0 -47
- package/dist/Verbs/index.d.ts.map +0 -1
- package/dist/Verbs/index.js +0 -47
- package/dist/Verbs/index.js.map +0 -1
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
import { type Cloud, type IHttpClient } from '@microsoft/managed-apps-common/services';
|
|
5
|
-
import type { CliLogger } from './Logger/CliLogger.js';
|
|
6
|
-
import type { CliOption } from './Types/Argument.types.js';
|
|
7
|
-
import type { IAccountManager, IAuthenticationProvider } from './Types/Cli.types.js';
|
|
8
|
-
import type { ResolvedCommand } from './Types/Command.types.js';
|
|
9
|
-
export interface IArgumentProvider {
|
|
10
|
-
addOption(cliOption: CliOption): void;
|
|
11
|
-
addOptions(cliOptions: CliOption[]): void;
|
|
12
|
-
addSwitch(cliOption: CliOption): void;
|
|
13
|
-
addSwitches(cliOptions: CliOption[]): void;
|
|
14
|
-
consumePositionalArg(name: string): void;
|
|
15
|
-
consumePositionalArgs(name: string): void;
|
|
16
|
-
getPositionalArg(index: number): string | undefined;
|
|
17
|
-
getPositionalArgs(index: number): readonly string[];
|
|
18
|
-
runVerb(): Promise<void>;
|
|
19
|
-
getVerb(): string;
|
|
20
|
-
getResolvedCommand(): ResolvedCommand | null;
|
|
21
|
-
handleGlobalHelpOrFlagsAndExit(): void;
|
|
22
|
-
getOption<T>(key: string, ignorePrompt?: boolean): Promise<T>;
|
|
23
|
-
getAuthenticationProvider(): IAuthenticationProvider;
|
|
24
|
-
/**
|
|
25
|
-
* Returns the account manager for the current auth mode. Throws `UsageError` when the
|
|
26
|
-
* current mode (service principal, HTTP forward) does not support account management —
|
|
27
|
-
* only interactive MSAL does.
|
|
28
|
-
*/
|
|
29
|
-
getAccountManager(): IAccountManager;
|
|
30
|
-
getHttpClient(): IHttpClient;
|
|
31
|
-
getTenantIdAsync(): Promise<string | undefined>;
|
|
32
|
-
getAuthResourceUrl(): string;
|
|
33
|
-
getLoginAuthority(tenantId: string): string;
|
|
34
|
-
setDescription(description: string): void;
|
|
35
|
-
isJsonMode(): boolean;
|
|
36
|
-
addExamples(examples: string[]): void;
|
|
37
|
-
/** Returns all `--flag` tokens currently registered with the program (including short aliases). */
|
|
38
|
-
getRegisteredFlags(): ReadonlySet<string>;
|
|
39
|
-
/** Returns the validated, normalized user-facing cloud value (from --cloud or ms.config.json). */
|
|
40
|
-
getCloud(): Cloud | undefined;
|
|
41
|
-
/** Returns the effective environment ID without prompting. */
|
|
42
|
-
getEnvironmentId(options?: {
|
|
43
|
-
includeConfig?: boolean;
|
|
44
|
-
}): string | undefined;
|
|
45
|
-
/** Updates the resolved environment used by Player Services and telemetry. */
|
|
46
|
-
updateEnvironmentId(environmentId: string): void;
|
|
47
|
-
}
|
|
48
|
-
export declare class ArgumentProvider implements IArgumentProvider {
|
|
49
|
-
private _httpClient;
|
|
50
|
-
private _logger;
|
|
51
|
-
private _authenticationProvider;
|
|
52
|
-
private _accountManager?;
|
|
53
|
-
private _environmentId;
|
|
54
|
-
private _debugEnvironmentId;
|
|
55
|
-
private _environmentIdNotified;
|
|
56
|
-
private _cloud;
|
|
57
|
-
private _region;
|
|
58
|
-
private _verb;
|
|
59
|
-
private _resolvedCommand;
|
|
60
|
-
private _tokensConsumed;
|
|
61
|
-
private _program;
|
|
62
|
-
private _options;
|
|
63
|
-
private _positionalArgs;
|
|
64
|
-
private _positionalArgNames;
|
|
65
|
-
private _isParsed;
|
|
66
|
-
constructor(_httpClient: IHttpClient, _logger: CliLogger, _authenticationProvider: IAuthenticationProvider, _accountManager?: IAccountManager | undefined);
|
|
67
|
-
addSwitch(cliOption: CliOption): void;
|
|
68
|
-
addSwitches(cliOptions: CliOption[]): void;
|
|
69
|
-
/**
|
|
70
|
-
* Consumes the next positional token from process.argv before Commander parses flags.
|
|
71
|
-
* Increments the internal token counter so runVerb() excludes this token from Commander's
|
|
72
|
-
* args, and updates the usage string so --help shows the argument name.
|
|
73
|
-
*
|
|
74
|
-
* Must be called before runVerb().
|
|
75
|
-
*/
|
|
76
|
-
consumePositionalArg(name: string): void;
|
|
77
|
-
/**
|
|
78
|
-
* Registers a variadic positional argument with Commander. Parsing uses
|
|
79
|
-
* optional syntax so the verb can provide its own missing-input error, while
|
|
80
|
-
* usage renders the argument as required.
|
|
81
|
-
*
|
|
82
|
-
* Unlike consumePositionalArg(), Commander can collect multiple values and
|
|
83
|
-
* allows options to appear before or after them. Must be called before runVerb().
|
|
84
|
-
*/
|
|
85
|
-
consumePositionalArgs(name: string): void;
|
|
86
|
-
getPositionalArg(index: number): string | undefined;
|
|
87
|
-
getPositionalArgs(index: number): readonly string[];
|
|
88
|
-
addOption(cliOption: CliOption): void;
|
|
89
|
-
addOptions(cliOptions: CliOption[]): void;
|
|
90
|
-
runVerb(): Promise<void>;
|
|
91
|
-
handleGlobalHelpOrFlagsAndExit(): void;
|
|
92
|
-
/**
|
|
93
|
-
* Detects `--help` requests on nested typed-verb paths the resolver can't
|
|
94
|
-
* leaf-match (e.g. `ms app share link --help` — `link` is a nested typed
|
|
95
|
-
* verb with no handler of its own) and prints the typed verb's flattened
|
|
96
|
-
* subcommand list. Returns true if it handled the request.
|
|
97
|
-
*
|
|
98
|
-
* Skips when the user is asking for help on a path the resolver already
|
|
99
|
-
* fully matched (those paths route through Commander's normal `--help`
|
|
100
|
-
* handling at the leaf level).
|
|
101
|
-
*/
|
|
102
|
-
private _tryPrintDeepTypedHelp;
|
|
103
|
-
getVerb(): string;
|
|
104
|
-
getResolvedCommand(): ResolvedCommand | null;
|
|
105
|
-
getOption<T>(key: string, ignorePrompt?: boolean): Promise<T>;
|
|
106
|
-
getAuthenticationProvider(): IAuthenticationProvider;
|
|
107
|
-
getAccountManager(): IAccountManager;
|
|
108
|
-
getHttpClient(): IHttpClient;
|
|
109
|
-
/**
|
|
110
|
-
* Returns the tenant ID for the authenticated user, acquiring a token first if needed.
|
|
111
|
-
*
|
|
112
|
-
* NodeMsalAuthenticationProvider only populates _tenantId after getAccessTokenForResource()
|
|
113
|
-
* is called. This method pre-acquires a token for the Power Platform resource so the tenant
|
|
114
|
-
* ID is always available after runVerb() completes.
|
|
115
|
-
*/
|
|
116
|
-
getTenantIdAsync(): Promise<string | undefined>;
|
|
117
|
-
getAuthResourceUrl(): string;
|
|
118
|
-
getCloud(): Cloud | undefined;
|
|
119
|
-
getLoginAuthority(tenantId: string): string;
|
|
120
|
-
/**
|
|
121
|
-
* Sets the description for the current command context.
|
|
122
|
-
* This is used to display help information specific to the verb being executed.
|
|
123
|
-
*
|
|
124
|
-
* @param {string} description - The description to set for the program.
|
|
125
|
-
*/
|
|
126
|
-
setDescription(description: string): void;
|
|
127
|
-
isJsonMode(): boolean;
|
|
128
|
-
addExamples(examples: string[]): void;
|
|
129
|
-
getRegisteredFlags(): ReadonlySet<string>;
|
|
130
|
-
getEnvironmentId(options?: {
|
|
131
|
-
includeConfig?: boolean;
|
|
132
|
-
}): string | undefined;
|
|
133
|
-
private _resolveEnvironmentId;
|
|
134
|
-
updateEnvironmentId(environmentId: string): void;
|
|
135
|
-
private _getRequiredVariables;
|
|
136
|
-
/**
|
|
137
|
-
* @param {CliOption} cliOption
|
|
138
|
-
* @param {boolean} [hasValue=true] true if the option requires a value, false for a switch such as --help
|
|
139
|
-
*/
|
|
140
|
-
private _createOption;
|
|
141
|
-
private _createFlags;
|
|
142
|
-
private _createSwitchFlags;
|
|
143
|
-
}
|
|
144
|
-
//# sourceMappingURL=ArgumentProvider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ArgumentProvider.d.ts","sourceRoot":"","sources":["../src/ArgumentProvider.ts"],"names":[],"mappings":"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"}
|
package/dist/ArgumentProvider.js
DELETED
|
@@ -1,493 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
import { getAuthResource, initializePlayerServices, updateEnvironmentName, updateRegion, } from '@microsoft/managed-apps-actions';
|
|
5
|
-
import { Clouds, cloudToRegion, } from '@microsoft/managed-apps-common/services';
|
|
6
|
-
import { Command } from 'commander';
|
|
7
|
-
import packageJson from '../package.json' with { type: 'json' };
|
|
8
|
-
import { getSettings } from './CliSettings.js';
|
|
9
|
-
import { extractEnvironmentId, getAuthority } from './CliUtils.js';
|
|
10
|
-
import { CLI_BINARY_NAME } from './Constants/CliConstants.js';
|
|
11
|
-
import { COMMAND_TREE } from './Constants/CommandRegistry.js';
|
|
12
|
-
import { HelpStrings } from './Constants/HelpStrings.js';
|
|
13
|
-
import { UsageError } from './Errors/CliError.js';
|
|
14
|
-
import { buildNounHelpText, buildPathTypedHelpText, buildVerbDescriptionTable, } from './Utils/BuildVerbDescriptionTable.js';
|
|
15
|
-
import { printInfo } from './Utils/ConsoleOutput.js';
|
|
16
|
-
import { cliEnvVarFullName, getCliEnvVar } from './Utils/EnvVars.js';
|
|
17
|
-
import { getHelpBanner } from './Utils/HelpBanner.js';
|
|
18
|
-
import { findIncompleteTypedPath, isKnownNoun, resolveCommand } from './Utils/ResolveCommand.js';
|
|
19
|
-
import { GlobalArguments } from './Verbs/VerbConstants.js';
|
|
20
|
-
function normalizeOptionalString(value) {
|
|
21
|
-
if (typeof value !== 'string') {
|
|
22
|
-
return undefined;
|
|
23
|
-
}
|
|
24
|
-
const normalized = value.trim();
|
|
25
|
-
return normalized || undefined;
|
|
26
|
-
}
|
|
27
|
-
export class ArgumentProvider {
|
|
28
|
-
_httpClient;
|
|
29
|
-
_logger;
|
|
30
|
-
_authenticationProvider;
|
|
31
|
-
_accountManager;
|
|
32
|
-
_environmentId;
|
|
33
|
-
_debugEnvironmentId;
|
|
34
|
-
_environmentIdNotified = false;
|
|
35
|
-
_cloud;
|
|
36
|
-
_region;
|
|
37
|
-
_verb;
|
|
38
|
-
_resolvedCommand;
|
|
39
|
-
_tokensConsumed = 0;
|
|
40
|
-
_program;
|
|
41
|
-
_options = {};
|
|
42
|
-
_positionalArgs = [];
|
|
43
|
-
_positionalArgNames = [];
|
|
44
|
-
_isParsed = false;
|
|
45
|
-
constructor(_httpClient, _logger, _authenticationProvider, _accountManager) {
|
|
46
|
-
this._httpClient = _httpClient;
|
|
47
|
-
this._logger = _logger;
|
|
48
|
-
this._authenticationProvider = _authenticationProvider;
|
|
49
|
-
this._accountManager = _accountManager;
|
|
50
|
-
// Resolve command using multi-token matching against the command registry
|
|
51
|
-
this._resolvedCommand = resolveCommand(process.argv, COMMAND_TREE);
|
|
52
|
-
if (this._resolvedCommand) {
|
|
53
|
-
// Use the command path as the verb identifier for telemetry and internal checks
|
|
54
|
-
this._verb = this._resolvedCommand.path.join(' ');
|
|
55
|
-
this._tokensConsumed = this._resolvedCommand.tokensConsumed;
|
|
56
|
-
}
|
|
57
|
-
this._program = new Command();
|
|
58
|
-
// Add the --non-interactive switch as a global option
|
|
59
|
-
this._program.option('--non-interactive', 'Run in non-interactive mode (no prompts, all parameters must be provided via flags or environment variables)');
|
|
60
|
-
this._program.option('--json', 'Format output as JSON');
|
|
61
|
-
this._program.option('--no-color', 'Disable colored output');
|
|
62
|
-
// If a command was resolved, show the full command path in help/usage.
|
|
63
|
-
// Otherwise show the generic top-level help.
|
|
64
|
-
if (this._resolvedCommand) {
|
|
65
|
-
this._program.name(`${CLI_BINARY_NAME} ${this._verb}`);
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
this._program.name(CLI_BINARY_NAME);
|
|
69
|
-
this._program.usage('[option] [command] [<args>]');
|
|
70
|
-
}
|
|
71
|
-
this._program.version(packageJson.version, '-v, --version', 'output the current version');
|
|
72
|
-
this._program.description(HelpStrings.global.programDescription);
|
|
73
|
-
// Register custom help text to show verb table on global --help
|
|
74
|
-
// This uses Commander's addHelpText hook which runs when help is displayed
|
|
75
|
-
this._program.addHelpText('beforeAll', () => `${getHelpBanner()}\n\n`);
|
|
76
|
-
this._program.addHelpText('after', (_context) => {
|
|
77
|
-
// Only show verb table for global help (not verb-specific help)
|
|
78
|
-
if (!this._resolvedCommand) {
|
|
79
|
-
return '\n' + buildVerbDescriptionTable() + '\n';
|
|
80
|
-
}
|
|
81
|
-
return '';
|
|
82
|
-
});
|
|
83
|
-
const settings = getSettings();
|
|
84
|
-
// Seed the project and debug fallbacks. Command-specific flags and their environment
|
|
85
|
-
// variables are registered later and resolved by getEnvironmentId().
|
|
86
|
-
const configEnvironmentId = normalizeOptionalString(settings.appConfig?.environmentId);
|
|
87
|
-
const debugEnvironmentId = normalizeOptionalString(getCliEnvVar('MAAF_DEBUG_ENVIRONMENT_ID'));
|
|
88
|
-
this._debugEnvironmentId = debugEnvironmentId;
|
|
89
|
-
this._environmentId = configEnvironmentId ?? debugEnvironmentId;
|
|
90
|
-
if (!configEnvironmentId && debugEnvironmentId) {
|
|
91
|
-
printInfo(`[debug] ${cliEnvVarFullName('MAAF_DEBUG_ENVIRONMENT_ID')} is set to '${debugEnvironmentId}'.`);
|
|
92
|
-
}
|
|
93
|
-
const configCloud = settings.appConfig?.cloud;
|
|
94
|
-
if (configCloud) {
|
|
95
|
-
const normalized = configCloud.toLowerCase();
|
|
96
|
-
if (!Clouds.includes(normalized)) {
|
|
97
|
-
throw new UsageError(`Invalid cloud value '${configCloud}' in ms.config.json. Valid values are: ${Clouds.join(', ')}.`);
|
|
98
|
-
}
|
|
99
|
-
this._cloud = normalized;
|
|
100
|
-
this._region = cloudToRegion(this._cloud);
|
|
101
|
-
}
|
|
102
|
-
if (!this._cloud) {
|
|
103
|
-
// Do not provide a prompt, default to public
|
|
104
|
-
this.addOption({
|
|
105
|
-
flags: {
|
|
106
|
-
key: GlobalArguments.Cloud.name,
|
|
107
|
-
},
|
|
108
|
-
env: GlobalArguments.Cloud.envVar,
|
|
109
|
-
default: 'public',
|
|
110
|
-
description: HelpStrings.global.cloud,
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
initializePlayerServices({
|
|
114
|
-
httpClient: this._httpClient,
|
|
115
|
-
logger: this._logger,
|
|
116
|
-
region: this._region ?? cloudToRegion('public'),
|
|
117
|
-
environmentName: this._resolveEnvironmentId() || 'default',
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
addSwitch(cliOption) {
|
|
121
|
-
this._createOption(cliOption, false);
|
|
122
|
-
}
|
|
123
|
-
addSwitches(cliOptions) {
|
|
124
|
-
cliOptions.forEach((cliOption) => this._createOption(cliOption, false));
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Consumes the next positional token from process.argv before Commander parses flags.
|
|
128
|
-
* Increments the internal token counter so runVerb() excludes this token from Commander's
|
|
129
|
-
* args, and updates the usage string so --help shows the argument name.
|
|
130
|
-
*
|
|
131
|
-
* Must be called before runVerb().
|
|
132
|
-
*/
|
|
133
|
-
consumePositionalArg(name) {
|
|
134
|
-
const value = process.argv[2 + this._tokensConsumed];
|
|
135
|
-
// Skip flags (e.g. --help, -h) — leave them in the args for Commander to handle.
|
|
136
|
-
if (value !== undefined && !/^-[a-zA-Z-]/.test(value)) {
|
|
137
|
-
this._tokensConsumed++;
|
|
138
|
-
this._positionalArgs.push(value);
|
|
139
|
-
}
|
|
140
|
-
else {
|
|
141
|
-
this._positionalArgs.push(undefined);
|
|
142
|
-
}
|
|
143
|
-
this._positionalArgNames.push(name);
|
|
144
|
-
this._program.usage(`${this._positionalArgNames.join(' ')} [options]`);
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* Registers a variadic positional argument with Commander. Parsing uses
|
|
148
|
-
* optional syntax so the verb can provide its own missing-input error, while
|
|
149
|
-
* usage renders the argument as required.
|
|
150
|
-
*
|
|
151
|
-
* Unlike consumePositionalArg(), Commander can collect multiple values and
|
|
152
|
-
* allows options to appear before or after them. Must be called before runVerb().
|
|
153
|
-
*/
|
|
154
|
-
consumePositionalArgs(name) {
|
|
155
|
-
this._program.argument(`[${name}...]`);
|
|
156
|
-
this._positionalArgNames.push(`<${name}...>`);
|
|
157
|
-
this._program.usage(`${this._positionalArgNames.join(' ')} [options]`);
|
|
158
|
-
}
|
|
159
|
-
getPositionalArg(index) {
|
|
160
|
-
return this._positionalArgs[index];
|
|
161
|
-
}
|
|
162
|
-
getPositionalArgs(index) {
|
|
163
|
-
const value = this._program.processedArgs[index];
|
|
164
|
-
if (!Array.isArray(value)) {
|
|
165
|
-
return [];
|
|
166
|
-
}
|
|
167
|
-
return value.filter((entry) => typeof entry === 'string');
|
|
168
|
-
}
|
|
169
|
-
addOption(cliOption) {
|
|
170
|
-
this._createOption(cliOption);
|
|
171
|
-
}
|
|
172
|
-
addOptions(cliOptions) {
|
|
173
|
-
cliOptions.forEach((cliOption) => this._createOption(cliOption));
|
|
174
|
-
}
|
|
175
|
-
async runVerb() {
|
|
176
|
-
// Commander needs to see only the flag arguments, so strip the command path
|
|
177
|
-
// tokens that were consumed by the resolver (e.g., 1 for 'init', 2 for 'app init',
|
|
178
|
-
// 3 for 'app add table'). Global flag paths skip this method entirely.
|
|
179
|
-
if (this._tokensConsumed > 0) {
|
|
180
|
-
const args = [
|
|
181
|
-
process.argv[0],
|
|
182
|
-
process.argv[1],
|
|
183
|
-
...process.argv.slice(2 + this._tokensConsumed),
|
|
184
|
-
];
|
|
185
|
-
this._program.parse(args);
|
|
186
|
-
}
|
|
187
|
-
else {
|
|
188
|
-
this._program.parse();
|
|
189
|
-
}
|
|
190
|
-
this._isParsed = true;
|
|
191
|
-
await this._getRequiredVariables();
|
|
192
|
-
if (!this._region) {
|
|
193
|
-
throw new UsageError(`Region is not set. Use --cloud or set the ${cliEnvVarFullName('CLOUD_INSTANCE')} environment variable.`);
|
|
194
|
-
}
|
|
195
|
-
this._logger.setTelemetryContext({ region: this._region });
|
|
196
|
-
await this._authenticationProvider.initAsync(this._region);
|
|
197
|
-
this._logger.trackActivityEvent('Initialize', {
|
|
198
|
-
verb: this._verb,
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
// Handles scenarios where only global flags (e.g., --help/--version) are provided,
|
|
202
|
-
// or partial commands that should show contextual help (e.g., 'app', 'app add').
|
|
203
|
-
handleGlobalHelpOrFlagsAndExit() {
|
|
204
|
-
const firstToken = process.argv[2];
|
|
205
|
-
if (!firstToken) {
|
|
206
|
-
this._program.help(); // No arguments at all — show help and exit
|
|
207
|
-
}
|
|
208
|
-
// If the first token is a flag (e.g., --version, --help), let Commander handle it
|
|
209
|
-
if (firstToken.startsWith('-')) {
|
|
210
|
-
this._program.parse(process.argv);
|
|
211
|
-
this._isParsed = true;
|
|
212
|
-
return;
|
|
213
|
-
}
|
|
214
|
-
// Deep typed-verb help: when the user has drilled past the resolver's leaf
|
|
215
|
-
// match (e.g. `ms app share link --help` resolves to the `share` hybrid
|
|
216
|
-
// parent + extra positional args), surface the deeper typed verb's
|
|
217
|
-
// subcommand list rather than letting Commander print the parent's help.
|
|
218
|
-
if (this._tryPrintDeepTypedHelp()) {
|
|
219
|
-
process.exit(0);
|
|
220
|
-
}
|
|
221
|
-
// If no command resolved, surface the most contextual help/error possible.
|
|
222
|
-
if (!this._resolvedCommand) {
|
|
223
|
-
// Walk the typed-verb tree along the argv path. This handles every
|
|
224
|
-
// arbitrarily-deep "incomplete typed group" case in one place — e.g.
|
|
225
|
-
// `ms app add` (group help), `ms app add bogus` (Unknown type error),
|
|
226
|
-
// `ms app share link` (deeper group help), `ms app share link bogus`
|
|
227
|
-
// (Unknown type error).
|
|
228
|
-
const incomplete = findIncompleteTypedPath(process.argv, COMMAND_TREE);
|
|
229
|
-
if (incomplete) {
|
|
230
|
-
if (incomplete.unknownToken !== undefined) {
|
|
231
|
-
throw new UsageError(`Unknown type '${incomplete.unknownToken}' for '${CLI_BINARY_NAME} ${incomplete.pathTokens.join(' ')}'. Run "${CLI_BINARY_NAME} ${incomplete.pathTokens.join(' ')} --help" for available types.`);
|
|
232
|
-
}
|
|
233
|
-
const helpText = buildPathTypedHelpText(incomplete.pathTokens);
|
|
234
|
-
if (helpText) {
|
|
235
|
-
printInfo(`${getHelpBanner()}\n\n${helpText}`);
|
|
236
|
-
process.exit(0);
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
// Noun-level fallbacks: noun-only (show noun help) and unknown verb
|
|
240
|
-
// under a known noun (Unknown command error).
|
|
241
|
-
if (isKnownNoun(firstToken, COMMAND_TREE)) {
|
|
242
|
-
const secondToken = process.argv[3];
|
|
243
|
-
if (secondToken && !secondToken.startsWith('-')) {
|
|
244
|
-
throw new UsageError(`Unknown command '${secondToken}' under '${CLI_BINARY_NAME} ${firstToken}'. Run "${CLI_BINARY_NAME} ${firstToken} --help" for available commands.`);
|
|
245
|
-
}
|
|
246
|
-
printInfo(`${getHelpBanner()}\n\n${buildNounHelpText(firstToken)}`);
|
|
247
|
-
process.exit(0);
|
|
248
|
-
}
|
|
249
|
-
// Unrecognised top-level token (not a known noun, not a registered command)
|
|
250
|
-
throw new UsageError(`Unknown command '${firstToken}'. Run "${CLI_BINARY_NAME} --help" for available commands.`);
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
/**
|
|
254
|
-
* Detects `--help` requests on nested typed-verb paths the resolver can't
|
|
255
|
-
* leaf-match (e.g. `ms app share link --help` — `link` is a nested typed
|
|
256
|
-
* verb with no handler of its own) and prints the typed verb's flattened
|
|
257
|
-
* subcommand list. Returns true if it handled the request.
|
|
258
|
-
*
|
|
259
|
-
* Skips when the user is asking for help on a path the resolver already
|
|
260
|
-
* fully matched (those paths route through Commander's normal `--help`
|
|
261
|
-
* handling at the leaf level).
|
|
262
|
-
*/
|
|
263
|
-
_tryPrintDeepTypedHelp() {
|
|
264
|
-
const argv = process.argv.slice(2);
|
|
265
|
-
const helpIdx = argv.findIndex((t) => t === '--help' || t === '-h');
|
|
266
|
-
if (helpIdx === -1)
|
|
267
|
-
return false;
|
|
268
|
-
const pathTokens = argv.slice(0, helpIdx).filter((t) => !t.startsWith('-'));
|
|
269
|
-
// Bail when the resolver consumed every non-flag path token already —
|
|
270
|
-
// those are leaf matches (or noun-only / typed-parent help, both of
|
|
271
|
-
// which are handled by the existing branches below).
|
|
272
|
-
if (this._resolvedCommand && pathTokens.length <= this._resolvedCommand.tokensConsumed) {
|
|
273
|
-
return false;
|
|
274
|
-
}
|
|
275
|
-
const helpText = buildPathTypedHelpText(pathTokens);
|
|
276
|
-
if (!helpText)
|
|
277
|
-
return false;
|
|
278
|
-
printInfo(`${getHelpBanner()}\n\n${helpText}`);
|
|
279
|
-
return true;
|
|
280
|
-
}
|
|
281
|
-
getVerb() {
|
|
282
|
-
if (!this._resolvedCommand) {
|
|
283
|
-
throw new UsageError(`No command specified. Run "${CLI_BINARY_NAME} --help" for available commands.`);
|
|
284
|
-
}
|
|
285
|
-
return this._verb;
|
|
286
|
-
}
|
|
287
|
-
getResolvedCommand() {
|
|
288
|
-
return this._resolvedCommand;
|
|
289
|
-
}
|
|
290
|
-
async getOption(key, ignorePrompt) {
|
|
291
|
-
const settings = getSettings();
|
|
292
|
-
let value = this._program.getOptionValue(key);
|
|
293
|
-
const option = this._options[key];
|
|
294
|
-
// Fallback to environment variable if not provided via CLI
|
|
295
|
-
if (value === undefined && option && option.env) {
|
|
296
|
-
value = getCliEnvVar(option.env);
|
|
297
|
-
}
|
|
298
|
-
// Fallback to default value if not provided via CLI or Env
|
|
299
|
-
if (value === undefined && option && option.default !== undefined) {
|
|
300
|
-
value = option.default;
|
|
301
|
-
}
|
|
302
|
-
if (!value && !ignorePrompt && option?.customPrompt) {
|
|
303
|
-
if (!settings.interactive) {
|
|
304
|
-
if (option.optionalInNonInteractive) {
|
|
305
|
-
// Option is optional — return undefined and let the actions layer handle it.
|
|
306
|
-
}
|
|
307
|
-
else {
|
|
308
|
-
const flagName = option.flags.key;
|
|
309
|
-
const alias = option.flags.alias;
|
|
310
|
-
const flagHint = alias ? `--${flagName} (-${alias})` : `--${flagName}`;
|
|
311
|
-
const envHint = option.env
|
|
312
|
-
? ` or environment variable (${cliEnvVarFullName(option.env)})`
|
|
313
|
-
: '';
|
|
314
|
-
throw new UsageError(`Missing required option ${flagHint}${envHint}. In non-interactive mode, all parameters must be provided via flags or environment variables.`);
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
else {
|
|
318
|
-
value = await option.customPrompt();
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
// Option could be undefined by design, so just return it.
|
|
322
|
-
return value;
|
|
323
|
-
}
|
|
324
|
-
getAuthenticationProvider() {
|
|
325
|
-
return this._authenticationProvider;
|
|
326
|
-
}
|
|
327
|
-
getAccountManager() {
|
|
328
|
-
if (!this._accountManager) {
|
|
329
|
-
throw new UsageError(`Account management commands (auth login/logout/status/switch) are only available in interactive mode. ` +
|
|
330
|
-
`They cannot be used with service principal or HTTP forward authentication.`);
|
|
331
|
-
}
|
|
332
|
-
return this._accountManager;
|
|
333
|
-
}
|
|
334
|
-
getHttpClient() {
|
|
335
|
-
return this._httpClient;
|
|
336
|
-
}
|
|
337
|
-
/**
|
|
338
|
-
* Returns the tenant ID for the authenticated user, acquiring a token first if needed.
|
|
339
|
-
*
|
|
340
|
-
* NodeMsalAuthenticationProvider only populates _tenantId after getAccessTokenForResource()
|
|
341
|
-
* is called. This method pre-acquires a token for the Power Platform resource so the tenant
|
|
342
|
-
* ID is always available after runVerb() completes.
|
|
343
|
-
*/
|
|
344
|
-
async getTenantIdAsync() {
|
|
345
|
-
// Fast path: provider already knows the tenant ID (e.g. ServicePrincipalAuthenticationProvider).
|
|
346
|
-
const existing = this._authenticationProvider.getUserTenantId();
|
|
347
|
-
if (existing)
|
|
348
|
-
return existing;
|
|
349
|
-
// Acquire a token to populate the tenant ID from the MSAL token response.
|
|
350
|
-
if (this._region && this._region !== 'local' && this._region !== 'dev') {
|
|
351
|
-
const resource = getAuthResource()[this._region];
|
|
352
|
-
await this._authenticationProvider.getAccessTokenForResource(resource);
|
|
353
|
-
}
|
|
354
|
-
return this._authenticationProvider.getUserTenantId();
|
|
355
|
-
}
|
|
356
|
-
getAuthResourceUrl() {
|
|
357
|
-
const region = this._region ?? cloudToRegion('public');
|
|
358
|
-
if (region === 'local' || region === 'dev')
|
|
359
|
-
return getAuthResource()['test'];
|
|
360
|
-
return getAuthResource()[region];
|
|
361
|
-
}
|
|
362
|
-
getCloud() {
|
|
363
|
-
return this._cloud;
|
|
364
|
-
}
|
|
365
|
-
getLoginAuthority(tenantId) {
|
|
366
|
-
return getAuthority(this._region, tenantId);
|
|
367
|
-
}
|
|
368
|
-
/**
|
|
369
|
-
* Sets the description for the current command context.
|
|
370
|
-
* This is used to display help information specific to the verb being executed.
|
|
371
|
-
*
|
|
372
|
-
* @param {string} description - The description to set for the program.
|
|
373
|
-
*/
|
|
374
|
-
setDescription(description) {
|
|
375
|
-
this._program.description(description);
|
|
376
|
-
}
|
|
377
|
-
isJsonMode() {
|
|
378
|
-
// Once Commander has parsed, opts() is the source of truth and won't
|
|
379
|
-
// confuse `--json` as a flag with `--json` as a value to another option.
|
|
380
|
-
// Pre-parse (e.g. a UsageError thrown from handleGlobalHelpOrFlagsAndExit
|
|
381
|
-
// before parse runs) we have no choice but to peek argv directly.
|
|
382
|
-
if (this._isParsed) {
|
|
383
|
-
return this._program.opts().json === true;
|
|
384
|
-
}
|
|
385
|
-
return process.argv.includes('--json');
|
|
386
|
-
}
|
|
387
|
-
addExamples(examples) {
|
|
388
|
-
if (!examples || examples.length === 0)
|
|
389
|
-
return;
|
|
390
|
-
this._program.addHelpText('after', () => {
|
|
391
|
-
const lines = ['', 'Examples:'];
|
|
392
|
-
examples.forEach((example) => {
|
|
393
|
-
lines.push(` $ ${example}`);
|
|
394
|
-
});
|
|
395
|
-
return lines.join('\n');
|
|
396
|
-
});
|
|
397
|
-
}
|
|
398
|
-
getRegisteredFlags() {
|
|
399
|
-
const flags = new Set();
|
|
400
|
-
for (const option of this._program.options) {
|
|
401
|
-
if (option.long)
|
|
402
|
-
flags.add(option.long);
|
|
403
|
-
// Commander also accepts the positive form of negated options (--color for --no-color)
|
|
404
|
-
if (option.negate && option.long?.startsWith('--no-')) {
|
|
405
|
-
flags.add(`--${option.long.slice('--no-'.length)}`);
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
return flags;
|
|
409
|
-
}
|
|
410
|
-
getEnvironmentId(options = {}) {
|
|
411
|
-
const environmentId = this._resolveEnvironmentId(options);
|
|
412
|
-
if (environmentId) {
|
|
413
|
-
this.updateEnvironmentId(environmentId);
|
|
414
|
-
}
|
|
415
|
-
return environmentId;
|
|
416
|
-
}
|
|
417
|
-
_resolveEnvironmentId(options = {}) {
|
|
418
|
-
const option = this._options.environmentId;
|
|
419
|
-
const optionValue = this._program.getOptionValue('environmentId');
|
|
420
|
-
const environmentValue = normalizeOptionalString(optionValue) ??
|
|
421
|
-
normalizeOptionalString(option?.env ? getCliEnvVar(option.env) : undefined) ??
|
|
422
|
-
// includeConfig:false still keeps the debug override available by design.
|
|
423
|
-
normalizeOptionalString(options.includeConfig === false ? this._debugEnvironmentId : this._environmentId);
|
|
424
|
-
if (!environmentValue) {
|
|
425
|
-
return undefined;
|
|
426
|
-
}
|
|
427
|
-
return extractEnvironmentId(environmentValue);
|
|
428
|
-
}
|
|
429
|
-
updateEnvironmentId(environmentId) {
|
|
430
|
-
// Idempotent: only update once per command execution.
|
|
431
|
-
if (this._environmentIdNotified) {
|
|
432
|
-
return;
|
|
433
|
-
}
|
|
434
|
-
const normalizedEnvironmentId = extractEnvironmentId(environmentId.trim());
|
|
435
|
-
this._environmentId = normalizedEnvironmentId;
|
|
436
|
-
updateEnvironmentName(normalizedEnvironmentId);
|
|
437
|
-
if (this._region) {
|
|
438
|
-
this._logger.setTelemetryContext({
|
|
439
|
-
environmentId: normalizedEnvironmentId,
|
|
440
|
-
region: this._region,
|
|
441
|
-
});
|
|
442
|
-
}
|
|
443
|
-
this._environmentIdNotified = true;
|
|
444
|
-
}
|
|
445
|
-
async _getRequiredVariables() {
|
|
446
|
-
if (!this._cloud) {
|
|
447
|
-
const rawCloud = await this.getOption('cloud');
|
|
448
|
-
if (rawCloud) {
|
|
449
|
-
const normalized = rawCloud.toLowerCase();
|
|
450
|
-
if (!Clouds.includes(normalized)) {
|
|
451
|
-
throw new UsageError(`Invalid --cloud value '${rawCloud}'. Valid values are: ${Clouds.join(', ')}.`);
|
|
452
|
-
}
|
|
453
|
-
this._cloud = normalized;
|
|
454
|
-
this._region = cloudToRegion(this._cloud);
|
|
455
|
-
updateRegion(this._region);
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
/**
|
|
460
|
-
* @param {CliOption} cliOption
|
|
461
|
-
* @param {boolean} [hasValue=true] true if the option requires a value, false for a switch such as --help
|
|
462
|
-
*/
|
|
463
|
-
_createOption(cliOption, hasValue = true) {
|
|
464
|
-
const isOptional = hasValue && (cliOption.default !== undefined || cliOption.optionalInNonInteractive === true);
|
|
465
|
-
const description = isOptional
|
|
466
|
-
? `[optional] ${cliOption.description ?? ''}`
|
|
467
|
-
: cliOption.description;
|
|
468
|
-
const option = this._program.createOption(hasValue ? this._createFlags(cliOption.flags) : this._createSwitchFlags(cliOption.flags), description);
|
|
469
|
-
if (cliOption.parseArg) {
|
|
470
|
-
option.argParser(cliOption.parseArg);
|
|
471
|
-
}
|
|
472
|
-
// We do not set the env or default here because we want to handle it manually in getOption
|
|
473
|
-
// This allows us to hide the env variable from the help text
|
|
474
|
-
// Hide global options from help output when showing global help
|
|
475
|
-
// This prevents --environment-id and --cloud from showing up in the global help
|
|
476
|
-
if (!this._resolvedCommand || cliOption.hidden) {
|
|
477
|
-
option.hideHelp();
|
|
478
|
-
}
|
|
479
|
-
this._program.addOption(option);
|
|
480
|
-
// Map to CliOption using Commander's camelCase attribute name so option
|
|
481
|
-
// accessors find entries registered with kebab-case flags.
|
|
482
|
-
this._options[option.attributeName()] = cliOption;
|
|
483
|
-
}
|
|
484
|
-
_createFlags(flags) {
|
|
485
|
-
const { key, alias } = flags;
|
|
486
|
-
return alias ? `-${alias}, --${key} <${key}>` : `--${key} <${key}>`;
|
|
487
|
-
}
|
|
488
|
-
_createSwitchFlags(flags) {
|
|
489
|
-
const { key, alias } = flags;
|
|
490
|
-
return alias ? `-${alias}, --${key}` : `--${key}`;
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
//# sourceMappingURL=ArgumentProvider.js.map
|