@uploadcare/upload-client 6.7.0 → 6.9.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/dist/cjs/index.browser.cjs +11 -9
- package/dist/cjs/index.browser.d.cts +14 -1
- package/dist/cjs/index.node.cjs +11 -9
- package/dist/cjs/index.node.d.cts +14 -1
- package/dist/cjs/index.react-native.cjs +11 -9
- package/dist/cjs/index.react-native.d.cts +14 -1
- package/dist/esm/index.browser.d.mts +14 -1
- package/dist/esm/index.browser.mjs +11 -10
- package/dist/esm/index.node.d.mts +14 -1
- package/dist/esm/index.node.mjs +11 -10
- package/dist/esm/index.react-native.d.mts +14 -1
- package/dist/esm/index.react-native.mjs +11 -10
- package/dist/index.d.ts +14 -1
- package/package.json +2 -2
|
@@ -397,7 +397,7 @@ const getUrl = (base, path, query) => {
|
|
|
397
397
|
return url.toString();
|
|
398
398
|
};
|
|
399
399
|
|
|
400
|
-
var version = '6.
|
|
400
|
+
var version = '6.9.0';
|
|
401
401
|
|
|
402
402
|
const LIBRARY_NAME = 'UploadcareUploadClient';
|
|
403
403
|
const LIBRARY_VERSION = version;
|
|
@@ -749,9 +749,9 @@ function multipartComplete(uuid, { publicKey, baseURL = defaultSettings.baseURL,
|
|
|
749
749
|
}), { retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes });
|
|
750
750
|
}
|
|
751
751
|
|
|
752
|
-
function isReadyPoll({
|
|
752
|
+
function isReadyPoll(uuid, { publicKey, baseURL, source, integration, userAgent, retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes, signal, onProgress }) {
|
|
753
753
|
return poll({
|
|
754
|
-
check: (signal) => info(
|
|
754
|
+
check: (signal) => info(uuid, {
|
|
755
755
|
publicKey,
|
|
756
756
|
baseURL,
|
|
757
757
|
signal,
|
|
@@ -835,8 +835,7 @@ const uploadDirect = (file, { publicKey, fileName, baseURL, secureSignature, sec
|
|
|
835
835
|
metadata
|
|
836
836
|
})
|
|
837
837
|
.then(({ file }) => {
|
|
838
|
-
return isReadyPoll({
|
|
839
|
-
file,
|
|
838
|
+
return isReadyPoll(file, {
|
|
840
839
|
publicKey,
|
|
841
840
|
baseURL,
|
|
842
841
|
source,
|
|
@@ -1201,8 +1200,7 @@ const uploadFromUrl = (sourceUrl, { publicKey, fileName, baseURL, baseCDN, check
|
|
|
1201
1200
|
throw result;
|
|
1202
1201
|
return result;
|
|
1203
1202
|
})
|
|
1204
|
-
.then((result) => isReadyPoll({
|
|
1205
|
-
file: result.uuid,
|
|
1203
|
+
.then((result) => isReadyPoll(result.uuid, {
|
|
1206
1204
|
publicKey,
|
|
1207
1205
|
baseURL,
|
|
1208
1206
|
integration,
|
|
@@ -1377,8 +1375,7 @@ const uploadMultipart = async (file, { publicKey, fileName, fileSize, baseURL, s
|
|
|
1377
1375
|
return fileInfo;
|
|
1378
1376
|
}
|
|
1379
1377
|
else {
|
|
1380
|
-
return isReadyPoll({
|
|
1381
|
-
file: fileInfo.uuid,
|
|
1378
|
+
return isReadyPoll(fileInfo.uuid, {
|
|
1382
1379
|
publicKey,
|
|
1383
1380
|
baseURL,
|
|
1384
1381
|
source,
|
|
@@ -1666,6 +1663,10 @@ class UploadClient {
|
|
|
1666
1663
|
const settings = this.getSettings();
|
|
1667
1664
|
return uploadFileGroup(data, populateOptionsWithSettings(options, settings));
|
|
1668
1665
|
}
|
|
1666
|
+
isReadyPoll(uuid, options = {}) {
|
|
1667
|
+
const settings = this.getSettings();
|
|
1668
|
+
return isReadyPoll(uuid, populateOptionsWithSettings(options, settings));
|
|
1669
|
+
}
|
|
1669
1670
|
}
|
|
1670
1671
|
|
|
1671
1672
|
class Queue {
|
|
@@ -1736,6 +1737,7 @@ exports.getUserAgent = getUserAgent$1;
|
|
|
1736
1737
|
exports.group = group;
|
|
1737
1738
|
exports.groupInfo = groupInfo;
|
|
1738
1739
|
exports.info = info;
|
|
1740
|
+
exports.isReadyPoll = isReadyPoll;
|
|
1739
1741
|
exports.multipartComplete = multipartComplete;
|
|
1740
1742
|
exports.multipartStart = multipartStart;
|
|
1741
1743
|
exports.multipartUpload = multipartUpload;
|
|
@@ -31,7 +31,7 @@ export type ImageInfo = {
|
|
|
31
31
|
height: number;
|
|
32
32
|
width: number;
|
|
33
33
|
geoLocation: GeoLocation | null;
|
|
34
|
-
datetimeOriginal: string;
|
|
34
|
+
datetimeOriginal: string | null;
|
|
35
35
|
format: string;
|
|
36
36
|
colorMode: string;
|
|
37
37
|
dpi: {
|
|
@@ -461,6 +461,18 @@ export type GroupFromOptions = {
|
|
|
461
461
|
jsonpCallback?: string;
|
|
462
462
|
};
|
|
463
463
|
export declare function uploadFileGroup(data: SupportedFileInput[] | Url[] | Uuid[], { publicKey, fileName, baseURL, secureSignature, secureExpire, store, signal, onProgress, source, integration, userAgent, retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes, contentType, multipartChunkSize, baseCDN, checkForUrlDuplicates, saveUrlForRecurrentUploads, jsonpCallback }: FileFromOptions & GroupFromOptions): Promise<UploadcareGroup>;
|
|
464
|
+
export type IsReadyPoolOptions = {
|
|
465
|
+
publicKey: string;
|
|
466
|
+
baseURL?: string;
|
|
467
|
+
source?: string;
|
|
468
|
+
integration?: string;
|
|
469
|
+
userAgent?: CustomUserAgent;
|
|
470
|
+
retryThrottledRequestMaxTimes?: number;
|
|
471
|
+
retryNetworkErrorMaxTimes?: number;
|
|
472
|
+
onProgress?: ProgressCallback<ComputableProgressInfo>;
|
|
473
|
+
signal?: AbortSignal;
|
|
474
|
+
};
|
|
475
|
+
export declare function isReadyPoll(uuid: Uuid, { publicKey, baseURL, source, integration, userAgent, retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes, signal, onProgress }: IsReadyPoolOptions): Promise<FileInfo>;
|
|
464
476
|
export declare class UploadClient {
|
|
465
477
|
private settings;
|
|
466
478
|
constructor(settings: Settings);
|
|
@@ -477,6 +489,7 @@ export declare class UploadClient {
|
|
|
477
489
|
multipartComplete(uuid: Uuid, options?: Partial<MultipartCompleteOptions>): Promise<FileInfo>;
|
|
478
490
|
uploadFile(data: SupportedFileInput | Url | Uuid, options?: Partial<FileFromOptions>): Promise<UploadcareFile>;
|
|
479
491
|
uploadFileGroup(data: SupportedFileInput[] | Url[] | Uuid[], options?: Partial<FileFromOptions & GroupFromOptions>): Promise<UploadcareGroup>;
|
|
492
|
+
isReadyPoll(uuid: Uuid, options?: Partial<IsReadyPoolOptions>): Promise<FileInfo>;
|
|
480
493
|
}
|
|
481
494
|
export type Task<T = unknown> = () => Promise<T>;
|
|
482
495
|
export declare class Queue {
|
package/dist/cjs/index.node.cjs
CHANGED
|
@@ -428,7 +428,7 @@ const getUrl = (base, path, query) => {
|
|
|
428
428
|
return url.toString();
|
|
429
429
|
};
|
|
430
430
|
|
|
431
|
-
var version = '6.
|
|
431
|
+
var version = '6.9.0';
|
|
432
432
|
|
|
433
433
|
const LIBRARY_NAME = 'UploadcareUploadClient';
|
|
434
434
|
const LIBRARY_VERSION = version;
|
|
@@ -780,9 +780,9 @@ function multipartComplete(uuid, { publicKey, baseURL = defaultSettings.baseURL,
|
|
|
780
780
|
}), { retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes });
|
|
781
781
|
}
|
|
782
782
|
|
|
783
|
-
function isReadyPoll({
|
|
783
|
+
function isReadyPoll(uuid, { publicKey, baseURL, source, integration, userAgent, retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes, signal, onProgress }) {
|
|
784
784
|
return poll({
|
|
785
|
-
check: (signal) => info(
|
|
785
|
+
check: (signal) => info(uuid, {
|
|
786
786
|
publicKey,
|
|
787
787
|
baseURL,
|
|
788
788
|
signal,
|
|
@@ -866,8 +866,7 @@ const uploadDirect = (file, { publicKey, fileName, baseURL, secureSignature, sec
|
|
|
866
866
|
metadata
|
|
867
867
|
})
|
|
868
868
|
.then(({ file }) => {
|
|
869
|
-
return isReadyPoll({
|
|
870
|
-
file,
|
|
869
|
+
return isReadyPoll(file, {
|
|
871
870
|
publicKey,
|
|
872
871
|
baseURL,
|
|
873
872
|
source,
|
|
@@ -1230,8 +1229,7 @@ const uploadFromUrl = (sourceUrl, { publicKey, fileName, baseURL, baseCDN, check
|
|
|
1230
1229
|
throw result;
|
|
1231
1230
|
return result;
|
|
1232
1231
|
})
|
|
1233
|
-
.then((result) => isReadyPoll({
|
|
1234
|
-
file: result.uuid,
|
|
1232
|
+
.then((result) => isReadyPoll(result.uuid, {
|
|
1235
1233
|
publicKey,
|
|
1236
1234
|
baseURL,
|
|
1237
1235
|
integration,
|
|
@@ -1409,8 +1407,7 @@ const uploadMultipart = async (file, { publicKey, fileName, fileSize, baseURL, s
|
|
|
1409
1407
|
return fileInfo;
|
|
1410
1408
|
}
|
|
1411
1409
|
else {
|
|
1412
|
-
return isReadyPoll({
|
|
1413
|
-
file: fileInfo.uuid,
|
|
1410
|
+
return isReadyPoll(fileInfo.uuid, {
|
|
1414
1411
|
publicKey,
|
|
1415
1412
|
baseURL,
|
|
1416
1413
|
source,
|
|
@@ -1698,6 +1695,10 @@ class UploadClient {
|
|
|
1698
1695
|
const settings = this.getSettings();
|
|
1699
1696
|
return uploadFileGroup(data, populateOptionsWithSettings(options, settings));
|
|
1700
1697
|
}
|
|
1698
|
+
isReadyPoll(uuid, options = {}) {
|
|
1699
|
+
const settings = this.getSettings();
|
|
1700
|
+
return isReadyPoll(uuid, populateOptionsWithSettings(options, settings));
|
|
1701
|
+
}
|
|
1701
1702
|
}
|
|
1702
1703
|
|
|
1703
1704
|
class Queue {
|
|
@@ -1768,6 +1769,7 @@ exports.getUserAgent = getUserAgent$1;
|
|
|
1768
1769
|
exports.group = group;
|
|
1769
1770
|
exports.groupInfo = groupInfo;
|
|
1770
1771
|
exports.info = info;
|
|
1772
|
+
exports.isReadyPoll = isReadyPoll;
|
|
1771
1773
|
exports.multipartComplete = multipartComplete;
|
|
1772
1774
|
exports.multipartStart = multipartStart;
|
|
1773
1775
|
exports.multipartUpload = multipartUpload;
|
|
@@ -31,7 +31,7 @@ export type ImageInfo = {
|
|
|
31
31
|
height: number;
|
|
32
32
|
width: number;
|
|
33
33
|
geoLocation: GeoLocation | null;
|
|
34
|
-
datetimeOriginal: string;
|
|
34
|
+
datetimeOriginal: string | null;
|
|
35
35
|
format: string;
|
|
36
36
|
colorMode: string;
|
|
37
37
|
dpi: {
|
|
@@ -461,6 +461,18 @@ export type GroupFromOptions = {
|
|
|
461
461
|
jsonpCallback?: string;
|
|
462
462
|
};
|
|
463
463
|
export declare function uploadFileGroup(data: SupportedFileInput[] | Url[] | Uuid[], { publicKey, fileName, baseURL, secureSignature, secureExpire, store, signal, onProgress, source, integration, userAgent, retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes, contentType, multipartChunkSize, baseCDN, checkForUrlDuplicates, saveUrlForRecurrentUploads, jsonpCallback }: FileFromOptions & GroupFromOptions): Promise<UploadcareGroup>;
|
|
464
|
+
export type IsReadyPoolOptions = {
|
|
465
|
+
publicKey: string;
|
|
466
|
+
baseURL?: string;
|
|
467
|
+
source?: string;
|
|
468
|
+
integration?: string;
|
|
469
|
+
userAgent?: CustomUserAgent;
|
|
470
|
+
retryThrottledRequestMaxTimes?: number;
|
|
471
|
+
retryNetworkErrorMaxTimes?: number;
|
|
472
|
+
onProgress?: ProgressCallback<ComputableProgressInfo>;
|
|
473
|
+
signal?: AbortSignal;
|
|
474
|
+
};
|
|
475
|
+
export declare function isReadyPoll(uuid: Uuid, { publicKey, baseURL, source, integration, userAgent, retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes, signal, onProgress }: IsReadyPoolOptions): Promise<FileInfo>;
|
|
464
476
|
export declare class UploadClient {
|
|
465
477
|
private settings;
|
|
466
478
|
constructor(settings: Settings);
|
|
@@ -477,6 +489,7 @@ export declare class UploadClient {
|
|
|
477
489
|
multipartComplete(uuid: Uuid, options?: Partial<MultipartCompleteOptions>): Promise<FileInfo>;
|
|
478
490
|
uploadFile(data: SupportedFileInput | Url | Uuid, options?: Partial<FileFromOptions>): Promise<UploadcareFile>;
|
|
479
491
|
uploadFileGroup(data: SupportedFileInput[] | Url[] | Uuid[], options?: Partial<FileFromOptions & GroupFromOptions>): Promise<UploadcareGroup>;
|
|
492
|
+
isReadyPoll(uuid: Uuid, options?: Partial<IsReadyPoolOptions>): Promise<FileInfo>;
|
|
480
493
|
}
|
|
481
494
|
export type Task<T = unknown> = () => Promise<T>;
|
|
482
495
|
export declare class Queue {
|
|
@@ -405,7 +405,7 @@ const getUrl = (base, path, query) => {
|
|
|
405
405
|
return url.toString();
|
|
406
406
|
};
|
|
407
407
|
|
|
408
|
-
var version = '6.
|
|
408
|
+
var version = '6.9.0';
|
|
409
409
|
|
|
410
410
|
const LIBRARY_NAME = 'UploadcareUploadClient';
|
|
411
411
|
const LIBRARY_VERSION = version;
|
|
@@ -757,9 +757,9 @@ function multipartComplete(uuid, { publicKey, baseURL = defaultSettings.baseURL,
|
|
|
757
757
|
}), { retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes });
|
|
758
758
|
}
|
|
759
759
|
|
|
760
|
-
function isReadyPoll({
|
|
760
|
+
function isReadyPoll(uuid, { publicKey, baseURL, source, integration, userAgent, retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes, signal, onProgress }) {
|
|
761
761
|
return poll({
|
|
762
|
-
check: (signal) => info(
|
|
762
|
+
check: (signal) => info(uuid, {
|
|
763
763
|
publicKey,
|
|
764
764
|
baseURL,
|
|
765
765
|
signal,
|
|
@@ -843,8 +843,7 @@ const uploadDirect = (file, { publicKey, fileName, baseURL, secureSignature, sec
|
|
|
843
843
|
metadata
|
|
844
844
|
})
|
|
845
845
|
.then(({ file }) => {
|
|
846
|
-
return isReadyPoll({
|
|
847
|
-
file,
|
|
846
|
+
return isReadyPoll(file, {
|
|
848
847
|
publicKey,
|
|
849
848
|
baseURL,
|
|
850
849
|
source,
|
|
@@ -1209,8 +1208,7 @@ const uploadFromUrl = (sourceUrl, { publicKey, fileName, baseURL, baseCDN, check
|
|
|
1209
1208
|
throw result;
|
|
1210
1209
|
return result;
|
|
1211
1210
|
})
|
|
1212
|
-
.then((result) => isReadyPoll({
|
|
1213
|
-
file: result.uuid,
|
|
1211
|
+
.then((result) => isReadyPoll(result.uuid, {
|
|
1214
1212
|
publicKey,
|
|
1215
1213
|
baseURL,
|
|
1216
1214
|
integration,
|
|
@@ -1405,8 +1403,7 @@ const uploadMultipart = async (file, { publicKey, fileName, fileSize, baseURL, s
|
|
|
1405
1403
|
return fileInfo;
|
|
1406
1404
|
}
|
|
1407
1405
|
else {
|
|
1408
|
-
return isReadyPoll({
|
|
1409
|
-
file: fileInfo.uuid,
|
|
1406
|
+
return isReadyPoll(fileInfo.uuid, {
|
|
1410
1407
|
publicKey,
|
|
1411
1408
|
baseURL,
|
|
1412
1409
|
source,
|
|
@@ -1694,6 +1691,10 @@ class UploadClient {
|
|
|
1694
1691
|
const settings = this.getSettings();
|
|
1695
1692
|
return uploadFileGroup(data, populateOptionsWithSettings(options, settings));
|
|
1696
1693
|
}
|
|
1694
|
+
isReadyPoll(uuid, options = {}) {
|
|
1695
|
+
const settings = this.getSettings();
|
|
1696
|
+
return isReadyPoll(uuid, populateOptionsWithSettings(options, settings));
|
|
1697
|
+
}
|
|
1697
1698
|
}
|
|
1698
1699
|
|
|
1699
1700
|
class Queue {
|
|
@@ -1764,6 +1765,7 @@ exports.getUserAgent = getUserAgent$1;
|
|
|
1764
1765
|
exports.group = group;
|
|
1765
1766
|
exports.groupInfo = groupInfo;
|
|
1766
1767
|
exports.info = info;
|
|
1768
|
+
exports.isReadyPoll = isReadyPoll;
|
|
1767
1769
|
exports.multipartComplete = multipartComplete;
|
|
1768
1770
|
exports.multipartStart = multipartStart;
|
|
1769
1771
|
exports.multipartUpload = multipartUpload;
|
|
@@ -31,7 +31,7 @@ export type ImageInfo = {
|
|
|
31
31
|
height: number;
|
|
32
32
|
width: number;
|
|
33
33
|
geoLocation: GeoLocation | null;
|
|
34
|
-
datetimeOriginal: string;
|
|
34
|
+
datetimeOriginal: string | null;
|
|
35
35
|
format: string;
|
|
36
36
|
colorMode: string;
|
|
37
37
|
dpi: {
|
|
@@ -461,6 +461,18 @@ export type GroupFromOptions = {
|
|
|
461
461
|
jsonpCallback?: string;
|
|
462
462
|
};
|
|
463
463
|
export declare function uploadFileGroup(data: SupportedFileInput[] | Url[] | Uuid[], { publicKey, fileName, baseURL, secureSignature, secureExpire, store, signal, onProgress, source, integration, userAgent, retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes, contentType, multipartChunkSize, baseCDN, checkForUrlDuplicates, saveUrlForRecurrentUploads, jsonpCallback }: FileFromOptions & GroupFromOptions): Promise<UploadcareGroup>;
|
|
464
|
+
export type IsReadyPoolOptions = {
|
|
465
|
+
publicKey: string;
|
|
466
|
+
baseURL?: string;
|
|
467
|
+
source?: string;
|
|
468
|
+
integration?: string;
|
|
469
|
+
userAgent?: CustomUserAgent;
|
|
470
|
+
retryThrottledRequestMaxTimes?: number;
|
|
471
|
+
retryNetworkErrorMaxTimes?: number;
|
|
472
|
+
onProgress?: ProgressCallback<ComputableProgressInfo>;
|
|
473
|
+
signal?: AbortSignal;
|
|
474
|
+
};
|
|
475
|
+
export declare function isReadyPoll(uuid: Uuid, { publicKey, baseURL, source, integration, userAgent, retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes, signal, onProgress }: IsReadyPoolOptions): Promise<FileInfo>;
|
|
464
476
|
export declare class UploadClient {
|
|
465
477
|
private settings;
|
|
466
478
|
constructor(settings: Settings);
|
|
@@ -477,6 +489,7 @@ export declare class UploadClient {
|
|
|
477
489
|
multipartComplete(uuid: Uuid, options?: Partial<MultipartCompleteOptions>): Promise<FileInfo>;
|
|
478
490
|
uploadFile(data: SupportedFileInput | Url | Uuid, options?: Partial<FileFromOptions>): Promise<UploadcareFile>;
|
|
479
491
|
uploadFileGroup(data: SupportedFileInput[] | Url[] | Uuid[], options?: Partial<FileFromOptions & GroupFromOptions>): Promise<UploadcareGroup>;
|
|
492
|
+
isReadyPoll(uuid: Uuid, options?: Partial<IsReadyPoolOptions>): Promise<FileInfo>;
|
|
480
493
|
}
|
|
481
494
|
export type Task<T = unknown> = () => Promise<T>;
|
|
482
495
|
export declare class Queue {
|
|
@@ -31,7 +31,7 @@ export type ImageInfo = {
|
|
|
31
31
|
height: number;
|
|
32
32
|
width: number;
|
|
33
33
|
geoLocation: GeoLocation | null;
|
|
34
|
-
datetimeOriginal: string;
|
|
34
|
+
datetimeOriginal: string | null;
|
|
35
35
|
format: string;
|
|
36
36
|
colorMode: string;
|
|
37
37
|
dpi: {
|
|
@@ -461,6 +461,18 @@ export type GroupFromOptions = {
|
|
|
461
461
|
jsonpCallback?: string;
|
|
462
462
|
};
|
|
463
463
|
export declare function uploadFileGroup(data: SupportedFileInput[] | Url[] | Uuid[], { publicKey, fileName, baseURL, secureSignature, secureExpire, store, signal, onProgress, source, integration, userAgent, retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes, contentType, multipartChunkSize, baseCDN, checkForUrlDuplicates, saveUrlForRecurrentUploads, jsonpCallback }: FileFromOptions & GroupFromOptions): Promise<UploadcareGroup>;
|
|
464
|
+
export type IsReadyPoolOptions = {
|
|
465
|
+
publicKey: string;
|
|
466
|
+
baseURL?: string;
|
|
467
|
+
source?: string;
|
|
468
|
+
integration?: string;
|
|
469
|
+
userAgent?: CustomUserAgent;
|
|
470
|
+
retryThrottledRequestMaxTimes?: number;
|
|
471
|
+
retryNetworkErrorMaxTimes?: number;
|
|
472
|
+
onProgress?: ProgressCallback<ComputableProgressInfo>;
|
|
473
|
+
signal?: AbortSignal;
|
|
474
|
+
};
|
|
475
|
+
export declare function isReadyPoll(uuid: Uuid, { publicKey, baseURL, source, integration, userAgent, retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes, signal, onProgress }: IsReadyPoolOptions): Promise<FileInfo>;
|
|
464
476
|
export declare class UploadClient {
|
|
465
477
|
private settings;
|
|
466
478
|
constructor(settings: Settings);
|
|
@@ -477,6 +489,7 @@ export declare class UploadClient {
|
|
|
477
489
|
multipartComplete(uuid: Uuid, options?: Partial<MultipartCompleteOptions>): Promise<FileInfo>;
|
|
478
490
|
uploadFile(data: SupportedFileInput | Url | Uuid, options?: Partial<FileFromOptions>): Promise<UploadcareFile>;
|
|
479
491
|
uploadFileGroup(data: SupportedFileInput[] | Url[] | Uuid[], options?: Partial<FileFromOptions & GroupFromOptions>): Promise<UploadcareGroup>;
|
|
492
|
+
isReadyPoll(uuid: Uuid, options?: Partial<IsReadyPoolOptions>): Promise<FileInfo>;
|
|
480
493
|
}
|
|
481
494
|
export type Task<T = unknown> = () => Promise<T>;
|
|
482
495
|
export declare class Queue {
|
|
@@ -395,7 +395,7 @@ const getUrl = (base, path, query) => {
|
|
|
395
395
|
return url.toString();
|
|
396
396
|
};
|
|
397
397
|
|
|
398
|
-
var version = '6.
|
|
398
|
+
var version = '6.9.0';
|
|
399
399
|
|
|
400
400
|
const LIBRARY_NAME = 'UploadcareUploadClient';
|
|
401
401
|
const LIBRARY_VERSION = version;
|
|
@@ -747,9 +747,9 @@ function multipartComplete(uuid, { publicKey, baseURL = defaultSettings.baseURL,
|
|
|
747
747
|
}), { retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes });
|
|
748
748
|
}
|
|
749
749
|
|
|
750
|
-
function isReadyPoll({
|
|
750
|
+
function isReadyPoll(uuid, { publicKey, baseURL, source, integration, userAgent, retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes, signal, onProgress }) {
|
|
751
751
|
return poll({
|
|
752
|
-
check: (signal) => info(
|
|
752
|
+
check: (signal) => info(uuid, {
|
|
753
753
|
publicKey,
|
|
754
754
|
baseURL,
|
|
755
755
|
signal,
|
|
@@ -833,8 +833,7 @@ const uploadDirect = (file, { publicKey, fileName, baseURL, secureSignature, sec
|
|
|
833
833
|
metadata
|
|
834
834
|
})
|
|
835
835
|
.then(({ file }) => {
|
|
836
|
-
return isReadyPoll({
|
|
837
|
-
file,
|
|
836
|
+
return isReadyPoll(file, {
|
|
838
837
|
publicKey,
|
|
839
838
|
baseURL,
|
|
840
839
|
source,
|
|
@@ -1199,8 +1198,7 @@ const uploadFromUrl = (sourceUrl, { publicKey, fileName, baseURL, baseCDN, check
|
|
|
1199
1198
|
throw result;
|
|
1200
1199
|
return result;
|
|
1201
1200
|
})
|
|
1202
|
-
.then((result) => isReadyPoll({
|
|
1203
|
-
file: result.uuid,
|
|
1201
|
+
.then((result) => isReadyPoll(result.uuid, {
|
|
1204
1202
|
publicKey,
|
|
1205
1203
|
baseURL,
|
|
1206
1204
|
integration,
|
|
@@ -1375,8 +1373,7 @@ const uploadMultipart = async (file, { publicKey, fileName, fileSize, baseURL, s
|
|
|
1375
1373
|
return fileInfo;
|
|
1376
1374
|
}
|
|
1377
1375
|
else {
|
|
1378
|
-
return isReadyPoll({
|
|
1379
|
-
file: fileInfo.uuid,
|
|
1376
|
+
return isReadyPoll(fileInfo.uuid, {
|
|
1380
1377
|
publicKey,
|
|
1381
1378
|
baseURL,
|
|
1382
1379
|
source,
|
|
@@ -1664,6 +1661,10 @@ class UploadClient {
|
|
|
1664
1661
|
const settings = this.getSettings();
|
|
1665
1662
|
return uploadFileGroup(data, populateOptionsWithSettings(options, settings));
|
|
1666
1663
|
}
|
|
1664
|
+
isReadyPoll(uuid, options = {}) {
|
|
1665
|
+
const settings = this.getSettings();
|
|
1666
|
+
return isReadyPoll(uuid, populateOptionsWithSettings(options, settings));
|
|
1667
|
+
}
|
|
1667
1668
|
}
|
|
1668
1669
|
|
|
1669
1670
|
class Queue {
|
|
@@ -1721,4 +1722,4 @@ class Queue {
|
|
|
1721
1722
|
}
|
|
1722
1723
|
}
|
|
1723
1724
|
|
|
1724
|
-
export { Queue, UploadClient, UploadClientError, UploadcareFile, UploadcareGroup, UploadcareNetworkError, base, fromUrl, fromUrlStatus, getUserAgent$1 as getUserAgent, group, groupInfo, info, multipartComplete, multipartStart, multipartUpload, uploadDirect, uploadFile, uploadFileGroup, uploadFromUploaded, uploadFromUrl, uploadMultipart };
|
|
1725
|
+
export { Queue, UploadClient, UploadClientError, UploadcareFile, UploadcareGroup, UploadcareNetworkError, base, fromUrl, fromUrlStatus, getUserAgent$1 as getUserAgent, group, groupInfo, info, isReadyPoll, multipartComplete, multipartStart, multipartUpload, uploadDirect, uploadFile, uploadFileGroup, uploadFromUploaded, uploadFromUrl, uploadMultipart };
|
|
@@ -31,7 +31,7 @@ export type ImageInfo = {
|
|
|
31
31
|
height: number;
|
|
32
32
|
width: number;
|
|
33
33
|
geoLocation: GeoLocation | null;
|
|
34
|
-
datetimeOriginal: string;
|
|
34
|
+
datetimeOriginal: string | null;
|
|
35
35
|
format: string;
|
|
36
36
|
colorMode: string;
|
|
37
37
|
dpi: {
|
|
@@ -461,6 +461,18 @@ export type GroupFromOptions = {
|
|
|
461
461
|
jsonpCallback?: string;
|
|
462
462
|
};
|
|
463
463
|
export declare function uploadFileGroup(data: SupportedFileInput[] | Url[] | Uuid[], { publicKey, fileName, baseURL, secureSignature, secureExpire, store, signal, onProgress, source, integration, userAgent, retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes, contentType, multipartChunkSize, baseCDN, checkForUrlDuplicates, saveUrlForRecurrentUploads, jsonpCallback }: FileFromOptions & GroupFromOptions): Promise<UploadcareGroup>;
|
|
464
|
+
export type IsReadyPoolOptions = {
|
|
465
|
+
publicKey: string;
|
|
466
|
+
baseURL?: string;
|
|
467
|
+
source?: string;
|
|
468
|
+
integration?: string;
|
|
469
|
+
userAgent?: CustomUserAgent;
|
|
470
|
+
retryThrottledRequestMaxTimes?: number;
|
|
471
|
+
retryNetworkErrorMaxTimes?: number;
|
|
472
|
+
onProgress?: ProgressCallback<ComputableProgressInfo>;
|
|
473
|
+
signal?: AbortSignal;
|
|
474
|
+
};
|
|
475
|
+
export declare function isReadyPoll(uuid: Uuid, { publicKey, baseURL, source, integration, userAgent, retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes, signal, onProgress }: IsReadyPoolOptions): Promise<FileInfo>;
|
|
464
476
|
export declare class UploadClient {
|
|
465
477
|
private settings;
|
|
466
478
|
constructor(settings: Settings);
|
|
@@ -477,6 +489,7 @@ export declare class UploadClient {
|
|
|
477
489
|
multipartComplete(uuid: Uuid, options?: Partial<MultipartCompleteOptions>): Promise<FileInfo>;
|
|
478
490
|
uploadFile(data: SupportedFileInput | Url | Uuid, options?: Partial<FileFromOptions>): Promise<UploadcareFile>;
|
|
479
491
|
uploadFileGroup(data: SupportedFileInput[] | Url[] | Uuid[], options?: Partial<FileFromOptions & GroupFromOptions>): Promise<UploadcareGroup>;
|
|
492
|
+
isReadyPoll(uuid: Uuid, options?: Partial<IsReadyPoolOptions>): Promise<FileInfo>;
|
|
480
493
|
}
|
|
481
494
|
export type Task<T = unknown> = () => Promise<T>;
|
|
482
495
|
export declare class Queue {
|
package/dist/esm/index.node.mjs
CHANGED
|
@@ -426,7 +426,7 @@ const getUrl = (base, path, query) => {
|
|
|
426
426
|
return url.toString();
|
|
427
427
|
};
|
|
428
428
|
|
|
429
|
-
var version = '6.
|
|
429
|
+
var version = '6.9.0';
|
|
430
430
|
|
|
431
431
|
const LIBRARY_NAME = 'UploadcareUploadClient';
|
|
432
432
|
const LIBRARY_VERSION = version;
|
|
@@ -778,9 +778,9 @@ function multipartComplete(uuid, { publicKey, baseURL = defaultSettings.baseURL,
|
|
|
778
778
|
}), { retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes });
|
|
779
779
|
}
|
|
780
780
|
|
|
781
|
-
function isReadyPoll({
|
|
781
|
+
function isReadyPoll(uuid, { publicKey, baseURL, source, integration, userAgent, retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes, signal, onProgress }) {
|
|
782
782
|
return poll({
|
|
783
|
-
check: (signal) => info(
|
|
783
|
+
check: (signal) => info(uuid, {
|
|
784
784
|
publicKey,
|
|
785
785
|
baseURL,
|
|
786
786
|
signal,
|
|
@@ -864,8 +864,7 @@ const uploadDirect = (file, { publicKey, fileName, baseURL, secureSignature, sec
|
|
|
864
864
|
metadata
|
|
865
865
|
})
|
|
866
866
|
.then(({ file }) => {
|
|
867
|
-
return isReadyPoll({
|
|
868
|
-
file,
|
|
867
|
+
return isReadyPoll(file, {
|
|
869
868
|
publicKey,
|
|
870
869
|
baseURL,
|
|
871
870
|
source,
|
|
@@ -1228,8 +1227,7 @@ const uploadFromUrl = (sourceUrl, { publicKey, fileName, baseURL, baseCDN, check
|
|
|
1228
1227
|
throw result;
|
|
1229
1228
|
return result;
|
|
1230
1229
|
})
|
|
1231
|
-
.then((result) => isReadyPoll({
|
|
1232
|
-
file: result.uuid,
|
|
1230
|
+
.then((result) => isReadyPoll(result.uuid, {
|
|
1233
1231
|
publicKey,
|
|
1234
1232
|
baseURL,
|
|
1235
1233
|
integration,
|
|
@@ -1407,8 +1405,7 @@ const uploadMultipart = async (file, { publicKey, fileName, fileSize, baseURL, s
|
|
|
1407
1405
|
return fileInfo;
|
|
1408
1406
|
}
|
|
1409
1407
|
else {
|
|
1410
|
-
return isReadyPoll({
|
|
1411
|
-
file: fileInfo.uuid,
|
|
1408
|
+
return isReadyPoll(fileInfo.uuid, {
|
|
1412
1409
|
publicKey,
|
|
1413
1410
|
baseURL,
|
|
1414
1411
|
source,
|
|
@@ -1696,6 +1693,10 @@ class UploadClient {
|
|
|
1696
1693
|
const settings = this.getSettings();
|
|
1697
1694
|
return uploadFileGroup(data, populateOptionsWithSettings(options, settings));
|
|
1698
1695
|
}
|
|
1696
|
+
isReadyPoll(uuid, options = {}) {
|
|
1697
|
+
const settings = this.getSettings();
|
|
1698
|
+
return isReadyPoll(uuid, populateOptionsWithSettings(options, settings));
|
|
1699
|
+
}
|
|
1699
1700
|
}
|
|
1700
1701
|
|
|
1701
1702
|
class Queue {
|
|
@@ -1753,4 +1754,4 @@ class Queue {
|
|
|
1753
1754
|
}
|
|
1754
1755
|
}
|
|
1755
1756
|
|
|
1756
|
-
export { Queue, UploadClient, UploadClientError, UploadcareFile, UploadcareGroup, UploadcareNetworkError, base, fromUrl, fromUrlStatus, getUserAgent$1 as getUserAgent, group, groupInfo, info, multipartComplete, multipartStart, multipartUpload, uploadDirect, uploadFile, uploadFileGroup, uploadFromUploaded, uploadFromUrl, uploadMultipart };
|
|
1757
|
+
export { Queue, UploadClient, UploadClientError, UploadcareFile, UploadcareGroup, UploadcareNetworkError, base, fromUrl, fromUrlStatus, getUserAgent$1 as getUserAgent, group, groupInfo, info, isReadyPoll, multipartComplete, multipartStart, multipartUpload, uploadDirect, uploadFile, uploadFileGroup, uploadFromUploaded, uploadFromUrl, uploadMultipart };
|
|
@@ -31,7 +31,7 @@ export type ImageInfo = {
|
|
|
31
31
|
height: number;
|
|
32
32
|
width: number;
|
|
33
33
|
geoLocation: GeoLocation | null;
|
|
34
|
-
datetimeOriginal: string;
|
|
34
|
+
datetimeOriginal: string | null;
|
|
35
35
|
format: string;
|
|
36
36
|
colorMode: string;
|
|
37
37
|
dpi: {
|
|
@@ -461,6 +461,18 @@ export type GroupFromOptions = {
|
|
|
461
461
|
jsonpCallback?: string;
|
|
462
462
|
};
|
|
463
463
|
export declare function uploadFileGroup(data: SupportedFileInput[] | Url[] | Uuid[], { publicKey, fileName, baseURL, secureSignature, secureExpire, store, signal, onProgress, source, integration, userAgent, retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes, contentType, multipartChunkSize, baseCDN, checkForUrlDuplicates, saveUrlForRecurrentUploads, jsonpCallback }: FileFromOptions & GroupFromOptions): Promise<UploadcareGroup>;
|
|
464
|
+
export type IsReadyPoolOptions = {
|
|
465
|
+
publicKey: string;
|
|
466
|
+
baseURL?: string;
|
|
467
|
+
source?: string;
|
|
468
|
+
integration?: string;
|
|
469
|
+
userAgent?: CustomUserAgent;
|
|
470
|
+
retryThrottledRequestMaxTimes?: number;
|
|
471
|
+
retryNetworkErrorMaxTimes?: number;
|
|
472
|
+
onProgress?: ProgressCallback<ComputableProgressInfo>;
|
|
473
|
+
signal?: AbortSignal;
|
|
474
|
+
};
|
|
475
|
+
export declare function isReadyPoll(uuid: Uuid, { publicKey, baseURL, source, integration, userAgent, retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes, signal, onProgress }: IsReadyPoolOptions): Promise<FileInfo>;
|
|
464
476
|
export declare class UploadClient {
|
|
465
477
|
private settings;
|
|
466
478
|
constructor(settings: Settings);
|
|
@@ -477,6 +489,7 @@ export declare class UploadClient {
|
|
|
477
489
|
multipartComplete(uuid: Uuid, options?: Partial<MultipartCompleteOptions>): Promise<FileInfo>;
|
|
478
490
|
uploadFile(data: SupportedFileInput | Url | Uuid, options?: Partial<FileFromOptions>): Promise<UploadcareFile>;
|
|
479
491
|
uploadFileGroup(data: SupportedFileInput[] | Url[] | Uuid[], options?: Partial<FileFromOptions & GroupFromOptions>): Promise<UploadcareGroup>;
|
|
492
|
+
isReadyPoll(uuid: Uuid, options?: Partial<IsReadyPoolOptions>): Promise<FileInfo>;
|
|
480
493
|
}
|
|
481
494
|
export type Task<T = unknown> = () => Promise<T>;
|
|
482
495
|
export declare class Queue {
|
|
@@ -403,7 +403,7 @@ const getUrl = (base, path, query) => {
|
|
|
403
403
|
return url.toString();
|
|
404
404
|
};
|
|
405
405
|
|
|
406
|
-
var version = '6.
|
|
406
|
+
var version = '6.9.0';
|
|
407
407
|
|
|
408
408
|
const LIBRARY_NAME = 'UploadcareUploadClient';
|
|
409
409
|
const LIBRARY_VERSION = version;
|
|
@@ -755,9 +755,9 @@ function multipartComplete(uuid, { publicKey, baseURL = defaultSettings.baseURL,
|
|
|
755
755
|
}), { retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes });
|
|
756
756
|
}
|
|
757
757
|
|
|
758
|
-
function isReadyPoll({
|
|
758
|
+
function isReadyPoll(uuid, { publicKey, baseURL, source, integration, userAgent, retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes, signal, onProgress }) {
|
|
759
759
|
return poll({
|
|
760
|
-
check: (signal) => info(
|
|
760
|
+
check: (signal) => info(uuid, {
|
|
761
761
|
publicKey,
|
|
762
762
|
baseURL,
|
|
763
763
|
signal,
|
|
@@ -841,8 +841,7 @@ const uploadDirect = (file, { publicKey, fileName, baseURL, secureSignature, sec
|
|
|
841
841
|
metadata
|
|
842
842
|
})
|
|
843
843
|
.then(({ file }) => {
|
|
844
|
-
return isReadyPoll({
|
|
845
|
-
file,
|
|
844
|
+
return isReadyPoll(file, {
|
|
846
845
|
publicKey,
|
|
847
846
|
baseURL,
|
|
848
847
|
source,
|
|
@@ -1207,8 +1206,7 @@ const uploadFromUrl = (sourceUrl, { publicKey, fileName, baseURL, baseCDN, check
|
|
|
1207
1206
|
throw result;
|
|
1208
1207
|
return result;
|
|
1209
1208
|
})
|
|
1210
|
-
.then((result) => isReadyPoll({
|
|
1211
|
-
file: result.uuid,
|
|
1209
|
+
.then((result) => isReadyPoll(result.uuid, {
|
|
1212
1210
|
publicKey,
|
|
1213
1211
|
baseURL,
|
|
1214
1212
|
integration,
|
|
@@ -1403,8 +1401,7 @@ const uploadMultipart = async (file, { publicKey, fileName, fileSize, baseURL, s
|
|
|
1403
1401
|
return fileInfo;
|
|
1404
1402
|
}
|
|
1405
1403
|
else {
|
|
1406
|
-
return isReadyPoll({
|
|
1407
|
-
file: fileInfo.uuid,
|
|
1404
|
+
return isReadyPoll(fileInfo.uuid, {
|
|
1408
1405
|
publicKey,
|
|
1409
1406
|
baseURL,
|
|
1410
1407
|
source,
|
|
@@ -1692,6 +1689,10 @@ class UploadClient {
|
|
|
1692
1689
|
const settings = this.getSettings();
|
|
1693
1690
|
return uploadFileGroup(data, populateOptionsWithSettings(options, settings));
|
|
1694
1691
|
}
|
|
1692
|
+
isReadyPoll(uuid, options = {}) {
|
|
1693
|
+
const settings = this.getSettings();
|
|
1694
|
+
return isReadyPoll(uuid, populateOptionsWithSettings(options, settings));
|
|
1695
|
+
}
|
|
1695
1696
|
}
|
|
1696
1697
|
|
|
1697
1698
|
class Queue {
|
|
@@ -1749,4 +1750,4 @@ class Queue {
|
|
|
1749
1750
|
}
|
|
1750
1751
|
}
|
|
1751
1752
|
|
|
1752
|
-
export { Queue, UploadClient, UploadClientError, UploadcareFile, UploadcareGroup, UploadcareNetworkError, base, fromUrl, fromUrlStatus, getUserAgent$1 as getUserAgent, group, groupInfo, info, multipartComplete, multipartStart, multipartUpload, uploadDirect, uploadFile, uploadFileGroup, uploadFromUploaded, uploadFromUrl, uploadMultipart };
|
|
1753
|
+
export { Queue, UploadClient, UploadClientError, UploadcareFile, UploadcareGroup, UploadcareNetworkError, base, fromUrl, fromUrlStatus, getUserAgent$1 as getUserAgent, group, groupInfo, info, isReadyPoll, multipartComplete, multipartStart, multipartUpload, uploadDirect, uploadFile, uploadFileGroup, uploadFromUploaded, uploadFromUrl, uploadMultipart };
|
package/dist/index.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export type ImageInfo = {
|
|
|
31
31
|
height: number;
|
|
32
32
|
width: number;
|
|
33
33
|
geoLocation: GeoLocation | null;
|
|
34
|
-
datetimeOriginal: string;
|
|
34
|
+
datetimeOriginal: string | null;
|
|
35
35
|
format: string;
|
|
36
36
|
colorMode: string;
|
|
37
37
|
dpi: {
|
|
@@ -461,6 +461,18 @@ export type GroupFromOptions = {
|
|
|
461
461
|
jsonpCallback?: string;
|
|
462
462
|
};
|
|
463
463
|
export declare function uploadFileGroup(data: SupportedFileInput[] | Url[] | Uuid[], { publicKey, fileName, baseURL, secureSignature, secureExpire, store, signal, onProgress, source, integration, userAgent, retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes, contentType, multipartChunkSize, baseCDN, checkForUrlDuplicates, saveUrlForRecurrentUploads, jsonpCallback }: FileFromOptions & GroupFromOptions): Promise<UploadcareGroup>;
|
|
464
|
+
export type IsReadyPoolOptions = {
|
|
465
|
+
publicKey: string;
|
|
466
|
+
baseURL?: string;
|
|
467
|
+
source?: string;
|
|
468
|
+
integration?: string;
|
|
469
|
+
userAgent?: CustomUserAgent;
|
|
470
|
+
retryThrottledRequestMaxTimes?: number;
|
|
471
|
+
retryNetworkErrorMaxTimes?: number;
|
|
472
|
+
onProgress?: ProgressCallback<ComputableProgressInfo>;
|
|
473
|
+
signal?: AbortSignal;
|
|
474
|
+
};
|
|
475
|
+
export declare function isReadyPoll(uuid: Uuid, { publicKey, baseURL, source, integration, userAgent, retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes, signal, onProgress }: IsReadyPoolOptions): Promise<FileInfo>;
|
|
464
476
|
export declare class UploadClient {
|
|
465
477
|
private settings;
|
|
466
478
|
constructor(settings: Settings);
|
|
@@ -477,6 +489,7 @@ export declare class UploadClient {
|
|
|
477
489
|
multipartComplete(uuid: Uuid, options?: Partial<MultipartCompleteOptions>): Promise<FileInfo>;
|
|
478
490
|
uploadFile(data: SupportedFileInput | Url | Uuid, options?: Partial<FileFromOptions>): Promise<UploadcareFile>;
|
|
479
491
|
uploadFileGroup(data: SupportedFileInput[] | Url[] | Uuid[], options?: Partial<FileFromOptions & GroupFromOptions>): Promise<UploadcareGroup>;
|
|
492
|
+
isReadyPoll(uuid: Uuid, options?: Partial<IsReadyPoolOptions>): Promise<FileInfo>;
|
|
480
493
|
}
|
|
481
494
|
export type Task<T = unknown> = () => Promise<T>;
|
|
482
495
|
export declare class Queue {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uploadcare/upload-client",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.9.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.
|
|
93
|
+
"@uploadcare/api-client-utils": "^6.9.0",
|
|
94
94
|
"chalk": "^4.1.2"
|
|
95
95
|
},
|
|
96
96
|
"dependencies": {
|