From ffdc153a3d020d77eb039b3082e1cc1a1a18a106 Mon Sep 17 00:00:00 2001 From: Innei Date: Sun, 4 Jun 2023 14:42:20 +0800 Subject: [PATCH] refactor: monorepo structure (#1082) --- .eslintrc.cjs | 6 +- .../workflows/{build.yml => build-core.yml} | 2 +- .github/workflows/release.yml | 7 +- .github/workflows/test.yml | 14 +- .gitignore | 8 - README.md | 4 +- apps/core/.gitignore | 10 + .../core}/download-latest-admin-assets.js | 2 +- .../core/ecosystem.config.js | 0 .../core/ecosystem.dev.config.js | 0 apps/core/external/pino/index.js | 24 + apps/core/external/pino/package.json | 4 + apps/core/external/readme.md | 1 + apps/core/external/request/index.js | 3 + apps/core/external/request/package.json | 4 + .../core}/get-latest-admin-version.js | 6 +- global.d.ts => apps/core/global.d.ts | 1 + nest-cli.json => apps/core/nest-cli.json | 0 apps/core/package.json | 163 +++++ {src => apps/core/src}/app.config.test.ts | 0 {src => apps/core/src}/app.config.ts | 0 {src => apps/core/src}/app.controller.ts | 0 {src => apps/core/src}/app.module.ts | 0 {src => apps/core/src}/bootstrap.ts | 0 {src => apps/core/src}/cluster.ts | 0 .../src}/common/adapters/fastify.adapter.ts | 0 .../src}/common/adapters/socket.adapter.ts | 0 .../decorators/api-controller.decorator.ts | 0 .../src}/common/decorators/auth.decorator.ts | 0 .../src}/common/decorators/cache.decorator.ts | 3 +- .../common/decorators/cookie.decorator.ts | 0 .../decorators/cron-description.decorator.ts | 0 .../common/decorators/cron-once.decorator.ts | 0 .../decorators/current-user.decorator.ts | 0 .../src}/common/decorators/demo.decorator.ts | 0 .../src}/common/decorators/http.decorator.ts | 0 .../src}/common/decorators/ip.decorator.ts | 0 .../decorators/response-filter.decorator.ts | 0 .../src}/common/decorators/role.decorator.ts | 0 .../decorators/update-count.decorator.ts | 0 .../exceptions/ban-in-demo.exception.ts | 0 .../src}/common/exceptions/biz.exception.ts | 0 .../common/exceptions/cant-find.exception.ts | 0 .../no-content-canbe-modified.exception.ts | 0 .../common/filters/any-exception.filter.ts | 0 .../core/src}/common/guards/auth.guard.ts | 0 .../core/src}/common/guards/roles.guard.ts | 0 .../core/src}/common/guards/spider.guard.ts | 0 .../allow-all-cors.interceptor.ts | 0 .../interceptors/analyze.interceptor.ts | 0 .../common/interceptors/cache.interceptor.ts | 0 .../interceptors/counting.interceptor.ts | 0 .../interceptors/db-query.interceptor.ts | 0 .../interceptors/idempotence.interceptor.ts | 0 .../json-transform.interceptor.ts | 0 .../interceptors/logging.interceptor.ts | 0 .../response-filter.interceptor.ts | 0 .../interceptors/response.interceptor.ts | 0 .../common/strategies/context.strategy.ts | 0 .../core/src}/constants/article.constant.ts | 0 .../src}/constants/business-event.constant.ts | 0 .../core/src}/constants/cache.constant.ts | 0 .../src}/constants/error-code.constant.ts | 0 .../core/src}/constants/event-bus.constant.ts | 0 .../core/src}/constants/meta.constant.ts | 0 .../core/src}/constants/other.constant.ts | 0 .../core/src}/constants/path.constant.ts | 0 .../core/src}/constants/system.constant.ts | 0 .../core/src}/global/consola.global.ts | 0 {src => apps/core/src}/global/dayjs.global.ts | 0 {src => apps/core/src}/global/env.global.ts | 0 {src => apps/core/src}/global/index.global.ts | 0 {src => apps/core/src}/global/json.global.ts | 0 {src => apps/core/src}/main.ts | 0 .../src}/migration/helper/encrypt-configs.ts | 0 {src => apps/core/src}/migration/history.ts | 0 {src => apps/core/src}/migration/migrate.ts | 0 .../src}/migration/version/v2.0.0-alpha.1.ts | 0 .../core/src}/migration/version/v3.30.0.ts | 0 .../core/src}/migration/version/v3.36.0.ts | 0 .../core/src}/migration/version/v3.39.3.ts | 0 .../modules/aggregate/aggregate.controller.ts | 3 +- .../src}/modules/aggregate/aggregate.dto.ts | 0 .../modules/aggregate/aggregate.interface.ts | 0 .../modules/aggregate/aggregate.module.ts | 0 .../modules/aggregate/aggregate.service.ts | 0 .../modules/analyze/analyze.controller.ts | 0 .../core/src}/modules/analyze/analyze.dto.ts | 0 .../src}/modules/analyze/analyze.model.ts | 0 .../src}/modules/analyze/analyze.module.ts | 0 .../src}/modules/analyze/analyze.service.ts | 0 .../core/src}/modules/auth/auth.controller.ts | 0 .../core/src}/modules/auth/auth.module.ts | 0 .../core/src}/modules/auth/auth.service.ts | 0 .../core/src}/modules/auth/oauth.dto.ts | 0 .../src}/modules/backup/backup.controller.ts | 0 .../core/src}/modules/backup/backup.module.ts | 0 .../src}/modules/backup/backup.service.ts | 0 .../modules/category/category.controller.ts | 0 .../src}/modules/category/category.dto.ts | 0 .../src}/modules/category/category.model.ts | 0 .../src}/modules/category/category.module.ts | 0 .../src}/modules/category/category.service.ts | 0 .../src}/modules/comment/block-keywords.json | 0 .../modules/comment/comment.controller.ts | 0 .../core/src}/modules/comment/comment.dto.ts | 0 .../modules/comment/comment.interceptor.ts | 0 .../src}/modules/comment/comment.model.ts | 0 .../src}/modules/comment/comment.module.ts | 0 .../src}/modules/comment/comment.service.ts | 0 .../src}/modules/configs/configs.default.ts | 0 .../core/src}/modules/configs/configs.dto.ts | 0 .../modules/configs/configs.encrypt.util.ts | 0 .../src}/modules/configs/configs.interface.ts | 0 .../configs/configs.jsonschema.decorator.ts | 0 .../src}/modules/configs/configs.model.ts | 0 .../src}/modules/configs/configs.module.ts | 0 .../src}/modules/configs/configs.service.ts | 0 .../src}/modules/debug/debug.controller.ts | 0 .../core/src}/modules/debug/debug.module.ts | 0 .../core/src}/modules/debug/debug.service.ts | 0 .../core/src}/modules/demo/demo.module.ts | 0 .../dependency/dependency.controller.ts | 0 .../modules/dependency/dependency.module.ts | 0 .../core/src}/modules/feed/feed.controller.ts | 3 +- .../core/src}/modules/feed/feed.module.ts | 0 .../core/src}/modules/file/file.controller.ts | 0 .../core/src}/modules/file/file.dto.ts | 0 .../core/src}/modules/file/file.module.ts | 0 .../core/src}/modules/file/file.service.ts | 0 .../core/src}/modules/file/file.type.ts | 0 .../src}/modules/health/health.controller.ts | 0 .../core/src}/modules/health/health.dto.ts | 0 .../core/src}/modules/health/health.module.ts | 0 .../health/sub-controller/cron.controller.ts | 0 .../health/sub-controller/log.controller.ts | 0 .../src}/modules/helper/helper.controller.ts | 0 .../core/src}/modules/helper/helper.module.ts | 0 .../src}/modules/helper/helper.service.ts | 0 .../core/src}/modules/init/init.controller.ts | 0 .../core/src}/modules/init/init.module.ts | 0 .../core/src}/modules/init/init.service.ts | 0 .../core/src}/modules/link/link.controller.ts | 0 .../core/src}/modules/link/link.dto.ts | 0 .../core/src}/modules/link/link.model.ts | 0 .../core/src}/modules/link/link.module.ts | 0 .../core/src}/modules/link/link.service.ts | 0 .../modules/markdown/markdown.controller.ts | 0 .../src}/modules/markdown/markdown.dto.ts | 0 .../modules/markdown/markdown.interface.ts | 0 .../src}/modules/markdown/markdown.module.ts | 0 .../src}/modules/markdown/markdown.service.ts | 0 .../modules/note/models/coordinate.model.ts | 0 .../src}/modules/note/models/music.model.ts | 0 .../core/src}/modules/note/note.controller.ts | 0 .../core/src}/modules/note/note.dto.ts | 0 .../core/src}/modules/note/note.model.ts | 0 .../core/src}/modules/note/note.module.ts | 0 .../core/src}/modules/note/note.service.ts | 0 .../controllers/base.option.controller.ts | 0 .../controllers/email.option.controller.ts | 0 .../src}/modules/option/dtoes/config.dto.ts | 0 .../src}/modules/option/dtoes/email.dto.ts | 0 .../src}/modules/option/option.decorator.ts | 0 .../core/src}/modules/option/option.model.ts | 0 .../core/src}/modules/option/option.module.ts | 0 .../core/src}/modules/page/page.controller.ts | 0 .../core/src}/modules/page/page.dto.ts | 0 .../core/src}/modules/page/page.model.ts | 0 .../core/src}/modules/page/page.module.ts | 0 .../core/src}/modules/page/page.service.ts | 0 .../modules/pageproxy/pageproxy.controller.ts | 0 .../src}/modules/pageproxy/pageproxy.dto.ts | 0 .../modules/pageproxy/pageproxy.module.ts | 0 .../modules/pageproxy/pageproxy.service.ts | 0 .../core/src}/modules/post/post.controller.ts | 0 .../core/src}/modules/post/post.dto.ts | 0 .../core/src}/modules/post/post.model.ts | 0 .../core/src}/modules/post/post.module.ts | 0 .../core/src}/modules/post/post.service.ts | 0 .../modules/project/project.controller.ts | 0 .../src}/modules/project/project.model.ts | 0 .../src}/modules/project/project.module.ts | 0 .../core/src}/modules/pty/pty.controller.ts | 0 .../core/src}/modules/pty/pty.gateway.ts | 0 .../core/src}/modules/pty/pty.module.ts | 0 .../core/src}/modules/pty/pty.service.ts | 0 .../modules/recently/recently.controller.ts | 0 .../src}/modules/recently/recently.dto.ts | 0 .../src}/modules/recently/recently.model.ts | 0 .../src}/modules/recently/recently.module.ts | 0 .../src}/modules/recently/recently.service.ts | 0 .../src}/modules/render/render.controller.ts | 0 .../core/src}/modules/render/render.module.ts | 0 .../core/src}/modules/say/say.controller.ts | 0 .../core/src}/modules/say/say.model.ts | 0 .../core/src}/modules/say/say.module.ts | 0 .../core/src}/modules/say/say.service.ts | 0 .../src}/modules/search/search.controller.ts | 0 .../core/src}/modules/search/search.dto.ts | 0 .../core/src}/modules/search/search.module.ts | 0 .../src}/modules/search/search.service.ts | 0 .../src}/modules/serverless/function.types.ts | 0 .../modules/serverless/mock-response.util.ts | 0 .../pack/built-in/geocode_location.ts | 0 .../pack/built-in/geocode_search.ts | 0 .../modules/serverless/pack/built-in/index.ts | 0 .../serverless/pack/built-in/ip-query.ts | 0 .../src}/modules/serverless/pack/index.ts | 0 .../serverless/pack/xlog/get_page_id.ts | 0 .../serverless/pack/xlog/get_summary.ts | 0 .../modules/serverless/pack/xlog/index.ts | 0 .../serverless/serverless.controller.ts | 0 .../src}/modules/serverless/serverless.dto.ts | 0 .../modules/serverless/serverless.model.ts | 0 .../modules/serverless/serverless.module.ts | 0 .../modules/serverless/serverless.readme.md | 0 .../modules/serverless/serverless.service.ts | 0 .../modules/serverless/serverless.util.ts | 0 .../modules/sitemap/sitemap.controller.ts | 3 +- .../src}/modules/sitemap/sitemap.module.ts | 0 .../modules/snippet/snippet.controller.ts | 0 .../core/src}/modules/snippet/snippet.dto.ts | 0 .../src}/modules/snippet/snippet.model.ts | 0 .../src}/modules/snippet/snippet.module.ts | 0 .../src}/modules/snippet/snippet.service.ts | 0 .../modules/subscribe/subscribe.constant.ts | 0 .../modules/subscribe/subscribe.controller.ts | 0 .../src}/modules/subscribe/subscribe.dto.ts | 0 .../src}/modules/subscribe/subscribe.model.ts | 0 .../modules/subscribe/subscribe.module.ts | 0 .../modules/subscribe/subscribe.service.ts | 0 .../src}/modules/topic/topic.controller.ts | 0 .../core/src}/modules/topic/topic.model.ts | 0 .../core/src}/modules/topic/topic.module.ts | 0 .../core/src}/modules/topic/topic.service.ts | 0 .../src}/modules/update/update.controller.ts | 0 .../core/src}/modules/update/update.dto.ts | 0 .../core/src}/modules/update/update.module.ts | 0 .../src}/modules/update/update.service.ts | 0 .../core/src}/modules/user/user.controller.ts | 0 .../core/src}/modules/user/user.dto.ts | 0 .../core/src}/modules/user/user.model.ts | 0 .../core/src}/modules/user/user.module.ts | 0 .../core/src}/modules/user/user.service.ts | 0 .../processors/database/database.models.ts | 0 .../processors/database/database.module.ts | 0 .../processors/database/database.provider.ts | 0 .../processors/database/database.service.ts | 0 .../gateway/admin/events.gateway.ts | 0 .../src}/processors/gateway/base.gateway.ts | 0 .../src}/processors/gateway/gateway.module.ts | 0 .../processors/gateway/shared/auth.gateway.ts | 0 .../gateway/shared/events.gateway.ts | 0 .../gateway/system/events.gateway.ts | 0 .../gateway/web/dtos/danmaku.dto.ts | 0 .../processors/gateway/web/events.gateway.ts | 0 .../processors/helper/helper.asset.service.ts | 0 .../processors/helper/helper.bark.service.ts | 0 .../helper/helper.counting.service.ts | 0 .../processors/helper/helper.cron.service.ts | 0 .../processors/helper/helper.email.service.ts | 0 .../processors/helper/helper.event.service.ts | 0 .../processors/helper/helper.http.service.ts | 0 .../processors/helper/helper.image.service.ts | 0 .../processors/helper/helper.jwt.service.ts | 0 .../processors/helper/helper.macro.service.ts | 0 .../src}/processors/helper/helper.module.ts | 0 .../processors/helper/helper.tq.service.ts | 0 .../helper/helper.upload.service.ts | 0 .../helper/helper.url-builder.service.ts | 0 .../src}/processors/logger/logger.module.ts | 0 .../src}/processors/logger/logger.service.ts | 0 .../src}/processors/redis/cache.service.ts | 0 .../processors/redis/redis.config.service.ts | 0 .../src}/processors/redis/redis.module.ts | 3 +- .../src}/processors/redis/subpub.service.ts | 0 {src => apps/core/src}/repl.ts | 0 {src => apps/core/src}/shared/dto/file.dto.ts | 0 {src => apps/core/src}/shared/dto/id.dto.ts | 0 .../core/src}/shared/dto/pager.dto.ts | 0 .../shared/interface/paginator.interface.ts | 0 .../src}/shared/model/base-comment.model.ts | 0 .../core/src}/shared/model/base.model.ts | 0 .../core/src}/shared/model/count.model.ts | 0 .../core/src}/shared/model/image.model.ts | 0 .../src}/shared/model/write-base.model.ts | 0 .../transformers/crud-factor.transformer.ts | 0 .../src}/transformers/db-query.transformer.ts | 0 .../src}/transformers/get-req.transformer.ts | 0 .../src}/transformers/model.transformer.ts | 0 .../src}/transformers/paginate.transformer.ts | 0 {src => apps/core/src}/types/request.ts | 0 {src => apps/core/src}/types/unique.ts | 0 {src => apps/core/src}/utils/biz.util.ts | 0 .../core/src}/utils/check-init.util.ts | 0 {src => apps/core/src}/utils/cos.util.ts | 0 {src => apps/core/src}/utils/database.util.ts | 0 {src => apps/core/src}/utils/encrypt.util.ts | 0 {src => apps/core/src}/utils/index.ts | 0 {src => apps/core/src}/utils/ip.util.ts | 0 .../core/src}/utils/jsonschema.util.ts | 0 {src => apps/core/src}/utils/path.util.ts | 0 {src => apps/core/src}/utils/pic.util.ts | 0 .../core/src}/utils/redis-subpub.util.ts | 0 {src => apps/core/src}/utils/redis.util.ts | 0 .../core/src}/utils/safe-eval.util.ts | 0 {src => apps/core/src}/utils/schedule.util.ts | 0 {src => apps/core/src}/utils/system.util.ts | 0 {src => apps/core/src}/utils/time.util.ts | 0 {src => apps/core/src}/utils/tool.util.ts | 0 .../core/src}/utils/validator/isAllowedUrl.ts | 0 .../src}/utils/validator/isBooleanOrString.ts | 0 .../src}/utils/validator/isMongoIdOrInt.ts | 0 .../src}/utils/validator/isNilOrString.ts | 0 .../utils/validator/simpleValidatorFactory.ts | 0 {test => apps/core/test}/global.d.ts | 0 .../core/test}/helper/create-e2e-app.ts | 0 .../core/test}/helper/db-mock.helper.ts | 0 .../core/test}/helper/defineProvider.ts | 0 .../core/test}/helper/redis-mock.helper.ts | 0 {test => apps/core/test}/helper/setup-e2e.ts | 0 .../core/test}/helper/utils.helper.ts | 0 .../core/test}/mock/constants/token.ts | 0 .../test}/mock/decorators/auth.decorator.ts | 2 +- .../core/test}/mock/guard/auth.guard.ts | 0 .../mock/interceptors/counting.interceptor.ts | 0 .../core/test}/mock/modules/auth.mock.ts | 0 .../core/test}/mock/modules/comment.mock.ts | 0 .../core/test}/mock/modules/config.mock.ts | 0 .../core/test}/mock/modules/gateway.mock.ts | 0 .../core/test}/mock/modules/user.mock.ts | 0 .../test}/mock/processors/counting.mock.ts | 0 .../core/test}/mock/processors/email.mock.ts | 0 .../core/test}/mock/processors/event.mock.ts | 0 .../test}/mock/processors/text-macro.mock.ts | 0 {test => apps/core/test}/setup-global.ts | 0 {test => apps/core/test}/setup.ts | 0 .../core/test}/setupFiles/lifecycle.ts | 0 .../core/test}/src/app.controller.e2e-spec.ts | 0 .../src/modules/auth/auth.service.spec.ts | 0 .../modules/configs/configs.service.spec.ts | 0 .../src/modules/configs/configs.util.spec.ts | 2 +- .../modules/link/link.controller.e2e-spec.ts | 0 .../modules/markdown/markdown.service.spec.ts | 0 .../note.controller.e2e-spec.ts.snap | 0 .../modules/note/note.controller.e2e-spec.ts | 0 .../src/modules/note/note.e2e-mock.db.ts | 4 +- .../options/options.controller.e2e-spec.ts | 0 .../serverless/serverless.service.spec.ts | 0 .../snippet/snippet.controller.e2e-spec.ts | 0 .../modules/snippet/snippet.service.spec.ts | 0 .../modules/user/user.controller.e2e-spec.ts | 0 .../src/modules/user/user.controller.spec.ts | 0 .../src/modules/user/user.service.spec.ts | 0 .../helper/helper.jwt.service.spec.ts | 0 .../helper/helper.macro.service.spec.ts | 0 .../curd-factor.e2e-spec.ts.snap | 0 .../src/transformers/curd-factor.e2e-spec.ts | 0 .../core/test}/src/utils/encrypt.util.spec.ts | 0 .../core/test}/src/utils/pic.util.spec.ts | 0 .../core/test}/src/utils/safe-eval.spec.ts | 0 .../core/test}/src/utils/tool.util.spec.ts | 0 {test => apps/core/test}/tsconfig.json | 0 .../core/tsconfig.build.json | 0 tsconfig.json => apps/core/tsconfig.json | 0 .../core/vitest.config.ts | 15 +- apps/core/zip-asset.sh | 14 + dockerfile | 3 +- package.json | 137 +--- packages/api-client/package.json | 18 +- pnpm-lock.yaml | 629 ++++++++++++------ pnpm-workspace.yaml | 1 + schema.gql | 120 ++++ scripts/workflow/test-server.sh | 2 +- scripts/zip-asset.sh | 8 - 376 files changed, 848 insertions(+), 381 deletions(-) rename .github/workflows/{build.yml => build-core.yml} (98%) create mode 100644 apps/core/.gitignore rename {scripts => apps/core}/download-latest-admin-assets.js (96%) rename ecosystem.config.js => apps/core/ecosystem.config.js (100%) rename ecosystem.dev.config.js => apps/core/ecosystem.dev.config.js (100%) create mode 100644 apps/core/external/pino/index.js create mode 100644 apps/core/external/pino/package.json create mode 100644 apps/core/external/readme.md create mode 100644 apps/core/external/request/index.js create mode 100644 apps/core/external/request/package.json rename {scripts => apps/core}/get-latest-admin-version.js (82%) rename global.d.ts => apps/core/global.d.ts (99%) rename nest-cli.json => apps/core/nest-cli.json (100%) create mode 100644 apps/core/package.json rename {src => apps/core/src}/app.config.test.ts (100%) rename {src => apps/core/src}/app.config.ts (100%) rename {src => apps/core/src}/app.controller.ts (100%) rename {src => apps/core/src}/app.module.ts (100%) rename {src => apps/core/src}/bootstrap.ts (100%) rename {src => apps/core/src}/cluster.ts (100%) rename {src => apps/core/src}/common/adapters/fastify.adapter.ts (100%) rename {src => apps/core/src}/common/adapters/socket.adapter.ts (100%) rename {src => apps/core/src}/common/decorators/api-controller.decorator.ts (100%) rename {src => apps/core/src}/common/decorators/auth.decorator.ts (100%) rename {src => apps/core/src}/common/decorators/cache.decorator.ts (90%) rename {src => apps/core/src}/common/decorators/cookie.decorator.ts (100%) rename {src => apps/core/src}/common/decorators/cron-description.decorator.ts (100%) rename {src => apps/core/src}/common/decorators/cron-once.decorator.ts (100%) rename {src => apps/core/src}/common/decorators/current-user.decorator.ts (100%) rename {src => apps/core/src}/common/decorators/demo.decorator.ts (100%) rename {src => apps/core/src}/common/decorators/http.decorator.ts (100%) rename {src => apps/core/src}/common/decorators/ip.decorator.ts (100%) rename {src => apps/core/src}/common/decorators/response-filter.decorator.ts (100%) rename {src => apps/core/src}/common/decorators/role.decorator.ts (100%) rename {src => apps/core/src}/common/decorators/update-count.decorator.ts (100%) rename {src => apps/core/src}/common/exceptions/ban-in-demo.exception.ts (100%) rename {src => apps/core/src}/common/exceptions/biz.exception.ts (100%) rename {src => apps/core/src}/common/exceptions/cant-find.exception.ts (100%) rename {src => apps/core/src}/common/exceptions/no-content-canbe-modified.exception.ts (100%) rename {src => apps/core/src}/common/filters/any-exception.filter.ts (100%) rename {src => apps/core/src}/common/guards/auth.guard.ts (100%) rename {src => apps/core/src}/common/guards/roles.guard.ts (100%) rename {src => apps/core/src}/common/guards/spider.guard.ts (100%) rename {src => apps/core/src}/common/interceptors/allow-all-cors.interceptor.ts (100%) rename {src => apps/core/src}/common/interceptors/analyze.interceptor.ts (100%) rename {src => apps/core/src}/common/interceptors/cache.interceptor.ts (100%) rename {src => apps/core/src}/common/interceptors/counting.interceptor.ts (100%) rename {src => apps/core/src}/common/interceptors/db-query.interceptor.ts (100%) rename {src => apps/core/src}/common/interceptors/idempotence.interceptor.ts (100%) rename {src => apps/core/src}/common/interceptors/json-transform.interceptor.ts (100%) rename {src => apps/core/src}/common/interceptors/logging.interceptor.ts (100%) rename {src => apps/core/src}/common/interceptors/response-filter.interceptor.ts (100%) rename {src => apps/core/src}/common/interceptors/response.interceptor.ts (100%) rename {src => apps/core/src}/common/strategies/context.strategy.ts (100%) rename {src => apps/core/src}/constants/article.constant.ts (100%) rename {src => apps/core/src}/constants/business-event.constant.ts (100%) rename {src => apps/core/src}/constants/cache.constant.ts (100%) rename {src => apps/core/src}/constants/error-code.constant.ts (100%) rename {src => apps/core/src}/constants/event-bus.constant.ts (100%) rename {src => apps/core/src}/constants/meta.constant.ts (100%) rename {src => apps/core/src}/constants/other.constant.ts (100%) rename {src => apps/core/src}/constants/path.constant.ts (100%) rename {src => apps/core/src}/constants/system.constant.ts (100%) rename {src => apps/core/src}/global/consola.global.ts (100%) rename {src => apps/core/src}/global/dayjs.global.ts (100%) rename {src => apps/core/src}/global/env.global.ts (100%) rename {src => apps/core/src}/global/index.global.ts (100%) rename {src => apps/core/src}/global/json.global.ts (100%) rename {src => apps/core/src}/main.ts (100%) rename {src => apps/core/src}/migration/helper/encrypt-configs.ts (100%) rename {src => apps/core/src}/migration/history.ts (100%) rename {src => apps/core/src}/migration/migrate.ts (100%) rename {src => apps/core/src}/migration/version/v2.0.0-alpha.1.ts (100%) rename {src => apps/core/src}/migration/version/v3.30.0.ts (100%) rename {src => apps/core/src}/migration/version/v3.36.0.ts (100%) rename {src => apps/core/src}/migration/version/v3.39.3.ts (100%) rename {src => apps/core/src}/modules/aggregate/aggregate.controller.ts (96%) rename {src => apps/core/src}/modules/aggregate/aggregate.dto.ts (100%) rename {src => apps/core/src}/modules/aggregate/aggregate.interface.ts (100%) rename {src => apps/core/src}/modules/aggregate/aggregate.module.ts (100%) rename {src => apps/core/src}/modules/aggregate/aggregate.service.ts (100%) rename {src => apps/core/src}/modules/analyze/analyze.controller.ts (100%) rename {src => apps/core/src}/modules/analyze/analyze.dto.ts (100%) rename {src => apps/core/src}/modules/analyze/analyze.model.ts (100%) rename {src => apps/core/src}/modules/analyze/analyze.module.ts (100%) rename {src => apps/core/src}/modules/analyze/analyze.service.ts (100%) rename {src => apps/core/src}/modules/auth/auth.controller.ts (100%) rename {src => apps/core/src}/modules/auth/auth.module.ts (100%) rename {src => apps/core/src}/modules/auth/auth.service.ts (100%) rename {src => apps/core/src}/modules/auth/oauth.dto.ts (100%) rename {src => apps/core/src}/modules/backup/backup.controller.ts (100%) rename {src => apps/core/src}/modules/backup/backup.module.ts (100%) rename {src => apps/core/src}/modules/backup/backup.service.ts (100%) rename {src => apps/core/src}/modules/category/category.controller.ts (100%) rename {src => apps/core/src}/modules/category/category.dto.ts (100%) rename {src => apps/core/src}/modules/category/category.model.ts (100%) rename {src => apps/core/src}/modules/category/category.module.ts (100%) rename {src => apps/core/src}/modules/category/category.service.ts (100%) rename {src => apps/core/src}/modules/comment/block-keywords.json (100%) rename {src => apps/core/src}/modules/comment/comment.controller.ts (100%) rename {src => apps/core/src}/modules/comment/comment.dto.ts (100%) rename {src => apps/core/src}/modules/comment/comment.interceptor.ts (100%) rename {src => apps/core/src}/modules/comment/comment.model.ts (100%) rename {src => apps/core/src}/modules/comment/comment.module.ts (100%) rename {src => apps/core/src}/modules/comment/comment.service.ts (100%) rename {src => apps/core/src}/modules/configs/configs.default.ts (100%) rename {src => apps/core/src}/modules/configs/configs.dto.ts (100%) rename {src => apps/core/src}/modules/configs/configs.encrypt.util.ts (100%) rename {src => apps/core/src}/modules/configs/configs.interface.ts (100%) rename {src => apps/core/src}/modules/configs/configs.jsonschema.decorator.ts (100%) rename {src => apps/core/src}/modules/configs/configs.model.ts (100%) rename {src => apps/core/src}/modules/configs/configs.module.ts (100%) rename {src => apps/core/src}/modules/configs/configs.service.ts (100%) rename {src => apps/core/src}/modules/debug/debug.controller.ts (100%) rename {src => apps/core/src}/modules/debug/debug.module.ts (100%) rename {src => apps/core/src}/modules/debug/debug.service.ts (100%) rename {src => apps/core/src}/modules/demo/demo.module.ts (100%) rename {src => apps/core/src}/modules/dependency/dependency.controller.ts (100%) rename {src => apps/core/src}/modules/dependency/dependency.module.ts (100%) rename {src => apps/core/src}/modules/feed/feed.controller.ts (95%) rename {src => apps/core/src}/modules/feed/feed.module.ts (100%) rename {src => apps/core/src}/modules/file/file.controller.ts (100%) rename {src => apps/core/src}/modules/file/file.dto.ts (100%) rename {src => apps/core/src}/modules/file/file.module.ts (100%) rename {src => apps/core/src}/modules/file/file.service.ts (100%) rename {src => apps/core/src}/modules/file/file.type.ts (100%) rename {src => apps/core/src}/modules/health/health.controller.ts (100%) rename {src => apps/core/src}/modules/health/health.dto.ts (100%) rename {src => apps/core/src}/modules/health/health.module.ts (100%) rename {src => apps/core/src}/modules/health/sub-controller/cron.controller.ts (100%) rename {src => apps/core/src}/modules/health/sub-controller/log.controller.ts (100%) rename {src => apps/core/src}/modules/helper/helper.controller.ts (100%) rename {src => apps/core/src}/modules/helper/helper.module.ts (100%) rename {src => apps/core/src}/modules/helper/helper.service.ts (100%) rename {src => apps/core/src}/modules/init/init.controller.ts (100%) rename {src => apps/core/src}/modules/init/init.module.ts (100%) rename {src => apps/core/src}/modules/init/init.service.ts (100%) rename {src => apps/core/src}/modules/link/link.controller.ts (100%) rename {src => apps/core/src}/modules/link/link.dto.ts (100%) rename {src => apps/core/src}/modules/link/link.model.ts (100%) rename {src => apps/core/src}/modules/link/link.module.ts (100%) rename {src => apps/core/src}/modules/link/link.service.ts (100%) rename {src => apps/core/src}/modules/markdown/markdown.controller.ts (100%) rename {src => apps/core/src}/modules/markdown/markdown.dto.ts (100%) rename {src => apps/core/src}/modules/markdown/markdown.interface.ts (100%) rename {src => apps/core/src}/modules/markdown/markdown.module.ts (100%) rename {src => apps/core/src}/modules/markdown/markdown.service.ts (100%) rename {src => apps/core/src}/modules/note/models/coordinate.model.ts (100%) rename {src => apps/core/src}/modules/note/models/music.model.ts (100%) rename {src => apps/core/src}/modules/note/note.controller.ts (100%) rename {src => apps/core/src}/modules/note/note.dto.ts (100%) rename {src => apps/core/src}/modules/note/note.model.ts (100%) rename {src => apps/core/src}/modules/note/note.module.ts (100%) rename {src => apps/core/src}/modules/note/note.service.ts (100%) rename {src => apps/core/src}/modules/option/controllers/base.option.controller.ts (100%) rename {src => apps/core/src}/modules/option/controllers/email.option.controller.ts (100%) rename {src => apps/core/src}/modules/option/dtoes/config.dto.ts (100%) rename {src => apps/core/src}/modules/option/dtoes/email.dto.ts (100%) rename {src => apps/core/src}/modules/option/option.decorator.ts (100%) rename {src => apps/core/src}/modules/option/option.model.ts (100%) rename {src => apps/core/src}/modules/option/option.module.ts (100%) rename {src => apps/core/src}/modules/page/page.controller.ts (100%) rename {src => apps/core/src}/modules/page/page.dto.ts (100%) rename {src => apps/core/src}/modules/page/page.model.ts (100%) rename {src => apps/core/src}/modules/page/page.module.ts (100%) rename {src => apps/core/src}/modules/page/page.service.ts (100%) rename {src => apps/core/src}/modules/pageproxy/pageproxy.controller.ts (100%) rename {src => apps/core/src}/modules/pageproxy/pageproxy.dto.ts (100%) rename {src => apps/core/src}/modules/pageproxy/pageproxy.module.ts (100%) rename {src => apps/core/src}/modules/pageproxy/pageproxy.service.ts (100%) rename {src => apps/core/src}/modules/post/post.controller.ts (100%) rename {src => apps/core/src}/modules/post/post.dto.ts (100%) rename {src => apps/core/src}/modules/post/post.model.ts (100%) rename {src => apps/core/src}/modules/post/post.module.ts (100%) rename {src => apps/core/src}/modules/post/post.service.ts (100%) rename {src => apps/core/src}/modules/project/project.controller.ts (100%) rename {src => apps/core/src}/modules/project/project.model.ts (100%) rename {src => apps/core/src}/modules/project/project.module.ts (100%) rename {src => apps/core/src}/modules/pty/pty.controller.ts (100%) rename {src => apps/core/src}/modules/pty/pty.gateway.ts (100%) rename {src => apps/core/src}/modules/pty/pty.module.ts (100%) rename {src => apps/core/src}/modules/pty/pty.service.ts (100%) rename {src => apps/core/src}/modules/recently/recently.controller.ts (100%) rename {src => apps/core/src}/modules/recently/recently.dto.ts (100%) rename {src => apps/core/src}/modules/recently/recently.model.ts (100%) rename {src => apps/core/src}/modules/recently/recently.module.ts (100%) rename {src => apps/core/src}/modules/recently/recently.service.ts (100%) rename {src => apps/core/src}/modules/render/render.controller.ts (100%) rename {src => apps/core/src}/modules/render/render.module.ts (100%) rename {src => apps/core/src}/modules/say/say.controller.ts (100%) rename {src => apps/core/src}/modules/say/say.model.ts (100%) rename {src => apps/core/src}/modules/say/say.module.ts (100%) rename {src => apps/core/src}/modules/say/say.service.ts (100%) rename {src => apps/core/src}/modules/search/search.controller.ts (100%) rename {src => apps/core/src}/modules/search/search.dto.ts (100%) rename {src => apps/core/src}/modules/search/search.module.ts (100%) rename {src => apps/core/src}/modules/search/search.service.ts (100%) rename {src => apps/core/src}/modules/serverless/function.types.ts (100%) rename {src => apps/core/src}/modules/serverless/mock-response.util.ts (100%) rename {src => apps/core/src}/modules/serverless/pack/built-in/geocode_location.ts (100%) rename {src => apps/core/src}/modules/serverless/pack/built-in/geocode_search.ts (100%) rename {src => apps/core/src}/modules/serverless/pack/built-in/index.ts (100%) rename {src => apps/core/src}/modules/serverless/pack/built-in/ip-query.ts (100%) rename {src => apps/core/src}/modules/serverless/pack/index.ts (100%) rename {src => apps/core/src}/modules/serverless/pack/xlog/get_page_id.ts (100%) rename {src => apps/core/src}/modules/serverless/pack/xlog/get_summary.ts (100%) rename {src => apps/core/src}/modules/serverless/pack/xlog/index.ts (100%) rename {src => apps/core/src}/modules/serverless/serverless.controller.ts (100%) rename {src => apps/core/src}/modules/serverless/serverless.dto.ts (100%) rename {src => apps/core/src}/modules/serverless/serverless.model.ts (100%) rename {src => apps/core/src}/modules/serverless/serverless.module.ts (100%) rename {src => apps/core/src}/modules/serverless/serverless.readme.md (100%) rename {src => apps/core/src}/modules/serverless/serverless.service.ts (100%) rename {src => apps/core/src}/modules/serverless/serverless.util.ts (100%) rename {src => apps/core/src}/modules/sitemap/sitemap.controller.ts (90%) rename {src => apps/core/src}/modules/sitemap/sitemap.module.ts (100%) rename {src => apps/core/src}/modules/snippet/snippet.controller.ts (100%) rename {src => apps/core/src}/modules/snippet/snippet.dto.ts (100%) rename {src => apps/core/src}/modules/snippet/snippet.model.ts (100%) rename {src => apps/core/src}/modules/snippet/snippet.module.ts (100%) rename {src => apps/core/src}/modules/snippet/snippet.service.ts (100%) rename {src => apps/core/src}/modules/subscribe/subscribe.constant.ts (100%) rename {src => apps/core/src}/modules/subscribe/subscribe.controller.ts (100%) rename {src => apps/core/src}/modules/subscribe/subscribe.dto.ts (100%) rename {src => apps/core/src}/modules/subscribe/subscribe.model.ts (100%) rename {src => apps/core/src}/modules/subscribe/subscribe.module.ts (100%) rename {src => apps/core/src}/modules/subscribe/subscribe.service.ts (100%) rename {src => apps/core/src}/modules/topic/topic.controller.ts (100%) rename {src => apps/core/src}/modules/topic/topic.model.ts (100%) rename {src => apps/core/src}/modules/topic/topic.module.ts (100%) rename {src => apps/core/src}/modules/topic/topic.service.ts (100%) rename {src => apps/core/src}/modules/update/update.controller.ts (100%) rename {src => apps/core/src}/modules/update/update.dto.ts (100%) rename {src => apps/core/src}/modules/update/update.module.ts (100%) rename {src => apps/core/src}/modules/update/update.service.ts (100%) rename {src => apps/core/src}/modules/user/user.controller.ts (100%) rename {src => apps/core/src}/modules/user/user.dto.ts (100%) rename {src => apps/core/src}/modules/user/user.model.ts (100%) rename {src => apps/core/src}/modules/user/user.module.ts (100%) rename {src => apps/core/src}/modules/user/user.service.ts (100%) rename {src => apps/core/src}/processors/database/database.models.ts (100%) rename {src => apps/core/src}/processors/database/database.module.ts (100%) rename {src => apps/core/src}/processors/database/database.provider.ts (100%) rename {src => apps/core/src}/processors/database/database.service.ts (100%) rename {src => apps/core/src}/processors/gateway/admin/events.gateway.ts (100%) rename {src => apps/core/src}/processors/gateway/base.gateway.ts (100%) rename {src => apps/core/src}/processors/gateway/gateway.module.ts (100%) rename {src => apps/core/src}/processors/gateway/shared/auth.gateway.ts (100%) rename {src => apps/core/src}/processors/gateway/shared/events.gateway.ts (100%) rename {src => apps/core/src}/processors/gateway/system/events.gateway.ts (100%) rename {src => apps/core/src}/processors/gateway/web/dtos/danmaku.dto.ts (100%) rename {src => apps/core/src}/processors/gateway/web/events.gateway.ts (100%) rename {src => apps/core/src}/processors/helper/helper.asset.service.ts (100%) rename {src => apps/core/src}/processors/helper/helper.bark.service.ts (100%) rename {src => apps/core/src}/processors/helper/helper.counting.service.ts (100%) rename {src => apps/core/src}/processors/helper/helper.cron.service.ts (100%) rename {src => apps/core/src}/processors/helper/helper.email.service.ts (100%) rename {src => apps/core/src}/processors/helper/helper.event.service.ts (100%) rename {src => apps/core/src}/processors/helper/helper.http.service.ts (100%) rename {src => apps/core/src}/processors/helper/helper.image.service.ts (100%) rename {src => apps/core/src}/processors/helper/helper.jwt.service.ts (100%) rename {src => apps/core/src}/processors/helper/helper.macro.service.ts (100%) rename {src => apps/core/src}/processors/helper/helper.module.ts (100%) rename {src => apps/core/src}/processors/helper/helper.tq.service.ts (100%) rename {src => apps/core/src}/processors/helper/helper.upload.service.ts (100%) rename {src => apps/core/src}/processors/helper/helper.url-builder.service.ts (100%) rename {src => apps/core/src}/processors/logger/logger.module.ts (100%) rename {src => apps/core/src}/processors/logger/logger.service.ts (100%) rename {src => apps/core/src}/processors/redis/cache.service.ts (100%) rename {src => apps/core/src}/processors/redis/redis.config.service.ts (100%) rename {src => apps/core/src}/processors/redis/redis.module.ts (83%) rename {src => apps/core/src}/processors/redis/subpub.service.ts (100%) rename {src => apps/core/src}/repl.ts (100%) rename {src => apps/core/src}/shared/dto/file.dto.ts (100%) rename {src => apps/core/src}/shared/dto/id.dto.ts (100%) rename {src => apps/core/src}/shared/dto/pager.dto.ts (100%) rename {src => apps/core/src}/shared/interface/paginator.interface.ts (100%) rename {src => apps/core/src}/shared/model/base-comment.model.ts (100%) rename {src => apps/core/src}/shared/model/base.model.ts (100%) rename {src => apps/core/src}/shared/model/count.model.ts (100%) rename {src => apps/core/src}/shared/model/image.model.ts (100%) rename {src => apps/core/src}/shared/model/write-base.model.ts (100%) rename {src => apps/core/src}/transformers/crud-factor.transformer.ts (100%) rename {src => apps/core/src}/transformers/db-query.transformer.ts (100%) rename {src => apps/core/src}/transformers/get-req.transformer.ts (100%) rename {src => apps/core/src}/transformers/model.transformer.ts (100%) rename {src => apps/core/src}/transformers/paginate.transformer.ts (100%) rename {src => apps/core/src}/types/request.ts (100%) rename {src => apps/core/src}/types/unique.ts (100%) rename {src => apps/core/src}/utils/biz.util.ts (100%) rename {src => apps/core/src}/utils/check-init.util.ts (100%) rename {src => apps/core/src}/utils/cos.util.ts (100%) rename {src => apps/core/src}/utils/database.util.ts (100%) rename {src => apps/core/src}/utils/encrypt.util.ts (100%) rename {src => apps/core/src}/utils/index.ts (100%) rename {src => apps/core/src}/utils/ip.util.ts (100%) rename {src => apps/core/src}/utils/jsonschema.util.ts (100%) rename {src => apps/core/src}/utils/path.util.ts (100%) rename {src => apps/core/src}/utils/pic.util.ts (100%) rename {src => apps/core/src}/utils/redis-subpub.util.ts (100%) rename {src => apps/core/src}/utils/redis.util.ts (100%) rename {src => apps/core/src}/utils/safe-eval.util.ts (100%) rename {src => apps/core/src}/utils/schedule.util.ts (100%) rename {src => apps/core/src}/utils/system.util.ts (100%) rename {src => apps/core/src}/utils/time.util.ts (100%) rename {src => apps/core/src}/utils/tool.util.ts (100%) rename {src => apps/core/src}/utils/validator/isAllowedUrl.ts (100%) rename {src => apps/core/src}/utils/validator/isBooleanOrString.ts (100%) rename {src => apps/core/src}/utils/validator/isMongoIdOrInt.ts (100%) rename {src => apps/core/src}/utils/validator/isNilOrString.ts (100%) rename {src => apps/core/src}/utils/validator/simpleValidatorFactory.ts (100%) rename {test => apps/core/test}/global.d.ts (100%) rename {test => apps/core/test}/helper/create-e2e-app.ts (100%) rename {test => apps/core/test}/helper/db-mock.helper.ts (100%) rename {test => apps/core/test}/helper/defineProvider.ts (100%) rename {test => apps/core/test}/helper/redis-mock.helper.ts (100%) rename {test => apps/core/test}/helper/setup-e2e.ts (100%) rename {test => apps/core/test}/helper/utils.helper.ts (100%) rename {test => apps/core/test}/mock/constants/token.ts (100%) rename {test => apps/core/test}/mock/decorators/auth.decorator.ts (81%) rename {test => apps/core/test}/mock/guard/auth.guard.ts (100%) rename {test => apps/core/test}/mock/interceptors/counting.interceptor.ts (100%) rename {test => apps/core/test}/mock/modules/auth.mock.ts (100%) rename {test => apps/core/test}/mock/modules/comment.mock.ts (100%) rename {test => apps/core/test}/mock/modules/config.mock.ts (100%) rename {test => apps/core/test}/mock/modules/gateway.mock.ts (100%) rename {test => apps/core/test}/mock/modules/user.mock.ts (100%) rename {test => apps/core/test}/mock/processors/counting.mock.ts (100%) rename {test => apps/core/test}/mock/processors/email.mock.ts (100%) rename {test => apps/core/test}/mock/processors/event.mock.ts (100%) rename {test => apps/core/test}/mock/processors/text-macro.mock.ts (100%) rename {test => apps/core/test}/setup-global.ts (100%) rename {test => apps/core/test}/setup.ts (100%) rename {test => apps/core/test}/setupFiles/lifecycle.ts (100%) rename {test => apps/core/test}/src/app.controller.e2e-spec.ts (100%) rename {test => apps/core/test}/src/modules/auth/auth.service.spec.ts (100%) rename {test => apps/core/test}/src/modules/configs/configs.service.spec.ts (100%) rename {test => apps/core/test}/src/modules/configs/configs.util.spec.ts (100%) rename {test => apps/core/test}/src/modules/link/link.controller.e2e-spec.ts (100%) rename {test => apps/core/test}/src/modules/markdown/markdown.service.spec.ts (100%) rename {test => apps/core/test}/src/modules/note/__snapshots__/note.controller.e2e-spec.ts.snap (100%) rename {test => apps/core/test}/src/modules/note/note.controller.e2e-spec.ts (100%) rename {test => apps/core/test}/src/modules/note/note.e2e-mock.db.ts (86%) rename {test => apps/core/test}/src/modules/options/options.controller.e2e-spec.ts (100%) rename {test => apps/core/test}/src/modules/serverless/serverless.service.spec.ts (100%) rename {test => apps/core/test}/src/modules/snippet/snippet.controller.e2e-spec.ts (100%) rename {test => apps/core/test}/src/modules/snippet/snippet.service.spec.ts (100%) rename {test => apps/core/test}/src/modules/user/user.controller.e2e-spec.ts (100%) rename {test => apps/core/test}/src/modules/user/user.controller.spec.ts (100%) rename {test => apps/core/test}/src/modules/user/user.service.spec.ts (100%) rename {test => apps/core/test}/src/processors/helper/helper.jwt.service.spec.ts (100%) rename {test => apps/core/test}/src/processors/helper/helper.macro.service.spec.ts (100%) rename {test => apps/core/test}/src/transformers/__snapshots__/curd-factor.e2e-spec.ts.snap (100%) rename {test => apps/core/test}/src/transformers/curd-factor.e2e-spec.ts (100%) rename {test => apps/core/test}/src/utils/encrypt.util.spec.ts (100%) rename {test => apps/core/test}/src/utils/pic.util.spec.ts (100%) rename {test => apps/core/test}/src/utils/safe-eval.spec.ts (100%) rename {test => apps/core/test}/src/utils/tool.util.spec.ts (100%) rename {test => apps/core/test}/tsconfig.json (100%) rename tsconfig.build.json => apps/core/tsconfig.build.json (100%) rename tsconfig.json => apps/core/tsconfig.json (100%) rename vitest.config.ts => apps/core/vitest.config.ts (82%) create mode 100644 apps/core/zip-asset.sh create mode 100644 schema.gql delete mode 100644 scripts/zip-asset.sh diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 6930529a..e0f2a59d 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -26,7 +26,11 @@ module.exports = { }, overrides: [ { - files: ['src/migration/**/*.ts', 'src/modules/serverless/pack/**/*.ts'], + files: [ + 'apps/core/src/migration/**/*.ts', + 'apps/core/src/modules/serverless/pack/**/*.ts', + 'apps/core/test/**/*.ts', + ], rules: { 'import/no-default-export': 'off', }, diff --git a/.github/workflows/build.yml b/.github/workflows/build-core.yml similarity index 98% rename from .github/workflows/build.yml rename to .github/workflows/build-core.yml index 52504d22..541cd5ec 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build-core.yml @@ -1,7 +1,7 @@ # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions -name: Node.js Build CI +name: Build (core) on: push: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fb3c5ec2..d54e37f4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -44,13 +44,16 @@ jobs: with: version: 8.x run_install: true + - name: Test + working-directory: ./apps/core timeout-minutes: 10 run: | npm run lint npm run test - name: Build project + working-directory: ./apps/core run: | pnpm run bundle - name: Test Bundle Server @@ -58,7 +61,7 @@ jobs: bash scripts/workflow/test-server.sh - name: Zip Assets run: | - sh scripts/zip-asset.sh + sh apps/core/zip-asset.sh - name: Create Release id: create_release uses: actions/create-release@v1 @@ -136,7 +139,7 @@ jobs: pnpm run bundle - name: Zip Assets run: | - sh scripts/zip-asset.sh + sh apps/core/zip-asset.sh - name: Upload Release Asset id: upload-release-asset uses: actions/upload-release-asset@v1 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e63d13e0..48a21892 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,11 +35,17 @@ jobs: - uses: pnpm/action-setup@v2.2.4 with: version: 8.x - run_install: true - - name: Run Test + run_install: false + - name: Install Dependencies run: | - yarn lint - yarn test + pnpm i + - name: Run Lint + run: | + npm run lint + + - name: Run Tests + run: | + npm run test env: CI: true diff --git a/.gitignore b/.gitignore index 039d666a..678a8af9 100644 --- a/.gitignore +++ b/.gitignore @@ -46,11 +46,3 @@ assets scripts/workflow/docker-compose.yml scripts/workflow/data - -schema.gql - -app.config.js - -webpack-dist - -admin/ diff --git a/README.md b/README.md index 7e363426..d6e4b27a 100644 --- a/README.md +++ b/README.md @@ -66,8 +66,8 @@ node index.js ## 开发环境 ``` -git clone https://github.com/mx-space/mx-server -cd mx-server +git clone https://github.com/mx-space/core mx-core +cd mx-core pnpm i pnpm dev ``` diff --git a/apps/core/.gitignore b/apps/core/.gitignore new file mode 100644 index 00000000..701b69d2 --- /dev/null +++ b/apps/core/.gitignore @@ -0,0 +1,10 @@ +schema.gql + +app.config.js + +webpack-dist + +./admin +dist + +tmp diff --git a/scripts/download-latest-admin-assets.js b/apps/core/download-latest-admin-assets.js similarity index 96% rename from scripts/download-latest-admin-assets.js rename to apps/core/download-latest-admin-assets.js index 44faa57f..d5f701fa 100644 --- a/scripts/download-latest-admin-assets.js +++ b/apps/core/download-latest-admin-assets.js @@ -4,7 +4,7 @@ const { join } = require('path') const { fetch, $ } = require('zx-cjs') const { dashboard: { repo, version }, -} = require('../package.json') +} = require('./package.json') const endpoint = `https://api.github.com/repos/${repo}/releases/tags/v${version}` !(async () => { diff --git a/ecosystem.config.js b/apps/core/ecosystem.config.js similarity index 100% rename from ecosystem.config.js rename to apps/core/ecosystem.config.js diff --git a/ecosystem.dev.config.js b/apps/core/ecosystem.dev.config.js similarity index 100% rename from ecosystem.dev.config.js rename to apps/core/ecosystem.dev.config.js diff --git a/apps/core/external/pino/index.js b/apps/core/external/pino/index.js new file mode 100644 index 00000000..617a5eb5 --- /dev/null +++ b/apps/core/external/pino/index.js @@ -0,0 +1,24 @@ +// why this, because we dont need pino logger, and this logger can not bundle whole package into only one file with ncc. +// only work with fastify v4+ with pino v8+ + +module.exports = { + symbols: { + // https://github.com/pinojs/pino/blob/master/lib/symbols.js + serializersSym: Symbol.for('pino.serializers'), + }, + stdSerializers: { + error: function asErrValue(err) { + const obj = { + type: err.constructor.name, + msg: err.message, + stack: err.stack, + } + for (const key in err) { + if (obj[key] === undefined) { + obj[key] = err[key] + } + } + return obj + }, + }, +} diff --git a/apps/core/external/pino/package.json b/apps/core/external/pino/package.json new file mode 100644 index 00000000..1a7f8610 --- /dev/null +++ b/apps/core/external/pino/package.json @@ -0,0 +1,4 @@ +{ + "name": "pino", + "main": "./index.js" +} diff --git a/apps/core/external/readme.md b/apps/core/external/readme.md new file mode 100644 index 00000000..7b8ace77 --- /dev/null +++ b/apps/core/external/readme.md @@ -0,0 +1 @@ +This is folder used to override dependencies. \ No newline at end of file diff --git a/apps/core/external/request/index.js b/apps/core/external/request/index.js new file mode 100644 index 00000000..3bcbdff6 --- /dev/null +++ b/apps/core/external/request/index.js @@ -0,0 +1,3 @@ +// why do this. +// we dont need request, because we get image color only by buffer, and we dont need send request. +module.exports = {} diff --git a/apps/core/external/request/package.json b/apps/core/external/request/package.json new file mode 100644 index 00000000..0b536f06 --- /dev/null +++ b/apps/core/external/request/package.json @@ -0,0 +1,4 @@ +{ + "name": "request", + "main": "index.js" +} diff --git a/scripts/get-latest-admin-version.js b/apps/core/get-latest-admin-version.js similarity index 82% rename from scripts/get-latest-admin-version.js rename to apps/core/get-latest-admin-version.js index c04a3540..dadbd615 100644 --- a/scripts/get-latest-admin-version.js +++ b/apps/core/get-latest-admin-version.js @@ -3,8 +3,8 @@ const axios = require('axios') const { fs } = require('zx-cjs') const { dashboard: { repo }, -} = require('../package.json') -const Package = require('../package.json') +} = require('./package.json') +const Package = require('../../package.json') const endpoint = `https://api.github.com/repos/${repo}/releases/latest` const latestVersion = async () => { @@ -17,7 +17,7 @@ async function main() { Package.dashboard.version = version await fs.writeFile( - resolve(__dirname, '../package.json'), + resolve(__dirname, './package.json'), JSON.stringify(Package, null, 2), ) diff --git a/global.d.ts b/apps/core/global.d.ts similarity index 99% rename from global.d.ts rename to apps/core/global.d.ts index c593b1cb..1ed0cad0 100644 --- a/global.d.ts +++ b/apps/core/global.d.ts @@ -1,5 +1,6 @@ import { Consola } from 'consola' import { Document, PaginateModel } from 'mongoose' + import 'zx-cjs/globals' import { ModelType } from '@typegoose/typegoose/lib/types' diff --git a/nest-cli.json b/apps/core/nest-cli.json similarity index 100% rename from nest-cli.json rename to apps/core/nest-cli.json diff --git a/apps/core/package.json b/apps/core/package.json new file mode 100644 index 00000000..c13bd128 --- /dev/null +++ b/apps/core/package.json @@ -0,0 +1,163 @@ +{ + "name": "@mx-space/core", + "version": "4.0.2", + "author": "Innei ", + "private": true, + "license": "AGPLv3", + "dashboard": { + "repo": "mx-space/mx-admin", + "version": "3.30.3" + }, + "repository": { + "directory": "mx-space/core", + "url": "https://github.com/mx-space/core" + }, + "homepage": "https://github.com/mx-space/core#readme", + "issues": "https://github.com/mx-space/core/issues", + "scripts": { + "prebuild": "rimraf dist", + "build": "nest build", + "build:webpack": "nest build --webpack --webpackPath ./configs/webpack.config.js -c ./configs/nest-cli.webpack.json", + "dev": "npm run start", + "repl": "npm run start -- --entryFile repl", + "bundle": "rimraf out && npm run build && cd dist/src && npx ncc build main.js -o ../../out -m -t && cd ../.. && chmod +x out/index.js", + "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\" \"packages/**/*.ts\"", + "start": "cross-env NODE_ENV=development nest start -w --path tsconfig.json -- ", + "start:debug": "cross-env NODE_ENV=development nest start --debug --watch", + "start:cluster": "cross-env NODE_ENV=development nest start --watch -- --cluster --workers 2", + "start:prod": "cross-env NODE_ENV=production node dist/src/main", + "lint": "eslint \"{src,apps,libs,test,packages}/**/*.ts\" --fix", + "prod": "cross-env NODE_ENV=production pm2-runtime start ecosystem.config.js", + "prod:pm2": "cross-env NODE_ENV=production pm2 restart ecosystem.config.js", + "prod:stop": "pm2 stop ecosystem.config.js", + "prod:debug": "cross-env NODE_ENV=production nest start --debug --watch", + "test": "NODE_ENV=development vitest", + "test:watch": "NODE_ENV=development vitest -w", + "docs": "npx @compodoc/compodoc -p tsconfig.json -s -d docs" + }, + "bump": { + "before": [ + "git pull --rebase", + "pnpm i", + "node scripts/get-latest-admin-version.js" + ], + "after": [ + "sh ./scripts/assets-push.sh" + ], + "changelog": true + }, + "dependencies": { + "@algolia/client-search": "^4.17.1", + "@babel/core": "7.22.1", + "@babel/plugin-transform-modules-commonjs": "7.21.5", + "@babel/plugin-transform-typescript": "7.22.3", + "@babel/types": "^7.22.4", + "@fastify/cookie": "8.3.0", + "@fastify/multipart": "7.6.0", + "@fastify/static": "6.10.2", + "@innei/next-async": "0.3.0", + "@nestjs/cache-manager": "1.0.0", + "@nestjs/common": "9.4.2", + "@nestjs/core": "9.4.2", + "@nestjs/event-emitter": "1.4.1", + "@nestjs/mapped-types": "^1.2.2", + "@nestjs/platform-fastify": "9.4.2", + "@nestjs/platform-socket.io": "9.4.2", + "@nestjs/schedule": "2.2.2", + "@nestjs/throttler": "4.0.0", + "@nestjs/websockets": "9.4.2", + "@socket.io/redis-adapter": "7.2.0", + "@socket.io/redis-emitter": "4.1.1", + "@typegoose/auto-increment": "3.2.0", + "@typegoose/typegoose": "11.2.0", + "@types/jsonwebtoken": "9.0.2", + "algoliasearch": "4.17.1", + "axios": "^1.4.0", + "axios-retry": "3.5.0", + "bcrypt": "5.1.0", + "cache-manager": "4.1.0", + "cache-manager-ioredis": "2.1.0", + "class-transformer": "0.5.1", + "class-validator": "0.13.2", + "class-validator-jsonschema": "npm:@innei/class-validator-jsonschema@3.1.2", + "commander": "10.0.1", + "consola": "*", + "dayjs": "1.11.8", + "ejs": "3.1.9", + "form-data": "4.0.0", + "get-image-colors": "4.0.1", + "image-size": "1.0.2", + "inquirer": "*", + "isbot": "3.6.10", + "js-yaml": "*", + "json5": "2.2.3", + "jsonwebtoken": "9.0.0", + "jszip": "3.10.1", + "linkedom": "0.14.26", + "lodash": "*", + "lru-cache": "9.1.1", + "marked": "5.0.4", + "mime-types": "*", + "mkdirp": "*", + "mongoose": "7.2.2", + "mongoose-aggregate-paginate-v2": "1.0.6", + "mongoose-autopopulate": "1.0.1", + "mongoose-lean-getters": "1.1.0", + "mongoose-lean-id": "0.5.0", + "mongoose-lean-virtuals": "0.9.1", + "mongoose-paginate-v2": "1.7.1", + "nanoid": "3.3.4", + "node-machine-id": "1.1.12", + "node-pty": "0.10.1", + "nodemailer": "6.9.3", + "pluralize": "*", + "qs": "6.11.2", + "reflect-metadata": "0.1.13", + "rxjs": "7.8.1", + "semver": "7.5.1", + "slugify": "1.6.6", + "snakecase-keys": "5.4.5", + "ua-parser-js": "1.0.35", + "vm2": "3.9.19", + "wildcard-match": "5.1.2", + "xss": "1.0.14", + "zx-cjs": "7.0.7-0" + }, + "devDependencies": { + "@nestjs/cli": "9.5.0", + "@nestjs/schematics": "9.2.0", + "@nestjs/testing": "9.4.2", + "@swc/core": "1.3.4", + "@types/babel__core": "7.20.1", + "@types/bcrypt": "5.0.0", + "@types/cache-manager": "4.0.2", + "@types/cron": "2.0.1", + "@types/ejs": "3.1.2", + "@types/get-image-colors": "4.0.2", + "@types/js-yaml": "4.0.5", + "@types/lodash": "4.14.195", + "@types/marked": "4.3.1", + "@types/mime-types": "2.1.1", + "@types/mongoose-aggregate-paginate-v2": "1.0.9", + "@types/node": "18.16.16", + "@types/nodemailer": "6.4.8", + "@types/qs": "6.9.7", + "@types/semver": "7.5.0", + "@types/ua-parser-js": "0.7.36", + "@types/validator": "13.7.17", + "@vercel/ncc": "0.36.1", + "cron": "*", + "husky": "8.0.3", + "ioredis": "5.3.2", + "rollup-plugin-swc": "0.2.1", + "socket.io": "4.6.2", + "vite": "3.2.5", + "vite-tsconfig-paths": "4.2.0", + "vitest": "0.25.3", + "zx": "7.2.2" + }, + "optionalDependencies": { + "mongodb-memory-server": "*", + "redis-memory-server": "*" + } +} diff --git a/src/app.config.test.ts b/apps/core/src/app.config.test.ts similarity index 100% rename from src/app.config.test.ts rename to apps/core/src/app.config.test.ts diff --git a/src/app.config.ts b/apps/core/src/app.config.ts similarity index 100% rename from src/app.config.ts rename to apps/core/src/app.config.ts diff --git a/src/app.controller.ts b/apps/core/src/app.controller.ts similarity index 100% rename from src/app.controller.ts rename to apps/core/src/app.controller.ts diff --git a/src/app.module.ts b/apps/core/src/app.module.ts similarity index 100% rename from src/app.module.ts rename to apps/core/src/app.module.ts diff --git a/src/bootstrap.ts b/apps/core/src/bootstrap.ts similarity index 100% rename from src/bootstrap.ts rename to apps/core/src/bootstrap.ts diff --git a/src/cluster.ts b/apps/core/src/cluster.ts similarity index 100% rename from src/cluster.ts rename to apps/core/src/cluster.ts diff --git a/src/common/adapters/fastify.adapter.ts b/apps/core/src/common/adapters/fastify.adapter.ts similarity index 100% rename from src/common/adapters/fastify.adapter.ts rename to apps/core/src/common/adapters/fastify.adapter.ts diff --git a/src/common/adapters/socket.adapter.ts b/apps/core/src/common/adapters/socket.adapter.ts similarity index 100% rename from src/common/adapters/socket.adapter.ts rename to apps/core/src/common/adapters/socket.adapter.ts diff --git a/src/common/decorators/api-controller.decorator.ts b/apps/core/src/common/decorators/api-controller.decorator.ts similarity index 100% rename from src/common/decorators/api-controller.decorator.ts rename to apps/core/src/common/decorators/api-controller.decorator.ts diff --git a/src/common/decorators/auth.decorator.ts b/apps/core/src/common/decorators/auth.decorator.ts similarity index 100% rename from src/common/decorators/auth.decorator.ts rename to apps/core/src/common/decorators/auth.decorator.ts diff --git a/src/common/decorators/cache.decorator.ts b/apps/core/src/common/decorators/cache.decorator.ts similarity index 90% rename from src/common/decorators/cache.decorator.ts rename to apps/core/src/common/decorators/cache.decorator.ts index 9358084b..4e8ca14f 100755 --- a/src/common/decorators/cache.decorator.ts +++ b/apps/core/src/common/decorators/cache.decorator.ts @@ -4,7 +4,8 @@ * @module decorator/cache * @author Surmon */ -import { CacheKey, CacheTTL, SetMetadata } from '@nestjs/common' +import { CacheKey, CacheTTL } from '@nestjs/cache-manager' +import { SetMetadata } from '@nestjs/common' import * as META from '~/constants/meta.constant' diff --git a/src/common/decorators/cookie.decorator.ts b/apps/core/src/common/decorators/cookie.decorator.ts similarity index 100% rename from src/common/decorators/cookie.decorator.ts rename to apps/core/src/common/decorators/cookie.decorator.ts diff --git a/src/common/decorators/cron-description.decorator.ts b/apps/core/src/common/decorators/cron-description.decorator.ts similarity index 100% rename from src/common/decorators/cron-description.decorator.ts rename to apps/core/src/common/decorators/cron-description.decorator.ts diff --git a/src/common/decorators/cron-once.decorator.ts b/apps/core/src/common/decorators/cron-once.decorator.ts similarity index 100% rename from src/common/decorators/cron-once.decorator.ts rename to apps/core/src/common/decorators/cron-once.decorator.ts diff --git a/src/common/decorators/current-user.decorator.ts b/apps/core/src/common/decorators/current-user.decorator.ts similarity index 100% rename from src/common/decorators/current-user.decorator.ts rename to apps/core/src/common/decorators/current-user.decorator.ts diff --git a/src/common/decorators/demo.decorator.ts b/apps/core/src/common/decorators/demo.decorator.ts similarity index 100% rename from src/common/decorators/demo.decorator.ts rename to apps/core/src/common/decorators/demo.decorator.ts diff --git a/src/common/decorators/http.decorator.ts b/apps/core/src/common/decorators/http.decorator.ts similarity index 100% rename from src/common/decorators/http.decorator.ts rename to apps/core/src/common/decorators/http.decorator.ts diff --git a/src/common/decorators/ip.decorator.ts b/apps/core/src/common/decorators/ip.decorator.ts similarity index 100% rename from src/common/decorators/ip.decorator.ts rename to apps/core/src/common/decorators/ip.decorator.ts diff --git a/src/common/decorators/response-filter.decorator.ts b/apps/core/src/common/decorators/response-filter.decorator.ts similarity index 100% rename from src/common/decorators/response-filter.decorator.ts rename to apps/core/src/common/decorators/response-filter.decorator.ts diff --git a/src/common/decorators/role.decorator.ts b/apps/core/src/common/decorators/role.decorator.ts similarity index 100% rename from src/common/decorators/role.decorator.ts rename to apps/core/src/common/decorators/role.decorator.ts diff --git a/src/common/decorators/update-count.decorator.ts b/apps/core/src/common/decorators/update-count.decorator.ts similarity index 100% rename from src/common/decorators/update-count.decorator.ts rename to apps/core/src/common/decorators/update-count.decorator.ts diff --git a/src/common/exceptions/ban-in-demo.exception.ts b/apps/core/src/common/exceptions/ban-in-demo.exception.ts similarity index 100% rename from src/common/exceptions/ban-in-demo.exception.ts rename to apps/core/src/common/exceptions/ban-in-demo.exception.ts diff --git a/src/common/exceptions/biz.exception.ts b/apps/core/src/common/exceptions/biz.exception.ts similarity index 100% rename from src/common/exceptions/biz.exception.ts rename to apps/core/src/common/exceptions/biz.exception.ts diff --git a/src/common/exceptions/cant-find.exception.ts b/apps/core/src/common/exceptions/cant-find.exception.ts similarity index 100% rename from src/common/exceptions/cant-find.exception.ts rename to apps/core/src/common/exceptions/cant-find.exception.ts diff --git a/src/common/exceptions/no-content-canbe-modified.exception.ts b/apps/core/src/common/exceptions/no-content-canbe-modified.exception.ts similarity index 100% rename from src/common/exceptions/no-content-canbe-modified.exception.ts rename to apps/core/src/common/exceptions/no-content-canbe-modified.exception.ts diff --git a/src/common/filters/any-exception.filter.ts b/apps/core/src/common/filters/any-exception.filter.ts similarity index 100% rename from src/common/filters/any-exception.filter.ts rename to apps/core/src/common/filters/any-exception.filter.ts diff --git a/src/common/guards/auth.guard.ts b/apps/core/src/common/guards/auth.guard.ts similarity index 100% rename from src/common/guards/auth.guard.ts rename to apps/core/src/common/guards/auth.guard.ts diff --git a/src/common/guards/roles.guard.ts b/apps/core/src/common/guards/roles.guard.ts similarity index 100% rename from src/common/guards/roles.guard.ts rename to apps/core/src/common/guards/roles.guard.ts diff --git a/src/common/guards/spider.guard.ts b/apps/core/src/common/guards/spider.guard.ts similarity index 100% rename from src/common/guards/spider.guard.ts rename to apps/core/src/common/guards/spider.guard.ts diff --git a/src/common/interceptors/allow-all-cors.interceptor.ts b/apps/core/src/common/interceptors/allow-all-cors.interceptor.ts similarity index 100% rename from src/common/interceptors/allow-all-cors.interceptor.ts rename to apps/core/src/common/interceptors/allow-all-cors.interceptor.ts diff --git a/src/common/interceptors/analyze.interceptor.ts b/apps/core/src/common/interceptors/analyze.interceptor.ts similarity index 100% rename from src/common/interceptors/analyze.interceptor.ts rename to apps/core/src/common/interceptors/analyze.interceptor.ts diff --git a/src/common/interceptors/cache.interceptor.ts b/apps/core/src/common/interceptors/cache.interceptor.ts similarity index 100% rename from src/common/interceptors/cache.interceptor.ts rename to apps/core/src/common/interceptors/cache.interceptor.ts diff --git a/src/common/interceptors/counting.interceptor.ts b/apps/core/src/common/interceptors/counting.interceptor.ts similarity index 100% rename from src/common/interceptors/counting.interceptor.ts rename to apps/core/src/common/interceptors/counting.interceptor.ts diff --git a/src/common/interceptors/db-query.interceptor.ts b/apps/core/src/common/interceptors/db-query.interceptor.ts similarity index 100% rename from src/common/interceptors/db-query.interceptor.ts rename to apps/core/src/common/interceptors/db-query.interceptor.ts diff --git a/src/common/interceptors/idempotence.interceptor.ts b/apps/core/src/common/interceptors/idempotence.interceptor.ts similarity index 100% rename from src/common/interceptors/idempotence.interceptor.ts rename to apps/core/src/common/interceptors/idempotence.interceptor.ts diff --git a/src/common/interceptors/json-transform.interceptor.ts b/apps/core/src/common/interceptors/json-transform.interceptor.ts similarity index 100% rename from src/common/interceptors/json-transform.interceptor.ts rename to apps/core/src/common/interceptors/json-transform.interceptor.ts diff --git a/src/common/interceptors/logging.interceptor.ts b/apps/core/src/common/interceptors/logging.interceptor.ts similarity index 100% rename from src/common/interceptors/logging.interceptor.ts rename to apps/core/src/common/interceptors/logging.interceptor.ts diff --git a/src/common/interceptors/response-filter.interceptor.ts b/apps/core/src/common/interceptors/response-filter.interceptor.ts similarity index 100% rename from src/common/interceptors/response-filter.interceptor.ts rename to apps/core/src/common/interceptors/response-filter.interceptor.ts diff --git a/src/common/interceptors/response.interceptor.ts b/apps/core/src/common/interceptors/response.interceptor.ts similarity index 100% rename from src/common/interceptors/response.interceptor.ts rename to apps/core/src/common/interceptors/response.interceptor.ts diff --git a/src/common/strategies/context.strategy.ts b/apps/core/src/common/strategies/context.strategy.ts similarity index 100% rename from src/common/strategies/context.strategy.ts rename to apps/core/src/common/strategies/context.strategy.ts diff --git a/src/constants/article.constant.ts b/apps/core/src/constants/article.constant.ts similarity index 100% rename from src/constants/article.constant.ts rename to apps/core/src/constants/article.constant.ts diff --git a/src/constants/business-event.constant.ts b/apps/core/src/constants/business-event.constant.ts similarity index 100% rename from src/constants/business-event.constant.ts rename to apps/core/src/constants/business-event.constant.ts diff --git a/src/constants/cache.constant.ts b/apps/core/src/constants/cache.constant.ts similarity index 100% rename from src/constants/cache.constant.ts rename to apps/core/src/constants/cache.constant.ts diff --git a/src/constants/error-code.constant.ts b/apps/core/src/constants/error-code.constant.ts similarity index 100% rename from src/constants/error-code.constant.ts rename to apps/core/src/constants/error-code.constant.ts diff --git a/src/constants/event-bus.constant.ts b/apps/core/src/constants/event-bus.constant.ts similarity index 100% rename from src/constants/event-bus.constant.ts rename to apps/core/src/constants/event-bus.constant.ts diff --git a/src/constants/meta.constant.ts b/apps/core/src/constants/meta.constant.ts similarity index 100% rename from src/constants/meta.constant.ts rename to apps/core/src/constants/meta.constant.ts diff --git a/src/constants/other.constant.ts b/apps/core/src/constants/other.constant.ts similarity index 100% rename from src/constants/other.constant.ts rename to apps/core/src/constants/other.constant.ts diff --git a/src/constants/path.constant.ts b/apps/core/src/constants/path.constant.ts similarity index 100% rename from src/constants/path.constant.ts rename to apps/core/src/constants/path.constant.ts diff --git a/src/constants/system.constant.ts b/apps/core/src/constants/system.constant.ts similarity index 100% rename from src/constants/system.constant.ts rename to apps/core/src/constants/system.constant.ts diff --git a/src/global/consola.global.ts b/apps/core/src/global/consola.global.ts similarity index 100% rename from src/global/consola.global.ts rename to apps/core/src/global/consola.global.ts diff --git a/src/global/dayjs.global.ts b/apps/core/src/global/dayjs.global.ts similarity index 100% rename from src/global/dayjs.global.ts rename to apps/core/src/global/dayjs.global.ts diff --git a/src/global/env.global.ts b/apps/core/src/global/env.global.ts similarity index 100% rename from src/global/env.global.ts rename to apps/core/src/global/env.global.ts diff --git a/src/global/index.global.ts b/apps/core/src/global/index.global.ts similarity index 100% rename from src/global/index.global.ts rename to apps/core/src/global/index.global.ts diff --git a/src/global/json.global.ts b/apps/core/src/global/json.global.ts similarity index 100% rename from src/global/json.global.ts rename to apps/core/src/global/json.global.ts diff --git a/src/main.ts b/apps/core/src/main.ts similarity index 100% rename from src/main.ts rename to apps/core/src/main.ts diff --git a/src/migration/helper/encrypt-configs.ts b/apps/core/src/migration/helper/encrypt-configs.ts similarity index 100% rename from src/migration/helper/encrypt-configs.ts rename to apps/core/src/migration/helper/encrypt-configs.ts diff --git a/src/migration/history.ts b/apps/core/src/migration/history.ts similarity index 100% rename from src/migration/history.ts rename to apps/core/src/migration/history.ts diff --git a/src/migration/migrate.ts b/apps/core/src/migration/migrate.ts similarity index 100% rename from src/migration/migrate.ts rename to apps/core/src/migration/migrate.ts diff --git a/src/migration/version/v2.0.0-alpha.1.ts b/apps/core/src/migration/version/v2.0.0-alpha.1.ts similarity index 100% rename from src/migration/version/v2.0.0-alpha.1.ts rename to apps/core/src/migration/version/v2.0.0-alpha.1.ts diff --git a/src/migration/version/v3.30.0.ts b/apps/core/src/migration/version/v3.30.0.ts similarity index 100% rename from src/migration/version/v3.30.0.ts rename to apps/core/src/migration/version/v3.30.0.ts diff --git a/src/migration/version/v3.36.0.ts b/apps/core/src/migration/version/v3.36.0.ts similarity index 100% rename from src/migration/version/v3.36.0.ts rename to apps/core/src/migration/version/v3.36.0.ts diff --git a/src/migration/version/v3.39.3.ts b/apps/core/src/migration/version/v3.39.3.ts similarity index 100% rename from src/migration/version/v3.39.3.ts rename to apps/core/src/migration/version/v3.39.3.ts diff --git a/src/modules/aggregate/aggregate.controller.ts b/apps/core/src/modules/aggregate/aggregate.controller.ts similarity index 96% rename from src/modules/aggregate/aggregate.controller.ts rename to apps/core/src/modules/aggregate/aggregate.controller.ts index 582cbb9d..47108feb 100644 --- a/src/modules/aggregate/aggregate.controller.ts +++ b/apps/core/src/modules/aggregate/aggregate.controller.ts @@ -1,6 +1,7 @@ import { omit } from 'lodash' -import { CacheKey, CacheTTL, Get, Query } from '@nestjs/common' +import { CacheKey, CacheTTL } from '@nestjs/cache-manager' +import { Get, Query } from '@nestjs/common' import { ApiController } from '~/common/decorators/api-controller.decorator' import { Auth } from '~/common/decorators/auth.decorator' diff --git a/src/modules/aggregate/aggregate.dto.ts b/apps/core/src/modules/aggregate/aggregate.dto.ts similarity index 100% rename from src/modules/aggregate/aggregate.dto.ts rename to apps/core/src/modules/aggregate/aggregate.dto.ts diff --git a/src/modules/aggregate/aggregate.interface.ts b/apps/core/src/modules/aggregate/aggregate.interface.ts similarity index 100% rename from src/modules/aggregate/aggregate.interface.ts rename to apps/core/src/modules/aggregate/aggregate.interface.ts diff --git a/src/modules/aggregate/aggregate.module.ts b/apps/core/src/modules/aggregate/aggregate.module.ts similarity index 100% rename from src/modules/aggregate/aggregate.module.ts rename to apps/core/src/modules/aggregate/aggregate.module.ts diff --git a/src/modules/aggregate/aggregate.service.ts b/apps/core/src/modules/aggregate/aggregate.service.ts similarity index 100% rename from src/modules/aggregate/aggregate.service.ts rename to apps/core/src/modules/aggregate/aggregate.service.ts diff --git a/src/modules/analyze/analyze.controller.ts b/apps/core/src/modules/analyze/analyze.controller.ts similarity index 100% rename from src/modules/analyze/analyze.controller.ts rename to apps/core/src/modules/analyze/analyze.controller.ts diff --git a/src/modules/analyze/analyze.dto.ts b/apps/core/src/modules/analyze/analyze.dto.ts similarity index 100% rename from src/modules/analyze/analyze.dto.ts rename to apps/core/src/modules/analyze/analyze.dto.ts diff --git a/src/modules/analyze/analyze.model.ts b/apps/core/src/modules/analyze/analyze.model.ts similarity index 100% rename from src/modules/analyze/analyze.model.ts rename to apps/core/src/modules/analyze/analyze.model.ts diff --git a/src/modules/analyze/analyze.module.ts b/apps/core/src/modules/analyze/analyze.module.ts similarity index 100% rename from src/modules/analyze/analyze.module.ts rename to apps/core/src/modules/analyze/analyze.module.ts diff --git a/src/modules/analyze/analyze.service.ts b/apps/core/src/modules/analyze/analyze.service.ts similarity index 100% rename from src/modules/analyze/analyze.service.ts rename to apps/core/src/modules/analyze/analyze.service.ts diff --git a/src/modules/auth/auth.controller.ts b/apps/core/src/modules/auth/auth.controller.ts similarity index 100% rename from src/modules/auth/auth.controller.ts rename to apps/core/src/modules/auth/auth.controller.ts diff --git a/src/modules/auth/auth.module.ts b/apps/core/src/modules/auth/auth.module.ts similarity index 100% rename from src/modules/auth/auth.module.ts rename to apps/core/src/modules/auth/auth.module.ts diff --git a/src/modules/auth/auth.service.ts b/apps/core/src/modules/auth/auth.service.ts similarity index 100% rename from src/modules/auth/auth.service.ts rename to apps/core/src/modules/auth/auth.service.ts diff --git a/src/modules/auth/oauth.dto.ts b/apps/core/src/modules/auth/oauth.dto.ts similarity index 100% rename from src/modules/auth/oauth.dto.ts rename to apps/core/src/modules/auth/oauth.dto.ts diff --git a/src/modules/backup/backup.controller.ts b/apps/core/src/modules/backup/backup.controller.ts similarity index 100% rename from src/modules/backup/backup.controller.ts rename to apps/core/src/modules/backup/backup.controller.ts diff --git a/src/modules/backup/backup.module.ts b/apps/core/src/modules/backup/backup.module.ts similarity index 100% rename from src/modules/backup/backup.module.ts rename to apps/core/src/modules/backup/backup.module.ts diff --git a/src/modules/backup/backup.service.ts b/apps/core/src/modules/backup/backup.service.ts similarity index 100% rename from src/modules/backup/backup.service.ts rename to apps/core/src/modules/backup/backup.service.ts diff --git a/src/modules/category/category.controller.ts b/apps/core/src/modules/category/category.controller.ts similarity index 100% rename from src/modules/category/category.controller.ts rename to apps/core/src/modules/category/category.controller.ts diff --git a/src/modules/category/category.dto.ts b/apps/core/src/modules/category/category.dto.ts similarity index 100% rename from src/modules/category/category.dto.ts rename to apps/core/src/modules/category/category.dto.ts diff --git a/src/modules/category/category.model.ts b/apps/core/src/modules/category/category.model.ts similarity index 100% rename from src/modules/category/category.model.ts rename to apps/core/src/modules/category/category.model.ts diff --git a/src/modules/category/category.module.ts b/apps/core/src/modules/category/category.module.ts similarity index 100% rename from src/modules/category/category.module.ts rename to apps/core/src/modules/category/category.module.ts diff --git a/src/modules/category/category.service.ts b/apps/core/src/modules/category/category.service.ts similarity index 100% rename from src/modules/category/category.service.ts rename to apps/core/src/modules/category/category.service.ts diff --git a/src/modules/comment/block-keywords.json b/apps/core/src/modules/comment/block-keywords.json similarity index 100% rename from src/modules/comment/block-keywords.json rename to apps/core/src/modules/comment/block-keywords.json diff --git a/src/modules/comment/comment.controller.ts b/apps/core/src/modules/comment/comment.controller.ts similarity index 100% rename from src/modules/comment/comment.controller.ts rename to apps/core/src/modules/comment/comment.controller.ts diff --git a/src/modules/comment/comment.dto.ts b/apps/core/src/modules/comment/comment.dto.ts similarity index 100% rename from src/modules/comment/comment.dto.ts rename to apps/core/src/modules/comment/comment.dto.ts diff --git a/src/modules/comment/comment.interceptor.ts b/apps/core/src/modules/comment/comment.interceptor.ts similarity index 100% rename from src/modules/comment/comment.interceptor.ts rename to apps/core/src/modules/comment/comment.interceptor.ts diff --git a/src/modules/comment/comment.model.ts b/apps/core/src/modules/comment/comment.model.ts similarity index 100% rename from src/modules/comment/comment.model.ts rename to apps/core/src/modules/comment/comment.model.ts diff --git a/src/modules/comment/comment.module.ts b/apps/core/src/modules/comment/comment.module.ts similarity index 100% rename from src/modules/comment/comment.module.ts rename to apps/core/src/modules/comment/comment.module.ts diff --git a/src/modules/comment/comment.service.ts b/apps/core/src/modules/comment/comment.service.ts similarity index 100% rename from src/modules/comment/comment.service.ts rename to apps/core/src/modules/comment/comment.service.ts diff --git a/src/modules/configs/configs.default.ts b/apps/core/src/modules/configs/configs.default.ts similarity index 100% rename from src/modules/configs/configs.default.ts rename to apps/core/src/modules/configs/configs.default.ts diff --git a/src/modules/configs/configs.dto.ts b/apps/core/src/modules/configs/configs.dto.ts similarity index 100% rename from src/modules/configs/configs.dto.ts rename to apps/core/src/modules/configs/configs.dto.ts diff --git a/src/modules/configs/configs.encrypt.util.ts b/apps/core/src/modules/configs/configs.encrypt.util.ts similarity index 100% rename from src/modules/configs/configs.encrypt.util.ts rename to apps/core/src/modules/configs/configs.encrypt.util.ts diff --git a/src/modules/configs/configs.interface.ts b/apps/core/src/modules/configs/configs.interface.ts similarity index 100% rename from src/modules/configs/configs.interface.ts rename to apps/core/src/modules/configs/configs.interface.ts diff --git a/src/modules/configs/configs.jsonschema.decorator.ts b/apps/core/src/modules/configs/configs.jsonschema.decorator.ts similarity index 100% rename from src/modules/configs/configs.jsonschema.decorator.ts rename to apps/core/src/modules/configs/configs.jsonschema.decorator.ts diff --git a/src/modules/configs/configs.model.ts b/apps/core/src/modules/configs/configs.model.ts similarity index 100% rename from src/modules/configs/configs.model.ts rename to apps/core/src/modules/configs/configs.model.ts diff --git a/src/modules/configs/configs.module.ts b/apps/core/src/modules/configs/configs.module.ts similarity index 100% rename from src/modules/configs/configs.module.ts rename to apps/core/src/modules/configs/configs.module.ts diff --git a/src/modules/configs/configs.service.ts b/apps/core/src/modules/configs/configs.service.ts similarity index 100% rename from src/modules/configs/configs.service.ts rename to apps/core/src/modules/configs/configs.service.ts diff --git a/src/modules/debug/debug.controller.ts b/apps/core/src/modules/debug/debug.controller.ts similarity index 100% rename from src/modules/debug/debug.controller.ts rename to apps/core/src/modules/debug/debug.controller.ts diff --git a/src/modules/debug/debug.module.ts b/apps/core/src/modules/debug/debug.module.ts similarity index 100% rename from src/modules/debug/debug.module.ts rename to apps/core/src/modules/debug/debug.module.ts diff --git a/src/modules/debug/debug.service.ts b/apps/core/src/modules/debug/debug.service.ts similarity index 100% rename from src/modules/debug/debug.service.ts rename to apps/core/src/modules/debug/debug.service.ts diff --git a/src/modules/demo/demo.module.ts b/apps/core/src/modules/demo/demo.module.ts similarity index 100% rename from src/modules/demo/demo.module.ts rename to apps/core/src/modules/demo/demo.module.ts diff --git a/src/modules/dependency/dependency.controller.ts b/apps/core/src/modules/dependency/dependency.controller.ts similarity index 100% rename from src/modules/dependency/dependency.controller.ts rename to apps/core/src/modules/dependency/dependency.controller.ts diff --git a/src/modules/dependency/dependency.module.ts b/apps/core/src/modules/dependency/dependency.module.ts similarity index 100% rename from src/modules/dependency/dependency.module.ts rename to apps/core/src/modules/dependency/dependency.module.ts diff --git a/src/modules/feed/feed.controller.ts b/apps/core/src/modules/feed/feed.controller.ts similarity index 95% rename from src/modules/feed/feed.controller.ts rename to apps/core/src/modules/feed/feed.controller.ts index 584582d2..aef44af6 100644 --- a/src/modules/feed/feed.controller.ts +++ b/apps/core/src/modules/feed/feed.controller.ts @@ -1,6 +1,7 @@ import xss from 'xss' -import { CacheKey, CacheTTL, Controller, Get, Header } from '@nestjs/common' +import { CacheKey, CacheTTL } from '@nestjs/cache-manager' +import { Controller, Get, Header } from '@nestjs/common' import { HTTPDecorators } from '~/common/decorators/http.decorator' import { CacheKeys } from '~/constants/cache.constant' diff --git a/src/modules/feed/feed.module.ts b/apps/core/src/modules/feed/feed.module.ts similarity index 100% rename from src/modules/feed/feed.module.ts rename to apps/core/src/modules/feed/feed.module.ts diff --git a/src/modules/file/file.controller.ts b/apps/core/src/modules/file/file.controller.ts similarity index 100% rename from src/modules/file/file.controller.ts rename to apps/core/src/modules/file/file.controller.ts diff --git a/src/modules/file/file.dto.ts b/apps/core/src/modules/file/file.dto.ts similarity index 100% rename from src/modules/file/file.dto.ts rename to apps/core/src/modules/file/file.dto.ts diff --git a/src/modules/file/file.module.ts b/apps/core/src/modules/file/file.module.ts similarity index 100% rename from src/modules/file/file.module.ts rename to apps/core/src/modules/file/file.module.ts diff --git a/src/modules/file/file.service.ts b/apps/core/src/modules/file/file.service.ts similarity index 100% rename from src/modules/file/file.service.ts rename to apps/core/src/modules/file/file.service.ts diff --git a/src/modules/file/file.type.ts b/apps/core/src/modules/file/file.type.ts similarity index 100% rename from src/modules/file/file.type.ts rename to apps/core/src/modules/file/file.type.ts diff --git a/src/modules/health/health.controller.ts b/apps/core/src/modules/health/health.controller.ts similarity index 100% rename from src/modules/health/health.controller.ts rename to apps/core/src/modules/health/health.controller.ts diff --git a/src/modules/health/health.dto.ts b/apps/core/src/modules/health/health.dto.ts similarity index 100% rename from src/modules/health/health.dto.ts rename to apps/core/src/modules/health/health.dto.ts diff --git a/src/modules/health/health.module.ts b/apps/core/src/modules/health/health.module.ts similarity index 100% rename from src/modules/health/health.module.ts rename to apps/core/src/modules/health/health.module.ts diff --git a/src/modules/health/sub-controller/cron.controller.ts b/apps/core/src/modules/health/sub-controller/cron.controller.ts similarity index 100% rename from src/modules/health/sub-controller/cron.controller.ts rename to apps/core/src/modules/health/sub-controller/cron.controller.ts diff --git a/src/modules/health/sub-controller/log.controller.ts b/apps/core/src/modules/health/sub-controller/log.controller.ts similarity index 100% rename from src/modules/health/sub-controller/log.controller.ts rename to apps/core/src/modules/health/sub-controller/log.controller.ts diff --git a/src/modules/helper/helper.controller.ts b/apps/core/src/modules/helper/helper.controller.ts similarity index 100% rename from src/modules/helper/helper.controller.ts rename to apps/core/src/modules/helper/helper.controller.ts diff --git a/src/modules/helper/helper.module.ts b/apps/core/src/modules/helper/helper.module.ts similarity index 100% rename from src/modules/helper/helper.module.ts rename to apps/core/src/modules/helper/helper.module.ts diff --git a/src/modules/helper/helper.service.ts b/apps/core/src/modules/helper/helper.service.ts similarity index 100% rename from src/modules/helper/helper.service.ts rename to apps/core/src/modules/helper/helper.service.ts diff --git a/src/modules/init/init.controller.ts b/apps/core/src/modules/init/init.controller.ts similarity index 100% rename from src/modules/init/init.controller.ts rename to apps/core/src/modules/init/init.controller.ts diff --git a/src/modules/init/init.module.ts b/apps/core/src/modules/init/init.module.ts similarity index 100% rename from src/modules/init/init.module.ts rename to apps/core/src/modules/init/init.module.ts diff --git a/src/modules/init/init.service.ts b/apps/core/src/modules/init/init.service.ts similarity index 100% rename from src/modules/init/init.service.ts rename to apps/core/src/modules/init/init.service.ts diff --git a/src/modules/link/link.controller.ts b/apps/core/src/modules/link/link.controller.ts similarity index 100% rename from src/modules/link/link.controller.ts rename to apps/core/src/modules/link/link.controller.ts diff --git a/src/modules/link/link.dto.ts b/apps/core/src/modules/link/link.dto.ts similarity index 100% rename from src/modules/link/link.dto.ts rename to apps/core/src/modules/link/link.dto.ts diff --git a/src/modules/link/link.model.ts b/apps/core/src/modules/link/link.model.ts similarity index 100% rename from src/modules/link/link.model.ts rename to apps/core/src/modules/link/link.model.ts diff --git a/src/modules/link/link.module.ts b/apps/core/src/modules/link/link.module.ts similarity index 100% rename from src/modules/link/link.module.ts rename to apps/core/src/modules/link/link.module.ts diff --git a/src/modules/link/link.service.ts b/apps/core/src/modules/link/link.service.ts similarity index 100% rename from src/modules/link/link.service.ts rename to apps/core/src/modules/link/link.service.ts diff --git a/src/modules/markdown/markdown.controller.ts b/apps/core/src/modules/markdown/markdown.controller.ts similarity index 100% rename from src/modules/markdown/markdown.controller.ts rename to apps/core/src/modules/markdown/markdown.controller.ts diff --git a/src/modules/markdown/markdown.dto.ts b/apps/core/src/modules/markdown/markdown.dto.ts similarity index 100% rename from src/modules/markdown/markdown.dto.ts rename to apps/core/src/modules/markdown/markdown.dto.ts diff --git a/src/modules/markdown/markdown.interface.ts b/apps/core/src/modules/markdown/markdown.interface.ts similarity index 100% rename from src/modules/markdown/markdown.interface.ts rename to apps/core/src/modules/markdown/markdown.interface.ts diff --git a/src/modules/markdown/markdown.module.ts b/apps/core/src/modules/markdown/markdown.module.ts similarity index 100% rename from src/modules/markdown/markdown.module.ts rename to apps/core/src/modules/markdown/markdown.module.ts diff --git a/src/modules/markdown/markdown.service.ts b/apps/core/src/modules/markdown/markdown.service.ts similarity index 100% rename from src/modules/markdown/markdown.service.ts rename to apps/core/src/modules/markdown/markdown.service.ts diff --git a/src/modules/note/models/coordinate.model.ts b/apps/core/src/modules/note/models/coordinate.model.ts similarity index 100% rename from src/modules/note/models/coordinate.model.ts rename to apps/core/src/modules/note/models/coordinate.model.ts diff --git a/src/modules/note/models/music.model.ts b/apps/core/src/modules/note/models/music.model.ts similarity index 100% rename from src/modules/note/models/music.model.ts rename to apps/core/src/modules/note/models/music.model.ts diff --git a/src/modules/note/note.controller.ts b/apps/core/src/modules/note/note.controller.ts similarity index 100% rename from src/modules/note/note.controller.ts rename to apps/core/src/modules/note/note.controller.ts diff --git a/src/modules/note/note.dto.ts b/apps/core/src/modules/note/note.dto.ts similarity index 100% rename from src/modules/note/note.dto.ts rename to apps/core/src/modules/note/note.dto.ts diff --git a/src/modules/note/note.model.ts b/apps/core/src/modules/note/note.model.ts similarity index 100% rename from src/modules/note/note.model.ts rename to apps/core/src/modules/note/note.model.ts diff --git a/src/modules/note/note.module.ts b/apps/core/src/modules/note/note.module.ts similarity index 100% rename from src/modules/note/note.module.ts rename to apps/core/src/modules/note/note.module.ts diff --git a/src/modules/note/note.service.ts b/apps/core/src/modules/note/note.service.ts similarity index 100% rename from src/modules/note/note.service.ts rename to apps/core/src/modules/note/note.service.ts diff --git a/src/modules/option/controllers/base.option.controller.ts b/apps/core/src/modules/option/controllers/base.option.controller.ts similarity index 100% rename from src/modules/option/controllers/base.option.controller.ts rename to apps/core/src/modules/option/controllers/base.option.controller.ts diff --git a/src/modules/option/controllers/email.option.controller.ts b/apps/core/src/modules/option/controllers/email.option.controller.ts similarity index 100% rename from src/modules/option/controllers/email.option.controller.ts rename to apps/core/src/modules/option/controllers/email.option.controller.ts diff --git a/src/modules/option/dtoes/config.dto.ts b/apps/core/src/modules/option/dtoes/config.dto.ts similarity index 100% rename from src/modules/option/dtoes/config.dto.ts rename to apps/core/src/modules/option/dtoes/config.dto.ts diff --git a/src/modules/option/dtoes/email.dto.ts b/apps/core/src/modules/option/dtoes/email.dto.ts similarity index 100% rename from src/modules/option/dtoes/email.dto.ts rename to apps/core/src/modules/option/dtoes/email.dto.ts diff --git a/src/modules/option/option.decorator.ts b/apps/core/src/modules/option/option.decorator.ts similarity index 100% rename from src/modules/option/option.decorator.ts rename to apps/core/src/modules/option/option.decorator.ts diff --git a/src/modules/option/option.model.ts b/apps/core/src/modules/option/option.model.ts similarity index 100% rename from src/modules/option/option.model.ts rename to apps/core/src/modules/option/option.model.ts diff --git a/src/modules/option/option.module.ts b/apps/core/src/modules/option/option.module.ts similarity index 100% rename from src/modules/option/option.module.ts rename to apps/core/src/modules/option/option.module.ts diff --git a/src/modules/page/page.controller.ts b/apps/core/src/modules/page/page.controller.ts similarity index 100% rename from src/modules/page/page.controller.ts rename to apps/core/src/modules/page/page.controller.ts diff --git a/src/modules/page/page.dto.ts b/apps/core/src/modules/page/page.dto.ts similarity index 100% rename from src/modules/page/page.dto.ts rename to apps/core/src/modules/page/page.dto.ts diff --git a/src/modules/page/page.model.ts b/apps/core/src/modules/page/page.model.ts similarity index 100% rename from src/modules/page/page.model.ts rename to apps/core/src/modules/page/page.model.ts diff --git a/src/modules/page/page.module.ts b/apps/core/src/modules/page/page.module.ts similarity index 100% rename from src/modules/page/page.module.ts rename to apps/core/src/modules/page/page.module.ts diff --git a/src/modules/page/page.service.ts b/apps/core/src/modules/page/page.service.ts similarity index 100% rename from src/modules/page/page.service.ts rename to apps/core/src/modules/page/page.service.ts diff --git a/src/modules/pageproxy/pageproxy.controller.ts b/apps/core/src/modules/pageproxy/pageproxy.controller.ts similarity index 100% rename from src/modules/pageproxy/pageproxy.controller.ts rename to apps/core/src/modules/pageproxy/pageproxy.controller.ts diff --git a/src/modules/pageproxy/pageproxy.dto.ts b/apps/core/src/modules/pageproxy/pageproxy.dto.ts similarity index 100% rename from src/modules/pageproxy/pageproxy.dto.ts rename to apps/core/src/modules/pageproxy/pageproxy.dto.ts diff --git a/src/modules/pageproxy/pageproxy.module.ts b/apps/core/src/modules/pageproxy/pageproxy.module.ts similarity index 100% rename from src/modules/pageproxy/pageproxy.module.ts rename to apps/core/src/modules/pageproxy/pageproxy.module.ts diff --git a/src/modules/pageproxy/pageproxy.service.ts b/apps/core/src/modules/pageproxy/pageproxy.service.ts similarity index 100% rename from src/modules/pageproxy/pageproxy.service.ts rename to apps/core/src/modules/pageproxy/pageproxy.service.ts diff --git a/src/modules/post/post.controller.ts b/apps/core/src/modules/post/post.controller.ts similarity index 100% rename from src/modules/post/post.controller.ts rename to apps/core/src/modules/post/post.controller.ts diff --git a/src/modules/post/post.dto.ts b/apps/core/src/modules/post/post.dto.ts similarity index 100% rename from src/modules/post/post.dto.ts rename to apps/core/src/modules/post/post.dto.ts diff --git a/src/modules/post/post.model.ts b/apps/core/src/modules/post/post.model.ts similarity index 100% rename from src/modules/post/post.model.ts rename to apps/core/src/modules/post/post.model.ts diff --git a/src/modules/post/post.module.ts b/apps/core/src/modules/post/post.module.ts similarity index 100% rename from src/modules/post/post.module.ts rename to apps/core/src/modules/post/post.module.ts diff --git a/src/modules/post/post.service.ts b/apps/core/src/modules/post/post.service.ts similarity index 100% rename from src/modules/post/post.service.ts rename to apps/core/src/modules/post/post.service.ts diff --git a/src/modules/project/project.controller.ts b/apps/core/src/modules/project/project.controller.ts similarity index 100% rename from src/modules/project/project.controller.ts rename to apps/core/src/modules/project/project.controller.ts diff --git a/src/modules/project/project.model.ts b/apps/core/src/modules/project/project.model.ts similarity index 100% rename from src/modules/project/project.model.ts rename to apps/core/src/modules/project/project.model.ts diff --git a/src/modules/project/project.module.ts b/apps/core/src/modules/project/project.module.ts similarity index 100% rename from src/modules/project/project.module.ts rename to apps/core/src/modules/project/project.module.ts diff --git a/src/modules/pty/pty.controller.ts b/apps/core/src/modules/pty/pty.controller.ts similarity index 100% rename from src/modules/pty/pty.controller.ts rename to apps/core/src/modules/pty/pty.controller.ts diff --git a/src/modules/pty/pty.gateway.ts b/apps/core/src/modules/pty/pty.gateway.ts similarity index 100% rename from src/modules/pty/pty.gateway.ts rename to apps/core/src/modules/pty/pty.gateway.ts diff --git a/src/modules/pty/pty.module.ts b/apps/core/src/modules/pty/pty.module.ts similarity index 100% rename from src/modules/pty/pty.module.ts rename to apps/core/src/modules/pty/pty.module.ts diff --git a/src/modules/pty/pty.service.ts b/apps/core/src/modules/pty/pty.service.ts similarity index 100% rename from src/modules/pty/pty.service.ts rename to apps/core/src/modules/pty/pty.service.ts diff --git a/src/modules/recently/recently.controller.ts b/apps/core/src/modules/recently/recently.controller.ts similarity index 100% rename from src/modules/recently/recently.controller.ts rename to apps/core/src/modules/recently/recently.controller.ts diff --git a/src/modules/recently/recently.dto.ts b/apps/core/src/modules/recently/recently.dto.ts similarity index 100% rename from src/modules/recently/recently.dto.ts rename to apps/core/src/modules/recently/recently.dto.ts diff --git a/src/modules/recently/recently.model.ts b/apps/core/src/modules/recently/recently.model.ts similarity index 100% rename from src/modules/recently/recently.model.ts rename to apps/core/src/modules/recently/recently.model.ts diff --git a/src/modules/recently/recently.module.ts b/apps/core/src/modules/recently/recently.module.ts similarity index 100% rename from src/modules/recently/recently.module.ts rename to apps/core/src/modules/recently/recently.module.ts diff --git a/src/modules/recently/recently.service.ts b/apps/core/src/modules/recently/recently.service.ts similarity index 100% rename from src/modules/recently/recently.service.ts rename to apps/core/src/modules/recently/recently.service.ts diff --git a/src/modules/render/render.controller.ts b/apps/core/src/modules/render/render.controller.ts similarity index 100% rename from src/modules/render/render.controller.ts rename to apps/core/src/modules/render/render.controller.ts diff --git a/src/modules/render/render.module.ts b/apps/core/src/modules/render/render.module.ts similarity index 100% rename from src/modules/render/render.module.ts rename to apps/core/src/modules/render/render.module.ts diff --git a/src/modules/say/say.controller.ts b/apps/core/src/modules/say/say.controller.ts similarity index 100% rename from src/modules/say/say.controller.ts rename to apps/core/src/modules/say/say.controller.ts diff --git a/src/modules/say/say.model.ts b/apps/core/src/modules/say/say.model.ts similarity index 100% rename from src/modules/say/say.model.ts rename to apps/core/src/modules/say/say.model.ts diff --git a/src/modules/say/say.module.ts b/apps/core/src/modules/say/say.module.ts similarity index 100% rename from src/modules/say/say.module.ts rename to apps/core/src/modules/say/say.module.ts diff --git a/src/modules/say/say.service.ts b/apps/core/src/modules/say/say.service.ts similarity index 100% rename from src/modules/say/say.service.ts rename to apps/core/src/modules/say/say.service.ts diff --git a/src/modules/search/search.controller.ts b/apps/core/src/modules/search/search.controller.ts similarity index 100% rename from src/modules/search/search.controller.ts rename to apps/core/src/modules/search/search.controller.ts diff --git a/src/modules/search/search.dto.ts b/apps/core/src/modules/search/search.dto.ts similarity index 100% rename from src/modules/search/search.dto.ts rename to apps/core/src/modules/search/search.dto.ts diff --git a/src/modules/search/search.module.ts b/apps/core/src/modules/search/search.module.ts similarity index 100% rename from src/modules/search/search.module.ts rename to apps/core/src/modules/search/search.module.ts diff --git a/src/modules/search/search.service.ts b/apps/core/src/modules/search/search.service.ts similarity index 100% rename from src/modules/search/search.service.ts rename to apps/core/src/modules/search/search.service.ts diff --git a/src/modules/serverless/function.types.ts b/apps/core/src/modules/serverless/function.types.ts similarity index 100% rename from src/modules/serverless/function.types.ts rename to apps/core/src/modules/serverless/function.types.ts diff --git a/src/modules/serverless/mock-response.util.ts b/apps/core/src/modules/serverless/mock-response.util.ts similarity index 100% rename from src/modules/serverless/mock-response.util.ts rename to apps/core/src/modules/serverless/mock-response.util.ts diff --git a/src/modules/serverless/pack/built-in/geocode_location.ts b/apps/core/src/modules/serverless/pack/built-in/geocode_location.ts similarity index 100% rename from src/modules/serverless/pack/built-in/geocode_location.ts rename to apps/core/src/modules/serverless/pack/built-in/geocode_location.ts diff --git a/src/modules/serverless/pack/built-in/geocode_search.ts b/apps/core/src/modules/serverless/pack/built-in/geocode_search.ts similarity index 100% rename from src/modules/serverless/pack/built-in/geocode_search.ts rename to apps/core/src/modules/serverless/pack/built-in/geocode_search.ts diff --git a/src/modules/serverless/pack/built-in/index.ts b/apps/core/src/modules/serverless/pack/built-in/index.ts similarity index 100% rename from src/modules/serverless/pack/built-in/index.ts rename to apps/core/src/modules/serverless/pack/built-in/index.ts diff --git a/src/modules/serverless/pack/built-in/ip-query.ts b/apps/core/src/modules/serverless/pack/built-in/ip-query.ts similarity index 100% rename from src/modules/serverless/pack/built-in/ip-query.ts rename to apps/core/src/modules/serverless/pack/built-in/ip-query.ts diff --git a/src/modules/serverless/pack/index.ts b/apps/core/src/modules/serverless/pack/index.ts similarity index 100% rename from src/modules/serverless/pack/index.ts rename to apps/core/src/modules/serverless/pack/index.ts diff --git a/src/modules/serverless/pack/xlog/get_page_id.ts b/apps/core/src/modules/serverless/pack/xlog/get_page_id.ts similarity index 100% rename from src/modules/serverless/pack/xlog/get_page_id.ts rename to apps/core/src/modules/serverless/pack/xlog/get_page_id.ts diff --git a/src/modules/serverless/pack/xlog/get_summary.ts b/apps/core/src/modules/serverless/pack/xlog/get_summary.ts similarity index 100% rename from src/modules/serverless/pack/xlog/get_summary.ts rename to apps/core/src/modules/serverless/pack/xlog/get_summary.ts diff --git a/src/modules/serverless/pack/xlog/index.ts b/apps/core/src/modules/serverless/pack/xlog/index.ts similarity index 100% rename from src/modules/serverless/pack/xlog/index.ts rename to apps/core/src/modules/serverless/pack/xlog/index.ts diff --git a/src/modules/serverless/serverless.controller.ts b/apps/core/src/modules/serverless/serverless.controller.ts similarity index 100% rename from src/modules/serverless/serverless.controller.ts rename to apps/core/src/modules/serverless/serverless.controller.ts diff --git a/src/modules/serverless/serverless.dto.ts b/apps/core/src/modules/serverless/serverless.dto.ts similarity index 100% rename from src/modules/serverless/serverless.dto.ts rename to apps/core/src/modules/serverless/serverless.dto.ts diff --git a/src/modules/serverless/serverless.model.ts b/apps/core/src/modules/serverless/serverless.model.ts similarity index 100% rename from src/modules/serverless/serverless.model.ts rename to apps/core/src/modules/serverless/serverless.model.ts diff --git a/src/modules/serverless/serverless.module.ts b/apps/core/src/modules/serverless/serverless.module.ts similarity index 100% rename from src/modules/serverless/serverless.module.ts rename to apps/core/src/modules/serverless/serverless.module.ts diff --git a/src/modules/serverless/serverless.readme.md b/apps/core/src/modules/serverless/serverless.readme.md similarity index 100% rename from src/modules/serverless/serverless.readme.md rename to apps/core/src/modules/serverless/serverless.readme.md diff --git a/src/modules/serverless/serverless.service.ts b/apps/core/src/modules/serverless/serverless.service.ts similarity index 100% rename from src/modules/serverless/serverless.service.ts rename to apps/core/src/modules/serverless/serverless.service.ts diff --git a/src/modules/serverless/serverless.util.ts b/apps/core/src/modules/serverless/serverless.util.ts similarity index 100% rename from src/modules/serverless/serverless.util.ts rename to apps/core/src/modules/serverless/serverless.util.ts diff --git a/src/modules/sitemap/sitemap.controller.ts b/apps/core/src/modules/sitemap/sitemap.controller.ts similarity index 90% rename from src/modules/sitemap/sitemap.controller.ts rename to apps/core/src/modules/sitemap/sitemap.controller.ts index b17dfc60..cdff6597 100644 --- a/src/modules/sitemap/sitemap.controller.ts +++ b/apps/core/src/modules/sitemap/sitemap.controller.ts @@ -1,4 +1,5 @@ -import { CacheKey, CacheTTL, Controller, Get, Header } from '@nestjs/common' +import { CacheKey, CacheTTL } from '@nestjs/cache-manager' +import { Controller, Get, Header } from '@nestjs/common' import { HTTPDecorators } from '~/common/decorators/http.decorator' import { CacheKeys } from '~/constants/cache.constant' diff --git a/src/modules/sitemap/sitemap.module.ts b/apps/core/src/modules/sitemap/sitemap.module.ts similarity index 100% rename from src/modules/sitemap/sitemap.module.ts rename to apps/core/src/modules/sitemap/sitemap.module.ts diff --git a/src/modules/snippet/snippet.controller.ts b/apps/core/src/modules/snippet/snippet.controller.ts similarity index 100% rename from src/modules/snippet/snippet.controller.ts rename to apps/core/src/modules/snippet/snippet.controller.ts diff --git a/src/modules/snippet/snippet.dto.ts b/apps/core/src/modules/snippet/snippet.dto.ts similarity index 100% rename from src/modules/snippet/snippet.dto.ts rename to apps/core/src/modules/snippet/snippet.dto.ts diff --git a/src/modules/snippet/snippet.model.ts b/apps/core/src/modules/snippet/snippet.model.ts similarity index 100% rename from src/modules/snippet/snippet.model.ts rename to apps/core/src/modules/snippet/snippet.model.ts diff --git a/src/modules/snippet/snippet.module.ts b/apps/core/src/modules/snippet/snippet.module.ts similarity index 100% rename from src/modules/snippet/snippet.module.ts rename to apps/core/src/modules/snippet/snippet.module.ts diff --git a/src/modules/snippet/snippet.service.ts b/apps/core/src/modules/snippet/snippet.service.ts similarity index 100% rename from src/modules/snippet/snippet.service.ts rename to apps/core/src/modules/snippet/snippet.service.ts diff --git a/src/modules/subscribe/subscribe.constant.ts b/apps/core/src/modules/subscribe/subscribe.constant.ts similarity index 100% rename from src/modules/subscribe/subscribe.constant.ts rename to apps/core/src/modules/subscribe/subscribe.constant.ts diff --git a/src/modules/subscribe/subscribe.controller.ts b/apps/core/src/modules/subscribe/subscribe.controller.ts similarity index 100% rename from src/modules/subscribe/subscribe.controller.ts rename to apps/core/src/modules/subscribe/subscribe.controller.ts diff --git a/src/modules/subscribe/subscribe.dto.ts b/apps/core/src/modules/subscribe/subscribe.dto.ts similarity index 100% rename from src/modules/subscribe/subscribe.dto.ts rename to apps/core/src/modules/subscribe/subscribe.dto.ts diff --git a/src/modules/subscribe/subscribe.model.ts b/apps/core/src/modules/subscribe/subscribe.model.ts similarity index 100% rename from src/modules/subscribe/subscribe.model.ts rename to apps/core/src/modules/subscribe/subscribe.model.ts diff --git a/src/modules/subscribe/subscribe.module.ts b/apps/core/src/modules/subscribe/subscribe.module.ts similarity index 100% rename from src/modules/subscribe/subscribe.module.ts rename to apps/core/src/modules/subscribe/subscribe.module.ts diff --git a/src/modules/subscribe/subscribe.service.ts b/apps/core/src/modules/subscribe/subscribe.service.ts similarity index 100% rename from src/modules/subscribe/subscribe.service.ts rename to apps/core/src/modules/subscribe/subscribe.service.ts diff --git a/src/modules/topic/topic.controller.ts b/apps/core/src/modules/topic/topic.controller.ts similarity index 100% rename from src/modules/topic/topic.controller.ts rename to apps/core/src/modules/topic/topic.controller.ts diff --git a/src/modules/topic/topic.model.ts b/apps/core/src/modules/topic/topic.model.ts similarity index 100% rename from src/modules/topic/topic.model.ts rename to apps/core/src/modules/topic/topic.model.ts diff --git a/src/modules/topic/topic.module.ts b/apps/core/src/modules/topic/topic.module.ts similarity index 100% rename from src/modules/topic/topic.module.ts rename to apps/core/src/modules/topic/topic.module.ts diff --git a/src/modules/topic/topic.service.ts b/apps/core/src/modules/topic/topic.service.ts similarity index 100% rename from src/modules/topic/topic.service.ts rename to apps/core/src/modules/topic/topic.service.ts diff --git a/src/modules/update/update.controller.ts b/apps/core/src/modules/update/update.controller.ts similarity index 100% rename from src/modules/update/update.controller.ts rename to apps/core/src/modules/update/update.controller.ts diff --git a/src/modules/update/update.dto.ts b/apps/core/src/modules/update/update.dto.ts similarity index 100% rename from src/modules/update/update.dto.ts rename to apps/core/src/modules/update/update.dto.ts diff --git a/src/modules/update/update.module.ts b/apps/core/src/modules/update/update.module.ts similarity index 100% rename from src/modules/update/update.module.ts rename to apps/core/src/modules/update/update.module.ts diff --git a/src/modules/update/update.service.ts b/apps/core/src/modules/update/update.service.ts similarity index 100% rename from src/modules/update/update.service.ts rename to apps/core/src/modules/update/update.service.ts diff --git a/src/modules/user/user.controller.ts b/apps/core/src/modules/user/user.controller.ts similarity index 100% rename from src/modules/user/user.controller.ts rename to apps/core/src/modules/user/user.controller.ts diff --git a/src/modules/user/user.dto.ts b/apps/core/src/modules/user/user.dto.ts similarity index 100% rename from src/modules/user/user.dto.ts rename to apps/core/src/modules/user/user.dto.ts diff --git a/src/modules/user/user.model.ts b/apps/core/src/modules/user/user.model.ts similarity index 100% rename from src/modules/user/user.model.ts rename to apps/core/src/modules/user/user.model.ts diff --git a/src/modules/user/user.module.ts b/apps/core/src/modules/user/user.module.ts similarity index 100% rename from src/modules/user/user.module.ts rename to apps/core/src/modules/user/user.module.ts diff --git a/src/modules/user/user.service.ts b/apps/core/src/modules/user/user.service.ts similarity index 100% rename from src/modules/user/user.service.ts rename to apps/core/src/modules/user/user.service.ts diff --git a/src/processors/database/database.models.ts b/apps/core/src/processors/database/database.models.ts similarity index 100% rename from src/processors/database/database.models.ts rename to apps/core/src/processors/database/database.models.ts diff --git a/src/processors/database/database.module.ts b/apps/core/src/processors/database/database.module.ts similarity index 100% rename from src/processors/database/database.module.ts rename to apps/core/src/processors/database/database.module.ts diff --git a/src/processors/database/database.provider.ts b/apps/core/src/processors/database/database.provider.ts similarity index 100% rename from src/processors/database/database.provider.ts rename to apps/core/src/processors/database/database.provider.ts diff --git a/src/processors/database/database.service.ts b/apps/core/src/processors/database/database.service.ts similarity index 100% rename from src/processors/database/database.service.ts rename to apps/core/src/processors/database/database.service.ts diff --git a/src/processors/gateway/admin/events.gateway.ts b/apps/core/src/processors/gateway/admin/events.gateway.ts similarity index 100% rename from src/processors/gateway/admin/events.gateway.ts rename to apps/core/src/processors/gateway/admin/events.gateway.ts diff --git a/src/processors/gateway/base.gateway.ts b/apps/core/src/processors/gateway/base.gateway.ts similarity index 100% rename from src/processors/gateway/base.gateway.ts rename to apps/core/src/processors/gateway/base.gateway.ts diff --git a/src/processors/gateway/gateway.module.ts b/apps/core/src/processors/gateway/gateway.module.ts similarity index 100% rename from src/processors/gateway/gateway.module.ts rename to apps/core/src/processors/gateway/gateway.module.ts diff --git a/src/processors/gateway/shared/auth.gateway.ts b/apps/core/src/processors/gateway/shared/auth.gateway.ts similarity index 100% rename from src/processors/gateway/shared/auth.gateway.ts rename to apps/core/src/processors/gateway/shared/auth.gateway.ts diff --git a/src/processors/gateway/shared/events.gateway.ts b/apps/core/src/processors/gateway/shared/events.gateway.ts similarity index 100% rename from src/processors/gateway/shared/events.gateway.ts rename to apps/core/src/processors/gateway/shared/events.gateway.ts diff --git a/src/processors/gateway/system/events.gateway.ts b/apps/core/src/processors/gateway/system/events.gateway.ts similarity index 100% rename from src/processors/gateway/system/events.gateway.ts rename to apps/core/src/processors/gateway/system/events.gateway.ts diff --git a/src/processors/gateway/web/dtos/danmaku.dto.ts b/apps/core/src/processors/gateway/web/dtos/danmaku.dto.ts similarity index 100% rename from src/processors/gateway/web/dtos/danmaku.dto.ts rename to apps/core/src/processors/gateway/web/dtos/danmaku.dto.ts diff --git a/src/processors/gateway/web/events.gateway.ts b/apps/core/src/processors/gateway/web/events.gateway.ts similarity index 100% rename from src/processors/gateway/web/events.gateway.ts rename to apps/core/src/processors/gateway/web/events.gateway.ts diff --git a/src/processors/helper/helper.asset.service.ts b/apps/core/src/processors/helper/helper.asset.service.ts similarity index 100% rename from src/processors/helper/helper.asset.service.ts rename to apps/core/src/processors/helper/helper.asset.service.ts diff --git a/src/processors/helper/helper.bark.service.ts b/apps/core/src/processors/helper/helper.bark.service.ts similarity index 100% rename from src/processors/helper/helper.bark.service.ts rename to apps/core/src/processors/helper/helper.bark.service.ts diff --git a/src/processors/helper/helper.counting.service.ts b/apps/core/src/processors/helper/helper.counting.service.ts similarity index 100% rename from src/processors/helper/helper.counting.service.ts rename to apps/core/src/processors/helper/helper.counting.service.ts diff --git a/src/processors/helper/helper.cron.service.ts b/apps/core/src/processors/helper/helper.cron.service.ts similarity index 100% rename from src/processors/helper/helper.cron.service.ts rename to apps/core/src/processors/helper/helper.cron.service.ts diff --git a/src/processors/helper/helper.email.service.ts b/apps/core/src/processors/helper/helper.email.service.ts similarity index 100% rename from src/processors/helper/helper.email.service.ts rename to apps/core/src/processors/helper/helper.email.service.ts diff --git a/src/processors/helper/helper.event.service.ts b/apps/core/src/processors/helper/helper.event.service.ts similarity index 100% rename from src/processors/helper/helper.event.service.ts rename to apps/core/src/processors/helper/helper.event.service.ts diff --git a/src/processors/helper/helper.http.service.ts b/apps/core/src/processors/helper/helper.http.service.ts similarity index 100% rename from src/processors/helper/helper.http.service.ts rename to apps/core/src/processors/helper/helper.http.service.ts diff --git a/src/processors/helper/helper.image.service.ts b/apps/core/src/processors/helper/helper.image.service.ts similarity index 100% rename from src/processors/helper/helper.image.service.ts rename to apps/core/src/processors/helper/helper.image.service.ts diff --git a/src/processors/helper/helper.jwt.service.ts b/apps/core/src/processors/helper/helper.jwt.service.ts similarity index 100% rename from src/processors/helper/helper.jwt.service.ts rename to apps/core/src/processors/helper/helper.jwt.service.ts diff --git a/src/processors/helper/helper.macro.service.ts b/apps/core/src/processors/helper/helper.macro.service.ts similarity index 100% rename from src/processors/helper/helper.macro.service.ts rename to apps/core/src/processors/helper/helper.macro.service.ts diff --git a/src/processors/helper/helper.module.ts b/apps/core/src/processors/helper/helper.module.ts similarity index 100% rename from src/processors/helper/helper.module.ts rename to apps/core/src/processors/helper/helper.module.ts diff --git a/src/processors/helper/helper.tq.service.ts b/apps/core/src/processors/helper/helper.tq.service.ts similarity index 100% rename from src/processors/helper/helper.tq.service.ts rename to apps/core/src/processors/helper/helper.tq.service.ts diff --git a/src/processors/helper/helper.upload.service.ts b/apps/core/src/processors/helper/helper.upload.service.ts similarity index 100% rename from src/processors/helper/helper.upload.service.ts rename to apps/core/src/processors/helper/helper.upload.service.ts diff --git a/src/processors/helper/helper.url-builder.service.ts b/apps/core/src/processors/helper/helper.url-builder.service.ts similarity index 100% rename from src/processors/helper/helper.url-builder.service.ts rename to apps/core/src/processors/helper/helper.url-builder.service.ts diff --git a/src/processors/logger/logger.module.ts b/apps/core/src/processors/logger/logger.module.ts similarity index 100% rename from src/processors/logger/logger.module.ts rename to apps/core/src/processors/logger/logger.module.ts diff --git a/src/processors/logger/logger.service.ts b/apps/core/src/processors/logger/logger.service.ts similarity index 100% rename from src/processors/logger/logger.service.ts rename to apps/core/src/processors/logger/logger.service.ts diff --git a/src/processors/redis/cache.service.ts b/apps/core/src/processors/redis/cache.service.ts similarity index 100% rename from src/processors/redis/cache.service.ts rename to apps/core/src/processors/redis/cache.service.ts diff --git a/src/processors/redis/redis.config.service.ts b/apps/core/src/processors/redis/redis.config.service.ts similarity index 100% rename from src/processors/redis/redis.config.service.ts rename to apps/core/src/processors/redis/redis.config.service.ts diff --git a/src/processors/redis/redis.module.ts b/apps/core/src/processors/redis/redis.module.ts similarity index 83% rename from src/processors/redis/redis.module.ts rename to apps/core/src/processors/redis/redis.module.ts index 867080d3..397c6933 100644 --- a/src/processors/redis/redis.module.ts +++ b/apps/core/src/processors/redis/redis.module.ts @@ -4,7 +4,8 @@ * @module processor/cache/module * @author Surmon */ -import { Global, Module, CacheModule as NestCacheModule } from '@nestjs/common' +import { CacheModule as NestCacheModule } from '@nestjs/cache-manager' +import { Global, Module } from '@nestjs/common' import { CacheService } from './cache.service' import { RedisConfigService } from './redis.config.service' diff --git a/src/processors/redis/subpub.service.ts b/apps/core/src/processors/redis/subpub.service.ts similarity index 100% rename from src/processors/redis/subpub.service.ts rename to apps/core/src/processors/redis/subpub.service.ts diff --git a/src/repl.ts b/apps/core/src/repl.ts similarity index 100% rename from src/repl.ts rename to apps/core/src/repl.ts diff --git a/src/shared/dto/file.dto.ts b/apps/core/src/shared/dto/file.dto.ts similarity index 100% rename from src/shared/dto/file.dto.ts rename to apps/core/src/shared/dto/file.dto.ts diff --git a/src/shared/dto/id.dto.ts b/apps/core/src/shared/dto/id.dto.ts similarity index 100% rename from src/shared/dto/id.dto.ts rename to apps/core/src/shared/dto/id.dto.ts diff --git a/src/shared/dto/pager.dto.ts b/apps/core/src/shared/dto/pager.dto.ts similarity index 100% rename from src/shared/dto/pager.dto.ts rename to apps/core/src/shared/dto/pager.dto.ts diff --git a/src/shared/interface/paginator.interface.ts b/apps/core/src/shared/interface/paginator.interface.ts similarity index 100% rename from src/shared/interface/paginator.interface.ts rename to apps/core/src/shared/interface/paginator.interface.ts diff --git a/src/shared/model/base-comment.model.ts b/apps/core/src/shared/model/base-comment.model.ts similarity index 100% rename from src/shared/model/base-comment.model.ts rename to apps/core/src/shared/model/base-comment.model.ts diff --git a/src/shared/model/base.model.ts b/apps/core/src/shared/model/base.model.ts similarity index 100% rename from src/shared/model/base.model.ts rename to apps/core/src/shared/model/base.model.ts diff --git a/src/shared/model/count.model.ts b/apps/core/src/shared/model/count.model.ts similarity index 100% rename from src/shared/model/count.model.ts rename to apps/core/src/shared/model/count.model.ts diff --git a/src/shared/model/image.model.ts b/apps/core/src/shared/model/image.model.ts similarity index 100% rename from src/shared/model/image.model.ts rename to apps/core/src/shared/model/image.model.ts diff --git a/src/shared/model/write-base.model.ts b/apps/core/src/shared/model/write-base.model.ts similarity index 100% rename from src/shared/model/write-base.model.ts rename to apps/core/src/shared/model/write-base.model.ts diff --git a/src/transformers/crud-factor.transformer.ts b/apps/core/src/transformers/crud-factor.transformer.ts similarity index 100% rename from src/transformers/crud-factor.transformer.ts rename to apps/core/src/transformers/crud-factor.transformer.ts diff --git a/src/transformers/db-query.transformer.ts b/apps/core/src/transformers/db-query.transformer.ts similarity index 100% rename from src/transformers/db-query.transformer.ts rename to apps/core/src/transformers/db-query.transformer.ts diff --git a/src/transformers/get-req.transformer.ts b/apps/core/src/transformers/get-req.transformer.ts similarity index 100% rename from src/transformers/get-req.transformer.ts rename to apps/core/src/transformers/get-req.transformer.ts diff --git a/src/transformers/model.transformer.ts b/apps/core/src/transformers/model.transformer.ts similarity index 100% rename from src/transformers/model.transformer.ts rename to apps/core/src/transformers/model.transformer.ts diff --git a/src/transformers/paginate.transformer.ts b/apps/core/src/transformers/paginate.transformer.ts similarity index 100% rename from src/transformers/paginate.transformer.ts rename to apps/core/src/transformers/paginate.transformer.ts diff --git a/src/types/request.ts b/apps/core/src/types/request.ts similarity index 100% rename from src/types/request.ts rename to apps/core/src/types/request.ts diff --git a/src/types/unique.ts b/apps/core/src/types/unique.ts similarity index 100% rename from src/types/unique.ts rename to apps/core/src/types/unique.ts diff --git a/src/utils/biz.util.ts b/apps/core/src/utils/biz.util.ts similarity index 100% rename from src/utils/biz.util.ts rename to apps/core/src/utils/biz.util.ts diff --git a/src/utils/check-init.util.ts b/apps/core/src/utils/check-init.util.ts similarity index 100% rename from src/utils/check-init.util.ts rename to apps/core/src/utils/check-init.util.ts diff --git a/src/utils/cos.util.ts b/apps/core/src/utils/cos.util.ts similarity index 100% rename from src/utils/cos.util.ts rename to apps/core/src/utils/cos.util.ts diff --git a/src/utils/database.util.ts b/apps/core/src/utils/database.util.ts similarity index 100% rename from src/utils/database.util.ts rename to apps/core/src/utils/database.util.ts diff --git a/src/utils/encrypt.util.ts b/apps/core/src/utils/encrypt.util.ts similarity index 100% rename from src/utils/encrypt.util.ts rename to apps/core/src/utils/encrypt.util.ts diff --git a/src/utils/index.ts b/apps/core/src/utils/index.ts similarity index 100% rename from src/utils/index.ts rename to apps/core/src/utils/index.ts diff --git a/src/utils/ip.util.ts b/apps/core/src/utils/ip.util.ts similarity index 100% rename from src/utils/ip.util.ts rename to apps/core/src/utils/ip.util.ts diff --git a/src/utils/jsonschema.util.ts b/apps/core/src/utils/jsonschema.util.ts similarity index 100% rename from src/utils/jsonschema.util.ts rename to apps/core/src/utils/jsonschema.util.ts diff --git a/src/utils/path.util.ts b/apps/core/src/utils/path.util.ts similarity index 100% rename from src/utils/path.util.ts rename to apps/core/src/utils/path.util.ts diff --git a/src/utils/pic.util.ts b/apps/core/src/utils/pic.util.ts similarity index 100% rename from src/utils/pic.util.ts rename to apps/core/src/utils/pic.util.ts diff --git a/src/utils/redis-subpub.util.ts b/apps/core/src/utils/redis-subpub.util.ts similarity index 100% rename from src/utils/redis-subpub.util.ts rename to apps/core/src/utils/redis-subpub.util.ts diff --git a/src/utils/redis.util.ts b/apps/core/src/utils/redis.util.ts similarity index 100% rename from src/utils/redis.util.ts rename to apps/core/src/utils/redis.util.ts diff --git a/src/utils/safe-eval.util.ts b/apps/core/src/utils/safe-eval.util.ts similarity index 100% rename from src/utils/safe-eval.util.ts rename to apps/core/src/utils/safe-eval.util.ts diff --git a/src/utils/schedule.util.ts b/apps/core/src/utils/schedule.util.ts similarity index 100% rename from src/utils/schedule.util.ts rename to apps/core/src/utils/schedule.util.ts diff --git a/src/utils/system.util.ts b/apps/core/src/utils/system.util.ts similarity index 100% rename from src/utils/system.util.ts rename to apps/core/src/utils/system.util.ts diff --git a/src/utils/time.util.ts b/apps/core/src/utils/time.util.ts similarity index 100% rename from src/utils/time.util.ts rename to apps/core/src/utils/time.util.ts diff --git a/src/utils/tool.util.ts b/apps/core/src/utils/tool.util.ts similarity index 100% rename from src/utils/tool.util.ts rename to apps/core/src/utils/tool.util.ts diff --git a/src/utils/validator/isAllowedUrl.ts b/apps/core/src/utils/validator/isAllowedUrl.ts similarity index 100% rename from src/utils/validator/isAllowedUrl.ts rename to apps/core/src/utils/validator/isAllowedUrl.ts diff --git a/src/utils/validator/isBooleanOrString.ts b/apps/core/src/utils/validator/isBooleanOrString.ts similarity index 100% rename from src/utils/validator/isBooleanOrString.ts rename to apps/core/src/utils/validator/isBooleanOrString.ts diff --git a/src/utils/validator/isMongoIdOrInt.ts b/apps/core/src/utils/validator/isMongoIdOrInt.ts similarity index 100% rename from src/utils/validator/isMongoIdOrInt.ts rename to apps/core/src/utils/validator/isMongoIdOrInt.ts diff --git a/src/utils/validator/isNilOrString.ts b/apps/core/src/utils/validator/isNilOrString.ts similarity index 100% rename from src/utils/validator/isNilOrString.ts rename to apps/core/src/utils/validator/isNilOrString.ts diff --git a/src/utils/validator/simpleValidatorFactory.ts b/apps/core/src/utils/validator/simpleValidatorFactory.ts similarity index 100% rename from src/utils/validator/simpleValidatorFactory.ts rename to apps/core/src/utils/validator/simpleValidatorFactory.ts diff --git a/test/global.d.ts b/apps/core/test/global.d.ts similarity index 100% rename from test/global.d.ts rename to apps/core/test/global.d.ts diff --git a/test/helper/create-e2e-app.ts b/apps/core/test/helper/create-e2e-app.ts similarity index 100% rename from test/helper/create-e2e-app.ts rename to apps/core/test/helper/create-e2e-app.ts diff --git a/test/helper/db-mock.helper.ts b/apps/core/test/helper/db-mock.helper.ts similarity index 100% rename from test/helper/db-mock.helper.ts rename to apps/core/test/helper/db-mock.helper.ts diff --git a/test/helper/defineProvider.ts b/apps/core/test/helper/defineProvider.ts similarity index 100% rename from test/helper/defineProvider.ts rename to apps/core/test/helper/defineProvider.ts diff --git a/test/helper/redis-mock.helper.ts b/apps/core/test/helper/redis-mock.helper.ts similarity index 100% rename from test/helper/redis-mock.helper.ts rename to apps/core/test/helper/redis-mock.helper.ts diff --git a/test/helper/setup-e2e.ts b/apps/core/test/helper/setup-e2e.ts similarity index 100% rename from test/helper/setup-e2e.ts rename to apps/core/test/helper/setup-e2e.ts diff --git a/test/helper/utils.helper.ts b/apps/core/test/helper/utils.helper.ts similarity index 100% rename from test/helper/utils.helper.ts rename to apps/core/test/helper/utils.helper.ts diff --git a/test/mock/constants/token.ts b/apps/core/test/mock/constants/token.ts similarity index 100% rename from test/mock/constants/token.ts rename to apps/core/test/mock/constants/token.ts diff --git a/test/mock/decorators/auth.decorator.ts b/apps/core/test/mock/decorators/auth.decorator.ts similarity index 81% rename from test/mock/decorators/auth.decorator.ts rename to apps/core/test/mock/decorators/auth.decorator.ts index 9fd0f20e..44d264bc 100644 --- a/test/mock/decorators/auth.decorator.ts +++ b/apps/core/test/mock/decorators/auth.decorator.ts @@ -1,4 +1,4 @@ -import { UseGuards, applyDecorators } from '@nestjs/common' +import { applyDecorators, UseGuards } from '@nestjs/common' import { AuthTestingGuard } from '../guard/auth.guard' diff --git a/test/mock/guard/auth.guard.ts b/apps/core/test/mock/guard/auth.guard.ts similarity index 100% rename from test/mock/guard/auth.guard.ts rename to apps/core/test/mock/guard/auth.guard.ts diff --git a/test/mock/interceptors/counting.interceptor.ts b/apps/core/test/mock/interceptors/counting.interceptor.ts similarity index 100% rename from test/mock/interceptors/counting.interceptor.ts rename to apps/core/test/mock/interceptors/counting.interceptor.ts diff --git a/test/mock/modules/auth.mock.ts b/apps/core/test/mock/modules/auth.mock.ts similarity index 100% rename from test/mock/modules/auth.mock.ts rename to apps/core/test/mock/modules/auth.mock.ts diff --git a/test/mock/modules/comment.mock.ts b/apps/core/test/mock/modules/comment.mock.ts similarity index 100% rename from test/mock/modules/comment.mock.ts rename to apps/core/test/mock/modules/comment.mock.ts diff --git a/test/mock/modules/config.mock.ts b/apps/core/test/mock/modules/config.mock.ts similarity index 100% rename from test/mock/modules/config.mock.ts rename to apps/core/test/mock/modules/config.mock.ts diff --git a/test/mock/modules/gateway.mock.ts b/apps/core/test/mock/modules/gateway.mock.ts similarity index 100% rename from test/mock/modules/gateway.mock.ts rename to apps/core/test/mock/modules/gateway.mock.ts diff --git a/test/mock/modules/user.mock.ts b/apps/core/test/mock/modules/user.mock.ts similarity index 100% rename from test/mock/modules/user.mock.ts rename to apps/core/test/mock/modules/user.mock.ts diff --git a/test/mock/processors/counting.mock.ts b/apps/core/test/mock/processors/counting.mock.ts similarity index 100% rename from test/mock/processors/counting.mock.ts rename to apps/core/test/mock/processors/counting.mock.ts diff --git a/test/mock/processors/email.mock.ts b/apps/core/test/mock/processors/email.mock.ts similarity index 100% rename from test/mock/processors/email.mock.ts rename to apps/core/test/mock/processors/email.mock.ts diff --git a/test/mock/processors/event.mock.ts b/apps/core/test/mock/processors/event.mock.ts similarity index 100% rename from test/mock/processors/event.mock.ts rename to apps/core/test/mock/processors/event.mock.ts diff --git a/test/mock/processors/text-macro.mock.ts b/apps/core/test/mock/processors/text-macro.mock.ts similarity index 100% rename from test/mock/processors/text-macro.mock.ts rename to apps/core/test/mock/processors/text-macro.mock.ts diff --git a/test/setup-global.ts b/apps/core/test/setup-global.ts similarity index 100% rename from test/setup-global.ts rename to apps/core/test/setup-global.ts diff --git a/test/setup.ts b/apps/core/test/setup.ts similarity index 100% rename from test/setup.ts rename to apps/core/test/setup.ts diff --git a/test/setupFiles/lifecycle.ts b/apps/core/test/setupFiles/lifecycle.ts similarity index 100% rename from test/setupFiles/lifecycle.ts rename to apps/core/test/setupFiles/lifecycle.ts diff --git a/test/src/app.controller.e2e-spec.ts b/apps/core/test/src/app.controller.e2e-spec.ts similarity index 100% rename from test/src/app.controller.e2e-spec.ts rename to apps/core/test/src/app.controller.e2e-spec.ts diff --git a/test/src/modules/auth/auth.service.spec.ts b/apps/core/test/src/modules/auth/auth.service.spec.ts similarity index 100% rename from test/src/modules/auth/auth.service.spec.ts rename to apps/core/test/src/modules/auth/auth.service.spec.ts diff --git a/test/src/modules/configs/configs.service.spec.ts b/apps/core/test/src/modules/configs/configs.service.spec.ts similarity index 100% rename from test/src/modules/configs/configs.service.spec.ts rename to apps/core/test/src/modules/configs/configs.service.spec.ts diff --git a/test/src/modules/configs/configs.util.spec.ts b/apps/core/test/src/modules/configs/configs.util.spec.ts similarity index 100% rename from test/src/modules/configs/configs.util.spec.ts rename to apps/core/test/src/modules/configs/configs.util.spec.ts index c221c4b4..cac98a75 100644 --- a/test/src/modules/configs/configs.util.spec.ts +++ b/apps/core/test/src/modules/configs/configs.util.spec.ts @@ -1,8 +1,8 @@ import 'reflect-metadata' import { - Encrypt, decryptObject, + Encrypt, encryptObject, encryptProperty, isEncryptProperty, diff --git a/test/src/modules/link/link.controller.e2e-spec.ts b/apps/core/test/src/modules/link/link.controller.e2e-spec.ts similarity index 100% rename from test/src/modules/link/link.controller.e2e-spec.ts rename to apps/core/test/src/modules/link/link.controller.e2e-spec.ts diff --git a/test/src/modules/markdown/markdown.service.spec.ts b/apps/core/test/src/modules/markdown/markdown.service.spec.ts similarity index 100% rename from test/src/modules/markdown/markdown.service.spec.ts rename to apps/core/test/src/modules/markdown/markdown.service.spec.ts diff --git a/test/src/modules/note/__snapshots__/note.controller.e2e-spec.ts.snap b/apps/core/test/src/modules/note/__snapshots__/note.controller.e2e-spec.ts.snap similarity index 100% rename from test/src/modules/note/__snapshots__/note.controller.e2e-spec.ts.snap rename to apps/core/test/src/modules/note/__snapshots__/note.controller.e2e-spec.ts.snap diff --git a/test/src/modules/note/note.controller.e2e-spec.ts b/apps/core/test/src/modules/note/note.controller.e2e-spec.ts similarity index 100% rename from test/src/modules/note/note.controller.e2e-spec.ts rename to apps/core/test/src/modules/note/note.controller.e2e-spec.ts diff --git a/test/src/modules/note/note.e2e-mock.db.ts b/apps/core/test/src/modules/note/note.e2e-mock.db.ts similarity index 86% rename from test/src/modules/note/note.e2e-mock.db.ts rename to apps/core/test/src/modules/note/note.e2e-mock.db.ts index a1cf3665..2222e972 100644 --- a/test/src/modules/note/note.e2e-mock.db.ts +++ b/apps/core/test/src/modules/note/note.e2e-mock.db.ts @@ -3,8 +3,8 @@ import { NoteModel } from '~/modules/note/note.model' export default Array.from({ length: 20 }).map((_, _i) => { const i = _i + 1 return { - title: 'Note ' + i, - text: 'Content ' + i, + title: `Note ${i}`, + text: `Content ${i}`, created: new Date(`2021-03-${i.toFixed().padStart(2, '0')}T00:00:00.000Z`), modified: null, allowComment: true, diff --git a/test/src/modules/options/options.controller.e2e-spec.ts b/apps/core/test/src/modules/options/options.controller.e2e-spec.ts similarity index 100% rename from test/src/modules/options/options.controller.e2e-spec.ts rename to apps/core/test/src/modules/options/options.controller.e2e-spec.ts diff --git a/test/src/modules/serverless/serverless.service.spec.ts b/apps/core/test/src/modules/serverless/serverless.service.spec.ts similarity index 100% rename from test/src/modules/serverless/serverless.service.spec.ts rename to apps/core/test/src/modules/serverless/serverless.service.spec.ts diff --git a/test/src/modules/snippet/snippet.controller.e2e-spec.ts b/apps/core/test/src/modules/snippet/snippet.controller.e2e-spec.ts similarity index 100% rename from test/src/modules/snippet/snippet.controller.e2e-spec.ts rename to apps/core/test/src/modules/snippet/snippet.controller.e2e-spec.ts diff --git a/test/src/modules/snippet/snippet.service.spec.ts b/apps/core/test/src/modules/snippet/snippet.service.spec.ts similarity index 100% rename from test/src/modules/snippet/snippet.service.spec.ts rename to apps/core/test/src/modules/snippet/snippet.service.spec.ts diff --git a/test/src/modules/user/user.controller.e2e-spec.ts b/apps/core/test/src/modules/user/user.controller.e2e-spec.ts similarity index 100% rename from test/src/modules/user/user.controller.e2e-spec.ts rename to apps/core/test/src/modules/user/user.controller.e2e-spec.ts diff --git a/test/src/modules/user/user.controller.spec.ts b/apps/core/test/src/modules/user/user.controller.spec.ts similarity index 100% rename from test/src/modules/user/user.controller.spec.ts rename to apps/core/test/src/modules/user/user.controller.spec.ts diff --git a/test/src/modules/user/user.service.spec.ts b/apps/core/test/src/modules/user/user.service.spec.ts similarity index 100% rename from test/src/modules/user/user.service.spec.ts rename to apps/core/test/src/modules/user/user.service.spec.ts diff --git a/test/src/processors/helper/helper.jwt.service.spec.ts b/apps/core/test/src/processors/helper/helper.jwt.service.spec.ts similarity index 100% rename from test/src/processors/helper/helper.jwt.service.spec.ts rename to apps/core/test/src/processors/helper/helper.jwt.service.spec.ts diff --git a/test/src/processors/helper/helper.macro.service.spec.ts b/apps/core/test/src/processors/helper/helper.macro.service.spec.ts similarity index 100% rename from test/src/processors/helper/helper.macro.service.spec.ts rename to apps/core/test/src/processors/helper/helper.macro.service.spec.ts diff --git a/test/src/transformers/__snapshots__/curd-factor.e2e-spec.ts.snap b/apps/core/test/src/transformers/__snapshots__/curd-factor.e2e-spec.ts.snap similarity index 100% rename from test/src/transformers/__snapshots__/curd-factor.e2e-spec.ts.snap rename to apps/core/test/src/transformers/__snapshots__/curd-factor.e2e-spec.ts.snap diff --git a/test/src/transformers/curd-factor.e2e-spec.ts b/apps/core/test/src/transformers/curd-factor.e2e-spec.ts similarity index 100% rename from test/src/transformers/curd-factor.e2e-spec.ts rename to apps/core/test/src/transformers/curd-factor.e2e-spec.ts diff --git a/test/src/utils/encrypt.util.spec.ts b/apps/core/test/src/utils/encrypt.util.spec.ts similarity index 100% rename from test/src/utils/encrypt.util.spec.ts rename to apps/core/test/src/utils/encrypt.util.spec.ts diff --git a/test/src/utils/pic.util.spec.ts b/apps/core/test/src/utils/pic.util.spec.ts similarity index 100% rename from test/src/utils/pic.util.spec.ts rename to apps/core/test/src/utils/pic.util.spec.ts diff --git a/test/src/utils/safe-eval.spec.ts b/apps/core/test/src/utils/safe-eval.spec.ts similarity index 100% rename from test/src/utils/safe-eval.spec.ts rename to apps/core/test/src/utils/safe-eval.spec.ts diff --git a/test/src/utils/tool.util.spec.ts b/apps/core/test/src/utils/tool.util.spec.ts similarity index 100% rename from test/src/utils/tool.util.spec.ts rename to apps/core/test/src/utils/tool.util.spec.ts diff --git a/test/tsconfig.json b/apps/core/test/tsconfig.json similarity index 100% rename from test/tsconfig.json rename to apps/core/test/tsconfig.json diff --git a/tsconfig.build.json b/apps/core/tsconfig.build.json similarity index 100% rename from tsconfig.build.json rename to apps/core/tsconfig.build.json diff --git a/tsconfig.json b/apps/core/tsconfig.json similarity index 100% rename from tsconfig.json rename to apps/core/tsconfig.json diff --git a/vitest.config.ts b/apps/core/vitest.config.ts similarity index 82% rename from vitest.config.ts rename to apps/core/vitest.config.ts index a8e9b37d..50436a03 100644 --- a/vitest.config.ts +++ b/apps/core/vitest.config.ts @@ -1,8 +1,21 @@ -import { resolve } from 'path' +import { cpSync, existsSync } from 'fs' +import path, { resolve } from 'path' import swc from 'rollup-plugin-swc' import tsconfigPath from 'vite-tsconfig-paths' import { defineConfig } from 'vitest/config' +if ( + existsSync( + path.resolve(__dirname, '../../node_modules/.cache/redis-memory-server'), + ) +) { + cpSync( + path.resolve(__dirname, '../../node_modules/.cache/redis-memory-server'), + path.resolve(__dirname, './node_modules/.cache/redis-memory-server'), + { recursive: true }, + ) +} + const swcPlugin = (() => { const plugin = swc({ test: 'ts', diff --git a/apps/core/zip-asset.sh b/apps/core/zip-asset.sh new file mode 100644 index 00000000..51840e5e --- /dev/null +++ b/apps/core/zip-asset.sh @@ -0,0 +1,14 @@ +#!/bin/sh +set -e +rm -rf assets/.git +# Copy core/out to $root/out +cp -r ./apps/core/out ./out + +cp -R assets out +# Copy core ecosystem.config.js to $root/out +cp ./apps/core/ecosystem.config.js out +node ./apps/core/download-latest-admin-assets.js +cd out +zip -r ../release.zip ./* + +rm -rf out diff --git a/dockerfile b/dockerfile index d66975ea..bafc54ee 100644 --- a/dockerfile +++ b/dockerfile @@ -5,7 +5,8 @@ RUN apk add git make g++ alpine-sdk python3 py3-pip unzip RUN npm i -g pnpm RUN pnpm install RUN pnpm bundle -RUN node scripts/download-latest-admin-assets.js +RUN mv apps/core/out ./out +RUN node apps/core/download-latest-admin-assets.js FROM node:16-alpine diff --git a/package.json b/package.json index 136ba147..9466149c 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,7 @@ { - "name": "@mx-space/core", - "version": "4.0.2", "author": "Innei ", "private": true, "license": "AGPLv3", - "dashboard": { - "repo": "mx-space/mx-admin", - "version": "3.30.3" - }, "husky": { "hooks": { "pre-commit": "lint-staged" @@ -27,31 +21,17 @@ "issues": "https://github.com/mx-space/core/issues", "scripts": { "prepare": "husky install && node scripts/init-project.mjs", - "prebuild": "rimraf dist", - "build": "nest build", - "build:webpack": "nest build --webpack --webpackPath ./configs/webpack.config.js -c ./configs/nest-cli.webpack.json", - "dev": "npm run start", - "repl": "npm run start -- --entryFile repl", - "bundle": "rimraf out && npm run build && cd dist/src && npx ncc build main.js -o ../../out -m -t && cd ../.. && chmod +x out/index.js", - "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\" \"packages/**/*.ts\"", - "start": "cross-env NODE_ENV=development nest start -w --path tsconfig.json -- ", - "start:debug": "cross-env NODE_ENV=development nest start --debug --watch", - "start:cluster": "cross-env NODE_ENV=development nest start --watch -- --cluster --workers 2", - "start:prod": "cross-env NODE_ENV=production node dist/src/main", - "lint": "eslint \"{src,apps,libs,test,packages}/**/*.ts\" --fix", - "prod": "cross-env NODE_ENV=production pm2-runtime start ecosystem.config.js", - "prod:pm2": "cross-env NODE_ENV=production pm2 restart ecosystem.config.js", - "prod:stop": "pm2 stop ecosystem.config.js", - "prod:debug": "cross-env NODE_ENV=production nest start --debug --watch", - "test": "NODE_ENV=development vitest", - "test:watch": "NODE_ENV=development vitest -w", - "docs": "npx @compodoc/compodoc -p tsconfig.json -s -d docs" + "build": "pnpm -C \"apps/core\" run build", + "dev": "pnpm -C \"apps/core\" run start", + "bundle": "pnpm -C \"apps/core\" run bundle", + "test": "pnpm -C \"apps/core\" run test", + "lint": "eslint --cache --ext .ts,.tsx --ignore-path .gitignore . --fix" }, "bump": { "before": [ "git pull --rebase", "pnpm i", - "node scripts/get-latest-admin-version.js" + "node ./apps/core/scripts/get-latest-admin-version.js" ], "after": [ "sh ./scripts/assets-push.sh" @@ -59,126 +39,23 @@ "changelog": true }, "dependencies": { - "@algolia/client-search": "^4.17.1", - "@babel/core": "7.22.1", - "@babel/plugin-transform-modules-commonjs": "7.21.5", - "@babel/plugin-transform-typescript": "7.22.3", - "@babel/types": "^7.22.4", - "@fastify/cookie": "8.3.0", - "@fastify/multipart": "7.6.0", - "@fastify/static": "6.10.2", - "@innei/next-async": "0.3.0", - "@nestjs/common": "9.4.2", - "@nestjs/core": "9.4.2", - "@nestjs/event-emitter": "1.4.1", - "@nestjs/mapped-types": "^1.2.2", - "@nestjs/platform-fastify": "9.4.2", - "@nestjs/platform-socket.io": "9.4.2", - "@nestjs/schedule": "2.2.2", - "@nestjs/throttler": "4.0.0", - "@nestjs/websockets": "9.4.2", - "@socket.io/redis-adapter": "7.2.0", - "@socket.io/redis-emitter": "4.1.1", - "@typegoose/auto-increment": "3.2.0", - "@typegoose/typegoose": "11.2.0", - "@types/jsonwebtoken": "9.0.2", - "algoliasearch": "4.17.1", - "axios": "^1.4.0", - "axios-retry": "3.5.0", - "bcrypt": "5.1.0", - "cache-manager": "4.1.0", - "cache-manager-ioredis": "2.1.0", - "class-transformer": "0.5.1", - "class-validator": "0.13.2", - "class-validator-jsonschema": "npm:@innei/class-validator-jsonschema@3.1.2", - "commander": "10.0.1", - "consola": "*", - "dayjs": "1.11.8", - "ejs": "3.1.9", - "form-data": "4.0.0", - "get-image-colors": "4.0.1", - "image-size": "1.0.2", - "inquirer": "*", - "isbot": "3.6.10", - "js-yaml": "*", - "json5": "2.2.3", - "jsonwebtoken": "9.0.0", - "jszip": "3.10.1", - "linkedom": "0.14.26", - "lodash": "*", - "lru-cache": "9.1.1", - "marked": "5.0.4", - "mime-types": "*", - "mkdirp": "*", - "mongoose": "7.2.2", - "mongoose-aggregate-paginate-v2": "1.0.6", - "mongoose-autopopulate": "1.0.1", - "mongoose-lean-getters": "1.1.0", - "mongoose-lean-id": "0.5.0", - "mongoose-lean-virtuals": "0.9.1", - "mongoose-paginate-v2": "1.7.1", - "nanoid": "3.3.4", - "node-machine-id": "1.1.12", - "node-pty": "0.10.1", - "nodemailer": "6.9.3", - "pluralize": "*", - "qs": "6.11.2", - "reflect-metadata": "0.1.13", - "rxjs": "7.8.1", - "semver": "7.5.1", - "slugify": "1.6.6", - "snakecase-keys": "5.4.5", - "ua-parser-js": "1.0.35", - "vm2": "3.9.19", - "wildcard-match": "5.1.2", - "xss": "1.0.14", "zx-cjs": "7.0.7-0" }, "devDependencies": { "@innei/eslint-config-ts": "0.10.1", "@innei/prettier": "0.10.1", - "@nestjs/cli": "9.5.0", - "@nestjs/schematics": "9.2.0", - "@nestjs/testing": "9.4.2", - "@swc/core": "1.3.4", - "@types/babel__core": "7.20.1", - "@types/bcrypt": "5.0.0", - "@types/cache-manager": "4.0.2", - "@types/cron": "2.0.1", - "@types/ejs": "3.1.2", - "@types/get-image-colors": "4.0.2", - "@types/js-yaml": "4.0.5", - "@types/lodash": "4.14.195", - "@types/marked": "4.3.1", - "@types/mime-types": "2.1.1", - "@types/mongoose-aggregate-paginate-v2": "1.0.9", "@types/node": "18.16.16", - "@types/nodemailer": "6.4.8", - "@types/qs": "6.9.7", - "@types/semver": "7.5.0", - "@types/ua-parser-js": "0.7.36", - "@types/validator": "13.7.17", - "@vercel/ncc": "0.36.1", - "cron": "*", "cross-env": "7.0.3", "eslint": "^8.42.0", "eslint-plugin-unused-imports": "2.0.0", "husky": "8.0.3", - "ioredis": "5.3.2", "lint-staged": "13.2.2", "prettier": "2.8.8", "rimraf": "5.0.1", - "rollup": "^3.23.0", - "rollup-plugin-swc": "0.2.1", - "socket.io": "4.6.2", - "source-map-support": "*", "ts-node": "10.9.1", "tsconfig-paths": "4.2.0", "typescript": "5.0.4", - "vite": "3.2.5", - "vite-tsconfig-paths": "4.2.0", - "vitest": "0.25.3", - "zx": "7.2.2" + "vite-tsconfig-paths": "4.2.0" }, "optionalDependencies": { "mongodb-memory-server": "8.12.2", diff --git a/packages/api-client/package.json b/packages/api-client/package.json index f5609e23..88065e8a 100644 --- a/packages/api-client/package.json +++ b/packages/api-client/package.json @@ -24,11 +24,6 @@ }, "./package.json": "./package.json" }, - "husky": { - "hooks": { - "pre-commit": "lint-staged" - } - }, "bump": { "before": [ "git pull --rebase", @@ -41,15 +36,6 @@ "tag": false, "commit_message": "chore(release): bump @mx-space/api-client to v${NEW_VERSION}" }, - "lint-staged": { - "*.{js,jsx,ts,tsx}": [ - "prettier --ignore-path ./.prettierignore --write ", - "eslint --cache" - ] - }, - "engines": { - "pnpm": ">=6" - }, "scripts": { "package": "rm -rf dist && tsup && node mod-dts.mjs", "build": "npm run package", @@ -69,6 +55,8 @@ "ky": "0.33.3", "lodash": "4.17.21", "tsup": "6.7.0", - "umi-request": "1.4.0" + "umi-request": "1.4.0", + "vitest": "^0.31.4", + "vite": "^4.3.9" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8047f8c3..985ce0f7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,6 +14,62 @@ overrides: importers: .: + dependencies: + zx-cjs: + specifier: 7.0.7-0 + version: 7.0.7-0 + optionalDependencies: + mongodb-memory-server: + specifier: 8.12.2 + version: 8.12.2 + redis-memory-server: + specifier: 0.6.0 + version: 0.6.0 + devDependencies: + '@innei/eslint-config-ts': + specifier: 0.10.1 + version: 0.10.1(typescript@5.0.4) + '@innei/prettier': + specifier: 0.10.1 + version: 0.10.1 + '@types/node': + specifier: 18.16.16 + version: 18.16.16 + cross-env: + specifier: 7.0.3 + version: 7.0.3 + eslint: + specifier: ^8.42.0 + version: 8.42.0 + eslint-plugin-unused-imports: + specifier: 2.0.0 + version: 2.0.0(@typescript-eslint/eslint-plugin@5.59.7)(eslint@8.42.0) + husky: + specifier: 8.0.3 + version: 8.0.3 + lint-staged: + specifier: 13.2.2 + version: 13.2.2 + prettier: + specifier: 2.8.8 + version: 2.8.8 + rimraf: + specifier: 5.0.1 + version: 5.0.1 + ts-node: + specifier: 10.9.1 + version: 10.9.1(@types/node@18.16.16)(typescript@5.0.4) + tsconfig-paths: + specifier: 4.2.0 + version: 4.2.0 + typescript: + specifier: 5.0.4 + version: 5.0.4 + vite-tsconfig-paths: + specifier: 4.2.0 + version: 4.2.0(typescript@5.0.4)(vite@3.2.5) + + apps/core: dependencies: '@algolia/client-search': specifier: ^4.17.1 @@ -42,6 +98,9 @@ importers: '@innei/next-async': specifier: 0.3.0 version: 0.3.0 + '@nestjs/cache-manager': + specifier: 1.0.0 + version: 1.0.0(@nestjs/common@9.4.2)(cache-manager@4.1.0)(reflect-metadata@0.1.13)(rxjs@7.8.1) '@nestjs/common': specifier: 9.4.2 version: 9.4.2(cache-manager@4.1.0)(class-transformer@0.5.1)(class-validator@0.13.2)(reflect-metadata@0.1.13)(rxjs@7.8.1) @@ -239,18 +298,12 @@ importers: version: 7.0.7-0 optionalDependencies: mongodb-memory-server: - specifier: 8.12.2 + specifier: '*' version: 8.12.2 redis-memory-server: - specifier: 0.6.0 + specifier: '*' version: 0.6.0 devDependencies: - '@innei/eslint-config-ts': - specifier: 0.10.1 - version: 0.10.1(typescript@5.0.4) - '@innei/prettier': - specifier: 0.10.1 - version: 0.10.1 '@nestjs/cli': specifier: 9.5.0 version: 9.5.0(@swc/core@1.3.4) @@ -320,51 +373,18 @@ importers: cron: specifier: '*' version: 2.1.0 - cross-env: - specifier: 7.0.3 - version: 7.0.3 - eslint: - specifier: ^8.42.0 - version: 8.42.0 - eslint-plugin-unused-imports: - specifier: 2.0.0 - version: 2.0.0(@typescript-eslint/eslint-plugin@5.59.7)(eslint@8.42.0) husky: specifier: 8.0.3 version: 8.0.3 ioredis: specifier: 5.3.2 version: 5.3.2 - lint-staged: - specifier: 13.2.2 - version: 13.2.2 - prettier: - specifier: 2.8.8 - version: 2.8.8 - rimraf: - specifier: 5.0.1 - version: 5.0.1 - rollup: - specifier: ^3.23.0 - version: 3.23.0 rollup-plugin-swc: specifier: 0.2.1 version: 0.2.1(@swc/core@1.3.4)(rollup@3.23.0) socket.io: specifier: 4.6.2 version: 4.6.2 - source-map-support: - specifier: '*' - version: 0.5.21 - ts-node: - specifier: 10.9.1 - version: 10.9.1(@swc/core@1.3.4)(@types/node@18.16.16)(typescript@5.0.4) - tsconfig-paths: - specifier: 4.2.0 - version: 4.2.0 - typescript: - specifier: 5.0.4 - version: 5.0.4 vite: specifier: 3.2.5 version: 3.2.5(@types/node@18.16.16) @@ -412,10 +432,16 @@ importers: version: 4.17.21 tsup: specifier: 6.7.0 - version: 6.7.0(@swc/core@1.3.4)(ts-node@10.9.1)(typescript@5.0.4) + version: 6.7.0(ts-node@10.9.1)(typescript@5.0.4) umi-request: specifier: 1.4.0 version: 1.4.0 + vite: + specifier: ^4.3.9 + version: 4.3.9(@types/node@18.16.16) + vitest: + specifier: ^0.31.4 + version: 0.31.4 packages: @@ -1425,15 +1451,6 @@ packages: transitivePeerDependencies: - supports-color - /@babel/generator@7.21.5: - resolution: {integrity: sha512-SrKK/sRv8GesIW1bDagf9cCG38IOMYZusoe1dfg0D8aiUe3Amvoj1QtjTPAWcfrZFvIwlleLb0gxzQidL9w14w==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.22.4 - '@jridgewell/gen-mapping': 0.3.3 - '@jridgewell/trace-mapping': 0.3.18 - jsesc: 2.5.2 - /@babel/generator@7.22.3: resolution: {integrity: sha512-C17MW4wlk//ES/CJDL51kPNwl+qiBQyN7b9SKyVp11BLGFeSPoVaHrv+MNt8jwQFhQWowW88z1eeBx3pFz9v8A==} engines: {node: '>=6.9.0'} @@ -1483,10 +1500,6 @@ packages: - supports-color dev: false - /@babel/helper-environment-visitor@7.21.5: - resolution: {integrity: sha512-IYl4gZ3ETsWocUWgsFZLM5i1BYx9SoemminVEXadgLBa9TdeorzgLKm8wWLA6J1N/kT3Kch8XIk1laNzYoHKvQ==} - engines: {node: '>=6.9.0'} - /@babel/helper-environment-visitor@7.22.1: resolution: {integrity: sha512-Z2tgopurB/kTbidvzeBrc2To3PUP/9i5MUe+fU6QJCQDyPwSH2oRapkLw3KGECDYSjhQZCNxEvNvZlLw8JjGwA==} engines: {node: '>=6.9.0'} @@ -1495,7 +1508,7 @@ packages: resolution: {integrity: sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/template': 7.20.7 + '@babel/template': 7.21.9 '@babel/types': 7.22.4 /@babel/helper-hoist-variables@7.18.6: @@ -1517,22 +1530,6 @@ packages: dependencies: '@babel/types': 7.22.4 - /@babel/helper-module-transforms@7.21.5: - resolution: {integrity: sha512-bI2Z9zBGY2q5yMHoBvJ2a9iX3ZOAzJPm7Q8Yz6YeoUjU/Cvhmi2G4QyTNyPBqqXSgTjUxRg3L0xV45HvkNWWBw==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/helper-environment-visitor': 7.21.5 - '@babel/helper-module-imports': 7.21.4 - '@babel/helper-simple-access': 7.21.5 - '@babel/helper-split-export-declaration': 7.18.6 - '@babel/helper-validator-identifier': 7.19.1 - '@babel/template': 7.20.7 - '@babel/traverse': 7.21.5 - '@babel/types': 7.22.4 - transitivePeerDependencies: - - supports-color - dev: false - /@babel/helper-module-transforms@7.22.1: resolution: {integrity: sha512-dxAe9E7ySDGbQdCVOY/4+UcD8M9ZFqZcZhSPsPacvCG4M+9lwtDDQfI2EoaSvmf7W/8yCBkGU0m7Pvt1ru3UZw==} engines: {node: '>=6.9.0'} @@ -1623,13 +1620,6 @@ packages: chalk: 2.4.2 js-tokens: 4.0.0 - /@babel/parser@7.21.8: - resolution: {integrity: sha512-6zavDGdzG3gUqAdWvlLFfk+36RilI+Pwyuuh7HItyeScCWP3k6i8vKclAQ0bM/0y/Kz/xiwvxhMv9MgTJP5gmA==} - engines: {node: '>=6.0.0'} - hasBin: true - dependencies: - '@babel/types': 7.22.4 - /@babel/parser@7.22.4: resolution: {integrity: sha512-VLLsx06XkEYqBtE5YGPwfSGwfrjnyPP5oiGty3S8pQLFDFLaS8VwWSIxkTXpcvr5zeYLE6+MBNl2npl/YnfofA==} engines: {node: '>=6.0.0'} @@ -1654,7 +1644,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.1 - '@babel/helper-module-transforms': 7.21.5 + '@babel/helper-module-transforms': 7.22.1 '@babel/helper-plugin-utils': 7.21.5 '@babel/helper-simple-access': 7.21.5 transitivePeerDependencies: @@ -1683,14 +1673,6 @@ packages: regenerator-runtime: 0.13.11 dev: false - /@babel/template@7.20.7: - resolution: {integrity: sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/code-frame': 7.21.4 - '@babel/parser': 7.21.8 - '@babel/types': 7.22.4 - /@babel/template@7.21.9: resolution: {integrity: sha512-MK0X5k8NKOuWRamiEfc3KEJiHMTkGZNUjzMipqCGDDc6ijRl/B7RGSKVGncu4Ro/HdyzzY6cmoXuKI2Gffk7vQ==} engines: {node: '>=6.9.0'} @@ -1699,23 +1681,6 @@ packages: '@babel/parser': 7.22.4 '@babel/types': 7.22.4 - /@babel/traverse@7.21.5: - resolution: {integrity: sha512-AhQoI3YjWi6u/y/ntv7k48mcrCXmus0t79J9qPNlk/lAsFlCiJ047RmbfMOawySTHtywXhbXgpx/8nXMYd+oFw==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/code-frame': 7.21.4 - '@babel/generator': 7.21.5 - '@babel/helper-environment-visitor': 7.21.5 - '@babel/helper-function-name': 7.21.0 - '@babel/helper-hoist-variables': 7.18.6 - '@babel/helper-split-export-declaration': 7.18.6 - '@babel/parser': 7.21.8 - '@babel/types': 7.22.4 - debug: 4.3.4 - globals: 11.12.0 - transitivePeerDependencies: - - supports-color - /@babel/traverse@7.22.4: resolution: {integrity: sha512-Tn1pDsjIcI+JcLKq1AVlZEr4226gpuAQTsLMorsYg9tuS/kG7nuwwJ4AB8jfQuEgb/COBwR/DqJxmoiYFu5/rQ==} engines: {node: '>=6.9.0'} @@ -2032,7 +1997,7 @@ packages: resolution: {integrity: sha512-P9hY9GO11L20TnZ33XN3i0bt+3x0zaT7S0ohAzWO950E9PB2xnNhLYzPFJIGFi5AVN0yr5+/iZhWxeYvR6KCzg==} dependencies: cookie: 0.5.0 - fastify-plugin: 4.2.1 + fastify-plugin: 4.5.0 dev: false /@fastify/cors@8.2.1: @@ -2137,9 +2102,9 @@ packages: optional: true dependencies: '@babel/core': 7.22.1 - '@babel/generator': 7.21.5 - '@babel/parser': 7.21.8 - '@babel/traverse': 7.21.5 + '@babel/generator': 7.22.3 + '@babel/parser': 7.22.4 + '@babel/traverse': 7.22.4 '@babel/types': 7.22.4 prettier: 2.8.8 semver: 7.5.1 @@ -2283,6 +2248,20 @@ packages: - supports-color dev: false + /@nestjs/cache-manager@1.0.0(@nestjs/common@9.4.2)(cache-manager@4.1.0)(reflect-metadata@0.1.13)(rxjs@7.8.1): + resolution: {integrity: sha512-XMNdgsj3H+Ng/SYwFl13vRGNFA3e5Obk8LNwIuHLVSocnK2exReAWtscxEjQhoBc4FW4jAYOgU/U+mt18Q9T0g==} + peerDependencies: + '@nestjs/common': ^9.0.0 + cache-manager: <=5 + reflect-metadata: ^0.1.12 + rxjs: ^7.0.0 + dependencies: + '@nestjs/common': 9.4.2(cache-manager@4.1.0)(class-transformer@0.5.1)(class-validator@0.13.2)(reflect-metadata@0.1.13)(rxjs@7.8.1) + cache-manager: 4.1.0 + reflect-metadata: 0.1.13 + rxjs: 7.8.1 + dev: false + /@nestjs/cli@9.5.0(@swc/core@1.3.4): resolution: {integrity: sha512-Z7q+3vNsQSG2d2r2Hl/OOj5EpfjVx3OfnJ9+KuAsOdw1sKLm7+Zc6KbhMFTd/eIvfx82ww3Nk72xdmfPYCulWA==} engines: {node: '>= 12.9.0'} @@ -2602,10 +2581,12 @@ packages: dependencies: debug: 4.3.4 notepack.io: 2.2.0 - socket.io-adapter: 2.4.0 + socket.io-adapter: 2.5.2 uid2: 0.0.3 transitivePeerDependencies: + - bufferutil - supports-color + - utf-8-validate dev: false /@socket.io/redis-emitter@4.1.1: @@ -2804,7 +2785,7 @@ packages: dependencies: loglevel: 1.8.1 mongoose: 7.2.2 - tslib: 2.5.2 + tslib: 2.5.3 dev: false /@typegoose/typegoose@11.2.0(mongoose@7.2.2): @@ -2818,13 +2799,13 @@ packages: mongoose: 7.2.2 reflect-metadata: 0.1.13 semver: 7.5.1 - tslib: 2.5.2 + tslib: 2.5.3 dev: false /@types/babel__core@7.20.1: resolution: {integrity: sha512-aACu/U/omhdk15O4Nfb+fHgH/z3QsfQzpnvRZhYhThms83ZnAOZz7zZAWO7mn2yyNQaA4xTO8GLK3uqFU4bYYw==} dependencies: - '@babel/parser': 7.21.8 + '@babel/parser': 7.22.4 '@babel/types': 7.22.4 '@types/babel__generator': 7.6.4 '@types/babel__template': 7.4.1 @@ -2840,7 +2821,7 @@ packages: /@types/babel__template@7.4.1: resolution: {integrity: sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==} dependencies: - '@babel/parser': 7.21.8 + '@babel/parser': 7.22.4 '@babel/types': 7.22.4 dev: true @@ -2877,6 +2858,10 @@ packages: resolution: {integrity: sha512-KnRanxnpfpjUTqTCXslZSEdLfXExwgNxYPdiO2WGUj8+HDjFi8R3k5RVKPeSCzLjCcshCAtVO2QBbVuAV4kTnw==} dev: true + /@types/chai@4.3.5: + resolution: {integrity: sha512-mEo1sAde+UCE6b2hxn332f1g1E8WfYRu6p5SvTKr2ZKC1f7gFJXk4h5PyGP9Dt6gCaG8y8XhwnXWC6Iy2cmBng==} + dev: true + /@types/chroma-js@2.1.3: resolution: {integrity: sha512-1xGPhoSGY1CPmXLCBcjVZSQinFjL26vlR8ZqprsBWiFyED4JacJJ9zHhh5aaUXqbY9B37mKQ73nlydVAXmr1+g==} dev: true @@ -3264,6 +3249,45 @@ packages: hasBin: true dev: true + /@vitest/expect@0.31.4: + resolution: {integrity: sha512-tibyx8o7GUyGHZGyPgzwiaPaLDQ9MMuCOrc03BYT0nryUuhLbL7NV2r/q98iv5STlwMgaKuFJkgBW/8iPKwlSg==} + dependencies: + '@vitest/spy': 0.31.4 + '@vitest/utils': 0.31.4 + chai: 4.3.7 + dev: true + + /@vitest/runner@0.31.4: + resolution: {integrity: sha512-Wgm6UER+gwq6zkyrm5/wbpXGF+g+UBB78asJlFkIOwyse0pz8lZoiC6SW5i4gPnls/zUcPLWS7Zog0LVepXnpg==} + dependencies: + '@vitest/utils': 0.31.4 + concordance: 5.0.4 + p-limit: 4.0.0 + pathe: 1.1.1 + dev: true + + /@vitest/snapshot@0.31.4: + resolution: {integrity: sha512-LemvNumL3NdWSmfVAMpXILGyaXPkZbG5tyl6+RQSdcHnTj6hvA49UAI8jzez9oQyE/FWLKRSNqTGzsHuk89LRA==} + dependencies: + magic-string: 0.30.0 + pathe: 1.1.1 + pretty-format: 27.5.1 + dev: true + + /@vitest/spy@0.31.4: + resolution: {integrity: sha512-3ei5ZH1s3aqbEyftPAzSuunGICRuhE+IXOmpURFdkm5ybUADk+viyQfejNk6q8M5QGX8/EVKw+QWMEP3DTJDag==} + dependencies: + tinyspy: 2.1.1 + dev: true + + /@vitest/utils@0.31.4: + resolution: {integrity: sha512-DobZbHacWznoGUfYU8XDPY78UubJxXfMNY1+SUdOp1NsI34eopSA6aZMeaGu10waSOeYwE8lxrd/pLfT0RMxjQ==} + dependencies: + concordance: 5.0.4 + loupe: 2.3.6 + pretty-format: 27.5.1 + dev: true + /@webassemblyjs/ast@1.11.5: resolution: {integrity: sha512-LHY/GSAZZRpsNQH+/oHqhRQ5FT7eoULcBqgfyTB5nQHogFnK3/7QoN7dLnwSE/JkUAF0SrRuclT7ODqMFtWxxQ==} dependencies: @@ -3419,18 +3443,6 @@ packages: resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==} engines: {node: '>=0.4.0'} - /acorn@8.7.1: - resolution: {integrity: sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==} - engines: {node: '>=0.4.0'} - hasBin: true - dev: true - - /acorn@8.8.1: - resolution: {integrity: sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==} - engines: {node: '>=0.4.0'} - hasBin: true - dev: true - /acorn@8.8.2: resolution: {integrity: sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==} engines: {node: '>=0.4.0'} @@ -3544,6 +3556,11 @@ packages: dependencies: color-convert: 2.0.1 + /ansi-styles@5.2.0: + resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} + engines: {node: '>=10'} + dev: true + /ansi-styles@6.2.1: resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} engines: {node: '>=12'} @@ -3650,7 +3667,7 @@ packages: /async-mutex@0.3.2: resolution: {integrity: sha512-HuTK7E7MT7jZEh1P9GtRW9+aTWiDWWi9InbZ5hjxrnRa39KS4BW04+xLBhYNS2aXhHUIKZSw3gj4Pn1pj+qGAA==} dependencies: - tslib: 2.5.2 + tslib: 2.5.3 dev: false optional: true @@ -3729,6 +3746,10 @@ packages: inherits: 2.0.4 readable-stream: 3.6.2 + /blueimp-md5@2.19.0: + resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} + dev: true + /body-parser@1.20.1: resolution: {integrity: sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==} engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} @@ -3776,17 +3797,6 @@ packages: fill-range: 7.0.1 dev: true - /browserslist@4.21.5: - resolution: {integrity: sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==} - engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} - hasBin: true - dependencies: - caniuse-lite: 1.0.30001450 - electron-to-chromium: 1.4.285 - node-releases: 2.0.9 - update-browserslist-db: 1.0.10(browserslist@4.21.5) - dev: true - /browserslist@4.21.7: resolution: {integrity: sha512-BauCXrQ7I2ftSqd2mvKHGo85XR0u7Ru3C/Hxsy/0TkfCtjrmAbPdzLGasmoiBxplpDXlPvdjX9u7srIMfgasNA==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} @@ -3896,10 +3906,6 @@ packages: resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} engines: {node: '>=10'} - /caniuse-lite@1.0.30001450: - resolution: {integrity: sha512-qMBmvmQmFXaSxexkjjfMvD5rnDL0+m+dUMZKoDYsGG8iZN29RuYh9eRoMvKsT6uMAWlyUUGDEQGJJYjzCIO9ew==} - dev: true - /caniuse-lite@1.0.30001492: resolution: {integrity: sha512-2efF8SAZwgAX1FJr87KWhvuJxnGJKOnctQa8xLOskAXNXq8oiuqgl6u1kk3fFpsp3GgvzlRjiK1sl63hNtFADw==} @@ -4128,6 +4134,20 @@ packages: /concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + /concordance@5.0.4: + resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} + engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} + dependencies: + date-time: 3.1.0 + esutils: 2.0.3 + fast-diff: 1.3.0 + js-string-escape: 1.0.1 + lodash: 4.17.21 + md5-hex: 3.0.1 + semver: 7.5.1 + well-known-symbols: 2.0.0 + dev: true + /consola@2.15.3: resolution: {integrity: sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw==} @@ -4270,6 +4290,13 @@ packages: engines: {node: '>= 12'} dev: true + /date-time@3.1.0: + resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} + engines: {node: '>=6'} + dependencies: + time-zone: 1.0.0 + dev: true + /dayjs@1.11.8: resolution: {integrity: sha512-LcgxzFoWMEPO7ggRv1Y2N31hUf2R0Vj7fuy/m+Bg1K8rr+KAs1AEy4y9jd5DXe8pbHgX+srkHNS7TH6Q6ZhYeQ==} dev: false @@ -4486,10 +4513,6 @@ packages: jake: 10.8.5 dev: false - /electron-to-chromium@1.4.285: - resolution: {integrity: sha512-47o4PPgxfU1KMNejz+Dgaodf7YTcg48uOfV1oM6cs3adrl2+7R+dHkt3Jpxqo0LRCbGJEzTKMUt0RdvByb/leg==} - dev: true - /electron-to-chromium@1.4.419: resolution: {integrity: sha512-jdie3RiEgygvDTyS2sgjq71B36q2cDSBfPlwzUyuOrfYTNoYWyBxxjGJV/HAu3A2hB0Y+HesvCVkVAFoCKwCSw==} @@ -5280,6 +5303,10 @@ packages: /fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + /fast-diff@1.3.0: + resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} + dev: true + /fast-glob@3.2.12: resolution: {integrity: sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==} engines: {node: '>=8.6.0'} @@ -5338,10 +5365,6 @@ packages: dev: false optional: true - /fastify-plugin@4.2.1: - resolution: {integrity: sha512-dlGKiwLzRBKkEf5J5ho0uAD/Jdv8GQVUbriB3tAX3ehRUXE4gTV3lRd5inEg9li1aLzb0EGj8y2K4/8g1TN06g==} - dev: false - /fastify-plugin@4.5.0: resolution: {integrity: sha512-79ak0JxddO0utAXAQ5ccKhvs6vX2MGyHHMMsmZkBANrq3hXc1CHzvNPHOcvTsVMEPl5I+NT+RO4YKMGehOfSIg==} dev: false @@ -6350,6 +6373,11 @@ packages: resolution: {integrity: sha512-+az2gi/hvex7eLTMTlbRLOhH6P6WFdk2ITI8HJsaH2VqYO0I594zXSYEP+tf4FW+8Cy68ScDXoAsQdyQanv3sw==} dev: false + /js-string-escape@1.0.1: + resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} + engines: {node: '>= 0.8'} + dev: true + /js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} @@ -6547,6 +6575,11 @@ packages: engines: {node: '>=14'} dev: true + /local-pkg@0.4.3: + resolution: {integrity: sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==} + engines: {node: '>=14'} + dev: true + /locate-path@5.0.0: resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} engines: {node: '>=8'} @@ -6751,6 +6784,13 @@ packages: dev: false optional: true + /md5-hex@3.0.1: + resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} + engines: {node: '>=8'} + dependencies: + blueimp-md5: 2.19.0 + dev: true + /md5@2.3.0: resolution: {integrity: sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==} dependencies: @@ -6893,6 +6933,15 @@ packages: hasBin: true dev: false + /mlly@1.3.0: + resolution: {integrity: sha512-HT5mcgIQKkOrZecOjOX3DJorTikWXwsBfpcr/MGBkhfWcjiqvnaL/9ppxvIUXfjT6xt4DVIAsN9fMUz1ev4bIw==} + dependencies: + acorn: 8.8.2 + pathe: 1.1.1 + pkg-types: 1.0.3 + ufo: 1.1.2 + dev: true + /mnemonist@0.39.5: resolution: {integrity: sha512-FPUtkhtJ0efmEFGpU14x7jGbTB+s18LrzRL2KgoWz9YvcY3cPomz8tih01GbHwnGk/OmkOKfqd/RAQoc8Lm7DQ==} dependencies: @@ -6920,7 +6969,7 @@ packages: new-find-package-json: 2.0.0 semver: 7.5.1 tar-stream: 2.2.0 - tslib: 2.5.2 + tslib: 2.5.3 uuid: 9.0.0 yauzl: 2.10.0 transitivePeerDependencies: @@ -6935,7 +6984,7 @@ packages: requiresBuild: true dependencies: mongodb-memory-server-core: 8.12.2 - tslib: 2.5.0 + tslib: 2.5.3 transitivePeerDependencies: - aws-crt - supports-color @@ -7088,6 +7137,12 @@ packages: engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true + /nanoid@3.3.6: + resolution: {integrity: sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + dev: true + /natural-compare-lite@1.4.0: resolution: {integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==} dev: true @@ -7200,10 +7255,6 @@ packages: /node-releases@2.0.12: resolution: {integrity: sha512-QzsYKWhXTWx8h1kIvqfnC++o0pEmpRQA/aenALsL2F4pqNVr7YzcdMlDij5WBnwftRbJCNJL/O7zdKaxKPHqgQ==} - /node-releases@2.0.9: - resolution: {integrity: sha512-2xfmOrRkGogbTK9R6Leda0DGiXeY3p2NJpy4+gNCffdUvV6mdEJnaDEic1i3Ec2djAo8jWYoJMR5PB0MSMpxUA==} - dev: true - /nodemailer@6.9.3: resolution: {integrity: sha512-fy9v3NgTzBngrMFkDsKEj0r02U7jm6XfC3b52eoNV+GCrGj+s8pt5OqhiJdWKuw51zCTdiNR/IUD1z33LIIGpg==} engines: {node: '>=6.0.0'} @@ -7394,6 +7445,13 @@ packages: dependencies: yocto-queue: 0.1.0 + /p-limit@4.0.0: + resolution: {integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dependencies: + yocto-queue: 1.0.0 + dev: true + /p-locate@4.1.0: resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} engines: {node: '>=8'} @@ -7506,6 +7564,10 @@ packages: engines: {node: '>=8'} dev: true + /pathe@1.1.1: + resolution: {integrity: sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q==} + dev: true + /pathval@1.1.1: resolution: {integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==} dev: true @@ -7553,6 +7615,14 @@ packages: dev: false optional: true + /pkg-types@1.0.3: + resolution: {integrity: sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==} + dependencies: + jsonc-parser: 3.2.0 + mlly: 1.3.0 + pathe: 1.1.1 + dev: true + /pluralize@8.0.0: resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==} engines: {node: '>=4'} @@ -7575,7 +7645,7 @@ packages: optional: true dependencies: lilconfig: 2.1.0 - ts-node: 10.9.1(@swc/core@1.3.4)(@types/node@18.16.16)(typescript@5.0.4) + ts-node: 10.9.1(@types/node@18.16.16)(typescript@5.0.4) yaml: 1.10.2 dev: true @@ -7588,6 +7658,15 @@ packages: source-map-js: 1.0.2 dev: true + /postcss@8.4.24: + resolution: {integrity: sha512-M0RzbcI0sO/XJNucsGjvWU9ERWxb/ytp1w6dKtxTKgixdtQDq4rmx/g8W1hnaheq9jgwL/oyEdH5Bc4WwJKMqg==} + engines: {node: ^10 || ^12 || >=14} + dependencies: + nanoid: 3.3.6 + picocolors: 1.0.0 + source-map-js: 1.0.2 + dev: true + /prelude-ls@1.2.1: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} @@ -7670,6 +7749,15 @@ packages: hasBin: true dev: true + /pretty-format@27.5.1: + resolution: {integrity: sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==} + engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} + dependencies: + ansi-regex: 5.0.1 + ansi-styles: 5.2.0 + react-is: 17.0.2 + dev: true + /process-nextick-args@2.0.1: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} dev: false @@ -7765,6 +7853,10 @@ packages: unpipe: 1.0.0 dev: true + /react-is@17.0.2: + resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==} + dev: true + /readable-stream@2.3.7: resolution: {integrity: sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==} dependencies: @@ -7883,15 +7975,6 @@ packages: engines: {node: '>=8'} dev: true - /resolve@1.22.1: - resolution: {integrity: sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==} - hasBin: true - dependencies: - is-core-module: 2.12.0 - path-parse: 1.0.7 - supports-preserve-symlinks-flag: 1.0.0 - dev: true - /resolve@1.22.2: resolution: {integrity: sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==} hasBin: true @@ -7982,7 +8065,7 @@ packages: /rxjs@7.8.1: resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} dependencies: - tslib: 2.5.0 + tslib: 2.5.3 /safe-buffer@5.1.2: resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} @@ -8119,6 +8202,10 @@ packages: /sift@16.0.1: resolution: {integrity: sha512-Wv6BjQ5zbhW7VFefWusVP33T/EM0vYikCaQ2qR8yULbsilAT8/wQaXvuQ3ptGLpoKx+lihJE3y2UTgKDyyNHZQ==} + /siginfo@2.0.0: + resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} + dev: true + /signal-exit@3.0.7: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} @@ -8188,10 +8275,6 @@ packages: type-fest: 2.19.0 dev: false - /socket.io-adapter@2.4.0: - resolution: {integrity: sha512-W4N+o69rkMEGVuk2D/cvca3uYsvGlMwsySWV447y99gUPghxq42BxqLNMndb+a1mm/5/7NeXVQS7RLa2XyXvYg==} - dev: false - /socket.io-adapter@2.5.2: resolution: {integrity: sha512-87C3LO/NOMc+eMcpcxUBebGjkpMDkNBS9tf7KJqcDsmL936EChtVva71Dw2q4tQcuVC+hAUy4an2NO/sYXmwRA==} dependencies: @@ -8307,6 +8390,10 @@ packages: through: 2.3.8 dev: true + /stackback@0.0.2: + resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} + dev: true + /standard-as-callback@2.1.0: resolution: {integrity: sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A==} @@ -8314,6 +8401,10 @@ packages: resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==} engines: {node: '>= 0.8'} + /std-env@3.3.3: + resolution: {integrity: sha512-Rz6yejtVyWnVjC1RFvNmYL10kgjC49EOghxWn0RFqlCHGFpQx+Xe7yW3I4ceK1SGrWIGMjD5Kbue8W/udkbMJg==} + dev: true + /stream-combiner@0.0.4: resolution: {integrity: sha512-rT00SPnTVyRsaSz5zgSPma/aHSOic5U1prhYdRy5HS2kTZviFpmDgzilbtsJsxiroqACmayynDN/9VzIbX5DOw==} dependencies: @@ -8435,6 +8526,12 @@ packages: acorn: 8.8.2 dev: true + /strip-literal@1.0.1: + resolution: {integrity: sha512-QZTsipNpa2Ppr6v1AmJHESqJ3Uz247MUS0OjrnnZjFAvEoWqxuyFuXn2xLgMtRnijJShAa1HL0gtJyUs7u7n3Q==} + dependencies: + acorn: 8.8.2 + dev: true + /strnum@1.0.5: resolution: {integrity: sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==} dev: false @@ -8570,6 +8667,11 @@ packages: /through@2.3.8: resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==} + /time-zone@1.0.0: + resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} + engines: {node: '>=4'} + dev: true + /tiny-lru@11.0.1: resolution: {integrity: sha512-iNgFugVuQgBKrqeO/mpiTTgmBsTP0WL6yeuLfLs/Ctf0pI/ixGqIRm8sDCwMcXGe9WWvt2sGXI5mNqZbValmJg==} engines: {node: '>=12'} @@ -8579,16 +8681,30 @@ packages: resolution: {integrity: sha512-hGYWYBMPr7p4g5IarQE7XhlyWveh1EKhy4wUBS1LrHXCKYgvz+4/jCqgmJqZxxldesn05vccrtME2RLLZNW7iA==} dev: true + /tinybench@2.5.0: + resolution: {integrity: sha512-kRwSG8Zx4tjF9ZiyH4bhaebu+EDz1BOx9hOigYHlUW4xxI/wKIUQUqo018UlU4ar6ATPBsaMrdbKZ+tmPdohFA==} + dev: true + /tinypool@0.3.0: resolution: {integrity: sha512-NX5KeqHOBZU6Bc0xj9Vr5Szbb1j8tUHIeD18s41aDJaPeC5QTdEhK0SpdpUrZlj2nv5cctNcSjaKNanXlfcVEQ==} engines: {node: '>=14.0.0'} dev: true + /tinypool@0.5.0: + resolution: {integrity: sha512-paHQtnrlS1QZYKF/GnLoOM/DN9fqaGOFbCbxzAhwniySnzl9Ebk8w73/dd34DAhe/obUbPAOldTyYXQZxnPBPQ==} + engines: {node: '>=14.0.0'} + dev: true + /tinyspy@1.0.2: resolution: {integrity: sha512-bSGlgwLBYf7PnUsQ6WOc6SJ3pGOcd+d8AA6EUnLDDM0kWEstC1JIlSZA3UNliDXhd9ABoS7hiRBDCu+XP/sf1Q==} engines: {node: '>=14.0.0'} dev: true + /tinyspy@2.1.1: + resolution: {integrity: sha512-XPJL2uSzcOyBMky6OFrusqWlzfFrXtE0hPuMgW8A2HmaqrPo4ZQHRN/V0QXN3FSjKxpsbRrFc5LI7KOwBsT1/w==} + engines: {node: '>=14.0.0'} + dev: true + /tmp@0.0.33: resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} engines: {node: '>=0.6.0'} @@ -8642,7 +8758,7 @@ packages: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} dev: true - /ts-node@10.9.1(@swc/core@1.3.4)(@types/node@18.16.16)(typescript@5.0.4): + /ts-node@10.9.1(@types/node@18.16.16)(typescript@5.0.4): resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -8657,13 +8773,12 @@ packages: optional: true dependencies: '@cspotcode/source-map-support': 0.8.1 - '@swc/core': 1.3.4 '@tsconfig/node10': 1.0.8 '@tsconfig/node12': 1.0.9 '@tsconfig/node14': 1.0.1 '@tsconfig/node16': 1.0.2 '@types/node': 18.16.16 - acorn: 8.7.1 + acorn: 8.8.2 acorn-walk: 8.2.0 arg: 4.1.3 create-require: 1.1.1 @@ -8717,17 +8832,13 @@ packages: /tslib@1.14.1: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} - /tslib@2.5.0: - resolution: {integrity: sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==} - /tslib@2.5.2: resolution: {integrity: sha512-5svOrSA2w3iGFDs1HibEVBGbDrAY82bFQ3HZ3ixB+88nsbsWQoKqDRb5UBYAUPEzbBn6dAp5gRNXglySbx1MlA==} /tslib@2.5.3: resolution: {integrity: sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==} - dev: false - /tsup@6.7.0(@swc/core@1.3.4)(ts-node@10.9.1)(typescript@5.0.4): + /tsup@6.7.0(ts-node@10.9.1)(typescript@5.0.4): resolution: {integrity: sha512-L3o8hGkaHnu5TdJns+mCqFsDBo83bJ44rlK7e6VdanIvpea4ArPcU3swWGsLVbXak1PqQx/V+SSmFPujBK+zEQ==} engines: {node: '>=14.18'} hasBin: true @@ -8743,7 +8854,6 @@ packages: typescript: optional: true dependencies: - '@swc/core': 1.3.4 bundle-require: 4.0.1(esbuild@0.17.8) cac: 6.7.14 chokidar: 3.5.3 @@ -8830,6 +8940,10 @@ packages: resolution: {integrity: sha512-fKnGuqmTBnIE+/KXSzCn4db8RTigUzw1AN0DmdU6hJovUTbYJKyqj+8Mt1c4VfRDnOVJnENmfYkIPZ946UrSAA==} dev: false + /ufo@1.1.2: + resolution: {integrity: sha512-TrY6DsjTQQgyS3E3dBaOXf0TpPD8u9FVrVYmKVegJuFw51n/YB9XPt+U6ydzFG5ZIN7+DIjPbNmXoBj9esYhgQ==} + dev: true + /uhyphen@0.2.0: resolution: {integrity: sha512-qz3o9CHXmJJPGBdqzab7qAYuW8kQGKNEuoHFYrBwV6hWIMcpAmxDLXojcHfFr9US1Pe6zUswEIJIbLI610fuqA==} dev: false @@ -8873,17 +8987,6 @@ packages: engines: {node: '>= 0.8'} dev: true - /update-browserslist-db@1.0.10(browserslist@4.21.5): - resolution: {integrity: sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==} - hasBin: true - peerDependencies: - browserslist: '>= 4.21.0' - dependencies: - browserslist: 4.21.5 - escalade: 3.1.1 - picocolors: 1.0.0 - dev: true - /update-browserslist-db@1.0.11(browserslist@4.21.7): resolution: {integrity: sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==} hasBin: true @@ -8936,6 +9039,27 @@ packages: resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} engines: {node: '>= 0.8'} + /vite-node@0.31.4(@types/node@18.16.16): + resolution: {integrity: sha512-uzL377GjJtTbuc5KQxVbDu2xfU/x0wVjUtXQR2ihS21q/NK6ROr4oG0rsSkBBddZUVCwzfx22in76/0ZZHXgkQ==} + engines: {node: '>=v14.18.0'} + hasBin: true + dependencies: + cac: 6.7.14 + debug: 4.3.4 + mlly: 1.3.0 + pathe: 1.1.1 + picocolors: 1.0.0 + vite: 4.3.9(@types/node@18.16.16) + transitivePeerDependencies: + - '@types/node' + - less + - sass + - stylus + - sugarss + - supports-color + - terser + dev: true + /vite-tsconfig-paths@4.2.0(typescript@5.0.4)(vite@3.2.5): resolution: {integrity: sha512-jGpus0eUy5qbbMVGiTxCL1iB9ZGN6Bd37VGLJU39kTDD6ZfULTTb1bcc5IeTWqWJKiWV5YihCaibeASPiGi8kw==} peerDependencies: @@ -8981,12 +9105,45 @@ packages: '@types/node': 18.16.16 esbuild: 0.15.18 postcss: 8.4.21 - resolve: 1.22.1 + resolve: 1.22.2 rollup: 2.79.1 optionalDependencies: fsevents: 2.3.2 dev: true + /vite@4.3.9(@types/node@18.16.16): + resolution: {integrity: sha512-qsTNZjO9NoJNW7KnOrgYwczm0WctJ8m/yqYAMAK9Lxt4SoySUfS5S8ia9K7JHpa3KEeMfyF8LoJ3c5NeBJy6pg==} + engines: {node: ^14.18.0 || >=16.0.0} + hasBin: true + peerDependencies: + '@types/node': '>= 14' + less: '*' + sass: '*' + stylus: '*' + sugarss: '*' + terser: ^5.4.0 + peerDependenciesMeta: + '@types/node': + optional: true + less: + optional: true + sass: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + dependencies: + '@types/node': 18.16.16 + esbuild: 0.17.8 + postcss: 8.4.24 + rollup: 3.23.0 + optionalDependencies: + fsevents: 2.3.2 + dev: true + /vitest@0.25.3: resolution: {integrity: sha512-/UzHfXIKsELZhL7OaM2xFlRF8HRZgAHtPctacvNK8H4vOcbJJAMEgbWNGSAK7Y9b1NBe5SeM7VTuz2RsTHFJJA==} engines: {node: '>=v14.16.0'} @@ -9012,7 +9169,7 @@ packages: '@types/chai': 4.3.4 '@types/chai-subset': 1.3.3 '@types/node': 18.16.16 - acorn: 8.8.1 + acorn: 8.8.2 acorn-walk: 8.2.0 chai: 4.3.7 debug: 4.3.4 @@ -9032,6 +9189,71 @@ packages: - terser dev: true + /vitest@0.31.4: + resolution: {integrity: sha512-GoV0VQPmWrUFOZSg3RpQAPN+LPmHg2/gxlMNJlyxJihkz6qReHDV6b0pPDcqFLNEPya4tWJ1pgwUNP9MLmUfvQ==} + engines: {node: '>=v14.18.0'} + hasBin: true + peerDependencies: + '@edge-runtime/vm': '*' + '@vitest/browser': '*' + '@vitest/ui': '*' + happy-dom: '*' + jsdom: '*' + playwright: '*' + safaridriver: '*' + webdriverio: '*' + peerDependenciesMeta: + '@edge-runtime/vm': + optional: true + '@vitest/browser': + optional: true + '@vitest/ui': + optional: true + happy-dom: + optional: true + jsdom: + optional: true + playwright: + optional: true + safaridriver: + optional: true + webdriverio: + optional: true + dependencies: + '@types/chai': 4.3.5 + '@types/chai-subset': 1.3.3 + '@types/node': 18.16.16 + '@vitest/expect': 0.31.4 + '@vitest/runner': 0.31.4 + '@vitest/snapshot': 0.31.4 + '@vitest/spy': 0.31.4 + '@vitest/utils': 0.31.4 + acorn: 8.8.2 + acorn-walk: 8.2.0 + cac: 6.7.14 + chai: 4.3.7 + concordance: 5.0.4 + debug: 4.3.4 + local-pkg: 0.4.3 + magic-string: 0.30.0 + pathe: 1.1.1 + picocolors: 1.0.0 + std-env: 3.3.3 + strip-literal: 1.0.1 + tinybench: 2.5.0 + tinypool: 0.5.0 + vite: 4.3.9(@types/node@18.16.16) + vite-node: 0.31.4(@types/node@18.16.16) + why-is-node-running: 2.2.2 + transitivePeerDependencies: + - less + - sass + - stylus + - sugarss + - supports-color + - terser + dev: true + /vm2@3.9.19: resolution: {integrity: sha512-J637XF0DHDMV57R6JyVsTak7nIL8gy5KH4r1HiwWLf/4GBbb5MKL5y7LpmF4A8E2nR6XmzpmMFQ7V7ppPTmUQg==} engines: {node: '>=6.0'} @@ -9097,7 +9319,7 @@ packages: '@webassemblyjs/wasm-parser': 1.11.5 acorn: 8.8.2 acorn-import-assertions: 1.8.0(acorn@8.8.2) - browserslist: 4.21.5 + browserslist: 4.21.7 chrome-trace-event: 1.0.3 enhanced-resolve: 5.14.0 es-module-lexer: 1.2.1 @@ -9125,6 +9347,11 @@ packages: hasBin: true dev: true + /well-known-symbols@2.0.0: + resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} + engines: {node: '>=6'} + dev: true + /whatwg-fetch@3.6.2: resolution: {integrity: sha512-bJlen0FcuU/0EMLrdbJ7zOnW6ITZLrZMIarMUVmdKtsGvZna8vxKYaexICWPfZ8qwf9fzNq+UEIZrnSaApt6RA==} dev: true @@ -9185,6 +9412,15 @@ packages: isexe: 2.0.0 dev: true + /why-is-node-running@2.2.2: + resolution: {integrity: sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==} + engines: {node: '>=8'} + hasBin: true + dependencies: + siginfo: 2.0.0 + stackback: 0.0.2 + dev: true + /wide-align@1.1.3: resolution: {integrity: sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==} dependencies: @@ -9285,6 +9521,11 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} + /yocto-queue@1.0.0: + resolution: {integrity: sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==} + engines: {node: '>=12.20'} + dev: true + /zx-cjs@7.0.7-0: resolution: {integrity: sha512-CDwRWriV229ZQN5/wIk92DYQ33Q/jU2DvL+CQXa96qIwMINpW6RQWaXWCRticVDPF0CRKZ4y6uB/8GRzBw1MxA==} engines: {node: '>= 16.0.0'} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 924b55f4..6f002730 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,2 +1,3 @@ packages: - packages/* + - apps/* diff --git a/schema.gql b/schema.gql new file mode 100644 index 00000000..cdea7258 --- /dev/null +++ b/schema.gql @@ -0,0 +1,120 @@ +# ------------------------------------------------------ +# THIS FILE WAS AUTOMATICALLY GENERATED (DO NOT MODIFY) +# ------------------------------------------------------ + +type Paginator { + total: Float! + size: Float! + currentPage: Float! + totalPage: Float! + hasNextPage: Boolean! + hasPrevPage: Boolean! +} + +type Image { + width: Float + height: Float + accent: String + type: String + src: String! +} + +type CountMixed { + read: Float + like: Float +} + +type Coordinate { + latitude: Float! + longitude: Float! +} + +type NoteMusic { + type: String! + id: String! +} + +type NoteModel { + created: DateTime + id: ID + commentsIndex: Float + allowComment: Boolean! + images: Image + modified: DateTime + title: String! + text: String! + coordinates: Coordinate + count: CountMixed + music: [NoteMusic!] + nid: Float! + hide: Boolean! + password: String + secret: DateTime + mood: String + weather: String + hasMemory: Boolean + location: String +} + +""" +A date-time string at UTC, such as 2019-12-03T09:54:33Z, compliant with the date-time format. +""" +scalar DateTime + +type NoteItemAggregateModel { + data: NoteModel! + prev: NoteModel + next: NoteModel +} + +type NotePaginatorModel { + data: [NoteModel!]! + pagination: Paginator! +} + +type CategoryModel { + created: DateTime + id: ID + name: String! + type: CategoryType + slug: String! +} + +enum CategoryType { + Category + Tag +} + +type PostModel { + created: DateTime + id: ID + commentsIndex: Float + allowComment: Boolean! + images: Image + modified: DateTime + title: String! + text: String! + categoryId: String! + category: CategoryModel + count: CountMixed + slug: String! + summary: String + hide: Boolean + copyright: Boolean + tags: [String!] +} + +type PostPaginatorModel { + data: [PostModel!]! + pagination: Paginator! +} + +type Query { + sayHello: String! + getPostById(id: ID!): PostModel! + getPostList(size: Int, page: Int, select: String, year: Float, state: Float, sortOrder: Int, sortBy: String): PostPaginatorModel! + getByCateAndSlug(category: String!, slug: String!): PostModel! + getNoteById(password: String, nid: Int, id: ID): NoteItemAggregateModel! + getLastestNote: NoteItemAggregateModel! + getNotesWithPager(size: Int, page: Int, select: String, year: Float, state: Float, sortOrder: Int, sortBy: String): NotePaginatorModel! +} diff --git a/scripts/workflow/test-server.sh b/scripts/workflow/test-server.sh index 7788c00a..93a3bfd8 100755 --- a/scripts/workflow/test-server.sh +++ b/scripts/workflow/test-server.sh @@ -9,7 +9,7 @@ if [[ $? -ne 0 ]]; then exit 1 fi -nohup node out/index.js 1>/dev/null & +nohup node apps/core/out/index.js 1>/dev/null & p=$! echo "started server with pid $p" diff --git a/scripts/zip-asset.sh b/scripts/zip-asset.sh deleted file mode 100644 index a851b6ff..00000000 --- a/scripts/zip-asset.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -set -e -rm -rf assets/.git -cp -R assets out -cp ecosystem.config.js out -node scripts/download-latest-admin-assets.js -cd out -zip -r ../release.zip ./*