|
1 | | -const shortcut = require("../../shortcut.app"); |
2 | | -const get = require("lodash/get"); |
3 | | -const validate = require("validate.js"); |
4 | | -const utils = require("../../utils"); |
5 | | -const constants = require("../../constants"); |
| 1 | +import shortcut from "../../shortcut.app.mjs"; |
| 2 | +import lodash from "lodash"; |
| 3 | +import validate from "validate.js"; |
| 4 | +import utils from "../../common/utils.mjs"; |
| 5 | +import constants from "../../common/constants.mjs"; |
6 | 6 |
|
7 | | -module.exports = { |
| 7 | +export default { |
8 | 8 | key: "shortcut-create-story", |
9 | 9 | name: "Create Story", |
10 | 10 | description: "Creates a new story in your Shortcut account. See [Create Story](https://shortcut.com/api/rest/v3#Create-Story) in Shortcut Rest API, V3 reference for endpoint documentation.", |
11 | | - version: "0.0.1", |
| 11 | + version: "1.0.0", |
12 | 12 | type: "action", |
13 | 13 | props: { |
14 | 14 | shortcut, |
@@ -58,7 +58,7 @@ module.exports = { |
58 | 58 | async options() { |
59 | 59 | let options = []; |
60 | 60 | const epics = await this.shortcut.callWithRetry("listEpics"); |
61 | | - const isEpicDataAvailable = get(epics, [ |
| 61 | + const isEpicDataAvailable = lodash.get(epics, [ |
62 | 62 | "data", |
63 | 63 | "length", |
64 | 64 | ]); |
@@ -100,7 +100,7 @@ module.exports = { |
100 | 100 | async options() { |
101 | 101 | let options = []; |
102 | 102 | const files = await this.shortcut.callWithRetry("listFiles"); |
103 | | - const isFileDataAvailable = get(files, [ |
| 103 | + const isFileDataAvailable = lodash.get(files, [ |
104 | 104 | "data", |
105 | 105 | "length", |
106 | 106 | ]); |
@@ -131,7 +131,7 @@ module.exports = { |
131 | 131 | async options() { |
132 | 132 | let options = []; |
133 | 133 | const iterations = await this.shortcut.callWithRetry("listIterations"); |
134 | | - const isIterationDataAvailable = get(iterations, [ |
| 134 | + const isIterationDataAvailable = lodash.get(iterations, [ |
135 | 135 | "data", |
136 | 136 | "length", |
137 | 137 | ]); |
@@ -161,7 +161,7 @@ module.exports = { |
161 | 161 | async options() { |
162 | 162 | let options = []; |
163 | 163 | const linkedFiles = await this.shortcut.callWithRetry("listLinkedFiles"); |
164 | | - const isLinkedFilesDataAvailable = get(linkedFiles, [ |
| 164 | + const isLinkedFilesDataAvailable = lodash.get(linkedFiles, [ |
165 | 165 | "data", |
166 | 166 | "length", |
167 | 167 | ]); |
@@ -197,7 +197,7 @@ module.exports = { |
197 | 197 | async options() { |
198 | 198 | let options = []; |
199 | 199 | const projects = await this.shortcut.callWithRetry("listProjects"); |
200 | | - const isProjectDataAvailable = get(projects, [ |
| 200 | + const isProjectDataAvailable = lodash.get(projects, [ |
201 | 201 | "data", |
202 | 202 | "length", |
203 | 203 | ]); |
@@ -261,15 +261,15 @@ module.exports = { |
261 | 261 | async options() { |
262 | 262 | let options = []; |
263 | 263 | const workflows = await this.shortcut.callWithRetry("listWorkflows"); |
264 | | - const isWorkflowDataAvailable = get(workflows, [ |
| 264 | + const isWorkflowDataAvailable = lodash.get(workflows, [ |
265 | 265 | "data", |
266 | 266 | "length", |
267 | 267 | ]); |
268 | 268 | if (!isWorkflowDataAvailable) { |
269 | 269 | return options; |
270 | 270 | } |
271 | 271 | return workflows.data.reduce(function (options, workflow) { |
272 | | - const hasState = get(workflow, [ |
| 272 | + const hasState = lodash.get(workflow, [ |
273 | 273 | "states", |
274 | 274 | "length", |
275 | 275 | ]); |
|
0 commit comments