From 4ca5f3fa831c4e722130f168cfc71e5624b7db1b Mon Sep 17 00:00:00 2001 From: niamu01 Date: Thu, 7 Dec 2023 01:54:14 +0900 Subject: [PATCH] fix: install @nestjs/cache-manager MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @nestjs/common에 있던 cache-manager 모듈이 버전 업데이트에서 분리되어 설치해주었습니다. deprecated 된 CacheModule을 사용할 수 있게 해줍니다. --- package-lock.json | 46 +++++++++++++++++++------ package.json | 3 +- src/app.module.ts | 14 +++----- src/statistics/statictics.controller.ts | 3 +- src/tag-log-v2/tag-log-v2.controller.ts | 16 ++++----- 5 files changed, 52 insertions(+), 30 deletions(-) diff --git a/package-lock.json b/package-lock.json index f98ebb2..148453b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "license": "UNLICENSED", "dependencies": { "@googleapis/sheets": "^3.0.2", + "@nestjs/cache-manager": "^2.1.1", "@nestjs/common": "^10.2.10", "@nestjs/config": "^3.1.1", "@nestjs/core": "^10.2.10", @@ -19,7 +20,7 @@ "@nestjs/swagger": "^7.1.16", "@nestjs/typeorm": "^10.0.1", "axios": "^1.3.4", - "cache-manager": "^4.0.0", + "cache-manager": "^5.3.1", "class-transformer": "^0.5.1", "class-validator": "^0.14.0", "cookie-parser": "^1.4.6", @@ -1607,6 +1608,18 @@ "node": ">=8" } }, + "node_modules/@nestjs/cache-manager": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@nestjs/cache-manager/-/cache-manager-2.1.1.tgz", + "integrity": "sha512-oYfRys4Ng0zp2HTUPNjH7gizf4vvG3PQZZ+3yGemb3xrF+p3JxDSK0cDq9NTjHzD5UmhjiyAftB9GkuL+t3r9g==", + "peerDependencies": { + "@nestjs/common": "^9.0.0 || ^10.0.0", + "@nestjs/core": "^9.0.0 || ^10.0.0", + "cache-manager": "<=5", + "reflect-metadata": "^0.1.12", + "rxjs": "^7.0.0" + } + }, "node_modules/@nestjs/cli": { "version": "10.2.1", "resolved": "https://registry.npmjs.org/@nestjs/cli/-/cli-10.2.1.tgz", @@ -3028,11 +3041,6 @@ "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==", "dev": true }, - "node_modules/async": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.3.tgz", - "integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==" - }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -3377,13 +3385,21 @@ } }, "node_modules/cache-manager": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cache-manager/-/cache-manager-4.1.0.tgz", - "integrity": "sha512-ZGM6dLxrP65bfOZmcviWMadUOCICqpLs92+P/S5tj8onz+k+tB7Gr+SAgOUHCQtfm2gYEQDHiKeul4+tYPOJ8A==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/cache-manager/-/cache-manager-5.3.1.tgz", + "integrity": "sha512-9HP6nc1ZqyZgcVEpy5XS2ns9MYE6cPEM6InA1wQhR6M7GviJzLH2NTFYnf3NEfRmLE351NCSkDo2VISX8dlG+w==", "dependencies": { - "async": "3.2.3", "lodash.clonedeep": "^4.5.0", - "lru-cache": "^7.10.1" + "lru-cache": "^10.0.2", + "promise-coalesce": "^1.1.1" + } + }, + "node_modules/cache-manager/node_modules/lru-cache": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.1.0.tgz", + "integrity": "sha512-/1clY/ui8CzjKFyjdvwPWJUYKiFVXG2I2cY0ssG7h4+hwk+XOIX7ZSG9Q7TW8TW3Kp3BUSqgFWBLgL4PJ+Blag==", + "engines": { + "node": "14 || >=16.14" } }, "node_modules/call-bind": { @@ -8050,6 +8066,14 @@ "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" }, + "node_modules/promise-coalesce": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/promise-coalesce/-/promise-coalesce-1.1.1.tgz", + "integrity": "sha512-k7+VaIwZc5dRfSF6RELqRY1+LCmcCkrnuNV9HzIpA6iwRHKke+j9yb0LBTTHQ2RRgf6AlMl9TntuTzcgV/BZwg==", + "engines": { + "node": ">=18" + } + }, "node_modules/prompts": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", diff --git a/package.json b/package.json index 1d1131c..0b10587 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ }, "dependencies": { "@googleapis/sheets": "^3.0.2", + "@nestjs/cache-manager": "^2.1.1", "@nestjs/common": "^10.2.10", "@nestjs/config": "^3.1.1", "@nestjs/core": "^10.2.10", @@ -31,7 +32,7 @@ "@nestjs/swagger": "^7.1.16", "@nestjs/typeorm": "^10.0.1", "axios": "^1.3.4", - "cache-manager": "^4.0.0", + "cache-manager": "^5.3.1", "class-transformer": "^0.5.1", "class-validator": "^0.14.0", "cookie-parser": "^1.4.6", diff --git a/src/app.module.ts b/src/app.module.ts index f7ca5f4..1cd15b4 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -1,9 +1,5 @@ -import { - CacheModule, - MiddlewareConsumer, - Module, - NestModule, -} from '@nestjs/common'; +import { CacheModule } from '@nestjs/cache-manager'; +import { MiddlewareConsumer, Module, NestModule } from '@nestjs/common'; import { ConfigModule } from '@nestjs/config'; import { TypeOrmModule } from '@nestjs/typeorm'; import { AuthModule } from './auth/auth.module'; @@ -11,12 +7,12 @@ import configuration from './configs/configuration'; import TypeOrmConfigService from './configs/typeorm.config'; import { ExtModule } from './ext/ext.module'; import { SessionMiddleware } from './middleware/session-middleware'; +import { RedirectModule } from './redirect/redirect.module'; +import { ReissueModule } from './reissue/reissue.module'; +import { StatisticsModule } from './statistics/statictics.module'; import { TagLogModule } from './tag-log-v1/tag-log.module'; import { TagLogModule2 } from './tag-log-v2/tag-log-v2.module'; import { UserModule } from './user/user.module'; -import { ReissueModule } from './reissue/reissue.module'; -import { StatisticsModule } from './statistics/statictics.module'; -import { RedirectModule } from './redirect/redirect.module'; @Module({ imports: [ diff --git a/src/statistics/statictics.controller.ts b/src/statistics/statictics.controller.ts index dfe94a7..fe93a3b 100644 --- a/src/statistics/statictics.controller.ts +++ b/src/statistics/statictics.controller.ts @@ -1,4 +1,5 @@ -import { CACHE_MANAGER, Controller, Get, Inject, Logger } from '@nestjs/common'; +import { Controller, Get, Inject, Logger } from '@nestjs/common'; +import { CACHE_MANAGER } from '@nestjs/cache-manager'; import { ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger'; import { StatisticsService } from './statictics.service'; import { CadetPerClusterDto } from './dto/cadet-per-cluster.dto'; diff --git a/src/tag-log-v2/tag-log-v2.controller.ts b/src/tag-log-v2/tag-log-v2.controller.ts index 3a11e16..42a155a 100644 --- a/src/tag-log-v2/tag-log-v2.controller.ts +++ b/src/tag-log-v2/tag-log-v2.controller.ts @@ -1,5 +1,5 @@ +import { CACHE_MANAGER } from '@nestjs/cache-manager'; import { - CACHE_MANAGER, Controller, Get, Inject, @@ -15,16 +15,16 @@ import { ApiResponse, ApiTags, } from '@nestjs/swagger'; -import { User } from 'src/auth/user.decorator'; +import { Cache } from 'cache-manager'; import { UserSessionDto } from 'src/auth/dto/user.session.dto'; -import { UserAccumulationType } from './dto/user-accumulation.type'; -import { UserInfoType } from './dto/user-Info.type'; -import { UserInOutLogsType } from './dto/UserInOutLogs.type'; -import { TagLogService } from './tag-log-v2.service'; import { UserAuthGuard } from 'src/auth/guard/user-auth.guard'; -import { Cache } from 'cache-manager'; -import { StatisticsService } from 'src/statistics/statictics.service'; +import { User } from 'src/auth/user.decorator'; import { CadetPerClusterDto } from 'src/statistics/dto/cadet-per-cluster.dto'; +import { StatisticsService } from 'src/statistics/statictics.service'; +import { UserInOutLogsType } from './dto/UserInOutLogs.type'; +import { UserInfoType } from './dto/user-Info.type'; +import { UserAccumulationType } from './dto/user-accumulation.type'; +import { TagLogService } from './tag-log-v2.service'; @ApiTags('체류 시간 산출 v2') @Controller({