@runwayml/sdk 2.2.1 → 2.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 +28 -0
- package/core.d.ts +5 -2
- package/core.d.ts.map +1 -1
- package/core.js +11 -6
- package/core.js.map +1 -1
- package/core.mjs +11 -6
- package/core.mjs.map +1 -1
- package/index.d.mts +5 -0
- package/index.d.ts +5 -0
- package/index.d.ts.map +1 -1
- package/index.js +14 -3
- package/index.js.map +1 -1
- package/index.mjs +10 -2
- package/index.mjs.map +1 -1
- package/lib/polling.d.ts +49 -0
- package/lib/polling.d.ts.map +1 -0
- package/lib/polling.js +67 -0
- package/lib/polling.js.map +1 -0
- package/lib/polling.mjs +60 -0
- package/lib/polling.mjs.map +1 -0
- package/package.json +1 -1
- package/resource.d.ts +1 -1
- package/resource.d.ts.map +1 -1
- package/resource.js.map +1 -1
- package/resource.mjs.map +1 -1
- package/resources/image-to-video.d.ts +17 -2
- package/resources/image-to-video.d.ts.map +1 -1
- package/resources/image-to-video.js +2 -1
- package/resources/image-to-video.js.map +1 -1
- package/resources/image-to-video.mjs +2 -1
- package/resources/image-to-video.mjs.map +1 -1
- package/resources/index.d.ts +1 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/organization.d.ts +30 -0
- package/resources/organization.d.ts.map +1 -1
- package/resources/tasks.d.ts +2 -1
- package/resources/tasks.d.ts.map +1 -1
- package/resources/tasks.js +2 -1
- package/resources/tasks.js.map +1 -1
- package/resources/tasks.mjs +2 -1
- package/resources/tasks.mjs.map +1 -1
- package/resources/text-to-image.d.ts +2 -1
- package/resources/text-to-image.d.ts.map +1 -1
- package/resources/text-to-image.js +2 -1
- package/resources/text-to-image.js.map +1 -1
- package/resources/text-to-image.mjs +2 -1
- package/resources/text-to-image.mjs.map +1 -1
- package/resources/video-upscale.d.ts +32 -0
- package/resources/video-upscale.d.ts.map +1 -0
- package/resources/video-upscale.js +17 -0
- package/resources/video-upscale.js.map +1 -0
- package/resources/video-upscale.mjs +13 -0
- package/resources/video-upscale.mjs.map +1 -0
- package/src/core.ts +11 -4
- package/src/index.ts +23 -0
- package/src/lib/polling.ts +109 -0
- package/src/resource.ts +1 -1
- package/src/resources/image-to-video.ts +22 -3
- package/src/resources/index.ts +5 -0
- package/src/resources/organization.ts +35 -0
- package/src/resources/tasks.ts +6 -2
- package/src/resources/text-to-image.ts +5 -2
- package/src/resources/video-upscale.ts +48 -0
- 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
|
@@ -23,9 +23,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
__setModuleDefault(result, mod);
|
|
24
24
|
return result;
|
|
25
25
|
};
|
|
26
|
-
var _a;
|
|
26
|
+
var _RunwayML_instances, _a, _RunwayML_baseURLOverridden;
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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;
|
|
28
|
+
exports.AbortError = exports.TaskTimedOutError = exports.TaskFailedError = 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
29
|
const Core = __importStar(require("./core.js"));
|
|
30
30
|
const Errors = __importStar(require("./error.js"));
|
|
31
31
|
const Uploads = __importStar(require("./uploads.js"));
|
|
@@ -34,6 +34,7 @@ const image_to_video_1 = require("./resources/image-to-video.js");
|
|
|
34
34
|
const organization_1 = require("./resources/organization.js");
|
|
35
35
|
const tasks_1 = require("./resources/tasks.js");
|
|
36
36
|
const text_to_image_1 = require("./resources/text-to-image.js");
|
|
37
|
+
const video_upscale_1 = require("./resources/video-upscale.js");
|
|
37
38
|
/**
|
|
38
39
|
* API Client for interfacing with the RunwayML API.
|
|
39
40
|
*/
|
|
@@ -66,14 +67,17 @@ class RunwayML extends Core.APIClient {
|
|
|
66
67
|
}
|
|
67
68
|
super({
|
|
68
69
|
baseURL: options.baseURL,
|
|
70
|
+
baseURLOverridden: baseURL ? baseURL !== 'https://api.dev.runwayml.com' : false,
|
|
69
71
|
timeout: options.timeout ?? 60000 /* 1 minute */,
|
|
70
72
|
httpAgent: options.httpAgent,
|
|
71
73
|
maxRetries: options.maxRetries,
|
|
72
74
|
fetch: options.fetch,
|
|
73
75
|
});
|
|
76
|
+
_RunwayML_instances.add(this);
|
|
74
77
|
this.tasks = new API.Tasks(this);
|
|
75
78
|
this.imageToVideo = new API.ImageToVideo(this);
|
|
76
79
|
this.textToImage = new API.TextToImage(this);
|
|
80
|
+
this.videoUpscale = new API.VideoUpscale(this);
|
|
77
81
|
this.organization = new API.Organization(this);
|
|
78
82
|
this._options = options;
|
|
79
83
|
this.apiKey = apiKey;
|
|
@@ -94,7 +98,9 @@ class RunwayML extends Core.APIClient {
|
|
|
94
98
|
}
|
|
95
99
|
}
|
|
96
100
|
exports.RunwayML = RunwayML;
|
|
97
|
-
_a = RunwayML
|
|
101
|
+
_a = RunwayML, _RunwayML_instances = new WeakSet(), _RunwayML_baseURLOverridden = function _RunwayML_baseURLOverridden() {
|
|
102
|
+
return this.baseURL !== 'https://api.dev.runwayml.com';
|
|
103
|
+
};
|
|
98
104
|
RunwayML.RunwayML = _a;
|
|
99
105
|
RunwayML.DEFAULT_TIMEOUT = 60000; // 1 minute
|
|
100
106
|
RunwayML.RunwayMLError = Errors.RunwayMLError;
|
|
@@ -115,6 +121,7 @@ RunwayML.fileFromPath = Uploads.fileFromPath;
|
|
|
115
121
|
RunwayML.Tasks = tasks_1.Tasks;
|
|
116
122
|
RunwayML.ImageToVideo = image_to_video_1.ImageToVideo;
|
|
117
123
|
RunwayML.TextToImage = text_to_image_1.TextToImage;
|
|
124
|
+
RunwayML.VideoUpscale = video_upscale_1.VideoUpscale;
|
|
118
125
|
RunwayML.Organization = organization_1.Organization;
|
|
119
126
|
var uploads_1 = require("./uploads.js");
|
|
120
127
|
Object.defineProperty(exports, "toFile", { enumerable: true, get: function () { return uploads_1.toFile; } });
|
|
@@ -133,6 +140,10 @@ Object.defineProperty(exports, "AuthenticationError", { enumerable: true, get: f
|
|
|
133
140
|
Object.defineProperty(exports, "InternalServerError", { enumerable: true, get: function () { return error_1.InternalServerError; } });
|
|
134
141
|
Object.defineProperty(exports, "PermissionDeniedError", { enumerable: true, get: function () { return error_1.PermissionDeniedError; } });
|
|
135
142
|
Object.defineProperty(exports, "UnprocessableEntityError", { enumerable: true, get: function () { return error_1.UnprocessableEntityError; } });
|
|
143
|
+
var polling_1 = require("./lib/polling.js");
|
|
144
|
+
Object.defineProperty(exports, "TaskFailedError", { enumerable: true, get: function () { return polling_1.TaskFailedError; } });
|
|
145
|
+
Object.defineProperty(exports, "TaskTimedOutError", { enumerable: true, get: function () { return polling_1.TaskTimedOutError; } });
|
|
146
|
+
Object.defineProperty(exports, "AbortError", { enumerable: true, get: function () { return polling_1.AbortError; } });
|
|
136
147
|
exports = module.exports = RunwayML;
|
|
137
148
|
exports.default = RunwayML;
|
|
138
149
|
//# 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;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGtF,gDAA+B;AAC/B,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AA4B,qGAAA,UAAU,OAAA;AAEjF,kBAAe,QAAQ,CAAC"}
|
package/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
var _a;
|
|
2
|
+
var _RunwayML_instances, _a, _RunwayML_baseURLOverridden;
|
|
3
3
|
import * as Core from "./core.mjs";
|
|
4
4
|
import * as Errors from "./error.mjs";
|
|
5
5
|
import * as Uploads from "./uploads.mjs";
|
|
@@ -8,6 +8,7 @@ import { ImageToVideo, } from "./resources/image-to-video.mjs";
|
|
|
8
8
|
import { Organization } from "./resources/organization.mjs";
|
|
9
9
|
import { Tasks } from "./resources/tasks.mjs";
|
|
10
10
|
import { TextToImage } from "./resources/text-to-image.mjs";
|
|
11
|
+
import { VideoUpscale, } from "./resources/video-upscale.mjs";
|
|
11
12
|
/**
|
|
12
13
|
* API Client for interfacing with the RunwayML API.
|
|
13
14
|
*/
|
|
@@ -40,14 +41,17 @@ export class RunwayML extends Core.APIClient {
|
|
|
40
41
|
}
|
|
41
42
|
super({
|
|
42
43
|
baseURL: options.baseURL,
|
|
44
|
+
baseURLOverridden: baseURL ? baseURL !== 'https://api.dev.runwayml.com' : false,
|
|
43
45
|
timeout: options.timeout ?? 60000 /* 1 minute */,
|
|
44
46
|
httpAgent: options.httpAgent,
|
|
45
47
|
maxRetries: options.maxRetries,
|
|
46
48
|
fetch: options.fetch,
|
|
47
49
|
});
|
|
50
|
+
_RunwayML_instances.add(this);
|
|
48
51
|
this.tasks = new API.Tasks(this);
|
|
49
52
|
this.imageToVideo = new API.ImageToVideo(this);
|
|
50
53
|
this.textToImage = new API.TextToImage(this);
|
|
54
|
+
this.videoUpscale = new API.VideoUpscale(this);
|
|
51
55
|
this.organization = new API.Organization(this);
|
|
52
56
|
this._options = options;
|
|
53
57
|
this.apiKey = apiKey;
|
|
@@ -67,7 +71,9 @@ export class RunwayML extends Core.APIClient {
|
|
|
67
71
|
return { Authorization: `Bearer ${this.apiKey}` };
|
|
68
72
|
}
|
|
69
73
|
}
|
|
70
|
-
_a = RunwayML
|
|
74
|
+
_a = RunwayML, _RunwayML_instances = new WeakSet(), _RunwayML_baseURLOverridden = function _RunwayML_baseURLOverridden() {
|
|
75
|
+
return this.baseURL !== 'https://api.dev.runwayml.com';
|
|
76
|
+
};
|
|
71
77
|
RunwayML.RunwayML = _a;
|
|
72
78
|
RunwayML.DEFAULT_TIMEOUT = 60000; // 1 minute
|
|
73
79
|
RunwayML.RunwayMLError = Errors.RunwayMLError;
|
|
@@ -88,8 +94,10 @@ RunwayML.fileFromPath = Uploads.fileFromPath;
|
|
|
88
94
|
RunwayML.Tasks = Tasks;
|
|
89
95
|
RunwayML.ImageToVideo = ImageToVideo;
|
|
90
96
|
RunwayML.TextToImage = TextToImage;
|
|
97
|
+
RunwayML.VideoUpscale = VideoUpscale;
|
|
91
98
|
RunwayML.Organization = Organization;
|
|
92
99
|
export { toFile, fileFromPath } from "./uploads.mjs";
|
|
93
100
|
export { RunwayMLError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } from "./error.mjs";
|
|
101
|
+
export { TaskFailedError, TaskTimedOutError, AbortError } from "./lib/polling.mjs";
|
|
94
102
|
export default RunwayML;
|
|
95
103
|
//# 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;;OAG/E,KAAK,IAAI;OACT,KAAK,MAAM;OACX,KAAK,OAAO;OACZ,KAAK,GAAG;OACR,EACL,YAAY,GAGb;OACM,EAAE,YAAY,EAAgC;OAC9C,EAAwB,KAAK,EAAE;OAC/B,EAAE,WAAW,EAAsD;
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceR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AACrC,sBAAa,GAAG,MAAM,CAAC,aAAa,CAAC;AACrC,uBAAc,GAAG,MAAM,CAAC,cAAc,CAAC;AACvC,wBAAe,GAAG,MAAM,CAAC,eAAe,CAAC;AACzC,4BAAmB,GAAG,MAAM,CAAC,mBAAmB,CAAC;AACjD,4BAAmB,GAAG,MAAM,CAAC,mBAAmB,CAAC;AACjD,8BAAqB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACrD,iCAAwB,GAAG,MAAM,CAAC,wBAAwB,CAAC;AAE3D,eAAM,GAAG,OAAO,CAAC,MAAM,CAAC;AACxB,qBAAY,GAAG,OAAO,CAAC,YAAY,CAAC;AAG7C,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC;AACvB,QAAQ,CAAC,YAAY,GAAG,YAAY,CAAC;AACrC,QAAQ,CAAC,WAAW,GAAG,WAAW,CAAC;AACnC,QAAQ,CAAC,YAAY,GAAG,YAAY,CAAC;AACrC,QAAQ,CAAC,YAAY,GAAG,YAAY,CAAC;OA2B9B,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;OAEM,EAAE,eAAe,EAAE,iBAAiB,EAA4B,UAAU,EAAE;AAEnF,eAAe,QAAQ,CAAC"}
|
package/lib/polling.d.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
|
|
2
|
+
import type { RunwayML } from "../index.js";
|
|
3
|
+
import * as Core from "../core.js";
|
|
4
|
+
import { TaskRetrieveResponse } from "../resources/tasks.js";
|
|
5
|
+
export declare class TaskFailedError extends Error {
|
|
6
|
+
taskDetails: TaskRetrieveResponse;
|
|
7
|
+
constructor(taskDetails: TaskRetrieveResponse);
|
|
8
|
+
}
|
|
9
|
+
export declare class TaskTimedOutError extends Error {
|
|
10
|
+
taskDetails: TaskRetrieveResponse;
|
|
11
|
+
constructor(taskDetails: TaskRetrieveResponse);
|
|
12
|
+
}
|
|
13
|
+
export interface WaitForTaskOutputOptions {
|
|
14
|
+
/**
|
|
15
|
+
* The maximum amount of time to wait for the task to complete in milliseconds. If not
|
|
16
|
+
* specified, the default timeout is 10 minutes. Will raise a `TaskTimeoutError` if the
|
|
17
|
+
* task does not complete within the timeout. Setting this to `null` will wait
|
|
18
|
+
* indefinitely (disabling the timeout). Disabling the timeout is not recommended.
|
|
19
|
+
* as it may cause your server to experience issues if your Runway API organization
|
|
20
|
+
* reaches its concurrency limit or if Runway experiences an outage.
|
|
21
|
+
*/
|
|
22
|
+
timeout?: number | null;
|
|
23
|
+
/**
|
|
24
|
+
* Passing an `AbortSignal` allows you to stop waiting for the task to complete.
|
|
25
|
+
* If you are using `waitForTaskOutput` in the handler for an incoming request,
|
|
26
|
+
* `waitForTaskOutput` will not stop polling if the client connection is closed.
|
|
27
|
+
* Passing an `AbortSignal` safely stops polling, preventing memory leaks and
|
|
28
|
+
* ensuring you do not create too many requests to the Runway API.
|
|
29
|
+
*/
|
|
30
|
+
abortSignal?: AbortSignal;
|
|
31
|
+
}
|
|
32
|
+
export declare class AbortError extends Error {
|
|
33
|
+
code: number;
|
|
34
|
+
constructor();
|
|
35
|
+
}
|
|
36
|
+
export type APIPromiseWithAwaitableTask<T extends {
|
|
37
|
+
id: string;
|
|
38
|
+
}> = Core.APIPromise<T> & {
|
|
39
|
+
/**
|
|
40
|
+
* When called, this will wait until the task is complete.
|
|
41
|
+
*
|
|
42
|
+
* If the task fails or is cancelled, a `TaskFailedError` will be thrown.
|
|
43
|
+
*/
|
|
44
|
+
waitForTaskOutput: (options?: WaitForTaskOutputOptions) => Promise<TaskRetrieveResponse>;
|
|
45
|
+
};
|
|
46
|
+
export declare function wrapAsWaitableResource<T extends {
|
|
47
|
+
id: string;
|
|
48
|
+
}>(client: RunwayML): (responsePromise: Core.APIPromise<T>, skipInitialWait?: boolean) => APIPromiseWithAwaitableTask<T>;
|
|
49
|
+
//# sourceMappingURL=polling.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polling.d.ts","sourceRoot":"","sources":["../src/lib/polling.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAK1D,qBAAa,eAAgB,SAAQ,KAAK;IACxC,WAAW,EAAE,oBAAoB,CAAC;gBACtB,WAAW,EAAE,oBAAoB;CAK9C;AAED,qBAAa,iBAAkB,SAAQ,KAAK;IAC1C,WAAW,EAAE,oBAAoB,CAAC;gBACtB,WAAW,EAAE,oBAAoB;CAK9C;AAED,MAAM,WAAW,wBAAwB;IACvC;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAED,qBAAa,UAAW,SAAQ,KAAK;IACnC,IAAI,SAAM;;CAKX;AAED,MAAM,MAAM,2BAA2B,CAAC,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG;IACvF;;;;OAIG;IACH,iBAAiB,EAAE,CAAC,OAAO,CAAC,EAAE,wBAAwB,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAC;CAC1F,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,EAAE,MAAM,EAAE,QAAQ,qBAE5D,KAAK,UAAU,CAAC,CAAC,CAAC,oBAClB,OAAO,KACvB,4BAA4B,CAAC,CAAC,CAyClC"}
|
package/lib/polling.js
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.wrapAsWaitableResource = exports.AbortError = exports.TaskTimedOutError = exports.TaskFailedError = void 0;
|
|
4
|
+
const POLL_TIME = 6000; // 6 seconds
|
|
5
|
+
const POLL_JITTER = 3000; // 3 seconds
|
|
6
|
+
class TaskFailedError extends Error {
|
|
7
|
+
constructor(taskDetails) {
|
|
8
|
+
super(taskDetails.failure);
|
|
9
|
+
this.taskDetails = taskDetails;
|
|
10
|
+
this.name = 'TaskFailedError';
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.TaskFailedError = TaskFailedError;
|
|
14
|
+
class TaskTimedOutError extends Error {
|
|
15
|
+
constructor(taskDetails) {
|
|
16
|
+
super('Task timed out');
|
|
17
|
+
this.taskDetails = taskDetails;
|
|
18
|
+
this.name = 'TaskTimedOutError';
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.TaskTimedOutError = TaskTimedOutError;
|
|
22
|
+
class AbortError extends Error {
|
|
23
|
+
constructor() {
|
|
24
|
+
super('Polling aborted');
|
|
25
|
+
this.code = 22;
|
|
26
|
+
this.name = 'AbortError';
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.AbortError = AbortError;
|
|
30
|
+
function wrapAsWaitableResource(client) {
|
|
31
|
+
return (responsePromise, skipInitialWait = false) => {
|
|
32
|
+
return Object.defineProperty(responsePromise, 'waitForTaskOutput', {
|
|
33
|
+
value: async (options) => {
|
|
34
|
+
const wait = () => new Promise((resolve) => setTimeout(resolve, POLL_TIME + Math.random() * POLL_JITTER - POLL_JITTER / 2));
|
|
35
|
+
if (!skipInitialWait) {
|
|
36
|
+
await wait();
|
|
37
|
+
}
|
|
38
|
+
const { timeout = 60 * 10 * 1000 } = options ?? {};
|
|
39
|
+
const output = await responsePromise;
|
|
40
|
+
const startTime = Date.now();
|
|
41
|
+
let taskDetails;
|
|
42
|
+
do {
|
|
43
|
+
if (options?.abortSignal?.aborted) {
|
|
44
|
+
throw new AbortError();
|
|
45
|
+
}
|
|
46
|
+
taskDetails = await client.tasks.retrieve(output.id);
|
|
47
|
+
if (taskDetails.status === 'SUCCEEDED') {
|
|
48
|
+
return taskDetails;
|
|
49
|
+
}
|
|
50
|
+
if (taskDetails.status === 'FAILED' || taskDetails.status === 'CANCELLED') {
|
|
51
|
+
throw new TaskFailedError(taskDetails);
|
|
52
|
+
}
|
|
53
|
+
await wait();
|
|
54
|
+
if (timeout != null && Date.now() - startTime > timeout && !options?.abortSignal?.aborted) {
|
|
55
|
+
throw new TaskTimedOutError(taskDetails);
|
|
56
|
+
}
|
|
57
|
+
} while (['THROTTLED', 'PENDING', 'RUNNING'].includes(taskDetails.status));
|
|
58
|
+
throw new TaskTimedOutError(taskDetails);
|
|
59
|
+
},
|
|
60
|
+
writable: false,
|
|
61
|
+
enumerable: false,
|
|
62
|
+
configurable: false,
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
exports.wrapAsWaitableResource = wrapAsWaitableResource;
|
|
67
|
+
//# sourceMappingURL=polling.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polling.js","sourceRoot":"","sources":["../src/lib/polling.ts"],"names":[],"mappings":";;;AAIA,MAAM,SAAS,GAAG,IAAI,CAAC,CAAC,YAAY;AACpC,MAAM,WAAW,GAAG,IAAI,CAAC,CAAC,YAAY;AAEtC,MAAa,eAAgB,SAAQ,KAAK;IAExC,YAAY,WAAiC;QAC3C,KAAK,CAAC,WAAW,CAAC,OAAQ,CAAC,CAAC;QAC5B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAChC,CAAC;CACF;AAPD,0CAOC;AAED,MAAa,iBAAkB,SAAQ,KAAK;IAE1C,YAAY,WAAiC;QAC3C,KAAK,CAAC,gBAAgB,CAAC,CAAC;QACxB,IAAI,CAA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E;wBACtC,OAAO,WAAW,CAAC;qBACpB;oBACD,IAAI,WAAW,CAAC,MAAM,KAAK,QAAQ,IAAI,WAAW,CAAC,MAAM,KAAK,WAAW,EAAE;wBACzE,MAAM,IAAI,eAAe,CAAC,WAAW,CAAC,CAAC;qBACxC;oBACD,MAAM,IAAI,EAAE,CAAC;oBACb,IAAI,OAAO,IAAI,IAAI,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,GAAG,OAAO,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE;wBACzF,MAAM,IAAI,iBAAiB,CAAC,WAAW,CAAC,CAAC;qBAC1C;iBACF,QAAQ,CAAC,WAAW,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE;gBAC3E,MAAM,IAAI,iBAAiB,CAAC,WAAW,CAAC,CAAC;YAC3C,CAAC;YACD,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,KAAK;YACjB,YAAY,EAAE,KAAK;SACpB,CAEA,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AA7CD,wDA6CC"}
|
package/lib/polling.mjs
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
const POLL_TIME = 6000; // 6 seconds
|
|
2
|
+
const POLL_JITTER = 3000; // 3 seconds
|
|
3
|
+
export class TaskFailedError extends Error {
|
|
4
|
+
constructor(taskDetails) {
|
|
5
|
+
super(taskDetails.failure);
|
|
6
|
+
this.taskDetails = taskDetails;
|
|
7
|
+
this.name = 'TaskFailedError';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export class TaskTimedOutError extends Error {
|
|
11
|
+
constructor(taskDetails) {
|
|
12
|
+
super('Task timed out');
|
|
13
|
+
this.taskDetails = taskDetails;
|
|
14
|
+
this.name = 'TaskTimedOutError';
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export class AbortError extends Error {
|
|
18
|
+
constructor() {
|
|
19
|
+
super('Polling aborted');
|
|
20
|
+
this.code = 22;
|
|
21
|
+
this.name = 'AbortError';
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export function wrapAsWaitableResource(client) {
|
|
25
|
+
return (responsePromise, skipInitialWait = false) => {
|
|
26
|
+
return Object.defineProperty(responsePromise, 'waitForTaskOutput', {
|
|
27
|
+
value: async (options) => {
|
|
28
|
+
const wait = () => new Promise((resolve) => setTimeout(resolve, POLL_TIME + Math.random() * POLL_JITTER - POLL_JITTER / 2));
|
|
29
|
+
if (!skipInitialWait) {
|
|
30
|
+
await wait();
|
|
31
|
+
}
|
|
32
|
+
const { timeout = 60 * 10 * 1000 } = options ?? {};
|
|
33
|
+
const output = await responsePromise;
|
|
34
|
+
const startTime = Date.now();
|
|
35
|
+
let taskDetails;
|
|
36
|
+
do {
|
|
37
|
+
if (options?.abortSignal?.aborted) {
|
|
38
|
+
throw new AbortError();
|
|
39
|
+
}
|
|
40
|
+
taskDetails = await client.tasks.retrieve(output.id);
|
|
41
|
+
if (taskDetails.status === 'SUCCEEDED') {
|
|
42
|
+
return taskDetails;
|
|
43
|
+
}
|
|
44
|
+
if (taskDetails.status === 'FAILED' || taskDetails.status === 'CANCELLED') {
|
|
45
|
+
throw new TaskFailedError(taskDetails);
|
|
46
|
+
}
|
|
47
|
+
await wait();
|
|
48
|
+
if (timeout != null && Date.now() - startTime > timeout && !options?.abortSignal?.aborted) {
|
|
49
|
+
throw new TaskTimedOutError(taskDetails);
|
|
50
|
+
}
|
|
51
|
+
} while (['THROTTLED', 'PENDING', 'RUNNING'].includes(taskDetails.status));
|
|
52
|
+
throw new TaskTimedOutError(taskDetails);
|
|
53
|
+
},
|
|
54
|
+
writable: false,
|
|
55
|
+
enumerable: false,
|
|
56
|
+
configurable: false,
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=polling.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polling.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|
1
|
-
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["src/resource.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,
|
|
1
|
+
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["src/resource.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,8BAAsB,WAAW;IAC/B,SAAS,CAAC,OAAO,EAAE,QAAQ,CAAC;gBAEhB,MAAM,EAAE,QAAQ;CAG7B"}
|
package/resource.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource.js","sourceRoot":"","sources":["src/resource.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAItF,
|
|
1
|
+
{"version":3,"file":"resource.js","sourceRoot":"","sources":["src/resource.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAItF,MAAsB,WAAW;IAG/B,YAAY,MAAgB;QAC1B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;CACF;AAND,kCAMC"}
|
package/resource.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource.mjs","sourceRoot":"","sources":["src/resource.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAItF,MAAM,
|
|
1
|
+
{"version":3,"file":"resource.mjs","sourceRoot":"","sources":["src/resource.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAItF,MAAM,OAAgB,WAAW;IAG/B,YAAY,MAAgB;QAC1B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;CACF"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { APIResource } from "../resource.js";
|
|
2
2
|
import * as Core from "../core.js";
|
|
3
|
+
import { APIPromiseWithAwaitableTask } from "../lib/polling.js";
|
|
3
4
|
export declare class ImageToVideo extends APIResource {
|
|
4
5
|
/**
|
|
5
6
|
* This endpoint will start a new task to generate a video from an image prompt.
|
|
6
7
|
*/
|
|
7
|
-
create(body: ImageToVideoCreateParams, options?: Core.RequestOptions):
|
|
8
|
+
create(body: ImageToVideoCreateParams, options?: Core.RequestOptions): APIPromiseWithAwaitableTask<ImageToVideoCreateResponse>;
|
|
8
9
|
}
|
|
9
10
|
export interface ImageToVideoCreateResponse {
|
|
10
11
|
/**
|
|
@@ -17,7 +18,7 @@ export interface ImageToVideoCreateParams {
|
|
|
17
18
|
/**
|
|
18
19
|
* The model variant to use.
|
|
19
20
|
*/
|
|
20
|
-
model: '
|
|
21
|
+
model: 'gen3a_turbo' | 'gen4_turbo';
|
|
21
22
|
/**
|
|
22
23
|
* A HTTPS URL or data URI containing an encoded image to be used as the first
|
|
23
24
|
* frame of the generated video. See [our docs](/assets/inputs#images) on image
|
|
@@ -42,6 +43,10 @@ export interface ImageToVideoCreateParams {
|
|
|
42
43
|
* - `768:1280`
|
|
43
44
|
*/
|
|
44
45
|
ratio: '1280:720' | '720:1280' | '1104:832' | '832:1104' | '960:960' | '1584:672' | '1280:768' | '768:1280';
|
|
46
|
+
/**
|
|
47
|
+
* Settings that affect the behavior of the content moderation system.
|
|
48
|
+
*/
|
|
49
|
+
contentModeration?: ImageToVideoCreateParams.ContentModeration;
|
|
45
50
|
/**
|
|
46
51
|
* The number of seconds of duration for the output video.
|
|
47
52
|
*/
|
|
@@ -74,6 +79,16 @@ export declare namespace ImageToVideoCreateParams {
|
|
|
74
79
|
*/
|
|
75
80
|
uri: string;
|
|
76
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* Settings that affect the behavior of the content moderation system.
|
|
84
|
+
*/
|
|
85
|
+
interface ContentModeration {
|
|
86
|
+
/**
|
|
87
|
+
* When set to `low`, the content moderation system will be less strict about
|
|
88
|
+
* preventing generations that include recognizable public figures.
|
|
89
|
+
*/
|
|
90
|
+
publicFigureThreshold?: 'auto' | 'low';
|
|
91
|
+
}
|
|
77
92
|
}
|
|
78
93
|
export declare namespace ImageToVideo {
|
|
79
94
|
export { type ImageToVideoCreateResponse as ImageToVideoCreateResponse, type ImageToVideoCreateParams as ImageToVideoCreateParams, };
|
|
@@ -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;AAChC,OAAO,EAAE,2BAA2B,EAA0B,MAAM,gBAAgB,CAAC;AAErF,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;OAEG;IACH,MAAM,CACJ,IAAI,EAAE,wBAAwB,EAC9B,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,2BAA2B,CAAC,0BAA0B,CAAC;CAK3D;AAED,MAAM,WAAW,0BAA0B;IACzC;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,KAAK,EAAE,aAAa,GAAG,YAAY,CAAC;IAEpC;;;;OAIG;IACH,WAAW,EAAE,MAAM,GAAG,KAAK,CAAC,wBAAwB,CAAC,WAAW,CAAC,CAAC;IAElE;;;;;;;;;;;;;;;;OAgBG;IACH,KAAK,EAAE,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,CAAC;IAE5G;;OAEG;IACH,iBAAiB,CAAC,EAAE,wBAAwB,CAAC,iBAAiB,CAAC;IAE/D;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC;IAElB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,yBAAiB,wBAAwB,CAAC;IACxC,UAAiB,WAAW;QAC1B;;;;;;WAMG;QACH,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC;QAE3B;;;WAGG;QACH,GAAG,EAAE,MAAM,CAAC;KACb;IAED;;OAEG;IACH,UAAiB,iBAAiB;QAChC;;;WAGG;QACH,qBAAqB,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;KACxC;CACF;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EACL,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,wBAAwB,IAAI,wBAAwB,GAC1D,CAAC;CACH"}
|
|
@@ -3,12 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.ImageToVideo = void 0;
|
|
5
5
|
const resource_1 = require("../resource.js");
|
|
6
|
+
const polling_1 = require("../lib/polling.js");
|
|
6
7
|
class ImageToVideo extends resource_1.APIResource {
|
|
7
8
|
/**
|
|
8
9
|
* This endpoint will start a new task to generate a video from an image prompt.
|
|
9
10
|
*/
|
|
10
11
|
create(body, options) {
|
|
11
|
-
return this._client.post('/v1/image_to_video', { body, ...options });
|
|
12
|
+
return (0, polling_1.wrapAsWaitableResource)(this._client)(this._client.post('/v1/image_to_video', { body, ...options }));
|
|
12
13
|
}
|
|
13
14
|
}
|
|
14
15
|
exports.ImageToVideo = ImageToVideo;
|
|
@@ -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;AAE1C,+CAAqF;AAErF,MAAa,YAAa,SAAQ,sBAAW;IAC3C;;OAEG;IACH,MAAM,CACJ,IAA8B,EAC9B,OAA6B;QAE7B,OAAO,IAAA,gCAAsB,EAA6B,IAAI,CAAC,OAAO,CAAC,CACrE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAC9D,CAAC;IACJ,CAAC;CACF;AAZD,oCAYC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
import { APIResource } from "../resource.mjs";
|
|
3
|
+
import { wrapAsWaitableResource } from "../lib/polling.mjs";
|
|
3
4
|
export class ImageToVideo extends APIResource {
|
|
4
5
|
/**
|
|
5
6
|
* This endpoint will start a new task to generate a video from an image prompt.
|
|
6
7
|
*/
|
|
7
8
|
create(body, options) {
|
|
8
|
-
return this._client.post('/v1/image_to_video', { body, ...options });
|
|
9
|
+
return wrapAsWaitableResource(this._client)(this._client.post('/v1/image_to_video', { body, ...options }));
|
|
9
10
|
}
|
|
10
11
|
}
|
|
11
12
|
//# sourceMappingURL=image-to-video.mjs.map
|
|
@@ -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;OAEf,EAA+B,sBAAsB,EAAE;AAE9D,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C;;OAEG;IACH,MAAM,CACJ,IAA8B,EAC9B,OAA6B;QAE7B,OAAO,sBAAsB,CAA6B,IAAI,CAAC,OAAO,CAAC,CACrE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAC9D,CAAC;IACJ,CAAC;CACF"}
|
package/resources/index.d.ts
CHANGED
|
@@ -2,4 +2,5 @@ export { ImageToVideo, type ImageToVideoCreateResponse, type ImageToVideoCreateP
|
|
|
2
2
|
export { Organization, type OrganizationRetrieveResponse } from "./organization.js";
|
|
3
3
|
export { Tasks, type TaskRetrieveResponse } from "./tasks.js";
|
|
4
4
|
export { TextToImage, type TextToImageCreateResponse, type TextToImageCreateParams } from "./text-to-image.js";
|
|
5
|
+
export { VideoUpscale, type VideoUpscaleCreateResponse, type VideoUpscaleCreateParams, } from "./video-upscale.js";
|
|
5
6
|
//# 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,EACL,YAAY,EACZ,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,GAC9B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,KAAK,4BAA4B,EAAE,MAAM,gBAAgB,CAAC;AACjF,OAAO,EAAE,KAAK,EAAE,KAAK,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,KAAK,yBAAyB,EAAE,KAAK,uBAAuB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
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,YAAY,EAAE,KAAK,4BAA4B,EAAE,MAAM,gBAAgB,CAAC;AACjF,OAAO,EAAE,KAAK,EAAE,KAAK,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,KAAK,yBAAyB,EAAE,KAAK,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC5G,OAAO,EACL,YAAY,EACZ,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,GAC9B,MAAM,iBAAiB,CAAC"}
|
package/resources/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.TextToImage = exports.Tasks = exports.Organization = exports.ImageToVideo = void 0;
|
|
4
|
+
exports.VideoUpscale = exports.TextToImage = exports.Tasks = exports.Organization = exports.ImageToVideo = void 0;
|
|
5
5
|
var image_to_video_1 = require("./image-to-video.js");
|
|
6
6
|
Object.defineProperty(exports, "ImageToVideo", { enumerable: true, get: function () { return image_to_video_1.ImageToVideo; } });
|
|
7
7
|
var organization_1 = require("./organization.js");
|
|
@@ -10,4 +10,6 @@ var tasks_1 = require("./tasks.js");
|
|
|
10
10
|
Object.defineProperty(exports, "Tasks", { enumerable: true, get: function () { return tasks_1.Tasks; } });
|
|
11
11
|
var text_to_image_1 = require("./text-to-image.js");
|
|
12
12
|
Object.defineProperty(exports, "TextToImage", { enumerable: true, get: function () { return text_to_image_1.TextToImage; } });
|
|
13
|
+
var video_upscale_1 = require("./video-upscale.js");
|
|
14
|
+
Object.defineProperty(exports, "VideoUpscale", { enumerable: true, get: function () { return video_upscale_1.VideoUpscale; } });
|
|
13
15
|
//# sourceMappingURL=index.js.map
|
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,sDAI0B;AAHxB,8GAAA,YAAY,OAAA;AAId,kDAAiF;AAAxE,4GAAA,YAAY,OAAA;AACrB,oCAA2D;AAAlD,8FAAA,KAAK,OAAA;AACd,oDAA4G;AAAnG,4GAAA,WAAW,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,sDAI0B;AAHxB,8GAAA,YAAY,OAAA;AAId,kDAAiF;AAAxE,4GAAA,YAAY,OAAA;AACrB,oCAA2D;AAAlD,8FAAA,KAAK,OAAA;AACd,oDAA4G;AAAnG,4GAAA,WAAW,OAAA;AACpB,oDAIyB;AAHvB,6GAAA,YAAY,OAAA"}
|
package/resources/index.mjs
CHANGED
|
@@ -3,4 +3,5 @@ export { ImageToVideo, } from "./image-to-video.mjs";
|
|
|
3
3
|
export { Organization } from "./organization.mjs";
|
|
4
4
|
export { Tasks } from "./tasks.mjs";
|
|
5
5
|
export { TextToImage } from "./text-to-image.mjs";
|
|
6
|
+
export { VideoUpscale, } from "./video-upscale.mjs";
|
|
6
7
|
//# 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,EACL,YAAY,GAGb;OACM,EAAE,YAAY,EAAqC;OACnD,EAAE,KAAK,EAA6B;OACpC,EAAE,WAAW,EAAgE"}
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,YAAY,GAGb;OACM,EAAE,YAAY,EAAqC;OACnD,EAAE,KAAK,EAA6B;OACpC,EAAE,WAAW,EAAgE;OAC7E,EACL,YAAY,GAGb"}
|
|
@@ -52,6 +52,10 @@ export declare namespace OrganizationRetrieveResponse {
|
|
|
52
52
|
* Limits associated with the gen4_turbo model.
|
|
53
53
|
*/
|
|
54
54
|
gen4_turbo?: Models.Gen4Turbo;
|
|
55
|
+
/**
|
|
56
|
+
* Limits associated with the upscale_v1 model.
|
|
57
|
+
*/
|
|
58
|
+
upscale_v1?: Models.UpscaleV1;
|
|
55
59
|
}
|
|
56
60
|
namespace Models {
|
|
57
61
|
/**
|
|
@@ -93,6 +97,19 @@ export declare namespace OrganizationRetrieveResponse {
|
|
|
93
97
|
*/
|
|
94
98
|
maxDailyGenerations: number;
|
|
95
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* Limits associated with the upscale_v1 model.
|
|
102
|
+
*/
|
|
103
|
+
interface UpscaleV1 {
|
|
104
|
+
/**
|
|
105
|
+
* The maximum number of generations that can be run concurrently for this model.
|
|
106
|
+
*/
|
|
107
|
+
maxConcurrentGenerations: number;
|
|
108
|
+
/**
|
|
109
|
+
* The maximum number of generations that can be created each day for this model.
|
|
110
|
+
*/
|
|
111
|
+
maxDailyGenerations: number;
|
|
112
|
+
}
|
|
96
113
|
}
|
|
97
114
|
}
|
|
98
115
|
/**
|
|
@@ -121,6 +138,10 @@ export declare namespace OrganizationRetrieveResponse {
|
|
|
121
138
|
* Usage data for the gen4_turbo model.
|
|
122
139
|
*/
|
|
123
140
|
gen4_turbo?: Models.Gen4Turbo;
|
|
141
|
+
/**
|
|
142
|
+
* Usage data for the upscale_v1 model.
|
|
143
|
+
*/
|
|
144
|
+
upscale_v1?: Models.UpscaleV1;
|
|
124
145
|
}
|
|
125
146
|
namespace Models {
|
|
126
147
|
/**
|
|
@@ -150,6 +171,15 @@ export declare namespace OrganizationRetrieveResponse {
|
|
|
150
171
|
*/
|
|
151
172
|
dailyGenerations: number;
|
|
152
173
|
}
|
|
174
|
+
/**
|
|
175
|
+
* Usage data for the upscale_v1 model.
|
|
176
|
+
*/
|
|
177
|
+
interface UpscaleV1 {
|
|
178
|
+
/**
|
|
179
|
+
* The number of generations that have been run for this model in the past day.
|
|
180
|
+
*/
|
|
181
|
+
dailyGenerations: number;
|
|
182
|
+
}
|
|
153
183
|
}
|
|
154
184
|
}
|
|
155
185
|
}
|
|
@@ -1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YAED;;eAEG;YACH,UAAiB,SAAS;gBACxB;;mBAEG;gBACH,wBAAwB,EAAE,MAAM,CAAC;gBAEjC;;mBAEG;gBACH,mBAAmB,EAAE,MAAM,CAAC;aAC7B;SACF;KACF;IAED;;OAEG;IACH,UAAiB,KAAK;QACpB;;WAEG;QACH,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC;KACtB;IAED,UAAiB,KAAK,CAAC;QACrB;;WAEG;QACH,UAAiB,MAAM;YACrB;;eAEG;YACH,WAAW,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;YAEhC;;eAEG;YACH,UAAU,CAAC,EAAE,MAAM,CAAC,SAAS,CAAC;YAE9B;;eAEG;YACH,UAAU,CAAC,EAAE,MAAM,CAAC,SAAS,CAAC;SAC/B;QAED,UAAiB,MAAM,CAAC;YACtB;;eAEG;YACH,UAAiB,UAAU;gBACzB;;mBAEG;gBACH,gBAAgB,EAAE,MAAM,CAAC;aAC1B;YAED;;eAEG;YACH,UAAiB,SAAS;gBACxB;;mBAEG;gBACH,gBAAgB,EAAE,MAAM,CAAC;aAC1B;YAED;;eAEG;YACH,UAAiB,SAAS;gBACxB;;mBAEG;gBACH,gBAAgB,EAAE,MAAM,CAAC;aAC1B;SACF;KACF;CACF;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EAAE,KAAK,4BAA4B,IAAI,4BAA4B,EAAE,CAAC;CAC9E"}
|
|
1
|
+
{"version":3,"file":"organization.d.ts","sourceRoot":"","sources":["../src/resources/organization.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAEhC,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,4BAA4B,CAAC;CAGvF;AAED,MAAM,WAAW,4BAA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UAAiB,KAAK;QACpB;;WAEG;QACH,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC;KACtB;IAED,UAAiB,KAAK,CAAC;QACrB;;WAEG;QACH,UAAiB,MAAM;YACrB;;eAEG;YACH,WAAW,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;YAEhC;;eAEG;YACH,UAAU,CAAC,EAAE,MAAM,CAAC,SAAS,CAAC;YAE9B;;eAEG;YACH,UAAU,CAAC,EAAE,MAAM,CAAC,SAAS,CAAC;YAE9B;;eAEG;YACH,UAAU,CAAC,EAAE,MAAM,CAAC,SAAS,CAAC;SAC/B;QAED,UAAiB,MAAM,CAAC;YACtB;;eAEG;YACH,UAAiB,UAAU;gBACzB;;mBAEG;gBACH,gBAAgB,EAAE,MAAM,CAAC;aAC1B;YAED;;eAEG;YACH,UAAiB,SAAS;gBACxB;;mBAEG;gBACH,gBAAgB,EAAE,MAAM,CAAC;aAC1B;YAED;;eAEG;YACH,UAAiB,SAAS;gBACxB;;mBAEG;gBACH,gBAAgB,EAAE,MAAM,CAAC;aAC1B;YAED;;eAEG;YACH,UAAiB,SAAS;gBACxB;;mBAEG;gBACH,gBAAgB,EAAE,MAAM,CAAC;aAC1B;SACF;KACF;CACF;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EAAE,KAAK,4BAA4B,IAAI,4BAA4B,EAAE,CAAC;CAC9E"}
|
package/resources/tasks.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { APIResource } from "../resource.js";
|
|
2
2
|
import * as Core from "../core.js";
|
|
3
|
+
import { APIPromiseWithAwaitableTask } from "../lib/polling.js";
|
|
3
4
|
export declare class Tasks extends APIResource {
|
|
4
5
|
/**
|
|
5
6
|
* Return details about a task. Consumers of this API should not expect updates
|
|
6
7
|
* more frequent than once every five seconds for a given task.
|
|
7
8
|
*/
|
|
8
|
-
retrieve(id: string, options?: Core.RequestOptions):
|
|
9
|
+
retrieve(id: string, options?: Core.RequestOptions): APIPromiseWithAwaitableTask<TaskRetrieveResponse>;
|
|
9
10
|
/**
|
|
10
11
|
* Tasks that are running, pending, or throttled can be canceled by invoking this
|
|
11
12
|
* method. Invoking this method for other tasks will delete them.
|
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;AAChC,OAAO,EAAE,2BAA2B,EAA0B,MAAM,gBAAgB,CAAC;AAErF,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;OAGG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,2BAA2B,CAAC,oBAAoB,CAAC;IAOtG;;;;;;;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"}
|