@sync.so/sdk 0.1.9 → 0.2.2

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 (129) hide show
  1. package/Client.d.ts +5 -2
  2. package/Client.js +8 -3
  3. package/README.md +6 -6
  4. package/api/resources/batch/client/Client.d.ts +89 -0
  5. package/api/resources/batch/client/Client.js +298 -0
  6. package/api/resources/batch/client/index.d.ts +1 -0
  7. package/api/resources/batch/client/index.js +17 -0
  8. package/api/resources/batch/client/requests/CreateBatchRequest.d.ts +21 -0
  9. package/api/resources/batch/client/requests/CreateBatchRequest.js +5 -0
  10. package/api/resources/batch/client/requests/ListBatchesRequest.d.ts +22 -0
  11. package/api/resources/batch/client/requests/ListBatchesRequest.js +5 -0
  12. package/api/resources/batch/client/requests/index.d.ts +2 -0
  13. package/api/resources/batch/client/requests/index.js +2 -0
  14. package/api/resources/batch/index.d.ts +1 -0
  15. package/api/resources/batch/index.js +17 -0
  16. package/api/resources/common/errors/PaymentRequiredError.d.ts +9 -0
  17. package/api/resources/common/errors/PaymentRequiredError.js +52 -0
  18. package/api/resources/common/errors/TooManyRequestsError.d.ts +9 -0
  19. package/api/resources/common/errors/TooManyRequestsError.js +52 -0
  20. package/api/resources/common/errors/index.d.ts +2 -0
  21. package/api/resources/common/errors/index.js +2 -0
  22. package/api/resources/common/types/ActiveSpeaker.d.ts +10 -0
  23. package/api/resources/common/types/ActiveSpeaker.js +5 -0
  24. package/api/resources/common/types/BatchId.d.ts +7 -0
  25. package/api/resources/common/types/BatchId.js +5 -0
  26. package/api/resources/common/types/BatchMetrics.d.ts +13 -0
  27. package/api/resources/common/types/BatchMetrics.js +5 -0
  28. package/api/resources/common/types/BatchResponse.d.ts +17 -0
  29. package/api/resources/common/types/BatchResponse.js +5 -0
  30. package/api/resources/common/types/BatchStatus.d.ts +14 -0
  31. package/api/resources/common/types/BatchStatus.js +13 -0
  32. package/api/resources/common/types/CreateBatchResponse.d.ts +5 -0
  33. package/api/resources/common/types/CreateBatchResponse.js +5 -0
  34. package/api/resources/common/types/CreateGenerationDto.d.ts +2 -0
  35. package/api/resources/common/types/Generation.d.ts +4 -0
  36. package/api/resources/common/types/GenerationOptions.d.ts +6 -14
  37. package/api/resources/common/types/Model.d.ts +1 -4
  38. package/api/resources/common/types/Model.js +0 -3
  39. package/api/resources/common/types/SyncMode.d.ts +20 -2
  40. package/api/resources/common/types/SyncMode.js +1 -1
  41. package/api/resources/common/types/ValidationResponse.d.ts +7 -0
  42. package/api/resources/common/types/ValidationResponse.js +5 -0
  43. package/api/resources/common/types/index.d.ts +7 -0
  44. package/api/resources/common/types/index.js +7 -0
  45. package/api/resources/generations/client/Client.d.ts +22 -3
  46. package/api/resources/generations/client/Client.js +96 -6
  47. package/api/resources/generations/client/requests/CreateGenerationRequest.d.ts +17 -0
  48. package/api/resources/generations/client/requests/CreateGenerationRequest.js +5 -0
  49. package/api/resources/generations/client/requests/index.d.ts +1 -0
  50. package/api/resources/index.d.ts +2 -0
  51. package/api/resources/index.js +3 -1
  52. package/api/resources/webhooks/types/GenerationNotification.d.ts +4 -0
  53. package/core/form-data-utils/FormDataWrapper.d.ts +63 -0
  54. package/core/form-data-utils/FormDataWrapper.js +227 -0
  55. package/core/form-data-utils/encodeAsFormParameter.d.ts +4 -0
  56. package/core/form-data-utils/encodeAsFormParameter.js +18 -0
  57. package/core/form-data-utils/index.d.ts +2 -0
  58. package/core/form-data-utils/index.js +20 -0
  59. package/core/index.d.ts +1 -0
  60. package/core/index.js +1 -0
  61. package/dist/Client.d.ts +5 -2
  62. package/dist/Client.js +8 -3
  63. package/dist/api/resources/batch/client/Client.d.ts +89 -0
  64. package/dist/api/resources/batch/client/Client.js +298 -0
  65. package/dist/api/resources/batch/client/index.d.ts +1 -0
  66. package/dist/api/resources/batch/client/index.js +17 -0
  67. package/dist/api/resources/batch/client/requests/CreateBatchRequest.d.ts +21 -0
  68. package/dist/api/resources/batch/client/requests/CreateBatchRequest.js +5 -0
  69. package/dist/api/resources/batch/client/requests/ListBatchesRequest.d.ts +22 -0
  70. package/dist/api/resources/batch/client/requests/ListBatchesRequest.js +5 -0
  71. package/dist/api/resources/batch/client/requests/index.d.ts +2 -0
  72. package/dist/api/resources/batch/client/requests/index.js +2 -0
  73. package/dist/api/resources/batch/index.d.ts +1 -0
  74. package/dist/api/resources/batch/index.js +17 -0
  75. package/dist/api/resources/common/errors/PaymentRequiredError.d.ts +9 -0
  76. package/dist/api/resources/common/errors/PaymentRequiredError.js +52 -0
  77. package/dist/api/resources/common/errors/TooManyRequestsError.d.ts +9 -0
  78. package/dist/api/resources/common/errors/TooManyRequestsError.js +52 -0
  79. package/dist/api/resources/common/errors/index.d.ts +2 -0
  80. package/dist/api/resources/common/errors/index.js +2 -0
  81. package/dist/api/resources/common/types/ActiveSpeaker.d.ts +10 -0
  82. package/dist/api/resources/common/types/ActiveSpeaker.js +5 -0
  83. package/dist/api/resources/common/types/BatchId.d.ts +7 -0
  84. package/dist/api/resources/common/types/BatchId.js +5 -0
  85. package/dist/api/resources/common/types/BatchMetrics.d.ts +13 -0
  86. package/dist/api/resources/common/types/BatchMetrics.js +5 -0
  87. package/dist/api/resources/common/types/BatchResponse.d.ts +17 -0
  88. package/dist/api/resources/common/types/BatchResponse.js +5 -0
  89. package/dist/api/resources/common/types/BatchStatus.d.ts +14 -0
  90. package/dist/api/resources/common/types/BatchStatus.js +13 -0
  91. package/dist/api/resources/common/types/CreateBatchResponse.d.ts +5 -0
  92. package/dist/api/resources/common/types/CreateBatchResponse.js +5 -0
  93. package/dist/api/resources/common/types/CreateGenerationDto.d.ts +2 -0
  94. package/dist/api/resources/common/types/Generation.d.ts +4 -0
  95. package/dist/api/resources/common/types/GenerationOptions.d.ts +6 -14
  96. package/dist/api/resources/common/types/Model.d.ts +1 -4
  97. package/dist/api/resources/common/types/Model.js +0 -3
  98. package/dist/api/resources/common/types/SyncMode.d.ts +20 -2
  99. package/dist/api/resources/common/types/SyncMode.js +1 -1
  100. package/dist/api/resources/common/types/ValidationResponse.d.ts +7 -0
  101. package/dist/api/resources/common/types/ValidationResponse.js +5 -0
  102. package/dist/api/resources/common/types/index.d.ts +7 -0
  103. package/dist/api/resources/common/types/index.js +7 -0
  104. package/dist/api/resources/generations/client/Client.d.ts +22 -3
  105. package/dist/api/resources/generations/client/Client.js +96 -6
  106. package/dist/api/resources/generations/client/requests/CreateGenerationRequest.d.ts +17 -0
  107. package/dist/api/resources/generations/client/requests/CreateGenerationRequest.js +5 -0
  108. package/dist/api/resources/generations/client/requests/index.d.ts +1 -0
  109. package/dist/api/resources/index.d.ts +2 -0
  110. package/dist/api/resources/index.js +3 -1
  111. package/dist/api/resources/webhooks/types/GenerationNotification.d.ts +4 -0
  112. package/dist/core/form-data-utils/FormDataWrapper.d.ts +63 -0
  113. package/dist/core/form-data-utils/FormDataWrapper.js +227 -0
  114. package/dist/core/form-data-utils/encodeAsFormParameter.d.ts +4 -0
  115. package/dist/core/form-data-utils/encodeAsFormParameter.js +18 -0
  116. package/dist/core/form-data-utils/index.d.ts +2 -0
  117. package/dist/core/form-data-utils/index.js +20 -0
  118. package/dist/core/index.d.ts +1 -0
  119. package/dist/core/index.js +1 -0
  120. package/dist/environments.d.ts +2 -1
  121. package/dist/environments.js +1 -0
  122. package/dist/version.d.ts +1 -1
  123. package/dist/version.js +1 -1
  124. package/environments.d.ts +2 -1
  125. package/environments.js +1 -0
  126. package/package.json +3 -2
  127. package/reference.md +272 -0
  128. package/version.d.ts +1 -1
  129. package/version.js +1 -1
@@ -0,0 +1,227 @@
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
36
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
+ return new (P || (P = Promise))(function (resolve, reject) {
38
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
39
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
40
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
41
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
42
+ });
43
+ };
44
+ Object.defineProperty(exports, "__esModule", { value: true });
45
+ exports.WebFormData = exports.Node16FormData = exports.Node18FormData = void 0;
46
+ exports.newFormData = newFormData;
47
+ const runtime_1 = require("../runtime");
48
+ function isNamedValue(value) {
49
+ return typeof value === "object" && value != null && "name" in value;
50
+ }
51
+ function isPathedValue(value) {
52
+ return typeof value === "object" && value != null && "path" in value;
53
+ }
54
+ function getLastPathSegment(pathStr) {
55
+ const lastForwardSlash = pathStr.lastIndexOf("/");
56
+ const lastBackSlash = pathStr.lastIndexOf("\\");
57
+ const lastSlashIndex = Math.max(lastForwardSlash, lastBackSlash);
58
+ return lastSlashIndex >= 0 ? pathStr.substring(lastSlashIndex + 1) : pathStr;
59
+ }
60
+ function newFormData() {
61
+ return __awaiter(this, void 0, void 0, function* () {
62
+ let formdata;
63
+ if (runtime_1.RUNTIME.type === "node" && runtime_1.RUNTIME.parsedVersion != null && runtime_1.RUNTIME.parsedVersion >= 18) {
64
+ formdata = new Node18FormData();
65
+ }
66
+ else if (runtime_1.RUNTIME.type === "node") {
67
+ formdata = new Node16FormData();
68
+ }
69
+ else {
70
+ formdata = new WebFormData();
71
+ }
72
+ yield formdata.setup();
73
+ return formdata;
74
+ });
75
+ }
76
+ /**
77
+ * Form Data Implementation for Node.js 18+
78
+ */
79
+ class Node18FormData {
80
+ setup() {
81
+ return __awaiter(this, void 0, void 0, function* () {
82
+ this.fd = new (yield Promise.resolve().then(() => __importStar(require("formdata-node")))).FormData();
83
+ });
84
+ }
85
+ append(key, value) {
86
+ var _a;
87
+ (_a = this.fd) === null || _a === void 0 ? void 0 : _a.append(key, value);
88
+ }
89
+ getFileName(value, filename) {
90
+ if (filename != null) {
91
+ return filename;
92
+ }
93
+ if (isNamedValue(value)) {
94
+ return value.name;
95
+ }
96
+ if (isPathedValue(value) && value.path) {
97
+ return getLastPathSegment(value.path.toString());
98
+ }
99
+ return undefined;
100
+ }
101
+ appendFile(key, value, fileName) {
102
+ return __awaiter(this, void 0, void 0, function* () {
103
+ var _a, _b;
104
+ fileName = this.getFileName(value, fileName);
105
+ if (value instanceof Blob) {
106
+ (_a = this.fd) === null || _a === void 0 ? void 0 : _a.append(key, value, fileName);
107
+ }
108
+ else {
109
+ (_b = this.fd) === null || _b === void 0 ? void 0 : _b.append(key, {
110
+ type: undefined,
111
+ name: fileName,
112
+ [Symbol.toStringTag]: "File",
113
+ stream() {
114
+ return value;
115
+ },
116
+ });
117
+ }
118
+ });
119
+ }
120
+ getRequest() {
121
+ return __awaiter(this, void 0, void 0, function* () {
122
+ const encoder = new (yield Promise.resolve().then(() => __importStar(require("form-data-encoder")))).FormDataEncoder(this.fd);
123
+ return {
124
+ body: (yield Promise.resolve().then(() => __importStar(require("readable-stream")))).Readable.from(encoder),
125
+ headers: encoder.headers,
126
+ duplex: "half",
127
+ };
128
+ });
129
+ }
130
+ }
131
+ exports.Node18FormData = Node18FormData;
132
+ /**
133
+ * Form Data Implementation for Node.js 16-18
134
+ */
135
+ class Node16FormData {
136
+ setup() {
137
+ return __awaiter(this, void 0, void 0, function* () {
138
+ this.fd = new (yield Promise.resolve().then(() => __importStar(require("form-data")))).default();
139
+ });
140
+ }
141
+ append(key, value) {
142
+ var _a;
143
+ (_a = this.fd) === null || _a === void 0 ? void 0 : _a.append(key, value);
144
+ }
145
+ getFileName(value, filename) {
146
+ if (filename != null) {
147
+ return filename;
148
+ }
149
+ if (isNamedValue(value)) {
150
+ return value.name;
151
+ }
152
+ if (isPathedValue(value) && value.path) {
153
+ return getLastPathSegment(value.path.toString());
154
+ }
155
+ return undefined;
156
+ }
157
+ appendFile(key, value, fileName) {
158
+ return __awaiter(this, void 0, void 0, function* () {
159
+ var _a, _b;
160
+ fileName = this.getFileName(value, fileName);
161
+ let bufferedValue;
162
+ if (value instanceof Blob) {
163
+ bufferedValue = Buffer.from(yield value.arrayBuffer());
164
+ }
165
+ else {
166
+ bufferedValue = value;
167
+ }
168
+ if (fileName == null) {
169
+ (_a = this.fd) === null || _a === void 0 ? void 0 : _a.append(key, bufferedValue);
170
+ }
171
+ else {
172
+ (_b = this.fd) === null || _b === void 0 ? void 0 : _b.append(key, bufferedValue, { filename: fileName });
173
+ }
174
+ });
175
+ }
176
+ getRequest() {
177
+ return {
178
+ body: this.fd,
179
+ headers: this.fd ? this.fd.getHeaders() : {},
180
+ };
181
+ }
182
+ }
183
+ exports.Node16FormData = Node16FormData;
184
+ /**
185
+ * Form Data Implementation for Web
186
+ */
187
+ class WebFormData {
188
+ setup() {
189
+ return __awaiter(this, void 0, void 0, function* () {
190
+ this.fd = new FormData();
191
+ });
192
+ }
193
+ append(key, value) {
194
+ var _a;
195
+ (_a = this.fd) === null || _a === void 0 ? void 0 : _a.append(key, value);
196
+ }
197
+ getFileName(value, filename) {
198
+ if (filename != null) {
199
+ return filename;
200
+ }
201
+ if (isNamedValue(value)) {
202
+ return value.name;
203
+ }
204
+ if (isPathedValue(value) && value.path) {
205
+ return getLastPathSegment(value.path.toString());
206
+ }
207
+ return undefined;
208
+ }
209
+ appendFile(key, value, fileName) {
210
+ return __awaiter(this, void 0, void 0, function* () {
211
+ var _a, _b;
212
+ fileName = this.getFileName(value, fileName);
213
+ if (value instanceof Blob) {
214
+ (_a = this.fd) === null || _a === void 0 ? void 0 : _a.append(key, value, fileName);
215
+ return;
216
+ }
217
+ (_b = this.fd) === null || _b === void 0 ? void 0 : _b.append(key, new Blob([value]), fileName);
218
+ });
219
+ }
220
+ getRequest() {
221
+ return {
222
+ body: this.fd,
223
+ headers: {},
224
+ };
225
+ }
226
+ }
227
+ exports.WebFormData = WebFormData;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Takes an unknown value, stringifies it using qs, and parses it into a key-value record
3
+ */
4
+ export declare function encodeAsFormParameter(value: unknown): Record<string, string>;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.encodeAsFormParameter = encodeAsFormParameter;
7
+ const qs_1 = __importDefault(require("qs"));
8
+ /**
9
+ * Takes an unknown value, stringifies it using qs, and parses it into a key-value record
10
+ */
11
+ function encodeAsFormParameter(value) {
12
+ const stringified = qs_1.default.stringify(value, { encode: false });
13
+ const keyValuePairs = stringified.split("&").map((pair) => {
14
+ const [key, value] = pair.split("=");
15
+ return [key, value];
16
+ });
17
+ return Object.fromEntries(keyValuePairs);
18
+ }
@@ -0,0 +1,2 @@
1
+ export { encodeAsFormParameter } from "./encodeAsFormParameter";
2
+ export * from "./FormDataWrapper";
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.encodeAsFormParameter = void 0;
18
+ var encodeAsFormParameter_1 = require("./encodeAsFormParameter");
19
+ Object.defineProperty(exports, "encodeAsFormParameter", { enumerable: true, get: function () { return encodeAsFormParameter_1.encodeAsFormParameter; } });
20
+ __exportStar(require("./FormDataWrapper"), exports);
@@ -1,2 +1,3 @@
1
1
  export * from "./fetcher";
2
+ export * from "./form-data-utils";
2
3
  export * from "./runtime";
@@ -15,4 +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);
18
19
  __exportStar(require("./runtime"), exports);
@@ -3,5 +3,6 @@
3
3
  */
4
4
  export declare const SyncEnvironment: {
5
5
  readonly Default: "https://api.sync.so";
6
+ readonly Dev: "https://dev-api.sync.so";
6
7
  };
7
- export type SyncEnvironment = typeof SyncEnvironment.Default;
8
+ export type SyncEnvironment = typeof SyncEnvironment.Default | typeof SyncEnvironment.Dev;
@@ -6,4 +6,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.SyncEnvironment = void 0;
7
7
  exports.SyncEnvironment = {
8
8
  Default: "https://api.sync.so",
9
+ Dev: "https://dev-api.sync.so",
9
10
  };
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.1.9";
1
+ export declare const SDK_VERSION = "0.2.2";
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.1.9";
4
+ exports.SDK_VERSION = "0.2.2";
package/environments.d.ts CHANGED
@@ -3,5 +3,6 @@
3
3
  */
4
4
  export declare const SyncEnvironment: {
5
5
  readonly Default: "https://api.sync.so";
6
+ readonly Dev: "https://dev-api.sync.so";
6
7
  };
7
- export type SyncEnvironment = typeof SyncEnvironment.Default;
8
+ export type SyncEnvironment = typeof SyncEnvironment.Default | typeof SyncEnvironment.Dev;
package/environments.js CHANGED
@@ -6,4 +6,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.SyncEnvironment = void 0;
7
7
  exports.SyncEnvironment = {
8
8
  Default: "https://api.sync.so",
9
+ Dev: "https://dev-api.sync.so",
9
10
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sync.so/sdk",
3
- "version": "0.1.9",
3
+ "version": "0.2.2",
4
4
  "private": false,
5
5
  "repository": "https://github.com/synchronicity-labs/sync-typescript-sdk",
6
6
  "main": "./index.js",
@@ -17,7 +17,8 @@
17
17
  "formdata-node": "^6.0.3",
18
18
  "node-fetch": "^2.7.0",
19
19
  "qs": "^6.13.1",
20
- "readable-stream": "^4.5.2"
20
+ "readable-stream": "^4.5.2",
21
+ "form-data-encoder": "^4.0.2"
21
22
  },
22
23
  "devDependencies": {
23
24
  "@types/url-join": "4.0.1",
package/reference.md CHANGED
@@ -1,5 +1,207 @@
1
1
  # Reference
2
2
 
3
+ ## Batch
4
+
5
+ <details><summary><code>client.batch.<a href="/src/api/resources/batch/client/Client.ts">create</a>(input, { ...params }) -> Sync.CreateBatchResponse</code></summary>
6
+ <dl>
7
+ <dd>
8
+
9
+ #### 📝 Description
10
+
11
+ <dl>
12
+ <dd>
13
+
14
+ <dl>
15
+ <dd>
16
+
17
+ API for [Batch Processing](/api-reference/guides/batch-processing). Available only for `Scale` and `Enterprise` plans.
18
+
19
+ </dd>
20
+ </dl>
21
+ </dd>
22
+ </dl>
23
+
24
+ #### 🔌 Usage
25
+
26
+ <dl>
27
+ <dd>
28
+
29
+ <dl>
30
+ <dd>
31
+
32
+ ```typescript
33
+ await client.batch.create(fs.createReadStream("/path/to/your/file"), {
34
+ webhook_url: "https://your-webhook-url.com/batch-webhook",
35
+ dry_run: false,
36
+ });
37
+ ```
38
+
39
+ </dd>
40
+ </dl>
41
+ </dd>
42
+ </dl>
43
+
44
+ #### ⚙️ Parameters
45
+
46
+ <dl>
47
+ <dd>
48
+
49
+ <dl>
50
+ <dd>
51
+
52
+ **input:** `File | fs.ReadStream | Blob`
53
+
54
+ </dd>
55
+ </dl>
56
+
57
+ <dl>
58
+ <dd>
59
+
60
+ **request:** `Sync.CreateBatchRequest`
61
+
62
+ </dd>
63
+ </dl>
64
+
65
+ <dl>
66
+ <dd>
67
+
68
+ **requestOptions:** `Batch.RequestOptions`
69
+
70
+ </dd>
71
+ </dl>
72
+ </dd>
73
+ </dl>
74
+
75
+ </dd>
76
+ </dl>
77
+ </details>
78
+
79
+ <details><summary><code>client.batch.<a href="/src/api/resources/batch/client/Client.ts">get</a>(id) -> Sync.BatchResponse</code></summary>
80
+ <dl>
81
+ <dd>
82
+
83
+ #### 📝 Description
84
+
85
+ <dl>
86
+ <dd>
87
+
88
+ <dl>
89
+ <dd>
90
+
91
+ Retrieve details about a specific batch, including its current status, processing metrics, and output file URL when available.
92
+
93
+ </dd>
94
+ </dl>
95
+ </dd>
96
+ </dl>
97
+
98
+ #### 🔌 Usage
99
+
100
+ <dl>
101
+ <dd>
102
+
103
+ <dl>
104
+ <dd>
105
+
106
+ ```typescript
107
+ await client.batch.get("batch_abc123");
108
+ ```
109
+
110
+ </dd>
111
+ </dl>
112
+ </dd>
113
+ </dl>
114
+
115
+ #### ⚙️ Parameters
116
+
117
+ <dl>
118
+ <dd>
119
+
120
+ <dl>
121
+ <dd>
122
+
123
+ **id:** `Sync.BatchId` — The unique identifier of the batch
124
+
125
+ </dd>
126
+ </dl>
127
+
128
+ <dl>
129
+ <dd>
130
+
131
+ **requestOptions:** `Batch.RequestOptions`
132
+
133
+ </dd>
134
+ </dl>
135
+ </dd>
136
+ </dl>
137
+
138
+ </dd>
139
+ </dl>
140
+ </details>
141
+
142
+ <details><summary><code>client.batch.<a href="/src/api/resources/batch/client/Client.ts">list</a>({ ...params }) -> Sync.BatchResponse[]</code></summary>
143
+ <dl>
144
+ <dd>
145
+
146
+ #### 📝 Description
147
+
148
+ <dl>
149
+ <dd>
150
+
151
+ <dl>
152
+ <dd>
153
+
154
+ List all batches for your organization with optional filtering by status and creation date. Results are ordered by creation date (newest first).
155
+
156
+ </dd>
157
+ </dl>
158
+ </dd>
159
+ </dl>
160
+
161
+ #### 🔌 Usage
162
+
163
+ <dl>
164
+ <dd>
165
+
166
+ <dl>
167
+ <dd>
168
+
169
+ ```typescript
170
+ await client.batch.list();
171
+ ```
172
+
173
+ </dd>
174
+ </dl>
175
+ </dd>
176
+ </dl>
177
+
178
+ #### ⚙️ Parameters
179
+
180
+ <dl>
181
+ <dd>
182
+
183
+ <dl>
184
+ <dd>
185
+
186
+ **request:** `Sync.ListBatchesRequest`
187
+
188
+ </dd>
189
+ </dl>
190
+
191
+ <dl>
192
+ <dd>
193
+
194
+ **requestOptions:** `Batch.RequestOptions`
195
+
196
+ </dd>
197
+ </dl>
198
+ </dd>
199
+ </dl>
200
+
201
+ </dd>
202
+ </dl>
203
+ </details>
204
+
3
205
  ## Generations
4
206
 
5
207
  <details><summary><code>client.generations.<a href="/src/api/resources/generations/client/Client.ts">create</a>({ ...params }) -> Sync.Generation</code></summary>
@@ -65,6 +267,76 @@ await client.generations.create({
65
267
  </dl>
66
268
  </details>
67
269
 
270
+ <details><summary><code>client.generations.<a href="/src/api/resources/generations/client/Client.ts">createWithFiles</a>(video, audio, { ...params }) -> Sync.Generation</code></summary>
271
+ <dl>
272
+ <dd>
273
+
274
+ #### 🔌 Usage
275
+
276
+ <dl>
277
+ <dd>
278
+
279
+ <dl>
280
+ <dd>
281
+
282
+ ```typescript
283
+ await client.generations.createWithFiles(
284
+ fs.createReadStream("/path/to/your/file"),
285
+ fs.createReadStream("/path/to/your/file"),
286
+ {
287
+ model: "lipsync-2",
288
+ },
289
+ );
290
+ ```
291
+
292
+ </dd>
293
+ </dl>
294
+ </dd>
295
+ </dl>
296
+
297
+ #### ⚙️ Parameters
298
+
299
+ <dl>
300
+ <dd>
301
+
302
+ <dl>
303
+ <dd>
304
+
305
+ **video:** `File | fs.ReadStream | Blob | undefined`
306
+
307
+ </dd>
308
+ </dl>
309
+
310
+ <dl>
311
+ <dd>
312
+
313
+ **audio:** `File | fs.ReadStream | Blob | undefined`
314
+
315
+ </dd>
316
+ </dl>
317
+
318
+ <dl>
319
+ <dd>
320
+
321
+ **request:** `Sync.CreateGenerationRequest`
322
+
323
+ </dd>
324
+ </dl>
325
+
326
+ <dl>
327
+ <dd>
328
+
329
+ **requestOptions:** `Generations.RequestOptions`
330
+
331
+ </dd>
332
+ </dl>
333
+ </dd>
334
+ </dl>
335
+
336
+ </dd>
337
+ </dl>
338
+ </details>
339
+
68
340
  <details><summary><code>client.generations.<a href="/src/api/resources/generations/client/Client.ts">get</a>(id) -> Sync.Generation</code></summary>
69
341
  <dl>
70
342
  <dd>
package/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.1.9";
1
+ export declare const SDK_VERSION = "0.2.2";
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.1.9";
4
+ exports.SDK_VERSION = "0.2.2";