@knocklabs/cli 0.1.7 → 0.1.8

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 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.7 linux-x64 node-v18.18.2
19
+ @knocklabs/cli/0.1.8 linux-x64 node-v18.18.2
20
20
  $ knock --help [COMMAND]
21
21
  USAGE
22
22
  $ knock COMMAND
@@ -77,7 +77,7 @@ FLAGS
77
77
  --service-token=<value> (required) The service token to authenticate with.
78
78
  ```
79
79
 
80
- _See code: [src/commands/commit/index.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/commit/index.ts)_
80
+ _See code: [src/commands/commit/index.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.8/src/commands/commit/index.ts)_
81
81
 
82
82
  ## `knock commit get ID`
83
83
 
@@ -94,7 +94,7 @@ GLOBAL FLAGS
94
94
  --json Format output as json.
95
95
  ```
96
96
 
97
- _See code: [src/commands/commit/get.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/commit/get.ts)_
97
+ _See code: [src/commands/commit/get.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.8/src/commands/commit/get.ts)_
98
98
 
99
99
  ## `knock commit list`
100
100
 
@@ -118,7 +118,7 @@ GLOBAL FLAGS
118
118
  --json Format output as json.
119
119
  ```
120
120
 
121
- _See code: [src/commands/commit/list.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/commit/list.ts)_
121
+ _See code: [src/commands/commit/list.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.8/src/commands/commit/list.ts)_
122
122
 
123
123
  ## `knock commit promote`
124
124
 
@@ -135,7 +135,7 @@ FLAGS
135
135
  --to=<value> The destination environment to promote all changes from the preceding environment.
136
136
  ```
137
137
 
138
- _See code: [src/commands/commit/promote.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/commit/promote.ts)_
138
+ _See code: [src/commands/commit/promote.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.8/src/commands/commit/promote.ts)_
139
139
 
140
140
  ## `knock help [COMMANDS]`
141
141
 
@@ -175,7 +175,7 @@ GLOBAL FLAGS
175
175
  --json Format output as json.
176
176
  ```
177
177
 
178
- _See code: [src/commands/layout/get.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/layout/get.ts)_
178
+ _See code: [src/commands/layout/get.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.8/src/commands/layout/get.ts)_
179
179
 
180
180
  ## `knock layout list`
181
181
 
@@ -198,7 +198,7 @@ GLOBAL FLAGS
198
198
  --json Format output as json.
199
199
  ```
200
200
 
201
- _See code: [src/commands/layout/list.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/layout/list.ts)_
201
+ _See code: [src/commands/layout/list.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.8/src/commands/layout/list.ts)_
202
202
 
203
203
  ## `knock layout pull [EMAILLAYOUTKEY]`
204
204
 
@@ -218,7 +218,7 @@ FLAGS
218
218
  --service-token=<value> (required) The service token to authenticate with.
219
219
  ```
220
220
 
221
- _See code: [src/commands/layout/pull.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/layout/pull.ts)_
221
+ _See code: [src/commands/layout/pull.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.8/src/commands/layout/pull.ts)_
222
222
 
223
223
  ## `knock layout push [EMAILLAYOUTKEY]`
224
224
 
@@ -240,7 +240,7 @@ FLAGS
240
240
  --service-token=<value> (required) The service token to authenticate with.
241
241
  ```
242
242
 
243
- _See code: [src/commands/layout/push.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/layout/push.ts)_
243
+ _See code: [src/commands/layout/push.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.8/src/commands/layout/push.ts)_
244
244
 
245
245
  ## `knock layout validate [EMAILLAYOUTKEY]`
246
246
 
@@ -259,7 +259,7 @@ FLAGS
259
259
  --service-token=<value> (required) The service token to authenticate with.
260
260
  ```
261
261
 
262
- _See code: [src/commands/layout/validate.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/layout/validate.ts)_
262
+ _See code: [src/commands/layout/validate.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.8/src/commands/layout/validate.ts)_
263
263
 
264
264
  ## `knock plugins`
265
265
 
@@ -531,7 +531,7 @@ GLOBAL FLAGS
531
531
  --json Format output as json.
532
532
  ```
533
533
 
534
- _See code: [src/commands/translation/get.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/translation/get.ts)_
534
+ _See code: [src/commands/translation/get.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.8/src/commands/translation/get.ts)_
535
535
 
536
536
  ## `knock translation list`
537
537
 
@@ -554,7 +554,7 @@ GLOBAL FLAGS
554
554
  --json Format output as json.
555
555
  ```
556
556
 
557
- _See code: [src/commands/translation/list.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/translation/list.ts)_
557
+ _See code: [src/commands/translation/list.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.8/src/commands/translation/list.ts)_
558
558
 
559
559
  ## `knock translation pull [TRANSLATIONREF]`
560
560
 
@@ -579,7 +579,7 @@ FLAGS
579
579
  --translations-dir=<value> The target directory path to pull all translations into.
580
580
  ```
581
581
 
582
- _See code: [src/commands/translation/pull.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/translation/pull.ts)_
582
+ _See code: [src/commands/translation/pull.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.8/src/commands/translation/pull.ts)_
583
583
 
584
584
  ## `knock translation push [TRANSLATIONREF]`
585
585
 
@@ -606,7 +606,7 @@ FLAGS
606
606
  --translations-dir=<value> The target directory path to find all translations to push.
607
607
  ```
608
608
 
609
- _See code: [src/commands/translation/push.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/translation/push.ts)_
609
+ _See code: [src/commands/translation/push.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.8/src/commands/translation/push.ts)_
610
610
 
611
611
  ## `knock translation validate [TRANSLATIONREF]`
612
612
 
@@ -631,7 +631,7 @@ FLAGS
631
631
  --translations-dir=<value> The target directory path to find all translations to validate.
632
632
  ```
633
633
 
634
- _See code: [src/commands/translation/validate.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/translation/validate.ts)_
634
+ _See code: [src/commands/translation/validate.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.8/src/commands/translation/validate.ts)_
635
635
 
636
636
  ## `knock whoami`
637
637
 
@@ -648,7 +648,7 @@ GLOBAL FLAGS
648
648
  --json Format output as json.
649
649
  ```
650
650
 
651
- _See code: [src/commands/whoami.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/whoami.ts)_
651
+ _See code: [src/commands/whoami.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.8/src/commands/whoami.ts)_
652
652
 
653
653
  ## `knock workflow activate WORKFLOWKEY`
654
654
 
@@ -675,7 +675,7 @@ DESCRIPTION
675
675
  with `false` in order to deactivate it.
676
676
  ```
677
677
 
678
- _See code: [src/commands/workflow/activate.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/workflow/activate.ts)_
678
+ _See code: [src/commands/workflow/activate.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.8/src/commands/workflow/activate.ts)_
679
679
 
680
680
  ## `knock workflow get WORKFLOWKEY`
681
681
 
@@ -695,7 +695,7 @@ GLOBAL FLAGS
695
695
  --json Format output as json.
696
696
  ```
697
697
 
698
- _See code: [src/commands/workflow/get.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/workflow/get.ts)_
698
+ _See code: [src/commands/workflow/get.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.8/src/commands/workflow/get.ts)_
699
699
 
700
700
  ## `knock workflow list`
701
701
 
@@ -718,7 +718,7 @@ GLOBAL FLAGS
718
718
  --json Format output as json.
719
719
  ```
720
720
 
721
- _See code: [src/commands/workflow/list.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/workflow/list.ts)_
721
+ _See code: [src/commands/workflow/list.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.8/src/commands/workflow/list.ts)_
722
722
 
723
723
  ## `knock workflow pull [WORKFLOWKEY]`
724
724
 
@@ -738,7 +738,7 @@ FLAGS
738
738
  --workflows-dir=<value> The target directory path to pull all workflows into.
739
739
  ```
740
740
 
741
- _See code: [src/commands/workflow/pull.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/workflow/pull.ts)_
741
+ _See code: [src/commands/workflow/pull.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.8/src/commands/workflow/pull.ts)_
742
742
 
743
743
  ## `knock workflow push [WORKFLOWKEY]`
744
744
 
@@ -759,7 +759,7 @@ FLAGS
759
759
  --workflows-dir=<value> The target directory path to find all workflows to push.
760
760
  ```
761
761
 
762
- _See code: [src/commands/workflow/push.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/workflow/push.ts)_
762
+ _See code: [src/commands/workflow/push.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.8/src/commands/workflow/push.ts)_
763
763
 
764
764
  ## `knock workflow run WORKFLOWKEY`
765
765
 
@@ -780,7 +780,7 @@ FLAGS
780
780
  --tenant=<value> A tenant id for the workflow run.
781
781
  ```
782
782
 
783
- _See code: [src/commands/workflow/run.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/workflow/run.ts)_
783
+ _See code: [src/commands/workflow/run.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.8/src/commands/workflow/run.ts)_
784
784
 
785
785
  ## `knock workflow validate [WORKFLOWKEY]`
786
786
 
@@ -799,5 +799,5 @@ FLAGS
799
799
  --workflows-dir=<value> The target directory path to find all workflows to validate.
800
800
  ```
801
801
 
802
- _See code: [src/commands/workflow/validate.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.7/src/commands/workflow/validate.ts)_
802
+ _See code: [src/commands/workflow/validate.ts](https://github.com/knocklabs/knock-cli/blob/v0.1.8/src/commands/workflow/validate.ts)_
803
803
  <!-- commandsstop -->
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "default", {
9
9
  const _core = require("@oclif/core");
10
10
  const _baseCommand = /*#__PURE__*/ _interopRequireDefault(require("../../lib/base-command"));
11
11
  const _date = require("../../lib/helpers/date");
12
- const _object = require("../../lib/helpers/object");
12
+ const _objectIsomorphic = require("../../lib/helpers/object.isomorphic");
13
13
  const _page = require("../../lib/helpers/page");
14
14
  const _request = require("../../lib/helpers/request");
15
15
  const _commit = require("../../lib/marshal/commit");
@@ -26,7 +26,7 @@ class CommitList extends _baseCommand.default {
26
26
  this.render(resp.data);
27
27
  }
28
28
  async request(pageParams = {}) {
29
- const props = (0, _object.merge)(this.props, {
29
+ const props = (0, _objectIsomorphic.merge)(this.props, {
30
30
  flags: {
31
31
  ...pageParams
32
32
  }
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "default", {
9
9
  const _core = require("@oclif/core");
10
10
  const _baseCommand = /*#__PURE__*/ _interopRequireDefault(require("../../lib/base-command"));
11
11
  const _date = require("../../lib/helpers/date");
12
- const _object = require("../../lib/helpers/object");
12
+ const _objectIsomorphic = require("../../lib/helpers/object.isomorphic");
13
13
  const _page = require("../../lib/helpers/page");
14
14
  const _request = require("../../lib/helpers/request");
15
15
  function _interopRequireDefault(obj) {
@@ -25,7 +25,7 @@ class EmailLayoutList extends _baseCommand.default {
25
25
  this.render(resp.data);
26
26
  }
27
27
  async request(pageParams = {}) {
28
- const props = (0, _object.merge)(this.props, {
28
+ const props = (0, _objectIsomorphic.merge)(this.props, {
29
29
  flags: {
30
30
  ...pageParams
31
31
  }
@@ -11,7 +11,7 @@ const _core = require("@oclif/core");
11
11
  const _baseCommand = /*#__PURE__*/ _interopRequireDefault(require("../../lib/base-command"));
12
12
  const _error = require("../../lib/helpers/error");
13
13
  const _flag = /*#__PURE__*/ _interopRequireWildcard(require("../../lib/helpers/flag"));
14
- const _object = require("../../lib/helpers/object");
14
+ const _objectIsomorphic = require("../../lib/helpers/object.isomorphic");
15
15
  const _page = require("../../lib/helpers/page");
16
16
  const _request = require("../../lib/helpers/request");
17
17
  const _ux = require("../../lib/helpers/ux");
@@ -81,7 +81,7 @@ class EmailLayoutPull extends _baseCommand.default {
81
81
  if (!input) return;
82
82
  }
83
83
  const resp = await (0, _request.withSpinner)(()=>{
84
- const props = (0, _object.merge)(this.props, {
84
+ const props = (0, _objectIsomorphic.merge)(this.props, {
85
85
  args: {
86
86
  emailLayoutKey: dirContext.key
87
87
  },
@@ -114,7 +114,7 @@ class EmailLayoutPull extends _baseCommand.default {
114
114
  this.log(`‣ Successfully ${action} the layouts directory at ${targetDirCtx.abspath}`);
115
115
  }
116
116
  async listAllEmailLayouts(pageParams = {}, emailLayoutsFetchedSoFar = []) {
117
- const props = (0, _object.merge)(this.props, {
117
+ const props = (0, _objectIsomorphic.merge)(this.props, {
118
118
  flags: {
119
119
  ...pageParams,
120
120
  annotate: true,
@@ -11,7 +11,7 @@ const _baseCommand = /*#__PURE__*/ _interopRequireDefault(require("../../lib/bas
11
11
  const _const = require("../../lib/helpers/const");
12
12
  const _error = require("../../lib/helpers/error");
13
13
  const _flag = /*#__PURE__*/ _interopRequireWildcard(require("../../lib/helpers/flag"));
14
- const _object = require("../../lib/helpers/object");
14
+ const _objectIsomorphic = require("../../lib/helpers/object.isomorphic");
15
15
  const _request = require("../../lib/helpers/request");
16
16
  const _string = require("../../lib/helpers/string");
17
17
  const _ux = require("../../lib/helpers/ux");
@@ -89,7 +89,7 @@ class EmailLayoutPush extends _baseCommand.default {
89
89
  // 3. Finally push up each layout, abort on the first error.
90
90
  _ux.spinner.start(`‣ Pushing`);
91
91
  for (const layout of layouts){
92
- const props = (0, _object.merge)(this.props, {
92
+ const props = (0, _objectIsomorphic.merge)(this.props, {
93
93
  flags: {
94
94
  annotate: true
95
95
  }
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "default", {
9
9
  const _core = require("@oclif/core");
10
10
  const _baseCommand = /*#__PURE__*/ _interopRequireDefault(require("../../lib/base-command"));
11
11
  const _date = require("../../lib/helpers/date");
12
- const _object = require("../../lib/helpers/object");
12
+ const _objectIsomorphic = require("../../lib/helpers/object.isomorphic");
13
13
  const _page = require("../../lib/helpers/page");
14
14
  const _request = require("../../lib/helpers/request");
15
15
  const _translation = /*#__PURE__*/ _interopRequireWildcard(require("../../lib/marshal/translation"));
@@ -65,7 +65,7 @@ class TranslationList extends _baseCommand.default {
65
65
  this.render(resp.data);
66
66
  }
67
67
  async request(pageParams = {}) {
68
- const props = (0, _object.merge)(this.props, {
68
+ const props = (0, _objectIsomorphic.merge)(this.props, {
69
69
  flags: {
70
70
  ...pageParams
71
71
  }
@@ -10,7 +10,7 @@ const _core = require("@oclif/core");
10
10
  const _baseCommand = /*#__PURE__*/ _interopRequireDefault(require("../../lib/base-command"));
11
11
  const _error = require("../../lib/helpers/error");
12
12
  const _flag = /*#__PURE__*/ _interopRequireWildcard(require("../../lib/helpers/flag"));
13
- const _object = require("../../lib/helpers/object");
13
+ const _objectIsomorphic = require("../../lib/helpers/object.isomorphic");
14
14
  const _page = require("../../lib/helpers/page");
15
15
  const _request = require("../../lib/helpers/request");
16
16
  const _ux = require("../../lib/helpers/ux");
@@ -124,7 +124,7 @@ class TranslationPull extends _baseCommand.default {
124
124
  this.log(`‣ Successfully ${action} the translations directory at ${targetCtx.abspath}`);
125
125
  }
126
126
  async listAllTranslations(filters = {}, pageParams = {}, translationsFetchedSoFar = []) {
127
- const props = (0, _object.merge)(this.props, {
127
+ const props = (0, _objectIsomorphic.merge)(this.props, {
128
128
  flags: {
129
129
  ...pageParams,
130
130
  limit: _page.MAX_PAGINATION_LIMIT
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "default", {
9
9
  const _core = require("@oclif/core");
10
10
  const _baseCommand = /*#__PURE__*/ _interopRequireDefault(require("../../lib/base-command"));
11
11
  const _date = require("../../lib/helpers/date");
12
- const _object = require("../../lib/helpers/object");
12
+ const _objectIsomorphic = require("../../lib/helpers/object.isomorphic");
13
13
  const _page = require("../../lib/helpers/page");
14
14
  const _request = require("../../lib/helpers/request");
15
15
  const _workflow = /*#__PURE__*/ _interopRequireWildcard(require("../../lib/marshal/workflow"));
@@ -65,7 +65,7 @@ class WorkflowList extends _baseCommand.default {
65
65
  this.render(resp.data);
66
66
  }
67
67
  async request(pageParams = {}) {
68
- const props = (0, _object.merge)(this.props, {
68
+ const props = (0, _objectIsomorphic.merge)(this.props, {
69
69
  flags: {
70
70
  ...pageParams
71
71
  }
@@ -10,7 +10,7 @@ const _nodePath = /*#__PURE__*/ _interopRequireWildcard(require("node:path"));
10
10
  const _core = require("@oclif/core");
11
11
  const _fsExtra = /*#__PURE__*/ _interopRequireWildcard(require("fs-extra"));
12
12
  const _baseCommand = /*#__PURE__*/ _interopRequireDefault(require("../../lib/base-command"));
13
- const _object = require("../../lib/helpers/object");
13
+ const _objectIsomorphic = require("../../lib/helpers/object.isomorphic");
14
14
  const _ux = require("../../lib/helpers/ux");
15
15
  const _workflow = /*#__PURE__*/ _interopRequireWildcard(require("../../lib/marshal/workflow"));
16
16
  function _interopRequireDefault(obj) {
@@ -106,7 +106,7 @@ class WorkflowNew extends _baseCommand.default {
106
106
  }
107
107
  }
108
108
  async checkExistingWorkflow() {
109
- const props = (0, _object.merge)(this.props, {
109
+ const props = (0, _objectIsomorphic.merge)(this.props, {
110
110
  flags: {
111
111
  environment: "development"
112
112
  }
@@ -11,7 +11,7 @@ const _core = require("@oclif/core");
11
11
  const _baseCommand = /*#__PURE__*/ _interopRequireDefault(require("../../lib/base-command"));
12
12
  const _error = require("../../lib/helpers/error");
13
13
  const _flag = /*#__PURE__*/ _interopRequireWildcard(require("../../lib/helpers/flag"));
14
- const _object = require("../../lib/helpers/object");
14
+ const _objectIsomorphic = require("../../lib/helpers/object.isomorphic");
15
15
  const _page = require("../../lib/helpers/page");
16
16
  const _request = require("../../lib/helpers/request");
17
17
  const _ux = require("../../lib/helpers/ux");
@@ -84,7 +84,7 @@ class WorkflowPull extends _baseCommand.default {
84
84
  }
85
85
  // 2. Fetch the workflow with annotations.
86
86
  const resp = await (0, _request.withSpinner)(()=>{
87
- const props = (0, _object.merge)(this.props, {
87
+ const props = (0, _objectIsomorphic.merge)(this.props, {
88
88
  args: {
89
89
  workflowKey: dirContext.key
90
90
  },
@@ -149,7 +149,7 @@ class WorkflowPull extends _baseCommand.default {
149
149
  this.log(`‣ Successfully ${action} the workflows directory at ${targetDirCtx.abspath}`);
150
150
  }
151
151
  async listAllWorkflows(pageParams = {}, workflowsFetchedSoFar = []) {
152
- const props = (0, _object.merge)(this.props, {
152
+ const props = (0, _objectIsomorphic.merge)(this.props, {
153
153
  flags: {
154
154
  ...pageParams,
155
155
  annotate: true,
@@ -11,7 +11,7 @@ const _baseCommand = /*#__PURE__*/ _interopRequireDefault(require("../../lib/bas
11
11
  const _const = require("../../lib/helpers/const");
12
12
  const _error = require("../../lib/helpers/error");
13
13
  const _flag = /*#__PURE__*/ _interopRequireWildcard(require("../../lib/helpers/flag"));
14
- const _object = require("../../lib/helpers/object");
14
+ const _objectIsomorphic = require("../../lib/helpers/object.isomorphic");
15
15
  const _request = require("../../lib/helpers/request");
16
16
  const _string = require("../../lib/helpers/string");
17
17
  const _ux = require("../../lib/helpers/ux");
@@ -89,7 +89,7 @@ class WorkflowPush extends _baseCommand.default {
89
89
  // 3. Finally push up each workflow, abort on the first error.
90
90
  _ux.spinner.start(`‣ Pushing`);
91
91
  for (const workflow of workflows){
92
- const props = (0, _object.merge)(this.props, {
92
+ const props = (0, _objectIsomorphic.merge)(this.props, {
93
93
  flags: {
94
94
  annotate: true
95
95
  }
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "default", {
7
7
  get: ()=>ApiV1
8
8
  });
9
9
  const _axios = /*#__PURE__*/ _interopRequireDefault(require("axios"));
10
- const _object = require("./helpers/object");
10
+ const _objectIsomorphic = require("./helpers/object.isomorphic");
11
11
  const _page = require("./helpers/page");
12
12
  function _interopRequireDefault(obj) {
13
13
  return obj && obj.__esModule ? obj : {
@@ -25,7 +25,7 @@ class ApiV1 {
25
25
  }
26
26
  // By resources: Workflows
27
27
  async listWorkflows({ flags }) {
28
- const params = (0, _object.prune)({
28
+ const params = (0, _objectIsomorphic.prune)({
29
29
  environment: flags.environment,
30
30
  annotate: flags.annotate,
31
31
  hide_uncommitted_changes: flags["hide-uncommitted-changes"],
@@ -36,7 +36,7 @@ class ApiV1 {
36
36
  });
37
37
  }
38
38
  async getWorkflow({ args , flags }) {
39
- const params = (0, _object.prune)({
39
+ const params = (0, _objectIsomorphic.prune)({
40
40
  environment: flags.environment,
41
41
  annotate: flags.annotate,
42
42
  hide_uncommitted_changes: flags["hide-uncommitted-changes"]
@@ -46,7 +46,7 @@ class ApiV1 {
46
46
  });
47
47
  }
48
48
  async upsertWorkflow({ flags }, workflow) {
49
- const params = (0, _object.prune)({
49
+ const params = (0, _objectIsomorphic.prune)({
50
50
  environment: flags.environment,
51
51
  annotate: flags.annotate,
52
52
  commit: flags.commit,
@@ -60,7 +60,7 @@ class ApiV1 {
60
60
  });
61
61
  }
62
62
  async validateWorkflow({ flags }, workflow) {
63
- const params = (0, _object.prune)({
63
+ const params = (0, _objectIsomorphic.prune)({
64
64
  environment: flags.environment
65
65
  });
66
66
  const data = {
@@ -71,7 +71,7 @@ class ApiV1 {
71
71
  });
72
72
  }
73
73
  async activateWorkflow({ args , flags }) {
74
- const params = (0, _object.prune)({
74
+ const params = (0, _objectIsomorphic.prune)({
75
75
  environment: flags.environment,
76
76
  status: flags.status
77
77
  });
@@ -80,10 +80,10 @@ class ApiV1 {
80
80
  });
81
81
  }
82
82
  async runWorkflow({ args , flags }) {
83
- const params = (0, _object.prune)({
83
+ const params = (0, _objectIsomorphic.prune)({
84
84
  environment: flags.environment
85
85
  });
86
- const data = (0, _object.prune)({
86
+ const data = (0, _objectIsomorphic.prune)({
87
87
  recipients: flags.recipients,
88
88
  tenant: flags.tenant,
89
89
  data: flags.data,
@@ -95,7 +95,7 @@ class ApiV1 {
95
95
  }
96
96
  // By resources: Commits
97
97
  async listCommits({ flags }) {
98
- const params = (0, _object.prune)({
98
+ const params = (0, _objectIsomorphic.prune)({
99
99
  environment: flags.environment,
100
100
  promoted: flags.promoted,
101
101
  ...(0, _page.toPageParams)(flags)
@@ -108,7 +108,7 @@ class ApiV1 {
108
108
  return this.get(`/commits/${args.id}`);
109
109
  }
110
110
  async commitAllChanges({ flags }) {
111
- const params = (0, _object.prune)({
111
+ const params = (0, _objectIsomorphic.prune)({
112
112
  environment: flags.environment,
113
113
  commit_message: flags["commit-message"]
114
114
  });
@@ -117,7 +117,7 @@ class ApiV1 {
117
117
  });
118
118
  }
119
119
  async promoteAllChanges({ flags }) {
120
- const params = (0, _object.prune)({
120
+ const params = (0, _objectIsomorphic.prune)({
121
121
  to_environment: flags.to
122
122
  });
123
123
  return this.put(`/commits/promote`, {}, {
@@ -129,7 +129,7 @@ class ApiV1 {
129
129
  }
130
130
  // By resources: Translations
131
131
  async listTranslations({ flags }, filters = {}) {
132
- const params = (0, _object.prune)({
132
+ const params = (0, _objectIsomorphic.prune)({
133
133
  environment: flags.environment,
134
134
  hide_uncommitted_changes: flags["hide-uncommitted-changes"],
135
135
  locale_code: filters.localeCode,
@@ -141,7 +141,7 @@ class ApiV1 {
141
141
  });
142
142
  }
143
143
  async getTranslation({ flags }, translation) {
144
- const params = (0, _object.prune)({
144
+ const params = (0, _objectIsomorphic.prune)({
145
145
  environment: flags.environment,
146
146
  hide_uncommitted_changes: flags["hide-uncommitted-changes"],
147
147
  namespace: translation.namespace
@@ -151,7 +151,7 @@ class ApiV1 {
151
151
  });
152
152
  }
153
153
  async upsertTranslation({ flags }, translation) {
154
- const params = (0, _object.prune)({
154
+ const params = (0, _objectIsomorphic.prune)({
155
155
  environment: flags.environment,
156
156
  commit: flags.commit,
157
157
  commit_message: flags["commit-message"],
@@ -164,7 +164,7 @@ class ApiV1 {
164
164
  });
165
165
  }
166
166
  async validateTranslation({ flags }, translation) {
167
- const params = (0, _object.prune)({
167
+ const params = (0, _objectIsomorphic.prune)({
168
168
  environment: flags.environment,
169
169
  namespace: translation.namespace
170
170
  });
@@ -177,7 +177,7 @@ class ApiV1 {
177
177
  }
178
178
  // By resources: Email layouts
179
179
  async listEmailLayouts({ flags }) {
180
- const params = (0, _object.prune)({
180
+ const params = (0, _objectIsomorphic.prune)({
181
181
  environment: flags.environment,
182
182
  annotate: flags.annotate,
183
183
  hide_uncommitted_changes: flags["hide-uncommitted-changes"],
@@ -188,7 +188,7 @@ class ApiV1 {
188
188
  });
189
189
  }
190
190
  async getEmailLayout({ args , flags }) {
191
- const params = (0, _object.prune)({
191
+ const params = (0, _objectIsomorphic.prune)({
192
192
  environment: flags.environment,
193
193
  annotate: flags.annotate,
194
194
  hide_uncommitted_changes: flags["hide-uncommitted-changes"]
@@ -198,7 +198,7 @@ class ApiV1 {
198
198
  });
199
199
  }
200
200
  async upsertEmailLayout({ flags }, layout) {
201
- const params = (0, _object.prune)({
201
+ const params = (0, _objectIsomorphic.prune)({
202
202
  environment: flags.environment,
203
203
  annotate: flags.annotate,
204
204
  commit: flags.commit,
@@ -212,7 +212,7 @@ class ApiV1 {
212
212
  });
213
213
  }
214
214
  async validateEmailLayout({ flags }, layout) {
215
- const params = (0, _object.prune)({
215
+ const params = (0, _objectIsomorphic.prune)({
216
216
  environment: flags.environment
217
217
  });
218
218
  const data = {
@@ -1,4 +1,11 @@
1
- "use strict";
1
+ /*
2
+ * IMPORTANT:
3
+ *
4
+ * This file is suffixed with `.isomorphic` because the code in this file is
5
+ * meant to run not just in a nodejs environment but also in a browser. For this
6
+ * reason there are some restrictions for which nodejs imports are allowed in
7
+ * this module. See `.eslintrc.json` for more details.
8
+ */ "use strict";
2
9
  Object.defineProperty(exports, "__esModule", {
3
10
  value: true
4
11
  });
@@ -18,7 +18,8 @@ const _fsExtra = /*#__PURE__*/ _interopRequireWildcard(require("fs-extra"));
18
18
  const _lodash = require("lodash");
19
19
  const _error = require("../../helpers/error");
20
20
  const _json = require("../../helpers/json");
21
- const _object = require("../../helpers/object");
21
+ const _objectIsomorphic = require("../../helpers/object.isomorphic");
22
+ const _constIsomorphic = require("../shared/const.isomorphic");
22
23
  const _helpers = require("../shared/helpers");
23
24
  const _helpers1 = require("./helpers");
24
25
  function _interopRequireDefault(obj) {
@@ -135,7 +136,7 @@ const readEmailLayoutDir = async (layoutDirCtx, opts = {})=>{
135
136
  const result = await (0, _json.readJson)(layoutJsonPath);
136
137
  if (!result[0]) return result;
137
138
  let [layoutJson] = result;
138
- layoutJson = withReadonlyField ? layoutJson : (0, _object.omitDeep)(layoutJson, [
139
+ layoutJson = withReadonlyField ? layoutJson : (0, _objectIsomorphic.omitDeep)(layoutJson, [
139
140
  "__readonly"
140
141
  ]);
141
142
  return withExtractedFiles ? joinExtractedFiles(layoutDirCtx, layoutJson) : [
@@ -153,11 +154,11 @@ const readEmailLayoutDir = async (layoutDirCtx, opts = {})=>{
153
154
  // layout.json) in the layout json node. Mutated in place, and used
154
155
  // to validate the uniqueness of an extracted path encountered.
155
156
  const uniqueFilePaths = {};
156
- (0, _object.mapValuesDeep)(layoutJson, (relpath, key, parts)=>{
157
+ (0, _objectIsomorphic.mapValuesDeep)(layoutJson, (relpath, key, parts)=>{
157
158
  // If not marked with the @suffix, there's nothing to do.
158
- if (!_helpers.FILEPATH_MARKED_RE.test(key)) return;
159
- const objPathToFieldStr = _object.ObjPath.stringify(parts);
160
- const inlinObjPathStr = objPathToFieldStr.replace(_helpers.FILEPATH_MARKED_RE, "");
159
+ if (!_constIsomorphic.FILEPATH_MARKED_RE.test(key)) return;
160
+ const objPathToFieldStr = _objectIsomorphic.ObjPath.stringify(parts);
161
+ const inlinObjPathStr = objPathToFieldStr.replace(_constIsomorphic.FILEPATH_MARKED_RE, "");
161
162
  // If there is inlined content present already, then nothing more to do.
162
163
  if ((0, _lodash.hasIn)(layoutJson, inlinObjPathStr)) return;
163
164
  // Check if the extracted path found at the current field path is valid