@runwayml/sdk 1.2.0 → 1.4.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 +29 -0
- package/README.md +1 -1
- package/core.d.ts +4 -4
- package/core.d.ts.map +1 -1
- package/core.js +6 -4
- package/core.js.map +1 -1
- package/core.mjs +6 -4
- package/core.mjs.map +1 -1
- package/error.d.ts.map +1 -1
- package/index.d.mts +10 -12
- package/index.d.ts +10 -12
- package/index.d.ts.map +1 -1
- package/index.js +25 -11
- package/index.js.map +1 -1
- package/index.mjs +9 -10
- package/index.mjs.map +1 -1
- package/package.json +2 -2
- package/resources/image-to-video.d.ts +23 -11
- 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 +16 -10
- package/src/error.ts +1 -1
- package/src/index.ts +27 -20
- package/src/resources/image-to-video.ts +29 -12
- 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
|
@@ -25,11 +25,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
};
|
|
26
26
|
var _a;
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
exports.
|
|
28
|
+
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.fileFromPath = exports.toFile = 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,25 @@ RunwayML.PermissionDeniedError = Errors.PermissionDeniedError;
|
|
|
106
108
|
RunwayML.UnprocessableEntityError = Errors.UnprocessableEntityError;
|
|
107
109
|
RunwayML.toFile = Uploads.toFile;
|
|
108
110
|
RunwayML.fileFromPath = Uploads.fileFromPath;
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
(function (
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
111
|
+
RunwayML.Tasks = tasks_1.Tasks;
|
|
112
|
+
RunwayML.ImageToVideo = image_to_video_1.ImageToVideo;
|
|
113
|
+
var uploads_1 = require("./uploads.js");
|
|
114
|
+
Object.defineProperty(exports, "toFile", { enumerable: true, get: function () { return uploads_1.toFile; } });
|
|
115
|
+
Object.defineProperty(exports, "fileFromPath", { enumerable: true, get: function () { return uploads_1.fileFromPath; } });
|
|
116
|
+
var error_1 = require("./error.js");
|
|
117
|
+
Object.defineProperty(exports, "RunwayMLError", { enumerable: true, get: function () { return error_1.RunwayMLError; } });
|
|
118
|
+
Object.defineProperty(exports, "APIError", { enumerable: true, get: function () { return error_1.APIError; } });
|
|
119
|
+
Object.defineProperty(exports, "APIConnectionError", { enumerable: true, get: function () { return error_1.APIConnectionError; } });
|
|
120
|
+
Object.defineProperty(exports, "APIConnectionTimeoutError", { enumerable: true, get: function () { return error_1.APIConnectionTimeoutError; } });
|
|
121
|
+
Object.defineProperty(exports, "APIUserAbortError", { enumerable: true, get: function () { return error_1.APIUserAbortError; } });
|
|
122
|
+
Object.defineProperty(exports, "NotFoundError", { enumerable: true, get: function () { return error_1.NotFoundError; } });
|
|
123
|
+
Object.defineProperty(exports, "ConflictError", { enumerable: true, get: function () { return error_1.ConflictError; } });
|
|
124
|
+
Object.defineProperty(exports, "RateLimitError", { enumerable: true, get: function () { return error_1.RateLimitError; } });
|
|
125
|
+
Object.defineProperty(exports, "BadRequestError", { enumerable: true, get: function () { return error_1.BadRequestError; } });
|
|
126
|
+
Object.defineProperty(exports, "AuthenticationError", { enumerable: true, get: function () { return error_1.AuthenticationError; } });
|
|
127
|
+
Object.defineProperty(exports, "InternalServerError", { enumerable: true, get: function () { return error_1.InternalServerError; } });
|
|
128
|
+
Object.defineProperty(exports, "PermissionDeniedError", { enumerable: true, get: function () { return error_1.PermissionDeniedError; } });
|
|
129
|
+
Object.defineProperty(exports, "UnprocessableEntityError", { enumerable: true, get: function () { return error_1.UnprocessableEntityError; } });
|
|
116
130
|
exports = module.exports = RunwayML;
|
|
117
131
|
exports.default = RunwayML;
|
|
118
132
|
//# 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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ACf,4GAAA,mBAAmB,OAAA;AACnB,4GAAA,mBAAmB,OAAA;AACnB,8GAAA,qBAAqB,OAAA;AACrB,iHAAA,wBAAwB,OAAA;AAG1B,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,9 @@ RunwayML.PermissionDeniedError = Errors.PermissionDeniedError;
|
|
|
79
81
|
RunwayML.UnprocessableEntityError = Errors.UnprocessableEntityError;
|
|
80
82
|
RunwayML.toFile = Uploads.toFile;
|
|
81
83
|
RunwayML.fileFromPath = Uploads.fileFromPath;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
export
|
|
85
|
-
|
|
86
|
-
RunwayML.Tasks = API.Tasks;
|
|
87
|
-
RunwayML.ImageToVideo = API.ImageToVideo;
|
|
88
|
-
})(RunwayML || (RunwayML = {}));
|
|
84
|
+
RunwayML.Tasks = Tasks;
|
|
85
|
+
RunwayML.ImageToVideo = ImageToVideo;
|
|
86
|
+
export { toFile, fileFromPath } from "./uploads.mjs";
|
|
87
|
+
export { RunwayMLError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } from "./error.mjs";
|
|
89
88
|
export default RunwayML;
|
|
90
89
|
//# 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":["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;AACvB,QAAQ,CAAC,YAAY,GAAG,YAAY,CAAC;OAa9B,EAAE,MAAM,EAAE,YAAY,EAAE;OACxB,EACL,aAAa,EACb,QAAQ,EACR,kBAAkB,EAClB,yBAAyB,EACzB,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,GACzB;AAED,eAAe,QAAQ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@runwayml/sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.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,19 +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>;
|
|
26
27
|
/**
|
|
27
28
|
* The number of seconds of duration for the output video.
|
|
28
29
|
*/
|
|
29
30
|
duration?: 5 | 10;
|
|
30
31
|
promptText?: string;
|
|
31
|
-
|
|
32
|
-
* The aspect ratio of the output video.
|
|
33
|
-
*/
|
|
34
|
-
ratio?: '16:9' | '9:16';
|
|
32
|
+
ratio?: '1280:768' | '768:1280';
|
|
35
33
|
/**
|
|
36
34
|
* If unspecified, a random number is chosen. Varying the seed integer is a way to
|
|
37
35
|
* get different results for the same other request parameters. Using the same seed
|
|
@@ -44,8 +42,22 @@ export interface ImageToVideoCreateParams {
|
|
|
44
42
|
*/
|
|
45
43
|
watermark?: boolean;
|
|
46
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
|
+
}
|
|
47
60
|
export declare namespace ImageToVideo {
|
|
48
|
-
export
|
|
49
|
-
export import ImageToVideoCreateParams = ImageToVideoAPI.ImageToVideoCreateParams;
|
|
61
|
+
export { type ImageToVideoCreateResponse as ImageToVideoCreateResponse, type ImageToVideoCreateParams as ImageToVideoCreateParams, };
|
|
50
62
|
}
|
|
51
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,9 +351,13 @@ export abstract class APIClient {
|
|
|
349
351
|
delete reqHeaders['content-type'];
|
|
350
352
|
}
|
|
351
353
|
|
|
352
|
-
// Don't set the retry count header if it was already set or removed
|
|
353
|
-
// which can contain nulls, instead of `reqHeaders` to
|
|
354
|
-
|
|
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
|
+
) {
|
|
355
361
|
reqHeaders['x-stainless-retry-count'] = String(retryCount);
|
|
356
362
|
}
|
|
357
363
|
|
|
@@ -390,7 +396,7 @@ export abstract class APIClient {
|
|
|
390
396
|
error: Object | undefined,
|
|
391
397
|
message: string | undefined,
|
|
392
398
|
headers: Headers | undefined,
|
|
393
|
-
) {
|
|
399
|
+
): APIError {
|
|
394
400
|
return APIError.generate(status, error, message, headers);
|
|
395
401
|
}
|
|
396
402
|
|
|
@@ -662,9 +668,9 @@ export abstract class AbstractPage<Item> implements AsyncIterable<Item> {
|
|
|
662
668
|
return await this.#client.requestAPIList(this.constructor as any, nextOptions);
|
|
663
669
|
}
|
|
664
670
|
|
|
665
|
-
async *iterPages() {
|
|
671
|
+
async *iterPages(): AsyncGenerator<this> {
|
|
666
672
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
667
|
-
let page:
|
|
673
|
+
let page: this = this;
|
|
668
674
|
yield page;
|
|
669
675
|
while (page.hasNextPage()) {
|
|
670
676
|
page = await page.getNextPage();
|
|
@@ -672,7 +678,7 @@ export abstract class AbstractPage<Item> implements AsyncIterable<Item> {
|
|
|
672
678
|
}
|
|
673
679
|
}
|
|
674
680
|
|
|
675
|
-
async *[Symbol.asyncIterator]() {
|
|
681
|
+
async *[Symbol.asyncIterator](): AsyncGenerator<Item> {
|
|
676
682
|
for await (const page of this.iterPages()) {
|
|
677
683
|
for (const item of page.getPaginatedItems()) {
|
|
678
684
|
yield item;
|
|
@@ -715,7 +721,7 @@ export class PagePromise<
|
|
|
715
721
|
* console.log(item)
|
|
716
722
|
* }
|
|
717
723
|
*/
|
|
718
|
-
async *[Symbol.asyncIterator]() {
|
|
724
|
+
async *[Symbol.asyncIterator](): AsyncGenerator<Item> {
|
|
719
725
|
const page = await this;
|
|
720
726
|
for await (const item of page) {
|
|
721
727
|
yield item;
|
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,22 @@ export class RunwayML extends Core.APIClient {
|
|
|
172
178
|
static fileFromPath = Uploads.fileFromPath;
|
|
173
179
|
}
|
|
174
180
|
|
|
175
|
-
|
|
181
|
+
RunwayML.Tasks = Tasks;
|
|
182
|
+
RunwayML.ImageToVideo = ImageToVideo;
|
|
183
|
+
export declare namespace RunwayML {
|
|
184
|
+
export type RequestOptions = Core.RequestOptions;
|
|
185
|
+
|
|
186
|
+
export { Tasks as Tasks, type TaskRetrieveResponse as TaskRetrieveResponse };
|
|
187
|
+
|
|
188
|
+
export {
|
|
189
|
+
ImageToVideo as ImageToVideo,
|
|
190
|
+
type ImageToVideoCreateResponse as ImageToVideoCreateResponse,
|
|
191
|
+
type ImageToVideoCreateParams as ImageToVideoCreateParams,
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export { toFile, fileFromPath } from './uploads';
|
|
196
|
+
export {
|
|
176
197
|
RunwayMLError,
|
|
177
198
|
APIError,
|
|
178
199
|
APIConnectionError,
|
|
@@ -186,20 +207,6 @@ export const {
|
|
|
186
207
|
InternalServerError,
|
|
187
208
|
PermissionDeniedError,
|
|
188
209
|
UnprocessableEntityError,
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
export import toFile = Uploads.toFile;
|
|
192
|
-
export import fileFromPath = Uploads.fileFromPath;
|
|
193
|
-
|
|
194
|
-
export namespace RunwayML {
|
|
195
|
-
export import RequestOptions = Core.RequestOptions;
|
|
196
|
-
|
|
197
|
-
export import Tasks = API.Tasks;
|
|
198
|
-
export import TaskRetrieveResponse = API.TaskRetrieveResponse;
|
|
199
|
-
|
|
200
|
-
export import ImageToVideo = API.ImageToVideo;
|
|
201
|
-
export import ImageToVideoCreateResponse = API.ImageToVideoCreateResponse;
|
|
202
|
-
export import ImageToVideoCreateParams = API.ImageToVideoCreateParams;
|
|
203
|
-
}
|
|
210
|
+
} from './error';
|
|
204
211
|
|
|
205
212
|
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,10 +30,11 @@ 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>;
|
|
37
38
|
|
|
38
39
|
/**
|
|
39
40
|
* The number of seconds of duration for the output video.
|
|
@@ -42,10 +43,7 @@ export interface ImageToVideoCreateParams {
|
|
|
42
43
|
|
|
43
44
|
promptText?: string;
|
|
44
45
|
|
|
45
|
-
|
|
46
|
-
* The aspect ratio of the output video.
|
|
47
|
-
*/
|
|
48
|
-
ratio?: '16:9' | '9:16';
|
|
46
|
+
ratio?: '1280:768' | '768:1280';
|
|
49
47
|
|
|
50
48
|
/**
|
|
51
49
|
* If unspecified, a random number is chosen. Varying the seed integer is a way to
|
|
@@ -61,7 +59,26 @@ export interface ImageToVideoCreateParams {
|
|
|
61
59
|
watermark?: boolean;
|
|
62
60
|
}
|
|
63
61
|
|
|
64
|
-
export namespace
|
|
65
|
-
export
|
|
66
|
-
|
|
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
|
+
};
|
|
67
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';
|