@sync.so/sdk 0.1.6
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/Client.d.ts +31 -0
- package/Client.js +17 -0
- package/README.md +183 -0
- package/api/index.d.ts +1 -0
- package/api/index.js +17 -0
- package/api/resources/common/errors/BadRequestError.d.ts +9 -0
- package/api/resources/common/errors/BadRequestError.js +52 -0
- package/api/resources/common/errors/InternalServerError.d.ts +9 -0
- package/api/resources/common/errors/InternalServerError.js +52 -0
- package/api/resources/common/errors/NotFoundError.d.ts +9 -0
- package/api/resources/common/errors/NotFoundError.js +52 -0
- package/api/resources/common/errors/UnauthorizedError.d.ts +9 -0
- package/api/resources/common/errors/UnauthorizedError.js +52 -0
- package/api/resources/common/errors/index.d.ts +4 -0
- package/api/resources/common/errors/index.js +20 -0
- package/api/resources/common/index.d.ts +2 -0
- package/api/resources/common/index.js +18 -0
- package/api/resources/common/types/Audio.d.ts +11 -0
- package/api/resources/common/types/Audio.js +5 -0
- package/api/resources/common/types/CreateGenerationDto.d.ts +14 -0
- package/api/resources/common/types/CreateGenerationDto.js +5 -0
- package/api/resources/common/types/ElevenLabs.d.ts +10 -0
- package/api/resources/common/types/ElevenLabs.js +5 -0
- package/api/resources/common/types/EstimatedGenerationCost.d.ts +9 -0
- package/api/resources/common/types/EstimatedGenerationCost.js +5 -0
- package/api/resources/common/types/Generation.d.ts +25 -0
- package/api/resources/common/types/Generation.js +5 -0
- package/api/resources/common/types/GenerationError.d.ts +12 -0
- package/api/resources/common/types/GenerationError.js +5 -0
- package/api/resources/common/types/GenerationErrorMessage.d.ts +7 -0
- package/api/resources/common/types/GenerationErrorMessage.js +5 -0
- package/api/resources/common/types/GenerationId.d.ts +7 -0
- package/api/resources/common/types/GenerationId.js +5 -0
- package/api/resources/common/types/GenerationOptions.d.ts +22 -0
- package/api/resources/common/types/GenerationOptions.js +5 -0
- package/api/resources/common/types/GenerationStatus.d.ts +13 -0
- package/api/resources/common/types/GenerationStatus.js +12 -0
- package/api/resources/common/types/Input.d.ts +8 -0
- package/api/resources/common/types/Input.js +5 -0
- package/api/resources/common/types/Model.d.ts +14 -0
- package/api/resources/common/types/Model.js +13 -0
- package/api/resources/common/types/SegmentFrames.d.ts +7 -0
- package/api/resources/common/types/SegmentFrames.js +5 -0
- package/api/resources/common/types/SegmentSecs.d.ts +7 -0
- package/api/resources/common/types/SegmentSecs.js +5 -0
- package/api/resources/common/types/SyncMode.d.ts +11 -0
- package/api/resources/common/types/SyncMode.js +13 -0
- package/api/resources/common/types/Tts.d.ts +12 -0
- package/api/resources/common/types/Tts.js +5 -0
- package/api/resources/common/types/TtsProviderConfig.d.ts +5 -0
- package/api/resources/common/types/TtsProviderConfig.js +5 -0
- package/api/resources/common/types/Video.d.ts +13 -0
- package/api/resources/common/types/Video.js +5 -0
- package/api/resources/common/types/index.d.ts +18 -0
- package/api/resources/common/types/index.js +34 -0
- package/api/resources/generate/client/Client.d.ts +106 -0
- package/api/resources/generate/client/Client.js +346 -0
- package/api/resources/generate/client/index.d.ts +1 -0
- package/api/resources/generate/client/index.js +17 -0
- package/api/resources/generate/client/requests/LipsyncListGenerationsRequest.d.ts +14 -0
- package/api/resources/generate/client/requests/LipsyncListGenerationsRequest.js +5 -0
- package/api/resources/generate/client/requests/index.d.ts +1 -0
- package/api/resources/generate/client/requests/index.js +2 -0
- package/api/resources/generate/index.d.ts +1 -0
- package/api/resources/generate/index.js +17 -0
- package/api/resources/index.d.ts +7 -0
- package/api/resources/index.js +46 -0
- package/api/resources/webhooks/index.d.ts +1 -0
- package/api/resources/webhooks/index.js +17 -0
- package/api/resources/webhooks/types/GenerationNotification.d.ts +24 -0
- package/api/resources/webhooks/types/GenerationNotification.js +5 -0
- package/api/resources/webhooks/types/WebhookStatus.d.ts +11 -0
- package/api/resources/webhooks/types/WebhookStatus.js +10 -0
- package/api/resources/webhooks/types/index.d.ts +2 -0
- package/api/resources/webhooks/types/index.js +18 -0
- package/core/fetcher/APIResponse.d.ts +20 -0
- package/core/fetcher/APIResponse.js +2 -0
- package/core/fetcher/Fetcher.d.ts +39 -0
- package/core/fetcher/Fetcher.js +107 -0
- package/core/fetcher/Headers.d.ts +2 -0
- package/core/fetcher/Headers.js +84 -0
- package/core/fetcher/HttpResponsePromise.d.ts +58 -0
- package/core/fetcher/HttpResponsePromise.js +103 -0
- package/core/fetcher/RawResponse.d.ts +29 -0
- package/core/fetcher/RawResponse.js +44 -0
- package/core/fetcher/Supplier.d.ts +4 -0
- package/core/fetcher/Supplier.js +22 -0
- package/core/fetcher/createRequestUrl.d.ts +1 -0
- package/core/fetcher/createRequestUrl.js +12 -0
- package/core/fetcher/getFetchFn.d.ts +4 -0
- package/core/fetcher/getFetchFn.js +68 -0
- package/core/fetcher/getHeader.d.ts +1 -0
- package/core/fetcher/getHeader.js +11 -0
- package/core/fetcher/getRequestBody.d.ts +7 -0
- package/core/fetcher/getRequestBody.js +23 -0
- package/core/fetcher/getResponseBody.d.ts +1 -0
- package/core/fetcher/getResponseBody.js +54 -0
- package/core/fetcher/index.d.ts +8 -0
- package/core/fetcher/index.js +15 -0
- package/core/fetcher/makeRequest.d.ts +1 -0
- package/core/fetcher/makeRequest.js +42 -0
- package/core/fetcher/requestWithRetries.d.ts +1 -0
- package/core/fetcher/requestWithRetries.js +40 -0
- package/core/fetcher/signals.d.ts +11 -0
- package/core/fetcher/signals.js +36 -0
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +30 -0
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +247 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +21 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +126 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +229 -0
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.js +59 -0
- package/core/index.d.ts +2 -0
- package/core/index.js +18 -0
- package/core/json.d.ts +15 -0
- package/core/json.js +24 -0
- package/core/runtime/index.d.ts +1 -0
- package/core/runtime/index.js +5 -0
- package/core/runtime/runtime.d.ts +9 -0
- package/core/runtime/runtime.js +103 -0
- package/dist/Client.d.ts +31 -0
- package/dist/Client.js +17 -0
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.js +17 -0
- package/dist/api/resources/common/errors/BadRequestError.d.ts +9 -0
- package/dist/api/resources/common/errors/BadRequestError.js +52 -0
- package/dist/api/resources/common/errors/InternalServerError.d.ts +9 -0
- package/dist/api/resources/common/errors/InternalServerError.js +52 -0
- package/dist/api/resources/common/errors/NotFoundError.d.ts +9 -0
- package/dist/api/resources/common/errors/NotFoundError.js +52 -0
- package/dist/api/resources/common/errors/UnauthorizedError.d.ts +9 -0
- package/dist/api/resources/common/errors/UnauthorizedError.js +52 -0
- package/dist/api/resources/common/errors/index.d.ts +4 -0
- package/dist/api/resources/common/errors/index.js +20 -0
- package/dist/api/resources/common/index.d.ts +2 -0
- package/dist/api/resources/common/index.js +18 -0
- package/dist/api/resources/common/types/Audio.d.ts +11 -0
- package/dist/api/resources/common/types/Audio.js +5 -0
- package/dist/api/resources/common/types/CreateGenerationDto.d.ts +14 -0
- package/dist/api/resources/common/types/CreateGenerationDto.js +5 -0
- package/dist/api/resources/common/types/ElevenLabs.d.ts +10 -0
- package/dist/api/resources/common/types/ElevenLabs.js +5 -0
- package/dist/api/resources/common/types/EstimatedGenerationCost.d.ts +9 -0
- package/dist/api/resources/common/types/EstimatedGenerationCost.js +5 -0
- package/dist/api/resources/common/types/Generation.d.ts +25 -0
- package/dist/api/resources/common/types/Generation.js +5 -0
- package/dist/api/resources/common/types/GenerationError.d.ts +12 -0
- package/dist/api/resources/common/types/GenerationError.js +5 -0
- package/dist/api/resources/common/types/GenerationErrorMessage.d.ts +7 -0
- package/dist/api/resources/common/types/GenerationErrorMessage.js +5 -0
- package/dist/api/resources/common/types/GenerationId.d.ts +7 -0
- package/dist/api/resources/common/types/GenerationId.js +5 -0
- package/dist/api/resources/common/types/GenerationOptions.d.ts +22 -0
- package/dist/api/resources/common/types/GenerationOptions.js +5 -0
- package/dist/api/resources/common/types/GenerationStatus.d.ts +13 -0
- package/dist/api/resources/common/types/GenerationStatus.js +12 -0
- package/dist/api/resources/common/types/Input.d.ts +8 -0
- package/dist/api/resources/common/types/Input.js +5 -0
- package/dist/api/resources/common/types/Model.d.ts +14 -0
- package/dist/api/resources/common/types/Model.js +13 -0
- package/dist/api/resources/common/types/SegmentFrames.d.ts +7 -0
- package/dist/api/resources/common/types/SegmentFrames.js +5 -0
- package/dist/api/resources/common/types/SegmentSecs.d.ts +7 -0
- package/dist/api/resources/common/types/SegmentSecs.js +5 -0
- package/dist/api/resources/common/types/SyncMode.d.ts +11 -0
- package/dist/api/resources/common/types/SyncMode.js +13 -0
- package/dist/api/resources/common/types/Tts.d.ts +12 -0
- package/dist/api/resources/common/types/Tts.js +5 -0
- package/dist/api/resources/common/types/TtsProviderConfig.d.ts +5 -0
- package/dist/api/resources/common/types/TtsProviderConfig.js +5 -0
- package/dist/api/resources/common/types/Video.d.ts +13 -0
- package/dist/api/resources/common/types/Video.js +5 -0
- package/dist/api/resources/common/types/index.d.ts +18 -0
- package/dist/api/resources/common/types/index.js +34 -0
- package/dist/api/resources/generate/client/Client.d.ts +106 -0
- package/dist/api/resources/generate/client/Client.js +346 -0
- package/dist/api/resources/generate/client/index.d.ts +1 -0
- package/dist/api/resources/generate/client/index.js +17 -0
- package/dist/api/resources/generate/client/requests/LipsyncListGenerationsRequest.d.ts +14 -0
- package/dist/api/resources/generate/client/requests/LipsyncListGenerationsRequest.js +5 -0
- package/dist/api/resources/generate/client/requests/index.d.ts +1 -0
- package/dist/api/resources/generate/client/requests/index.js +2 -0
- package/dist/api/resources/generate/index.d.ts +1 -0
- package/dist/api/resources/generate/index.js +17 -0
- package/dist/api/resources/index.d.ts +7 -0
- package/dist/api/resources/index.js +46 -0
- package/dist/api/resources/webhooks/index.d.ts +1 -0
- package/dist/api/resources/webhooks/index.js +17 -0
- package/dist/api/resources/webhooks/types/GenerationNotification.d.ts +24 -0
- package/dist/api/resources/webhooks/types/GenerationNotification.js +5 -0
- package/dist/api/resources/webhooks/types/WebhookStatus.d.ts +11 -0
- package/dist/api/resources/webhooks/types/WebhookStatus.js +10 -0
- package/dist/api/resources/webhooks/types/index.d.ts +2 -0
- package/dist/api/resources/webhooks/types/index.js +18 -0
- package/dist/core/fetcher/APIResponse.d.ts +20 -0
- package/dist/core/fetcher/APIResponse.js +2 -0
- package/dist/core/fetcher/Fetcher.d.ts +39 -0
- package/dist/core/fetcher/Fetcher.js +107 -0
- package/dist/core/fetcher/Headers.d.ts +2 -0
- package/dist/core/fetcher/Headers.js +84 -0
- package/dist/core/fetcher/HttpResponsePromise.d.ts +58 -0
- package/dist/core/fetcher/HttpResponsePromise.js +103 -0
- package/dist/core/fetcher/RawResponse.d.ts +29 -0
- package/dist/core/fetcher/RawResponse.js +44 -0
- package/dist/core/fetcher/Supplier.d.ts +4 -0
- package/dist/core/fetcher/Supplier.js +22 -0
- package/dist/core/fetcher/createRequestUrl.d.ts +1 -0
- package/dist/core/fetcher/createRequestUrl.js +12 -0
- package/dist/core/fetcher/getFetchFn.d.ts +4 -0
- package/dist/core/fetcher/getFetchFn.js +68 -0
- package/dist/core/fetcher/getHeader.d.ts +1 -0
- package/dist/core/fetcher/getHeader.js +11 -0
- package/dist/core/fetcher/getRequestBody.d.ts +7 -0
- package/dist/core/fetcher/getRequestBody.js +23 -0
- package/dist/core/fetcher/getResponseBody.d.ts +1 -0
- package/dist/core/fetcher/getResponseBody.js +54 -0
- package/dist/core/fetcher/index.d.ts +8 -0
- package/dist/core/fetcher/index.js +15 -0
- package/dist/core/fetcher/makeRequest.d.ts +1 -0
- package/dist/core/fetcher/makeRequest.js +42 -0
- package/dist/core/fetcher/requestWithRetries.d.ts +1 -0
- package/dist/core/fetcher/requestWithRetries.js +40 -0
- package/dist/core/fetcher/signals.d.ts +11 -0
- package/dist/core/fetcher/signals.js +36 -0
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +30 -0
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +247 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +21 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +126 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +229 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.js +59 -0
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +18 -0
- package/dist/core/json.d.ts +15 -0
- package/dist/core/json.js +24 -0
- package/dist/core/runtime/index.d.ts +1 -0
- package/dist/core/runtime/index.js +5 -0
- package/dist/core/runtime/runtime.d.ts +9 -0
- package/dist/core/runtime/runtime.js +103 -0
- package/dist/environments.d.ts +7 -0
- package/dist/environments.js +9 -0
- package/dist/errors/SyncError.d.ts +15 -0
- package/dist/errors/SyncError.js +30 -0
- package/dist/errors/SyncTimeoutError.d.ts +6 -0
- package/dist/errors/SyncTimeoutError.js +13 -0
- package/dist/errors/index.d.ts +2 -0
- package/dist/errors/index.js +7 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +44 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +4 -0
- package/environments.d.ts +7 -0
- package/environments.js +9 -0
- package/errors/SyncError.d.ts +15 -0
- package/errors/SyncError.js +30 -0
- package/errors/SyncTimeoutError.d.ts +6 -0
- package/errors/SyncTimeoutError.js +13 -0
- package/errors/index.d.ts +2 -0
- package/errors/index.js +7 -0
- package/index.d.ts +4 -0
- package/index.js +44 -0
- package/jest.config.mjs +8 -0
- package/package.json +43 -0
- package/reference.md +225 -0
- package/scripts/rename-to-esm-files.js +115 -0
- package/version.d.ts +1 -0
- package/version.js +4 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./GenerationId"), exports);
|
|
18
|
+
__exportStar(require("./CreateGenerationDto"), exports);
|
|
19
|
+
__exportStar(require("./Input"), exports);
|
|
20
|
+
__exportStar(require("./Model"), exports);
|
|
21
|
+
__exportStar(require("./EstimatedGenerationCost"), exports);
|
|
22
|
+
__exportStar(require("./Generation"), exports);
|
|
23
|
+
__exportStar(require("./GenerationError"), exports);
|
|
24
|
+
__exportStar(require("./GenerationErrorMessage"), exports);
|
|
25
|
+
__exportStar(require("./GenerationOptions"), exports);
|
|
26
|
+
__exportStar(require("./SyncMode"), exports);
|
|
27
|
+
__exportStar(require("./GenerationStatus"), exports);
|
|
28
|
+
__exportStar(require("./TtsProviderConfig"), exports);
|
|
29
|
+
__exportStar(require("./ElevenLabs"), exports);
|
|
30
|
+
__exportStar(require("./Tts"), exports);
|
|
31
|
+
__exportStar(require("./Audio"), exports);
|
|
32
|
+
__exportStar(require("./Video"), exports);
|
|
33
|
+
__exportStar(require("./SegmentSecs"), exports);
|
|
34
|
+
__exportStar(require("./SegmentFrames"), exports);
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as environments from "../../../../environments";
|
|
5
|
+
import * as core from "../../../../core";
|
|
6
|
+
import * as Sync from "../../../index";
|
|
7
|
+
export declare namespace Generate {
|
|
8
|
+
interface Options {
|
|
9
|
+
environment?: core.Supplier<environments.SyncEnvironment | string>;
|
|
10
|
+
/** Specify a custom URL to connect the client to. */
|
|
11
|
+
baseUrl?: core.Supplier<string>;
|
|
12
|
+
apiKey: core.Supplier<string>;
|
|
13
|
+
fetcher?: core.FetchFunction;
|
|
14
|
+
}
|
|
15
|
+
interface RequestOptions {
|
|
16
|
+
/** The maximum time to wait for a response in seconds. */
|
|
17
|
+
timeoutInSeconds?: number;
|
|
18
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
19
|
+
maxRetries?: number;
|
|
20
|
+
/** A hook to abort the request. */
|
|
21
|
+
abortSignal?: AbortSignal;
|
|
22
|
+
/** Additional headers to include in the request. */
|
|
23
|
+
headers?: Record<string, string>;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export declare class Generate {
|
|
27
|
+
protected readonly _options: Generate.Options;
|
|
28
|
+
constructor(_options: Generate.Options);
|
|
29
|
+
/**
|
|
30
|
+
* @param {Sync.CreateGenerationDto} request
|
|
31
|
+
* @param {Generate.RequestOptions} requestOptions - Request-specific configuration.
|
|
32
|
+
*
|
|
33
|
+
* @throws {@link Sync.BadRequestError}
|
|
34
|
+
* @throws {@link Sync.UnauthorizedError}
|
|
35
|
+
* @throws {@link Sync.InternalServerError}
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* await client.generate.createGeneration({
|
|
39
|
+
* input: [{
|
|
40
|
+
* type: "video",
|
|
41
|
+
* url: "https://synchlabs-public.s3.us-west-2.amazonaws.com/david_demo_shortvid-03a10044-7741-4cfc-816a-5bccd392d1ee.mp4"
|
|
42
|
+
* }, {
|
|
43
|
+
* type: "audio",
|
|
44
|
+
* url: "https://synchlabs-public.s3.us-west-2.amazonaws.com/david_demo_shortaud-27623a4f-edab-4c6a-8383-871b18961a4a.wav"
|
|
45
|
+
* }],
|
|
46
|
+
* model: "lipsync-2",
|
|
47
|
+
* options: {
|
|
48
|
+
* sync_mode: "loop"
|
|
49
|
+
* }
|
|
50
|
+
* })
|
|
51
|
+
*/
|
|
52
|
+
createGeneration(request: Sync.CreateGenerationDto, requestOptions?: Generate.RequestOptions): core.HttpResponsePromise<Sync.Generation>;
|
|
53
|
+
private __createGeneration;
|
|
54
|
+
/**
|
|
55
|
+
* @param {Sync.GenerationId} id
|
|
56
|
+
* @param {Generate.RequestOptions} requestOptions - Request-specific configuration.
|
|
57
|
+
*
|
|
58
|
+
* @throws {@link Sync.UnauthorizedError}
|
|
59
|
+
* @throws {@link Sync.NotFoundError}
|
|
60
|
+
* @throws {@link Sync.InternalServerError}
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* await client.generate.getGeneration("6533643b-acbe-4c40-967e-d9ba9baac39e")
|
|
64
|
+
*/
|
|
65
|
+
getGeneration(id: Sync.GenerationId, requestOptions?: Generate.RequestOptions): core.HttpResponsePromise<Sync.Generation>;
|
|
66
|
+
private __getGeneration;
|
|
67
|
+
/**
|
|
68
|
+
* @param {Sync.LipsyncListGenerationsRequest} request
|
|
69
|
+
* @param {Generate.RequestOptions} requestOptions - Request-specific configuration.
|
|
70
|
+
*
|
|
71
|
+
* @throws {@link Sync.UnauthorizedError}
|
|
72
|
+
* @throws {@link Sync.InternalServerError}
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* await client.generate.listGenerations()
|
|
76
|
+
*/
|
|
77
|
+
listGenerations(request?: Sync.LipsyncListGenerationsRequest, requestOptions?: Generate.RequestOptions): core.HttpResponsePromise<Sync.Generation[]>;
|
|
78
|
+
private __listGenerations;
|
|
79
|
+
/**
|
|
80
|
+
* @param {Sync.CreateGenerationDto} request
|
|
81
|
+
* @param {Generate.RequestOptions} requestOptions - Request-specific configuration.
|
|
82
|
+
*
|
|
83
|
+
* @throws {@link Sync.UnauthorizedError}
|
|
84
|
+
* @throws {@link Sync.InternalServerError}
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* await client.generate.estimateCost({
|
|
88
|
+
* input: [{
|
|
89
|
+
* type: "video",
|
|
90
|
+
* url: "https://synchlabs-public.s3.us-west-2.amazonaws.com/david_demo_shortvid-03a10044-7741-4cfc-816a-5bccd392d1ee.mp4"
|
|
91
|
+
* }, {
|
|
92
|
+
* type: "audio",
|
|
93
|
+
* url: "https://synchlabs-public.s3.us-west-2.amazonaws.com/david_demo_shortaud-27623a4f-edab-4c6a-8383-871b18961a4a.wav"
|
|
94
|
+
* }],
|
|
95
|
+
* model: "lipsync-2",
|
|
96
|
+
* options: {
|
|
97
|
+
* sync_mode: "loop"
|
|
98
|
+
* }
|
|
99
|
+
* })
|
|
100
|
+
*/
|
|
101
|
+
estimateCost(request: Sync.CreateGenerationDto, requestOptions?: Generate.RequestOptions): core.HttpResponsePromise<Sync.EstimatedGenerationCost[]>;
|
|
102
|
+
private __estimateCost;
|
|
103
|
+
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
104
|
+
"x-api-key": string;
|
|
105
|
+
}>;
|
|
106
|
+
}
|
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
39
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
40
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
41
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
42
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
43
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
44
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
48
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
49
|
+
};
|
|
50
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
|
+
exports.Generate = void 0;
|
|
52
|
+
const environments = __importStar(require("../../../../environments"));
|
|
53
|
+
const core = __importStar(require("../../../../core"));
|
|
54
|
+
const Sync = __importStar(require("../../../index"));
|
|
55
|
+
const url_join_1 = __importDefault(require("url-join"));
|
|
56
|
+
const errors = __importStar(require("../../../../errors/index"));
|
|
57
|
+
class Generate {
|
|
58
|
+
constructor(_options) {
|
|
59
|
+
this._options = _options;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* @param {Sync.CreateGenerationDto} request
|
|
63
|
+
* @param {Generate.RequestOptions} requestOptions - Request-specific configuration.
|
|
64
|
+
*
|
|
65
|
+
* @throws {@link Sync.BadRequestError}
|
|
66
|
+
* @throws {@link Sync.UnauthorizedError}
|
|
67
|
+
* @throws {@link Sync.InternalServerError}
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* await client.generate.createGeneration({
|
|
71
|
+
* input: [{
|
|
72
|
+
* type: "video",
|
|
73
|
+
* url: "https://synchlabs-public.s3.us-west-2.amazonaws.com/david_demo_shortvid-03a10044-7741-4cfc-816a-5bccd392d1ee.mp4"
|
|
74
|
+
* }, {
|
|
75
|
+
* type: "audio",
|
|
76
|
+
* url: "https://synchlabs-public.s3.us-west-2.amazonaws.com/david_demo_shortaud-27623a4f-edab-4c6a-8383-871b18961a4a.wav"
|
|
77
|
+
* }],
|
|
78
|
+
* model: "lipsync-2",
|
|
79
|
+
* options: {
|
|
80
|
+
* sync_mode: "loop"
|
|
81
|
+
* }
|
|
82
|
+
* })
|
|
83
|
+
*/
|
|
84
|
+
createGeneration(request, requestOptions) {
|
|
85
|
+
return core.HttpResponsePromise.fromPromise(this.__createGeneration(request, requestOptions));
|
|
86
|
+
}
|
|
87
|
+
__createGeneration(request, requestOptions) {
|
|
88
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
89
|
+
var _a, _b, _c;
|
|
90
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
91
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SyncEnvironment.Default, "/v2/generate"),
|
|
92
|
+
method: "POST",
|
|
93
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.1.6", "User-Agent": "@sync.so/sdk/0.1.6", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
94
|
+
contentType: "application/json",
|
|
95
|
+
requestType: "json",
|
|
96
|
+
body: request,
|
|
97
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
98
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
99
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
100
|
+
});
|
|
101
|
+
if (_response.ok) {
|
|
102
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
103
|
+
}
|
|
104
|
+
if (_response.error.reason === "status-code") {
|
|
105
|
+
switch (_response.error.statusCode) {
|
|
106
|
+
case 400:
|
|
107
|
+
throw new Sync.BadRequestError(_response.error.body, _response.rawResponse);
|
|
108
|
+
case 401:
|
|
109
|
+
throw new Sync.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
110
|
+
case 500:
|
|
111
|
+
throw new Sync.InternalServerError(_response.error.body, _response.rawResponse);
|
|
112
|
+
default:
|
|
113
|
+
throw new errors.SyncError({
|
|
114
|
+
statusCode: _response.error.statusCode,
|
|
115
|
+
body: _response.error.body,
|
|
116
|
+
rawResponse: _response.rawResponse,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
switch (_response.error.reason) {
|
|
121
|
+
case "non-json":
|
|
122
|
+
throw new errors.SyncError({
|
|
123
|
+
statusCode: _response.error.statusCode,
|
|
124
|
+
body: _response.error.rawBody,
|
|
125
|
+
rawResponse: _response.rawResponse,
|
|
126
|
+
});
|
|
127
|
+
case "timeout":
|
|
128
|
+
throw new errors.SyncTimeoutError("Timeout exceeded when calling POST /v2/generate.");
|
|
129
|
+
case "unknown":
|
|
130
|
+
throw new errors.SyncError({
|
|
131
|
+
message: _response.error.errorMessage,
|
|
132
|
+
rawResponse: _response.rawResponse,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* @param {Sync.GenerationId} id
|
|
139
|
+
* @param {Generate.RequestOptions} requestOptions - Request-specific configuration.
|
|
140
|
+
*
|
|
141
|
+
* @throws {@link Sync.UnauthorizedError}
|
|
142
|
+
* @throws {@link Sync.NotFoundError}
|
|
143
|
+
* @throws {@link Sync.InternalServerError}
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* await client.generate.getGeneration("6533643b-acbe-4c40-967e-d9ba9baac39e")
|
|
147
|
+
*/
|
|
148
|
+
getGeneration(id, requestOptions) {
|
|
149
|
+
return core.HttpResponsePromise.fromPromise(this.__getGeneration(id, requestOptions));
|
|
150
|
+
}
|
|
151
|
+
__getGeneration(id, requestOptions) {
|
|
152
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
153
|
+
var _a, _b, _c;
|
|
154
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
155
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SyncEnvironment.Default, `/v2/generate/${encodeURIComponent(id)}`),
|
|
156
|
+
method: "GET",
|
|
157
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.1.6", "User-Agent": "@sync.so/sdk/0.1.6", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
158
|
+
contentType: "application/json",
|
|
159
|
+
requestType: "json",
|
|
160
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
161
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
162
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
163
|
+
});
|
|
164
|
+
if (_response.ok) {
|
|
165
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
166
|
+
}
|
|
167
|
+
if (_response.error.reason === "status-code") {
|
|
168
|
+
switch (_response.error.statusCode) {
|
|
169
|
+
case 401:
|
|
170
|
+
throw new Sync.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
171
|
+
case 404:
|
|
172
|
+
throw new Sync.NotFoundError(_response.error.body, _response.rawResponse);
|
|
173
|
+
case 500:
|
|
174
|
+
throw new Sync.InternalServerError(_response.error.body, _response.rawResponse);
|
|
175
|
+
default:
|
|
176
|
+
throw new errors.SyncError({
|
|
177
|
+
statusCode: _response.error.statusCode,
|
|
178
|
+
body: _response.error.body,
|
|
179
|
+
rawResponse: _response.rawResponse,
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
switch (_response.error.reason) {
|
|
184
|
+
case "non-json":
|
|
185
|
+
throw new errors.SyncError({
|
|
186
|
+
statusCode: _response.error.statusCode,
|
|
187
|
+
body: _response.error.rawBody,
|
|
188
|
+
rawResponse: _response.rawResponse,
|
|
189
|
+
});
|
|
190
|
+
case "timeout":
|
|
191
|
+
throw new errors.SyncTimeoutError("Timeout exceeded when calling GET /v2/generate/{id}.");
|
|
192
|
+
case "unknown":
|
|
193
|
+
throw new errors.SyncError({
|
|
194
|
+
message: _response.error.errorMessage,
|
|
195
|
+
rawResponse: _response.rawResponse,
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* @param {Sync.LipsyncListGenerationsRequest} request
|
|
202
|
+
* @param {Generate.RequestOptions} requestOptions - Request-specific configuration.
|
|
203
|
+
*
|
|
204
|
+
* @throws {@link Sync.UnauthorizedError}
|
|
205
|
+
* @throws {@link Sync.InternalServerError}
|
|
206
|
+
*
|
|
207
|
+
* @example
|
|
208
|
+
* await client.generate.listGenerations()
|
|
209
|
+
*/
|
|
210
|
+
listGenerations(request = {}, requestOptions) {
|
|
211
|
+
return core.HttpResponsePromise.fromPromise(this.__listGenerations(request, requestOptions));
|
|
212
|
+
}
|
|
213
|
+
__listGenerations() {
|
|
214
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
215
|
+
var _a, _b, _c;
|
|
216
|
+
const { status } = request;
|
|
217
|
+
const _queryParams = {};
|
|
218
|
+
if (status != null) {
|
|
219
|
+
_queryParams["status"] = status;
|
|
220
|
+
}
|
|
221
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
222
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SyncEnvironment.Default, "/v2/generations"),
|
|
223
|
+
method: "GET",
|
|
224
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.1.6", "User-Agent": "@sync.so/sdk/0.1.6", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
225
|
+
contentType: "application/json",
|
|
226
|
+
queryParameters: _queryParams,
|
|
227
|
+
requestType: "json",
|
|
228
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
229
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
230
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
231
|
+
});
|
|
232
|
+
if (_response.ok) {
|
|
233
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
234
|
+
}
|
|
235
|
+
if (_response.error.reason === "status-code") {
|
|
236
|
+
switch (_response.error.statusCode) {
|
|
237
|
+
case 401:
|
|
238
|
+
throw new Sync.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
239
|
+
case 500:
|
|
240
|
+
throw new Sync.InternalServerError(_response.error.body, _response.rawResponse);
|
|
241
|
+
default:
|
|
242
|
+
throw new errors.SyncError({
|
|
243
|
+
statusCode: _response.error.statusCode,
|
|
244
|
+
body: _response.error.body,
|
|
245
|
+
rawResponse: _response.rawResponse,
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
switch (_response.error.reason) {
|
|
250
|
+
case "non-json":
|
|
251
|
+
throw new errors.SyncError({
|
|
252
|
+
statusCode: _response.error.statusCode,
|
|
253
|
+
body: _response.error.rawBody,
|
|
254
|
+
rawResponse: _response.rawResponse,
|
|
255
|
+
});
|
|
256
|
+
case "timeout":
|
|
257
|
+
throw new errors.SyncTimeoutError("Timeout exceeded when calling GET /v2/generations.");
|
|
258
|
+
case "unknown":
|
|
259
|
+
throw new errors.SyncError({
|
|
260
|
+
message: _response.error.errorMessage,
|
|
261
|
+
rawResponse: _response.rawResponse,
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* @param {Sync.CreateGenerationDto} request
|
|
268
|
+
* @param {Generate.RequestOptions} requestOptions - Request-specific configuration.
|
|
269
|
+
*
|
|
270
|
+
* @throws {@link Sync.UnauthorizedError}
|
|
271
|
+
* @throws {@link Sync.InternalServerError}
|
|
272
|
+
*
|
|
273
|
+
* @example
|
|
274
|
+
* await client.generate.estimateCost({
|
|
275
|
+
* input: [{
|
|
276
|
+
* type: "video",
|
|
277
|
+
* url: "https://synchlabs-public.s3.us-west-2.amazonaws.com/david_demo_shortvid-03a10044-7741-4cfc-816a-5bccd392d1ee.mp4"
|
|
278
|
+
* }, {
|
|
279
|
+
* type: "audio",
|
|
280
|
+
* url: "https://synchlabs-public.s3.us-west-2.amazonaws.com/david_demo_shortaud-27623a4f-edab-4c6a-8383-871b18961a4a.wav"
|
|
281
|
+
* }],
|
|
282
|
+
* model: "lipsync-2",
|
|
283
|
+
* options: {
|
|
284
|
+
* sync_mode: "loop"
|
|
285
|
+
* }
|
|
286
|
+
* })
|
|
287
|
+
*/
|
|
288
|
+
estimateCost(request, requestOptions) {
|
|
289
|
+
return core.HttpResponsePromise.fromPromise(this.__estimateCost(request, requestOptions));
|
|
290
|
+
}
|
|
291
|
+
__estimateCost(request, requestOptions) {
|
|
292
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
293
|
+
var _a, _b, _c;
|
|
294
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
295
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SyncEnvironment.Default, "/v2/analyze/cost"),
|
|
296
|
+
method: "POST",
|
|
297
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.1.6", "User-Agent": "@sync.so/sdk/0.1.6", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
298
|
+
contentType: "application/json",
|
|
299
|
+
requestType: "json",
|
|
300
|
+
body: request,
|
|
301
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
302
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
303
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
304
|
+
});
|
|
305
|
+
if (_response.ok) {
|
|
306
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
307
|
+
}
|
|
308
|
+
if (_response.error.reason === "status-code") {
|
|
309
|
+
switch (_response.error.statusCode) {
|
|
310
|
+
case 401:
|
|
311
|
+
throw new Sync.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
312
|
+
case 500:
|
|
313
|
+
throw new Sync.InternalServerError(_response.error.body, _response.rawResponse);
|
|
314
|
+
default:
|
|
315
|
+
throw new errors.SyncError({
|
|
316
|
+
statusCode: _response.error.statusCode,
|
|
317
|
+
body: _response.error.body,
|
|
318
|
+
rawResponse: _response.rawResponse,
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
switch (_response.error.reason) {
|
|
323
|
+
case "non-json":
|
|
324
|
+
throw new errors.SyncError({
|
|
325
|
+
statusCode: _response.error.statusCode,
|
|
326
|
+
body: _response.error.rawBody,
|
|
327
|
+
rawResponse: _response.rawResponse,
|
|
328
|
+
});
|
|
329
|
+
case "timeout":
|
|
330
|
+
throw new errors.SyncTimeoutError("Timeout exceeded when calling POST /v2/analyze/cost.");
|
|
331
|
+
case "unknown":
|
|
332
|
+
throw new errors.SyncError({
|
|
333
|
+
message: _response.error.errorMessage,
|
|
334
|
+
rawResponse: _response.rawResponse,
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
_getCustomAuthorizationHeaders() {
|
|
340
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
341
|
+
const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
|
|
342
|
+
return { "x-api-key": apiKeyValue };
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
exports.Generate = Generate;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./requests"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Sync from "../../../../index";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {}
|
|
8
|
+
*/
|
|
9
|
+
export interface LipsyncListGenerationsRequest {
|
|
10
|
+
/**
|
|
11
|
+
* Filter generations by status
|
|
12
|
+
*/
|
|
13
|
+
status?: Sync.GenerationStatus;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { type LipsyncListGenerationsRequest } from "./LipsyncListGenerationsRequest";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./client"), exports);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * as common from "./common";
|
|
2
|
+
export * from "./common/types";
|
|
3
|
+
export * as webhooks from "./webhooks";
|
|
4
|
+
export * from "./webhooks/types";
|
|
5
|
+
export * from "./common/errors";
|
|
6
|
+
export * as generate from "./generate";
|
|
7
|
+
export * from "./generate/client/requests";
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
36
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.generate = exports.webhooks = exports.common = void 0;
|
|
40
|
+
exports.common = __importStar(require("./common"));
|
|
41
|
+
__exportStar(require("./common/types"), exports);
|
|
42
|
+
exports.webhooks = __importStar(require("./webhooks"));
|
|
43
|
+
__exportStar(require("./webhooks/types"), exports);
|
|
44
|
+
__exportStar(require("./common/errors"), exports);
|
|
45
|
+
exports.generate = __importStar(require("./generate"));
|
|
46
|
+
__exportStar(require("./generate/client/requests"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./types";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./types"), exports);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Sync from "../../../index";
|
|
5
|
+
export interface GenerationNotification {
|
|
6
|
+
/** The status of the generation */
|
|
7
|
+
status: Sync.WebhookStatus;
|
|
8
|
+
/** The date and time the generation was created */
|
|
9
|
+
createdAt: string;
|
|
10
|
+
id: Sync.GenerationId;
|
|
11
|
+
/** The input items for the generation */
|
|
12
|
+
input: Sync.Input[];
|
|
13
|
+
model: Sync.Model;
|
|
14
|
+
/** error message if the generation failed */
|
|
15
|
+
error?: string;
|
|
16
|
+
/** options used for the generation */
|
|
17
|
+
options?: Sync.GenerationOptions;
|
|
18
|
+
/** generated output media duration in seconds */
|
|
19
|
+
outputDuration?: number;
|
|
20
|
+
/** url of the generated output media */
|
|
21
|
+
outputUrl?: string;
|
|
22
|
+
/** url of the webhook server */
|
|
23
|
+
webhookUrl?: string;
|
|
24
|
+
}
|