@uploadcare/upload-client 2.0.0-alpha.9 → 2.0.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 +35 -10
- package/dist/index.browser.cjs +70 -42
- package/dist/index.browser.js +110 -86
- package/dist/index.cjs +82 -49
- package/dist/index.js +119 -95
- package/dist/types.d.ts +72 -3
- package/package.json +32 -26
- package/CHANGELOG.md +0 -243
package/dist/types.d.ts
CHANGED
|
@@ -105,7 +105,8 @@ export declare type CustomUserAgentOptions = {
|
|
|
105
105
|
languageName: string;
|
|
106
106
|
integration?: string;
|
|
107
107
|
};
|
|
108
|
-
export declare type
|
|
108
|
+
export declare type CustomUserAgentFn = (options: CustomUserAgentOptions) => string;
|
|
109
|
+
export declare type CustomUserAgent = string | CustomUserAgentFn;
|
|
109
110
|
export declare type BrowserFile = Blob | File;
|
|
110
111
|
export declare type NodeFile = Buffer;
|
|
111
112
|
export declare type BaseResponse = {
|
|
@@ -177,6 +178,7 @@ export declare type StatusProgressResponse = {
|
|
|
177
178
|
export declare type StatusErrorResponse = {
|
|
178
179
|
status: Status.Error;
|
|
179
180
|
error: string;
|
|
181
|
+
errorCode: string;
|
|
180
182
|
};
|
|
181
183
|
export declare type StatusSuccessResponse = {
|
|
182
184
|
status: Status.Success;
|
|
@@ -246,8 +248,10 @@ export declare type MultipartStartResponse = {
|
|
|
246
248
|
};
|
|
247
249
|
declare function multipartStart(size: number, { publicKey, contentType, fileName, multipartChunkSize, baseURL, secureSignature, secureExpire, store, signal, source, integration, userAgent, retryThrottledRequestMaxTimes }: MultipartStartOptions): Promise<MultipartStartResponse>;
|
|
248
250
|
export declare type MultipartUploadOptions = {
|
|
251
|
+
publicKey?: string;
|
|
249
252
|
signal?: AbortSignal;
|
|
250
253
|
onProgress?: ProgressCallback;
|
|
254
|
+
integration?: string;
|
|
251
255
|
retryThrottledRequestMaxTimes?: number;
|
|
252
256
|
};
|
|
253
257
|
export declare type MultipartUploadResponse = {
|
|
@@ -270,6 +274,7 @@ declare class UploadcareFile {
|
|
|
270
274
|
readonly size: null | number;
|
|
271
275
|
readonly isStored: null | boolean;
|
|
272
276
|
readonly isImage: null | boolean;
|
|
277
|
+
readonly mimeType: null | string;
|
|
273
278
|
readonly cdnUrl: null | string;
|
|
274
279
|
readonly cdnUrlModifiers: null | string;
|
|
275
280
|
readonly originalUrl: null | string;
|
|
@@ -282,6 +287,62 @@ declare class UploadcareFile {
|
|
|
282
287
|
fileName?: string;
|
|
283
288
|
});
|
|
284
289
|
}
|
|
290
|
+
export declare type FromObjectOptions = {
|
|
291
|
+
publicKey: string;
|
|
292
|
+
fileName?: string;
|
|
293
|
+
baseURL?: string;
|
|
294
|
+
secureSignature?: string;
|
|
295
|
+
secureExpire?: string;
|
|
296
|
+
store?: boolean;
|
|
297
|
+
signal?: AbortSignal;
|
|
298
|
+
onProgress?: ProgressCallback;
|
|
299
|
+
source?: string;
|
|
300
|
+
integration?: string;
|
|
301
|
+
userAgent?: CustomUserAgent;
|
|
302
|
+
retryThrottledRequestMaxTimes?: number;
|
|
303
|
+
baseCDN?: string;
|
|
304
|
+
};
|
|
305
|
+
declare const uploadFromObject: (file: NodeFile | BrowserFile, { publicKey, fileName, baseURL, secureSignature, secureExpire, store, signal, onProgress, source, integration, userAgent, retryThrottledRequestMaxTimes, baseCDN }: FromObjectOptions) => Promise<UploadcareFile>;
|
|
306
|
+
export declare type UploadFromUrlOptions = {
|
|
307
|
+
baseCDN?: string;
|
|
308
|
+
onProgress?: ProgressCallback;
|
|
309
|
+
pusherKey?: string;
|
|
310
|
+
} & FromUrlOptions;
|
|
311
|
+
export declare const uploadFromUrl: (sourceUrl: string, { publicKey, fileName, baseURL, baseCDN, checkForUrlDuplicates, saveUrlForRecurrentUploads, secureSignature, secureExpire, store, signal, onProgress, source, integration, userAgent, retryThrottledRequestMaxTimes, pusherKey }: UploadFromUrlOptions) => Promise<UploadcareFile>;
|
|
312
|
+
export declare type FromUploadedOptions = {
|
|
313
|
+
publicKey: string;
|
|
314
|
+
fileName?: string;
|
|
315
|
+
baseURL?: string;
|
|
316
|
+
signal?: AbortSignal;
|
|
317
|
+
onProgress?: ProgressCallback;
|
|
318
|
+
source?: string;
|
|
319
|
+
integration?: string;
|
|
320
|
+
userAgent?: CustomUserAgent;
|
|
321
|
+
retryThrottledRequestMaxTimes?: number;
|
|
322
|
+
baseCDN?: string;
|
|
323
|
+
};
|
|
324
|
+
export declare const uploadFromUploaded: (uuid: Uuid, { publicKey, fileName, baseURL, signal, onProgress, source, integration, userAgent, retryThrottledRequestMaxTimes, baseCDN }: FromUploadedOptions) => Promise<UploadcareFile>;
|
|
325
|
+
export declare type MultipartOptions = {
|
|
326
|
+
publicKey: string;
|
|
327
|
+
contentType?: string;
|
|
328
|
+
multipartChunkSize?: number;
|
|
329
|
+
fileName?: string;
|
|
330
|
+
fileSize?: number;
|
|
331
|
+
baseURL?: string;
|
|
332
|
+
secureSignature?: string;
|
|
333
|
+
secureExpire?: string;
|
|
334
|
+
store?: boolean;
|
|
335
|
+
signal?: AbortSignal;
|
|
336
|
+
onProgress?: ProgressCallback;
|
|
337
|
+
source?: string;
|
|
338
|
+
integration?: string;
|
|
339
|
+
userAgent?: CustomUserAgent;
|
|
340
|
+
retryThrottledRequestMaxTimes?: number;
|
|
341
|
+
maxConcurrentRequests?: number;
|
|
342
|
+
multipartMaxAttempts?: number;
|
|
343
|
+
baseCDN?: string;
|
|
344
|
+
};
|
|
345
|
+
export declare const uploadMultipart: (file: NodeFile | BrowserFile, { publicKey, fileName, fileSize, baseURL, secureSignature, secureExpire, store, signal, onProgress, source, integration, userAgent, retryThrottledRequestMaxTimes, contentType, multipartChunkSize, maxConcurrentRequests, multipartMaxAttempts, baseCDN }: MultipartOptions) => Promise<UploadcareFile>;
|
|
285
346
|
export declare type FileFromOptions = {
|
|
286
347
|
publicKey: string;
|
|
287
348
|
fileName?: string;
|
|
@@ -297,9 +358,17 @@ export declare type FileFromOptions = {
|
|
|
297
358
|
retryThrottledRequestMaxTimes?: number;
|
|
298
359
|
contentType?: string;
|
|
299
360
|
multipartChunkSize?: number;
|
|
361
|
+
multipartMaxAttempts?: number;
|
|
362
|
+
maxConcurrentRequests?: number;
|
|
300
363
|
baseCDN?: string;
|
|
364
|
+
checkForUrlDuplicates?: boolean;
|
|
365
|
+
saveUrlForRecurrentUploads?: boolean;
|
|
366
|
+
pusherKey?: string;
|
|
301
367
|
};
|
|
302
|
-
|
|
368
|
+
/**
|
|
369
|
+
* Uploads file from provided data.
|
|
370
|
+
*/
|
|
371
|
+
export declare function uploadFile(data: NodeFile | BrowserFile | Url | Uuid, { publicKey, fileName, baseURL, secureSignature, secureExpire, store, signal, onProgress, source, integration, userAgent, retryThrottledRequestMaxTimes, contentType, multipartChunkSize, multipartMaxAttempts, maxConcurrentRequests, baseCDN, checkForUrlDuplicates, saveUrlForRecurrentUploads, pusherKey }: FileFromOptions): Promise<UploadcareFile>;
|
|
303
372
|
declare class UploadcareGroup {
|
|
304
373
|
readonly uuid: GroupId;
|
|
305
374
|
readonly filesCount: string;
|
|
@@ -347,8 +416,8 @@ export {
|
|
|
347
416
|
multipartComplete as multipartComplete,
|
|
348
417
|
multipartStart as multipartStart,
|
|
349
418
|
multipartUpload as multipartUpload,
|
|
350
|
-
uploadFile as uploadFile,
|
|
351
419
|
uploadFileGroup as uploadFileGroup,
|
|
420
|
+
uploadFromObject as uploadBase,
|
|
352
421
|
};
|
|
353
422
|
|
|
354
423
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uploadcare/upload-client",
|
|
3
|
-
"version": "2.0.0
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Library for work with Uploadcare Upload API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -21,6 +21,12 @@
|
|
|
21
21
|
"import": "./dist/index.js"
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
|
+
"react-native": {
|
|
25
|
+
"./lib/request/request.node.js": "./lib/request/request.browser.js",
|
|
26
|
+
"./lib/tools/getFormData.node.js": "./lib/tools/getFormData.react-native.js",
|
|
27
|
+
"./lib/tools/sockets.node.js": "./lib/tools/sockets.browser.js",
|
|
28
|
+
"./lib/uploadFile/prepareChunks.node.js": "./lib/uploadFile/prepareChunks.react-native.js"
|
|
29
|
+
},
|
|
24
30
|
"scripts": {
|
|
25
31
|
"check-env-vars": "node ./checkvars.js",
|
|
26
32
|
"mock:start": "node --loader ts-node/esm.mjs ./mock-server/server.ts --silent",
|
|
@@ -56,47 +62,47 @@
|
|
|
56
62
|
"cdn"
|
|
57
63
|
],
|
|
58
64
|
"devDependencies": {
|
|
59
|
-
"@koa/cors": "3.1.0",
|
|
60
|
-
"@koa/router": "8.0.8",
|
|
61
65
|
"@rollup/plugin-alias": "^3.1.1",
|
|
62
66
|
"@rollup/plugin-node-resolve": "^8.4.0",
|
|
67
|
+
"@types/ws": "8.2.0",
|
|
68
|
+
"dts-bundle-generator": "5.4.0",
|
|
69
|
+
"prettier": "2.2.1",
|
|
70
|
+
"rollup": "^2.23.0",
|
|
71
|
+
"rollup-plugin-typescript2": "^0.27.1",
|
|
72
|
+
"typescript": "^3.9.7",
|
|
73
|
+
"@koa/cors": "3.1.0",
|
|
74
|
+
"@koa/router": "10.0.0",
|
|
63
75
|
"@types/form-data": "2.5.0",
|
|
64
|
-
"@types/jest": "26.0.
|
|
65
|
-
"@types/koa": "2.11.
|
|
66
|
-
"@types/node": "12.12.
|
|
76
|
+
"@types/jest": "26.0.14",
|
|
77
|
+
"@types/koa": "2.11.4",
|
|
78
|
+
"@types/node": "12.12.67",
|
|
67
79
|
"@types/promise": "7.1.30",
|
|
68
|
-
"@
|
|
69
|
-
"@typescript-eslint/
|
|
70
|
-
"@typescript-eslint/parser": "2.34.0",
|
|
80
|
+
"@typescript-eslint/eslint-plugin": "5.3.1",
|
|
81
|
+
"@typescript-eslint/parser": "5.3.1",
|
|
71
82
|
"chalk": "4.1.0",
|
|
72
83
|
"data-uri-to-buffer": "3.0.1",
|
|
73
84
|
"dataurl-to-blob": "0.0.1",
|
|
74
85
|
"dotenv": "8.2.0",
|
|
75
|
-
"
|
|
76
|
-
"eslint": "
|
|
77
|
-
"eslint-
|
|
78
|
-
"
|
|
79
|
-
"jest": "26.
|
|
80
|
-
"jest-
|
|
81
|
-
"jest-websocket-mock": "2.1.0",
|
|
86
|
+
"eslint": "8.2.0",
|
|
87
|
+
"eslint-config-prettier": "8.3.0",
|
|
88
|
+
"eslint-plugin-prettier": "4.0.0",
|
|
89
|
+
"jest": "26.5.3",
|
|
90
|
+
"jest-environment-jsdom": "26.5.2",
|
|
91
|
+
"jest-websocket-mock": "2.2.0",
|
|
82
92
|
"koa": "2.13.0",
|
|
83
93
|
"koa-add-trailing-slashes": "2.0.1",
|
|
84
94
|
"koa-body": "4.2.0",
|
|
85
95
|
"mock-socket": "9.0.3",
|
|
86
|
-
"prettier": "
|
|
87
|
-
"prettier-config-standard": "1.0.1",
|
|
96
|
+
"prettier-config-standard": "4.0.0",
|
|
88
97
|
"rimraf": "3.0.2",
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"ts-jest": "26.1.4",
|
|
94
|
-
"ts-node": "8.10.2",
|
|
95
|
-
"typescript": "^3.9.7"
|
|
98
|
+
"shipjs": "0.24.0",
|
|
99
|
+
"start-server-and-test": "1.11.7",
|
|
100
|
+
"ts-jest": "26.4.1",
|
|
101
|
+
"ts-node": "9.1.1"
|
|
96
102
|
},
|
|
97
103
|
"dependencies": {
|
|
98
104
|
"abort-controller": "^3.0.0",
|
|
99
105
|
"form-data": "^4.0.0",
|
|
100
|
-
"ws": "^
|
|
106
|
+
"ws": "^8.2.3"
|
|
101
107
|
}
|
|
102
108
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
## [1.1.2](https://github.com/uploadcare/uploadcare-upload-client/compare/v1.1.1...v1.1.2) (2020-04-20)
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
### Bug Fixes
|
|
5
|
-
|
|
6
|
-
* **multipart:** implement retry for part uploading ([#253](https://github.com/uploadcare/uploadcare-upload-client/issues/253)) ([e2330bb](https://github.com/uploadcare/uploadcare-upload-client/commit/e2330bb37ea75b2d82c3258696b5d18cf719eae5))
|
|
7
|
-
* **multipart:** add is ready pool for mulipart upload ([#254](https://github.com/uploadcare/uploadcare-upload-client/issues/254)) ([fe7ca2a](https://github.com/uploadcare/uploadcare-upload-client/commit/fe7ca2a0bbee7b24de2a792669ec33691cb2fd0c))
|
|
8
|
-
* **multipart:** implement multipart progress for node ([#252](https://github.com/uploadcare/uploadcare-upload-client/issues/252)) ([b60eb83](https://github.com/uploadcare/uploadcare-upload-client/commit/b60eb831ff966a4c6a80f2ee9d72ce3b76659d56))
|
|
9
|
-
* **multipart:** use browser contentType if option is not passed ([#251](https://github.com/uploadcare/uploadcare-upload-client/issues/251)) ([f5ab80a](https://github.com/uploadcare/uploadcare-upload-client/commit/f5ab80a295cd6e4fc59e426d9d73086999bf4197))
|
|
10
|
-
* **multipart:** use browser filename if option is not passed ([#250](https://github.com/uploadcare/uploadcare-upload-client/issues/250)) ([749e4a9](https://github.com/uploadcare/uploadcare-upload-client/commit/749e4a988b7d10ee9368433a4ffa076471a4d3e3))
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
## [1.1.1](https://github.com/uploadcare/uploadcare-upload-client/compare/v1.1.0...v1.1.1) (2020-03-16)
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
### Bug Fixes
|
|
17
|
-
|
|
18
|
-
* add is ready poll in `uploadFromUrl` ([#238](https://github.com/uploadcare/uploadcare-upload-client/issues/238)) ([dd0202d](https://github.com/uploadcare/uploadcare-upload-client/commit/dd0202d5ef2c787a63d345731ea2ccc39ecca70e))
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
# [1.1.0](https://github.com/uploadcare/uploadcare-upload-client/compare/v1.0.1...v1.1.0) (2020-03-03)
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
### Features
|
|
26
|
-
|
|
27
|
-
* implement push strategy with sockets for `uploadFromUrl` ([#222](https://github.com/uploadcare/uploadcare-upload-client/issues/222)) ([4cafe97](https://github.com/uploadcare/uploadcare-upload-client/commit/4cafe9759ebfe1f54b0e6d2f9cf2cffa36ec3283))
|
|
28
|
-
* add deferred disconnect for push strategy ([#229](https://github.com/uploadcare/uploadcare-upload-client/issues/229)) ([a9901f7](https://github.com/uploadcare/uploadcare-upload-client/commit/a9901f74aa1512471b3f4bd470ccc794eb31dac0))
|
|
29
|
-
* add strong typed event emitter ([#217](https://github.com/uploadcare/uploadcare-upload-client/issues/217)) ([35b9eef](https://github.com/uploadcare/uploadcare-upload-client/commit/35b9eef22ae0638d52915a2338e3c3978e3d6f2b))
|
|
30
|
-
* add custom race function ([#177](https://github.com/uploadcare/uploadcare-upload-client/issues/177)) ([219c02a](https://github.com/uploadcare/uploadcare-upload-client/commit/219c02aceb233886383e6d66c5ecdfbd5a1626ea))
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
### Bug Fixes
|
|
34
|
-
|
|
35
|
-
* make `fileName` optional and remove it from default settings ([#233](https://github.com/uploadcare/uploadcare-upload-client/issues/233)) ([a28d181](https://github.com/uploadcare/uploadcare-upload-client/commit/a28d181e5c412f6ff2aeee2e7ae02a7ae848c8a2))
|
|
36
|
-
* remove timeout from `uploadFromUrl` function ([#226](https://github.com/uploadcare/uploadcare-upload-client/issues/226)) ([76db2e4](https://github.com/uploadcare/uploadcare-upload-client/commit/76db2e4c607164afcaf07132789348927ea65577))
|
|
37
|
-
* use direct import for CancelController and rename callback to stopRace ([#216](https://github.com/uploadcare/uploadcare-upload-client/issues/216)) ([ea4ef7a](https://github.com/uploadcare/uploadcare-upload-client/commit/ea4ef7ac291ed1503e359901a315239563b53e83))
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
## [1.0.1](https://github.com/uploadcare/uploadcare-upload-client/compare/v1.0.0...v1.0.1) (2020-01-13)
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
### Bug Fixes
|
|
44
|
-
|
|
45
|
-
* **deps:** update dependency form-data to v3 ([#130](https://github.com/uploadcare/uploadcare-upload-client/issues/130)) ([1ece271](https://github.com/uploadcare/uploadcare-upload-client/commit/1ece271d8583ba257011d16b3f1930ad29329a96))
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
# [1.0.0](https://github.com/uploadcare/uploadcare-upload-client/compare/v1.0.0-alpha.5...v1.0.0) (2019-12-23)
|
|
50
|
-
|
|
51
|
-
### Changed
|
|
52
|
-
|
|
53
|
-
- All methods return a `Promise` now instead of `ThenableInterface`
|
|
54
|
-
- `SettingsInterface` was renamed to `Settings`
|
|
55
|
-
- `fileFrom` was renamed to `uploadFile`.
|
|
56
|
-
- `groupFrom` was renamed to `uploadFileGroup`.
|
|
57
|
-
- `request` low-level API method is not exported outside now.
|
|
58
|
-
- Method `setSettings` of `UploadClient` was renamed to `updateSettings`.
|
|
59
|
-
- Methods (`base`, `fromUrl`, `fromUrlStatus`, `group`,
|
|
60
|
-
`groupInfo`, `info`, `multipartStart`, `multipartUpload`,
|
|
61
|
-
`multipartComplete`, `multipart`, `uploadFile`, `uploadGroup`) were exported
|
|
62
|
-
from `index.ts` to make the tree shaking better.
|
|
63
|
-
- Methods (`base`, `fromUrl`, `fromUrlStatus`, `group`,
|
|
64
|
-
`groupInfo`, `info`, `multipartStart`, `multipartUpload`,
|
|
65
|
-
`multipartComplete`, `multipart`, `uploadFile`, `uploadGroup`) accept
|
|
66
|
-
`options` instead of `settings` as a second argument.
|
|
67
|
-
- `UploadClient` now contains all low-level API methods (`base`,
|
|
68
|
-
`fromUrl`, `fromUrlStatus`, `group`, `groupInfo`, `info`,
|
|
69
|
-
`multipartStart`, `multipartUpload`, `multipartComplete`, `multipart`,
|
|
70
|
-
`fileFrom`, `groupFrom`).
|
|
71
|
-
- `UploadcareGroup` files now contain `UploadcareFile[]`, but not `FileInfo[]`.
|
|
72
|
-
- `README.md` was updated according to library API.
|
|
73
|
-
- `FileData` became `NodeFile` and `BrowserFile`.
|
|
74
|
-
|
|
75
|
-
### Removed
|
|
76
|
-
|
|
77
|
-
- `UploadAPI` class.
|
|
78
|
-
- `Thenable`, `CancelableThenable`, `BaseThenable`, `Upload` classes
|
|
79
|
-
implementing respective interfaces.
|
|
80
|
-
- `onReady`, `onUploaded` callbacks.
|
|
81
|
-
- `addUpdateSettingsListener` and `removeUpdateSettingsListener` from
|
|
82
|
-
`UploadClientInterface`.
|
|
83
|
-
- `from` param of `uploadFile` and `uploadFileGroup`.
|
|
84
|
-
- `FileFromEnum` and `GroupFromEnum`.
|
|
85
|
-
|
|
86
|
-
### Added
|
|
87
|
-
|
|
88
|
-
- `CancelController` to make API calls cancellable. See README for how
|
|
89
|
-
to use this feature. ([#77](https://github.com/uploadcare/uploadcare-upload-client/issues/77))
|
|
90
|
-
|
|
91
|
-
## [1.0.0-alpha.5]
|
|
92
|
-
|
|
93
|
-
### Added
|
|
94
|
-
|
|
95
|
-
- Support of multipart and big files uploading: `multipartStart`,
|
|
96
|
-
`multipartUpload`, and `multipartComplete` methods to `UploadAPI`.
|
|
97
|
-
- Support of canceling uploads and handling them for all API methods
|
|
98
|
-
(`info`, `fromUrl`, `fromUrlStatus`, `group`, `groupInfo`).
|
|
99
|
-
- `DefaultSettingsInterface` with required properties.
|
|
100
|
-
- `pollingTimeoutMilliseconds` to `SettingsInterface`.
|
|
101
|
-
Now you can adjust the timeout for checking is file ready,
|
|
102
|
-
and checking is file being uploaded from URL.
|
|
103
|
-
- `maxConcurrentRequests` setting that allows you to specify the number
|
|
104
|
-
of concurrent requests.
|
|
105
|
-
|
|
106
|
-
### Changed
|
|
107
|
-
|
|
108
|
-
- `FileFrom` enum was renamed to `FileFromEnum`.
|
|
109
|
-
- `GroupFrom` enum was renamed to `GroupFromEnum`.
|
|
110
|
-
- `Settings` was renamed to `SettingsInterface`.
|
|
111
|
-
- `FileInfo` was renamed to `FileInfoInterface`.
|
|
112
|
-
- `GroupInfo` was renamed to `GroupInfoInfoInterface`.
|
|
113
|
-
- `OriginalImageInfo` was renamed to `OriginalImageInfoInterface`.
|
|
114
|
-
- `RequestOptions` was renamed to `RequestOptionsInterface`.
|
|
115
|
-
- `ProgressStatus` was renamed to `ProgressStatusInterface`.
|
|
116
|
-
- `Audio` type was renamed to `AudioInterface`.
|
|
117
|
-
- `Video` type was renamed to `VideoInterface`.
|
|
118
|
-
- `ErrorRequestInfo` type was renamed to `ErrorRequestInfoInterface`.
|
|
119
|
-
- `ErrorResponseInfoInfo` type was renamed to `ErrorResponseInfoInterface`.
|
|
120
|
-
- `ProgressState` was renamed to `ProgressStateEnum`.
|
|
121
|
-
- `ProgressParams` was renamed to `ProgressParamsInterface`.
|
|
122
|
-
- `base` method of Upload API now returns `BaseThenableInterface<BaseResponse>`
|
|
123
|
-
instead of `DirectUploadInterface`.
|
|
124
|
-
- `info`, `fromUrl`, `fromUrlStatus`, `group`, `groupInfo` now returns
|
|
125
|
-
`CancelableThenableInterface`.
|
|
126
|
-
- Progress is now calculated from 0 to 1 instead of 0 to 100
|
|
127
|
-
|
|
128
|
-
### Fixed
|
|
129
|
-
|
|
130
|
-
- Example with `directUpload.onProgress` in `README.md`.
|
|
131
|
-
- All tests are passing now.
|
|
132
|
-
- Mock server tests are passing now.
|
|
133
|
-
|
|
134
|
-
### Removed
|
|
135
|
-
|
|
136
|
-
- `DirectUploadInterface` was removed in favor of `BaseThenableInterface<BaseResponse>`.
|
|
137
|
-
- `BaseProgress` was removed in favor of native `ProgressEvent`.
|
|
138
|
-
- `InfoResponse` was removed in favor of `FileInfoInterface`.
|
|
139
|
-
- Old code in folder `./.back`.
|
|
140
|
-
|
|
141
|
-
[1.0.0-alpha.5]: https://github.com/uploadcare/uploadcare-upload-client/compare/v1.0.0-alpha.4...v1.0.0-alpha.5
|
|
142
|
-
|
|
143
|
-
## [1.0.0-alpha.4]
|
|
144
|
-
|
|
145
|
-
### Added
|
|
146
|
-
|
|
147
|
-
- Wrappers for group paths of Upload API (`group`, `groupInfo`).
|
|
148
|
-
- The high-level function for group uploading, aka filesGroupFrom.
|
|
149
|
-
- Uploading progress for Node.js in the `base` method.
|
|
150
|
-
|
|
151
|
-
### Changed
|
|
152
|
-
|
|
153
|
-
- `UploadFromInterface` was renamed to `FileUploadInterface`.
|
|
154
|
-
- `FileProgress` was renamed to `ProgressParams`.
|
|
155
|
-
- `UploadcareFile` was renamed to `UploadcareFileInterface`.
|
|
156
|
-
|
|
157
|
-
[1.0.0-alpha.4]: https://github.com/uploadcare/uploadcare-upload-client/compare/v1.0.0-alpha.3...v1.0.0-alpha.4
|
|
158
|
-
|
|
159
|
-
## [1.0.0-alpha.3]
|
|
160
|
-
|
|
161
|
-
### Added
|
|
162
|
-
|
|
163
|
-
- Support `fileFrom` 'uploaded' file (`uuid`).
|
|
164
|
-
- Support of `waiting` status from `/from_url/status/` endpoint.
|
|
165
|
-
- Export some main types from the `index.ts` file.
|
|
166
|
-
So you can import them now directly from `@uploadcare/upload-client`.
|
|
167
|
-
- Throttling for `request`.
|
|
168
|
-
- `retryThrottledMaxTimes` param to set count of max retries after
|
|
169
|
-
throttled request (1 by default).
|
|
170
|
-
- `Uuid` type.
|
|
171
|
-
- Mock server for local testing.
|
|
172
|
-
|
|
173
|
-
### Fixed
|
|
174
|
-
|
|
175
|
-
- The default timeout for polling functions increased from 3s to 10s.
|
|
176
|
-
- Removed restrictions for timeout and interval.
|
|
177
|
-
|
|
178
|
-
[1.0.0-alpha.3]: https://github.com/uploadcare/uploadcare-upload-client/compare/v1.0.0-alpha.2...v1.0.0-alpha.3
|
|
179
|
-
|
|
180
|
-
## [1.0.0-alpha.2]
|
|
181
|
-
|
|
182
|
-
### Changed
|
|
183
|
-
|
|
184
|
-
- The project was moved from Flow notations to TypeScript.
|
|
185
|
-
- The `base` function now returns an object that implements
|
|
186
|
-
`DirectUploadInterface`.
|
|
187
|
-
- The `fileFrom` function now returns an object that implements
|
|
188
|
-
`UploadFromInterface`.
|
|
189
|
-
- The `UCFile` type renamed to `UploadcareFile`.
|
|
190
|
-
- The progress of `fileFrom` now based on the `UploadingProgress` type.
|
|
191
|
-
|
|
192
|
-
### Added
|
|
193
|
-
|
|
194
|
-
- Low-level request wrappers for `/from_url/` and `/from_url/status/`
|
|
195
|
-
paths of Upload API.
|
|
196
|
-
- Settings: the support of setting `baseCDN`, `checkForUrlDuplicates`,
|
|
197
|
-
`saveUrlForRecurrentUploads`.
|
|
198
|
-
|
|
199
|
-
[1.0.0-alpha.2]: https://github.com/uploadcare/uploadcare-upload-client/compare/v1.0.0-alpha.1...v1.0.0-alpha.2
|
|
200
|
-
|
|
201
|
-
## [1.0.0-alpha.1]
|
|
202
|
-
|
|
203
|
-
### Fixed
|
|
204
|
-
|
|
205
|
-
- Use the version from the `package.json` file to create Uploadcare User
|
|
206
|
-
Agent.
|
|
207
|
-
|
|
208
|
-
### Changed
|
|
209
|
-
|
|
210
|
-
- The `base` function returns `thenable` object called `DirectUpload`
|
|
211
|
-
instead of using the `promise` property.
|
|
212
|
-
- The `fileFrom` function returns `thenable` object called `FilePromise`
|
|
213
|
-
instead of using the `promise` property.
|
|
214
|
-
- The `FileInfo` type renamed to `UCFile` and updated.
|
|
215
|
-
- The `FilePromise` resolved with an object of the `UploadcareFile` type.
|
|
216
|
-
- The progress of `fileFrom` now based on the `FilePromiseProgress` type.
|
|
217
|
-
- Updated the `InfoResponse` type.
|
|
218
|
-
|
|
219
|
-
### Added
|
|
220
|
-
|
|
221
|
-
- The `checkFileIsReady` function to check if the file is ready on the CDN.
|
|
222
|
-
- New properties for the object that the `fileFrom` function returns:
|
|
223
|
-
`onUploaded`, `onReady`.
|
|
224
|
-
- The `camelizeKeys` function for inner usage.
|
|
225
|
-
- The `baseCDN` default setting
|
|
226
|
-
|
|
227
|
-
[1.0.0-alpha.1]: https://github.com/uploadcare/uploadcare-upload-client/compare/v1.0.0-alpha...v1.0.0-alpha.1
|
|
228
|
-
|
|
229
|
-
## 1.0.0-alpha
|
|
230
|
-
|
|
231
|
-
The first public alpha release.
|
|
232
|
-
|
|
233
|
-
### Added
|
|
234
|
-
|
|
235
|
-
- The `request` function to request to any path of [Upload API][upload-api].
|
|
236
|
-
- Low-level request wrappers for `/base/` and `/info/` paths of Upload API.
|
|
237
|
-
- `UploadClient` class with settings and `fileFrom` method that supports
|
|
238
|
-
only direct uploads now.
|
|
239
|
-
- Support of following Uploadcare Settings: `publicKey`, `baseUrl`,
|
|
240
|
-
`doNotStore`, `integration`, `secureExpire`, `secureSignature`.
|
|
241
|
-
- Test environment for both Node.js and browsers
|
|
242
|
-
|
|
243
|
-
[upload-api]: https://uploadcare.com/docs/api_reference/upload/
|