chore: cleanup
This commit is contained in:
parent
9df9e15953
commit
53393daba3
30 changed files with 334 additions and 184 deletions
0
.forgejo/workflows/release.yml
Normal file
0
.forgejo/workflows/release.yml
Normal file
0
.github/workflows/release.yml
vendored
Normal file
0
.github/workflows/release.yml
vendored
Normal file
61
Dockerfile
61
Dockerfile
|
@ -1,58 +1,39 @@
|
|||
# base environment
|
||||
FROM node:22.4.1-alpine3.20 AS base-stage
|
||||
RUN mkdir /app && chown -R node:node /app
|
||||
WORKDIR /app
|
||||
# Setup Base Env
|
||||
FROM node:20.18.0-alpine3.20 AS base
|
||||
ENV PNPM_HOME="/pnpm"
|
||||
ENV PATH="$PNPM_HOME:$PATH"
|
||||
RUN corepack enable
|
||||
COPY . /app
|
||||
WORKDIR /app
|
||||
|
||||
# dependency environment
|
||||
FROM base-stage AS dependency-stage
|
||||
USER node
|
||||
COPY --link --chown=1000:1000 package*.json pnpm-lock.yaml ./
|
||||
# Install Prod Dependencies
|
||||
FROM base AS prod-deps
|
||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install typia ts-patch -g
|
||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
|
||||
|
||||
# Install all Dependencies
|
||||
FROM base AS all-deps
|
||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
|
||||
|
||||
# test stage to stop at for testing
|
||||
FROM dependency-stage AS all-source-stage
|
||||
COPY --link --chown=1000:1000 . .
|
||||
|
||||
# lint
|
||||
FROM all-source-stage AS lint
|
||||
FROM all-deps AS lint
|
||||
RUN npm run lint -- --no-fix
|
||||
|
||||
# test-e2e
|
||||
FROM all-source-stage AS test-e2e
|
||||
USER root
|
||||
RUN mkdir /keys
|
||||
USER node
|
||||
RUN --mount=type=secret,id=cookies,target=/keys/cookies.json,uid=1000,gid=1000,required=true \
|
||||
--mount=type=secret,id=jwks,target=/keys/jwks.json,uid=1000,gid=1000,required=true \
|
||||
npm run test:e2e:cov -- --ci --json --testLocationInResults --outputFile=/tmp/report.json
|
||||
|
||||
# Just the e2e report file
|
||||
FROM scratch AS test-stage
|
||||
COPY --link --from=test-e2e /tmp/report.json /
|
||||
#Build the app
|
||||
FROM all-deps AS build
|
||||
RUN pnpm run build
|
||||
|
||||
# build environment
|
||||
FROM dependency-stage AS build-stage
|
||||
COPY --link --chown=1000:1000 . .
|
||||
RUN npm run build
|
||||
|
||||
# prod dependency environment
|
||||
FROM build-stage AS production-dependency-stage
|
||||
RUN npm prune --production
|
||||
|
||||
# production environment
|
||||
FROM base-stage AS production-stage
|
||||
#Build final image
|
||||
FROM base
|
||||
RUN apk add --no-cache tini
|
||||
USER node
|
||||
|
||||
COPY --link --chown=1000:1000 --from=production-dependency-stage /app /app
|
||||
|
||||
COPY --from=prod-deps /app/node_modules /app/node_modules
|
||||
COPY --from=build /app/dist /app/dist
|
||||
ENV NODE_ENV=production
|
||||
|
||||
EXPOSE 3000
|
||||
ENTRYPOINT ["/sbin/tini", "--"]
|
||||
CMD ["node", "/app/.dist/src/main.js"]
|
||||
CMD ["node", "/app/dist/main.js"]
|
||||
|
||||
ARG VERSION
|
||||
ENV VERSION=${VERSION}
|
|
@ -16,5 +16,18 @@ services:
|
|||
restart: unless-stopped
|
||||
ports:
|
||||
- "6379:6379"
|
||||
|
||||
waterwolf-auth:
|
||||
build: .
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "3000:3000"
|
||||
depends_on:
|
||||
- mysql
|
||||
- redis
|
||||
env_file:
|
||||
- .env
|
||||
volumes:
|
||||
- ./keys:/keys
|
||||
volumes:
|
||||
mysql-data:
|
|
@ -1,5 +1,6 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
@ -7,30 +8,48 @@
|
|||
<link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
|
||||
<style>
|
||||
body {
|
||||
background-color: #f3f4f6; /* Tailwind class 'bg-gray-100' */
|
||||
background-color: #f3f4f6;
|
||||
/* Tailwind class 'bg-gray-100' */
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 28rem; /* Tailwind class 'max-w-md' */
|
||||
margin: 2rem auto; /* Tailwind classes 'mx-auto' 'mt-8' */
|
||||
padding: 1.5rem; /* Tailwind class 'p-6' */
|
||||
background-color: #ffffff; /* Tailwind class 'bg-white' */
|
||||
border-radius: 0.5rem; /* Tailwind class 'rounded-lg' */
|
||||
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); /* Tailwind class 'shadow-md' */
|
||||
max-width: 28rem;
|
||||
/* Tailwind class 'max-w-md' */
|
||||
margin: 2rem auto;
|
||||
/* Tailwind classes 'mx-auto' 'mt-8' */
|
||||
padding: 1.5rem;
|
||||
/* Tailwind class 'p-6' */
|
||||
background-color: #ffffff;
|
||||
/* Tailwind class 'bg-white' */
|
||||
border-radius: 0.5rem;
|
||||
/* Tailwind class 'rounded-lg' */
|
||||
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
|
||||
/* Tailwind class 'shadow-md' */
|
||||
}
|
||||
|
||||
.button {
|
||||
display: inline-block;
|
||||
background-color: #6366f1; /* Tailwind class 'bg-indigo-600' */
|
||||
color: #ffffff; /* Tailwind class 'text-white' */
|
||||
font-weight: 700; /* Tailwind class 'font-bold' */
|
||||
padding: 0.5rem 1rem; /* Tailwind classes 'py-2' and 'px-4' */
|
||||
border-radius: 0.375rem; /* Tailwind class 'rounded-md' */
|
||||
text-decoration: none; /* Remove underline for links */
|
||||
background-color: #1b92c9d1;
|
||||
/* Tailwind class 'bg-indigo-600' */
|
||||
color: #ffffff;
|
||||
/* Tailwind class 'text-white' */
|
||||
font-weight: 700;
|
||||
/* Tailwind class 'font-bold' */
|
||||
padding: 0.5rem 1rem;
|
||||
/* Tailwind classes 'py-2' and 'px-4' */
|
||||
border-radius: 0.375rem;
|
||||
/* Tailwind class 'rounded-md' */
|
||||
text-decoration: none;
|
||||
/* Remove underline for links */
|
||||
}
|
||||
|
||||
.button:hover {
|
||||
background-color: #4f46e5; /* Tailwind class 'hover:bg-indigo-700' */
|
||||
background-color: #4f46e5;
|
||||
/* Tailwind class 'hover:bg-indigo-700' */
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1 class="text-2xl font-semibold text-gray-800">Verify Your Email Address</h1>
|
||||
|
@ -58,7 +77,8 @@
|
|||
</style>
|
||||
<g id="svg">
|
||||
<g id="svgg">
|
||||
<path id="path0" class="cls-1" d="M87.69,1.22C25.89,11.33-13.11,71.52,4.06,130.27c2.91,9.95,2.81,9.92,5.07,1.07,1.11-4.32,2.34-8.7,2.74-9.73.5-1.27.5-3.66,0-7.51C1.85,36.65,88.31-16.64,153.44,26.86c67.68,45.2,44.99,151.23-35.36,165.24-10.87,1.9-10.31,2.09-18.71-6.25-8.16-8.1-8-8.17-4.75,2.22l1.64,5.26-4.77-.51c-7.24-.77-18.02-3.71-19.82-5.4-4.91-4.61-8.76-19.09-9.26-34.81-.18-5.6-.57-10.2-.87-10.23-3.89-.28-13.29,4.17-19.89,9.41-5.97,4.74-6.02,4.7-3.91-3.57,6.93-27.13,27.84-54.82,50.35-66.66l5.01-2.64-2.73-.51c-1.5-.28-5.67-.35-9.26-.14l-6.53.37,6.83-3.43c7.96-4,14.12-6.14,20.87-7.26,2.77-.46,4.82-1.16,4.82-1.64,0-3,19.12-26.83,21.52-26.83.35,0,.43,3.27.19,7.33-.55,9.09-.71,8.86,10.82,15.24,10.14,5.61,11.94,7.09,11.65,9.57-.35,3.02-2.34,2.57-4.44-1-2.17-3.7-4.25-4.99-9.58-5.96-4.45-.81-4.68-.56-3.68,3.9,1.24,5.55,4.55,7.99,13.36,9.85,10.08,2.14,26.65,9.16,26.14,11.07-.19.73.21,2.18.9,3.22,1.2,1.82,1.19,1.98-.18,3.83-4.8,6.48-11.34,7.82-18.59,3.82-15.61-8.62-25.89-12.19-36.77-12.79-10.3-.56-18.56,1.78-10.29,2.91,3.9.54,7.97,2.52,10.33,5.05l1.73,1.86h-3.52c-23.99.1-42.29,20.92-37.02,42.13,1.83,7.37,6.88,16.46,13.12,23.61,2.46,2.82,2.6,2.69,1.05-1.03-4.13-9.89-2.1-27.31,4-34.25,4.43-5.04,4.84-4.83,4.44,2.3-1.22,21.5,13.44,35.47,40.58,38.67,4.98.59,5.26.26,1.59-1.84-14.85-8.47-26.07-27.76-23.68-40.69,2.92-15.8,12.63-21.34,34.29-19.56l10.56.87,3.15-1.84c7.55-4.42,17.35-15.45,15.44-17.36-.58-.58-6.99-3.62-14.23-6.75l-13.18-5.69-.36-4.47c-.44-5.58-.41-5.53-6.84-9.87-4.85-3.27-5.31-3.79-5.31-6,0-6.16-3.48-18.85-4.93-17.96-.37.23-.9,3.95-1.18,8.27-.52,8.03-1.12,9.27-3.25,6.71-.68-.82-.96-3.68-.98-9.93-.03-9.38-.86-11.79-4.09-11.79-5.02,0-19.77,11.77-29.26,23.35-1.53,1.87-3.02,2.57-8.57,4.05-21.98,5.85-51.41,23.66-59.59,36.06-2.69,4.07-2.28,4.17,3.95.94,12.69-6.58,26.23-10.86,19.26-6.1-20.43,13.98-33.21,37.15-37.46,67.92-1.03,7.47,22.04,28.83,40.44,37.46,76.3,35.75,160.95-30.76,143.93-113.09C191.73,29.3,139.44-7.25,87.69,1.22"/>
|
||||
<path id="path0" class="cls-1"
|
||||
d="M87.69,1.22C25.89,11.33-13.11,71.52,4.06,130.27c2.91,9.95,2.81,9.92,5.07,1.07,1.11-4.32,2.34-8.7,2.74-9.73.5-1.27.5-3.66,0-7.51C1.85,36.65,88.31-16.64,153.44,26.86c67.68,45.2,44.99,151.23-35.36,165.24-10.87,1.9-10.31,2.09-18.71-6.25-8.16-8.1-8-8.17-4.75,2.22l1.64,5.26-4.77-.51c-7.24-.77-18.02-3.71-19.82-5.4-4.91-4.61-8.76-19.09-9.26-34.81-.18-5.6-.57-10.2-.87-10.23-3.89-.28-13.29,4.17-19.89,9.41-5.97,4.74-6.02,4.7-3.91-3.57,6.93-27.13,27.84-54.82,50.35-66.66l5.01-2.64-2.73-.51c-1.5-.28-5.67-.35-9.26-.14l-6.53.37,6.83-3.43c7.96-4,14.12-6.14,20.87-7.26,2.77-.46,4.82-1.16,4.82-1.64,0-3,19.12-26.83,21.52-26.83.35,0,.43,3.27.19,7.33-.55,9.09-.71,8.86,10.82,15.24,10.14,5.61,11.94,7.09,11.65,9.57-.35,3.02-2.34,2.57-4.44-1-2.17-3.7-4.25-4.99-9.58-5.96-4.45-.81-4.68-.56-3.68,3.9,1.24,5.55,4.55,7.99,13.36,9.85,10.08,2.14,26.65,9.16,26.14,11.07-.19.73.21,2.18.9,3.22,1.2,1.82,1.19,1.98-.18,3.83-4.8,6.48-11.34,7.82-18.59,3.82-15.61-8.62-25.89-12.19-36.77-12.79-10.3-.56-18.56,1.78-10.29,2.91,3.9.54,7.97,2.52,10.33,5.05l1.73,1.86h-3.52c-23.99.1-42.29,20.92-37.02,42.13,1.83,7.37,6.88,16.46,13.12,23.61,2.46,2.82,2.6,2.69,1.05-1.03-4.13-9.89-2.1-27.31,4-34.25,4.43-5.04,4.84-4.83,4.44,2.3-1.22,21.5,13.44,35.47,40.58,38.67,4.98.59,5.26.26,1.59-1.84-14.85-8.47-26.07-27.76-23.68-40.69,2.92-15.8,12.63-21.34,34.29-19.56l10.56.87,3.15-1.84c7.55-4.42,17.35-15.45,15.44-17.36-.58-.58-6.99-3.62-14.23-6.75l-13.18-5.69-.36-4.47c-.44-5.58-.41-5.53-6.84-9.87-4.85-3.27-5.31-3.79-5.31-6,0-6.16-3.48-18.85-4.93-17.96-.37.23-.9,3.95-1.18,8.27-.52,8.03-1.12,9.27-3.25,6.71-.68-.82-.96-3.68-.98-9.93-.03-9.38-.86-11.79-4.09-11.79-5.02,0-19.77,11.77-29.26,23.35-1.53,1.87-3.02,2.57-8.57,4.05-21.98,5.85-51.41,23.66-59.59,36.06-2.69,4.07-2.28,4.17,3.95.94,12.69-6.58,26.23-10.86,19.26-6.1-20.43,13.98-33.21,37.15-37.46,67.92-1.03,7.47,22.04,28.83,40.44,37.46,76.3,35.75,160.95-30.76,143.93-113.09C191.73,29.3,139.44-7.25,87.69,1.22" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
@ -66,4 +86,5 @@
|
|||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
152
pnpm-lock.yaml
152
pnpm-lock.yaml
|
@ -34,10 +34,10 @@ importers:
|
|||
version: 7.4.2(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.4(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.4)(reflect-metadata@0.2.2)(rxjs@7.8.1))(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)
|
||||
'@nestjs/terminus':
|
||||
specifier: ^10.2.3
|
||||
version: 10.2.3(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.4(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.4)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/typeorm@10.0.2(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.4(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.4)(reflect-metadata@0.2.2)(rxjs@7.8.1))(reflect-metadata@0.2.2)(rxjs@7.8.1)(typeorm@0.3.20(ioredis@5.4.1)(mysql2@3.11.3)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.3))))(reflect-metadata@0.2.2)(rxjs@7.8.1)(typeorm@0.3.20(ioredis@5.4.1)(mysql2@3.11.3)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.3)))
|
||||
version: 10.2.3(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.4(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.4)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/typeorm@10.0.2(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.4(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.4)(reflect-metadata@0.2.2)(rxjs@7.8.1))(reflect-metadata@0.2.2)(rxjs@7.8.1)(typeorm@0.3.20(ioredis@5.4.1)(mysql2@3.11.3)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.2))))(reflect-metadata@0.2.2)(rxjs@7.8.1)(typeorm@0.3.20(ioredis@5.4.1)(mysql2@3.11.3)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.2)))
|
||||
'@nestjs/typeorm':
|
||||
specifier: ^10.0.2
|
||||
version: 10.0.2(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.4(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.4)(reflect-metadata@0.2.2)(rxjs@7.8.1))(reflect-metadata@0.2.2)(rxjs@7.8.1)(typeorm@0.3.20(ioredis@5.4.1)(mysql2@3.11.3)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.3)))
|
||||
version: 10.0.2(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.4(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.4)(reflect-metadata@0.2.2)(rxjs@7.8.1))(reflect-metadata@0.2.2)(rxjs@7.8.1)(typeorm@0.3.20(ioredis@5.4.1)(mysql2@3.11.3)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.2)))
|
||||
'@opentelemetry/api':
|
||||
specifier: ^1.9.0
|
||||
version: 1.9.0
|
||||
|
@ -85,7 +85,7 @@ importers:
|
|||
version: 6.1.1(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.4(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.4)(reflect-metadata@0.2.2)(rxjs@7.8.1))
|
||||
nestjs-postal-client:
|
||||
specifier: ^0.0.6
|
||||
version: 0.0.6(jrcpsu45e3dhzjv3azmojl75yy)
|
||||
version: 0.0.6(jdf445rhtpddlny4lqmttufnfe)
|
||||
oidc-provider:
|
||||
specifier: ^8.5.1
|
||||
version: 8.5.1
|
||||
|
@ -103,10 +103,10 @@ importers:
|
|||
version: 7.8.1
|
||||
typeorm:
|
||||
specifier: ^0.3.20
|
||||
version: 0.3.20(ioredis@5.4.1)(mysql2@3.11.3)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.3))
|
||||
version: 0.3.20(ioredis@5.4.1)(mysql2@3.11.3)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.2))
|
||||
typia:
|
||||
specifier: ^6.11.2
|
||||
version: 6.11.2(typescript@5.6.3)
|
||||
version: 6.11.2(typescript@5.6.2)
|
||||
uuid:
|
||||
specifier: ^10.0.0
|
||||
version: 10.0.0
|
||||
|
@ -119,7 +119,7 @@ importers:
|
|||
version: 10.4.5
|
||||
'@nestjs/schematics':
|
||||
specifier: ^10.1.4
|
||||
version: 10.1.4(chokidar@3.6.0)(typescript@5.6.3)
|
||||
version: 10.1.4(chokidar@3.6.0)(typescript@5.6.2)
|
||||
'@nestjs/testing':
|
||||
specifier: ^10.4.4
|
||||
version: 10.4.4(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.4(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.4)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.4(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.4))
|
||||
|
@ -146,10 +146,10 @@ importers:
|
|||
version: 6.0.2
|
||||
'@typescript-eslint/eslint-plugin':
|
||||
specifier: ^7.18.0
|
||||
version: 7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1)(typescript@5.6.3)
|
||||
version: 7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.6.2))(eslint@8.57.1)(typescript@5.6.2)
|
||||
'@typescript-eslint/parser':
|
||||
specifier: ^7.18.0
|
||||
version: 7.18.0(eslint@8.57.1)(typescript@5.6.3)
|
||||
version: 7.18.0(eslint@8.57.1)(typescript@5.6.2)
|
||||
eslint:
|
||||
specifier: ^8.57.1
|
||||
version: 8.57.1
|
||||
|
@ -161,7 +161,7 @@ importers:
|
|||
version: 5.2.1(@types/eslint@9.6.0)(eslint-config-prettier@9.1.0(eslint@8.57.1))(eslint@8.57.1)(prettier@3.3.3)
|
||||
jest:
|
||||
specifier: ^29.7.0
|
||||
version: 29.7.0(@types/node@20.16.11)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.3))
|
||||
version: 29.7.0(@types/node@20.16.11)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.2))
|
||||
prettier:
|
||||
specifier: ^3.3.3
|
||||
version: 3.3.3
|
||||
|
@ -176,16 +176,16 @@ importers:
|
|||
version: 7.0.0
|
||||
tailwindcss:
|
||||
specifier: ^3.4.14
|
||||
version: 3.4.14(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.3))
|
||||
version: 3.4.14(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.2))
|
||||
ts-jest:
|
||||
specifier: ^29.2.5
|
||||
version: 29.2.5(@babel/core@7.25.8)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.8))(jest@29.7.0(@types/node@20.16.11)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.3)))(typescript@5.6.3)
|
||||
version: 29.2.5(@babel/core@7.25.8)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.8))(jest@29.7.0(@types/node@20.16.11)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.2)))(typescript@5.6.2)
|
||||
ts-loader:
|
||||
specifier: ^9.5.1
|
||||
version: 9.5.1(typescript@5.6.3)(webpack@5.94.0)
|
||||
version: 9.5.1(typescript@5.6.2)(webpack@5.94.0)
|
||||
ts-node:
|
||||
specifier: ^10.9.2
|
||||
version: 10.9.2(@types/node@20.16.11)(typescript@5.6.3)
|
||||
version: 10.9.2(@types/node@20.16.11)(typescript@5.6.2)
|
||||
ts-patch:
|
||||
specifier: ^3.2.1
|
||||
version: 3.2.1
|
||||
|
@ -193,8 +193,8 @@ importers:
|
|||
specifier: ^4.2.0
|
||||
version: 4.2.0
|
||||
typescript:
|
||||
specifier: ^5.6.3
|
||||
version: 5.6.3
|
||||
specifier: ^5.6.2
|
||||
version: 5.6.2
|
||||
|
||||
packages:
|
||||
|
||||
|
@ -3974,8 +3974,8 @@ packages:
|
|||
engines: {node: '>=14.17'}
|
||||
hasBin: true
|
||||
|
||||
typescript@5.6.3:
|
||||
resolution: {integrity: sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==}
|
||||
typescript@5.6.2:
|
||||
resolution: {integrity: sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==}
|
||||
engines: {node: '>=14.17'}
|
||||
hasBin: true
|
||||
|
||||
|
@ -4514,7 +4514,7 @@ snapshots:
|
|||
jest-util: 29.7.0
|
||||
slash: 3.0.0
|
||||
|
||||
'@jest/core@29.7.0(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.3))':
|
||||
'@jest/core@29.7.0(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.2))':
|
||||
dependencies:
|
||||
'@jest/console': 29.7.0
|
||||
'@jest/reporters': 29.7.0
|
||||
|
@ -4528,7 +4528,7 @@ snapshots:
|
|||
exit: 0.1.2
|
||||
graceful-fs: 4.2.11
|
||||
jest-changed-files: 29.7.0
|
||||
jest-config: 29.7.0(@types/node@20.16.11)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.3))
|
||||
jest-config: 29.7.0(@types/node@20.16.11)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.2))
|
||||
jest-haste-map: 29.7.0
|
||||
jest-message-util: 29.7.0
|
||||
jest-regex-util: 29.6.3
|
||||
|
@ -4847,14 +4847,14 @@ snapshots:
|
|||
transitivePeerDependencies:
|
||||
- chokidar
|
||||
|
||||
'@nestjs/schematics@10.1.4(chokidar@3.6.0)(typescript@5.6.3)':
|
||||
'@nestjs/schematics@10.1.4(chokidar@3.6.0)(typescript@5.6.2)':
|
||||
dependencies:
|
||||
'@angular-devkit/core': 17.3.8(chokidar@3.6.0)
|
||||
'@angular-devkit/schematics': 17.3.8(chokidar@3.6.0)
|
||||
comment-json: 4.2.3
|
||||
jsonc-parser: 3.3.1
|
||||
pluralize: 8.0.0
|
||||
typescript: 5.6.3
|
||||
typescript: 5.6.2
|
||||
transitivePeerDependencies:
|
||||
- chokidar
|
||||
|
||||
|
@ -4882,7 +4882,7 @@ snapshots:
|
|||
class-transformer: 0.5.1
|
||||
class-validator: 0.14.1
|
||||
|
||||
'@nestjs/terminus@10.2.3(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.4(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.4)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/typeorm@10.0.2(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.4(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.4)(reflect-metadata@0.2.2)(rxjs@7.8.1))(reflect-metadata@0.2.2)(rxjs@7.8.1)(typeorm@0.3.20(ioredis@5.4.1)(mysql2@3.11.3)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.3))))(reflect-metadata@0.2.2)(rxjs@7.8.1)(typeorm@0.3.20(ioredis@5.4.1)(mysql2@3.11.3)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.3)))':
|
||||
'@nestjs/terminus@10.2.3(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.4(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.4)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/typeorm@10.0.2(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.4(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.4)(reflect-metadata@0.2.2)(rxjs@7.8.1))(reflect-metadata@0.2.2)(rxjs@7.8.1)(typeorm@0.3.20(ioredis@5.4.1)(mysql2@3.11.3)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.2))))(reflect-metadata@0.2.2)(rxjs@7.8.1)(typeorm@0.3.20(ioredis@5.4.1)(mysql2@3.11.3)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.2)))':
|
||||
dependencies:
|
||||
'@nestjs/common': 10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1)
|
||||
'@nestjs/core': 10.4.4(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.4)(reflect-metadata@0.2.2)(rxjs@7.8.1)
|
||||
|
@ -4891,8 +4891,8 @@ snapshots:
|
|||
reflect-metadata: 0.2.2
|
||||
rxjs: 7.8.1
|
||||
optionalDependencies:
|
||||
'@nestjs/typeorm': 10.0.2(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.4(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.4)(reflect-metadata@0.2.2)(rxjs@7.8.1))(reflect-metadata@0.2.2)(rxjs@7.8.1)(typeorm@0.3.20(ioredis@5.4.1)(mysql2@3.11.3)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.3)))
|
||||
typeorm: 0.3.20(ioredis@5.4.1)(mysql2@3.11.3)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.3))
|
||||
'@nestjs/typeorm': 10.0.2(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.4(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.4)(reflect-metadata@0.2.2)(rxjs@7.8.1))(reflect-metadata@0.2.2)(rxjs@7.8.1)(typeorm@0.3.20(ioredis@5.4.1)(mysql2@3.11.3)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.2)))
|
||||
typeorm: 0.3.20(ioredis@5.4.1)(mysql2@3.11.3)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.2))
|
||||
|
||||
'@nestjs/testing@10.4.4(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.4(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.4)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.4(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.4))':
|
||||
dependencies:
|
||||
|
@ -4902,13 +4902,13 @@ snapshots:
|
|||
optionalDependencies:
|
||||
'@nestjs/platform-express': 10.4.4(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.4)
|
||||
|
||||
'@nestjs/typeorm@10.0.2(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.4(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.4)(reflect-metadata@0.2.2)(rxjs@7.8.1))(reflect-metadata@0.2.2)(rxjs@7.8.1)(typeorm@0.3.20(ioredis@5.4.1)(mysql2@3.11.3)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.3)))':
|
||||
'@nestjs/typeorm@10.0.2(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.4(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.4)(reflect-metadata@0.2.2)(rxjs@7.8.1))(reflect-metadata@0.2.2)(rxjs@7.8.1)(typeorm@0.3.20(ioredis@5.4.1)(mysql2@3.11.3)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.2)))':
|
||||
dependencies:
|
||||
'@nestjs/common': 10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1)
|
||||
'@nestjs/core': 10.4.4(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.4)(reflect-metadata@0.2.2)(rxjs@7.8.1)
|
||||
reflect-metadata: 0.2.2
|
||||
rxjs: 7.8.1
|
||||
typeorm: 0.3.20(ioredis@5.4.1)(mysql2@3.11.3)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.3))
|
||||
typeorm: 0.3.20(ioredis@5.4.1)(mysql2@3.11.3)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.2))
|
||||
uuid: 9.0.1
|
||||
|
||||
'@nodelib/fs.scandir@2.1.5':
|
||||
|
@ -5160,34 +5160,34 @@ snapshots:
|
|||
dependencies:
|
||||
'@types/yargs-parser': 21.0.3
|
||||
|
||||
'@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1)(typescript@5.6.3)':
|
||||
'@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.6.2))(eslint@8.57.1)(typescript@5.6.2)':
|
||||
dependencies:
|
||||
'@eslint-community/regexpp': 4.11.1
|
||||
'@typescript-eslint/parser': 7.18.0(eslint@8.57.1)(typescript@5.6.3)
|
||||
'@typescript-eslint/parser': 7.18.0(eslint@8.57.1)(typescript@5.6.2)
|
||||
'@typescript-eslint/scope-manager': 7.18.0
|
||||
'@typescript-eslint/type-utils': 7.18.0(eslint@8.57.1)(typescript@5.6.3)
|
||||
'@typescript-eslint/utils': 7.18.0(eslint@8.57.1)(typescript@5.6.3)
|
||||
'@typescript-eslint/type-utils': 7.18.0(eslint@8.57.1)(typescript@5.6.2)
|
||||
'@typescript-eslint/utils': 7.18.0(eslint@8.57.1)(typescript@5.6.2)
|
||||
'@typescript-eslint/visitor-keys': 7.18.0
|
||||
eslint: 8.57.1
|
||||
graphemer: 1.4.0
|
||||
ignore: 5.3.2
|
||||
natural-compare: 1.4.0
|
||||
ts-api-utils: 1.3.0(typescript@5.6.3)
|
||||
ts-api-utils: 1.3.0(typescript@5.6.2)
|
||||
optionalDependencies:
|
||||
typescript: 5.6.3
|
||||
typescript: 5.6.2
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.6.3)':
|
||||
'@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.6.2)':
|
||||
dependencies:
|
||||
'@typescript-eslint/scope-manager': 7.18.0
|
||||
'@typescript-eslint/types': 7.18.0
|
||||
'@typescript-eslint/typescript-estree': 7.18.0(typescript@5.6.3)
|
||||
'@typescript-eslint/typescript-estree': 7.18.0(typescript@5.6.2)
|
||||
'@typescript-eslint/visitor-keys': 7.18.0
|
||||
debug: 4.3.7
|
||||
eslint: 8.57.1
|
||||
optionalDependencies:
|
||||
typescript: 5.6.3
|
||||
typescript: 5.6.2
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
|
@ -5196,21 +5196,21 @@ snapshots:
|
|||
'@typescript-eslint/types': 7.18.0
|
||||
'@typescript-eslint/visitor-keys': 7.18.0
|
||||
|
||||
'@typescript-eslint/type-utils@7.18.0(eslint@8.57.1)(typescript@5.6.3)':
|
||||
'@typescript-eslint/type-utils@7.18.0(eslint@8.57.1)(typescript@5.6.2)':
|
||||
dependencies:
|
||||
'@typescript-eslint/typescript-estree': 7.18.0(typescript@5.6.3)
|
||||
'@typescript-eslint/utils': 7.18.0(eslint@8.57.1)(typescript@5.6.3)
|
||||
'@typescript-eslint/typescript-estree': 7.18.0(typescript@5.6.2)
|
||||
'@typescript-eslint/utils': 7.18.0(eslint@8.57.1)(typescript@5.6.2)
|
||||
debug: 4.3.7
|
||||
eslint: 8.57.1
|
||||
ts-api-utils: 1.3.0(typescript@5.6.3)
|
||||
ts-api-utils: 1.3.0(typescript@5.6.2)
|
||||
optionalDependencies:
|
||||
typescript: 5.6.3
|
||||
typescript: 5.6.2
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/types@7.18.0': {}
|
||||
|
||||
'@typescript-eslint/typescript-estree@7.18.0(typescript@5.6.3)':
|
||||
'@typescript-eslint/typescript-estree@7.18.0(typescript@5.6.2)':
|
||||
dependencies:
|
||||
'@typescript-eslint/types': 7.18.0
|
||||
'@typescript-eslint/visitor-keys': 7.18.0
|
||||
|
@ -5219,18 +5219,18 @@ snapshots:
|
|||
is-glob: 4.0.3
|
||||
minimatch: 9.0.5
|
||||
semver: 7.6.3
|
||||
ts-api-utils: 1.3.0(typescript@5.6.3)
|
||||
ts-api-utils: 1.3.0(typescript@5.6.2)
|
||||
optionalDependencies:
|
||||
typescript: 5.6.3
|
||||
typescript: 5.6.2
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/utils@7.18.0(eslint@8.57.1)(typescript@5.6.3)':
|
||||
'@typescript-eslint/utils@7.18.0(eslint@8.57.1)(typescript@5.6.2)':
|
||||
dependencies:
|
||||
'@eslint-community/eslint-utils': 4.4.0(eslint@8.57.1)
|
||||
'@typescript-eslint/scope-manager': 7.18.0
|
||||
'@typescript-eslint/types': 7.18.0
|
||||
'@typescript-eslint/typescript-estree': 7.18.0(typescript@5.6.3)
|
||||
'@typescript-eslint/typescript-estree': 7.18.0(typescript@5.6.2)
|
||||
eslint: 8.57.1
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
@ -5884,13 +5884,13 @@ snapshots:
|
|||
optionalDependencies:
|
||||
typescript: 5.3.3
|
||||
|
||||
create-jest@29.7.0(@types/node@20.16.11)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.3)):
|
||||
create-jest@29.7.0(@types/node@20.16.11)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.2)):
|
||||
dependencies:
|
||||
'@jest/types': 29.6.3
|
||||
chalk: 4.1.2
|
||||
exit: 0.1.2
|
||||
graceful-fs: 4.2.11
|
||||
jest-config: 29.7.0(@types/node@20.16.11)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.3))
|
||||
jest-config: 29.7.0(@types/node@20.16.11)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.2))
|
||||
jest-util: 29.7.0
|
||||
prompts: 2.4.2
|
||||
transitivePeerDependencies:
|
||||
|
@ -6851,16 +6851,16 @@ snapshots:
|
|||
- babel-plugin-macros
|
||||
- supports-color
|
||||
|
||||
jest-cli@29.7.0(@types/node@20.16.11)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.3)):
|
||||
jest-cli@29.7.0(@types/node@20.16.11)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.2)):
|
||||
dependencies:
|
||||
'@jest/core': 29.7.0(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.3))
|
||||
'@jest/core': 29.7.0(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.2))
|
||||
'@jest/test-result': 29.7.0
|
||||
'@jest/types': 29.6.3
|
||||
chalk: 4.1.2
|
||||
create-jest: 29.7.0(@types/node@20.16.11)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.3))
|
||||
create-jest: 29.7.0(@types/node@20.16.11)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.2))
|
||||
exit: 0.1.2
|
||||
import-local: 3.2.0
|
||||
jest-config: 29.7.0(@types/node@20.16.11)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.3))
|
||||
jest-config: 29.7.0(@types/node@20.16.11)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.2))
|
||||
jest-util: 29.7.0
|
||||
jest-validate: 29.7.0
|
||||
yargs: 17.7.2
|
||||
|
@ -6870,7 +6870,7 @@ snapshots:
|
|||
- supports-color
|
||||
- ts-node
|
||||
|
||||
jest-config@29.7.0(@types/node@20.16.11)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.3)):
|
||||
jest-config@29.7.0(@types/node@20.16.11)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.2)):
|
||||
dependencies:
|
||||
'@babel/core': 7.25.8
|
||||
'@jest/test-sequencer': 29.7.0
|
||||
|
@ -6896,7 +6896,7 @@ snapshots:
|
|||
strip-json-comments: 3.1.1
|
||||
optionalDependencies:
|
||||
'@types/node': 20.16.11
|
||||
ts-node: 10.9.2(@types/node@20.16.11)(typescript@5.6.3)
|
||||
ts-node: 10.9.2(@types/node@20.16.11)(typescript@5.6.2)
|
||||
transitivePeerDependencies:
|
||||
- babel-plugin-macros
|
||||
- supports-color
|
||||
|
@ -7122,12 +7122,12 @@ snapshots:
|
|||
merge-stream: 2.0.0
|
||||
supports-color: 8.1.1
|
||||
|
||||
jest@29.7.0(@types/node@20.16.11)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.3)):
|
||||
jest@29.7.0(@types/node@20.16.11)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.2)):
|
||||
dependencies:
|
||||
'@jest/core': 29.7.0(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.3))
|
||||
'@jest/core': 29.7.0(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.2))
|
||||
'@jest/types': 29.6.3
|
||||
import-local: 3.2.0
|
||||
jest-cli: 29.7.0(@types/node@20.16.11)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.3))
|
||||
jest-cli: 29.7.0(@types/node@20.16.11)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.2))
|
||||
transitivePeerDependencies:
|
||||
- '@types/node'
|
||||
- babel-plugin-macros
|
||||
|
@ -7484,7 +7484,7 @@ snapshots:
|
|||
'@opentelemetry/host-metrics': 0.35.4(@opentelemetry/api@1.9.0)
|
||||
response-time: 2.3.3
|
||||
|
||||
nestjs-postal-client@0.0.6(jrcpsu45e3dhzjv3azmojl75yy):
|
||||
nestjs-postal-client@0.0.6(jdf445rhtpddlny4lqmttufnfe):
|
||||
dependencies:
|
||||
'@nestjs/cache-manager': 2.2.2(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.4(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.4)(reflect-metadata@0.2.2)(rxjs@7.8.1))(cache-manager@5.7.2)(rxjs@7.8.1)
|
||||
'@nestjs/common': 10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1)
|
||||
|
@ -7495,7 +7495,7 @@ snapshots:
|
|||
kakious-nestjs-http-promise: 0.0.1(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(axios@1.7.2)
|
||||
nestjs-cls: 4.4.1(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.4(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.4)(reflect-metadata@0.2.2)(rxjs@7.8.1))(reflect-metadata@0.2.2)(rxjs@7.8.1)
|
||||
nestjs-otel: 6.1.1(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.4(@nestjs/common@10.4.4(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.4)(reflect-metadata@0.2.2)(rxjs@7.8.1))
|
||||
typia: 6.11.2(typescript@5.6.3)
|
||||
typia: 6.11.2(typescript@5.6.2)
|
||||
transitivePeerDependencies:
|
||||
- typescript
|
||||
|
||||
|
@ -7719,13 +7719,13 @@ snapshots:
|
|||
camelcase-css: 2.0.1
|
||||
postcss: 8.4.47
|
||||
|
||||
postcss-load-config@4.0.2(postcss@8.4.47)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.3)):
|
||||
postcss-load-config@4.0.2(postcss@8.4.47)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.2)):
|
||||
dependencies:
|
||||
lilconfig: 3.1.2
|
||||
yaml: 2.6.0
|
||||
optionalDependencies:
|
||||
postcss: 8.4.47
|
||||
ts-node: 10.9.2(@types/node@20.16.11)(typescript@5.6.3)
|
||||
ts-node: 10.9.2(@types/node@20.16.11)(typescript@5.6.2)
|
||||
|
||||
postcss-nested@6.2.0(postcss@8.4.47):
|
||||
dependencies:
|
||||
|
@ -8227,7 +8227,7 @@ snapshots:
|
|||
|
||||
systeminformation@5.22.9: {}
|
||||
|
||||
tailwindcss@3.4.14(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.3)):
|
||||
tailwindcss@3.4.14(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.2)):
|
||||
dependencies:
|
||||
'@alloc/quick-lru': 5.2.0
|
||||
arg: 5.0.2
|
||||
|
@ -8246,7 +8246,7 @@ snapshots:
|
|||
postcss: 8.4.47
|
||||
postcss-import: 15.1.0(postcss@8.4.47)
|
||||
postcss-js: 4.0.1(postcss@8.4.47)
|
||||
postcss-load-config: 4.0.2(postcss@8.4.47)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.3))
|
||||
postcss-load-config: 4.0.2(postcss@8.4.47)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.2))
|
||||
postcss-nested: 6.2.0(postcss@8.4.47)
|
||||
postcss-selector-parser: 6.1.2
|
||||
resolve: 1.22.8
|
||||
|
@ -8321,24 +8321,24 @@ snapshots:
|
|||
|
||||
tree-kill@1.2.2: {}
|
||||
|
||||
ts-api-utils@1.3.0(typescript@5.6.3):
|
||||
ts-api-utils@1.3.0(typescript@5.6.2):
|
||||
dependencies:
|
||||
typescript: 5.6.3
|
||||
typescript: 5.6.2
|
||||
|
||||
ts-interface-checker@0.1.13: {}
|
||||
|
||||
ts-jest@29.2.5(@babel/core@7.25.8)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.8))(jest@29.7.0(@types/node@20.16.11)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.3)))(typescript@5.6.3):
|
||||
ts-jest@29.2.5(@babel/core@7.25.8)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.8))(jest@29.7.0(@types/node@20.16.11)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.2)))(typescript@5.6.2):
|
||||
dependencies:
|
||||
bs-logger: 0.2.6
|
||||
ejs: 3.1.10
|
||||
fast-json-stable-stringify: 2.1.0
|
||||
jest: 29.7.0(@types/node@20.16.11)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.3))
|
||||
jest: 29.7.0(@types/node@20.16.11)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.2))
|
||||
jest-util: 29.7.0
|
||||
json5: 2.2.3
|
||||
lodash.memoize: 4.1.2
|
||||
make-error: 1.3.6
|
||||
semver: 7.6.3
|
||||
typescript: 5.6.3
|
||||
typescript: 5.6.2
|
||||
yargs-parser: 21.1.1
|
||||
optionalDependencies:
|
||||
'@babel/core': 7.25.8
|
||||
|
@ -8346,17 +8346,17 @@ snapshots:
|
|||
'@jest/types': 29.6.3
|
||||
babel-jest: 29.7.0(@babel/core@7.25.8)
|
||||
|
||||
ts-loader@9.5.1(typescript@5.6.3)(webpack@5.94.0):
|
||||
ts-loader@9.5.1(typescript@5.6.2)(webpack@5.94.0):
|
||||
dependencies:
|
||||
chalk: 4.1.2
|
||||
enhanced-resolve: 5.17.1
|
||||
micromatch: 4.0.8
|
||||
semver: 7.6.3
|
||||
source-map: 0.7.4
|
||||
typescript: 5.6.3
|
||||
typescript: 5.6.2
|
||||
webpack: 5.94.0
|
||||
|
||||
ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.3):
|
||||
ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.2):
|
||||
dependencies:
|
||||
'@cspotcode/source-map-support': 0.8.1
|
||||
'@tsconfig/node10': 1.0.11
|
||||
|
@ -8370,7 +8370,7 @@ snapshots:
|
|||
create-require: 1.1.1
|
||||
diff: 4.0.2
|
||||
make-error: 1.3.6
|
||||
typescript: 5.6.3
|
||||
typescript: 5.6.2
|
||||
v8-compile-cache-lib: 3.0.1
|
||||
yn: 3.1.1
|
||||
|
||||
|
@ -8422,7 +8422,7 @@ snapshots:
|
|||
|
||||
typedarray@0.0.6: {}
|
||||
|
||||
typeorm@0.3.20(ioredis@5.4.1)(mysql2@3.11.3)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.3)):
|
||||
typeorm@0.3.20(ioredis@5.4.1)(mysql2@3.11.3)(ts-node@10.9.2(@types/node@20.16.11)(typescript@5.6.2)):
|
||||
dependencies:
|
||||
'@sqltools/formatter': 1.2.5
|
||||
app-root-path: 3.1.0
|
||||
|
@ -8442,15 +8442,15 @@ snapshots:
|
|||
optionalDependencies:
|
||||
ioredis: 5.4.1
|
||||
mysql2: 3.11.3
|
||||
ts-node: 10.9.2(@types/node@20.16.11)(typescript@5.6.3)
|
||||
ts-node: 10.9.2(@types/node@20.16.11)(typescript@5.6.2)
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
typescript@5.3.3: {}
|
||||
|
||||
typescript@5.6.3: {}
|
||||
typescript@5.6.2: {}
|
||||
|
||||
typia@6.11.2(typescript@5.6.3):
|
||||
typia@6.11.2(typescript@5.6.2):
|
||||
dependencies:
|
||||
'@samchon/openapi': 1.1.1
|
||||
commander: 10.0.1
|
||||
|
@ -8458,7 +8458,7 @@ snapshots:
|
|||
inquirer: 8.2.6
|
||||
package-manager-detector: 0.2.2
|
||||
randexp: 0.5.3
|
||||
typescript: 5.6.3
|
||||
typescript: 5.6.2
|
||||
|
||||
uglify-js@3.19.3:
|
||||
optional: true
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { Controller, Get, Redirect, UseGuards } from '@nestjs/common';
|
||||
import { AppService } from './app.service';
|
||||
import { LoginGuard } from './auth/guard/login.guard';
|
||||
import { MailService } from './mail/mail.service';
|
||||
import { ViewLoginGuard } from './auth/guard/viewLogin.guard';
|
||||
import { MailService } from './mail/service/mail.service';
|
||||
import { ApiExcludeController } from '@nestjs/swagger';
|
||||
|
||||
@Controller()
|
||||
|
@ -14,7 +14,7 @@ export class AppController {
|
|||
|
||||
@Get()
|
||||
@Redirect('/auth/login')
|
||||
@UseGuards(LoginGuard)
|
||||
@UseGuards(ViewLoginGuard)
|
||||
getHello(): any {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -29,3 +29,10 @@ export const REGISTRATION_EXPIRATION = 60 * 60 * 24; // 24 hours
|
|||
export const REGISTRATION_LIMIT = 10;
|
||||
|
||||
export const getRegistrationKey = (ip: string): string => `${REGISTRATION_CACHE_KEY}${ip}`;
|
||||
|
||||
export enum AuthMethods {
|
||||
ClientSecret = 'ClientSecret',
|
||||
Session = 'Session',
|
||||
AccessToken = 'AccessToken',
|
||||
APIToken = 'APIToken',
|
||||
}
|
||||
|
|
|
@ -5,8 +5,8 @@ import { AuthService } from '../services/auth.service';
|
|||
import { ForgotPasswordDto } from '../dto/forgotPassword.dto';
|
||||
import { CreateUserDto } from '../dto/register.dto';
|
||||
import { LoginUserDto } from '../dto/loginUser.dto';
|
||||
import { User } from '../decorators/user.decorator';
|
||||
import { LoginGuard } from '../guard/login.guard';
|
||||
import { CurrentUser } from '../decorators/user.decorator';
|
||||
import { ViewLoginGuard } from '../guard/viewLogin.guard';
|
||||
import { Response, Request } from 'express';
|
||||
import { LoginResponse } from '../dto/loginResponse.dto';
|
||||
|
||||
|
@ -51,7 +51,7 @@ export class AuthController {
|
|||
// ==== Render pages ==== //
|
||||
|
||||
@Get('verify-email')
|
||||
@UseGuards(LoginGuard)
|
||||
@UseGuards(ViewLoginGuard)
|
||||
@ApiExcludeEndpoint()
|
||||
public async verifyEmail(@Res() response: Response, @Query('code') code: string): Promise<any> {
|
||||
if (!code) {
|
||||
|
|
|
@ -12,12 +12,12 @@ import { ApiExcludeController } from '@nestjs/swagger';
|
|||
|
||||
import { AuthService } from '../services/auth.service';
|
||||
|
||||
import { User } from '../decorators/user.decorator';
|
||||
import { CurrentUser } from '../decorators/user.decorator';
|
||||
import { Request, Response } from 'express';
|
||||
import { InteractionService } from '../oidc/service/interaction.service';
|
||||
import { OidcService } from '../oidc/service/core.service';
|
||||
import { InteractionParams, InteractionSession } from '../oidc/types/interaction.type';
|
||||
import { User as UserObject } from 'src/database/models/user.model';
|
||||
import { User } from '../../database/models/user.model';
|
||||
|
||||
@Controller('interaction')
|
||||
@ApiExcludeController()
|
||||
|
@ -31,7 +31,7 @@ export class InteractionController {
|
|||
logger = new Logger(InteractionController.name);
|
||||
|
||||
@Get(':id')
|
||||
async getUserInteraction(@Res() res: Response, @Req() req: Request, @User() user: UserObject) {
|
||||
async getUserInteraction(@Res() res: Response, @Req() req: Request, @CurrentUser() user: User) {
|
||||
const details: {
|
||||
session?: InteractionSession;
|
||||
uid: string;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { createParamDecorator } from '@nestjs/common';
|
||||
import { ClsServiceManager } from 'nestjs-cls';
|
||||
import { User as UserObject } from 'src/database/models/user.model';
|
||||
import { User } from 'src/database/models/user.model';
|
||||
|
||||
export const User = createParamDecorator((): UserObject | null => {
|
||||
export const CurrentUser = createParamDecorator((): User | null => {
|
||||
const cls = ClsServiceManager.getClsService();
|
||||
const authType = cls.get('authType');
|
||||
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
import { Injectable, CanActivate, ExecutionContext } from '@nestjs/common';
|
||||
import { ClsService } from 'nestjs-cls';
|
||||
import { Observable } from 'rxjs';
|
||||
import { Response } from 'express';
|
||||
|
||||
@Injectable()
|
||||
export class APILoginGuard implements CanActivate {
|
||||
constructor(private readonly clsService: ClsService) {}
|
||||
canActivate(context: ExecutionContext): boolean | Promise<boolean> | Observable<boolean> {
|
||||
const authType = this.clsService.get('authType');
|
||||
const response = context.switchToHttp().getResponse() as Response;
|
||||
|
||||
if (authType === 'session') {
|
||||
response.redirect('/home');
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -4,17 +4,34 @@ import { Observable } from 'rxjs';
|
|||
import { Response } from 'express';
|
||||
|
||||
@Injectable()
|
||||
export class LoginGuard implements CanActivate {
|
||||
export class ViewLoginGuard implements CanActivate {
|
||||
constructor(private readonly clsService: ClsService) {}
|
||||
canActivate(context: ExecutionContext): boolean | Promise<boolean> | Observable<boolean> {
|
||||
const authType = this.clsService.get('authType');
|
||||
const response = context.switchToHttp().getResponse() as Response;
|
||||
|
||||
console.log('test');
|
||||
if (authType === 'session') {
|
||||
response.redirect('/auth/auth-test');
|
||||
return false;
|
||||
const loginPages = [
|
||||
'/auth/login',
|
||||
'/auth/forgot-password',
|
||||
'/auth/reset-password',
|
||||
'/auth/register',
|
||||
'/auth/verify-email',
|
||||
'/',
|
||||
];
|
||||
|
||||
if (loginPages.includes(context.switchToHttp().getRequest().url)) {
|
||||
if (authType === 'session') {
|
||||
response.redirect('/home');
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
|
||||
if (authType === 'session') {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
30
src/auth/interceptors/selfReflection.interceptor.ts
Normal file
30
src/auth/interceptors/selfReflection.interceptor.ts
Normal file
|
@ -0,0 +1,30 @@
|
|||
import {
|
||||
BadRequestException,
|
||||
CallHandler,
|
||||
ExecutionContext,
|
||||
Injectable,
|
||||
NestInterceptor,
|
||||
} from '@nestjs/common';
|
||||
import { Observable, throwError } from 'rxjs';
|
||||
|
||||
import { AuthMethods } from '../auth.const';
|
||||
import { ClsService } from 'nestjs-cls';
|
||||
|
||||
@Injectable()
|
||||
export class UserSelfReflection implements NestInterceptor {
|
||||
constructor(private readonly clsService: ClsService) {}
|
||||
|
||||
intercept(context: ExecutionContext, next: CallHandler): Observable<any> {
|
||||
const request = context.switchToHttp().getRequest();
|
||||
const authType = this.clsService.get('authType');
|
||||
if (request.params.id === '@me' && request.path.includes('/user/')) {
|
||||
if (authType === AuthMethods.ClientSecret) {
|
||||
return throwError(
|
||||
() => new BadRequestException('Unable to use @me without User Auth Session'),
|
||||
);
|
||||
}
|
||||
request.params.id = this.clsService.get('user').id;
|
||||
}
|
||||
return next.handle().pipe();
|
||||
}
|
||||
}
|
|
@ -8,7 +8,7 @@ import { Response, Request } from 'express';
|
|||
|
||||
import { UserService } from '../../user/service/user.service';
|
||||
import { RedisService } from '../../redis/service/redis.service';
|
||||
import { MailService } from '../../mail/mail.service';
|
||||
import { MailService } from '../../mail/service/mail.service';
|
||||
import {
|
||||
getEmailVerifyKey,
|
||||
getResetKey,
|
||||
|
|
|
@ -9,5 +9,6 @@ export default async () => ({
|
|||
port: process.env['REDIS_POST'] ?? 6379,
|
||||
password: process.env['REDIS_PASSWORD'] ?? '',
|
||||
db: process.env['REDIS_DB'] ?? 0,
|
||||
searchDisabled: process.env['REDIS_SEARCH_DISABLED'] ?? false,
|
||||
},
|
||||
});
|
||||
|
|
|
@ -2,7 +2,7 @@ import { registerAs } from '@nestjs/config';
|
|||
import type { tags } from 'typia';
|
||||
import typia from 'typia';
|
||||
|
||||
import { validateOrThrow } from '../util/validation.util';
|
||||
import { validateOrThrow } from '../../util/validation.util';
|
||||
|
||||
export const POSTAL_CONFIG_KEY = 'postal';
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
import { Module } from '@nestjs/common';
|
||||
import { ConfigModule, ConfigService } from '@nestjs/config';
|
||||
import { PostalClientModule } from 'nestjs-postal-client';
|
||||
import postalConfig from './postal.config';
|
||||
import { PostalConfigService } from './postal_config.service';
|
||||
import { MailService } from './mail.service';
|
||||
import postalConfig from './config/postal.config';
|
||||
import { PostalConfigService } from './service/postal_config.service';
|
||||
import { MailService } from './service/mail.service';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
|
|
|
@ -3,8 +3,8 @@ import type { PostalModuleOptions, PostalModuleOptionsFactory } from 'nestjs-pos
|
|||
import { Injectable } from '@nestjs/common';
|
||||
import { ConfigService } from '@nestjs/config';
|
||||
|
||||
import type { PostalConfig } from './postal.config';
|
||||
import { POSTAL_CONFIG_KEY } from './postal.config';
|
||||
import type { PostalConfig } from '../config/postal.config';
|
||||
import { POSTAL_CONFIG_KEY } from '../config/postal.config';
|
||||
|
||||
@Injectable()
|
||||
export class PostalConfigService implements PostalModuleOptionsFactory {
|
|
@ -11,6 +11,8 @@ import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
|
|||
async function bootstrap() {
|
||||
const app = await NestFactory.create<NestExpressApplication>(AppModule);
|
||||
|
||||
app.disable('x-powered-by');
|
||||
|
||||
app.setGlobalPrefix('api', {
|
||||
exclude: [
|
||||
{ path: 'auth/login', method: RequestMethod.GET },
|
||||
|
|
|
@ -3,8 +3,8 @@ import { ApiOperation, ApiTags } from '@nestjs/swagger';
|
|||
import { OrganizationService } from '../service/organization.service';
|
||||
import { OrgSetFlagDto } from '../dto/orgSetFlag.dto';
|
||||
import { CreateOrgDto } from '../dto/orgCreate.dto';
|
||||
import { User as UserObject } from '../../database/models/user.model';
|
||||
import { User } from '../../auth/decorators/user.decorator';
|
||||
import { User } from '../../database/models/user.model';
|
||||
import { CurrentUser } from '../../auth/decorators/user.decorator';
|
||||
|
||||
@Controller('organization')
|
||||
@ApiTags('Organization')
|
||||
|
@ -41,7 +41,7 @@ export class OrganizationController {
|
|||
@Post()
|
||||
public async createOrganization(
|
||||
@Body() body: CreateOrgDto,
|
||||
@User() user: UserObject,
|
||||
@CurrentUser() user: User,
|
||||
): Promise<any> {
|
||||
return await this.organizationService.createOrganization(user.id, body);
|
||||
}
|
||||
|
|
1
src/redis/redis.const.ts
Normal file
1
src/redis/redis.const.ts
Normal file
|
@ -0,0 +1 @@
|
|||
export const REDIS_SEARCH_DISABLED_ERROR = `Search is disabled.`;
|
|
@ -1,14 +1,29 @@
|
|||
import { Injectable, Logger, OnApplicationBootstrap } from '@nestjs/common';
|
||||
import { BadRequestException, Injectable, Logger, OnApplicationBootstrap } from '@nestjs/common';
|
||||
|
||||
import { RedisService } from './redis.service';
|
||||
import { userCacheKey } from '../../user/user.constant';
|
||||
import { REDIS_SEARCH_DISABLED_ERROR } from '../redis.const';
|
||||
import { ConfigService } from '@nestjs/config';
|
||||
|
||||
@Injectable()
|
||||
export class SearchService implements OnApplicationBootstrap {
|
||||
private readonly logger = new Logger(SearchService.name);
|
||||
constructor(private readonly redisService: RedisService) {}
|
||||
|
||||
searchDisabled = true;
|
||||
|
||||
constructor(
|
||||
private readonly redisService: RedisService,
|
||||
private readonly configService: ConfigService,
|
||||
) {
|
||||
this.searchDisabled = this.configService.getOrThrow<boolean>('redis.searchDisabled');
|
||||
}
|
||||
async onApplicationBootstrap() {
|
||||
this.logger.debug('Checking Index in Redis Serch');
|
||||
if (this.searchDisabled) {
|
||||
this.logger.warn(REDIS_SEARCH_DISABLED_ERROR);
|
||||
return;
|
||||
}
|
||||
|
||||
this.logger.debug('Checking Index in Redis Search');
|
||||
|
||||
if (!(await this.checkIndexExists('idx:users'))) {
|
||||
this.logger.log('Created users redis index');
|
||||
|
@ -35,9 +50,12 @@ export class SearchService implements OnApplicationBootstrap {
|
|||
'TEXT',
|
||||
);
|
||||
}
|
||||
|
||||
this.logger.log('Redis Search Initialized');
|
||||
}
|
||||
|
||||
public async createIndex(indexName: string, keyPrefix: string, ...schema: string[]) {
|
||||
this.searchCheck();
|
||||
this.redisService.ioredis.call(
|
||||
'FT.CREATE',
|
||||
indexName,
|
||||
|
@ -57,6 +75,7 @@ export class SearchService implements OnApplicationBootstrap {
|
|||
* @returns boolean
|
||||
*/
|
||||
public async checkIndexExists(indexName: string): Promise<boolean> {
|
||||
this.searchCheck();
|
||||
try {
|
||||
await this.redisService.ioredis.call('FT.INFO', indexName);
|
||||
return true;
|
||||
|
@ -67,7 +86,15 @@ export class SearchService implements OnApplicationBootstrap {
|
|||
}
|
||||
}
|
||||
|
||||
public async search(index: string, searchQuery: string, field?: string) {
|
||||
public async search(
|
||||
index: string,
|
||||
searchQuery: string,
|
||||
field?: string,
|
||||
): Promise<{
|
||||
totalResults: number;
|
||||
results: any[];
|
||||
}> {
|
||||
this.searchCheck();
|
||||
let query: string = '';
|
||||
|
||||
searchQuery = searchQuery.replace(/[.@\\]/g, '\\$&');
|
||||
|
@ -83,7 +110,10 @@ export class SearchService implements OnApplicationBootstrap {
|
|||
const redisSearch = (await this.redisService.ioredis.call('FT.SEARCH', index, query)) as any;
|
||||
|
||||
if (redisSearch[0] === 0) {
|
||||
return [];
|
||||
return {
|
||||
totalResults: 0,
|
||||
results: [],
|
||||
};
|
||||
}
|
||||
|
||||
delete redisSearch[2][0];
|
||||
|
@ -105,4 +135,10 @@ export class SearchService implements OnApplicationBootstrap {
|
|||
results: redisSearchResults,
|
||||
};
|
||||
}
|
||||
|
||||
private searchCheck() {
|
||||
if (this.searchDisabled) {
|
||||
throw new BadRequestException(REDIS_SEARCH_DISABLED_ERROR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,22 +1,28 @@
|
|||
import { Controller, Delete, Get, Param, Patch, Post, Put, Query } from '@nestjs/common';
|
||||
import {
|
||||
Controller,
|
||||
Delete,
|
||||
Get,
|
||||
Param,
|
||||
Patch,
|
||||
Post,
|
||||
Put,
|
||||
Query,
|
||||
UseInterceptors,
|
||||
} from '@nestjs/common';
|
||||
import { ApiParam, ApiTags } from '@nestjs/swagger';
|
||||
import { UserService } from '../service/user.service';
|
||||
import { RedisService } from '../../redis/service/redis.service';
|
||||
import { SearchService } from '../../redis/service/search.service';
|
||||
|
||||
import { UserSelfReflection } from 'src/auth/interceptors/selfReflection.interceptor';
|
||||
|
||||
@Controller('user')
|
||||
@ApiTags('User')
|
||||
export class UserController {
|
||||
constructor(
|
||||
private readonly userService: UserService,
|
||||
private readonly redisService: RedisService,
|
||||
private readonly searchService: SearchService,
|
||||
) {}
|
||||
constructor(private readonly userService: UserService) {}
|
||||
|
||||
@Get('/search')
|
||||
@ApiParam({ name: 'field', required: false })
|
||||
public async search(@Query('query') query: string, @Query('field') field?: string) {
|
||||
return await this.searchService.search('idx:users', query, field);
|
||||
return await this.userService.search(query, field);
|
||||
}
|
||||
|
||||
@Get()
|
||||
|
@ -28,6 +34,7 @@ export class UserController {
|
|||
@Get(':id')
|
||||
// Authenticated : Has to be publicly seen due to org inviting. Filter amount of data unless your an admin.
|
||||
// Allow self reflection to get all user data. @me
|
||||
@UseInterceptors(UserSelfReflection)
|
||||
public async getUser(@Param('id') id: string): Promise<any> {
|
||||
return await this.userService.getUserById(id);
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ import {
|
|||
userCacheKeyGenerate,
|
||||
} from '../user.constant';
|
||||
import { ClsService } from 'nestjs-cls';
|
||||
import { SearchService } from '../../redis/service/search.service';
|
||||
|
||||
@Injectable()
|
||||
export class UserService {
|
||||
|
@ -27,6 +28,7 @@ export class UserService {
|
|||
@InjectRepository(User)
|
||||
private readonly userRepository: Repository<User>,
|
||||
private readonly redisService: RedisService,
|
||||
private readonly searchService: SearchService,
|
||||
private readonly clsService: ClsService,
|
||||
) {}
|
||||
|
||||
|
@ -98,6 +100,21 @@ export class UserService {
|
|||
return user;
|
||||
}
|
||||
|
||||
async search(query: string, field?: string): Promise<any> {
|
||||
const result = await this.searchService.search('idx:users', query, field);
|
||||
|
||||
// iterate through the search results and only return the following fields from each one. username, id, displayName, avatar
|
||||
|
||||
result.results = result.results.map((user) => {
|
||||
return {
|
||||
id: user.id,
|
||||
displayName: user.displayName || user.username,
|
||||
avatar: user.avatar,
|
||||
};
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* Validate that a username and email is unique
|
||||
* @param username The username to validate
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { Controller, Get, Render, UseGuards } from '@nestjs/common';
|
||||
import { ApiExcludeController, ApiExcludeEndpoint } from '@nestjs/swagger';
|
||||
|
||||
import { LoginGuard } from '../../auth/guard/login.guard';
|
||||
import { User } from '../../auth/decorators/user.decorator';
|
||||
import { User as UserObject } from '../../database/models/user.model';
|
||||
import { ViewLoginGuard } from '../../auth/guard/viewLogin.guard';
|
||||
import { CurrentUser } from '../../auth/decorators/user.decorator';
|
||||
import { User } from '../../database/models/user.model';
|
||||
|
||||
@ApiExcludeController()
|
||||
@Controller()
|
||||
|
@ -11,7 +11,7 @@ export class ViewController {
|
|||
@Get('auth/login')
|
||||
@Render('auth/login')
|
||||
@ApiExcludeEndpoint()
|
||||
@UseGuards(LoginGuard)
|
||||
@UseGuards(ViewLoginGuard)
|
||||
public async loginView(): Promise<any> {
|
||||
return {
|
||||
forgot_password: 'forgot-password',
|
||||
|
@ -24,7 +24,7 @@ export class ViewController {
|
|||
@Get('auth/login/totp')
|
||||
@Render('auth/login-totp')
|
||||
@ApiExcludeEndpoint()
|
||||
@UseGuards(LoginGuard)
|
||||
@UseGuards(ViewLoginGuard)
|
||||
public async getLoginTotp(): Promise<any> {
|
||||
return {
|
||||
login: 'login',
|
||||
|
@ -35,7 +35,7 @@ export class ViewController {
|
|||
@Get('auth/register')
|
||||
@Render('auth/register')
|
||||
@ApiExcludeEndpoint()
|
||||
@UseGuards(LoginGuard)
|
||||
@UseGuards(ViewLoginGuard)
|
||||
public async getRegister(): Promise<any> {
|
||||
return {
|
||||
login: 'login',
|
||||
|
@ -43,7 +43,7 @@ export class ViewController {
|
|||
}
|
||||
|
||||
@Get('auth/forgot-password')
|
||||
@UseGuards(LoginGuard)
|
||||
@UseGuards(ViewLoginGuard)
|
||||
@Render('auth/forgot-password')
|
||||
@ApiExcludeEndpoint()
|
||||
public async getForgotPassword(): Promise<any> {
|
||||
|
@ -55,7 +55,8 @@ export class ViewController {
|
|||
@Get('home')
|
||||
@Render('home/index')
|
||||
@ApiExcludeEndpoint()
|
||||
public async getHomeView(@User() user: UserObject): Promise<any> {
|
||||
@UseGuards(ViewLoginGuard)
|
||||
public async getHomeView(@CurrentUser() user: User): Promise<any> {
|
||||
return {
|
||||
user: {
|
||||
name: user.displayName ?? user.username,
|
||||
|
|
0
src/worker.module.ts
Normal file
0
src/worker.module.ts
Normal file
0
src/worker.ts
Normal file
0
src/worker.ts
Normal file
|
@ -16,9 +16,6 @@ describe('AppController (e2e)', () => {
|
|||
});
|
||||
|
||||
it('/ (GET)', () => {
|
||||
return request(app.getHttpServer())
|
||||
.get('/')
|
||||
.expect(200)
|
||||
.expect('Hello World!');
|
||||
return request(app.getHttpServer()).get('/').expect(200).expect('Hello World!');
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue