hereya-cli 0.2.1
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 +392 -0
- package/bin/dev.cmd +3 -0
- package/bin/dev.js +6 -0
- package/bin/run.cmd +3 -0
- package/bin/run.js +5 -0
- package/dist/backend/common.d.ts +126 -0
- package/dist/backend/common.js +1 -0
- package/dist/backend/index.d.ts +4 -0
- package/dist/backend/index.js +5 -0
- package/dist/backend/local.d.ts +16 -0
- package/dist/backend/local.js +231 -0
- package/dist/commands/add/index.d.ts +13 -0
- package/dist/commands/add/index.js +96 -0
- package/dist/commands/bootstrap/index.d.ts +12 -0
- package/dist/commands/bootstrap/index.js +28 -0
- package/dist/commands/down/index.d.ts +10 -0
- package/dist/commands/down/index.js +78 -0
- package/dist/commands/env/index.d.ts +10 -0
- package/dist/commands/env/index.js +46 -0
- package/dist/commands/init/index.d.ts +13 -0
- package/dist/commands/init/index.js +46 -0
- package/dist/commands/remote/exec/index.d.ts +12 -0
- package/dist/commands/remote/exec/index.js +65 -0
- package/dist/commands/remove/index.d.ts +12 -0
- package/dist/commands/remove/index.js +80 -0
- package/dist/commands/run/index.d.ts +14 -0
- package/dist/commands/run/index.js +60 -0
- package/dist/commands/up/index.d.ts +10 -0
- package/dist/commands/up/index.js +121 -0
- package/dist/commands/workspace/create/index.d.ts +9 -0
- package/dist/commands/workspace/create/index.js +25 -0
- package/dist/commands/workspace/delete/index.d.ts +9 -0
- package/dist/commands/workspace/delete/index.js +24 -0
- package/dist/commands/workspace/env/index.d.ts +9 -0
- package/dist/commands/workspace/env/index.js +28 -0
- package/dist/commands/workspace/install/index.d.ts +14 -0
- package/dist/commands/workspace/install/index.js +74 -0
- package/dist/commands/workspace/uninstall/index.d.ts +14 -0
- package/dist/commands/workspace/uninstall/index.js +85 -0
- package/dist/iac/cdk.d.ts +8 -0
- package/dist/iac/cdk.js +83 -0
- package/dist/iac/common.d.ts +29 -0
- package/dist/iac/common.js +5 -0
- package/dist/iac/index.d.ts +16 -0
- package/dist/iac/index.js +18 -0
- package/dist/iac/terraform.d.ts +6 -0
- package/dist/iac/terraform.js +67 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/infrastructure/aws.d.ts +8 -0
- package/dist/infrastructure/aws.js +28 -0
- package/dist/infrastructure/common.d.ts +59 -0
- package/dist/infrastructure/common.js +7 -0
- package/dist/infrastructure/index.d.ts +43 -0
- package/dist/infrastructure/index.js +82 -0
- package/dist/infrastructure/local.d.ts +14 -0
- package/dist/infrastructure/local.js +81 -0
- package/dist/lib/config/common.d.ts +34 -0
- package/dist/lib/config/common.js +1 -0
- package/dist/lib/config/index.d.ts +3 -0
- package/dist/lib/config/index.js +5 -0
- package/dist/lib/config/simple.d.ts +8 -0
- package/dist/lib/config/simple.js +41 -0
- package/dist/lib/env/index.d.ts +27 -0
- package/dist/lib/env/index.js +42 -0
- package/dist/lib/env-utils.d.ts +8 -0
- package/dist/lib/env-utils.js +20 -0
- package/dist/lib/filesystem.d.ts +1 -0
- package/dist/lib/filesystem.js +15 -0
- package/dist/lib/object-utils.d.ts +4 -0
- package/dist/lib/object-utils.js +9 -0
- package/dist/lib/package/common.d.ts +15 -0
- package/dist/lib/package/common.js +1 -0
- package/dist/lib/package/github.d.ts +4 -0
- package/dist/lib/package/github.js +32 -0
- package/dist/lib/package/index.d.ts +30 -0
- package/dist/lib/package/index.js +45 -0
- package/dist/lib/parameter/index.d.ts +34 -0
- package/dist/lib/parameter/index.js +47 -0
- package/dist/lib/shell.d.ts +9 -0
- package/dist/lib/shell.js +16 -0
- package/dist/lib/yaml-utils.d.ts +5 -0
- package/dist/lib/yaml-utils.js +27 -0
- package/oclif.manifest.json +610 -0
- package/package.json +86 -0
package/README.md
ADDED
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
hereya-cli
|
|
2
|
+
=================
|
|
3
|
+
|
|
4
|
+
Developer's Package Manager for Seamless Infrastructure Integration.
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
[](https://oclif.io)
|
|
8
|
+
[](https://npmjs.org/package/hereya-cli)
|
|
9
|
+
[](https://npmjs.org/package/hereya-cli)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
<!-- toc -->
|
|
13
|
+
* [Usage](#usage)
|
|
14
|
+
* [Commands](#commands)
|
|
15
|
+
<!-- tocstop -->
|
|
16
|
+
# Usage
|
|
17
|
+
<!-- usage -->
|
|
18
|
+
```sh-session
|
|
19
|
+
$ npm install -g hereya-cli
|
|
20
|
+
$ hereya COMMAND
|
|
21
|
+
running command...
|
|
22
|
+
$ hereya (--version)
|
|
23
|
+
hereya-cli/0.2.1 linux-x64 node-v20.13.1
|
|
24
|
+
$ hereya --help [COMMAND]
|
|
25
|
+
USAGE
|
|
26
|
+
$ hereya COMMAND
|
|
27
|
+
...
|
|
28
|
+
```
|
|
29
|
+
<!-- usagestop -->
|
|
30
|
+
# Commands
|
|
31
|
+
<!-- commands -->
|
|
32
|
+
* [`hereya add PACKAGE`](#hereya-add-package)
|
|
33
|
+
* [`hereya bootstrap INFRASTRUCTURETYPE`](#hereya-bootstrap-infrastructuretype)
|
|
34
|
+
* [`hereya down`](#hereya-down)
|
|
35
|
+
* [`hereya env`](#hereya-env)
|
|
36
|
+
* [`hereya help [COMMAND]`](#hereya-help-command)
|
|
37
|
+
* [`hereya init PROJECT`](#hereya-init-project)
|
|
38
|
+
* [`hereya remote exec [PKGPATH]`](#hereya-remote-exec-pkgpath)
|
|
39
|
+
* [`hereya remove PACKAGE`](#hereya-remove-package)
|
|
40
|
+
* [`hereya run CMD`](#hereya-run-cmd)
|
|
41
|
+
* [`hereya up`](#hereya-up)
|
|
42
|
+
* [`hereya workspace create NAME`](#hereya-workspace-create-name)
|
|
43
|
+
* [`hereya workspace delete NAME`](#hereya-workspace-delete-name)
|
|
44
|
+
* [`hereya workspace env`](#hereya-workspace-env)
|
|
45
|
+
* [`hereya workspace install PACKAGE`](#hereya-workspace-install-package)
|
|
46
|
+
* [`hereya workspace uninstall PACKAGE`](#hereya-workspace-uninstall-package)
|
|
47
|
+
|
|
48
|
+
## `hereya add PACKAGE`
|
|
49
|
+
|
|
50
|
+
Add a package to the project.
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
USAGE
|
|
54
|
+
$ hereya add PACKAGE [--chdir <value>] [-p <value>]
|
|
55
|
+
|
|
56
|
+
ARGUMENTS
|
|
57
|
+
PACKAGE The package to add. Packages are gitHub repositories. Use the format owner/repository
|
|
58
|
+
|
|
59
|
+
FLAGS
|
|
60
|
+
-p, --parameter=<value>... [default: ] parameter for the package, in the form of 'key=value'. Can be specified
|
|
61
|
+
multiple times.
|
|
62
|
+
--chdir=<value> directory to run command in
|
|
63
|
+
|
|
64
|
+
DESCRIPTION
|
|
65
|
+
Add a package to the project.
|
|
66
|
+
|
|
67
|
+
EXAMPLES
|
|
68
|
+
$ hereya add cloudy/docker_postgres
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
_See code: [src/commands/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.2.1/src/commands/add/index.ts)_
|
|
72
|
+
|
|
73
|
+
## `hereya bootstrap INFRASTRUCTURETYPE`
|
|
74
|
+
|
|
75
|
+
Install necessary resources for hereya operations in an infrastructure.
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
USAGE
|
|
79
|
+
$ hereya bootstrap INFRASTRUCTURETYPE [-f]
|
|
80
|
+
|
|
81
|
+
ARGUMENTS
|
|
82
|
+
INFRASTRUCTURETYPE infrastructure to bootstrap. Options are local, aws, azure, gcp
|
|
83
|
+
|
|
84
|
+
FLAGS
|
|
85
|
+
-f, --force redeploy hereya resources if already deployed
|
|
86
|
+
|
|
87
|
+
DESCRIPTION
|
|
88
|
+
Install necessary resources for hereya operations in an infrastructure.
|
|
89
|
+
|
|
90
|
+
EXAMPLES
|
|
91
|
+
$ hereya bootstrap aws
|
|
92
|
+
|
|
93
|
+
$ hereya bootstrap local
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
_See code: [src/commands/bootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.2.1/src/commands/bootstrap/index.ts)_
|
|
97
|
+
|
|
98
|
+
## `hereya down`
|
|
99
|
+
|
|
100
|
+
Destroy all packages in the project.
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
USAGE
|
|
104
|
+
$ hereya down [--chdir <value>] [-w <value>]
|
|
105
|
+
|
|
106
|
+
FLAGS
|
|
107
|
+
-w, --workspace=<value> name of the workspace to install the packages for
|
|
108
|
+
--chdir=<value> directory to run command in
|
|
109
|
+
|
|
110
|
+
DESCRIPTION
|
|
111
|
+
Destroy all packages in the project.
|
|
112
|
+
|
|
113
|
+
EXAMPLES
|
|
114
|
+
$ hereya down
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
_See code: [src/commands/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.2.1/src/commands/down/index.ts)_
|
|
118
|
+
|
|
119
|
+
## `hereya env`
|
|
120
|
+
|
|
121
|
+
Print project environment variables.
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
USAGE
|
|
125
|
+
$ hereya env [--chdir <value>] [-w <value>]
|
|
126
|
+
|
|
127
|
+
FLAGS
|
|
128
|
+
-w, --workspace=<value> name of the workspace to print the env vars for
|
|
129
|
+
--chdir=<value> project root directory
|
|
130
|
+
|
|
131
|
+
DESCRIPTION
|
|
132
|
+
Print project environment variables.
|
|
133
|
+
|
|
134
|
+
EXAMPLES
|
|
135
|
+
$ hereya env
|
|
136
|
+
|
|
137
|
+
$ hereya env -w dev
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
_See code: [src/commands/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.2.1/src/commands/env/index.ts)_
|
|
141
|
+
|
|
142
|
+
## `hereya help [COMMAND]`
|
|
143
|
+
|
|
144
|
+
Display help for hereya.
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
USAGE
|
|
148
|
+
$ hereya help [COMMAND...] [-n]
|
|
149
|
+
|
|
150
|
+
ARGUMENTS
|
|
151
|
+
COMMAND... Command to show help for.
|
|
152
|
+
|
|
153
|
+
FLAGS
|
|
154
|
+
-n, --nested-commands Include all nested commands in the output.
|
|
155
|
+
|
|
156
|
+
DESCRIPTION
|
|
157
|
+
Display help for hereya.
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.0.22/src/commands/help.ts)_
|
|
161
|
+
|
|
162
|
+
## `hereya init PROJECT`
|
|
163
|
+
|
|
164
|
+
Initialize hereya in a project directory.
|
|
165
|
+
|
|
166
|
+
```
|
|
167
|
+
USAGE
|
|
168
|
+
$ hereya init PROJECT -w <value> [--chdir <value>]
|
|
169
|
+
|
|
170
|
+
ARGUMENTS
|
|
171
|
+
PROJECT project name
|
|
172
|
+
|
|
173
|
+
FLAGS
|
|
174
|
+
-w, --workspace=<value> (required) workspace to set as default
|
|
175
|
+
--chdir=<value> directory to run command in
|
|
176
|
+
|
|
177
|
+
DESCRIPTION
|
|
178
|
+
Initialize hereya in a project directory.
|
|
179
|
+
|
|
180
|
+
EXAMPLES
|
|
181
|
+
$ hereya init myProject -w=defaultWorkspace
|
|
182
|
+
|
|
183
|
+
$ hereya init myProject -w=defaultWorkspace --chdir=./myProject
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
_See code: [src/commands/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.2.1/src/commands/init/index.ts)_
|
|
187
|
+
|
|
188
|
+
## `hereya remote exec [PKGPATH]`
|
|
189
|
+
|
|
190
|
+
remotely provision or destroy a package
|
|
191
|
+
|
|
192
|
+
```
|
|
193
|
+
USAGE
|
|
194
|
+
$ hereya remote exec [PKGPATH] [-o <value>]
|
|
195
|
+
|
|
196
|
+
ARGUMENTS
|
|
197
|
+
PKGPATH The path to the package to provision or destroy
|
|
198
|
+
|
|
199
|
+
FLAGS
|
|
200
|
+
-o, --output=<value> The path to store the output env in
|
|
201
|
+
|
|
202
|
+
DESCRIPTION
|
|
203
|
+
remotely provision or destroy a package
|
|
204
|
+
|
|
205
|
+
EXAMPLES
|
|
206
|
+
$ hereya remote exec
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
_See code: [src/commands/remote/exec/index.ts](https://github.com/hereya/hereya-cli/blob/v0.2.1/src/commands/remote/exec/index.ts)_
|
|
210
|
+
|
|
211
|
+
## `hereya remove PACKAGE`
|
|
212
|
+
|
|
213
|
+
Remove a package from the project.
|
|
214
|
+
|
|
215
|
+
```
|
|
216
|
+
USAGE
|
|
217
|
+
$ hereya remove PACKAGE [--chdir <value>]
|
|
218
|
+
|
|
219
|
+
ARGUMENTS
|
|
220
|
+
PACKAGE The package to remove. Packages are gitHub repositories. Use the format owner/repository
|
|
221
|
+
|
|
222
|
+
FLAGS
|
|
223
|
+
--chdir=<value> directory to run command in
|
|
224
|
+
|
|
225
|
+
DESCRIPTION
|
|
226
|
+
Remove a package from the project.
|
|
227
|
+
|
|
228
|
+
EXAMPLES
|
|
229
|
+
$ hereya remove cloudy/docker_postgres
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
_See code: [src/commands/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.2.1/src/commands/remove/index.ts)_
|
|
233
|
+
|
|
234
|
+
## `hereya run CMD`
|
|
235
|
+
|
|
236
|
+
Run a command with hereya env vars.
|
|
237
|
+
|
|
238
|
+
```
|
|
239
|
+
USAGE
|
|
240
|
+
$ hereya run CMD... [--chdir <value>] [-w <value>]
|
|
241
|
+
|
|
242
|
+
ARGUMENTS
|
|
243
|
+
CMD... command to run
|
|
244
|
+
|
|
245
|
+
FLAGS
|
|
246
|
+
-w, --workspace=<value> name of the workspace to run the command in
|
|
247
|
+
--chdir=<value> directory to run command in
|
|
248
|
+
|
|
249
|
+
DESCRIPTION
|
|
250
|
+
Run a command with hereya env vars.
|
|
251
|
+
|
|
252
|
+
EXAMPLES
|
|
253
|
+
$ hereya run -- npm run dev
|
|
254
|
+
|
|
255
|
+
$ hereya run -w uat -- node index.js
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
_See code: [src/commands/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.2.1/src/commands/run/index.ts)_
|
|
259
|
+
|
|
260
|
+
## `hereya up`
|
|
261
|
+
|
|
262
|
+
Provision all packages in the project.
|
|
263
|
+
|
|
264
|
+
```
|
|
265
|
+
USAGE
|
|
266
|
+
$ hereya up [--chdir <value>] [-w <value>]
|
|
267
|
+
|
|
268
|
+
FLAGS
|
|
269
|
+
-w, --workspace=<value> name of the workspace to install the packages for
|
|
270
|
+
--chdir=<value> directory to run command in
|
|
271
|
+
|
|
272
|
+
DESCRIPTION
|
|
273
|
+
Provision all packages in the project.
|
|
274
|
+
|
|
275
|
+
EXAMPLES
|
|
276
|
+
$ hereya up
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
_See code: [src/commands/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.2.1/src/commands/up/index.ts)_
|
|
280
|
+
|
|
281
|
+
## `hereya workspace create NAME`
|
|
282
|
+
|
|
283
|
+
Create a new workspace if it does not exist.
|
|
284
|
+
|
|
285
|
+
```
|
|
286
|
+
USAGE
|
|
287
|
+
$ hereya workspace create NAME
|
|
288
|
+
|
|
289
|
+
ARGUMENTS
|
|
290
|
+
NAME name of the workspace to create
|
|
291
|
+
|
|
292
|
+
DESCRIPTION
|
|
293
|
+
Create a new workspace if it does not exist.
|
|
294
|
+
|
|
295
|
+
EXAMPLES
|
|
296
|
+
$ hereya workspace create dev
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
_See code: [src/commands/workspace/create/index.ts](https://github.com/hereya/hereya-cli/blob/v0.2.1/src/commands/workspace/create/index.ts)_
|
|
300
|
+
|
|
301
|
+
## `hereya workspace delete NAME`
|
|
302
|
+
|
|
303
|
+
Delete a workspace if it exists.
|
|
304
|
+
|
|
305
|
+
```
|
|
306
|
+
USAGE
|
|
307
|
+
$ hereya workspace delete NAME
|
|
308
|
+
|
|
309
|
+
ARGUMENTS
|
|
310
|
+
NAME name of the workspace to delete
|
|
311
|
+
|
|
312
|
+
DESCRIPTION
|
|
313
|
+
Delete a workspace if it exists.
|
|
314
|
+
|
|
315
|
+
EXAMPLES
|
|
316
|
+
$ hereya workspace delete dev
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
_See code: [src/commands/workspace/delete/index.ts](https://github.com/hereya/hereya-cli/blob/v0.2.1/src/commands/workspace/delete/index.ts)_
|
|
320
|
+
|
|
321
|
+
## `hereya workspace env`
|
|
322
|
+
|
|
323
|
+
Print workspace env vars.
|
|
324
|
+
|
|
325
|
+
```
|
|
326
|
+
USAGE
|
|
327
|
+
$ hereya workspace env -w <value>
|
|
328
|
+
|
|
329
|
+
FLAGS
|
|
330
|
+
-w, --workspace=<value> (required) name of the workspace to print env vars for
|
|
331
|
+
|
|
332
|
+
DESCRIPTION
|
|
333
|
+
Print workspace env vars.
|
|
334
|
+
|
|
335
|
+
EXAMPLES
|
|
336
|
+
$ hereya workspace env -w dev
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
_See code: [src/commands/workspace/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.2.1/src/commands/workspace/env/index.ts)_
|
|
340
|
+
|
|
341
|
+
## `hereya workspace install PACKAGE`
|
|
342
|
+
|
|
343
|
+
Add a package to the workspace.
|
|
344
|
+
|
|
345
|
+
```
|
|
346
|
+
USAGE
|
|
347
|
+
$ hereya workspace install PACKAGE -w <value> [-p <value>] [-f <value>]
|
|
348
|
+
|
|
349
|
+
ARGUMENTS
|
|
350
|
+
PACKAGE The package to add. Packages are gitHub repositories. Use the format owner/repository
|
|
351
|
+
|
|
352
|
+
FLAGS
|
|
353
|
+
-f, --parameter-file=<value> path to a file containing parameters for the package
|
|
354
|
+
-p, --parameter=<value>... [default: ] parameter for the package, in the form of 'key=value'. Can be specified
|
|
355
|
+
multiple times.
|
|
356
|
+
-w, --workspace=<value> (required) name of the workspace to add the package to
|
|
357
|
+
|
|
358
|
+
DESCRIPTION
|
|
359
|
+
Add a package to the workspace.
|
|
360
|
+
|
|
361
|
+
EXAMPLES
|
|
362
|
+
$ hereya workspace install hereya/aws-cognito
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
_See code: [src/commands/workspace/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.2.1/src/commands/workspace/install/index.ts)_
|
|
366
|
+
|
|
367
|
+
## `hereya workspace uninstall PACKAGE`
|
|
368
|
+
|
|
369
|
+
Remove a package from a workspace.
|
|
370
|
+
|
|
371
|
+
```
|
|
372
|
+
USAGE
|
|
373
|
+
$ hereya workspace uninstall PACKAGE -w <value> [-p <value>] [-f <value>]
|
|
374
|
+
|
|
375
|
+
ARGUMENTS
|
|
376
|
+
PACKAGE The package to remove. Packages are gitHub repositories. Use the format owner/repository
|
|
377
|
+
|
|
378
|
+
FLAGS
|
|
379
|
+
-f, --parameter-file=<value> path to a file containing parameters for the package
|
|
380
|
+
-p, --parameter=<value>... [default: ] parameter for the package, in the form of 'key=value'. Can be specified
|
|
381
|
+
multiple times.
|
|
382
|
+
-w, --workspace=<value> (required) name of the workspace to remove the package from
|
|
383
|
+
|
|
384
|
+
DESCRIPTION
|
|
385
|
+
Remove a package from a workspace.
|
|
386
|
+
|
|
387
|
+
EXAMPLES
|
|
388
|
+
$ hereya workspace uninstall hereya/aws-cognito
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
_See code: [src/commands/workspace/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.2.1/src/commands/workspace/uninstall/index.ts)_
|
|
392
|
+
<!-- commandsstop -->
|
package/bin/dev.cmd
ADDED
package/bin/dev.js
ADDED
package/bin/run.cmd
ADDED
package/bin/run.js
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { InfrastructureType } from '../infrastructure/common.js';
|
|
2
|
+
import { Config } from '../lib/config/common.js';
|
|
3
|
+
export interface Backend {
|
|
4
|
+
addPackageToWorkspace(input: AddPackageToWorkspaceInput): Promise<AddPackageToWorkspaceOutput>;
|
|
5
|
+
createWorkspace(input: CreateWorkspaceInput): Promise<CreateWorkspaceOutput>;
|
|
6
|
+
deleteWorkspace(input: DeleteWorkspaceInput): Promise<DeleteWorkspaceOutput>;
|
|
7
|
+
getState(input: GetStateInput): Promise<GetStateOutput>;
|
|
8
|
+
getWorkspace(workspace: string): Promise<GetWorkspaceOutput>;
|
|
9
|
+
getWorkspaceEnv(input: GetWorkspaceEnvInput): Promise<GetWorkspaceEnvOutput>;
|
|
10
|
+
init(options: InitProjectInput): Promise<InitProjectOutput>;
|
|
11
|
+
removePackageFromWorkspace(input: RemovePackageFromWorkspaceInput): Promise<RemovePackageFromWorkspaceOutput>;
|
|
12
|
+
saveState(config: Omit<Config, 'workspace'>): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
export type AddPackageToWorkspaceInput = {
|
|
15
|
+
env: {
|
|
16
|
+
[key: string]: string;
|
|
17
|
+
};
|
|
18
|
+
infra: InfrastructureType;
|
|
19
|
+
package: string;
|
|
20
|
+
parameters?: {
|
|
21
|
+
[key: string]: string;
|
|
22
|
+
};
|
|
23
|
+
workspace: string;
|
|
24
|
+
};
|
|
25
|
+
export type AddPackageToWorkspaceOutput = {
|
|
26
|
+
reason: string;
|
|
27
|
+
success: false;
|
|
28
|
+
} | {
|
|
29
|
+
success: true;
|
|
30
|
+
workspace: {
|
|
31
|
+
id: string;
|
|
32
|
+
name: string;
|
|
33
|
+
packages?: {
|
|
34
|
+
[key: string]: {
|
|
35
|
+
version: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export type RemovePackageFromWorkspaceInput = AddPackageToWorkspaceInput;
|
|
41
|
+
export type RemovePackageFromWorkspaceOutput = AddPackageToWorkspaceOutput;
|
|
42
|
+
export interface InitProjectInput {
|
|
43
|
+
project: string;
|
|
44
|
+
workspace: string;
|
|
45
|
+
}
|
|
46
|
+
export interface InitProjectOutput {
|
|
47
|
+
project: {
|
|
48
|
+
id: string;
|
|
49
|
+
name: string;
|
|
50
|
+
};
|
|
51
|
+
workspace: {
|
|
52
|
+
id: string;
|
|
53
|
+
name: string;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
export interface CreateWorkspaceInput {
|
|
57
|
+
name: string;
|
|
58
|
+
}
|
|
59
|
+
export type CreateWorkspaceOutput = {
|
|
60
|
+
isNew: boolean;
|
|
61
|
+
success: true;
|
|
62
|
+
workspace: {
|
|
63
|
+
id: string;
|
|
64
|
+
name: string;
|
|
65
|
+
};
|
|
66
|
+
} | {
|
|
67
|
+
reason: string;
|
|
68
|
+
success: false;
|
|
69
|
+
};
|
|
70
|
+
export type GetWorkspaceEnvInput = {
|
|
71
|
+
project?: string;
|
|
72
|
+
workspace: string;
|
|
73
|
+
};
|
|
74
|
+
export type GetWorkspaceEnvOutput = {
|
|
75
|
+
env: {
|
|
76
|
+
[key: string]: string;
|
|
77
|
+
};
|
|
78
|
+
success: true;
|
|
79
|
+
} | {
|
|
80
|
+
reason: string;
|
|
81
|
+
success: false;
|
|
82
|
+
};
|
|
83
|
+
export type GetWorkspaceOutput = ({
|
|
84
|
+
found: true;
|
|
85
|
+
hasError: false;
|
|
86
|
+
workspace: {
|
|
87
|
+
env?: {
|
|
88
|
+
[key: string]: string;
|
|
89
|
+
};
|
|
90
|
+
id: string;
|
|
91
|
+
name: string;
|
|
92
|
+
packages?: {
|
|
93
|
+
[key: string]: {
|
|
94
|
+
parameters?: {
|
|
95
|
+
[key: string]: string;
|
|
96
|
+
};
|
|
97
|
+
version: string;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
} | {
|
|
102
|
+
error: string;
|
|
103
|
+
found: true;
|
|
104
|
+
hasError: true;
|
|
105
|
+
}) | {
|
|
106
|
+
found: false;
|
|
107
|
+
};
|
|
108
|
+
export type GetStateInput = {
|
|
109
|
+
project: string;
|
|
110
|
+
};
|
|
111
|
+
export type GetStateOutput = {
|
|
112
|
+
config: Omit<Config, 'workspace'>;
|
|
113
|
+
found: true;
|
|
114
|
+
} | {
|
|
115
|
+
found: false;
|
|
116
|
+
};
|
|
117
|
+
export type DeleteWorkspaceInput = {
|
|
118
|
+
name: string;
|
|
119
|
+
};
|
|
120
|
+
export type DeleteWorkspaceOutput = {
|
|
121
|
+
message?: string;
|
|
122
|
+
success: true;
|
|
123
|
+
} | {
|
|
124
|
+
reason: string;
|
|
125
|
+
success: false;
|
|
126
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Config } from '../lib/config/common.js';
|
|
2
|
+
import { AddPackageToWorkspaceInput, AddPackageToWorkspaceOutput, Backend, CreateWorkspaceInput, CreateWorkspaceOutput, DeleteWorkspaceInput, DeleteWorkspaceOutput, GetStateInput, GetStateOutput, GetWorkspaceEnvInput, GetWorkspaceEnvOutput, GetWorkspaceOutput, InitProjectInput, InitProjectOutput, RemovePackageFromWorkspaceInput, RemovePackageFromWorkspaceOutput } from './common.js';
|
|
3
|
+
export declare class LocalBackend implements Backend {
|
|
4
|
+
addPackageToWorkspace(input: AddPackageToWorkspaceInput): Promise<AddPackageToWorkspaceOutput>;
|
|
5
|
+
createWorkspace(input: CreateWorkspaceInput): Promise<CreateWorkspaceOutput>;
|
|
6
|
+
deleteWorkspace(input: DeleteWorkspaceInput): Promise<DeleteWorkspaceOutput>;
|
|
7
|
+
getState(input: GetStateInput): Promise<GetStateOutput>;
|
|
8
|
+
getWorkspace(workspace: string): Promise<GetWorkspaceOutput>;
|
|
9
|
+
getWorkspaceEnv(input: GetWorkspaceEnvInput): Promise<GetWorkspaceEnvOutput>;
|
|
10
|
+
init(options: InitProjectInput): Promise<InitProjectOutput>;
|
|
11
|
+
removePackageFromWorkspace(input: RemovePackageFromWorkspaceInput): Promise<RemovePackageFromWorkspaceOutput>;
|
|
12
|
+
saveState(config: Omit<Config, 'workspace'>): Promise<void>;
|
|
13
|
+
private getProjectStatePath;
|
|
14
|
+
private getWorkspacePath;
|
|
15
|
+
private saveWorkspace;
|
|
16
|
+
}
|