@karinjs/adapter-qqbot 1.2.10 → 2.0.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.
Files changed (65) hide show
  1. package/README.md +326 -85
  2. package/dist/apps/login.d.ts +20 -0
  3. package/dist/apps/login.js +57 -0
  4. package/dist/config-H7LrvlNU.js +197 -0
  5. package/dist/index.d.ts +670 -0
  6. package/dist/index.js +2847 -0
  7. package/dist/onboard-BX8g8Wik.js +249 -0
  8. package/dist/utils-DO4gEkVN.js +3 -0
  9. package/dist/web.config.d.ts +22 -0
  10. package/dist/web.config.js +173 -0
  11. package/package.json +34 -21
  12. package/config/comment/config.json +0 -3
  13. package/config/config/config.yaml +0 -53
  14. package/lib/cli/pr.d.ts +0 -2
  15. package/lib/cli/pr.js +0 -73
  16. package/lib/core/adapter/adapter.d.ts +0 -91
  17. package/lib/core/adapter/adapter.js +0 -144
  18. package/lib/core/adapter/handler.d.ts +0 -49
  19. package/lib/core/adapter/handler.js +0 -140
  20. package/lib/core/adapter/markdown.d.ts +0 -38
  21. package/lib/core/adapter/markdown.js +0 -220
  22. package/lib/core/adapter/normal.d.ts +0 -30
  23. package/lib/core/adapter/normal.js +0 -263
  24. package/lib/core/api/index.d.ts +0 -167
  25. package/lib/core/api/index.js +0 -180
  26. package/lib/core/api/sign.d.ts +0 -22
  27. package/lib/core/api/sign.js +0 -40
  28. package/lib/core/api/types.d.ts +0 -236
  29. package/lib/core/api/types.js +0 -1
  30. package/lib/core/event/conver.d.ts +0 -10
  31. package/lib/core/event/conver.js +0 -57
  32. package/lib/core/event/index.d.ts +0 -9
  33. package/lib/core/event/index.js +0 -98
  34. package/lib/core/event/message.d.ts +0 -27
  35. package/lib/core/event/message.js +0 -95
  36. package/lib/core/event/notice.d.ts +0 -50
  37. package/lib/core/event/notice.js +0 -133
  38. package/lib/core/event/types.d.ts +0 -473
  39. package/lib/core/event/types.js +0 -1
  40. package/lib/core/internal/axios.d.ts +0 -25
  41. package/lib/core/internal/axios.js +0 -46
  42. package/lib/core/internal/sign.d.ts +0 -22
  43. package/lib/core/internal/sign.js +0 -40
  44. package/lib/core/webhook/c2c.d.ts +0 -2
  45. package/lib/core/webhook/c2c.js +0 -14
  46. package/lib/core/webhook/http.d.ts +0 -2
  47. package/lib/core/webhook/http.js +0 -35
  48. package/lib/core/webhook/index.d.ts +0 -17
  49. package/lib/core/webhook/index.js +0 -87
  50. package/lib/core/webhook/ws.d.ts +0 -2
  51. package/lib/core/webhook/ws.js +0 -79
  52. package/lib/index.d.ts +0 -1
  53. package/lib/index.js +0 -5
  54. package/lib/root.d.ts +0 -5
  55. package/lib/root.js +0 -9
  56. package/lib/types/config.d.ts +0 -53
  57. package/lib/types/config.js +0 -1
  58. package/lib/utils/common.d.ts +0 -80
  59. package/lib/utils/common.js +0 -198
  60. package/lib/utils/config.d.ts +0 -9
  61. package/lib/utils/config.js +0 -54
  62. package/lib/utils/dir.d.ts +0 -1
  63. package/lib/utils/dir.js +0 -1
  64. package/lib/utils/index.d.ts +0 -4
  65. package/lib/utils/index.js +0 -4
@@ -1,54 +0,0 @@
1
- import { dirPath } from '@/utils';
2
- import { watch, basePath, filesByExt, copyConfigSync, requireFileSync, } from 'node-karin';
3
- let cache;
4
- /**
5
- * @description package.json
6
- */
7
- export const pkg = () => requireFileSync(`${dirPath}/package.json`);
8
- /** 用户配置的插件名称 */
9
- const pluginName = pkg().name.replace(/\//g, '-');
10
- /** 用户配置 */
11
- const dirConfig = `${basePath}/${pluginName}/config`;
12
- /** 默认配置 */
13
- const defConfig = `${dirPath}/config/config`;
14
- /**
15
- * @description 初始化配置文件
16
- */
17
- copyConfigSync(defConfig, dirConfig, ['.yaml']);
18
- /**
19
- * @description 配置文件
20
- */
21
- export const config = () => {
22
- if (cache)
23
- return cache;
24
- const user = requireFileSync(`${dirConfig}/config.yaml`);
25
- const def = requireFileSync(`${defConfig}/config.yaml`);
26
- const result = { default: Object.assign(def.default, user.default) };
27
- for (const key in user) {
28
- if (key === 'default')
29
- continue;
30
- result[key] = {
31
- ...result.default,
32
- ...user[key],
33
- event: {
34
- ...result.default.event,
35
- ...user?.[key]?.event
36
- },
37
- markdown: {
38
- ...result.default.markdown,
39
- ...user?.[key]?.markdown
40
- },
41
- };
42
- }
43
- cache = result;
44
- return result;
45
- };
46
- /**
47
- * @description 监听配置文件
48
- */
49
- setTimeout(() => {
50
- const list = filesByExt(dirConfig, '.yaml', 'abs');
51
- list.forEach(file => watch(file, (old, now) => {
52
- cache = undefined;
53
- }));
54
- }, 2000);
@@ -1 +0,0 @@
1
- export * from '../root';
package/lib/utils/dir.js DELETED
@@ -1 +0,0 @@
1
- export * from '../root';
@@ -1,4 +0,0 @@
1
- export * from './dir';
2
- export * from './config';
3
- export * as common from './common';
4
- export * as config from './config';
@@ -1,4 +0,0 @@
1
- export * from './dir';
2
- export * from './config';
3
- export * as common from './common';
4
- export * as config from './config';