@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.
@@ -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
- * File Type Binaries.
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
- * Is Valid.
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":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,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;;OAEG;IACH,cAAc,IAAI,MAAM;IAIxB;;;;OAIG;IACG,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAyB9C"}
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(name: any): boolean;
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,aAAa,CAAC;AAExC,qBAAa,IAAK,SAAQ,SAAS;IAC1B,cAAc,IAAI,MAAM;IAI/B;;;;;;;OAOG;IACI,OAAO,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO;CAGnC"}
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,4 +1,4 @@
1
- import { Validator } from "./validator";
1
+ import { Validator } from "./validator.js";
2
2
  export declare class Upload extends Validator {
3
3
  /**
4
4
  * Get Description
@@ -1 +1 @@
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;IACnC;;OAEG;IACH,cAAc,IAAI,MAAM;IAIxB;;;;;OAKG;IACG,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;CAY/C"}
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": "1.0.0",
4
- "description": "S3-compatible storage library for Nuvix BaaS platform with support for AWS S3, Wasabi, MinIO, and local storage",
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.cjs.js",
7
- "module": "dist/index.esm.js",
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
- "import": "./dist/index.esm.js",
12
- "require": "./dist/index.cjs.js",
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": "rollup -c",
23
- "build:watch": "rollup -c --watch",
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": "jest",
27
- "test:watch": "jest --watch",
28
- "test:coverage": "jest --coverage",
29
- "lint": "eslint src --ext .ts",
30
- "lint:fix": "eslint src --ext .ts --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
- "@rollup/plugin-commonjs": "^28.0.5",
37
- "@rollup/plugin-node-resolve": "^16.0.1",
38
- "@rollup/plugin-typescript": "^12.1.2",
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
- "esm",
62
- "commonjs"
49
+ "bun"
63
50
  ],
64
51
  "author": "",
65
52
  "license": "MIT",
66
53
  "engines": {
67
- "node": ">=16.0.0"
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"