@koishijs/plugin-database-mongo 4.11.0 → 5.0.0-alpha.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 CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: Plugin.Object<import("koishi").Context, T>;
2
- export default _default;
1
+ import { MongoDriver } from '@minatojs/driver-mongo';
2
+ export default MongoDriver;
package/lib/index.js CHANGED
@@ -2,9 +2,6 @@ var __defProp = Object.defineProperty;
2
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __commonJS = (cb, mod) => function __require() {
6
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
7
- };
8
5
  var __export = (target, all) => {
9
6
  for (var name in all)
10
7
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -19,38 +16,12 @@ var __copyProps = (to, from, except, desc) => {
19
16
  };
20
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
18
 
22
- // koishi/plugins/database/mongo/src/locales/zh-CN.yml
23
- var require_zh_CN = __commonJS({
24
- "koishi/plugins/database/mongo/src/locales/zh-CN.yml"(exports, module2) {
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
- }
27
- });
28
-
29
- // koishi/plugins/database/mongo/src/index.ts
19
+ // koishi/external/upstream/database/mongo/src/index.ts
30
20
  var src_exports = {};
31
21
  __export(src_exports, {
32
22
  default: () => src_default
33
23
  });
34
24
  module.exports = __toCommonJS(src_exports);
35
- var import_koishi = require("koishi");
36
25
  var import_driver_mongo = require("@minatojs/driver-mongo");
37
- var src_default = (0, import_koishi.defineDriver)(import_driver_mongo.MongoDriver, import_koishi.Schema.object({
38
- protocol: import_koishi.Schema.string().default("mongodb"),
39
- host: import_koishi.Schema.string().default("localhost"),
40
- port: import_koishi.Schema.natural().max(65535),
41
- username: import_koishi.Schema.string(),
42
- password: import_koishi.Schema.string().role("secret"),
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
- })
53
- }).i18n({
54
- "zh-CN": require_zh_CN()
55
- }));
26
+ var src_default = import_driver_mongo.MongoDriver;
56
27
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 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,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
- "names": ["module"]
3
+ "sources": ["../src/index.ts"],
4
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA4B;AAE5B,IAAO,cAAQ;",
5
+ "names": []
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.11.0",
4
+ "version": "5.0.0-alpha.0",
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.16.7"
46
+ "koishi": "^4.17.0-alpha.0"
47
47
  },
48
48
  "devDependencies": {
49
- "koishi": "^4.16.7"
49
+ "koishi": "^4.17.0-alpha.0"
50
50
  },
51
51
  "dependencies": {
52
- "@minatojs/driver-mongo": "^2.11.0"
52
+ "@minatojs/driver-mongo": "^3.0.0-alpha.0"
53
53
  }
54
54
  }
package/src/index.ts CHANGED
@@ -1,22 +1,3 @@
1
- import { defineDriver, Schema } from 'koishi'
2
1
  import { MongoDriver } from '@minatojs/driver-mongo'
3
2
 
4
- export default defineDriver(MongoDriver, Schema.object({
5
- protocol: Schema.string().default('mongodb'),
6
- host: Schema.string().default('localhost'),
7
- port: Schema.natural().max(65535),
8
- username: Schema.string(),
9
- password: Schema.string().role('secret'),
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
- }),
20
- }).i18n({
21
- 'zh-CN': require('./locales/zh-CN'),
22
- }))
3
+ export default MongoDriver
@@ -1,6 +0,0 @@
1
- protocol: 要使用的协议名。
2
- host: 要连接到的主机名。
3
- port: 要连接到的端口号。
4
- username: 要使用的用户名。
5
- password: 要使用的密码。
6
- database: 要访问的数据库名。
@@ -1,16 +0,0 @@
1
- protocol: The protocol to use.
2
- host: The host to connect to.
3
- port: The port number to be connected.
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.
@@ -1,6 +0,0 @@
1
- protocol: 要使用的协议名。
2
- host: 要连接到的主机名。
3
- port: 要连接到的端口号。
4
- username: 要使用的用户名。
5
- password: 要使用的密码。
6
- database: 要访问的数据库名。
@@ -1,6 +0,0 @@
1
- protocol: 要使用的协议名。
2
- host: 要连接到的主机名。
3
- port: 要连接到的端口号。
4
- username: 要使用的用户名。
5
- password: 要使用的密码。
6
- database: 要访问的数据库名。
@@ -1,6 +0,0 @@
1
- protocol: 要使用的协议名。
2
- host: 要连接到的主机名。
3
- port: 要连接到的端口号。
4
- username: 要使用的用户名。
5
- password: 要使用的密码。
6
- database: 要访问的数据库名。
@@ -1,16 +0,0 @@
1
- protocol: 要使用的协议名。
2
- host: 要连接到的主机名。
3
- port: 要连接到的端口号。
4
- username: 要使用的用户名。
5
- password: 要使用的密码。
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.
@@ -1,6 +0,0 @@
1
- protocol: 要使用的協議名。
2
- host: 要連接到的主機名。
3
- port: 要連接到的端口號。
4
- username: 要使用的使用者名。
5
- password: 要使用的密碼。
6
- database: 要訪問的數據庫名。