@nuvix/storage 0.1.0 → 1.0.1
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 +125 -68
- package/dist/index.cjs +7375 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +469 -0
- package/dist/index.d.ts +38 -88
- package/dist/index.js +7360 -0
- package/dist/index.js.map +1 -0
- package/package.json +18 -23
- package/dist/index.cjs.js +0 -1270
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.esm.js +0 -1258
- package/dist/index.esm.js.map +0 -1
- package/dist/src/device/local.d.ts +0 -31
- package/dist/src/device/local.d.ts.map +0 -1
- package/dist/src/device/s3.d.ts +0 -89
- package/dist/src/device/s3.d.ts.map +0 -1
- package/dist/src/device/wasabi.d.ts +0 -24
- package/dist/src/device/wasabi.d.ts.map +0 -1
- package/dist/src/device.d.ts +0 -146
- package/dist/src/device.d.ts.map +0 -1
- package/dist/src/storage.d.ts +0 -56
- package/dist/src/storage.d.ts.map +0 -1
- package/dist/src/validator/file-ext.d.ts +0 -17
- package/dist/src/validator/file-ext.d.ts.map +0 -1
- package/dist/src/validator/file-name.d.ts +0 -31
- package/dist/src/validator/file-name.d.ts.map +0 -1
- package/dist/src/validator/file-size.d.ts +0 -29
- package/dist/src/validator/file-size.d.ts.map +0 -1
- package/dist/src/validator/file-type.d.ts +0 -35
- package/dist/src/validator/file-type.d.ts.map +0 -1
- package/dist/src/validator/file.d.ts +0 -30
- package/dist/src/validator/file.d.ts.map +0 -1
- package/dist/src/validator/upload.d.ts +0 -31
- package/dist/src/validator/upload.d.ts.map +0 -1
- package/dist/src/validator/validator.d.ts +0 -8
- package/dist/src/validator/validator.d.ts.map +0 -1
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Validator } from './validator';
|
|
2
|
-
export declare class FileName extends Validator {
|
|
3
|
-
/**
|
|
4
|
-
* Get Description
|
|
5
|
-
*/
|
|
6
|
-
getDescription(): string;
|
|
7
|
-
/**
|
|
8
|
-
* The file name can only contain "a-z", "A-Z", "0-9" and "." and not empty.
|
|
9
|
-
*
|
|
10
|
-
* @param name - The filename to validate
|
|
11
|
-
* @returns boolean indicating if the filename is valid
|
|
12
|
-
*/
|
|
13
|
-
isValid(name: any): boolean;
|
|
14
|
-
/**
|
|
15
|
-
* Is array
|
|
16
|
-
*
|
|
17
|
-
* Function will return true if object is array.
|
|
18
|
-
*
|
|
19
|
-
* @returns boolean
|
|
20
|
-
*/
|
|
21
|
-
isArray(): boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Get Type
|
|
24
|
-
*
|
|
25
|
-
* Returns validator type.
|
|
26
|
-
*
|
|
27
|
-
* @returns string
|
|
28
|
-
*/
|
|
29
|
-
getType(): string;
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=file-name.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-name.d.ts","sourceRoot":"","sources":["../../../src/validator/file-name.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,qBAAa,QAAS,SAAQ,SAAS;IACnC;;OAEG;IACH,cAAc,IAAI,MAAM;IAIxB;;;;;OAKG;IACH,OAAO,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO;IAgB3B;;;;;;OAMG;IACH,OAAO,IAAI,OAAO;IAIlB;;;;;;OAMG;IACH,OAAO,IAAI,MAAM;CAGpB"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Validator } from './validator';
|
|
2
|
-
export declare class FileSize extends Validator {
|
|
3
|
-
private max;
|
|
4
|
-
/**
|
|
5
|
-
* Max size in bytes
|
|
6
|
-
*/
|
|
7
|
-
constructor(max: number);
|
|
8
|
-
/**
|
|
9
|
-
* Get Description
|
|
10
|
-
*/
|
|
11
|
-
getDescription(): string;
|
|
12
|
-
/**
|
|
13
|
-
* Finds whether a file size is smaller than required limit.
|
|
14
|
-
*/
|
|
15
|
-
isValid(fileSize: any): boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Is array
|
|
18
|
-
*
|
|
19
|
-
* Function will return true if object is array.
|
|
20
|
-
*/
|
|
21
|
-
isArray(): boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Get Type
|
|
24
|
-
*
|
|
25
|
-
* Returns validator type.
|
|
26
|
-
*/
|
|
27
|
-
getType(): string;
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=file-size.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-size.d.ts","sourceRoot":"","sources":["../../../src/validator/file-size.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,qBAAa,QAAS,SAAQ,SAAS;IACnC,OAAO,CAAC,GAAG,CAAS;IAEpB;;OAEG;gBACS,GAAG,EAAE,MAAM;IAKvB;;OAEG;IACH,cAAc,IAAI,MAAM;IAIxB;;OAEG;IACH,OAAO,CAAC,QAAQ,EAAE,GAAG,GAAG,OAAO;IAY/B;;;;OAIG;IACH,OAAO,IAAI,OAAO;IAIlB;;;;OAIG;IACH,OAAO,IAAI,MAAM;CAGpB"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { Validator } from './validator';
|
|
2
|
-
export declare class FileType extends Validator {
|
|
3
|
-
/**
|
|
4
|
-
* File Types Constants.
|
|
5
|
-
*/
|
|
6
|
-
static readonly FILE_TYPE_JPEG = "jpeg";
|
|
7
|
-
static readonly FILE_TYPE_GIF = "gif";
|
|
8
|
-
static readonly FILE_TYPE_PNG = "png";
|
|
9
|
-
static readonly FILE_TYPE_GZIP = "gz";
|
|
10
|
-
/**
|
|
11
|
-
* File Type Binaries.
|
|
12
|
-
*/
|
|
13
|
-
private readonly types;
|
|
14
|
-
private readonly allowed;
|
|
15
|
-
constructor(allowed: string[]);
|
|
16
|
-
/**
|
|
17
|
-
* Get Description
|
|
18
|
-
*/
|
|
19
|
-
getDescription(): string;
|
|
20
|
-
/**
|
|
21
|
-
* Is Valid.
|
|
22
|
-
*
|
|
23
|
-
* Binary check to finds whether a file is of valid type
|
|
24
|
-
*/
|
|
25
|
-
isValid(path: string): Promise<boolean>;
|
|
26
|
-
/**
|
|
27
|
-
* Is array
|
|
28
|
-
*/
|
|
29
|
-
isArray(): boolean;
|
|
30
|
-
/**
|
|
31
|
-
* Get Type
|
|
32
|
-
*/
|
|
33
|
-
getType(): string;
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=file-type.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-type.d.ts","sourceRoot":"","sources":["../../../src/validator/file-type.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,qBAAa,QAAS,SAAQ,SAAS;IACnC;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,cAAc,UAAU;IACxC,MAAM,CAAC,QAAQ,CAAC,aAAa,SAAS;IACtC,MAAM,CAAC,QAAQ,CAAC,aAAa,SAAS;IACtC,MAAM,CAAC,QAAQ,CAAC,cAAc,QAAQ;IAEtC;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,KAAK,CAKpB;IAEF,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAW;gBAEvB,OAAO,EAAE,MAAM,EAAE;IAY7B;;OAEG;IACH,cAAc,IAAI,MAAM;IAIxB;;;;OAIG;IACG,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAiB7C;;OAEG;IACH,OAAO,IAAI,OAAO;IAIlB;;OAEG;IACH,OAAO,IAAI,MAAM;CAGpB"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Validator } from "./validator";
|
|
2
|
-
export declare class File extends Validator {
|
|
3
|
-
getDescription(): string;
|
|
4
|
-
/**
|
|
5
|
-
* NOT MUCH RIGHT NOW.
|
|
6
|
-
*
|
|
7
|
-
* TODO think what to do here, currently only used for parameter to be present in SDKs
|
|
8
|
-
*
|
|
9
|
-
* @param name
|
|
10
|
-
* @return boolean
|
|
11
|
-
*/
|
|
12
|
-
isValid(name: any): boolean;
|
|
13
|
-
/**
|
|
14
|
-
* Is array
|
|
15
|
-
*
|
|
16
|
-
* Function will return true if object is array.
|
|
17
|
-
*
|
|
18
|
-
* @return boolean
|
|
19
|
-
*/
|
|
20
|
-
isArray(): boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Get Type
|
|
23
|
-
*
|
|
24
|
-
* Returns validator type.
|
|
25
|
-
*
|
|
26
|
-
* @return string
|
|
27
|
-
*/
|
|
28
|
-
getType(): string;
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=file.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../src/validator/file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,qBAAa,IAAK,SAAQ,SAAS;IACxB,cAAc,IAAI,MAAM;IAI/B;;;;;;;OAOG;IACI,OAAO,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO;IAIlC;;;;;;OAMG;IACI,OAAO,IAAI,OAAO;IAIzB;;;;;;OAMG;IACI,OAAO,IAAI,MAAM;CAG3B"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Validator } from "./validator";
|
|
2
|
-
export declare class Upload extends Validator {
|
|
3
|
-
/**
|
|
4
|
-
* Get Description
|
|
5
|
-
*/
|
|
6
|
-
getDescription(): string;
|
|
7
|
-
/**
|
|
8
|
-
* Check if a file is a valid upload file
|
|
9
|
-
*
|
|
10
|
-
* @param path - The file path to validate
|
|
11
|
-
* @returns Promise that resolves to true if valid upload file, false otherwise
|
|
12
|
-
*/
|
|
13
|
-
isValid(path: unknown): Promise<boolean>;
|
|
14
|
-
/**
|
|
15
|
-
* Is array
|
|
16
|
-
*
|
|
17
|
-
* Function will return true if object is array.
|
|
18
|
-
*
|
|
19
|
-
* @returns false - this validator doesn't handle arrays
|
|
20
|
-
*/
|
|
21
|
-
isArray(): boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Get Type
|
|
24
|
-
*
|
|
25
|
-
* Returns validator type.
|
|
26
|
-
*
|
|
27
|
-
* @returns The validator type
|
|
28
|
-
*/
|
|
29
|
-
getType(): string;
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=upload.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../../src/validator/upload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,qBAAa,MAAO,SAAQ,SAAS;IACjC;;OAEG;IACH,cAAc,IAAI,MAAM;IAIxB;;;;;OAKG;IACG,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAa9C;;;;;;OAMG;IACH,OAAO,IAAI,OAAO;IAIlB;;;;;;OAMG;IACH,OAAO,IAAI,MAAM;CAGpB"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare abstract class Validator {
|
|
2
|
-
static TYPE_STRING: string;
|
|
3
|
-
static TYPE_ARRAY: string;
|
|
4
|
-
static TYPE_INTEGER: string;
|
|
5
|
-
static TYPE_BOOLEAN: string;
|
|
6
|
-
abstract isValid(value: any): boolean | Promise<boolean>;
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=validator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../../../src/validator/validator.ts"],"names":[],"mappings":"AACA,8BAAsB,SAAS;IAC3B,MAAM,CAAC,WAAW,SAAY;IAC9B,MAAM,CAAC,UAAU,SAAW;IAC5B,MAAM,CAAC,YAAY,SAAa;IAChC,MAAM,CAAC,YAAY,SAAa;IAEhC,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;CAC3D"}
|