@knocklabs/cli 0.2.4 → 0.3.0
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 +80 -84
- package/dist/commands/commit/list.js +11 -5
- package/dist/commands/guide/pull.js +6 -2
- package/dist/commands/guide/push.js +5 -6
- package/dist/commands/guide/validate.js +2 -5
- package/dist/commands/layout/pull.js +6 -2
- package/dist/commands/layout/push.js +3 -1
- package/dist/commands/message-type/pull.js +6 -2
- package/dist/commands/message-type/push.js +3 -1
- package/dist/commands/partial/pull.js +6 -2
- package/dist/commands/partial/push.js +3 -1
- package/dist/commands/translation/get.js +1 -0
- package/dist/commands/translation/list.js +1 -0
- package/dist/commands/translation/pull.js +1 -0
- package/dist/commands/translation/push.js +1 -0
- package/dist/commands/translation/validate.js +1 -0
- package/dist/commands/workflow/new.js +8 -9
- package/dist/commands/workflow/pull.js +6 -2
- package/dist/commands/workflow/push.js +5 -6
- package/dist/commands/workflow/validate.js +2 -5
- package/dist/lib/base-command.js +17 -1
- package/dist/lib/helpers/account-features.js +53 -0
- package/dist/lib/marshal/email-layout/processor.isomorphic.js +3 -2
- package/dist/lib/marshal/email-layout/writer.js +6 -4
- package/dist/lib/marshal/guide/processor.isomorphic.js +3 -2
- package/dist/lib/marshal/guide/writer.js +6 -4
- package/dist/lib/marshal/message-type/processor.isomorphic.js +3 -2
- package/dist/lib/marshal/message-type/writer.js +6 -4
- package/dist/lib/marshal/partial/processor.isomorphic.js +3 -2
- package/dist/lib/marshal/partial/writer.js +6 -4
- package/dist/lib/marshal/shared/helpers.isomorphic.js +7 -1
- package/dist/lib/marshal/workflow/processor.isomorphic.js +3 -2
- package/dist/lib/marshal/workflow/writer.js +6 -4
- package/oclif.manifest.json +20 -19
- package/package.json +7 -4
|
@@ -71,13 +71,15 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
71
71
|
}
|
|
72
72
|
return newObj;
|
|
73
73
|
}
|
|
74
|
-
const
|
|
74
|
+
const WORKFLOW_SCHEMA = "https://schemas.knock.app/cli/workflow.json";
|
|
75
|
+
const writeWorkflowDirFromData = async (workflowDirCtx, remoteWorkflow, options)=>{
|
|
76
|
+
const { withSchema = false } = options || {};
|
|
75
77
|
// If the workflow directory exists on the file system (i.e. previously
|
|
76
78
|
// pulled before), then read the workflow file to use as a reference.
|
|
77
79
|
const [localWorkflow] = workflowDirCtx.exists ? await (0, _reader.readWorkflowDir)(workflowDirCtx, {
|
|
78
80
|
withExtractedFiles: true
|
|
79
81
|
}) : [];
|
|
80
|
-
const bundle = (0, _processorisomorphic.buildWorkflowDirBundle)(remoteWorkflow, localWorkflow);
|
|
82
|
+
const bundle = (0, _processorisomorphic.buildWorkflowDirBundle)(remoteWorkflow, localWorkflow, withSchema ? WORKFLOW_SCHEMA : undefined);
|
|
81
83
|
return writeWorkflowDirFromBundle(workflowDirCtx, bundle);
|
|
82
84
|
};
|
|
83
85
|
const writeWorkflowDirFromBundle = async (workflowDirCtx, workflowDirBundle)=>{
|
|
@@ -132,7 +134,7 @@ const writeWorkflowDirFromBundle = async (workflowDirCtx, workflowDirBundle)=>{
|
|
|
132
134
|
});
|
|
133
135
|
await Promise.all(promises);
|
|
134
136
|
};
|
|
135
|
-
const writeWorkflowsIndexDir = async (indexDirCtx, remoteWorkflows)=>{
|
|
137
|
+
const writeWorkflowsIndexDir = async (indexDirCtx, remoteWorkflows, options)=>{
|
|
136
138
|
const backupDirPath = _nodepath.resolve(_const.sandboxDir, (0, _lodash.uniqueId)("backup"));
|
|
137
139
|
try {
|
|
138
140
|
// If the index directory already exists, back it up in the temp sandbox
|
|
@@ -150,7 +152,7 @@ const writeWorkflowsIndexDir = async (indexDirCtx, remoteWorkflows)=>{
|
|
|
150
152
|
abspath: workflowDirPath,
|
|
151
153
|
exists: indexDirCtx.exists ? await (0, _helpers.isWorkflowDir)(workflowDirPath) : false
|
|
152
154
|
};
|
|
153
|
-
return writeWorkflowDirFromData(workflowDirCtx, workflow);
|
|
155
|
+
return writeWorkflowDirFromData(workflowDirCtx, workflow, options);
|
|
154
156
|
});
|
|
155
157
|
await Promise.all(writeWorkflowDirPromises);
|
|
156
158
|
} catch (error) {
|
package/oclif.manifest.json
CHANGED
|
@@ -761,9 +761,9 @@
|
|
|
761
761
|
},
|
|
762
762
|
"resource-type": {
|
|
763
763
|
"name": "resource-type",
|
|
764
|
-
"summary": "Filter commits by resource type.
|
|
764
|
+
"summary": "Filter commits by resource type. Can be used alone or together with resource-id. Use multiple --resource-type flags for multiple values.",
|
|
765
765
|
"hasDynamicHelp": false,
|
|
766
|
-
"multiple":
|
|
766
|
+
"multiple": true,
|
|
767
767
|
"options": [
|
|
768
768
|
"email_layout",
|
|
769
769
|
"guide",
|
|
@@ -1322,13 +1322,10 @@
|
|
|
1322
1322
|
},
|
|
1323
1323
|
"environment": {
|
|
1324
1324
|
"name": "environment",
|
|
1325
|
-
"summary": "
|
|
1325
|
+
"summary": "The environment to push the guide to. Defaults to development.",
|
|
1326
1326
|
"default": "development",
|
|
1327
1327
|
"hasDynamicHelp": false,
|
|
1328
1328
|
"multiple": false,
|
|
1329
|
-
"options": [
|
|
1330
|
-
"development"
|
|
1331
|
-
],
|
|
1332
1329
|
"type": "option"
|
|
1333
1330
|
},
|
|
1334
1331
|
"branch": {
|
|
@@ -1418,13 +1415,10 @@
|
|
|
1418
1415
|
},
|
|
1419
1416
|
"environment": {
|
|
1420
1417
|
"name": "environment",
|
|
1421
|
-
"summary": "
|
|
1418
|
+
"summary": "The environment to validate the guide in. Defaults to development.",
|
|
1422
1419
|
"default": "development",
|
|
1423
1420
|
"hasDynamicHelp": false,
|
|
1424
1421
|
"multiple": false,
|
|
1425
|
-
"options": [
|
|
1426
|
-
"development"
|
|
1427
|
-
],
|
|
1428
1422
|
"type": "option"
|
|
1429
1423
|
},
|
|
1430
1424
|
"branch": {
|
|
@@ -2831,6 +2825,7 @@
|
|
|
2831
2825
|
"strict": true,
|
|
2832
2826
|
"summary": "Display a single translation from an environment.",
|
|
2833
2827
|
"enableJsonFlag": true,
|
|
2828
|
+
"verifyFeatureEnabled": "translations",
|
|
2834
2829
|
"isESM": false,
|
|
2835
2830
|
"relativePath": [
|
|
2836
2831
|
"dist",
|
|
@@ -2920,6 +2915,7 @@
|
|
|
2920
2915
|
"strict": true,
|
|
2921
2916
|
"summary": "Display all translations for an environment.",
|
|
2922
2917
|
"enableJsonFlag": true,
|
|
2918
|
+
"verifyFeatureEnabled": "translations",
|
|
2923
2919
|
"isESM": false,
|
|
2924
2920
|
"relativePath": [
|
|
2925
2921
|
"dist",
|
|
@@ -3021,6 +3017,7 @@
|
|
|
3021
3017
|
"strict": true,
|
|
3022
3018
|
"summary": "Pull one or more translations from an environment into a local file system.",
|
|
3023
3019
|
"enableJsonFlag": false,
|
|
3020
|
+
"verifyFeatureEnabled": "translations",
|
|
3024
3021
|
"isESM": false,
|
|
3025
3022
|
"relativePath": [
|
|
3026
3023
|
"dist",
|
|
@@ -3118,6 +3115,7 @@
|
|
|
3118
3115
|
"strict": true,
|
|
3119
3116
|
"summary": "Push one or more translations from a local file system to Knock.",
|
|
3120
3117
|
"enableJsonFlag": false,
|
|
3118
|
+
"verifyFeatureEnabled": "translations",
|
|
3121
3119
|
"isESM": false,
|
|
3122
3120
|
"relativePath": [
|
|
3123
3121
|
"dist",
|
|
@@ -3198,6 +3196,7 @@
|
|
|
3198
3196
|
"strict": true,
|
|
3199
3197
|
"summary": "Validate one or more translations from a local file system.",
|
|
3200
3198
|
"enableJsonFlag": false,
|
|
3199
|
+
"verifyFeatureEnabled": "translations",
|
|
3201
3200
|
"isESM": false,
|
|
3202
3201
|
"relativePath": [
|
|
3203
3202
|
"dist",
|
|
@@ -3549,6 +3548,14 @@
|
|
|
3549
3548
|
"name": "force",
|
|
3550
3549
|
"allowNo": false,
|
|
3551
3550
|
"type": "boolean"
|
|
3551
|
+
},
|
|
3552
|
+
"environment": {
|
|
3553
|
+
"hidden": true,
|
|
3554
|
+
"name": "environment",
|
|
3555
|
+
"default": "development",
|
|
3556
|
+
"hasDynamicHelp": false,
|
|
3557
|
+
"multiple": false,
|
|
3558
|
+
"type": "option"
|
|
3552
3559
|
}
|
|
3553
3560
|
},
|
|
3554
3561
|
"hasDynamicHelp": false,
|
|
@@ -3684,13 +3691,10 @@
|
|
|
3684
3691
|
},
|
|
3685
3692
|
"environment": {
|
|
3686
3693
|
"name": "environment",
|
|
3687
|
-
"summary": "
|
|
3694
|
+
"summary": "The environment to push the workflow to. Defaults to development.",
|
|
3688
3695
|
"default": "development",
|
|
3689
3696
|
"hasDynamicHelp": false,
|
|
3690
3697
|
"multiple": false,
|
|
3691
|
-
"options": [
|
|
3692
|
-
"development"
|
|
3693
|
-
],
|
|
3694
3698
|
"type": "option"
|
|
3695
3699
|
},
|
|
3696
3700
|
"branch": {
|
|
@@ -3872,13 +3876,10 @@
|
|
|
3872
3876
|
},
|
|
3873
3877
|
"environment": {
|
|
3874
3878
|
"name": "environment",
|
|
3875
|
-
"summary": "
|
|
3879
|
+
"summary": "The environment to validate the workflow in. Defaults to development.",
|
|
3876
3880
|
"default": "development",
|
|
3877
3881
|
"hasDynamicHelp": false,
|
|
3878
3882
|
"multiple": false,
|
|
3879
|
-
"options": [
|
|
3880
|
-
"development"
|
|
3881
|
-
],
|
|
3882
3883
|
"type": "option"
|
|
3883
3884
|
},
|
|
3884
3885
|
"branch": {
|
|
@@ -3924,5 +3925,5 @@
|
|
|
3924
3925
|
]
|
|
3925
3926
|
}
|
|
3926
3927
|
},
|
|
3927
|
-
"version": "0.
|
|
3928
|
+
"version": "0.3.0"
|
|
3928
3929
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@knocklabs/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Knock CLI",
|
|
5
5
|
"author": "@knocklabs",
|
|
6
6
|
"bin": {
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
"@oclif/core": "^3",
|
|
22
22
|
"@oclif/plugin-help": "^6",
|
|
23
23
|
"@prantlf/jsonlint": "^14.1.0",
|
|
24
|
-
"axios": "^1.
|
|
24
|
+
"axios": "^1.12.2",
|
|
25
25
|
"date-fns": "^2.30.0",
|
|
26
26
|
"enquirer": "^2.4.1",
|
|
27
27
|
"find-up": "^5.0.0",
|
|
28
28
|
"fs-extra": "^11.3.2",
|
|
29
|
-
"liquidjs": "^10.
|
|
29
|
+
"liquidjs": "^10.22.0",
|
|
30
30
|
"locale-codes": "^1.3.1",
|
|
31
31
|
"lodash": "^4.17.21",
|
|
32
32
|
"open": "8.4.2",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@types/chai": "^4",
|
|
42
42
|
"@types/fs-extra": "^11.0.4",
|
|
43
43
|
"@types/mocha": "^10.0.10",
|
|
44
|
-
"@types/node": "^20.19.
|
|
44
|
+
"@types/node": "^20.19.22",
|
|
45
45
|
"chai": "^4",
|
|
46
46
|
"eslint": "^7.32.0",
|
|
47
47
|
"eslint-config-oclif": "^4",
|
|
@@ -64,6 +64,9 @@
|
|
|
64
64
|
"bin": "knock",
|
|
65
65
|
"dirname": "knock",
|
|
66
66
|
"commands": "./dist/commands",
|
|
67
|
+
"additionalHelpFlags": [
|
|
68
|
+
"-h"
|
|
69
|
+
],
|
|
67
70
|
"plugins": [
|
|
68
71
|
"@oclif/plugin-help"
|
|
69
72
|
],
|