@knocklabs/cli 0.1.5 → 0.1.7
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 +53 -266
- package/dist/commands/commit/get.js +76 -0
- package/dist/commands/commit/list.js +99 -0
- package/dist/commands/commit/promote.js +36 -3
- package/dist/commands/layout/get.js +0 -4
- package/dist/commands/layout/list.js +0 -4
- package/dist/commands/layout/pull.js +0 -4
- package/dist/commands/layout/push.js +0 -4
- package/dist/commands/layout/validate.js +0 -4
- package/dist/lib/api-v1.js +16 -0
- package/dist/lib/marshal/commit/helpers.js +13 -0
- package/dist/lib/marshal/commit/index.js +17 -0
- package/dist/lib/marshal/commit/types.js +5 -0
- package/oclif.manifest.json +116 -24
- package/package.json +9 -9
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.7 linux-x64 node-v18.18.2
|
|
20
20
|
$ knock --help [COMMAND]
|
|
21
21
|
USAGE
|
|
22
22
|
$ knock COMMAND
|
|
@@ -28,17 +28,9 @@ USAGE
|
|
|
28
28
|
|
|
29
29
|
<!-- commands -->
|
|
30
30
|
* [`knock commit`](#knock-commit)
|
|
31
|
+
* [`knock commit get ID`](#knock-commit-get-id)
|
|
32
|
+
* [`knock commit list`](#knock-commit-list)
|
|
31
33
|
* [`knock commit promote`](#knock-commit-promote)
|
|
32
|
-
* [`knock email-layout get EMAILLAYOUTKEY`](#knock-email-layout-get-emaillayoutkey)
|
|
33
|
-
* [`knock email-layout list`](#knock-email-layout-list)
|
|
34
|
-
* [`knock email-layout pull [EMAILLAYOUTKEY]`](#knock-email-layout-pull-emaillayoutkey)
|
|
35
|
-
* [`knock email-layout push [EMAILLAYOUTKEY]`](#knock-email-layout-push-emaillayoutkey)
|
|
36
|
-
* [`knock email-layout validate [EMAILLAYOUTKEY]`](#knock-email-layout-validate-emaillayoutkey)
|
|
37
|
-
* [`knock email_layout get EMAILLAYOUTKEY`](#knock-email_layout-get-emaillayoutkey)
|
|
38
|
-
* [`knock email_layout list`](#knock-email_layout-list)
|
|
39
|
-
* [`knock email_layout pull [EMAILLAYOUTKEY]`](#knock-email_layout-pull-emaillayoutkey)
|
|
40
|
-
* [`knock email_layout push [EMAILLAYOUTKEY]`](#knock-email_layout-push-emaillayoutkey)
|
|
41
|
-
* [`knock email_layout validate [EMAILLAYOUTKEY]`](#knock-email_layout-validate-emaillayoutkey)
|
|
42
34
|
* [`knock help [COMMANDS]`](#knock-help-commands)
|
|
43
35
|
* [`knock layout get EMAILLAYOUTKEY`](#knock-layout-get-emaillayoutkey)
|
|
44
36
|
* [`knock layout list`](#knock-layout-list)
|
|
@@ -85,252 +77,66 @@ FLAGS
|
|
|
85
77
|
--service-token=<value> (required) The service token to authenticate with.
|
|
86
78
|
```
|
|
87
79
|
|
|
88
|
-
_See code: [
|
|
80
|
+
_See code: [src/commands/commit/index.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/commit/index.ts)_
|
|
89
81
|
|
|
90
|
-
## `knock commit
|
|
82
|
+
## `knock commit get ID`
|
|
91
83
|
|
|
92
|
-
|
|
84
|
+
Display a single commit
|
|
93
85
|
|
|
94
86
|
```
|
|
95
87
|
USAGE
|
|
96
|
-
$ knock commit
|
|
88
|
+
$ knock commit get ID --service-token <value> [--json]
|
|
97
89
|
|
|
98
90
|
FLAGS
|
|
99
|
-
--force Remove the confirmation prompt.
|
|
100
91
|
--service-token=<value> (required) The service token to authenticate with.
|
|
101
|
-
--to=<value> (required) The destination environment to promote changes from the preceding environment.
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
_See code: [dist/commands/commit/promote.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.5/dist/commands/commit/promote.ts)_
|
|
105
|
-
|
|
106
|
-
## `knock email-layout get EMAILLAYOUTKEY`
|
|
107
|
-
|
|
108
|
-
Display a single email layout from an environment.
|
|
109
|
-
|
|
110
|
-
```
|
|
111
|
-
USAGE
|
|
112
|
-
$ knock email-layout get EMAILLAYOUTKEY --service-token <value> [--environment <value>] [--hide-uncommitted-changes]
|
|
113
|
-
[--json]
|
|
114
|
-
|
|
115
|
-
FLAGS
|
|
116
|
-
--environment=<value> [default: development] The environment to use.
|
|
117
|
-
--hide-uncommitted-changes Hide any uncommitted changes.
|
|
118
|
-
--service-token=<value> (required) The service token to authenticate with.
|
|
119
92
|
|
|
120
93
|
GLOBAL FLAGS
|
|
121
94
|
--json Format output as json.
|
|
122
|
-
|
|
123
|
-
ALIASES
|
|
124
|
-
$ knock email-layout get
|
|
125
|
-
$ knock email_layout get
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
## `knock email-layout list`
|
|
129
|
-
|
|
130
|
-
Display all email layouts for an environment.
|
|
131
|
-
|
|
132
|
-
```
|
|
133
|
-
USAGE
|
|
134
|
-
$ knock email-layout list --service-token <value> [--environment <value>] [--hide-uncommitted-changes] [--after
|
|
135
|
-
<value>] [--before <value>] [--limit <value>] [--json]
|
|
136
|
-
|
|
137
|
-
FLAGS
|
|
138
|
-
--after=<value> The cursor after which to fetch the next page.
|
|
139
|
-
--before=<value> The cursor before which to fetch the previous page.
|
|
140
|
-
--environment=<value> [default: development] The environment to use.
|
|
141
|
-
--hide-uncommitted-changes Hide any uncommitted changes.
|
|
142
|
-
--limit=<value> The total number of entries to fetch per page.
|
|
143
|
-
--service-token=<value> (required) The service token to authenticate with.
|
|
144
|
-
|
|
145
|
-
GLOBAL FLAGS
|
|
146
|
-
--json Format output as json.
|
|
147
|
-
|
|
148
|
-
ALIASES
|
|
149
|
-
$ knock email-layout list
|
|
150
|
-
$ knock email_layout list
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
## `knock email-layout pull [EMAILLAYOUTKEY]`
|
|
154
|
-
|
|
155
|
-
Pull one or more email layouts from an environment into a local file system.
|
|
156
|
-
|
|
157
|
-
```
|
|
158
|
-
USAGE
|
|
159
|
-
$ knock email-layout pull [EMAILLAYOUTKEY] --service-token <value> [--environment <value>] [--layouts-dir <value>
|
|
160
|
-
--all] [--hide-uncommitted-changes] [--force]
|
|
161
|
-
|
|
162
|
-
FLAGS
|
|
163
|
-
--all Whether to pull all email layouts from the specified environment.
|
|
164
|
-
--environment=<value> [default: development] The environment to use.
|
|
165
|
-
--force Remove the confirmation prompt.
|
|
166
|
-
--hide-uncommitted-changes Hide any uncommitted changes.
|
|
167
|
-
--layouts-dir=<value> The target directory path to pull all email layouts into.
|
|
168
|
-
--service-token=<value> (required) The service token to authenticate with.
|
|
169
|
-
|
|
170
|
-
ALIASES
|
|
171
|
-
$ knock email-layout pull
|
|
172
|
-
$ knock email_layout pull
|
|
173
95
|
```
|
|
174
96
|
|
|
175
|
-
|
|
97
|
+
_See code: [src/commands/commit/get.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/commit/get.ts)_
|
|
176
98
|
|
|
177
|
-
|
|
99
|
+
## `knock commit list`
|
|
178
100
|
|
|
179
|
-
|
|
180
|
-
USAGE
|
|
181
|
-
$ knock email-layout push [EMAILLAYOUTKEY] --service-token <value> [--environment development] [--layouts-dir <value>
|
|
182
|
-
--all] [-m <value> --commit]
|
|
183
|
-
|
|
184
|
-
FLAGS
|
|
185
|
-
-m, --commit-message=<value> Use the given value as the commit message
|
|
186
|
-
--all Whether to push all layouts from the target directory.
|
|
187
|
-
--commit Push and commit the layout(s) at the same time
|
|
188
|
-
--environment=<option> [default: development] Pushing an email layout is only allowed in the development
|
|
189
|
-
environment
|
|
190
|
-
<options: development>
|
|
191
|
-
--layouts-dir=<value> The target directory path to find all layouts to push.
|
|
192
|
-
--service-token=<value> (required) The service token to authenticate with.
|
|
193
|
-
|
|
194
|
-
ALIASES
|
|
195
|
-
$ knock email-layout push
|
|
196
|
-
$ knock email_layout push
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
## `knock email-layout validate [EMAILLAYOUTKEY]`
|
|
200
|
-
|
|
201
|
-
Validate one or more layouts from a local file system.
|
|
101
|
+
Display all commits in an environment
|
|
202
102
|
|
|
203
103
|
```
|
|
204
104
|
USAGE
|
|
205
|
-
$ knock
|
|
206
|
-
--
|
|
105
|
+
$ knock commit list --service-token <value> [--environment <value>] [--promoted] [--after <value>] [--before
|
|
106
|
+
<value>] [--limit <value>] [--json]
|
|
207
107
|
|
|
208
108
|
FLAGS
|
|
209
|
-
--
|
|
210
|
-
--
|
|
211
|
-
|
|
212
|
-
--
|
|
109
|
+
--after=<value> The cursor after which to fetch the next page.
|
|
110
|
+
--before=<value> The cursor before which to fetch the previous page.
|
|
111
|
+
--environment=<value> [default: development] The environment to use.
|
|
112
|
+
--limit=<value> The total number of entries to fetch per page.
|
|
113
|
+
--[no-]promoted Show only promoted or unpromoted changes between the given environment and the subsequent
|
|
114
|
+
environment.
|
|
213
115
|
--service-token=<value> (required) The service token to authenticate with.
|
|
214
116
|
|
|
215
|
-
ALIASES
|
|
216
|
-
$ knock email-layout validate
|
|
217
|
-
$ knock email_layout validate
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
## `knock email_layout get EMAILLAYOUTKEY`
|
|
221
|
-
|
|
222
|
-
Display a single email layout from an environment.
|
|
223
|
-
|
|
224
|
-
```
|
|
225
|
-
USAGE
|
|
226
|
-
$ knock email_layout get EMAILLAYOUTKEY --service-token <value> [--environment <value>] [--hide-uncommitted-changes]
|
|
227
|
-
[--json]
|
|
228
|
-
|
|
229
|
-
FLAGS
|
|
230
|
-
--environment=<value> [default: development] The environment to use.
|
|
231
|
-
--hide-uncommitted-changes Hide any uncommitted changes.
|
|
232
|
-
--service-token=<value> (required) The service token to authenticate with.
|
|
233
|
-
|
|
234
117
|
GLOBAL FLAGS
|
|
235
118
|
--json Format output as json.
|
|
236
|
-
|
|
237
|
-
ALIASES
|
|
238
|
-
$ knock email-layout get
|
|
239
|
-
$ knock email_layout get
|
|
240
119
|
```
|
|
241
120
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
Display all email layouts for an environment.
|
|
245
|
-
|
|
246
|
-
```
|
|
247
|
-
USAGE
|
|
248
|
-
$ knock email_layout list --service-token <value> [--environment <value>] [--hide-uncommitted-changes] [--after
|
|
249
|
-
<value>] [--before <value>] [--limit <value>] [--json]
|
|
250
|
-
|
|
251
|
-
FLAGS
|
|
252
|
-
--after=<value> The cursor after which to fetch the next page.
|
|
253
|
-
--before=<value> The cursor before which to fetch the previous page.
|
|
254
|
-
--environment=<value> [default: development] The environment to use.
|
|
255
|
-
--hide-uncommitted-changes Hide any uncommitted changes.
|
|
256
|
-
--limit=<value> The total number of entries to fetch per page.
|
|
257
|
-
--service-token=<value> (required) The service token to authenticate with.
|
|
121
|
+
_See code: [src/commands/commit/list.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/commit/list.ts)_
|
|
258
122
|
|
|
259
|
-
|
|
260
|
-
--json Format output as json.
|
|
261
|
-
|
|
262
|
-
ALIASES
|
|
263
|
-
$ knock email-layout list
|
|
264
|
-
$ knock email_layout list
|
|
265
|
-
```
|
|
266
|
-
|
|
267
|
-
## `knock email_layout pull [EMAILLAYOUTKEY]`
|
|
268
|
-
|
|
269
|
-
Pull one or more email layouts from an environment into a local file system.
|
|
270
|
-
|
|
271
|
-
```
|
|
272
|
-
USAGE
|
|
273
|
-
$ knock email_layout pull [EMAILLAYOUTKEY] --service-token <value> [--environment <value>] [--layouts-dir <value>
|
|
274
|
-
--all] [--hide-uncommitted-changes] [--force]
|
|
275
|
-
|
|
276
|
-
FLAGS
|
|
277
|
-
--all Whether to pull all email layouts from the specified environment.
|
|
278
|
-
--environment=<value> [default: development] The environment to use.
|
|
279
|
-
--force Remove the confirmation prompt.
|
|
280
|
-
--hide-uncommitted-changes Hide any uncommitted changes.
|
|
281
|
-
--layouts-dir=<value> The target directory path to pull all email layouts into.
|
|
282
|
-
--service-token=<value> (required) The service token to authenticate with.
|
|
283
|
-
|
|
284
|
-
ALIASES
|
|
285
|
-
$ knock email-layout pull
|
|
286
|
-
$ knock email_layout pull
|
|
287
|
-
```
|
|
288
|
-
|
|
289
|
-
## `knock email_layout push [EMAILLAYOUTKEY]`
|
|
290
|
-
|
|
291
|
-
Push one or more email layouts from a local file system to Knock.
|
|
292
|
-
|
|
293
|
-
```
|
|
294
|
-
USAGE
|
|
295
|
-
$ knock email_layout push [EMAILLAYOUTKEY] --service-token <value> [--environment development] [--layouts-dir <value>
|
|
296
|
-
--all] [-m <value> --commit]
|
|
297
|
-
|
|
298
|
-
FLAGS
|
|
299
|
-
-m, --commit-message=<value> Use the given value as the commit message
|
|
300
|
-
--all Whether to push all layouts from the target directory.
|
|
301
|
-
--commit Push and commit the layout(s) at the same time
|
|
302
|
-
--environment=<option> [default: development] Pushing an email layout is only allowed in the development
|
|
303
|
-
environment
|
|
304
|
-
<options: development>
|
|
305
|
-
--layouts-dir=<value> The target directory path to find all layouts to push.
|
|
306
|
-
--service-token=<value> (required) The service token to authenticate with.
|
|
307
|
-
|
|
308
|
-
ALIASES
|
|
309
|
-
$ knock email-layout push
|
|
310
|
-
$ knock email_layout push
|
|
311
|
-
```
|
|
312
|
-
|
|
313
|
-
## `knock email_layout validate [EMAILLAYOUTKEY]`
|
|
123
|
+
## `knock commit promote`
|
|
314
124
|
|
|
315
|
-
|
|
125
|
+
Promote one or all commits to the subsequent environment.
|
|
316
126
|
|
|
317
127
|
```
|
|
318
128
|
USAGE
|
|
319
|
-
$ knock
|
|
320
|
-
--all]
|
|
129
|
+
$ knock commit promote --service-token <value> [--to <value>] [--force] [--only <value>]
|
|
321
130
|
|
|
322
131
|
FLAGS
|
|
323
|
-
--
|
|
324
|
-
--
|
|
325
|
-
<options: development>
|
|
326
|
-
--layouts-dir=<value> The target directory path to find all layouts to validate.
|
|
132
|
+
--force Remove the confirmation prompt.
|
|
133
|
+
--only=<value> The target commit id to promote to the subsequent environment
|
|
327
134
|
--service-token=<value> (required) The service token to authenticate with.
|
|
328
|
-
|
|
329
|
-
ALIASES
|
|
330
|
-
$ knock email-layout validate
|
|
331
|
-
$ knock email_layout validate
|
|
135
|
+
--to=<value> The destination environment to promote all changes from the preceding environment.
|
|
332
136
|
```
|
|
333
137
|
|
|
138
|
+
_See code: [src/commands/commit/promote.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/commit/promote.ts)_
|
|
139
|
+
|
|
334
140
|
## `knock help [COMMANDS]`
|
|
335
141
|
|
|
336
142
|
Display help for knock.
|
|
@@ -367,13 +173,9 @@ FLAGS
|
|
|
367
173
|
|
|
368
174
|
GLOBAL FLAGS
|
|
369
175
|
--json Format output as json.
|
|
370
|
-
|
|
371
|
-
ALIASES
|
|
372
|
-
$ knock email-layout get
|
|
373
|
-
$ knock email_layout get
|
|
374
176
|
```
|
|
375
177
|
|
|
376
|
-
_See code: [
|
|
178
|
+
_See code: [src/commands/layout/get.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/layout/get.ts)_
|
|
377
179
|
|
|
378
180
|
## `knock layout list`
|
|
379
181
|
|
|
@@ -394,13 +196,9 @@ FLAGS
|
|
|
394
196
|
|
|
395
197
|
GLOBAL FLAGS
|
|
396
198
|
--json Format output as json.
|
|
397
|
-
|
|
398
|
-
ALIASES
|
|
399
|
-
$ knock email-layout list
|
|
400
|
-
$ knock email_layout list
|
|
401
199
|
```
|
|
402
200
|
|
|
403
|
-
_See code: [
|
|
201
|
+
_See code: [src/commands/layout/list.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/layout/list.ts)_
|
|
404
202
|
|
|
405
203
|
## `knock layout pull [EMAILLAYOUTKEY]`
|
|
406
204
|
|
|
@@ -418,13 +216,9 @@ FLAGS
|
|
|
418
216
|
--hide-uncommitted-changes Hide any uncommitted changes.
|
|
419
217
|
--layouts-dir=<value> The target directory path to pull all email layouts into.
|
|
420
218
|
--service-token=<value> (required) The service token to authenticate with.
|
|
421
|
-
|
|
422
|
-
ALIASES
|
|
423
|
-
$ knock email-layout pull
|
|
424
|
-
$ knock email_layout pull
|
|
425
219
|
```
|
|
426
220
|
|
|
427
|
-
_See code: [
|
|
221
|
+
_See code: [src/commands/layout/pull.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/layout/pull.ts)_
|
|
428
222
|
|
|
429
223
|
## `knock layout push [EMAILLAYOUTKEY]`
|
|
430
224
|
|
|
@@ -444,13 +238,9 @@ FLAGS
|
|
|
444
238
|
<options: development>
|
|
445
239
|
--layouts-dir=<value> The target directory path to find all layouts to push.
|
|
446
240
|
--service-token=<value> (required) The service token to authenticate with.
|
|
447
|
-
|
|
448
|
-
ALIASES
|
|
449
|
-
$ knock email-layout push
|
|
450
|
-
$ knock email_layout push
|
|
451
241
|
```
|
|
452
242
|
|
|
453
|
-
_See code: [
|
|
243
|
+
_See code: [src/commands/layout/push.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/layout/push.ts)_
|
|
454
244
|
|
|
455
245
|
## `knock layout validate [EMAILLAYOUTKEY]`
|
|
456
246
|
|
|
@@ -467,13 +257,9 @@ FLAGS
|
|
|
467
257
|
<options: development>
|
|
468
258
|
--layouts-dir=<value> The target directory path to find all layouts to validate.
|
|
469
259
|
--service-token=<value> (required) The service token to authenticate with.
|
|
470
|
-
|
|
471
|
-
ALIASES
|
|
472
|
-
$ knock email-layout validate
|
|
473
|
-
$ knock email_layout validate
|
|
474
260
|
```
|
|
475
261
|
|
|
476
|
-
_See code: [
|
|
262
|
+
_See code: [src/commands/layout/validate.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/layout/validate.ts)_
|
|
477
263
|
|
|
478
264
|
## `knock plugins`
|
|
479
265
|
|
|
@@ -496,7 +282,7 @@ EXAMPLES
|
|
|
496
282
|
$ knock plugins
|
|
497
283
|
```
|
|
498
284
|
|
|
499
|
-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.
|
|
285
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.9.4/src/commands/plugins/index.ts)_
|
|
500
286
|
|
|
501
287
|
## `knock plugins:install PLUGIN...`
|
|
502
288
|
|
|
@@ -561,7 +347,7 @@ EXAMPLES
|
|
|
561
347
|
$ knock plugins:inspect myplugin
|
|
562
348
|
```
|
|
563
349
|
|
|
564
|
-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.
|
|
350
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.9.4/src/commands/plugins/inspect.ts)_
|
|
565
351
|
|
|
566
352
|
## `knock plugins:install PLUGIN...`
|
|
567
353
|
|
|
@@ -601,7 +387,7 @@ EXAMPLES
|
|
|
601
387
|
$ knock plugins:install someuser/someplugin
|
|
602
388
|
```
|
|
603
389
|
|
|
604
|
-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.
|
|
390
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.9.4/src/commands/plugins/install.ts)_
|
|
605
391
|
|
|
606
392
|
## `knock plugins:link PLUGIN`
|
|
607
393
|
|
|
@@ -615,8 +401,9 @@ ARGUMENTS
|
|
|
615
401
|
PATH [default: .] path to plugin
|
|
616
402
|
|
|
617
403
|
FLAGS
|
|
618
|
-
-h, --help
|
|
404
|
+
-h, --help Show CLI help.
|
|
619
405
|
-v, --verbose
|
|
406
|
+
--[no-]install Install dependencies after linking the plugin.
|
|
620
407
|
|
|
621
408
|
DESCRIPTION
|
|
622
409
|
Links a plugin into the CLI for development.
|
|
@@ -630,7 +417,7 @@ EXAMPLES
|
|
|
630
417
|
$ knock plugins:link myplugin
|
|
631
418
|
```
|
|
632
419
|
|
|
633
|
-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.
|
|
420
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.9.4/src/commands/plugins/link.ts)_
|
|
634
421
|
|
|
635
422
|
## `knock plugins:uninstall PLUGIN...`
|
|
636
423
|
|
|
@@ -678,7 +465,7 @@ ALIASES
|
|
|
678
465
|
$ knock plugins remove
|
|
679
466
|
```
|
|
680
467
|
|
|
681
|
-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.
|
|
468
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.9.4/src/commands/plugins/uninstall.ts)_
|
|
682
469
|
|
|
683
470
|
## `knock plugins:uninstall PLUGIN...`
|
|
684
471
|
|
|
@@ -719,7 +506,7 @@ DESCRIPTION
|
|
|
719
506
|
Update installed plugins.
|
|
720
507
|
```
|
|
721
508
|
|
|
722
|
-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.
|
|
509
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.9.4/src/commands/plugins/update.ts)_
|
|
723
510
|
|
|
724
511
|
## `knock translation get TRANSLATIONREF`
|
|
725
512
|
|
|
@@ -744,7 +531,7 @@ GLOBAL FLAGS
|
|
|
744
531
|
--json Format output as json.
|
|
745
532
|
```
|
|
746
533
|
|
|
747
|
-
_See code: [
|
|
534
|
+
_See code: [src/commands/translation/get.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/translation/get.ts)_
|
|
748
535
|
|
|
749
536
|
## `knock translation list`
|
|
750
537
|
|
|
@@ -767,7 +554,7 @@ GLOBAL FLAGS
|
|
|
767
554
|
--json Format output as json.
|
|
768
555
|
```
|
|
769
556
|
|
|
770
|
-
_See code: [
|
|
557
|
+
_See code: [src/commands/translation/list.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/translation/list.ts)_
|
|
771
558
|
|
|
772
559
|
## `knock translation pull [TRANSLATIONREF]`
|
|
773
560
|
|
|
@@ -792,7 +579,7 @@ FLAGS
|
|
|
792
579
|
--translations-dir=<value> The target directory path to pull all translations into.
|
|
793
580
|
```
|
|
794
581
|
|
|
795
|
-
_See code: [
|
|
582
|
+
_See code: [src/commands/translation/pull.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/translation/pull.ts)_
|
|
796
583
|
|
|
797
584
|
## `knock translation push [TRANSLATIONREF]`
|
|
798
585
|
|
|
@@ -819,7 +606,7 @@ FLAGS
|
|
|
819
606
|
--translations-dir=<value> The target directory path to find all translations to push.
|
|
820
607
|
```
|
|
821
608
|
|
|
822
|
-
_See code: [
|
|
609
|
+
_See code: [src/commands/translation/push.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/translation/push.ts)_
|
|
823
610
|
|
|
824
611
|
## `knock translation validate [TRANSLATIONREF]`
|
|
825
612
|
|
|
@@ -844,7 +631,7 @@ FLAGS
|
|
|
844
631
|
--translations-dir=<value> The target directory path to find all translations to validate.
|
|
845
632
|
```
|
|
846
633
|
|
|
847
|
-
_See code: [
|
|
634
|
+
_See code: [src/commands/translation/validate.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/translation/validate.ts)_
|
|
848
635
|
|
|
849
636
|
## `knock whoami`
|
|
850
637
|
|
|
@@ -861,7 +648,7 @@ GLOBAL FLAGS
|
|
|
861
648
|
--json Format output as json.
|
|
862
649
|
```
|
|
863
650
|
|
|
864
|
-
_See code: [
|
|
651
|
+
_See code: [src/commands/whoami.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/whoami.ts)_
|
|
865
652
|
|
|
866
653
|
## `knock workflow activate WORKFLOWKEY`
|
|
867
654
|
|
|
@@ -888,7 +675,7 @@ DESCRIPTION
|
|
|
888
675
|
with `false` in order to deactivate it.
|
|
889
676
|
```
|
|
890
677
|
|
|
891
|
-
_See code: [
|
|
678
|
+
_See code: [src/commands/workflow/activate.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/workflow/activate.ts)_
|
|
892
679
|
|
|
893
680
|
## `knock workflow get WORKFLOWKEY`
|
|
894
681
|
|
|
@@ -908,7 +695,7 @@ GLOBAL FLAGS
|
|
|
908
695
|
--json Format output as json.
|
|
909
696
|
```
|
|
910
697
|
|
|
911
|
-
_See code: [
|
|
698
|
+
_See code: [src/commands/workflow/get.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/workflow/get.ts)_
|
|
912
699
|
|
|
913
700
|
## `knock workflow list`
|
|
914
701
|
|
|
@@ -931,7 +718,7 @@ GLOBAL FLAGS
|
|
|
931
718
|
--json Format output as json.
|
|
932
719
|
```
|
|
933
720
|
|
|
934
|
-
_See code: [
|
|
721
|
+
_See code: [src/commands/workflow/list.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/workflow/list.ts)_
|
|
935
722
|
|
|
936
723
|
## `knock workflow pull [WORKFLOWKEY]`
|
|
937
724
|
|
|
@@ -951,7 +738,7 @@ FLAGS
|
|
|
951
738
|
--workflows-dir=<value> The target directory path to pull all workflows into.
|
|
952
739
|
```
|
|
953
740
|
|
|
954
|
-
_See code: [
|
|
741
|
+
_See code: [src/commands/workflow/pull.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/workflow/pull.ts)_
|
|
955
742
|
|
|
956
743
|
## `knock workflow push [WORKFLOWKEY]`
|
|
957
744
|
|
|
@@ -972,7 +759,7 @@ FLAGS
|
|
|
972
759
|
--workflows-dir=<value> The target directory path to find all workflows to push.
|
|
973
760
|
```
|
|
974
761
|
|
|
975
|
-
_See code: [
|
|
762
|
+
_See code: [src/commands/workflow/push.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/workflow/push.ts)_
|
|
976
763
|
|
|
977
764
|
## `knock workflow run WORKFLOWKEY`
|
|
978
765
|
|
|
@@ -993,7 +780,7 @@ FLAGS
|
|
|
993
780
|
--tenant=<value> A tenant id for the workflow run.
|
|
994
781
|
```
|
|
995
782
|
|
|
996
|
-
_See code: [
|
|
783
|
+
_See code: [src/commands/workflow/run.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/workflow/run.ts)_
|
|
997
784
|
|
|
998
785
|
## `knock workflow validate [WORKFLOWKEY]`
|
|
999
786
|
|
|
@@ -1012,5 +799,5 @@ FLAGS
|
|
|
1012
799
|
--workflows-dir=<value> The target directory path to find all workflows to validate.
|
|
1013
800
|
```
|
|
1014
801
|
|
|
1015
|
-
_See code: [
|
|
802
|
+
_See code: [src/commands/workflow/validate.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/workflow/validate.ts)_
|
|
1016
803
|
<!-- commandsstop -->
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>CommitGet
|
|
8
|
+
});
|
|
9
|
+
const _core = require("@oclif/core");
|
|
10
|
+
const _baseCommand = /*#__PURE__*/ _interopRequireDefault(require("../../lib/base-command"));
|
|
11
|
+
const _date = require("../../lib/helpers/date");
|
|
12
|
+
const _request = require("../../lib/helpers/request");
|
|
13
|
+
const _commit = require("../../lib/marshal/commit");
|
|
14
|
+
function _interopRequireDefault(obj) {
|
|
15
|
+
return obj && obj.__esModule ? obj : {
|
|
16
|
+
default: obj
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
class CommitGet extends _baseCommand.default {
|
|
20
|
+
async run() {
|
|
21
|
+
const { flags } = this.props;
|
|
22
|
+
const resp = await (0, _request.withSpinner)(()=>this.apiV1.getCommit(this.props));
|
|
23
|
+
if (flags.json) return resp.data;
|
|
24
|
+
this.render(resp.data);
|
|
25
|
+
}
|
|
26
|
+
render(commit) {
|
|
27
|
+
this.log(`‣ Showing commit \`${commit.id}\` in \`${commit.environment}\` environment`);
|
|
28
|
+
/*
|
|
29
|
+
* Commit table
|
|
30
|
+
*/ const rows = [
|
|
31
|
+
{
|
|
32
|
+
key: "ID",
|
|
33
|
+
value: commit.id
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
key: "Resource",
|
|
37
|
+
value: commit.resource.type
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
key: "Identifier",
|
|
41
|
+
value: commit.resource.identifier
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
key: "Author",
|
|
45
|
+
value: (0, _commit.formatCommitAuthor)(commit)
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
key: "Created at",
|
|
49
|
+
value: (0, _date.formatDate)(commit.created_at)
|
|
50
|
+
}
|
|
51
|
+
];
|
|
52
|
+
this.log("");
|
|
53
|
+
_core.ux.table(rows, {
|
|
54
|
+
key: {
|
|
55
|
+
header: "Commit",
|
|
56
|
+
minWidth: 18
|
|
57
|
+
},
|
|
58
|
+
value: {
|
|
59
|
+
header: "",
|
|
60
|
+
minWidth: 16
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
this.log("");
|
|
64
|
+
if (commit.commit_message) {
|
|
65
|
+
this.log(commit.commit_message);
|
|
66
|
+
this.log("");
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
CommitGet.summary = "Display a single commit";
|
|
71
|
+
CommitGet.args = {
|
|
72
|
+
id: _core.Args.string({
|
|
73
|
+
required: true
|
|
74
|
+
})
|
|
75
|
+
};
|
|
76
|
+
CommitGet.enableJsonFlag = true;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>CommitList
|
|
8
|
+
});
|
|
9
|
+
const _core = require("@oclif/core");
|
|
10
|
+
const _baseCommand = /*#__PURE__*/ _interopRequireDefault(require("../../lib/base-command"));
|
|
11
|
+
const _date = require("../../lib/helpers/date");
|
|
12
|
+
const _object = require("../../lib/helpers/object");
|
|
13
|
+
const _page = require("../../lib/helpers/page");
|
|
14
|
+
const _request = require("../../lib/helpers/request");
|
|
15
|
+
const _commit = require("../../lib/marshal/commit");
|
|
16
|
+
function _interopRequireDefault(obj) {
|
|
17
|
+
return obj && obj.__esModule ? obj : {
|
|
18
|
+
default: obj
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
class CommitList extends _baseCommand.default {
|
|
22
|
+
async run() {
|
|
23
|
+
const resp = await this.request();
|
|
24
|
+
const { flags } = this.props;
|
|
25
|
+
if (flags.json) return resp.data;
|
|
26
|
+
this.render(resp.data);
|
|
27
|
+
}
|
|
28
|
+
async request(pageParams = {}) {
|
|
29
|
+
const props = (0, _object.merge)(this.props, {
|
|
30
|
+
flags: {
|
|
31
|
+
...pageParams
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
return (0, _request.withSpinner)(()=>this.apiV1.listCommits(props));
|
|
35
|
+
}
|
|
36
|
+
async render(data) {
|
|
37
|
+
const { entries } = data;
|
|
38
|
+
const { environment: env , promoted } = this.props.flags;
|
|
39
|
+
let qualifier = "";
|
|
40
|
+
if (promoted === true) {
|
|
41
|
+
qualifier = "(showing only promoted)";
|
|
42
|
+
}
|
|
43
|
+
if (promoted === false) {
|
|
44
|
+
qualifier = "(showing only unpromoted)";
|
|
45
|
+
}
|
|
46
|
+
this.log(`‣ Showing ${entries.length} commits in \`${env}\` environment ${qualifier}\n`);
|
|
47
|
+
/*
|
|
48
|
+
* Commits table
|
|
49
|
+
*/ _core.ux.table(entries, {
|
|
50
|
+
id: {
|
|
51
|
+
header: "ID"
|
|
52
|
+
},
|
|
53
|
+
resource: {
|
|
54
|
+
header: "Resource",
|
|
55
|
+
get: (entry)=>entry.resource.type
|
|
56
|
+
},
|
|
57
|
+
identifier: {
|
|
58
|
+
header: "Identifier",
|
|
59
|
+
get: (entry)=>entry.resource.identifier
|
|
60
|
+
},
|
|
61
|
+
author: {
|
|
62
|
+
header: "Author",
|
|
63
|
+
get: (entry)=>(0, _commit.formatCommitAuthor)(entry)
|
|
64
|
+
},
|
|
65
|
+
commit_message: {
|
|
66
|
+
header: "Commit message",
|
|
67
|
+
get: (entry)=>entry.commit_message ? entry.commit_message.trim() : ""
|
|
68
|
+
},
|
|
69
|
+
created_at: {
|
|
70
|
+
header: "Created at",
|
|
71
|
+
get: (entry)=>(0, _date.formatDate)(entry.created_at)
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
return this.prompt(data);
|
|
75
|
+
}
|
|
76
|
+
async prompt(data) {
|
|
77
|
+
const { page_info } = data;
|
|
78
|
+
const pageAction = await (0, _page.maybePromptPageAction)(page_info);
|
|
79
|
+
const pageParams = pageAction && (0, _page.paramsForPageAction)(pageAction, page_info);
|
|
80
|
+
if (pageParams) {
|
|
81
|
+
this.log("\n");
|
|
82
|
+
const resp = await this.request(pageParams);
|
|
83
|
+
return this.render(resp.data);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
CommitList.summary = "Display all commits in an environment";
|
|
88
|
+
CommitList.flags = {
|
|
89
|
+
environment: _core.Flags.string({
|
|
90
|
+
default: "development",
|
|
91
|
+
summary: "The environment to use."
|
|
92
|
+
}),
|
|
93
|
+
promoted: _core.Flags.boolean({
|
|
94
|
+
summary: "Show only promoted or unpromoted changes between the given environment and the subsequent environment.",
|
|
95
|
+
allowNo: true
|
|
96
|
+
}),
|
|
97
|
+
..._page.pageFlags
|
|
98
|
+
};
|
|
99
|
+
CommitList.enableJsonFlag = true;
|
|
@@ -8,7 +8,9 @@ Object.defineProperty(exports, "default", {
|
|
|
8
8
|
});
|
|
9
9
|
const _core = require("@oclif/core");
|
|
10
10
|
const _baseCommand = /*#__PURE__*/ _interopRequireDefault(require("../../lib/base-command"));
|
|
11
|
+
const _error = require("../../lib/helpers/error");
|
|
11
12
|
const _request = require("../../lib/helpers/request");
|
|
13
|
+
const _string = require("../../lib/helpers/string");
|
|
12
14
|
const _ux = require("../../lib/helpers/ux");
|
|
13
15
|
function _interopRequireDefault(obj) {
|
|
14
16
|
return obj && obj.__esModule ? obj : {
|
|
@@ -17,6 +19,35 @@ function _interopRequireDefault(obj) {
|
|
|
17
19
|
}
|
|
18
20
|
class CommitPromote extends _baseCommand.default {
|
|
19
21
|
async run() {
|
|
22
|
+
const { flags } = this.props;
|
|
23
|
+
// Currently this command support two modes of operation based on the flags:
|
|
24
|
+
// * --to : Promotes all changes to the destination environment.
|
|
25
|
+
// * --only: Promotes one commit to the subsequent enviroment
|
|
26
|
+
// The absence or presence of both flags will result in an error.
|
|
27
|
+
if (flags.to && flags.only) {
|
|
28
|
+
throw new Error("`--to` and `--only` flags cannot be used together.\n See more help with --help");
|
|
29
|
+
}
|
|
30
|
+
if (!flags.to && !flags.only) {
|
|
31
|
+
throw new Error("You must specify either `--to` or `--only` flag.\n See more help with --help");
|
|
32
|
+
}
|
|
33
|
+
return flags.only ? this.promoteOneChange() : this.promoteAllChanges();
|
|
34
|
+
}
|
|
35
|
+
async promoteOneChange() {
|
|
36
|
+
const { flags } = this.props;
|
|
37
|
+
// Confirm first as we are about to promote the commit, unless forced.
|
|
38
|
+
const prompt = `Promote the commit \`${flags.only}\` ?`;
|
|
39
|
+
const input = flags.force || await (0, _ux.promptToConfirm)(prompt);
|
|
40
|
+
if (!input) return;
|
|
41
|
+
const resp = await (0, _request.withSpinner)(()=>this.apiV1.promoteOneChange(this.props));
|
|
42
|
+
if (!(0, _request.isSuccessResp)(resp)) {
|
|
43
|
+
const message = (0, _request.formatErrorRespMessage)(resp);
|
|
44
|
+
return this.error(new _error.ApiError(message));
|
|
45
|
+
}
|
|
46
|
+
const { commit } = resp.data;
|
|
47
|
+
this.log(`‣ Successfully promoted the commit \`${flags.only}\` into \`${commit.environment}\` environment`);
|
|
48
|
+
this.log((0, _string.indentString)(`Commit id: ${commit.id}`, 4));
|
|
49
|
+
}
|
|
50
|
+
async promoteAllChanges() {
|
|
20
51
|
const { flags } = this.props;
|
|
21
52
|
// Confirm first as we are about to promote changes to go live in the target
|
|
22
53
|
// environment, unless forced.
|
|
@@ -27,13 +58,15 @@ class CommitPromote extends _baseCommand.default {
|
|
|
27
58
|
this.log(`‣ Successfully promoted all changes to \`${flags.to}\` environment`);
|
|
28
59
|
}
|
|
29
60
|
}
|
|
30
|
-
CommitPromote.summary = "Promote all
|
|
61
|
+
CommitPromote.summary = "Promote one or all commits to the subsequent environment.";
|
|
31
62
|
CommitPromote.flags = {
|
|
32
63
|
to: _core.Flags.string({
|
|
33
|
-
summary: "The destination environment to promote changes from the preceding environment."
|
|
34
|
-
required: true
|
|
64
|
+
summary: "The destination environment to promote all changes from the preceding environment."
|
|
35
65
|
}),
|
|
36
66
|
force: _core.Flags.boolean({
|
|
37
67
|
summary: "Remove the confirmation prompt."
|
|
68
|
+
}),
|
|
69
|
+
only: _core.Flags.string({
|
|
70
|
+
summary: "The target commit id to promote to the subsequent environment"
|
|
38
71
|
})
|
|
39
72
|
};
|
|
@@ -76,10 +76,6 @@ class EmailLayoutGet extends _baseCommand.default {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
EmailLayoutGet.aliases = [
|
|
80
|
-
"email-layout:get",
|
|
81
|
-
"email_layout:get"
|
|
82
|
-
];
|
|
83
79
|
EmailLayoutGet.summary = "Display a single email layout from an environment.";
|
|
84
80
|
EmailLayoutGet.flags = {
|
|
85
81
|
environment: _core.Flags.string({
|
|
@@ -68,10 +68,6 @@ class EmailLayoutList extends _baseCommand.default {
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
EmailLayoutList.aliases = [
|
|
72
|
-
"email-layout:list",
|
|
73
|
-
"email_layout:list"
|
|
74
|
-
];
|
|
75
71
|
EmailLayoutList.summary = "Display all email layouts for an environment.";
|
|
76
72
|
EmailLayoutList.flags = {
|
|
77
73
|
environment: _core.Flags.string({
|
|
@@ -163,10 +163,6 @@ class EmailLayoutPull extends _baseCommand.default {
|
|
|
163
163
|
return this.error("Missing 1 required arg:\nemailLayoutKey");
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
|
-
EmailLayoutPull.aliases = [
|
|
167
|
-
"email-layout:pull",
|
|
168
|
-
"email_layout:pull"
|
|
169
|
-
];
|
|
170
166
|
EmailLayoutPull.summary = "Pull one or more email layouts from an environment into a local file system.";
|
|
171
167
|
EmailLayoutPull.flags = {
|
|
172
168
|
environment: _core.Flags.string({
|
|
@@ -116,10 +116,6 @@ class EmailLayoutPush extends _baseCommand.default {
|
|
|
116
116
|
this.log(`‣ Successfully ${actioned} ${layouts.length} layout(s):\n` + (0, _string.indentString)(layoutKeys.join("\n"), 4));
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
|
-
EmailLayoutPush.aliases = [
|
|
120
|
-
"email-layout:push",
|
|
121
|
-
"email_layout:push"
|
|
122
|
-
];
|
|
123
119
|
EmailLayoutPush.summary = "Push one or more email layouts from a local file system to Knock.";
|
|
124
120
|
EmailLayoutPush.flags = {
|
|
125
121
|
environment: _core.Flags.string({
|
|
@@ -101,10 +101,6 @@ class EmailLayoutValidate extends _baseCommand.default {
|
|
|
101
101
|
return errors;
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
EmailLayoutValidate.aliases = [
|
|
105
|
-
"email-layout:validate",
|
|
106
|
-
"email_layout:validate"
|
|
107
|
-
];
|
|
108
104
|
EmailLayoutValidate.summary = "Validate one or more layouts from a local file system.";
|
|
109
105
|
EmailLayoutValidate.flags = {
|
|
110
106
|
environment: _core.Flags.string({
|
package/dist/lib/api-v1.js
CHANGED
|
@@ -94,6 +94,19 @@ class ApiV1 {
|
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
96
|
// By resources: Commits
|
|
97
|
+
async listCommits({ flags }) {
|
|
98
|
+
const params = (0, _object.prune)({
|
|
99
|
+
environment: flags.environment,
|
|
100
|
+
promoted: flags.promoted,
|
|
101
|
+
...(0, _page.toPageParams)(flags)
|
|
102
|
+
});
|
|
103
|
+
return this.get("/commits", {
|
|
104
|
+
params
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
async getCommit({ args }) {
|
|
108
|
+
return this.get(`/commits/${args.id}`);
|
|
109
|
+
}
|
|
97
110
|
async commitAllChanges({ flags }) {
|
|
98
111
|
const params = (0, _object.prune)({
|
|
99
112
|
environment: flags.environment,
|
|
@@ -111,6 +124,9 @@ class ApiV1 {
|
|
|
111
124
|
params
|
|
112
125
|
});
|
|
113
126
|
}
|
|
127
|
+
async promoteOneChange({ flags }) {
|
|
128
|
+
return this.put(`/commits/${flags.only}/promote`);
|
|
129
|
+
}
|
|
114
130
|
// By resources: Translations
|
|
115
131
|
async listTranslations({ flags }, filters = {}) {
|
|
116
132
|
const params = (0, _object.prune)({
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "formatCommitAuthor", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>formatCommitAuthor
|
|
8
|
+
});
|
|
9
|
+
function formatCommitAuthor(commit) {
|
|
10
|
+
const email = commit.author.email;
|
|
11
|
+
const name = commit.author.name;
|
|
12
|
+
return name ? `${name} <${email}>` : `<${email}>`;
|
|
13
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
_exportStar(require("./helpers"), exports);
|
|
6
|
+
_exportStar(require("./types"), exports);
|
|
7
|
+
function _exportStar(from, to) {
|
|
8
|
+
Object.keys(from).forEach(function(k) {
|
|
9
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function() {
|
|
12
|
+
return from[k];
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
return from;
|
|
17
|
+
}
|
package/oclif.manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.1.
|
|
2
|
+
"version": "0.1.7",
|
|
3
3
|
"commands": {
|
|
4
4
|
"knock": {
|
|
5
5
|
"id": "knock",
|
|
@@ -86,6 +86,44 @@
|
|
|
86
86
|
},
|
|
87
87
|
"args": {}
|
|
88
88
|
},
|
|
89
|
+
"commit:get": {
|
|
90
|
+
"id": "commit:get",
|
|
91
|
+
"summary": "Display a single commit",
|
|
92
|
+
"strict": true,
|
|
93
|
+
"pluginName": "@knocklabs/cli",
|
|
94
|
+
"pluginAlias": "@knocklabs/cli",
|
|
95
|
+
"pluginType": "core",
|
|
96
|
+
"aliases": [],
|
|
97
|
+
"flags": {
|
|
98
|
+
"service-token": {
|
|
99
|
+
"name": "service-token",
|
|
100
|
+
"type": "option",
|
|
101
|
+
"summary": "The service token to authenticate with.",
|
|
102
|
+
"required": true,
|
|
103
|
+
"multiple": false
|
|
104
|
+
},
|
|
105
|
+
"api-origin": {
|
|
106
|
+
"name": "api-origin",
|
|
107
|
+
"type": "option",
|
|
108
|
+
"hidden": true,
|
|
109
|
+
"required": false,
|
|
110
|
+
"multiple": false
|
|
111
|
+
},
|
|
112
|
+
"json": {
|
|
113
|
+
"name": "json",
|
|
114
|
+
"type": "boolean",
|
|
115
|
+
"description": "Format output as json.",
|
|
116
|
+
"helpGroup": "GLOBAL",
|
|
117
|
+
"allowNo": false
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
"args": {
|
|
121
|
+
"id": {
|
|
122
|
+
"name": "id",
|
|
123
|
+
"required": true
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
},
|
|
89
127
|
"commit": {
|
|
90
128
|
"id": "commit",
|
|
91
129
|
"summary": "Commit all changes in development environment.",
|
|
@@ -135,9 +173,73 @@
|
|
|
135
173
|
},
|
|
136
174
|
"args": {}
|
|
137
175
|
},
|
|
176
|
+
"commit:list": {
|
|
177
|
+
"id": "commit:list",
|
|
178
|
+
"summary": "Display all commits in an environment",
|
|
179
|
+
"strict": true,
|
|
180
|
+
"pluginName": "@knocklabs/cli",
|
|
181
|
+
"pluginAlias": "@knocklabs/cli",
|
|
182
|
+
"pluginType": "core",
|
|
183
|
+
"aliases": [],
|
|
184
|
+
"flags": {
|
|
185
|
+
"service-token": {
|
|
186
|
+
"name": "service-token",
|
|
187
|
+
"type": "option",
|
|
188
|
+
"summary": "The service token to authenticate with.",
|
|
189
|
+
"required": true,
|
|
190
|
+
"multiple": false
|
|
191
|
+
},
|
|
192
|
+
"api-origin": {
|
|
193
|
+
"name": "api-origin",
|
|
194
|
+
"type": "option",
|
|
195
|
+
"hidden": true,
|
|
196
|
+
"required": false,
|
|
197
|
+
"multiple": false
|
|
198
|
+
},
|
|
199
|
+
"environment": {
|
|
200
|
+
"name": "environment",
|
|
201
|
+
"type": "option",
|
|
202
|
+
"summary": "The environment to use.",
|
|
203
|
+
"multiple": false,
|
|
204
|
+
"default": "development"
|
|
205
|
+
},
|
|
206
|
+
"promoted": {
|
|
207
|
+
"name": "promoted",
|
|
208
|
+
"type": "boolean",
|
|
209
|
+
"summary": "Show only promoted or unpromoted changes between the given environment and the subsequent environment.",
|
|
210
|
+
"allowNo": true
|
|
211
|
+
},
|
|
212
|
+
"after": {
|
|
213
|
+
"name": "after",
|
|
214
|
+
"type": "option",
|
|
215
|
+
"summary": "The cursor after which to fetch the next page.",
|
|
216
|
+
"multiple": false
|
|
217
|
+
},
|
|
218
|
+
"before": {
|
|
219
|
+
"name": "before",
|
|
220
|
+
"type": "option",
|
|
221
|
+
"summary": "The cursor before which to fetch the previous page.",
|
|
222
|
+
"multiple": false
|
|
223
|
+
},
|
|
224
|
+
"limit": {
|
|
225
|
+
"name": "limit",
|
|
226
|
+
"type": "option",
|
|
227
|
+
"summary": "The total number of entries to fetch per page.",
|
|
228
|
+
"multiple": false
|
|
229
|
+
},
|
|
230
|
+
"json": {
|
|
231
|
+
"name": "json",
|
|
232
|
+
"type": "boolean",
|
|
233
|
+
"description": "Format output as json.",
|
|
234
|
+
"helpGroup": "GLOBAL",
|
|
235
|
+
"allowNo": false
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
"args": {}
|
|
239
|
+
},
|
|
138
240
|
"commit:promote": {
|
|
139
241
|
"id": "commit:promote",
|
|
140
|
-
"summary": "Promote all
|
|
242
|
+
"summary": "Promote one or all commits to the subsequent environment.",
|
|
141
243
|
"strict": true,
|
|
142
244
|
"pluginName": "@knocklabs/cli",
|
|
143
245
|
"pluginAlias": "@knocklabs/cli",
|
|
@@ -161,8 +263,7 @@
|
|
|
161
263
|
"to": {
|
|
162
264
|
"name": "to",
|
|
163
265
|
"type": "option",
|
|
164
|
-
"summary": "The destination environment to promote changes from the preceding environment.",
|
|
165
|
-
"required": true,
|
|
266
|
+
"summary": "The destination environment to promote all changes from the preceding environment.",
|
|
166
267
|
"multiple": false
|
|
167
268
|
},
|
|
168
269
|
"force": {
|
|
@@ -170,6 +271,12 @@
|
|
|
170
271
|
"type": "boolean",
|
|
171
272
|
"summary": "Remove the confirmation prompt.",
|
|
172
273
|
"allowNo": false
|
|
274
|
+
},
|
|
275
|
+
"only": {
|
|
276
|
+
"name": "only",
|
|
277
|
+
"type": "option",
|
|
278
|
+
"summary": "The target commit id to promote to the subsequent environment",
|
|
279
|
+
"multiple": false
|
|
173
280
|
}
|
|
174
281
|
},
|
|
175
282
|
"args": {}
|
|
@@ -181,10 +288,7 @@
|
|
|
181
288
|
"pluginName": "@knocklabs/cli",
|
|
182
289
|
"pluginAlias": "@knocklabs/cli",
|
|
183
290
|
"pluginType": "core",
|
|
184
|
-
"aliases": [
|
|
185
|
-
"email-layout:get",
|
|
186
|
-
"email_layout:get"
|
|
187
|
-
],
|
|
291
|
+
"aliases": [],
|
|
188
292
|
"flags": {
|
|
189
293
|
"service-token": {
|
|
190
294
|
"name": "service-token",
|
|
@@ -235,10 +339,7 @@
|
|
|
235
339
|
"pluginName": "@knocklabs/cli",
|
|
236
340
|
"pluginAlias": "@knocklabs/cli",
|
|
237
341
|
"pluginType": "core",
|
|
238
|
-
"aliases": [
|
|
239
|
-
"email-layout:list",
|
|
240
|
-
"email_layout:list"
|
|
241
|
-
],
|
|
342
|
+
"aliases": [],
|
|
242
343
|
"flags": {
|
|
243
344
|
"service-token": {
|
|
244
345
|
"name": "service-token",
|
|
@@ -302,10 +403,7 @@
|
|
|
302
403
|
"pluginName": "@knocklabs/cli",
|
|
303
404
|
"pluginAlias": "@knocklabs/cli",
|
|
304
405
|
"pluginType": "core",
|
|
305
|
-
"aliases": [
|
|
306
|
-
"email-layout:pull",
|
|
307
|
-
"email_layout:pull"
|
|
308
|
-
],
|
|
406
|
+
"aliases": [],
|
|
309
407
|
"flags": {
|
|
310
408
|
"service-token": {
|
|
311
409
|
"name": "service-token",
|
|
@@ -373,10 +471,7 @@
|
|
|
373
471
|
"pluginName": "@knocklabs/cli",
|
|
374
472
|
"pluginAlias": "@knocklabs/cli",
|
|
375
473
|
"pluginType": "core",
|
|
376
|
-
"aliases": [
|
|
377
|
-
"email-layout:push",
|
|
378
|
-
"email_layout:push"
|
|
379
|
-
],
|
|
474
|
+
"aliases": [],
|
|
380
475
|
"flags": {
|
|
381
476
|
"service-token": {
|
|
382
477
|
"name": "service-token",
|
|
@@ -451,10 +546,7 @@
|
|
|
451
546
|
"pluginName": "@knocklabs/cli",
|
|
452
547
|
"pluginAlias": "@knocklabs/cli",
|
|
453
548
|
"pluginType": "core",
|
|
454
|
-
"aliases": [
|
|
455
|
-
"email-layout:validate",
|
|
456
|
-
"email_layout:validate"
|
|
457
|
-
],
|
|
549
|
+
"aliases": [],
|
|
458
550
|
"flags": {
|
|
459
551
|
"service-token": {
|
|
460
552
|
"name": "service-token",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@knocklabs/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Knock CLI",
|
|
5
5
|
"author": "@knocklabs",
|
|
6
6
|
"bin": {
|
|
@@ -21,24 +21,24 @@
|
|
|
21
21
|
"@oclif/plugin-help": "^5",
|
|
22
22
|
"@oclif/plugin-plugins": "^3",
|
|
23
23
|
"@prantlf/jsonlint": "^14.0.3",
|
|
24
|
-
"axios": "^1.
|
|
24
|
+
"axios": "^1.5.1",
|
|
25
25
|
"date-fns": "^2.30.0",
|
|
26
26
|
"enquirer": "^2.4.1",
|
|
27
27
|
"fs-extra": "^11.1.1",
|
|
28
|
-
"liquidjs": "^10.
|
|
28
|
+
"liquidjs": "^10.9.3",
|
|
29
29
|
"locale-codes": "^1.3.1",
|
|
30
30
|
"lodash": "^4.17.21",
|
|
31
|
-
"yup": "^1.2
|
|
31
|
+
"yup": "^1.3.2"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@oclif/test": "^2.
|
|
34
|
+
"@oclif/test": "^2.5.6",
|
|
35
35
|
"@swc/cli": "^0.1.62",
|
|
36
36
|
"@swc/core": "^1.3.37",
|
|
37
37
|
"@swc/helpers": "^0.4.14",
|
|
38
38
|
"@types/chai": "^4",
|
|
39
|
-
"@types/fs-extra": "^11.0.
|
|
39
|
+
"@types/fs-extra": "^11.0.3",
|
|
40
40
|
"@types/mocha": "^10.0.1",
|
|
41
|
-
"@types/node": "^20.
|
|
41
|
+
"@types/node": "^20.9.0",
|
|
42
42
|
"chai": "^4",
|
|
43
43
|
"eslint": "^7.32.0",
|
|
44
44
|
"eslint-config-oclif": "^4",
|
|
@@ -47,14 +47,14 @@
|
|
|
47
47
|
"eslint-plugin-prettier": "^4.2.1",
|
|
48
48
|
"eslint-plugin-simple-import-sort": "^10.0.0",
|
|
49
49
|
"mocha": "^10",
|
|
50
|
-
"nock": "^13.3.
|
|
50
|
+
"nock": "^13.3.8",
|
|
51
51
|
"oclif": "^3",
|
|
52
52
|
"prettier": "2.8.8",
|
|
53
53
|
"shx": "^0.3.4",
|
|
54
54
|
"sinon": "^15.2.0",
|
|
55
55
|
"ts-node": "^10.9.1",
|
|
56
56
|
"tsconfig-paths": "^4.2.0",
|
|
57
|
-
"tslib": "^2.6.
|
|
57
|
+
"tslib": "^2.6.2",
|
|
58
58
|
"typescript": "^5.1.6"
|
|
59
59
|
},
|
|
60
60
|
"oclif": {
|