@wxn0brp/db-storage-bin 0.90.0 → 0.100.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/dist/actions.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { CustomActionsBase } from "@wxn0brp/db-core/base/custom";
2
2
  import { DbOpts } from "@wxn0brp/db-core/types/options";
3
- import { VQuery } from "@wxn0brp/db-core/types/query";
4
3
  import { BinManager } from "./bin/index.js";
5
4
  export declare class BinFileAction extends CustomActionsBase {
6
5
  private mgr;
@@ -21,13 +20,13 @@ export declare class BinFileAction extends CustomActionsBase {
21
20
  /**
22
21
  * Check and create the specified collection if it doesn't exist.
23
22
  */
24
- ensureCollection({ collection }: VQuery): Promise<boolean>;
23
+ ensureCollection(collection: string): Promise<boolean>;
25
24
  /**
26
25
  * Check if a collection exists.
27
26
  */
28
- issetCollection({ collection }: VQuery): Promise<boolean>;
27
+ issetCollection(collection: string): Promise<boolean>;
29
28
  /**
30
29
  * Removes a database collection from the file system.
31
30
  */
32
- removeCollection({ collection }: VQuery): Promise<boolean>;
31
+ removeCollection(collection: string): Promise<boolean>;
33
32
  }
package/dist/actions.js CHANGED
@@ -28,7 +28,7 @@ export class BinFileAction extends CustomActionsBase {
28
28
  /**
29
29
  * Check and create the specified collection if it doesn't exist.
30
30
  */
31
- async ensureCollection({ collection }) {
31
+ async ensureCollection(collection) {
32
32
  if (await this.issetCollection(arguments[0]))
33
33
  return;
34
34
  await this.mgr.write(collection, []);
@@ -37,14 +37,14 @@ export class BinFileAction extends CustomActionsBase {
37
37
  /**
38
38
  * Check if a collection exists.
39
39
  */
40
- async issetCollection({ collection }) {
40
+ async issetCollection(collection) {
41
41
  const collections = await this.getCollections();
42
42
  return collections.includes(collection);
43
43
  }
44
44
  /**
45
45
  * Removes a database collection from the file system.
46
46
  */
47
- async removeCollection({ collection }) {
47
+ async removeCollection(collection) {
48
48
  await this.mgr.removeCollection(collection);
49
49
  return true;
50
50
  }
package/dist/index.d.ts CHANGED
@@ -8,3 +8,6 @@ export declare function createBinValthera(path: string, opts?: Partial<Options>,
8
8
  actions: BinFileAction;
9
9
  mgr: BinManager;
10
10
  }>;
11
+ export declare const DYNAMIC: {
12
+ bin(path: string, opts?: Partial<Options>): Promise<BinFileAction>;
13
+ };
package/dist/index.js CHANGED
@@ -15,3 +15,11 @@ export async function createBinValthera(path, opts = {}, init = true) {
15
15
  mgr,
16
16
  };
17
17
  }
18
+ export const DYNAMIC = {
19
+ async bin(path, opts = {}) {
20
+ const mgr = new BinManager(path, opts);
21
+ const actions = new BinFileAction(mgr);
22
+ await actions.init();
23
+ return actions;
24
+ }
25
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wxn0brp/db-storage-bin",
3
- "version": "0.90.0",
3
+ "version": "0.100.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "author": "wxn0brP",
@@ -18,16 +18,16 @@
18
18
  "vdb-adapter"
19
19
  ],
20
20
  "devDependencies": {
21
- "@types/node": "*",
22
- "@wxn0brp/db-core": "~0.9.0",
23
- "tsc-alias": "*",
24
- "typescript": "*"
21
+ "@types/bun": "*",
22
+ "@wxn0brp/db-core": "^0.10.3",
23
+ "tsc-alias": "^1",
24
+ "typescript": "^6"
25
25
  },
26
26
  "dependencies": {
27
27
  "@msgpack/msgpack": "^3.1.3"
28
28
  },
29
29
  "peerDependencies": {
30
- "@wxn0brp/db-core": "~0.9.0"
30
+ "@wxn0brp/db-core": "^0.10.3"
31
31
  },
32
32
  "files": [
33
33
  "dist"
package/dist/version.js DELETED
@@ -1 +0,0 @@
1
- export const version = "0.90.0";