@knocklabs/cli 0.1.10 → 0.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/README.md +68 -531
  2. package/bin/dev.js +6 -0
  3. package/bin/run.js +7 -0
  4. package/dist/{commands → src/commands}/commit/get.js +24 -9
  5. package/dist/{commands → src/commands}/commit/index.js +23 -8
  6. package/dist/{commands → src/commands}/commit/list.js +29 -14
  7. package/dist/{commands → src/commands}/commit/promote.js +26 -11
  8. package/dist/{commands → src/commands}/knock.js +21 -6
  9. package/dist/{commands → src/commands}/layout/get.js +28 -13
  10. package/dist/{commands → src/commands}/layout/list.js +29 -14
  11. package/dist/{commands → src/commands}/layout/pull.js +47 -30
  12. package/dist/{commands → src/commands}/layout/push.js +38 -21
  13. package/dist/{commands → src/commands}/layout/validate.js +33 -16
  14. package/dist/src/commands/ping.js +37 -0
  15. package/dist/{commands → src/commands}/translation/get.js +33 -16
  16. package/dist/{commands → src/commands}/translation/list.js +34 -17
  17. package/dist/{commands → src/commands}/translation/pull.js +36 -19
  18. package/dist/{commands → src/commands}/translation/push.js +33 -15
  19. package/dist/{commands → src/commands}/translation/validate.js +30 -13
  20. package/dist/{commands → src/commands}/whoami.js +22 -7
  21. package/dist/{commands → src/commands}/workflow/activate.js +27 -12
  22. package/dist/{commands → src/commands}/workflow/get.js +35 -18
  23. package/dist/{commands → src/commands}/workflow/list.js +34 -17
  24. package/dist/{commands → src/commands}/workflow/new.js +37 -20
  25. package/dist/{commands → src/commands}/workflow/pull.js +44 -27
  26. package/dist/{commands → src/commands}/workflow/push.js +34 -17
  27. package/dist/{commands → src/commands}/workflow/run.js +25 -10
  28. package/dist/{commands → src/commands}/workflow/validate.js +30 -13
  29. package/dist/{index.js → src/index.js} +3 -1
  30. package/dist/{isomorphic.js → src/isomorphic.js} +8 -4
  31. package/dist/{lib → src/lib}/api-v1.js +57 -41
  32. package/dist/{lib → src/lib}/base-command.js +38 -15
  33. package/dist/{lib → src/lib}/helpers/const.js +18 -10
  34. package/dist/{lib → src/lib}/helpers/date.js +9 -5
  35. package/dist/{lib → src/lib}/helpers/error.js +42 -8
  36. package/dist/{lib → src/lib}/helpers/flag.js +24 -12
  37. package/dist/{lib → src/lib}/helpers/fs.js +10 -6
  38. package/dist/{lib → src/lib}/helpers/json.js +19 -9
  39. package/dist/{lib → src/lib}/helpers/liquid.js +3 -1
  40. package/dist/{lib → src/lib}/helpers/object.isomorphic.js +35 -7
  41. package/dist/{lib → src/lib}/helpers/page.js +34 -18
  42. package/dist/{lib → src/lib}/helpers/request.js +12 -6
  43. package/dist/{lib → src/lib}/helpers/string.js +8 -4
  44. package/dist/{lib → src/lib}/helpers/ux.js +9 -5
  45. package/dist/{lib → src/lib}/marshal/commit/helpers.js +3 -1
  46. package/dist/src/lib/marshal/commit/index.js +19 -0
  47. package/dist/{lib → src/lib}/marshal/conditions/helpers.js +5 -3
  48. package/dist/src/lib/marshal/conditions/index.js +19 -0
  49. package/dist/{lib → src/lib}/marshal/email-layout/helpers.js +25 -15
  50. package/dist/src/lib/marshal/email-layout/index.js +22 -0
  51. package/dist/{lib → src/lib}/marshal/email-layout/processor.isomorphic.js +17 -11
  52. package/dist/{lib → src/lib}/marshal/email-layout/reader.js +29 -23
  53. package/dist/{lib → src/lib}/marshal/email-layout/writer.js +38 -30
  54. package/dist/src/lib/marshal/index.isomorphic.js +26 -0
  55. package/dist/{lib → src/lib}/marshal/shared/const.isomorphic.js +6 -2
  56. package/dist/{lib → src/lib}/marshal/shared/helpers.js +22 -14
  57. package/dist/{lib → src/lib}/marshal/translation/helpers.js +52 -30
  58. package/dist/src/lib/marshal/translation/index.js +22 -0
  59. package/dist/{lib → src/lib}/marshal/translation/processor.isomorphic.js +9 -3
  60. package/dist/{lib → src/lib}/marshal/translation/reader.js +14 -10
  61. package/dist/{lib → src/lib}/marshal/translation/writer.js +21 -15
  62. package/dist/{lib → src/lib}/marshal/workflow/generator.js +23 -15
  63. package/dist/{lib → src/lib}/marshal/workflow/helpers.js +47 -27
  64. package/dist/src/lib/marshal/workflow/index.js +23 -0
  65. package/dist/{lib → src/lib}/marshal/workflow/processor.isomorphic.js +35 -23
  66. package/dist/{lib → src/lib}/marshal/workflow/reader.js +30 -24
  67. package/dist/{lib → src/lib}/marshal/workflow/types.js +3 -1
  68. package/dist/{lib → src/lib}/marshal/workflow/writer.js +40 -30
  69. package/dist/{lib → src/lib}/run-context/helpers.js +3 -1
  70. package/dist/src/lib/run-context/index.js +26 -0
  71. package/dist/{lib → src/lib}/run-context/loader.js +17 -13
  72. package/dist/{lib → src/lib}/user-config.js +13 -9
  73. package/oclif.manifest.json +2 -1386
  74. package/package.json +15 -15
  75. package/bin/dev +0 -17
  76. package/bin/run +0 -5
  77. package/dist/commands/ping.js +0 -22
  78. package/dist/lib/marshal/commit/index.js +0 -17
  79. package/dist/lib/marshal/conditions/index.js +0 -17
  80. package/dist/lib/marshal/email-layout/index.js +0 -20
  81. package/dist/lib/marshal/index.isomorphic.js +0 -20
  82. package/dist/lib/marshal/translation/index.js +0 -20
  83. package/dist/lib/marshal/workflow/index.js +0 -21
  84. package/dist/lib/run-context/index.js +0 -22
  85. /package/dist/{lib → src/lib}/marshal/commit/types.js +0 -0
  86. /package/dist/{lib → src/lib}/marshal/conditions/types.js +0 -0
  87. /package/dist/{lib → src/lib}/marshal/email-layout/types.js +0 -0
  88. /package/dist/{lib → src/lib}/marshal/shared/types.js +0 -0
  89. /package/dist/{lib → src/lib}/marshal/translation/types.js +0 -0
  90. /package/dist/{lib → src/lib}/run-context/types.js +0 -0
@@ -4,18 +4,33 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: ()=>TranslationPull
7
+ get: function() {
8
+ return TranslationPull;
9
+ }
8
10
  });
9
11
  const _core = require("@oclif/core");
10
- const _baseCommand = /*#__PURE__*/ _interopRequireDefault(require("../../lib/base-command"));
12
+ const _basecommand = /*#__PURE__*/ _interop_require_default(require("../../lib/base-command"));
11
13
  const _error = require("../../lib/helpers/error");
12
- const _flag = /*#__PURE__*/ _interopRequireWildcard(require("../../lib/helpers/flag"));
13
- const _objectIsomorphic = require("../../lib/helpers/object.isomorphic");
14
+ const _flag = /*#__PURE__*/ _interop_require_wildcard(require("../../lib/helpers/flag"));
15
+ const _objectisomorphic = require("../../lib/helpers/object.isomorphic");
14
16
  const _page = require("../../lib/helpers/page");
15
17
  const _request = require("../../lib/helpers/request");
16
18
  const _ux = require("../../lib/helpers/ux");
17
- const _translation = /*#__PURE__*/ _interopRequireWildcard(require("../../lib/marshal/translation"));
18
- function _interopRequireDefault(obj) {
19
+ const _translation = /*#__PURE__*/ _interop_require_wildcard(require("../../lib/marshal/translation"));
20
+ function _define_property(obj, key, value) {
21
+ if (key in obj) {
22
+ Object.defineProperty(obj, key, {
23
+ value: value,
24
+ enumerable: true,
25
+ configurable: true,
26
+ writable: true
27
+ });
28
+ } else {
29
+ obj[key] = value;
30
+ }
31
+ return obj;
32
+ }
33
+ function _interop_require_default(obj) {
19
34
  return obj && obj.__esModule ? obj : {
20
35
  default: obj
21
36
  };
@@ -28,7 +43,7 @@ function _getRequireWildcardCache(nodeInterop) {
28
43
  return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
29
44
  })(nodeInterop);
30
45
  }
31
- function _interopRequireWildcard(obj, nodeInterop) {
46
+ function _interop_require_wildcard(obj, nodeInterop) {
32
47
  if (!nodeInterop && obj && obj.__esModule) {
33
48
  return obj;
34
49
  }
@@ -41,7 +56,9 @@ function _interopRequireWildcard(obj, nodeInterop) {
41
56
  if (cache && cache.has(obj)) {
42
57
  return cache.get(obj);
43
58
  }
44
- var newObj = {};
59
+ var newObj = {
60
+ __proto__: null
61
+ };
45
62
  var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
46
63
  for(var key in obj){
47
64
  if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
@@ -59,7 +76,7 @@ function _interopRequireWildcard(obj, nodeInterop) {
59
76
  }
60
77
  return newObj;
61
78
  }
62
- class TranslationPull extends _baseCommand.default {
79
+ class TranslationPull extends _basecommand.default {
63
80
  async run() {
64
81
  const target = await _translation.ensureValidCommandTarget(this.props, this.runContext);
65
82
  switch(target.type){
@@ -76,7 +93,7 @@ class TranslationPull extends _baseCommand.default {
76
93
  /*
77
94
  * Pull a single translation (using TranslationFileContext)
78
95
  */ async pullOneTranslation(targetCtx) {
79
- const { flags } = this.props;
96
+ const { flags } = this.props;
80
97
  if (targetCtx.exists) {
81
98
  this.log(`‣ Found \`${targetCtx.ref}\` at ${targetCtx.abspath}`);
82
99
  } else {
@@ -92,7 +109,7 @@ class TranslationPull extends _baseCommand.default {
92
109
  /*
93
110
  * Pull all translations for a locale (using TranslationDirContext)
94
111
  */ async pullAllTranslationsForLocale(targetCtx) {
95
- const { flags } = this.props;
112
+ const { flags } = this.props;
96
113
  const prompt = targetCtx.exists ? `Pull latest \`${targetCtx.key}\` translations into ${targetCtx.abspath}?\n This will overwrite the contents of this directory.` : `Create a new \`${targetCtx.key}\` translations directory at ${targetCtx.abspath}?`;
97
114
  const input = flags.force || await (0, _ux.promptToConfirm)(prompt);
98
115
  if (!input) return;
@@ -111,7 +128,7 @@ class TranslationPull extends _baseCommand.default {
111
128
  /*
112
129
  * Pull all translations (using DirContext)
113
130
  */ async pullAllTranslations(targetCtx) {
114
- const { flags } = this.props;
131
+ const { flags } = this.props;
115
132
  const prompt = targetCtx.exists ? `Pull latest translations into ${targetCtx.abspath}?\n This will overwrite the contents of this directory.` : `Create a new translations directory at ${targetCtx.abspath}?`;
116
133
  const input = flags.force || await (0, _ux.promptToConfirm)(prompt);
117
134
  if (!input) return;
@@ -124,7 +141,7 @@ class TranslationPull extends _baseCommand.default {
124
141
  this.log(`‣ Successfully ${action} the translations directory at ${targetCtx.abspath}`);
125
142
  }
126
143
  async listAllTranslations(filters = {}, pageParams = {}, translationsFetchedSoFar = []) {
127
- const props = (0, _objectIsomorphic.merge)(this.props, {
144
+ const props = (0, _objectisomorphic.merge)(this.props, {
128
145
  flags: {
129
146
  ...pageParams,
130
147
  limit: _page.MAX_PAGINATION_LIMIT
@@ -135,7 +152,7 @@ class TranslationPull extends _baseCommand.default {
135
152
  const message = (0, _request.formatErrorRespMessage)(resp);
136
153
  this.error(new _error.ApiError(message));
137
154
  }
138
- const { entries , page_info: pageInfo } = resp.data;
155
+ const { entries, page_info: pageInfo } = resp.data;
139
156
  const translations = [
140
157
  ...translationsFetchedSoFar,
141
158
  ...entries
@@ -145,8 +162,8 @@ class TranslationPull extends _baseCommand.default {
145
162
  }, translations) : translations;
146
163
  }
147
164
  }
148
- TranslationPull.summary = "Pull one or more translations from an environment into a local file system.";
149
- TranslationPull.flags = {
165
+ _define_property(TranslationPull, "summary", "Pull one or more translations from an environment into a local file system.");
166
+ _define_property(TranslationPull, "flags", {
150
167
  environment: _core.Flags.string({
151
168
  default: "development",
152
169
  summary: "The environment to use."
@@ -166,10 +183,10 @@ TranslationPull.flags = {
166
183
  force: _core.Flags.boolean({
167
184
  summary: "Remove the confirmation prompt."
168
185
  })
169
- };
170
- TranslationPull.args = {
186
+ });
187
+ _define_property(TranslationPull, "args", {
171
188
  translationRef: _core.Args.string({
172
189
  description: _translation.translationRefDescription,
173
190
  required: false
174
191
  })
175
- };
192
+ });
@@ -4,19 +4,34 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: ()=>TranslationPush
7
+ get: function() {
8
+ return TranslationPush;
9
+ }
8
10
  });
9
11
  const _core = require("@oclif/core");
10
- const _baseCommand = /*#__PURE__*/ _interopRequireDefault(require("../../lib/base-command"));
12
+ const _basecommand = /*#__PURE__*/ _interop_require_default(require("../../lib/base-command"));
11
13
  const _const = require("../../lib/helpers/const");
12
14
  const _error = require("../../lib/helpers/error");
13
- const _flag = /*#__PURE__*/ _interopRequireWildcard(require("../../lib/helpers/flag"));
15
+ const _flag = /*#__PURE__*/ _interop_require_wildcard(require("../../lib/helpers/flag"));
14
16
  const _request = require("../../lib/helpers/request");
15
17
  const _string = require("../../lib/helpers/string");
16
18
  const _ux = require("../../lib/helpers/ux");
17
- const _translation = /*#__PURE__*/ _interopRequireWildcard(require("../../lib/marshal/translation"));
18
- const _validate = /*#__PURE__*/ _interopRequireDefault(require("./validate"));
19
- function _interopRequireDefault(obj) {
19
+ const _translation = /*#__PURE__*/ _interop_require_wildcard(require("../../lib/marshal/translation"));
20
+ const _validate = /*#__PURE__*/ _interop_require_default(require("./validate"));
21
+ function _define_property(obj, key, value) {
22
+ if (key in obj) {
23
+ Object.defineProperty(obj, key, {
24
+ value: value,
25
+ enumerable: true,
26
+ configurable: true,
27
+ writable: true
28
+ });
29
+ } else {
30
+ obj[key] = value;
31
+ }
32
+ return obj;
33
+ }
34
+ function _interop_require_default(obj) {
20
35
  return obj && obj.__esModule ? obj : {
21
36
  default: obj
22
37
  };
@@ -29,7 +44,7 @@ function _getRequireWildcardCache(nodeInterop) {
29
44
  return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
30
45
  })(nodeInterop);
31
46
  }
32
- function _interopRequireWildcard(obj, nodeInterop) {
47
+ function _interop_require_wildcard(obj, nodeInterop) {
33
48
  if (!nodeInterop && obj && obj.__esModule) {
34
49
  return obj;
35
50
  }
@@ -42,7 +57,9 @@ function _interopRequireWildcard(obj, nodeInterop) {
42
57
  if (cache && cache.has(obj)) {
43
58
  return cache.get(obj);
44
59
  }
45
- var newObj = {};
60
+ var newObj = {
61
+ __proto__: null
62
+ };
46
63
  var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
47
64
  for(var key in obj){
48
65
  if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
@@ -60,9 +77,9 @@ function _interopRequireWildcard(obj, nodeInterop) {
60
77
  }
61
78
  return newObj;
62
79
  }
63
- class TranslationPush extends _baseCommand.default {
80
+ class TranslationPush extends _basecommand.default {
64
81
  async run() {
65
- const { flags } = this.props;
82
+ const { flags } = this.props;
66
83
  // 1. First read all translation files found for the given command.
67
84
  const target = await _translation.ensureValidCommandTarget(this.props, this.runContext);
68
85
  const [translations, readErrors] = await _translation.readAllForCommandTarget(target);
@@ -86,6 +103,7 @@ class TranslationPush extends _baseCommand.default {
86
103
  // 3. Finally push up each translation file, abort on the first error.
87
104
  _ux.spinner.start(`‣ Pushing`);
88
105
  for (const translation of translations){
106
+ if (translation.namespace === _translation.SYSTEM_NAMESPACE) continue;
89
107
  // eslint-disable-next-line no-await-in-loop
90
108
  const resp = await this.apiV1.upsertTranslation(this.props, {
91
109
  locale_code: translation.localeCode,
@@ -104,8 +122,8 @@ class TranslationPush extends _baseCommand.default {
104
122
  this.log(`‣ Successfully ${actioned} ${translations.length} translation(s):\n` + (0, _string.indentString)(handledRefs.join("\n"), 4));
105
123
  }
106
124
  }
107
- TranslationPush.summary = "Push one or more translations from a local file system to Knock.";
108
- TranslationPush.flags = {
125
+ _define_property(TranslationPush, "summary", "Push one or more translations from a local file system to Knock.");
126
+ _define_property(TranslationPush, "flags", {
109
127
  environment: _core.Flags.string({
110
128
  summary: "Pushing a translation is only allowed in the development environment",
111
129
  default: _const.KnockEnv.Development,
@@ -132,10 +150,10 @@ TranslationPush.flags = {
132
150
  "commit"
133
151
  ]
134
152
  })
135
- };
136
- TranslationPush.args = {
153
+ });
154
+ _define_property(TranslationPush, "args", {
137
155
  translationRef: _core.Args.string({
138
156
  description: _translation.translationRefDescription,
139
157
  required: false
140
158
  })
141
- };
159
+ });
@@ -4,18 +4,33 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: ()=>TranslationValidate
7
+ get: function() {
8
+ return TranslationValidate;
9
+ }
8
10
  });
9
11
  const _core = require("@oclif/core");
10
- const _baseCommand = /*#__PURE__*/ _interopRequireDefault(require("../../lib/base-command"));
12
+ const _basecommand = /*#__PURE__*/ _interop_require_default(require("../../lib/base-command"));
11
13
  const _const = require("../../lib/helpers/const");
12
14
  const _error = require("../../lib/helpers/error");
13
- const _flag = /*#__PURE__*/ _interopRequireWildcard(require("../../lib/helpers/flag"));
15
+ const _flag = /*#__PURE__*/ _interop_require_wildcard(require("../../lib/helpers/flag"));
14
16
  const _request = require("../../lib/helpers/request");
15
17
  const _string = require("../../lib/helpers/string");
16
18
  const _ux = require("../../lib/helpers/ux");
17
- const _translation = /*#__PURE__*/ _interopRequireWildcard(require("../../lib/marshal/translation"));
18
- function _interopRequireDefault(obj) {
19
+ const _translation = /*#__PURE__*/ _interop_require_wildcard(require("../../lib/marshal/translation"));
20
+ function _define_property(obj, key, value) {
21
+ if (key in obj) {
22
+ Object.defineProperty(obj, key, {
23
+ value: value,
24
+ enumerable: true,
25
+ configurable: true,
26
+ writable: true
27
+ });
28
+ } else {
29
+ obj[key] = value;
30
+ }
31
+ return obj;
32
+ }
33
+ function _interop_require_default(obj) {
19
34
  return obj && obj.__esModule ? obj : {
20
35
  default: obj
21
36
  };
@@ -28,7 +43,7 @@ function _getRequireWildcardCache(nodeInterop) {
28
43
  return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
29
44
  })(nodeInterop);
30
45
  }
31
- function _interopRequireWildcard(obj, nodeInterop) {
46
+ function _interop_require_wildcard(obj, nodeInterop) {
32
47
  if (!nodeInterop && obj && obj.__esModule) {
33
48
  return obj;
34
49
  }
@@ -41,7 +56,9 @@ function _interopRequireWildcard(obj, nodeInterop) {
41
56
  if (cache && cache.has(obj)) {
42
57
  return cache.get(obj);
43
58
  }
44
- var newObj = {};
59
+ var newObj = {
60
+ __proto__: null
61
+ };
45
62
  var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
46
63
  for(var key in obj){
47
64
  if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
@@ -59,7 +76,7 @@ function _interopRequireWildcard(obj, nodeInterop) {
59
76
  }
60
77
  return newObj;
61
78
  }
62
- class TranslationValidate extends _baseCommand.default {
79
+ class TranslationValidate extends _basecommand.default {
63
80
  async run() {
64
81
  const target = await _translation.ensureValidCommandTarget(this.props, this.runContext);
65
82
  const [translations, readErrors] = await _translation.readAllForCommandTarget(target);
@@ -99,8 +116,8 @@ class TranslationValidate extends _baseCommand.default {
99
116
  return errors;
100
117
  }
101
118
  }
102
- TranslationValidate.summary = "Validate one or more translations from a local file system.";
103
- TranslationValidate.flags = {
119
+ _define_property(TranslationValidate, "summary", "Validate one or more translations from a local file system.");
120
+ _define_property(TranslationValidate, "flags", {
104
121
  environment: _core.Flags.string({
105
122
  summary: "Validating a translation is only done in the development environment",
106
123
  default: _const.KnockEnv.Development,
@@ -117,10 +134,10 @@ TranslationValidate.flags = {
117
134
  "all"
118
135
  ]
119
136
  })
120
- };
121
- TranslationValidate.args = {
137
+ });
138
+ _define_property(TranslationValidate, "args", {
122
139
  translationRef: _core.Args.string({
123
140
  description: _translation.translationRefDescription,
124
141
  required: false
125
142
  })
126
- };
143
+ });
@@ -4,20 +4,35 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: ()=>Whoami
7
+ get: function() {
8
+ return Whoami;
9
+ }
8
10
  });
9
- const _baseCommand = /*#__PURE__*/ _interopRequireDefault(require("../lib/base-command"));
11
+ const _basecommand = /*#__PURE__*/ _interop_require_default(require("../lib/base-command"));
10
12
  const _request = require("../lib/helpers/request");
11
13
  const _string = require("../lib/helpers/string");
12
- function _interopRequireDefault(obj) {
14
+ function _define_property(obj, key, value) {
15
+ if (key in obj) {
16
+ Object.defineProperty(obj, key, {
17
+ value: value,
18
+ enumerable: true,
19
+ configurable: true,
20
+ writable: true
21
+ });
22
+ } else {
23
+ obj[key] = value;
24
+ }
25
+ return obj;
26
+ }
27
+ function _interop_require_default(obj) {
13
28
  return obj && obj.__esModule ? obj : {
14
29
  default: obj
15
30
  };
16
31
  }
17
- class Whoami extends _baseCommand.default {
32
+ class Whoami extends _basecommand.default {
18
33
  async run() {
19
34
  const resp = await (0, _request.withSpinner)(()=>this.apiV1.whoami());
20
- const { flags } = this.props;
35
+ const { flags } = this.props;
21
36
  if (flags.json) return resp.data;
22
37
  this.log(`‣ Successfully verified the provided service token:`);
23
38
  const info = [
@@ -27,5 +42,5 @@ class Whoami extends _baseCommand.default {
27
42
  this.log((0, _string.indentString)(info.join("\n"), 4));
28
43
  }
29
44
  }
30
- Whoami.summary = "Verify the provided service token.";
31
- Whoami.enableJsonFlag = true;
45
+ _define_property(Whoami, "summary", "Verify the provided service token.");
46
+ _define_property(Whoami, "enableJsonFlag", true);
@@ -4,21 +4,36 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: ()=>WorkflowActivate
7
+ get: function() {
8
+ return WorkflowActivate;
9
+ }
8
10
  });
9
11
  const _core = require("@oclif/core");
10
- const _baseCommand = /*#__PURE__*/ _interopRequireDefault(require("../../lib/base-command"));
12
+ const _basecommand = /*#__PURE__*/ _interop_require_default(require("../../lib/base-command"));
11
13
  const _flag = require("../../lib/helpers/flag");
12
14
  const _request = require("../../lib/helpers/request");
13
15
  const _ux = require("../../lib/helpers/ux");
14
- function _interopRequireDefault(obj) {
16
+ function _define_property(obj, key, value) {
17
+ if (key in obj) {
18
+ Object.defineProperty(obj, key, {
19
+ value: value,
20
+ enumerable: true,
21
+ configurable: true,
22
+ writable: true
23
+ });
24
+ } else {
25
+ obj[key] = value;
26
+ }
27
+ return obj;
28
+ }
29
+ function _interop_require_default(obj) {
15
30
  return obj && obj.__esModule ? obj : {
16
31
  default: obj
17
32
  };
18
33
  }
19
- class WorkflowActivate extends _baseCommand.default {
34
+ class WorkflowActivate extends _basecommand.default {
20
35
  async run() {
21
- const { args , flags } = this.props;
36
+ const { args, flags } = this.props;
22
37
  // 1. Confirm before activating or deactivating the workflow, unless forced.
23
38
  const action = flags.status ? "Activate" : "Deactivate";
24
39
  const prompt = `${action} \`${args.workflowKey}\` workflow in \`${flags.environment}\` environment?`;
@@ -35,15 +50,15 @@ class WorkflowActivate extends _baseCommand.default {
35
50
  this.log(`‣ Successfully ${actioned} \`${args.workflowKey}\` workflow in \`${flags.environment}\` environment`);
36
51
  }
37
52
  }
38
- WorkflowActivate.summary = "Activate or deactivate a workflow in a given environment.";
39
- WorkflowActivate.description = `
53
+ _define_property(WorkflowActivate, "summary", "Activate or deactivate a workflow in a given environment.");
54
+ _define_property(WorkflowActivate, "description", `
40
55
  This immediately enables or disables a workflow in a given environment without
41
56
  needing to go through environment promotion.
42
57
 
43
58
  By default, this command activates a given workflow. Pass in the --status flag
44
59
  with \`false\` in order to deactivate it.
45
- `.trim();
46
- WorkflowActivate.flags = {
60
+ `.trim());
61
+ _define_property(WorkflowActivate, "flags", {
47
62
  // Do not default to any env for this command, since this action runs
48
63
  // directly in each environment outside the commit and promote flow.
49
64
  environment: _core.Flags.string({
@@ -57,9 +72,9 @@ WorkflowActivate.flags = {
57
72
  force: _core.Flags.boolean({
58
73
  summary: "Remove the confirmation prompt."
59
74
  })
60
- };
61
- WorkflowActivate.args = {
75
+ });
76
+ _define_property(WorkflowActivate, "args", {
62
77
  workflowKey: _core.Args.string({
63
78
  required: true
64
79
  })
65
- };
80
+ });
@@ -4,18 +4,33 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
- get: ()=>WorkflowGet
7
+ get: function() {
8
+ return WorkflowGet;
9
+ }
8
10
  });
9
11
  const _core = require("@oclif/core");
10
- const _baseCommand = /*#__PURE__*/ _interopRequireDefault(require("../../lib/base-command"));
12
+ const _basecommand = /*#__PURE__*/ _interop_require_default(require("../../lib/base-command"));
11
13
  const _date = require("../../lib/helpers/date");
12
14
  const _error = require("../../lib/helpers/error");
13
15
  const _request = require("../../lib/helpers/request");
14
16
  const _string = require("../../lib/helpers/string");
15
17
  const _ux = require("../../lib/helpers/ux");
16
- const _conditions = /*#__PURE__*/ _interopRequireWildcard(require("../../lib/marshal/conditions"));
17
- const _workflow = /*#__PURE__*/ _interopRequireWildcard(require("../../lib/marshal/workflow"));
18
- function _interopRequireDefault(obj) {
18
+ const _conditions = /*#__PURE__*/ _interop_require_wildcard(require("../../lib/marshal/conditions"));
19
+ const _workflow = /*#__PURE__*/ _interop_require_wildcard(require("../../lib/marshal/workflow"));
20
+ function _define_property(obj, key, value) {
21
+ if (key in obj) {
22
+ Object.defineProperty(obj, key, {
23
+ value: value,
24
+ enumerable: true,
25
+ configurable: true,
26
+ writable: true
27
+ });
28
+ } else {
29
+ obj[key] = value;
30
+ }
31
+ return obj;
32
+ }
33
+ function _interop_require_default(obj) {
19
34
  return obj && obj.__esModule ? obj : {
20
35
  default: obj
21
36
  };
@@ -28,7 +43,7 @@ function _getRequireWildcardCache(nodeInterop) {
28
43
  return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
29
44
  })(nodeInterop);
30
45
  }
31
- function _interopRequireWildcard(obj, nodeInterop) {
46
+ function _interop_require_wildcard(obj, nodeInterop) {
32
47
  if (!nodeInterop && obj && obj.__esModule) {
33
48
  return obj;
34
49
  }
@@ -41,7 +56,9 @@ function _interopRequireWildcard(obj, nodeInterop) {
41
56
  if (cache && cache.has(obj)) {
42
57
  return cache.get(obj);
43
58
  }
44
- var newObj = {};
59
+ var newObj = {
60
+ __proto__: null
61
+ };
45
62
  var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
46
63
  for(var key in obj){
47
64
  if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
@@ -59,12 +76,12 @@ function _interopRequireWildcard(obj, nodeInterop) {
59
76
  }
60
77
  return newObj;
61
78
  }
62
- class WorkflowGet extends _baseCommand.default {
79
+ class WorkflowGet extends _basecommand.default {
63
80
  async run() {
64
81
  _ux.spinner.start("‣ Loading");
65
- const { workflow , whoami } = await this.loadWorkflow();
82
+ const { workflow, whoami } = await this.loadWorkflow();
66
83
  _ux.spinner.stop();
67
- const { flags } = this.props;
84
+ const { flags } = this.props;
68
85
  if (flags.json) return workflow;
69
86
  this.render(workflow, whoami);
70
87
  }
@@ -85,8 +102,8 @@ class WorkflowGet extends _baseCommand.default {
85
102
  };
86
103
  }
87
104
  render(workflow, whoami) {
88
- const { workflowKey } = this.props.args;
89
- const { environment: env , "hide-uncommitted-changes": commitedOnly } = this.props.flags;
105
+ const { workflowKey } = this.props.args;
106
+ const { environment: env, "hide-uncommitted-changes": commitedOnly } = this.props.flags;
90
107
  const qualifier = env === "development" && !commitedOnly ? "(including uncommitted)" : "";
91
108
  this.log(`‣ Showing workflow \`${workflowKey}\` in \`${env}\` environment ${qualifier}\n`);
92
109
  /*
@@ -179,8 +196,8 @@ class WorkflowGet extends _baseCommand.default {
179
196
  this.log((0, _string.indentString)(viewWorkflowUrl, 2));
180
197
  }
181
198
  }
182
- WorkflowGet.summary = "Display a single workflow from an environment.";
183
- WorkflowGet.flags = {
199
+ _define_property(WorkflowGet, "summary", "Display a single workflow from an environment.");
200
+ _define_property(WorkflowGet, "flags", {
184
201
  environment: _core.Flags.string({
185
202
  default: "development",
186
203
  summary: "The environment to use."
@@ -188,10 +205,10 @@ WorkflowGet.flags = {
188
205
  "hide-uncommitted-changes": _core.Flags.boolean({
189
206
  summary: "Hide any uncommitted changes."
190
207
  })
191
- };
192
- WorkflowGet.args = {
208
+ });
209
+ _define_property(WorkflowGet, "args", {
193
210
  workflowKey: _core.Args.string({
194
211
  required: true
195
212
  })
196
- };
197
- WorkflowGet.enableJsonFlag = true;
213
+ });
214
+ _define_property(WorkflowGet, "enableJsonFlag", true);