@microsoft/apps-cli 0.0.1 → 0.4.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/README.md +281 -1
- package/dist/ArgumentProvider.d.ts +102 -0
- package/dist/ArgumentProvider.d.ts.map +1 -0
- package/dist/ArgumentProvider.js +376 -0
- package/dist/ArgumentProvider.js.map +1 -0
- package/dist/Authentication/NodeMsalAuthenticationProvider.d.ts +18 -0
- package/dist/Authentication/NodeMsalAuthenticationProvider.d.ts.map +1 -0
- package/dist/Authentication/NodeMsalAuthenticationProvider.js +99 -0
- package/dist/Authentication/NodeMsalAuthenticationProvider.js.map +1 -0
- package/dist/Authentication/OrchardAuthenticationProvider.d.ts +13 -0
- package/dist/Authentication/OrchardAuthenticationProvider.d.ts.map +1 -0
- package/dist/Authentication/OrchardAuthenticationProvider.js +30 -0
- package/dist/Authentication/OrchardAuthenticationProvider.js.map +1 -0
- package/dist/Authentication/ServicePrincipalAuthenticationProvider.d.ts +23 -0
- package/dist/Authentication/ServicePrincipalAuthenticationProvider.d.ts.map +1 -0
- package/dist/Authentication/ServicePrincipalAuthenticationProvider.js +60 -0
- package/dist/Authentication/ServicePrincipalAuthenticationProvider.js.map +1 -0
- package/dist/Bin.d.ts +6 -0
- package/dist/Bin.d.ts.map +1 -0
- package/dist/Bin.js +7 -0
- package/dist/Bin.js.map +1 -0
- package/dist/Cli.d.ts +2 -0
- package/dist/Cli.d.ts.map +1 -0
- package/dist/Cli.js +95 -0
- package/dist/Cli.js.map +1 -0
- package/dist/CliSettings.d.ts +14 -0
- package/dist/CliSettings.d.ts.map +1 -0
- package/dist/CliSettings.js +76 -0
- package/dist/CliSettings.js.map +1 -0
- package/dist/CliUtils.d.ts +92 -0
- package/dist/CliUtils.d.ts.map +1 -0
- package/dist/CliUtils.js +218 -0
- package/dist/CliUtils.js.map +1 -0
- package/dist/Constants/CliConstants.d.ts +6 -0
- package/dist/Constants/CliConstants.d.ts.map +1 -0
- package/dist/Constants/CliConstants.js +6 -0
- package/dist/Constants/CliConstants.js.map +1 -0
- package/dist/Constants/CommandRegistry.d.ts +23 -0
- package/dist/Constants/CommandRegistry.d.ts.map +1 -0
- package/dist/Constants/CommandRegistry.js +197 -0
- package/dist/Constants/CommandRegistry.js.map +1 -0
- package/dist/Constants/HelpStrings.d.ts +329 -0
- package/dist/Constants/HelpStrings.d.ts.map +1 -0
- package/dist/Constants/HelpStrings.js +451 -0
- package/dist/Constants/HelpStrings.js.map +1 -0
- package/dist/Constants.d.ts +10 -0
- package/dist/Constants.d.ts.map +1 -0
- package/dist/Constants.js +18 -0
- package/dist/Constants.js.map +1 -0
- package/dist/Errors/CliError.d.ts +5 -0
- package/dist/Errors/CliError.d.ts.map +1 -0
- package/dist/Errors/CliError.js +7 -0
- package/dist/Errors/CliError.js.map +1 -0
- package/dist/FS/CliFs.d.ts +41 -0
- package/dist/FS/CliFs.d.ts.map +1 -0
- package/dist/FS/CliFs.js +136 -0
- package/dist/FS/CliFs.js.map +1 -0
- package/dist/HttpClient/CliHttpClient.d.ts +24 -0
- package/dist/HttpClient/CliHttpClient.d.ts.map +1 -0
- package/dist/HttpClient/CliHttpClient.js +122 -0
- package/dist/HttpClient/CliHttpClient.js.map +1 -0
- package/dist/HttpClient/OrchardProxy.d.ts +11 -0
- package/dist/HttpClient/OrchardProxy.d.ts.map +1 -0
- package/dist/HttpClient/OrchardProxy.js +25 -0
- package/dist/HttpClient/OrchardProxy.js.map +1 -0
- package/dist/HttpClient/Proxy.d.ts +7 -0
- package/dist/HttpClient/Proxy.d.ts.map +1 -0
- package/dist/HttpClient/Proxy.js +5 -0
- package/dist/HttpClient/Proxy.js.map +1 -0
- package/dist/Logger/CliLogger.d.ts +35 -0
- package/dist/Logger/CliLogger.d.ts.map +1 -0
- package/dist/Logger/CliLogger.js +237 -0
- package/dist/Logger/CliLogger.js.map +1 -0
- package/dist/Logger/ConsoleWriter.d.ts +15 -0
- package/dist/Logger/ConsoleWriter.d.ts.map +1 -0
- package/dist/Logger/ConsoleWriter.js +45 -0
- package/dist/Logger/ConsoleWriter.js.map +1 -0
- package/dist/Logger/Constants.d.ts +6 -0
- package/dist/Logger/Constants.d.ts.map +1 -0
- package/dist/Logger/Constants.js +15 -0
- package/dist/Logger/Constants.js.map +1 -0
- package/dist/Logger/LoggerSettings.d.ts +19 -0
- package/dist/Logger/LoggerSettings.d.ts.map +1 -0
- package/dist/Logger/LoggerSettings.js +114 -0
- package/dist/Logger/LoggerSettings.js.map +1 -0
- package/dist/Logger/OneDSWriter.d.ts +22 -0
- package/dist/Logger/OneDSWriter.d.ts.map +1 -0
- package/dist/Logger/OneDSWriter.js +129 -0
- package/dist/Logger/OneDSWriter.js.map +1 -0
- package/dist/Logger/Scrubber/ScrubCustomDimensions.d.ts +5 -0
- package/dist/Logger/Scrubber/ScrubCustomDimensions.d.ts.map +1 -0
- package/dist/Logger/Scrubber/ScrubCustomDimensions.js +46 -0
- package/dist/Logger/Scrubber/ScrubCustomDimensions.js.map +1 -0
- package/dist/Logger/Scrubber/ScrubCustomDimensionsConfig.d.ts +27 -0
- package/dist/Logger/Scrubber/ScrubCustomDimensionsConfig.d.ts.map +1 -0
- package/dist/Logger/Scrubber/ScrubCustomDimensionsConfig.js +168 -0
- package/dist/Logger/Scrubber/ScrubCustomDimensionsConfig.js.map +1 -0
- package/dist/Logger/Scrubber/ScrubUtils.d.ts +8 -0
- package/dist/Logger/Scrubber/ScrubUtils.d.ts.map +1 -0
- package/dist/Logger/Scrubber/ScrubUtils.js +34 -0
- package/dist/Logger/Scrubber/ScrubUtils.js.map +1 -0
- package/dist/Types/Argument.types.d.ts +27 -0
- package/dist/Types/Argument.types.d.ts.map +1 -0
- package/dist/Types/Argument.types.js +5 -0
- package/dist/Types/Argument.types.js.map +1 -0
- package/dist/Types/Cli.types.d.ts +32 -0
- package/dist/Types/Cli.types.d.ts.map +1 -0
- package/dist/Types/Cli.types.js +5 -0
- package/dist/Types/Cli.types.js.map +1 -0
- package/dist/Types/Command.types.d.ts +52 -0
- package/dist/Types/Command.types.d.ts.map +1 -0
- package/dist/Types/Command.types.js +8 -0
- package/dist/Types/Command.types.js.map +1 -0
- package/dist/Types/Datasource.types.d.ts +43 -0
- package/dist/Types/Datasource.types.d.ts.map +1 -0
- package/dist/Types/Datasource.types.js +5 -0
- package/dist/Types/Datasource.types.js.map +1 -0
- package/dist/Types/LoggerTypes.types.d.ts +17 -0
- package/dist/Types/LoggerTypes.types.d.ts.map +1 -0
- package/dist/Types/LoggerTypes.types.js +5 -0
- package/dist/Types/LoggerTypes.types.js.map +1 -0
- package/dist/Utils/BuildVerbDescriptionTable.d.ts +19 -0
- package/dist/Utils/BuildVerbDescriptionTable.d.ts.map +1 -0
- package/dist/Utils/BuildVerbDescriptionTable.js +87 -0
- package/dist/Utils/BuildVerbDescriptionTable.js.map +1 -0
- package/dist/Utils/ConsoleOutput.d.ts +80 -0
- package/dist/Utils/ConsoleOutput.d.ts.map +1 -0
- package/dist/Utils/ConsoleOutput.js +151 -0
- package/dist/Utils/ConsoleOutput.js.map +1 -0
- package/dist/Utils/DetectPackageManager.d.ts +9 -0
- package/dist/Utils/DetectPackageManager.d.ts.map +1 -0
- package/dist/Utils/DetectPackageManager.js +24 -0
- package/dist/Utils/DetectPackageManager.js.map +1 -0
- package/dist/Utils/EnhanceNetworkError.d.ts +14 -0
- package/dist/Utils/EnhanceNetworkError.d.ts.map +1 -0
- package/dist/Utils/EnhanceNetworkError.js +59 -0
- package/dist/Utils/EnhanceNetworkError.js.map +1 -0
- package/dist/Utils/EnvVars.d.ts +17 -0
- package/dist/Utils/EnvVars.d.ts.map +1 -0
- package/dist/Utils/EnvVars.js +38 -0
- package/dist/Utils/EnvVars.js.map +1 -0
- package/dist/Utils/GitCredentialConfig.d.ts +12 -0
- package/dist/Utils/GitCredentialConfig.d.ts.map +1 -0
- package/dist/Utils/GitCredentialConfig.js +32 -0
- package/dist/Utils/GitCredentialConfig.js.map +1 -0
- package/dist/Utils/GitUtils.d.ts +22 -0
- package/dist/Utils/GitUtils.d.ts.map +1 -0
- package/dist/Utils/GitUtils.js +35 -0
- package/dist/Utils/GitUtils.js.map +1 -0
- package/dist/Utils/Paging.d.ts +23 -0
- package/dist/Utils/Paging.d.ts.map +1 -0
- package/dist/Utils/Paging.js +67 -0
- package/dist/Utils/Paging.js.map +1 -0
- package/dist/Utils/ReadPackageJson.d.ts +9 -0
- package/dist/Utils/ReadPackageJson.d.ts.map +1 -0
- package/dist/Utils/ReadPackageJson.js +13 -0
- package/dist/Utils/ReadPackageJson.js.map +1 -0
- package/dist/Utils/ResolveCommand.d.ts +26 -0
- package/dist/Utils/ResolveCommand.d.ts.map +1 -0
- package/dist/Utils/ResolveCommand.js +62 -0
- package/dist/Utils/ResolveCommand.js.map +1 -0
- package/dist/Utils/RunCommand.d.ts +13 -0
- package/dist/Utils/RunCommand.d.ts.map +1 -0
- package/dist/Utils/RunCommand.js +35 -0
- package/dist/Utils/RunCommand.js.map +1 -0
- package/dist/Utils/Spinner.d.ts +15 -0
- package/dist/Utils/Spinner.d.ts.map +1 -0
- package/dist/Utils/Spinner.js +71 -0
- package/dist/Utils/Spinner.js.map +1 -0
- package/dist/Utils/zipBuildArtifact.d.ts +35 -0
- package/dist/Utils/zipBuildArtifact.d.ts.map +1 -0
- package/dist/Utils/zipBuildArtifact.js +100 -0
- package/dist/Utils/zipBuildArtifact.js.map +1 -0
- package/dist/Verbs/AddAction.d.ts +6 -0
- package/dist/Verbs/AddAction.d.ts.map +1 -0
- package/dist/Verbs/AddAction.js +87 -0
- package/dist/Verbs/AddAction.js.map +1 -0
- package/dist/Verbs/AddDataSource.d.ts +19 -0
- package/dist/Verbs/AddDataSource.d.ts.map +1 -0
- package/dist/Verbs/AddDataSource.js +174 -0
- package/dist/Verbs/AddDataSource.js.map +1 -0
- package/dist/Verbs/AddFlow.d.ts +12 -0
- package/dist/Verbs/AddFlow.d.ts.map +1 -0
- package/dist/Verbs/AddFlow.js +67 -0
- package/dist/Verbs/AddFlow.js.map +1 -0
- package/dist/Verbs/AddTable.d.ts +6 -0
- package/dist/Verbs/AddTable.d.ts.map +1 -0
- package/dist/Verbs/AddTable.js +163 -0
- package/dist/Verbs/AddTable.js.map +1 -0
- package/dist/Verbs/AuthStatus.d.ts +6 -0
- package/dist/Verbs/AuthStatus.d.ts.map +1 -0
- package/dist/Verbs/AuthStatus.js +18 -0
- package/dist/Verbs/AuthStatus.js.map +1 -0
- package/dist/Verbs/BuildMaafApp.d.ts +6 -0
- package/dist/Verbs/BuildMaafApp.d.ts.map +1 -0
- package/dist/Verbs/BuildMaafApp.js +97 -0
- package/dist/Verbs/BuildMaafApp.js.map +1 -0
- package/dist/Verbs/ConnectorHelpers.d.ts +37 -0
- package/dist/Verbs/ConnectorHelpers.d.ts.map +1 -0
- package/dist/Verbs/ConnectorHelpers.js +116 -0
- package/dist/Verbs/ConnectorHelpers.js.map +1 -0
- package/dist/Verbs/CreateMaafApp.d.ts +25 -0
- package/dist/Verbs/CreateMaafApp.d.ts.map +1 -0
- package/dist/Verbs/CreateMaafApp.js +565 -0
- package/dist/Verbs/CreateMaafApp.js.map +1 -0
- package/dist/Verbs/DeleteDataSource.d.ts +6 -0
- package/dist/Verbs/DeleteDataSource.d.ts.map +1 -0
- package/dist/Verbs/DeleteDataSource.js +106 -0
- package/dist/Verbs/DeleteDataSource.js.map +1 -0
- package/dist/Verbs/DeleteMaafApp.d.ts +23 -0
- package/dist/Verbs/DeleteMaafApp.d.ts.map +1 -0
- package/dist/Verbs/DeleteMaafApp.js +99 -0
- package/dist/Verbs/DeleteMaafApp.js.map +1 -0
- package/dist/Verbs/DeployMaafApp.d.ts +6 -0
- package/dist/Verbs/DeployMaafApp.d.ts.map +1 -0
- package/dist/Verbs/DeployMaafApp.js +96 -0
- package/dist/Verbs/DeployMaafApp.js.map +1 -0
- package/dist/Verbs/Dev.d.ts +6 -0
- package/dist/Verbs/Dev.d.ts.map +1 -0
- package/dist/Verbs/Dev.js +214 -0
- package/dist/Verbs/Dev.js.map +1 -0
- package/dist/Verbs/FindDataverseApi.d.ts +12 -0
- package/dist/Verbs/FindDataverseApi.d.ts.map +1 -0
- package/dist/Verbs/FindDataverseApi.js +101 -0
- package/dist/Verbs/FindDataverseApi.js.map +1 -0
- package/dist/Verbs/GetMaafApp.d.ts +6 -0
- package/dist/Verbs/GetMaafApp.d.ts.map +1 -0
- package/dist/Verbs/GetMaafApp.js +60 -0
- package/dist/Verbs/GetMaafApp.js.map +1 -0
- package/dist/Verbs/GetMaafBuildStatus.d.ts +6 -0
- package/dist/Verbs/GetMaafBuildStatus.d.ts.map +1 -0
- package/dist/Verbs/GetMaafBuildStatus.js +68 -0
- package/dist/Verbs/GetMaafBuildStatus.js.map +1 -0
- package/dist/Verbs/GetSettings.d.ts +12 -0
- package/dist/Verbs/GetSettings.d.ts.map +1 -0
- package/dist/Verbs/GetSettings.js +48 -0
- package/dist/Verbs/GetSettings.js.map +1 -0
- package/dist/Verbs/Init.d.ts +6 -0
- package/dist/Verbs/Init.d.ts.map +1 -0
- package/dist/Verbs/Init.js +172 -0
- package/dist/Verbs/Init.js.map +1 -0
- package/dist/Verbs/ListConnectionReferences.d.ts +6 -0
- package/dist/Verbs/ListConnectionReferences.d.ts.map +1 -0
- package/dist/Verbs/ListConnectionReferences.js +70 -0
- package/dist/Verbs/ListConnectionReferences.js.map +1 -0
- package/dist/Verbs/ListConnectorActions.d.ts +6 -0
- package/dist/Verbs/ListConnectorActions.d.ts.map +1 -0
- package/dist/Verbs/ListConnectorActions.js +79 -0
- package/dist/Verbs/ListConnectorActions.js.map +1 -0
- package/dist/Verbs/ListConnectors.d.ts +6 -0
- package/dist/Verbs/ListConnectors.d.ts.map +1 -0
- package/dist/Verbs/ListConnectors.js +66 -0
- package/dist/Verbs/ListConnectors.js.map +1 -0
- package/dist/Verbs/ListDatasets.d.ts +6 -0
- package/dist/Verbs/ListDatasets.d.ts.map +1 -0
- package/dist/Verbs/ListDatasets.js +83 -0
- package/dist/Verbs/ListDatasets.js.map +1 -0
- package/dist/Verbs/ListEnvironmentVariables.d.ts +14 -0
- package/dist/Verbs/ListEnvironmentVariables.d.ts.map +1 -0
- package/dist/Verbs/ListEnvironmentVariables.js +66 -0
- package/dist/Verbs/ListEnvironmentVariables.js.map +1 -0
- package/dist/Verbs/ListFlows.d.ts +13 -0
- package/dist/Verbs/ListFlows.d.ts.map +1 -0
- package/dist/Verbs/ListFlows.js +88 -0
- package/dist/Verbs/ListFlows.js.map +1 -0
- package/dist/Verbs/ListMaafApps.d.ts +71 -0
- package/dist/Verbs/ListMaafApps.d.ts.map +1 -0
- package/dist/Verbs/ListMaafApps.js +168 -0
- package/dist/Verbs/ListMaafApps.js.map +1 -0
- package/dist/Verbs/ListSqlStoredProcedures.d.ts +6 -0
- package/dist/Verbs/ListSqlStoredProcedures.d.ts.map +1 -0
- package/dist/Verbs/ListSqlStoredProcedures.js +84 -0
- package/dist/Verbs/ListSqlStoredProcedures.js.map +1 -0
- package/dist/Verbs/ListTables.d.ts +6 -0
- package/dist/Verbs/ListTables.d.ts.map +1 -0
- package/dist/Verbs/ListTables.js +95 -0
- package/dist/Verbs/ListTables.js.map +1 -0
- package/dist/Verbs/Login.d.ts +6 -0
- package/dist/Verbs/Login.d.ts.map +1 -0
- package/dist/Verbs/Login.js +28 -0
- package/dist/Verbs/Login.js.map +1 -0
- package/dist/Verbs/Logout.d.ts +6 -0
- package/dist/Verbs/Logout.d.ts.map +1 -0
- package/dist/Verbs/Logout.js +28 -0
- package/dist/Verbs/Logout.js.map +1 -0
- package/dist/Verbs/MaafAppPermissions.d.ts +23 -0
- package/dist/Verbs/MaafAppPermissions.d.ts.map +1 -0
- package/dist/Verbs/MaafAppPermissions.js +278 -0
- package/dist/Verbs/MaafAppPermissions.js.map +1 -0
- package/dist/Verbs/Pack.d.ts +38 -0
- package/dist/Verbs/Pack.d.ts.map +1 -0
- package/dist/Verbs/Pack.js +106 -0
- package/dist/Verbs/Pack.js.map +1 -0
- package/dist/Verbs/PushMaafApp.d.ts +6 -0
- package/dist/Verbs/PushMaafApp.d.ts.map +1 -0
- package/dist/Verbs/PushMaafApp.js +145 -0
- package/dist/Verbs/PushMaafApp.js.map +1 -0
- package/dist/Verbs/RefreshDataSource.d.ts +6 -0
- package/dist/Verbs/RefreshDataSource.d.ts.map +1 -0
- package/dist/Verbs/RefreshDataSource.js +72 -0
- package/dist/Verbs/RefreshDataSource.js.map +1 -0
- package/dist/Verbs/RemoveFlow.d.ts +12 -0
- package/dist/Verbs/RemoveFlow.d.ts.map +1 -0
- package/dist/Verbs/RemoveFlow.js +99 -0
- package/dist/Verbs/RemoveFlow.js.map +1 -0
- package/dist/Verbs/SetSetting.d.ts +12 -0
- package/dist/Verbs/SetSetting.d.ts.map +1 -0
- package/dist/Verbs/SetSetting.js +142 -0
- package/dist/Verbs/SetSetting.js.map +1 -0
- package/dist/Verbs/ShareMaafApp.d.ts +12 -0
- package/dist/Verbs/ShareMaafApp.d.ts.map +1 -0
- package/dist/Verbs/ShareMaafApp.js +14 -0
- package/dist/Verbs/ShareMaafApp.js.map +1 -0
- package/dist/Verbs/ShowMaafApp.d.ts +94 -0
- package/dist/Verbs/ShowMaafApp.d.ts.map +1 -0
- package/dist/Verbs/ShowMaafApp.js +216 -0
- package/dist/Verbs/ShowMaafApp.js.map +1 -0
- package/dist/Verbs/TelemetrySettings.d.ts +8 -0
- package/dist/Verbs/TelemetrySettings.d.ts.map +1 -0
- package/dist/Verbs/TelemetrySettings.js +104 -0
- package/dist/Verbs/TelemetrySettings.js.map +1 -0
- package/dist/Verbs/UnshareMaafApp.d.ts +12 -0
- package/dist/Verbs/UnshareMaafApp.d.ts.map +1 -0
- package/dist/Verbs/UnshareMaafApp.js +14 -0
- package/dist/Verbs/UnshareMaafApp.js.map +1 -0
- package/dist/Verbs/VerbConstants.d.ts +433 -0
- package/dist/Verbs/VerbConstants.d.ts.map +1 -0
- package/dist/Verbs/VerbConstants.js +403 -0
- package/dist/Verbs/VerbConstants.js.map +1 -0
- package/dist/Verbs/index.d.ts +40 -0
- package/dist/Verbs/index.d.ts.map +1 -0
- package/dist/Verbs/index.js +40 -0
- package/dist/Verbs/index.js.map +1 -0
- package/package.json +43 -3
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import { MaafAppReaderRoleName, modifyPermissionsAsync, resolvePrincipalByEmailAsync, } from '@microsoft/apps-actions';
|
|
5
|
+
import { AppConfigFileName } from '@microsoft/apps-common/config';
|
|
6
|
+
import { HttpClientError } from '@microsoft/apps-common/services';
|
|
7
|
+
import { getCliLogger, getSettings } from '../CliSettings.js';
|
|
8
|
+
import { isGuid, resolveAppNameAsync, resolveEnvironmentId } from '../CliUtils.js';
|
|
9
|
+
import { CLI_BINARY_NAME } from '../Constants/CliConstants.js';
|
|
10
|
+
import { HelpStrings } from '../Constants/HelpStrings.js';
|
|
11
|
+
import { UsageError } from '../Errors/CliError.js';
|
|
12
|
+
import { printInfo, printJsonSuccess, printSuccess, printWarning } from '../Utils/ConsoleOutput.js';
|
|
13
|
+
import { ShareMaafAppArguments, UnshareMaafAppArguments } from './VerbConstants.js';
|
|
14
|
+
/**
|
|
15
|
+
* Implements `ms app share` and `ms app unshare` — adds or removes the
|
|
16
|
+
* `Microsoft App Reader` role for AAD principals (users or groups) at the app
|
|
17
|
+
* scope.
|
|
18
|
+
*
|
|
19
|
+
* Pipeline:
|
|
20
|
+
* 1. Register option schema for the chosen mode and run the verb (so `--help`
|
|
21
|
+
* works outside an init'd project).
|
|
22
|
+
* 2. Require a loaded `ms.config.json`.
|
|
23
|
+
* 3. Resolve `environmentId` (`--environment-id` flag wins; otherwise from config) and tenantId.
|
|
24
|
+
* 4. Read the comma-separated principals positional; resolve email-shaped inputs
|
|
25
|
+
* to AAD object ids via Graph, pass GUID-shaped inputs through unchanged.
|
|
26
|
+
* 5. Call `modifyPermissionsAsync` with `put` or `delete` populated based on
|
|
27
|
+
* `mode`, then emit JSON or a human summary.
|
|
28
|
+
*/
|
|
29
|
+
export async function executeMaafAppPermissionsAsync(argumentProvider, mode) {
|
|
30
|
+
configureOptionSchema(argumentProvider, mode);
|
|
31
|
+
await argumentProvider.runVerb();
|
|
32
|
+
const cliSettings = getSettings();
|
|
33
|
+
if (!cliSettings.appConfig) {
|
|
34
|
+
throw new UsageError(`No ${AppConfigFileName} found in the current directory. Run "npx ${CLI_BINARY_NAME} app init" first.`);
|
|
35
|
+
}
|
|
36
|
+
// `resolveEnvironmentId` enforces flag-wins precedence and pushes the resolved
|
|
37
|
+
// id into player services so the URL builder targets the override.
|
|
38
|
+
const environmentId = await resolveEnvironmentId(argumentProvider);
|
|
39
|
+
const tenantId = await argumentProvider.getTenantIdAsync();
|
|
40
|
+
if (!tenantId) {
|
|
41
|
+
throw new UsageError('Unable to determine tenant ID. Ensure you are logged in.');
|
|
42
|
+
}
|
|
43
|
+
const appName = await resolveAppNameAsync(argumentProvider);
|
|
44
|
+
const inputs = parseInputs(argumentProvider.getPositionalArg(0));
|
|
45
|
+
if (inputs.length === 0) {
|
|
46
|
+
throw new UsageError('Provide at least one principal as a comma-separated list (AAD object IDs or email addresses).');
|
|
47
|
+
}
|
|
48
|
+
// Failures (bad shape, no Graph match, transport error) are collected here so
|
|
49
|
+
// we can warn the user but still proceed with the entries that resolved.
|
|
50
|
+
const failures = [];
|
|
51
|
+
const refs = await resolveAllAsync(inputs, failures);
|
|
52
|
+
// If nothing resolved, the operation has no inputs to apply — abort with a
|
|
53
|
+
// single error listing every failure rather than calling the RP with an empty
|
|
54
|
+
// array.
|
|
55
|
+
if (refs.length === 0) {
|
|
56
|
+
throw new UsageError(formatFailures(failures));
|
|
57
|
+
}
|
|
58
|
+
// Otherwise warn about the unresolved entries up front (so they're visible
|
|
59
|
+
// before the success line), then proceed with the resolved subset.
|
|
60
|
+
if (failures.length > 0) {
|
|
61
|
+
printWarning(formatFailures(failures));
|
|
62
|
+
}
|
|
63
|
+
const entries = refs.map(toPermissionEntry);
|
|
64
|
+
const result = await modifyPermissionsAsync({
|
|
65
|
+
tenantId,
|
|
66
|
+
environmentId,
|
|
67
|
+
logger: getCliLogger(),
|
|
68
|
+
actionsParams: {
|
|
69
|
+
appName,
|
|
70
|
+
put: mode === 'share' ? entries : [],
|
|
71
|
+
delete: mode === 'unshare' ? entries : [],
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
if (argumentProvider.isJsonMode()) {
|
|
75
|
+
const _assertNoCollision = true;
|
|
76
|
+
void _assertNoCollision;
|
|
77
|
+
printJsonSuccess({
|
|
78
|
+
...result,
|
|
79
|
+
partialFailure: failures.length > 0,
|
|
80
|
+
warnings: failures,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
printSummary(appName, mode, refs.length, result);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Splits a comma-separated string into a deduplicated, trimmed list of inputs.
|
|
89
|
+
* Each entry is either an AAD object id (GUID) or an email address. Empty
|
|
90
|
+
* segments (trailing commas, whitespace-only entries) are dropped.
|
|
91
|
+
*/
|
|
92
|
+
function parseInputs(raw) {
|
|
93
|
+
if (!raw)
|
|
94
|
+
return [];
|
|
95
|
+
const seen = new Set();
|
|
96
|
+
for (const segment of raw.split(',')) {
|
|
97
|
+
const trimmed = segment.trim();
|
|
98
|
+
if (trimmed)
|
|
99
|
+
seen.add(trimmed);
|
|
100
|
+
}
|
|
101
|
+
return [...seen];
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Resolves a list of principal inputs to AAD object ids. GUIDs pass through
|
|
105
|
+
* unchanged; anything containing `@` is treated as an email and resolved via
|
|
106
|
+
* Microsoft Graph.
|
|
107
|
+
*
|
|
108
|
+
* Per-entry failures (malformed input, no Graph match, transport error like
|
|
109
|
+
* 403 on the group lookup) are pushed to the shared `failures` array rather
|
|
110
|
+
* than throwing, so one bad email doesn't kill an otherwise-valid batch.
|
|
111
|
+
*
|
|
112
|
+
* Resolution runs Graph calls in parallel (`Promise.all`), with an in-flight
|
|
113
|
+
* map coalescing concurrent requests for the same email. The cache deduplicates
|
|
114
|
+
* within a single invocation (e.g. the same email listed twice round-trips Graph
|
|
115
|
+
* once).
|
|
116
|
+
*/
|
|
117
|
+
async function resolveAllAsync(inputs, failures) {
|
|
118
|
+
const cache = new Map();
|
|
119
|
+
const inFlight = new Map();
|
|
120
|
+
const settled = await Promise.all(inputs.map(async (input) => {
|
|
121
|
+
const cacheKey = input.toLowerCase();
|
|
122
|
+
const hit = cache.get(cacheKey);
|
|
123
|
+
if (hit)
|
|
124
|
+
return hit;
|
|
125
|
+
if (isGuid(input)) {
|
|
126
|
+
const ref = { id: input, input };
|
|
127
|
+
cache.set(cacheKey, ref);
|
|
128
|
+
return ref;
|
|
129
|
+
}
|
|
130
|
+
if (!looksLikeEmail(input)) {
|
|
131
|
+
failures.push({
|
|
132
|
+
input,
|
|
133
|
+
reason: 'not an AAD object ID (GUID) or a valid email address',
|
|
134
|
+
});
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
try {
|
|
138
|
+
let resolution = inFlight.get(cacheKey);
|
|
139
|
+
if (!resolution) {
|
|
140
|
+
resolution = resolvePrincipalByEmailAsync(input, getCliLogger());
|
|
141
|
+
inFlight.set(cacheKey, resolution);
|
|
142
|
+
}
|
|
143
|
+
const resolved = await resolution;
|
|
144
|
+
if (!resolved) {
|
|
145
|
+
failures.push({
|
|
146
|
+
input,
|
|
147
|
+
reason: 'no user or group found in this tenant (invite as a guest in Entra ID first if external)',
|
|
148
|
+
});
|
|
149
|
+
return null;
|
|
150
|
+
}
|
|
151
|
+
const ref = {
|
|
152
|
+
id: resolved.id,
|
|
153
|
+
input,
|
|
154
|
+
email: input,
|
|
155
|
+
displayName: resolved.displayName,
|
|
156
|
+
};
|
|
157
|
+
cache.set(cacheKey, ref);
|
|
158
|
+
return ref;
|
|
159
|
+
}
|
|
160
|
+
catch (error) {
|
|
161
|
+
failures.push({
|
|
162
|
+
input,
|
|
163
|
+
reason: extractGraphErrorMessage(error),
|
|
164
|
+
});
|
|
165
|
+
return null;
|
|
166
|
+
}
|
|
167
|
+
}));
|
|
168
|
+
return settled.filter((r) => r !== null);
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Renders the failure list as a single multi-line message. The intro line
|
|
172
|
+
* leads with the count so users skimming a long warning see the impact first.
|
|
173
|
+
*/
|
|
174
|
+
function formatFailures(failures) {
|
|
175
|
+
const noun = failures.length === 1 ? 'entry' : 'entries';
|
|
176
|
+
const lines = failures.map((f) => ` - ${f.input}: ${f.reason}`);
|
|
177
|
+
return [`Could not resolve ${failures.length} ${noun}:`, ...lines].join('\n');
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Extracts the meaningful piece of a Graph HTTP error and formats it as
|
|
181
|
+
* `Graph <status>: <message>`.
|
|
182
|
+
*
|
|
183
|
+
* Prefers the structured fields on {@link HttpClientError} (`status` + JSON-parsed `body`),
|
|
184
|
+
* which removes the dependency on `err.message`'s exact format and decouples this code from
|
|
185
|
+
* which `IHttpClient` implementation produced the error. For anything else (plain `Error`,
|
|
186
|
+
* non-Graph response shape, body parse failure), falls back to the raw message so we never
|
|
187
|
+
* lose information.
|
|
188
|
+
*/
|
|
189
|
+
function extractGraphErrorMessage(error) {
|
|
190
|
+
if (error instanceof HttpClientError) {
|
|
191
|
+
const message = extractGraphMessageFromBody(error.body);
|
|
192
|
+
if (message !== undefined) {
|
|
193
|
+
return `Graph ${error.status}: ${message}`;
|
|
194
|
+
}
|
|
195
|
+
return error.message;
|
|
196
|
+
}
|
|
197
|
+
return error instanceof Error ? error.message : String(error);
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Parses a Graph error body string and returns the inner `error.message`. Returns
|
|
201
|
+
* `undefined` if the body is missing, not valid JSON, or doesn't carry the
|
|
202
|
+
* `{ error: { message } }` shape. Pulled out as a top-level function so the
|
|
203
|
+
* unit tests can exercise it without constructing an `HttpClientError`.
|
|
204
|
+
*/
|
|
205
|
+
function extractGraphMessageFromBody(body) {
|
|
206
|
+
if (!body)
|
|
207
|
+
return undefined;
|
|
208
|
+
try {
|
|
209
|
+
const parsed = JSON.parse(body);
|
|
210
|
+
const message = parsed?.error?.message;
|
|
211
|
+
return typeof message === 'string' ? message : undefined;
|
|
212
|
+
}
|
|
213
|
+
catch {
|
|
214
|
+
return undefined;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Cheap pre-flight check that an input looks like an email address. We do not
|
|
219
|
+
* try to be RFC-5321 compliant — the goal is to surface obvious typos
|
|
220
|
+
* (`foo@`, `@bar`, `a@b@c`, `a@b`) as a `UsageError` naming the bad input,
|
|
221
|
+
* rather than letting Graph reject them with an opaque 400.
|
|
222
|
+
*/
|
|
223
|
+
function looksLikeEmail(input) {
|
|
224
|
+
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(input);
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Builds a `MaafAppPermission` from a resolved reference. The `name` field is a
|
|
228
|
+
* display label echoed back unchanged on the response — we prefer the friendly
|
|
229
|
+
* displayName from Graph, fall back to the original input. Setting `principal.email`
|
|
230
|
+
* (when the user supplied one) keeps the wire payload self-describing for server
|
|
231
|
+
* logs even though the response strips it.
|
|
232
|
+
*/
|
|
233
|
+
function toPermissionEntry(ref) {
|
|
234
|
+
return {
|
|
235
|
+
name: ref.displayName ?? ref.input,
|
|
236
|
+
properties: {
|
|
237
|
+
roleName: MaafAppReaderRoleName,
|
|
238
|
+
principal: ref.email ? { id: ref.id, email: ref.email } : { id: ref.id },
|
|
239
|
+
},
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* For share, the granted count comes from the server echo (the spec lets the
|
|
244
|
+
* server dedupe or treat 409 "already exists" as success and echo the entry).
|
|
245
|
+
* For unshare, the count comes from the request because the spec says `delete`
|
|
246
|
+
* is not populated on the response and may be omitted or null.
|
|
247
|
+
*/
|
|
248
|
+
function printSummary(appName, mode, inputCount, result) {
|
|
249
|
+
if (mode === 'share') {
|
|
250
|
+
const grantedCount = result.put?.length ?? 0;
|
|
251
|
+
if (grantedCount === 0) {
|
|
252
|
+
printInfo('No changes were applied.');
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
printSuccess(`Shared app '${appName}' with ${grantedCount} ${pluralize('principal', grantedCount)}. They can now play the app.`);
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
printSuccess(`Revoked play permissions for ${inputCount} ${pluralize('principal', inputCount)} on '${appName}'.`);
|
|
259
|
+
}
|
|
260
|
+
function pluralize(noun, count) {
|
|
261
|
+
return count === 1 ? noun : `${noun}s`;
|
|
262
|
+
}
|
|
263
|
+
function configureOptionSchema(argumentProvider, mode) {
|
|
264
|
+
const help = mode === 'share' ? HelpStrings.app.share : HelpStrings.app.unshare;
|
|
265
|
+
const args = mode === 'share' ? ShareMaafAppArguments : UnshareMaafAppArguments;
|
|
266
|
+
argumentProvider.setDescription(help.description);
|
|
267
|
+
argumentProvider.addExamples(help.examples);
|
|
268
|
+
argumentProvider.consumePositionalArg('<principals>');
|
|
269
|
+
argumentProvider.addOptions([
|
|
270
|
+
{
|
|
271
|
+
flags: { key: args.AppName.name, alias: args.AppName.alias },
|
|
272
|
+
env: args.AppName.envVar,
|
|
273
|
+
description: help.options.app,
|
|
274
|
+
optionalInNonInteractive: true,
|
|
275
|
+
},
|
|
276
|
+
]);
|
|
277
|
+
}
|
|
278
|
+
//# sourceMappingURL=MaafAppPermissions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MaafAppPermissions.js","sourceRoot":"","sources":["../../src/Verbs/MaafAppPermissions.ts"],"names":[],"mappings":"AAAA;;GAEG;AAOH,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,4BAA4B,GAC7B,M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OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC;AACzC,CAAC;AAED,SAAS,qBAAqB,CAC5B,gBAAkC,EAClC,IAA4B;IAE5B,MAAM,IAAI,GAAG,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC;IAChF,MAAM,IAAI,GAAG,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,uBAAuB,CAAC;IAChF,gBAAgB,CAAC,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAClD,gBAAgB,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC5C,gBAAgB,CAAC,oBAAoB,CAAC,cAAc,CAAC,CAAC;IACtD,gBAAgB,CAAC,UAAU,CAAC;QAC1B;YACE,KAAK,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE;YAC5D,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM;YACxB,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG;YAC7B,wBAAwB,EAAE,IAAI;SAC/B;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import type { AppConfig } from '@microsoft/apps-common/config';
|
|
5
|
+
import type { ArgumentProvider } from '../ArgumentProvider.js';
|
|
6
|
+
export interface PackResult {
|
|
7
|
+
/** Root of the packed output: `<projectRoot>/.{CLI_BINARY_NAME}/packed/`. */
|
|
8
|
+
packedFolder: string;
|
|
9
|
+
/** Per-app client folder inside `packedFolder` containing the copied build output. */
|
|
10
|
+
packClientOutputDir: string;
|
|
11
|
+
}
|
|
12
|
+
export interface PackOptions {
|
|
13
|
+
/**
|
|
14
|
+
* When true, suppresses all human-oriented stdout produced during pack: the build
|
|
15
|
+
* command banner, the spinner, and the build script's stdout/stderr (which is
|
|
16
|
+
* captured and surfaced only on failure). This keeps the parent stdout clean for
|
|
17
|
+
* JSON-mode callers like `ms app push --json`.
|
|
18
|
+
*/
|
|
19
|
+
quiet?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Validates the pack-related fields of `ms.config.json` (`buildPath`,
|
|
23
|
+
* `buildCommand`) without performing any I/O. Call this before any user-facing
|
|
24
|
+
* confirmation prompt so config errors surface up-front instead of after the
|
|
25
|
+
* user confirms.
|
|
26
|
+
*
|
|
27
|
+
* Typed as a TypeScript assertion predicate so callers can use `appConfig.buildPath` and
|
|
28
|
+
* `appConfig.buildCommand` as `string` (not `string | undefined`) without casts.
|
|
29
|
+
*/
|
|
30
|
+
export declare function assertPackPreconditions(appConfig: AppConfig): asserts appConfig is AppConfig & Required<Pick<AppConfig, 'buildPath' | 'buildCommand'>>;
|
|
31
|
+
/**
|
|
32
|
+
* Runs the configured build command and copies its output into the canonical packed
|
|
33
|
+
* layout `<projectRoot>/.{CLI_BINARY_NAME}/packed/apps/<appId>/client/`. Returns the
|
|
34
|
+
* paths so callers (the `app pack` verb, `app push`) can consume the artifact.
|
|
35
|
+
*/
|
|
36
|
+
export declare function packAppArtifactAsync(options?: PackOptions): Promise<PackResult>;
|
|
37
|
+
export declare function packAsync(argumentProvider: ArgumentProvider): Promise<void>;
|
|
38
|
+
//# sourceMappingURL=Pack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pack.d.ts","sourceRoot":"","sources":["../../src/Verbs/Pack.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAI/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAS5D,MAAM,WAAW,UAAU;IACzB,6EAA6E;IAC7E,YAAY,EAAE,MAAM,CAAC;IACrB,sFAAsF;IACtF,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,WAAW;IAC1B;;;;;OAKG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,SAAS,GACnB,OAAO,CAAC,SAAS,IAAI,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,GAAG,cAAc,CAAC,CAAC,CAO1F;AAED;;;;GAIG;AACH,wBAAsB,oBAAoB,CAAC,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,UAAU,CAAC,CAkDzF;AAyCD,wBAAsB,SAAS,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAQjF"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import * as fsp from 'node:fs/promises';
|
|
5
|
+
import * as path from 'node:path';
|
|
6
|
+
import { GENERATED_FOLDERNAME } from '@microsoft/apps-codegen';
|
|
7
|
+
import { AppConfigFileName } from '@microsoft/apps-common/config';
|
|
8
|
+
import JSON5 from 'json5';
|
|
9
|
+
import { getSettings } from '../CliSettings.js';
|
|
10
|
+
import { CLI_BINARY_NAME } from '../Constants/CliConstants.js';
|
|
11
|
+
import { HelpStrings } from '../Constants/HelpStrings.js';
|
|
12
|
+
import { ConfigurationError } from '../Errors/CliError.js';
|
|
13
|
+
import { printInfo, printSuccess } from '../Utils/ConsoleOutput.js';
|
|
14
|
+
import { runCommandAsync } from '../Utils/RunCommand.js';
|
|
15
|
+
import { CliSpinner } from '../Utils/Spinner.js';
|
|
16
|
+
/**
|
|
17
|
+
* Validates the pack-related fields of `ms.config.json` (`buildPath`,
|
|
18
|
+
* `buildCommand`) without performing any I/O. Call this before any user-facing
|
|
19
|
+
* confirmation prompt so config errors surface up-front instead of after the
|
|
20
|
+
* user confirms.
|
|
21
|
+
*
|
|
22
|
+
* Typed as a TypeScript assertion predicate so callers can use `appConfig.buildPath` and
|
|
23
|
+
* `appConfig.buildCommand` as `string` (not `string | undefined`) without casts.
|
|
24
|
+
*/
|
|
25
|
+
export function assertPackPreconditions(appConfig) {
|
|
26
|
+
if (!appConfig.buildPath) {
|
|
27
|
+
throw new ConfigurationError(`buildPath is required in ${AppConfigFileName} to pack an app`);
|
|
28
|
+
}
|
|
29
|
+
if (!appConfig.buildCommand) {
|
|
30
|
+
throw new ConfigurationError(`buildCommand is required in ${AppConfigFileName} to pack an app`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Runs the configured build command and copies its output into the canonical packed
|
|
35
|
+
* layout `<projectRoot>/.{CLI_BINARY_NAME}/packed/apps/<appId>/client/`. Returns the
|
|
36
|
+
* paths so callers (the `app pack` verb, `app push`) can consume the artifact.
|
|
37
|
+
*/
|
|
38
|
+
export async function packAppArtifactAsync(options = {}) {
|
|
39
|
+
const quiet = options.quiet === true;
|
|
40
|
+
const { appConfig, fileConfig } = getSettings();
|
|
41
|
+
if (!appConfig) {
|
|
42
|
+
throw new ConfigurationError(`${AppConfigFileName} is required to pack an app`);
|
|
43
|
+
}
|
|
44
|
+
const appId = appConfig.appId;
|
|
45
|
+
if (!appId) {
|
|
46
|
+
throw new ConfigurationError(`appId is required in ${AppConfigFileName} to pack an app`);
|
|
47
|
+
}
|
|
48
|
+
assertPackPreconditions(appConfig);
|
|
49
|
+
const { buildPath, buildCommand } = appConfig;
|
|
50
|
+
const projectRoot = path.dirname(path.resolve(fileConfig.appConfigPath));
|
|
51
|
+
const packedFolder = path.join(projectRoot, `.${CLI_BINARY_NAME}`, 'packed');
|
|
52
|
+
const packAppOutputDir = path.join(packedFolder, 'apps', appId);
|
|
53
|
+
const packClientOutputDir = path.join(packAppOutputDir, 'client');
|
|
54
|
+
if (!quiet) {
|
|
55
|
+
printInfo(`Running: ${buildCommand}`);
|
|
56
|
+
}
|
|
57
|
+
await runCommandAsync(buildCommand, projectRoot, { quiet });
|
|
58
|
+
const resolvedBuildPath = path.resolve(projectRoot, buildPath);
|
|
59
|
+
const spinner = quiet ? null : new CliSpinner();
|
|
60
|
+
spinner?.start();
|
|
61
|
+
try {
|
|
62
|
+
await fsp.rm(packedFolder, { recursive: true, force: true });
|
|
63
|
+
await fsp.mkdir(packClientOutputDir, { recursive: true });
|
|
64
|
+
await fsp.cp(resolvedBuildPath, packClientOutputDir, { recursive: true });
|
|
65
|
+
await fsp.copyFile(path.resolve(fileConfig.appConfigPath), path.join(packAppOutputDir, AppConfigFileName));
|
|
66
|
+
await extractDataSourcesAsync(projectRoot, packAppOutputDir);
|
|
67
|
+
await fsp.writeFile(path.join(packAppOutputDir, 'manifest.json'), JSON.stringify({ hasCustomMiddleTier: false }, null, 2));
|
|
68
|
+
}
|
|
69
|
+
finally {
|
|
70
|
+
spinner?.stop();
|
|
71
|
+
}
|
|
72
|
+
return { packedFolder, packClientOutputDir };
|
|
73
|
+
}
|
|
74
|
+
const DATA_SOURCES_TS_PATH = path.join(GENERATED_FOLDERNAME, 'dataSources.ts');
|
|
75
|
+
const DATA_SOURCES_EXPORT_REGEX = /export\s+default\s+(\{[\s\S]*\});/;
|
|
76
|
+
async function extractDataSourcesAsync(projectRoot, packAppOutputDir) {
|
|
77
|
+
const dataSourcesTsPath = path.join(projectRoot, DATA_SOURCES_TS_PATH);
|
|
78
|
+
try {
|
|
79
|
+
await fsp.access(dataSourcesTsPath);
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
printInfo(`${DATA_SOURCES_TS_PATH} not found — dataSources.json will not be included in the pack.`);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const fileContent = await fsp.readFile(dataSourcesTsPath, 'utf-8');
|
|
86
|
+
const match = DATA_SOURCES_EXPORT_REGEX.exec(fileContent);
|
|
87
|
+
if (!match?.[1]) {
|
|
88
|
+
throw new ConfigurationError(`Could not extract dataSources from ${DATA_SOURCES_TS_PATH}`);
|
|
89
|
+
}
|
|
90
|
+
let parsed;
|
|
91
|
+
try {
|
|
92
|
+
parsed = JSON5.parse(match[1]);
|
|
93
|
+
}
|
|
94
|
+
catch (err) {
|
|
95
|
+
throw new ConfigurationError(`${DATA_SOURCES_TS_PATH} has an unexpected format: ${err.message}`);
|
|
96
|
+
}
|
|
97
|
+
await fsp.writeFile(path.join(packAppOutputDir, 'dataSources.json'), JSON.stringify(parsed, null, 2));
|
|
98
|
+
}
|
|
99
|
+
export async function packAsync(argumentProvider) {
|
|
100
|
+
argumentProvider.setDescription(HelpStrings.app.pack.description);
|
|
101
|
+
argumentProvider.addExamples(HelpStrings.app.pack.examples);
|
|
102
|
+
await argumentProvider.runVerb();
|
|
103
|
+
await packAppArtifactAsync();
|
|
104
|
+
printSuccess('App successfully packed.');
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=Pack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pack.js","sourceRoot":"","sources":["../../src/Verbs/Pack.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,GAAG,MAAM,kBAAkB,CAAC;AACxC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC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I,kBAAkB,CAC1B,GAAG,oBAAoB,8BAA+B,GAAa,CAAC,OAAO,EAAE,CAC9E,CAAC;IACJ,CAAC;IACD,MAAM,GAAG,CAAC,SAAS,CACjB,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,EAC/C,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAChC,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,gBAAkC;IAChE,gBAAgB,CAAC,cAAc,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAClE,gBAAgB,CAAC,WAAW,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAE5D,MAAM,gBAAgB,CAAC,OAAO,EAAE,CAAC;IAEjC,MAAM,oBAAoB,EAAE,CAAC;IAC7B,YAAY,CAAC,0BAA0B,CAAC,CAAC;AAC3C,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import type { ArgumentProvider } from '../ArgumentProvider.js';
|
|
5
|
+
export declare function pushMaafAppAsync(argumentProvider: ArgumentProvider): Promise<void>;
|
|
6
|
+
//# sourceMappingURL=PushMaafApp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PushMaafApp.d.ts","sourceRoot":"","sources":["../../src/Verbs/PushMaafApp.ts"],"names":[],"mappings":"AAAA;;GAEG;AAOH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AA6B5D,wBAAsB,gBAAgB,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAiHxF"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import { MAX_BUILD_ARTIFACT_SIZE_BYTES, pushAsync } from '@microsoft/apps-actions';
|
|
5
|
+
import { AppConfigFileName } from '@microsoft/apps-common/config';
|
|
6
|
+
import { BuildArtifactTooLargeError } from '@microsoft/apps-common/errors';
|
|
7
|
+
import { HttpClientError } from '@microsoft/apps-common/services';
|
|
8
|
+
import { getCliLogger, getSettings } from '../CliSettings.js';
|
|
9
|
+
import { promptConfirm } from '../CliUtils.js';
|
|
10
|
+
import { HelpStrings } from '../Constants/HelpStrings.js';
|
|
11
|
+
import { AppError, ConfigurationError, UsageError } from '../Errors/CliError.js';
|
|
12
|
+
import { printInfo, printJsonSuccess, printSuccess } from '../Utils/ConsoleOutput.js';
|
|
13
|
+
import { zipBuildArtifact } from '../Utils/zipBuildArtifact.js';
|
|
14
|
+
import { assertPackPreconditions, packAppArtifactAsync } from './Pack.js';
|
|
15
|
+
import { PushMaafAppArguments } from './VerbConstants.js';
|
|
16
|
+
/**
|
|
17
|
+
* User-facing message for the "feature not enabled" case (server returns 403 with
|
|
18
|
+
* `CodeAppOperationNotAllowedInEnvironment`). Indentation preserved verbatim from the spec.
|
|
19
|
+
*/
|
|
20
|
+
const FEATURE_NOT_ENABLED_MESSAGE = `Direct push is not enabled for this app.
|
|
21
|
+
To enable direct push, contact your administrator to enable the
|
|
22
|
+
direct push setting for this app.`;
|
|
23
|
+
function formatMb(bytes) {
|
|
24
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
25
|
+
}
|
|
26
|
+
function formatBuildTooLargeMessage(bytes, capBytes) {
|
|
27
|
+
if (bytes !== undefined) {
|
|
28
|
+
return `Build artifact is ${formatMb(bytes)}, which exceeds the ${formatMb(capBytes)} limit.`;
|
|
29
|
+
}
|
|
30
|
+
return `Build artifact exceeds the ${formatMb(capBytes)} limit.`;
|
|
31
|
+
}
|
|
32
|
+
export async function pushMaafAppAsync(argumentProvider) {
|
|
33
|
+
createOptionSchema(argumentProvider);
|
|
34
|
+
await argumentProvider.runVerb();
|
|
35
|
+
const { appConfig, fileConfig } = getSettings();
|
|
36
|
+
if (!appConfig) {
|
|
37
|
+
throw new ConfigurationError(`${AppConfigFileName} is required. Run this command from a directory created by \`ms app create\`.`);
|
|
38
|
+
}
|
|
39
|
+
if (!fileConfig?.appConfigPath) {
|
|
40
|
+
throw new ConfigurationError(`${AppConfigFileName} path is unavailable.`);
|
|
41
|
+
}
|
|
42
|
+
const tenantId = await argumentProvider.getTenantIdAsync();
|
|
43
|
+
if (!tenantId) {
|
|
44
|
+
throw new UsageError('Unable to determine tenant ID. Ensure you are logged in.');
|
|
45
|
+
}
|
|
46
|
+
// Resolve environmentId: --environment-id flag wins; otherwise getEnvironmentId() (which
|
|
47
|
+
// already encapsulates ms.config.json + the debug-only MAAF_DEBUG_ENVIRONMENT_ID env
|
|
48
|
+
// var). Note: getOption keys are camelCase since Commander auto-converts the kebab-case
|
|
49
|
+
// flag name. There is intentionally no env-var fallback wired on the flag — env-var
|
|
50
|
+
// override of environment ID goes through MAAF_DEBUG_ENVIRONMENT_ID only, so the override
|
|
51
|
+
// is logged and obvious.
|
|
52
|
+
const envFromFlag = await argumentProvider.getOption('environmentId',
|
|
53
|
+
/* ignorePrompt */ true);
|
|
54
|
+
const environmentId = envFromFlag || argumentProvider.getEnvironmentId();
|
|
55
|
+
if (!environmentId) {
|
|
56
|
+
throw new UsageError(`No environment ID. Pass --environment-id or set environmentId in ${AppConfigFileName}.`);
|
|
57
|
+
}
|
|
58
|
+
const appName = appConfig.appId;
|
|
59
|
+
if (!appName) {
|
|
60
|
+
throw new UsageError(`appId is missing in ${AppConfigFileName}. Run \`ms app create\` first.`);
|
|
61
|
+
}
|
|
62
|
+
// Validate pack-related config (buildPath, buildCommand) up-front so the user
|
|
63
|
+
// doesn't get a config error after confirming the deploy prompt.
|
|
64
|
+
assertPackPreconditions(appConfig);
|
|
65
|
+
// Confirmation: skip in JSON mode and non-interactive shells (piped/CI). Gating on
|
|
66
|
+
// getSettings().interactive (rather than process.stdout.isTTY directly) keeps the
|
|
67
|
+
// decline path testable — tests can stub interactive: true and a declining promptConfirm.
|
|
68
|
+
const skipConfirm = argumentProvider.isJsonMode() || !getSettings().interactive;
|
|
69
|
+
if (!skipConfirm) {
|
|
70
|
+
const ok = await promptConfirm({
|
|
71
|
+
message: `This will build and deploy the app to environment ${environmentId}. Continue?`,
|
|
72
|
+
initialValue: false,
|
|
73
|
+
});
|
|
74
|
+
if (!ok) {
|
|
75
|
+
printInfo('Aborted.');
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
// Always pack first: build the app and stage the output in the canonical packed layout.
|
|
80
|
+
// This guarantees push uploads exactly the artifact produced by the configured build
|
|
81
|
+
// command, instead of trusting whatever happens to be on disk at `buildPath`.
|
|
82
|
+
//
|
|
83
|
+
// We pass `packClientOutputDir` (the inner `client/` folder) to the zip helper rather
|
|
84
|
+
// than `packedFolder` so the `apps/<appId>/client/` prefix is stripped — the zip ends
|
|
85
|
+
// up with build files at its root. Two reasons:
|
|
86
|
+
// (a) the `/uploadBuild` endpoint already addresses a specific app via URL params,
|
|
87
|
+
// so the wrapper would be redundant in the zip; and
|
|
88
|
+
// (b) the MHRG storage proxy mapping to the served artifact expects `index.html`
|
|
89
|
+
// at the zip root.
|
|
90
|
+
const { packClientOutputDir } = await packAppArtifactAsync({
|
|
91
|
+
quiet: argumentProvider.isJsonMode(),
|
|
92
|
+
});
|
|
93
|
+
let result;
|
|
94
|
+
try {
|
|
95
|
+
const zipBuffer = await zipBuildArtifact(packClientOutputDir, fileConfig.appConfigPath, {
|
|
96
|
+
maxBytes: MAX_BUILD_ARTIFACT_SIZE_BYTES,
|
|
97
|
+
});
|
|
98
|
+
if (!argumentProvider.isJsonMode()) {
|
|
99
|
+
printInfo('Uploading build artifact and deploying...');
|
|
100
|
+
}
|
|
101
|
+
result = await pushAsync({
|
|
102
|
+
logger: getCliLogger(),
|
|
103
|
+
actionsParams: { appName, zipBuffer },
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
catch (err) {
|
|
107
|
+
// Cap exceeded during zipping: zipBuildArtifact throws BuildArtifactTooLargeError.
|
|
108
|
+
if (err instanceof BuildArtifactTooLargeError) {
|
|
109
|
+
throw new UsageError(formatBuildTooLargeMessage(err.bytes, err.capBytes));
|
|
110
|
+
}
|
|
111
|
+
// Server "feature not enabled": 403 + CodeAppOperationNotAllowedInEnvironment.
|
|
112
|
+
if (err instanceof HttpClientError &&
|
|
113
|
+
err.status === 403 &&
|
|
114
|
+
err.code === 'CodeAppOperationNotAllowedInEnvironment') {
|
|
115
|
+
throw new AppError(FEATURE_NOT_ENABLED_MESSAGE);
|
|
116
|
+
}
|
|
117
|
+
// Server-side 413 (server-enforced cap, request size unknown to server response).
|
|
118
|
+
if (err instanceof HttpClientError && err.status === 413) {
|
|
119
|
+
throw new AppError(formatBuildTooLargeMessage(undefined, MAX_BUILD_ARTIFACT_SIZE_BYTES));
|
|
120
|
+
}
|
|
121
|
+
throw err;
|
|
122
|
+
}
|
|
123
|
+
if (argumentProvider.isJsonMode()) {
|
|
124
|
+
printJsonSuccess(result);
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
printSuccess(`Pushed app '${result.name}'.`);
|
|
128
|
+
printInfo(`Commit: ${result.commitSha}`);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
function createOptionSchema(argumentProvider) {
|
|
132
|
+
argumentProvider.setDescription(HelpStrings.app.push.description);
|
|
133
|
+
argumentProvider.addExamples(HelpStrings.app.push.examples);
|
|
134
|
+
argumentProvider.addOptions([
|
|
135
|
+
{
|
|
136
|
+
flags: {
|
|
137
|
+
key: PushMaafAppArguments.EnvironmentId.name,
|
|
138
|
+
alias: PushMaafAppArguments.EnvironmentId.alias,
|
|
139
|
+
},
|
|
140
|
+
description: HelpStrings.app.push.options.environmentId,
|
|
141
|
+
optionalInNonInteractive: true,
|
|
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AE,oBAAoB,CAAC,aAAa,CAAC,KAAK;aAChD;YACD,WAAW,EAAE,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa;YACvD,wBAAwB,EAAE,IAAI;SAC/B;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import type { ArgumentProvider } from '../ArgumentProvider.js';
|
|
5
|
+
export declare function refreshDataSourceAsync(argumentProvider: ArgumentProvider): Promise<void>;
|
|
6
|
+
//# sourceMappingURL=RefreshDataSource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RefreshDataSource.d.ts","sourceRoot":"","sources":["../../src/Verbs/RefreshDataSource.ts"],"names":[],"mappings":"AAAA;;GAEG;AAQH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAO5D,wBAAsB,sBAAsB,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CA4C9F"}
|