Commit d92de23d authored by nanahira's avatar nanahira

bump things

parent 50afa2a0
import 'reflect-metadata';
export * from './src/register';
export * from './src/decorators';
export * from './src/cosmotype-exports';
export * from './src/base-plugin';
export * from './src/def/interfaces';
export * from 'schemastery-gen';
export * from 'koishi-entities';
......@@ -11,11 +11,11 @@
"dependencies": {
"@types/koa": "^2.13.4",
"@types/koa__router": "^8.0.11",
"koishi-decorators": "^1.3.5",
"koishi-entities": "^1.0.5",
"cosmotype-decorators": "^2.0.1",
"koishi-decorators": "^2.0.0",
"lodash": "^4.17.21",
"reflect-metadata": "^0.1.13",
"schemastery-gen": "^3.1.2",
"schemastery-gen": "^3.1.4",
"typed-reflector": "^1.0.10"
},
"devDependencies": {
......@@ -38,7 +38,7 @@
"ws": "^8.2.3"
},
"peerDependencies": {
"koishi": "^4.5.1",
"koishi": "^4.6.0",
"schemastery": "^3.1.0"
}
},
......@@ -1028,25 +1028,15 @@
}
},
"node_modules/@koishijs/core": {
"version": "4.5.1",
"resolved": "https://registry.npmjs.org/@koishijs/core/-/core-4.5.1.tgz",
"integrity": "sha512-GD9Uzk7hgL+NbbGksTJw/nC+Dwi2too0ra1scoWJgMDzFwX++EnZhylOG5TlDeAbJ94c3JuNJqgj5VvYGzs4qQ==",
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/@koishijs/core/-/core-4.6.0.tgz",
"integrity": "sha512-m+K2h/Oqmpcw39dQhJ/D9MBmwnWNUf9uFqymJ94+nP4CR7rcM1DTWNiaMGshGUqNu+s4q0ildoEDlQrE4hVuWA==",
"peer": true,
"dependencies": {
"@koishijs/orm": "^1.0.0",
"@koishijs/utils": "^5.2.1",
"fastest-levenshtein": "^1.0.12"
},
"engines": {
"node": ">=12.0.0"
}
},
"node_modules/@koishijs/orm": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@koishijs/orm/-/orm-1.0.0.tgz",
"integrity": "sha512-uWSOVCF2THR/S4PPS5FsvsYNhWcPIHO6pXVlSckV5GmJMDQ4zAppSi4s6MwvBHPRX5CMjicK/T2huUlEA/srOQ==",
"dependencies": {
"@koishijs/utils": "^5.2.1"
"@koishijs/utils": "^5.4.0",
"cosmotype": "^1.0.3",
"fastest-levenshtein": "^1.0.12",
"ns-require": "^1.1.0"
},
"engines": {
"node": ">=12.0.0"
......@@ -1065,29 +1055,22 @@
"koishi": "^4.4.2"
}
},
"node_modules/@koishijs/plugin-database-memory": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@koishijs/plugin-database-memory/-/plugin-database-memory-1.1.0.tgz",
"integrity": "sha512-l6dB+HD5V7prbabdsrgZruOdkbWuv2viobcU2LCJaeTjhhqvchKFYv7SDGu4Ohz4csD/v4Y+qOELbXUar56N+Q==",
"dependencies": {
"@koishijs/orm": "^1.0.0"
},
"peerDependencies": {
"koishi": "^4.5.0"
}
},
"node_modules/@koishijs/segment": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@koishijs/segment/-/segment-1.1.1.tgz",
"integrity": "sha512-HmLRKJiIX++U+ow+RP0BVGwgAFzDRqwHusUzjoZcZdcnG8yudTsvB6MXnzBMnBL7k9LBxUlfB5P8ukkM1roZFQ=="
"integrity": "sha512-HmLRKJiIX++U+ow+RP0BVGwgAFzDRqwHusUzjoZcZdcnG8yudTsvB6MXnzBMnBL7k9LBxUlfB5P8ukkM1roZFQ==",
"peer": true
},
"node_modules/@koishijs/utils": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/@koishijs/utils/-/utils-5.2.1.tgz",
"integrity": "sha512-Yu+QzmpStHAx5ZknSZhp9Zv3rfy6M4b1tuU3Wh8D3gTgZPeo+gqh07X7GyN7SA76Nr472rN8+hDqq5rafuA9iQ==",
"version": "5.4.0",
"resolved": "https://registry.npmjs.org/@koishijs/utils/-/utils-5.4.0.tgz",
"integrity": "sha512-w5SHArw032cXVtxp5nXkc5jzP6Fn3LrF7FQTanPnOgmjGv/AIOAKfJ6bqaOUsSg+ttcK3iO8xs65W6XsNz3g7g==",
"peer": true,
"dependencies": {
"@koishijs/segment": "^1.1.1",
"schemastery": "^3.1.1",
"cosmokit": "^1.1.1",
"reggol": "^1.0.1",
"schemastery": "^3.3.2",
"supports-color": "^8.1.1"
}
},
......@@ -1095,6 +1078,7 @@
"version": "8.1.1",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz",
"integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==",
"peer": true,
"dependencies": {
"has-flag": "^4.0.0"
},
......@@ -2310,6 +2294,34 @@
"integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==",
"peer": true
},
"node_modules/cosmokit": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/cosmokit/-/cosmokit-1.1.1.tgz",
"integrity": "sha512-+f8x9pFGIc7I6HTObS90dq2K5YsI4U3Me4l9OminU9woVtF9Sv3CAHb5vKbFZ93XpTFctAQ6qAVSGjkGvGI9iw==",
"peer": true
},
"node_modules/cosmotype": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/cosmotype/-/cosmotype-1.0.3.tgz",
"integrity": "sha512-JykvyDjyjaDjycm8CcK8GD4Xt6/Glu4pJU9uJ5lsDuE5B5bdmAykiTPMHfs+Is8QUsNaDKpsHfxtxCUBDPYgdw==",
"peer": true,
"dependencies": {
"cosmokit": "^1.1.1",
"ns-require": "^1.1.0"
}
},
"node_modules/cosmotype-decorators": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/cosmotype-decorators/-/cosmotype-decorators-2.0.1.tgz",
"integrity": "sha512-5pGd3Ln5YKLDx0FEWDV90EJFfvJVDK+0/kU5V2YJesuZrkocLKi6z2P76n6RRQUoV+hdn9/z0lqqdR748wTWjg==",
"dependencies": {
"lodash": "^4.17.21",
"typed-reflector": "^1.0.10"
},
"peerDependencies": {
"cosmotype": "^1.0.3"
}
},
"node_modules/cross-spawn": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
......@@ -4758,14 +4770,14 @@
}
},
"node_modules/koishi": {
"version": "4.5.1",
"resolved": "https://registry.npmjs.org/koishi/-/koishi-4.5.1.tgz",
"integrity": "sha512-iYbziM1Ecm9VtWFe4knH9T3jeONzDK/bXmi4i7Qtt3V/jT1Ms0B4S+QVi5Mdd4XzIjlqGlUlEUT40D9y+BZP5Q==",
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/koishi/-/koishi-4.6.0.tgz",
"integrity": "sha512-QhjFWTGhrFnYfpVg4dNNxgHER38zSij3nyM/RB3YrLTM4VwImVk5unpgg0QryViwWxSYM4zJ0YUoys4A9jgG6A==",
"peer": true,
"dependencies": {
"@koa/router": "^10.1.1",
"@koishijs/core": "^4.5.1",
"@koishijs/utils": "^5.2.1",
"@koishijs/core": "^4.6.0",
"@koishijs/utils": "^5.4.0",
"@types/koa": "*",
"@types/koa__router": "*",
"@types/ws": "^8.5.3",
......@@ -4783,9 +4795,9 @@
}
},
"node_modules/koishi-decorators": {
"version": "1.3.5",
"resolved": "https://registry.npmjs.org/koishi-decorators/-/koishi-decorators-1.3.5.tgz",
"integrity": "sha512-DiNxUNYZAjyfYrEvPmmN+K1qi8SM+v16HjKXZfZHjymt8OV3KAIFcf+UQULlnMfOTjj/GUsbp7eNXVYtc8hmhw==",
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/koishi-decorators/-/koishi-decorators-2.0.0.tgz",
"integrity": "sha512-YAbjOLdBxJU0DnBM7vqH+UNfSqMrejlcTEc+m++ZvuMbkUA4tHZ5iciwJFV2iPZUKSZy7GbmImNbXDmmjowF5w==",
"dependencies": {
"@types/koa": "^2.13.4",
"@types/koa__router": "^8.0.11",
......@@ -4794,20 +4806,7 @@
"typed-reflector": "^1.0.10"
},
"peerDependencies": {
"koishi": "^4.5.1"
}
},
"node_modules/koishi-entities": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/koishi-entities/-/koishi-entities-1.0.5.tgz",
"integrity": "sha512-XeiEszFiVLHBxjvAsme+CSJ3rieM9j6kUQHfiRiHjyQEVIYLhbpazxo7rmrhZ9Ute6VrP/du6Fep3QcYp4CZUQ==",
"dependencies": {
"@koishijs/plugin-database-memory": "^1.1.0",
"lodash": "^4.17.21",
"typed-reflector": "^1.0.10"
},
"peerDependencies": {
"koishi": "^4.5.1"
"koishi": "^4.6.0"
}
},
"node_modules/leven": {
......@@ -5092,6 +5091,12 @@
"node": ">=8"
}
},
"node_modules/ns-require": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/ns-require/-/ns-require-1.1.0.tgz",
"integrity": "sha512-Iw349zwWNgkGZjYJtruf+BXUe8YHOiMZE0iUNffvpt/A1yTSabTnpBMQ0zNl65G1LhpzwCo1KMCqjmJF0z8O6g==",
"peer": true
},
"node_modules/nwsapi": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz",
......@@ -5673,6 +5678,31 @@
"url": "https://github.com/sponsors/mysticatea"
}
},
"node_modules/reggol": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/reggol/-/reggol-1.0.1.tgz",
"integrity": "sha512-ZMOp3rZG6YQFVp/DC+BgFZaXSQcxHDayCmo7cL/kGujsSEoUzee0VJq1KCe9sgNt0qsM6JzkuSlj/+5SmmoO7Q==",
"peer": true,
"dependencies": {
"cosmokit": "^1.1.0",
"supports-color": "^8.1.1"
}
},
"node_modules/reggol/node_modules/supports-color": {
"version": "8.1.1",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz",
"integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==",
"peer": true,
"dependencies": {
"has-flag": "^4.0.0"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/chalk/supports-color?sponsor=1"
}
},
"node_modules/require-directory": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
......@@ -5814,21 +5844,25 @@
}
},
"node_modules/schemastery": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/schemastery/-/schemastery-3.1.1.tgz",
"integrity": "sha512-TdbphUvailcX1FqxSq3sqlxdFx/HhBD7TXliq1r4Su7BTChRQimHvrauK/Q75jLVCYaJPACDU92s0JTovmVrtA=="
"version": "3.3.2",
"resolved": "https://registry.npmjs.org/schemastery/-/schemastery-3.3.2.tgz",
"integrity": "sha512-Z1C850OPtNEBs+D4QBPdC+Wu1t6Fn1BrOJILRHs2b+I/u61hUKP2vIPMAXFLvmmONnwqAW8ksPdCD6Zz9n8zhg==",
"peer": true,
"dependencies": {
"cosmokit": "^1.1.0"
}
},
"node_modules/schemastery-gen": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/schemastery-gen/-/schemastery-gen-3.1.2.tgz",
"integrity": "sha512-Vzv4nJ/HnZuEcVXMIY5IULtcNG253jrp+htPAujCq3wVC2p4hxv1e/GRht5O+tYRDfowgAsM89FLXHYXin/tEg==",
"version": "3.1.4",
"resolved": "https://registry.npmjs.org/schemastery-gen/-/schemastery-gen-3.1.4.tgz",
"integrity": "sha512-zhM5A2p/SdPKe8ouObCYSOA3k5I1CpbOfSvv8DWp7kCbVnSgfOMSBCB4Yue3/D81+MAE2re93nSt7k/Tolz3mQ==",
"dependencies": {
"lodash": "^4.17.21",
"reflect-metadata": "^0.1.13",
"typed-reflector": "^1.0.8"
"typed-reflector": "^1.0.10"
},
"peerDependencies": {
"schemastery": "^3.1.0"
"schemastery": "^3.3.2"
}
},
"node_modules/semver": {
......@@ -7593,22 +7627,15 @@
}
},
"@koishijs/core": {
"version": "4.5.1",
"resolved": "https://registry.npmjs.org/@koishijs/core/-/core-4.5.1.tgz",
"integrity": "sha512-GD9Uzk7hgL+NbbGksTJw/nC+Dwi2too0ra1scoWJgMDzFwX++EnZhylOG5TlDeAbJ94c3JuNJqgj5VvYGzs4qQ==",
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/@koishijs/core/-/core-4.6.0.tgz",
"integrity": "sha512-m+K2h/Oqmpcw39dQhJ/D9MBmwnWNUf9uFqymJ94+nP4CR7rcM1DTWNiaMGshGUqNu+s4q0ildoEDlQrE4hVuWA==",
"peer": true,
"requires": {
"@koishijs/orm": "^1.0.0",
"@koishijs/utils": "^5.2.1",
"fastest-levenshtein": "^1.0.12"
}
},
"@koishijs/orm": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@koishijs/orm/-/orm-1.0.0.tgz",
"integrity": "sha512-uWSOVCF2THR/S4PPS5FsvsYNhWcPIHO6pXVlSckV5GmJMDQ4zAppSi4s6MwvBHPRX5CMjicK/T2huUlEA/srOQ==",
"requires": {
"@koishijs/utils": "^5.2.1"
"@koishijs/utils": "^5.4.0",
"cosmotype": "^1.0.3",
"fastest-levenshtein": "^1.0.12",
"ns-require": "^1.1.0"
}
},
"@koishijs/plugin-adapter-onebot": {
......@@ -7621,26 +7648,22 @@
"ws": "^8.5.0"
}
},
"@koishijs/plugin-database-memory": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@koishijs/plugin-database-memory/-/plugin-database-memory-1.1.0.tgz",
"integrity": "sha512-l6dB+HD5V7prbabdsrgZruOdkbWuv2viobcU2LCJaeTjhhqvchKFYv7SDGu4Ohz4csD/v4Y+qOELbXUar56N+Q==",
"requires": {
"@koishijs/orm": "^1.0.0"
}
},
"@koishijs/segment": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@koishijs/segment/-/segment-1.1.1.tgz",
"integrity": "sha512-HmLRKJiIX++U+ow+RP0BVGwgAFzDRqwHusUzjoZcZdcnG8yudTsvB6MXnzBMnBL7k9LBxUlfB5P8ukkM1roZFQ=="
"integrity": "sha512-HmLRKJiIX++U+ow+RP0BVGwgAFzDRqwHusUzjoZcZdcnG8yudTsvB6MXnzBMnBL7k9LBxUlfB5P8ukkM1roZFQ==",
"peer": true
},
"@koishijs/utils": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/@koishijs/utils/-/utils-5.2.1.tgz",
"integrity": "sha512-Yu+QzmpStHAx5ZknSZhp9Zv3rfy6M4b1tuU3Wh8D3gTgZPeo+gqh07X7GyN7SA76Nr472rN8+hDqq5rafuA9iQ==",
"version": "5.4.0",
"resolved": "https://registry.npmjs.org/@koishijs/utils/-/utils-5.4.0.tgz",
"integrity": "sha512-w5SHArw032cXVtxp5nXkc5jzP6Fn3LrF7FQTanPnOgmjGv/AIOAKfJ6bqaOUsSg+ttcK3iO8xs65W6XsNz3g7g==",
"peer": true,
"requires": {
"@koishijs/segment": "^1.1.1",
"schemastery": "^3.1.1",
"cosmokit": "^1.1.1",
"reggol": "^1.0.1",
"schemastery": "^3.3.2",
"supports-color": "^8.1.1"
},
"dependencies": {
......@@ -7648,6 +7671,7 @@
"version": "8.1.1",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz",
"integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==",
"peer": true,
"requires": {
"has-flag": "^4.0.0"
}
......@@ -8624,6 +8648,31 @@
"integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==",
"peer": true
},
"cosmokit": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/cosmokit/-/cosmokit-1.1.1.tgz",
"integrity": "sha512-+f8x9pFGIc7I6HTObS90dq2K5YsI4U3Me4l9OminU9woVtF9Sv3CAHb5vKbFZ93XpTFctAQ6qAVSGjkGvGI9iw==",
"peer": true
},
"cosmotype": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/cosmotype/-/cosmotype-1.0.3.tgz",
"integrity": "sha512-JykvyDjyjaDjycm8CcK8GD4Xt6/Glu4pJU9uJ5lsDuE5B5bdmAykiTPMHfs+Is8QUsNaDKpsHfxtxCUBDPYgdw==",
"peer": true,
"requires": {
"cosmokit": "^1.1.1",
"ns-require": "^1.1.0"
}
},
"cosmotype-decorators": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/cosmotype-decorators/-/cosmotype-decorators-2.0.1.tgz",
"integrity": "sha512-5pGd3Ln5YKLDx0FEWDV90EJFfvJVDK+0/kU5V2YJesuZrkocLKi6z2P76n6RRQUoV+hdn9/z0lqqdR748wTWjg==",
"requires": {
"lodash": "^4.17.21",
"typed-reflector": "^1.0.10"
}
},
"cross-spawn": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
......@@ -10463,14 +10512,14 @@
}
},
"koishi": {
"version": "4.5.1",
"resolved": "https://registry.npmjs.org/koishi/-/koishi-4.5.1.tgz",
"integrity": "sha512-iYbziM1Ecm9VtWFe4knH9T3jeONzDK/bXmi4i7Qtt3V/jT1Ms0B4S+QVi5Mdd4XzIjlqGlUlEUT40D9y+BZP5Q==",
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/koishi/-/koishi-4.6.0.tgz",
"integrity": "sha512-QhjFWTGhrFnYfpVg4dNNxgHER38zSij3nyM/RB3YrLTM4VwImVk5unpgg0QryViwWxSYM4zJ0YUoys4A9jgG6A==",
"peer": true,
"requires": {
"@koa/router": "^10.1.1",
"@koishijs/core": "^4.5.1",
"@koishijs/utils": "^5.2.1",
"@koishijs/core": "^4.6.0",
"@koishijs/utils": "^5.4.0",
"@types/koa": "*",
"@types/koa__router": "*",
"@types/ws": "^8.5.3",
......@@ -10485,9 +10534,9 @@
}
},
"koishi-decorators": {
"version": "1.3.5",
"resolved": "https://registry.npmjs.org/koishi-decorators/-/koishi-decorators-1.3.5.tgz",
"integrity": "sha512-DiNxUNYZAjyfYrEvPmmN+K1qi8SM+v16HjKXZfZHjymt8OV3KAIFcf+UQULlnMfOTjj/GUsbp7eNXVYtc8hmhw==",
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/koishi-decorators/-/koishi-decorators-2.0.0.tgz",
"integrity": "sha512-YAbjOLdBxJU0DnBM7vqH+UNfSqMrejlcTEc+m++ZvuMbkUA4tHZ5iciwJFV2iPZUKSZy7GbmImNbXDmmjowF5w==",
"requires": {
"@types/koa": "^2.13.4",
"@types/koa__router": "^8.0.11",
......@@ -10496,16 +10545,6 @@
"typed-reflector": "^1.0.10"
}
},
"koishi-entities": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/koishi-entities/-/koishi-entities-1.0.5.tgz",
"integrity": "sha512-XeiEszFiVLHBxjvAsme+CSJ3rieM9j6kUQHfiRiHjyQEVIYLhbpazxo7rmrhZ9Ute6VrP/du6Fep3QcYp4CZUQ==",
"requires": {
"@koishijs/plugin-database-memory": "^1.1.0",
"lodash": "^4.17.21",
"typed-reflector": "^1.0.10"
}
},
"leven": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz",
......@@ -10724,6 +10763,12 @@
"path-key": "^3.0.0"
}
},
"ns-require": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/ns-require/-/ns-require-1.1.0.tgz",
"integrity": "sha512-Iw349zwWNgkGZjYJtruf+BXUe8YHOiMZE0iUNffvpt/A1yTSabTnpBMQ0zNl65G1LhpzwCo1KMCqjmJF0z8O6g==",
"peer": true
},
"nwsapi": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz",
......@@ -11154,6 +11199,27 @@
"integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==",
"dev": true
},
"reggol": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/reggol/-/reggol-1.0.1.tgz",
"integrity": "sha512-ZMOp3rZG6YQFVp/DC+BgFZaXSQcxHDayCmo7cL/kGujsSEoUzee0VJq1KCe9sgNt0qsM6JzkuSlj/+5SmmoO7Q==",
"peer": true,
"requires": {
"cosmokit": "^1.1.0",
"supports-color": "^8.1.1"
},
"dependencies": {
"supports-color": {
"version": "8.1.1",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz",
"integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==",
"peer": true,
"requires": {
"has-flag": "^4.0.0"
}
}
}
},
"require-directory": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
......@@ -11249,18 +11315,22 @@
}
},
"schemastery": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/schemastery/-/schemastery-3.1.1.tgz",
"integrity": "sha512-TdbphUvailcX1FqxSq3sqlxdFx/HhBD7TXliq1r4Su7BTChRQimHvrauK/Q75jLVCYaJPACDU92s0JTovmVrtA=="
"version": "3.3.2",
"resolved": "https://registry.npmjs.org/schemastery/-/schemastery-3.3.2.tgz",
"integrity": "sha512-Z1C850OPtNEBs+D4QBPdC+Wu1t6Fn1BrOJILRHs2b+I/u61hUKP2vIPMAXFLvmmONnwqAW8ksPdCD6Zz9n8zhg==",
"peer": true,
"requires": {
"cosmokit": "^1.1.0"
}
},
"schemastery-gen": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/schemastery-gen/-/schemastery-gen-3.1.2.tgz",
"integrity": "sha512-Vzv4nJ/HnZuEcVXMIY5IULtcNG253jrp+htPAujCq3wVC2p4hxv1e/GRht5O+tYRDfowgAsM89FLXHYXin/tEg==",
"version": "3.1.4",
"resolved": "https://registry.npmjs.org/schemastery-gen/-/schemastery-gen-3.1.4.tgz",
"integrity": "sha512-zhM5A2p/SdPKe8ouObCYSOA3k5I1CpbOfSvv8DWp7kCbVnSgfOMSBCB4Yue3/D81+MAE2re93nSt7k/Tolz3mQ==",
"requires": {
"lodash": "^4.17.21",
"reflect-metadata": "^0.1.13",
"typed-reflector": "^1.0.8"
"typed-reflector": "^1.0.10"
}
},
"semver": {
......
......@@ -50,11 +50,11 @@
"dependencies": {
"@types/koa": "^2.13.4",
"@types/koa__router": "^8.0.11",
"koishi-decorators": "^1.3.5",
"koishi-entities": "^1.0.5",
"cosmotype-decorators": "^2.0.1",
"koishi-decorators": "^2.0.0",
"lodash": "^4.17.21",
"reflect-metadata": "^0.1.13",
"schemastery-gen": "^3.1.2",
"schemastery-gen": "^3.1.4",
"typed-reflector": "^1.0.10"
},
"jest": {
......@@ -75,7 +75,7 @@
"testEnvironment": "node"
},
"peerDependencies": {
"koishi": "^4.5.1",
"koishi": "^4.6.0",
"schemastery": "^3.1.0"
}
}
import { ModelDecorators } from 'cosmotype-decorators';
import { Tables } from 'koishi';
const decorators = new ModelDecorators<Tables>();
export const DefineModel = decorators.DefineModel;
export const ModelField = decorators.ModelField;
export const Primary = decorators.Primary;
export const PrimaryGenerated = decorators.PrimaryGenerated;
export const Foreign = decorators.Foreign;
export const Unique = decorators.Unique;
export const ChildModel = decorators.ChildModel;
......@@ -14,7 +14,7 @@ import {
SystemInjectFun,
} from './def';
import { TopLevelAction } from 'koishi-decorators';
import { mixinModel, ModelClassType, registerModel } from 'koishi-entities';
import { ModelClassType, ModelRegistrar } from 'cosmotype-decorators';
// Export all koishi-decorator decorators
......@@ -128,7 +128,10 @@ export const If = <T>(func: Condition<boolean, T>): MethodDecorator =>
Metadata.append('KoishiIf', func);
export const UseModel = (...models: ModelClassType[]): ClassDecorator =>
TopLevelAction((ctx) => models.forEach((m) => registerModel(ctx, m)));
TopLevelAction((ctx) => {
const registrar = new ModelRegistrar(ctx.model);
models.forEach((m) => registrar.registerModel(m));
});
export const MixinModel = <K extends Keys<Tables>>(
tableName: K,
......@@ -136,4 +139,7 @@ export const MixinModel = <K extends Keys<Tables>>(
[F in Keys<Tables[K]>]?: ModelClassType<Flatten<Tables[K][F]>>;
},
): ClassDecorator =>
TopLevelAction((ctx) => mixinModel(ctx, tableName, classDict));
TopLevelAction((ctx) => {
const registrar = new ModelRegistrar(ctx.model);
registrar.mixinModel(tableName, classDict);
});
import { MixinModel, UseModel } from '../src/decorators';
import { App } from 'koishi';
import { BasePlugin } from '../src/base-plugin';
import { DefinePlugin } from '../src/register';
import {
ChildModel,
DefineModel,
......@@ -5,11 +9,7 @@ import {
ModelField,
PrimaryGenerated,
Unique,
} from 'koishi-entities';
import { MixinModel, UseModel } from '../src/decorators';
import { App } from 'koishi';
import { BasePlugin } from '../src/base-plugin';
import { DefinePlugin } from '../src/register';
} from '../src/cosmotype-exports';
declare module 'koishi' {
interface Tables {
......@@ -85,7 +85,7 @@ describe('Test of model', () => {
it('should register model', async () => {
const app = new App();
app.plugin(MyPlugin);
expect(app.model.config.dress.fields.name.type).toBe('string');
expect(app.model.config.user.fields['shirt.size'].type).toBe('string');
expect(app.model.tables.dress.fields.name.type).toBe('string');
expect(app.model.tables.user.fields['shirt.size'].type).toBe('string');
});
});
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