codefresh 0.89.5 → 0.89.6
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/lib/interface/cli/commands/root/get.cmd.js +1 -1
- package/lib/interface/cli/commands/root/get.completion.js +1 -1
- package/lib/interface/cli/completion/tree.json +1 -1
- package/lib/output/Output.js +2 -0
- package/lib/output/types/jsonArray.output.js +19 -0
- package/lib/output/types/jsonArray.output.spec.js +37 -0
- package/lib/output/types/yamlArray.output.js +20 -0
- package/lib/output/types/yamlArray.output.spec.js +40 -0
- package/package.json +1 -1
|
@@ -22,7 +22,7 @@ const get = new Command({
|
|
|
22
22
|
.option('output', {
|
|
23
23
|
describe: 'Output format',
|
|
24
24
|
alias: 'o',
|
|
25
|
-
choices: ['json', 'yaml', 'wide', 'name', 'id'],
|
|
25
|
+
choices: ['json', 'yaml', 'wide', 'name', 'id', 'jsonArray', 'yamlArray'],
|
|
26
26
|
group: 'Output Options',
|
|
27
27
|
})
|
|
28
28
|
.option('date-format', {
|
|
@@ -8,7 +8,7 @@ function optionHandler({ word, argv, option }) {
|
|
|
8
8
|
return fileDir(word);
|
|
9
9
|
}
|
|
10
10
|
if (OUTPUT_OPTIONS.includes(option)) {
|
|
11
|
-
return ['json', 'yaml', 'wide', 'name', 'id'];
|
|
11
|
+
return ['json', 'yaml', 'wide', 'name', 'id', 'jsonArray', 'yamlArray'];
|
|
12
12
|
}
|
|
13
13
|
return [];
|
|
14
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"codefresh":{"analyze":{},"completion":{},"completions":{"alias":"completion"},"tag":{},"untag":{},"offline-logs":{"ensure-index":{},"offload-to-collection":{},"offload-to-file":{}},"run":{"__optionHandlers":["../commands/pipeline/run.completion.js"]},"add":{"repository":{},"repo":{"alias":"repository"}},"annotate":{"image":{},"img":{"alias":"image"}},"patch":{"__optionHandlers":["../commands/root/apply.completion.js"],"agent":{"__optionHandlers":["../commands/root/apply.completion.js"]},"board":{"__optionHandlers":["../commands/root/apply.completion.js"]},"project":{"__optionHandlers":["../commands/root/apply.completion.js"]},"runtime-environments":{"__optionHandlers":["../commands/root/apply.completion.js"]},"re":{"alias":"runtime-environments"},"runtime-environment":{"alias":"runtime-environments"},"section":{"__optionHandlers":["../commands/root/apply.completion.js"]},"system-runtime-environments":{"__optionHandlers":["../commands/root/apply.completion.js"]},"sys-re":{"alias":"system-runtime-environments"},"system-runtime-environment":{"alias":"system-runtime-environments"},"teams":{"__optionHandlers":["../commands/root/apply.completion.js"]},"team":{"alias":"teams"},"tm":{"alias":"teams"},"tokens":{"__optionHandlers":["../commands/root/apply.completion.js"]},"token":{"alias":"tokens"},"helm-repo":{"__optionHandlers":["../commands/root/apply.completion.js"]},"context":{"__optionHandlers":["../commands/root/apply.completion.js"]},"ctx":{"alias":"context"}},"assign":{"system-runtime-environments":{},"sys-re":{"alias":"system-runtime-environments"},"system-runtime-environment":{"alias":"system-runtime-environments"}},"auth":{"create-context":{},"current-context":{},"get-contexts":{},"use-context":{}},"components":{"download":{},"update":{}},"create":{"__optionHandlers":["../commands/root/create.completion.js"],"agent":{"__optionHandlers":["../commands/root/create.completion.js"]},"clusters":{"__optionHandlers":["../commands/root/create.completion.js"]},"cluster":{"alias":"clusters"},"annotation":{"__optionHandlers":["../commands/root/create.completion.js"]},"board":{"__optionHandlers":["../commands/root/create.completion.js"]},"composition":{"__optionHandlers":["../commands/composition/create.completion.js","../commands/root/create.completion.js"]},"com":{"alias":"composition"},"project":{"__optionHandlers":["../commands/root/create.completion.js"]},"runtime-environments":{"__optionHandlers":["../commands/root/create.completion.js"]},"re":{"alias":"runtime-environments"},"runtime-environment":{"alias":"runtime-environments"},"section":{"__optionHandlers":["../commands/root/create.completion.js"]},"teams":{"__optionHandlers":["../commands/root/create.completion.js"]},"team":{"alias":"teams"},"tm":{"alias":"teams"},"token":{"__optionHandlers":["../commands/root/create.completion.js"]},"helm-repo":{"__optionHandlers":["../commands/root/create.completion.js"]},"registry":{"__optionHandlers":["../commands/root/create.completion.js"],"standard":{"__optionHandlers":["../commands/root/create.completion.js"]}},"trigger":{"__optionHandlers":["../commands/root/create.completion.js"]},"t":{"alias":"trigger"},"trigger-event":{"__optionHandlers":["../commands/root/create.completion.js"]},"te":{"alias":"trigger-event"},"workflow-data-item":{"__optionHandlers":["../commands/root/create.completion.js"]},"wdi":{"alias":"workflow-data-item"},"context":{"__optionHandlers":["../commands/root/create.completion.js"],"config":{"__optionHandlers":["../commands/root/create.completion.js"]},"secret":{"__optionHandlers":["../commands/root/create.completion.js"]},"secret-yaml":{"__optionHandlers":["../commands/root/create.completion.js"]},"yaml":{"__optionHandlers":["../commands/root/create.completion.js"]},"git":{"__optionHandlers":["../commands/root/create.completion.js"],"bitbucket":{"__optionHandlers":["../commands/root/create.completion.js"]},"github":{"__optionHandlers":["../commands/root/create.completion.js"]},"stash":{"__optionHandlers":["../commands/root/create.completion.js"]},"gitlab":{"__optionHandlers":["../commands/root/create.completion.js"]}},"helm-repository":{"__optionHandlers":["../commands/root/create.completion.js"],"http":{"__optionHandlers":["../commands/root/create.completion.js"]},"s3":{"__optionHandlers":["../commands/root/create.completion.js"]}},"secret-store":{"__optionHandlers":["../commands/root/create.completion.js"],"kubernetes-runtime":{"__optionHandlers":["../commands/root/create.completion.js"]},"hashicorp-vault":{"__optionHandlers":["../commands/root/create.completion.js"]},"kubernetes":{"__optionHandlers":["../commands/root/create.completion.js"]}}},"ctx":{"alias":"context","config":{"__optionHandlers":["../commands/root/create.completion.js"]},"secret":{"__optionHandlers":["../commands/root/create.completion.js"]},"secret-yaml":{"__optionHandlers":["../commands/root/create.completion.js"]},"yaml":{"__optionHandlers":["../commands/root/create.completion.js"]},"git":{"__optionHandlers":["../commands/root/create.completion.js"],"bitbucket":{"__optionHandlers":["../commands/root/create.completion.js"]},"github":{"__optionHandlers":["../commands/root/create.completion.js"]},"stash":{"__optionHandlers":["../commands/root/create.completion.js"]},"gitlab":{"__optionHandlers":["../commands/root/create.completion.js"]}},"helm-repository":{"__optionHandlers":["../commands/root/create.completion.js"],"http":{"__optionHandlers":["../commands/root/create.completion.js"]},"s3":{"__optionHandlers":["../commands/root/create.completion.js"]}},"secret-store":{"__optionHandlers":["../commands/root/create.completion.js"],"kubernetes-runtime":{"__optionHandlers":["../commands/root/create.completion.js"]},"hashicorp-vault":{"__optionHandlers":["../commands/root/create.completion.js"]},"kubernetes":{"__optionHandlers":["../commands/root/create.completion.js"]}}}},"delete":{"__optionHandlers":["../commands/root/delete.completion.js"],"agent":{"__optionHandlers":["../commands/root/delete.completion.js"]},"annotation":{"__optionHandlers":["../commands/root/delete.completion.js"]},"board":{"__optionHandlers":["../commands/root/delete.completion.js"]},"cluster":{"__optionHandlers":["../commands/root/delete.completion.js"]},"clusters":{"alias":"cluster"},"composition":{"__optionHandlers":["../commands/root/delete.completion.js"]},"com":{"alias":"composition"},"environment":{"__optionHandlers":["../commands/root/delete.completion.js"]},"env":{"alias":"environment"},"pipeline":{"__optionHandlers":["../commands/root/delete.completion.js"]},"pip":{"alias":"pipeline"},"project":{"__optionHandlers":["../commands/root/delete.completion.js"]},"repository":{"__optionHandlers":["../commands/root/delete.completion.js"]},"repo":{"alias":"repository"},"runtime-environments":{"__optionHandlers":["../commands/root/delete.completion.js"]},"re":{"alias":"runtime-environments"},"runtime-environment":{"alias":"runtime-environments"},"section":{"__optionHandlers":["../commands/root/delete.completion.js"]},"step-type":{"__optionHandlers":["../commands/root/delete.completion.js"]},"system-runtime-environments":{"__optionHandlers":["../commands/root/delete.completion.js"]},"sys-re":{"alias":"system-runtime-environments"},"system-runtime-environment":{"alias":"system-runtime-environments"},"teams":{"__optionHandlers":["../commands/root/delete.completion.js"]},"team":{"alias":"teams"},"tm":{"alias":"teams"},"tokens":{"__optionHandlers":["../commands/root/delete.completion.js"]},"token":{"alias":"tokens"},"helm-repo":{"__optionHandlers":["../commands/root/delete.completion.js"]},"registry":{"__optionHandlers":["../commands/root/delete.completion.js"]},"trigger":{"__optionHandlers":["../commands/root/delete.completion.js"]},"t":{"alias":"trigger"},"trigger-event":{"__optionHandlers":["../commands/root/delete.completion.js"]},"te":{"alias":"trigger-event"},"context":{"__optionHandlers":["../commands/root/delete.completion.js"]},"ctx":{"alias":"context"}},"diff":{"__optionHandlers":["../commands/root/diff.completion.js"],"runtime-environments":{"__optionHandlers":["../commands/root/diff.completion.js"]},"re":{"alias":"runtime-environments"},"runtime-environment":{"alias":"runtime-environments"},"system-runtime-environments":{"__optionHandlers":["../commands/root/diff.completion.js"]},"sys-re":{"alias":"system-runtime-environments"},"system-runtime-environment":{"alias":"system-runtime-environments"}},"download":{"audit":{}},"generate":{"image-pull-secret":{}},"get":{"__optionHandlers":["../commands/root/get.completion.js"],"runtime-environment-base-images":{"__optionHandlers":["../commands/root/get.completion.js"]},"re-base-images":{"alias":"runtime-environment-base-images"},"agents":{"__optionHandlers":["../commands/root/get.completion.js"]},"agent":{"alias":"agents"},"annotation":{"__optionHandlers":["../commands/root/get.completion.js"]},"boards":{"__optionHandlers":["../commands/root/get.completion.js"]},"board":{"alias":"boards"},"clusters":{"__optionHandlers":["../commands/root/get.completion.js"]},"cluster":{"alias":"clusters"},"compositions":{"__optionHandlers":["../commands/root/get.completion.js"]},"com":{"alias":"compositions"},"composition":{"alias":"compositions"},"environments":{"__optionHandlers":["../commands/root/get.completion.js"]},"env":{"alias":"environments"},"environment":{"alias":"environments"},"images":{"__optionHandlers":["../commands/root/get.completion.js"]},"img":{"alias":"images"},"image":{"alias":"images"},"pipelines":{"__positionalHandler":"../commands/pipeline/get.completion.js","__optionHandlers":["../commands/root/get.completion.js"]},"pip":{"alias":"pipelines"},"pipeline":{"alias":"pipelines"},"projects":{"__optionHandlers":["../commands/root/get.completion.js"]},"project":{"alias":"projects"},"repository":{"__optionHandlers":["../commands/root/get.completion.js"]},"repo":{"alias":"repository"},"runtime-environments":{"__optionHandlers":["../commands/root/get.completion.js"]},"re":{"alias":"runtime-environments"},"runtime-environment":{"alias":"runtime-environments"},"sections":{"__optionHandlers":["../commands/root/get.completion.js"]},"section":{"alias":"sections"},"step-types":{"__positionalHandler":"../commands/step/get.completion.js","__optionHandlers":["../commands/root/get.completion.js"]},"step-type":{"alias":"step-types"},"system-runtime-environments":{"__optionHandlers":["../commands/root/get.completion.js"]},"sys-re":{"alias":"system-runtime-environments"},"system-runtime-environment":{"alias":"system-runtime-environments"},"teams":{"__optionHandlers":["../commands/root/get.completion.js"]},"team":{"alias":"teams"},"tm":{"alias":"teams"},"tokens":{"__optionHandlers":["../commands/root/get.completion.js"]},"token":{"alias":"tokens"},"helm-repo":{"__optionHandlers":["../commands/root/get.completion.js"]},"registry":{"__optionHandlers":["../commands/root/get.completion.js"]},"triggers":{"__optionHandlers":["../commands/root/get.completion.js"]},"trigger":{"alias":"triggers"},"t":{"alias":"triggers"},"trigger-types":{"__optionHandlers":["../commands/root/get.completion.js"]},"trigger-type":{"alias":"trigger-types"},"tt":{"alias":"trigger-types"},"trigger-events":{"__optionHandlers":["../commands/root/get.completion.js"]},"trigger-event":{"alias":"trigger-events"},"te":{"alias":"trigger-events"},"builds":{"__optionHandlers":["../commands/root/get.completion.js"]},"build":{"alias":"builds"},"workflow-data-item":{"__optionHandlers":["../commands/root/get.completion.js"]},"wdi":{"alias":"workflow-data-item"},"contexts":{"__optionHandlers":["../commands/root/get.completion.js"]},"ctx":{"alias":"contexts"},"context":{"alias":"contexts"}},"install":{"runtime":{},"agent":{},"app-proxy":{},"monitor":{},"gitops":{}},"replace":{"__optionHandlers":["../commands/root/replace.completion.js"],"composition":{"__optionHandlers":["../commands/composition/replace.completion.js","../commands/root/replace.completion.js"]},"com":{"alias":"composition"}},"runner":{"delete":{},"execute-test-pipeline":{},"info":{},"init":{},"upgrade":{}},"synchronize":{"teams":{},"team":{"alias":"teams"},"tm":{"alias":"teams"}},"unassign":{"system-runtime-environments":{},"sys-re":{"alias":"system-runtime-environments"},"system-runtime-environment":{"alias":"system-runtime-environments"}},"uninstall":{"agent":{},"app-proxy":{},"runtime":{},"monitor":{},"gitops":{}},"upgrade":{"app-proxy":{},"gitops":{}},"validate":{"__positionalHandler":"../commands/root/validate.completion.js"},"version":{},"attach":{},"cli-config":{"get":{},"help":{},"profile":{},"set":{}},"set-helm-config":{},"install-chart":{},"helm-promotion":{},"delete-release":{},"rollback-release":{},"test-release":{},"approve":{},"deny":{},"logs":{},"restart":{},"terminate":{},"wait":{}}}
|
|
1
|
+
{"codefresh":{"analyze":{},"completion":{},"completions":{"alias":"completion"},"tag":{},"untag":{},"offline-logs":{"ensure-index":{},"offload-to-collection":{},"offload-to-file":{}},"run":{"__optionHandlers":["../commands/pipeline/run.completion.js"]},"attach":{},"add":{"repository":{},"repo":{"alias":"repository"}},"annotate":{"image":{},"img":{"alias":"image"}},"patch":{"__optionHandlers":["../commands/root/apply.completion.js"],"agent":{"__optionHandlers":["../commands/root/apply.completion.js"]},"board":{"__optionHandlers":["../commands/root/apply.completion.js"]},"project":{"__optionHandlers":["../commands/root/apply.completion.js"]},"runtime-environments":{"__optionHandlers":["../commands/root/apply.completion.js"]},"re":{"alias":"runtime-environments"},"runtime-environment":{"alias":"runtime-environments"},"section":{"__optionHandlers":["../commands/root/apply.completion.js"]},"system-runtime-environments":{"__optionHandlers":["../commands/root/apply.completion.js"]},"sys-re":{"alias":"system-runtime-environments"},"system-runtime-environment":{"alias":"system-runtime-environments"},"teams":{"__optionHandlers":["../commands/root/apply.completion.js"]},"team":{"alias":"teams"},"tm":{"alias":"teams"},"tokens":{"__optionHandlers":["../commands/root/apply.completion.js"]},"token":{"alias":"tokens"},"helm-repo":{"__optionHandlers":["../commands/root/apply.completion.js"]},"context":{"__optionHandlers":["../commands/root/apply.completion.js"]},"ctx":{"alias":"context"}},"assign":{"system-runtime-environments":{},"sys-re":{"alias":"system-runtime-environments"},"system-runtime-environment":{"alias":"system-runtime-environments"}},"auth":{"create-context":{},"current-context":{},"get-contexts":{},"use-context":{}},"components":{"download":{},"update":{}},"create":{"__optionHandlers":["../commands/root/create.completion.js"],"agent":{"__optionHandlers":["../commands/root/create.completion.js"]},"clusters":{"__optionHandlers":["../commands/root/create.completion.js"]},"cluster":{"alias":"clusters"},"annotation":{"__optionHandlers":["../commands/root/create.completion.js"]},"board":{"__optionHandlers":["../commands/root/create.completion.js"]},"composition":{"__optionHandlers":["../commands/composition/create.completion.js","../commands/root/create.completion.js"]},"com":{"alias":"composition"},"project":{"__optionHandlers":["../commands/root/create.completion.js"]},"runtime-environments":{"__optionHandlers":["../commands/root/create.completion.js"]},"re":{"alias":"runtime-environments"},"runtime-environment":{"alias":"runtime-environments"},"section":{"__optionHandlers":["../commands/root/create.completion.js"]},"teams":{"__optionHandlers":["../commands/root/create.completion.js"]},"team":{"alias":"teams"},"tm":{"alias":"teams"},"token":{"__optionHandlers":["../commands/root/create.completion.js"]},"helm-repo":{"__optionHandlers":["../commands/root/create.completion.js"]},"registry":{"__optionHandlers":["../commands/root/create.completion.js"],"standard":{"__optionHandlers":["../commands/root/create.completion.js"]}},"trigger":{"__optionHandlers":["../commands/root/create.completion.js"]},"t":{"alias":"trigger"},"trigger-event":{"__optionHandlers":["../commands/root/create.completion.js"]},"te":{"alias":"trigger-event"},"workflow-data-item":{"__optionHandlers":["../commands/root/create.completion.js"]},"wdi":{"alias":"workflow-data-item"},"context":{"__optionHandlers":["../commands/root/create.completion.js"],"config":{"__optionHandlers":["../commands/root/create.completion.js"]},"secret":{"__optionHandlers":["../commands/root/create.completion.js"]},"secret-yaml":{"__optionHandlers":["../commands/root/create.completion.js"]},"yaml":{"__optionHandlers":["../commands/root/create.completion.js"]},"helm-repository":{"__optionHandlers":["../commands/root/create.completion.js"],"http":{"__optionHandlers":["../commands/root/create.completion.js"]},"s3":{"__optionHandlers":["../commands/root/create.completion.js"]}},"secret-store":{"__optionHandlers":["../commands/root/create.completion.js"],"hashicorp-vault":{"__optionHandlers":["../commands/root/create.completion.js"]},"kubernetes-runtime":{"__optionHandlers":["../commands/root/create.completion.js"]},"kubernetes":{"__optionHandlers":["../commands/root/create.completion.js"]}},"git":{"__optionHandlers":["../commands/root/create.completion.js"],"bitbucket":{"__optionHandlers":["../commands/root/create.completion.js"]},"github":{"__optionHandlers":["../commands/root/create.completion.js"]},"gitlab":{"__optionHandlers":["../commands/root/create.completion.js"]},"stash":{"__optionHandlers":["../commands/root/create.completion.js"]}}},"ctx":{"alias":"context","config":{"__optionHandlers":["../commands/root/create.completion.js"]},"secret":{"__optionHandlers":["../commands/root/create.completion.js"]},"secret-yaml":{"__optionHandlers":["../commands/root/create.completion.js"]},"yaml":{"__optionHandlers":["../commands/root/create.completion.js"]},"helm-repository":{"__optionHandlers":["../commands/root/create.completion.js"],"http":{"__optionHandlers":["../commands/root/create.completion.js"]},"s3":{"__optionHandlers":["../commands/root/create.completion.js"]}},"secret-store":{"__optionHandlers":["../commands/root/create.completion.js"],"hashicorp-vault":{"__optionHandlers":["../commands/root/create.completion.js"]},"kubernetes-runtime":{"__optionHandlers":["../commands/root/create.completion.js"]},"kubernetes":{"__optionHandlers":["../commands/root/create.completion.js"]}},"git":{"__optionHandlers":["../commands/root/create.completion.js"],"bitbucket":{"__optionHandlers":["../commands/root/create.completion.js"]},"github":{"__optionHandlers":["../commands/root/create.completion.js"]},"gitlab":{"__optionHandlers":["../commands/root/create.completion.js"]},"stash":{"__optionHandlers":["../commands/root/create.completion.js"]}}}},"delete":{"__optionHandlers":["../commands/root/delete.completion.js"],"agent":{"__optionHandlers":["../commands/root/delete.completion.js"]},"annotation":{"__optionHandlers":["../commands/root/delete.completion.js"]},"board":{"__optionHandlers":["../commands/root/delete.completion.js"]},"cluster":{"__optionHandlers":["../commands/root/delete.completion.js"]},"clusters":{"alias":"cluster"},"environment":{"__optionHandlers":["../commands/root/delete.completion.js"]},"env":{"alias":"environment"},"composition":{"__optionHandlers":["../commands/root/delete.completion.js"]},"com":{"alias":"composition"},"project":{"__optionHandlers":["../commands/root/delete.completion.js"]},"pipeline":{"__optionHandlers":["../commands/root/delete.completion.js"]},"pip":{"alias":"pipeline"},"repository":{"__optionHandlers":["../commands/root/delete.completion.js"]},"repo":{"alias":"repository"},"runtime-environments":{"__optionHandlers":["../commands/root/delete.completion.js"]},"re":{"alias":"runtime-environments"},"runtime-environment":{"alias":"runtime-environments"},"section":{"__optionHandlers":["../commands/root/delete.completion.js"]},"step-type":{"__optionHandlers":["../commands/root/delete.completion.js"]},"system-runtime-environments":{"__optionHandlers":["../commands/root/delete.completion.js"]},"sys-re":{"alias":"system-runtime-environments"},"system-runtime-environment":{"alias":"system-runtime-environments"},"teams":{"__optionHandlers":["../commands/root/delete.completion.js"]},"team":{"alias":"teams"},"tm":{"alias":"teams"},"tokens":{"__optionHandlers":["../commands/root/delete.completion.js"]},"token":{"alias":"tokens"},"helm-repo":{"__optionHandlers":["../commands/root/delete.completion.js"]},"registry":{"__optionHandlers":["../commands/root/delete.completion.js"]},"trigger":{"__optionHandlers":["../commands/root/delete.completion.js"]},"t":{"alias":"trigger"},"trigger-event":{"__optionHandlers":["../commands/root/delete.completion.js"]},"te":{"alias":"trigger-event"},"context":{"__optionHandlers":["../commands/root/delete.completion.js"]},"ctx":{"alias":"context"}},"diff":{"__optionHandlers":["../commands/root/diff.completion.js"],"runtime-environments":{"__optionHandlers":["../commands/root/diff.completion.js"]},"re":{"alias":"runtime-environments"},"runtime-environment":{"alias":"runtime-environments"},"system-runtime-environments":{"__optionHandlers":["../commands/root/diff.completion.js"]},"sys-re":{"alias":"system-runtime-environments"},"system-runtime-environment":{"alias":"system-runtime-environments"}},"download":{"audit":{}},"generate":{"image-pull-secret":{}},"get":{"__optionHandlers":["../commands/root/get.completion.js"],"runtime-environment-base-images":{"__optionHandlers":["../commands/root/get.completion.js"]},"re-base-images":{"alias":"runtime-environment-base-images"},"agents":{"__optionHandlers":["../commands/root/get.completion.js"]},"agent":{"alias":"agents"},"annotation":{"__optionHandlers":["../commands/root/get.completion.js"]},"boards":{"__optionHandlers":["../commands/root/get.completion.js"]},"board":{"alias":"boards"},"clusters":{"__optionHandlers":["../commands/root/get.completion.js"]},"cluster":{"alias":"clusters"},"environments":{"__optionHandlers":["../commands/root/get.completion.js"]},"env":{"alias":"environments"},"environment":{"alias":"environments"},"compositions":{"__optionHandlers":["../commands/root/get.completion.js"]},"com":{"alias":"compositions"},"composition":{"alias":"compositions"},"images":{"__optionHandlers":["../commands/root/get.completion.js"]},"img":{"alias":"images"},"image":{"alias":"images"},"projects":{"__optionHandlers":["../commands/root/get.completion.js"]},"project":{"alias":"projects"},"pipelines":{"__positionalHandler":"../commands/pipeline/get.completion.js","__optionHandlers":["../commands/root/get.completion.js"]},"pip":{"alias":"pipelines"},"pipeline":{"alias":"pipelines"},"repository":{"__optionHandlers":["../commands/root/get.completion.js"]},"repo":{"alias":"repository"},"runtime-environments":{"__optionHandlers":["../commands/root/get.completion.js"]},"re":{"alias":"runtime-environments"},"runtime-environment":{"alias":"runtime-environments"},"sections":{"__optionHandlers":["../commands/root/get.completion.js"]},"section":{"alias":"sections"},"step-types":{"__positionalHandler":"../commands/step/get.completion.js","__optionHandlers":["../commands/root/get.completion.js"]},"step-type":{"alias":"step-types"},"system-runtime-environments":{"__optionHandlers":["../commands/root/get.completion.js"]},"sys-re":{"alias":"system-runtime-environments"},"system-runtime-environment":{"alias":"system-runtime-environments"},"teams":{"__optionHandlers":["../commands/root/get.completion.js"]},"team":{"alias":"teams"},"tm":{"alias":"teams"},"tokens":{"__optionHandlers":["../commands/root/get.completion.js"]},"token":{"alias":"tokens"},"helm-repo":{"__optionHandlers":["../commands/root/get.completion.js"]},"registry":{"__optionHandlers":["../commands/root/get.completion.js"]},"triggers":{"__optionHandlers":["../commands/root/get.completion.js"]},"trigger":{"alias":"triggers"},"t":{"alias":"triggers"},"trigger-events":{"__optionHandlers":["../commands/root/get.completion.js"]},"trigger-event":{"alias":"trigger-events"},"te":{"alias":"trigger-events"},"trigger-types":{"__optionHandlers":["../commands/root/get.completion.js"]},"trigger-type":{"alias":"trigger-types"},"tt":{"alias":"trigger-types"},"builds":{"__optionHandlers":["../commands/root/get.completion.js"]},"build":{"alias":"builds"},"workflow-data-item":{"__optionHandlers":["../commands/root/get.completion.js"]},"wdi":{"alias":"workflow-data-item"},"contexts":{"__optionHandlers":["../commands/root/get.completion.js"]},"ctx":{"alias":"contexts"},"context":{"alias":"contexts"}},"install":{"runtime":{},"agent":{},"app-proxy":{},"monitor":{},"gitops":{}},"replace":{"__optionHandlers":["../commands/root/replace.completion.js"],"composition":{"__optionHandlers":["../commands/composition/replace.completion.js","../commands/root/replace.completion.js"]},"com":{"alias":"composition"}},"runner":{"delete":{},"execute-test-pipeline":{},"info":{},"init":{},"upgrade":{}},"synchronize":{"teams":{},"team":{"alias":"teams"},"tm":{"alias":"teams"}},"uninstall":{"agent":{},"app-proxy":{},"runtime":{},"monitor":{},"gitops":{}},"upgrade":{"app-proxy":{},"gitops":{}},"unassign":{"system-runtime-environments":{},"sys-re":{"alias":"system-runtime-environments"},"system-runtime-environment":{"alias":"system-runtime-environments"}},"validate":{"__positionalHandler":"../commands/root/validate.completion.js"},"version":{},"cli-config":{"get":{},"help":{},"set":{},"profile":{}},"set-helm-config":{},"install-chart":{},"helm-promotion":{},"delete-release":{},"rollback-release":{},"test-release":{},"approve":{},"deny":{},"logs":{},"restart":{},"terminate":{},"wait":{}}}
|
package/lib/output/Output.js
CHANGED
|
@@ -13,6 +13,8 @@ const TYPES = {
|
|
|
13
13
|
table: require('./types/table.output'),
|
|
14
14
|
id: require('./types/id.output'),
|
|
15
15
|
name: require('./types/name.output'),
|
|
16
|
+
jsonArray: require('./types/jsonArray.output'),
|
|
17
|
+
yamlArray: require('./types/yamlArray.output'),
|
|
16
18
|
};
|
|
17
19
|
|
|
18
20
|
const TABLE_TYPES = ['default', 'wide'];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const CFError = require('cf-errors'); // eslint-disable-line
|
|
2
|
+
const Entity = require('../../logic/entities/Entity');
|
|
3
|
+
const _ = require('lodash');
|
|
4
|
+
|
|
5
|
+
function output(data) {
|
|
6
|
+
const entities = _.isArray(data) ? data : [data];
|
|
7
|
+
const jsonArray = [];
|
|
8
|
+
|
|
9
|
+
_.forEach(entities, (entity) => {
|
|
10
|
+
if (!(entity instanceof Entity)) {
|
|
11
|
+
throw new CFError('Cannot extract data for "jsonArray" output -- data contains not Entity');
|
|
12
|
+
}
|
|
13
|
+
jsonArray.push(entity.info);
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
return JSON.stringify(jsonArray, null, '\t');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
module.exports = output;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const CFError = require('cf-errors');
|
|
2
|
+
const Entity = require('../../logic/entities/Entity');
|
|
3
|
+
const output = require('./jsonArray.output');
|
|
4
|
+
|
|
5
|
+
describe('jsonArray output', () => {
|
|
6
|
+
it('should return empty array for an empty array', () => {
|
|
7
|
+
expect(output([])).toBe('[]');
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('should wrap single Entity into array', () => {
|
|
11
|
+
const entity = new Entity();
|
|
12
|
+
entity.info = { id: '1', status: 'ok' };
|
|
13
|
+
|
|
14
|
+
const result = JSON.parse(output(entity));
|
|
15
|
+
expect(Array.isArray(result)).toBe(true);
|
|
16
|
+
expect(result).toHaveLength(1);
|
|
17
|
+
expect(result[0]).toEqual(entity.info);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should keep multiple Entities as array', () => {
|
|
21
|
+
const entity1 = new Entity();
|
|
22
|
+
entity1.info = { id: '1' };
|
|
23
|
+
const entity2 = new Entity();
|
|
24
|
+
entity2.info = { id: '2' };
|
|
25
|
+
|
|
26
|
+
const result = JSON.parse(output([entity1, entity2]));
|
|
27
|
+
expect(Array.isArray(result)).toBe(true);
|
|
28
|
+
expect(result).toHaveLength(2);
|
|
29
|
+
expect(result[0]).toEqual(entity1.info);
|
|
30
|
+
expect(result[1]).toEqual(entity2.info);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it('should throw CFError if element is not an Entity', () => {
|
|
34
|
+
expect(() => output({ id: '1' })).toThrow(CFError);
|
|
35
|
+
expect(() => output([new Entity(), {}])).toThrow(CFError);
|
|
36
|
+
});
|
|
37
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const CFError = require('cf-errors');
|
|
2
|
+
const Entity = require('../../logic/entities/Entity');
|
|
3
|
+
const _ = require('lodash');
|
|
4
|
+
const yaml = require('js-yaml');
|
|
5
|
+
|
|
6
|
+
function output(data) {
|
|
7
|
+
const entities = _.isArray(data) ? data : [data];
|
|
8
|
+
const yamlArray = [];
|
|
9
|
+
|
|
10
|
+
_.forEach(entities, (entity) => {
|
|
11
|
+
if (!(entity instanceof Entity)) {
|
|
12
|
+
throw new CFError('Cannot extract data for "yamlArray" output -- data contains not Entity');
|
|
13
|
+
}
|
|
14
|
+
yamlArray.push(entity.info);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
return yaml.dump(yamlArray);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
module.exports = output;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const CFError = require('cf-errors');
|
|
2
|
+
const yaml = require('js-yaml');
|
|
3
|
+
const Entity = require('../../logic/entities/Entity');
|
|
4
|
+
const output = require('./yamlArray.output');
|
|
5
|
+
|
|
6
|
+
describe('yamlArray output', () => {
|
|
7
|
+
it('should return empty array for an empty array', () => {
|
|
8
|
+
const result = yaml.load(output([]));
|
|
9
|
+
expect(Array.isArray(result)).toBe(true);
|
|
10
|
+
expect(result).toHaveLength(0);
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('should wrap single Entity into array', () => {
|
|
14
|
+
const entity = new Entity();
|
|
15
|
+
entity.info = { id: '1', status: 'ok' };
|
|
16
|
+
|
|
17
|
+
const result = yaml.load(output(entity));
|
|
18
|
+
expect(Array.isArray(result)).toBe(true);
|
|
19
|
+
expect(result).toHaveLength(1);
|
|
20
|
+
expect(result[0]).toEqual(entity.info);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('should keep multiple Entities as array', () => {
|
|
24
|
+
const entity1 = new Entity();
|
|
25
|
+
entity1.info = { id: '1' };
|
|
26
|
+
const entity2 = new Entity();
|
|
27
|
+
entity2.info = { id: '2' };
|
|
28
|
+
|
|
29
|
+
const result = yaml.load(output([entity1, entity2]));
|
|
30
|
+
expect(Array.isArray(result)).toBe(true);
|
|
31
|
+
expect(result).toHaveLength(2);
|
|
32
|
+
expect(result[0]).toEqual(entity1.info);
|
|
33
|
+
expect(result[1]).toEqual(entity2.info);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it('should throw CFError if element is not an Entity', () => {
|
|
37
|
+
expect(() => output({ id: '1' })).toThrow(CFError);
|
|
38
|
+
expect(() => output([new Entity(), {}])).toThrow(CFError);
|
|
39
|
+
});
|
|
40
|
+
});
|