@sync.so/sdk 0.1.7 → 0.1.9
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 +3 -3
- package/Client.js +3 -3
- package/README.md +11 -11
- package/api/resources/{generate → generations}/client/Client.d.ts +24 -24
- package/{dist/api/resources/generate → api/resources/generations}/client/Client.js +29 -29
- package/api/resources/{generate/client/requests/LipsyncListGenerationsRequest.d.ts → generations/client/requests/ListGenerationsRequest.d.ts} +1 -1
- package/api/resources/generations/client/requests/index.d.ts +1 -0
- package/api/resources/index.d.ts +2 -2
- package/api/resources/index.js +3 -3
- package/dist/Client.d.ts +3 -3
- package/dist/Client.js +3 -3
- package/dist/api/resources/{generate → generations}/client/Client.d.ts +24 -24
- package/{api/resources/generate → dist/api/resources/generations}/client/Client.js +29 -29
- package/dist/api/resources/{generate/client/requests/LipsyncListGenerationsRequest.d.ts → generations/client/requests/ListGenerationsRequest.d.ts} +1 -1
- package/dist/api/resources/generations/client/requests/index.d.ts +1 -0
- package/dist/api/resources/index.d.ts +2 -2
- package/dist/api/resources/index.js +3 -3
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/reference.md +18 -18
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/api/resources/generate/client/requests/index.d.ts +0 -1
- package/dist/api/resources/generate/client/requests/index.d.ts +0 -1
- /package/api/resources/{generate → generations}/client/index.d.ts +0 -0
- /package/api/resources/{generate → generations}/client/index.js +0 -0
- /package/api/resources/{generate/client/requests/LipsyncListGenerationsRequest.js → generations/client/requests/ListGenerationsRequest.js} +0 -0
- /package/api/resources/{generate → generations}/client/requests/index.js +0 -0
- /package/api/resources/{generate → generations}/index.d.ts +0 -0
- /package/api/resources/{generate → generations}/index.js +0 -0
- /package/dist/api/resources/{generate → generations}/client/index.d.ts +0 -0
- /package/dist/api/resources/{generate → generations}/client/index.js +0 -0
- /package/dist/api/resources/{generate/client/requests/LipsyncListGenerationsRequest.js → generations/client/requests/ListGenerationsRequest.js} +0 -0
- /package/dist/api/resources/{generate → generations}/client/requests/index.js +0 -0
- /package/dist/api/resources/{generate → generations}/index.d.ts +0 -0
- /package/dist/api/resources/{generate → generations}/index.js +0 -0
package/Client.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as environments from "./environments";
|
|
5
5
|
import * as core from "./core";
|
|
6
|
-
import {
|
|
6
|
+
import { Generations } from "./api/resources/generations/client/Client";
|
|
7
7
|
export declare namespace SyncClient {
|
|
8
8
|
interface Options {
|
|
9
9
|
environment?: core.Supplier<environments.SyncEnvironment | string>;
|
|
@@ -25,7 +25,7 @@ export declare namespace SyncClient {
|
|
|
25
25
|
}
|
|
26
26
|
export declare class SyncClient {
|
|
27
27
|
protected readonly _options: SyncClient.Options;
|
|
28
|
-
protected
|
|
28
|
+
protected _generations: Generations | undefined;
|
|
29
29
|
constructor(_options: SyncClient.Options);
|
|
30
|
-
get
|
|
30
|
+
get generations(): Generations;
|
|
31
31
|
}
|
package/Client.js
CHANGED
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.SyncClient = void 0;
|
|
7
|
-
const Client_1 = require("./api/resources/
|
|
7
|
+
const Client_1 = require("./api/resources/generations/client/Client");
|
|
8
8
|
class SyncClient {
|
|
9
9
|
constructor(_options) {
|
|
10
10
|
this._options = _options;
|
|
11
11
|
}
|
|
12
|
-
get
|
|
12
|
+
get generations() {
|
|
13
13
|
var _a;
|
|
14
|
-
return ((_a = this.
|
|
14
|
+
return ((_a = this._generations) !== null && _a !== void 0 ? _a : (this._generations = new Client_1.Generations(this._options)));
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
exports.SyncClient = SyncClient;
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ The Sync TypeScript library provides convenient access to the Sync API from Type
|
|
|
7
7
|
|
|
8
8
|
## Documentation
|
|
9
9
|
|
|
10
|
-
API reference documentation is available [here](https://docs.
|
|
10
|
+
API reference documentation is available [here](https://sync.docs.buildwithfern.com/api-reference).
|
|
11
11
|
|
|
12
12
|
## Installation
|
|
13
13
|
|
|
@@ -27,15 +27,15 @@ Instantiate and use the client with the following:
|
|
|
27
27
|
import { SyncClient } from "@sync.so/sdk";
|
|
28
28
|
|
|
29
29
|
const client = new SyncClient({ apiKey: "YOUR_API_KEY" });
|
|
30
|
-
await client.
|
|
30
|
+
await client.generations.create({
|
|
31
31
|
input: [
|
|
32
32
|
{
|
|
33
33
|
type: "video",
|
|
34
|
-
url: "https://
|
|
34
|
+
url: "https://assets.sync.so/docs/example-video.mp4",
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
type: "audio",
|
|
38
|
-
url: "https://
|
|
38
|
+
url: "https://assets.sync.so/docs/example-audio.wav",
|
|
39
39
|
},
|
|
40
40
|
],
|
|
41
41
|
model: "lipsync-2",
|
|
@@ -53,7 +53,7 @@ following namespace:
|
|
|
53
53
|
```typescript
|
|
54
54
|
import { Sync } from "@sync.so/sdk";
|
|
55
55
|
|
|
56
|
-
const request: Sync.
|
|
56
|
+
const request: Sync.ListGenerationsRequest = {
|
|
57
57
|
...
|
|
58
58
|
};
|
|
59
59
|
```
|
|
@@ -67,7 +67,7 @@ will be thrown.
|
|
|
67
67
|
import { SyncError } from "@sync.so/sdk";
|
|
68
68
|
|
|
69
69
|
try {
|
|
70
|
-
await client.
|
|
70
|
+
await client.generations.create(...);
|
|
71
71
|
} catch (err) {
|
|
72
72
|
if (err instanceof SyncError) {
|
|
73
73
|
console.log(err.statusCode);
|
|
@@ -85,7 +85,7 @@ try {
|
|
|
85
85
|
If you would like to send additional headers as part of the request, use the `headers` request option.
|
|
86
86
|
|
|
87
87
|
```typescript
|
|
88
|
-
const response = await client.
|
|
88
|
+
const response = await client.generations.create(..., {
|
|
89
89
|
headers: {
|
|
90
90
|
'X-Custom-Header': 'custom value'
|
|
91
91
|
}
|
|
@@ -107,7 +107,7 @@ A request is deemed retryable when any of the following HTTP status codes is ret
|
|
|
107
107
|
Use the `maxRetries` request option to configure this behavior.
|
|
108
108
|
|
|
109
109
|
```typescript
|
|
110
|
-
const response = await client.
|
|
110
|
+
const response = await client.generations.create(..., {
|
|
111
111
|
maxRetries: 0 // override maxRetries at the request level
|
|
112
112
|
});
|
|
113
113
|
```
|
|
@@ -117,7 +117,7 @@ const response = await client.generate.createGeneration(..., {
|
|
|
117
117
|
The SDK defaults to a 60 second timeout. Use the `timeoutInSeconds` option to configure this behavior.
|
|
118
118
|
|
|
119
119
|
```typescript
|
|
120
|
-
const response = await client.
|
|
120
|
+
const response = await client.generations.create(..., {
|
|
121
121
|
timeoutInSeconds: 30 // override timeout to 30s
|
|
122
122
|
});
|
|
123
123
|
```
|
|
@@ -128,7 +128,7 @@ The SDK allows users to abort requests at any point by passing in an abort signa
|
|
|
128
128
|
|
|
129
129
|
```typescript
|
|
130
130
|
const controller = new AbortController();
|
|
131
|
-
const response = await client.
|
|
131
|
+
const response = await client.generations.create(..., {
|
|
132
132
|
abortSignal: controller.signal
|
|
133
133
|
});
|
|
134
134
|
controller.abort(); // aborts the request
|
|
@@ -140,7 +140,7 @@ The SDK provides access to raw response data, including headers, through the `.w
|
|
|
140
140
|
The `.withRawResponse()` method returns a promise that results to an object with a `data` and a `rawResponse` property.
|
|
141
141
|
|
|
142
142
|
```typescript
|
|
143
|
-
const { data, rawResponse } = await client.
|
|
143
|
+
const { data, rawResponse } = await client.generations.create(...).withRawResponse();
|
|
144
144
|
|
|
145
145
|
console.log(data);
|
|
146
146
|
console.log(rawResponse.headers['X-My-Header']);
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import * as environments from "../../../../environments";
|
|
5
5
|
import * as core from "../../../../core";
|
|
6
6
|
import * as Sync from "../../../index";
|
|
7
|
-
export declare namespace
|
|
7
|
+
export declare namespace Generations {
|
|
8
8
|
interface Options {
|
|
9
9
|
environment?: core.Supplier<environments.SyncEnvironment | string>;
|
|
10
10
|
/** Specify a custom URL to connect the client to. */
|
|
@@ -23,25 +23,25 @@ export declare namespace Generate {
|
|
|
23
23
|
headers?: Record<string, string>;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
export declare class
|
|
27
|
-
protected readonly _options:
|
|
28
|
-
constructor(_options:
|
|
26
|
+
export declare class Generations {
|
|
27
|
+
protected readonly _options: Generations.Options;
|
|
28
|
+
constructor(_options: Generations.Options);
|
|
29
29
|
/**
|
|
30
30
|
* @param {Sync.CreateGenerationDto} request
|
|
31
|
-
* @param {
|
|
31
|
+
* @param {Generations.RequestOptions} requestOptions - Request-specific configuration.
|
|
32
32
|
*
|
|
33
33
|
* @throws {@link Sync.BadRequestError}
|
|
34
34
|
* @throws {@link Sync.UnauthorizedError}
|
|
35
35
|
* @throws {@link Sync.InternalServerError}
|
|
36
36
|
*
|
|
37
37
|
* @example
|
|
38
|
-
* await client.
|
|
38
|
+
* await client.generations.create({
|
|
39
39
|
* input: [{
|
|
40
40
|
* type: "video",
|
|
41
|
-
* url: "https://
|
|
41
|
+
* url: "https://assets.sync.so/docs/example-video.mp4"
|
|
42
42
|
* }, {
|
|
43
43
|
* type: "audio",
|
|
44
|
-
* url: "https://
|
|
44
|
+
* url: "https://assets.sync.so/docs/example-audio.wav"
|
|
45
45
|
* }],
|
|
46
46
|
* model: "lipsync-2",
|
|
47
47
|
* options: {
|
|
@@ -49,48 +49,48 @@ export declare class Generate {
|
|
|
49
49
|
* }
|
|
50
50
|
* })
|
|
51
51
|
*/
|
|
52
|
-
|
|
53
|
-
private
|
|
52
|
+
create(request: Sync.CreateGenerationDto, requestOptions?: Generations.RequestOptions): core.HttpResponsePromise<Sync.Generation>;
|
|
53
|
+
private __create;
|
|
54
54
|
/**
|
|
55
55
|
* @param {Sync.GenerationId} id
|
|
56
|
-
* @param {
|
|
56
|
+
* @param {Generations.RequestOptions} requestOptions - Request-specific configuration.
|
|
57
57
|
*
|
|
58
58
|
* @throws {@link Sync.UnauthorizedError}
|
|
59
59
|
* @throws {@link Sync.NotFoundError}
|
|
60
60
|
* @throws {@link Sync.InternalServerError}
|
|
61
61
|
*
|
|
62
62
|
* @example
|
|
63
|
-
* await client.
|
|
63
|
+
* await client.generations.get("6533643b-aceb-4c40-967e-d9ba9baac39e")
|
|
64
64
|
*/
|
|
65
|
-
|
|
66
|
-
private
|
|
65
|
+
get(id: Sync.GenerationId, requestOptions?: Generations.RequestOptions): core.HttpResponsePromise<Sync.Generation>;
|
|
66
|
+
private __get;
|
|
67
67
|
/**
|
|
68
|
-
* @param {Sync.
|
|
69
|
-
* @param {
|
|
68
|
+
* @param {Sync.ListGenerationsRequest} request
|
|
69
|
+
* @param {Generations.RequestOptions} requestOptions - Request-specific configuration.
|
|
70
70
|
*
|
|
71
71
|
* @throws {@link Sync.UnauthorizedError}
|
|
72
72
|
* @throws {@link Sync.InternalServerError}
|
|
73
73
|
*
|
|
74
74
|
* @example
|
|
75
|
-
* await client.
|
|
75
|
+
* await client.generations.list()
|
|
76
76
|
*/
|
|
77
|
-
|
|
78
|
-
private
|
|
77
|
+
list(request?: Sync.ListGenerationsRequest, requestOptions?: Generations.RequestOptions): core.HttpResponsePromise<Sync.Generation[]>;
|
|
78
|
+
private __list;
|
|
79
79
|
/**
|
|
80
80
|
* @param {Sync.CreateGenerationDto} request
|
|
81
|
-
* @param {
|
|
81
|
+
* @param {Generations.RequestOptions} requestOptions - Request-specific configuration.
|
|
82
82
|
*
|
|
83
83
|
* @throws {@link Sync.UnauthorizedError}
|
|
84
84
|
* @throws {@link Sync.InternalServerError}
|
|
85
85
|
*
|
|
86
86
|
* @example
|
|
87
|
-
* await client.
|
|
87
|
+
* await client.generations.estimateCost({
|
|
88
88
|
* input: [{
|
|
89
89
|
* type: "video",
|
|
90
|
-
* url: "https://
|
|
90
|
+
* url: "https://assets.sync.so/docs/example-video.mp4"
|
|
91
91
|
* }, {
|
|
92
92
|
* type: "audio",
|
|
93
|
-
* url: "https://
|
|
93
|
+
* url: "https://assets.sync.so/docs/example-audio.wav"
|
|
94
94
|
* }],
|
|
95
95
|
* model: "lipsync-2",
|
|
96
96
|
* options: {
|
|
@@ -98,7 +98,7 @@ export declare class Generate {
|
|
|
98
98
|
* }
|
|
99
99
|
* })
|
|
100
100
|
*/
|
|
101
|
-
estimateCost(request: Sync.CreateGenerationDto, requestOptions?:
|
|
101
|
+
estimateCost(request: Sync.CreateGenerationDto, requestOptions?: Generations.RequestOptions): core.HttpResponsePromise<Sync.EstimatedGenerationCost[]>;
|
|
102
102
|
private __estimateCost;
|
|
103
103
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
104
104
|
"x-api-key": string;
|
|
@@ -48,32 +48,32 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
48
48
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
49
49
|
};
|
|
50
50
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
|
-
exports.
|
|
51
|
+
exports.Generations = void 0;
|
|
52
52
|
const environments = __importStar(require("../../../../environments"));
|
|
53
53
|
const core = __importStar(require("../../../../core"));
|
|
54
54
|
const Sync = __importStar(require("../../../index"));
|
|
55
55
|
const url_join_1 = __importDefault(require("url-join"));
|
|
56
56
|
const errors = __importStar(require("../../../../errors/index"));
|
|
57
|
-
class
|
|
57
|
+
class Generations {
|
|
58
58
|
constructor(_options) {
|
|
59
59
|
this._options = _options;
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
62
62
|
* @param {Sync.CreateGenerationDto} request
|
|
63
|
-
* @param {
|
|
63
|
+
* @param {Generations.RequestOptions} requestOptions - Request-specific configuration.
|
|
64
64
|
*
|
|
65
65
|
* @throws {@link Sync.BadRequestError}
|
|
66
66
|
* @throws {@link Sync.UnauthorizedError}
|
|
67
67
|
* @throws {@link Sync.InternalServerError}
|
|
68
68
|
*
|
|
69
69
|
* @example
|
|
70
|
-
* await client.
|
|
70
|
+
* await client.generations.create({
|
|
71
71
|
* input: [{
|
|
72
72
|
* type: "video",
|
|
73
|
-
* url: "https://
|
|
73
|
+
* url: "https://assets.sync.so/docs/example-video.mp4"
|
|
74
74
|
* }, {
|
|
75
75
|
* type: "audio",
|
|
76
|
-
* url: "https://
|
|
76
|
+
* url: "https://assets.sync.so/docs/example-audio.wav"
|
|
77
77
|
* }],
|
|
78
78
|
* model: "lipsync-2",
|
|
79
79
|
* options: {
|
|
@@ -81,16 +81,16 @@ class Generate {
|
|
|
81
81
|
* }
|
|
82
82
|
* })
|
|
83
83
|
*/
|
|
84
|
-
|
|
85
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
84
|
+
create(request, requestOptions) {
|
|
85
|
+
return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
|
|
86
86
|
}
|
|
87
|
-
|
|
87
|
+
__create(request, requestOptions) {
|
|
88
88
|
return __awaiter(this, void 0, void 0, function* () {
|
|
89
89
|
var _a, _b, _c;
|
|
90
90
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
91
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
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.
|
|
93
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.1.9", "User-Agent": "@sync.so/sdk/0.1.9", "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
94
|
contentType: "application/json",
|
|
95
95
|
requestType: "json",
|
|
96
96
|
body: request,
|
|
@@ -136,25 +136,25 @@ class Generate {
|
|
|
136
136
|
}
|
|
137
137
|
/**
|
|
138
138
|
* @param {Sync.GenerationId} id
|
|
139
|
-
* @param {
|
|
139
|
+
* @param {Generations.RequestOptions} requestOptions - Request-specific configuration.
|
|
140
140
|
*
|
|
141
141
|
* @throws {@link Sync.UnauthorizedError}
|
|
142
142
|
* @throws {@link Sync.NotFoundError}
|
|
143
143
|
* @throws {@link Sync.InternalServerError}
|
|
144
144
|
*
|
|
145
145
|
* @example
|
|
146
|
-
* await client.
|
|
146
|
+
* await client.generations.get("6533643b-aceb-4c40-967e-d9ba9baac39e")
|
|
147
147
|
*/
|
|
148
|
-
|
|
149
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
148
|
+
get(id, requestOptions) {
|
|
149
|
+
return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions));
|
|
150
150
|
}
|
|
151
|
-
|
|
151
|
+
__get(id, requestOptions) {
|
|
152
152
|
return __awaiter(this, void 0, void 0, function* () {
|
|
153
153
|
var _a, _b, _c;
|
|
154
154
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
155
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
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.
|
|
157
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.1.9", "User-Agent": "@sync.so/sdk/0.1.9", "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
158
|
contentType: "application/json",
|
|
159
159
|
requestType: "json",
|
|
160
160
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -198,19 +198,19 @@ class Generate {
|
|
|
198
198
|
});
|
|
199
199
|
}
|
|
200
200
|
/**
|
|
201
|
-
* @param {Sync.
|
|
202
|
-
* @param {
|
|
201
|
+
* @param {Sync.ListGenerationsRequest} request
|
|
202
|
+
* @param {Generations.RequestOptions} requestOptions - Request-specific configuration.
|
|
203
203
|
*
|
|
204
204
|
* @throws {@link Sync.UnauthorizedError}
|
|
205
205
|
* @throws {@link Sync.InternalServerError}
|
|
206
206
|
*
|
|
207
207
|
* @example
|
|
208
|
-
* await client.
|
|
208
|
+
* await client.generations.list()
|
|
209
209
|
*/
|
|
210
|
-
|
|
211
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
210
|
+
list(request = {}, requestOptions) {
|
|
211
|
+
return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions));
|
|
212
212
|
}
|
|
213
|
-
|
|
213
|
+
__list() {
|
|
214
214
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
215
215
|
var _a, _b, _c;
|
|
216
216
|
const { status } = request;
|
|
@@ -221,7 +221,7 @@ class Generate {
|
|
|
221
221
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
222
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
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.
|
|
224
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.1.9", "User-Agent": "@sync.so/sdk/0.1.9", "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
225
|
contentType: "application/json",
|
|
226
226
|
queryParameters: _queryParams,
|
|
227
227
|
requestType: "json",
|
|
@@ -265,19 +265,19 @@ class Generate {
|
|
|
265
265
|
}
|
|
266
266
|
/**
|
|
267
267
|
* @param {Sync.CreateGenerationDto} request
|
|
268
|
-
* @param {
|
|
268
|
+
* @param {Generations.RequestOptions} requestOptions - Request-specific configuration.
|
|
269
269
|
*
|
|
270
270
|
* @throws {@link Sync.UnauthorizedError}
|
|
271
271
|
* @throws {@link Sync.InternalServerError}
|
|
272
272
|
*
|
|
273
273
|
* @example
|
|
274
|
-
* await client.
|
|
274
|
+
* await client.generations.estimateCost({
|
|
275
275
|
* input: [{
|
|
276
276
|
* type: "video",
|
|
277
|
-
* url: "https://
|
|
277
|
+
* url: "https://assets.sync.so/docs/example-video.mp4"
|
|
278
278
|
* }, {
|
|
279
279
|
* type: "audio",
|
|
280
|
-
* url: "https://
|
|
280
|
+
* url: "https://assets.sync.so/docs/example-audio.wav"
|
|
281
281
|
* }],
|
|
282
282
|
* model: "lipsync-2",
|
|
283
283
|
* options: {
|
|
@@ -294,7 +294,7 @@ class Generate {
|
|
|
294
294
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
295
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
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.
|
|
297
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.1.9", "User-Agent": "@sync.so/sdk/0.1.9", "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
298
|
contentType: "application/json",
|
|
299
299
|
requestType: "json",
|
|
300
300
|
body: request,
|
|
@@ -343,4 +343,4 @@ class Generate {
|
|
|
343
343
|
});
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
|
-
exports.
|
|
346
|
+
exports.Generations = Generations;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { type ListGenerationsRequest } from "./ListGenerationsRequest";
|
package/api/resources/index.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ export * from "./common/types";
|
|
|
3
3
|
export * as webhooks from "./webhooks";
|
|
4
4
|
export * from "./webhooks/types";
|
|
5
5
|
export * from "./common/errors";
|
|
6
|
-
export * as
|
|
7
|
-
export * from "./
|
|
6
|
+
export * as generations from "./generations";
|
|
7
|
+
export * from "./generations/client/requests";
|
package/api/resources/index.js
CHANGED
|
@@ -36,11 +36,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
36
36
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.
|
|
39
|
+
exports.generations = exports.webhooks = exports.common = void 0;
|
|
40
40
|
exports.common = __importStar(require("./common"));
|
|
41
41
|
__exportStar(require("./common/types"), exports);
|
|
42
42
|
exports.webhooks = __importStar(require("./webhooks"));
|
|
43
43
|
__exportStar(require("./webhooks/types"), exports);
|
|
44
44
|
__exportStar(require("./common/errors"), exports);
|
|
45
|
-
exports.
|
|
46
|
-
__exportStar(require("./
|
|
45
|
+
exports.generations = __importStar(require("./generations"));
|
|
46
|
+
__exportStar(require("./generations/client/requests"), exports);
|
package/dist/Client.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as environments from "./environments";
|
|
5
5
|
import * as core from "./core";
|
|
6
|
-
import {
|
|
6
|
+
import { Generations } from "./api/resources/generations/client/Client";
|
|
7
7
|
export declare namespace SyncClient {
|
|
8
8
|
interface Options {
|
|
9
9
|
environment?: core.Supplier<environments.SyncEnvironment | string>;
|
|
@@ -25,7 +25,7 @@ export declare namespace SyncClient {
|
|
|
25
25
|
}
|
|
26
26
|
export declare class SyncClient {
|
|
27
27
|
protected readonly _options: SyncClient.Options;
|
|
28
|
-
protected
|
|
28
|
+
protected _generations: Generations | undefined;
|
|
29
29
|
constructor(_options: SyncClient.Options);
|
|
30
|
-
get
|
|
30
|
+
get generations(): Generations;
|
|
31
31
|
}
|
package/dist/Client.js
CHANGED
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.SyncClient = void 0;
|
|
7
|
-
const Client_1 = require("./api/resources/
|
|
7
|
+
const Client_1 = require("./api/resources/generations/client/Client");
|
|
8
8
|
class SyncClient {
|
|
9
9
|
constructor(_options) {
|
|
10
10
|
this._options = _options;
|
|
11
11
|
}
|
|
12
|
-
get
|
|
12
|
+
get generations() {
|
|
13
13
|
var _a;
|
|
14
|
-
return ((_a = this.
|
|
14
|
+
return ((_a = this._generations) !== null && _a !== void 0 ? _a : (this._generations = new Client_1.Generations(this._options)));
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
exports.SyncClient = SyncClient;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import * as environments from "../../../../environments";
|
|
5
5
|
import * as core from "../../../../core";
|
|
6
6
|
import * as Sync from "../../../index";
|
|
7
|
-
export declare namespace
|
|
7
|
+
export declare namespace Generations {
|
|
8
8
|
interface Options {
|
|
9
9
|
environment?: core.Supplier<environments.SyncEnvironment | string>;
|
|
10
10
|
/** Specify a custom URL to connect the client to. */
|
|
@@ -23,25 +23,25 @@ export declare namespace Generate {
|
|
|
23
23
|
headers?: Record<string, string>;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
export declare class
|
|
27
|
-
protected readonly _options:
|
|
28
|
-
constructor(_options:
|
|
26
|
+
export declare class Generations {
|
|
27
|
+
protected readonly _options: Generations.Options;
|
|
28
|
+
constructor(_options: Generations.Options);
|
|
29
29
|
/**
|
|
30
30
|
* @param {Sync.CreateGenerationDto} request
|
|
31
|
-
* @param {
|
|
31
|
+
* @param {Generations.RequestOptions} requestOptions - Request-specific configuration.
|
|
32
32
|
*
|
|
33
33
|
* @throws {@link Sync.BadRequestError}
|
|
34
34
|
* @throws {@link Sync.UnauthorizedError}
|
|
35
35
|
* @throws {@link Sync.InternalServerError}
|
|
36
36
|
*
|
|
37
37
|
* @example
|
|
38
|
-
* await client.
|
|
38
|
+
* await client.generations.create({
|
|
39
39
|
* input: [{
|
|
40
40
|
* type: "video",
|
|
41
|
-
* url: "https://
|
|
41
|
+
* url: "https://assets.sync.so/docs/example-video.mp4"
|
|
42
42
|
* }, {
|
|
43
43
|
* type: "audio",
|
|
44
|
-
* url: "https://
|
|
44
|
+
* url: "https://assets.sync.so/docs/example-audio.wav"
|
|
45
45
|
* }],
|
|
46
46
|
* model: "lipsync-2",
|
|
47
47
|
* options: {
|
|
@@ -49,48 +49,48 @@ export declare class Generate {
|
|
|
49
49
|
* }
|
|
50
50
|
* })
|
|
51
51
|
*/
|
|
52
|
-
|
|
53
|
-
private
|
|
52
|
+
create(request: Sync.CreateGenerationDto, requestOptions?: Generations.RequestOptions): core.HttpResponsePromise<Sync.Generation>;
|
|
53
|
+
private __create;
|
|
54
54
|
/**
|
|
55
55
|
* @param {Sync.GenerationId} id
|
|
56
|
-
* @param {
|
|
56
|
+
* @param {Generations.RequestOptions} requestOptions - Request-specific configuration.
|
|
57
57
|
*
|
|
58
58
|
* @throws {@link Sync.UnauthorizedError}
|
|
59
59
|
* @throws {@link Sync.NotFoundError}
|
|
60
60
|
* @throws {@link Sync.InternalServerError}
|
|
61
61
|
*
|
|
62
62
|
* @example
|
|
63
|
-
* await client.
|
|
63
|
+
* await client.generations.get("6533643b-aceb-4c40-967e-d9ba9baac39e")
|
|
64
64
|
*/
|
|
65
|
-
|
|
66
|
-
private
|
|
65
|
+
get(id: Sync.GenerationId, requestOptions?: Generations.RequestOptions): core.HttpResponsePromise<Sync.Generation>;
|
|
66
|
+
private __get;
|
|
67
67
|
/**
|
|
68
|
-
* @param {Sync.
|
|
69
|
-
* @param {
|
|
68
|
+
* @param {Sync.ListGenerationsRequest} request
|
|
69
|
+
* @param {Generations.RequestOptions} requestOptions - Request-specific configuration.
|
|
70
70
|
*
|
|
71
71
|
* @throws {@link Sync.UnauthorizedError}
|
|
72
72
|
* @throws {@link Sync.InternalServerError}
|
|
73
73
|
*
|
|
74
74
|
* @example
|
|
75
|
-
* await client.
|
|
75
|
+
* await client.generations.list()
|
|
76
76
|
*/
|
|
77
|
-
|
|
78
|
-
private
|
|
77
|
+
list(request?: Sync.ListGenerationsRequest, requestOptions?: Generations.RequestOptions): core.HttpResponsePromise<Sync.Generation[]>;
|
|
78
|
+
private __list;
|
|
79
79
|
/**
|
|
80
80
|
* @param {Sync.CreateGenerationDto} request
|
|
81
|
-
* @param {
|
|
81
|
+
* @param {Generations.RequestOptions} requestOptions - Request-specific configuration.
|
|
82
82
|
*
|
|
83
83
|
* @throws {@link Sync.UnauthorizedError}
|
|
84
84
|
* @throws {@link Sync.InternalServerError}
|
|
85
85
|
*
|
|
86
86
|
* @example
|
|
87
|
-
* await client.
|
|
87
|
+
* await client.generations.estimateCost({
|
|
88
88
|
* input: [{
|
|
89
89
|
* type: "video",
|
|
90
|
-
* url: "https://
|
|
90
|
+
* url: "https://assets.sync.so/docs/example-video.mp4"
|
|
91
91
|
* }, {
|
|
92
92
|
* type: "audio",
|
|
93
|
-
* url: "https://
|
|
93
|
+
* url: "https://assets.sync.so/docs/example-audio.wav"
|
|
94
94
|
* }],
|
|
95
95
|
* model: "lipsync-2",
|
|
96
96
|
* options: {
|
|
@@ -98,7 +98,7 @@ export declare class Generate {
|
|
|
98
98
|
* }
|
|
99
99
|
* })
|
|
100
100
|
*/
|
|
101
|
-
estimateCost(request: Sync.CreateGenerationDto, requestOptions?:
|
|
101
|
+
estimateCost(request: Sync.CreateGenerationDto, requestOptions?: Generations.RequestOptions): core.HttpResponsePromise<Sync.EstimatedGenerationCost[]>;
|
|
102
102
|
private __estimateCost;
|
|
103
103
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
104
104
|
"x-api-key": string;
|
|
@@ -48,32 +48,32 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
48
48
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
49
49
|
};
|
|
50
50
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
|
-
exports.
|
|
51
|
+
exports.Generations = void 0;
|
|
52
52
|
const environments = __importStar(require("../../../../environments"));
|
|
53
53
|
const core = __importStar(require("../../../../core"));
|
|
54
54
|
const Sync = __importStar(require("../../../index"));
|
|
55
55
|
const url_join_1 = __importDefault(require("url-join"));
|
|
56
56
|
const errors = __importStar(require("../../../../errors/index"));
|
|
57
|
-
class
|
|
57
|
+
class Generations {
|
|
58
58
|
constructor(_options) {
|
|
59
59
|
this._options = _options;
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
62
62
|
* @param {Sync.CreateGenerationDto} request
|
|
63
|
-
* @param {
|
|
63
|
+
* @param {Generations.RequestOptions} requestOptions - Request-specific configuration.
|
|
64
64
|
*
|
|
65
65
|
* @throws {@link Sync.BadRequestError}
|
|
66
66
|
* @throws {@link Sync.UnauthorizedError}
|
|
67
67
|
* @throws {@link Sync.InternalServerError}
|
|
68
68
|
*
|
|
69
69
|
* @example
|
|
70
|
-
* await client.
|
|
70
|
+
* await client.generations.create({
|
|
71
71
|
* input: [{
|
|
72
72
|
* type: "video",
|
|
73
|
-
* url: "https://
|
|
73
|
+
* url: "https://assets.sync.so/docs/example-video.mp4"
|
|
74
74
|
* }, {
|
|
75
75
|
* type: "audio",
|
|
76
|
-
* url: "https://
|
|
76
|
+
* url: "https://assets.sync.so/docs/example-audio.wav"
|
|
77
77
|
* }],
|
|
78
78
|
* model: "lipsync-2",
|
|
79
79
|
* options: {
|
|
@@ -81,16 +81,16 @@ class Generate {
|
|
|
81
81
|
* }
|
|
82
82
|
* })
|
|
83
83
|
*/
|
|
84
|
-
|
|
85
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
84
|
+
create(request, requestOptions) {
|
|
85
|
+
return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
|
|
86
86
|
}
|
|
87
|
-
|
|
87
|
+
__create(request, requestOptions) {
|
|
88
88
|
return __awaiter(this, void 0, void 0, function* () {
|
|
89
89
|
var _a, _b, _c;
|
|
90
90
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
91
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
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.
|
|
93
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.1.9", "User-Agent": "@sync.so/sdk/0.1.9", "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
94
|
contentType: "application/json",
|
|
95
95
|
requestType: "json",
|
|
96
96
|
body: request,
|
|
@@ -136,25 +136,25 @@ class Generate {
|
|
|
136
136
|
}
|
|
137
137
|
/**
|
|
138
138
|
* @param {Sync.GenerationId} id
|
|
139
|
-
* @param {
|
|
139
|
+
* @param {Generations.RequestOptions} requestOptions - Request-specific configuration.
|
|
140
140
|
*
|
|
141
141
|
* @throws {@link Sync.UnauthorizedError}
|
|
142
142
|
* @throws {@link Sync.NotFoundError}
|
|
143
143
|
* @throws {@link Sync.InternalServerError}
|
|
144
144
|
*
|
|
145
145
|
* @example
|
|
146
|
-
* await client.
|
|
146
|
+
* await client.generations.get("6533643b-aceb-4c40-967e-d9ba9baac39e")
|
|
147
147
|
*/
|
|
148
|
-
|
|
149
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
148
|
+
get(id, requestOptions) {
|
|
149
|
+
return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions));
|
|
150
150
|
}
|
|
151
|
-
|
|
151
|
+
__get(id, requestOptions) {
|
|
152
152
|
return __awaiter(this, void 0, void 0, function* () {
|
|
153
153
|
var _a, _b, _c;
|
|
154
154
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
155
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
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.
|
|
157
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.1.9", "User-Agent": "@sync.so/sdk/0.1.9", "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
158
|
contentType: "application/json",
|
|
159
159
|
requestType: "json",
|
|
160
160
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -198,19 +198,19 @@ class Generate {
|
|
|
198
198
|
});
|
|
199
199
|
}
|
|
200
200
|
/**
|
|
201
|
-
* @param {Sync.
|
|
202
|
-
* @param {
|
|
201
|
+
* @param {Sync.ListGenerationsRequest} request
|
|
202
|
+
* @param {Generations.RequestOptions} requestOptions - Request-specific configuration.
|
|
203
203
|
*
|
|
204
204
|
* @throws {@link Sync.UnauthorizedError}
|
|
205
205
|
* @throws {@link Sync.InternalServerError}
|
|
206
206
|
*
|
|
207
207
|
* @example
|
|
208
|
-
* await client.
|
|
208
|
+
* await client.generations.list()
|
|
209
209
|
*/
|
|
210
|
-
|
|
211
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
210
|
+
list(request = {}, requestOptions) {
|
|
211
|
+
return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions));
|
|
212
212
|
}
|
|
213
|
-
|
|
213
|
+
__list() {
|
|
214
214
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
215
215
|
var _a, _b, _c;
|
|
216
216
|
const { status } = request;
|
|
@@ -221,7 +221,7 @@ class Generate {
|
|
|
221
221
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
222
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
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.
|
|
224
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.1.9", "User-Agent": "@sync.so/sdk/0.1.9", "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
225
|
contentType: "application/json",
|
|
226
226
|
queryParameters: _queryParams,
|
|
227
227
|
requestType: "json",
|
|
@@ -265,19 +265,19 @@ class Generate {
|
|
|
265
265
|
}
|
|
266
266
|
/**
|
|
267
267
|
* @param {Sync.CreateGenerationDto} request
|
|
268
|
-
* @param {
|
|
268
|
+
* @param {Generations.RequestOptions} requestOptions - Request-specific configuration.
|
|
269
269
|
*
|
|
270
270
|
* @throws {@link Sync.UnauthorizedError}
|
|
271
271
|
* @throws {@link Sync.InternalServerError}
|
|
272
272
|
*
|
|
273
273
|
* @example
|
|
274
|
-
* await client.
|
|
274
|
+
* await client.generations.estimateCost({
|
|
275
275
|
* input: [{
|
|
276
276
|
* type: "video",
|
|
277
|
-
* url: "https://
|
|
277
|
+
* url: "https://assets.sync.so/docs/example-video.mp4"
|
|
278
278
|
* }, {
|
|
279
279
|
* type: "audio",
|
|
280
|
-
* url: "https://
|
|
280
|
+
* url: "https://assets.sync.so/docs/example-audio.wav"
|
|
281
281
|
* }],
|
|
282
282
|
* model: "lipsync-2",
|
|
283
283
|
* options: {
|
|
@@ -294,7 +294,7 @@ class Generate {
|
|
|
294
294
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
295
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
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.
|
|
297
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.1.9", "User-Agent": "@sync.so/sdk/0.1.9", "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
298
|
contentType: "application/json",
|
|
299
299
|
requestType: "json",
|
|
300
300
|
body: request,
|
|
@@ -343,4 +343,4 @@ class Generate {
|
|
|
343
343
|
});
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
|
-
exports.
|
|
346
|
+
exports.Generations = Generations;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { type ListGenerationsRequest } from "./ListGenerationsRequest";
|
|
@@ -3,5 +3,5 @@ export * from "./common/types";
|
|
|
3
3
|
export * as webhooks from "./webhooks";
|
|
4
4
|
export * from "./webhooks/types";
|
|
5
5
|
export * from "./common/errors";
|
|
6
|
-
export * as
|
|
7
|
-
export * from "./
|
|
6
|
+
export * as generations from "./generations";
|
|
7
|
+
export * from "./generations/client/requests";
|
|
@@ -36,11 +36,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
36
36
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.
|
|
39
|
+
exports.generations = exports.webhooks = exports.common = void 0;
|
|
40
40
|
exports.common = __importStar(require("./common"));
|
|
41
41
|
__exportStar(require("./common/types"), exports);
|
|
42
42
|
exports.webhooks = __importStar(require("./webhooks"));
|
|
43
43
|
__exportStar(require("./webhooks/types"), exports);
|
|
44
44
|
__exportStar(require("./common/errors"), exports);
|
|
45
|
-
exports.
|
|
46
|
-
__exportStar(require("./
|
|
45
|
+
exports.generations = __importStar(require("./generations"));
|
|
46
|
+
__exportStar(require("./generations/client/requests"), exports);
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.1.
|
|
1
|
+
export declare const SDK_VERSION = "0.1.9";
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
package/reference.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Reference
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Generations
|
|
4
4
|
|
|
5
|
-
<details><summary><code>client.
|
|
5
|
+
<details><summary><code>client.generations.<a href="/src/api/resources/generations/client/Client.ts">create</a>({ ...params }) -> Sync.Generation</code></summary>
|
|
6
6
|
<dl>
|
|
7
7
|
<dd>
|
|
8
8
|
|
|
@@ -15,15 +15,15 @@
|
|
|
15
15
|
<dd>
|
|
16
16
|
|
|
17
17
|
```typescript
|
|
18
|
-
await client.
|
|
18
|
+
await client.generations.create({
|
|
19
19
|
input: [
|
|
20
20
|
{
|
|
21
21
|
type: "video",
|
|
22
|
-
url: "https://
|
|
22
|
+
url: "https://assets.sync.so/docs/example-video.mp4",
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
type: "audio",
|
|
26
|
-
url: "https://
|
|
26
|
+
url: "https://assets.sync.so/docs/example-audio.wav",
|
|
27
27
|
},
|
|
28
28
|
],
|
|
29
29
|
model: "lipsync-2",
|
|
@@ -54,7 +54,7 @@ await client.generate.createGeneration({
|
|
|
54
54
|
<dl>
|
|
55
55
|
<dd>
|
|
56
56
|
|
|
57
|
-
**requestOptions:** `
|
|
57
|
+
**requestOptions:** `Generations.RequestOptions`
|
|
58
58
|
|
|
59
59
|
</dd>
|
|
60
60
|
</dl>
|
|
@@ -65,7 +65,7 @@ await client.generate.createGeneration({
|
|
|
65
65
|
</dl>
|
|
66
66
|
</details>
|
|
67
67
|
|
|
68
|
-
<details><summary><code>client.
|
|
68
|
+
<details><summary><code>client.generations.<a href="/src/api/resources/generations/client/Client.ts">get</a>(id) -> Sync.Generation</code></summary>
|
|
69
69
|
<dl>
|
|
70
70
|
<dd>
|
|
71
71
|
|
|
@@ -78,7 +78,7 @@ await client.generate.createGeneration({
|
|
|
78
78
|
<dd>
|
|
79
79
|
|
|
80
80
|
```typescript
|
|
81
|
-
await client.
|
|
81
|
+
await client.generations.get("6533643b-aceb-4c40-967e-d9ba9baac39e");
|
|
82
82
|
```
|
|
83
83
|
|
|
84
84
|
</dd>
|
|
@@ -102,7 +102,7 @@ await client.generate.getGeneration("6533643b-acbe-4c40-967e-d9ba9baac39e");
|
|
|
102
102
|
<dl>
|
|
103
103
|
<dd>
|
|
104
104
|
|
|
105
|
-
**requestOptions:** `
|
|
105
|
+
**requestOptions:** `Generations.RequestOptions`
|
|
106
106
|
|
|
107
107
|
</dd>
|
|
108
108
|
</dl>
|
|
@@ -113,7 +113,7 @@ await client.generate.getGeneration("6533643b-acbe-4c40-967e-d9ba9baac39e");
|
|
|
113
113
|
</dl>
|
|
114
114
|
</details>
|
|
115
115
|
|
|
116
|
-
<details><summary><code>client.
|
|
116
|
+
<details><summary><code>client.generations.<a href="/src/api/resources/generations/client/Client.ts">list</a>({ ...params }) -> Sync.Generation[]</code></summary>
|
|
117
117
|
<dl>
|
|
118
118
|
<dd>
|
|
119
119
|
|
|
@@ -126,7 +126,7 @@ await client.generate.getGeneration("6533643b-acbe-4c40-967e-d9ba9baac39e");
|
|
|
126
126
|
<dd>
|
|
127
127
|
|
|
128
128
|
```typescript
|
|
129
|
-
await client.
|
|
129
|
+
await client.generations.list();
|
|
130
130
|
```
|
|
131
131
|
|
|
132
132
|
</dd>
|
|
@@ -142,7 +142,7 @@ await client.generate.listGenerations();
|
|
|
142
142
|
<dl>
|
|
143
143
|
<dd>
|
|
144
144
|
|
|
145
|
-
**request:** `Sync.
|
|
145
|
+
**request:** `Sync.ListGenerationsRequest`
|
|
146
146
|
|
|
147
147
|
</dd>
|
|
148
148
|
</dl>
|
|
@@ -150,7 +150,7 @@ await client.generate.listGenerations();
|
|
|
150
150
|
<dl>
|
|
151
151
|
<dd>
|
|
152
152
|
|
|
153
|
-
**requestOptions:** `
|
|
153
|
+
**requestOptions:** `Generations.RequestOptions`
|
|
154
154
|
|
|
155
155
|
</dd>
|
|
156
156
|
</dl>
|
|
@@ -161,7 +161,7 @@ await client.generate.listGenerations();
|
|
|
161
161
|
</dl>
|
|
162
162
|
</details>
|
|
163
163
|
|
|
164
|
-
<details><summary><code>client.
|
|
164
|
+
<details><summary><code>client.generations.<a href="/src/api/resources/generations/client/Client.ts">estimateCost</a>({ ...params }) -> Sync.EstimatedGenerationCost[]</code></summary>
|
|
165
165
|
<dl>
|
|
166
166
|
<dd>
|
|
167
167
|
|
|
@@ -174,15 +174,15 @@ await client.generate.listGenerations();
|
|
|
174
174
|
<dd>
|
|
175
175
|
|
|
176
176
|
```typescript
|
|
177
|
-
await client.
|
|
177
|
+
await client.generations.estimateCost({
|
|
178
178
|
input: [
|
|
179
179
|
{
|
|
180
180
|
type: "video",
|
|
181
|
-
url: "https://
|
|
181
|
+
url: "https://assets.sync.so/docs/example-video.mp4",
|
|
182
182
|
},
|
|
183
183
|
{
|
|
184
184
|
type: "audio",
|
|
185
|
-
url: "https://
|
|
185
|
+
url: "https://assets.sync.so/docs/example-audio.wav",
|
|
186
186
|
},
|
|
187
187
|
],
|
|
188
188
|
model: "lipsync-2",
|
|
@@ -213,7 +213,7 @@ await client.generate.estimateCost({
|
|
|
213
213
|
<dl>
|
|
214
214
|
<dd>
|
|
215
215
|
|
|
216
|
-
**requestOptions:** `
|
|
216
|
+
**requestOptions:** `Generations.RequestOptions`
|
|
217
217
|
|
|
218
218
|
</dd>
|
|
219
219
|
</dl>
|
package/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.1.
|
|
1
|
+
export declare const SDK_VERSION = "0.1.9";
|
package/version.js
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { type LipsyncListGenerationsRequest } from "./LipsyncListGenerationsRequest";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { type LipsyncListGenerationsRequest } from "./LipsyncListGenerationsRequest";
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|