@knocklabs/cli 0.2.1 → 0.2.2
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 +258 -36
- package/dist/commands/branch/create.js +1 -1
- package/dist/commands/branch/delete.js +1 -1
- package/dist/commands/commit/get.js +4 -4
- package/dist/commands/commit/index.js +47 -2
- package/dist/commands/commit/list.js +61 -13
- package/dist/commands/guide/activate.js +48 -4
- package/dist/commands/guide/generate-types.js +4 -1
- package/dist/commands/guide/get.js +46 -3
- package/dist/commands/guide/list.js +46 -3
- package/dist/commands/guide/pull.js +6 -4
- package/dist/commands/guide/push.js +4 -3
- package/dist/commands/guide/validate.js +4 -3
- package/dist/commands/layout/get.js +46 -1
- package/dist/commands/layout/list.js +46 -1
- package/dist/commands/layout/pull.js +6 -2
- package/dist/commands/layout/push.js +4 -1
- package/dist/commands/layout/validate.js +4 -1
- package/dist/commands/login.js +1 -0
- package/dist/commands/logout.js +1 -0
- package/dist/commands/message-type/get.js +46 -3
- package/dist/commands/message-type/list.js +46 -3
- package/dist/commands/message-type/pull.js +6 -4
- package/dist/commands/message-type/push.js +4 -3
- package/dist/commands/message-type/validate.js +4 -3
- package/dist/commands/partial/get.js +46 -1
- package/dist/commands/partial/list.js +46 -1
- package/dist/commands/partial/pull.js +6 -2
- package/dist/commands/partial/push.js +4 -1
- package/dist/commands/partial/validate.js +6 -1
- package/dist/commands/pull.js +28 -8
- package/dist/commands/push.js +27 -8
- package/dist/commands/translation/get.js +5 -1
- package/dist/commands/translation/list.js +5 -1
- package/dist/commands/translation/pull.js +8 -3
- package/dist/commands/translation/push.js +4 -1
- package/dist/commands/translation/validate.js +4 -1
- package/dist/commands/workflow/activate.js +47 -3
- package/dist/commands/workflow/generate-types.js +4 -1
- package/dist/commands/workflow/get.js +9 -4
- package/dist/commands/workflow/list.js +5 -1
- package/dist/commands/workflow/pull.js +6 -2
- package/dist/commands/workflow/push.js +4 -1
- package/dist/commands/workflow/run.js +46 -2
- package/dist/commands/workflow/validate.js +4 -1
- package/dist/lib/api-v1.js +35 -12
- package/dist/lib/helpers/arg.js +6 -5
- package/dist/lib/helpers/command.js +14 -0
- package/dist/lib/helpers/flag.js +18 -0
- package/dist/lib/helpers/string.js +4 -0
- package/dist/lib/marshal/commit/index.js +0 -1
- package/dist/lib/resources.js +6 -1
- package/dist/lib/urls.js +4 -0
- package/oclif.manifest.json +316 -50
- package/package.json +13 -4
- package/dist/commands/ping.js +0 -37
- package/dist/lib/marshal/commit/types.js +0 -5
|
@@ -10,6 +10,7 @@ Object.defineProperty(exports, "default", {
|
|
|
10
10
|
});
|
|
11
11
|
const _core = require("@oclif/core");
|
|
12
12
|
const _basecommand = /*#__PURE__*/ _interop_require_default(require("../../lib/base-command"));
|
|
13
|
+
const _command = require("../../lib/helpers/command");
|
|
13
14
|
const _const = require("../../lib/helpers/const");
|
|
14
15
|
const _error = require("../../lib/helpers/error");
|
|
15
16
|
const _flag = /*#__PURE__*/ _interop_require_wildcard(require("../../lib/helpers/flag"));
|
|
@@ -102,7 +103,8 @@ class WorkflowValidate extends _basecommand.default {
|
|
|
102
103
|
_ux.spinner.stop();
|
|
103
104
|
// 3. Display a success message.
|
|
104
105
|
const workflowKeys = workflows.map((w)=>w.key);
|
|
105
|
-
|
|
106
|
+
const scope = (0, _command.formatCommandScope)(this.props.flags);
|
|
107
|
+
this.log(`‣ Successfully validated ${workflows.length} workflow(s) using ${scope}:\n` + (0, _string.indentString)(workflowKeys.join("\n"), 4));
|
|
106
108
|
}
|
|
107
109
|
static async validateAll(api, props, workflows) {
|
|
108
110
|
// TODO: Throw an error if a non validation error (e.g. authentication error)
|
|
@@ -129,6 +131,7 @@ _define_property(WorkflowValidate, "flags", {
|
|
|
129
131
|
_const.KnockEnv.Development
|
|
130
132
|
]
|
|
131
133
|
}),
|
|
134
|
+
branch: _flag.branch,
|
|
132
135
|
all: _core.Flags.boolean({
|
|
133
136
|
summary: "Whether to validate all workflows from the target directory."
|
|
134
137
|
}),
|
package/dist/lib/api-v1.js
CHANGED
|
@@ -40,9 +40,6 @@ class ApiV1 {
|
|
|
40
40
|
getToken(sessionContext) {
|
|
41
41
|
return sessionContext.session ? sessionContext.session.accessToken : sessionContext.token;
|
|
42
42
|
}
|
|
43
|
-
async ping() {
|
|
44
|
-
return this.get("/ping");
|
|
45
|
-
}
|
|
46
43
|
async whoami() {
|
|
47
44
|
return this.get("/whoami");
|
|
48
45
|
}
|
|
@@ -50,6 +47,7 @@ class ApiV1 {
|
|
|
50
47
|
async listWorkflows({ flags }) {
|
|
51
48
|
const params = (0, _objectisomorphic.prune)({
|
|
52
49
|
environment: flags.environment,
|
|
50
|
+
branch: flags.branch,
|
|
53
51
|
annotate: flags.annotate,
|
|
54
52
|
hide_uncommitted_changes: flags["hide-uncommitted-changes"],
|
|
55
53
|
...(0, _page.toPageParams)(flags)
|
|
@@ -61,6 +59,7 @@ class ApiV1 {
|
|
|
61
59
|
async getWorkflow({ args, flags }) {
|
|
62
60
|
const params = (0, _objectisomorphic.prune)({
|
|
63
61
|
environment: flags.environment,
|
|
62
|
+
branch: flags.branch,
|
|
64
63
|
annotate: flags.annotate,
|
|
65
64
|
hide_uncommitted_changes: flags["hide-uncommitted-changes"]
|
|
66
65
|
});
|
|
@@ -71,6 +70,7 @@ class ApiV1 {
|
|
|
71
70
|
async upsertWorkflow({ flags }, workflow) {
|
|
72
71
|
const params = (0, _objectisomorphic.prune)({
|
|
73
72
|
environment: flags.environment,
|
|
73
|
+
branch: flags.branch,
|
|
74
74
|
annotate: flags.annotate,
|
|
75
75
|
commit: flags.commit,
|
|
76
76
|
commit_message: flags["commit-message"]
|
|
@@ -84,7 +84,8 @@ class ApiV1 {
|
|
|
84
84
|
}
|
|
85
85
|
async validateWorkflow({ flags }, workflow) {
|
|
86
86
|
const params = (0, _objectisomorphic.prune)({
|
|
87
|
-
environment: flags.environment
|
|
87
|
+
environment: flags.environment,
|
|
88
|
+
branch: flags.branch
|
|
88
89
|
});
|
|
89
90
|
const data = {
|
|
90
91
|
workflow
|
|
@@ -96,6 +97,7 @@ class ApiV1 {
|
|
|
96
97
|
async activateWorkflow({ args, flags }) {
|
|
97
98
|
const params = (0, _objectisomorphic.prune)({
|
|
98
99
|
environment: flags.environment,
|
|
100
|
+
branch: flags.branch,
|
|
99
101
|
status: flags.status
|
|
100
102
|
});
|
|
101
103
|
return this.put(`/workflows/${args.workflowKey}/activate`, {}, {
|
|
@@ -104,7 +106,8 @@ class ApiV1 {
|
|
|
104
106
|
}
|
|
105
107
|
async runWorkflow({ args, flags }) {
|
|
106
108
|
const params = (0, _objectisomorphic.prune)({
|
|
107
|
-
environment: flags.environment
|
|
109
|
+
environment: flags.environment,
|
|
110
|
+
branch: flags.branch
|
|
108
111
|
});
|
|
109
112
|
const data = (0, _objectisomorphic.prune)({
|
|
110
113
|
recipients: flags.recipients,
|
|
@@ -120,6 +123,7 @@ class ApiV1 {
|
|
|
120
123
|
async listCommits({ flags }) {
|
|
121
124
|
const params = (0, _objectisomorphic.prune)({
|
|
122
125
|
environment: flags.environment,
|
|
126
|
+
branch: flags.branch,
|
|
123
127
|
promoted: flags.promoted,
|
|
124
128
|
resource_type: flags["resource-type"],
|
|
125
129
|
resource_id: flags["resource-id"],
|
|
@@ -129,12 +133,10 @@ class ApiV1 {
|
|
|
129
133
|
params
|
|
130
134
|
});
|
|
131
135
|
}
|
|
132
|
-
async getCommit({ args }) {
|
|
133
|
-
return this.get(`/commits/${args.id}`);
|
|
134
|
-
}
|
|
135
136
|
async commitAllChanges({ flags }) {
|
|
136
137
|
const params = (0, _objectisomorphic.prune)({
|
|
137
138
|
environment: flags.environment,
|
|
139
|
+
branch: flags.branch,
|
|
138
140
|
commit_message: flags["commit-message"]
|
|
139
141
|
});
|
|
140
142
|
return this.put(`/commits`, {}, {
|
|
@@ -156,6 +158,7 @@ class ApiV1 {
|
|
|
156
158
|
async listTranslations({ flags }, filters = {}) {
|
|
157
159
|
const params = (0, _objectisomorphic.prune)({
|
|
158
160
|
environment: flags.environment,
|
|
161
|
+
branch: flags.branch,
|
|
159
162
|
hide_uncommitted_changes: flags["hide-uncommitted-changes"],
|
|
160
163
|
locale_code: filters.localeCode,
|
|
161
164
|
namespace: filters.namespace,
|
|
@@ -169,6 +172,7 @@ class ApiV1 {
|
|
|
169
172
|
async getTranslation({ flags }, translation) {
|
|
170
173
|
const params = (0, _objectisomorphic.prune)({
|
|
171
174
|
environment: flags.environment,
|
|
175
|
+
branch: flags.branch,
|
|
172
176
|
hide_uncommitted_changes: flags["hide-uncommitted-changes"],
|
|
173
177
|
namespace: translation.namespace,
|
|
174
178
|
format: flags.format
|
|
@@ -180,6 +184,7 @@ class ApiV1 {
|
|
|
180
184
|
async upsertTranslation({ flags }, translation) {
|
|
181
185
|
const params = (0, _objectisomorphic.prune)({
|
|
182
186
|
environment: flags.environment,
|
|
187
|
+
branch: flags.branch,
|
|
183
188
|
commit: flags.commit,
|
|
184
189
|
commit_message: flags["commit-message"],
|
|
185
190
|
namespace: translation.namespace
|
|
@@ -193,6 +198,7 @@ class ApiV1 {
|
|
|
193
198
|
async validateTranslation({ flags }, translation) {
|
|
194
199
|
const params = (0, _objectisomorphic.prune)({
|
|
195
200
|
environment: flags.environment,
|
|
201
|
+
branch: flags.branch,
|
|
196
202
|
namespace: translation.namespace
|
|
197
203
|
});
|
|
198
204
|
const data = {
|
|
@@ -206,6 +212,7 @@ class ApiV1 {
|
|
|
206
212
|
async listEmailLayouts({ flags }) {
|
|
207
213
|
const params = (0, _objectisomorphic.prune)({
|
|
208
214
|
environment: flags.environment,
|
|
215
|
+
branch: flags.branch,
|
|
209
216
|
annotate: flags.annotate,
|
|
210
217
|
hide_uncommitted_changes: flags["hide-uncommitted-changes"],
|
|
211
218
|
...(0, _page.toPageParams)(flags)
|
|
@@ -217,6 +224,7 @@ class ApiV1 {
|
|
|
217
224
|
async getEmailLayout({ args, flags }) {
|
|
218
225
|
const params = (0, _objectisomorphic.prune)({
|
|
219
226
|
environment: flags.environment,
|
|
227
|
+
branch: flags.branch,
|
|
220
228
|
annotate: flags.annotate,
|
|
221
229
|
hide_uncommitted_changes: flags["hide-uncommitted-changes"]
|
|
222
230
|
});
|
|
@@ -227,6 +235,7 @@ class ApiV1 {
|
|
|
227
235
|
async upsertEmailLayout({ flags }, layout) {
|
|
228
236
|
const params = (0, _objectisomorphic.prune)({
|
|
229
237
|
environment: flags.environment,
|
|
238
|
+
branch: flags.branch,
|
|
230
239
|
annotate: flags.annotate,
|
|
231
240
|
commit: flags.commit,
|
|
232
241
|
commit_message: flags["commit-message"]
|
|
@@ -240,7 +249,8 @@ class ApiV1 {
|
|
|
240
249
|
}
|
|
241
250
|
async validateEmailLayout({ flags }, layout) {
|
|
242
251
|
const params = (0, _objectisomorphic.prune)({
|
|
243
|
-
environment: flags.environment
|
|
252
|
+
environment: flags.environment,
|
|
253
|
+
branch: flags.branch
|
|
244
254
|
});
|
|
245
255
|
const data = {
|
|
246
256
|
email_layout: layout
|
|
@@ -253,6 +263,7 @@ class ApiV1 {
|
|
|
253
263
|
async listPartials({ flags }) {
|
|
254
264
|
const params = (0, _objectisomorphic.prune)({
|
|
255
265
|
environment: flags.environment,
|
|
266
|
+
branch: flags.branch,
|
|
256
267
|
hide_uncommitted_changes: flags["hide-uncommitted-changes"],
|
|
257
268
|
annotate: flags.annotate,
|
|
258
269
|
...(0, _page.toPageParams)(flags)
|
|
@@ -264,6 +275,7 @@ class ApiV1 {
|
|
|
264
275
|
async getPartial({ args, flags }) {
|
|
265
276
|
const params = (0, _objectisomorphic.prune)({
|
|
266
277
|
environment: flags.environment,
|
|
278
|
+
branch: flags.branch,
|
|
267
279
|
annotate: flags.annotate,
|
|
268
280
|
hide_uncommitted_changes: flags["hide-uncommitted-changes"]
|
|
269
281
|
});
|
|
@@ -274,6 +286,7 @@ class ApiV1 {
|
|
|
274
286
|
async upsertPartial({ flags }, partial) {
|
|
275
287
|
const params = (0, _objectisomorphic.prune)({
|
|
276
288
|
environment: flags.environment,
|
|
289
|
+
branch: flags.branch,
|
|
277
290
|
annotate: flags.annotate,
|
|
278
291
|
commit: flags.commit,
|
|
279
292
|
commit_message: flags["commit-message"]
|
|
@@ -287,7 +300,8 @@ class ApiV1 {
|
|
|
287
300
|
}
|
|
288
301
|
async validatePartial({ flags }, partial) {
|
|
289
302
|
const params = (0, _objectisomorphic.prune)({
|
|
290
|
-
environment: flags.environment
|
|
303
|
+
environment: flags.environment,
|
|
304
|
+
branch: flags.branch
|
|
291
305
|
});
|
|
292
306
|
const data = {
|
|
293
307
|
partial
|
|
@@ -300,6 +314,7 @@ class ApiV1 {
|
|
|
300
314
|
async listMessageTypes({ flags }) {
|
|
301
315
|
const params = (0, _objectisomorphic.prune)({
|
|
302
316
|
environment: flags.environment,
|
|
317
|
+
branch: flags.branch,
|
|
303
318
|
hide_uncommitted_changes: flags["hide-uncommitted-changes"],
|
|
304
319
|
annotate: flags.annotate,
|
|
305
320
|
...(0, _page.toPageParams)(flags)
|
|
@@ -311,6 +326,7 @@ class ApiV1 {
|
|
|
311
326
|
async getMessageType({ args, flags }) {
|
|
312
327
|
const params = (0, _objectisomorphic.prune)({
|
|
313
328
|
environment: flags.environment,
|
|
329
|
+
branch: flags.branch,
|
|
314
330
|
annotate: flags.annotate,
|
|
315
331
|
hide_uncommitted_changes: flags["hide-uncommitted-changes"]
|
|
316
332
|
});
|
|
@@ -321,6 +337,7 @@ class ApiV1 {
|
|
|
321
337
|
async upsertMessageType({ flags }, messageType) {
|
|
322
338
|
const params = (0, _objectisomorphic.prune)({
|
|
323
339
|
environment: flags.environment,
|
|
340
|
+
branch: flags.branch,
|
|
324
341
|
annotate: flags.annotate,
|
|
325
342
|
commit: flags.commit,
|
|
326
343
|
commit_message: flags["commit-message"]
|
|
@@ -334,7 +351,8 @@ class ApiV1 {
|
|
|
334
351
|
}
|
|
335
352
|
async validateMessageType({ flags }, messageType) {
|
|
336
353
|
const params = (0, _objectisomorphic.prune)({
|
|
337
|
-
environment: flags.environment
|
|
354
|
+
environment: flags.environment,
|
|
355
|
+
branch: flags.branch
|
|
338
356
|
});
|
|
339
357
|
const data = {
|
|
340
358
|
message_type: messageType
|
|
@@ -347,6 +365,7 @@ class ApiV1 {
|
|
|
347
365
|
async listGuides({ flags }) {
|
|
348
366
|
const params = (0, _objectisomorphic.prune)({
|
|
349
367
|
environment: flags.environment,
|
|
368
|
+
branch: flags.branch,
|
|
350
369
|
annotate: flags.annotate,
|
|
351
370
|
hide_uncommitted_changes: flags["hide-uncommitted-changes"],
|
|
352
371
|
include_json_schema: flags["include-json-schema"],
|
|
@@ -359,6 +378,7 @@ class ApiV1 {
|
|
|
359
378
|
async getGuide({ args, flags }) {
|
|
360
379
|
const params = (0, _objectisomorphic.prune)({
|
|
361
380
|
environment: flags.environment,
|
|
381
|
+
branch: flags.branch,
|
|
362
382
|
annotate: flags.annotate,
|
|
363
383
|
hide_uncommitted_changes: flags["hide-uncommitted-changes"]
|
|
364
384
|
});
|
|
@@ -368,7 +388,8 @@ class ApiV1 {
|
|
|
368
388
|
}
|
|
369
389
|
async validateGuide({ flags }, guide) {
|
|
370
390
|
const params = (0, _objectisomorphic.prune)({
|
|
371
|
-
environment: flags.environment
|
|
391
|
+
environment: flags.environment,
|
|
392
|
+
branch: flags.branch
|
|
372
393
|
});
|
|
373
394
|
const data = {
|
|
374
395
|
guide
|
|
@@ -380,6 +401,7 @@ class ApiV1 {
|
|
|
380
401
|
async upsertGuide({ flags }, guide) {
|
|
381
402
|
const params = (0, _objectisomorphic.prune)({
|
|
382
403
|
environment: flags.environment,
|
|
404
|
+
branch: flags.branch,
|
|
383
405
|
annotate: flags.annotate,
|
|
384
406
|
commit: flags.commit,
|
|
385
407
|
commit_message: flags["commit-message"]
|
|
@@ -394,6 +416,7 @@ class ApiV1 {
|
|
|
394
416
|
async activateGuide({ args, flags }) {
|
|
395
417
|
const params = (0, _objectisomorphic.prune)({
|
|
396
418
|
environment: flags.environment,
|
|
419
|
+
branch: flags.branch,
|
|
397
420
|
status: flags.status,
|
|
398
421
|
from: flags.from,
|
|
399
422
|
until: flags.until
|
package/dist/lib/helpers/arg.js
CHANGED
|
@@ -9,15 +9,16 @@ Object.defineProperty(exports, "CustomArgs", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _core = require("@oclif/core");
|
|
12
|
-
const
|
|
12
|
+
const _string = require("./string");
|
|
13
|
+
const slug = _core.Args.custom({
|
|
13
14
|
parse: async (str)=>{
|
|
14
|
-
const
|
|
15
|
-
if (!
|
|
15
|
+
const slugifiedInput = (0, _string.slugify)(str);
|
|
16
|
+
if (!slugifiedInput) {
|
|
16
17
|
throw new Error("Invalid slug provided");
|
|
17
18
|
}
|
|
18
|
-
return
|
|
19
|
+
return slugifiedInput;
|
|
19
20
|
}
|
|
20
21
|
});
|
|
21
22
|
const CustomArgs = {
|
|
22
|
-
|
|
23
|
+
slug
|
|
23
24
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "formatCommandScope", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return formatCommandScope;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const formatCommandScope = (flags)=>{
|
|
12
|
+
const { environment, branch } = flags;
|
|
13
|
+
return `\`${branch !== null && branch !== void 0 ? branch : environment}\` ${branch ? "branch" : "environment"}`;
|
|
14
|
+
};
|
package/dist/lib/helpers/flag.js
CHANGED
|
@@ -12,6 +12,9 @@ _export(exports, {
|
|
|
12
12
|
get booleanStr () {
|
|
13
13
|
return booleanStr;
|
|
14
14
|
},
|
|
15
|
+
get branch () {
|
|
16
|
+
return branch;
|
|
17
|
+
},
|
|
15
18
|
get dirPath () {
|
|
16
19
|
return dirPath;
|
|
17
20
|
},
|
|
@@ -32,6 +35,7 @@ const _nodepath = /*#__PURE__*/ _interop_require_wildcard(require("node:path"));
|
|
|
32
35
|
const _core = require("@oclif/core");
|
|
33
36
|
const _fsextra = /*#__PURE__*/ _interop_require_wildcard(require("fs-extra"));
|
|
34
37
|
const _json = require("./json");
|
|
38
|
+
const _string = require("./string");
|
|
35
39
|
function _getRequireWildcardCache(nodeInterop) {
|
|
36
40
|
if (typeof WeakMap !== "function") return null;
|
|
37
41
|
var cacheBabelInterop = new WeakMap();
|
|
@@ -131,3 +135,17 @@ const maybeJsonStrAsList = _core.Flags.custom({
|
|
|
131
135
|
];
|
|
132
136
|
}
|
|
133
137
|
});
|
|
138
|
+
const slug = _core.Flags.custom({
|
|
139
|
+
parse: async (str)=>{
|
|
140
|
+
const slugifiedInput = (0, _string.slugify)(str);
|
|
141
|
+
if (!slugifiedInput) {
|
|
142
|
+
throw new Error("Invalid slug provided");
|
|
143
|
+
}
|
|
144
|
+
return slugifiedInput;
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
const branch = slug({
|
|
148
|
+
summary: "The slug of the branch to use.",
|
|
149
|
+
// TODO Hide until branching is released in GA
|
|
150
|
+
hidden: true
|
|
151
|
+
});
|
|
@@ -16,6 +16,9 @@ _export(exports, {
|
|
|
16
16
|
},
|
|
17
17
|
get indentString () {
|
|
18
18
|
return indentString;
|
|
19
|
+
},
|
|
20
|
+
get slugify () {
|
|
21
|
+
return slugify;
|
|
19
22
|
}
|
|
20
23
|
});
|
|
21
24
|
const SLUG_FORMAT_RE = /^[\w-]+$/;
|
|
@@ -44,3 +47,4 @@ const indentString = (string, count = 0, options = {})=>{
|
|
|
44
47
|
const regex = includeEmptyLines ? /^/gm : /^(?!\s*$)/gm;
|
|
45
48
|
return string.replace(regex, indent.repeat(count));
|
|
46
49
|
};
|
|
50
|
+
const slugify = (input)=>input.toLowerCase().trim().replace(/\s+/g, "-");
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
5
|
_export_star(require("./helpers"), exports);
|
|
6
|
-
_export_star(require("./types"), exports);
|
|
7
6
|
function _export_star(from, to) {
|
|
8
7
|
Object.keys(from).forEach(function(k) {
|
|
9
8
|
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
package/dist/lib/resources.js
CHANGED
|
@@ -22,11 +22,16 @@ const ALL_RESOURCE_TYPES = [
|
|
|
22
22
|
// Email layouts next, as workflows with email channel steps may reference them
|
|
23
23
|
"email_layout",
|
|
24
24
|
"workflow",
|
|
25
|
+
// Message types then guides, as guides use message types.
|
|
26
|
+
"message_type",
|
|
27
|
+
"guide",
|
|
25
28
|
"translation"
|
|
26
29
|
];
|
|
27
30
|
const RESOURCE_SUBDIRS = {
|
|
28
31
|
email_layout: "layouts",
|
|
29
32
|
partial: "partials",
|
|
30
33
|
translation: "translations",
|
|
31
|
-
workflow: "workflows"
|
|
34
|
+
workflow: "workflows",
|
|
35
|
+
message_type: "message-types",
|
|
36
|
+
guide: "guides"
|
|
32
37
|
};
|
package/dist/lib/urls.js
CHANGED
|
@@ -23,6 +23,9 @@ _export(exports, {
|
|
|
23
23
|
},
|
|
24
24
|
get authSuccessUrl () {
|
|
25
25
|
return authSuccessUrl;
|
|
26
|
+
},
|
|
27
|
+
get viewWorkflowUrl () {
|
|
28
|
+
return viewWorkflowUrl;
|
|
26
29
|
}
|
|
27
30
|
});
|
|
28
31
|
const DEFAULT_DASHBOARD_URL = "https://dashboard.knock.app";
|
|
@@ -30,3 +33,4 @@ const DEFAULT_AUTH_URL = "https://signin.knock.app";
|
|
|
30
33
|
const DEFAULT_API_URL = "https://control.knock.app";
|
|
31
34
|
const authSuccessUrl = (dashboardUrl)=>`${dashboardUrl}/auth/oauth/cli`;
|
|
32
35
|
const authErrorUrl = (dashboardUrl, error)=>`${dashboardUrl}/auth/oauth/cli?error=${error}`;
|
|
36
|
+
const viewWorkflowUrl = (dashboardUrl, accountSlug, envOrBranchSlug, workflowKey)=>`${dashboardUrl}/${accountSlug}/${envOrBranchSlug.toLowerCase()}/workflows/${workflowKey}`;
|