-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathregisterCommands.ts
More file actions
143 lines (127 loc) · 9.9 KB
/
registerCommands.ts
File metadata and controls
143 lines (127 loc) · 9.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { registerCommand, registerCommandWithTreeNodeUnwrapping, registerErrorHandler, registerReportIssueCommand, type IActionContext } from '@microsoft/vscode-azext-utils';
import { type EnvironmentVariableItem } from '../tree/containers/EnvironmentVariableItem';
import { deployImageApiCompat } from './api/deployImageApi';
import { browseContainerAppNode } from './browseContainerApp';
import { deployWithCopilot } from './copilot/deployWithCopilot';
import { createContainerApp } from './createContainerApp/createContainerApp';
import { createManagedEnvironment } from './createManagedEnvironment/createManagedEnvironment';
import { deleteContainerApp } from './deleteContainerApp/deleteContainerApp';
import { deleteManagedEnvironment } from './deleteManagedEnvironment/deleteManagedEnvironment';
import { deployContainerApp } from './deployContainerApp/deployContainerApp';
import { deployWorkspaceProject } from './deployWorkspaceProject/deployWorkspaceProject';
import { editContainer } from './editContainer/editContainer';
import { editContainerImage } from './editContainer/editContainerImage/editContainerImage';
import { editContainerApp } from './editContainerApp';
import { addEnvironmentVariable } from './environmentVariables/addEnvironmentVariable/addEnvironmentVariable';
import { convertEnvironmentVariable } from './environmentVariables/convertEnvironmentVariable/convertEnvironmentVariable';
import { deleteEnvironmentVariable } from './environmentVariables/deleteEnvironmentVariable/deleteEnvironmentVariable';
import { editEnvironmentVariableName } from './environmentVariables/editEnvironmentVariable/editEnvironmentVariableName';
import { editEnvironmentVariableValue } from './environmentVariables/editEnvironmentVariable/editEnvironmentVariableValue';
import { editEnvironmentVariables } from './environmentVariables/editEnvironmentVariables/editEnvironmentVariables';
import { connectToGitHub } from './gitHub/connectToGitHub/connectToGitHub';
import { disconnectRepo } from './gitHub/disconnectRepo/disconnectRepo';
import { openGitHubRepo } from './gitHub/openGitHubRepo';
import { createAcr } from './image/imageSource/containerRegistry/acr/createAcr/createAcr';
import { openAcrBuildLogs } from './image/openAcrBuildLogs';
import { disableIngress } from './ingress/disableIngress/disableIngress';
import { editTargetPort } from './ingress/editTargetPort/editTargetPort';
import { enableIngress } from './ingress/enableIngress/enableIngress';
import { toggleIngressVisibility } from './ingress/toggleIngressVisibility/toggleIngressVisibility';
import { startStreamingLogs } from './logStream/startStreamingLogs';
import { stopStreamingLogs } from './logStream/stopStreamingLogs';
import { openConsoleInPortal } from './openConsoleInPortal';
import { activateRevision } from './revision/activateRevision';
import { chooseRevisionMode } from './revision/chooseRevisionMode/chooseRevisionMode';
import { deactivateRevision } from './revision/deactivateRevision';
import { restartRevision } from './revision/restartRevision';
import { createRevisionDraft } from './revisionDraft/createRevisionDraft';
import { deployRevisionDraft } from './revisionDraft/deployRevisionDraft/deployRevisionDraft';
import { discardRevisionDraft } from './revisionDraft/discardRevisionDraft';
import { editRevisionDraft } from './revisionDraft/editRevisionDraft';
import { editScaleRange } from './scaling/scaleRange/editScaleRange';
import { addScaleRule } from './scaling/scaleRule/addScaleRule/addScaleRule';
import { deleteScaleRule } from './scaling/scaleRule/deleteScaleRule/deleteScaleRule';
import { addSecret } from './secret/addSecret/addSecret';
import { deleteSecret } from './secret/deleteSecret/deleteSecret';
import { editSecretValue } from './secret/editSecret/editSecretValue';
import { addWorkspaceProjectWalkthrough } from './walkthrough/addWorkspaceProject';
import { azureSignInWalkthrough } from './walkthrough/azureSignIn';
import { cleanUpResourcesWalkthrough } from './walkthrough/cleanUpResources';
import { deployWorkspaceProjectWalkthrough } from './walkthrough/deployWorkspaceProject';
import { gettingStartedInternalWalkthrough } from './walkthrough/gettingStartedInternal';
export function registerCommands(): void {
// managed environments
registerCommandWithTreeNodeUnwrapping('containerApps.createManagedEnvironment', createManagedEnvironment);
registerCommandWithTreeNodeUnwrapping('containerApps.deleteManagedEnvironment', deleteManagedEnvironment);
// container apps
registerCommandWithTreeNodeUnwrapping('containerApps.browse', browseContainerAppNode);
registerCommandWithTreeNodeUnwrapping('containerApps.createContainerApp', createContainerApp);
registerCommandWithTreeNodeUnwrapping('containerApps.deleteContainerApp', deleteContainerApp);
registerCommandWithTreeNodeUnwrapping('containerApps.editContainerApp', editContainerApp);
registerCommandWithTreeNodeUnwrapping('containerApps.openConsoleInPortal', openConsoleInPortal);
registerCommandWithTreeNodeUnwrapping('containerApps.toggleEnvironmentVariableVisibility',
async (context: IActionContext, item: EnvironmentVariableItem) => {
await item.toggleValueVisibility(context);
});
// containers
registerCommandWithTreeNodeUnwrapping('containerApps.editContainer', editContainer);
registerCommandWithTreeNodeUnwrapping('containerApps.editContainerImage', editContainerImage);
// environment variables
registerCommandWithTreeNodeUnwrapping('containerApps.addEnvironmentVariable', addEnvironmentVariable);
registerCommandWithTreeNodeUnwrapping('containerApps.editEnvironmentVariableName', editEnvironmentVariableName);
registerCommandWithTreeNodeUnwrapping('containerApps.editEnvironmentVariableValue', editEnvironmentVariableValue);
registerCommandWithTreeNodeUnwrapping('containerApps.editEnvironmentVariables', editEnvironmentVariables);
registerCommandWithTreeNodeUnwrapping('containerApps.convertEnvironmentVariable', convertEnvironmentVariable);
registerCommandWithTreeNodeUnwrapping('containerApps.deleteEnvironmentVariable', deleteEnvironmentVariable);
// deploy
registerCommandWithTreeNodeUnwrapping('containerApps.deployImageApi', deployImageApiCompat);
registerCommandWithTreeNodeUnwrapping('containerApps.deployRevisionDraft', deployRevisionDraft);
registerCommandWithTreeNodeUnwrapping('containerApps.deployWorkspaceProject', deployWorkspaceProject);
registerCommandWithTreeNodeUnwrapping('containerApps.deployContainerApp', deployContainerApp);
registerCommandWithTreeNodeUnwrapping('containerApps.deployContainerAppWithCopilot', deployWithCopilot);
// github
registerCommandWithTreeNodeUnwrapping('containerApps.connectToGitHub', connectToGitHub);
registerCommandWithTreeNodeUnwrapping('containerApps.disconnectRepo', disconnectRepo);
registerCommandWithTreeNodeUnwrapping('containerApps.openGitHubRepo', openGitHubRepo);
// ingress
registerCommandWithTreeNodeUnwrapping('containerApps.enableIngress', enableIngress);
registerCommandWithTreeNodeUnwrapping('containerApps.disableIngress', disableIngress);
registerCommandWithTreeNodeUnwrapping('containerApps.toggleVisibility', toggleIngressVisibility);
registerCommandWithTreeNodeUnwrapping('containerApps.editTargetPort', editTargetPort);
// secret
registerCommandWithTreeNodeUnwrapping('containerApps.addSecret', addSecret);
registerCommandWithTreeNodeUnwrapping('containerApps.editSecretValue', editSecretValue);
registerCommandWithTreeNodeUnwrapping('containerApps.deleteSecret', deleteSecret);
// revisions
registerCommandWithTreeNodeUnwrapping('containerApps.chooseRevisionMode', chooseRevisionMode);
registerCommandWithTreeNodeUnwrapping('containerApps.activateRevision', activateRevision);
registerCommandWithTreeNodeUnwrapping('containerApps.deactivateRevision', deactivateRevision);
registerCommandWithTreeNodeUnwrapping('containerApps.restartRevision', restartRevision);
// revision draft
registerCommandWithTreeNodeUnwrapping('containerApps.createRevisionDraft', createRevisionDraft);
registerCommandWithTreeNodeUnwrapping('containerApps.editRevisionDraft', editRevisionDraft);
registerCommandWithTreeNodeUnwrapping('containerApps.discardRevisionDraft', discardRevisionDraft);
// scaling
registerCommandWithTreeNodeUnwrapping('containerApps.editScaleRange', editScaleRange);
registerCommandWithTreeNodeUnwrapping('containerApps.addScaleRule', addScaleRule);
registerCommandWithTreeNodeUnwrapping('containerApps.deleteScaleRule', deleteScaleRule);
// log streaming
registerCommandWithTreeNodeUnwrapping('containerApps.startStreamingLogs', startStreamingLogs);
registerCommandWithTreeNodeUnwrapping('containerApps.stopStreamingLogs', stopStreamingLogs);
// Suppress "Report an Issue" button for all errors in favor of the command
registerErrorHandler(c => c.errorHandling.suppressReportIssue = true);
registerReportIssueCommand('containerApps.reportIssue');
// registries
registerCommand('containerApps.createAcr', createAcr);
registerCommand('containerApps.openAcrBuildLogs', openAcrBuildLogs);
// walkthrough
registerCommand('containerApps.walkthrough.gettingStarted.internal', gettingStartedInternalWalkthrough);
registerCommand('containerApps.walkthrough.addWorkspaceProject', addWorkspaceProjectWalkthrough);
registerCommand('containerApps.walkthrough.azureSignIn', azureSignInWalkthrough);
registerCommand('containerApps.walkthrough.deployWorkspaceProject', deployWorkspaceProjectWalkthrough);
registerCommand('containerApps.walkthrough.cleanUpResources', cleanUpResourcesWalkthrough);
}