@uploadcare/upload-client 6.6.1 → 6.8.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 +78 -60
- package/dist/cjs/index.browser.d.cts +29 -5
- package/dist/cjs/index.node.cjs +78 -60
- package/dist/cjs/index.node.d.cts +29 -5
- package/dist/cjs/index.react-native.cjs +78 -60
- package/dist/cjs/index.react-native.d.cts +29 -5
- package/dist/esm/index.browser.d.mts +29 -5
- package/dist/esm/index.browser.mjs +78 -61
- package/dist/esm/index.node.d.mts +29 -5
- package/dist/esm/index.node.mjs +78 -61
- package/dist/esm/index.react-native.d.mts +29 -5
- package/dist/esm/index.react-native.mjs +78 -61
- package/dist/index.d.ts +29 -5
- package/package.json +3 -3
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: {
|
|
@@ -126,12 +126,15 @@ export type FileInfo = {
|
|
|
126
126
|
s3Bucket?: string;
|
|
127
127
|
metadata?: Metadata;
|
|
128
128
|
};
|
|
129
|
+
export type GroupFileInfo = FileInfo & {
|
|
130
|
+
defaultEffects: string;
|
|
131
|
+
};
|
|
129
132
|
export type GroupInfo = {
|
|
130
133
|
datetimeCreated: string;
|
|
131
134
|
datetimeStored: string | null;
|
|
132
135
|
filesCount: string;
|
|
133
136
|
cdnUrl: string;
|
|
134
|
-
files:
|
|
137
|
+
files: (GroupFileInfo | null)[];
|
|
135
138
|
url: string;
|
|
136
139
|
id: GroupId;
|
|
137
140
|
};
|
|
@@ -347,7 +350,8 @@ export declare class UploadcareFile {
|
|
|
347
350
|
readonly contentInfo: null | ContentInfo;
|
|
348
351
|
readonly metadata: null | Metadata;
|
|
349
352
|
readonly s3Bucket: null | string;
|
|
350
|
-
|
|
353
|
+
readonly defaultEffects: null | string;
|
|
354
|
+
constructor(fileInfo: FileInfo | GroupFileInfo, { baseCDN, fileName }?: {
|
|
351
355
|
baseCDN?: string;
|
|
352
356
|
fileName?: string;
|
|
353
357
|
});
|
|
@@ -449,12 +453,26 @@ export declare class UploadcareGroup {
|
|
|
449
453
|
readonly files: UploadcareFile[];
|
|
450
454
|
readonly createdAt: string;
|
|
451
455
|
readonly storedAt: string | null;
|
|
452
|
-
constructor(groupInfo: GroupInfo,
|
|
456
|
+
constructor(groupInfo: GroupInfo, { baseCDN }?: {
|
|
457
|
+
baseCDN?: string;
|
|
458
|
+
});
|
|
453
459
|
}
|
|
454
460
|
export type GroupFromOptions = {
|
|
455
461
|
jsonpCallback?: string;
|
|
456
462
|
};
|
|
457
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>;
|
|
458
476
|
export declare class UploadClient {
|
|
459
477
|
private settings;
|
|
460
478
|
constructor(settings: Settings);
|
|
@@ -471,11 +489,17 @@ export declare class UploadClient {
|
|
|
471
489
|
multipartComplete(uuid: Uuid, options?: Partial<MultipartCompleteOptions>): Promise<FileInfo>;
|
|
472
490
|
uploadFile(data: SupportedFileInput | Url | Uuid, options?: Partial<FileFromOptions>): Promise<UploadcareFile>;
|
|
473
491
|
uploadFileGroup(data: SupportedFileInput[] | Url[] | Uuid[], options?: Partial<FileFromOptions & GroupFromOptions>): Promise<UploadcareGroup>;
|
|
492
|
+
isReadyPoll(uuid: Uuid, options?: Partial<IsReadyPoolOptions>): Promise<FileInfo>;
|
|
474
493
|
}
|
|
475
494
|
export type Task<T = unknown> = () => Promise<T>;
|
|
476
495
|
export declare class Queue {
|
|
477
|
-
|
|
496
|
+
private _concurrency;
|
|
497
|
+
private _pending;
|
|
498
|
+
private _running;
|
|
499
|
+
private _resolvers;
|
|
500
|
+
private _rejectors;
|
|
478
501
|
constructor(concurrency: number);
|
|
502
|
+
private _run;
|
|
479
503
|
add<T>(task: Task<T>): Promise<T>;
|
|
480
504
|
get pending(): number;
|
|
481
505
|
get running(): number;
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uploadcare/upload-client",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.8.0",
|
|
4
4
|
"description": "Library for work with Uploadcare Upload API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./dist/esm/index.node.mjs",
|
|
7
7
|
"browser": "./dist/esm/index.browser.mjs",
|
|
8
|
-
"react-native": "./dist/index.react-native.
|
|
8
|
+
"react-native": "./dist/index.react-native.mjs",
|
|
9
9
|
"types": "./dist/index.d.ts",
|
|
10
10
|
"exports": {
|
|
11
11
|
".": {
|
|
@@ -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.8.0",
|
|
94
94
|
"chalk": "^4.1.2"
|
|
95
95
|
},
|
|
96
96
|
"dependencies": {
|