hereya-cli 0.54.1 → 0.56.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 +94 -36
- package/dist/backend/cloud/cloud-backend.d.ts +5 -1
- package/dist/backend/cloud/cloud-backend.js +214 -0
- package/dist/backend/common.d.ts +62 -0
- package/dist/backend/file.d.ts +5 -1
- package/dist/backend/file.js +24 -0
- package/dist/commands/doc/index.d.ts +17 -0
- package/dist/commands/doc/index.js +154 -0
- package/dist/commands/publish/index.d.ts +32 -0
- package/dist/commands/publish/index.js +239 -0
- package/oclif.manifest.json +92 -1
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ $ npm install -g hereya-cli
|
|
|
20
20
|
$ hereya COMMAND
|
|
21
21
|
running command...
|
|
22
22
|
$ hereya (--version)
|
|
23
|
-
hereya-cli/0.
|
|
23
|
+
hereya-cli/0.56.0 linux-x64 node-v22.18.0
|
|
24
24
|
$ hereya --help [COMMAND]
|
|
25
25
|
USAGE
|
|
26
26
|
$ hereya COMMAND
|
|
@@ -37,6 +37,7 @@ USAGE
|
|
|
37
37
|
* [`hereya config use-backend TYPE`](#hereya-config-use-backend-type)
|
|
38
38
|
* [`hereya delete-state`](#hereya-delete-state)
|
|
39
39
|
* [`hereya deploy`](#hereya-deploy)
|
|
40
|
+
* [`hereya doc PACKAGE`](#hereya-doc-package)
|
|
40
41
|
* [`hereya down`](#hereya-down)
|
|
41
42
|
* [`hereya env [NAME]`](#hereya-env-name)
|
|
42
43
|
* [`hereya env set [NAME]`](#hereya-env-set-name)
|
|
@@ -51,6 +52,7 @@ USAGE
|
|
|
51
52
|
* [`hereya init PROJECT`](#hereya-init-project)
|
|
52
53
|
* [`hereya login [URL]`](#hereya-login-url)
|
|
53
54
|
* [`hereya logout`](#hereya-logout)
|
|
55
|
+
* [`hereya publish`](#hereya-publish)
|
|
54
56
|
* [`hereya remove PACKAGE`](#hereya-remove-package)
|
|
55
57
|
* [`hereya run CMD`](#hereya-run-cmd)
|
|
56
58
|
* [`hereya unbootstrap INFRASTRUCTURETYPE`](#hereya-unbootstrap-infrastructuretype)
|
|
@@ -98,7 +100,7 @@ EXAMPLES
|
|
|
98
100
|
$ hereya add cloudy/docker_postgres
|
|
99
101
|
```
|
|
100
102
|
|
|
101
|
-
_See code: [src/commands/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
103
|
+
_See code: [src/commands/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/add/index.ts)_
|
|
102
104
|
|
|
103
105
|
## `hereya bootstrap INFRASTRUCTURETYPE`
|
|
104
106
|
|
|
@@ -123,7 +125,7 @@ EXAMPLES
|
|
|
123
125
|
$ hereya bootstrap local
|
|
124
126
|
```
|
|
125
127
|
|
|
126
|
-
_See code: [src/commands/bootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
128
|
+
_See code: [src/commands/bootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/bootstrap/index.ts)_
|
|
127
129
|
|
|
128
130
|
## `hereya config export-backend [FILE]`
|
|
129
131
|
|
|
@@ -145,7 +147,7 @@ EXAMPLES
|
|
|
145
147
|
$ hereya config export-backend ./path/to/export.json
|
|
146
148
|
```
|
|
147
149
|
|
|
148
|
-
_See code: [src/commands/config/export-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
150
|
+
_See code: [src/commands/config/export-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/config/export-backend/index.ts)_
|
|
149
151
|
|
|
150
152
|
## `hereya config get-backend`
|
|
151
153
|
|
|
@@ -162,7 +164,7 @@ EXAMPLES
|
|
|
162
164
|
$ hereya config get-backend
|
|
163
165
|
```
|
|
164
166
|
|
|
165
|
-
_See code: [src/commands/config/get-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
167
|
+
_See code: [src/commands/config/get-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/config/get-backend/index.ts)_
|
|
166
168
|
|
|
167
169
|
## `hereya config import-backend FILE`
|
|
168
170
|
|
|
@@ -182,7 +184,7 @@ EXAMPLES
|
|
|
182
184
|
$ hereya config import-backend ./path/to/cloud-backend.json
|
|
183
185
|
```
|
|
184
186
|
|
|
185
|
-
_See code: [src/commands/config/import-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
187
|
+
_See code: [src/commands/config/import-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/config/import-backend/index.ts)_
|
|
186
188
|
|
|
187
189
|
## `hereya config use-backend TYPE`
|
|
188
190
|
|
|
@@ -204,7 +206,7 @@ EXAMPLES
|
|
|
204
206
|
$ hereya config use-backend local
|
|
205
207
|
```
|
|
206
208
|
|
|
207
|
-
_See code: [src/commands/config/use-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
209
|
+
_See code: [src/commands/config/use-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/config/use-backend/index.ts)_
|
|
208
210
|
|
|
209
211
|
## `hereya delete-state`
|
|
210
212
|
|
|
@@ -230,7 +232,7 @@ EXAMPLES
|
|
|
230
232
|
$ hereya delete-state --workspace staging
|
|
231
233
|
```
|
|
232
234
|
|
|
233
|
-
_See code: [src/commands/delete-state/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
235
|
+
_See code: [src/commands/delete-state/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/delete-state/index.ts)_
|
|
234
236
|
|
|
235
237
|
## `hereya deploy`
|
|
236
238
|
|
|
@@ -255,7 +257,40 @@ EXAMPLES
|
|
|
255
257
|
$ hereya deploy
|
|
256
258
|
```
|
|
257
259
|
|
|
258
|
-
_See code: [src/commands/deploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
260
|
+
_See code: [src/commands/deploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/deploy/index.ts)_
|
|
261
|
+
|
|
262
|
+
## `hereya doc PACKAGE`
|
|
263
|
+
|
|
264
|
+
Display documentation for a package from the registry
|
|
265
|
+
|
|
266
|
+
```
|
|
267
|
+
USAGE
|
|
268
|
+
$ hereya doc PACKAGE [-C <value>] [-j] [--no-doc]
|
|
269
|
+
|
|
270
|
+
ARGUMENTS
|
|
271
|
+
PACKAGE Package name with optional version (e.g., my-package or my-package@1.0.0)
|
|
272
|
+
|
|
273
|
+
FLAGS
|
|
274
|
+
-j, --json Output in JSON format
|
|
275
|
+
--no-doc Show only metadata without the full documentation
|
|
276
|
+
|
|
277
|
+
GLOBAL FLAGS
|
|
278
|
+
-C, --chdir=<value> [default: .] directory to run command in
|
|
279
|
+
|
|
280
|
+
DESCRIPTION
|
|
281
|
+
Display documentation for a package from the registry
|
|
282
|
+
|
|
283
|
+
EXAMPLES
|
|
284
|
+
$ hereya doc my-package
|
|
285
|
+
|
|
286
|
+
$ hereya doc my-package@1.0.0
|
|
287
|
+
|
|
288
|
+
$ hereya doc my-package --json
|
|
289
|
+
|
|
290
|
+
$ hereya doc my-package --no-doc
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
_See code: [src/commands/doc/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/doc/index.ts)_
|
|
259
294
|
|
|
260
295
|
## `hereya down`
|
|
261
296
|
|
|
@@ -282,7 +317,7 @@ EXAMPLES
|
|
|
282
317
|
$ hereya down
|
|
283
318
|
```
|
|
284
319
|
|
|
285
|
-
_See code: [src/commands/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
320
|
+
_See code: [src/commands/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/down/index.ts)_
|
|
286
321
|
|
|
287
322
|
## `hereya env [NAME]`
|
|
288
323
|
|
|
@@ -313,7 +348,7 @@ EXAMPLES
|
|
|
313
348
|
$ hereya env -w dev -l
|
|
314
349
|
```
|
|
315
350
|
|
|
316
|
-
_See code: [src/commands/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
351
|
+
_See code: [src/commands/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/env/index.ts)_
|
|
317
352
|
|
|
318
353
|
## `hereya env set [NAME]`
|
|
319
354
|
|
|
@@ -340,7 +375,7 @@ EXAMPLES
|
|
|
340
375
|
$ hereya env set FOO -v bar -w dev
|
|
341
376
|
```
|
|
342
377
|
|
|
343
|
-
_See code: [src/commands/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
378
|
+
_See code: [src/commands/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/env/set/index.ts)_
|
|
344
379
|
|
|
345
380
|
## `hereya flow add PACKAGE`
|
|
346
381
|
|
|
@@ -378,7 +413,7 @@ EXAMPLES
|
|
|
378
413
|
$ hereya flow add cloudy/docker_postgres -p DB_NAME=mydb -p DB_USER=admin
|
|
379
414
|
```
|
|
380
415
|
|
|
381
|
-
_See code: [src/commands/flow/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
416
|
+
_See code: [src/commands/flow/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/flow/add/index.ts)_
|
|
382
417
|
|
|
383
418
|
## `hereya flow down`
|
|
384
419
|
|
|
@@ -412,7 +447,7 @@ EXAMPLES
|
|
|
412
447
|
$ hereya flow down --pin
|
|
413
448
|
```
|
|
414
449
|
|
|
415
|
-
_See code: [src/commands/flow/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
450
|
+
_See code: [src/commands/flow/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/flow/down/index.ts)_
|
|
416
451
|
|
|
417
452
|
## `hereya flow env [NAME]`
|
|
418
453
|
|
|
@@ -446,7 +481,7 @@ EXAMPLES
|
|
|
446
481
|
$ hereya flow env -l
|
|
447
482
|
```
|
|
448
483
|
|
|
449
|
-
_See code: [src/commands/flow/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
484
|
+
_See code: [src/commands/flow/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/flow/env/index.ts)_
|
|
450
485
|
|
|
451
486
|
## `hereya flow remove PACKAGE`
|
|
452
487
|
|
|
@@ -476,7 +511,7 @@ EXAMPLES
|
|
|
476
511
|
$ hereya flow remove cloudy/docker_postgres --profile staging
|
|
477
512
|
```
|
|
478
513
|
|
|
479
|
-
_See code: [src/commands/flow/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
514
|
+
_See code: [src/commands/flow/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/flow/remove/index.ts)_
|
|
480
515
|
|
|
481
516
|
## `hereya flow run CMD`
|
|
482
517
|
|
|
@@ -505,7 +540,7 @@ EXAMPLES
|
|
|
505
540
|
$ hereya flow run --pin -- npm test
|
|
506
541
|
```
|
|
507
542
|
|
|
508
|
-
_See code: [src/commands/flow/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
543
|
+
_See code: [src/commands/flow/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/flow/run/index.ts)_
|
|
509
544
|
|
|
510
545
|
## `hereya flow up`
|
|
511
546
|
|
|
@@ -539,7 +574,7 @@ EXAMPLES
|
|
|
539
574
|
$ hereya flow up --pin
|
|
540
575
|
```
|
|
541
576
|
|
|
542
|
-
_See code: [src/commands/flow/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
577
|
+
_See code: [src/commands/flow/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/flow/up/index.ts)_
|
|
543
578
|
|
|
544
579
|
## `hereya help [COMMAND]`
|
|
545
580
|
|
|
@@ -596,7 +631,7 @@ EXAMPLES
|
|
|
596
631
|
$ hereya import org/my-package -f state.tfstate -w my-workspace
|
|
597
632
|
```
|
|
598
633
|
|
|
599
|
-
_See code: [src/commands/import/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
634
|
+
_See code: [src/commands/import/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/import/index.ts)_
|
|
600
635
|
|
|
601
636
|
## `hereya init PROJECT`
|
|
602
637
|
|
|
@@ -622,7 +657,7 @@ EXAMPLES
|
|
|
622
657
|
$ hereya init myProject -w=defaultWorkspace --chdir=./myProject
|
|
623
658
|
```
|
|
624
659
|
|
|
625
|
-
_See code: [src/commands/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
660
|
+
_See code: [src/commands/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/init/index.ts)_
|
|
626
661
|
|
|
627
662
|
## `hereya login [URL]`
|
|
628
663
|
|
|
@@ -651,7 +686,7 @@ EXAMPLES
|
|
|
651
686
|
$ hereya login --token=your-token https://cloud.hereya.dev
|
|
652
687
|
```
|
|
653
688
|
|
|
654
|
-
_See code: [src/commands/login/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
689
|
+
_See code: [src/commands/login/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/login/index.ts)_
|
|
655
690
|
|
|
656
691
|
## `hereya logout`
|
|
657
692
|
|
|
@@ -668,7 +703,30 @@ EXAMPLES
|
|
|
668
703
|
$ hereya logout
|
|
669
704
|
```
|
|
670
705
|
|
|
671
|
-
_See code: [src/commands/logout/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
706
|
+
_See code: [src/commands/logout/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/logout/index.ts)_
|
|
707
|
+
|
|
708
|
+
## `hereya publish`
|
|
709
|
+
|
|
710
|
+
Publish a package to the Hereya registry
|
|
711
|
+
|
|
712
|
+
```
|
|
713
|
+
USAGE
|
|
714
|
+
$ hereya publish [--chdir <value>]
|
|
715
|
+
|
|
716
|
+
FLAGS
|
|
717
|
+
--chdir=<value> Directory where the command will be executed.
|
|
718
|
+
If not specified, it defaults to the current working directory.
|
|
719
|
+
|
|
720
|
+
DESCRIPTION
|
|
721
|
+
Publish a package to the Hereya registry
|
|
722
|
+
|
|
723
|
+
EXAMPLES
|
|
724
|
+
$ hereya publish
|
|
725
|
+
|
|
726
|
+
$ hereya publish --chdir=/path/to/package
|
|
727
|
+
```
|
|
728
|
+
|
|
729
|
+
_See code: [src/commands/publish/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/publish/index.ts)_
|
|
672
730
|
|
|
673
731
|
## `hereya remove PACKAGE`
|
|
674
732
|
|
|
@@ -696,7 +754,7 @@ EXAMPLES
|
|
|
696
754
|
$ hereya remove cloudy/docker_postgres
|
|
697
755
|
```
|
|
698
756
|
|
|
699
|
-
_See code: [src/commands/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
757
|
+
_See code: [src/commands/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/remove/index.ts)_
|
|
700
758
|
|
|
701
759
|
## `hereya run CMD`
|
|
702
760
|
|
|
@@ -722,7 +780,7 @@ EXAMPLES
|
|
|
722
780
|
$ hereya run -w uat -- node index.js
|
|
723
781
|
```
|
|
724
782
|
|
|
725
|
-
_See code: [src/commands/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
783
|
+
_See code: [src/commands/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/run/index.ts)_
|
|
726
784
|
|
|
727
785
|
## `hereya unbootstrap INFRASTRUCTURETYPE`
|
|
728
786
|
|
|
@@ -747,7 +805,7 @@ EXAMPLES
|
|
|
747
805
|
$ hereya unbootstrap local
|
|
748
806
|
```
|
|
749
807
|
|
|
750
|
-
_See code: [src/commands/unbootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
808
|
+
_See code: [src/commands/unbootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/unbootstrap/index.ts)_
|
|
751
809
|
|
|
752
810
|
## `hereya undeploy`
|
|
753
811
|
|
|
@@ -772,7 +830,7 @@ EXAMPLES
|
|
|
772
830
|
$ hereya undeploy
|
|
773
831
|
```
|
|
774
832
|
|
|
775
|
-
_See code: [src/commands/undeploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
833
|
+
_See code: [src/commands/undeploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/undeploy/index.ts)_
|
|
776
834
|
|
|
777
835
|
## `hereya up`
|
|
778
836
|
|
|
@@ -799,7 +857,7 @@ EXAMPLES
|
|
|
799
857
|
$ hereya up
|
|
800
858
|
```
|
|
801
859
|
|
|
802
|
-
_See code: [src/commands/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
860
|
+
_See code: [src/commands/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/up/index.ts)_
|
|
803
861
|
|
|
804
862
|
## `hereya workspace create NAME`
|
|
805
863
|
|
|
@@ -824,7 +882,7 @@ EXAMPLES
|
|
|
824
882
|
$ hereya workspace create dev
|
|
825
883
|
```
|
|
826
884
|
|
|
827
|
-
_See code: [src/commands/workspace/create/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
885
|
+
_See code: [src/commands/workspace/create/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/workspace/create/index.ts)_
|
|
828
886
|
|
|
829
887
|
## `hereya workspace delete NAME`
|
|
830
888
|
|
|
@@ -844,7 +902,7 @@ EXAMPLES
|
|
|
844
902
|
$ hereya workspace delete dev
|
|
845
903
|
```
|
|
846
904
|
|
|
847
|
-
_See code: [src/commands/workspace/delete/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
905
|
+
_See code: [src/commands/workspace/delete/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/workspace/delete/index.ts)_
|
|
848
906
|
|
|
849
907
|
## `hereya workspace env [NAME]`
|
|
850
908
|
|
|
@@ -870,7 +928,7 @@ EXAMPLES
|
|
|
870
928
|
$ hereya workspace env myEnv -w dev
|
|
871
929
|
```
|
|
872
930
|
|
|
873
|
-
_See code: [src/commands/workspace/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
931
|
+
_See code: [src/commands/workspace/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/workspace/env/index.ts)_
|
|
874
932
|
|
|
875
933
|
## `hereya workspace env set`
|
|
876
934
|
|
|
@@ -894,7 +952,7 @@ EXAMPLES
|
|
|
894
952
|
$ hereya workspace env set -w my-workspace -n myVar -v my-value -i aws -s
|
|
895
953
|
```
|
|
896
954
|
|
|
897
|
-
_See code: [src/commands/workspace/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
955
|
+
_See code: [src/commands/workspace/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/workspace/env/set/index.ts)_
|
|
898
956
|
|
|
899
957
|
## `hereya workspace env unset`
|
|
900
958
|
|
|
@@ -915,7 +973,7 @@ EXAMPLES
|
|
|
915
973
|
$ hereya workspace env unset -w my-workspace -n myVar
|
|
916
974
|
```
|
|
917
975
|
|
|
918
|
-
_See code: [src/commands/workspace/env/unset/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
976
|
+
_See code: [src/commands/workspace/env/unset/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/workspace/env/unset/index.ts)_
|
|
919
977
|
|
|
920
978
|
## `hereya workspace install PACKAGE`
|
|
921
979
|
|
|
@@ -942,7 +1000,7 @@ EXAMPLES
|
|
|
942
1000
|
$ hereya workspace install hereya/aws-cognito
|
|
943
1001
|
```
|
|
944
1002
|
|
|
945
|
-
_See code: [src/commands/workspace/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1003
|
+
_See code: [src/commands/workspace/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/workspace/install/index.ts)_
|
|
946
1004
|
|
|
947
1005
|
## `hereya workspace list`
|
|
948
1006
|
|
|
@@ -959,7 +1017,7 @@ EXAMPLES
|
|
|
959
1017
|
$ hereya workspace list
|
|
960
1018
|
```
|
|
961
1019
|
|
|
962
|
-
_See code: [src/commands/workspace/list/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1020
|
+
_See code: [src/commands/workspace/list/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/workspace/list/index.ts)_
|
|
963
1021
|
|
|
964
1022
|
## `hereya workspace set-profile PROFILE`
|
|
965
1023
|
|
|
@@ -983,7 +1041,7 @@ EXAMPLES
|
|
|
983
1041
|
$ hereya workspace set-profile prod-profile -w production
|
|
984
1042
|
```
|
|
985
1043
|
|
|
986
|
-
_See code: [src/commands/workspace/set-profile/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1044
|
+
_See code: [src/commands/workspace/set-profile/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/workspace/set-profile/index.ts)_
|
|
987
1045
|
|
|
988
1046
|
## `hereya workspace uninstall PACKAGE`
|
|
989
1047
|
|
|
@@ -1010,5 +1068,5 @@ EXAMPLES
|
|
|
1010
1068
|
$ hereya workspace uninstall hereya/aws-cognito
|
|
1011
1069
|
```
|
|
1012
1070
|
|
|
1013
|
-
_See code: [src/commands/workspace/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1071
|
+
_See code: [src/commands/workspace/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.56.0/src/commands/workspace/uninstall/index.ts)_
|
|
1014
1072
|
<!-- commandsstop -->
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Config } from '../../lib/config/common.js';
|
|
2
|
-
import { AddPackageToWorkspaceInput, AddPackageToWorkspaceOutput, Backend, CreateWorkspaceInput, CreateWorkspaceOutput, DeleteStateInput, DeleteStateOutput, DeleteWorkspaceInput, DeleteWorkspaceOutput, ExportBackendOutput, GetProvisioningIdInput, GetProvisioningIdOutput, GetStateInput, GetStateOutput, GetWorkspaceEnvInput, GetWorkspaceEnvOutput, GetWorkspaceOutput, ImportBackendInput, ImportBackendOutput, InitProjectInput, InitProjectOutput, RemovePackageFromWorkspaceInput, RemovePackageFromWorkspaceOutput, SetEnvVarInput, SetEnvVarOutput, UnsetEnvVarInput, UnsetEnvVarOutput, UpdateWorkspaceInput, UpdateWorkspaceOutput } from '../common.js';
|
|
2
|
+
import { AddPackageToWorkspaceInput, AddPackageToWorkspaceOutput, Backend, CreateWorkspaceInput, CreateWorkspaceOutput, DeleteStateInput, DeleteStateOutput, DeleteWorkspaceInput, DeleteWorkspaceOutput, ExportBackendOutput, GetPackageOutput, GetProvisioningIdInput, GetProvisioningIdOutput, GetStateInput, GetStateOutput, GetWorkspaceEnvInput, GetWorkspaceEnvOutput, GetWorkspaceOutput, ImportBackendInput, ImportBackendOutput, InitProjectInput, InitProjectOutput, ListPackageVersionsOutput, PublishPackageInput, PublishPackageOutput, RemovePackageFromWorkspaceInput, RemovePackageFromWorkspaceOutput, SetEnvVarInput, SetEnvVarOutput, UnsetEnvVarInput, UnsetEnvVarOutput, UpdateWorkspaceInput, UpdateWorkspaceOutput } from '../common.js';
|
|
3
3
|
interface CloudBackendConfig {
|
|
4
4
|
accessToken: string;
|
|
5
5
|
clientId: string;
|
|
@@ -14,13 +14,17 @@ export declare class CloudBackend implements Backend {
|
|
|
14
14
|
deleteState(input: DeleteStateInput): Promise<DeleteStateOutput>;
|
|
15
15
|
deleteWorkspace(input: DeleteWorkspaceInput): Promise<DeleteWorkspaceOutput>;
|
|
16
16
|
exportBackend(): Promise<ExportBackendOutput>;
|
|
17
|
+
getPackageByVersion(name: string, version: string): Promise<GetPackageOutput>;
|
|
18
|
+
getPackageLatest(name: string): Promise<GetPackageOutput>;
|
|
17
19
|
getProvisioningId(input: GetProvisioningIdInput): Promise<GetProvisioningIdOutput>;
|
|
18
20
|
getState(input: GetStateInput): Promise<GetStateOutput>;
|
|
19
21
|
getWorkspace(name: string): Promise<GetWorkspaceOutput>;
|
|
20
22
|
getWorkspaceEnv(input: GetWorkspaceEnvInput): Promise<GetWorkspaceEnvOutput>;
|
|
21
23
|
importBackend(input: ImportBackendInput): Promise<ImportBackendOutput>;
|
|
22
24
|
init(input: InitProjectInput): Promise<InitProjectOutput>;
|
|
25
|
+
listPackageVersions(name: string): Promise<ListPackageVersionsOutput>;
|
|
23
26
|
listWorkspaces(): Promise<string[]>;
|
|
27
|
+
publishPackage(input: PublishPackageInput): Promise<PublishPackageOutput>;
|
|
24
28
|
removePackageFromWorkspace(input: RemovePackageFromWorkspaceInput): Promise<RemovePackageFromWorkspaceOutput>;
|
|
25
29
|
saveState(config: Config, workspace?: string): Promise<void>;
|
|
26
30
|
setEnvVar(input: SetEnvVarInput): Promise<SetEnvVarOutput>;
|
|
@@ -123,6 +123,76 @@ export class CloudBackend {
|
|
|
123
123
|
success: true,
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
|
+
async getPackageByVersion(name, version) {
|
|
127
|
+
const response = await fetch(`${this.config.url}/api/registry/packages/${encodeURIComponent(name)}/${encodeURIComponent(version)}`, {
|
|
128
|
+
headers: {
|
|
129
|
+
'Authorization': `Bearer ${this.config.accessToken}`,
|
|
130
|
+
},
|
|
131
|
+
method: 'GET',
|
|
132
|
+
});
|
|
133
|
+
const result = await response.json();
|
|
134
|
+
if (!response.ok) {
|
|
135
|
+
// Handle error responses
|
|
136
|
+
let errorMessage = result.error || 'Failed to get package';
|
|
137
|
+
switch (response.status) {
|
|
138
|
+
case 401: {
|
|
139
|
+
errorMessage = 'Authentication failed. Please run `hereya login` to refresh your credentials.';
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
case 403: {
|
|
143
|
+
errorMessage = `Access denied: ${errorMessage}`;
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
case 404: {
|
|
147
|
+
errorMessage = `Package '${name}@${version}' not found`;
|
|
148
|
+
break;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return {
|
|
152
|
+
reason: errorMessage,
|
|
153
|
+
success: false,
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
return {
|
|
157
|
+
package: result.package,
|
|
158
|
+
success: true,
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
async getPackageLatest(name) {
|
|
162
|
+
const response = await fetch(`${this.config.url}/api/registry/packages/${encodeURIComponent(name)}`, {
|
|
163
|
+
headers: {
|
|
164
|
+
'Authorization': `Bearer ${this.config.accessToken}`,
|
|
165
|
+
},
|
|
166
|
+
method: 'GET',
|
|
167
|
+
});
|
|
168
|
+
const result = await response.json();
|
|
169
|
+
if (!response.ok) {
|
|
170
|
+
// Handle error responses
|
|
171
|
+
let errorMessage = result.error || 'Failed to get package';
|
|
172
|
+
switch (response.status) {
|
|
173
|
+
case 401: {
|
|
174
|
+
errorMessage = 'Authentication failed. Please run `hereya login` to refresh your credentials.';
|
|
175
|
+
break;
|
|
176
|
+
}
|
|
177
|
+
case 403: {
|
|
178
|
+
errorMessage = `Access denied: ${errorMessage}`;
|
|
179
|
+
break;
|
|
180
|
+
}
|
|
181
|
+
case 404: {
|
|
182
|
+
errorMessage = `Package '${name}' not found`;
|
|
183
|
+
break;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
return {
|
|
187
|
+
reason: errorMessage,
|
|
188
|
+
success: false,
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
return {
|
|
192
|
+
package: result.package,
|
|
193
|
+
success: true,
|
|
194
|
+
};
|
|
195
|
+
}
|
|
126
196
|
async getProvisioningId(input) {
|
|
127
197
|
const formData = new FormData();
|
|
128
198
|
formData.append('packageCanonicalName', input.packageCanonicalName);
|
|
@@ -198,6 +268,12 @@ export class CloudBackend {
|
|
|
198
268
|
},
|
|
199
269
|
method: 'GET',
|
|
200
270
|
});
|
|
271
|
+
// Handle 404 as "not found" rather than error
|
|
272
|
+
if (response.status === 404) {
|
|
273
|
+
return {
|
|
274
|
+
found: false,
|
|
275
|
+
};
|
|
276
|
+
}
|
|
201
277
|
if (!response.ok) {
|
|
202
278
|
const error = await response.json();
|
|
203
279
|
return {
|
|
@@ -280,6 +356,41 @@ export class CloudBackend {
|
|
|
280
356
|
},
|
|
281
357
|
};
|
|
282
358
|
}
|
|
359
|
+
async listPackageVersions(name) {
|
|
360
|
+
const response = await fetch(`${this.config.url}/api/registry/packages/${encodeURIComponent(name)}?versions=all`, {
|
|
361
|
+
headers: {
|
|
362
|
+
'Authorization': `Bearer ${this.config.accessToken}`,
|
|
363
|
+
},
|
|
364
|
+
method: 'GET',
|
|
365
|
+
});
|
|
366
|
+
const result = await response.json();
|
|
367
|
+
if (!response.ok) {
|
|
368
|
+
// Handle error responses
|
|
369
|
+
let errorMessage = result.error || 'Failed to list package versions';
|
|
370
|
+
switch (response.status) {
|
|
371
|
+
case 401: {
|
|
372
|
+
errorMessage = 'Authentication failed. Please run `hereya login` to refresh your credentials.';
|
|
373
|
+
break;
|
|
374
|
+
}
|
|
375
|
+
case 403: {
|
|
376
|
+
errorMessage = `Access denied: ${errorMessage}`;
|
|
377
|
+
break;
|
|
378
|
+
}
|
|
379
|
+
case 404: {
|
|
380
|
+
errorMessage = `Package '${name}' not found`;
|
|
381
|
+
break;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
return {
|
|
385
|
+
reason: errorMessage,
|
|
386
|
+
success: false,
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
return {
|
|
390
|
+
packages: result.packages || [],
|
|
391
|
+
success: true,
|
|
392
|
+
};
|
|
393
|
+
}
|
|
283
394
|
async listWorkspaces() {
|
|
284
395
|
const response = await fetch(`${this.config.url}/api/workspaces`, {
|
|
285
396
|
headers: {
|
|
@@ -293,6 +404,109 @@ export class CloudBackend {
|
|
|
293
404
|
const result = await response.json();
|
|
294
405
|
return result.workspaces.map((workspace) => workspace.name);
|
|
295
406
|
}
|
|
407
|
+
async publishPackage(input) {
|
|
408
|
+
const formData = new FormData();
|
|
409
|
+
formData.append('name', input.name);
|
|
410
|
+
formData.append('version', input.version);
|
|
411
|
+
formData.append('description', input.description);
|
|
412
|
+
formData.append('repository', input.repository);
|
|
413
|
+
formData.append('commit', input.commit);
|
|
414
|
+
formData.append('sha256', input.sha256);
|
|
415
|
+
formData.append('iac', input.iac);
|
|
416
|
+
formData.append('infra', input.infra);
|
|
417
|
+
if (input.doc) {
|
|
418
|
+
formData.append('doc', input.doc);
|
|
419
|
+
}
|
|
420
|
+
if (input.visibility) {
|
|
421
|
+
formData.append('visibility', input.visibility);
|
|
422
|
+
}
|
|
423
|
+
if (input.onDeployPkg) {
|
|
424
|
+
formData.append('onDeployPkg', input.onDeployPkg);
|
|
425
|
+
}
|
|
426
|
+
if (input.onDeployVersion) {
|
|
427
|
+
formData.append('onDeployVersion', input.onDeployVersion);
|
|
428
|
+
}
|
|
429
|
+
const response = await fetch(`${this.config.url}/api/registry/packages`, {
|
|
430
|
+
body: formData,
|
|
431
|
+
headers: {
|
|
432
|
+
'Authorization': `Bearer ${this.config.accessToken}`,
|
|
433
|
+
},
|
|
434
|
+
method: 'POST',
|
|
435
|
+
});
|
|
436
|
+
const result = await response.json();
|
|
437
|
+
if (!response.ok) {
|
|
438
|
+
// Handle validation errors (field-specific errors)
|
|
439
|
+
if (result.errors && typeof result.errors === 'object') {
|
|
440
|
+
const errorMessages = [];
|
|
441
|
+
// Add main error message if present
|
|
442
|
+
if (result.error) {
|
|
443
|
+
errorMessages.push(result.error, ''); // Empty line for separation
|
|
444
|
+
}
|
|
445
|
+
// Add field-specific errors
|
|
446
|
+
for (const [field, messages] of Object.entries(result.errors)) {
|
|
447
|
+
if (Array.isArray(messages)) {
|
|
448
|
+
errorMessages.push(`${field}: ${messages.join(', ')}`);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
// Add help message if present
|
|
452
|
+
if (result.help) {
|
|
453
|
+
errorMessages.push('', `ℹ️ ${result.help}`);
|
|
454
|
+
}
|
|
455
|
+
return {
|
|
456
|
+
reason: errorMessages.join('\n'),
|
|
457
|
+
success: false,
|
|
458
|
+
};
|
|
459
|
+
}
|
|
460
|
+
// Handle other errors with more context
|
|
461
|
+
const errorMessages = [];
|
|
462
|
+
const errorMessage = result.error || 'Unknown error occurred';
|
|
463
|
+
// Add main error with context based on errorType or status code
|
|
464
|
+
if (result.errorType) {
|
|
465
|
+
errorMessages.push(`[${result.errorType}] ${errorMessage}`);
|
|
466
|
+
}
|
|
467
|
+
else {
|
|
468
|
+
// Fallback to status-based context
|
|
469
|
+
switch (response.status) {
|
|
470
|
+
case 401: {
|
|
471
|
+
errorMessages.push('Authentication failed. Please run `hereya login` to refresh your credentials.');
|
|
472
|
+
break;
|
|
473
|
+
}
|
|
474
|
+
case 403: {
|
|
475
|
+
errorMessages.push(`Permission denied: ${errorMessage}`);
|
|
476
|
+
break;
|
|
477
|
+
}
|
|
478
|
+
case 409: {
|
|
479
|
+
errorMessages.push(`Conflict: ${errorMessage}`);
|
|
480
|
+
break;
|
|
481
|
+
}
|
|
482
|
+
default: {
|
|
483
|
+
if (response.status >= 500) {
|
|
484
|
+
errorMessages.push(`Server error: ${errorMessage} (status ${response.status})`);
|
|
485
|
+
}
|
|
486
|
+
else {
|
|
487
|
+
errorMessages.push(errorMessage);
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
// Add help message if present
|
|
493
|
+
if (result.help) {
|
|
494
|
+
errorMessages.push('', `ℹ️ ${result.help}`);
|
|
495
|
+
}
|
|
496
|
+
// Add package info if present (helpful for debugging)
|
|
497
|
+
if (result.package) {
|
|
498
|
+
errorMessages.push('', `Package: ${result.package.name}@${result.package.version}`);
|
|
499
|
+
}
|
|
500
|
+
return {
|
|
501
|
+
reason: errorMessages.join('\n'),
|
|
502
|
+
success: false,
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
return {
|
|
506
|
+
package: result.package,
|
|
507
|
+
success: true,
|
|
508
|
+
};
|
|
509
|
+
}
|
|
296
510
|
async removePackageFromWorkspace(input) {
|
|
297
511
|
const response = await fetch(`${this.config.url}/api/workspaces/${encodeURIComponent(input.workspace)}/packages/${encodeURIComponent(input.package)}`, {
|
|
298
512
|
headers: {
|