@sync.so/sdk 0.1.9 → 0.2.1

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 (128) hide show
  1. package/Client.d.ts +3 -0
  2. package/Client.js +7 -2
  3. package/api/resources/batch/client/Client.d.ts +89 -0
  4. package/api/resources/batch/client/Client.js +297 -0
  5. package/api/resources/batch/client/index.d.ts +1 -0
  6. package/api/resources/batch/client/index.js +17 -0
  7. package/api/resources/batch/client/requests/CreateBatchRequest.d.ts +21 -0
  8. package/api/resources/batch/client/requests/CreateBatchRequest.js +5 -0
  9. package/api/resources/batch/client/requests/ListBatchesRequest.d.ts +22 -0
  10. package/api/resources/batch/client/requests/ListBatchesRequest.js +5 -0
  11. package/api/resources/batch/client/requests/index.d.ts +2 -0
  12. package/api/resources/batch/client/requests/index.js +2 -0
  13. package/api/resources/batch/index.d.ts +1 -0
  14. package/api/resources/batch/index.js +17 -0
  15. package/api/resources/common/errors/PaymentRequiredError.d.ts +9 -0
  16. package/api/resources/common/errors/PaymentRequiredError.js +52 -0
  17. package/api/resources/common/errors/TooManyRequestsError.d.ts +9 -0
  18. package/api/resources/common/errors/TooManyRequestsError.js +52 -0
  19. package/api/resources/common/errors/index.d.ts +2 -0
  20. package/api/resources/common/errors/index.js +2 -0
  21. package/api/resources/common/types/ActiveSpeaker.d.ts +10 -0
  22. package/api/resources/common/types/ActiveSpeaker.js +5 -0
  23. package/api/resources/common/types/BatchId.d.ts +7 -0
  24. package/api/resources/common/types/BatchId.js +5 -0
  25. package/api/resources/common/types/BatchMetrics.d.ts +13 -0
  26. package/api/resources/common/types/BatchMetrics.js +5 -0
  27. package/api/resources/common/types/BatchResponse.d.ts +17 -0
  28. package/api/resources/common/types/BatchResponse.js +5 -0
  29. package/api/resources/common/types/BatchStatus.d.ts +14 -0
  30. package/api/resources/common/types/BatchStatus.js +13 -0
  31. package/api/resources/common/types/CreateBatchResponse.d.ts +5 -0
  32. package/api/resources/common/types/CreateBatchResponse.js +5 -0
  33. package/api/resources/common/types/CreateGenerationDto.d.ts +2 -0
  34. package/api/resources/common/types/Generation.d.ts +2 -0
  35. package/api/resources/common/types/GenerationOptions.d.ts +6 -14
  36. package/api/resources/common/types/Model.d.ts +1 -4
  37. package/api/resources/common/types/Model.js +0 -3
  38. package/api/resources/common/types/SyncMode.d.ts +20 -2
  39. package/api/resources/common/types/SyncMode.js +1 -1
  40. package/api/resources/common/types/ValidationResponse.d.ts +7 -0
  41. package/api/resources/common/types/ValidationResponse.js +5 -0
  42. package/api/resources/common/types/index.d.ts +7 -0
  43. package/api/resources/common/types/index.js +7 -0
  44. package/api/resources/generations/client/Client.d.ts +19 -0
  45. package/api/resources/generations/client/Client.js +93 -4
  46. package/api/resources/generations/client/requests/CreateGenerationRequest.d.ts +17 -0
  47. package/api/resources/generations/client/requests/CreateGenerationRequest.js +5 -0
  48. package/api/resources/generations/client/requests/index.d.ts +1 -0
  49. package/api/resources/index.d.ts +2 -0
  50. package/api/resources/index.js +3 -1
  51. package/api/resources/webhooks/types/GenerationNotification.d.ts +2 -0
  52. package/core/form-data-utils/FormDataWrapper.d.ts +63 -0
  53. package/core/form-data-utils/FormDataWrapper.js +227 -0
  54. package/core/form-data-utils/encodeAsFormParameter.d.ts +4 -0
  55. package/core/form-data-utils/encodeAsFormParameter.js +18 -0
  56. package/core/form-data-utils/index.d.ts +2 -0
  57. package/core/form-data-utils/index.js +20 -0
  58. package/core/index.d.ts +1 -0
  59. package/core/index.js +1 -0
  60. package/dist/Client.d.ts +3 -0
  61. package/dist/Client.js +7 -2
  62. package/dist/api/resources/batch/client/Client.d.ts +89 -0
  63. package/dist/api/resources/batch/client/Client.js +297 -0
  64. package/dist/api/resources/batch/client/index.d.ts +1 -0
  65. package/dist/api/resources/batch/client/index.js +17 -0
  66. package/dist/api/resources/batch/client/requests/CreateBatchRequest.d.ts +21 -0
  67. package/dist/api/resources/batch/client/requests/CreateBatchRequest.js +5 -0
  68. package/dist/api/resources/batch/client/requests/ListBatchesRequest.d.ts +22 -0
  69. package/dist/api/resources/batch/client/requests/ListBatchesRequest.js +5 -0
  70. package/dist/api/resources/batch/client/requests/index.d.ts +2 -0
  71. package/dist/api/resources/batch/client/requests/index.js +2 -0
  72. package/dist/api/resources/batch/index.d.ts +1 -0
  73. package/dist/api/resources/batch/index.js +17 -0
  74. package/dist/api/resources/common/errors/PaymentRequiredError.d.ts +9 -0
  75. package/dist/api/resources/common/errors/PaymentRequiredError.js +52 -0
  76. package/dist/api/resources/common/errors/TooManyRequestsError.d.ts +9 -0
  77. package/dist/api/resources/common/errors/TooManyRequestsError.js +52 -0
  78. package/dist/api/resources/common/errors/index.d.ts +2 -0
  79. package/dist/api/resources/common/errors/index.js +2 -0
  80. package/dist/api/resources/common/types/ActiveSpeaker.d.ts +10 -0
  81. package/dist/api/resources/common/types/ActiveSpeaker.js +5 -0
  82. package/dist/api/resources/common/types/BatchId.d.ts +7 -0
  83. package/dist/api/resources/common/types/BatchId.js +5 -0
  84. package/dist/api/resources/common/types/BatchMetrics.d.ts +13 -0
  85. package/dist/api/resources/common/types/BatchMetrics.js +5 -0
  86. package/dist/api/resources/common/types/BatchResponse.d.ts +17 -0
  87. package/dist/api/resources/common/types/BatchResponse.js +5 -0
  88. package/dist/api/resources/common/types/BatchStatus.d.ts +14 -0
  89. package/dist/api/resources/common/types/BatchStatus.js +13 -0
  90. package/dist/api/resources/common/types/CreateBatchResponse.d.ts +5 -0
  91. package/dist/api/resources/common/types/CreateBatchResponse.js +5 -0
  92. package/dist/api/resources/common/types/CreateGenerationDto.d.ts +2 -0
  93. package/dist/api/resources/common/types/Generation.d.ts +2 -0
  94. package/dist/api/resources/common/types/GenerationOptions.d.ts +6 -14
  95. package/dist/api/resources/common/types/Model.d.ts +1 -4
  96. package/dist/api/resources/common/types/Model.js +0 -3
  97. package/dist/api/resources/common/types/SyncMode.d.ts +20 -2
  98. package/dist/api/resources/common/types/SyncMode.js +1 -1
  99. package/dist/api/resources/common/types/ValidationResponse.d.ts +7 -0
  100. package/dist/api/resources/common/types/ValidationResponse.js +5 -0
  101. package/dist/api/resources/common/types/index.d.ts +7 -0
  102. package/dist/api/resources/common/types/index.js +7 -0
  103. package/dist/api/resources/generations/client/Client.d.ts +19 -0
  104. package/dist/api/resources/generations/client/Client.js +93 -4
  105. package/dist/api/resources/generations/client/requests/CreateGenerationRequest.d.ts +17 -0
  106. package/dist/api/resources/generations/client/requests/CreateGenerationRequest.js +5 -0
  107. package/dist/api/resources/generations/client/requests/index.d.ts +1 -0
  108. package/dist/api/resources/index.d.ts +2 -0
  109. package/dist/api/resources/index.js +3 -1
  110. package/dist/api/resources/webhooks/types/GenerationNotification.d.ts +2 -0
  111. package/dist/core/form-data-utils/FormDataWrapper.d.ts +63 -0
  112. package/dist/core/form-data-utils/FormDataWrapper.js +227 -0
  113. package/dist/core/form-data-utils/encodeAsFormParameter.d.ts +4 -0
  114. package/dist/core/form-data-utils/encodeAsFormParameter.js +18 -0
  115. package/dist/core/form-data-utils/index.d.ts +2 -0
  116. package/dist/core/form-data-utils/index.js +20 -0
  117. package/dist/core/index.d.ts +1 -0
  118. package/dist/core/index.js +1 -0
  119. package/dist/environments.d.ts +2 -1
  120. package/dist/environments.js +1 -0
  121. package/dist/version.d.ts +1 -1
  122. package/dist/version.js +1 -1
  123. package/environments.d.ts +2 -1
  124. package/environments.js +1 -0
  125. package/package.json +3 -2
  126. package/reference.md +272 -0
  127. package/version.d.ts +1 -1
  128. 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);
package/core/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from "./fetcher";
2
+ export * from "./form-data-utils";
2
3
  export * from "./runtime";
package/core/index.js CHANGED
@@ -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);
package/dist/Client.d.ts CHANGED
@@ -3,6 +3,7 @@
3
3
  */
4
4
  import * as environments from "./environments";
5
5
  import * as core from "./core";
6
+ import { Batch } from "./api/resources/batch/client/Client";
6
7
  import { Generations } from "./api/resources/generations/client/Client";
7
8
  export declare namespace SyncClient {
8
9
  interface Options {
@@ -25,7 +26,9 @@ export declare namespace SyncClient {
25
26
  }
26
27
  export declare class SyncClient {
27
28
  protected readonly _options: SyncClient.Options;
29
+ protected _batch: Batch | undefined;
28
30
  protected _generations: Generations | undefined;
29
31
  constructor(_options: SyncClient.Options);
32
+ get batch(): Batch;
30
33
  get generations(): Generations;
31
34
  }
package/dist/Client.js CHANGED
@@ -4,14 +4,19 @@
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.SyncClient = void 0;
7
- const Client_1 = require("./api/resources/generations/client/Client");
7
+ const Client_1 = require("./api/resources/batch/client/Client");
8
+ const Client_2 = require("./api/resources/generations/client/Client");
8
9
  class SyncClient {
9
10
  constructor(_options) {
10
11
  this._options = _options;
11
12
  }
13
+ get batch() {
14
+ var _a;
15
+ return ((_a = this._batch) !== null && _a !== void 0 ? _a : (this._batch = new Client_1.Batch(this._options)));
16
+ }
12
17
  get generations() {
13
18
  var _a;
14
- return ((_a = this._generations) !== null && _a !== void 0 ? _a : (this._generations = new Client_1.Generations(this._options)));
19
+ return ((_a = this._generations) !== null && _a !== void 0 ? _a : (this._generations = new Client_2.Generations(this._options)));
15
20
  }
16
21
  }
17
22
  exports.SyncClient = SyncClient;
@@ -0,0 +1,89 @@
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
+ import * as fs from "fs";
8
+ import { Blob } from "buffer";
9
+ export declare namespace Batch {
10
+ interface Options {
11
+ environment?: core.Supplier<environments.SyncEnvironment | string>;
12
+ /** Specify a custom URL to connect the client to. */
13
+ baseUrl?: core.Supplier<string>;
14
+ apiKey: core.Supplier<string>;
15
+ fetcher?: core.FetchFunction;
16
+ }
17
+ interface RequestOptions {
18
+ /** The maximum time to wait for a response in seconds. */
19
+ timeoutInSeconds?: number;
20
+ /** The number of times to retry the request. Defaults to 2. */
21
+ maxRetries?: number;
22
+ /** A hook to abort the request. */
23
+ abortSignal?: AbortSignal;
24
+ /** Additional headers to include in the request. */
25
+ headers?: Record<string, string>;
26
+ }
27
+ }
28
+ export declare class Batch {
29
+ protected readonly _options: Batch.Options;
30
+ constructor(_options: Batch.Options);
31
+ /**
32
+ * API for [Batch Processing](/api-reference/guides/batch-processing). Available only for `Scale` and `Enterprise` plans.
33
+ *
34
+ * @param {File | fs.ReadStream | Blob} input
35
+ * @param {Sync.CreateBatchRequest} request
36
+ * @param {Batch.RequestOptions} requestOptions - Request-specific configuration.
37
+ *
38
+ * @throws {@link Sync.BadRequestError}
39
+ * @throws {@link Sync.UnauthorizedError}
40
+ * @throws {@link Sync.PaymentRequiredError}
41
+ * @throws {@link Sync.TooManyRequestsError}
42
+ * @throws {@link Sync.InternalServerError}
43
+ *
44
+ * @example
45
+ * await client.batch.create(fs.createReadStream("/path/to/your/file"), {
46
+ * webhook_url: "https://your-webhook-url.com/batch-webhook",
47
+ * dry_run: false
48
+ * })
49
+ *
50
+ * @example
51
+ * await client.batch.create(fs.createReadStream("/path/to/your/file"), {
52
+ * dry_run: true
53
+ * })
54
+ */
55
+ create(input: File | fs.ReadStream | Blob, request: Sync.CreateBatchRequest, requestOptions?: Batch.RequestOptions): core.HttpResponsePromise<Sync.CreateBatchResponse>;
56
+ private __create;
57
+ /**
58
+ * Retrieve details about a specific batch, including its current status, processing metrics, and output file URL when available.
59
+ *
60
+ * @param {Sync.BatchId} id - The unique identifier of the batch
61
+ * @param {Batch.RequestOptions} requestOptions - Request-specific configuration.
62
+ *
63
+ * @throws {@link Sync.UnauthorizedError}
64
+ * @throws {@link Sync.NotFoundError}
65
+ * @throws {@link Sync.InternalServerError}
66
+ *
67
+ * @example
68
+ * await client.batch.get("batch_abc123")
69
+ */
70
+ get(id: Sync.BatchId, requestOptions?: Batch.RequestOptions): core.HttpResponsePromise<Sync.BatchResponse>;
71
+ private __get;
72
+ /**
73
+ * List all batches for your organization with optional filtering by status and creation date. Results are ordered by creation date (newest first).
74
+ *
75
+ * @param {Sync.ListBatchesRequest} request
76
+ * @param {Batch.RequestOptions} requestOptions - Request-specific configuration.
77
+ *
78
+ * @throws {@link Sync.UnauthorizedError}
79
+ * @throws {@link Sync.InternalServerError}
80
+ *
81
+ * @example
82
+ * await client.batch.list()
83
+ */
84
+ list(request?: Sync.ListBatchesRequest, requestOptions?: Batch.RequestOptions): core.HttpResponsePromise<Sync.BatchResponse[]>;
85
+ private __list;
86
+ protected _getCustomAuthorizationHeaders(): Promise<{
87
+ "x-api-key": string;
88
+ }>;
89
+ }