@koishijs/plugin-database-mysql 5.5.5 → 5.6.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.js +15 -8
- package/lib/index.js.map +1 -1
- package/package.json +5 -5
- package/src/index.ts +14 -7
- package/src/locales/en-US.yml +9 -5
- package/src/locales/zh-CN.yml +4 -0
package/lib/index.js
CHANGED
|
@@ -22,7 +22,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
22
22
|
// koishi/plugins/database/mysql/src/locales/zh-CN.yml
|
|
23
23
|
var require_zh_CN = __commonJS({
|
|
24
24
|
"koishi/plugins/database/mysql/src/locales/zh-CN.yml"(exports, module2) {
|
|
25
|
-
module2.exports = { host: "要连接到的主机名。", port: "要连接到的端口号。", user: "要使用的用户名。", password: "要使用的密码。", database: "要访问的数据库名。" };
|
|
25
|
+
module2.exports = { host: "要连接到的主机名。", port: "要连接到的端口号。", user: "要使用的用户名。", password: "要使用的密码。", database: "要访问的数据库名。", ssl: { $description: "SSL 选项", rejectUnauthorized: "拒绝使用无效证书的客户端。" } };
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
28
|
|
|
@@ -34,13 +34,20 @@ __export(src_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(src_exports);
|
|
35
35
|
var import_koishi = require("koishi");
|
|
36
36
|
var import_driver_mysql = require("@minatojs/driver-mysql");
|
|
37
|
-
var src_default = (0, import_koishi.defineDriver)(import_driver_mysql.MySQLDriver, import_koishi.Schema.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
37
|
+
var src_default = (0, import_koishi.defineDriver)(import_driver_mysql.MySQLDriver, import_koishi.Schema.intersect([
|
|
38
|
+
import_koishi.Schema.object({
|
|
39
|
+
host: import_koishi.Schema.string().default("localhost"),
|
|
40
|
+
port: import_koishi.Schema.natural().max(65535).default(3306),
|
|
41
|
+
user: import_koishi.Schema.string().default("root"),
|
|
42
|
+
password: import_koishi.Schema.string().role("secret"),
|
|
43
|
+
database: import_koishi.Schema.string().default("koishi")
|
|
44
|
+
}),
|
|
45
|
+
import_koishi.Schema.object({
|
|
46
|
+
ssl: import_koishi.Schema.object({
|
|
47
|
+
rejectUnauthorized: import_koishi.Schema.boolean().default(true)
|
|
48
|
+
})
|
|
49
|
+
})
|
|
50
|
+
]).i18n({
|
|
44
51
|
"zh-CN": require_zh_CN()
|
|
45
52
|
}));
|
|
46
53
|
//# sourceMappingURL=index.js.map
|
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,MAAO,aAAY,MAAO,aAAY,MAAO,YAAW,UAAW,WAAU,UAAW,
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,iEAAAA,SAAA;AAAA,IAAAA,QAAA,YAAC,MAAO,aAAY,MAAO,aAAY,MAAO,YAAW,UAAW,WAAU,UAAW,aAAY,KAAM,EAAC,cAAe,UAAS,oBAAqB,gBAAe,EAAC;AAAA;AAAA;;;ACAzK;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAqC;AACrC,0BAA4B;AAE5B,IAAO,kBAAQ,4BAAa,iCAAa,qBAAO,UAAU;AAAA,EACxD,qBAAO,OAAO;AAAA,IACZ,MAAM,qBAAO,OAAO,EAAE,QAAQ,WAAW;AAAA,IACzC,MAAM,qBAAO,QAAQ,EAAE,IAAI,KAAK,EAAE,QAAQ,IAAI;AAAA,IAC9C,MAAM,qBAAO,OAAO,EAAE,QAAQ,MAAM;AAAA,IACpC,UAAU,qBAAO,OAAO,EAAE,KAAK,QAAQ;AAAA,IACvC,UAAU,qBAAO,OAAO,EAAE,QAAQ,QAAQ;AAAA,EAC5C,CAAC;AAAA,EACD,qBAAO,OAAO;AAAA,IACZ,KAAK,qBAAO,OAAO;AAAA,MACjB,oBAAoB,qBAAO,QAAQ,EAAE,QAAQ,IAAI;AAAA,IACnD,CAAC;AAAA,EACH,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-mysql",
|
|
3
3
|
"description": "MySQL support for Koishi",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.6.0",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"koishi": "^4.15.
|
|
45
|
+
"koishi": "^4.15.4"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"koishi": "^4.15.
|
|
48
|
+
"koishi": "^4.15.4"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@minatojs/driver-mysql": "^2.
|
|
51
|
+
"@minatojs/driver-mysql": "^2.6.0"
|
|
52
52
|
}
|
|
53
|
-
}
|
|
53
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import { defineDriver, Schema } from 'koishi'
|
|
2
2
|
import { MySQLDriver } from '@minatojs/driver-mysql'
|
|
3
3
|
|
|
4
|
-
export default defineDriver(MySQLDriver, Schema.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
export default defineDriver(MySQLDriver, Schema.intersect([
|
|
5
|
+
Schema.object({
|
|
6
|
+
host: Schema.string().default('localhost'),
|
|
7
|
+
port: Schema.natural().max(65535).default(3306),
|
|
8
|
+
user: Schema.string().default('root'),
|
|
9
|
+
password: Schema.string().role('secret'),
|
|
10
|
+
database: Schema.string().default('koishi'),
|
|
11
|
+
}),
|
|
12
|
+
Schema.object({
|
|
13
|
+
ssl: Schema.object({
|
|
14
|
+
rejectUnauthorized: Schema.boolean().default(true),
|
|
15
|
+
}),
|
|
16
|
+
}),
|
|
17
|
+
]).i18n({
|
|
11
18
|
'zh-CN': require('./locales/zh-CN'),
|
|
12
19
|
}))
|
package/src/locales/en-US.yml
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
host: The
|
|
2
|
-
port: The port number to
|
|
3
|
-
user: The
|
|
4
|
-
password: The password
|
|
5
|
-
database:
|
|
1
|
+
host: The hostname of the database you are connecting to.
|
|
2
|
+
port: The port number to connect to.
|
|
3
|
+
user: The MySQL user to authenticate as.
|
|
4
|
+
password: The password of that MySQL user.
|
|
5
|
+
database: Name of the database to use for this connection.
|
|
6
|
+
|
|
7
|
+
ssl:
|
|
8
|
+
$description: SSL options.
|
|
9
|
+
rejectUnauthorized: Reject clients with invalid certificates.
|