@runwayml/sdk 1.1.0 → 1.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/CHANGELOG.md +23 -0
- package/README.md +4 -0
- package/core.d.ts +6 -5
- package/core.d.ts.map +1 -1
- package/core.js +19 -5
- package/core.js.map +1 -1
- package/core.mjs +16 -3
- package/core.mjs.map +1 -1
- package/error.d.ts.map +1 -1
- package/index.d.mts +9 -10
- package/index.d.ts +9 -10
- package/index.d.ts.map +1 -1
- package/index.js +21 -8
- package/index.js.map +1 -1
- package/index.mjs +8 -8
- package/index.mjs.map +1 -1
- package/package.json +2 -2
- package/resources/image-to-video.d.ts +27 -7
- package/resources/image-to-video.d.ts.map +1 -1
- package/resources/image-to-video.js +0 -2
- package/resources/image-to-video.js.map +1 -1
- package/resources/image-to-video.mjs +0 -2
- package/resources/image-to-video.mjs.map +1 -1
- package/resources/index.d.ts +2 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/tasks.d.ts +4 -2
- package/resources/tasks.d.ts.map +1 -1
- package/resources/tasks.js +0 -2
- package/resources/tasks.js.map +1 -1
- package/resources/tasks.mjs +0 -2
- package/resources/tasks.mjs.map +1 -1
- package/src/core.ts +28 -10
- package/src/error.ts +1 -1
- package/src/index.ts +23 -13
- package/src/resources/image-to-video.ts +35 -8
- package/src/resources/index.ts +6 -2
- package/src/resources/tasks.ts +5 -3
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/index.js
CHANGED
|
@@ -26,10 +26,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
26
26
|
var _a;
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
28
|
exports.fileFromPath = exports.toFile = exports.UnprocessableEntityError = exports.PermissionDeniedError = exports.InternalServerError = exports.AuthenticationError = exports.BadRequestError = exports.RateLimitError = exports.ConflictError = exports.NotFoundError = exports.APIUserAbortError = exports.APIConnectionTimeoutError = exports.APIConnectionError = exports.APIError = exports.RunwayMLError = exports.RunwayML = void 0;
|
|
29
|
+
const Core = __importStar(require("./core.js"));
|
|
29
30
|
const Errors = __importStar(require("./error.js"));
|
|
30
31
|
const Uploads = __importStar(require("./uploads.js"));
|
|
31
|
-
const Core = __importStar(require("./core.js"));
|
|
32
32
|
const API = __importStar(require("./resources/index.js"));
|
|
33
|
+
const image_to_video_1 = require("./resources/image-to-video.js");
|
|
34
|
+
const tasks_1 = require("./resources/tasks.js");
|
|
33
35
|
/**
|
|
34
36
|
* API Client for interfacing with the RunwayML API.
|
|
35
37
|
*/
|
|
@@ -38,7 +40,7 @@ class RunwayML extends Core.APIClient {
|
|
|
38
40
|
* API Client for interfacing with the RunwayML API.
|
|
39
41
|
*
|
|
40
42
|
* @param {string | undefined} [opts.apiKey=process.env['RUNWAYML_API_SECRET'] ?? undefined]
|
|
41
|
-
* @param {string | undefined} [opts.runwayVersion=2024-
|
|
43
|
+
* @param {string | undefined} [opts.runwayVersion=2024-11-06]
|
|
42
44
|
* @param {string} [opts.baseURL=process.env['RUNWAYML_BASE_URL'] ?? https://api.dev.runwayml.com] - Override the default base URL for the API.
|
|
43
45
|
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
44
46
|
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
|
|
@@ -47,7 +49,7 @@ class RunwayML extends Core.APIClient {
|
|
|
47
49
|
* @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
|
|
48
50
|
* @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
49
51
|
*/
|
|
50
|
-
constructor({ baseURL = Core.readEnv('RUNWAYML_BASE_URL'), apiKey = Core.readEnv('RUNWAYML_API_SECRET'), runwayVersion = '2024-
|
|
52
|
+
constructor({ baseURL = Core.readEnv('RUNWAYML_BASE_URL'), apiKey = Core.readEnv('RUNWAYML_API_SECRET'), runwayVersion = '2024-11-06', ...opts } = {}) {
|
|
51
53
|
if (apiKey === undefined) {
|
|
52
54
|
throw new Errors.RunwayMLError("The RUNWAYML_API_SECRET environment variable is missing or empty; either provide it, or instantiate the RunwayML client with an apiKey option, like new RunwayML({ apiKey: 'My API Key' }).");
|
|
53
55
|
}
|
|
@@ -106,13 +108,24 @@ RunwayML.PermissionDeniedError = Errors.PermissionDeniedError;
|
|
|
106
108
|
RunwayML.UnprocessableEntityError = Errors.UnprocessableEntityError;
|
|
107
109
|
RunwayML.toFile = Uploads.toFile;
|
|
108
110
|
RunwayML.fileFromPath = Uploads.fileFromPath;
|
|
109
|
-
|
|
111
|
+
var error_1 = require("./error.js");
|
|
112
|
+
Object.defineProperty(exports, "RunwayMLError", { enumerable: true, get: function () { return error_1.RunwayMLError; } });
|
|
113
|
+
Object.defineProperty(exports, "APIError", { enumerable: true, get: function () { return error_1.APIError; } });
|
|
114
|
+
Object.defineProperty(exports, "APIConnectionError", { enumerable: true, get: function () { return error_1.APIConnectionError; } });
|
|
115
|
+
Object.defineProperty(exports, "APIConnectionTimeoutError", { enumerable: true, get: function () { return error_1.APIConnectionTimeoutError; } });
|
|
116
|
+
Object.defineProperty(exports, "APIUserAbortError", { enumerable: true, get: function () { return error_1.APIUserAbortError; } });
|
|
117
|
+
Object.defineProperty(exports, "NotFoundError", { enumerable: true, get: function () { return error_1.NotFoundError; } });
|
|
118
|
+
Object.defineProperty(exports, "ConflictError", { enumerable: true, get: function () { return error_1.ConflictError; } });
|
|
119
|
+
Object.defineProperty(exports, "RateLimitError", { enumerable: true, get: function () { return error_1.RateLimitError; } });
|
|
120
|
+
Object.defineProperty(exports, "BadRequestError", { enumerable: true, get: function () { return error_1.BadRequestError; } });
|
|
121
|
+
Object.defineProperty(exports, "AuthenticationError", { enumerable: true, get: function () { return error_1.AuthenticationError; } });
|
|
122
|
+
Object.defineProperty(exports, "InternalServerError", { enumerable: true, get: function () { return error_1.InternalServerError; } });
|
|
123
|
+
Object.defineProperty(exports, "PermissionDeniedError", { enumerable: true, get: function () { return error_1.PermissionDeniedError; } });
|
|
124
|
+
Object.defineProperty(exports, "UnprocessableEntityError", { enumerable: true, get: function () { return error_1.UnprocessableEntityError; } });
|
|
110
125
|
exports.toFile = Uploads.toFile;
|
|
111
126
|
exports.fileFromPath = Uploads.fileFromPath;
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
RunwayML.ImageToVideo = API.ImageToVideo;
|
|
115
|
-
})(RunwayML = exports.RunwayML || (exports.RunwayML = {}));
|
|
127
|
+
RunwayML.Tasks = tasks_1.Tasks;
|
|
128
|
+
RunwayML.ImageToVideo = image_to_video_1.ImageToVideo;
|
|
116
129
|
exports = module.exports = RunwayML;
|
|
117
130
|
exports.default = RunwayML;
|
|
118
131
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGtF,gDAA+B;AAC/B,mDAAkC;AAClC,sDAAqC;AACrC,0DAAyC;AACzC,kEAIoC;AACpC,gDAAgE;AAmEhE;;GAEG;AACH,MAAa,QAAS,SAAQ,IAAI,CAAC,SAAS;IAM1C;;;;;;;;;;;;OAYG;IACH,YAAY,EACV,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,EAC3C,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,EAC5C,aAAa,GAAG,YAAY,EAC5B,GAAG,IAAI,KACU,EAAE;QACnB,IAAI,MAAM,KAAK,SAAS,EAAE;YACxB,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C;AACvB,QAAQ,CAAC,YAAY,GAAG,6BAAY,CAAC;AAcrC,kBAAe,QAAQ,CAAC"}
|
package/index.mjs
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
var _a;
|
|
3
|
+
import * as Core from "./core.mjs";
|
|
3
4
|
import * as Errors from "./error.mjs";
|
|
4
5
|
import * as Uploads from "./uploads.mjs";
|
|
5
|
-
import * as Core from "./core.mjs";
|
|
6
6
|
import * as API from "./resources/index.mjs";
|
|
7
|
+
import { ImageToVideo, } from "./resources/image-to-video.mjs";
|
|
8
|
+
import { Tasks } from "./resources/tasks.mjs";
|
|
7
9
|
/**
|
|
8
10
|
* API Client for interfacing with the RunwayML API.
|
|
9
11
|
*/
|
|
@@ -12,7 +14,7 @@ export class RunwayML extends Core.APIClient {
|
|
|
12
14
|
* API Client for interfacing with the RunwayML API.
|
|
13
15
|
*
|
|
14
16
|
* @param {string | undefined} [opts.apiKey=process.env['RUNWAYML_API_SECRET'] ?? undefined]
|
|
15
|
-
* @param {string | undefined} [opts.runwayVersion=2024-
|
|
17
|
+
* @param {string | undefined} [opts.runwayVersion=2024-11-06]
|
|
16
18
|
* @param {string} [opts.baseURL=process.env['RUNWAYML_BASE_URL'] ?? https://api.dev.runwayml.com] - Override the default base URL for the API.
|
|
17
19
|
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
18
20
|
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
|
|
@@ -21,7 +23,7 @@ export class RunwayML extends Core.APIClient {
|
|
|
21
23
|
* @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
|
|
22
24
|
* @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
23
25
|
*/
|
|
24
|
-
constructor({ baseURL = Core.readEnv('RUNWAYML_BASE_URL'), apiKey = Core.readEnv('RUNWAYML_API_SECRET'), runwayVersion = '2024-
|
|
26
|
+
constructor({ baseURL = Core.readEnv('RUNWAYML_BASE_URL'), apiKey = Core.readEnv('RUNWAYML_API_SECRET'), runwayVersion = '2024-11-06', ...opts } = {}) {
|
|
25
27
|
if (apiKey === undefined) {
|
|
26
28
|
throw new Errors.RunwayMLError("The RUNWAYML_API_SECRET environment variable is missing or empty; either provide it, or instantiate the RunwayML client with an apiKey option, like new RunwayML({ apiKey: 'My API Key' }).");
|
|
27
29
|
}
|
|
@@ -79,12 +81,10 @@ RunwayML.PermissionDeniedError = Errors.PermissionDeniedError;
|
|
|
79
81
|
RunwayML.UnprocessableEntityError = Errors.UnprocessableEntityError;
|
|
80
82
|
RunwayML.toFile = Uploads.toFile;
|
|
81
83
|
RunwayML.fileFromPath = Uploads.fileFromPath;
|
|
82
|
-
export
|
|
84
|
+
export { RunwayMLError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } from "./error.mjs";
|
|
83
85
|
export var toFile = Uploads.toFile;
|
|
84
86
|
export var fileFromPath = Uploads.fileFromPath;
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
RunwayML.ImageToVideo = API.ImageToVideo;
|
|
88
|
-
})(RunwayML || (RunwayML = {}));
|
|
87
|
+
RunwayML.Tasks = Tasks;
|
|
88
|
+
RunwayML.ImageToVideo = ImageToVideo;
|
|
89
89
|
export default RunwayML;
|
|
90
90
|
//# sourceMappingURL=index.mjs.map
|
package/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;;
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;;OAG/E,KAAK,IAAI;OACT,KAAK,MAAM;OACX,K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AAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,GACzB;AAED,MAAM,KAAQ,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;AACtC,MAAM,KAAQ,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;AAElD,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC;AACvB,QAAQ,CAAC,YAAY,GAAG,YAAY,CAAC;AAcrC,eAAe,QAAQ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@runwayml/sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "The official TypeScript library for the RunwayML API",
|
|
5
5
|
"author": "RunwayML <dev-feedback@runwayml.com>",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"packageManager": "yarn@1.22.22",
|
|
12
12
|
"files": [
|
|
13
|
-
"
|
|
13
|
+
"**/*"
|
|
14
14
|
],
|
|
15
15
|
"private": false,
|
|
16
16
|
"scripts": {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { APIResource } from "../resource.js";
|
|
2
2
|
import * as Core from "../core.js";
|
|
3
|
-
import * as ImageToVideoAPI from "./image-to-video.js";
|
|
4
3
|
export declare class ImageToVideo extends APIResource {
|
|
5
4
|
/**
|
|
6
5
|
* This endpoint will start a new task to generate a video from an image prompt.
|
|
@@ -9,7 +8,8 @@ export declare class ImageToVideo extends APIResource {
|
|
|
9
8
|
}
|
|
10
9
|
export interface ImageToVideoCreateResponse {
|
|
11
10
|
/**
|
|
12
|
-
* The ID of the newly created task.
|
|
11
|
+
* The ID of the newly created task. Use this ID to query the task status and
|
|
12
|
+
* retrieve the generated video.
|
|
13
13
|
*/
|
|
14
14
|
id: string;
|
|
15
15
|
}
|
|
@@ -19,11 +19,17 @@ export interface ImageToVideoCreateParams {
|
|
|
19
19
|
*/
|
|
20
20
|
model: 'gen3a_turbo';
|
|
21
21
|
/**
|
|
22
|
-
* A HTTPS URL
|
|
23
|
-
*
|
|
22
|
+
* A HTTPS URL or data URI containing an encoded image to be used as the first
|
|
23
|
+
* frame of the generated video. See [our docs](/assets/inputs#images) on image
|
|
24
|
+
* inputs for more information.
|
|
24
25
|
*/
|
|
25
|
-
promptImage: string
|
|
26
|
+
promptImage: string | Array<ImageToVideoCreateParams.PromptImage>;
|
|
27
|
+
/**
|
|
28
|
+
* The number of seconds of duration for the output video.
|
|
29
|
+
*/
|
|
30
|
+
duration?: 5 | 10;
|
|
26
31
|
promptText?: string;
|
|
32
|
+
ratio?: '1280:768' | '768:1280';
|
|
27
33
|
/**
|
|
28
34
|
* If unspecified, a random number is chosen. Varying the seed integer is a way to
|
|
29
35
|
* get different results for the same other request parameters. Using the same seed
|
|
@@ -36,8 +42,22 @@ export interface ImageToVideoCreateParams {
|
|
|
36
42
|
*/
|
|
37
43
|
watermark?: boolean;
|
|
38
44
|
}
|
|
45
|
+
export declare namespace ImageToVideoCreateParams {
|
|
46
|
+
interface PromptImage {
|
|
47
|
+
/**
|
|
48
|
+
* The position of the image in the output video. "first" will use the image as the
|
|
49
|
+
* first frame of the video, "last" will use the image as the last frame of the
|
|
50
|
+
* video.
|
|
51
|
+
*/
|
|
52
|
+
position: 'first' | 'last';
|
|
53
|
+
/**
|
|
54
|
+
* A HTTPS URL or data URI containing an encoded image. See
|
|
55
|
+
* [our docs](/assets/inputs#images) on image inputs for more information.
|
|
56
|
+
*/
|
|
57
|
+
uri: string;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
39
60
|
export declare namespace ImageToVideo {
|
|
40
|
-
export
|
|
41
|
-
export import ImageToVideoCreateParams = ImageToVideoAPI.ImageToVideoCreateParams;
|
|
61
|
+
export { type ImageToVideoCreateResponse as ImageToVideoCreateResponse, type ImageToVideoCreateParams as ImageToVideoCreateParams, };
|
|
42
62
|
}
|
|
43
63
|
//# sourceMappingURL=image-to-video.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-to-video.d.ts","sourceRoot":"","sources":["../src/resources/image-to-video.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"image-to-video.d.ts","sourceRoot":"","sources":["../src/resources/image-to-video.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAEhC,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;OAEG;IACH,MAAM,CACJ,IAAI,EAAE,wBAAwB,EAC9B,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAAC,UAAU,CAAC,0BAA0B,CAAC;CAG/C;AAED,MAAM,WAAW,0BAA0B;IACzC;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,KAAK,EAAE,aAAa,CAAC;IAErB;;;;OAIG;IACH,WAAW,EAAE,MAAM,GAAG,KAAK,CAAC,wBAAwB,CAAC,WAAW,CAAC,CAAC;IAElE;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC;IAElB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,KAAK,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IAEhC;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,yBAAiB,wBAAwB,CAAC;IACxC,UAAiB,WAAW;QAC1B;;;;WAIG;QACH,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC;QAE3B;;;WAGG;QACH,GAAG,EAAE,MAAM,CAAC;KACb;CACF;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EACL,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,wBAAwB,IAAI,wBAAwB,GAC1D,CAAC;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-to-video.js","sourceRoot":"","sources":["../src/resources/image-to-video.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CAA0C;
|
|
1
|
+
{"version":3,"file":"image-to-video.js","sourceRoot":"","sources":["../src/resources/image-to-video.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CAA0C;AAG1C,MAAa,YAAa,SAAQ,sBAAW;IAC3C;;OAEG;IACH,MAAM,CACJ,IAA8B,EAC9B,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvE,CAAC;CACF;AAVD,oCAUC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-to-video.mjs","sourceRoot":"","sources":["../src/resources/image-to-video.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;
|
|
1
|
+
{"version":3,"file":"image-to-video.mjs","sourceRoot":"","sources":["../src/resources/image-to-video.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAGtB,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C;;OAEG;IACH,MAAM,CACJ,IAA8B,EAC9B,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvE,CAAC;CACF"}
|
package/resources/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { ImageToVideoCreateResponse, ImageToVideoCreateParams,
|
|
2
|
-
export {
|
|
1
|
+
export { ImageToVideo, type ImageToVideoCreateResponse, type ImageToVideoCreateParams, } from "./image-to-video.js";
|
|
2
|
+
export { Tasks, type TaskRetrieveResponse } from "./tasks.js";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/resources/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EACZ,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,GAC9B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,KAAK,oBAAoB,EAAE,MAAM,SAAS,CAAC"}
|
package/resources/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,sDAI0B;AAHxB,8GAAA,YAAY,OAAA;AAId,oCAA2D;AAAlD,8FAAA,KAAK,OAAA"}
|
package/resources/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
export { ImageToVideo } from "./image-to-video.mjs";
|
|
2
|
+
export { ImageToVideo, } from "./image-to-video.mjs";
|
|
3
3
|
export { Tasks } from "./tasks.mjs";
|
|
4
4
|
//# sourceMappingURL=index.mjs.map
|
package/resources/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,YAAY,GAGb;OACM,EAAE,KAAK,EAA6B"}
|
package/resources/tasks.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { APIResource } from "../resource.js";
|
|
2
2
|
import * as Core from "../core.js";
|
|
3
|
-
import * as TasksAPI from "./tasks.js";
|
|
4
3
|
export declare class Tasks extends APIResource {
|
|
5
4
|
/**
|
|
6
5
|
* Return details about a task. Consumers of this API should not expect updates
|
|
@@ -18,6 +17,9 @@ export declare class Tasks extends APIResource {
|
|
|
18
17
|
delete(id: string, options?: Core.RequestOptions): Core.APIPromise<void>;
|
|
19
18
|
}
|
|
20
19
|
export interface TaskRetrieveResponse {
|
|
20
|
+
/**
|
|
21
|
+
* The ID of the task being returned.
|
|
22
|
+
*/
|
|
21
23
|
id: string;
|
|
22
24
|
/**
|
|
23
25
|
* The timestamp that the task was submitted at.
|
|
@@ -60,6 +62,6 @@ export interface TaskRetrieveResponse {
|
|
|
60
62
|
progress?: number;
|
|
61
63
|
}
|
|
62
64
|
export declare namespace Tasks {
|
|
63
|
-
export
|
|
65
|
+
export { type TaskRetrieveResponse as TaskRetrieveResponse };
|
|
64
66
|
}
|
|
65
67
|
//# sourceMappingURL=tasks.d.ts.map
|
package/resources/tasks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../src/resources/tasks.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../src/resources/tasks.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAEhC,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;OAGG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,oBAAoB,CAAC;IAI1F;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;CAMzE;AAED,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;;;;;;OAQG;IACH,MAAM,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,WAAW,CAAC;IAEnF;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAEvB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EAAE,KAAK,oBAAoB,IAAI,oBAAoB,EAAE,CAAC;CAC9D"}
|
package/resources/tasks.js
CHANGED
package/resources/tasks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tasks.js","sourceRoot":"","sources":["../src/resources/tasks.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CAA0C;
|
|
1
|
+
{"version":3,"file":"tasks.js","sourceRoot":"","sources":["../src/resources/tasks.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CAA0C;AAG1C,MAAa,KAAM,SAAQ,sBAAW;IACpC;;;OAGG;IACH,QAAQ,CAAC,EAAU,EAAE,OAA6B;QAChD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,EAAU,EAAE,OAA6B;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,EAAE,EAAE;YAC5C,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;CACF;AAvBD,sBAuBC"}
|
package/resources/tasks.mjs
CHANGED
package/resources/tasks.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tasks.mjs","sourceRoot":"","sources":["../src/resources/tasks.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;
|
|
1
|
+
{"version":3,"file":"tasks.mjs","sourceRoot":"","sources":["../src/resources/tasks.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAGtB,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC;;;OAGG;IACH,QAAQ,CAAC,EAAU,EAAE,OAA6B;QAChD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,EAAU,EAAE,OAA6B;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,EAAE,EAAE;YAC5C,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;CACF"}
|
package/src/core.ts
CHANGED
|
@@ -84,8 +84,10 @@ export class APIPromise<T> extends Promise<T> {
|
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
_thenUnwrap<U>(transform: (data: T) => U): APIPromise<U> {
|
|
88
|
-
return new APIPromise(this.responsePromise, async (props) =>
|
|
87
|
+
_thenUnwrap<U>(transform: (data: T, props: APIResponseProps) => U): APIPromise<U> {
|
|
88
|
+
return new APIPromise(this.responsePromise, async (props) =>
|
|
89
|
+
transform(await this.parseResponse(props), props),
|
|
90
|
+
);
|
|
89
91
|
}
|
|
90
92
|
|
|
91
93
|
/**
|
|
@@ -349,7 +351,15 @@ export abstract class APIClient {
|
|
|
349
351
|
delete reqHeaders['content-type'];
|
|
350
352
|
}
|
|
351
353
|
|
|
352
|
-
|
|
354
|
+
// Don't set the retry count header if it was already set or removed through default headers or by the
|
|
355
|
+
// caller. We check `defaultHeaders` and `headers`, which can contain nulls, instead of `reqHeaders` to
|
|
356
|
+
// account for the removal case.
|
|
357
|
+
if (
|
|
358
|
+
getHeader(defaultHeaders, 'x-stainless-retry-count') === undefined &&
|
|
359
|
+
getHeader(headers, 'x-stainless-retry-count') === undefined
|
|
360
|
+
) {
|
|
361
|
+
reqHeaders['x-stainless-retry-count'] = String(retryCount);
|
|
362
|
+
}
|
|
353
363
|
|
|
354
364
|
this.validateHeaders(reqHeaders, headers);
|
|
355
365
|
|
|
@@ -386,7 +396,7 @@ export abstract class APIClient {
|
|
|
386
396
|
error: Object | undefined,
|
|
387
397
|
message: string | undefined,
|
|
388
398
|
headers: Headers | undefined,
|
|
389
|
-
) {
|
|
399
|
+
): APIError {
|
|
390
400
|
return APIError.generate(status, error, message, headers);
|
|
391
401
|
}
|
|
392
402
|
|
|
@@ -658,9 +668,9 @@ export abstract class AbstractPage<Item> implements AsyncIterable<Item> {
|
|
|
658
668
|
return await this.#client.requestAPIList(this.constructor as any, nextOptions);
|
|
659
669
|
}
|
|
660
670
|
|
|
661
|
-
async *iterPages() {
|
|
671
|
+
async *iterPages(): AsyncGenerator<this> {
|
|
662
672
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
663
|
-
let page:
|
|
673
|
+
let page: this = this;
|
|
664
674
|
yield page;
|
|
665
675
|
while (page.hasNextPage()) {
|
|
666
676
|
page = await page.getNextPage();
|
|
@@ -668,7 +678,7 @@ export abstract class AbstractPage<Item> implements AsyncIterable<Item> {
|
|
|
668
678
|
}
|
|
669
679
|
}
|
|
670
680
|
|
|
671
|
-
async *[Symbol.asyncIterator]() {
|
|
681
|
+
async *[Symbol.asyncIterator](): AsyncGenerator<Item> {
|
|
672
682
|
for await (const page of this.iterPages()) {
|
|
673
683
|
for (const item of page.getPaginatedItems()) {
|
|
674
684
|
yield item;
|
|
@@ -711,7 +721,7 @@ export class PagePromise<
|
|
|
711
721
|
* console.log(item)
|
|
712
722
|
* }
|
|
713
723
|
*/
|
|
714
|
-
async *[Symbol.asyncIterator]() {
|
|
724
|
+
async *[Symbol.asyncIterator](): AsyncGenerator<Item> {
|
|
715
725
|
const page = await this;
|
|
716
726
|
for await (const item of page) {
|
|
717
727
|
yield item;
|
|
@@ -1128,7 +1138,15 @@ export const isHeadersProtocol = (headers: any): headers is HeadersProtocol => {
|
|
|
1128
1138
|
return typeof headers?.get === 'function';
|
|
1129
1139
|
};
|
|
1130
1140
|
|
|
1131
|
-
export const getRequiredHeader = (headers: HeadersLike, header: string): string => {
|
|
1141
|
+
export const getRequiredHeader = (headers: HeadersLike | Headers, header: string): string => {
|
|
1142
|
+
const foundHeader = getHeader(headers, header);
|
|
1143
|
+
if (foundHeader === undefined) {
|
|
1144
|
+
throw new Error(`Could not find ${header} header`);
|
|
1145
|
+
}
|
|
1146
|
+
return foundHeader;
|
|
1147
|
+
};
|
|
1148
|
+
|
|
1149
|
+
export const getHeader = (headers: HeadersLike | Headers, header: string): string | undefined => {
|
|
1132
1150
|
const lowerCasedHeader = header.toLowerCase();
|
|
1133
1151
|
if (isHeadersProtocol(headers)) {
|
|
1134
1152
|
// to deal with the case where the header looks like Stainless-Event-Id
|
|
@@ -1154,7 +1172,7 @@ export const getRequiredHeader = (headers: HeadersLike, header: string): string
|
|
|
1154
1172
|
}
|
|
1155
1173
|
}
|
|
1156
1174
|
|
|
1157
|
-
|
|
1175
|
+
return undefined;
|
|
1158
1176
|
};
|
|
1159
1177
|
|
|
1160
1178
|
/**
|
package/src/error.ts
CHANGED
|
@@ -47,7 +47,7 @@ export class APIError extends RunwayMLError {
|
|
|
47
47
|
errorResponse: Object | undefined,
|
|
48
48
|
message: string | undefined,
|
|
49
49
|
headers: Headers | undefined,
|
|
50
|
-
) {
|
|
50
|
+
): APIError {
|
|
51
51
|
if (!status) {
|
|
52
52
|
return new APIConnectionError({ message, cause: castToError(errorResponse) });
|
|
53
53
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import * as Errors from './error';
|
|
4
|
-
import * as Uploads from './uploads';
|
|
5
3
|
import { type Agent } from './_shims/index';
|
|
6
4
|
import * as Core from './core';
|
|
5
|
+
import * as Errors from './error';
|
|
6
|
+
import * as Uploads from './uploads';
|
|
7
7
|
import * as API from './resources/index';
|
|
8
|
+
import {
|
|
9
|
+
ImageToVideo,
|
|
10
|
+
ImageToVideoCreateParams,
|
|
11
|
+
ImageToVideoCreateResponse,
|
|
12
|
+
} from './resources/image-to-video';
|
|
13
|
+
import { TaskRetrieveResponse, Tasks } from './resources/tasks';
|
|
8
14
|
|
|
9
15
|
export interface ClientOptions {
|
|
10
16
|
/**
|
|
@@ -84,7 +90,7 @@ export class RunwayML extends Core.APIClient {
|
|
|
84
90
|
* API Client for interfacing with the RunwayML API.
|
|
85
91
|
*
|
|
86
92
|
* @param {string | undefined} [opts.apiKey=process.env['RUNWAYML_API_SECRET'] ?? undefined]
|
|
87
|
-
* @param {string | undefined} [opts.runwayVersion=2024-
|
|
93
|
+
* @param {string | undefined} [opts.runwayVersion=2024-11-06]
|
|
88
94
|
* @param {string} [opts.baseURL=process.env['RUNWAYML_BASE_URL'] ?? https://api.dev.runwayml.com] - Override the default base URL for the API.
|
|
89
95
|
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
90
96
|
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
|
|
@@ -96,7 +102,7 @@ export class RunwayML extends Core.APIClient {
|
|
|
96
102
|
constructor({
|
|
97
103
|
baseURL = Core.readEnv('RUNWAYML_BASE_URL'),
|
|
98
104
|
apiKey = Core.readEnv('RUNWAYML_API_SECRET'),
|
|
99
|
-
runwayVersion = '2024-
|
|
105
|
+
runwayVersion = '2024-11-06',
|
|
100
106
|
...opts
|
|
101
107
|
}: ClientOptions = {}) {
|
|
102
108
|
if (apiKey === undefined) {
|
|
@@ -172,7 +178,7 @@ export class RunwayML extends Core.APIClient {
|
|
|
172
178
|
static fileFromPath = Uploads.fileFromPath;
|
|
173
179
|
}
|
|
174
180
|
|
|
175
|
-
export
|
|
181
|
+
export {
|
|
176
182
|
RunwayMLError,
|
|
177
183
|
APIError,
|
|
178
184
|
APIConnectionError,
|
|
@@ -186,20 +192,24 @@ export const {
|
|
|
186
192
|
InternalServerError,
|
|
187
193
|
PermissionDeniedError,
|
|
188
194
|
UnprocessableEntityError,
|
|
189
|
-
}
|
|
195
|
+
} from './error';
|
|
190
196
|
|
|
191
197
|
export import toFile = Uploads.toFile;
|
|
192
198
|
export import fileFromPath = Uploads.fileFromPath;
|
|
193
199
|
|
|
194
|
-
|
|
195
|
-
|
|
200
|
+
RunwayML.Tasks = Tasks;
|
|
201
|
+
RunwayML.ImageToVideo = ImageToVideo;
|
|
202
|
+
|
|
203
|
+
export declare namespace RunwayML {
|
|
204
|
+
export type RequestOptions = Core.RequestOptions;
|
|
196
205
|
|
|
197
|
-
export
|
|
198
|
-
export import TaskRetrieveResponse = API.TaskRetrieveResponse;
|
|
206
|
+
export { Tasks as Tasks, type TaskRetrieveResponse as TaskRetrieveResponse };
|
|
199
207
|
|
|
200
|
-
export
|
|
201
|
-
|
|
202
|
-
|
|
208
|
+
export {
|
|
209
|
+
ImageToVideo as ImageToVideo,
|
|
210
|
+
type ImageToVideoCreateResponse as ImageToVideoCreateResponse,
|
|
211
|
+
type ImageToVideoCreateParams as ImageToVideoCreateParams,
|
|
212
|
+
};
|
|
203
213
|
}
|
|
204
214
|
|
|
205
215
|
export default RunwayML;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../resource';
|
|
4
4
|
import * as Core from '../core';
|
|
5
|
-
import * as ImageToVideoAPI from './image-to-video';
|
|
6
5
|
|
|
7
6
|
export class ImageToVideo extends APIResource {
|
|
8
7
|
/**
|
|
@@ -18,7 +17,8 @@ export class ImageToVideo extends APIResource {
|
|
|
18
17
|
|
|
19
18
|
export interface ImageToVideoCreateResponse {
|
|
20
19
|
/**
|
|
21
|
-
* The ID of the newly created task.
|
|
20
|
+
* The ID of the newly created task. Use this ID to query the task status and
|
|
21
|
+
* retrieve the generated video.
|
|
22
22
|
*/
|
|
23
23
|
id: string;
|
|
24
24
|
}
|
|
@@ -30,13 +30,21 @@ export interface ImageToVideoCreateParams {
|
|
|
30
30
|
model: 'gen3a_turbo';
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
|
-
* A HTTPS URL
|
|
34
|
-
*
|
|
33
|
+
* A HTTPS URL or data URI containing an encoded image to be used as the first
|
|
34
|
+
* frame of the generated video. See [our docs](/assets/inputs#images) on image
|
|
35
|
+
* inputs for more information.
|
|
35
36
|
*/
|
|
36
|
-
promptImage: string
|
|
37
|
+
promptImage: string | Array<ImageToVideoCreateParams.PromptImage>;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The number of seconds of duration for the output video.
|
|
41
|
+
*/
|
|
42
|
+
duration?: 5 | 10;
|
|
37
43
|
|
|
38
44
|
promptText?: string;
|
|
39
45
|
|
|
46
|
+
ratio?: '1280:768' | '768:1280';
|
|
47
|
+
|
|
40
48
|
/**
|
|
41
49
|
* If unspecified, a random number is chosen. Varying the seed integer is a way to
|
|
42
50
|
* get different results for the same other request parameters. Using the same seed
|
|
@@ -51,7 +59,26 @@ export interface ImageToVideoCreateParams {
|
|
|
51
59
|
watermark?: boolean;
|
|
52
60
|
}
|
|
53
61
|
|
|
54
|
-
export namespace
|
|
55
|
-
export
|
|
56
|
-
|
|
62
|
+
export namespace ImageToVideoCreateParams {
|
|
63
|
+
export interface PromptImage {
|
|
64
|
+
/**
|
|
65
|
+
* The position of the image in the output video. "first" will use the image as the
|
|
66
|
+
* first frame of the video, "last" will use the image as the last frame of the
|
|
67
|
+
* video.
|
|
68
|
+
*/
|
|
69
|
+
position: 'first' | 'last';
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* A HTTPS URL or data URI containing an encoded image. See
|
|
73
|
+
* [our docs](/assets/inputs#images) on image inputs for more information.
|
|
74
|
+
*/
|
|
75
|
+
uri: string;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export declare namespace ImageToVideo {
|
|
80
|
+
export {
|
|
81
|
+
type ImageToVideoCreateResponse as ImageToVideoCreateResponse,
|
|
82
|
+
type ImageToVideoCreateParams as ImageToVideoCreateParams,
|
|
83
|
+
};
|
|
57
84
|
}
|
package/src/resources/index.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
export {
|
|
4
|
-
|
|
3
|
+
export {
|
|
4
|
+
ImageToVideo,
|
|
5
|
+
type ImageToVideoCreateResponse,
|
|
6
|
+
type ImageToVideoCreateParams,
|
|
7
|
+
} from './image-to-video';
|
|
8
|
+
export { Tasks, type TaskRetrieveResponse } from './tasks';
|