@knocklabs/cli 0.2.0 → 0.2.2

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.
Files changed (64) hide show
  1. package/README.md +258 -36
  2. package/dist/commands/branch/create.js +56 -0
  3. package/dist/commands/branch/delete.js +60 -0
  4. package/dist/commands/branch/list.js +89 -0
  5. package/dist/commands/commit/get.js +4 -4
  6. package/dist/commands/commit/index.js +47 -2
  7. package/dist/commands/commit/list.js +61 -13
  8. package/dist/commands/guide/activate.js +48 -4
  9. package/dist/commands/guide/generate-types.js +4 -1
  10. package/dist/commands/guide/get.js +46 -3
  11. package/dist/commands/guide/list.js +46 -3
  12. package/dist/commands/guide/pull.js +6 -4
  13. package/dist/commands/guide/push.js +4 -3
  14. package/dist/commands/guide/validate.js +4 -3
  15. package/dist/commands/layout/get.js +46 -1
  16. package/dist/commands/layout/list.js +46 -1
  17. package/dist/commands/layout/pull.js +6 -2
  18. package/dist/commands/layout/push.js +4 -1
  19. package/dist/commands/layout/validate.js +4 -1
  20. package/dist/commands/login.js +1 -0
  21. package/dist/commands/logout.js +1 -0
  22. package/dist/commands/message-type/get.js +46 -3
  23. package/dist/commands/message-type/list.js +46 -3
  24. package/dist/commands/message-type/pull.js +6 -4
  25. package/dist/commands/message-type/push.js +4 -3
  26. package/dist/commands/message-type/validate.js +4 -3
  27. package/dist/commands/partial/get.js +46 -1
  28. package/dist/commands/partial/list.js +46 -1
  29. package/dist/commands/partial/pull.js +6 -2
  30. package/dist/commands/partial/push.js +4 -1
  31. package/dist/commands/partial/validate.js +6 -1
  32. package/dist/commands/pull.js +28 -8
  33. package/dist/commands/push.js +27 -8
  34. package/dist/commands/translation/get.js +5 -1
  35. package/dist/commands/translation/list.js +5 -1
  36. package/dist/commands/translation/pull.js +8 -3
  37. package/dist/commands/translation/push.js +4 -1
  38. package/dist/commands/translation/validate.js +4 -1
  39. package/dist/commands/whoami.js +7 -8
  40. package/dist/commands/workflow/activate.js +47 -3
  41. package/dist/commands/workflow/generate-types.js +4 -1
  42. package/dist/commands/workflow/get.js +9 -4
  43. package/dist/commands/workflow/list.js +5 -1
  44. package/dist/commands/workflow/pull.js +6 -2
  45. package/dist/commands/workflow/push.js +4 -1
  46. package/dist/commands/workflow/run.js +46 -2
  47. package/dist/commands/workflow/validate.js +4 -1
  48. package/dist/lib/api-v1.js +57 -20
  49. package/dist/lib/helpers/arg.js +24 -0
  50. package/dist/lib/helpers/command.js +14 -0
  51. package/dist/lib/helpers/flag.js +18 -0
  52. package/dist/lib/helpers/request.js +48 -2
  53. package/dist/lib/helpers/string.js +4 -0
  54. package/dist/lib/marshal/commit/index.js +0 -1
  55. package/dist/lib/marshal/index.isomorphic.js +8 -4
  56. package/dist/lib/marshal/reusable-step/helpers.js +72 -0
  57. package/dist/lib/marshal/reusable-step/index.js +19 -0
  58. package/dist/lib/marshal/reusable-step/processor.isomorphic.js +86 -0
  59. package/dist/lib/marshal/{commit → reusable-step}/types.js +0 -1
  60. package/dist/lib/resources.js +6 -1
  61. package/dist/lib/urls.js +4 -0
  62. package/oclif.manifest.json +489 -50
  63. package/package.json +16 -5
  64. package/dist/commands/ping.js +0 -37
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.2.0 linux-x64 node-v18.20.8
19
+ @knocklabs/cli/0.2.2 linux-x64 node-v18.20.8
20
20
  $ knock --help [COMMAND]
21
21
  USAGE
22
22
  $ knock COMMAND
@@ -33,6 +33,11 @@ USAGE
33
33
  * [`knock commit promote`](#knock-commit-promote)
34
34
  * [`knock guide activate GUIDEKEY`](#knock-guide-activate-guidekey)
35
35
  * [`knock guide generate-types`](#knock-guide-generate-types)
36
+ * [`knock guide get GUIDEKEY`](#knock-guide-get-guidekey)
37
+ * [`knock guide list`](#knock-guide-list)
38
+ * [`knock guide pull [GUIDEKEY]`](#knock-guide-pull-guidekey)
39
+ * [`knock guide push [GUIDEKEY]`](#knock-guide-push-guidekey)
40
+ * [`knock guide validate [GUIDEKEY]`](#knock-guide-validate-guidekey)
36
41
  * [`knock help [COMMAND]`](#knock-help-command)
37
42
  * [`knock layout get EMAILLAYOUTKEY`](#knock-layout-get-emaillayoutkey)
38
43
  * [`knock layout list`](#knock-layout-list)
@@ -41,6 +46,11 @@ USAGE
41
46
  * [`knock layout validate [EMAILLAYOUTKEY]`](#knock-layout-validate-emaillayoutkey)
42
47
  * [`knock login`](#knock-login)
43
48
  * [`knock logout`](#knock-logout)
49
+ * [`knock message-type get MESSAGETYPEKEY`](#knock-message-type-get-messagetypekey)
50
+ * [`knock message-type list`](#knock-message-type-list)
51
+ * [`knock message-type pull [MESSAGETYPEKEY]`](#knock-message-type-pull-messagetypekey)
52
+ * [`knock message-type push [MESSAGETYPEKEY]`](#knock-message-type-push-messagetypekey)
53
+ * [`knock message-type validate [MESSAGETYPEKEY]`](#knock-message-type-validate-messagetypekey)
44
54
  * [`knock partial get PARTIALKEY`](#knock-partial-get-partialkey)
45
55
  * [`knock partial list`](#knock-partial-list)
46
56
  * [`knock partial pull [PARTIALKEY]`](#knock-partial-pull-partialkey)
@@ -80,7 +90,7 @@ FLAGS
80
90
  --service-token=<value> The service token to authenticate with.
81
91
  ```
82
92
 
83
- _See code: [src/commands/commit/index.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.0/src/commands/commit/index.ts)_
93
+ _See code: [src/commands/commit/index.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/commit/index.ts)_
84
94
 
85
95
  ## `knock commit get ID`
86
96
 
@@ -97,7 +107,7 @@ GLOBAL FLAGS
97
107
  --json Format output as json.
98
108
  ```
99
109
 
100
- _See code: [src/commands/commit/get.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.0/src/commands/commit/get.ts)_
110
+ _See code: [src/commands/commit/get.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/commit/get.ts)_
101
111
 
102
112
  ## `knock commit list`
103
113
 
@@ -127,7 +137,7 @@ GLOBAL FLAGS
127
137
  --json Format output as json.
128
138
  ```
129
139
 
130
- _See code: [src/commands/commit/list.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.0/src/commands/commit/list.ts)_
140
+ _See code: [src/commands/commit/list.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/commit/list.ts)_
131
141
 
132
142
  ## `knock commit promote`
133
143
 
@@ -144,7 +154,7 @@ FLAGS
144
154
  --to=<value> The destination environment to promote all changes from the preceding environment.
145
155
  ```
146
156
 
147
- _See code: [src/commands/commit/promote.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.0/src/commands/commit/promote.ts)_
157
+ _See code: [src/commands/commit/promote.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/commit/promote.ts)_
148
158
 
149
159
  ## `knock guide activate GUIDEKEY`
150
160
 
@@ -174,7 +184,7 @@ DESCRIPTION
174
184
  or deactivated at a later time using the --from and --until flags.
175
185
  ```
176
186
 
177
- _See code: [src/commands/guide/activate.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.0/src/commands/guide/activate.ts)_
187
+ _See code: [src/commands/guide/activate.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/guide/activate.ts)_
178
188
 
179
189
  ## `knock guide generate-types`
180
190
 
@@ -195,7 +205,110 @@ DESCRIPTION
195
205
  Generate types for all guides in an environment and write them to a file.
196
206
  ```
197
207
 
198
- _See code: [src/commands/guide/generate-types.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.0/src/commands/guide/generate-types.ts)_
208
+ _See code: [src/commands/guide/generate-types.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/guide/generate-types.ts)_
209
+
210
+ ## `knock guide get GUIDEKEY`
211
+
212
+ Display a single guide from an environment.
213
+
214
+ ```
215
+ USAGE
216
+ $ knock guide get GUIDEKEY [--json] [--service-token <value>] [--environment <value>]
217
+ [--hide-uncommitted-changes]
218
+
219
+ FLAGS
220
+ --environment=<value> [default: development] The environment to use.
221
+ --hide-uncommitted-changes Hide any uncommitted changes.
222
+ --service-token=<value> The service token to authenticate with.
223
+
224
+ GLOBAL FLAGS
225
+ --json Format output as json.
226
+ ```
227
+
228
+ _See code: [src/commands/guide/get.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/guide/get.ts)_
229
+
230
+ ## `knock guide list`
231
+
232
+ Display all guides for an environment.
233
+
234
+ ```
235
+ USAGE
236
+ $ knock guide list [--json] [--service-token <value>] [--environment <value>] [--hide-uncommitted-changes]
237
+ [--after <value>] [--before <value>] [--limit <value>]
238
+
239
+ FLAGS
240
+ --after=<value> The cursor after which to fetch the next page.
241
+ --before=<value> The cursor before which to fetch the previous page.
242
+ --environment=<value> [default: development] The environment to use.
243
+ --hide-uncommitted-changes Hide any uncommitted changes.
244
+ --limit=<value> The total number of entries to fetch per page.
245
+ --service-token=<value> The service token to authenticate with.
246
+
247
+ GLOBAL FLAGS
248
+ --json Format output as json.
249
+ ```
250
+
251
+ _See code: [src/commands/guide/list.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/guide/list.ts)_
252
+
253
+ ## `knock guide pull [GUIDEKEY]`
254
+
255
+ Pull one or more guides from an environment into a local file system.
256
+
257
+ ```
258
+ USAGE
259
+ $ knock guide pull [GUIDEKEY] [--service-token <value>] [--environment <value>] [--guides-dir <value> --all]
260
+ [--hide-uncommitted-changes] [--force]
261
+
262
+ FLAGS
263
+ --all Whether to pull all guides from the specified environment.
264
+ --environment=<value> [default: development] The environment to use.
265
+ --force Remove the confirmation prompt.
266
+ --guides-dir=<value> The target directory path to pull all guides into.
267
+ --hide-uncommitted-changes Hide any uncommitted changes.
268
+ --service-token=<value> The service token to authenticate with.
269
+ ```
270
+
271
+ _See code: [src/commands/guide/pull.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/guide/pull.ts)_
272
+
273
+ ## `knock guide push [GUIDEKEY]`
274
+
275
+ Push one or more guides from a local file system to Knock.
276
+
277
+ ```
278
+ USAGE
279
+ $ knock guide push [GUIDEKEY] [--service-token <value>] [--environment development] [--guides-dir <value>
280
+ --all] [-m <value> --commit]
281
+
282
+ FLAGS
283
+ -m, --commit-message=<value> Use the given value as the commit message
284
+ --all Whether to push all guides from the target directory.
285
+ --commit Push and commit the guide(s) at the same time
286
+ --environment=<option> [default: development] Pushing a guide is only allowed in the development environment
287
+ <options: development>
288
+ --guides-dir=<value> The target directory path to find all guides to push.
289
+ --service-token=<value> The service token to authenticate with.
290
+ ```
291
+
292
+ _See code: [src/commands/guide/push.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/guide/push.ts)_
293
+
294
+ ## `knock guide validate [GUIDEKEY]`
295
+
296
+ Validate one or more guides from a local file system.
297
+
298
+ ```
299
+ USAGE
300
+ $ knock guide validate [GUIDEKEY] [--service-token <value>] [--environment development] [--guides-dir <value>
301
+ --all]
302
+
303
+ FLAGS
304
+ --all Whether to validate all guides from the target directory.
305
+ --environment=<option> [default: development] Validating a guide is only done in the development environment
306
+ <options: development>
307
+ --guides-dir=<value> The target directory path to find all guides to validate.
308
+ --service-token=<value> The service token to authenticate with.
309
+ ```
310
+
311
+ _See code: [src/commands/guide/validate.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/guide/validate.ts)_
199
312
 
200
313
  ## `knock help [COMMAND]`
201
314
 
@@ -215,7 +328,7 @@ DESCRIPTION
215
328
  Display help for knock.
216
329
  ```
217
330
 
218
- _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.32/src/commands/help.ts)_
331
+ _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.33/src/commands/help.ts)_
219
332
 
220
333
  ## `knock layout get EMAILLAYOUTKEY`
221
334
 
@@ -235,7 +348,7 @@ GLOBAL FLAGS
235
348
  --json Format output as json.
236
349
  ```
237
350
 
238
- _See code: [src/commands/layout/get.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.0/src/commands/layout/get.ts)_
351
+ _See code: [src/commands/layout/get.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/layout/get.ts)_
239
352
 
240
353
  ## `knock layout list`
241
354
 
@@ -258,7 +371,7 @@ GLOBAL FLAGS
258
371
  --json Format output as json.
259
372
  ```
260
373
 
261
- _See code: [src/commands/layout/list.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.0/src/commands/layout/list.ts)_
374
+ _See code: [src/commands/layout/list.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/layout/list.ts)_
262
375
 
263
376
  ## `knock layout pull [EMAILLAYOUTKEY]`
264
377
 
@@ -278,7 +391,7 @@ FLAGS
278
391
  --service-token=<value> The service token to authenticate with.
279
392
  ```
280
393
 
281
- _See code: [src/commands/layout/pull.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.0/src/commands/layout/pull.ts)_
394
+ _See code: [src/commands/layout/pull.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/layout/pull.ts)_
282
395
 
283
396
  ## `knock layout push [EMAILLAYOUTKEY]`
284
397
 
@@ -300,7 +413,7 @@ FLAGS
300
413
  --service-token=<value> The service token to authenticate with.
301
414
  ```
302
415
 
303
- _See code: [src/commands/layout/push.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.0/src/commands/layout/push.ts)_
416
+ _See code: [src/commands/layout/push.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/layout/push.ts)_
304
417
 
305
418
  ## `knock layout validate [EMAILLAYOUTKEY]`
306
419
 
@@ -319,10 +432,12 @@ FLAGS
319
432
  --service-token=<value> The service token to authenticate with.
320
433
  ```
321
434
 
322
- _See code: [src/commands/layout/validate.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.0/src/commands/layout/validate.ts)_
435
+ _See code: [src/commands/layout/validate.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/layout/validate.ts)_
323
436
 
324
437
  ## `knock login`
325
438
 
439
+ Log in with a Knock user account.
440
+
326
441
  ```
327
442
  USAGE
328
443
  $ knock login [--service-token <value>]
@@ -331,10 +446,12 @@ FLAGS
331
446
  --service-token=<value> The service token to authenticate with.
332
447
  ```
333
448
 
334
- _See code: [src/commands/login.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.0/src/commands/login.ts)_
449
+ _See code: [src/commands/login.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/login.ts)_
335
450
 
336
451
  ## `knock logout`
337
452
 
453
+ Log out of a Knock user account.
454
+
338
455
  ```
339
456
  USAGE
340
457
  $ knock logout [--service-token <value>]
@@ -343,7 +460,112 @@ FLAGS
343
460
  --service-token=<value> The service token to authenticate with.
344
461
  ```
345
462
 
346
- _See code: [src/commands/logout.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.0/src/commands/logout.ts)_
463
+ _See code: [src/commands/logout.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/logout.ts)_
464
+
465
+ ## `knock message-type get MESSAGETYPEKEY`
466
+
467
+ Display a single in-app message type from an environment.
468
+
469
+ ```
470
+ USAGE
471
+ $ knock message-type get MESSAGETYPEKEY [--json] [--service-token <value>] [--environment <value>]
472
+ [--hide-uncommitted-changes]
473
+
474
+ FLAGS
475
+ --environment=<value> [default: development] The environment to use.
476
+ --hide-uncommitted-changes Hide any uncommitted changes.
477
+ --service-token=<value> The service token to authenticate with.
478
+
479
+ GLOBAL FLAGS
480
+ --json Format output as json.
481
+ ```
482
+
483
+ _See code: [src/commands/message-type/get.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/message-type/get.ts)_
484
+
485
+ ## `knock message-type list`
486
+
487
+ Display all in-app message types for an environment.
488
+
489
+ ```
490
+ USAGE
491
+ $ knock message-type list [--json] [--service-token <value>] [--environment <value>] [--hide-uncommitted-changes]
492
+ [--after <value>] [--before <value>] [--limit <value>]
493
+
494
+ FLAGS
495
+ --after=<value> The cursor after which to fetch the next page.
496
+ --before=<value> The cursor before which to fetch the previous page.
497
+ --environment=<value> [default: development] The environment to use.
498
+ --hide-uncommitted-changes Hide any uncommitted changes.
499
+ --limit=<value> The total number of entries to fetch per page.
500
+ --service-token=<value> The service token to authenticate with.
501
+
502
+ GLOBAL FLAGS
503
+ --json Format output as json.
504
+ ```
505
+
506
+ _See code: [src/commands/message-type/list.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/message-type/list.ts)_
507
+
508
+ ## `knock message-type pull [MESSAGETYPEKEY]`
509
+
510
+ Pull one or more in-app message types from an environment into a local file system.
511
+
512
+ ```
513
+ USAGE
514
+ $ knock message-type pull [MESSAGETYPEKEY] [--service-token <value>] [--environment <value>] [--message-types-dir
515
+ <value> --all] [--hide-uncommitted-changes] [--force]
516
+
517
+ FLAGS
518
+ --all Whether to pull all in-app message types from the specified environment.
519
+ --environment=<value> [default: development] The environment to use.
520
+ --force Remove the confirmation prompt.
521
+ --hide-uncommitted-changes Hide any uncommitted changes.
522
+ --message-types-dir=<value> The target directory path to pull all in-app message types into.
523
+ --service-token=<value> The service token to authenticate with.
524
+ ```
525
+
526
+ _See code: [src/commands/message-type/pull.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/message-type/pull.ts)_
527
+
528
+ ## `knock message-type push [MESSAGETYPEKEY]`
529
+
530
+ Push one or more message types from a local file system to Knock.
531
+
532
+ ```
533
+ USAGE
534
+ $ knock message-type push [MESSAGETYPEKEY] [--service-token <value>] [--environment development] [--message-types-dir
535
+ <value> --all] [-m <value> --commit]
536
+
537
+ FLAGS
538
+ -m, --commit-message=<value> Use the given value as the commit message
539
+ --all Whether to push all message types from the target directory.
540
+ --commit Push and commit the message type(s) at the same time
541
+ --environment=<option> [default: development] Pushing a message type is only allowed in the development
542
+ environment
543
+ <options: development>
544
+ --message-types-dir=<value> The target directory path to find all message types to push.
545
+ --service-token=<value> The service token to authenticate with.
546
+ ```
547
+
548
+ _See code: [src/commands/message-type/push.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/message-type/push.ts)_
549
+
550
+ ## `knock message-type validate [MESSAGETYPEKEY]`
551
+
552
+ Validate one or more message types from a local file system.
553
+
554
+ ```
555
+ USAGE
556
+ $ knock message-type validate [MESSAGETYPEKEY] [--service-token <value>] [--environment development] [--message-types-dir
557
+ <value> --all]
558
+
559
+ FLAGS
560
+ --all Whether to validate all message types from the target directory.
561
+ --environment=<option> [default: development] Validating a message type is only done in the development
562
+ environment
563
+ <options: development>
564
+ --message-types-dir=<value> The target directory path to find all message types to validate.
565
+ --service-token=<value> The service token to authenticate with.
566
+ ```
567
+
568
+ _See code: [src/commands/message-type/validate.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/message-type/validate.ts)_
347
569
 
348
570
  ## `knock partial get PARTIALKEY`
349
571
 
@@ -363,7 +585,7 @@ GLOBAL FLAGS
363
585
  --json Format output as json.
364
586
  ```
365
587
 
366
- _See code: [src/commands/partial/get.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.0/src/commands/partial/get.ts)_
588
+ _See code: [src/commands/partial/get.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/partial/get.ts)_
367
589
 
368
590
  ## `knock partial list`
369
591
 
@@ -386,7 +608,7 @@ GLOBAL FLAGS
386
608
  --json Format output as json.
387
609
  ```
388
610
 
389
- _See code: [src/commands/partial/list.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.0/src/commands/partial/list.ts)_
611
+ _See code: [src/commands/partial/list.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/partial/list.ts)_
390
612
 
391
613
  ## `knock partial pull [PARTIALKEY]`
392
614
 
@@ -406,7 +628,7 @@ FLAGS
406
628
  --service-token=<value> The service token to authenticate with.
407
629
  ```
408
630
 
409
- _See code: [src/commands/partial/pull.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.0/src/commands/partial/pull.ts)_
631
+ _See code: [src/commands/partial/pull.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/partial/pull.ts)_
410
632
 
411
633
  ## `knock partial push [PARTIALKEY]`
412
634
 
@@ -427,7 +649,7 @@ FLAGS
427
649
  --service-token=<value> The service token to authenticate with.
428
650
  ```
429
651
 
430
- _See code: [src/commands/partial/push.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.0/src/commands/partial/push.ts)_
652
+ _See code: [src/commands/partial/push.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/partial/push.ts)_
431
653
 
432
654
  ## `knock partial validate [PARTIALKEY]`
433
655
 
@@ -446,7 +668,7 @@ FLAGS
446
668
  --service-token=<value> The service token to authenticate with.
447
669
  ```
448
670
 
449
- _See code: [src/commands/partial/validate.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.0/src/commands/partial/validate.ts)_
671
+ _See code: [src/commands/partial/validate.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/partial/validate.ts)_
450
672
 
451
673
  ## `knock pull`
452
674
 
@@ -465,7 +687,7 @@ FLAGS
465
687
  --service-token=<value> The service token to authenticate with.
466
688
  ```
467
689
 
468
- _See code: [src/commands/pull.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.0/src/commands/pull.ts)_
690
+ _See code: [src/commands/pull.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/pull.ts)_
469
691
 
470
692
  ## `knock push`
471
693
 
@@ -485,7 +707,7 @@ FLAGS
485
707
  --service-token=<value> The service token to authenticate with.
486
708
  ```
487
709
 
488
- _See code: [src/commands/push.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.0/src/commands/push.ts)_
710
+ _See code: [src/commands/push.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/push.ts)_
489
711
 
490
712
  ## `knock translation get TRANSLATIONREF`
491
713
 
@@ -512,7 +734,7 @@ GLOBAL FLAGS
512
734
  --json Format output as json.
513
735
  ```
514
736
 
515
- _See code: [src/commands/translation/get.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.0/src/commands/translation/get.ts)_
737
+ _See code: [src/commands/translation/get.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/translation/get.ts)_
516
738
 
517
739
  ## `knock translation list`
518
740
 
@@ -535,7 +757,7 @@ GLOBAL FLAGS
535
757
  --json Format output as json.
536
758
  ```
537
759
 
538
- _See code: [src/commands/translation/list.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.0/src/commands/translation/list.ts)_
760
+ _See code: [src/commands/translation/list.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/translation/list.ts)_
539
761
 
540
762
  ## `knock translation pull [TRANSLATIONREF]`
541
763
 
@@ -562,7 +784,7 @@ FLAGS
562
784
  --translations-dir=<value> The target directory path to pull all translations into.
563
785
  ```
564
786
 
565
- _See code: [src/commands/translation/pull.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.0/src/commands/translation/pull.ts)_
787
+ _See code: [src/commands/translation/pull.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/translation/pull.ts)_
566
788
 
567
789
  ## `knock translation push [TRANSLATIONREF]`
568
790
 
@@ -589,7 +811,7 @@ FLAGS
589
811
  --translations-dir=<value> The target directory path to find all translations to push.
590
812
  ```
591
813
 
592
- _See code: [src/commands/translation/push.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.0/src/commands/translation/push.ts)_
814
+ _See code: [src/commands/translation/push.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/translation/push.ts)_
593
815
 
594
816
  ## `knock translation validate [TRANSLATIONREF]`
595
817
 
@@ -614,7 +836,7 @@ FLAGS
614
836
  --translations-dir=<value> The target directory path to find all translations to validate.
615
837
  ```
616
838
 
617
- _See code: [src/commands/translation/validate.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.0/src/commands/translation/validate.ts)_
839
+ _See code: [src/commands/translation/validate.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/translation/validate.ts)_
618
840
 
619
841
  ## `knock whoami`
620
842
 
@@ -631,7 +853,7 @@ GLOBAL FLAGS
631
853
  --json Format output as json.
632
854
  ```
633
855
 
634
- _See code: [src/commands/whoami.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.0/src/commands/whoami.ts)_
856
+ _See code: [src/commands/whoami.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/whoami.ts)_
635
857
 
636
858
  ## `knock workflow activate WORKFLOWKEY`
637
859
 
@@ -658,7 +880,7 @@ DESCRIPTION
658
880
  with `false` in order to deactivate it.
659
881
  ```
660
882
 
661
- _See code: [src/commands/workflow/activate.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.0/src/commands/workflow/activate.ts)_
883
+ _See code: [src/commands/workflow/activate.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/workflow/activate.ts)_
662
884
 
663
885
  ## `knock workflow generate-types`
664
886
 
@@ -679,7 +901,7 @@ DESCRIPTION
679
901
  Generate types for all workflows in an environment and write them to a file.
680
902
  ```
681
903
 
682
- _See code: [src/commands/workflow/generate-types.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.0/src/commands/workflow/generate-types.ts)_
904
+ _See code: [src/commands/workflow/generate-types.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/workflow/generate-types.ts)_
683
905
 
684
906
  ## `knock workflow get WORKFLOWKEY`
685
907
 
@@ -699,7 +921,7 @@ GLOBAL FLAGS
699
921
  --json Format output as json.
700
922
  ```
701
923
 
702
- _See code: [src/commands/workflow/get.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.0/src/commands/workflow/get.ts)_
924
+ _See code: [src/commands/workflow/get.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/workflow/get.ts)_
703
925
 
704
926
  ## `knock workflow list`
705
927
 
@@ -722,7 +944,7 @@ GLOBAL FLAGS
722
944
  --json Format output as json.
723
945
  ```
724
946
 
725
- _See code: [src/commands/workflow/list.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.0/src/commands/workflow/list.ts)_
947
+ _See code: [src/commands/workflow/list.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/workflow/list.ts)_
726
948
 
727
949
  ## `knock workflow pull [WORKFLOWKEY]`
728
950
 
@@ -742,7 +964,7 @@ FLAGS
742
964
  --workflows-dir=<value> The target directory path to pull all workflows into.
743
965
  ```
744
966
 
745
- _See code: [src/commands/workflow/pull.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.0/src/commands/workflow/pull.ts)_
967
+ _See code: [src/commands/workflow/pull.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/workflow/pull.ts)_
746
968
 
747
969
  ## `knock workflow push [WORKFLOWKEY]`
748
970
 
@@ -763,7 +985,7 @@ FLAGS
763
985
  --workflows-dir=<value> The target directory path to find all workflows to push.
764
986
  ```
765
987
 
766
- _See code: [src/commands/workflow/push.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.0/src/commands/workflow/push.ts)_
988
+ _See code: [src/commands/workflow/push.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/workflow/push.ts)_
767
989
 
768
990
  ## `knock workflow run WORKFLOWKEY`
769
991
 
@@ -784,7 +1006,7 @@ FLAGS
784
1006
  --tenant=<value> A tenant id for the workflow run.
785
1007
  ```
786
1008
 
787
- _See code: [src/commands/workflow/run.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.0/src/commands/workflow/run.ts)_
1009
+ _See code: [src/commands/workflow/run.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/workflow/run.ts)_
788
1010
 
789
1011
  ## `knock workflow validate [WORKFLOWKEY]`
790
1012
 
@@ -803,5 +1025,5 @@ FLAGS
803
1025
  --workflows-dir=<value> The target directory path to find all workflows to validate.
804
1026
  ```
805
1027
 
806
- _See code: [src/commands/workflow/validate.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.0/src/commands/workflow/validate.ts)_
1028
+ _See code: [src/commands/workflow/validate.ts](https://github.com/knocklabs/knock-cli/blob/v0.2.2/src/commands/workflow/validate.ts)_
807
1029
  <!-- commandsstop -->
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "default", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return BranchCreate;
9
+ }
10
+ });
11
+ const _basecommand = /*#__PURE__*/ _interop_require_default(require("../../lib/base-command"));
12
+ const _arg = require("../../lib/helpers/arg");
13
+ const _request = require("../../lib/helpers/request");
14
+ function _define_property(obj, key, value) {
15
+ if (key in obj) {
16
+ Object.defineProperty(obj, key, {
17
+ value: value,
18
+ enumerable: true,
19
+ configurable: true,
20
+ writable: true
21
+ });
22
+ } else {
23
+ obj[key] = value;
24
+ }
25
+ return obj;
26
+ }
27
+ function _interop_require_default(obj) {
28
+ return obj && obj.__esModule ? obj : {
29
+ default: obj
30
+ };
31
+ }
32
+ class BranchCreate extends _basecommand.default {
33
+ async run() {
34
+ const { args, flags } = this.props;
35
+ const resp = await this.request(args.slug);
36
+ if (flags.json) return resp;
37
+ this.render(resp);
38
+ }
39
+ async request(slug) {
40
+ return (0, _request.withSpinnerV2)(()=>this.apiV1.mgmtClient.post(`/v1/branches/${slug}`));
41
+ }
42
+ async render(data) {
43
+ this.log(`‣ Successfully created branch \`${data.slug}\``);
44
+ this.log(` Created at: ${data.created_at}`);
45
+ }
46
+ }
47
+ // Hide until branches are released in GA
48
+ _define_property(BranchCreate, "hidden", true);
49
+ _define_property(BranchCreate, "summary", "Creates a new branch off of the development environment.");
50
+ _define_property(BranchCreate, "enableJsonFlag", true);
51
+ _define_property(BranchCreate, "args", {
52
+ slug: _arg.CustomArgs.slug({
53
+ required: true,
54
+ description: "The slug for the new branch"
55
+ })
56
+ });
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "default", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return BranchDelete;
9
+ }
10
+ });
11
+ const _core = require("@oclif/core");
12
+ const _basecommand = /*#__PURE__*/ _interop_require_default(require("../../lib/base-command"));
13
+ const _arg = require("../../lib/helpers/arg");
14
+ const _request = require("../../lib/helpers/request");
15
+ const _ux = require("../../lib/helpers/ux");
16
+ function _define_property(obj, key, value) {
17
+ if (key in obj) {
18
+ Object.defineProperty(obj, key, {
19
+ value: value,
20
+ enumerable: true,
21
+ configurable: true,
22
+ writable: true
23
+ });
24
+ } else {
25
+ obj[key] = value;
26
+ }
27
+ return obj;
28
+ }
29
+ function _interop_require_default(obj) {
30
+ return obj && obj.__esModule ? obj : {
31
+ default: obj
32
+ };
33
+ }
34
+ class BranchDelete extends _basecommand.default {
35
+ async run() {
36
+ const { args, flags } = this.props;
37
+ // Confirm before deleting the branch, unless forced
38
+ const prompt = `Delete branch \`${args.slug}\`?`;
39
+ const input = flags.force || await (0, _ux.promptToConfirm)(prompt);
40
+ if (!input) return;
41
+ await (0, _request.withSpinnerV2)(()=>this.apiV1.mgmtClient.delete(`/v1/branches/${args.slug}`), {
42
+ action: "‣ Deleting branch"
43
+ });
44
+ this.log(`‣ Successfully deleted branch \`${args.slug}\``);
45
+ }
46
+ }
47
+ // Hide until branches are released in GA
48
+ _define_property(BranchDelete, "hidden", true);
49
+ _define_property(BranchDelete, "summary", "Deletes an existing branch with the given slug.");
50
+ _define_property(BranchDelete, "args", {
51
+ slug: _arg.CustomArgs.slug({
52
+ required: true,
53
+ description: "The slug of the branch to delete"
54
+ })
55
+ });
56
+ _define_property(BranchDelete, "flags", {
57
+ force: _core.Flags.boolean({
58
+ summary: "Remove the confirmation prompt."
59
+ })
60
+ });