@dsh-plugin/dsh-synapse 0.1.0-dev.41044228975 → 0.1.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 (74) hide show
  1. package/LICENSE +661 -661
  2. package/README.md +0 -14
  3. package/package.json +1 -1
  4. package/vendor/gugle-chat-bot/LICENSE +661 -661
  5. package/vendor/gugle-chat-bot/package.json +57 -57
  6. package/vendor/gugle-chat-bot/src/allow-rule.yml +9345 -9345
  7. package/vendor/gugle-chat-bot/src/api.json +4284 -4284
  8. package/vendor/gugle-chat-bot/src/command/index.ts +141 -141
  9. package/vendor/gugle-chat-bot/src/config/features.ts +547 -547
  10. package/vendor/gugle-chat-bot/src/config/index.ts +184 -184
  11. package/vendor/gugle-chat-bot/src/config/manager.ts +356 -356
  12. package/vendor/gugle-chat-bot/src/constants/index.ts +13 -13
  13. package/vendor/gugle-chat-bot/src/custom.ts +548 -548
  14. package/vendor/gugle-chat-bot/src/event/index.ts +118 -118
  15. package/vendor/gugle-chat-bot/src/features/admin/index.ts +414 -414
  16. package/vendor/gugle-chat-bot/src/features/bili/image/impl/video.ts +39 -39
  17. package/vendor/gugle-chat-bot/src/features/bili/image/index.ts +37 -37
  18. package/vendor/gugle-chat-bot/src/features/bili/index.ts +65 -65
  19. package/vendor/gugle-chat-bot/src/features/bili/template/style/video.css +97 -97
  20. package/vendor/gugle-chat-bot/src/features/bili/template/video.html +56 -56
  21. package/vendor/gugle-chat-bot/src/features/discord-bridge/index.ts +1128 -1128
  22. package/vendor/gugle-chat-bot/src/features/discord-bridge/markdown.ts +105 -105
  23. package/vendor/gugle-chat-bot/src/features/discord-bridge/slash.ts +355 -355
  24. package/vendor/gugle-chat-bot/src/features/discord-bridge/source.ts +96 -96
  25. package/vendor/gugle-chat-bot/src/features/discord-bridge/template/message.html +14 -14
  26. package/vendor/gugle-chat-bot/src/features/discord-bridge/template/style/message.css +144 -144
  27. package/vendor/gugle-chat-bot/src/features/github/api.ts +93 -93
  28. package/vendor/gugle-chat-bot/src/features/github/binding.ts +161 -161
  29. package/vendor/gugle-chat-bot/src/features/github/image/impl/issue.ts +132 -132
  30. package/vendor/gugle-chat-bot/src/features/github/image/impl/pr.ts +144 -144
  31. package/vendor/gugle-chat-bot/src/features/github/image/impl/release.ts +160 -160
  32. package/vendor/gugle-chat-bot/src/features/github/image/index.ts +310 -310
  33. package/vendor/gugle-chat-bot/src/features/github/index.ts +302 -302
  34. package/vendor/gugle-chat-bot/src/features/github/template/issue.html +118 -118
  35. package/vendor/gugle-chat-bot/src/features/github/template/pull_request.html +125 -125
  36. package/vendor/gugle-chat-bot/src/features/github/template/release.html +53 -53
  37. package/vendor/gugle-chat-bot/src/features/github/template/style/issue.css +468 -468
  38. package/vendor/gugle-chat-bot/src/features/github/template/style/pull_request.css +468 -468
  39. package/vendor/gugle-chat-bot/src/features/github/template/style/release.css +412 -412
  40. package/vendor/gugle-chat-bot/src/features/hermes/client.ts +184 -184
  41. package/vendor/gugle-chat-bot/src/features/hermes/config.ts +210 -210
  42. package/vendor/gugle-chat-bot/src/features/hermes/context.ts +67 -67
  43. package/vendor/gugle-chat-bot/src/features/hermes/history.ts +86 -86
  44. package/vendor/gugle-chat-bot/src/features/hermes/index.ts +1533 -1533
  45. package/vendor/gugle-chat-bot/src/features/hermes/message.ts +319 -319
  46. package/vendor/gugle-chat-bot/src/features/hermes/reaction.ts +181 -181
  47. package/vendor/gugle-chat-bot/src/features/hermes/render.ts +118 -118
  48. package/vendor/gugle-chat-bot/src/features/hermes/reply-units.ts +331 -331
  49. package/vendor/gugle-chat-bot/src/features/hermes/skills.ts +406 -406
  50. package/vendor/gugle-chat-bot/src/features/hermes/template/approval.html +30 -30
  51. package/vendor/gugle-chat-bot/src/features/hermes/template/progress.html +21 -21
  52. package/vendor/gugle-chat-bot/src/features/hermes/template/style/approval.css +81 -81
  53. package/vendor/gugle-chat-bot/src/features/hermes/template/style/progress.css +120 -120
  54. package/vendor/gugle-chat-bot/src/features/hermes/trigger.ts +86 -86
  55. package/vendor/gugle-chat-bot/src/features/hermes/types.ts +327 -327
  56. package/vendor/gugle-chat-bot/src/features/management/index.ts +156 -156
  57. package/vendor/gugle-chat-bot/src/features/minecraft/index.ts +127 -127
  58. package/vendor/gugle-chat-bot/src/features/modrinth/index.ts +71 -71
  59. package/vendor/gugle-chat-bot/src/features/parentheses/index.ts +117 -117
  60. package/vendor/gugle-chat-bot/src/features/peak-valley-timer/index.ts +451 -451
  61. package/vendor/gugle-chat-bot/src/features/poke/index.ts +24 -24
  62. package/vendor/gugle-chat-bot/src/features/version-tracker/index.ts +77 -77
  63. package/vendor/gugle-chat-bot/src/features/welcome/index.ts +57 -57
  64. package/vendor/gugle-chat-bot/src/github-ip.json +5814 -5814
  65. package/vendor/gugle-chat-bot/src/image/index.ts +278 -278
  66. package/vendor/gugle-chat-bot/src/index.ts +695 -695
  67. package/vendor/gugle-chat-bot/src/logger/index.ts +54 -54
  68. package/vendor/gugle-chat-bot/src/result.json +359 -359
  69. package/vendor/gugle-chat-bot/src/type/bili.d.ts +825 -825
  70. package/vendor/gugle-chat-bot/src/type/event.d.ts +146 -146
  71. package/vendor/gugle-chat-bot/src/type/github.d.ts +446 -446
  72. package/vendor/gugle-chat-bot/src/type/index.d.ts +254 -254
  73. package/vendor/gugle-chat-bot/tsconfig.json +46 -46
  74. package/scripts/dump-npm-latest.mjs +0 -30
@@ -1,54 +1,54 @@
1
- // 导入winston库中的createLogger、Logger、transports和format模块,以及dayjs库
2
- import { createLogger, format, Logger, transports } from 'winston';
3
- import 'winston-daily-rotate-file';
4
- import dayjs from 'dayjs';
5
-
6
- // 定义LoggerFactory类
7
- export class LoggerFactory {
8
- /**
9
- * 创建一个Logger实例
10
- *
11
- * @param name 日志的名称,用于在日志条目中标识,可选,默认为undefined
12
- * @param path 日志文件的存储路径,可选,默认为当前工作目录
13
- * @param logLevel 日志级别,可选,默认为'info',可选值包括'debug'、'info'、'warn'和'error'
14
- * @returns 返回一个配置好的Logger实例
15
- */
16
- public static createLogger(
17
- name: string | undefined = undefined,
18
- path: string = process.cwd(),
19
- logLevel: 'debug' | 'info' | 'warn' | 'error' = 'info'
20
- ): Logger {
21
- // 配置文件日志输出
22
- const dailyRotateFile = new transports.DailyRotateFile({
23
- // 指定日志文件的名称和路径
24
- filename: `%DATE%.log`,
25
- dirname: path,
26
- datePattern: 'YYYY-MM-DD',
27
- // 使用自定义打印格式
28
- format: format.printf(
29
- info => `[${dayjs().format('YYYY-MM-DD HH:mm:ss')}]${name ? `[${name}]` : ''}[${info.level}] ${info.message}`
30
- ),
31
- maxSize: '16k',
32
- zippedArchive: true
33
- });
34
-
35
- // 配置控制台日志输出
36
- const console = new transports.Console({
37
- // 结合颜色格式化和自定义打印格式
38
- format: format.combine(
39
- format.colorize(),
40
- format.printf(
41
- info => `[${dayjs().format('YYYY-MM-DD HH:mm:ss')}]${name ? `[${name}]` : ''}[${info.level}] ${info.message}`
42
- )
43
- )
44
- });
45
-
46
- // 使用winston的createLogger方法创建并返回一个Logger实例
47
- return createLogger({
48
- // 设置日志级别
49
- level: logLevel,
50
- // 配置日志传输(输出)的方式,包括控制台和文件
51
- transports: [console, dailyRotateFile]
52
- });
53
- }
54
- }
1
+ // 导入winston库中的createLogger、Logger、transports和format模块,以及dayjs库
2
+ import { createLogger, format, Logger, transports } from 'winston';
3
+ import 'winston-daily-rotate-file';
4
+ import dayjs from 'dayjs';
5
+
6
+ // 定义LoggerFactory类
7
+ export class LoggerFactory {
8
+ /**
9
+ * 创建一个Logger实例
10
+ *
11
+ * @param name 日志的名称,用于在日志条目中标识,可选,默认为undefined
12
+ * @param path 日志文件的存储路径,可选,默认为当前工作目录
13
+ * @param logLevel 日志级别,可选,默认为'info',可选值包括'debug'、'info'、'warn'和'error'
14
+ * @returns 返回一个配置好的Logger实例
15
+ */
16
+ public static createLogger(
17
+ name: string | undefined = undefined,
18
+ path: string = process.cwd(),
19
+ logLevel: 'debug' | 'info' | 'warn' | 'error' = 'info'
20
+ ): Logger {
21
+ // 配置文件日志输出
22
+ const dailyRotateFile = new transports.DailyRotateFile({
23
+ // 指定日志文件的名称和路径
24
+ filename: `%DATE%.log`,
25
+ dirname: path,
26
+ datePattern: 'YYYY-MM-DD',
27
+ // 使用自定义打印格式
28
+ format: format.printf(
29
+ info => `[${dayjs().format('YYYY-MM-DD HH:mm:ss')}]${name ? `[${name}]` : ''}[${info.level}] ${info.message}`
30
+ ),
31
+ maxSize: '16k',
32
+ zippedArchive: true
33
+ });
34
+
35
+ // 配置控制台日志输出
36
+ const console = new transports.Console({
37
+ // 结合颜色格式化和自定义打印格式
38
+ format: format.combine(
39
+ format.colorize(),
40
+ format.printf(
41
+ info => `[${dayjs().format('YYYY-MM-DD HH:mm:ss')}]${name ? `[${name}]` : ''}[${info.level}] ${info.message}`
42
+ )
43
+ )
44
+ });
45
+
46
+ // 使用winston的createLogger方法创建并返回一个Logger实例
47
+ return createLogger({
48
+ // 设置日志级别
49
+ level: logLevel,
50
+ // 配置日志传输(输出)的方式,包括控制台和文件
51
+ transports: [console, dailyRotateFile]
52
+ });
53
+ }
54
+ }