@koishijs/plugin-database-mongo 3.3.2 → 3.4.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/lib/index.d.ts +9 -6
- package/lib/index.js +6 -20
- package/lib/index.js.map +2 -2
- package/package.json +3 -3
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
declare const _default: import("koishi").Plugin.Object<{
|
|
2
|
+
protocol?: string;
|
|
3
|
+
host?: string;
|
|
4
|
+
port?: number;
|
|
5
|
+
username?: string;
|
|
6
|
+
password?: string;
|
|
7
|
+
database?: string;
|
|
8
|
+
} & import("koishi").Dict<any, string>, any>;
|
|
9
|
+
export default _default;
|
package/lib/index.js
CHANGED
|
@@ -5,11 +5,10 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
9
8
|
var __export = (target, all) => {
|
|
10
9
|
__markAsModule(target);
|
|
11
|
-
for (var
|
|
12
|
-
__defProp(target,
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
13
12
|
};
|
|
14
13
|
var __reExport = (target, module2, desc) => {
|
|
15
14
|
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
@@ -25,31 +24,18 @@ var __toModule = (module2) => {
|
|
|
25
24
|
|
|
26
25
|
// plugins/database/mongo/src/index.ts
|
|
27
26
|
__export(exports, {
|
|
28
|
-
|
|
29
|
-
apply: () => apply,
|
|
30
|
-
name: () => name
|
|
27
|
+
default: () => src_default
|
|
31
28
|
});
|
|
32
29
|
var import_koishi = __toModule(require("koishi"));
|
|
33
30
|
var import_driver_mongo = __toModule(require("@minatojs/driver-mongo"));
|
|
34
|
-
var
|
|
35
|
-
var Config = import_koishi.Schema.object({
|
|
31
|
+
var src_default = (0, import_koishi.defineDriver)(import_driver_mongo.default, import_koishi.Schema.object({
|
|
36
32
|
protocol: import_koishi.Schema.string().description("要使用的协议名。").default("mongodb"),
|
|
37
33
|
host: import_koishi.Schema.string().description("要连接到的主机名。").default("localhost"),
|
|
38
34
|
port: import_koishi.Schema.natural().max(65535).description("要连接到的端口号。"),
|
|
39
35
|
username: import_koishi.Schema.string().description("要使用的用户名。"),
|
|
40
36
|
password: import_koishi.Schema.string().description("要使用的密码。").role("secret"),
|
|
41
37
|
database: import_koishi.Schema.string().description("要访问的数据库名。").default("koishi")
|
|
42
|
-
});
|
|
43
|
-
function apply(ctx, config) {
|
|
44
|
-
const driver = new import_driver_mongo.default(ctx.model, config);
|
|
45
|
-
ctx.on("ready", () => driver.start());
|
|
46
|
-
ctx.on("dispose", () => driver.stop());
|
|
47
|
-
}
|
|
48
|
-
__name(apply, "apply");
|
|
38
|
+
}));
|
|
49
39
|
// Annotate the CommonJS export names for ESM import in node:
|
|
50
|
-
0 && (module.exports = {
|
|
51
|
-
Config,
|
|
52
|
-
apply,
|
|
53
|
-
name
|
|
54
|
-
});
|
|
40
|
+
0 && (module.exports = {});
|
|
55
41
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["import {
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import { defineDriver, Schema } from 'koishi'\nimport MongoDriver from '@minatojs/driver-mongo'\n\nexport default defineDriver(MongoDriver, Schema.object({\n protocol: Schema.string().description('要使用的协议名。').default('mongodb'),\n host: Schema.string().description('要连接到的主机名。').default('localhost'),\n port: Schema.natural().max(65535).description('要连接到的端口号。'),\n username: Schema.string().description('要使用的用户名。'),\n password: Schema.string().description('要使用的密码。').role('secret'),\n database: Schema.string().description('要访问的数据库名。').default('koishi'),\n}))\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,oBAAqC;AACrC,0BAAwB;AAExB,IAAO,cAAQ,gCAAa,6BAAa,qBAAO,OAAO;AAAA,EACrD,UAAU,qBAAO,SAAS,YAAY,YAAY,QAAQ;AAAA,EAC1D,MAAM,qBAAO,SAAS,YAAY,aAAa,QAAQ;AAAA,EACvD,MAAM,qBAAO,UAAU,IAAI,OAAO,YAAY;AAAA,EAC9C,UAAU,qBAAO,SAAS,YAAY;AAAA,EACtC,UAAU,qBAAO,SAAS,YAAY,WAAW,KAAK;AAAA,EACtD,UAAU,qBAAO,SAAS,YAAY,aAAa,QAAQ;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@koishijs/plugin-database-mongo",
|
|
3
3
|
"description": "MongoDB support for Koishi",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.4.0",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"koishi": "^4.7.
|
|
44
|
+
"koishi": "^4.7.5"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@minatojs/driver-mongo": "^1.
|
|
47
|
+
"@minatojs/driver-mongo": "^1.2.0"
|
|
48
48
|
}
|
|
49
49
|
}
|