@nuvix/storage 1.0.0 → 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 +141 -275
- package/dist/index.d.ts +14 -470
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/src/device/local.d.ts +28 -10
- package/dist/src/device/local.d.ts.map +1 -1
- package/dist/src/device/minio.d.ts +16 -10
- package/dist/src/device/minio.d.ts.map +1 -1
- package/dist/src/device/s3.d.ts +63 -53
- package/dist/src/device/s3.d.ts.map +1 -1
- package/dist/src/device/wasabi.d.ts +13 -11
- package/dist/src/device/wasabi.d.ts.map +1 -1
- package/dist/src/device.d.ts +74 -102
- package/dist/src/device.d.ts.map +1 -1
- package/dist/src/errors.d.ts +15 -0
- package/dist/src/errors.d.ts.map +1 -0
- package/dist/src/storage.d.ts +23 -36
- package/dist/src/storage.d.ts.map +1 -1
- package/dist/src/validator/file-ext.d.ts +1 -1
- package/dist/src/validator/file-ext.d.ts.map +1 -1
- package/dist/src/validator/file-name.d.ts +1 -1
- package/dist/src/validator/file-name.d.ts.map +1 -1
- package/dist/src/validator/file-size.d.ts +1 -1
- package/dist/src/validator/file-size.d.ts.map +1 -1
- package/dist/src/validator/file-type.d.ts +4 -8
- package/dist/src/validator/file-type.d.ts.map +1 -1
- package/dist/src/validator/file.d.ts +2 -2
- package/dist/src/validator/file.d.ts.map +1 -1
- package/dist/src/validator/upload.d.ts +1 -1
- package/dist/src/validator/upload.d.ts.map +1 -1
- package/package.json +23 -35
- package/dist/index.cjs.js +0 -1296
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.esm.js +0 -1283
- package/dist/index.esm.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Validator } from "./validator";
|
|
1
|
+
import { Validator } from "./validator.js";
|
|
2
2
|
export declare class FileType extends Validator {
|
|
3
3
|
/**
|
|
4
4
|
* File Types Constants.
|
|
@@ -8,19 +8,15 @@ export declare class FileType extends Validator {
|
|
|
8
8
|
static readonly FILE_TYPE_PNG = "png";
|
|
9
9
|
static readonly FILE_TYPE_GZIP = "gz";
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Magic-byte signatures used to identify file content.
|
|
12
12
|
*/
|
|
13
13
|
private readonly types;
|
|
14
14
|
private readonly allowed;
|
|
15
15
|
constructor(allowed: string[]);
|
|
16
|
-
/**
|
|
17
|
-
* Get Description
|
|
18
|
-
*/
|
|
19
16
|
getDescription(): string;
|
|
20
17
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* Binary check to finds whether a file is of valid type
|
|
18
|
+
* Binary signature check: reads only the first few bytes of the file
|
|
19
|
+
* (via Bun.file slice) instead of loading the whole file into memory.
|
|
24
20
|
*/
|
|
25
21
|
isValid(path: string): Promise<boolean>;
|
|
26
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-type.d.ts","sourceRoot":"","sources":["../../../src/validator/file-type.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"file-type.d.ts","sourceRoot":"","sources":["../../../src/validator/file-type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,qBAAa,QAAS,SAAQ,SAAS;IACrC;;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,cAAc,IAAI,MAAM;IAIxB;;;OAGG;IACG,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAkB9C"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Validator } from "./validator";
|
|
1
|
+
import { Validator } from "./validator.js";
|
|
2
2
|
export declare class File extends Validator {
|
|
3
3
|
getDescription(): string;
|
|
4
4
|
/**
|
|
@@ -9,6 +9,6 @@ export declare class File extends Validator {
|
|
|
9
9
|
* @param name
|
|
10
10
|
* @return boolean
|
|
11
11
|
*/
|
|
12
|
-
isValid(
|
|
12
|
+
isValid(_name: any): boolean;
|
|
13
13
|
}
|
|
14
14
|
//# sourceMappingURL=file.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../src/validator/file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../src/validator/file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,qBAAa,IAAK,SAAQ,SAAS;IAC1B,cAAc,IAAI,MAAM;IAI/B;;;;;;;OAOG;IACI,OAAO,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO;CAGpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../../src/validator/upload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../../src/validator/upload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAG3C,qBAAa,MAAO,SAAQ,SAAS;IACnC;;OAEG;IACH,cAAc,IAAI,MAAM;IAIxB;;;;;OAKG;IACG,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;CAY/C"}
|
package/package.json
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuvix/storage",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "S3-compatible storage library for Nuvix BaaS platform
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "S3-compatible storage library for the Nuvix BaaS platform, built on Bun's native APIs. Supports AWS S3, Wasabi, MinIO, and local storage.",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "dist/index.
|
|
7
|
-
"module": "dist/index.
|
|
8
|
-
"types": "dist/index.d.ts",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"types": "./dist/index.d.ts"
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
14
13
|
}
|
|
15
14
|
},
|
|
16
15
|
"files": [
|
|
@@ -19,34 +18,23 @@
|
|
|
19
18
|
"LICENSE"
|
|
20
19
|
],
|
|
21
20
|
"scripts": {
|
|
22
|
-
"build": "
|
|
23
|
-
"build:
|
|
21
|
+
"build": "bun run build:js && bun run build:types",
|
|
22
|
+
"build:js": "bun build ./index.ts --outdir dist --target bun --format esm --minify",
|
|
23
|
+
"build:types": "tsc --project tsconfig.build.json",
|
|
24
24
|
"clean": "rm -rf dist",
|
|
25
25
|
"prepublishOnly": "bun run clean && bun run build",
|
|
26
|
-
"test": "
|
|
27
|
-
"test:watch": "
|
|
28
|
-
"test:coverage": "
|
|
29
|
-
"lint": "
|
|
30
|
-
"lint:fix": "
|
|
31
|
-
|
|
32
|
-
"dependencies": {
|
|
33
|
-
"xml2js": "^0.6.2"
|
|
26
|
+
"test": "bun test",
|
|
27
|
+
"test:watch": "bun test --watch",
|
|
28
|
+
"test:coverage": "bun test --coverage",
|
|
29
|
+
"lint": "oxlint src __tests__ index.ts",
|
|
30
|
+
"lint:fix": "oxlint src __tests__ index.ts --fix",
|
|
31
|
+
"typecheck": "tsc --noEmit"
|
|
34
32
|
},
|
|
33
|
+
"dependencies": {},
|
|
35
34
|
"devDependencies": {
|
|
36
|
-
"@
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"@types/jest": "^29.5.0",
|
|
40
|
-
"@types/node": "^18.15.11",
|
|
41
|
-
"@types/xml2js": "^0.4.14",
|
|
42
|
-
"@typescript-eslint/eslint-plugin": "^5.59.0",
|
|
43
|
-
"@typescript-eslint/parser": "^5.59.0",
|
|
44
|
-
"eslint": "^8.38.0",
|
|
45
|
-
"jest": "^29.5.0",
|
|
46
|
-
"rollup": "^4.43.0",
|
|
47
|
-
"rollup-plugin-dts": "^6.2.1",
|
|
48
|
-
"ts-jest": "^29.1.0",
|
|
49
|
-
"typescript": "^5.0.4"
|
|
35
|
+
"@types/bun": "^1.2.0",
|
|
36
|
+
"oxlint": "^1.0.0",
|
|
37
|
+
"typescript": "^5.6.0"
|
|
50
38
|
},
|
|
51
39
|
"keywords": [
|
|
52
40
|
"nuvix",
|
|
@@ -58,19 +46,19 @@
|
|
|
58
46
|
"cloud-storage",
|
|
59
47
|
"file-upload",
|
|
60
48
|
"typescript",
|
|
61
|
-
"
|
|
62
|
-
"commonjs"
|
|
49
|
+
"bun"
|
|
63
50
|
],
|
|
64
51
|
"author": "",
|
|
65
52
|
"license": "MIT",
|
|
66
53
|
"engines": {
|
|
67
|
-
"
|
|
54
|
+
"bun": ">=1.2.0"
|
|
68
55
|
},
|
|
69
56
|
"repository": {
|
|
70
57
|
"type": "git",
|
|
71
58
|
"url": "https://github.com/nuvix-tech/storage.git"
|
|
72
59
|
},
|
|
73
60
|
"bugs": {
|
|
61
|
+
"type": "git",
|
|
74
62
|
"url": "https://github.com/nuvix-tech/storage/issues"
|
|
75
63
|
},
|
|
76
64
|
"homepage": "https://github.com/nuvix-tech/storage#readme"
|