@sync.so/sdk 0.2.1 → 0.2.3

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 CHANGED
@@ -10,7 +10,7 @@ export declare namespace SyncClient {
10
10
  environment?: core.Supplier<environments.SyncEnvironment | string>;
11
11
  /** Specify a custom URL to connect the client to. */
12
12
  baseUrl?: core.Supplier<string>;
13
- apiKey: core.Supplier<string>;
13
+ apiKey?: core.Supplier<string>;
14
14
  fetcher?: core.FetchFunction;
15
15
  }
16
16
  interface RequestOptions {
@@ -28,7 +28,7 @@ export declare class SyncClient {
28
28
  protected readonly _options: SyncClient.Options;
29
29
  protected _batch: Batch | undefined;
30
30
  protected _generations: Generations | undefined;
31
- constructor(_options: SyncClient.Options);
31
+ constructor(_options?: SyncClient.Options);
32
32
  get batch(): Batch;
33
33
  get generations(): Generations;
34
34
  }
package/Client.js CHANGED
@@ -7,7 +7,7 @@ exports.SyncClient = void 0;
7
7
  const Client_1 = require("./api/resources/batch/client/Client");
8
8
  const Client_2 = require("./api/resources/generations/client/Client");
9
9
  class SyncClient {
10
- constructor(_options) {
10
+ constructor(_options = {}) {
11
11
  this._options = _options;
12
12
  }
13
13
  get batch() {
package/README.md CHANGED
@@ -1,13 +1,13 @@
1
- # Sync TypeScript Library
1
+ # Sync TypeScript SDK
2
2
 
3
3
  [![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](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
4
  [![npm shield](https://img.shields.io/npm/v/@sync.so/sdk)](https://www.npmjs.com/package/@sync.so/sdk)
5
5
 
6
- The Sync TypeScript library provides convenient access to the Sync API from TypeScript.
6
+ The Sync TypeScript SDK provides convenient access to the Sync API from TypeScript.
7
7
 
8
8
  ## Documentation
9
9
 
10
- API reference documentation is available [here](https://sync.docs.buildwithfern.com/api-reference).
10
+ API reference documentation is available [here](https://docs.sync.so/api-reference).
11
11
 
12
12
  ## Installation
13
13
 
@@ -21,13 +21,13 @@ A full reference for this library is available [here](./reference.md).
21
21
 
22
22
  ## Usage
23
23
 
24
- Instantiate and use the client with the following:
24
+ Set SYNC_API_KEY environment variable to your [Sync](https://sync.so/settings/api-keys) and use the client with the following:
25
25
 
26
26
  ```typescript
27
27
  import { SyncClient } from "@sync.so/sdk";
28
28
 
29
- const client = new SyncClient({ apiKey: "YOUR_API_KEY" });
30
- await client.generations.create({
29
+ const sync = new SyncClient();
30
+ await sync.generations.create({
31
31
  input: [
32
32
  {
33
33
  type: "video",
@@ -11,7 +11,7 @@ export declare namespace Batch {
11
11
  environment?: core.Supplier<environments.SyncEnvironment | string>;
12
12
  /** Specify a custom URL to connect the client to. */
13
13
  baseUrl?: core.Supplier<string>;
14
- apiKey: core.Supplier<string>;
14
+ apiKey?: core.Supplier<string>;
15
15
  fetcher?: core.FetchFunction;
16
16
  }
17
17
  interface RequestOptions {
@@ -27,7 +27,7 @@ export declare namespace Batch {
27
27
  }
28
28
  export declare class Batch {
29
29
  protected readonly _options: Batch.Options;
30
- constructor(_options: Batch.Options);
30
+ constructor(_options?: Batch.Options);
31
31
  /**
32
32
  * API for [Batch Processing](/api-reference/guides/batch-processing). Available only for `Scale` and `Enterprise` plans.
33
33
  *
@@ -84,6 +84,6 @@ export declare class Batch {
84
84
  list(request?: Sync.ListBatchesRequest, requestOptions?: Batch.RequestOptions): core.HttpResponsePromise<Sync.BatchResponse[]>;
85
85
  private __list;
86
86
  protected _getCustomAuthorizationHeaders(): Promise<{
87
- "x-api-key": string;
87
+ "x-api-key": string | undefined;
88
88
  }>;
89
89
  }
@@ -55,7 +55,7 @@ const Sync = __importStar(require("../../../index"));
55
55
  const url_join_1 = __importDefault(require("url-join"));
56
56
  const errors = __importStar(require("../../../../errors/index"));
57
57
  class Batch {
58
- constructor(_options) {
58
+ constructor(_options = {}) {
59
59
  this._options = _options;
60
60
  }
61
61
  /**
@@ -100,7 +100,7 @@ class Batch {
100
100
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
101
101
  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/batch"),
102
102
  method: "POST",
103
- headers: Object.assign(Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.2.1", "User-Agent": "@sync.so/sdk/0.2.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
103
+ headers: Object.assign(Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.2.3", "User-Agent": "@sync.so/sdk/0.2.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
104
104
  requestType: "file",
105
105
  duplex: _maybeEncodedRequest.duplex,
106
106
  body: _maybeEncodedRequest.body,
@@ -170,7 +170,7 @@ class Batch {
170
170
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
171
171
  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/batch/${encodeURIComponent(id)}`),
172
172
  method: "GET",
173
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.2.1", "User-Agent": "@sync.so/sdk/0.2.1", "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),
173
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.2.3", "User-Agent": "@sync.so/sdk/0.2.3", "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),
174
174
  contentType: "application/json",
175
175
  requestType: "json",
176
176
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -245,7 +245,7 @@ class Batch {
245
245
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
246
246
  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/batch"),
247
247
  method: "GET",
248
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.2.1", "User-Agent": "@sync.so/sdk/0.2.1", "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),
248
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.2.3", "User-Agent": "@sync.so/sdk/0.2.3", "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),
249
249
  contentType: "application/json",
250
250
  queryParameters: _queryParams,
251
251
  requestType: "json",
@@ -289,7 +289,8 @@ class Batch {
289
289
  }
290
290
  _getCustomAuthorizationHeaders() {
291
291
  return __awaiter(this, void 0, void 0, function* () {
292
- const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
292
+ var _a;
293
+ const apiKeyValue = (_a = (yield core.Supplier.get(this._options.apiKey))) !== null && _a !== void 0 ? _a : process === null || process === void 0 ? void 0 : process.env["SYNC_API_KEY"];
293
294
  return { "x-api-key": apiKeyValue };
294
295
  });
295
296
  }
@@ -7,6 +7,8 @@ export interface Generation {
7
7
  createdAt: string;
8
8
  /** The error message if the generation failed. */
9
9
  error?: string;
10
+ /** The error code if the generation failed. */
11
+ error_code?: string;
10
12
  id: Sync.GenerationId;
11
13
  /** An array of input objects used for generation. */
12
14
  input: Sync.Input[];
@@ -4,8 +4,9 @@
4
4
  /**
5
5
  * name of the model to use for generation.
6
6
  */
7
- export type Model = "lipsync-2" | "lipsync-1.9.0-beta";
7
+ export type Model = "lipsync-2" | "lipsync-1.9.0-beta" | "lipsync-2-pro";
8
8
  export declare const Model: {
9
9
  readonly Lipsync2: "lipsync-2";
10
10
  readonly Lipsync190Beta: "lipsync-1.9.0-beta";
11
+ readonly Lipsync2Pro: "lipsync-2-pro";
11
12
  };
@@ -7,4 +7,5 @@ exports.Model = void 0;
7
7
  exports.Model = {
8
8
  Lipsync2: "lipsync-2",
9
9
  Lipsync190Beta: "lipsync-1.9.0-beta",
10
+ Lipsync2Pro: "lipsync-2-pro",
10
11
  };
@@ -11,7 +11,7 @@ export declare namespace Generations {
11
11
  environment?: core.Supplier<environments.SyncEnvironment | string>;
12
12
  /** Specify a custom URL to connect the client to. */
13
13
  baseUrl?: core.Supplier<string>;
14
- apiKey: core.Supplier<string>;
14
+ apiKey?: core.Supplier<string>;
15
15
  fetcher?: core.FetchFunction;
16
16
  }
17
17
  interface RequestOptions {
@@ -27,7 +27,7 @@ export declare namespace Generations {
27
27
  }
28
28
  export declare class Generations {
29
29
  protected readonly _options: Generations.Options;
30
- constructor(_options: Generations.Options);
30
+ constructor(_options?: Generations.Options);
31
31
  /**
32
32
  * @param {Sync.CreateGenerationDto} request
33
33
  * @param {Generations.RequestOptions} requestOptions - Request-specific configuration.
@@ -120,6 +120,6 @@ export declare class Generations {
120
120
  estimateCost(request: Sync.CreateGenerationDto, requestOptions?: Generations.RequestOptions): core.HttpResponsePromise<Sync.EstimatedGenerationCost[]>;
121
121
  private __estimateCost;
122
122
  protected _getCustomAuthorizationHeaders(): Promise<{
123
- "x-api-key": string;
123
+ "x-api-key": string | undefined;
124
124
  }>;
125
125
  }
@@ -56,7 +56,7 @@ const url_join_1 = __importDefault(require("url-join"));
56
56
  const errors = __importStar(require("../../../../errors/index"));
57
57
  const json_1 = require("../../../../core/json");
58
58
  class Generations {
59
- constructor(_options) {
59
+ constructor(_options = {}) {
60
60
  this._options = _options;
61
61
  }
62
62
  /**
@@ -91,7 +91,7 @@ class Generations {
91
91
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
92
92
  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"),
93
93
  method: "POST",
94
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.2.1", "User-Agent": "@sync.so/sdk/0.2.1", "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
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.2.3", "User-Agent": "@sync.so/sdk/0.2.3", "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),
95
95
  contentType: "application/json",
96
96
  requestType: "json",
97
97
  body: request,
@@ -179,7 +179,7 @@ class Generations {
179
179
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
180
180
  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"),
181
181
  method: "POST",
182
- headers: Object.assign(Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.2.1", "User-Agent": "@sync.so/sdk/0.2.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
182
+ headers: Object.assign(Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.2.3", "User-Agent": "@sync.so/sdk/0.2.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
183
183
  requestType: "file",
184
184
  duplex: _maybeEncodedRequest.duplex,
185
185
  body: _maybeEncodedRequest.body,
@@ -243,7 +243,7 @@ class Generations {
243
243
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
244
244
  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)}`),
245
245
  method: "GET",
246
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.2.1", "User-Agent": "@sync.so/sdk/0.2.1", "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),
246
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.2.3", "User-Agent": "@sync.so/sdk/0.2.3", "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),
247
247
  contentType: "application/json",
248
248
  requestType: "json",
249
249
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -310,7 +310,7 @@ class Generations {
310
310
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
311
311
  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"),
312
312
  method: "GET",
313
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.2.1", "User-Agent": "@sync.so/sdk/0.2.1", "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),
313
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.2.3", "User-Agent": "@sync.so/sdk/0.2.3", "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),
314
314
  contentType: "application/json",
315
315
  queryParameters: _queryParams,
316
316
  requestType: "json",
@@ -383,7 +383,7 @@ class Generations {
383
383
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
384
384
  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"),
385
385
  method: "POST",
386
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.2.1", "User-Agent": "@sync.so/sdk/0.2.1", "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),
386
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.2.3", "User-Agent": "@sync.so/sdk/0.2.3", "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),
387
387
  contentType: "application/json",
388
388
  requestType: "json",
389
389
  body: request,
@@ -427,7 +427,8 @@ class Generations {
427
427
  }
428
428
  _getCustomAuthorizationHeaders() {
429
429
  return __awaiter(this, void 0, void 0, function* () {
430
- const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
430
+ var _a;
431
+ const apiKeyValue = (_a = (yield core.Supplier.get(this._options.apiKey))) !== null && _a !== void 0 ? _a : process === null || process === void 0 ? void 0 : process.env["SYNC_API_KEY"];
431
432
  return { "x-api-key": apiKeyValue };
432
433
  });
433
434
  }
@@ -13,6 +13,8 @@ export interface GenerationNotification {
13
13
  model: Sync.Model;
14
14
  /** error message if the generation failed */
15
15
  error?: string;
16
+ /** error code if the generation failed */
17
+ error_code?: string;
16
18
  /** options used for the generation */
17
19
  options?: Sync.GenerationOptions;
18
20
  /** generated output media duration in seconds */
package/dist/Client.d.ts CHANGED
@@ -10,7 +10,7 @@ export declare namespace SyncClient {
10
10
  environment?: core.Supplier<environments.SyncEnvironment | string>;
11
11
  /** Specify a custom URL to connect the client to. */
12
12
  baseUrl?: core.Supplier<string>;
13
- apiKey: core.Supplier<string>;
13
+ apiKey?: core.Supplier<string>;
14
14
  fetcher?: core.FetchFunction;
15
15
  }
16
16
  interface RequestOptions {
@@ -28,7 +28,7 @@ export declare class SyncClient {
28
28
  protected readonly _options: SyncClient.Options;
29
29
  protected _batch: Batch | undefined;
30
30
  protected _generations: Generations | undefined;
31
- constructor(_options: SyncClient.Options);
31
+ constructor(_options?: SyncClient.Options);
32
32
  get batch(): Batch;
33
33
  get generations(): Generations;
34
34
  }
package/dist/Client.js CHANGED
@@ -7,7 +7,7 @@ exports.SyncClient = void 0;
7
7
  const Client_1 = require("./api/resources/batch/client/Client");
8
8
  const Client_2 = require("./api/resources/generations/client/Client");
9
9
  class SyncClient {
10
- constructor(_options) {
10
+ constructor(_options = {}) {
11
11
  this._options = _options;
12
12
  }
13
13
  get batch() {
@@ -11,7 +11,7 @@ export declare namespace Batch {
11
11
  environment?: core.Supplier<environments.SyncEnvironment | string>;
12
12
  /** Specify a custom URL to connect the client to. */
13
13
  baseUrl?: core.Supplier<string>;
14
- apiKey: core.Supplier<string>;
14
+ apiKey?: core.Supplier<string>;
15
15
  fetcher?: core.FetchFunction;
16
16
  }
17
17
  interface RequestOptions {
@@ -27,7 +27,7 @@ export declare namespace Batch {
27
27
  }
28
28
  export declare class Batch {
29
29
  protected readonly _options: Batch.Options;
30
- constructor(_options: Batch.Options);
30
+ constructor(_options?: Batch.Options);
31
31
  /**
32
32
  * API for [Batch Processing](/api-reference/guides/batch-processing). Available only for `Scale` and `Enterprise` plans.
33
33
  *
@@ -84,6 +84,6 @@ export declare class Batch {
84
84
  list(request?: Sync.ListBatchesRequest, requestOptions?: Batch.RequestOptions): core.HttpResponsePromise<Sync.BatchResponse[]>;
85
85
  private __list;
86
86
  protected _getCustomAuthorizationHeaders(): Promise<{
87
- "x-api-key": string;
87
+ "x-api-key": string | undefined;
88
88
  }>;
89
89
  }
@@ -55,7 +55,7 @@ const Sync = __importStar(require("../../../index"));
55
55
  const url_join_1 = __importDefault(require("url-join"));
56
56
  const errors = __importStar(require("../../../../errors/index"));
57
57
  class Batch {
58
- constructor(_options) {
58
+ constructor(_options = {}) {
59
59
  this._options = _options;
60
60
  }
61
61
  /**
@@ -100,7 +100,7 @@ class Batch {
100
100
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
101
101
  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/batch"),
102
102
  method: "POST",
103
- headers: Object.assign(Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.2.1", "User-Agent": "@sync.so/sdk/0.2.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
103
+ headers: Object.assign(Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.2.3", "User-Agent": "@sync.so/sdk/0.2.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
104
104
  requestType: "file",
105
105
  duplex: _maybeEncodedRequest.duplex,
106
106
  body: _maybeEncodedRequest.body,
@@ -170,7 +170,7 @@ class Batch {
170
170
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
171
171
  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/batch/${encodeURIComponent(id)}`),
172
172
  method: "GET",
173
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.2.1", "User-Agent": "@sync.so/sdk/0.2.1", "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),
173
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.2.3", "User-Agent": "@sync.so/sdk/0.2.3", "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),
174
174
  contentType: "application/json",
175
175
  requestType: "json",
176
176
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -245,7 +245,7 @@ class Batch {
245
245
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
246
246
  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/batch"),
247
247
  method: "GET",
248
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.2.1", "User-Agent": "@sync.so/sdk/0.2.1", "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),
248
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.2.3", "User-Agent": "@sync.so/sdk/0.2.3", "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),
249
249
  contentType: "application/json",
250
250
  queryParameters: _queryParams,
251
251
  requestType: "json",
@@ -289,7 +289,8 @@ class Batch {
289
289
  }
290
290
  _getCustomAuthorizationHeaders() {
291
291
  return __awaiter(this, void 0, void 0, function* () {
292
- const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
292
+ var _a;
293
+ const apiKeyValue = (_a = (yield core.Supplier.get(this._options.apiKey))) !== null && _a !== void 0 ? _a : process === null || process === void 0 ? void 0 : process.env["SYNC_API_KEY"];
293
294
  return { "x-api-key": apiKeyValue };
294
295
  });
295
296
  }
@@ -7,6 +7,8 @@ export interface Generation {
7
7
  createdAt: string;
8
8
  /** The error message if the generation failed. */
9
9
  error?: string;
10
+ /** The error code if the generation failed. */
11
+ error_code?: string;
10
12
  id: Sync.GenerationId;
11
13
  /** An array of input objects used for generation. */
12
14
  input: Sync.Input[];
@@ -4,8 +4,9 @@
4
4
  /**
5
5
  * name of the model to use for generation.
6
6
  */
7
- export type Model = "lipsync-2" | "lipsync-1.9.0-beta";
7
+ export type Model = "lipsync-2" | "lipsync-1.9.0-beta" | "lipsync-2-pro";
8
8
  export declare const Model: {
9
9
  readonly Lipsync2: "lipsync-2";
10
10
  readonly Lipsync190Beta: "lipsync-1.9.0-beta";
11
+ readonly Lipsync2Pro: "lipsync-2-pro";
11
12
  };
@@ -7,4 +7,5 @@ exports.Model = void 0;
7
7
  exports.Model = {
8
8
  Lipsync2: "lipsync-2",
9
9
  Lipsync190Beta: "lipsync-1.9.0-beta",
10
+ Lipsync2Pro: "lipsync-2-pro",
10
11
  };
@@ -11,7 +11,7 @@ export declare namespace Generations {
11
11
  environment?: core.Supplier<environments.SyncEnvironment | string>;
12
12
  /** Specify a custom URL to connect the client to. */
13
13
  baseUrl?: core.Supplier<string>;
14
- apiKey: core.Supplier<string>;
14
+ apiKey?: core.Supplier<string>;
15
15
  fetcher?: core.FetchFunction;
16
16
  }
17
17
  interface RequestOptions {
@@ -27,7 +27,7 @@ export declare namespace Generations {
27
27
  }
28
28
  export declare class Generations {
29
29
  protected readonly _options: Generations.Options;
30
- constructor(_options: Generations.Options);
30
+ constructor(_options?: Generations.Options);
31
31
  /**
32
32
  * @param {Sync.CreateGenerationDto} request
33
33
  * @param {Generations.RequestOptions} requestOptions - Request-specific configuration.
@@ -120,6 +120,6 @@ export declare class Generations {
120
120
  estimateCost(request: Sync.CreateGenerationDto, requestOptions?: Generations.RequestOptions): core.HttpResponsePromise<Sync.EstimatedGenerationCost[]>;
121
121
  private __estimateCost;
122
122
  protected _getCustomAuthorizationHeaders(): Promise<{
123
- "x-api-key": string;
123
+ "x-api-key": string | undefined;
124
124
  }>;
125
125
  }
@@ -56,7 +56,7 @@ const url_join_1 = __importDefault(require("url-join"));
56
56
  const errors = __importStar(require("../../../../errors/index"));
57
57
  const json_1 = require("../../../../core/json");
58
58
  class Generations {
59
- constructor(_options) {
59
+ constructor(_options = {}) {
60
60
  this._options = _options;
61
61
  }
62
62
  /**
@@ -91,7 +91,7 @@ class Generations {
91
91
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
92
92
  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"),
93
93
  method: "POST",
94
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.2.1", "User-Agent": "@sync.so/sdk/0.2.1", "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
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.2.3", "User-Agent": "@sync.so/sdk/0.2.3", "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),
95
95
  contentType: "application/json",
96
96
  requestType: "json",
97
97
  body: request,
@@ -179,7 +179,7 @@ class Generations {
179
179
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
180
180
  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"),
181
181
  method: "POST",
182
- headers: Object.assign(Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.2.1", "User-Agent": "@sync.so/sdk/0.2.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
182
+ headers: Object.assign(Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.2.3", "User-Agent": "@sync.so/sdk/0.2.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
183
183
  requestType: "file",
184
184
  duplex: _maybeEncodedRequest.duplex,
185
185
  body: _maybeEncodedRequest.body,
@@ -243,7 +243,7 @@ class Generations {
243
243
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
244
244
  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)}`),
245
245
  method: "GET",
246
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.2.1", "User-Agent": "@sync.so/sdk/0.2.1", "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),
246
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.2.3", "User-Agent": "@sync.so/sdk/0.2.3", "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),
247
247
  contentType: "application/json",
248
248
  requestType: "json",
249
249
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -310,7 +310,7 @@ class Generations {
310
310
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
311
311
  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"),
312
312
  method: "GET",
313
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.2.1", "User-Agent": "@sync.so/sdk/0.2.1", "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),
313
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.2.3", "User-Agent": "@sync.so/sdk/0.2.3", "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),
314
314
  contentType: "application/json",
315
315
  queryParameters: _queryParams,
316
316
  requestType: "json",
@@ -383,7 +383,7 @@ class Generations {
383
383
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
384
384
  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"),
385
385
  method: "POST",
386
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.2.1", "User-Agent": "@sync.so/sdk/0.2.1", "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),
386
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.2.3", "User-Agent": "@sync.so/sdk/0.2.3", "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),
387
387
  contentType: "application/json",
388
388
  requestType: "json",
389
389
  body: request,
@@ -427,7 +427,8 @@ class Generations {
427
427
  }
428
428
  _getCustomAuthorizationHeaders() {
429
429
  return __awaiter(this, void 0, void 0, function* () {
430
- const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
430
+ var _a;
431
+ const apiKeyValue = (_a = (yield core.Supplier.get(this._options.apiKey))) !== null && _a !== void 0 ? _a : process === null || process === void 0 ? void 0 : process.env["SYNC_API_KEY"];
431
432
  return { "x-api-key": apiKeyValue };
432
433
  });
433
434
  }
@@ -13,6 +13,8 @@ export interface GenerationNotification {
13
13
  model: Sync.Model;
14
14
  /** error message if the generation failed */
15
15
  error?: string;
16
+ /** error code if the generation failed */
17
+ error_code?: string;
16
18
  /** options used for the generation */
17
19
  options?: Sync.GenerationOptions;
18
20
  /** generated output media duration in seconds */
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.2.1";
1
+ export declare const SDK_VERSION = "0.2.3";
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "0.2.1";
4
+ exports.SDK_VERSION = "0.2.3";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sync.so/sdk",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "private": false,
5
5
  "repository": "https://github.com/synchronicity-labs/sync-typescript-sdk",
6
6
  "main": "./index.js",
package/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.2.1";
1
+ export declare const SDK_VERSION = "0.2.3";
package/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "0.2.1";
4
+ exports.SDK_VERSION = "0.2.3";