@uploadcare/upload-client 6.14.1-alpha.0 → 6.14.1-alpha.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.
@@ -1359,7 +1359,7 @@ const uploadMultipart = async (file, { publicKey, fileName, fileSize, baseURL, s
1359
1359
  metadata
1360
1360
  })
1361
1361
  .then(async ({ uuid, parts }) => {
1362
- const { getChunk, disposeChunks, disposeChunk } = await prepareChunks(file, size, multipartChunkSize);
1362
+ const { getChunk, disposeChunks } = await prepareChunks(file, size, multipartChunkSize);
1363
1363
  await runWithConcurrency(maxConcurrentRequests, parts.map((url, index) => async () => {
1364
1364
  const chunk = getChunk(index);
1365
1365
  return uploadPart(chunk, url, {
@@ -1370,7 +1370,7 @@ const uploadMultipart = async (file, { publicKey, fileName, fileSize, baseURL, s
1370
1370
  integration,
1371
1371
  retryThrottledRequestMaxTimes,
1372
1372
  retryNetworkErrorMaxTimes
1373
- }).finally(() => disposeChunk?.(chunk));
1373
+ });
1374
1374
  })).finally(() => disposeChunks?.());
1375
1375
  return uuid;
1376
1376
  })
@@ -1391,7 +1391,7 @@ const uploadMultipart = async (file, { publicKey, fileName, fileSize, baseURL, s
1391
1391
  metadata
1392
1392
  })
1393
1393
  .then(async ({ uuid, parts }) => {
1394
- const { getChunk, disposeChunks, disposeChunk } = await prepareChunks(file, size, multipartChunkSize);
1394
+ const { getChunk, disposeChunks } = await prepareChunks(file, size, multipartChunkSize);
1395
1395
  await runWithConcurrency(maxConcurrentRequests, parts.map((url, index) => async () => {
1396
1396
  const chunk = getChunk(index);
1397
1397
  return uploadPart(chunk, url, {
@@ -1402,7 +1402,7 @@ const uploadMultipart = async (file, { publicKey, fileName, fileSize, baseURL, s
1402
1402
  integration,
1403
1403
  retryThrottledRequestMaxTimes,
1404
1404
  retryNetworkErrorMaxTimes
1405
- }).finally(() => disposeChunk?.(chunk));
1405
+ });
1406
1406
  })).finally(() => disposeChunks?.());
1407
1407
  return uuid;
1408
1408
  })
@@ -1344,13 +1344,6 @@ const prepareChunks = async (file, fileSize, chunkSize) => {
1344
1344
  */
1345
1345
  disposeChunks: () => {
1346
1346
  chunks.clear();
1347
- },
1348
- /**
1349
- * Remove specific chunk reference from the memory to make able react-native
1350
- * to deallocate it
1351
- */
1352
- disposeChunk: (chunk) => {
1353
- chunks.delete(chunk);
1354
1347
  }
1355
1348
  };
1356
1349
  };
@@ -1403,7 +1396,7 @@ const uploadMultipart = async (file, { publicKey, fileName, fileSize, baseURL, s
1403
1396
  metadata
1404
1397
  })
1405
1398
  .then(async ({ uuid, parts }) => {
1406
- const { getChunk, disposeChunks, disposeChunk } = await prepareChunks(file, size, multipartChunkSize);
1399
+ const { getChunk, disposeChunks } = await prepareChunks(file, size, multipartChunkSize);
1407
1400
  await runWithConcurrency(maxConcurrentRequests, parts.map((url, index) => async () => {
1408
1401
  const chunk = getChunk(index);
1409
1402
  return uploadPart(chunk, url, {
@@ -1414,7 +1407,7 @@ const uploadMultipart = async (file, { publicKey, fileName, fileSize, baseURL, s
1414
1407
  integration,
1415
1408
  retryThrottledRequestMaxTimes,
1416
1409
  retryNetworkErrorMaxTimes
1417
- }).finally(() => disposeChunk?.(chunk));
1410
+ });
1418
1411
  })).finally(() => disposeChunks?.());
1419
1412
  return uuid;
1420
1413
  })
@@ -1357,7 +1357,7 @@ const uploadMultipart = async (file, { publicKey, fileName, fileSize, baseURL, s
1357
1357
  metadata
1358
1358
  })
1359
1359
  .then(async ({ uuid, parts }) => {
1360
- const { getChunk, disposeChunks, disposeChunk } = await prepareChunks(file, size, multipartChunkSize);
1360
+ const { getChunk, disposeChunks } = await prepareChunks(file, size, multipartChunkSize);
1361
1361
  await runWithConcurrency(maxConcurrentRequests, parts.map((url, index) => async () => {
1362
1362
  const chunk = getChunk(index);
1363
1363
  return uploadPart(chunk, url, {
@@ -1368,7 +1368,7 @@ const uploadMultipart = async (file, { publicKey, fileName, fileSize, baseURL, s
1368
1368
  integration,
1369
1369
  retryThrottledRequestMaxTimes,
1370
1370
  retryNetworkErrorMaxTimes
1371
- }).finally(() => disposeChunk?.(chunk));
1371
+ });
1372
1372
  })).finally(() => disposeChunks?.());
1373
1373
  return uuid;
1374
1374
  })
@@ -1389,7 +1389,7 @@ const uploadMultipart = async (file, { publicKey, fileName, fileSize, baseURL, s
1389
1389
  metadata
1390
1390
  })
1391
1391
  .then(async ({ uuid, parts }) => {
1392
- const { getChunk, disposeChunks, disposeChunk } = await prepareChunks(file, size, multipartChunkSize);
1392
+ const { getChunk, disposeChunks } = await prepareChunks(file, size, multipartChunkSize);
1393
1393
  await runWithConcurrency(maxConcurrentRequests, parts.map((url, index) => async () => {
1394
1394
  const chunk = getChunk(index);
1395
1395
  return uploadPart(chunk, url, {
@@ -1400,7 +1400,7 @@ const uploadMultipart = async (file, { publicKey, fileName, fileSize, baseURL, s
1400
1400
  integration,
1401
1401
  retryThrottledRequestMaxTimes,
1402
1402
  retryNetworkErrorMaxTimes
1403
- }).finally(() => disposeChunk?.(chunk));
1403
+ });
1404
1404
  })).finally(() => disposeChunks?.());
1405
1405
  return uuid;
1406
1406
  })
@@ -1342,13 +1342,6 @@ const prepareChunks = async (file, fileSize, chunkSize) => {
1342
1342
  */
1343
1343
  disposeChunks: () => {
1344
1344
  chunks.clear();
1345
- },
1346
- /**
1347
- * Remove specific chunk reference from the memory to make able react-native
1348
- * to deallocate it
1349
- */
1350
- disposeChunk: (chunk) => {
1351
- chunks.delete(chunk);
1352
1345
  }
1353
1346
  };
1354
1347
  };
@@ -1401,7 +1394,7 @@ const uploadMultipart = async (file, { publicKey, fileName, fileSize, baseURL, s
1401
1394
  metadata
1402
1395
  })
1403
1396
  .then(async ({ uuid, parts }) => {
1404
- const { getChunk, disposeChunks, disposeChunk } = await prepareChunks(file, size, multipartChunkSize);
1397
+ const { getChunk, disposeChunks } = await prepareChunks(file, size, multipartChunkSize);
1405
1398
  await runWithConcurrency(maxConcurrentRequests, parts.map((url, index) => async () => {
1406
1399
  const chunk = getChunk(index);
1407
1400
  return uploadPart(chunk, url, {
@@ -1412,7 +1405,7 @@ const uploadMultipart = async (file, { publicKey, fileName, fileSize, baseURL, s
1412
1405
  integration,
1413
1406
  retryThrottledRequestMaxTimes,
1414
1407
  retryNetworkErrorMaxTimes
1415
- }).finally(() => disposeChunk?.(chunk));
1408
+ });
1416
1409
  })).finally(() => disposeChunks?.());
1417
1410
  return uuid;
1418
1411
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uploadcare/upload-client",
3
- "version": "6.14.1-alpha.0",
3
+ "version": "6.14.1-alpha.1",
4
4
  "description": "Library for work with Uploadcare Upload API",
5
5
  "type": "module",
6
6
  "module": "./dist/esm/index.node.mjs",