mulesoft-anypoint-cli-agent-fabric-plugin 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +321 -0
- package/bin/run +5 -0
- package/bin/run.cmd +3 -0
- package/dist/commands/agent-network/project/build.d.ts +26 -0
- package/dist/commands/agent-network/project/build.js +192 -0
- package/dist/commands/agent-network/project/build.js.map +1 -0
- package/dist/commands/agent-network/project/create.d.ts +28 -0
- package/dist/commands/agent-network/project/create.js +101 -0
- package/dist/commands/agent-network/project/create.js.map +1 -0
- package/dist/commands/agent-network/project/deploy.d.ts +67 -0
- package/dist/commands/agent-network/project/deploy.js +580 -0
- package/dist/commands/agent-network/project/deploy.js.map +1 -0
- package/dist/commands/agent-network/project/publish.d.ts +27 -0
- package/dist/commands/agent-network/project/publish.js +159 -0
- package/dist/commands/agent-network/project/publish.js.map +1 -0
- package/dist/commands/agent-network/setup/dependencies.d.ts +12 -0
- package/dist/commands/agent-network/setup/dependencies.js +65 -0
- package/dist/commands/agent-network/setup/dependencies.js.map +1 -0
- package/dist/commands/agent-network/setup/gateways.d.ts +31 -0
- package/dist/commands/agent-network/setup/gateways.js +175 -0
- package/dist/commands/agent-network/setup/gateways.js.map +1 -0
- package/dist/errors/base-error.d.ts +8 -0
- package/dist/errors/base-error.js +81 -0
- package/dist/errors/base-error.js.map +1 -0
- package/dist/errors/error-factory.d.ts +71 -0
- package/dist/errors/error-factory.js +362 -0
- package/dist/errors/error-factory.js.map +1 -0
- package/dist/helpers/dependency-manager.d.ts +30 -0
- package/dist/helpers/dependency-manager.js +366 -0
- package/dist/helpers/dependency-manager.js.map +1 -0
- package/dist/helpers/entitlement-utils.d.ts +4 -0
- package/dist/helpers/entitlement-utils.js +20 -0
- package/dist/helpers/entitlement-utils.js.map +1 -0
- package/dist/helpers/policy-helper.d.ts +21 -0
- package/dist/helpers/policy-helper.js +96 -0
- package/dist/helpers/policy-helper.js.map +1 -0
- package/dist/helpers/project/api-project-dependency-fetcher.d.ts +10 -0
- package/dist/helpers/project/api-project-dependency-fetcher.js +213 -0
- package/dist/helpers/project/api-project-dependency-fetcher.js.map +1 -0
- package/dist/helpers/project/constants.d.ts +52 -0
- package/dist/helpers/project/constants.js +52 -0
- package/dist/helpers/project/constants.js.map +1 -0
- package/dist/helpers/project/debug-messages.d.ts +4 -0
- package/dist/helpers/project/debug-messages.js +8 -0
- package/dist/helpers/project/debug-messages.js.map +1 -0
- package/dist/helpers/project/templates.d.ts +1 -0
- package/dist/helpers/project/templates.js +6 -0
- package/dist/helpers/project/templates.js.map +1 -0
- package/dist/helpers/project/uris.d.ts +2 -0
- package/dist/helpers/project/uris.js +8 -0
- package/dist/helpers/project/uris.js.map +1 -0
- package/dist/helpers/project/validation-commons.d.ts +6 -0
- package/dist/helpers/project/validation-commons.js +50 -0
- package/dist/helpers/project/validation-commons.js.map +1 -0
- package/dist/helpers/types.d.ts +54 -0
- package/dist/helpers/types.js +10 -0
- package/dist/helpers/types.js.map +1 -0
- package/dist/helpers/utils.d.ts +68 -0
- package/dist/helpers/utils.js +374 -0
- package/dist/helpers/utils.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -0
- package/dist/resources/mule-generation-dependencies.json +1 -0
- package/dist/resources/runtime-dependencies.json +13 -0
- package/dist/resources/schemas/mule-generation-dependencies-schema.json +52 -0
- package/dist/resources/schemas/runtime-dependencies-schema.json +57 -0
- package/dist/types/agent-network.d.ts +214 -0
- package/dist/types/agent-network.js +13 -0
- package/dist/types/agent-network.js.map +1 -0
- package/dist/types/types.d.ts +296 -0
- package/dist/types/types.js +3 -0
- package/dist/types/types.js.map +1 -0
- package/dist/utils/access-management.d.ts +5 -0
- package/dist/utils/access-management.js +14 -0
- package/dist/utils/access-management.js.map +1 -0
- package/dist/utils/api-instance-builder.d.ts +28 -0
- package/dist/utils/api-instance-builder.js +450 -0
- package/dist/utils/api-instance-builder.js.map +1 -0
- package/dist/utils/asset-builder.d.ts +28 -0
- package/dist/utils/asset-builder.js +248 -0
- package/dist/utils/asset-builder.js.map +1 -0
- package/dist/utils/constants.d.ts +73 -0
- package/dist/utils/constants.js +87 -0
- package/dist/utils/constants.js.map +1 -0
- package/dist/utils/exchange.d.ts +4 -0
- package/dist/utils/exchange.js +26 -0
- package/dist/utils/exchange.js.map +1 -0
- package/dist/utils/files.d.ts +63 -0
- package/dist/utils/files.js +300 -0
- package/dist/utils/files.js.map +1 -0
- package/dist/utils/gateway.d.ts +12 -0
- package/dist/utils/gateway.js +83 -0
- package/dist/utils/gateway.js.map +1 -0
- package/dist/utils/naming.d.ts +1 -0
- package/dist/utils/naming.js +17 -0
- package/dist/utils/naming.js.map +1 -0
- package/dist/utils/report/junit-report.d.ts +2 -0
- package/dist/utils/report/junit-report.js +19 -0
- package/dist/utils/report/junit-report.js.map +1 -0
- package/dist/utils/report/validation-report.d.ts +27 -0
- package/dist/utils/report/validation-report.js +16 -0
- package/dist/utils/report/validation-report.js.map +1 -0
- package/dist/utils/uris.d.ts +26 -0
- package/dist/utils/uris.js +41 -0
- package/dist/utils/uris.js.map +1 -0
- package/dist/utils/variables.d.ts +6 -0
- package/dist/utils/variables.js +22 -0
- package/dist/utils/variables.js.map +1 -0
- package/package.json +100 -0
- package/scripts/post-install.js +102 -0
- package/templates/agent-network.yaml.template +89 -0
- package/templates/exchange.json.template +36 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2019 Salesforce
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
# Anypoint CLI Agent Fabric Plugin
|
|
2
|
+
|
|
3
|
+
This plugin provides CLI commands for managing Agent Fabric projects, specifically Agent Network functionality.
|
|
4
|
+
|
|
5
|
+
## Commands
|
|
6
|
+
|
|
7
|
+
<!-- commands -->
|
|
8
|
+
* [`anypoint-cli-agent-fabric-plugin agent-network project build`](#anypoint-cli-agent-fabric-plugin-agent-network-project-build)
|
|
9
|
+
* [`anypoint-cli-agent-fabric-plugin agent-network project create`](#anypoint-cli-agent-fabric-plugin-agent-network-project-create)
|
|
10
|
+
* [`anypoint-cli-agent-fabric-plugin agent-network project deploy`](#anypoint-cli-agent-fabric-plugin-agent-network-project-deploy)
|
|
11
|
+
* [`anypoint-cli-agent-fabric-plugin agent-network project publish`](#anypoint-cli-agent-fabric-plugin-agent-network-project-publish)
|
|
12
|
+
* [`anypoint-cli-agent-fabric-plugin agent-network setup gateways`](#anypoint-cli-agent-fabric-plugin-agent-network-setup-gateways)
|
|
13
|
+
* [`anypoint-cli-agent-fabric-plugin conf [KEY] [VALUE]`](#anypoint-cli-agent-fabric-plugin-conf-key-value)
|
|
14
|
+
* [`anypoint-cli-agent-fabric-plugin help [COMMAND]`](#anypoint-cli-agent-fabric-plugin-help-command)
|
|
15
|
+
* [`anypoint-cli-agent-fabric-plugin version`](#anypoint-cli-agent-fabric-plugin-version)
|
|
16
|
+
|
|
17
|
+
## `anypoint-cli-agent-fabric-plugin agent-network project build`
|
|
18
|
+
|
|
19
|
+
Build the current project using the Maven wrapper (mvnw or mvnw.cmd)
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
USAGE
|
|
23
|
+
$ anypoint-cli-agent-fabric-plugin agent-network project build [--password <value> [--username <value> | --client_id <value> |
|
|
24
|
+
]] [--client_secret <value> ] [--bearer <value> | | ] [--organization <value>] [--environment <value>] [--host
|
|
25
|
+
<value>] [--collectMetrics] [--path <value>] [--debug] [--forceUpdate]
|
|
26
|
+
|
|
27
|
+
FLAGS
|
|
28
|
+
--bearer=<value> Token Bearer. You can define this in the ANYPOINT_BEARER environment variable.
|
|
29
|
+
--client_id=<value> Client ID. You can define this in the ANYPOINT_CLIENT_ID environment variable.
|
|
30
|
+
--client_secret=<value> Client Secret. You can define this in the ANYPOINT_CLIENT_SECRET environment variable.
|
|
31
|
+
--[no-]collectMetrics collect metrics. You can define this in the COLLECT_METRICS environment variable.
|
|
32
|
+
--debug Enable debug mode
|
|
33
|
+
--environment=<value> Environment Name. You can define this in the ANYPOINT_ENV environment variable.
|
|
34
|
+
--forceUpdate Force update the dependencies
|
|
35
|
+
--host=anypoint.mulesoft.com [default: anypoint.mulesoft.com] Host URL. You can define this in the ANYPOINT_HOST
|
|
36
|
+
environment variable.
|
|
37
|
+
--organization=<value> Organization Name. You can define this in the ANYPOINT_ORG environment variable.
|
|
38
|
+
--password=<value> Password. You can define this in the ANYPOINT_PASSWORD environment variable.
|
|
39
|
+
--path=<value> [default: .] The path to the project.
|
|
40
|
+
--username=<value> Username. You can define this in the ANYPOINT_USERNAME environment variable.
|
|
41
|
+
|
|
42
|
+
DESCRIPTION
|
|
43
|
+
Build the current project using the Maven wrapper (mvnw or mvnw.cmd)
|
|
44
|
+
|
|
45
|
+
EXAMPLES
|
|
46
|
+
$ agent-network project build
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## `anypoint-cli-agent-fabric-plugin agent-network project create`
|
|
50
|
+
|
|
51
|
+
Create a new project in the current directory
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
USAGE
|
|
55
|
+
$ anypoint-cli-agent-fabric-plugin agent-network project create -n <value> [--password <value> [--username <value> | --client_id
|
|
56
|
+
<value> | ]] [--client_secret <value> ] [--bearer <value> | | ] [--organization <value>] [--environment <value>]
|
|
57
|
+
[--host <value>] [--collectMetrics] [-o <value>] [--group-id <value>] [--asset-id <value>] [--asset-version <value>]
|
|
58
|
+
[--tab-size <value>] [--create-dir]
|
|
59
|
+
|
|
60
|
+
FLAGS
|
|
61
|
+
-n, --name=<value> (required) Name of the project
|
|
62
|
+
-o, --output-dir=<value> Output directory for the project
|
|
63
|
+
--asset-id=<value> Asset Name (GAV)
|
|
64
|
+
--asset-version=<value> [default: 1.0.0] Asset Version (GAV)
|
|
65
|
+
--bearer=<value> Token Bearer. You can define this in the ANYPOINT_BEARER environment variable.
|
|
66
|
+
--client_id=<value> Client ID. You can define this in the ANYPOINT_CLIENT_ID environment variable.
|
|
67
|
+
--client_secret=<value> Client Secret. You can define this in the ANYPOINT_CLIENT_SECRET environment variable.
|
|
68
|
+
--[no-]collectMetrics collect metrics. You can define this in the COLLECT_METRICS environment variable.
|
|
69
|
+
--[no-]create-dir Create new directory at output-dir for the new project using project's name
|
|
70
|
+
--environment=<value> Environment Name. You can define this in the ANYPOINT_ENV environment variable.
|
|
71
|
+
--group-id=<value> Group Id (GAV)
|
|
72
|
+
--host=anypoint.mulesoft.com [default: anypoint.mulesoft.com] Host URL. You can define this in the ANYPOINT_HOST
|
|
73
|
+
environment variable.
|
|
74
|
+
--organization=<value> Organization Name. You can define this in the ANYPOINT_ORG environment variable.
|
|
75
|
+
--password=<value> Password. You can define this in the ANYPOINT_PASSWORD environment variable.
|
|
76
|
+
--tab-size=<value> [default: 2] Tab size to ident Api Specification
|
|
77
|
+
--username=<value> Username. You can define this in the ANYPOINT_USERNAME environment variable.
|
|
78
|
+
|
|
79
|
+
DESCRIPTION
|
|
80
|
+
Create a new project in the current directory
|
|
81
|
+
|
|
82
|
+
EXAMPLES
|
|
83
|
+
$ agent-network project create --name my-project
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## `anypoint-cli-agent-fabric-plugin agent-network project deploy`
|
|
87
|
+
|
|
88
|
+
Deploys the Agent Network application
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
USAGE
|
|
92
|
+
$ anypoint-cli-agent-fabric-plugin agent-network project deploy [--password <value> [--username <value> | --client_id <value> |
|
|
93
|
+
]] [--client_secret <value> ] [--bearer <value> | | ] [--organization <value>] [--environment <value>] [--host
|
|
94
|
+
<value>] [--collectMetrics] [-i <value>] [-e <value>] [-t <value>] [--dont-wait-for-agent-network]
|
|
95
|
+
[--disable-tracing] [--property <value>] [--path <value>] [--max-retries <value>] [--json]
|
|
96
|
+
|
|
97
|
+
FLAGS
|
|
98
|
+
-e, --egress-gw=<value> [default: agent-network-egress-gw] Name of the target egress gw
|
|
99
|
+
-i, --ingress-gw=<value> [default: agent-network-ingress-gw] Name of the target ingress gw
|
|
100
|
+
-t, --target-space=<value> [default: agent-network-space] Name of the target private space to deploy
|
|
101
|
+
--bearer=<value> Token Bearer. You can define this in the ANYPOINT_BEARER environment variable.
|
|
102
|
+
--client_id=<value> Client ID. You can define this in the ANYPOINT_CLIENT_ID environment variable.
|
|
103
|
+
--client_secret=<value> Client Secret. You can define this in the ANYPOINT_CLIENT_SECRET environment variable.
|
|
104
|
+
--[no-]collectMetrics collect metrics. You can define this in the COLLECT_METRICS environment variable.
|
|
105
|
+
--disable-tracing Disable tracing functionalities
|
|
106
|
+
--dont-wait-for-agent-network Do not wait for the Agent Network to be ready
|
|
107
|
+
--environment=<value> Environment Name. You can define this in the ANYPOINT_ENV environment variable.
|
|
108
|
+
--host=anypoint.mulesoft.com [default: anypoint.mulesoft.com] Host URL. You can define this in the ANYPOINT_HOST
|
|
109
|
+
environment variable.
|
|
110
|
+
--max-retries=<value> [default: 3] Max retries to check the status of the deploying application.
|
|
111
|
+
--organization=<value> Organization Name. You can define this in the ANYPOINT_ORG environment variable.
|
|
112
|
+
--password=<value> Password. You can define this in the ANYPOINT_PASSWORD environment variable.
|
|
113
|
+
--path=<value> [default: .] The path to the project.
|
|
114
|
+
--property=<value>... [default: ] Name and value for the properties. Name:Value
|
|
115
|
+
--username=<value> Username. You can define this in the ANYPOINT_USERNAME environment variable.
|
|
116
|
+
|
|
117
|
+
GLOBAL FLAGS
|
|
118
|
+
--json Format output as json.
|
|
119
|
+
|
|
120
|
+
DESCRIPTION
|
|
121
|
+
Deploys the Agent Network application
|
|
122
|
+
|
|
123
|
+
EXAMPLES
|
|
124
|
+
$ agent-network project deploy
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## `anypoint-cli-agent-fabric-plugin agent-network project publish`
|
|
128
|
+
|
|
129
|
+
Publish current Agent Network project into Exchange
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
USAGE
|
|
133
|
+
$ anypoint-cli-agent-fabric-plugin agent-network project publish [--password <value> [--username <value> | --client_id <value> |
|
|
134
|
+
]] [--client_secret <value> ] [--bearer <value> | | ] [--organization <value>] [--environment <value>] [--host
|
|
135
|
+
<value>] [--collectMetrics] [--json] [--path <value>] [--debug]
|
|
136
|
+
|
|
137
|
+
FLAGS
|
|
138
|
+
--bearer=<value> Token Bearer. You can define this in the ANYPOINT_BEARER environment variable.
|
|
139
|
+
--client_id=<value> Client ID. You can define this in the ANYPOINT_CLIENT_ID environment variable.
|
|
140
|
+
--client_secret=<value> Client Secret. You can define this in the ANYPOINT_CLIENT_SECRET environment variable.
|
|
141
|
+
--[no-]collectMetrics collect metrics. You can define this in the COLLECT_METRICS environment variable.
|
|
142
|
+
--debug Enable debug mode
|
|
143
|
+
--environment=<value> Environment Name. You can define this in the ANYPOINT_ENV environment variable.
|
|
144
|
+
--host=anypoint.mulesoft.com [default: anypoint.mulesoft.com] Host URL. You can define this in the ANYPOINT_HOST
|
|
145
|
+
environment variable.
|
|
146
|
+
--organization=<value> Organization Name. You can define this in the ANYPOINT_ORG environment variable.
|
|
147
|
+
--password=<value> Password. You can define this in the ANYPOINT_PASSWORD environment variable.
|
|
148
|
+
--path=<value> [default: .] The path to the project.
|
|
149
|
+
--username=<value> Username. You can define this in the ANYPOINT_USERNAME environment variable.
|
|
150
|
+
|
|
151
|
+
GLOBAL FLAGS
|
|
152
|
+
--json Format output as json.
|
|
153
|
+
|
|
154
|
+
DESCRIPTION
|
|
155
|
+
Publish current Agent Network project into Exchange
|
|
156
|
+
|
|
157
|
+
EXAMPLES
|
|
158
|
+
$ agent-network project publish
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## `anypoint-cli-agent-fabric-plugin agent-network setup gateways`
|
|
162
|
+
|
|
163
|
+
Set up the Agent Network environment with the required gateways.
|
|
164
|
+
|
|
165
|
+
```
|
|
166
|
+
USAGE
|
|
167
|
+
$ anypoint-cli-agent-fabric-plugin agent-network setup gateways [--password <value> [--username <value> | --client_id <value> |
|
|
168
|
+
]] [--client_secret <value> ] [--bearer <value> | | ] [--organization <value>] [--environment <value>] [--host
|
|
169
|
+
<value>] [--collectMetrics] [-t <value>] [-i <value>] [-e <value>]
|
|
170
|
+
|
|
171
|
+
FLAGS
|
|
172
|
+
-e, --egress-gw=<value> [default: agent-network-egress-gw] Name of the egress gw
|
|
173
|
+
-i, --ingress-gw=<value> [default: agent-network-ingress-gw] Name of the ingress gw
|
|
174
|
+
-t, --target-space=<value> [default: agent-network-space] Name of the target private space where to setup the Agent
|
|
175
|
+
Network environment.
|
|
176
|
+
--bearer=<value> Token Bearer. You can define this in the ANYPOINT_BEARER environment variable.
|
|
177
|
+
--client_id=<value> Client ID. You can define this in the ANYPOINT_CLIENT_ID environment variable.
|
|
178
|
+
--client_secret=<value> Client Secret. You can define this in the ANYPOINT_CLIENT_SECRET environment variable.
|
|
179
|
+
--[no-]collectMetrics collect metrics. You can define this in the COLLECT_METRICS environment variable.
|
|
180
|
+
--environment=<value> Environment Name. You can define this in the ANYPOINT_ENV environment variable.
|
|
181
|
+
--host=anypoint.mulesoft.com [default: anypoint.mulesoft.com] Host URL. You can define this in the ANYPOINT_HOST
|
|
182
|
+
environment variable.
|
|
183
|
+
--organization=<value> Organization Name. You can define this in the ANYPOINT_ORG environment variable.
|
|
184
|
+
--password=<value> Password. You can define this in the ANYPOINT_PASSWORD environment variable.
|
|
185
|
+
--username=<value> Username. You can define this in the ANYPOINT_USERNAME environment variable.
|
|
186
|
+
|
|
187
|
+
DESCRIPTION
|
|
188
|
+
Set up the Agent Network environment with the required gateways.
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
## `anypoint-cli-agent-fabric-plugin conf [KEY] [VALUE]`
|
|
192
|
+
|
|
193
|
+
Manage authentication credentials in a configuration file (config.json)
|
|
194
|
+
|
|
195
|
+
```
|
|
196
|
+
USAGE
|
|
197
|
+
$ anypoint-cli-agent-fabric-plugin conf [KEY] [VALUE] [-h] [-k <value>] [-v <value>] [-d]
|
|
198
|
+
|
|
199
|
+
ARGUMENTS
|
|
200
|
+
KEY key of the config
|
|
201
|
+
VALUE value of the config
|
|
202
|
+
|
|
203
|
+
FLAGS
|
|
204
|
+
-d, --delete delete config key
|
|
205
|
+
-h, --help Show CLI help.
|
|
206
|
+
-k, --key=<value> key of the config
|
|
207
|
+
-v, --value=<value> value of the config
|
|
208
|
+
|
|
209
|
+
DESCRIPTION
|
|
210
|
+
Manage authentication credentials in a configuration file (config.json)
|
|
211
|
+
by adding and removing key value pairs. Set one key value pair per command execution.
|
|
212
|
+
CLI config file: ~/Library/Preferences/oclif-nodejs/config.json
|
|
213
|
+
|
|
214
|
+
EXAMPLES
|
|
215
|
+
$ anypoint-cli-agent-fabric-plugin conf username myuser
|
|
216
|
+
|
|
217
|
+
$ anypoint-cli-agent-fabric-plugin conf password mypwd
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
## `anypoint-cli-agent-fabric-plugin help [COMMAND]`
|
|
221
|
+
|
|
222
|
+
Display help for anypoint-cli-agent-fabric-plugin.
|
|
223
|
+
|
|
224
|
+
```
|
|
225
|
+
USAGE
|
|
226
|
+
$ anypoint-cli-agent-fabric-plugin help [COMMAND] [-n]
|
|
227
|
+
|
|
228
|
+
ARGUMENTS
|
|
229
|
+
COMMAND Command to show help for.
|
|
230
|
+
|
|
231
|
+
FLAGS
|
|
232
|
+
-n, --nested-commands Include all nested commands in the output.
|
|
233
|
+
|
|
234
|
+
DESCRIPTION
|
|
235
|
+
Display help for anypoint-cli-agent-fabric-plugin.
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.1.12/src/commands/help.ts)_
|
|
239
|
+
|
|
240
|
+
## `anypoint-cli-agent-fabric-plugin version`
|
|
241
|
+
|
|
242
|
+
```
|
|
243
|
+
USAGE
|
|
244
|
+
$ anypoint-cli-agent-fabric-plugin version
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
_See code: [@oclif/plugin-version](https://github.com/oclif/plugin-version/blob/v1.0.4/src/commands/version.ts)_
|
|
248
|
+
<!-- commandsstop -->
|
|
249
|
+
|
|
250
|
+
## Installation
|
|
251
|
+
|
|
252
|
+
```bash
|
|
253
|
+
npm install -g @mulesoft/anypoint-cli-agent-fabric-plugin
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
## Usage
|
|
257
|
+
|
|
258
|
+
<!-- usage -->
|
|
259
|
+
```sh-session
|
|
260
|
+
$ npm install -g @mulesoft/anypoint-cli-agent-fabric-plugin
|
|
261
|
+
$ anypoint-cli-agent-fabric-plugin COMMAND
|
|
262
|
+
running command...
|
|
263
|
+
$ anypoint-cli-agent-fabric-plugin (--version)
|
|
264
|
+
@mulesoft/anypoint-cli-agent-fabric-plugin/1.0.0 darwin-arm64 node-v20.19.2
|
|
265
|
+
$ anypoint-cli-agent-fabric-plugin --help [COMMAND]
|
|
266
|
+
USAGE
|
|
267
|
+
$ anypoint-cli-agent-fabric-plugin COMMAND
|
|
268
|
+
...
|
|
269
|
+
```
|
|
270
|
+
<!-- usagestop -->
|
|
271
|
+
|
|
272
|
+
After installation, you can use the commands directly:
|
|
273
|
+
|
|
274
|
+
```bash
|
|
275
|
+
# Create a new agent network project
|
|
276
|
+
anypoint-cli-agent-fabric-plugin agent-network project create --name my-agent-network
|
|
277
|
+
|
|
278
|
+
# Build the project
|
|
279
|
+
anypoint-cli-agent-fabric-plugin agent-network project build
|
|
280
|
+
|
|
281
|
+
# Publish to exchange
|
|
282
|
+
anypoint-cli-agent-fabric-plugin agent-network project publish
|
|
283
|
+
|
|
284
|
+
# Deploy the application
|
|
285
|
+
anypoint-cli-agent-fabric-plugin agent-network project deploy
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
## Development
|
|
289
|
+
|
|
290
|
+
### Prerequisites
|
|
291
|
+
|
|
292
|
+
- Node.js >= 20.0.0
|
|
293
|
+
- npm
|
|
294
|
+
|
|
295
|
+
### Setup
|
|
296
|
+
|
|
297
|
+
```bash
|
|
298
|
+
npm install
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
### Build
|
|
302
|
+
|
|
303
|
+
```bash
|
|
304
|
+
npm run build
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
### Test
|
|
308
|
+
|
|
309
|
+
```bash
|
|
310
|
+
npm test
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
### Lint
|
|
314
|
+
|
|
315
|
+
```bash
|
|
316
|
+
npm run lint
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
## License
|
|
320
|
+
|
|
321
|
+
MIT
|
package/bin/run
ADDED
package/bin/run.cmd
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AuthenticationBaseCommand } from 'anypoint-cli-command';
|
|
2
|
+
export default class Build extends AuthenticationBaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
path: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
7
|
+
debug: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
forceUpdate: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
'cache-dir': import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
10
|
+
"skip-environment": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
collectMetrics: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
host: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
13
|
+
environment: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
14
|
+
organization: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
15
|
+
bearer: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
16
|
+
client_secret: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
17
|
+
client_id: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
18
|
+
password: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
19
|
+
username: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
20
|
+
};
|
|
21
|
+
static LOWER_ENVS: string[];
|
|
22
|
+
run(): Promise<void>;
|
|
23
|
+
private validateAgentNetwork;
|
|
24
|
+
private validateApp;
|
|
25
|
+
private buildMuleApplication;
|
|
26
|
+
}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const anypoint_cli_command_1 = require("anypoint-cli-command");
|
|
6
|
+
const node_child_process_1 = require("node:child_process");
|
|
7
|
+
const node_path_1 = tslib_1.__importStar(require("node:path"));
|
|
8
|
+
const fs = tslib_1.__importStar(require("node:fs"));
|
|
9
|
+
const constants_1 = require("../../../utils/constants");
|
|
10
|
+
const variables_1 = require("../../../utils/variables");
|
|
11
|
+
const error_factory_1 = require("../../../errors/error-factory");
|
|
12
|
+
const utils_1 = require("../../../helpers/utils");
|
|
13
|
+
const asset_builder_1 = require("../../../utils/asset-builder");
|
|
14
|
+
const policy_helper_1 = require("../../../helpers/policy-helper");
|
|
15
|
+
const dependencies_1 = tslib_1.__importDefault(require("../setup/dependencies"));
|
|
16
|
+
const validation_commons_1 = require("../../../helpers/project/validation-commons");
|
|
17
|
+
const dependency_manager_1 = require("../../../helpers/dependency-manager");
|
|
18
|
+
class Build extends anypoint_cli_command_1.AuthenticationBaseCommand {
|
|
19
|
+
async run() {
|
|
20
|
+
const { flags } = await this.parse(Build);
|
|
21
|
+
const cwd = process.cwd();
|
|
22
|
+
const definitionRef = flags.path || cwd;
|
|
23
|
+
const lowerEnv = Build.LOWER_ENVS.includes(flags.host);
|
|
24
|
+
const isWindows = process.platform === 'win32';
|
|
25
|
+
const basePath = (0, node_path_1.isAbsolute)(definitionRef) ? definitionRef : (0, node_path_1.resolve)(cwd, definitionRef);
|
|
26
|
+
const mulesoftOrg = utils_1.MULESOFT_ORGS[flags.host];
|
|
27
|
+
const cacheDir = flags['cache-dir'];
|
|
28
|
+
const exchangeJsonPath = (0, node_path_1.join)(basePath, constants_1.EXCHANGE_JSON_FILENAME);
|
|
29
|
+
if (!fs.existsSync(exchangeJsonPath)) {
|
|
30
|
+
throw error_factory_1.ErrorFactory.projectDescriptorNotFound(definitionRef, constants_1.EXCHANGE_JSON_FILENAME);
|
|
31
|
+
}
|
|
32
|
+
anypoint_cli_command_1.Logger.info('Building agent network project...');
|
|
33
|
+
if ((0, utils_1.checkForRuntimeDependencyFiles)(cacheDir)) {
|
|
34
|
+
anypoint_cli_command_1.Logger.info('Setting up dependencies...');
|
|
35
|
+
const dependenciesCommand = new dependencies_1.default(['--cache-dir', cacheDir], this.config);
|
|
36
|
+
await dependenciesCommand.run();
|
|
37
|
+
}
|
|
38
|
+
await this.validateAgentNetwork(basePath, flags);
|
|
39
|
+
const agentNetworkDescriptor = (0, utils_1.safeJsonFileParse)(exchangeJsonPath).jsonObject;
|
|
40
|
+
const mainFilePath = (0, node_path_1.join)(basePath, agentNetworkDescriptor.main || 'agent-network-descriptor.yaml');
|
|
41
|
+
const targetDir = (0, node_path_1.join)(basePath, 'target');
|
|
42
|
+
const assetsDir = (0, node_path_1.join)(targetDir, 'assets');
|
|
43
|
+
const muleAppDir = (0, node_path_1.join)(targetDir, constants_1.MULE_BROKER_APP);
|
|
44
|
+
fs.rmSync(targetDir, { recursive: true, force: true });
|
|
45
|
+
this.validateApp(mainFilePath, agentNetworkDescriptor);
|
|
46
|
+
const processor = new asset_builder_1.AgentNetworkAssetBuilder(mainFilePath, muleAppDir, agentNetworkDescriptor, mulesoftOrg);
|
|
47
|
+
policy_helper_1.PolicyHelper.validateAllPolicies(processor.an, agentNetworkDescriptor, mulesoftOrg, basePath);
|
|
48
|
+
if (processor.hasBrokers()) {
|
|
49
|
+
await this.buildMuleApplication(basePath, isWindows, muleAppDir, mainFilePath, exchangeJsonPath, definitionRef, lowerEnv, flags, cacheDir);
|
|
50
|
+
}
|
|
51
|
+
anypoint_cli_command_1.Logger.cliStart('Building assets');
|
|
52
|
+
try {
|
|
53
|
+
await processor.buildAssets(assetsDir);
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
anypoint_cli_command_1.Logger.cliEndFailed();
|
|
57
|
+
throw error_factory_1.ErrorFactory.buildAssetsError(assetsDir, error);
|
|
58
|
+
}
|
|
59
|
+
anypoint_cli_command_1.Logger.cliEndOk();
|
|
60
|
+
anypoint_cli_command_1.Logger.info(`Agent network project '${processor.descriptor.name}' build succeeded.`);
|
|
61
|
+
}
|
|
62
|
+
async validateAgentNetwork(basePath, flags) {
|
|
63
|
+
anypoint_cli_command_1.Logger.cliStart('Validating agent network definition');
|
|
64
|
+
const client = (0, validation_commons_1.getProjectClient)(basePath, this.req, constants_1.EXCHANGE_MODULES_DIR_NAME);
|
|
65
|
+
const apbReport = await client.validate();
|
|
66
|
+
const apbResults = apbReport.results();
|
|
67
|
+
const report = apbResults.length > 0 ? (0, validation_commons_1.transformErrors)(apbResults) : [];
|
|
68
|
+
if (apbReport.conforms()) {
|
|
69
|
+
anypoint_cli_command_1.Logger.cliEndOk();
|
|
70
|
+
anypoint_cli_command_1.Logger.info('Agent network project is valid.');
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
(0, utils_1.showResults)({ syntaxValidations: report, functionalValidations: [] }, { ...flags, location: basePath });
|
|
74
|
+
anypoint_cli_command_1.Logger.cliEndFailed();
|
|
75
|
+
throw error_factory_1.ErrorFactory.invalidAgentNetworkProject();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
validateApp(mainFilePath, agentNetworkDescriptor) {
|
|
79
|
+
var _a;
|
|
80
|
+
const content = fs.readFileSync(mainFilePath, constants_1.UTF8);
|
|
81
|
+
const flattenedVariables = variables_1.VariablesHelper.flattenVariables((_a = agentNetworkDescriptor.metadata) === null || _a === void 0 ? void 0 : _a.variables);
|
|
82
|
+
const allVariables = { ...flattenedVariables, [constants_1.EGRESS_GW_URL_PROPERTY]: {}, [constants_1.INGRESS_GW_URL_PROPERTY]: {} };
|
|
83
|
+
const matches = content.matchAll(/\${([^}]+)}/g);
|
|
84
|
+
anypoint_cli_command_1.Logger.cliStart('Validating agent network variables');
|
|
85
|
+
// First we validate placeholders
|
|
86
|
+
const nonFoundVariables = [];
|
|
87
|
+
for (const match of matches) {
|
|
88
|
+
const varName = match[1];
|
|
89
|
+
if (!(varName in allVariables)) {
|
|
90
|
+
nonFoundVariables.push(varName);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
if (nonFoundVariables.length > 0) {
|
|
94
|
+
throw error_factory_1.ErrorFactory.variablesNotFound(nonFoundVariables);
|
|
95
|
+
}
|
|
96
|
+
anypoint_cli_command_1.Logger.cliEndOk();
|
|
97
|
+
}
|
|
98
|
+
async buildMuleApplication(basePath, isWindows, muleAppDir, mainFilePath, exchangeJsonPath, definitionRef, lowerEnv, flags, cacheDir) {
|
|
99
|
+
const mvnSettingsXmlPath = (0, node_path_1.join)(basePath, '.mvn', 'settings.xml');
|
|
100
|
+
const jarPath = (0, node_path_1.join)(cacheDir, constants_1.BUILD_JAR_FILENAME);
|
|
101
|
+
anypoint_cli_command_1.Logger.cliStart('Generating brokers application');
|
|
102
|
+
const javaHome = process.env.JAVA_HOME;
|
|
103
|
+
if (javaHome) {
|
|
104
|
+
anypoint_cli_command_1.Logger.debug(`JAVA_HOME: ${javaHome}`);
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
anypoint_cli_command_1.Logger.error('JAVA_HOME is not set.');
|
|
108
|
+
}
|
|
109
|
+
const muleGenerationDependencies = await dependency_manager_1.DependencyManager.retrieveMuleGenerationDependencies();
|
|
110
|
+
const versionsParameter = muleGenerationDependencies.map(({ name, version }) => [name, version].join('=')).join(',');
|
|
111
|
+
const javaExecutable = isWindows ? (0, utils_1.quoteValue)(`${javaHome}\\bin\\java.exe`) : `${javaHome}/bin/java`;
|
|
112
|
+
let arg = isWindows ?
|
|
113
|
+
['-jar', (0, utils_1.quoteValue)(jarPath), 'generate', (0, utils_1.quoteValue)(mainFilePath), (0, utils_1.quoteValue)(exchangeJsonPath), lowerEnv.toString(), (0, utils_1.quoteValue)((0, utils_1.resolveExchangeModuleDir)()), (0, utils_1.quoteValue)(muleAppDir)] :
|
|
114
|
+
['-jar', jarPath, 'generate', mainFilePath, exchangeJsonPath, lowerEnv.toString(), (0, utils_1.resolveExchangeModuleDir)(), muleAppDir];
|
|
115
|
+
if (versionsParameter.length > 0) {
|
|
116
|
+
arg = [...arg, (isWindows ? (0, utils_1.quoteValue)(versionsParameter) : versionsParameter)];
|
|
117
|
+
}
|
|
118
|
+
const appGenerationResult = (0, node_child_process_1.spawnSync)(javaExecutable, arg, {
|
|
119
|
+
cwd: basePath,
|
|
120
|
+
stdio: 'inherit',
|
|
121
|
+
shell: isWindows, // needed for .cmd on Windows
|
|
122
|
+
});
|
|
123
|
+
if (appGenerationResult.status === 0) {
|
|
124
|
+
anypoint_cli_command_1.Logger.cliEndOk();
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
anypoint_cli_command_1.Logger.cliEndFailed();
|
|
128
|
+
throw error_factory_1.ErrorFactory.validatingAgentNetworkError(appGenerationResult.status);
|
|
129
|
+
}
|
|
130
|
+
anypoint_cli_command_1.Logger.cliStart('Building brokers application');
|
|
131
|
+
const wrapperCmd = isWindows ? 'mvnw.cmd' : './mvnw';
|
|
132
|
+
const wrapperPath = (0, node_path_1.join)(muleAppDir, wrapperCmd);
|
|
133
|
+
if (!fs.existsSync(wrapperPath)) {
|
|
134
|
+
throw error_factory_1.ErrorFactory.wrapperNotFoundError(definitionRef, wrapperPath);
|
|
135
|
+
}
|
|
136
|
+
const mavenParameters = ['clean', 'package'];
|
|
137
|
+
if (flags.debug) {
|
|
138
|
+
mavenParameters.push('-X');
|
|
139
|
+
}
|
|
140
|
+
if (flags.forceUpdate) {
|
|
141
|
+
mavenParameters.push('-U');
|
|
142
|
+
}
|
|
143
|
+
if (fs.existsSync(mvnSettingsXmlPath)) {
|
|
144
|
+
const quotedSettingsXmlPath = (0, utils_1.quoteValue)(mvnSettingsXmlPath);
|
|
145
|
+
anypoint_cli_command_1.Logger.info(`Using settings.xml file: ${quotedSettingsXmlPath}`);
|
|
146
|
+
mavenParameters.push('-s', quotedSettingsXmlPath);
|
|
147
|
+
}
|
|
148
|
+
const mavenExecutable = isWindows ? (0, utils_1.quoteValue)(wrapperPath) : wrapperPath;
|
|
149
|
+
const result = (0, node_child_process_1.spawnSync)(mavenExecutable, mavenParameters, {
|
|
150
|
+
cwd: muleAppDir,
|
|
151
|
+
stdio: 'inherit',
|
|
152
|
+
shell: isWindows, // needed for .cmd on Windows
|
|
153
|
+
});
|
|
154
|
+
if (result.status !== 0) {
|
|
155
|
+
anypoint_cli_command_1.Logger.cliEndFailed();
|
|
156
|
+
throw error_factory_1.ErrorFactory.buildBrokersAppError(result.status);
|
|
157
|
+
}
|
|
158
|
+
anypoint_cli_command_1.Logger.cliEndOk();
|
|
159
|
+
return muleAppDir;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
exports.default = Build;
|
|
163
|
+
Build.description = 'Build the current project using the Maven wrapper (mvnw or mvnw.cmd)';
|
|
164
|
+
Build.examples = [
|
|
165
|
+
'$ agent-network project build',
|
|
166
|
+
];
|
|
167
|
+
Build.flags = {
|
|
168
|
+
...anypoint_cli_command_1.AuthenticationBaseCommand.flags,
|
|
169
|
+
path: core_1.Flags.file({
|
|
170
|
+
description: 'The path to the project.',
|
|
171
|
+
default: '.',
|
|
172
|
+
}),
|
|
173
|
+
debug: core_1.Flags.boolean({
|
|
174
|
+
description: 'Enable debug mode',
|
|
175
|
+
default: false,
|
|
176
|
+
}),
|
|
177
|
+
forceUpdate: core_1.Flags.boolean({
|
|
178
|
+
description: 'Force update the dependencies',
|
|
179
|
+
default: false,
|
|
180
|
+
}),
|
|
181
|
+
'cache-dir': core_1.Flags.string({
|
|
182
|
+
description: 'Specify the directory where the command will find the required downloaded dependencies',
|
|
183
|
+
default: node_path_1.default.join(__dirname, '../../../../jvmLib'),
|
|
184
|
+
hidden: true
|
|
185
|
+
}),
|
|
186
|
+
};
|
|
187
|
+
Build.LOWER_ENVS = [
|
|
188
|
+
'devx.anypoint.mulesoft.com',
|
|
189
|
+
'qax.anypoint.mulesoft.com',
|
|
190
|
+
'stgx.anypoint.mulesoft.com',
|
|
191
|
+
];
|
|
192
|
+
//# sourceMappingURL=build.js.map
|
|
@@ -0,0 +1 @@
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+B;QAC5C,OAAO,EAAE,KAAK;KACf,CAAC;IACF,WAAW,EAAE,YAAK,CAAC,MAAM,CAAC;QACxB,WAAW,EAAE,wFAAwF;QACrG,OAAO,EAAE,mBAAI,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC;QACnD,MAAM,EAAE,IAAI;KACb,CAAC;CACH,CAAA;AAEM,gBAAU,GAAG;IAClB,4BAA4B;IAC5B,2BAA2B;IAC3B,4BAA4B;CAC7B,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { AuthenticationBaseCommand } from 'anypoint-cli-command';
|
|
2
|
+
export default class Create extends AuthenticationBaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
name: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
7
|
+
'output-dir': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
8
|
+
'group-id': import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
9
|
+
'asset-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
10
|
+
'asset-version': import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
11
|
+
'tab-size': import("@oclif/core/lib/interfaces").OptionFlag<number>;
|
|
12
|
+
'create-dir': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
"skip-environment": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
collectMetrics: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
host: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
16
|
+
environment: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
17
|
+
organization: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
18
|
+
bearer: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
19
|
+
client_secret: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
20
|
+
client_id: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
21
|
+
password: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
22
|
+
username: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
23
|
+
};
|
|
24
|
+
static mainFile: string;
|
|
25
|
+
run(): Promise<void>;
|
|
26
|
+
validateFlags(validSemver: string | null, assetVersion: string, groupId: string): void;
|
|
27
|
+
checkAndCreateProjectDirectory(projectDirectory: string, outputDir: string, normalizedName: string): Promise<void>;
|
|
28
|
+
}
|