@reglow/reglow 0.4.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/README.md +267 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/reglow/common/errors.d.ts +92 -0
- package/dist/reglow/common/errors.js +127 -0
- package/dist/reglow/common/errors.js.map +1 -0
- package/dist/reglow/common/exception_handler.d.ts +14 -0
- package/dist/reglow/common/exception_handler.js +135 -0
- package/dist/reglow/common/exception_handler.js.map +1 -0
- package/dist/reglow/common/i18n.d.ts +15 -0
- package/dist/reglow/common/i18n.js +61 -0
- package/dist/reglow/common/i18n.js.map +1 -0
- package/dist/reglow/common/middleware.d.ts +5 -0
- package/dist/reglow/common/middleware.js +131 -0
- package/dist/reglow/common/middleware.js.map +1 -0
- package/dist/reglow/common/response.d.ts +28 -0
- package/dist/reglow/common/response.js +42 -0
- package/dist/reglow/common/response.js.map +1 -0
- package/dist/reglow/common/serialize.d.ts +6 -0
- package/dist/reglow/common/serialize.js +39 -0
- package/dist/reglow/common/serialize.js.map +1 -0
- package/dist/reglow/common/utils/date_utils.d.ts +10 -0
- package/dist/reglow/common/utils/date_utils.js +30 -0
- package/dist/reglow/common/utils/date_utils.js.map +1 -0
- package/dist/reglow/common/utils/parse-user-agent.d.ts +11 -0
- package/dist/reglow/common/utils/parse-user-agent.js +80 -0
- package/dist/reglow/common/utils/parse-user-agent.js.map +1 -0
- package/dist/reglow/common/utils/string_utils.d.ts +14 -0
- package/dist/reglow/common/utils/string_utils.js +31 -0
- package/dist/reglow/common/utils/string_utils.js.map +1 -0
- package/dist/reglow/core/auth.d.ts +15 -0
- package/dist/reglow/core/auth.js +184 -0
- package/dist/reglow/core/auth.js.map +1 -0
- package/dist/reglow/core/cache.d.ts +6 -0
- package/dist/reglow/core/cache.js +15 -0
- package/dist/reglow/core/cache.js.map +1 -0
- package/dist/reglow/core/config.d.ts +45 -0
- package/dist/reglow/core/config.js +83 -0
- package/dist/reglow/core/config.js.map +1 -0
- package/dist/reglow/core/data_scope.d.ts +21 -0
- package/dist/reglow/core/data_scope.js +20 -0
- package/dist/reglow/core/data_scope.js.map +1 -0
- package/dist/reglow/core/database.d.ts +4 -0
- package/dist/reglow/core/database.js +43 -0
- package/dist/reglow/core/database.js.map +1 -0
- package/dist/reglow/core/email.d.ts +12 -0
- package/dist/reglow/core/email.js +277 -0
- package/dist/reglow/core/email.js.map +1 -0
- package/dist/reglow/core/entities.d.ts +462 -0
- package/dist/reglow/core/entities.js +6 -0
- package/dist/reglow/core/entities.js.map +1 -0
- package/dist/reglow/core/fastify.d.ts +21 -0
- package/dist/reglow/core/fastify.js +2 -0
- package/dist/reglow/core/fastify.js.map +1 -0
- package/dist/reglow/core/logging.d.ts +8 -0
- package/dist/reglow/core/logging.js +32 -0
- package/dist/reglow/core/logging.js.map +1 -0
- package/dist/reglow/core/models.d.ts +98 -0
- package/dist/reglow/core/models.js +57 -0
- package/dist/reglow/core/models.js.map +1 -0
- package/dist/reglow/core/observability.d.ts +17 -0
- package/dist/reglow/core/observability.js +92 -0
- package/dist/reglow/core/observability.js.map +1 -0
- package/dist/reglow/core/payment.d.ts +107 -0
- package/dist/reglow/core/payment.js +1177 -0
- package/dist/reglow/core/payment.js.map +1 -0
- package/dist/reglow/core/plugin.d.ts +19 -0
- package/dist/reglow/core/plugin.js +85 -0
- package/dist/reglow/core/plugin.js.map +1 -0
- package/dist/reglow/core/rate_limit.d.ts +2 -0
- package/dist/reglow/core/rate_limit.js +28 -0
- package/dist/reglow/core/rate_limit.js.map +1 -0
- package/dist/reglow/core/redis.d.ts +30 -0
- package/dist/reglow/core/redis.js +278 -0
- package/dist/reglow/core/redis.js.map +1 -0
- package/dist/reglow/core/redis_keys.d.ts +22 -0
- package/dist/reglow/core/redis_keys.js +59 -0
- package/dist/reglow/core/redis_keys.js.map +1 -0
- package/dist/reglow/core/security.d.ts +25 -0
- package/dist/reglow/core/security.js +64 -0
- package/dist/reglow/core/security.js.map +1 -0
- package/dist/reglow/core/session.d.ts +17 -0
- package/dist/reglow/core/session.js +194 -0
- package/dist/reglow/core/session.js.map +1 -0
- package/dist/reglow/core/sms.d.ts +19 -0
- package/dist/reglow/core/sms.js +33 -0
- package/dist/reglow/core/sms.js.map +1 -0
- package/dist/reglow/core/storage.d.ts +45 -0
- package/dist/reglow/core/storage.js +249 -0
- package/dist/reglow/core/storage.js.map +1 -0
- package/dist/reglow/modules/agreement/controller.d.ts +7 -0
- package/dist/reglow/modules/agreement/controller.js +242 -0
- package/dist/reglow/modules/agreement/controller.js.map +1 -0
- package/dist/reglow/modules/agreement/repository.d.ts +30 -0
- package/dist/reglow/modules/agreement/repository.js +160 -0
- package/dist/reglow/modules/agreement/repository.js.map +1 -0
- package/dist/reglow/modules/agreement/router.d.ts +13 -0
- package/dist/reglow/modules/agreement/router.js +10 -0
- package/dist/reglow/modules/agreement/router.js.map +1 -0
- package/dist/reglow/modules/agreement/schema.d.ts +30 -0
- package/dist/reglow/modules/agreement/schema.js +27 -0
- package/dist/reglow/modules/agreement/schema.js.map +1 -0
- package/dist/reglow/modules/agreement/service.d.ts +42 -0
- package/dist/reglow/modules/agreement/service.js +349 -0
- package/dist/reglow/modules/agreement/service.js.map +1 -0
- package/dist/reglow/modules/ai/controller.d.ts +25 -0
- package/dist/reglow/modules/ai/controller.js +1143 -0
- package/dist/reglow/modules/ai/controller.js.map +1 -0
- package/dist/reglow/modules/ai/router.d.ts +9 -0
- package/dist/reglow/modules/ai/router.js +7 -0
- package/dist/reglow/modules/ai/router.js.map +1 -0
- package/dist/reglow/modules/ai/schema.d.ts +48 -0
- package/dist/reglow/modules/ai/schema.js +40 -0
- package/dist/reglow/modules/ai/schema.js.map +1 -0
- package/dist/reglow/modules/ai/service.d.ts +8 -0
- package/dist/reglow/modules/ai/service.js +137 -0
- package/dist/reglow/modules/ai/service.js.map +1 -0
- package/dist/reglow/modules/article/controller.d.ts +6 -0
- package/dist/reglow/modules/article/controller.js +204 -0
- package/dist/reglow/modules/article/controller.js.map +1 -0
- package/dist/reglow/modules/article/repository.d.ts +37 -0
- package/dist/reglow/modules/article/repository.js +184 -0
- package/dist/reglow/modules/article/repository.js.map +1 -0
- package/dist/reglow/modules/article/router.d.ts +10 -0
- package/dist/reglow/modules/article/router.js +8 -0
- package/dist/reglow/modules/article/router.js.map +1 -0
- package/dist/reglow/modules/article/schema.d.ts +66 -0
- package/dist/reglow/modules/article/schema.js +66 -0
- package/dist/reglow/modules/article/schema.js.map +1 -0
- package/dist/reglow/modules/article/service.d.ts +81 -0
- package/dist/reglow/modules/article/service.js +254 -0
- package/dist/reglow/modules/article/service.js.map +1 -0
- package/dist/reglow/modules/auth/controller.d.ts +6 -0
- package/dist/reglow/modules/auth/controller.js +127 -0
- package/dist/reglow/modules/auth/controller.js.map +1 -0
- package/dist/reglow/modules/auth/router.d.ts +9 -0
- package/dist/reglow/modules/auth/router.js +7 -0
- package/dist/reglow/modules/auth/router.js.map +1 -0
- package/dist/reglow/modules/auth/schema.d.ts +59 -0
- package/dist/reglow/modules/auth/schema.js +56 -0
- package/dist/reglow/modules/auth/schema.js.map +1 -0
- package/dist/reglow/modules/auth/service.d.ts +69 -0
- package/dist/reglow/modules/auth/service.js +492 -0
- package/dist/reglow/modules/auth/service.js.map +1 -0
- package/dist/reglow/modules/config/controller.d.ts +7 -0
- package/dist/reglow/modules/config/controller.js +297 -0
- package/dist/reglow/modules/config/controller.js.map +1 -0
- package/dist/reglow/modules/config/repository.d.ts +17 -0
- package/dist/reglow/modules/config/repository.js +88 -0
- package/dist/reglow/modules/config/repository.js.map +1 -0
- package/dist/reglow/modules/config/router.d.ts +13 -0
- package/dist/reglow/modules/config/router.js +8 -0
- package/dist/reglow/modules/config/router.js.map +1 -0
- package/dist/reglow/modules/config/schema.d.ts +37 -0
- package/dist/reglow/modules/config/schema.js +25 -0
- package/dist/reglow/modules/config/schema.js.map +1 -0
- package/dist/reglow/modules/customer_service/controller.d.ts +3 -0
- package/dist/reglow/modules/customer_service/controller.js +443 -0
- package/dist/reglow/modules/customer_service/controller.js.map +1 -0
- package/dist/reglow/modules/customer_service/document_parser.d.ts +5 -0
- package/dist/reglow/modules/customer_service/document_parser.js +84 -0
- package/dist/reglow/modules/customer_service/document_parser.js.map +1 -0
- package/dist/reglow/modules/customer_service/repository.d.ts +72 -0
- package/dist/reglow/modules/customer_service/repository.js +376 -0
- package/dist/reglow/modules/customer_service/repository.js.map +1 -0
- package/dist/reglow/modules/customer_service/router.d.ts +14 -0
- package/dist/reglow/modules/customer_service/router.js +9 -0
- package/dist/reglow/modules/customer_service/router.js.map +1 -0
- package/dist/reglow/modules/customer_service/schema.d.ts +97 -0
- package/dist/reglow/modules/customer_service/schema.js +91 -0
- package/dist/reglow/modules/customer_service/schema.js.map +1 -0
- package/dist/reglow/modules/customer_service/sdk_template.html +666 -0
- package/dist/reglow/modules/customer_service/service.d.ts +92 -0
- package/dist/reglow/modules/customer_service/service.js +1642 -0
- package/dist/reglow/modules/customer_service/service.js.map +1 -0
- package/dist/reglow/modules/customer_service/ws.d.ts +29 -0
- package/dist/reglow/modules/customer_service/ws.js +182 -0
- package/dist/reglow/modules/customer_service/ws.js.map +1 -0
- package/dist/reglow/modules/dept/controller.d.ts +6 -0
- package/dist/reglow/modules/dept/controller.js +122 -0
- package/dist/reglow/modules/dept/controller.js.map +1 -0
- package/dist/reglow/modules/dept/repository.d.ts +24 -0
- package/dist/reglow/modules/dept/repository.js +140 -0
- package/dist/reglow/modules/dept/repository.js.map +1 -0
- package/dist/reglow/modules/dept/router.d.ts +9 -0
- package/dist/reglow/modules/dept/router.js +7 -0
- package/dist/reglow/modules/dept/router.js.map +1 -0
- package/dist/reglow/modules/dept/schema.d.ts +37 -0
- package/dist/reglow/modules/dept/schema.js +33 -0
- package/dist/reglow/modules/dept/schema.js.map +1 -0
- package/dist/reglow/modules/dept/service.d.ts +33 -0
- package/dist/reglow/modules/dept/service.js +88 -0
- package/dist/reglow/modules/dept/service.js.map +1 -0
- package/dist/reglow/modules/dict/controller.d.ts +5 -0
- package/dist/reglow/modules/dict/controller.js +87 -0
- package/dist/reglow/modules/dict/controller.js.map +1 -0
- package/dist/reglow/modules/dict/model.d.ts +7 -0
- package/dist/reglow/modules/dict/model.js +8 -0
- package/dist/reglow/modules/dict/model.js.map +1 -0
- package/dist/reglow/modules/dict/repository.d.ts +16 -0
- package/dist/reglow/modules/dict/repository.js +103 -0
- package/dist/reglow/modules/dict/repository.js.map +1 -0
- package/dist/reglow/modules/dict/router.d.ts +9 -0
- package/dist/reglow/modules/dict/router.js +7 -0
- package/dist/reglow/modules/dict/router.js.map +1 -0
- package/dist/reglow/modules/dict/schema.d.ts +38 -0
- package/dist/reglow/modules/dict/schema.js +37 -0
- package/dist/reglow/modules/dict/schema.js.map +1 -0
- package/dist/reglow/modules/dict/service.d.ts +15 -0
- package/dist/reglow/modules/dict/service.js +88 -0
- package/dist/reglow/modules/dict/service.js.map +1 -0
- package/dist/reglow/modules/employee/controller.d.ts +6 -0
- package/dist/reglow/modules/employee/controller.js +167 -0
- package/dist/reglow/modules/employee/controller.js.map +1 -0
- package/dist/reglow/modules/employee/repository.d.ts +22 -0
- package/dist/reglow/modules/employee/repository.js +129 -0
- package/dist/reglow/modules/employee/repository.js.map +1 -0
- package/dist/reglow/modules/employee/router.d.ts +9 -0
- package/dist/reglow/modules/employee/router.js +7 -0
- package/dist/reglow/modules/employee/router.js.map +1 -0
- package/dist/reglow/modules/employee/schema.d.ts +57 -0
- package/dist/reglow/modules/employee/schema.js +58 -0
- package/dist/reglow/modules/employee/schema.js.map +1 -0
- package/dist/reglow/modules/employee/service.d.ts +30 -0
- package/dist/reglow/modules/employee/service.js +193 -0
- package/dist/reglow/modules/employee/service.js.map +1 -0
- package/dist/reglow/modules/log/controller.d.ts +6 -0
- package/dist/reglow/modules/log/controller.js +137 -0
- package/dist/reglow/modules/log/controller.js.map +1 -0
- package/dist/reglow/modules/log/data-scope.d.ts +9 -0
- package/dist/reglow/modules/log/data-scope.js +108 -0
- package/dist/reglow/modules/log/data-scope.js.map +1 -0
- package/dist/reglow/modules/log/router.d.ts +9 -0
- package/dist/reglow/modules/log/router.js +7 -0
- package/dist/reglow/modules/log/router.js.map +1 -0
- package/dist/reglow/modules/material/controller.d.ts +3 -0
- package/dist/reglow/modules/material/controller.js +400 -0
- package/dist/reglow/modules/material/controller.js.map +1 -0
- package/dist/reglow/modules/material/repository.d.ts +37 -0
- package/dist/reglow/modules/material/repository.js +183 -0
- package/dist/reglow/modules/material/repository.js.map +1 -0
- package/dist/reglow/modules/material/router.d.ts +14 -0
- package/dist/reglow/modules/material/router.js +11 -0
- package/dist/reglow/modules/material/router.js.map +1 -0
- package/dist/reglow/modules/material/schema.d.ts +40 -0
- package/dist/reglow/modules/material/schema.js +34 -0
- package/dist/reglow/modules/material/schema.js.map +1 -0
- package/dist/reglow/modules/material/service.d.ts +85 -0
- package/dist/reglow/modules/material/service.js +292 -0
- package/dist/reglow/modules/material/service.js.map +1 -0
- package/dist/reglow/modules/menu/controller.d.ts +6 -0
- package/dist/reglow/modules/menu/controller.js +69 -0
- package/dist/reglow/modules/menu/controller.js.map +1 -0
- package/dist/reglow/modules/menu/repository.d.ts +14 -0
- package/dist/reglow/modules/menu/repository.js +37 -0
- package/dist/reglow/modules/menu/repository.js.map +1 -0
- package/dist/reglow/modules/menu/router.d.ts +9 -0
- package/dist/reglow/modules/menu/router.js +7 -0
- package/dist/reglow/modules/menu/router.js.map +1 -0
- package/dist/reglow/modules/menu/schema.d.ts +39 -0
- package/dist/reglow/modules/menu/schema.js +37 -0
- package/dist/reglow/modules/menu/schema.js.map +1 -0
- package/dist/reglow/modules/menu/service.d.ts +31 -0
- package/dist/reglow/modules/menu/service.js +89 -0
- package/dist/reglow/modules/menu/service.js.map +1 -0
- package/dist/reglow/modules/message/controller.d.ts +7 -0
- package/dist/reglow/modules/message/controller.js +260 -0
- package/dist/reglow/modules/message/controller.js.map +1 -0
- package/dist/reglow/modules/message/repository.d.ts +27 -0
- package/dist/reglow/modules/message/repository.js +145 -0
- package/dist/reglow/modules/message/repository.js.map +1 -0
- package/dist/reglow/modules/message/router.d.ts +13 -0
- package/dist/reglow/modules/message/router.js +8 -0
- package/dist/reglow/modules/message/router.js.map +1 -0
- package/dist/reglow/modules/message/schema.d.ts +39 -0
- package/dist/reglow/modules/message/schema.js +37 -0
- package/dist/reglow/modules/message/schema.js.map +1 -0
- package/dist/reglow/modules/message/service.d.ts +70 -0
- package/dist/reglow/modules/message/service.js +199 -0
- package/dist/reglow/modules/message/service.js.map +1 -0
- package/dist/reglow/modules/notice/controller.d.ts +6 -0
- package/dist/reglow/modules/notice/controller.js +123 -0
- package/dist/reglow/modules/notice/controller.js.map +1 -0
- package/dist/reglow/modules/notice/repository.d.ts +25 -0
- package/dist/reglow/modules/notice/repository.js +145 -0
- package/dist/reglow/modules/notice/repository.js.map +1 -0
- package/dist/reglow/modules/notice/router.d.ts +9 -0
- package/dist/reglow/modules/notice/router.js +7 -0
- package/dist/reglow/modules/notice/router.js.map +1 -0
- package/dist/reglow/modules/notice/schema.d.ts +23 -0
- package/dist/reglow/modules/notice/schema.js +22 -0
- package/dist/reglow/modules/notice/schema.js.map +1 -0
- package/dist/reglow/modules/notice/service.d.ts +45 -0
- package/dist/reglow/modules/notice/service.js +149 -0
- package/dist/reglow/modules/notice/service.js.map +1 -0
- package/dist/reglow/modules/payment/controller.d.ts +6 -0
- package/dist/reglow/modules/payment/controller.js +186 -0
- package/dist/reglow/modules/payment/controller.js.map +1 -0
- package/dist/reglow/modules/payment/router.d.ts +10 -0
- package/dist/reglow/modules/payment/router.js +8 -0
- package/dist/reglow/modules/payment/router.js.map +1 -0
- package/dist/reglow/modules/payment/schema.d.ts +52 -0
- package/dist/reglow/modules/payment/schema.js +43 -0
- package/dist/reglow/modules/payment/schema.js.map +1 -0
- package/dist/reglow/modules/payment/service.d.ts +28 -0
- package/dist/reglow/modules/payment/service.js +219 -0
- package/dist/reglow/modules/payment/service.js.map +1 -0
- package/dist/reglow/modules/photo/controller.d.ts +2 -0
- package/dist/reglow/modules/photo/controller.js +323 -0
- package/dist/reglow/modules/photo/controller.js.map +1 -0
- package/dist/reglow/modules/photo/controller_client.d.ts +2 -0
- package/dist/reglow/modules/photo/controller_client.js +293 -0
- package/dist/reglow/modules/photo/controller_client.js.map +1 -0
- package/dist/reglow/modules/photo/repository.d.ts +50 -0
- package/dist/reglow/modules/photo/repository.js +240 -0
- package/dist/reglow/modules/photo/repository.js.map +1 -0
- package/dist/reglow/modules/photo/router.d.ts +15 -0
- package/dist/reglow/modules/photo/router.js +10 -0
- package/dist/reglow/modules/photo/router.js.map +1 -0
- package/dist/reglow/modules/photo/schema.d.ts +69 -0
- package/dist/reglow/modules/photo/schema.js +66 -0
- package/dist/reglow/modules/photo/schema.js.map +1 -0
- package/dist/reglow/modules/photo/service.d.ts +98 -0
- package/dist/reglow/modules/photo/service.js +295 -0
- package/dist/reglow/modules/photo/service.js.map +1 -0
- package/dist/reglow/modules/post/controller.d.ts +6 -0
- package/dist/reglow/modules/post/controller.js +61 -0
- package/dist/reglow/modules/post/controller.js.map +1 -0
- package/dist/reglow/modules/post/repository.d.ts +12 -0
- package/dist/reglow/modules/post/repository.js +46 -0
- package/dist/reglow/modules/post/repository.js.map +1 -0
- package/dist/reglow/modules/post/router.d.ts +9 -0
- package/dist/reglow/modules/post/router.js +7 -0
- package/dist/reglow/modules/post/router.js.map +1 -0
- package/dist/reglow/modules/post/schema.d.ts +19 -0
- package/dist/reglow/modules/post/schema.js +18 -0
- package/dist/reglow/modules/post/schema.js.map +1 -0
- package/dist/reglow/modules/post/service.d.ts +18 -0
- package/dist/reglow/modules/post/service.js +44 -0
- package/dist/reglow/modules/post/service.js.map +1 -0
- package/dist/reglow/modules/role/controller.d.ts +6 -0
- package/dist/reglow/modules/role/controller.js +103 -0
- package/dist/reglow/modules/role/controller.js.map +1 -0
- package/dist/reglow/modules/role/repository.d.ts +22 -0
- package/dist/reglow/modules/role/repository.js +84 -0
- package/dist/reglow/modules/role/repository.js.map +1 -0
- package/dist/reglow/modules/role/router.d.ts +9 -0
- package/dist/reglow/modules/role/router.js +7 -0
- package/dist/reglow/modules/role/router.js.map +1 -0
- package/dist/reglow/modules/role/schema.d.ts +32 -0
- package/dist/reglow/modules/role/schema.js +29 -0
- package/dist/reglow/modules/role/schema.js.map +1 -0
- package/dist/reglow/modules/role/service.d.ts +22 -0
- package/dist/reglow/modules/role/service.js +72 -0
- package/dist/reglow/modules/role/service.js.map +1 -0
- package/dist/reglow/modules/user/controller.d.ts +6 -0
- package/dist/reglow/modules/user/controller.js +126 -0
- package/dist/reglow/modules/user/controller.js.map +1 -0
- package/dist/reglow/modules/user/controller_client.d.ts +2 -0
- package/dist/reglow/modules/user/controller_client.js +291 -0
- package/dist/reglow/modules/user/controller_client.js.map +1 -0
- package/dist/reglow/modules/user/repository.d.ts +12 -0
- package/dist/reglow/modules/user/repository.js +71 -0
- package/dist/reglow/modules/user/repository.js.map +1 -0
- package/dist/reglow/modules/user/router.d.ts +16 -0
- package/dist/reglow/modules/user/router.js +11 -0
- package/dist/reglow/modules/user/router.js.map +1 -0
- package/dist/reglow/modules/user/schema.d.ts +92 -0
- package/dist/reglow/modules/user/schema.js +82 -0
- package/dist/reglow/modules/user/schema.js.map +1 -0
- package/dist/reglow/modules/user/service.d.ts +43 -0
- package/dist/reglow/modules/user/service.js +311 -0
- package/dist/reglow/modules/user/service.js.map +1 -0
- package/dist/reglow/modules/video/controller.d.ts +2 -0
- package/dist/reglow/modules/video/controller.js +254 -0
- package/dist/reglow/modules/video/controller.js.map +1 -0
- package/dist/reglow/modules/video/repository.d.ts +38 -0
- package/dist/reglow/modules/video/repository.js +186 -0
- package/dist/reglow/modules/video/repository.js.map +1 -0
- package/dist/reglow/modules/video/router.d.ts +10 -0
- package/dist/reglow/modules/video/router.js +8 -0
- package/dist/reglow/modules/video/router.js.map +1 -0
- package/dist/reglow/modules/video/schema.d.ts +62 -0
- package/dist/reglow/modules/video/schema.js +61 -0
- package/dist/reglow/modules/video/schema.js.map +1 -0
- package/dist/reglow/modules/video/service.d.ts +80 -0
- package/dist/reglow/modules/video/service.js +251 -0
- package/dist/reglow/modules/video/service.js.map +1 -0
- package/dist/reglow/scripts/init-data.d.ts +44 -0
- package/dist/reglow/scripts/init-data.js +472 -0
- package/dist/reglow/scripts/init-data.js.map +1 -0
- package/dist/reglow/scripts/remove-business-menu.d.ts +1 -0
- package/dist/reglow/scripts/remove-business-menu.js +124 -0
- package/dist/reglow/scripts/remove-business-menu.js.map +1 -0
- package/dist/reglow/scripts/schema.d.ts +9 -0
- package/dist/reglow/scripts/schema.js +746 -0
- package/dist/reglow/scripts/schema.js.map +1 -0
- package/dist/reglow/scripts/sync-menu-mysql-to-sqlite.d.ts +1 -0
- package/dist/reglow/scripts/sync-menu-mysql-to-sqlite.js +304 -0
- package/dist/reglow/scripts/sync-menu-mysql-to-sqlite.js.map +1 -0
- package/dist/server.d.ts +1 -0
- package/dist/server.js +162 -0
- package/dist/server.js.map +1 -0
- package/package.json +79 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../../reglow/core/models.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,QAAQ,EAAE,cAAc;IACxB,YAAY,EAAE,mBAAmB;IACjC,YAAY,EAAE,mBAAmB;IACjC,IAAI,EAAE,UAAU;IAChB,QAAQ,EAAE,eAAe;IACzB,QAAQ,EAAE,eAAe;IACzB,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,UAAU;IAEhB,SAAS,EAAE,YAAY;IACvB,UAAU,EAAE,aAAa;IACzB,YAAY,EAAE,mBAAmB;IACjC,QAAQ,EAAE,eAAe;IAEzB,IAAI,EAAE,UAAU;IAChB,SAAS,EAAE,gBAAgB;IAC3B,aAAa,EAAE,oBAAoB;IAEnC,QAAQ,EAAE,eAAe;IACzB,QAAQ,EAAE,eAAe;IAEzB,QAAQ,EAAE,cAAc;IACxB,aAAa,EAAE,oBAAoB;IACnC,qBAAqB,EAAE,6BAA6B;IAEpD,OAAO,EAAE,aAAa;IACtB,eAAe,EAAE,sBAAsB;IACvC,MAAM,EAAE,YAAY;IACpB,UAAU,EAAE,iBAAiB;IAE7B,SAAS,EAAE,eAAe;IAC1B,gBAAgB,EAAE,uBAAuB;IAEzC,OAAO,EAAE,aAAa;IACtB,eAAe,EAAE,sBAAsB;IACvC,iBAAiB,EAAE,wBAAwB;IAE3C,KAAK,EAAE,WAAW;IAClB,UAAU,EAAE,iBAAiB;IAC7B,aAAa,EAAE,oBAAoB;IAEnC,KAAK,EAAE,WAAW;IAClB,aAAa,EAAE,oBAAoB;IACnC,eAAe,EAAE,sBAAsB;IAEvC,YAAY,EAAE,eAAe;IAE7B,QAAQ,EAAE,WAAW;IACrB,eAAe,EAAE,mBAAmB;IACpC,gBAAgB,EAAE,oBAAoB;IACtC,UAAU,EAAE,cAAc;IAC1B,SAAS,EAAE,YAAY;IACvB,OAAO,EAAE,UAAU;IACnB,SAAS,EAAE,YAAY;CACf,CAAC;AAIX,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,GAAG,UAAU;IACb,GAAG,CAAC,IAA6B;QAC/B,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 健康检查与 Prometheus 指标
|
|
3
|
+
* 对应 backend-python 的 reglow/core/observability.py
|
|
4
|
+
*/
|
|
5
|
+
import type { FastifyInstance } from "fastify";
|
|
6
|
+
export declare function resetMetricsForTest(): void;
|
|
7
|
+
export declare function recordRequestMetric(method: string, path: string, status: number, durationSeconds: number): void;
|
|
8
|
+
export declare function generateMetrics(): string;
|
|
9
|
+
export declare function health(): Promise<Record<string, unknown>>;
|
|
10
|
+
export declare function readiness(): Promise<Record<string, unknown>>;
|
|
11
|
+
export declare function registerObservabilityRoutes(fastify: FastifyInstance): void;
|
|
12
|
+
export declare class MetricsTimer {
|
|
13
|
+
private startedAt;
|
|
14
|
+
duration: number;
|
|
15
|
+
constructor();
|
|
16
|
+
stop(): number;
|
|
17
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import settings from "./config.js";
|
|
2
|
+
import { knex } from "./database.js";
|
|
3
|
+
import { getRedisStore } from "./redis.js";
|
|
4
|
+
const requestCounts = new Map();
|
|
5
|
+
const requestDurationSum = new Map();
|
|
6
|
+
function keyOf(method, path, status) {
|
|
7
|
+
return `${method}|${path}|${status}`;
|
|
8
|
+
}
|
|
9
|
+
export function resetMetricsForTest() {
|
|
10
|
+
requestCounts.clear();
|
|
11
|
+
requestDurationSum.clear();
|
|
12
|
+
}
|
|
13
|
+
export function recordRequestMetric(method, path, status, durationSeconds) {
|
|
14
|
+
const key = keyOf(method, path, status);
|
|
15
|
+
requestCounts.set(key, (requestCounts.get(key) || 0) + 1);
|
|
16
|
+
requestDurationSum.set(key, (requestDurationSum.get(key) || 0) + durationSeconds);
|
|
17
|
+
}
|
|
18
|
+
function escapeLabel(value) {
|
|
19
|
+
return value
|
|
20
|
+
.replace(/\\/g, "\\\\")
|
|
21
|
+
.replace(/"/g, '\\"')
|
|
22
|
+
.replace(/\n/g, "\\n");
|
|
23
|
+
}
|
|
24
|
+
export function generateMetrics() {
|
|
25
|
+
const lines = [
|
|
26
|
+
"# HELP reglow_http_requests_total Total HTTP requests.",
|
|
27
|
+
"# TYPE reglow_http_requests_total counter",
|
|
28
|
+
];
|
|
29
|
+
const countEntries = Array.from(requestCounts.entries()).sort((a, b) => a[0].localeCompare(b[0]));
|
|
30
|
+
for (const [key, count] of countEntries) {
|
|
31
|
+
const [method, path, status] = key.split("|");
|
|
32
|
+
const labels = `method="${escapeLabel(method)}",path="${escapeLabel(path)}",status="${escapeLabel(status)}"`;
|
|
33
|
+
lines.push(`reglow_http_requests_total{${labels}} ${count}`);
|
|
34
|
+
}
|
|
35
|
+
lines.push("# HELP reglow_http_request_duration_seconds_sum Total HTTP request duration in seconds.", "# TYPE reglow_http_request_duration_seconds_sum counter");
|
|
36
|
+
const durationEntries = Array.from(requestDurationSum.entries()).sort((a, b) => a[0].localeCompare(b[0]));
|
|
37
|
+
for (const [key, duration] of durationEntries) {
|
|
38
|
+
const [method, path, status] = key.split("|");
|
|
39
|
+
const labels = `method="${escapeLabel(method)}",path="${escapeLabel(path)}",status="${escapeLabel(status)}"`;
|
|
40
|
+
lines.push(`reglow_http_request_duration_seconds_sum{${labels}} ${duration.toFixed(6)}`);
|
|
41
|
+
}
|
|
42
|
+
return lines.join("\n") + "\n";
|
|
43
|
+
}
|
|
44
|
+
async function checkDatabase() {
|
|
45
|
+
try {
|
|
46
|
+
await knex.raw("SELECT 1");
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
async function checkRedis() {
|
|
54
|
+
try {
|
|
55
|
+
return await getRedisStore().ping();
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
export async function health() {
|
|
62
|
+
return { status: "ok", version: settings.APP_VERSION };
|
|
63
|
+
}
|
|
64
|
+
export async function readiness() {
|
|
65
|
+
const databaseOk = await checkDatabase();
|
|
66
|
+
const redisOk = await checkRedis();
|
|
67
|
+
const checks = { database: databaseOk, redis: redisOk };
|
|
68
|
+
const status = databaseOk && redisOk ? "ok" : "degraded";
|
|
69
|
+
return { status, checks };
|
|
70
|
+
}
|
|
71
|
+
export function registerObservabilityRoutes(fastify) {
|
|
72
|
+
fastify.get("/health", async () => health());
|
|
73
|
+
fastify.get("/health/live", async () => health());
|
|
74
|
+
fastify.get("/health/ready", async () => readiness());
|
|
75
|
+
fastify.get("/metrics", async (_req, reply) => {
|
|
76
|
+
void reply.type("text/plain; version=0.0.4; charset=utf-8");
|
|
77
|
+
return generateMetrics();
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
export class MetricsTimer {
|
|
81
|
+
startedAt;
|
|
82
|
+
duration = 0;
|
|
83
|
+
constructor() {
|
|
84
|
+
this.startedAt = process.hrtime();
|
|
85
|
+
}
|
|
86
|
+
stop() {
|
|
87
|
+
const [s, ns] = process.hrtime(this.startedAt);
|
|
88
|
+
this.duration = s + ns / 1e9;
|
|
89
|
+
return this.duration;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=observability.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observability.js","sourceRoot":"","sources":["../../../reglow/core/observability.ts"],"names":[],"mappings":"AAKA,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,aAAa,GAAG,IAAI,GAAG,EAAkB,CAAC;AAChD,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAkB,CAAC;AAErD,SAAS,KAAK,CAAC,MAAc,EAAE,IAAY,EAAE,MAAc;IACzD,OAAO,GAAG,MAAM,IAAI,IAAI,IAAI,MAAM,EAAE,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,mBAAmB;IACjC,aAAa,CAAC,KAAK,EAAE,CAAC;IACtB,kBAAkB,CAAC,KAAK,EAAE,CAAC;AAC7B,CAAC;AAED,MAAM,UAAU,mBAAmB,CACjC,MAAc,EACd,IAAY,EACZ,MAAc,EACd,eAAuB;IAEvB,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IACxC,aAAa,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,C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msg: string;
|
|
4
|
+
qrCode: string;
|
|
5
|
+
tradeNo: string;
|
|
6
|
+
outTradeNo: string;
|
|
7
|
+
payParams: Record<string, unknown>;
|
|
8
|
+
raw: Record<string, unknown>;
|
|
9
|
+
}
|
|
10
|
+
export interface CallbackResult {
|
|
11
|
+
success: boolean;
|
|
12
|
+
msg: string;
|
|
13
|
+
outTradeNo: string;
|
|
14
|
+
tradeNo: string;
|
|
15
|
+
amount: number;
|
|
16
|
+
status: string;
|
|
17
|
+
}
|
|
18
|
+
export declare abstract class PaymentProvider {
|
|
19
|
+
provider_name: string;
|
|
20
|
+
abstract createTrade(outTradeNo: string, amountCents: number, subject: string, notifyUrl: string): Promise<PaymentResult>;
|
|
21
|
+
createTradeByPlatform(outTradeNo: string, amountCents: number, subject: string, notifyUrl: string, _platform?: string, _openid?: string, _buyerId?: string, _payerIp?: string): Promise<PaymentResult>;
|
|
22
|
+
abstract queryTrade(outTradeNo: string): Promise<PaymentResult>;
|
|
23
|
+
abstract verifyCallback(headers: Record<string, string>, body: Buffer): Promise<CallbackResult>;
|
|
24
|
+
successResponse(): string;
|
|
25
|
+
}
|
|
26
|
+
export declare class MockPaymentProvider extends PaymentProvider {
|
|
27
|
+
provider_name: string;
|
|
28
|
+
createTrade(outTradeNo: string, amountCents: number, _subject: string, _notifyUrl: string): Promise<PaymentResult>;
|
|
29
|
+
createTradeByPlatform(outTradeNo: string, amountCents: number, subject: string, notifyUrl: string, platform?: string): Promise<PaymentResult>;
|
|
30
|
+
queryTrade(outTradeNo: string): Promise<PaymentResult>;
|
|
31
|
+
verifyCallback(_headers: Record<string, string>, body: Buffer): Promise<CallbackResult>;
|
|
32
|
+
}
|
|
33
|
+
export declare class AlipayProvider extends PaymentProvider {
|
|
34
|
+
provider_name: string;
|
|
35
|
+
private appId;
|
|
36
|
+
private appPrivateKey;
|
|
37
|
+
private alipayPublicKey;
|
|
38
|
+
private gateway;
|
|
39
|
+
private notifyUrl;
|
|
40
|
+
private returnUrl;
|
|
41
|
+
constructor(config: Record<string, string>);
|
|
42
|
+
private signParams;
|
|
43
|
+
private verifyParams;
|
|
44
|
+
private alipayPost;
|
|
45
|
+
private callAlipay;
|
|
46
|
+
createTrade(outTradeNo: string, amountCents: number, subject: string, notifyUrl: string): Promise<PaymentResult>;
|
|
47
|
+
createTradeCreate(outTradeNo: string, amountCents: number, subject: string, notifyUrl: string, buyerId: string): Promise<PaymentResult>;
|
|
48
|
+
createAppTrade(outTradeNo: string, amountCents: number, subject: string, notifyUrl: string): Promise<PaymentResult>;
|
|
49
|
+
createPageTrade(outTradeNo: string, amountCents: number, subject: string, notifyUrl: string, returnUrl?: string): Promise<PaymentResult>;
|
|
50
|
+
createWapTrade(outTradeNo: string, amountCents: number, subject: string, notifyUrl: string, returnUrl?: string): Promise<PaymentResult>;
|
|
51
|
+
createTradeByPlatform(outTradeNo: string, amountCents: number, subject: string, notifyUrl: string, platform?: string, _openid?: string, buyerId?: string): Promise<PaymentResult>;
|
|
52
|
+
queryTrade(outTradeNo: string): Promise<PaymentResult>;
|
|
53
|
+
verifyCallback(_headers: Record<string, string>, body: Buffer): Promise<CallbackResult>;
|
|
54
|
+
}
|
|
55
|
+
export declare class UnionPayProvider extends PaymentProvider {
|
|
56
|
+
provider_name: string;
|
|
57
|
+
static TEST_GATEWAY: string;
|
|
58
|
+
static PROD_GATEWAY: string;
|
|
59
|
+
private merId;
|
|
60
|
+
private gateway;
|
|
61
|
+
private notifyUrl;
|
|
62
|
+
private privateKey;
|
|
63
|
+
private publicKey;
|
|
64
|
+
constructor(config: Record<string, string>);
|
|
65
|
+
private signParams;
|
|
66
|
+
private verifyParams;
|
|
67
|
+
private post;
|
|
68
|
+
createTrade(outTradeNo: string, amountCents: number, _subject: string, notifyUrl: string): Promise<PaymentResult>;
|
|
69
|
+
createAppTrade(outTradeNo: string, amountCents: number, _subject: string, notifyUrl: string): Promise<PaymentResult>;
|
|
70
|
+
createTradeByPlatform(outTradeNo: string, amountCents: number, subject: string, notifyUrl: string, platform?: string): Promise<PaymentResult>;
|
|
71
|
+
queryTrade(outTradeNo: string): Promise<PaymentResult>;
|
|
72
|
+
verifyCallback(_headers: Record<string, string>, body: Buffer): Promise<CallbackResult>;
|
|
73
|
+
successResponse(): string;
|
|
74
|
+
}
|
|
75
|
+
export declare class WeChatPayProvider extends PaymentProvider {
|
|
76
|
+
provider_name: string;
|
|
77
|
+
static BASE_URL: string;
|
|
78
|
+
private appid;
|
|
79
|
+
private miniAppId;
|
|
80
|
+
private appAppId;
|
|
81
|
+
private appSecret;
|
|
82
|
+
private mchid;
|
|
83
|
+
private serialNo;
|
|
84
|
+
private privateKey;
|
|
85
|
+
private apiV3Key;
|
|
86
|
+
private notifyUrl;
|
|
87
|
+
constructor(config: Record<string, string>);
|
|
88
|
+
private buildAuth;
|
|
89
|
+
private v3Post;
|
|
90
|
+
createTrade(outTradeNo: string, amountCents: number, subject: string, notifyUrl: string): Promise<PaymentResult>;
|
|
91
|
+
private generateJsapiParams;
|
|
92
|
+
private generateAppParams;
|
|
93
|
+
createJsapiTrade(outTradeNo: string, amountCents: number, subject: string, notifyUrl: string, openid: string): Promise<PaymentResult>;
|
|
94
|
+
createH5Trade(outTradeNo: string, amountCents: number, subject: string, notifyUrl: string, payerIp: string): Promise<PaymentResult>;
|
|
95
|
+
createAppTrade(outTradeNo: string, amountCents: number, subject: string, notifyUrl: string): Promise<PaymentResult>;
|
|
96
|
+
/** 构造微信公众号网页授权跳转 URL(默认 snsapi_base 静默授权,仅拿 openid) */
|
|
97
|
+
buildOauthUrl(redirectUri: string, scope?: string, state?: string): string;
|
|
98
|
+
/** 用网页授权 code 换取 openid(snsapi_base 静默授权) */
|
|
99
|
+
getOpenidByCode(code: string): Promise<string>;
|
|
100
|
+
createTradeByPlatform(outTradeNo: string, amountCents: number, subject: string, notifyUrl: string, platform?: string, openid?: string, _buyerId?: string, payerIp?: string): Promise<PaymentResult>;
|
|
101
|
+
queryTrade(outTradeNo: string): Promise<PaymentResult>;
|
|
102
|
+
verifyCallback(_headers: Record<string, string>, body: Buffer): Promise<CallbackResult>;
|
|
103
|
+
successResponse(): string;
|
|
104
|
+
}
|
|
105
|
+
export declare function createPaymentProvider(providerName: string, config: Record<string, string>): PaymentProvider;
|
|
106
|
+
export declare function getPaymentSettings(): Promise<Record<string, string>>;
|
|
107
|
+
export declare function getActiveProvider(config: Record<string, string>): string;
|