@uploadcare/upload-client 6.18.4 → 6.19.0-alpha.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 +1 -2
- package/dist/cjs/index.browser.cjs +47 -45
- package/dist/cjs/index.browser.d.cts +14 -6
- package/dist/cjs/index.node.cjs +47 -45
- package/dist/cjs/index.node.d.cts +14 -6
- package/dist/cjs/index.react-native.cjs +47 -45
- package/dist/cjs/index.react-native.d.cts +14 -6
- package/dist/esm/index.browser.d.mts +14 -6
- package/dist/esm/index.browser.mjs +47 -45
- package/dist/esm/index.node.d.mts +14 -6
- package/dist/esm/index.node.mjs +47 -45
- package/dist/esm/index.react-native.d.mts +14 -6
- package/dist/esm/index.react-native.mjs +47 -45
- package/dist/index.d.ts +14 -6
- package/package.json +12 -6
package/dist/index.d.ts
CHANGED
|
@@ -73,6 +73,7 @@ export type ContentInfo = {
|
|
|
73
73
|
video?: VideoInfo;
|
|
74
74
|
};
|
|
75
75
|
export type Metadata = Record<string, string>;
|
|
76
|
+
export type Tags = string[];
|
|
76
77
|
export type StoreValue = "auto" | boolean;
|
|
77
78
|
export declare class CancelError extends UploadcareError {
|
|
78
79
|
isCancel: boolean;
|
|
@@ -125,12 +126,13 @@ export type FileInfo = {
|
|
|
125
126
|
mimeType: string;
|
|
126
127
|
isImage: boolean;
|
|
127
128
|
isStored: boolean;
|
|
128
|
-
isReady:
|
|
129
|
+
isReady: boolean;
|
|
129
130
|
imageInfo: ImageInfo | null;
|
|
130
131
|
videoInfo: VideoInfo | null;
|
|
131
132
|
contentInfo: ContentInfo | null;
|
|
132
133
|
s3Bucket?: string;
|
|
133
134
|
metadata?: Metadata;
|
|
135
|
+
tags?: Tags;
|
|
134
136
|
};
|
|
135
137
|
export type GroupFileInfo = FileInfo & {
|
|
136
138
|
defaultEffects: string;
|
|
@@ -175,12 +177,13 @@ export type BaseOptions = {
|
|
|
175
177
|
retryThrottledRequestMaxTimes?: number;
|
|
176
178
|
retryNetworkErrorMaxTimes?: number;
|
|
177
179
|
metadata?: Metadata;
|
|
180
|
+
tags?: Tags;
|
|
178
181
|
};
|
|
179
182
|
/**
|
|
180
183
|
* Performs file uploading request to Uploadcare Upload API. Can be canceled and
|
|
181
184
|
* has progress.
|
|
182
185
|
*/
|
|
183
|
-
export function base(file: SupportedFileInput, { publicKey, fileName, contentType, baseURL, secureSignature, secureExpire, store, signal, onProgress, source, integration, userAgent, retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes, metadata }: BaseOptions): Promise<BaseResponse>;
|
|
186
|
+
export function base(file: SupportedFileInput, { publicKey, fileName, contentType, baseURL, secureSignature, secureExpire, store, signal, onProgress, source, integration, userAgent, retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes, metadata, tags }: BaseOptions): Promise<BaseResponse>;
|
|
184
187
|
export declare enum TypeEnum {
|
|
185
188
|
Token = "token",
|
|
186
189
|
FileInfo = "file_info"
|
|
@@ -309,6 +312,7 @@ export type MultipartStartOptions = {
|
|
|
309
312
|
retryThrottledRequestMaxTimes?: number;
|
|
310
313
|
retryNetworkErrorMaxTimes?: number;
|
|
311
314
|
metadata?: Metadata;
|
|
315
|
+
tags?: Tags;
|
|
312
316
|
};
|
|
313
317
|
export type MultipartPart = string;
|
|
314
318
|
export type MultipartStartResponse = {
|
|
@@ -316,7 +320,7 @@ export type MultipartStartResponse = {
|
|
|
316
320
|
uuid: Uuid;
|
|
317
321
|
};
|
|
318
322
|
/** Start multipart uploading. */
|
|
319
|
-
export function multipartStart(size: number, { publicKey, contentType, fileName, multipartChunkSize, baseURL, secureSignature, secureExpire, store, signal, source, integration, userAgent, retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes, metadata }: MultipartStartOptions): Promise<MultipartStartResponse>;
|
|
323
|
+
export function multipartStart(size: number, { publicKey, contentType, fileName, multipartChunkSize, baseURL, secureSignature, secureExpire, store, signal, source, integration, userAgent, retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes, metadata, tags }: MultipartStartOptions): Promise<MultipartStartResponse>;
|
|
320
324
|
export type MultipartUploadOptions = {
|
|
321
325
|
publicKey?: string;
|
|
322
326
|
contentType?: string;
|
|
@@ -357,6 +361,7 @@ export declare class UploadcareFile {
|
|
|
357
361
|
readonly videoInfo: VideoInfo | null;
|
|
358
362
|
readonly contentInfo: ContentInfo | null;
|
|
359
363
|
readonly metadata: Metadata | null;
|
|
364
|
+
readonly tags: Tags | null;
|
|
360
365
|
readonly s3Bucket: string | null;
|
|
361
366
|
readonly defaultEffects: null | string;
|
|
362
367
|
constructor(fileInfo: FileInfo | GroupFileInfo, { baseCDN, fileName }?: {
|
|
@@ -387,9 +392,10 @@ export type FileFromOptions = {
|
|
|
387
392
|
saveUrlForRecurrentUploads?: boolean;
|
|
388
393
|
pusherKey?: string;
|
|
389
394
|
metadata?: Metadata;
|
|
395
|
+
tags?: Tags;
|
|
390
396
|
};
|
|
391
397
|
/** Uploads file from provided data. */
|
|
392
|
-
export declare function uploadFile(data: SupportedFileInput | Url | Uuid, { publicKey, fileName, baseURL, secureSignature, secureExpire, store, signal, onProgress, source, integration, userAgent, retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes, contentType, multipartMinFileSize, multipartChunkSize, maxConcurrentRequests, baseCDN, checkForUrlDuplicates, saveUrlForRecurrentUploads, pusherKey, metadata }: FileFromOptions): Promise<UploadcareFile>;
|
|
398
|
+
export declare function uploadFile(data: SupportedFileInput | Url | Uuid, { publicKey, fileName, baseURL, secureSignature, secureExpire, store, signal, onProgress, source, integration, userAgent, retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes, contentType, multipartMinFileSize, multipartChunkSize, maxConcurrentRequests, baseCDN, checkForUrlDuplicates, saveUrlForRecurrentUploads, pusherKey, metadata, tags }: FileFromOptions): Promise<UploadcareFile>;
|
|
393
399
|
export type DirectOptions = {
|
|
394
400
|
publicKey: string;
|
|
395
401
|
fileName?: string;
|
|
@@ -407,8 +413,9 @@ export type DirectOptions = {
|
|
|
407
413
|
retryNetworkErrorMaxTimes?: number;
|
|
408
414
|
baseCDN?: string;
|
|
409
415
|
metadata?: Metadata;
|
|
416
|
+
tags?: Tags;
|
|
410
417
|
};
|
|
411
|
-
export declare const uploadDirect: (file: SupportedFileInput, { publicKey, fileName, baseURL, secureSignature, secureExpire, store, contentType, signal, onProgress, source, integration, userAgent, retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes, baseCDN, metadata }: DirectOptions) => Promise<UploadcareFile>;
|
|
418
|
+
export declare const uploadDirect: (file: SupportedFileInput, { publicKey, fileName, baseURL, secureSignature, secureExpire, store, contentType, signal, onProgress, source, integration, userAgent, retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes, baseCDN, metadata, tags }: DirectOptions) => Promise<UploadcareFile>;
|
|
412
419
|
export type FromUploadedOptions = {
|
|
413
420
|
publicKey: string;
|
|
414
421
|
fileName?: string;
|
|
@@ -449,8 +456,9 @@ export type MultipartOptions = {
|
|
|
449
456
|
maxConcurrentRequests?: number;
|
|
450
457
|
baseCDN?: string;
|
|
451
458
|
metadata?: Metadata;
|
|
459
|
+
tags?: Tags;
|
|
452
460
|
};
|
|
453
|
-
export declare const uploadMultipart: (file: SupportedFileInput, { publicKey, fileName, fileSize, baseURL, secureSignature, secureExpire, store, signal, onProgress, source, integration, userAgent, retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes, contentType, multipartChunkSize, maxConcurrentRequests, baseCDN, metadata }: MultipartOptions) => Promise<UploadcareFile>;
|
|
461
|
+
export declare const uploadMultipart: (file: SupportedFileInput, { publicKey, fileName, fileSize, baseURL, secureSignature, secureExpire, store, signal, onProgress, source, integration, userAgent, retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes, contentType, multipartChunkSize, maxConcurrentRequests, baseCDN, metadata, tags }: MultipartOptions) => Promise<UploadcareFile>;
|
|
454
462
|
export declare class UploadcareGroup {
|
|
455
463
|
readonly uuid: GroupId;
|
|
456
464
|
readonly filesCount: string;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uploadcare/upload-client",
|
|
3
|
-
"version": "6.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "6.19.0-alpha.0",
|
|
4
|
+
"description": "`@uploadcare/upload-client` is a JavaScript and TypeScript SDK for the Uploadcare Upload API. It handles direct binary uploads, multipart uploads for large files, URL-based and UUID-based uploads, and file group creation. Works in Node.js, browser, and React Native. Supports upload progress tracking, AbortController cancellation, concurrent request queuing, and signed uploads.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./dist/esm/index.node.mjs",
|
|
7
7
|
"browser": "./dist/esm/index.browser.mjs",
|
|
@@ -68,11 +68,17 @@
|
|
|
68
68
|
"homepage": "https://github.com/uploadcare/uploadcare-js-api-clients#readme",
|
|
69
69
|
"keywords": [
|
|
70
70
|
"uploadcare",
|
|
71
|
-
"file",
|
|
72
|
-
"uploader",
|
|
73
|
-
"image",
|
|
74
71
|
"upload",
|
|
75
|
-
"
|
|
72
|
+
"file",
|
|
73
|
+
"sdk",
|
|
74
|
+
"typescript",
|
|
75
|
+
"multipart",
|
|
76
|
+
"nodejs",
|
|
77
|
+
"browser",
|
|
78
|
+
"react-native",
|
|
79
|
+
"progress",
|
|
80
|
+
"abort",
|
|
81
|
+
"signed-uploads",
|
|
76
82
|
"cdn"
|
|
77
83
|
],
|
|
78
84
|
"devDependencies": {
|