@pcontext/api 0.0.1
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 +151 -0
- package/dist/app.d.mts +44779 -0
- package/dist/app.d.mts.map +1 -0
- package/dist/app.mjs +37 -0
- package/dist/app.mjs.map +1 -0
- package/dist/client.d.mts +22428 -0
- package/dist/client.d.mts.map +1 -0
- package/dist/client.mjs +15 -0
- package/dist/client.mjs.map +1 -0
- package/dist/dev.d.mts +11 -0
- package/dist/dev.d.mts.map +1 -0
- package/dist/dev.mjs +16 -0
- package/dist/dev.mjs.map +1 -0
- package/dist/index.d.mts +3 -0
- package/dist/index.mjs +10 -0
- package/dist/index.mjs.map +1 -0
- package/dist/modules/doc/chat.route.d.mts +18 -0
- package/dist/modules/doc/chat.route.d.mts.map +1 -0
- package/dist/modules/doc/chat.route.mjs +20 -0
- package/dist/modules/doc/chat.route.mjs.map +1 -0
- package/dist/modules/doc/chat.service.d.mts +10 -0
- package/dist/modules/doc/chat.service.d.mts.map +1 -0
- package/dist/modules/doc/chat.service.mjs +29 -0
- package/dist/modules/doc/chat.service.mjs.map +1 -0
- package/dist/modules/doc/doc.dto.d.mts +67 -0
- package/dist/modules/doc/doc.dto.d.mts.map +1 -0
- package/dist/modules/doc/doc.dto.mjs +43 -0
- package/dist/modules/doc/doc.dto.mjs.map +1 -0
- package/dist/modules/doc/doc.entity.d.mts +19 -0
- package/dist/modules/doc/doc.entity.d.mts.map +1 -0
- package/dist/modules/doc/doc.entity.mjs +1 -0
- package/dist/modules/doc/doc.repo.interface.d.mts +28 -0
- package/dist/modules/doc/doc.repo.interface.d.mts.map +1 -0
- package/dist/modules/doc/doc.repo.interface.mjs +1 -0
- package/dist/modules/doc/doc.route.d.mts +14193 -0
- package/dist/modules/doc/doc.route.d.mts.map +1 -0
- package/dist/modules/doc/doc.route.mjs +100 -0
- package/dist/modules/doc/doc.route.mjs.map +1 -0
- package/dist/modules/doc/doc.service.d.mts +38 -0
- package/dist/modules/doc/doc.service.d.mts.map +1 -0
- package/dist/modules/doc/doc.service.mjs +134 -0
- package/dist/modules/doc/doc.service.mjs.map +1 -0
- package/dist/modules/doc/doc.vo.d.mts +17 -0
- package/dist/modules/doc/doc.vo.d.mts.map +1 -0
- package/dist/modules/doc/doc.vo.mjs +1 -0
- package/dist/modules/doc/infrastructure/agent/engine/chat.d.mts +21 -0
- package/dist/modules/doc/infrastructure/agent/engine/chat.d.mts.map +1 -0
- package/dist/modules/doc/infrastructure/agent/engine/chat.mjs +36 -0
- package/dist/modules/doc/infrastructure/agent/engine/chat.mjs.map +1 -0
- package/dist/modules/doc/infrastructure/agent/engine/generate.d.mts +28 -0
- package/dist/modules/doc/infrastructure/agent/engine/generate.d.mts.map +1 -0
- package/dist/modules/doc/infrastructure/agent/engine/generate.mjs +135 -0
- package/dist/modules/doc/infrastructure/agent/engine/generate.mjs.map +1 -0
- package/dist/modules/doc/infrastructure/agent/engine/query-filter.d.mts +7 -0
- package/dist/modules/doc/infrastructure/agent/engine/query-filter.d.mts.map +1 -0
- package/dist/modules/doc/infrastructure/agent/engine/query-filter.mjs +12 -0
- package/dist/modules/doc/infrastructure/agent/engine/query-filter.mjs.map +1 -0
- package/dist/modules/doc/infrastructure/agent/loaders/git-repository-reader.d.mts +54 -0
- package/dist/modules/doc/infrastructure/agent/loaders/git-repository-reader.d.mts.map +1 -0
- package/dist/modules/doc/infrastructure/agent/loaders/git-repository-reader.mjs +142 -0
- package/dist/modules/doc/infrastructure/agent/loaders/git-repository-reader.mjs.map +1 -0
- package/dist/modules/doc/infrastructure/agent/loaders/index.d.mts +3 -0
- package/dist/modules/doc/infrastructure/agent/loaders/index.mjs +4 -0
- package/dist/modules/doc/infrastructure/agent/loaders/website-crawl-reader.d.mts +42 -0
- package/dist/modules/doc/infrastructure/agent/loaders/website-crawl-reader.d.mts.map +1 -0
- package/dist/modules/doc/infrastructure/agent/loaders/website-crawl-reader.mjs +104 -0
- package/dist/modules/doc/infrastructure/agent/loaders/website-crawl-reader.mjs.map +1 -0
- package/dist/modules/doc/infrastructure/agent/settings.d.mts +5 -0
- package/dist/modules/doc/infrastructure/agent/settings.d.mts.map +1 -0
- package/dist/modules/doc/infrastructure/agent/settings.mjs +72 -0
- package/dist/modules/doc/infrastructure/agent/settings.mjs.map +1 -0
- package/dist/modules/doc/infrastructure/agent/storage/index.d.mts +7 -0
- package/dist/modules/doc/infrastructure/agent/storage/index.d.mts.map +1 -0
- package/dist/modules/doc/infrastructure/agent/storage/index.mjs +12 -0
- package/dist/modules/doc/infrastructure/agent/storage/index.mjs.map +1 -0
- package/dist/modules/doc/infrastructure/agent/storage/vector-store.d.mts +14 -0
- package/dist/modules/doc/infrastructure/agent/storage/vector-store.d.mts.map +1 -0
- package/dist/modules/doc/infrastructure/agent/storage/vector-store.mjs +35 -0
- package/dist/modules/doc/infrastructure/agent/storage/vector-store.mjs.map +1 -0
- package/dist/modules/doc/infrastructure/doc.po.d.mts +570 -0
- package/dist/modules/doc/infrastructure/doc.po.d.mts.map +1 -0
- package/dist/modules/doc/infrastructure/doc.po.mjs +54 -0
- package/dist/modules/doc/infrastructure/doc.po.mjs.map +1 -0
- package/dist/modules/doc/infrastructure/doc.repo.pg.d.mts +32 -0
- package/dist/modules/doc/infrastructure/doc.repo.pg.d.mts.map +1 -0
- package/dist/modules/doc/infrastructure/doc.repo.pg.mjs +157 -0
- package/dist/modules/doc/infrastructure/doc.repo.pg.mjs.map +1 -0
- package/dist/modules/doc/infrastructure/doc.repo.sqlite.d.mts +32 -0
- package/dist/modules/doc/infrastructure/doc.repo.sqlite.d.mts.map +1 -0
- package/dist/modules/doc/infrastructure/doc.repo.sqlite.mjs +153 -0
- package/dist/modules/doc/infrastructure/doc.repo.sqlite.mjs.map +1 -0
- package/dist/modules/doc/mcp.route.d.mts +18 -0
- package/dist/modules/doc/mcp.route.d.mts.map +1 -0
- package/dist/modules/doc/mcp.route.mjs +39 -0
- package/dist/modules/doc/mcp.route.mjs.map +1 -0
- package/dist/modules/doc/mcp.service.d.mts +22 -0
- package/dist/modules/doc/mcp.service.d.mts.map +1 -0
- package/dist/modules/doc/mcp.service.mjs +119 -0
- package/dist/modules/doc/mcp.service.mjs.map +1 -0
- package/dist/modules/rank/rank.dto.d.mts +10 -0
- package/dist/modules/rank/rank.dto.d.mts.map +1 -0
- package/dist/modules/rank/rank.dto.mjs +8 -0
- package/dist/modules/rank/rank.dto.mjs.map +1 -0
- package/dist/modules/rank/rank.route.d.mts +2033 -0
- package/dist/modules/rank/rank.route.d.mts.map +1 -0
- package/dist/modules/rank/rank.route.mjs +20 -0
- package/dist/modules/rank/rank.route.mjs.map +1 -0
- package/dist/modules/rank/rank.service.d.mts +32 -0
- package/dist/modules/rank/rank.service.d.mts.map +1 -0
- package/dist/modules/rank/rank.service.mjs +3 -0
- package/dist/modules/rank/rank.vo.d.mts +9 -0
- package/dist/modules/rank/rank.vo.d.mts.map +1 -0
- package/dist/modules/rank/rank.vo.mjs +1 -0
- package/dist/modules/task/infrastructure/mq/task-context.d.mts +29 -0
- package/dist/modules/task/infrastructure/mq/task-context.d.mts.map +1 -0
- package/dist/modules/task/infrastructure/mq/task-context.mjs +70 -0
- package/dist/modules/task/infrastructure/mq/task-context.mjs.map +1 -0
- package/dist/modules/task/infrastructure/mq/task-queue.d.mts +10 -0
- package/dist/modules/task/infrastructure/mq/task-queue.d.mts.map +1 -0
- package/dist/modules/task/infrastructure/mq/task-queue.mjs +12 -0
- package/dist/modules/task/infrastructure/mq/task-queue.mjs.map +1 -0
- package/dist/modules/task/infrastructure/mq/task-worker.d.mts +13 -0
- package/dist/modules/task/infrastructure/mq/task-worker.d.mts.map +1 -0
- package/dist/modules/task/infrastructure/mq/task-worker.mjs +35 -0
- package/dist/modules/task/infrastructure/mq/task-worker.mjs.map +1 -0
- package/dist/modules/task/infrastructure/task.po.d.mts +1147 -0
- package/dist/modules/task/infrastructure/task.po.d.mts.map +1 -0
- package/dist/modules/task/infrastructure/task.po.mjs +55 -0
- package/dist/modules/task/infrastructure/task.po.mjs.map +1 -0
- package/dist/modules/task/infrastructure/task.repo.pg.d.mts +21 -0
- package/dist/modules/task/infrastructure/task.repo.pg.d.mts.map +1 -0
- package/dist/modules/task/infrastructure/task.repo.pg.mjs +86 -0
- package/dist/modules/task/infrastructure/task.repo.pg.mjs.map +1 -0
- package/dist/modules/task/infrastructure/task.repo.sqlite.d.mts +21 -0
- package/dist/modules/task/infrastructure/task.repo.sqlite.d.mts.map +1 -0
- package/dist/modules/task/infrastructure/task.repo.sqlite.mjs +89 -0
- package/dist/modules/task/infrastructure/task.repo.sqlite.mjs.map +1 -0
- package/dist/modules/task/task.dto.d.mts +26 -0
- package/dist/modules/task/task.dto.d.mts.map +1 -0
- package/dist/modules/task/task.dto.mjs +25 -0
- package/dist/modules/task/task.dto.mjs.map +1 -0
- package/dist/modules/task/task.entity.d.mts +43 -0
- package/dist/modules/task/task.entity.d.mts.map +1 -0
- package/dist/modules/task/task.entity.mjs +1 -0
- package/dist/modules/task/task.repo.interface.d.mts +17 -0
- package/dist/modules/task/task.repo.interface.d.mts.map +1 -0
- package/dist/modules/task/task.repo.interface.mjs +1 -0
- package/dist/modules/task/task.route.d.mts +4087 -0
- package/dist/modules/task/task.route.d.mts.map +1 -0
- package/dist/modules/task/task.route.mjs +63 -0
- package/dist/modules/task/task.route.mjs.map +1 -0
- package/dist/modules/task/task.service.d.mts +28 -0
- package/dist/modules/task/task.service.d.mts.map +1 -0
- package/dist/modules/task/task.service.mjs +202 -0
- package/dist/modules/task/task.service.mjs.map +1 -0
- package/dist/modules/task/task.vo.d.mts +18 -0
- package/dist/modules/task/task.vo.d.mts.map +1 -0
- package/dist/modules/task/task.vo.mjs +1 -0
- package/dist/modules/user/application/user.service.d.mts +24 -0
- package/dist/modules/user/application/user.service.d.mts.map +1 -0
- package/dist/modules/user/application/user.service.mjs +153 -0
- package/dist/modules/user/application/user.service.mjs.map +1 -0
- package/dist/modules/user/domain/user.entity.d.mts +24 -0
- package/dist/modules/user/domain/user.entity.d.mts.map +1 -0
- package/dist/modules/user/domain/user.entity.mjs +35 -0
- package/dist/modules/user/domain/user.entity.mjs.map +1 -0
- package/dist/modules/user/domain/user.repo.interface.d.mts +27 -0
- package/dist/modules/user/domain/user.repo.interface.d.mts.map +1 -0
- package/dist/modules/user/domain/user.repo.interface.mjs +1 -0
- package/dist/modules/user/infrastructure/casbin/adapter.d.mts +7 -0
- package/dist/modules/user/infrastructure/casbin/adapter.d.mts.map +1 -0
- package/dist/modules/user/infrastructure/casbin/adapter.mjs +13 -0
- package/dist/modules/user/infrastructure/casbin/adapter.mjs.map +1 -0
- package/dist/modules/user/infrastructure/casbin/adapter.pg.d.mts +19 -0
- package/dist/modules/user/infrastructure/casbin/adapter.pg.d.mts.map +1 -0
- package/dist/modules/user/infrastructure/casbin/adapter.pg.mjs +129 -0
- package/dist/modules/user/infrastructure/casbin/adapter.pg.mjs.map +1 -0
- package/dist/modules/user/infrastructure/casbin/adapter.sqlite.d.mts +19 -0
- package/dist/modules/user/infrastructure/casbin/adapter.sqlite.d.mts.map +1 -0
- package/dist/modules/user/infrastructure/casbin/adapter.sqlite.mjs +129 -0
- package/dist/modules/user/infrastructure/casbin/adapter.sqlite.mjs.map +1 -0
- package/dist/modules/user/infrastructure/casbin/enforcer.d.mts +9 -0
- package/dist/modules/user/infrastructure/casbin/enforcer.d.mts.map +1 -0
- package/dist/modules/user/infrastructure/casbin/enforcer.mjs +150 -0
- package/dist/modules/user/infrastructure/casbin/enforcer.mjs.map +1 -0
- package/dist/modules/user/infrastructure/casbin-rule.po.d.mts +643 -0
- package/dist/modules/user/infrastructure/casbin-rule.po.d.mts.map +1 -0
- package/dist/modules/user/infrastructure/casbin-rule.po.mjs +30 -0
- package/dist/modules/user/infrastructure/casbin-rule.po.mjs.map +1 -0
- package/dist/modules/user/infrastructure/user.po.d.mts +392 -0
- package/dist/modules/user/infrastructure/user.po.d.mts.map +1 -0
- package/dist/modules/user/infrastructure/user.po.mjs +34 -0
- package/dist/modules/user/infrastructure/user.po.mjs.map +1 -0
- package/dist/modules/user/infrastructure/user.repo.pg.d.mts +24 -0
- package/dist/modules/user/infrastructure/user.repo.pg.d.mts.map +1 -0
- package/dist/modules/user/infrastructure/user.repo.pg.mjs +90 -0
- package/dist/modules/user/infrastructure/user.repo.pg.mjs.map +1 -0
- package/dist/modules/user/infrastructure/user.repo.sqlite.d.mts +24 -0
- package/dist/modules/user/infrastructure/user.repo.sqlite.d.mts.map +1 -0
- package/dist/modules/user/infrastructure/user.repo.sqlite.mjs +88 -0
- package/dist/modules/user/infrastructure/user.repo.sqlite.mjs.map +1 -0
- package/dist/modules/user/interfaces/admin.route.d.mts +8270 -0
- package/dist/modules/user/interfaces/admin.route.d.mts.map +1 -0
- package/dist/modules/user/interfaces/admin.route.mjs +74 -0
- package/dist/modules/user/interfaces/admin.route.mjs.map +1 -0
- package/dist/modules/user/interfaces/role.route.d.mts +102 -0
- package/dist/modules/user/interfaces/role.route.d.mts.map +1 -0
- package/dist/modules/user/interfaces/role.route.mjs +60 -0
- package/dist/modules/user/interfaces/role.route.mjs.map +1 -0
- package/dist/modules/user/interfaces/user.dto.d.mts +106 -0
- package/dist/modules/user/interfaces/user.dto.d.mts.map +1 -0
- package/dist/modules/user/interfaces/user.dto.mjs +32 -0
- package/dist/modules/user/interfaces/user.dto.mjs.map +1 -0
- package/dist/modules/user/interfaces/user.route.d.mts +2093 -0
- package/dist/modules/user/interfaces/user.route.d.mts.map +1 -0
- package/dist/modules/user/interfaces/user.route.mjs +69 -0
- package/dist/modules/user/interfaces/user.route.mjs.map +1 -0
- package/dist/modules/user/interfaces/user.vo.d.mts +28 -0
- package/dist/modules/user/interfaces/user.vo.d.mts.map +1 -0
- package/dist/modules/user/interfaces/user.vo.mjs +18 -0
- package/dist/modules/user/interfaces/user.vo.mjs.map +1 -0
- package/dist/rank.service-D2h-2iJA.mjs +109 -0
- package/dist/rank.service-D2h-2iJA.mjs.map +1 -0
- package/dist/settings.d.mts +12 -0
- package/dist/settings.d.mts.map +1 -0
- package/dist/settings.mjs +27 -0
- package/dist/settings.mjs.map +1 -0
- package/dist/shared/create-app.d.mts +13 -0
- package/dist/shared/create-app.d.mts.map +1 -0
- package/dist/shared/create-app.mjs +45 -0
- package/dist/shared/create-app.mjs.map +1 -0
- package/dist/shared/db/bootstrap.d.mts +5 -0
- package/dist/shared/db/bootstrap.d.mts.map +1 -0
- package/dist/shared/db/bootstrap.mjs +51 -0
- package/dist/shared/db/bootstrap.mjs.map +1 -0
- package/dist/shared/db/connection.d.mts +1567 -0
- package/dist/shared/db/connection.d.mts.map +1 -0
- package/dist/shared/db/connection.mjs +59 -0
- package/dist/shared/db/connection.mjs.map +1 -0
- package/dist/shared/db/migrations/pg/0000_init.sql +74 -0
- package/dist/shared/db/migrations/pg/0001_snippets & tokens.sql +6 -0
- package/dist/shared/db/migrations/pg/0002_change_task_id_to_uuid_v7.sql +3 -0
- package/dist/shared/db/migrations/pg/meta/0000_snapshot.json +498 -0
- package/dist/shared/db/migrations/pg/meta/0001_snapshot.json +513 -0
- package/dist/shared/db/migrations/pg/meta/0002_snapshot.json +514 -0
- package/dist/shared/db/migrations/pg/meta/_journal.json +27 -0
- package/dist/shared/db/migrations/sqlite/0000_init.sql +72 -0
- package/dist/shared/db/migrations/sqlite/0001_snippets & tokens.sql +2 -0
- package/dist/shared/db/migrations/sqlite/0002_change_task_id_to_uuid_v7.sql +35 -0
- package/dist/shared/db/migrations/sqlite/meta/0000_snapshot.json +493 -0
- package/dist/shared/db/migrations/sqlite/meta/0001_snapshot.json +509 -0
- package/dist/shared/db/migrations/sqlite/meta/0002_snapshot.json +509 -0
- package/dist/shared/db/migrations/sqlite/meta/_journal.json +27 -0
- package/dist/shared/db/seed.d.mts +5 -0
- package/dist/shared/db/seed.d.mts.map +1 -0
- package/dist/shared/db/seed.mjs +42 -0
- package/dist/shared/db/seed.mjs.map +1 -0
- package/dist/shared/deps.d.mts +28 -0
- package/dist/shared/deps.d.mts.map +1 -0
- package/dist/shared/deps.mjs +69 -0
- package/dist/shared/deps.mjs.map +1 -0
- package/dist/shared/dto/index.d.mts +11 -0
- package/dist/shared/dto/index.d.mts.map +1 -0
- package/dist/shared/dto/index.mjs +11 -0
- package/dist/shared/dto/index.mjs.map +1 -0
- package/dist/shared/logger.d.mts +14 -0
- package/dist/shared/logger.d.mts.map +1 -0
- package/dist/shared/logger.mjs +37 -0
- package/dist/shared/logger.mjs.map +1 -0
- package/dist/shared/mcp/createTool.d.mts +15 -0
- package/dist/shared/mcp/createTool.d.mts.map +1 -0
- package/dist/shared/mcp/createTool.mjs +8 -0
- package/dist/shared/mcp/createTool.mjs.map +1 -0
- package/dist/shared/middleware/authorization.d.mts +15 -0
- package/dist/shared/middleware/authorization.d.mts.map +1 -0
- package/dist/shared/middleware/authorization.mjs +46 -0
- package/dist/shared/middleware/authorization.mjs.map +1 -0
- package/dist/shared/middleware/http-logger.d.mts +7 -0
- package/dist/shared/middleware/http-logger.d.mts.map +1 -0
- package/dist/shared/middleware/http-logger.mjs +40 -0
- package/dist/shared/middleware/http-logger.mjs.map +1 -0
- package/dist/shared/middleware/jwt.d.mts +7 -0
- package/dist/shared/middleware/jwt.d.mts.map +1 -0
- package/dist/shared/middleware/jwt.mjs +34 -0
- package/dist/shared/middleware/jwt.mjs.map +1 -0
- package/dist/shared/middleware/limiter.d.mts +7 -0
- package/dist/shared/middleware/limiter.d.mts.map +1 -0
- package/dist/shared/middleware/limiter.mjs +10 -0
- package/dist/shared/middleware/limiter.mjs.map +1 -0
- package/dist/shared/middleware/services.d.mts +8 -0
- package/dist/shared/middleware/services.d.mts.map +1 -0
- package/dist/shared/middleware/services.mjs +19 -0
- package/dist/shared/middleware/services.mjs.map +1 -0
- package/dist/shared/redis/decorator.d.mts +113 -0
- package/dist/shared/redis/decorator.d.mts.map +1 -0
- package/dist/shared/redis/decorator.mjs +203 -0
- package/dist/shared/redis/decorator.mjs.map +1 -0
- package/dist/shared/redis/factory.d.mts +18 -0
- package/dist/shared/redis/factory.d.mts.map +1 -0
- package/dist/shared/redis/factory.mjs +41 -0
- package/dist/shared/redis/factory.mjs.map +1 -0
- package/dist/shared/redis/index.d.mts +12 -0
- package/dist/shared/redis/index.d.mts.map +1 -0
- package/dist/shared/redis/index.mjs +14 -0
- package/dist/shared/redis/index.mjs.map +1 -0
- package/dist/shared/types.d.mts +36 -0
- package/dist/shared/types.d.mts.map +1 -0
- package/dist/shared/types.mjs +1 -0
- package/dist/shared/utils/date.d.mts +1 -0
- package/dist/shared/utils/date.mjs +1 -0
- package/dist/shared/utils/error-handler.d.mts +7 -0
- package/dist/shared/utils/error-handler.d.mts.map +1 -0
- package/dist/shared/utils/error-handler.mjs +22 -0
- package/dist/shared/utils/error-handler.mjs.map +1 -0
- package/dist/shared/utils/format.d.mts +8 -0
- package/dist/shared/utils/format.d.mts.map +1 -0
- package/dist/shared/utils/format.mjs +24 -0
- package/dist/shared/utils/format.mjs.map +1 -0
- package/dist/shared/utils/pagination.d.mts +9 -0
- package/dist/shared/utils/pagination.d.mts.map +1 -0
- package/dist/shared/utils/pagination.mjs +12 -0
- package/dist/shared/utils/pagination.mjs.map +1 -0
- package/dist/shared/utils/response-template.d.mts +69 -0
- package/dist/shared/utils/response-template.d.mts.map +1 -0
- package/dist/shared/utils/response-template.mjs +96 -0
- package/dist/shared/utils/response-template.mjs.map +1 -0
- package/dist/shared/utils/url.d.mts +18 -0
- package/dist/shared/utils/url.d.mts.map +1 -0
- package/dist/shared/utils/url.mjs +39 -0
- package/dist/shared/utils/url.mjs.map +1 -0
- package/dist/shared/utils/user.d.mts +8 -0
- package/dist/shared/utils/user.d.mts.map +1 -0
- package/dist/shared/utils/user.mjs +11 -0
- package/dist/shared/utils/user.mjs.map +1 -0
- package/dist/shared/utils/validator.d.mts +5984 -0
- package/dist/shared/utils/validator.d.mts.map +1 -0
- package/dist/shared/utils/validator.mjs +34 -0
- package/dist/shared/utils/validator.mjs.map +1 -0
- package/dist/shared/vo/index.d.mts +11 -0
- package/dist/shared/vo/index.d.mts.map +1 -0
- package/dist/shared/vo/index.mjs +1 -0
- package/package.json +86 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
//#region src/shared/utils/response-template.ts
|
|
2
|
+
function Res200(data, message = "Success") {
|
|
3
|
+
return {
|
|
4
|
+
code: 200,
|
|
5
|
+
data,
|
|
6
|
+
message
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
function Res201(data, message = "Created") {
|
|
10
|
+
return {
|
|
11
|
+
code: 201,
|
|
12
|
+
data,
|
|
13
|
+
message
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
function Res204(data = null, message = "No Content") {
|
|
17
|
+
return {
|
|
18
|
+
code: 204,
|
|
19
|
+
data,
|
|
20
|
+
message
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function Res400(data = null, message = "Bad Request") {
|
|
24
|
+
return {
|
|
25
|
+
code: 400,
|
|
26
|
+
data,
|
|
27
|
+
message
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function Res401(data = null, message = "Unauthorized") {
|
|
31
|
+
return {
|
|
32
|
+
code: 401,
|
|
33
|
+
data,
|
|
34
|
+
message
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function Res403(data = null, message = "Forbidden") {
|
|
38
|
+
return {
|
|
39
|
+
code: 403,
|
|
40
|
+
data,
|
|
41
|
+
message
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function Res404(data = null, message = "Not Found") {
|
|
45
|
+
return {
|
|
46
|
+
code: 404,
|
|
47
|
+
data,
|
|
48
|
+
message
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function Res405(data = null, message = "Method Not Allowed") {
|
|
52
|
+
return {
|
|
53
|
+
code: 405,
|
|
54
|
+
data,
|
|
55
|
+
message
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function Res409(data = null, message = "Conflict") {
|
|
59
|
+
return {
|
|
60
|
+
code: 409,
|
|
61
|
+
data,
|
|
62
|
+
message
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function Res422(data = null, message = "Unprocessable Entity") {
|
|
66
|
+
return {
|
|
67
|
+
code: 422,
|
|
68
|
+
data,
|
|
69
|
+
message
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
function Res429(data = null, message = "Too Many Requests") {
|
|
73
|
+
return {
|
|
74
|
+
code: 429,
|
|
75
|
+
data,
|
|
76
|
+
message
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function Res500(data = null, message = "Internal Server Error") {
|
|
80
|
+
return {
|
|
81
|
+
code: 500,
|
|
82
|
+
data,
|
|
83
|
+
message
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function Res503(data = null, message = "Service Unavailable") {
|
|
87
|
+
return {
|
|
88
|
+
code: 503,
|
|
89
|
+
data,
|
|
90
|
+
message
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
//#endregion
|
|
95
|
+
export { Res200, Res201, Res204, Res400, Res401, Res403, Res404, Res405, Res409, Res422, Res429, Res500, Res503 };
|
|
96
|
+
//# sourceMappingURL=response-template.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response-template.mjs","names":[],"sources":["../../../src/shared/utils/response-template.ts"],"sourcesContent":["\nexport function Res200<T>(data: T, message: string = 'Success') {\n return {\n code: 200,\n data,\n message,\n }\n}\n\nexport function Res201<T>(data: T, message: string = 'Created') {\n return {\n code: 201,\n data,\n message,\n }\n}\n\nexport function Res204<T>(data: T | null = null, message: string = 'No Content') {\n return {\n code: 204,\n data,\n message,\n }\n}\n\nexport function Res400<T>(data: T | null = null, message: string = 'Bad Request') {\n return {\n code: 400,\n data,\n message,\n }\n}\n\nexport function Res401<T>(data: T | null = null, message: string = 'Unauthorized') {\n return {\n code: 401,\n data,\n message,\n }\n}\n\nexport function Res403<T>(data: T | null = null, message: string = 'Forbidden') {\n return {\n code: 403,\n data,\n message,\n }\n}\n\nexport function Res404<T>(data: T | null = null, message: string = 'Not Found') {\n return {\n code: 404,\n data,\n message,\n }\n}\n\nexport function Res405<T>(data: T | null = null, message: string = 'Method Not Allowed') {\n return {\n code: 405,\n data,\n message,\n }\n}\n\nexport function Res409<T>(data: T | null = null, message: string = 'Conflict') {\n return {\n code: 409,\n data,\n message,\n }\n}\n\nexport function Res422<T>(data: T | null = null, message: string = 'Unprocessable Entity') {\n return {\n code: 422,\n data,\n message,\n }\n}\n\nexport function Res429<T>(data: T | null = null, message: string = 'Too Many Requests') {\n return {\n code: 429,\n data,\n message,\n }\n}\n\nexport function Res500<T>(data: T | null = null, message: string = 'Internal Server Error') {\n return {\n code: 500,\n data,\n message,\n }\n}\n\nexport function Res503<T>(data: T | null = null, message: string = 'Service Unavailable') {\n return {\n code: 503,\n data,\n message,\n }\n}\n"],"mappings":";AACA,SAAgB,OAAU,MAAS,UAAkB,WAAW;AAC9D,QAAO;EACL,MAAM;EACN;EACA;EACD;;AAGH,SAAgB,OAAU,MAAS,UAAkB,WAAW;AAC9D,QAAO;EACL,MAAM;EACN;EACA;EACD;;AAGH,SAAgB,OAAU,OAAiB,MAAM,UAAkB,cAAc;AAC/E,QAAO;EACL,MAAM;EACN;EACA;EACD;;AAGH,SAAgB,OAAU,OAAiB,MAAM,UAAkB,eAAe;AAChF,QAAO;EACL,MAAM;EACN;EACA;EACD;;AAGH,SAAgB,OAAU,OAAiB,MAAM,UAAkB,gBAAgB;AACjF,QAAO;EACL,MAAM;EACN;EACA;EACD;;AAGH,SAAgB,OAAU,OAAiB,MAAM,UAAkB,aAAa;AAC9E,QAAO;EACL,MAAM;EACN;EACA;EACD;;AAGH,SAAgB,OAAU,OAAiB,MAAM,UAAkB,aAAa;AAC9E,QAAO;EACL,MAAM;EACN;EACA;EACD;;AAGH,SAAgB,OAAU,OAAiB,MAAM,UAAkB,sBAAsB;AACvF,QAAO;EACL,MAAM;EACN;EACA;EACD;;AAGH,SAAgB,OAAU,OAAiB,MAAM,UAAkB,YAAY;AAC7E,QAAO;EACL,MAAM;EACN;EACA;EACD;;AAGH,SAAgB,OAAU,OAAiB,MAAM,UAAkB,wBAAwB;AACzF,QAAO;EACL,MAAM;EACN;EACA;EACD;;AAGH,SAAgB,OAAU,OAAiB,MAAM,UAAkB,qBAAqB;AACtF,QAAO;EACL,MAAM;EACN;EACA;EACD;;AAGH,SAAgB,OAAU,OAAiB,MAAM,UAAkB,yBAAyB;AAC1F,QAAO;EACL,MAAM;EACN;EACA;EACD;;AAGH,SAAgB,OAAU,OAAiB,MAAM,UAAkB,uBAAuB;AACxF,QAAO;EACL,MAAM;EACN;EACA;EACD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DocSourceEnumDTO } from "../../modules/doc/doc.dto.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/shared/utils/url.d.ts
|
|
4
|
+
interface DocIdentifier {
|
|
5
|
+
slug: string;
|
|
6
|
+
docName: string;
|
|
7
|
+
}
|
|
8
|
+
declare function buildGitDocIdentifier(url: string): DocIdentifier;
|
|
9
|
+
declare function buildWebsiteDocIdentifier(rawUrl: string): DocIdentifier;
|
|
10
|
+
declare function buildDocIdentifiersFromUrl(url: string, source: DocSourceEnumDTO): DocIdentifier;
|
|
11
|
+
interface DenoisedPage {
|
|
12
|
+
url: string;
|
|
13
|
+
title: string;
|
|
14
|
+
markdown: string;
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { DenoisedPage, DocIdentifier, buildDocIdentifiersFromUrl, buildGitDocIdentifier, buildWebsiteDocIdentifier };
|
|
18
|
+
//# sourceMappingURL=url.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url.d.mts","names":[],"sources":["../../../src/shared/utils/url.ts"],"mappings":";;;UAGiB,aAAA;EACf,IAAA;EACA,OAAA;AAAA;AAAA,iBAiBc,qBAAA,CAAsB,GAAA,WAAc,aAAA;AAAA,iBAYpC,yBAAA,CAA0B,MAAA,WAAiB,aAAA;AAAA,iBAW3C,0BAAA,CAA2B,GAAA,UAAa,MAAA,EAAQ,gBAAA,GAAmB,aAAA;AAAA,UAKlE,YAAA;EACf,GAAA;EACA,KAAA;EACA,QAAA;AAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import gitUrlParse from "git-url-parse";
|
|
2
|
+
|
|
3
|
+
//#region src/shared/utils/url.ts
|
|
4
|
+
function getDomainWithoutTld(hostname) {
|
|
5
|
+
const parts = hostname.split(".").filter(Boolean);
|
|
6
|
+
if (parts.length >= 2) return parts[parts.length - 2];
|
|
7
|
+
return parts[0] || "";
|
|
8
|
+
}
|
|
9
|
+
function getHostPartsWithoutTld(hostname) {
|
|
10
|
+
const parts = hostname.split(".").filter(Boolean);
|
|
11
|
+
if (parts.length <= 1) return parts;
|
|
12
|
+
return parts.slice(0, parts.length - 1);
|
|
13
|
+
}
|
|
14
|
+
function buildGitDocIdentifier(url) {
|
|
15
|
+
const parsed = gitUrlParse(url);
|
|
16
|
+
const domain = getDomainWithoutTld(parsed.resource || parsed.source || "");
|
|
17
|
+
const pathSegments = [parsed.owner || "", parsed.name || ""].filter(Boolean);
|
|
18
|
+
return {
|
|
19
|
+
slug: [domain, ...pathSegments].filter(Boolean).join("_"),
|
|
20
|
+
docName: pathSegments[pathSegments.length - 1] || domain
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function buildWebsiteDocIdentifier(rawUrl) {
|
|
24
|
+
const parsed = new URL(rawUrl);
|
|
25
|
+
const hostParts = getHostPartsWithoutTld(parsed.hostname);
|
|
26
|
+
const hostSlugPart = hostParts.join("_");
|
|
27
|
+
const pathSegments = parsed.pathname.split("/").filter(Boolean).slice(0, 2);
|
|
28
|
+
return {
|
|
29
|
+
slug: [hostSlugPart, ...pathSegments].filter(Boolean).join("_"),
|
|
30
|
+
docName: [hostParts.length >= 1 ? hostParts[hostParts.length - 1] : "", ...pathSegments].filter(Boolean).join(" ")
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function buildDocIdentifiersFromUrl(url, source) {
|
|
34
|
+
return source === "website" ? buildWebsiteDocIdentifier(url) : buildGitDocIdentifier(url);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
//#endregion
|
|
38
|
+
export { buildDocIdentifiersFromUrl, buildGitDocIdentifier, buildWebsiteDocIdentifier };
|
|
39
|
+
//# sourceMappingURL=url.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url.mjs","names":[],"sources":["../../../src/shared/utils/url.ts"],"sourcesContent":["import type { DocSourceEnumDTO } from '@/modules/doc/doc.dto'\nimport gitUrlParse from 'git-url-parse'\n\nexport interface DocIdentifier {\n slug: string\n docName: string\n}\n\nfunction getDomainWithoutTld(hostname: string) {\n const parts = hostname.split('.').filter(Boolean)\n if (parts.length >= 2)\n return parts[parts.length - 2]\n return parts[0] || ''\n}\n\nfunction getHostPartsWithoutTld(hostname: string) {\n const parts = hostname.split('.').filter(Boolean)\n if (parts.length <= 1)\n return parts\n return parts.slice(0, parts.length - 1)\n}\n\nexport function buildGitDocIdentifier(url: string): DocIdentifier {\n const parsed = gitUrlParse(url)\n const resource = parsed.resource || parsed.source || ''\n const domain = getDomainWithoutTld(resource)\n const owner = parsed.owner || ''\n const name = parsed.name || ''\n const pathSegments = [owner, name].filter(Boolean)\n const slug = [domain, ...pathSegments].filter(Boolean).join('_')\n const docName = pathSegments[pathSegments.length - 1] || domain\n return { slug, docName }\n}\n\nexport function buildWebsiteDocIdentifier(rawUrl: string): DocIdentifier {\n const parsed = new URL(rawUrl)\n const hostParts = getHostPartsWithoutTld(parsed.hostname)\n const hostSlugPart = hostParts.join('_')\n const pathSegments = parsed.pathname.split('/').filter(Boolean).slice(0, 2)\n const slug = [hostSlugPart, ...pathSegments].filter(Boolean).join('_')\n const secondLevel = hostParts.length >= 1 ? hostParts[hostParts.length - 1] : ''\n const docName = [secondLevel, ...pathSegments].filter(Boolean).join(' ')\n return { slug, docName }\n}\n\nexport function buildDocIdentifiersFromUrl(url: string, source: DocSourceEnumDTO): DocIdentifier {\n return source === 'website' ? buildWebsiteDocIdentifier(url) : buildGitDocIdentifier(url)\n}\n\n// 定义返回的数据结构\nexport interface DenoisedPage {\n url: string\n title: string\n markdown: string\n}\n"],"mappings":";;;AAQA,SAAS,oBAAoB,UAAkB;CAC7C,MAAM,QAAQ,SAAS,MAAM,IAAI,CAAC,OAAO,QAAQ;AACjD,KAAI,MAAM,UAAU,EAClB,QAAO,MAAM,MAAM,SAAS;AAC9B,QAAO,MAAM,MAAM;;AAGrB,SAAS,uBAAuB,UAAkB;CAChD,MAAM,QAAQ,SAAS,MAAM,IAAI,CAAC,OAAO,QAAQ;AACjD,KAAI,MAAM,UAAU,EAClB,QAAO;AACT,QAAO,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE;;AAGzC,SAAgB,sBAAsB,KAA4B;CAChE,MAAM,SAAS,YAAY,IAAI;CAE/B,MAAM,SAAS,oBADE,OAAO,YAAY,OAAO,UAAU,GACT;CAG5C,MAAM,eAAe,CAFP,OAAO,SAAS,IACjB,OAAO,QAAQ,GACM,CAAC,OAAO,QAAQ;AAGlD,QAAO;EAAE,MAFI,CAAC,QAAQ,GAAG,aAAa,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;EAEjD,SADC,aAAa,aAAa,SAAS,MAAM;EACjC;;AAG1B,SAAgB,0BAA0B,QAA+B;CACvE,MAAM,SAAS,IAAI,IAAI,OAAO;CAC9B,MAAM,YAAY,uBAAuB,OAAO,SAAS;CACzD,MAAM,eAAe,UAAU,KAAK,IAAI;CACxC,MAAM,eAAe,OAAO,SAAS,MAAM,IAAI,CAAC,OAAO,QAAQ,CAAC,MAAM,GAAG,EAAE;AAI3E,QAAO;EAAE,MAHI,CAAC,cAAc,GAAG,aAAa,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;EAGvD,SADC,CADI,UAAU,UAAU,IAAI,UAAU,UAAU,SAAS,KAAK,IAChD,GAAG,aAAa,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;EAChD;;AAG1B,SAAgB,2BAA2B,KAAa,QAAyC;AAC/F,QAAO,WAAW,YAAY,0BAA0B,IAAI,GAAG,sBAAsB,IAAI"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Context } from "hono";
|
|
2
|
+
|
|
3
|
+
//#region src/shared/utils/user.d.ts
|
|
4
|
+
declare function getCurrentUserId(c: Context): number;
|
|
5
|
+
declare function isAdmin(c: Context): boolean;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { getCurrentUserId, isAdmin };
|
|
8
|
+
//# sourceMappingURL=user.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.d.mts","names":[],"sources":["../../../src/shared/utils/user.ts"],"mappings":";;;iBAEgB,gBAAA,CAAiB,CAAA,EAAG,OAAA;AAAA,iBAKpB,OAAA,CAAQ,CAAA,EAAG,OAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/shared/utils/user.ts
|
|
2
|
+
function getCurrentUserId(c) {
|
|
3
|
+
return c.get("user")?.id;
|
|
4
|
+
}
|
|
5
|
+
function isAdmin(c) {
|
|
6
|
+
return c.get("user")?.role === "admin";
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
//#endregion
|
|
10
|
+
export { getCurrentUserId, isAdmin };
|
|
11
|
+
//# sourceMappingURL=user.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.mjs","names":[],"sources":["../../../src/shared/utils/user.ts"],"sourcesContent":["import type { Context } from 'hono'\n\nexport function getCurrentUserId(c: Context) {\n const user = c.get('user')\n return user?.id as number\n}\n\nexport function isAdmin(c: Context) {\n const user = c.get('user') as { role: 'admin' | 'user' | null } | undefined\n return user?.role === 'admin'\n}\n"],"mappings":";AAEA,SAAgB,iBAAiB,GAAY;AAE3C,QADa,EAAE,IAAI,OAAO,EACb;;AAGf,SAAgB,QAAQ,GAAY;AAElC,QADa,EAAE,IAAI,OAAO,EACb,SAAS"}
|