@wxn0brp/db-storage-dir 0.1.3 → 0.1.4
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/action.d.ts +1 -1
- package/dist/action.js +3 -4
- package/dist/version.js +1 -1
- package/package.json +4 -4
package/dist/action.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ export declare class FileActions extends dbActionBase {
|
|
|
34
34
|
/**
|
|
35
35
|
* Add a new entry to the specified database.
|
|
36
36
|
*/
|
|
37
|
-
add({ collection, data
|
|
37
|
+
add({ collection, data }: VQuery): Promise<import("@wxn0brp/db-core/types/arg").Arg>;
|
|
38
38
|
/**
|
|
39
39
|
* Find entries in the specified database based on search criteria.
|
|
40
40
|
*/
|
package/dist/action.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import dbActionBase from "@wxn0brp/db-core/base/actions";
|
|
2
|
-
import
|
|
2
|
+
import { addId } from "@wxn0brp/db-core/helpers/addId";
|
|
3
3
|
import { findUtil } from "@wxn0brp/db-core/utils/action";
|
|
4
4
|
import { existsSync, mkdirSync, promises, statSync } from "fs";
|
|
5
5
|
import { resolve, sep } from "path";
|
|
@@ -73,12 +73,11 @@ export class FileActions extends dbActionBase {
|
|
|
73
73
|
/**
|
|
74
74
|
* Add a new entry to the specified database.
|
|
75
75
|
*/
|
|
76
|
-
async add({ collection, data
|
|
76
|
+
async add({ collection, data }) {
|
|
77
77
|
await this.ensureCollection(arguments[0]);
|
|
78
78
|
const c_path = this._getCollectionPath(collection);
|
|
79
79
|
const file = c_path + await getLastFile(c_path, this.options.maxFileSize);
|
|
80
|
-
|
|
81
|
-
data._id = data._id || gen();
|
|
80
|
+
await addId(arguments[0], this);
|
|
82
81
|
await this.fileCpu.add(file, data);
|
|
83
82
|
return data;
|
|
84
83
|
}
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = "0.1.
|
|
1
|
+
export const version = "0.1.4";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wxn0brp/db-storage-dir",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"author": "wxn0brP",
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
"json5": "^2.2.3"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"@wxn0brp/db-core": ">=0.2.
|
|
19
|
+
"@wxn0brp/db-core": ">=0.2.4"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@types/bun": "*",
|
|
23
|
-
"@wxn0brp/db-core": "^0.2.
|
|
23
|
+
"@wxn0brp/db-core": "^0.2.4",
|
|
24
24
|
"tsc-alias": "*",
|
|
25
25
|
"typescript": "*"
|
|
26
26
|
},
|
|
@@ -39,4 +39,4 @@
|
|
|
39
39
|
"default": "./dist/*.js"
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
}
|
|
42
|
+
}
|