@knocklabs/cli 0.1.4 → 0.1.5
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 +407 -4
- package/dist/commands/layout/get.js +98 -0
- package/dist/commands/layout/list.js +86 -0
- package/dist/commands/layout/pull.js +199 -0
- package/dist/commands/layout/push.js +159 -0
- package/dist/commands/layout/validate.js +134 -0
- package/dist/commands/workflow/get.js +39 -7
- package/dist/commands/workflow/list.js +4 -1
- package/dist/lib/api-v1.js +47 -0
- package/dist/lib/marshal/email-layout/helpers.js +124 -0
- package/dist/lib/marshal/email-layout/index.js +19 -0
- package/dist/lib/marshal/email-layout/reader.js +193 -0
- package/dist/lib/marshal/email-layout/types.js +4 -0
- package/dist/lib/marshal/email-layout/writer.js +240 -0
- package/dist/lib/marshal/shared/helpers.js +135 -0
- package/dist/lib/marshal/workflow/generator.js +3 -2
- package/dist/lib/marshal/workflow/helpers.js +27 -5
- package/dist/lib/marshal/workflow/reader.js +8 -106
- package/dist/lib/marshal/workflow/types.js +1 -0
- package/dist/lib/marshal/workflow/writer.js +76 -40
- package/dist/lib/run-context/loader.js +11 -0
- package/oclif.manifest.json +333 -1
- package/package.json +9 -6
package/oclif.manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.1.
|
|
2
|
+
"version": "0.1.5",
|
|
3
3
|
"commands": {
|
|
4
4
|
"knock": {
|
|
5
5
|
"id": "knock",
|
|
@@ -174,6 +174,338 @@
|
|
|
174
174
|
},
|
|
175
175
|
"args": {}
|
|
176
176
|
},
|
|
177
|
+
"layout:get": {
|
|
178
|
+
"id": "layout:get",
|
|
179
|
+
"summary": "Display a single email layout from an environment.",
|
|
180
|
+
"strict": true,
|
|
181
|
+
"pluginName": "@knocklabs/cli",
|
|
182
|
+
"pluginAlias": "@knocklabs/cli",
|
|
183
|
+
"pluginType": "core",
|
|
184
|
+
"aliases": [
|
|
185
|
+
"email-layout:get",
|
|
186
|
+
"email_layout:get"
|
|
187
|
+
],
|
|
188
|
+
"flags": {
|
|
189
|
+
"service-token": {
|
|
190
|
+
"name": "service-token",
|
|
191
|
+
"type": "option",
|
|
192
|
+
"summary": "The service token to authenticate with.",
|
|
193
|
+
"required": true,
|
|
194
|
+
"multiple": false
|
|
195
|
+
},
|
|
196
|
+
"api-origin": {
|
|
197
|
+
"name": "api-origin",
|
|
198
|
+
"type": "option",
|
|
199
|
+
"hidden": true,
|
|
200
|
+
"required": false,
|
|
201
|
+
"multiple": false
|
|
202
|
+
},
|
|
203
|
+
"environment": {
|
|
204
|
+
"name": "environment",
|
|
205
|
+
"type": "option",
|
|
206
|
+
"summary": "The environment to use.",
|
|
207
|
+
"multiple": false,
|
|
208
|
+
"default": "development"
|
|
209
|
+
},
|
|
210
|
+
"hide-uncommitted-changes": {
|
|
211
|
+
"name": "hide-uncommitted-changes",
|
|
212
|
+
"type": "boolean",
|
|
213
|
+
"summary": "Hide any uncommitted changes.",
|
|
214
|
+
"allowNo": false
|
|
215
|
+
},
|
|
216
|
+
"json": {
|
|
217
|
+
"name": "json",
|
|
218
|
+
"type": "boolean",
|
|
219
|
+
"description": "Format output as json.",
|
|
220
|
+
"helpGroup": "GLOBAL",
|
|
221
|
+
"allowNo": false
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
"args": {
|
|
225
|
+
"emailLayoutKey": {
|
|
226
|
+
"name": "emailLayoutKey",
|
|
227
|
+
"required": true
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
"layout:list": {
|
|
232
|
+
"id": "layout:list",
|
|
233
|
+
"summary": "Display all email layouts for an environment.",
|
|
234
|
+
"strict": true,
|
|
235
|
+
"pluginName": "@knocklabs/cli",
|
|
236
|
+
"pluginAlias": "@knocklabs/cli",
|
|
237
|
+
"pluginType": "core",
|
|
238
|
+
"aliases": [
|
|
239
|
+
"email-layout:list",
|
|
240
|
+
"email_layout:list"
|
|
241
|
+
],
|
|
242
|
+
"flags": {
|
|
243
|
+
"service-token": {
|
|
244
|
+
"name": "service-token",
|
|
245
|
+
"type": "option",
|
|
246
|
+
"summary": "The service token to authenticate with.",
|
|
247
|
+
"required": true,
|
|
248
|
+
"multiple": false
|
|
249
|
+
},
|
|
250
|
+
"api-origin": {
|
|
251
|
+
"name": "api-origin",
|
|
252
|
+
"type": "option",
|
|
253
|
+
"hidden": true,
|
|
254
|
+
"required": false,
|
|
255
|
+
"multiple": false
|
|
256
|
+
},
|
|
257
|
+
"environment": {
|
|
258
|
+
"name": "environment",
|
|
259
|
+
"type": "option",
|
|
260
|
+
"summary": "The environment to use.",
|
|
261
|
+
"multiple": false,
|
|
262
|
+
"default": "development"
|
|
263
|
+
},
|
|
264
|
+
"hide-uncommitted-changes": {
|
|
265
|
+
"name": "hide-uncommitted-changes",
|
|
266
|
+
"type": "boolean",
|
|
267
|
+
"summary": "Hide any uncommitted changes.",
|
|
268
|
+
"allowNo": false
|
|
269
|
+
},
|
|
270
|
+
"after": {
|
|
271
|
+
"name": "after",
|
|
272
|
+
"type": "option",
|
|
273
|
+
"summary": "The cursor after which to fetch the next page.",
|
|
274
|
+
"multiple": false
|
|
275
|
+
},
|
|
276
|
+
"before": {
|
|
277
|
+
"name": "before",
|
|
278
|
+
"type": "option",
|
|
279
|
+
"summary": "The cursor before which to fetch the previous page.",
|
|
280
|
+
"multiple": false
|
|
281
|
+
},
|
|
282
|
+
"limit": {
|
|
283
|
+
"name": "limit",
|
|
284
|
+
"type": "option",
|
|
285
|
+
"summary": "The total number of entries to fetch per page.",
|
|
286
|
+
"multiple": false
|
|
287
|
+
},
|
|
288
|
+
"json": {
|
|
289
|
+
"name": "json",
|
|
290
|
+
"type": "boolean",
|
|
291
|
+
"description": "Format output as json.",
|
|
292
|
+
"helpGroup": "GLOBAL",
|
|
293
|
+
"allowNo": false
|
|
294
|
+
}
|
|
295
|
+
},
|
|
296
|
+
"args": {}
|
|
297
|
+
},
|
|
298
|
+
"layout:pull": {
|
|
299
|
+
"id": "layout:pull",
|
|
300
|
+
"summary": "Pull one or more email layouts from an environment into a local file system.",
|
|
301
|
+
"strict": true,
|
|
302
|
+
"pluginName": "@knocklabs/cli",
|
|
303
|
+
"pluginAlias": "@knocklabs/cli",
|
|
304
|
+
"pluginType": "core",
|
|
305
|
+
"aliases": [
|
|
306
|
+
"email-layout:pull",
|
|
307
|
+
"email_layout:pull"
|
|
308
|
+
],
|
|
309
|
+
"flags": {
|
|
310
|
+
"service-token": {
|
|
311
|
+
"name": "service-token",
|
|
312
|
+
"type": "option",
|
|
313
|
+
"summary": "The service token to authenticate with.",
|
|
314
|
+
"required": true,
|
|
315
|
+
"multiple": false
|
|
316
|
+
},
|
|
317
|
+
"api-origin": {
|
|
318
|
+
"name": "api-origin",
|
|
319
|
+
"type": "option",
|
|
320
|
+
"hidden": true,
|
|
321
|
+
"required": false,
|
|
322
|
+
"multiple": false
|
|
323
|
+
},
|
|
324
|
+
"environment": {
|
|
325
|
+
"name": "environment",
|
|
326
|
+
"type": "option",
|
|
327
|
+
"summary": "The environment to use.",
|
|
328
|
+
"multiple": false,
|
|
329
|
+
"default": "development"
|
|
330
|
+
},
|
|
331
|
+
"all": {
|
|
332
|
+
"name": "all",
|
|
333
|
+
"type": "boolean",
|
|
334
|
+
"summary": "Whether to pull all email layouts from the specified environment.",
|
|
335
|
+
"allowNo": false
|
|
336
|
+
},
|
|
337
|
+
"layouts-dir": {
|
|
338
|
+
"name": "layouts-dir",
|
|
339
|
+
"type": "option",
|
|
340
|
+
"summary": "The target directory path to pull all email layouts into.",
|
|
341
|
+
"multiple": false,
|
|
342
|
+
"dependsOn": [
|
|
343
|
+
"all"
|
|
344
|
+
],
|
|
345
|
+
"aliases": [
|
|
346
|
+
"email-layouts-dir"
|
|
347
|
+
]
|
|
348
|
+
},
|
|
349
|
+
"hide-uncommitted-changes": {
|
|
350
|
+
"name": "hide-uncommitted-changes",
|
|
351
|
+
"type": "boolean",
|
|
352
|
+
"summary": "Hide any uncommitted changes.",
|
|
353
|
+
"allowNo": false
|
|
354
|
+
},
|
|
355
|
+
"force": {
|
|
356
|
+
"name": "force",
|
|
357
|
+
"type": "boolean",
|
|
358
|
+
"summary": "Remove the confirmation prompt.",
|
|
359
|
+
"allowNo": false
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
"args": {
|
|
363
|
+
"emailLayoutKey": {
|
|
364
|
+
"name": "emailLayoutKey",
|
|
365
|
+
"required": false
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
},
|
|
369
|
+
"layout:push": {
|
|
370
|
+
"id": "layout:push",
|
|
371
|
+
"summary": "Push one or more email layouts from a local file system to Knock.",
|
|
372
|
+
"strict": true,
|
|
373
|
+
"pluginName": "@knocklabs/cli",
|
|
374
|
+
"pluginAlias": "@knocklabs/cli",
|
|
375
|
+
"pluginType": "core",
|
|
376
|
+
"aliases": [
|
|
377
|
+
"email-layout:push",
|
|
378
|
+
"email_layout:push"
|
|
379
|
+
],
|
|
380
|
+
"flags": {
|
|
381
|
+
"service-token": {
|
|
382
|
+
"name": "service-token",
|
|
383
|
+
"type": "option",
|
|
384
|
+
"summary": "The service token to authenticate with.",
|
|
385
|
+
"required": true,
|
|
386
|
+
"multiple": false
|
|
387
|
+
},
|
|
388
|
+
"api-origin": {
|
|
389
|
+
"name": "api-origin",
|
|
390
|
+
"type": "option",
|
|
391
|
+
"hidden": true,
|
|
392
|
+
"required": false,
|
|
393
|
+
"multiple": false
|
|
394
|
+
},
|
|
395
|
+
"environment": {
|
|
396
|
+
"name": "environment",
|
|
397
|
+
"type": "option",
|
|
398
|
+
"summary": "Pushing an email layout is only allowed in the development environment",
|
|
399
|
+
"multiple": false,
|
|
400
|
+
"options": [
|
|
401
|
+
"development"
|
|
402
|
+
],
|
|
403
|
+
"default": "development"
|
|
404
|
+
},
|
|
405
|
+
"all": {
|
|
406
|
+
"name": "all",
|
|
407
|
+
"type": "boolean",
|
|
408
|
+
"summary": "Whether to push all layouts from the target directory.",
|
|
409
|
+
"allowNo": false
|
|
410
|
+
},
|
|
411
|
+
"layouts-dir": {
|
|
412
|
+
"name": "layouts-dir",
|
|
413
|
+
"type": "option",
|
|
414
|
+
"summary": "The target directory path to find all layouts to push.",
|
|
415
|
+
"multiple": false,
|
|
416
|
+
"dependsOn": [
|
|
417
|
+
"all"
|
|
418
|
+
],
|
|
419
|
+
"aliases": [
|
|
420
|
+
"email-layouts-dir"
|
|
421
|
+
]
|
|
422
|
+
},
|
|
423
|
+
"commit": {
|
|
424
|
+
"name": "commit",
|
|
425
|
+
"type": "boolean",
|
|
426
|
+
"summary": "Push and commit the layout(s) at the same time",
|
|
427
|
+
"allowNo": false
|
|
428
|
+
},
|
|
429
|
+
"commit-message": {
|
|
430
|
+
"name": "commit-message",
|
|
431
|
+
"type": "option",
|
|
432
|
+
"char": "m",
|
|
433
|
+
"summary": "Use the given value as the commit message",
|
|
434
|
+
"multiple": false,
|
|
435
|
+
"dependsOn": [
|
|
436
|
+
"commit"
|
|
437
|
+
]
|
|
438
|
+
}
|
|
439
|
+
},
|
|
440
|
+
"args": {
|
|
441
|
+
"emailLayoutKey": {
|
|
442
|
+
"name": "emailLayoutKey",
|
|
443
|
+
"required": false
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
},
|
|
447
|
+
"layout:validate": {
|
|
448
|
+
"id": "layout:validate",
|
|
449
|
+
"summary": "Validate one or more layouts from a local file system.",
|
|
450
|
+
"strict": true,
|
|
451
|
+
"pluginName": "@knocklabs/cli",
|
|
452
|
+
"pluginAlias": "@knocklabs/cli",
|
|
453
|
+
"pluginType": "core",
|
|
454
|
+
"aliases": [
|
|
455
|
+
"email-layout:validate",
|
|
456
|
+
"email_layout:validate"
|
|
457
|
+
],
|
|
458
|
+
"flags": {
|
|
459
|
+
"service-token": {
|
|
460
|
+
"name": "service-token",
|
|
461
|
+
"type": "option",
|
|
462
|
+
"summary": "The service token to authenticate with.",
|
|
463
|
+
"required": true,
|
|
464
|
+
"multiple": false
|
|
465
|
+
},
|
|
466
|
+
"api-origin": {
|
|
467
|
+
"name": "api-origin",
|
|
468
|
+
"type": "option",
|
|
469
|
+
"hidden": true,
|
|
470
|
+
"required": false,
|
|
471
|
+
"multiple": false
|
|
472
|
+
},
|
|
473
|
+
"environment": {
|
|
474
|
+
"name": "environment",
|
|
475
|
+
"type": "option",
|
|
476
|
+
"summary": "Validating a layout is only done in the development environment",
|
|
477
|
+
"multiple": false,
|
|
478
|
+
"options": [
|
|
479
|
+
"development"
|
|
480
|
+
],
|
|
481
|
+
"default": "development"
|
|
482
|
+
},
|
|
483
|
+
"all": {
|
|
484
|
+
"name": "all",
|
|
485
|
+
"type": "boolean",
|
|
486
|
+
"summary": "Whether to validate all layouts from the target directory.",
|
|
487
|
+
"allowNo": false
|
|
488
|
+
},
|
|
489
|
+
"layouts-dir": {
|
|
490
|
+
"name": "layouts-dir",
|
|
491
|
+
"type": "option",
|
|
492
|
+
"summary": "The target directory path to find all layouts to validate.",
|
|
493
|
+
"multiple": false,
|
|
494
|
+
"dependsOn": [
|
|
495
|
+
"all"
|
|
496
|
+
],
|
|
497
|
+
"aliases": [
|
|
498
|
+
"email-layouts-dir"
|
|
499
|
+
]
|
|
500
|
+
}
|
|
501
|
+
},
|
|
502
|
+
"args": {
|
|
503
|
+
"emailLayoutKey": {
|
|
504
|
+
"name": "emailLayoutKey",
|
|
505
|
+
"required": false
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
},
|
|
177
509
|
"translation:get": {
|
|
178
510
|
"id": "translation:get",
|
|
179
511
|
"summary": "Display a single translation from an environment.",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@knocklabs/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Knock CLI",
|
|
5
5
|
"author": "@knocklabs",
|
|
6
6
|
"bin": {
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"@prantlf/jsonlint": "^14.0.3",
|
|
24
24
|
"axios": "^1.4.0",
|
|
25
25
|
"date-fns": "^2.30.0",
|
|
26
|
-
"enquirer": "^2.
|
|
26
|
+
"enquirer": "^2.4.1",
|
|
27
27
|
"fs-extra": "^11.1.1",
|
|
28
|
-
"liquidjs": "^10.8.
|
|
28
|
+
"liquidjs": "^10.8.4",
|
|
29
29
|
"locale-codes": "^1.3.1",
|
|
30
30
|
"lodash": "^4.17.21",
|
|
31
31
|
"yup": "^1.2.0"
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"eslint": "^7.32.0",
|
|
44
44
|
"eslint-config-oclif": "^4",
|
|
45
45
|
"eslint-config-oclif-typescript": "^1.0.3",
|
|
46
|
-
"eslint-config-prettier": "^8.
|
|
46
|
+
"eslint-config-prettier": "^8.10.0",
|
|
47
47
|
"eslint-plugin-prettier": "^4.2.1",
|
|
48
48
|
"eslint-plugin-simple-import-sort": "^10.0.0",
|
|
49
49
|
"mocha": "^10",
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"sinon": "^15.2.0",
|
|
55
55
|
"ts-node": "^10.9.1",
|
|
56
56
|
"tsconfig-paths": "^4.2.0",
|
|
57
|
-
"tslib": "^2.
|
|
58
|
-
"typescript": "^5.1.
|
|
57
|
+
"tslib": "^2.6.0",
|
|
58
|
+
"typescript": "^5.1.6"
|
|
59
59
|
},
|
|
60
60
|
"oclif": {
|
|
61
61
|
"bin": "knock",
|
|
@@ -75,6 +75,9 @@
|
|
|
75
75
|
},
|
|
76
76
|
"translation": {
|
|
77
77
|
"description": "Manage translation files."
|
|
78
|
+
},
|
|
79
|
+
"layout": {
|
|
80
|
+
"description": "Manage email layouts."
|
|
78
81
|
}
|
|
79
82
|
}
|
|
80
83
|
},
|