Skip to content

Commit 4cf82e7

Browse files
authored
feat(validation): add all supported regions to validation (#233)
* feat(validation): add all supported regions to validation * feat(pickerOptions): Add errorsTimeout to picker options * refactor(deps): bump dev deps * fix(pickerOptions): Remove maximum value for maxSize param
1 parent 033e1bb commit 4cf82e7

8 files changed

+992
-478
lines changed

package-lock.json

+962-455
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+15-16
Original file line numberDiff line numberDiff line change
@@ -46,24 +46,23 @@
4646
"isutf8": "^2.0.3",
4747
"jsonschema": "^1.2.4",
4848
"p-queue": "^4.0.0",
49-
"prettier-tslint": "^0.4.2",
5049
"spark-md5": "^3.0.0",
5150
"ts-node": "^8.1.0",
5251
"tslib": "^1.9.3"
5352
},
5453
"devDependencies": {
55-
"@babel/core": "^7.4.4",
56-
"@babel/preset-env": "^7.4.4",
54+
"@babel/core": "^7.4.5",
55+
"@babel/preset-env": "^7.4.5",
5756
"@purtuga/esm-webpack-plugin": "^1.0.1",
58-
"@types/jest": "^24.0.12",
57+
"@types/jest": "^24.0.13",
5958
"@types/mime": "^2.0.1",
60-
"@types/node": "^12.0.0",
59+
"@types/node": "^12.0.4",
6160
"@types/spark-md5": "^3.0.1",
6261
"@types/uuid": "^3.4.4",
63-
"aws-sdk": "^2.451.0",
64-
"babel-loader": "^8.0.5",
65-
"clean-webpack-plugin": "^2.0.2",
66-
"codecov": "^3.3.0",
62+
"aws-sdk": "^2.466.0",
63+
"babel-loader": "^8.0.6",
64+
"clean-webpack-plugin": "^3.0.0",
65+
"codecov": "^3.5.0",
6766
"compression-webpack-plugin": "^2.0.0",
6867
"del": "^4.1.1",
6968
"dotenv": "^8.0.0",
@@ -79,25 +78,25 @@
7978
"jest-localstorage-mock": "^2.4.0",
8079
"jest-mock": "^24.8.0",
8180
"js-yaml": "^3.13.1",
82-
"jsdom": "^15.0.0",
81+
"jsdom": "^15.1.1",
8382
"lodash.clonedeep": "^4.5.0",
8483
"lodash.merge": "^4.6.1",
8584
"nock": "^10.0.6",
86-
"opn-cli": "^4.1.0",
87-
"prettier": "^1.17.0",
85+
"opn-cli": "^5.0.0",
86+
"prettier": "^1.17.1",
8887
"prettier-tslint": "^0.4.2",
8988
"standard-version": "^6.0.1",
90-
"trash-cli": "^2.0.0",
89+
"trash-cli": "^3.0.0",
9190
"ts-jest": "^24.0.2",
92-
"tslint": "^5.16.0",
91+
"tslint": "^5.17.0",
9392
"tslint-config-semistandard": "^8.0.0",
9493
"typedoc": "^0.14.2",
9594
"typescript": "^3.4.5",
9695
"validate-commit-msg": "^2.14.0",
97-
"webpack": "^4.30.0",
96+
"webpack": "^4.32.2",
9897
"webpack-assets-manifest": "^3.1.1",
9998
"webpack-bundle-analyzer": "^3.3.2",
100-
"webpack-cli": "^3.3.1",
99+
"webpack-cli": "^3.3.2",
101100
"webpack-node-externals": "^1.7.2",
102101
"webpack-subresource-integrity": "^1.3.2"
103102
},

releases/filestack-js-3.0.0-relase.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
height: 480,
6767
}
6868
);
69-
}.catch(e: FilestackError => {
69+
}.catch(e: FilestackError) {
7070
console.log(e.message);
7171
console.log(e.details); // detailed validation errors
7272
})
@@ -80,7 +80,7 @@
8080
wrongPickerOption: true
8181
})
8282
.open();
83-
}.catch(e: FilestackError => {
83+
}.catch(e: FilestackError) {
8484
console.log(e.message);
8585
console.log(e.details); // detailed validation errors
8686
})

src/lib/client.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ export class Client extends EventEmitter {
362362
* token.resume(); // Resume flow
363363
* token.cancel(); // Cancel flow (rejects)
364364
* ```
365-
* @param file Must be a valid [File | Blob | Buffer | string]
365+
* @param {InputFile} file Must be a valid [File | Blob | Buffer | string]
366366
* @param uploadOptions Uploader options.
367367
* @param storeOptions Storage options.
368368
* @param token A control token that can be used to call cancel(), pause(), and resume().
@@ -413,7 +413,7 @@ export class Client extends EventEmitter {
413413
* token.resume(); // Resume flow
414414
* token.cancel(); // Cancel flow (rejects)
415415
* ```
416-
* @param file Must be a valid [File | Blob | Buffer | string (base64)]
416+
* @param {InputFile[]} file Must be a valid [File | Blob | Buffer | string (base64)]
417417
* @param uploadOptions Upload options.
418418
* @param storeOptions Storage options.
419419
* @param token A control token that can be used to call cancel(), pause(), and resume().

src/lib/picker.ts

+5
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,11 @@ export interface PickerOptions {
521521
* Default view type option for file browser
522522
*/
523523
viewType?: 'grid' | 'list';
524+
525+
/**
526+
* Timeout for error messages
527+
*/
528+
errorsTimeout?: number;
524529
/**
525530
* Specify [width, height] in pixels of the desktop modal.
526531
*/

src/schema/definitions.schema.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export const DefinitionsSchema = {
6262
regionsDef: {
6363
id: '/regionsDef',
6464
type: 'string',
65-
enum: ['us-east-1', 'us-west-1', 'us-west-2', 'eu-west-1', 'eu-central-1', 'ap-northeast-1', 'ap-northeast-2', 'ap-southeast-1', 'ap-southeast-2', 'sa-east-1'],
65+
enum: ['us-east-1', 'us-east-2', 'us-west-1', 'us-west-2', 'eu-west-1', 'eu-west-2', 'eu-west-3', 'eu-central-1', 'ap-northeast-1', 'ap-northeast-2', 'ap-northeast-3', 'ap-southeast-1', 'ap-southeast-2', 'ap-south-1', 'sa-east-1'],
6666
},
6767
locationsDef: {
6868
id: '/locationsDef',

src/schema/picker.schema.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ export const PickerParamsSchema = {
186186
maxSize: {
187187
type: 'integer',
188188
minimum: 1,
189-
maximum: 1000000,
190189
},
191190
modalSize: {
192191
type: 'array',
@@ -384,5 +383,9 @@ export const PickerParamsSchema = {
384383
additionalProperties: false,
385384
properties: UploadParamsSchema.properties,// manual import upload definitions
386385
},
386+
errorsTimeout: {
387+
type: 'number',
388+
minimum: 0,
389+
},
387390
},
388391
};

webpack.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const path = require('path');
44
const fs = require('fs');
55
const EsmWebpackPlugin = require('@purtuga/esm-webpack-plugin');
66
const merge = require('lodash.merge');
7-
const CleanWebpackPlugin = require('clean-webpack-plugin');
7+
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
88
const WebpackAssetsManifest = require('webpack-assets-manifest');
99
const banner = fs.readFileSync('./LICENSE', 'utf8').replace('{year}', new Date().getFullYear());
1010

0 commit comments

Comments
 (0)