@sync.so/sdk 0.2.5 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Client.d.ts +6 -0
- package/Client.js +14 -4
- package/api/resources/assets/client/Client.d.ts +64 -0
- package/api/resources/assets/client/Client.js +221 -0
- package/api/resources/assets/client/index.d.ts +1 -0
- package/api/resources/assets/client/index.js +17 -0
- package/api/resources/assets/client/requests/ListAssetsRequest.d.ts +37 -0
- package/api/resources/assets/client/requests/ListAssetsRequest.js +5 -0
- package/api/resources/assets/client/requests/index.d.ts +1 -0
- package/api/resources/assets/client/requests/index.js +2 -0
- package/api/resources/assets/index.d.ts +1 -0
- package/api/resources/assets/index.js +17 -0
- package/api/resources/batch/client/Client.js +3 -3
- package/api/resources/common/types/ActiveSpeaker.d.ts +6 -0
- package/api/resources/common/types/Asset.d.ts +36 -0
- package/api/resources/common/types/Asset.js +5 -0
- package/api/resources/common/types/AssetId.d.ts +7 -0
- package/api/resources/common/types/AssetId.js +5 -0
- package/api/resources/common/types/AssetInputType.d.ts +15 -0
- package/api/resources/common/types/AssetInputType.js +14 -0
- package/api/resources/common/types/AssetSort.d.ts +19 -0
- package/api/resources/common/types/AssetSort.js +18 -0
- package/api/resources/common/types/AssetType.d.ts +12 -0
- package/api/resources/common/types/AssetType.js +11 -0
- package/api/resources/common/types/AssetVisibility.d.ts +17 -0
- package/api/resources/common/types/AssetVisibility.js +10 -0
- package/api/resources/common/types/Audio.d.ts +5 -2
- package/api/resources/common/types/ElevenLabs.d.ts +5 -1
- package/api/resources/common/types/Emotion.d.ts +15 -0
- package/api/resources/common/types/Emotion.js +14 -0
- package/api/resources/common/types/GenerationOptions.d.ts +4 -0
- package/api/resources/common/types/Model.d.ts +3 -1
- package/api/resources/common/types/Model.js +2 -0
- package/api/resources/common/types/ModelInfo.d.ts +21 -0
- package/api/resources/common/types/ModelInfo.js +5 -0
- package/api/resources/common/types/ModelMode.d.ts +12 -0
- package/api/resources/common/types/ModelMode.js +11 -0
- package/api/resources/common/types/ModelType.d.ts +11 -0
- package/api/resources/common/types/ModelType.js +10 -0
- package/api/resources/common/types/PaginatedAssetsResponse.d.ts +15 -0
- package/api/resources/common/types/PaginatedAssetsResponse.js +5 -0
- package/api/resources/common/types/Video.d.ts +9 -4
- package/api/resources/common/types/index.d.ts +11 -0
- package/api/resources/common/types/index.js +11 -0
- package/api/resources/generations/client/Client.js +10 -7
- package/api/resources/generations/client/requests/ListGenerationsRequest.d.ts +6 -2
- package/api/resources/index.d.ts +3 -0
- package/api/resources/index.js +4 -1
- package/api/resources/models/client/Client.d.ts +45 -0
- package/api/resources/models/client/Client.js +130 -0
- package/api/resources/models/client/index.d.ts +1 -0
- package/api/resources/models/client/index.js +2 -0
- package/api/resources/models/index.d.ts +1 -0
- package/api/resources/models/index.js +17 -0
- package/core/index.d.ts +1 -1
- package/core/index.js +1 -1
- package/dist/Client.d.ts +6 -0
- package/dist/Client.js +14 -4
- package/dist/api/resources/assets/client/Client.d.ts +64 -0
- package/dist/api/resources/assets/client/Client.js +221 -0
- package/dist/api/resources/assets/client/index.d.ts +1 -0
- package/dist/api/resources/assets/client/index.js +17 -0
- package/dist/api/resources/assets/client/requests/ListAssetsRequest.d.ts +37 -0
- package/dist/api/resources/assets/client/requests/ListAssetsRequest.js +5 -0
- package/dist/api/resources/assets/client/requests/index.d.ts +1 -0
- package/dist/api/resources/assets/client/requests/index.js +2 -0
- package/dist/api/resources/assets/index.d.ts +1 -0
- package/dist/api/resources/assets/index.js +17 -0
- package/dist/api/resources/batch/client/Client.js +3 -3
- package/dist/api/resources/common/types/ActiveSpeaker.d.ts +6 -0
- package/dist/api/resources/common/types/Asset.d.ts +36 -0
- package/dist/api/resources/common/types/Asset.js +5 -0
- package/dist/api/resources/common/types/AssetId.d.ts +7 -0
- package/dist/api/resources/common/types/AssetId.js +5 -0
- package/dist/api/resources/common/types/AssetInputType.d.ts +15 -0
- package/dist/api/resources/common/types/AssetInputType.js +14 -0
- package/dist/api/resources/common/types/AssetSort.d.ts +19 -0
- package/dist/api/resources/common/types/AssetSort.js +18 -0
- package/dist/api/resources/common/types/AssetType.d.ts +12 -0
- package/dist/api/resources/common/types/AssetType.js +11 -0
- package/dist/api/resources/common/types/AssetVisibility.d.ts +17 -0
- package/dist/api/resources/common/types/AssetVisibility.js +10 -0
- package/dist/api/resources/common/types/Audio.d.ts +5 -2
- package/dist/api/resources/common/types/ElevenLabs.d.ts +5 -1
- package/dist/api/resources/common/types/Emotion.d.ts +15 -0
- package/dist/api/resources/common/types/Emotion.js +14 -0
- package/dist/api/resources/common/types/GenerationOptions.d.ts +4 -0
- package/dist/api/resources/common/types/Model.d.ts +3 -1
- package/dist/api/resources/common/types/Model.js +2 -0
- package/dist/api/resources/common/types/ModelInfo.d.ts +21 -0
- package/dist/api/resources/common/types/ModelInfo.js +5 -0
- package/dist/api/resources/common/types/ModelMode.d.ts +12 -0
- package/dist/api/resources/common/types/ModelMode.js +11 -0
- package/dist/api/resources/common/types/ModelType.d.ts +11 -0
- package/dist/api/resources/common/types/ModelType.js +10 -0
- package/dist/api/resources/common/types/PaginatedAssetsResponse.d.ts +15 -0
- package/dist/api/resources/common/types/PaginatedAssetsResponse.js +5 -0
- package/dist/api/resources/common/types/Video.d.ts +9 -4
- package/dist/api/resources/common/types/index.d.ts +11 -0
- package/dist/api/resources/common/types/index.js +11 -0
- package/dist/api/resources/generations/client/Client.js +10 -7
- package/dist/api/resources/generations/client/requests/ListGenerationsRequest.d.ts +6 -2
- package/dist/api/resources/index.d.ts +3 -0
- package/dist/api/resources/index.js +4 -1
- package/dist/api/resources/models/client/Client.d.ts +45 -0
- package/dist/api/resources/models/client/Client.js +130 -0
- package/dist/api/resources/models/client/index.d.ts +1 -0
- package/dist/api/resources/models/client/index.js +2 -0
- package/dist/api/resources/models/index.d.ts +1 -0
- package/dist/api/resources/models/index.js +17 -0
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/reference.md +188 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
package/Client.d.ts
CHANGED
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as environments from "./environments";
|
|
5
5
|
import * as core from "./core";
|
|
6
|
+
import { Assets } from "./api/resources/assets/client/Client";
|
|
6
7
|
import { Batch } from "./api/resources/batch/client/Client";
|
|
7
8
|
import { Generations } from "./api/resources/generations/client/Client";
|
|
9
|
+
import { Models } from "./api/resources/models/client/Client";
|
|
8
10
|
export declare namespace SyncClient {
|
|
9
11
|
interface Options {
|
|
10
12
|
environment?: core.Supplier<environments.SyncEnvironment | string>;
|
|
@@ -26,9 +28,13 @@ export declare namespace SyncClient {
|
|
|
26
28
|
}
|
|
27
29
|
export declare class SyncClient {
|
|
28
30
|
protected readonly _options: SyncClient.Options;
|
|
31
|
+
protected _assets: Assets | undefined;
|
|
29
32
|
protected _batch: Batch | undefined;
|
|
30
33
|
protected _generations: Generations | undefined;
|
|
34
|
+
protected _models: Models | undefined;
|
|
31
35
|
constructor(_options?: SyncClient.Options);
|
|
36
|
+
get assets(): Assets;
|
|
32
37
|
get batch(): Batch;
|
|
33
38
|
get generations(): Generations;
|
|
39
|
+
get models(): Models;
|
|
34
40
|
}
|
package/Client.js
CHANGED
|
@@ -4,19 +4,29 @@
|
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.SyncClient = void 0;
|
|
7
|
-
const Client_1 = require("./api/resources/
|
|
8
|
-
const Client_2 = require("./api/resources/
|
|
7
|
+
const Client_1 = require("./api/resources/assets/client/Client");
|
|
8
|
+
const Client_2 = require("./api/resources/batch/client/Client");
|
|
9
|
+
const Client_3 = require("./api/resources/generations/client/Client");
|
|
10
|
+
const Client_4 = require("./api/resources/models/client/Client");
|
|
9
11
|
class SyncClient {
|
|
10
12
|
constructor(_options = {}) {
|
|
11
13
|
this._options = _options;
|
|
12
14
|
}
|
|
15
|
+
get assets() {
|
|
16
|
+
var _a;
|
|
17
|
+
return ((_a = this._assets) !== null && _a !== void 0 ? _a : (this._assets = new Client_1.Assets(this._options)));
|
|
18
|
+
}
|
|
13
19
|
get batch() {
|
|
14
20
|
var _a;
|
|
15
|
-
return ((_a = this._batch) !== null && _a !== void 0 ? _a : (this._batch = new
|
|
21
|
+
return ((_a = this._batch) !== null && _a !== void 0 ? _a : (this._batch = new Client_2.Batch(this._options)));
|
|
16
22
|
}
|
|
17
23
|
get generations() {
|
|
18
24
|
var _a;
|
|
19
|
-
return ((_a = this._generations) !== null && _a !== void 0 ? _a : (this._generations = new
|
|
25
|
+
return ((_a = this._generations) !== null && _a !== void 0 ? _a : (this._generations = new Client_3.Generations(this._options)));
|
|
26
|
+
}
|
|
27
|
+
get models() {
|
|
28
|
+
var _a;
|
|
29
|
+
return ((_a = this._models) !== null && _a !== void 0 ? _a : (this._models = new Client_4.Models(this._options)));
|
|
20
30
|
}
|
|
21
31
|
}
|
|
22
32
|
exports.SyncClient = SyncClient;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as environments from "../../../../environments";
|
|
5
|
+
import * as core from "../../../../core";
|
|
6
|
+
import * as Sync from "../../../index";
|
|
7
|
+
export declare namespace Assets {
|
|
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 Assets {
|
|
27
|
+
protected readonly _options: Assets.Options;
|
|
28
|
+
constructor(_options?: Assets.Options);
|
|
29
|
+
/**
|
|
30
|
+
* List all assets in your organization's media library.
|
|
31
|
+
*
|
|
32
|
+
* @param {Sync.ListAssetsRequest} request
|
|
33
|
+
* @param {Assets.RequestOptions} requestOptions - Request-specific configuration.
|
|
34
|
+
*
|
|
35
|
+
* @throws {@link Sync.UnauthorizedError}
|
|
36
|
+
* @throws {@link Sync.InternalServerError}
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* await client.assets.list({
|
|
40
|
+
* limit: 10,
|
|
41
|
+
* sortBy: "dateDesc"
|
|
42
|
+
* })
|
|
43
|
+
*/
|
|
44
|
+
list(request?: Sync.ListAssetsRequest, requestOptions?: Assets.RequestOptions): core.HttpResponsePromise<Sync.PaginatedAssetsResponse>;
|
|
45
|
+
private __list;
|
|
46
|
+
/**
|
|
47
|
+
* Retrieve a specific asset by ID.
|
|
48
|
+
*
|
|
49
|
+
* @param {Sync.AssetId} id
|
|
50
|
+
* @param {Assets.RequestOptions} requestOptions - Request-specific configuration.
|
|
51
|
+
*
|
|
52
|
+
* @throws {@link Sync.UnauthorizedError}
|
|
53
|
+
* @throws {@link Sync.NotFoundError}
|
|
54
|
+
* @throws {@link Sync.InternalServerError}
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* await client.assets.get("550e8400-e29b-41d4-a716-446655440000")
|
|
58
|
+
*/
|
|
59
|
+
get(id: Sync.AssetId, requestOptions?: Assets.RequestOptions): core.HttpResponsePromise<Sync.Asset>;
|
|
60
|
+
private __get;
|
|
61
|
+
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
62
|
+
"x-api-key": string | undefined;
|
|
63
|
+
}>;
|
|
64
|
+
}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
39
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
40
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
41
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
42
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
43
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
44
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
48
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
49
|
+
};
|
|
50
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
|
+
exports.Assets = void 0;
|
|
52
|
+
const environments = __importStar(require("../../../../environments"));
|
|
53
|
+
const core = __importStar(require("../../../../core"));
|
|
54
|
+
const Sync = __importStar(require("../../../index"));
|
|
55
|
+
const json_1 = require("../../../../core/json");
|
|
56
|
+
const url_join_1 = __importDefault(require("url-join"));
|
|
57
|
+
const errors = __importStar(require("../../../../errors/index"));
|
|
58
|
+
class Assets {
|
|
59
|
+
constructor(_options = {}) {
|
|
60
|
+
this._options = _options;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* List all assets in your organization's media library.
|
|
64
|
+
*
|
|
65
|
+
* @param {Sync.ListAssetsRequest} request
|
|
66
|
+
* @param {Assets.RequestOptions} requestOptions - Request-specific configuration.
|
|
67
|
+
*
|
|
68
|
+
* @throws {@link Sync.UnauthorizedError}
|
|
69
|
+
* @throws {@link Sync.InternalServerError}
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* await client.assets.list({
|
|
73
|
+
* limit: 10,
|
|
74
|
+
* sortBy: "dateDesc"
|
|
75
|
+
* })
|
|
76
|
+
*/
|
|
77
|
+
list(request = {}, requestOptions) {
|
|
78
|
+
return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions));
|
|
79
|
+
}
|
|
80
|
+
__list() {
|
|
81
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
82
|
+
var _a, _b, _c;
|
|
83
|
+
const { projectId, limit, cursor, searchQuery, sortBy, types } = request;
|
|
84
|
+
const _queryParams = {};
|
|
85
|
+
if (projectId != null) {
|
|
86
|
+
_queryParams["projectId"] = projectId;
|
|
87
|
+
}
|
|
88
|
+
if (limit != null) {
|
|
89
|
+
_queryParams["limit"] = limit.toString();
|
|
90
|
+
}
|
|
91
|
+
if (cursor != null) {
|
|
92
|
+
_queryParams["cursor"] = cursor;
|
|
93
|
+
}
|
|
94
|
+
if (searchQuery != null) {
|
|
95
|
+
_queryParams["searchQuery"] = searchQuery;
|
|
96
|
+
}
|
|
97
|
+
if (sortBy != null) {
|
|
98
|
+
_queryParams["sortBy"] = sortBy;
|
|
99
|
+
}
|
|
100
|
+
if (types != null) {
|
|
101
|
+
_queryParams["types"] = (0, json_1.toJson)(types);
|
|
102
|
+
}
|
|
103
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
104
|
+
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/assets"),
|
|
105
|
+
method: "GET",
|
|
106
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.3.0", "User-Agent": "@sync.so/sdk/0.3.0", "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),
|
|
107
|
+
contentType: "application/json",
|
|
108
|
+
queryParameters: _queryParams,
|
|
109
|
+
requestType: "json",
|
|
110
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
111
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
112
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
113
|
+
});
|
|
114
|
+
if (_response.ok) {
|
|
115
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
116
|
+
}
|
|
117
|
+
if (_response.error.reason === "status-code") {
|
|
118
|
+
switch (_response.error.statusCode) {
|
|
119
|
+
case 401:
|
|
120
|
+
throw new Sync.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
121
|
+
case 500:
|
|
122
|
+
throw new Sync.InternalServerError(_response.error.body, _response.rawResponse);
|
|
123
|
+
default:
|
|
124
|
+
throw new errors.SyncError({
|
|
125
|
+
statusCode: _response.error.statusCode,
|
|
126
|
+
body: _response.error.body,
|
|
127
|
+
rawResponse: _response.rawResponse,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
switch (_response.error.reason) {
|
|
132
|
+
case "non-json":
|
|
133
|
+
throw new errors.SyncError({
|
|
134
|
+
statusCode: _response.error.statusCode,
|
|
135
|
+
body: _response.error.rawBody,
|
|
136
|
+
rawResponse: _response.rawResponse,
|
|
137
|
+
});
|
|
138
|
+
case "timeout":
|
|
139
|
+
throw new errors.SyncTimeoutError("Timeout exceeded when calling GET /v2/assets.");
|
|
140
|
+
case "unknown":
|
|
141
|
+
throw new errors.SyncError({
|
|
142
|
+
message: _response.error.errorMessage,
|
|
143
|
+
rawResponse: _response.rawResponse,
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Retrieve a specific asset by ID.
|
|
150
|
+
*
|
|
151
|
+
* @param {Sync.AssetId} id
|
|
152
|
+
* @param {Assets.RequestOptions} requestOptions - Request-specific configuration.
|
|
153
|
+
*
|
|
154
|
+
* @throws {@link Sync.UnauthorizedError}
|
|
155
|
+
* @throws {@link Sync.NotFoundError}
|
|
156
|
+
* @throws {@link Sync.InternalServerError}
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* await client.assets.get("550e8400-e29b-41d4-a716-446655440000")
|
|
160
|
+
*/
|
|
161
|
+
get(id, requestOptions) {
|
|
162
|
+
return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions));
|
|
163
|
+
}
|
|
164
|
+
__get(id, requestOptions) {
|
|
165
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
166
|
+
var _a, _b, _c;
|
|
167
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
168
|
+
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/assets/${encodeURIComponent(id)}`),
|
|
169
|
+
method: "GET",
|
|
170
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.3.0", "User-Agent": "@sync.so/sdk/0.3.0", "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),
|
|
171
|
+
contentType: "application/json",
|
|
172
|
+
requestType: "json",
|
|
173
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
174
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
175
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
176
|
+
});
|
|
177
|
+
if (_response.ok) {
|
|
178
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
179
|
+
}
|
|
180
|
+
if (_response.error.reason === "status-code") {
|
|
181
|
+
switch (_response.error.statusCode) {
|
|
182
|
+
case 401:
|
|
183
|
+
throw new Sync.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
184
|
+
case 404:
|
|
185
|
+
throw new Sync.NotFoundError(_response.error.body, _response.rawResponse);
|
|
186
|
+
case 500:
|
|
187
|
+
throw new Sync.InternalServerError(_response.error.body, _response.rawResponse);
|
|
188
|
+
default:
|
|
189
|
+
throw new errors.SyncError({
|
|
190
|
+
statusCode: _response.error.statusCode,
|
|
191
|
+
body: _response.error.body,
|
|
192
|
+
rawResponse: _response.rawResponse,
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
switch (_response.error.reason) {
|
|
197
|
+
case "non-json":
|
|
198
|
+
throw new errors.SyncError({
|
|
199
|
+
statusCode: _response.error.statusCode,
|
|
200
|
+
body: _response.error.rawBody,
|
|
201
|
+
rawResponse: _response.rawResponse,
|
|
202
|
+
});
|
|
203
|
+
case "timeout":
|
|
204
|
+
throw new errors.SyncTimeoutError("Timeout exceeded when calling GET /v2/assets/{id}.");
|
|
205
|
+
case "unknown":
|
|
206
|
+
throw new errors.SyncError({
|
|
207
|
+
message: _response.error.errorMessage,
|
|
208
|
+
rawResponse: _response.rawResponse,
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
_getCustomAuthorizationHeaders() {
|
|
214
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
215
|
+
var _a;
|
|
216
|
+
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"];
|
|
217
|
+
return { "x-api-key": apiKeyValue };
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
exports.Assets = Assets;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./requests"), exports);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Sync from "../../../../index";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* limit: 10,
|
|
9
|
+
* sortBy: "dateDesc"
|
|
10
|
+
* }
|
|
11
|
+
*/
|
|
12
|
+
export interface ListAssetsRequest {
|
|
13
|
+
/**
|
|
14
|
+
* Filter assets by project ID.
|
|
15
|
+
*/
|
|
16
|
+
projectId?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Maximum number of assets to return (1-100).
|
|
19
|
+
*/
|
|
20
|
+
limit?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Cursor for pagination.
|
|
23
|
+
*/
|
|
24
|
+
cursor?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Search assets by name.
|
|
27
|
+
*/
|
|
28
|
+
searchQuery?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Sort order for the results.
|
|
31
|
+
*/
|
|
32
|
+
sortBy?: Sync.AssetSort;
|
|
33
|
+
/**
|
|
34
|
+
* Filter by asset types. Accepts multiple types as a comma-separated list (AUDIO, VIDEO, IMAGE).
|
|
35
|
+
*/
|
|
36
|
+
types?: Sync.AssetType[];
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { type ListAssetsRequest } from "./ListAssetsRequest";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./client"), exports);
|
|
@@ -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.
|
|
103
|
+
headers: Object.assign(Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.3.0", "User-Agent": "@sync.so/sdk/0.3.0", "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.
|
|
173
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.3.0", "User-Agent": "@sync.so/sdk/0.3.0", "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.
|
|
248
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@sync.so/sdk", "X-Fern-SDK-Version": "0.3.0", "User-Agent": "@sync.so/sdk/0.3.0", "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",
|
|
@@ -7,4 +7,10 @@
|
|
|
7
7
|
export interface ActiveSpeaker {
|
|
8
8
|
/** Whether to automatically detect and apply generation to the active speaker */
|
|
9
9
|
auto_detect?: boolean;
|
|
10
|
+
/** Frame index that corresponds to the provided coordinates for manual speaker selection */
|
|
11
|
+
frame_number?: number;
|
|
12
|
+
/** Reference point [x, y] on the speaker's face in the specified frame_number */
|
|
13
|
+
coordinates?: number[];
|
|
14
|
+
/** Per-frame array of bounding boxes [x1, y1, x2, y2] for the detected face, or null if no box for that frame. Use instead of frame_number + coordinates when you already have detection data. */
|
|
15
|
+
bounding_boxes?: (number[] | undefined)[];
|
|
10
16
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Sync from "../../../index";
|
|
5
|
+
/**
|
|
6
|
+
* An asset stored in your organization's media library.
|
|
7
|
+
*/
|
|
8
|
+
export interface Asset {
|
|
9
|
+
id: Sync.AssetId;
|
|
10
|
+
/** The date and time the asset was created. */
|
|
11
|
+
createdAt: string;
|
|
12
|
+
/** The date and time the asset was last updated. */
|
|
13
|
+
updatedAt: string;
|
|
14
|
+
/** The filename of the asset. */
|
|
15
|
+
name?: string;
|
|
16
|
+
/** The URL to access the asset media. */
|
|
17
|
+
url?: string;
|
|
18
|
+
/** File size in bytes. */
|
|
19
|
+
size?: number;
|
|
20
|
+
/** File format/extension (e.g., "mp4", "wav"). */
|
|
21
|
+
format?: string;
|
|
22
|
+
/** The type of asset file. */
|
|
23
|
+
type: Sync.AssetType;
|
|
24
|
+
/** The source type of the asset. */
|
|
25
|
+
inputType?: Sync.AssetInputType;
|
|
26
|
+
/** Duration of the media in seconds (for audio/video). */
|
|
27
|
+
durationSeconds?: number;
|
|
28
|
+
/** URL to the asset's thumbnail image. */
|
|
29
|
+
thumbnailUrl?: string;
|
|
30
|
+
/** Visibility scope for the asset. */
|
|
31
|
+
visibility: Sync.AssetVisibility;
|
|
32
|
+
/** Width in pixels (for video/image). */
|
|
33
|
+
width?: number;
|
|
34
|
+
/** Height in pixels (for video/image). */
|
|
35
|
+
height?: number;
|
|
36
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* The source type of the asset.
|
|
6
|
+
*/
|
|
7
|
+
export type AssetInputType = "UPLOAD" | "URL" | "RECORD" | "TTS" | "EXTRACT" | "PLATFORM_IMPORT";
|
|
8
|
+
export declare const AssetInputType: {
|
|
9
|
+
readonly Upload: "UPLOAD";
|
|
10
|
+
readonly Url: "URL";
|
|
11
|
+
readonly Record: "RECORD";
|
|
12
|
+
readonly Tts: "TTS";
|
|
13
|
+
readonly Extract: "EXTRACT";
|
|
14
|
+
readonly PlatformImport: "PLATFORM_IMPORT";
|
|
15
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
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.AssetInputType = void 0;
|
|
7
|
+
exports.AssetInputType = {
|
|
8
|
+
Upload: "UPLOAD",
|
|
9
|
+
Url: "URL",
|
|
10
|
+
Record: "RECORD",
|
|
11
|
+
Tts: "TTS",
|
|
12
|
+
Extract: "EXTRACT",
|
|
13
|
+
PlatformImport: "PLATFORM_IMPORT",
|
|
14
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Sorting options for listing assets.
|
|
6
|
+
*/
|
|
7
|
+
export type AssetSort = "nameAsc" | "nameDesc" | "dateAsc" | "dateDesc" | "durationAsc" | "durationDesc" | "sizeAsc" | "sizeDesc" | "kindAsc" | "kindDesc";
|
|
8
|
+
export declare const AssetSort: {
|
|
9
|
+
readonly NameAsc: "nameAsc";
|
|
10
|
+
readonly NameDesc: "nameDesc";
|
|
11
|
+
readonly DateAsc: "dateAsc";
|
|
12
|
+
readonly DateDesc: "dateDesc";
|
|
13
|
+
readonly DurationAsc: "durationAsc";
|
|
14
|
+
readonly DurationDesc: "durationDesc";
|
|
15
|
+
readonly SizeAsc: "sizeAsc";
|
|
16
|
+
readonly SizeDesc: "sizeDesc";
|
|
17
|
+
readonly KindAsc: "kindAsc";
|
|
18
|
+
readonly KindDesc: "kindDesc";
|
|
19
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
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.AssetSort = void 0;
|
|
7
|
+
exports.AssetSort = {
|
|
8
|
+
NameAsc: "nameAsc",
|
|
9
|
+
NameDesc: "nameDesc",
|
|
10
|
+
DateAsc: "dateAsc",
|
|
11
|
+
DateDesc: "dateDesc",
|
|
12
|
+
DurationAsc: "durationAsc",
|
|
13
|
+
DurationDesc: "durationDesc",
|
|
14
|
+
SizeAsc: "sizeAsc",
|
|
15
|
+
SizeDesc: "sizeDesc",
|
|
16
|
+
KindAsc: "kindAsc",
|
|
17
|
+
KindDesc: "kindDesc",
|
|
18
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* The type of asset file.
|
|
6
|
+
*/
|
|
7
|
+
export type AssetType = "AUDIO" | "VIDEO" | "IMAGE";
|
|
8
|
+
export declare const AssetType: {
|
|
9
|
+
readonly Audio: "AUDIO";
|
|
10
|
+
readonly Video: "VIDEO";
|
|
11
|
+
readonly Image: "IMAGE";
|
|
12
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
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.AssetType = void 0;
|
|
7
|
+
exports.AssetType = {
|
|
8
|
+
Audio: "AUDIO",
|
|
9
|
+
Video: "VIDEO",
|
|
10
|
+
Image: "IMAGE",
|
|
11
|
+
};
|