@koishijs/plugin-database-mongo 4.8.1 → 4.9.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/lib/index.js +11 -2
- package/lib/index.js.map +1 -1
- package/package.json +5 -5
- package/src/index.ts +9 -0
- package/src/locales/en-US.yml +13 -3
- package/src/locales/zh-CN.yml +10 -0
package/lib/index.js
CHANGED
|
@@ -22,7 +22,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
22
22
|
// koishi/plugins/database/mongo/src/locales/zh-CN.yml
|
|
23
23
|
var require_zh_CN = __commonJS({
|
|
24
24
|
"koishi/plugins/database/mongo/src/locales/zh-CN.yml"(exports, module2) {
|
|
25
|
-
module2.exports = { protocol: "要使用的协议名。", host: "要连接到的主机名。", port: "要连接到的端口号。", username: "要使用的用户名。", password: "要使用的密码。", database: "要访问的数据库名。" };
|
|
25
|
+
module2.exports = { protocol: "要使用的协议名。", host: "要连接到的主机名。", port: "要连接到的端口号。", username: "要使用的用户名。", password: "要使用的密码。", database: "要访问的数据库名。", writeConcern: { $description: "Write Concern", w: { $description: "The write concern.", $value: ["Default", "Custom", "Majority"] }, wtimeoutMS: "The write concern timeout.", journal: "The journal write concern." } };
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
28
|
|
|
@@ -40,7 +40,16 @@ var src_default = (0, import_koishi.defineDriver)(import_driver_mongo.MongoDrive
|
|
|
40
40
|
port: import_koishi.Schema.natural().max(65535),
|
|
41
41
|
username: import_koishi.Schema.string(),
|
|
42
42
|
password: import_koishi.Schema.string().role("secret"),
|
|
43
|
-
database: import_koishi.Schema.string().default("koishi")
|
|
43
|
+
database: import_koishi.Schema.string().default("koishi"),
|
|
44
|
+
writeConcern: import_koishi.Schema.object({
|
|
45
|
+
w: import_koishi.Schema.union([
|
|
46
|
+
import_koishi.Schema.const(void 0),
|
|
47
|
+
import_koishi.Schema.number().required(),
|
|
48
|
+
import_koishi.Schema.const("majority").required()
|
|
49
|
+
]),
|
|
50
|
+
wtimeoutMS: import_koishi.Schema.number(),
|
|
51
|
+
journal: import_koishi.Schema.boolean()
|
|
52
|
+
})
|
|
44
53
|
}).i18n({
|
|
45
54
|
"zh-CN": require_zh_CN()
|
|
46
55
|
}));
|
package/lib/index.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/locales/zh-CN.yml", "../src/index.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,iEAAAA,SAAA;AAAA,IAAAA,QAAA,YAAC,UAAW,YAAW,MAAO,aAAY,MAAO,aAAY,UAAW,YAAW,UAAW,WAAU,UAAW,
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,iEAAAA,SAAA;AAAA,IAAAA,QAAA,YAAC,UAAW,YAAW,MAAO,aAAY,MAAO,aAAY,UAAW,YAAW,UAAW,WAAU,UAAW,aAAY,cAAe,EAAC,cAAe,iBAAgB,GAAI,EAAC,cAAe,sBAAqB,QAAS,CAAC,WAAU,UAAS,UAAU,EAAC,GAAE,YAAa,8BAA6B,SAAU,6BAA4B,EAAC;AAAA;AAAA;;;ACAlV;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAqC;AACrC,0BAA4B;AAE5B,IAAO,kBAAQ,4BAAa,iCAAa,qBAAO,OAAO;AAAA,EACrD,UAAU,qBAAO,OAAO,EAAE,QAAQ,SAAS;AAAA,EAC3C,MAAM,qBAAO,OAAO,EAAE,QAAQ,WAAW;AAAA,EACzC,MAAM,qBAAO,QAAQ,EAAE,IAAI,KAAK;AAAA,EAChC,UAAU,qBAAO,OAAO;AAAA,EACxB,UAAU,qBAAO,OAAO,EAAE,KAAK,QAAQ;AAAA,EACvC,UAAU,qBAAO,OAAO,EAAE,QAAQ,QAAQ;AAAA,EAC1C,cAAc,qBAAO,OAAO;AAAA,IAC1B,GAAG,qBAAO,MAAM;AAAA,MACd,qBAAO,MAAM,MAAS;AAAA,MACtB,qBAAO,OAAO,EAAE,SAAS;AAAA,MACzB,qBAAO,MAAM,UAAU,EAAE,SAAS;AAAA,IACpC,CAAC;AAAA,IACD,YAAY,qBAAO,OAAO;AAAA,IAC1B,SAAS,qBAAO,QAAQ;AAAA,EAC1B,CAAC;AACH,CAAC,EAAE,KAAK;AAAA,EACN,SAAS;AACX,CAAC,CAAC;",
|
|
5
5
|
"names": ["module"]
|
|
6
6
|
}
|
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": "4.
|
|
4
|
+
"version": "4.9.1",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -43,12 +43,12 @@
|
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"koishi": "^4.15.
|
|
46
|
+
"koishi": "^4.15.5"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"koishi": "^4.15.
|
|
49
|
+
"koishi": "^4.15.5"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@minatojs/driver-mongo": "^2.
|
|
52
|
+
"@minatojs/driver-mongo": "^2.9.1"
|
|
53
53
|
}
|
|
54
|
-
}
|
|
54
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -8,6 +8,15 @@ export default defineDriver(MongoDriver, Schema.object({
|
|
|
8
8
|
username: Schema.string(),
|
|
9
9
|
password: Schema.string().role('secret'),
|
|
10
10
|
database: Schema.string().default('koishi'),
|
|
11
|
+
writeConcern: Schema.object({
|
|
12
|
+
w: Schema.union([
|
|
13
|
+
Schema.const(undefined),
|
|
14
|
+
Schema.number().required(),
|
|
15
|
+
Schema.const('majority').required(),
|
|
16
|
+
]),
|
|
17
|
+
wtimeoutMS: Schema.number(),
|
|
18
|
+
journal: Schema.boolean(),
|
|
19
|
+
}),
|
|
11
20
|
}).i18n({
|
|
12
21
|
'zh-CN': require('./locales/zh-CN'),
|
|
13
22
|
}))
|
package/src/locales/en-US.yml
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
protocol: The protocol to use.
|
|
2
2
|
host: The host to connect to.
|
|
3
3
|
port: The port number to be connected.
|
|
4
|
-
username: The username
|
|
5
|
-
password: The password
|
|
6
|
-
database: The database
|
|
4
|
+
username: The username used for authentication.
|
|
5
|
+
password: The password used for authentication.
|
|
6
|
+
database: The name of the database we want to use.
|
|
7
|
+
writeConcern:
|
|
8
|
+
$description: Write Concern
|
|
9
|
+
w:
|
|
10
|
+
$description: The write concern.
|
|
11
|
+
$value:
|
|
12
|
+
- Default
|
|
13
|
+
- Custom
|
|
14
|
+
- Majority
|
|
15
|
+
wtimeoutMS: The write concern timeout.
|
|
16
|
+
journal: The journal write concern.
|
package/src/locales/zh-CN.yml
CHANGED
|
@@ -4,3 +4,13 @@ port: 要连接到的端口号。
|
|
|
4
4
|
username: 要使用的用户名。
|
|
5
5
|
password: 要使用的密码。
|
|
6
6
|
database: 要访问的数据库名。
|
|
7
|
+
writeConcern:
|
|
8
|
+
$description: Write Concern
|
|
9
|
+
w:
|
|
10
|
+
$description: The write concern.
|
|
11
|
+
$value:
|
|
12
|
+
- Default
|
|
13
|
+
- Custom
|
|
14
|
+
- Majority
|
|
15
|
+
wtimeoutMS: The write concern timeout.
|
|
16
|
+
journal: The journal write concern.
|