@uploadcare/upload-client 2.0.0-alpha.8 → 2.2.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/README.md CHANGED
@@ -42,7 +42,7 @@ providing the necessary settings. Specifying `YOUR_PUBLIC_KEY` is mandatory: it
42
42
  points to the specific Uploadcare project:
43
43
 
44
44
  ```javascript
45
- import UploadClient from '@uploadcare/upload-client'
45
+ import { UploadClient } from '@uploadcare/upload-client'
46
46
 
47
47
  const client = new UploadClient({ publicKey: 'YOUR_PUBLIC_KEY' })
48
48
  ```
@@ -94,10 +94,10 @@ You can cancel file uploading and track this event:
94
94
 
95
95
  ```javascript
96
96
  const fileUUID = 'edfdf045-34c0-4087-bbdd-e3834921f890'
97
- const controller = new CancelController()
97
+ const abortController = new AbortController()
98
98
 
99
99
  client
100
- .uploadFile(fileUUID, { cancel: controller })
100
+ .uploadFile(fileUUID, { signal: abortController })
101
101
  .then(file => console.log(file.uuid))
102
102
  .catch(error => {
103
103
  if (error.isCancel) {
@@ -106,7 +106,7 @@ client
106
106
  })
107
107
 
108
108
  // Cancel uploading
109
- controller.cancel()
109
+ abortController.abort()
110
110
  ```
111
111
 
112
112
  List of all available `UploadClient` API methods:
@@ -163,17 +163,30 @@ interface UploadClient {
163
163
  }
164
164
  ```
165
165
 
166
+ You can import only needed methods directly, without `UploadClient` wrapper:
167
+
168
+ ```javascript
169
+ import {
170
+ uploadFile,
171
+ uploadFromUrl,
172
+ uploadBase,
173
+ uploadFromUploaded,
174
+ uploadMultipart,
175
+ uploadFileGroup
176
+ } from '@uploadcare/upload-client'
177
+ ```
178
+
166
179
  ### Low-Level API
167
180
 
168
181
  Also, you can use low-level wrappers to call the API endpoints directly:
169
182
 
170
183
  ```javascript
171
- import { base, CancelController } from '@uploadcare/upload-client'
184
+ import { base, AbortController } from '@uploadcare/upload-client'
172
185
 
173
186
  const onProgress = ({ value }) => console.log(value)
174
- const cancelController = new CancelController()
187
+ const abortController = new AbortController()
175
188
 
176
- base(fileData, { onProgress, cancel: cancelController }) // fileData must be `Blob` or `File` or `Buffer`
189
+ base(fileData, { onProgress, signal: abortController }) // fileData must be `Blob` or `File` or `Buffer`
177
190
  .then(data => console.log(data.file))
178
191
  .catch(error => {
179
192
  if (error.isCancel) {
@@ -182,7 +195,7 @@ base(fileData, { onProgress, cancel: cancelController }) // fileData must be `Bl
182
195
  })
183
196
 
184
197
  // Also you can cancel upload:
185
- cancelController.cancel()
198
+ abortController.abort()
186
199
  ```
187
200
 
188
201
  List of all available API methods:
@@ -290,7 +303,19 @@ of `API secret key` and `secureExpire`.
290
303
 
291
304
  Stands for the Unix time to which the signature is valid, e.g., `1454902434`.
292
305
 
293
- #### `integration: string`
306
+ #### `integration: string | CustomUserAgentFn`
307
+
308
+ ```typescript
309
+ type CustomUserAgentOptions = {
310
+ publicKey: string
311
+ libraryName: string
312
+ libraryVersion: string
313
+ languageName: string
314
+ integration?: string
315
+ }
316
+
317
+ type CustomUserAgentFn = (options: CustomUserAgentOptions) => string
318
+ ```
294
319
 
295
320
  `X-UC-User-Agent` header value.
296
321
 
@@ -372,7 +397,7 @@ npm run test
372
397
  By default, tests runs with mock server, but you can run tests with
373
398
  production environment.
374
399
 
375
- Run test on production servers:
400
+ Run test on production servers:
376
401
 
377
402
  ```bash
378
403
  npm run test:production
@@ -52,10 +52,11 @@ function __spreadArrays() {
52
52
 
53
53
  var UploadClientError = /** @class */ (function (_super) {
54
54
  __extends(UploadClientError, _super);
55
- function UploadClientError(message, request, response, headers) {
55
+ function UploadClientError(message, code, request, response, headers) {
56
56
  var _this = _super.call(this) || this;
57
57
  _this.name = 'UploadClientError';
58
58
  _this.message = message;
59
+ _this.code = code;
59
60
  _this.request = request;
60
61
  _this.response = response;
61
62
  _this.headers = headers;
@@ -163,20 +164,27 @@ var request = function (_a) {
163
164
  });
164
165
  };
165
166
 
167
+ function identity(obj) {
168
+ return obj;
169
+ }
170
+
171
+ var transformFile = identity;
166
172
  var getFormData = (function () { return new FormData(); });
167
173
 
174
+ var isFileTuple = function (tuple) {
175
+ return tuple[0] === 'file';
176
+ };
168
177
  function buildFormData(body) {
169
178
  var formData = getFormData();
170
- var isTriple = function (tuple) {
171
- return tuple[0] === 'file';
172
- };
173
179
  var _loop_1 = function (tuple) {
174
180
  if (Array.isArray(tuple[1])) {
175
181
  // refactor this
176
182
  tuple[1].forEach(function (val) { return val && formData.append(tuple[0] + '[]', "" + val); });
177
183
  }
178
- else if (isTriple(tuple)) {
179
- formData.append(tuple[0], tuple[1], tuple[2]);
184
+ else if (isFileTuple(tuple)) {
185
+ var name_1 = tuple[2];
186
+ var file = transformFile(tuple[1]); // lgtm[js/superfluous-trailing-arguments]
187
+ formData.append(tuple[0], file, name_1);
180
188
  }
181
189
  else if (tuple[1] != null) {
182
190
  formData.append(tuple[0], "" + tuple[1]);
@@ -234,7 +242,7 @@ var defaultSettings = {
234
242
  var defaultContentType = 'application/octet-stream';
235
243
  var defaultFilename = 'original';
236
244
 
237
- var version = '1.1.2';
245
+ var version = '2.2.0';
238
246
 
239
247
  /**
240
248
  * Returns User Agent based on version and settings.
@@ -323,7 +331,7 @@ function retrier(fn, options) {
323
331
  return runAttempt(fn);
324
332
  }
325
333
 
326
- var REQUEST_WAS_THROTTLED_CODE = 429;
334
+ var REQUEST_WAS_THROTTLED_CODE = 'RequestThrottledError';
327
335
  var DEFAULT_RETRY_AFTER_TIMEOUT = 15000;
328
336
  function getTimeoutFromThrottledRequest(error) {
329
337
  var headers = (error || {}).headers;
@@ -335,9 +343,8 @@ function retryIfThrottled(fn, retryThrottledMaxTimes) {
335
343
  return retrier(function (_a) {
336
344
  var attempt = _a.attempt, retry = _a.retry;
337
345
  return fn().catch(function (error) {
338
- var _a;
339
346
  if ('response' in error &&
340
- ((_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.statusCode) === REQUEST_WAS_THROTTLED_CODE &&
347
+ (error === null || error === void 0 ? void 0 : error.code) === REQUEST_WAS_THROTTLED_CODE &&
341
348
  attempt < retryThrottledMaxTimes) {
342
349
  return retry(getTimeoutFromThrottledRequest(error));
343
350
  }
@@ -379,7 +386,7 @@ function base(file, _a) {
379
386
  var data = _a.data, headers = _a.headers, request = _a.request;
380
387
  var response = camelizeKeys(JSON.parse(data));
381
388
  if ('error' in response) {
382
- throw new UploadClientError("[" + response.error.statusCode + "] " + response.error.content, request, response.error, headers);
389
+ throw new UploadClientError(response.error.content, response.error.errorCode, request, response, headers);
383
390
  }
384
391
  else {
385
392
  return response;
@@ -396,7 +403,6 @@ var TypeEnum;
396
403
  /**
397
404
  * Uploading files from URL.
398
405
  */
399
- /* eslint @typescript-eslint/camelcase: [2, {allow: ["pub_key", "source_url", "check_URL_duplicates", "save_URL_duplicates"]}] */
400
406
  function fromUrl(sourceUrl, _a) {
401
407
  var publicKey = _a.publicKey, _b = _a.baseURL, baseURL = _b === void 0 ? defaultSettings.baseURL : _b, store = _a.store, fileName = _a.fileName, checkForUrlDuplicates = _a.checkForUrlDuplicates, saveUrlForRecurrentUploads = _a.saveUrlForRecurrentUploads, secureSignature = _a.secureSignature, secureExpire = _a.secureExpire, _c = _a.source, source = _c === void 0 ? 'url' : _c, signal = _a.signal, integration = _a.integration, userAgent = _a.userAgent, _d = _a.retryThrottledRequestMaxTimes, retryThrottledRequestMaxTimes = _d === void 0 ? defaultSettings.retryThrottledRequestMaxTimes : _d;
402
408
  return retryIfThrottled(function () {
@@ -422,7 +428,7 @@ function fromUrl(sourceUrl, _a) {
422
428
  var data = _a.data, headers = _a.headers, request = _a.request;
423
429
  var response = camelizeKeys(JSON.parse(data));
424
430
  if ('error' in response) {
425
- throw new UploadClientError("[" + response.error.statusCode + "] " + response.error.content, request, response.error, headers);
431
+ throw new UploadClientError(response.error.content, response.error.errorCode, request, response, headers);
426
432
  }
427
433
  else {
428
434
  return response;
@@ -468,7 +474,7 @@ function fromUrlStatus(token, _a) {
468
474
  var data = _a.data, headers = _a.headers, request = _a.request;
469
475
  var response = camelizeKeys(JSON.parse(data));
470
476
  if ('error' in response && !isErrorResponse(response)) {
471
- throw new UploadClientError("[" + response.error.statusCode + "] " + response.error.content, request, response.error, headers);
477
+ throw new UploadClientError(response.error.content, undefined, request, response, headers);
472
478
  }
473
479
  else {
474
480
  return response;
@@ -480,7 +486,6 @@ function fromUrlStatus(token, _a) {
480
486
  /**
481
487
  * Create files group.
482
488
  */
483
- /* eslint @typescript-eslint/camelcase: [2, {allow: ["pub_key"]}] */
484
489
  function group(uuids, _a) {
485
490
  var publicKey = _a.publicKey, _b = _a.baseURL, baseURL = _b === void 0 ? defaultSettings.baseURL : _b, jsonpCallback = _a.jsonpCallback, secureSignature = _a.secureSignature, secureExpire = _a.secureExpire, signal = _a.signal, source = _a.source, integration = _a.integration, userAgent = _a.userAgent, _c = _a.retryThrottledRequestMaxTimes, retryThrottledRequestMaxTimes = _c === void 0 ? defaultSettings.retryThrottledRequestMaxTimes : _c;
486
491
  return retryIfThrottled(function () {
@@ -503,7 +508,7 @@ function group(uuids, _a) {
503
508
  var data = _a.data, headers = _a.headers, request = _a.request;
504
509
  var response = camelizeKeys(JSON.parse(data));
505
510
  if ('error' in response) {
506
- throw new UploadClientError("[" + response.error.statusCode + "] " + response.error.content, request, response.error, headers);
511
+ throw new UploadClientError(response.error.content, response.error.errorCode, request, response, headers);
507
512
  }
508
513
  else {
509
514
  return response;
@@ -515,7 +520,6 @@ function group(uuids, _a) {
515
520
  /**
516
521
  * Get info about group.
517
522
  */
518
- /* eslint @typescript-eslint/camelcase: [2, {allow: ["pub_key", "group_id"]}] */
519
523
  function groupInfo(id, _a) {
520
524
  var publicKey = _a.publicKey, _b = _a.baseURL, baseURL = _b === void 0 ? defaultSettings.baseURL : _b, signal = _a.signal, source = _a.source, integration = _a.integration, userAgent = _a.userAgent, _c = _a.retryThrottledRequestMaxTimes, retryThrottledRequestMaxTimes = _c === void 0 ? defaultSettings.retryThrottledRequestMaxTimes : _c;
521
525
  return retryIfThrottled(function () {
@@ -535,7 +539,7 @@ function groupInfo(id, _a) {
535
539
  var data = _a.data, headers = _a.headers, request = _a.request;
536
540
  var response = camelizeKeys(JSON.parse(data));
537
541
  if ('error' in response) {
538
- throw new UploadClientError("[" + response.error.statusCode + "] " + response.error.content, request, response.error, headers);
542
+ throw new UploadClientError(response.error.content, response.error.errorCode, request, response, headers);
539
543
  }
540
544
  else {
541
545
  return response;
@@ -547,7 +551,6 @@ function groupInfo(id, _a) {
547
551
  /**
548
552
  * Returns a JSON dictionary holding file info.
549
553
  */
550
- /* eslint @typescript-eslint/camelcase: [2, {allow: ["pub_key", "file_id"]}] */
551
554
  function info(uuid, _a) {
552
555
  var publicKey = _a.publicKey, _b = _a.baseURL, baseURL = _b === void 0 ? defaultSettings.baseURL : _b, signal = _a.signal, source = _a.source, integration = _a.integration, userAgent = _a.userAgent, _c = _a.retryThrottledRequestMaxTimes, retryThrottledRequestMaxTimes = _c === void 0 ? defaultSettings.retryThrottledRequestMaxTimes : _c;
553
556
  return retryIfThrottled(function () {
@@ -567,7 +570,7 @@ function info(uuid, _a) {
567
570
  var data = _a.data, headers = _a.headers, request = _a.request;
568
571
  var response = camelizeKeys(JSON.parse(data));
569
572
  if ('error' in response) {
570
- throw new UploadClientError("[" + response.error.statusCode + "] " + response.error.content, request, response.error, headers);
573
+ throw new UploadClientError(response.error.content, response.error.errorCode, request, response, headers);
571
574
  }
572
575
  else {
573
576
  return response;
@@ -604,7 +607,7 @@ function multipartStart(size, _a) {
604
607
  var data = _a.data, headers = _a.headers, request = _a.request;
605
608
  var response = camelizeKeys(JSON.parse(data));
606
609
  if ('error' in response) {
607
- throw new UploadClientError("[" + response.error.statusCode + "] " + response.error.content, request, response.error, headers);
610
+ throw new UploadClientError(response.error.content, response.error.errorCode, request, response, headers);
608
611
  }
609
612
  else {
610
613
  // convert to array
@@ -661,7 +664,7 @@ function multipartComplete(uuid, _a) {
661
664
  var data = _a.data, headers = _a.headers, request = _a.request;
662
665
  var response = camelizeKeys(JSON.parse(data));
663
666
  if ('error' in response) {
664
- throw new UploadClientError("[" + response.error.statusCode + "] " + response.error.content, request, response.error, headers);
667
+ throw new UploadClientError(response.error.content, response.error.errorCode, request, response, headers);
665
668
  }
666
669
  else {
667
670
  return response;
@@ -677,6 +680,7 @@ var UploadcareFile = /** @class */ (function () {
677
680
  this.size = null;
678
681
  this.isStored = null;
679
682
  this.isImage = null;
683
+ this.mimeType = null;
680
684
  this.cdnUrl = null;
681
685
  this.cdnUrlModifiers = null;
682
686
  this.originalUrl = null;
@@ -695,6 +699,7 @@ var UploadcareFile = /** @class */ (function () {
695
699
  this.size = fileInfo.size;
696
700
  this.isStored = fileInfo.isStored;
697
701
  this.isImage = fileInfo.isImage;
702
+ this.mimeType = fileInfo.mimeType;
698
703
  this.cdnUrl = cdnUrl;
699
704
  this.cdnUrlModifiers = cdnUrlModifiers;
700
705
  this.originalUrl = originalUrl;
@@ -895,7 +900,7 @@ var Pusher = /** @class */ (function () {
895
900
  _this.queue = [];
896
901
  });
897
902
  this.ws.addEventListener('message', function (e) {
898
- var data = JSON.parse(e.data);
903
+ var data = JSON.parse(e.data.toString());
899
904
  switch (data.event) {
900
905
  case 'pusher:connection_established': {
901
906
  _this.emmitter.emit('connected', undefined);
@@ -1004,7 +1009,7 @@ function pollStrategy(_a) {
1004
1009
  }).then(function (response) {
1005
1010
  switch (response.status) {
1006
1011
  case Status.Error: {
1007
- return new UploadClientError(response.error);
1012
+ return new UploadClientError(response.error, response.errorCode);
1008
1013
  }
1009
1014
  case Status.Waiting: {
1010
1015
  return false;
@@ -1032,7 +1037,7 @@ function pollStrategy(_a) {
1032
1037
  });
1033
1038
  }
1034
1039
  var pushStrategy = function (_a) {
1035
- var token = _a.token, pusherKey = _a.pusherKey, signal = _a.signal, stopRace = _a.stopRace, onProgress = _a.onProgress;
1040
+ var token = _a.token, pusherKey = _a.pusherKey, signal = _a.signal, onProgress = _a.onProgress;
1036
1041
  return new Promise(function (resolve, reject) {
1037
1042
  var pusher = getPusher(pusherKey);
1038
1043
  var unsubErrorHandler = pusher.onError(reject);
@@ -1042,10 +1047,9 @@ var pushStrategy = function (_a) {
1042
1047
  };
1043
1048
  onCancel(signal, function () {
1044
1049
  destroy();
1045
- reject(cancelError('pisher cancelled'));
1050
+ reject(cancelError('pusher cancelled'));
1046
1051
  });
1047
1052
  pusher.subscribe(token, function (result) {
1048
- stopRace();
1049
1053
  switch (result.status) {
1050
1054
  case Status.Progress: {
1051
1055
  if (onProgress) {
@@ -1062,7 +1066,7 @@ var pushStrategy = function (_a) {
1062
1066
  }
1063
1067
  case Status.Error: {
1064
1068
  destroy();
1065
- reject(new UploadClientError(result.msg));
1069
+ reject(new UploadClientError(result.msg, result.error_code));
1066
1070
  }
1067
1071
  }
1068
1072
  });
@@ -1087,6 +1091,11 @@ var uploadFromUrl = function (sourceUrl, _a) {
1087
1091
  userAgent: userAgent,
1088
1092
  retryThrottledRequestMaxTimes: retryThrottledRequestMaxTimes
1089
1093
  });
1094
+ })
1095
+ .catch(function (error) {
1096
+ var pusher = getPusher(pusherKey);
1097
+ pusher === null || pusher === void 0 ? void 0 : pusher.disconnect();
1098
+ return Promise.reject(error);
1090
1099
  })
1091
1100
  .then(function (urlResponse) {
1092
1101
  if (urlResponse.type === TypeEnum.FileInfo) {
@@ -1108,11 +1117,10 @@ var uploadFromUrl = function (sourceUrl, _a) {
1108
1117
  });
1109
1118
  },
1110
1119
  function (_a) {
1111
- var stopRace = _a.stopRace, signal = _a.signal;
1120
+ var signal = _a.signal;
1112
1121
  return pushStrategy({
1113
1122
  token: urlResponse.token,
1114
1123
  pusherKey: pusherKey,
1115
- stopRace: stopRace,
1116
1124
  signal: signal,
1117
1125
  onProgress: onProgress
1118
1126
  });
@@ -1202,6 +1210,18 @@ var isMultipart = function (fileSize, multipartMinFileSize) {
1202
1210
  return fileSize >= multipartMinFileSize;
1203
1211
  };
1204
1212
 
1213
+ var sliceChunk = function (file, index, fileSize, chunkSize) {
1214
+ var start = chunkSize * index;
1215
+ var end = Math.min(start + chunkSize, fileSize);
1216
+ return file.slice(start, end);
1217
+ };
1218
+
1219
+ function prepareChunks(file, fileSize, chunkSize) {
1220
+ return function (index) {
1221
+ return sliceChunk(file, index, fileSize, chunkSize);
1222
+ };
1223
+ }
1224
+
1205
1225
  var runWithConcurrency = function (concurrency, tasks) {
1206
1226
  return new Promise(function (resolve, reject) {
1207
1227
  var results = [];
@@ -1237,18 +1257,15 @@ var runWithConcurrency = function (concurrency, tasks) {
1237
1257
  });
1238
1258
  };
1239
1259
 
1240
- var getChunk = function (file, index, fileSize, chunkSize) {
1241
- var start = chunkSize * index;
1242
- var end = Math.min(start + chunkSize, fileSize);
1243
- return file.slice(start, end);
1244
- };
1245
1260
  var uploadPartWithRetry = function (chunk, url, _a) {
1246
- var onProgress = _a.onProgress, signal = _a.signal, multipartMaxAttempts = _a.multipartMaxAttempts;
1261
+ var publicKey = _a.publicKey, onProgress = _a.onProgress, signal = _a.signal, integration = _a.integration, multipartMaxAttempts = _a.multipartMaxAttempts;
1247
1262
  return retrier(function (_a) {
1248
1263
  var attempt = _a.attempt, retry = _a.retry;
1249
1264
  return multipartUpload(chunk, url, {
1265
+ publicKey: publicKey,
1250
1266
  onProgress: onProgress,
1251
- signal: signal
1267
+ signal: signal,
1268
+ integration: integration
1252
1269
  }).catch(function (error) {
1253
1270
  if (attempt < multipartMaxAttempts) {
1254
1271
  return retry();
@@ -1292,12 +1309,15 @@ var uploadMultipart = function (file, _a) {
1292
1309
  })
1293
1310
  .then(function (_a) {
1294
1311
  var uuid = _a.uuid, parts = _a.parts;
1312
+ var getChunk = prepareChunks(file, size, multipartChunkSize);
1295
1313
  return Promise.all([
1296
1314
  uuid,
1297
1315
  runWithConcurrency(maxConcurrentRequests, parts.map(function (url, index) { return function () {
1298
- return uploadPartWithRetry(getChunk(file, index, size, multipartChunkSize), url, {
1316
+ return uploadPartWithRetry(getChunk(index), url, {
1317
+ publicKey: publicKey,
1299
1318
  onProgress: createProgressHandler(parts.length, index),
1300
1319
  signal: signal,
1320
+ integration: integration,
1301
1321
  multipartMaxAttempts: multipartMaxAttempts
1302
1322
  });
1303
1323
  }; }))
@@ -1339,7 +1359,7 @@ var uploadMultipart = function (file, _a) {
1339
1359
  * Uploads file from provided data.
1340
1360
  */
1341
1361
  function uploadFile(data, _a) {
1342
- var publicKey = _a.publicKey, fileName = _a.fileName, _b = _a.baseURL, baseURL = _b === void 0 ? defaultSettings.baseURL : _b, secureSignature = _a.secureSignature, secureExpire = _a.secureExpire, store = _a.store, signal = _a.signal, onProgress = _a.onProgress, source = _a.source, integration = _a.integration, userAgent = _a.userAgent, retryThrottledRequestMaxTimes = _a.retryThrottledRequestMaxTimes, contentType = _a.contentType, _c = _a.multipartChunkSize, multipartChunkSize = _c === void 0 ? defaultSettings.multipartChunkSize : _c, _d = _a.baseCDN, baseCDN = _d === void 0 ? defaultSettings.baseCDN : _d;
1362
+ var publicKey = _a.publicKey, fileName = _a.fileName, _b = _a.baseURL, baseURL = _b === void 0 ? defaultSettings.baseURL : _b, secureSignature = _a.secureSignature, secureExpire = _a.secureExpire, store = _a.store, signal = _a.signal, onProgress = _a.onProgress, source = _a.source, integration = _a.integration, userAgent = _a.userAgent, retryThrottledRequestMaxTimes = _a.retryThrottledRequestMaxTimes, contentType = _a.contentType, multipartChunkSize = _a.multipartChunkSize, multipartMaxAttempts = _a.multipartMaxAttempts, maxConcurrentRequests = _a.maxConcurrentRequests, _c = _a.baseCDN, baseCDN = _c === void 0 ? defaultSettings.baseCDN : _c, checkForUrlDuplicates = _a.checkForUrlDuplicates, saveUrlForRecurrentUploads = _a.saveUrlForRecurrentUploads, pusherKey = _a.pusherKey;
1343
1363
  if (isFileData(data)) {
1344
1364
  var fileSize = getFileSize(data);
1345
1365
  if (isMultipart(fileSize)) {
@@ -1347,6 +1367,7 @@ function uploadFile(data, _a) {
1347
1367
  publicKey: publicKey,
1348
1368
  contentType: contentType,
1349
1369
  multipartChunkSize: multipartChunkSize,
1370
+ multipartMaxAttempts: multipartMaxAttempts,
1350
1371
  fileName: fileName,
1351
1372
  baseURL: baseURL,
1352
1373
  secureSignature: secureSignature,
@@ -1357,6 +1378,7 @@ function uploadFile(data, _a) {
1357
1378
  source: source,
1358
1379
  integration: integration,
1359
1380
  userAgent: userAgent,
1381
+ maxConcurrentRequests: maxConcurrentRequests,
1360
1382
  retryThrottledRequestMaxTimes: retryThrottledRequestMaxTimes,
1361
1383
  baseCDN: baseCDN
1362
1384
  });
@@ -1382,6 +1404,9 @@ function uploadFile(data, _a) {
1382
1404
  publicKey: publicKey,
1383
1405
  fileName: fileName,
1384
1406
  baseURL: baseURL,
1407
+ baseCDN: baseCDN,
1408
+ checkForUrlDuplicates: checkForUrlDuplicates,
1409
+ saveUrlForRecurrentUploads: saveUrlForRecurrentUploads,
1385
1410
  secureSignature: secureSignature,
1386
1411
  secureExpire: secureExpire,
1387
1412
  store: store,
@@ -1391,7 +1416,7 @@ function uploadFile(data, _a) {
1391
1416
  integration: integration,
1392
1417
  userAgent: userAgent,
1393
1418
  retryThrottledRequestMaxTimes: retryThrottledRequestMaxTimes,
1394
- baseCDN: baseCDN
1419
+ pusherKey: pusherKey
1395
1420
  });
1396
1421
  }
1397
1422
  if (isUuid(data)) {
@@ -1418,8 +1443,7 @@ var UploadcareGroup = /** @class */ (function () {
1418
1443
  this.filesCount = groupInfo.filesCount;
1419
1444
  this.totalSize = Object.values(groupInfo.files).reduce(function (acc, file) { return acc + file.size; }, 0);
1420
1445
  this.isStored = !!groupInfo.datetimeStored;
1421
- this.isImage = !!Object.values(groupInfo.files).filter(function (file) { return file.isImage; })
1422
- .length;
1446
+ this.isImage = !!Object.values(groupInfo.files).filter(function (file) { return file.isImage; }).length;
1423
1447
  this.cdnUrl = groupInfo.cdnUrl;
1424
1448
  this.files = files;
1425
1449
  this.createdAt = groupInfo.datetimeCreated;
@@ -1592,6 +1616,9 @@ var UploadClient = /** @class */ (function () {
1592
1616
 
1593
1617
  exports.AbortController = AbortController;
1594
1618
  exports.UploadClient = UploadClient;
1619
+ exports.UploadClientError = UploadClientError;
1620
+ exports.UploadcareFile = UploadcareFile;
1621
+ exports.UploadcareGroup = UploadcareGroup;
1595
1622
  exports.base = base;
1596
1623
  exports.fromUrl = fromUrl;
1597
1624
  exports.fromUrlStatus = fromUrlStatus;
@@ -1601,5 +1628,9 @@ exports.info = info;
1601
1628
  exports.multipartComplete = multipartComplete;
1602
1629
  exports.multipartStart = multipartStart;
1603
1630
  exports.multipartUpload = multipartUpload;
1631
+ exports.uploadBase = uploadFromObject;
1604
1632
  exports.uploadFile = uploadFile;
1605
1633
  exports.uploadFileGroup = uploadFileGroup;
1634
+ exports.uploadFromUploaded = uploadFromUploaded;
1635
+ exports.uploadFromUrl = uploadFromUrl;
1636
+ exports.uploadMultipart = uploadMultipart;