@knocklabs/cli 0.1.0 → 0.1.4
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 +142 -61
- package/dist/commands/commit/index.js +6 -3
- package/dist/commands/commit/promote.js +5 -2
- package/dist/commands/knock.js +102 -0
- package/dist/commands/ping.js +0 -4
- package/dist/commands/translation/get.js +13 -9
- package/dist/commands/translation/list.js +7 -3
- package/dist/commands/translation/pull.js +18 -9
- package/dist/commands/translation/push.js +10 -6
- package/dist/commands/translation/validate.js +11 -7
- package/dist/commands/whoami.js +3 -0
- package/dist/commands/workflow/activate.js +19 -8
- package/dist/commands/workflow/get.js +14 -10
- package/dist/commands/workflow/list.js +7 -3
- package/dist/commands/workflow/new.js +4 -5
- package/dist/commands/workflow/pull.js +17 -9
- package/dist/commands/workflow/push.js +9 -6
- package/dist/commands/workflow/run.js +56 -0
- package/dist/commands/workflow/validate.js +9 -6
- package/dist/lib/api-v1.js +14 -0
- package/dist/lib/base-command.js +8 -4
- package/dist/lib/helpers/flag.js +30 -1
- package/dist/lib/helpers/json.js +9 -0
- package/dist/lib/helpers/page.js +7 -2
- package/dist/lib/helpers/request.js +1 -1
- package/dist/lib/helpers/ux.js +2 -2
- package/dist/lib/marshal/translation/helpers.js +11 -5
- package/dist/lib/marshal/translation/reader.js +1 -1
- package/dist/lib/marshal/workflow/generator.js +1 -0
- package/dist/lib/marshal/workflow/helpers.js +19 -6
- package/dist/lib/marshal/workflow/reader.js +1 -1
- package/dist/lib/marshal/workflow/types.js +1 -0
- package/dist/lib/run-context/helpers.js +2 -2
- package/oclif.manifest.json +169 -25
- package/package.json +23 -17
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ $ npm install -g @knocklabs/cli
|
|
|
16
16
|
$ knock COMMAND
|
|
17
17
|
running command...
|
|
18
18
|
$ knock (--version)
|
|
19
|
-
@knocklabs/cli/0.1.
|
|
19
|
+
@knocklabs/cli/0.1.4 linux-x64 node-v18.16.1
|
|
20
20
|
$ knock --help [COMMAND]
|
|
21
21
|
USAGE
|
|
22
22
|
$ knock COMMAND
|
|
@@ -50,35 +50,40 @@ USAGE
|
|
|
50
50
|
* [`knock workflow list`](#knock-workflow-list)
|
|
51
51
|
* [`knock workflow pull [WORKFLOWKEY]`](#knock-workflow-pull-workflowkey)
|
|
52
52
|
* [`knock workflow push [WORKFLOWKEY]`](#knock-workflow-push-workflowkey)
|
|
53
|
+
* [`knock workflow run WORKFLOWKEY`](#knock-workflow-run-workflowkey)
|
|
53
54
|
* [`knock workflow validate [WORKFLOWKEY]`](#knock-workflow-validate-workflowkey)
|
|
54
55
|
|
|
55
56
|
## `knock commit`
|
|
56
57
|
|
|
58
|
+
Commit all changes in development environment.
|
|
59
|
+
|
|
57
60
|
```
|
|
58
61
|
USAGE
|
|
59
62
|
$ knock commit --service-token <value> [--environment development] [-m <value>] [--force]
|
|
60
63
|
|
|
61
64
|
FLAGS
|
|
62
|
-
-m, --commit-message=<value> Use the given value as the commit message
|
|
65
|
+
-m, --commit-message=<value> Use the given value as the commit message.
|
|
63
66
|
--environment=<option> [default: development] Committing changes applies to the development environment only,
|
|
64
|
-
use `commit promote` to promote changes to a
|
|
67
|
+
use `commit promote` to promote changes to a subsequent environment.
|
|
65
68
|
<options: development>
|
|
66
|
-
--force
|
|
67
|
-
--service-token=<value> (required) The service token to authenticate with
|
|
69
|
+
--force Remove the confirmation prompt.
|
|
70
|
+
--service-token=<value> (required) The service token to authenticate with.
|
|
68
71
|
```
|
|
69
72
|
|
|
70
|
-
_See code: [dist/commands/commit/index.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.
|
|
73
|
+
_See code: [dist/commands/commit/index.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.4/dist/commands/commit/index.ts)_
|
|
71
74
|
|
|
72
75
|
## `knock commit promote`
|
|
73
76
|
|
|
77
|
+
Promote all changes to the destination environment.
|
|
78
|
+
|
|
74
79
|
```
|
|
75
80
|
USAGE
|
|
76
81
|
$ knock commit promote --service-token <value> --to <value> [--force]
|
|
77
82
|
|
|
78
83
|
FLAGS
|
|
79
|
-
--force
|
|
80
|
-
--service-token=<value> (required) The service token to authenticate with
|
|
81
|
-
--to=<value> (required) The destination environment to promote changes from the preceding environment
|
|
84
|
+
--force Remove the confirmation prompt.
|
|
85
|
+
--service-token=<value> (required) The service token to authenticate with.
|
|
86
|
+
--to=<value> (required) The destination environment to promote changes from the preceding environment.
|
|
82
87
|
```
|
|
83
88
|
|
|
84
89
|
## `knock help [COMMANDS]`
|
|
@@ -99,7 +104,7 @@ DESCRIPTION
|
|
|
99
104
|
Display help for knock.
|
|
100
105
|
```
|
|
101
106
|
|
|
102
|
-
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.2.
|
|
107
|
+
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.2.11/src/commands/help.ts)_
|
|
103
108
|
|
|
104
109
|
## `knock plugins`
|
|
105
110
|
|
|
@@ -107,11 +112,14 @@ List installed plugins.
|
|
|
107
112
|
|
|
108
113
|
```
|
|
109
114
|
USAGE
|
|
110
|
-
$ knock plugins [--core]
|
|
115
|
+
$ knock plugins [--json] [--core]
|
|
111
116
|
|
|
112
117
|
FLAGS
|
|
113
118
|
--core Show core plugins.
|
|
114
119
|
|
|
120
|
+
GLOBAL FLAGS
|
|
121
|
+
--json Format output as json.
|
|
122
|
+
|
|
115
123
|
DESCRIPTION
|
|
116
124
|
List installed plugins.
|
|
117
125
|
|
|
@@ -119,7 +127,7 @@ EXAMPLES
|
|
|
119
127
|
$ knock plugins
|
|
120
128
|
```
|
|
121
129
|
|
|
122
|
-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/
|
|
130
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.1.6/src/commands/plugins/index.ts)_
|
|
123
131
|
|
|
124
132
|
## `knock plugins:install PLUGIN...`
|
|
125
133
|
|
|
@@ -336,15 +344,22 @@ DESCRIPTION
|
|
|
336
344
|
|
|
337
345
|
## `knock translation get TRANSLATIONREF`
|
|
338
346
|
|
|
347
|
+
Display a single translation from an environment.
|
|
348
|
+
|
|
339
349
|
```
|
|
340
350
|
USAGE
|
|
341
351
|
$ knock translation get TRANSLATIONREF --service-token <value> [--environment <value>] [--hide-uncommitted-changes]
|
|
342
352
|
[--json]
|
|
343
353
|
|
|
354
|
+
ARGUMENTS
|
|
355
|
+
TRANSLATIONREF Translation ref is a identifier string that refers to a unique translation.
|
|
356
|
+
If a translation has no namespace, it is the same as the locale, e.g. `en`.
|
|
357
|
+
If namespaced, it is formatted as namespace.locale, e.g. `admin.en`.
|
|
358
|
+
|
|
344
359
|
FLAGS
|
|
345
|
-
--environment=<value> [default: development]
|
|
346
|
-
--hide-uncommitted-changes
|
|
347
|
-
--service-token=<value> (required) The service token to authenticate with
|
|
360
|
+
--environment=<value> [default: development] The environment to use.
|
|
361
|
+
--hide-uncommitted-changes Hide any uncommitted changes.
|
|
362
|
+
--service-token=<value> (required) The service token to authenticate with.
|
|
348
363
|
|
|
349
364
|
GLOBAL FLAGS
|
|
350
365
|
--json Format output as json.
|
|
@@ -352,18 +367,20 @@ GLOBAL FLAGS
|
|
|
352
367
|
|
|
353
368
|
## `knock translation list`
|
|
354
369
|
|
|
370
|
+
Display all translations for an environment.
|
|
371
|
+
|
|
355
372
|
```
|
|
356
373
|
USAGE
|
|
357
374
|
$ knock translation list --service-token <value> [--environment <value>] [--hide-uncommitted-changes] [--after
|
|
358
375
|
<value>] [--before <value>] [--limit <value>] [--json]
|
|
359
376
|
|
|
360
377
|
FLAGS
|
|
361
|
-
--after=<value>
|
|
362
|
-
--before=<value>
|
|
363
|
-
--environment=<value> [default: development]
|
|
364
|
-
--hide-uncommitted-changes
|
|
365
|
-
--limit=<value>
|
|
366
|
-
--service-token=<value> (required) The service token to authenticate with
|
|
378
|
+
--after=<value> The cursor after which to fetch the next page.
|
|
379
|
+
--before=<value> The cursor before which to fetch the previous page.
|
|
380
|
+
--environment=<value> [default: development] The environment to use.
|
|
381
|
+
--hide-uncommitted-changes Hide any uncommitted changes.
|
|
382
|
+
--limit=<value> The total number of entries to fetch per page.
|
|
383
|
+
--service-token=<value> (required) The service token to authenticate with.
|
|
367
384
|
|
|
368
385
|
GLOBAL FLAGS
|
|
369
386
|
--json Format output as json.
|
|
@@ -371,93 +388,130 @@ GLOBAL FLAGS
|
|
|
371
388
|
|
|
372
389
|
## `knock translation pull [TRANSLATIONREF]`
|
|
373
390
|
|
|
391
|
+
Pull one or more translations from an environment into a local file system.
|
|
392
|
+
|
|
374
393
|
```
|
|
375
394
|
USAGE
|
|
376
395
|
$ knock translation pull [TRANSLATIONREF] --service-token <value> [--environment <value>] [--translations-dir
|
|
377
396
|
<value> --all] [--hide-uncommitted-changes] [--force]
|
|
378
397
|
|
|
398
|
+
ARGUMENTS
|
|
399
|
+
TRANSLATIONREF Translation ref is a identifier string that refers to a unique translation.
|
|
400
|
+
If a translation has no namespace, it is the same as the locale, e.g. `en`.
|
|
401
|
+
If namespaced, it is formatted as namespace.locale, e.g. `admin.en`.
|
|
402
|
+
|
|
379
403
|
FLAGS
|
|
380
|
-
--all
|
|
381
|
-
--environment=<value> [default: development]
|
|
382
|
-
--force
|
|
383
|
-
--hide-uncommitted-changes
|
|
384
|
-
--service-token=<value> (required) The service token to authenticate with
|
|
385
|
-
--translations-dir=<value>
|
|
404
|
+
--all Whether to pull all translations from the specified environment.
|
|
405
|
+
--environment=<value> [default: development] The environment to use.
|
|
406
|
+
--force Remove the confirmation prompt.
|
|
407
|
+
--hide-uncommitted-changes Hide any uncommitted changes.
|
|
408
|
+
--service-token=<value> (required) The service token to authenticate with.
|
|
409
|
+
--translations-dir=<value> The target directory path to pull all translations into.
|
|
386
410
|
```
|
|
387
411
|
|
|
388
412
|
## `knock translation push [TRANSLATIONREF]`
|
|
389
413
|
|
|
414
|
+
Push one or more translations from a local file system to Knock.
|
|
415
|
+
|
|
390
416
|
```
|
|
391
417
|
USAGE
|
|
392
418
|
$ knock translation push [TRANSLATIONREF] --service-token <value> [--environment development] [--translations-dir
|
|
393
419
|
<value> --all] [-m <value> --commit]
|
|
394
420
|
|
|
421
|
+
ARGUMENTS
|
|
422
|
+
TRANSLATIONREF Translation ref is a identifier string that refers to a unique translation.
|
|
423
|
+
If a translation has no namespace, it is the same as the locale, e.g. `en`.
|
|
424
|
+
If namespaced, it is formatted as namespace.locale, e.g. `admin.en`.
|
|
425
|
+
|
|
395
426
|
FLAGS
|
|
396
427
|
-m, --commit-message=<value> Use the given value as the commit message
|
|
397
|
-
--all
|
|
428
|
+
--all Whether to push all translations from the target directory.
|
|
398
429
|
--commit Push and commit the translation(s) at the same time
|
|
399
430
|
--environment=<option> [default: development] Pushing a translation is only allowed in the development
|
|
400
431
|
environment
|
|
401
432
|
<options: development>
|
|
402
|
-
--service-token=<value> (required) The service token to authenticate with
|
|
403
|
-
--translations-dir=<value>
|
|
433
|
+
--service-token=<value> (required) The service token to authenticate with.
|
|
434
|
+
--translations-dir=<value> The target directory path to find all translations to push.
|
|
404
435
|
```
|
|
405
436
|
|
|
406
437
|
## `knock translation validate [TRANSLATIONREF]`
|
|
407
438
|
|
|
439
|
+
Validate one or more translations from a local file system.
|
|
440
|
+
|
|
408
441
|
```
|
|
409
442
|
USAGE
|
|
410
443
|
$ knock translation validate [TRANSLATIONREF] --service-token <value> [--environment development] [--translations-dir
|
|
411
444
|
<value> --all]
|
|
412
445
|
|
|
446
|
+
ARGUMENTS
|
|
447
|
+
TRANSLATIONREF Translation ref is a identifier string that refers to a unique translation.
|
|
448
|
+
If a translation has no namespace, it is the same as the locale, e.g. `en`.
|
|
449
|
+
If namespaced, it is formatted as namespace.locale, e.g. `admin.en`.
|
|
450
|
+
|
|
413
451
|
FLAGS
|
|
414
|
-
--all
|
|
415
|
-
--environment=<option> [default: development] Validating a
|
|
452
|
+
--all Whether to validate all translations from the target directory.
|
|
453
|
+
--environment=<option> [default: development] Validating a translation is only done in the development
|
|
454
|
+
environment
|
|
416
455
|
<options: development>
|
|
417
|
-
--service-token=<value> (required) The service token to authenticate with
|
|
418
|
-
--translations-dir=<value>
|
|
456
|
+
--service-token=<value> (required) The service token to authenticate with.
|
|
457
|
+
--translations-dir=<value> The target directory path to find all translations to validate.
|
|
419
458
|
```
|
|
420
459
|
|
|
421
460
|
## `knock whoami`
|
|
422
461
|
|
|
462
|
+
Verify the provided service token.
|
|
463
|
+
|
|
423
464
|
```
|
|
424
465
|
USAGE
|
|
425
466
|
$ knock whoami --service-token <value> [--json]
|
|
426
467
|
|
|
427
468
|
FLAGS
|
|
428
|
-
--service-token=<value> (required) The service token to authenticate with
|
|
469
|
+
--service-token=<value> (required) The service token to authenticate with.
|
|
429
470
|
|
|
430
471
|
GLOBAL FLAGS
|
|
431
472
|
--json Format output as json.
|
|
432
473
|
```
|
|
433
474
|
|
|
434
|
-
_See code: [dist/commands/whoami.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.
|
|
475
|
+
_See code: [dist/commands/whoami.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.4/dist/commands/whoami.ts)_
|
|
435
476
|
|
|
436
477
|
## `knock workflow activate WORKFLOWKEY`
|
|
437
478
|
|
|
479
|
+
Activate or deactivate a workflow in a given environment.
|
|
480
|
+
|
|
438
481
|
```
|
|
439
482
|
USAGE
|
|
440
483
|
$ knock workflow activate WORKFLOWKEY --service-token <value> --environment <value> [--status true|false] [--force]
|
|
441
484
|
|
|
442
485
|
FLAGS
|
|
443
|
-
--environment=<value> (required)
|
|
444
|
-
--force
|
|
445
|
-
--service-token=<value> (required) The service token to authenticate with
|
|
446
|
-
--status=<option> [default: true]
|
|
486
|
+
--environment=<value> (required) The environment to use.
|
|
487
|
+
--force Remove the confirmation prompt.
|
|
488
|
+
--service-token=<value> (required) The service token to authenticate with.
|
|
489
|
+
--status=<option> [default: true] The workflow active status to set.
|
|
447
490
|
<options: true|false>
|
|
491
|
+
|
|
492
|
+
DESCRIPTION
|
|
493
|
+
Activate or deactivate a workflow in a given environment.
|
|
494
|
+
|
|
495
|
+
This immediately enables or disables a workflow in a given environment without
|
|
496
|
+
needing to go through environment promotion.
|
|
497
|
+
|
|
498
|
+
By default, this command activates a given workflow. Pass in the --status flag
|
|
499
|
+
with `false` in order to deactivate it.
|
|
448
500
|
```
|
|
449
501
|
|
|
450
502
|
## `knock workflow get WORKFLOWKEY`
|
|
451
503
|
|
|
504
|
+
Display a single workflow from an environment.
|
|
505
|
+
|
|
452
506
|
```
|
|
453
507
|
USAGE
|
|
454
508
|
$ knock workflow get WORKFLOWKEY --service-token <value> [--environment <value>] [--hide-uncommitted-changes]
|
|
455
509
|
[--json]
|
|
456
510
|
|
|
457
511
|
FLAGS
|
|
458
|
-
--environment=<value> [default: development]
|
|
459
|
-
--hide-uncommitted-changes
|
|
460
|
-
--service-token=<value> (required) The service token to authenticate with
|
|
512
|
+
--environment=<value> [default: development] The environment to use.
|
|
513
|
+
--hide-uncommitted-changes Hide any uncommitted changes.
|
|
514
|
+
--service-token=<value> (required) The service token to authenticate with.
|
|
461
515
|
|
|
462
516
|
GLOBAL FLAGS
|
|
463
517
|
--json Format output as json.
|
|
@@ -465,18 +519,20 @@ GLOBAL FLAGS
|
|
|
465
519
|
|
|
466
520
|
## `knock workflow list`
|
|
467
521
|
|
|
522
|
+
Display all workflows for an environment.
|
|
523
|
+
|
|
468
524
|
```
|
|
469
525
|
USAGE
|
|
470
526
|
$ knock workflow list --service-token <value> [--environment <value>] [--hide-uncommitted-changes] [--after
|
|
471
527
|
<value>] [--before <value>] [--limit <value>] [--json]
|
|
472
528
|
|
|
473
529
|
FLAGS
|
|
474
|
-
--after=<value>
|
|
475
|
-
--before=<value>
|
|
476
|
-
--environment=<value> [default: development]
|
|
477
|
-
--hide-uncommitted-changes
|
|
478
|
-
--limit=<value>
|
|
479
|
-
--service-token=<value> (required) The service token to authenticate with
|
|
530
|
+
--after=<value> The cursor after which to fetch the next page.
|
|
531
|
+
--before=<value> The cursor before which to fetch the previous page.
|
|
532
|
+
--environment=<value> [default: development] The environment to use.
|
|
533
|
+
--hide-uncommitted-changes Hide any uncommitted changes.
|
|
534
|
+
--limit=<value> The total number of entries to fetch per page.
|
|
535
|
+
--service-token=<value> (required) The service token to authenticate with.
|
|
480
536
|
|
|
481
537
|
GLOBAL FLAGS
|
|
482
538
|
--json Format output as json.
|
|
@@ -484,22 +540,26 @@ GLOBAL FLAGS
|
|
|
484
540
|
|
|
485
541
|
## `knock workflow pull [WORKFLOWKEY]`
|
|
486
542
|
|
|
543
|
+
Pull one or more workflows from an environment into a local file system.
|
|
544
|
+
|
|
487
545
|
```
|
|
488
546
|
USAGE
|
|
489
547
|
$ knock workflow pull [WORKFLOWKEY] --service-token <value> [--environment <value>] [--workflows-dir <value>
|
|
490
548
|
--all] [--hide-uncommitted-changes] [--force]
|
|
491
549
|
|
|
492
550
|
FLAGS
|
|
493
|
-
--all
|
|
494
|
-
--environment=<value> [default: development]
|
|
495
|
-
--force
|
|
496
|
-
--hide-uncommitted-changes
|
|
497
|
-
--service-token=<value> (required) The service token to authenticate with
|
|
498
|
-
--workflows-dir=<value>
|
|
551
|
+
--all Whether to pull all workflows from the specified environment.
|
|
552
|
+
--environment=<value> [default: development] The environment to use.
|
|
553
|
+
--force Remove the confirmation prompt.
|
|
554
|
+
--hide-uncommitted-changes Hide any uncommitted changes.
|
|
555
|
+
--service-token=<value> (required) The service token to authenticate with.
|
|
556
|
+
--workflows-dir=<value> The target directory path to pull all workflows into.
|
|
499
557
|
```
|
|
500
558
|
|
|
501
559
|
## `knock workflow push [WORKFLOWKEY]`
|
|
502
560
|
|
|
561
|
+
Push one or more workflows from a local file system to Knock.
|
|
562
|
+
|
|
503
563
|
```
|
|
504
564
|
USAGE
|
|
505
565
|
$ knock workflow push [WORKFLOWKEY] --service-token <value> [--environment development] [--workflows-dir <value>
|
|
@@ -507,26 +567,47 @@ USAGE
|
|
|
507
567
|
|
|
508
568
|
FLAGS
|
|
509
569
|
-m, --commit-message=<value> Use the given value as the commit message
|
|
510
|
-
--all
|
|
570
|
+
--all Whether to push all workflows from the target directory.
|
|
511
571
|
--commit Push and commit the workflow(s) at the same time
|
|
512
572
|
--environment=<option> [default: development] Pushing a workflow is only allowed in the development environment
|
|
513
573
|
<options: development>
|
|
514
|
-
--service-token=<value> (required) The service token to authenticate with
|
|
515
|
-
--workflows-dir=<value>
|
|
574
|
+
--service-token=<value> (required) The service token to authenticate with.
|
|
575
|
+
--workflows-dir=<value> The target directory path to find all workflows to push.
|
|
576
|
+
```
|
|
577
|
+
|
|
578
|
+
## `knock workflow run WORKFLOWKEY`
|
|
579
|
+
|
|
580
|
+
Test run a workflow using the latest version from Knock.
|
|
581
|
+
|
|
582
|
+
```
|
|
583
|
+
USAGE
|
|
584
|
+
$ knock workflow run WORKFLOWKEY --service-token <value> --recipients <value> [--environment <value>] [--actor
|
|
585
|
+
<value>] [--tenant <value>] [--data <value>]
|
|
586
|
+
|
|
587
|
+
FLAGS
|
|
588
|
+
--actor=<value> An actor id, or a JSON string of an actor object reference for the workflow run.
|
|
589
|
+
--data=<value> A JSON string of the data for this workflow
|
|
590
|
+
--environment=<value> [default: development] The environment in which to run the workflow
|
|
591
|
+
--recipients=<value> (required) One or more recipient user ids separated by comma, or a JSON string containing one
|
|
592
|
+
or more recipient object references for this workflow run.
|
|
593
|
+
--service-token=<value> (required) The service token to authenticate with.
|
|
594
|
+
--tenant=<value> A tenant id for the workflow run.
|
|
516
595
|
```
|
|
517
596
|
|
|
518
597
|
## `knock workflow validate [WORKFLOWKEY]`
|
|
519
598
|
|
|
599
|
+
Validate one or more workflows from a local file system.
|
|
600
|
+
|
|
520
601
|
```
|
|
521
602
|
USAGE
|
|
522
603
|
$ knock workflow validate [WORKFLOWKEY] --service-token <value> [--environment development] [--workflows-dir <value>
|
|
523
604
|
--all]
|
|
524
605
|
|
|
525
606
|
FLAGS
|
|
526
|
-
--all
|
|
607
|
+
--all Whether to validate all workflows from the target directory.
|
|
527
608
|
--environment=<option> [default: development] Validating a workflow is only done in the development environment
|
|
528
609
|
<options: development>
|
|
529
|
-
--service-token=<value> (required) The service token to authenticate with
|
|
530
|
-
--workflows-dir=<value>
|
|
610
|
+
--service-token=<value> (required) The service token to authenticate with.
|
|
611
|
+
--workflows-dir=<value> The target directory path to find all workflows to validate.
|
|
531
612
|
```
|
|
532
613
|
<!-- commandsstop -->
|
|
@@ -28,17 +28,20 @@ class Commit extends _baseCommand.default {
|
|
|
28
28
|
this.log(`‣ Successfully committed all changes in \`${flags.environment}\` environment`);
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
+
Commit.summary = "Commit all changes in development environment.";
|
|
31
32
|
Commit.flags = {
|
|
32
33
|
environment: _core.Flags.string({
|
|
33
|
-
summary: "Committing changes applies to the development environment only, use `commit promote` to promote changes to a
|
|
34
|
+
summary: "Committing changes applies to the development environment only, use `commit promote` to promote changes to a subsequent environment.",
|
|
34
35
|
default: _const.KnockEnv.Development,
|
|
35
36
|
options: [
|
|
36
37
|
_const.KnockEnv.Development
|
|
37
38
|
]
|
|
38
39
|
}),
|
|
39
40
|
"commit-message": _core.Flags.string({
|
|
40
|
-
summary: "Use the given value as the commit message",
|
|
41
|
+
summary: "Use the given value as the commit message.",
|
|
41
42
|
char: "m"
|
|
42
43
|
}),
|
|
43
|
-
force: _core.Flags.boolean(
|
|
44
|
+
force: _core.Flags.boolean({
|
|
45
|
+
summary: "Remove the confirmation prompt."
|
|
46
|
+
})
|
|
44
47
|
};
|
|
@@ -27,10 +27,13 @@ class CommitPromote extends _baseCommand.default {
|
|
|
27
27
|
this.log(`‣ Successfully promoted all changes to \`${flags.to}\` environment`);
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
+
CommitPromote.summary = "Promote all changes to the destination environment.";
|
|
30
31
|
CommitPromote.flags = {
|
|
31
32
|
to: _core.Flags.string({
|
|
32
|
-
summary: "The destination environment to promote changes from the preceding environment",
|
|
33
|
+
summary: "The destination environment to promote changes from the preceding environment.",
|
|
33
34
|
required: true
|
|
34
35
|
}),
|
|
35
|
-
force: _core.Flags.boolean(
|
|
36
|
+
force: _core.Flags.boolean({
|
|
37
|
+
summary: "Remove the confirmation prompt."
|
|
38
|
+
})
|
|
36
39
|
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>Knock
|
|
8
|
+
});
|
|
9
|
+
const _enquirer = /*#__PURE__*/ _interopRequireDefault(require("enquirer"));
|
|
10
|
+
const _baseCommand = /*#__PURE__*/ _interopRequireDefault(require("../lib/base-command"));
|
|
11
|
+
function _interopRequireDefault(obj) {
|
|
12
|
+
return obj && obj.__esModule ? obj : {
|
|
13
|
+
default: obj
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
const JOKES = [
|
|
17
|
+
[
|
|
18
|
+
"Boo.",
|
|
19
|
+
"Boo who?",
|
|
20
|
+
"Don't cry, it's just a joke!"
|
|
21
|
+
],
|
|
22
|
+
[
|
|
23
|
+
"Cows go.",
|
|
24
|
+
"Cows go who?",
|
|
25
|
+
"No silly, cows go moo!"
|
|
26
|
+
],
|
|
27
|
+
[
|
|
28
|
+
"Lettuce.",
|
|
29
|
+
"Lettuce who?",
|
|
30
|
+
"Lettuce in!"
|
|
31
|
+
],
|
|
32
|
+
[
|
|
33
|
+
"Interrupting cow.",
|
|
34
|
+
"Interrupting cow wh—",
|
|
35
|
+
"MOO!"
|
|
36
|
+
],
|
|
37
|
+
[
|
|
38
|
+
"Alpaca.",
|
|
39
|
+
"Alpaca who?",
|
|
40
|
+
"Alpaca the suitcase, let's go on vacation!"
|
|
41
|
+
],
|
|
42
|
+
[
|
|
43
|
+
"To.",
|
|
44
|
+
"To who?",
|
|
45
|
+
"It's to whom."
|
|
46
|
+
],
|
|
47
|
+
[
|
|
48
|
+
"HIPAA.",
|
|
49
|
+
"HIPAA who?",
|
|
50
|
+
"I'm sorry, I’m not authorized to release that information."
|
|
51
|
+
],
|
|
52
|
+
[
|
|
53
|
+
"Control freak.",
|
|
54
|
+
"Con–",
|
|
55
|
+
"Okay, now you say, 'Control freak who?'."
|
|
56
|
+
],
|
|
57
|
+
[
|
|
58
|
+
"Dejav.",
|
|
59
|
+
"Dejav who?",
|
|
60
|
+
"Knock, knock."
|
|
61
|
+
],
|
|
62
|
+
[
|
|
63
|
+
"Art.",
|
|
64
|
+
"Art who?",
|
|
65
|
+
"R2D2!"
|
|
66
|
+
],
|
|
67
|
+
[
|
|
68
|
+
"Spell.",
|
|
69
|
+
"Spell who?",
|
|
70
|
+
"W-h-o"
|
|
71
|
+
],
|
|
72
|
+
[
|
|
73
|
+
"Beets.",
|
|
74
|
+
"Beets who?",
|
|
75
|
+
"Beets me!"
|
|
76
|
+
]
|
|
77
|
+
];
|
|
78
|
+
class Knock extends _baseCommand.default {
|
|
79
|
+
async run() {
|
|
80
|
+
const promptOpts = {
|
|
81
|
+
type: "invisible",
|
|
82
|
+
name: "input"
|
|
83
|
+
};
|
|
84
|
+
await _enquirer.default.prompt({
|
|
85
|
+
...promptOpts,
|
|
86
|
+
message: "Who's there?"
|
|
87
|
+
});
|
|
88
|
+
const randomIndex = Math.floor(Math.random() * JOKES.length);
|
|
89
|
+
const lines = JOKES[randomIndex];
|
|
90
|
+
for (const line of lines){
|
|
91
|
+
// eslint-disable-next-line no-await-in-loop
|
|
92
|
+
await _enquirer.default.prompt({
|
|
93
|
+
...promptOpts,
|
|
94
|
+
message: line
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
this.log("");
|
|
98
|
+
this.log("Thank you for using Knock, and have a nice day! 🙂");
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
// Because, it's a secret :)
|
|
102
|
+
Knock.hidden = true;
|
package/dist/commands/ping.js
CHANGED
|
@@ -95,7 +95,7 @@ class TranslationGet extends _baseCommand.default {
|
|
|
95
95
|
value: (0, _date.formatDate)(translation.created_at)
|
|
96
96
|
}
|
|
97
97
|
];
|
|
98
|
-
_core.
|
|
98
|
+
_core.ux.table(rows, {
|
|
99
99
|
key: {
|
|
100
100
|
header: "Translation",
|
|
101
101
|
minWidth: 24
|
|
@@ -106,19 +106,23 @@ class TranslationGet extends _baseCommand.default {
|
|
|
106
106
|
}
|
|
107
107
|
});
|
|
108
108
|
this.log("");
|
|
109
|
-
_core.
|
|
109
|
+
_core.ux.styledJSON(JSON.parse(translation.content));
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
|
+
TranslationGet.summary = "Display a single translation from an environment.";
|
|
112
113
|
TranslationGet.flags = {
|
|
113
114
|
environment: _core.Flags.string({
|
|
114
|
-
default: "development"
|
|
115
|
+
default: "development",
|
|
116
|
+
summary: "The environment to use."
|
|
115
117
|
}),
|
|
116
|
-
"hide-uncommitted-changes": _core.Flags.boolean(
|
|
118
|
+
"hide-uncommitted-changes": _core.Flags.boolean({
|
|
119
|
+
summary: "Hide any uncommitted changes."
|
|
120
|
+
})
|
|
117
121
|
};
|
|
118
|
-
TranslationGet.args =
|
|
119
|
-
{
|
|
120
|
-
|
|
122
|
+
TranslationGet.args = {
|
|
123
|
+
translationRef: _core.Args.string({
|
|
124
|
+
description: _translation.translationRefDescription,
|
|
121
125
|
required: true
|
|
122
|
-
}
|
|
123
|
-
|
|
126
|
+
})
|
|
127
|
+
};
|
|
124
128
|
TranslationGet.enableJsonFlag = true;
|
|
@@ -79,7 +79,7 @@ class TranslationList extends _baseCommand.default {
|
|
|
79
79
|
this.log(`‣ Showing ${entries.length} translations in \`${env}\` environment ${qualifier}\n`);
|
|
80
80
|
/*
|
|
81
81
|
* Translations list table
|
|
82
|
-
*/ _core.
|
|
82
|
+
*/ _core.ux.table(entries, {
|
|
83
83
|
ref: {
|
|
84
84
|
header: "Ref",
|
|
85
85
|
get: (entry)=>_translation.formatRef(entry)
|
|
@@ -116,11 +116,15 @@ class TranslationList extends _baseCommand.default {
|
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
|
+
TranslationList.summary = "Display all translations for an environment.";
|
|
119
120
|
TranslationList.flags = {
|
|
120
121
|
environment: _core.Flags.string({
|
|
121
|
-
default: "development"
|
|
122
|
+
default: "development",
|
|
123
|
+
summary: "The environment to use."
|
|
124
|
+
}),
|
|
125
|
+
"hide-uncommitted-changes": _core.Flags.boolean({
|
|
126
|
+
summary: "Hide any uncommitted changes."
|
|
122
127
|
}),
|
|
123
|
-
"hide-uncommitted-changes": _core.Flags.boolean(),
|
|
124
128
|
..._page.pageFlags
|
|
125
129
|
};
|
|
126
130
|
TranslationList.enableJsonFlag = true;
|
|
@@ -145,22 +145,31 @@ class TranslationPull extends _baseCommand.default {
|
|
|
145
145
|
}, translations) : translations;
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
|
+
TranslationPull.summary = "Pull one or more translations from an environment into a local file system.";
|
|
148
149
|
TranslationPull.flags = {
|
|
149
150
|
environment: _core.Flags.string({
|
|
150
|
-
default: "development"
|
|
151
|
+
default: "development",
|
|
152
|
+
summary: "The environment to use."
|
|
153
|
+
}),
|
|
154
|
+
all: _core.Flags.boolean({
|
|
155
|
+
summary: "Whether to pull all translations from the specified environment."
|
|
151
156
|
}),
|
|
152
|
-
all: _core.Flags.boolean(),
|
|
153
157
|
"translations-dir": _flag.dirPath({
|
|
158
|
+
summary: "The target directory path to pull all translations into.",
|
|
154
159
|
dependsOn: [
|
|
155
160
|
"all"
|
|
156
161
|
]
|
|
157
162
|
}),
|
|
158
|
-
"hide-uncommitted-changes": _core.Flags.boolean(
|
|
159
|
-
|
|
163
|
+
"hide-uncommitted-changes": _core.Flags.boolean({
|
|
164
|
+
summary: "Hide any uncommitted changes."
|
|
165
|
+
}),
|
|
166
|
+
force: _core.Flags.boolean({
|
|
167
|
+
summary: "Remove the confirmation prompt."
|
|
168
|
+
})
|
|
160
169
|
};
|
|
161
|
-
TranslationPull.args =
|
|
162
|
-
{
|
|
163
|
-
|
|
170
|
+
TranslationPull.args = {
|
|
171
|
+
translationRef: _core.Args.string({
|
|
172
|
+
description: _translation.translationRefDescription,
|
|
164
173
|
required: false
|
|
165
|
-
}
|
|
166
|
-
|
|
174
|
+
})
|
|
175
|
+
};
|