@hedra/sdk 5.0.0 → 5.2.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/README.md +196 -49
- package/dist/cjs/BaseClient.d.ts +2 -2
- package/dist/cjs/BaseClient.js +3 -3
- package/dist/cjs/api/resources/billing/client/Client.js +3 -3
- package/dist/cjs/api/resources/files/client/Client.js +1 -1
- package/dist/cjs/api/resources/jobs/client/Client.d.ts +73 -0
- package/dist/cjs/api/resources/jobs/client/Client.js +274 -97
- package/dist/cjs/api/resources/jobs/client/requests/SubmitBodyCreatifyAurora.d.ts +24 -0
- package/dist/cjs/api/resources/jobs/client/requests/SubmitBodyCreatifyAurora.js +3 -0
- package/dist/cjs/api/resources/jobs/client/requests/SubmitBodyHeygenPhotoAvatar4.d.ts +25 -0
- package/dist/cjs/api/resources/jobs/client/requests/SubmitBodyHeygenPhotoAvatar4.js +3 -0
- package/dist/cjs/api/resources/jobs/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/keys/client/Client.js +4 -4
- package/dist/cjs/api/resources/logDrains/client/Client.js +6 -6
- package/dist/cjs/api/resources/models/client/Client.js +7 -7
- package/dist/cjs/api/resources/tokens/client/Client.js +1 -1
- package/dist/cjs/api/resources/webhooks/client/Client.js +7 -7
- package/dist/cjs/api/types/InputCreatifyAurora.d.ts +24 -0
- package/dist/cjs/api/types/InputCreatifyAurora.js +12 -0
- package/dist/cjs/api/types/InputCreatifyAuroraAudio.d.ts +23 -0
- package/dist/cjs/api/types/InputCreatifyAuroraAudio.js +3 -0
- package/dist/cjs/api/types/InputCreatifyAuroraStartImage.d.ts +23 -0
- package/dist/cjs/api/types/InputCreatifyAuroraStartImage.js +3 -0
- package/dist/cjs/api/types/InputGptImage2.d.ts +1 -1
- package/dist/cjs/api/types/InputHeygenPhotoAvatar4.d.ts +39 -0
- package/dist/cjs/api/types/InputHeygenPhotoAvatar4.js +24 -0
- package/dist/cjs/api/types/InputHeygenPhotoAvatar4Audio.d.ts +23 -0
- package/dist/cjs/api/types/InputHeygenPhotoAvatar4Audio.js +3 -0
- package/dist/cjs/api/types/InputHeygenPhotoAvatar4StartImage.d.ts +23 -0
- package/dist/cjs/api/types/InputHeygenPhotoAvatar4StartImage.js +3 -0
- package/dist/cjs/api/types/index.d.ts +6 -0
- package/dist/cjs/api/types/index.js +6 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.d.mts +2 -2
- package/dist/esm/BaseClient.mjs +3 -3
- package/dist/esm/api/resources/billing/client/Client.mjs +3 -3
- package/dist/esm/api/resources/files/client/Client.mjs +1 -1
- package/dist/esm/api/resources/jobs/client/Client.d.mts +73 -0
- package/dist/esm/api/resources/jobs/client/Client.mjs +274 -97
- package/dist/esm/api/resources/jobs/client/requests/SubmitBodyCreatifyAurora.d.mts +24 -0
- package/dist/esm/api/resources/jobs/client/requests/SubmitBodyCreatifyAurora.mjs +2 -0
- package/dist/esm/api/resources/jobs/client/requests/SubmitBodyHeygenPhotoAvatar4.d.mts +25 -0
- package/dist/esm/api/resources/jobs/client/requests/SubmitBodyHeygenPhotoAvatar4.mjs +2 -0
- package/dist/esm/api/resources/jobs/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/keys/client/Client.mjs +4 -4
- package/dist/esm/api/resources/logDrains/client/Client.mjs +6 -6
- package/dist/esm/api/resources/models/client/Client.mjs +7 -7
- package/dist/esm/api/resources/tokens/client/Client.mjs +1 -1
- package/dist/esm/api/resources/webhooks/client/Client.mjs +7 -7
- package/dist/esm/api/types/InputCreatifyAurora.d.mts +24 -0
- package/dist/esm/api/types/InputCreatifyAurora.mjs +9 -0
- package/dist/esm/api/types/InputCreatifyAuroraAudio.d.mts +23 -0
- package/dist/esm/api/types/InputCreatifyAuroraAudio.mjs +2 -0
- package/dist/esm/api/types/InputCreatifyAuroraStartImage.d.mts +23 -0
- package/dist/esm/api/types/InputCreatifyAuroraStartImage.mjs +2 -0
- package/dist/esm/api/types/InputGptImage2.d.mts +1 -1
- package/dist/esm/api/types/InputHeygenPhotoAvatar4.d.mts +39 -0
- package/dist/esm/api/types/InputHeygenPhotoAvatar4.mjs +21 -0
- package/dist/esm/api/types/InputHeygenPhotoAvatar4Audio.d.mts +23 -0
- package/dist/esm/api/types/InputHeygenPhotoAvatar4Audio.mjs +2 -0
- package/dist/esm/api/types/InputHeygenPhotoAvatar4StartImage.d.mts +23 -0
- package/dist/esm/api/types/InputHeygenPhotoAvatar4StartImage.mjs +2 -0
- package/dist/esm/api/types/index.d.mts +6 -0
- package/dist/esm/api/types/index.mjs +6 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
- package/reference.md +155 -0
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "5.
|
|
1
|
+
export declare const SDK_VERSION = "5.2.0";
|
package/dist/cjs/version.js
CHANGED
|
@@ -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.16.
|
|
10
|
+
specVersion?: "3.16.2";
|
|
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.16.
|
|
37
|
+
specVersion?: "3.16.2";
|
|
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. */
|
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -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": "5.
|
|
11
|
-
"User-Agent": "hedra-node/5.
|
|
10
|
+
"X-Fern-SDK-Version": "5.2.0",
|
|
11
|
+
"User-Agent": "hedra-node/5.2.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.16.
|
|
14
|
+
"X-Hedra-Spec-Version": (_a = options === null || options === void 0 ? void 0 : options.specVersion) !== null && _a !== void 0 ? _a : "3.16.2",
|
|
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.16.
|
|
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.16.2" }), 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.16.
|
|
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.16.2" }), 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",
|
|
@@ -189,7 +189,7 @@ export class BillingClient {
|
|
|
189
189
|
cursor,
|
|
190
190
|
};
|
|
191
191
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
192
|
-
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.16.
|
|
192
|
+
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.16.2" }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
193
193
|
const _response = yield core.fetcher({
|
|
194
194
|
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, "transactions"),
|
|
195
195
|
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.16.
|
|
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.16.2" }, _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",
|
|
@@ -88,6 +88,42 @@ export declare class JobsClient {
|
|
|
88
88
|
listJobLogs(job_id: string, request?: Hedra.JobsListJobLogsRequest, requestOptions?: JobsClient.RequestOptions): Promise<core.Page<Hedra.JobLogItem, Hedra.JobLogListResponse>>;
|
|
89
89
|
stream(job_id: string, request?: Hedra.JobsStreamRequest, requestOptions?: JobsClient.RequestOptions): core.HttpResponsePromise<core.Stream<Hedra.JobsStreamResponse>>;
|
|
90
90
|
private __stream;
|
|
91
|
+
/**
|
|
92
|
+
* Create high-fidelity speaking or singing avatar videos.
|
|
93
|
+
*
|
|
94
|
+
* 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`.
|
|
95
|
+
*
|
|
96
|
+
* @param {Hedra.SubmitBodyCreatifyAurora} request
|
|
97
|
+
* @param {JobsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
98
|
+
*
|
|
99
|
+
* @throws {@link Hedra.BadRequestError}
|
|
100
|
+
* @throws {@link Hedra.UnauthorizedError}
|
|
101
|
+
* @throws {@link Hedra.PaymentRequiredError}
|
|
102
|
+
* @throws {@link Hedra.ForbiddenError}
|
|
103
|
+
* @throws {@link Hedra.NotFoundError}
|
|
104
|
+
* @throws {@link Hedra.UnprocessableEntityError}
|
|
105
|
+
* @throws {@link Hedra.TooManyRequestsError}
|
|
106
|
+
* @throws {@link Hedra.InternalServerError}
|
|
107
|
+
* @throws {@link errors.HedraError}
|
|
108
|
+
* @throws {@link errors.HedraTimeoutError}
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* await client.jobs.submitCreatifyAurora({
|
|
112
|
+
* input: {
|
|
113
|
+
* resolution: "480p",
|
|
114
|
+
* start_image: {
|
|
115
|
+
* source: "url",
|
|
116
|
+
* url: "url"
|
|
117
|
+
* },
|
|
118
|
+
* audio: {
|
|
119
|
+
* source: "url",
|
|
120
|
+
* url: "url"
|
|
121
|
+
* }
|
|
122
|
+
* }
|
|
123
|
+
* })
|
|
124
|
+
*/
|
|
125
|
+
submitCreatifyAurora(request: Hedra.SubmitBodyCreatifyAurora, requestOptions?: JobsClient.RequestOptions): core.HttpResponsePromise<Hedra.SubmitResponse>;
|
|
126
|
+
private __submitCreatifyAurora;
|
|
91
127
|
/**
|
|
92
128
|
* Polished, print-ready stills when the brief is a finished image rather than a sketch.
|
|
93
129
|
*
|
|
@@ -991,6 +1027,43 @@ export declare class JobsClient {
|
|
|
991
1027
|
*/
|
|
992
1028
|
submitHedraCharacter3(request: Hedra.SubmitBodyHedraCharacter3, requestOptions?: JobsClient.RequestOptions): core.HttpResponsePromise<Hedra.SubmitResponse>;
|
|
993
1029
|
private __submitHedraCharacter3;
|
|
1030
|
+
/**
|
|
1031
|
+
* Turn a clear portrait and driving audio into a talking avatar.
|
|
1032
|
+
*
|
|
1033
|
+
* 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`.
|
|
1034
|
+
*
|
|
1035
|
+
* @param {Hedra.SubmitBodyHeygenPhotoAvatar4} request
|
|
1036
|
+
* @param {JobsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1037
|
+
*
|
|
1038
|
+
* @throws {@link Hedra.BadRequestError}
|
|
1039
|
+
* @throws {@link Hedra.UnauthorizedError}
|
|
1040
|
+
* @throws {@link Hedra.PaymentRequiredError}
|
|
1041
|
+
* @throws {@link Hedra.ForbiddenError}
|
|
1042
|
+
* @throws {@link Hedra.NotFoundError}
|
|
1043
|
+
* @throws {@link Hedra.UnprocessableEntityError}
|
|
1044
|
+
* @throws {@link Hedra.TooManyRequestsError}
|
|
1045
|
+
* @throws {@link Hedra.InternalServerError}
|
|
1046
|
+
* @throws {@link errors.HedraError}
|
|
1047
|
+
* @throws {@link errors.HedraTimeoutError}
|
|
1048
|
+
*
|
|
1049
|
+
* @example
|
|
1050
|
+
* await client.jobs.submitHeygenPhotoAvatar4({
|
|
1051
|
+
* input: {
|
|
1052
|
+
* aspect_ratio: "16:9",
|
|
1053
|
+
* resolution: "360p",
|
|
1054
|
+
* start_image: {
|
|
1055
|
+
* source: "url",
|
|
1056
|
+
* url: "url"
|
|
1057
|
+
* },
|
|
1058
|
+
* audio: {
|
|
1059
|
+
* source: "url",
|
|
1060
|
+
* url: "url"
|
|
1061
|
+
* }
|
|
1062
|
+
* }
|
|
1063
|
+
* })
|
|
1064
|
+
*/
|
|
1065
|
+
submitHeygenPhotoAvatar4(request: Hedra.SubmitBodyHeygenPhotoAvatar4, requestOptions?: JobsClient.RequestOptions): core.HttpResponsePromise<Hedra.SubmitResponse>;
|
|
1066
|
+
private __submitHeygenPhotoAvatar4;
|
|
994
1067
|
/**
|
|
995
1068
|
* HiDream.ai's open-weights HiDream-O1-Image (8B): one pixel-native model that generates, edits, and personalizes without a VAE or a separate text encoder.
|
|
996
1069
|
*
|