@runwayml/sdk 0.1.0-alpha.3

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.
Files changed (179) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/LICENSE +201 -0
  3. package/README.md +329 -0
  4. package/_shims/MultipartBody.d.ts +9 -0
  5. package/_shims/MultipartBody.d.ts.map +1 -0
  6. package/_shims/MultipartBody.js +16 -0
  7. package/_shims/MultipartBody.js.map +1 -0
  8. package/_shims/MultipartBody.mjs +12 -0
  9. package/_shims/MultipartBody.mjs.map +1 -0
  10. package/_shims/README.md +46 -0
  11. package/_shims/auto/runtime-bun.d.ts +5 -0
  12. package/_shims/auto/runtime-bun.d.ts.map +1 -0
  13. package/_shims/auto/runtime-bun.js +21 -0
  14. package/_shims/auto/runtime-bun.js.map +1 -0
  15. package/_shims/auto/runtime-bun.mjs +2 -0
  16. package/_shims/auto/runtime-bun.mjs.map +1 -0
  17. package/_shims/auto/runtime-node.d.ts +5 -0
  18. package/_shims/auto/runtime-node.d.ts.map +1 -0
  19. package/_shims/auto/runtime-node.js +21 -0
  20. package/_shims/auto/runtime-node.js.map +1 -0
  21. package/_shims/auto/runtime-node.mjs +2 -0
  22. package/_shims/auto/runtime-node.mjs.map +1 -0
  23. package/_shims/auto/runtime.d.ts +5 -0
  24. package/_shims/auto/runtime.d.ts.map +1 -0
  25. package/_shims/auto/runtime.js +21 -0
  26. package/_shims/auto/runtime.js.map +1 -0
  27. package/_shims/auto/runtime.mjs +2 -0
  28. package/_shims/auto/runtime.mjs.map +1 -0
  29. package/_shims/auto/types-node.d.ts +5 -0
  30. package/_shims/auto/types-node.d.ts.map +1 -0
  31. package/_shims/auto/types-node.js +21 -0
  32. package/_shims/auto/types-node.js.map +1 -0
  33. package/_shims/auto/types-node.mjs +2 -0
  34. package/_shims/auto/types-node.mjs.map +1 -0
  35. package/_shims/auto/types.d.ts +101 -0
  36. package/_shims/auto/types.js +3 -0
  37. package/_shims/auto/types.mjs +3 -0
  38. package/_shims/bun-runtime.d.ts +6 -0
  39. package/_shims/bun-runtime.d.ts.map +1 -0
  40. package/_shims/bun-runtime.js +14 -0
  41. package/_shims/bun-runtime.js.map +1 -0
  42. package/_shims/bun-runtime.mjs +10 -0
  43. package/_shims/bun-runtime.mjs.map +1 -0
  44. package/_shims/index.d.ts +81 -0
  45. package/_shims/index.js +13 -0
  46. package/_shims/index.mjs +7 -0
  47. package/_shims/manual-types.d.ts +12 -0
  48. package/_shims/manual-types.js +3 -0
  49. package/_shims/manual-types.mjs +3 -0
  50. package/_shims/node-runtime.d.ts +3 -0
  51. package/_shims/node-runtime.d.ts.map +1 -0
  52. package/_shims/node-runtime.js +89 -0
  53. package/_shims/node-runtime.js.map +1 -0
  54. package/_shims/node-runtime.mjs +56 -0
  55. package/_shims/node-runtime.mjs.map +1 -0
  56. package/_shims/node-types.d.ts +42 -0
  57. package/_shims/node-types.js +3 -0
  58. package/_shims/node-types.mjs +3 -0
  59. package/_shims/registry.d.ts +37 -0
  60. package/_shims/registry.d.ts.map +1 -0
  61. package/_shims/registry.js +41 -0
  62. package/_shims/registry.js.map +1 -0
  63. package/_shims/registry.mjs +37 -0
  64. package/_shims/registry.mjs.map +1 -0
  65. package/_shims/web-runtime.d.ts +5 -0
  66. package/_shims/web-runtime.d.ts.map +1 -0
  67. package/_shims/web-runtime.js +78 -0
  68. package/_shims/web-runtime.js.map +1 -0
  69. package/_shims/web-runtime.mjs +71 -0
  70. package/_shims/web-runtime.mjs.map +1 -0
  71. package/_shims/web-types.d.ts +83 -0
  72. package/_shims/web-types.js +3 -0
  73. package/_shims/web-types.mjs +3 -0
  74. package/core.d.ts +239 -0
  75. package/core.d.ts.map +1 -0
  76. package/core.js +887 -0
  77. package/core.js.map +1 -0
  78. package/core.mjs +856 -0
  79. package/core.mjs.map +1 -0
  80. package/error.d.ts +53 -0
  81. package/error.d.ts.map +1 -0
  82. package/error.js +143 -0
  83. package/error.js.map +1 -0
  84. package/error.mjs +127 -0
  85. package/error.mjs.map +1 -0
  86. package/index.d.mts +118 -0
  87. package/index.d.ts +118 -0
  88. package/index.d.ts.map +1 -0
  89. package/index.js +118 -0
  90. package/index.js.map +1 -0
  91. package/index.mjs +90 -0
  92. package/index.mjs.map +1 -0
  93. package/package.json +103 -0
  94. package/resource.d.ts +6 -0
  95. package/resource.d.ts.map +1 -0
  96. package/resource.js +11 -0
  97. package/resource.js.map +1 -0
  98. package/resource.mjs +7 -0
  99. package/resource.mjs.map +1 -0
  100. package/resources/image-to-video.d.ts +43 -0
  101. package/resources/image-to-video.d.ts.map +1 -0
  102. package/resources/image-to-video.js +17 -0
  103. package/resources/image-to-video.js.map +1 -0
  104. package/resources/image-to-video.mjs +13 -0
  105. package/resources/image-to-video.mjs.map +1 -0
  106. package/resources/index.d.ts +3 -0
  107. package/resources/index.d.ts.map +1 -0
  108. package/resources/index.js +9 -0
  109. package/resources/index.js.map +1 -0
  110. package/resources/index.mjs +4 -0
  111. package/resources/index.mjs.map +1 -0
  112. package/resources/tasks.d.ts +65 -0
  113. package/resources/tasks.d.ts.map +1 -0
  114. package/resources/tasks.js +32 -0
  115. package/resources/tasks.js.map +1 -0
  116. package/resources/tasks.mjs +28 -0
  117. package/resources/tasks.mjs.map +1 -0
  118. package/shims/node.d.ts +30 -0
  119. package/shims/node.d.ts.map +1 -0
  120. package/shims/node.js +31 -0
  121. package/shims/node.js.map +1 -0
  122. package/shims/node.mjs +5 -0
  123. package/shims/node.mjs.map +1 -0
  124. package/shims/web.d.ts +26 -0
  125. package/shims/web.d.ts.map +1 -0
  126. package/shims/web.js +31 -0
  127. package/shims/web.js.map +1 -0
  128. package/shims/web.mjs +5 -0
  129. package/shims/web.mjs.map +1 -0
  130. package/src/_shims/MultipartBody.ts +9 -0
  131. package/src/_shims/README.md +46 -0
  132. package/src/_shims/auto/runtime-bun.ts +4 -0
  133. package/src/_shims/auto/runtime-node.ts +4 -0
  134. package/src/_shims/auto/runtime.ts +4 -0
  135. package/src/_shims/auto/types-node.ts +4 -0
  136. package/src/_shims/auto/types.d.ts +101 -0
  137. package/src/_shims/auto/types.js +3 -0
  138. package/src/_shims/auto/types.mjs +3 -0
  139. package/src/_shims/bun-runtime.ts +14 -0
  140. package/src/_shims/index.d.ts +81 -0
  141. package/src/_shims/index.js +13 -0
  142. package/src/_shims/index.mjs +7 -0
  143. package/src/_shims/manual-types.d.ts +12 -0
  144. package/src/_shims/manual-types.js +3 -0
  145. package/src/_shims/manual-types.mjs +3 -0
  146. package/src/_shims/node-runtime.ts +81 -0
  147. package/src/_shims/node-types.d.ts +42 -0
  148. package/src/_shims/node-types.js +3 -0
  149. package/src/_shims/node-types.mjs +3 -0
  150. package/src/_shims/registry.ts +67 -0
  151. package/src/_shims/web-runtime.ts +103 -0
  152. package/src/_shims/web-types.d.ts +83 -0
  153. package/src/_shims/web-types.js +3 -0
  154. package/src/_shims/web-types.mjs +3 -0
  155. package/src/core.ts +1170 -0
  156. package/src/error.ts +146 -0
  157. package/src/index.ts +205 -0
  158. package/src/lib/.keep +4 -0
  159. package/src/resource.ts +11 -0
  160. package/src/resources/image-to-video.ts +57 -0
  161. package/src/resources/index.ts +4 -0
  162. package/src/resources/tasks.ts +83 -0
  163. package/src/shims/node.ts +50 -0
  164. package/src/shims/web.ts +50 -0
  165. package/src/tsconfig.json +11 -0
  166. package/src/uploads.ts +255 -0
  167. package/src/version.ts +1 -0
  168. package/uploads.d.ts +75 -0
  169. package/uploads.d.ts.map +1 -0
  170. package/uploads.js +171 -0
  171. package/uploads.js.map +1 -0
  172. package/uploads.mjs +158 -0
  173. package/uploads.mjs.map +1 -0
  174. package/version.d.ts +2 -0
  175. package/version.d.ts.map +1 -0
  176. package/version.js +5 -0
  177. package/version.js.map +1 -0
  178. package/version.mjs +2 -0
  179. package/version.mjs.map +1 -0
package/index.js ADDED
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || function (mod) {
20
+ if (mod && mod.__esModule) return mod;
21
+ var result = {};
22
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
23
+ __setModuleDefault(result, mod);
24
+ return result;
25
+ };
26
+ var _a;
27
+ Object.defineProperty(exports, "__esModule", { value: true });
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 Errors = __importStar(require("./error.js"));
30
+ const Uploads = __importStar(require("./uploads.js"));
31
+ const Core = __importStar(require("./core.js"));
32
+ const API = __importStar(require("./resources/index.js"));
33
+ /**
34
+ * API Client for interfacing with the RunwayML API.
35
+ */
36
+ class RunwayML extends Core.APIClient {
37
+ /**
38
+ * API Client for interfacing with the RunwayML API.
39
+ *
40
+ * @param {string | undefined} [opts.apiKey=process.env['RUNWAYML_API_SECRET'] ?? undefined]
41
+ * @param {string | undefined} [opts.runwayVersion=2024-09-13]
42
+ * @param {string} [opts.baseURL=process.env['RUNWAYML_BASE_URL'] ?? https://api.dev.runwayml.com] - Override the default base URL for the API.
43
+ * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
44
+ * @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
45
+ * @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
46
+ * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
47
+ * @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
48
+ * @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
49
+ */
50
+ constructor({ baseURL = Core.readEnv('RUNWAYML_BASE_URL'), apiKey = Core.readEnv('RUNWAYML_API_SECRET'), runwayVersion = '2024-09-13', ...opts } = {}) {
51
+ if (apiKey === undefined) {
52
+ 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
+ }
54
+ const options = {
55
+ apiKey,
56
+ runwayVersion,
57
+ ...opts,
58
+ baseURL: baseURL || `https://api.dev.runwayml.com`,
59
+ };
60
+ if (Core.isRunningInBrowser()) {
61
+ throw new Errors.RunwayMLError("It looks like you're running in a browser-like environment, which is disabled to protect your secret API credentials from attackers. If you have a strong business need for client-side use of this API, please open a GitHub issue with your use-case and security mitigations.");
62
+ }
63
+ super({
64
+ baseURL: options.baseURL,
65
+ timeout: options.timeout ?? 60000 /* 1 minute */,
66
+ httpAgent: options.httpAgent,
67
+ maxRetries: options.maxRetries,
68
+ fetch: options.fetch,
69
+ });
70
+ this.tasks = new API.Tasks(this);
71
+ this.imageToVideo = new API.ImageToVideo(this);
72
+ this._options = options;
73
+ this.apiKey = apiKey;
74
+ this.runwayVersion = runwayVersion;
75
+ }
76
+ defaultQuery() {
77
+ return this._options.defaultQuery;
78
+ }
79
+ defaultHeaders(opts) {
80
+ return {
81
+ ...super.defaultHeaders(opts),
82
+ 'X-Runway-Version': this.runwayVersion,
83
+ ...this._options.defaultHeaders,
84
+ };
85
+ }
86
+ authHeaders(opts) {
87
+ return { Authorization: `Bearer ${this.apiKey}` };
88
+ }
89
+ }
90
+ exports.RunwayML = RunwayML;
91
+ _a = RunwayML;
92
+ RunwayML.RunwayML = _a;
93
+ RunwayML.DEFAULT_TIMEOUT = 60000; // 1 minute
94
+ RunwayML.RunwayMLError = Errors.RunwayMLError;
95
+ RunwayML.APIError = Errors.APIError;
96
+ RunwayML.APIConnectionError = Errors.APIConnectionError;
97
+ RunwayML.APIConnectionTimeoutError = Errors.APIConnectionTimeoutError;
98
+ RunwayML.APIUserAbortError = Errors.APIUserAbortError;
99
+ RunwayML.NotFoundError = Errors.NotFoundError;
100
+ RunwayML.ConflictError = Errors.ConflictError;
101
+ RunwayML.RateLimitError = Errors.RateLimitError;
102
+ RunwayML.BadRequestError = Errors.BadRequestError;
103
+ RunwayML.AuthenticationError = Errors.AuthenticationError;
104
+ RunwayML.InternalServerError = Errors.InternalServerError;
105
+ RunwayML.PermissionDeniedError = Errors.PermissionDeniedError;
106
+ RunwayML.UnprocessableEntityError = Errors.UnprocessableEntityError;
107
+ RunwayML.toFile = Uploads.toFile;
108
+ RunwayML.fileFromPath = Uploads.fileFromPath;
109
+ exports.RunwayMLError = Errors.RunwayMLError, exports.APIError = Errors.APIError, exports.APIConnectionError = Errors.APIConnectionError, exports.APIConnectionTimeoutError = Errors.APIConnectionTimeoutError, exports.APIUserAbortError = Errors.APIUserAbortError, exports.NotFoundError = Errors.NotFoundError, exports.ConflictError = Errors.ConflictError, exports.RateLimitError = Errors.RateLimitError, exports.BadRequestError = Errors.BadRequestError, exports.AuthenticationError = Errors.AuthenticationError, exports.InternalServerError = Errors.InternalServerError, exports.PermissionDeniedError = Errors.PermissionDeniedError, exports.UnprocessableEntityError = Errors.UnprocessableEntityError;
110
+ exports.toFile = Uploads.toFile;
111
+ exports.fileFromPath = Uploads.fileFromPath;
112
+ (function (RunwayML) {
113
+ RunwayML.Tasks = API.Tasks;
114
+ RunwayML.ImageToVideo = API.ImageToVideo;
115
+ })(RunwayML = exports.RunwayML || (exports.RunwayML = {}));
116
+ exports = module.exports = RunwayML;
117
+ exports.default = RunwayML;
118
+ //# sourceMappingURL=index.js.map
package/index.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtF,mDAAkC;AAClC,sDAAqC;AAErC,gDAA+B;AAC/B,0DAAyC;AAmEzC;;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,MAAM,IAAI,MAAM,CAAC,aAAa,CAC5B,6LAA6L,CAC9L,CAAC;SACH;QAED,MAAM,OAAO,GAAkB;YAC7B,MAAM;YACN,aAAa;YACb,GAAG,IAAI;YACP,OAAO,EAAE,OAAO,IAAI,8BAA8B;SACnD,CAAC;QAEF,IAAI,IAAI,CAAC,kBAAkB,EAAE,EAAE;YAC7B,MAAM,IAAI,MAAM,CAAC,aAAa,CAC5B,kRAAkR,CACnR,CAAC;SACH;QAED,KAAK,CAAC;YACJ,OAAO,EAAE,OAAO,CAAC,OAAQ;YACzB,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,KAAK,CAAC,cAAc;YAChD,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,KAAK,EAAE,OAAO,CAAC,KAAK;SACrB,CAAC,CAAC;QAQL,UAAK,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AAmB,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;AAI3C,qBAAa,GAaX,MAAM,gBAZR,gBAAQ,GAYN,MAAM,WAXR,0BAAkB,GAWhB,MAAM,qBAVR,iCAAyB,GAUvB,MAAM,4BATR,yBAAiB,GASf,MAAM,oBARR,qBAAa,GAQX,MAAM,gBAPR,qBAAa,GAOX,MAAM,gBANR,sBAAc,GAMZ,MAAM,iBALR,uBAAe,GAKb,MAAM,kBAJR,2BAAmB,GAIjB,MAAM,sBAHR,2BAAmB,GAGjB,MAAM,sBAFR,6BAAqB,GAEnB,MAAM,wBADR,gCAAwB,GACtB,MAAM,0BAAC;AAEG,QAAA,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;AACxB,QAAA,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;AAElD,WAAiB,QAAQ;IAGT,cAAK,GAAG,GAAG,CAAC,KAAK,CAAC;IAGlB,qBAAY,GAAG,GAAG,CAAC,YAAY,CAAC;AAGhD,CAAC,EATgB,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QASxB;AAED,kBAAe,QAAQ,CAAC"}
package/index.mjs ADDED
@@ -0,0 +1,90 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ var _a;
3
+ import * as Errors from "./error.mjs";
4
+ import * as Uploads from "./uploads.mjs";
5
+ import * as Core from "./core.mjs";
6
+ import * as API from "./resources/index.mjs";
7
+ /**
8
+ * API Client for interfacing with the RunwayML API.
9
+ */
10
+ export class RunwayML extends Core.APIClient {
11
+ /**
12
+ * API Client for interfacing with the RunwayML API.
13
+ *
14
+ * @param {string | undefined} [opts.apiKey=process.env['RUNWAYML_API_SECRET'] ?? undefined]
15
+ * @param {string | undefined} [opts.runwayVersion=2024-09-13]
16
+ * @param {string} [opts.baseURL=process.env['RUNWAYML_BASE_URL'] ?? https://api.dev.runwayml.com] - Override the default base URL for the API.
17
+ * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
18
+ * @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
19
+ * @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
20
+ * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
21
+ * @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
22
+ * @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
23
+ */
24
+ constructor({ baseURL = Core.readEnv('RUNWAYML_BASE_URL'), apiKey = Core.readEnv('RUNWAYML_API_SECRET'), runwayVersion = '2024-09-13', ...opts } = {}) {
25
+ if (apiKey === undefined) {
26
+ 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
+ }
28
+ const options = {
29
+ apiKey,
30
+ runwayVersion,
31
+ ...opts,
32
+ baseURL: baseURL || `https://api.dev.runwayml.com`,
33
+ };
34
+ if (Core.isRunningInBrowser()) {
35
+ throw new Errors.RunwayMLError("It looks like you're running in a browser-like environment, which is disabled to protect your secret API credentials from attackers. If you have a strong business need for client-side use of this API, please open a GitHub issue with your use-case and security mitigations.");
36
+ }
37
+ super({
38
+ baseURL: options.baseURL,
39
+ timeout: options.timeout ?? 60000 /* 1 minute */,
40
+ httpAgent: options.httpAgent,
41
+ maxRetries: options.maxRetries,
42
+ fetch: options.fetch,
43
+ });
44
+ this.tasks = new API.Tasks(this);
45
+ this.imageToVideo = new API.ImageToVideo(this);
46
+ this._options = options;
47
+ this.apiKey = apiKey;
48
+ this.runwayVersion = runwayVersion;
49
+ }
50
+ defaultQuery() {
51
+ return this._options.defaultQuery;
52
+ }
53
+ defaultHeaders(opts) {
54
+ return {
55
+ ...super.defaultHeaders(opts),
56
+ 'X-Runway-Version': this.runwayVersion,
57
+ ...this._options.defaultHeaders,
58
+ };
59
+ }
60
+ authHeaders(opts) {
61
+ return { Authorization: `Bearer ${this.apiKey}` };
62
+ }
63
+ }
64
+ _a = RunwayML;
65
+ RunwayML.RunwayML = _a;
66
+ RunwayML.DEFAULT_TIMEOUT = 60000; // 1 minute
67
+ RunwayML.RunwayMLError = Errors.RunwayMLError;
68
+ RunwayML.APIError = Errors.APIError;
69
+ RunwayML.APIConnectionError = Errors.APIConnectionError;
70
+ RunwayML.APIConnectionTimeoutError = Errors.APIConnectionTimeoutError;
71
+ RunwayML.APIUserAbortError = Errors.APIUserAbortError;
72
+ RunwayML.NotFoundError = Errors.NotFoundError;
73
+ RunwayML.ConflictError = Errors.ConflictError;
74
+ RunwayML.RateLimitError = Errors.RateLimitError;
75
+ RunwayML.BadRequestError = Errors.BadRequestError;
76
+ RunwayML.AuthenticationError = Errors.AuthenticationError;
77
+ RunwayML.InternalServerError = Errors.InternalServerError;
78
+ RunwayML.PermissionDeniedError = Errors.PermissionDeniedError;
79
+ RunwayML.UnprocessableEntityError = Errors.UnprocessableEntityError;
80
+ RunwayML.toFile = Uploads.toFile;
81
+ RunwayML.fileFromPath = Uploads.fileFromPath;
82
+ export const { RunwayMLError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } = Errors;
83
+ export var toFile = Uploads.toFile;
84
+ export var fileFromPath = Uploads.fileFromPath;
85
+ (function (RunwayML) {
86
+ RunwayML.Tasks = API.Tasks;
87
+ RunwayML.ImageToVideo = API.ImageToVideo;
88
+ })(RunwayML || (RunwayML = {}));
89
+ export default RunwayML;
90
+ //# sourceMappingURL=index.mjs.map
package/index.mjs.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":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iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,GACzB,GAAG,MAAM,CAAC;AAEX,MAAM,KAAQ,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;AACtC,MAAM,KAAQ,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;AAElD,WAAiB,QAAQ;IAGT,cAAK,GAAG,GAAG,CAAC,KAAK,CAAC;IAGlB,qBAAY,GAAG,GAAG,CAAC,YAAY,CAAC;AAGhD,CAAC,EATgB,QAAQ,KAAR,QAAQ,QASxB;AAED,eAAe,QAAQ,CAAC"}
package/package.json ADDED
@@ -0,0 +1,103 @@
1
+ {
2
+ "name": "@runwayml/sdk",
3
+ "version": "0.1.0-alpha.3",
4
+ "description": "The official TypeScript library for the RunwayML API",
5
+ "author": "RunwayML <dev-feedback@runwayml.com>",
6
+ "types": "./index.d.ts",
7
+ "main": "./index.js",
8
+ "type": "commonjs",
9
+ "repository": "github:runwayml/sdk-node",
10
+ "license": "Apache-2.0",
11
+ "packageManager": "yarn@1.22.22",
12
+ "files": [
13
+ "*"
14
+ ],
15
+ "private": false,
16
+ "scripts": {
17
+ "test": "./scripts/test",
18
+ "build": "./scripts/build",
19
+ "format": "prettier --write --cache --cache-strategy metadata . !dist",
20
+ "tsn": "ts-node -r tsconfig-paths/register",
21
+ "lint": "./scripts/lint",
22
+ "fix": "./scripts/format"
23
+ },
24
+ "dependencies": {
25
+ "@types/node": "^18.11.18",
26
+ "@types/node-fetch": "^2.6.4",
27
+ "abort-controller": "^3.0.0",
28
+ "agentkeepalive": "^4.2.1",
29
+ "form-data-encoder": "1.7.2",
30
+ "formdata-node": "^4.3.2",
31
+ "node-fetch": "^2.6.7"
32
+ },
33
+ "sideEffects": [
34
+ "./_shims/index.js",
35
+ "./_shims/index.mjs",
36
+ "./shims/node.js",
37
+ "./shims/node.mjs",
38
+ "./shims/web.js",
39
+ "./shims/web.mjs"
40
+ ],
41
+ "imports": {
42
+ "@runwayml/sdk": ".",
43
+ "@runwayml/sdk/*": "./src/*"
44
+ },
45
+ "exports": {
46
+ "./_shims/auto/*": {
47
+ "deno": {
48
+ "types": "./_shims/auto/*.d.ts",
49
+ "require": "./_shims/auto/*.js",
50
+ "default": "./_shims/auto/*.mjs"
51
+ },
52
+ "bun": {
53
+ "types": "./_shims/auto/*.d.ts",
54
+ "require": "./_shims/auto/*-bun.js",
55
+ "default": "./_shims/auto/*-bun.mjs"
56
+ },
57
+ "browser": {
58
+ "types": "./_shims/auto/*.d.ts",
59
+ "require": "./_shims/auto/*.js",
60
+ "default": "./_shims/auto/*.mjs"
61
+ },
62
+ "worker": {
63
+ "types": "./_shims/auto/*.d.ts",
64
+ "require": "./_shims/auto/*.js",
65
+ "default": "./_shims/auto/*.mjs"
66
+ },
67
+ "workerd": {
68
+ "types": "./_shims/auto/*.d.ts",
69
+ "require": "./_shims/auto/*.js",
70
+ "default": "./_shims/auto/*.mjs"
71
+ },
72
+ "node": {
73
+ "types": "./_shims/auto/*-node.d.ts",
74
+ "require": "./_shims/auto/*-node.js",
75
+ "default": "./_shims/auto/*-node.mjs"
76
+ },
77
+ "types": "./_shims/auto/*.d.ts",
78
+ "require": "./_shims/auto/*.js",
79
+ "default": "./_shims/auto/*.mjs"
80
+ },
81
+ ".": {
82
+ "require": {
83
+ "types": "./index.d.ts",
84
+ "default": "./index.js"
85
+ },
86
+ "types": "./index.d.mts",
87
+ "default": "./index.mjs"
88
+ },
89
+ "./*.mjs": {
90
+ "types": "./*.d.ts",
91
+ "default": "./*.mjs"
92
+ },
93
+ "./*.js": {
94
+ "types": "./*.d.ts",
95
+ "default": "./*.js"
96
+ },
97
+ "./*": {
98
+ "types": "./*.d.ts",
99
+ "require": "./*.js",
100
+ "default": "./*.mjs"
101
+ }
102
+ }
103
+ }
package/resource.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ import type { RunwayML } from "./index.js";
2
+ export declare class APIResource {
3
+ protected _client: RunwayML;
4
+ constructor(client: RunwayML);
5
+ }
6
+ //# sourceMappingURL=resource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["src/resource.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,qBAAa,WAAW;IACtB,SAAS,CAAC,OAAO,EAAE,QAAQ,CAAC;gBAEhB,MAAM,EAAE,QAAQ;CAG7B"}
package/resource.js ADDED
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.APIResource = void 0;
5
+ class APIResource {
6
+ constructor(client) {
7
+ this._client = client;
8
+ }
9
+ }
10
+ exports.APIResource = APIResource;
11
+ //# sourceMappingURL=resource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource.js","sourceRoot":"","sources":["src/resource.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAItF,MAAa,WAAW;IAGtB,YAAY,MAAgB;QAC1B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;CACF;AAND,kCAMC"}
package/resource.mjs ADDED
@@ -0,0 +1,7 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ export class APIResource {
3
+ constructor(client) {
4
+ this._client = client;
5
+ }
6
+ }
7
+ //# sourceMappingURL=resource.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource.mjs","sourceRoot":"","sources":["src/resource.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAItF,MAAM,OAAO,WAAW;IAGtB,YAAY,MAAgB;QAC1B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;CACF"}
@@ -0,0 +1,43 @@
1
+ import { APIResource } from "../resource.js";
2
+ import * as Core from "../core.js";
3
+ import * as ImageToVideoAPI from "./image-to-video.js";
4
+ export declare class ImageToVideo extends APIResource {
5
+ /**
6
+ * This endpoint will start a new task to generate a video from an image prompt.
7
+ */
8
+ create(body: ImageToVideoCreateParams, options?: Core.RequestOptions): Core.APIPromise<ImageToVideoCreateResponse>;
9
+ }
10
+ export interface ImageToVideoCreateResponse {
11
+ /**
12
+ * The ID of the newly created task.
13
+ */
14
+ id: string;
15
+ }
16
+ export interface ImageToVideoCreateParams {
17
+ /**
18
+ * The model variant to use.
19
+ */
20
+ model: 'gen3a_turbo';
21
+ /**
22
+ * A HTTPS URL pointing to an image. Images must be JPEG, PNG, or WebP and are
23
+ * limited to 16MB. Responses must include a valid `Content-Length` header.
24
+ */
25
+ promptImage: string;
26
+ promptText?: string;
27
+ /**
28
+ * If unspecified, a random number is chosen. Varying the seed integer is a way to
29
+ * get different results for the same other request parameters. Using the same seed
30
+ * integer for an identical request will produce similar results.
31
+ */
32
+ seed?: number;
33
+ /**
34
+ * A boolean indicating whether or not the output video will contain a Runway
35
+ * watermark.
36
+ */
37
+ watermark?: boolean;
38
+ }
39
+ export declare namespace ImageToVideo {
40
+ export import ImageToVideoCreateResponse = ImageToVideoAPI.ImageToVideoCreateResponse;
41
+ export import ImageToVideoCreateParams = ImageToVideoAPI.ImageToVideoCreateParams;
42
+ }
43
+ //# sourceMappingURL=image-to-video.d.ts.map
@@ -0,0 +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;AAChC,OAAO,KAAK,eAAe,MAAM,kBAAkB,CAAC;AAEpD,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;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,KAAK,EAAE,aAAa,CAAC;IAErB;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,yBAAiB,YAAY,CAAC;IAC5B,MAAM,QAAQ,0BAA0B,GAAG,eAAe,CAAC,0BAA0B,CAAC;IACtF,MAAM,QAAQ,wBAAwB,GAAG,eAAe,CAAC,wBAAwB,CAAC;CACnF"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ImageToVideo = void 0;
5
+ const resource_1 = require("../resource.js");
6
+ class ImageToVideo extends resource_1.APIResource {
7
+ /**
8
+ * This endpoint will start a new task to generate a video from an image prompt.
9
+ */
10
+ create(body, options) {
11
+ return this._client.post('/v1/image_to_video', { body, ...options });
12
+ }
13
+ }
14
+ exports.ImageToVideo = ImageToVideo;
15
+ (function (ImageToVideo) {
16
+ })(ImageToVideo = exports.ImageToVideo || (exports.ImageToVideo = {}));
17
+ //# sourceMappingURL=image-to-video.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image-to-video.js","sourceRoot":"","sources":["../src/resources/image-to-video.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CAA0C;AAI1C,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;AAqCD,WAAiB,YAAY;AAG7B,CAAC,EAHgB,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAG5B"}
@@ -0,0 +1,13 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../resource.mjs";
3
+ export class ImageToVideo extends APIResource {
4
+ /**
5
+ * This endpoint will start a new task to generate a video from an image prompt.
6
+ */
7
+ create(body, options) {
8
+ return this._client.post('/v1/image_to_video', { body, ...options });
9
+ }
10
+ }
11
+ (function (ImageToVideo) {
12
+ })(ImageToVideo || (ImageToVideo = {}));
13
+ //# sourceMappingURL=image-to-video.mjs.map
@@ -0,0 +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;AAItB,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;AAqCD,WAAiB,YAAY;AAG7B,CAAC,EAHgB,YAAY,KAAZ,YAAY,QAG5B"}
@@ -0,0 +1,3 @@
1
+ export { ImageToVideoCreateResponse, ImageToVideoCreateParams, ImageToVideo } from "./image-to-video.js";
2
+ export { TaskRetrieveResponse, Tasks } from "./tasks.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACtG,OAAO,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Tasks = exports.ImageToVideo = void 0;
5
+ var image_to_video_1 = require("./image-to-video.js");
6
+ Object.defineProperty(exports, "ImageToVideo", { enumerable: true, get: function () { return image_to_video_1.ImageToVideo; } });
7
+ var tasks_1 = require("./tasks.js");
8
+ Object.defineProperty(exports, "Tasks", { enumerable: true, get: function () { return tasks_1.Tasks; } });
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,sDAAsG;AAAvC,8GAAA,YAAY,OAAA;AAC3E,oCAAsD;AAAvB,8FAAA,KAAK,OAAA"}
@@ -0,0 +1,4 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ export { ImageToVideo } from "./image-to-video.mjs";
3
+ export { Tasks } from "./tasks.mjs";
4
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAwD,YAAY,EAAE;OACtE,EAAwB,KAAK,EAAE"}
@@ -0,0 +1,65 @@
1
+ import { APIResource } from "../resource.js";
2
+ import * as Core from "../core.js";
3
+ import * as TasksAPI from "./tasks.js";
4
+ export declare class Tasks extends APIResource {
5
+ /**
6
+ * Return details about a task. Consumers of this API should not expect updates
7
+ * more frequent than once every five seconds for a given task.
8
+ */
9
+ retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<TaskRetrieveResponse>;
10
+ /**
11
+ * Tasks that are running, pending, or throttled can be canceled by invoking this
12
+ * method. Invoking this method for other tasks will delete them.
13
+ *
14
+ * The output data associated with a deleted task will be deleted from persistent
15
+ * storage in accordance with our data retention policy. Aborted and deleted tasks
16
+ * will not be able to be fetched again in the future.
17
+ */
18
+ delete(id: string, options?: Core.RequestOptions): Core.APIPromise<void>;
19
+ }
20
+ export interface TaskRetrieveResponse {
21
+ id: string;
22
+ /**
23
+ * The timestamp that the task was submitted at.
24
+ */
25
+ createdAt: string;
26
+ /**
27
+ * - `PENDING` tasks have been enqueued and are waiting to run.
28
+ * - `THROTTLED` tasks are waiting to be enqueued until other jobs have finished
29
+ * running.
30
+ * - `RUNNING` tasks are currently being processed.
31
+ * - `SUCCEEDED` tasks have completed successfully.
32
+ * - `FAILED` tasks have failed.
33
+ * - `CANCELLED` tasks have been aborted.
34
+ */
35
+ status: 'RUNNING' | 'SUCCEEDED' | 'FAILED' | 'PENDING' | 'CANCELLED' | 'THROTTLED';
36
+ /**
37
+ * If the status is `FAILED`, this will contain a human-friendly reason for the
38
+ * failure.
39
+ */
40
+ failure?: string;
41
+ /**
42
+ * If the task has a status of `FAILED`, this contains a machine-readable error
43
+ * code. This is a dot-separated string, with the leftmost segment being the most
44
+ * generic and the rightmost segment being the most specific. For example,
45
+ * `SAFETY.INPUT.TEXT` would indicate that the task failed due to a content
46
+ * moderation error on the input text.
47
+ */
48
+ failureCode?: string;
49
+ /**
50
+ * If the status is `SUCCEEDED`, this will contain an array of strings. Each string
51
+ * will be a URL that returns an output from the task. URLs expire within 24-48
52
+ * hours; fetch the task again to get fresh URLs. It is expected that you download
53
+ * the assets at these URLs and store them in your own storage system.
54
+ */
55
+ output?: Array<string>;
56
+ /**
57
+ * If the task has a status of `RUNNING`, this will contain a floating point number
58
+ * between 0 and 1 representing the progress of the generation.
59
+ */
60
+ progress?: number;
61
+ }
62
+ export declare namespace Tasks {
63
+ export import TaskRetrieveResponse = TasksAPI.TaskRetrieveResponse;
64
+ }
65
+ //# sourceMappingURL=tasks.d.ts.map
@@ -0,0 +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;AAChC,OAAO,KAAK,QAAQ,MAAM,SAAS,CAAC;AAEpC,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,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,yBAAiB,KAAK,CAAC;IACrB,MAAM,QAAQ,oBAAoB,GAAG,QAAQ,CAAC,oBAAoB,CAAC;CACpE"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Tasks = void 0;
5
+ const resource_1 = require("../resource.js");
6
+ class Tasks extends resource_1.APIResource {
7
+ /**
8
+ * Return details about a task. Consumers of this API should not expect updates
9
+ * more frequent than once every five seconds for a given task.
10
+ */
11
+ retrieve(id, options) {
12
+ return this._client.get(`/v1/tasks/${id}`, options);
13
+ }
14
+ /**
15
+ * Tasks that are running, pending, or throttled can be canceled by invoking this
16
+ * method. Invoking this method for other tasks will delete them.
17
+ *
18
+ * The output data associated with a deleted task will be deleted from persistent
19
+ * storage in accordance with our data retention policy. Aborted and deleted tasks
20
+ * will not be able to be fetched again in the future.
21
+ */
22
+ delete(id, options) {
23
+ return this._client.delete(`/v1/tasks/${id}`, {
24
+ ...options,
25
+ headers: { Accept: '*/*', ...options?.headers },
26
+ });
27
+ }
28
+ }
29
+ exports.Tasks = Tasks;
30
+ (function (Tasks) {
31
+ })(Tasks = exports.Tasks || (exports.Tasks = {}));
32
+ //# sourceMappingURL=tasks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tasks.js","sourceRoot":"","sources":["../src/resources/tasks.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CAA0C;AAI1C,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;AAmDD,WAAiB,KAAK;AAEtB,CAAC,EAFgB,KAAK,GAAL,aAAK,KAAL,aAAK,QAErB"}
@@ -0,0 +1,28 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../resource.mjs";
3
+ export class Tasks extends APIResource {
4
+ /**
5
+ * Return details about a task. Consumers of this API should not expect updates
6
+ * more frequent than once every five seconds for a given task.
7
+ */
8
+ retrieve(id, options) {
9
+ return this._client.get(`/v1/tasks/${id}`, options);
10
+ }
11
+ /**
12
+ * Tasks that are running, pending, or throttled can be canceled by invoking this
13
+ * method. Invoking this method for other tasks will delete them.
14
+ *
15
+ * The output data associated with a deleted task will be deleted from persistent
16
+ * storage in accordance with our data retention policy. Aborted and deleted tasks
17
+ * will not be able to be fetched again in the future.
18
+ */
19
+ delete(id, options) {
20
+ return this._client.delete(`/v1/tasks/${id}`, {
21
+ ...options,
22
+ headers: { Accept: '*/*', ...options?.headers },
23
+ });
24
+ }
25
+ }
26
+ (function (Tasks) {
27
+ })(Tasks || (Tasks = {}));
28
+ //# sourceMappingURL=tasks.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tasks.mjs","sourceRoot":"","sources":["../src/resources/tasks.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAItB,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;AAmDD,WAAiB,KAAK;AAEtB,CAAC,EAFgB,KAAK,KAAL,KAAK,QAErB"}