@hedra/sdk 2.0.2 → 3.0.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.
Files changed (76) hide show
  1. package/dist/cjs/BaseClient.d.ts +2 -2
  2. package/dist/cjs/BaseClient.js +3 -3
  3. package/dist/cjs/api/resources/billing/client/Client.js +2 -2
  4. package/dist/cjs/api/resources/files/client/Client.js +1 -1
  5. package/dist/cjs/api/resources/jobs/client/Client.d.ts +31 -2
  6. package/dist/cjs/api/resources/jobs/client/Client.js +164 -83
  7. package/dist/cjs/api/resources/jobs/client/requests/SubmitBodyKlingO3.d.ts +0 -1
  8. package/dist/cjs/api/resources/jobs/client/requests/SubmitBodyKlingV3.d.ts +0 -1
  9. package/dist/cjs/api/resources/jobs/client/requests/SubmitBodyVeedVideoBackgroundRemoval.d.ts +19 -0
  10. package/dist/cjs/api/resources/jobs/client/requests/SubmitBodyVeedVideoBackgroundRemoval.js +3 -0
  11. package/dist/cjs/api/resources/jobs/client/requests/index.d.ts +1 -0
  12. package/dist/cjs/api/resources/keys/client/Client.js +4 -4
  13. package/dist/cjs/api/resources/logDrains/client/Client.js +6 -6
  14. package/dist/cjs/api/resources/models/client/Client.js +6 -6
  15. package/dist/cjs/api/resources/tokens/client/Client.js +1 -1
  16. package/dist/cjs/api/resources/webhooks/client/Client.js +7 -7
  17. package/dist/cjs/api/types/InputKlingAiAvatarV2.d.ts +1 -1
  18. package/dist/cjs/api/types/InputKlingAiAvatarV2Audio.d.ts +1 -1
  19. package/dist/cjs/api/types/InputKlingO3.d.ts +29 -7
  20. package/dist/cjs/api/types/InputKlingO3.js +5 -0
  21. package/dist/cjs/api/types/InputKlingV3.d.ts +29 -7
  22. package/dist/cjs/api/types/InputKlingV3.js +5 -0
  23. package/dist/cjs/api/types/InputMinimaxH3.d.ts +3 -3
  24. package/dist/cjs/api/types/InputMinimaxH3EndImage.d.ts +1 -1
  25. package/dist/cjs/api/types/InputMinimaxH3StartImage.d.ts +1 -1
  26. package/dist/cjs/api/types/InputSeedance25.d.ts +1 -0
  27. package/dist/cjs/api/types/InputSeedance25.js +1 -0
  28. package/dist/cjs/api/types/InputVeedVideoBackgroundRemoval.d.ts +12 -0
  29. package/dist/cjs/api/types/InputVeedVideoBackgroundRemoval.js +3 -0
  30. package/dist/cjs/api/types/InputVeedVideoBackgroundRemovalSourceVideo.d.ts +23 -0
  31. package/dist/cjs/api/types/InputVeedVideoBackgroundRemovalSourceVideo.js +3 -0
  32. package/dist/cjs/api/types/ModelDetail.d.ts +2 -0
  33. package/dist/cjs/api/types/ModelSummary.d.ts +2 -0
  34. package/dist/cjs/api/types/index.d.ts +2 -0
  35. package/dist/cjs/api/types/index.js +2 -0
  36. package/dist/cjs/version.d.ts +1 -1
  37. package/dist/cjs/version.js +1 -1
  38. package/dist/esm/BaseClient.d.mts +2 -2
  39. package/dist/esm/BaseClient.mjs +3 -3
  40. package/dist/esm/api/resources/billing/client/Client.mjs +2 -2
  41. package/dist/esm/api/resources/files/client/Client.mjs +1 -1
  42. package/dist/esm/api/resources/jobs/client/Client.d.mts +31 -2
  43. package/dist/esm/api/resources/jobs/client/Client.mjs +164 -83
  44. package/dist/esm/api/resources/jobs/client/requests/SubmitBodyKlingO3.d.mts +0 -1
  45. package/dist/esm/api/resources/jobs/client/requests/SubmitBodyKlingV3.d.mts +0 -1
  46. package/dist/esm/api/resources/jobs/client/requests/SubmitBodyVeedVideoBackgroundRemoval.d.mts +19 -0
  47. package/dist/esm/api/resources/jobs/client/requests/SubmitBodyVeedVideoBackgroundRemoval.mjs +2 -0
  48. package/dist/esm/api/resources/jobs/client/requests/index.d.mts +1 -0
  49. package/dist/esm/api/resources/keys/client/Client.mjs +4 -4
  50. package/dist/esm/api/resources/logDrains/client/Client.mjs +6 -6
  51. package/dist/esm/api/resources/models/client/Client.mjs +6 -6
  52. package/dist/esm/api/resources/tokens/client/Client.mjs +1 -1
  53. package/dist/esm/api/resources/webhooks/client/Client.mjs +7 -7
  54. package/dist/esm/api/types/InputKlingAiAvatarV2.d.mts +1 -1
  55. package/dist/esm/api/types/InputKlingAiAvatarV2Audio.d.mts +1 -1
  56. package/dist/esm/api/types/InputKlingO3.d.mts +29 -7
  57. package/dist/esm/api/types/InputKlingO3.mjs +5 -0
  58. package/dist/esm/api/types/InputKlingV3.d.mts +29 -7
  59. package/dist/esm/api/types/InputKlingV3.mjs +5 -0
  60. package/dist/esm/api/types/InputMinimaxH3.d.mts +3 -3
  61. package/dist/esm/api/types/InputMinimaxH3EndImage.d.mts +1 -1
  62. package/dist/esm/api/types/InputMinimaxH3StartImage.d.mts +1 -1
  63. package/dist/esm/api/types/InputSeedance25.d.mts +1 -0
  64. package/dist/esm/api/types/InputSeedance25.mjs +1 -0
  65. package/dist/esm/api/types/InputVeedVideoBackgroundRemoval.d.mts +12 -0
  66. package/dist/esm/api/types/InputVeedVideoBackgroundRemoval.mjs +2 -0
  67. package/dist/esm/api/types/InputVeedVideoBackgroundRemovalSourceVideo.d.mts +23 -0
  68. package/dist/esm/api/types/InputVeedVideoBackgroundRemovalSourceVideo.mjs +2 -0
  69. package/dist/esm/api/types/ModelDetail.d.mts +2 -0
  70. package/dist/esm/api/types/ModelSummary.d.mts +2 -0
  71. package/dist/esm/api/types/index.d.mts +2 -0
  72. package/dist/esm/api/types/index.mjs +2 -0
  73. package/dist/esm/version.d.mts +1 -1
  74. package/dist/esm/version.mjs +1 -1
  75. package/package.json +2 -2
  76. package/reference.md +72 -2
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "2.0.2";
1
+ export declare const SDK_VERSION = "3.0.0";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "2.0.2";
4
+ exports.SDK_VERSION = "3.0.0";
@@ -7,7 +7,7 @@ export type BaseClientOptions = {
7
7
  /** Specify a custom URL to connect the client to. */
8
8
  baseUrl?: core.Supplier<string>;
9
9
  /** Override the X-Hedra-Spec-Version header */
10
- specVersion?: "3.3.0";
10
+ specVersion?: "3.9.0";
11
11
  /** Additional headers to include in requests. */
12
12
  headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
13
13
  /** The default maximum time to wait for a response in seconds. */
@@ -34,7 +34,7 @@ export interface BaseRequestOptions {
34
34
  /** A hook to abort the request. */
35
35
  abortSignal?: AbortSignal;
36
36
  /** Override the X-Hedra-Spec-Version header */
37
- specVersion?: "3.3.0";
37
+ specVersion?: "3.9.0";
38
38
  /** Additional query string parameters to include in the request. */
39
39
  queryParams?: Record<string, unknown>;
40
40
  /** A dictionary containing additional parameters to spread into the request's body. */
@@ -7,11 +7,11 @@ export function normalizeClientOptions(options) {
7
7
  const headers = mergeHeaders({
8
8
  "X-Fern-Language": "JavaScript",
9
9
  "X-Fern-SDK-Name": "@hedra/sdk",
10
- "X-Fern-SDK-Version": "2.0.2",
11
- "User-Agent": "@hedra/sdk/2.0.2",
10
+ "X-Fern-SDK-Version": "3.0.0",
11
+ "User-Agent": "@hedra/sdk/3.0.0",
12
12
  "X-Fern-Runtime": core.RUNTIME.type,
13
13
  "X-Fern-Runtime-Version": core.RUNTIME.version,
14
- "X-Hedra-Spec-Version": (_a = options === null || options === void 0 ? void 0 : options.specVersion) !== null && _a !== void 0 ? _a : "3.3.0",
14
+ "X-Hedra-Spec-Version": (_a = options === null || options === void 0 ? void 0 : options.specVersion) !== null && _a !== void 0 ? _a : "3.9.0",
15
15
  }, options === null || options === void 0 ? void 0 : options.headers);
16
16
  return Object.assign(Object.assign({}, options), { logging: core.logging.createLogger(options === null || options === void 0 ? void 0 : options.logging), headers });
17
17
  }
@@ -44,7 +44,7 @@ export class BillingClient {
44
44
  return __awaiter(this, void 0, void 0, function* () {
45
45
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
46
46
  const _authRequest = yield this._options.authProvider.getAuthRequest();
47
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "X-Hedra-Spec-Version": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.specVersion) !== null && _b !== void 0 ? _b : "3.3.0" }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
47
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "X-Hedra-Spec-Version": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.specVersion) !== null && _b !== void 0 ? _b : "3.9.0" }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
48
48
  const _response = yield core.fetcher({
49
49
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.HedraEnvironment.Production, "balance"),
50
50
  method: "GET",
@@ -113,7 +113,7 @@ export class BillingClient {
113
113
  group_by: groupBy != null ? groupBy : undefined,
114
114
  };
115
115
  const _authRequest = yield this._options.authProvider.getAuthRequest();
116
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "X-Hedra-Spec-Version": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.specVersion) !== null && _b !== void 0 ? _b : "3.3.0" }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
116
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "X-Hedra-Spec-Version": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.specVersion) !== null && _b !== void 0 ? _b : "3.9.0" }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
117
117
  const _response = yield core.fetcher({
118
118
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.HedraEnvironment.Production, "usage"),
119
119
  method: "GET",
@@ -54,7 +54,7 @@ export class FilesClient {
54
54
  yield _body.appendFile("file", request.file);
55
55
  const _maybeEncodedRequest = yield _body.getRequest();
56
56
  const _authRequest = yield this._options.authProvider.getAuthRequest();
57
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({ "X-Hedra-Spec-Version": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.specVersion) !== null && _b !== void 0 ? _b : "3.3.0" }, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
57
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({ "X-Hedra-Spec-Version": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.specVersion) !== null && _b !== void 0 ? _b : "3.9.0" }, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
58
58
  const _response = yield core.fetcher({
59
59
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.HedraEnvironment.Production, "files"),
60
60
  method: "POST",
@@ -1165,7 +1165,6 @@ export declare class JobsClient {
1165
1165
  * @example
1166
1166
  * await client.jobs.submitKlingO3({
1167
1167
  * input: {
1168
- * prompt: "prompt",
1169
1168
  * aspect_ratio: "16:9",
1170
1169
  * duration_ms: 1,
1171
1170
  * quality: "standard"
@@ -1262,7 +1261,6 @@ export declare class JobsClient {
1262
1261
  * @example
1263
1262
  * await client.jobs.submitKlingV3({
1264
1263
  * input: {
1265
- * prompt: "prompt",
1266
1264
  * aspect_ratio: "16:9",
1267
1265
  * duration_ms: 1,
1268
1266
  * quality: "standard"
@@ -2204,6 +2202,37 @@ export declare class JobsClient {
2204
2202
  */
2205
2203
  submitVeedFabric10(request: Hedra.SubmitBodyVeedFabric10, requestOptions?: JobsClient.RequestOptions): core.HttpResponsePromise<Hedra.SubmitResponse>;
2206
2204
  private __submitVeedFabric10;
2205
+ /**
2206
+ * Remove a video's background and return transparent WebM.
2207
+ *
2208
+ * Submits an asynchronous job and returns `202` with a job id. Fetch the result at `GET /v3/jobs/{job_id}` — each item in its `outputs[]` follows the `OutputItem` schema — or track progress via `GET /v3/jobs/{job_id}/status` / the SSE stream at `GET /v3/jobs/{job_id}/stream`.
2209
+ *
2210
+ * @param {Hedra.SubmitBodyVeedVideoBackgroundRemoval} request
2211
+ * @param {JobsClient.RequestOptions} requestOptions - Request-specific configuration.
2212
+ *
2213
+ * @throws {@link Hedra.BadRequestError}
2214
+ * @throws {@link Hedra.UnauthorizedError}
2215
+ * @throws {@link Hedra.PaymentRequiredError}
2216
+ * @throws {@link Hedra.ForbiddenError}
2217
+ * @throws {@link Hedra.NotFoundError}
2218
+ * @throws {@link Hedra.UnprocessableEntityError}
2219
+ * @throws {@link Hedra.TooManyRequestsError}
2220
+ * @throws {@link Hedra.InternalServerError}
2221
+ * @throws {@link errors.HedraError}
2222
+ * @throws {@link errors.HedraTimeoutError}
2223
+ *
2224
+ * @example
2225
+ * await client.jobs.submitVeedVideoBackgroundRemoval({
2226
+ * input: {
2227
+ * source_video: {
2228
+ * source: "url",
2229
+ * url: "url"
2230
+ * }
2231
+ * }
2232
+ * })
2233
+ */
2234
+ submitVeedVideoBackgroundRemoval(request: Hedra.SubmitBodyVeedVideoBackgroundRemoval, requestOptions?: JobsClient.RequestOptions): core.HttpResponsePromise<Hedra.SubmitResponse>;
2235
+ private __submitVeedVideoBackgroundRemoval;
2207
2236
  /**
2208
2237
  * The current state of the art in video generation
2209
2238
  *