@uploadcare/upload-client 6.12.1 → 6.14.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.
@@ -317,7 +317,12 @@ const isFileValue = (value) => !!value &&
317
317
  'data' in value &&
318
318
  isFileData(value.data);
319
319
  function collectParams(params, inputKey, inputValue) {
320
- if (isFileValue(inputValue)) {
320
+ if (Array.isArray(inputValue)) {
321
+ for (const value of inputValue) {
322
+ collectParams(params, `${inputKey}[]`, value);
323
+ }
324
+ }
325
+ else if (isFileValue(inputValue)) {
321
326
  const { name, contentType } = inputValue;
322
327
  const file = transformFile(inputValue.data, name, contentType ?? defaultContentType);
323
328
  const options = getFileOptions({ name, contentType });
@@ -400,7 +405,7 @@ const getUrl = (base, path, query) => {
400
405
  return url.toString();
401
406
  };
402
407
 
403
- var version = '6.12.1';
408
+ var version = '6.14.0';
404
409
 
405
410
  const LIBRARY_NAME = 'UploadcareUploadClient';
406
411
  const LIBRARY_VERSION = version;
@@ -595,10 +600,12 @@ function group(uuids, { publicKey, baseURL = defaultSettings.baseURL, jsonpCallb
595
600
  'X-UC-User-Agent': getUserAgent({ publicKey, integration, userAgent })
596
601
  },
597
602
  url: getUrl(baseURL, '/group/', {
598
- jsonerrors: 1,
599
- pub_key: publicKey,
603
+ jsonerrors: 1
604
+ }),
605
+ data: buildFormData({
600
606
  files: uuids,
601
607
  callback: jsonpCallback,
608
+ pub_key: publicKey,
602
609
  signature: secureSignature,
603
610
  expire: secureExpire,
604
611
  source
@@ -348,7 +348,12 @@ const isFileValue = (value) => !!value &&
348
348
  'data' in value &&
349
349
  isFileData(value.data);
350
350
  function collectParams(params, inputKey, inputValue) {
351
- if (isFileValue(inputValue)) {
351
+ if (Array.isArray(inputValue)) {
352
+ for (const value of inputValue) {
353
+ collectParams(params, `${inputKey}[]`, value);
354
+ }
355
+ }
356
+ else if (isFileValue(inputValue)) {
352
357
  const { name, contentType } = inputValue;
353
358
  const file = transformFile(inputValue.data, name, contentType ?? defaultContentType);
354
359
  const options = getFileOptions({ name, contentType });
@@ -431,7 +436,7 @@ const getUrl = (base, path, query) => {
431
436
  return url.toString();
432
437
  };
433
438
 
434
- var version = '6.12.1';
439
+ var version = '6.14.0';
435
440
 
436
441
  const LIBRARY_NAME = 'UploadcareUploadClient';
437
442
  const LIBRARY_VERSION = version;
@@ -626,10 +631,12 @@ function group(uuids, { publicKey, baseURL = defaultSettings.baseURL, jsonpCallb
626
631
  'X-UC-User-Agent': getUserAgent({ publicKey, integration, userAgent })
627
632
  },
628
633
  url: getUrl(baseURL, '/group/', {
629
- jsonerrors: 1,
630
- pub_key: publicKey,
634
+ jsonerrors: 1
635
+ }),
636
+ data: buildFormData({
631
637
  files: uuids,
632
638
  callback: jsonpCallback,
639
+ pub_key: publicKey,
633
640
  signature: secureSignature,
634
641
  expire: secureExpire,
635
642
  source
@@ -325,7 +325,12 @@ const isFileValue = (value) => !!value &&
325
325
  'data' in value &&
326
326
  isFileData(value.data);
327
327
  function collectParams(params, inputKey, inputValue) {
328
- if (isFileValue(inputValue)) {
328
+ if (Array.isArray(inputValue)) {
329
+ for (const value of inputValue) {
330
+ collectParams(params, `${inputKey}[]`, value);
331
+ }
332
+ }
333
+ else if (isFileValue(inputValue)) {
329
334
  const { name, contentType } = inputValue;
330
335
  const file = transformFile(inputValue.data, name, contentType ?? defaultContentType);
331
336
  const options = getFileOptions();
@@ -408,7 +413,7 @@ const getUrl = (base, path, query) => {
408
413
  return url.toString();
409
414
  };
410
415
 
411
- var version = '6.12.1';
416
+ var version = '6.14.0';
412
417
 
413
418
  const LIBRARY_NAME = 'UploadcareUploadClient';
414
419
  const LIBRARY_VERSION = version;
@@ -603,10 +608,12 @@ function group(uuids, { publicKey, baseURL = defaultSettings.baseURL, jsonpCallb
603
608
  'X-UC-User-Agent': getUserAgent({ publicKey, integration, userAgent })
604
609
  },
605
610
  url: getUrl(baseURL, '/group/', {
606
- jsonerrors: 1,
607
- pub_key: publicKey,
611
+ jsonerrors: 1
612
+ }),
613
+ data: buildFormData({
608
614
  files: uuids,
609
615
  callback: jsonpCallback,
616
+ pub_key: publicKey,
610
617
  signature: secureSignature,
611
618
  expire: secureExpire,
612
619
  source
@@ -315,7 +315,12 @@ const isFileValue = (value) => !!value &&
315
315
  'data' in value &&
316
316
  isFileData(value.data);
317
317
  function collectParams(params, inputKey, inputValue) {
318
- if (isFileValue(inputValue)) {
318
+ if (Array.isArray(inputValue)) {
319
+ for (const value of inputValue) {
320
+ collectParams(params, `${inputKey}[]`, value);
321
+ }
322
+ }
323
+ else if (isFileValue(inputValue)) {
319
324
  const { name, contentType } = inputValue;
320
325
  const file = transformFile(inputValue.data, name, contentType ?? defaultContentType);
321
326
  const options = getFileOptions({ name, contentType });
@@ -398,7 +403,7 @@ const getUrl = (base, path, query) => {
398
403
  return url.toString();
399
404
  };
400
405
 
401
- var version = '6.12.1';
406
+ var version = '6.14.0';
402
407
 
403
408
  const LIBRARY_NAME = 'UploadcareUploadClient';
404
409
  const LIBRARY_VERSION = version;
@@ -593,10 +598,12 @@ function group(uuids, { publicKey, baseURL = defaultSettings.baseURL, jsonpCallb
593
598
  'X-UC-User-Agent': getUserAgent({ publicKey, integration, userAgent })
594
599
  },
595
600
  url: getUrl(baseURL, '/group/', {
596
- jsonerrors: 1,
597
- pub_key: publicKey,
601
+ jsonerrors: 1
602
+ }),
603
+ data: buildFormData({
598
604
  files: uuids,
599
605
  callback: jsonpCallback,
606
+ pub_key: publicKey,
600
607
  signature: secureSignature,
601
608
  expire: secureExpire,
602
609
  source
@@ -346,7 +346,12 @@ const isFileValue = (value) => !!value &&
346
346
  'data' in value &&
347
347
  isFileData(value.data);
348
348
  function collectParams(params, inputKey, inputValue) {
349
- if (isFileValue(inputValue)) {
349
+ if (Array.isArray(inputValue)) {
350
+ for (const value of inputValue) {
351
+ collectParams(params, `${inputKey}[]`, value);
352
+ }
353
+ }
354
+ else if (isFileValue(inputValue)) {
350
355
  const { name, contentType } = inputValue;
351
356
  const file = transformFile(inputValue.data, name, contentType ?? defaultContentType);
352
357
  const options = getFileOptions({ name, contentType });
@@ -429,7 +434,7 @@ const getUrl = (base, path, query) => {
429
434
  return url.toString();
430
435
  };
431
436
 
432
- var version = '6.12.1';
437
+ var version = '6.14.0';
433
438
 
434
439
  const LIBRARY_NAME = 'UploadcareUploadClient';
435
440
  const LIBRARY_VERSION = version;
@@ -624,10 +629,12 @@ function group(uuids, { publicKey, baseURL = defaultSettings.baseURL, jsonpCallb
624
629
  'X-UC-User-Agent': getUserAgent({ publicKey, integration, userAgent })
625
630
  },
626
631
  url: getUrl(baseURL, '/group/', {
627
- jsonerrors: 1,
628
- pub_key: publicKey,
632
+ jsonerrors: 1
633
+ }),
634
+ data: buildFormData({
629
635
  files: uuids,
630
636
  callback: jsonpCallback,
637
+ pub_key: publicKey,
631
638
  signature: secureSignature,
632
639
  expire: secureExpire,
633
640
  source
@@ -323,7 +323,12 @@ const isFileValue = (value) => !!value &&
323
323
  'data' in value &&
324
324
  isFileData(value.data);
325
325
  function collectParams(params, inputKey, inputValue) {
326
- if (isFileValue(inputValue)) {
326
+ if (Array.isArray(inputValue)) {
327
+ for (const value of inputValue) {
328
+ collectParams(params, `${inputKey}[]`, value);
329
+ }
330
+ }
331
+ else if (isFileValue(inputValue)) {
327
332
  const { name, contentType } = inputValue;
328
333
  const file = transformFile(inputValue.data, name, contentType ?? defaultContentType);
329
334
  const options = getFileOptions();
@@ -406,7 +411,7 @@ const getUrl = (base, path, query) => {
406
411
  return url.toString();
407
412
  };
408
413
 
409
- var version = '6.12.1';
414
+ var version = '6.14.0';
410
415
 
411
416
  const LIBRARY_NAME = 'UploadcareUploadClient';
412
417
  const LIBRARY_VERSION = version;
@@ -601,10 +606,12 @@ function group(uuids, { publicKey, baseURL = defaultSettings.baseURL, jsonpCallb
601
606
  'X-UC-User-Agent': getUserAgent({ publicKey, integration, userAgent })
602
607
  },
603
608
  url: getUrl(baseURL, '/group/', {
604
- jsonerrors: 1,
605
- pub_key: publicKey,
609
+ jsonerrors: 1
610
+ }),
611
+ data: buildFormData({
606
612
  files: uuids,
607
613
  callback: jsonpCallback,
614
+ pub_key: publicKey,
608
615
  signature: secureSignature,
609
616
  expire: secureExpire,
610
617
  source
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uploadcare/upload-client",
3
- "version": "6.12.1",
3
+ "version": "6.14.0",
4
4
  "description": "Library for work with Uploadcare Upload API",
5
5
  "type": "module",
6
6
  "module": "./dist/esm/index.node.mjs",
@@ -90,7 +90,7 @@
90
90
  "koa-body": "5.0.0",
91
91
  "mock-socket": "9.0.3",
92
92
  "start-server-and-test": "1.14.0",
93
- "@uploadcare/api-client-utils": "^6.12.1",
93
+ "@uploadcare/api-client-utils": "^6.14.0",
94
94
  "chalk": "^4.1.2"
95
95
  },
96
96
  "dependencies": {