@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
package/Client.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
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 { Generate } from "./api/resources/generate/client/Client";
|
|
7
|
+
export declare namespace SyncClient {
|
|
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 SyncClient {
|
|
27
|
+
protected readonly _options: SyncClient.Options;
|
|
28
|
+
protected _generate: Generate | undefined;
|
|
29
|
+
constructor(_options: SyncClient.Options);
|
|
30
|
+
get generate(): Generate;
|
|
31
|
+
}
|
package/Client.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SyncClient = void 0;
|
|
7
|
+
const Client_1 = require("./api/resources/generate/client/Client");
|
|
8
|
+
class SyncClient {
|
|
9
|
+
constructor(_options) {
|
|
10
|
+
this._options = _options;
|
|
11
|
+
}
|
|
12
|
+
get generate() {
|
|
13
|
+
var _a;
|
|
14
|
+
return ((_a = this._generate) !== null && _a !== void 0 ? _a : (this._generate = new Client_1.Generate(this._options)));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.SyncClient = SyncClient;
|
package/README.md
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# Sync TypeScript Library
|
|
2
|
+
|
|
3
|
+
[](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Fsynchronicity-labs%2Fsync-typescript-sdk)
|
|
4
|
+
[](https://www.npmjs.com/package/@sync.so/sdk)
|
|
5
|
+
|
|
6
|
+
The Sync TypeScript library provides convenient access to the Sync API from TypeScript.
|
|
7
|
+
|
|
8
|
+
## Documentation
|
|
9
|
+
|
|
10
|
+
API reference documentation is available [here](https://docs.sync.so/api-reference).
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
npm i -s @sync.so/sdk
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Reference
|
|
19
|
+
|
|
20
|
+
A full reference for this library is available [here](./reference.md).
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
Instantiate and use the client with the following:
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
import { SyncClient } from "@sync.so/sdk";
|
|
28
|
+
|
|
29
|
+
const client = new SyncClient({ apiKey: "YOUR_API_KEY" });
|
|
30
|
+
await client.generate.createGeneration({
|
|
31
|
+
input: [
|
|
32
|
+
{
|
|
33
|
+
type: "video",
|
|
34
|
+
url: "https://synchlabs-public.s3.us-west-2.amazonaws.com/david_demo_shortvid-03a10044-7741-4cfc-816a-5bccd392d1ee.mp4",
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
type: "audio",
|
|
38
|
+
url: "https://synchlabs-public.s3.us-west-2.amazonaws.com/david_demo_shortaud-27623a4f-edab-4c6a-8383-871b18961a4a.wav",
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
model: "lipsync-2",
|
|
42
|
+
options: {
|
|
43
|
+
sync_mode: "loop",
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Request And Response Types
|
|
49
|
+
|
|
50
|
+
The SDK exports all request and response types as TypeScript interfaces. Simply import them with the
|
|
51
|
+
following namespace:
|
|
52
|
+
|
|
53
|
+
```typescript
|
|
54
|
+
import { Sync } from "@sync.so/sdk";
|
|
55
|
+
|
|
56
|
+
const request: Sync.LipsyncListGenerationsRequest = {
|
|
57
|
+
...
|
|
58
|
+
};
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Exception Handling
|
|
62
|
+
|
|
63
|
+
When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error
|
|
64
|
+
will be thrown.
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
import { SyncError } from "@sync.so/sdk";
|
|
68
|
+
|
|
69
|
+
try {
|
|
70
|
+
await client.generate.createGeneration(...);
|
|
71
|
+
} catch (err) {
|
|
72
|
+
if (err instanceof SyncError) {
|
|
73
|
+
console.log(err.statusCode);
|
|
74
|
+
console.log(err.message);
|
|
75
|
+
console.log(err.body);
|
|
76
|
+
console.log(err.rawResponse);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Advanced
|
|
82
|
+
|
|
83
|
+
### Additional Headers
|
|
84
|
+
|
|
85
|
+
If you would like to send additional headers as part of the request, use the `headers` request option.
|
|
86
|
+
|
|
87
|
+
```typescript
|
|
88
|
+
const response = await client.generate.createGeneration(..., {
|
|
89
|
+
headers: {
|
|
90
|
+
'X-Custom-Header': 'custom value'
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Retries
|
|
96
|
+
|
|
97
|
+
The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
|
|
98
|
+
as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
|
|
99
|
+
retry limit (default: 2).
|
|
100
|
+
|
|
101
|
+
A request is deemed retryable when any of the following HTTP status codes is returned:
|
|
102
|
+
|
|
103
|
+
- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
|
|
104
|
+
- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
|
|
105
|
+
- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)
|
|
106
|
+
|
|
107
|
+
Use the `maxRetries` request option to configure this behavior.
|
|
108
|
+
|
|
109
|
+
```typescript
|
|
110
|
+
const response = await client.generate.createGeneration(..., {
|
|
111
|
+
maxRetries: 0 // override maxRetries at the request level
|
|
112
|
+
});
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Timeouts
|
|
116
|
+
|
|
117
|
+
The SDK defaults to a 60 second timeout. Use the `timeoutInSeconds` option to configure this behavior.
|
|
118
|
+
|
|
119
|
+
```typescript
|
|
120
|
+
const response = await client.generate.createGeneration(..., {
|
|
121
|
+
timeoutInSeconds: 30 // override timeout to 30s
|
|
122
|
+
});
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Aborting Requests
|
|
126
|
+
|
|
127
|
+
The SDK allows users to abort requests at any point by passing in an abort signal.
|
|
128
|
+
|
|
129
|
+
```typescript
|
|
130
|
+
const controller = new AbortController();
|
|
131
|
+
const response = await client.generate.createGeneration(..., {
|
|
132
|
+
abortSignal: controller.signal
|
|
133
|
+
});
|
|
134
|
+
controller.abort(); // aborts the request
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Access Raw Response Data
|
|
138
|
+
|
|
139
|
+
The SDK provides access to raw response data, including headers, through the `.withRawResponse()` method.
|
|
140
|
+
The `.withRawResponse()` method returns a promise that results to an object with a `data` and a `rawResponse` property.
|
|
141
|
+
|
|
142
|
+
```typescript
|
|
143
|
+
const { data, rawResponse } = await client.generate.createGeneration(...).withRawResponse();
|
|
144
|
+
|
|
145
|
+
console.log(data);
|
|
146
|
+
console.log(rawResponse.headers['X-My-Header']);
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Runtime Compatibility
|
|
150
|
+
|
|
151
|
+
The SDK defaults to `node-fetch` but will use the global fetch client if present. The SDK works in the following
|
|
152
|
+
runtimes:
|
|
153
|
+
|
|
154
|
+
- Node.js 18+
|
|
155
|
+
- Vercel
|
|
156
|
+
- Cloudflare Workers
|
|
157
|
+
- Deno v1.25+
|
|
158
|
+
- Bun 1.0+
|
|
159
|
+
- React Native
|
|
160
|
+
|
|
161
|
+
### Customizing Fetch Client
|
|
162
|
+
|
|
163
|
+
The SDK provides a way for your to customize the underlying HTTP client / Fetch function. If you're running in an
|
|
164
|
+
unsupported environment, this provides a way for you to break glass and ensure the SDK works.
|
|
165
|
+
|
|
166
|
+
```typescript
|
|
167
|
+
import { SyncClient } from "@sync.so/sdk";
|
|
168
|
+
|
|
169
|
+
const client = new SyncClient({
|
|
170
|
+
...
|
|
171
|
+
fetcher: // provide your implementation here
|
|
172
|
+
});
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## Contributing
|
|
176
|
+
|
|
177
|
+
While we value open-source contributions to this SDK, this library is generated programmatically.
|
|
178
|
+
Additions made directly to this library would have to be moved over to our generation code,
|
|
179
|
+
otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
|
|
180
|
+
a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
|
|
181
|
+
an issue first to discuss with us!
|
|
182
|
+
|
|
183
|
+
On the other hand, contributions to the README are always very welcome!
|
package/api/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./resources";
|
package/api/index.js
ADDED
|
@@ -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("./resources"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as errors from "../../../../errors/index";
|
|
5
|
+
import * as Sync from "../../../index";
|
|
6
|
+
import * as core from "../../../../core";
|
|
7
|
+
export declare class BadRequestError extends errors.SyncError {
|
|
8
|
+
constructor(body: Sync.GenerationError, rawResponse?: core.RawResponse);
|
|
9
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.BadRequestError = void 0;
|
|
40
|
+
const errors = __importStar(require("../../../../errors/index"));
|
|
41
|
+
class BadRequestError extends errors.SyncError {
|
|
42
|
+
constructor(body, rawResponse) {
|
|
43
|
+
super({
|
|
44
|
+
message: "BadRequestError",
|
|
45
|
+
statusCode: 400,
|
|
46
|
+
body: body,
|
|
47
|
+
rawResponse: rawResponse,
|
|
48
|
+
});
|
|
49
|
+
Object.setPrototypeOf(this, BadRequestError.prototype);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.BadRequestError = BadRequestError;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as errors from "../../../../errors/index";
|
|
5
|
+
import * as Sync from "../../../index";
|
|
6
|
+
import * as core from "../../../../core";
|
|
7
|
+
export declare class InternalServerError extends errors.SyncError {
|
|
8
|
+
constructor(body: Sync.GenerationError, rawResponse?: core.RawResponse);
|
|
9
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.InternalServerError = void 0;
|
|
40
|
+
const errors = __importStar(require("../../../../errors/index"));
|
|
41
|
+
class InternalServerError extends errors.SyncError {
|
|
42
|
+
constructor(body, rawResponse) {
|
|
43
|
+
super({
|
|
44
|
+
message: "InternalServerError",
|
|
45
|
+
statusCode: 500,
|
|
46
|
+
body: body,
|
|
47
|
+
rawResponse: rawResponse,
|
|
48
|
+
});
|
|
49
|
+
Object.setPrototypeOf(this, InternalServerError.prototype);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.InternalServerError = InternalServerError;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as errors from "../../../../errors/index";
|
|
5
|
+
import * as Sync from "../../../index";
|
|
6
|
+
import * as core from "../../../../core";
|
|
7
|
+
export declare class NotFoundError extends errors.SyncError {
|
|
8
|
+
constructor(body: Sync.GenerationError, rawResponse?: core.RawResponse);
|
|
9
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.NotFoundError = void 0;
|
|
40
|
+
const errors = __importStar(require("../../../../errors/index"));
|
|
41
|
+
class NotFoundError extends errors.SyncError {
|
|
42
|
+
constructor(body, rawResponse) {
|
|
43
|
+
super({
|
|
44
|
+
message: "NotFoundError",
|
|
45
|
+
statusCode: 404,
|
|
46
|
+
body: body,
|
|
47
|
+
rawResponse: rawResponse,
|
|
48
|
+
});
|
|
49
|
+
Object.setPrototypeOf(this, NotFoundError.prototype);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.NotFoundError = NotFoundError;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as errors from "../../../../errors/index";
|
|
5
|
+
import * as Sync from "../../../index";
|
|
6
|
+
import * as core from "../../../../core";
|
|
7
|
+
export declare class UnauthorizedError extends errors.SyncError {
|
|
8
|
+
constructor(body: Sync.GenerationError, rawResponse?: core.RawResponse);
|
|
9
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.UnauthorizedError = void 0;
|
|
40
|
+
const errors = __importStar(require("../../../../errors/index"));
|
|
41
|
+
class UnauthorizedError extends errors.SyncError {
|
|
42
|
+
constructor(body, rawResponse) {
|
|
43
|
+
super({
|
|
44
|
+
message: "UnauthorizedError",
|
|
45
|
+
statusCode: 401,
|
|
46
|
+
body: body,
|
|
47
|
+
rawResponse: rawResponse,
|
|
48
|
+
});
|
|
49
|
+
Object.setPrototypeOf(this, UnauthorizedError.prototype);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.UnauthorizedError = UnauthorizedError;
|
|
@@ -0,0 +1,20 @@
|
|
|
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("./BadRequestError"), exports);
|
|
18
|
+
__exportStar(require("./InternalServerError"), exports);
|
|
19
|
+
__exportStar(require("./NotFoundError"), exports);
|
|
20
|
+
__exportStar(require("./UnauthorizedError"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
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);
|
|
18
|
+
__exportStar(require("./errors"), 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
|
+
export interface CreateGenerationDto {
|
|
6
|
+
/** name of the model to use for generation. */
|
|
7
|
+
model: Sync.Model;
|
|
8
|
+
/** Array of input objects. Must include one video input item and one audio input item. Audio input items can be provided as either: recorded/captured audio url or a text-to-speech input with tts provider configuration. */
|
|
9
|
+
input: Sync.Input[];
|
|
10
|
+
/** additional options available for generation. */
|
|
11
|
+
options?: Sync.GenerationOptions;
|
|
12
|
+
/** webhook url for generation status updates. once the generation completes we will send a POST request to the webhook url with the generation data. */
|
|
13
|
+
webhookUrl?: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
export interface ElevenLabs {
|
|
5
|
+
name: "elevenlabs";
|
|
6
|
+
/** id of the voice to be used for generation */
|
|
7
|
+
voiceId: string;
|
|
8
|
+
/** script to be used for generation */
|
|
9
|
+
script: string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
export interface EstimatedGenerationCost {
|
|
5
|
+
/** The estimated frame count for the generation. */
|
|
6
|
+
estimatedFrameCount: number;
|
|
7
|
+
/** The estimated cost of the generation in USD. */
|
|
8
|
+
estimatedGenerationCost: number;
|
|
9
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Sync from "../../../index";
|
|
5
|
+
export interface Generation {
|
|
6
|
+
/** The date and time the generation was created. */
|
|
7
|
+
createdAt: string;
|
|
8
|
+
/** The error message if the generation failed. */
|
|
9
|
+
error?: string;
|
|
10
|
+
id: Sync.GenerationId;
|
|
11
|
+
/** An array of input objects used for generation. */
|
|
12
|
+
input: Sync.Input[];
|
|
13
|
+
/** The name of the model used for generation. */
|
|
14
|
+
model: Sync.Model;
|
|
15
|
+
/** Options for the generation. */
|
|
16
|
+
options?: Sync.GenerationOptions;
|
|
17
|
+
/** The duration of the output media. */
|
|
18
|
+
outputDuration?: number;
|
|
19
|
+
/** The URL of the output media. */
|
|
20
|
+
outputUrl?: string;
|
|
21
|
+
/** The status of the generation. */
|
|
22
|
+
status: Sync.GenerationStatus;
|
|
23
|
+
/** The URL to the webhook endpoint. */
|
|
24
|
+
webhookUrl?: string;
|
|
25
|
+
}
|