Commit 54f233ce authored by nanahira's avatar nanahira

update schema class methods

parent 07135f1a
......@@ -11,7 +11,7 @@
"dependencies": {
"reflect-metadata": "^0.1.13",
"schemastery": "^1.0.0",
"schemastery-gen": "^1.0.3",
"schemastery-gen": "^1.0.5",
"typed-reflector": "^1.0.5"
},
"devDependencies": {
......@@ -2729,9 +2729,9 @@
"integrity": "sha512-TwjfFcstdU1rSkV9/dATEk8YFLa1OOxCuGT2mMepZxpMAATQdVm7Fw2tRr4tEsrqAitP+X1/8P5Vv51OUBClAw=="
},
"node_modules/schemastery-gen": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/schemastery-gen/-/schemastery-gen-1.0.3.tgz",
"integrity": "sha512-qJQS0N5ZOsCsMkv4ZhQYS50j9iIEaizIABC3u/331pY737al2E9rrx77cK5yc/ChZUq+ejm3/eKIgATrpLaCnQ==",
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/schemastery-gen/-/schemastery-gen-1.0.5.tgz",
"integrity": "sha512-OCU1SnGzCQ9DjGXlOhE1G2pVOpA6MMOfy8SQFVOow3L4qmNrJ/Ihcc1SndOMqgFUMVC77+vCNR1QSnL4Q0jl3Q==",
"dependencies": {
"lodash": "^4.17.21",
"reflect-metadata": "^0.1.13",
......@@ -5294,9 +5294,9 @@
"integrity": "sha512-TwjfFcstdU1rSkV9/dATEk8YFLa1OOxCuGT2mMepZxpMAATQdVm7Fw2tRr4tEsrqAitP+X1/8P5Vv51OUBClAw=="
},
"schemastery-gen": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/schemastery-gen/-/schemastery-gen-1.0.3.tgz",
"integrity": "sha512-qJQS0N5ZOsCsMkv4ZhQYS50j9iIEaizIABC3u/331pY737al2E9rrx77cK5yc/ChZUq+ejm3/eKIgATrpLaCnQ==",
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/schemastery-gen/-/schemastery-gen-1.0.5.tgz",
"integrity": "sha512-OCU1SnGzCQ9DjGXlOhE1G2pVOpA6MMOfy8SQFVOow3L4qmNrJ/Ihcc1SndOMqgFUMVC77+vCNR1QSnL4Q0jl3Q==",
"requires": {
"lodash": "^4.17.21",
"reflect-metadata": "^0.1.13",
......
......@@ -17,7 +17,7 @@ import {
} from './def';
import { reflector } from './meta/meta-fetch';
import { applySelector } from './utility/utility';
import { ClassType, RegisterSchema } from 'schemastery-gen';
import { ClassType, SchemaClass } from 'schemastery-gen';
export interface KoishiPluginRegistrationOptions<T = any> {
name?: string;
......@@ -59,7 +59,7 @@ export function KoishiPlugin<T = any>(
const newClass = class extends originalClass implements PluginClass {
static schema = (options.schema as Schema).type
? (options.schema as Schema<T>)
: RegisterSchema()(options.schema as ClassType<T>);
: SchemaClass(options.schema as ClassType<T>);
__ctx: Context;
__config: T;
__pluginOptions: KoishiPluginRegistrationOptions<T>;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment