@sync.so/sdk 0.2.6 → 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.
Files changed (108) hide show
  1. package/Client.d.ts +6 -0
  2. package/Client.js +14 -4
  3. package/api/resources/assets/client/Client.d.ts +64 -0
  4. package/api/resources/assets/client/Client.js +221 -0
  5. package/api/resources/assets/client/index.d.ts +1 -0
  6. package/api/resources/assets/client/index.js +17 -0
  7. package/api/resources/assets/client/requests/ListAssetsRequest.d.ts +37 -0
  8. package/api/resources/assets/client/requests/ListAssetsRequest.js +5 -0
  9. package/api/resources/assets/client/requests/index.d.ts +1 -0
  10. package/api/resources/assets/client/requests/index.js +2 -0
  11. package/api/resources/assets/index.d.ts +1 -0
  12. package/api/resources/assets/index.js +17 -0
  13. package/api/resources/batch/client/Client.js +3 -3
  14. package/api/resources/common/types/ActiveSpeaker.d.ts +6 -0
  15. package/api/resources/common/types/Asset.d.ts +36 -0
  16. package/api/resources/common/types/Asset.js +5 -0
  17. package/api/resources/common/types/AssetId.d.ts +7 -0
  18. package/api/resources/common/types/AssetId.js +5 -0
  19. package/api/resources/common/types/AssetInputType.d.ts +15 -0
  20. package/api/resources/common/types/AssetInputType.js +14 -0
  21. package/api/resources/common/types/AssetSort.d.ts +19 -0
  22. package/api/resources/common/types/AssetSort.js +18 -0
  23. package/api/resources/common/types/AssetType.d.ts +12 -0
  24. package/api/resources/common/types/AssetType.js +11 -0
  25. package/api/resources/common/types/AssetVisibility.d.ts +17 -0
  26. package/api/resources/common/types/AssetVisibility.js +10 -0
  27. package/api/resources/common/types/Audio.d.ts +5 -2
  28. package/api/resources/common/types/ElevenLabs.d.ts +5 -1
  29. package/api/resources/common/types/Model.d.ts +2 -1
  30. package/api/resources/common/types/Model.js +1 -0
  31. package/api/resources/common/types/ModelInfo.d.ts +21 -0
  32. package/api/resources/common/types/ModelInfo.js +5 -0
  33. package/api/resources/common/types/ModelType.d.ts +11 -0
  34. package/api/resources/common/types/ModelType.js +10 -0
  35. package/api/resources/common/types/PaginatedAssetsResponse.d.ts +15 -0
  36. package/api/resources/common/types/PaginatedAssetsResponse.js +5 -0
  37. package/api/resources/common/types/Video.d.ts +7 -2
  38. package/api/resources/common/types/index.d.ts +9 -0
  39. package/api/resources/common/types/index.js +9 -0
  40. package/api/resources/generations/client/Client.js +10 -7
  41. package/api/resources/generations/client/requests/ListGenerationsRequest.d.ts +6 -2
  42. package/api/resources/index.d.ts +3 -0
  43. package/api/resources/index.js +4 -1
  44. package/api/resources/models/client/Client.d.ts +45 -0
  45. package/api/resources/models/client/Client.js +130 -0
  46. package/api/resources/models/client/index.d.ts +1 -0
  47. package/api/resources/models/client/index.js +2 -0
  48. package/api/resources/models/index.d.ts +1 -0
  49. package/api/resources/models/index.js +17 -0
  50. package/core/index.d.ts +1 -1
  51. package/core/index.js +1 -1
  52. package/dist/Client.d.ts +6 -0
  53. package/dist/Client.js +14 -4
  54. package/dist/api/resources/assets/client/Client.d.ts +64 -0
  55. package/dist/api/resources/assets/client/Client.js +221 -0
  56. package/dist/api/resources/assets/client/index.d.ts +1 -0
  57. package/dist/api/resources/assets/client/index.js +17 -0
  58. package/dist/api/resources/assets/client/requests/ListAssetsRequest.d.ts +37 -0
  59. package/dist/api/resources/assets/client/requests/ListAssetsRequest.js +5 -0
  60. package/dist/api/resources/assets/client/requests/index.d.ts +1 -0
  61. package/dist/api/resources/assets/client/requests/index.js +2 -0
  62. package/dist/api/resources/assets/index.d.ts +1 -0
  63. package/dist/api/resources/assets/index.js +17 -0
  64. package/dist/api/resources/batch/client/Client.js +3 -3
  65. package/dist/api/resources/common/types/ActiveSpeaker.d.ts +6 -0
  66. package/dist/api/resources/common/types/Asset.d.ts +36 -0
  67. package/dist/api/resources/common/types/Asset.js +5 -0
  68. package/dist/api/resources/common/types/AssetId.d.ts +7 -0
  69. package/dist/api/resources/common/types/AssetId.js +5 -0
  70. package/dist/api/resources/common/types/AssetInputType.d.ts +15 -0
  71. package/dist/api/resources/common/types/AssetInputType.js +14 -0
  72. package/dist/api/resources/common/types/AssetSort.d.ts +19 -0
  73. package/dist/api/resources/common/types/AssetSort.js +18 -0
  74. package/dist/api/resources/common/types/AssetType.d.ts +12 -0
  75. package/dist/api/resources/common/types/AssetType.js +11 -0
  76. package/dist/api/resources/common/types/AssetVisibility.d.ts +17 -0
  77. package/dist/api/resources/common/types/AssetVisibility.js +10 -0
  78. package/dist/api/resources/common/types/Audio.d.ts +5 -2
  79. package/dist/api/resources/common/types/ElevenLabs.d.ts +5 -1
  80. package/dist/api/resources/common/types/Model.d.ts +2 -1
  81. package/dist/api/resources/common/types/Model.js +1 -0
  82. package/dist/api/resources/common/types/ModelInfo.d.ts +21 -0
  83. package/dist/api/resources/common/types/ModelInfo.js +5 -0
  84. package/dist/api/resources/common/types/ModelType.d.ts +11 -0
  85. package/dist/api/resources/common/types/ModelType.js +10 -0
  86. package/dist/api/resources/common/types/PaginatedAssetsResponse.d.ts +15 -0
  87. package/dist/api/resources/common/types/PaginatedAssetsResponse.js +5 -0
  88. package/dist/api/resources/common/types/Video.d.ts +7 -2
  89. package/dist/api/resources/common/types/index.d.ts +9 -0
  90. package/dist/api/resources/common/types/index.js +9 -0
  91. package/dist/api/resources/generations/client/Client.js +10 -7
  92. package/dist/api/resources/generations/client/requests/ListGenerationsRequest.d.ts +6 -2
  93. package/dist/api/resources/index.d.ts +3 -0
  94. package/dist/api/resources/index.js +4 -1
  95. package/dist/api/resources/models/client/Client.d.ts +45 -0
  96. package/dist/api/resources/models/client/Client.js +130 -0
  97. package/dist/api/resources/models/client/index.d.ts +1 -0
  98. package/dist/api/resources/models/client/index.js +2 -0
  99. package/dist/api/resources/models/index.d.ts +1 -0
  100. package/dist/api/resources/models/index.js +17 -0
  101. package/dist/core/index.d.ts +1 -1
  102. package/dist/core/index.js +1 -1
  103. package/dist/version.d.ts +1 -1
  104. package/dist/version.js +1 -1
  105. package/package.json +1 -1
  106. package/reference.md +188 -0
  107. package/version.d.ts +1 -1
  108. package/version.js +1 -1
@@ -4,10 +4,11 @@
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" | "lipsync-2-pro" | "react-1";
7
+ export type Model = "lipsync-2" | "lipsync-1.9.0-beta" | "lipsync-2-pro" | "react-1" | "sync-3";
8
8
  export declare const Model: {
9
9
  readonly Lipsync2: "lipsync-2";
10
10
  readonly Lipsync190Beta: "lipsync-1.9.0-beta";
11
11
  readonly Lipsync2Pro: "lipsync-2-pro";
12
12
  readonly React1: "react-1";
13
+ readonly Sync3: "sync-3";
13
14
  };
@@ -9,4 +9,5 @@ exports.Model = {
9
9
  Lipsync190Beta: "lipsync-1.9.0-beta",
10
10
  Lipsync2Pro: "lipsync-2-pro",
11
11
  React1: "react-1",
12
+ Sync3: "sync-3",
12
13
  };
@@ -0,0 +1,21 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Sync from "../../../index";
5
+ /**
6
+ * Information about an available Sync model.
7
+ */
8
+ export interface ModelInfo {
9
+ /** Unique model identifier. */
10
+ id: string;
11
+ /** Model name (e.g., lipsync-2, react-1). */
12
+ name: string;
13
+ /** The type of model. */
14
+ type: Sync.ModelType;
15
+ /** Model version string. */
16
+ version: string;
17
+ /** Model description. */
18
+ description?: string;
19
+ /** Deprecation timestamp. Models with this field set are excluded from the list endpoint response. */
20
+ deprecatedAt?: string;
21
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * The type of model.
6
+ */
7
+ export type ModelType = "lipsync" | "react";
8
+ export declare const ModelType: {
9
+ readonly Lipsync: "lipsync";
10
+ readonly React: "react";
11
+ };
@@ -0,0 +1,10 @@
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.ModelType = void 0;
7
+ exports.ModelType = {
8
+ Lipsync: "lipsync",
9
+ React: "react",
10
+ };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Sync from "../../../index";
5
+ /**
6
+ * Paginated list of assets.
7
+ */
8
+ export interface PaginatedAssetsResponse {
9
+ /** Array of assets. */
10
+ items: Sync.Asset[];
11
+ /** Cursor for fetching the next page of results. */
12
+ nextCursor?: string;
13
+ /** Total number of assets matching the query. */
14
+ totalCount?: number;
15
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -2,10 +2,15 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as Sync from "../../../index";
5
+ /**
6
+ * Video input for generation. Provide either `url` or `assetId` (one is required).
7
+ */
5
8
  export interface Video {
6
9
  type: "video";
7
- /** URL of the video to be used for generation */
8
- url: string;
10
+ /** URL of the video to be used for generation. Either `url` or `assetId` must be provided. */
11
+ url?: string;
12
+ /** ID of a video asset from your media library. Either `url` or `assetId` must be provided. */
13
+ assetId?: Sync.AssetId;
9
14
  /** [DEPRECATED] Use the top-level [segments](/api-reference/api/generate-api/create#request.body.segments) array instead for multi-segment support. */
10
15
  segments_secs?: Sync.SegmentSecs;
11
16
  /** [DEPRECATED] Use the top-level [segments](/api-reference/api/generate-api/create#request.body.segments) array instead for multi-segment support. frames 100 and 200 of the video */
@@ -27,3 +27,12 @@ export * from "./BatchStatus";
27
27
  export * from "./BatchMetrics";
28
28
  export * from "./ValidationResponse";
29
29
  export * from "./CreateBatchResponse";
30
+ export * from "./AssetId";
31
+ export * from "./AssetType";
32
+ export * from "./AssetVisibility";
33
+ export * from "./AssetInputType";
34
+ export * from "./AssetSort";
35
+ export * from "./Asset";
36
+ export * from "./PaginatedAssetsResponse";
37
+ export * from "./ModelType";
38
+ export * from "./ModelInfo";
@@ -43,3 +43,12 @@ __exportStar(require("./BatchStatus"), exports);
43
43
  __exportStar(require("./BatchMetrics"), exports);
44
44
  __exportStar(require("./ValidationResponse"), exports);
45
45
  __exportStar(require("./CreateBatchResponse"), exports);
46
+ __exportStar(require("./AssetId"), exports);
47
+ __exportStar(require("./AssetType"), exports);
48
+ __exportStar(require("./AssetVisibility"), exports);
49
+ __exportStar(require("./AssetInputType"), exports);
50
+ __exportStar(require("./AssetSort"), exports);
51
+ __exportStar(require("./Asset"), exports);
52
+ __exportStar(require("./PaginatedAssetsResponse"), exports);
53
+ __exportStar(require("./ModelType"), exports);
54
+ __exportStar(require("./ModelInfo"), exports);
@@ -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.6", "User-Agent": "@sync.so/sdk/0.2.6", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
94
+ 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),
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.6", "User-Agent": "@sync.so/sdk/0.2.6", "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.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),
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.6", "User-Agent": "@sync.so/sdk/0.2.6", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
246
+ 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),
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,
@@ -302,15 +302,18 @@ class Generations {
302
302
  __list() {
303
303
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
304
304
  var _a, _b, _c;
305
- const { status } = request;
305
+ const { status, ids } = request;
306
306
  const _queryParams = {};
307
307
  if (status != null) {
308
- _queryParams["status"] = status;
308
+ _queryParams["status"] = (0, json_1.toJson)(status);
309
+ }
310
+ if (ids != null) {
311
+ _queryParams["ids"] = (0, json_1.toJson)(ids);
309
312
  }
310
313
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
311
314
  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
315
  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.6", "User-Agent": "@sync.so/sdk/0.2.6", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
316
+ 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),
314
317
  contentType: "application/json",
315
318
  queryParameters: _queryParams,
316
319
  requestType: "json",
@@ -383,7 +386,7 @@ class Generations {
383
386
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
384
387
  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
388
  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.6", "User-Agent": "@sync.so/sdk/0.2.6", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
389
+ 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),
387
390
  contentType: "application/json",
388
391
  requestType: "json",
389
392
  body: request,
@@ -8,7 +8,11 @@ import * as Sync from "../../../../index";
8
8
  */
9
9
  export interface ListGenerationsRequest {
10
10
  /**
11
- * Filter generations by status
11
+ * Filter generations by status. Accepts multiple statuses as a comma-separated list.
12
12
  */
13
- status?: Sync.GenerationStatus;
13
+ status?: Sync.GenerationStatus[];
14
+ /**
15
+ * Filter generations by ID. Accepts multiple IDs as a comma-separated list.
16
+ */
17
+ ids?: string[];
14
18
  }
@@ -3,7 +3,10 @@ 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 assets from "./assets";
6
7
  export * as batch from "./batch";
7
8
  export * as generations from "./generations";
9
+ export * as models from "./models";
10
+ export * from "./assets/client/requests";
8
11
  export * from "./batch/client/requests";
9
12
  export * from "./generations/client/requests";
@@ -36,13 +36,16 @@ 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.generations = exports.batch = exports.webhooks = exports.common = void 0;
39
+ exports.models = exports.generations = exports.batch = exports.assets = 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.assets = __importStar(require("./assets"));
45
46
  exports.batch = __importStar(require("./batch"));
46
47
  exports.generations = __importStar(require("./generations"));
48
+ exports.models = __importStar(require("./models"));
49
+ __exportStar(require("./assets/client/requests"), exports);
47
50
  __exportStar(require("./batch/client/requests"), exports);
48
51
  __exportStar(require("./generations/client/requests"), exports);
@@ -0,0 +1,45 @@
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 Models {
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 Models {
27
+ protected readonly _options: Models.Options;
28
+ constructor(_options?: Models.Options);
29
+ /**
30
+ * List all available models for the authenticated user. Returns active (non-deprecated) models the user has access to, including any feature-flagged models enabled for their account.
31
+ *
32
+ * @param {Models.RequestOptions} requestOptions - Request-specific configuration.
33
+ *
34
+ * @throws {@link Sync.UnauthorizedError}
35
+ * @throws {@link Sync.InternalServerError}
36
+ *
37
+ * @example
38
+ * await client.models.list()
39
+ */
40
+ list(requestOptions?: Models.RequestOptions): core.HttpResponsePromise<Sync.ModelInfo[]>;
41
+ private __list;
42
+ protected _getCustomAuthorizationHeaders(): Promise<{
43
+ "x-api-key": string | undefined;
44
+ }>;
45
+ }
@@ -0,0 +1,130 @@
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.Models = void 0;
52
+ const environments = __importStar(require("../../../../environments"));
53
+ const core = __importStar(require("../../../../core"));
54
+ const Sync = __importStar(require("../../../index"));
55
+ const url_join_1 = __importDefault(require("url-join"));
56
+ const errors = __importStar(require("../../../../errors/index"));
57
+ class Models {
58
+ constructor(_options = {}) {
59
+ this._options = _options;
60
+ }
61
+ /**
62
+ * List all available models for the authenticated user. Returns active (non-deprecated) models the user has access to, including any feature-flagged models enabled for their account.
63
+ *
64
+ * @param {Models.RequestOptions} requestOptions - Request-specific configuration.
65
+ *
66
+ * @throws {@link Sync.UnauthorizedError}
67
+ * @throws {@link Sync.InternalServerError}
68
+ *
69
+ * @example
70
+ * await client.models.list()
71
+ */
72
+ list(requestOptions) {
73
+ return core.HttpResponsePromise.fromPromise(this.__list(requestOptions));
74
+ }
75
+ __list(requestOptions) {
76
+ return __awaiter(this, void 0, void 0, function* () {
77
+ var _a, _b, _c;
78
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
79
+ 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/models"),
80
+ method: "GET",
81
+ 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),
82
+ contentType: "application/json",
83
+ requestType: "json",
84
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
85
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
86
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
87
+ });
88
+ if (_response.ok) {
89
+ return { data: _response.body, rawResponse: _response.rawResponse };
90
+ }
91
+ if (_response.error.reason === "status-code") {
92
+ switch (_response.error.statusCode) {
93
+ case 401:
94
+ throw new Sync.UnauthorizedError(_response.error.body, _response.rawResponse);
95
+ case 500:
96
+ throw new Sync.InternalServerError(_response.error.body, _response.rawResponse);
97
+ default:
98
+ throw new errors.SyncError({
99
+ statusCode: _response.error.statusCode,
100
+ body: _response.error.body,
101
+ rawResponse: _response.rawResponse,
102
+ });
103
+ }
104
+ }
105
+ switch (_response.error.reason) {
106
+ case "non-json":
107
+ throw new errors.SyncError({
108
+ statusCode: _response.error.statusCode,
109
+ body: _response.error.rawBody,
110
+ rawResponse: _response.rawResponse,
111
+ });
112
+ case "timeout":
113
+ throw new errors.SyncTimeoutError("Timeout exceeded when calling GET /v2/models.");
114
+ case "unknown":
115
+ throw new errors.SyncError({
116
+ message: _response.error.errorMessage,
117
+ rawResponse: _response.rawResponse,
118
+ });
119
+ }
120
+ });
121
+ }
122
+ _getCustomAuthorizationHeaders() {
123
+ return __awaiter(this, void 0, void 0, function* () {
124
+ var _a;
125
+ 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"];
126
+ return { "x-api-key": apiKeyValue };
127
+ });
128
+ }
129
+ }
130
+ exports.Models = Models;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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);
@@ -1,3 +1,3 @@
1
1
  export * from "./fetcher";
2
- export * from "./form-data-utils";
3
2
  export * from "./runtime";
3
+ export * from "./form-data-utils";
@@ -15,5 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./fetcher"), exports);
18
- __exportStar(require("./form-data-utils"), exports);
19
18
  __exportStar(require("./runtime"), exports);
19
+ __exportStar(require("./form-data-utils"), exports);
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.2.6";
1
+ export declare const SDK_VERSION = "0.3.0";
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.6";
4
+ exports.SDK_VERSION = "0.3.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sync.so/sdk",
3
- "version": "0.2.6",
3
+ "version": "0.3.0",
4
4
  "private": false,
5
5
  "repository": "https://github.com/synchronicity-labs/sync-typescript-sdk",
6
6
  "main": "./index.js",