diff --git a/package.json b/package.json index 80e393c..243343a 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "@nestjs/jwt": "^10.2.0", "@nestjs/mapped-types": "*", "@nestjs/platform-express": "^10.4.6", - "@nestjs/swagger": "^7.4.2", + "@nestjs/swagger": "^8.0.1", "@nestjs/terminus": "^10.2.3", "@nestjs/typeorm": "^10.0.2", "argon2": "^0.41.1", @@ -78,11 +78,11 @@ "@nestjs/schematics": "^10.2.3", "@nestjs/testing": "^10.4.6", "@swc/cli": "^0.4.0", - "@swc/core": "^1.7.26", + "@swc/core": "^1.7.40", "@types/compression": "^1.7.5", "@types/eslint__js": "^8.42.3", "@types/express": "^5.0.0", - "@types/jest": "^29.5.13", + "@types/jest": "^29.5.14", "@types/ms": "^0.7.34", "@types/node": "^22.8.2", "@types/nodemailer": "^6.4.16", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index caa98ec..7db3482 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -39,14 +39,14 @@ importers: specifier: ^10.4.6 version: 10.4.6(@nestjs/common@10.4.6(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.6) '@nestjs/swagger': - specifier: ^7.4.2 - version: 7.4.2(@nestjs/common@10.4.6(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.6)(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2) + specifier: ^8.0.1 + version: 8.0.1(@nestjs/common@10.4.6(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.6)(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/axios@3.1.1(@nestjs/common@10.4.6(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(axios@1.7.7)(rxjs@7.8.1))(@nestjs/common@10.4.6(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.6)(@nestjs/typeorm@10.0.2(@nestjs/common@10.4.6(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.6)(reflect-metadata@0.2.2)(rxjs@7.8.1)(typeorm@0.3.20(ioredis@5.4.1)(pg@8.13.1)(redis@4.7.0)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@22.8.2)(typescript@5.6.3))))(reflect-metadata@0.2.2)(rxjs@7.8.1)(typeorm@0.3.20(ioredis@5.4.1)(pg@8.13.1)(redis@4.7.0)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@22.8.2)(typescript@5.6.3))) + version: 10.2.3(@nestjs/axios@3.1.1(@nestjs/common@10.4.6(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(axios@1.7.7)(rxjs@7.8.1))(@nestjs/common@10.4.6(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.6)(@nestjs/typeorm@10.0.2(@nestjs/common@10.4.6(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.6)(reflect-metadata@0.2.2)(rxjs@7.8.1)(typeorm@0.3.20(ioredis@5.4.1)(pg@8.13.1)(redis@4.7.0)(ts-node@10.9.2(@swc/core@1.7.40)(@types/node@22.8.2)(typescript@5.6.3))))(reflect-metadata@0.2.2)(rxjs@7.8.1)(typeorm@0.3.20(ioredis@5.4.1)(pg@8.13.1)(redis@4.7.0)(ts-node@10.9.2(@swc/core@1.7.40)(@types/node@22.8.2)(typescript@5.6.3))) '@nestjs/typeorm': specifier: ^10.0.2 - version: 10.0.2(@nestjs/common@10.4.6(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.6)(reflect-metadata@0.2.2)(rxjs@7.8.1)(typeorm@0.3.20(ioredis@5.4.1)(pg@8.13.1)(redis@4.7.0)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@22.8.2)(typescript@5.6.3))) + version: 10.0.2(@nestjs/common@10.4.6(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.6)(reflect-metadata@0.2.2)(rxjs@7.8.1)(typeorm@0.3.20(ioredis@5.4.1)(pg@8.13.1)(redis@4.7.0)(ts-node@10.9.2(@swc/core@1.7.40)(@types/node@22.8.2)(typescript@5.6.3))) argon2: specifier: ^0.41.1 version: 0.41.1 @@ -109,10 +109,10 @@ importers: version: 2.8.0 typeorm: specifier: ^0.3.20 - version: 0.3.20(ioredis@5.4.1)(pg@8.13.1)(redis@4.7.0)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@22.8.2)(typescript@5.6.3)) + version: 0.3.20(ioredis@5.4.1)(pg@8.13.1)(redis@4.7.0)(ts-node@10.9.2(@swc/core@1.7.40)(@types/node@22.8.2)(typescript@5.6.3)) typeorm-extension: specifier: ^3.6.2 - version: 3.6.2(typeorm@0.3.20(ioredis@5.4.1)(pg@8.13.1)(redis@4.7.0)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@22.8.2)(typescript@5.6.3))) + version: 3.6.2(typeorm@0.3.20(ioredis@5.4.1)(pg@8.13.1)(redis@4.7.0)(ts-node@10.9.2(@swc/core@1.7.40)(@types/node@22.8.2)(typescript@5.6.3))) uuid: specifier: ^11.0.2 version: 11.0.2 @@ -128,7 +128,7 @@ importers: version: 9.13.0 '@nestjs/cli': specifier: ^10.4.5 - version: 10.4.5(@swc/cli@0.4.0(@swc/core@1.7.26)(chokidar@3.6.0))(@swc/core@1.7.26) + version: 10.4.5(@swc/cli@0.4.0(@swc/core@1.7.40)(chokidar@3.6.0))(@swc/core@1.7.40) '@nestjs/schematics': specifier: ^10.2.3 version: 10.2.3(chokidar@3.6.0)(typescript@5.6.3) @@ -137,10 +137,10 @@ importers: version: 10.4.6(@nestjs/common@10.4.6(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.6)(@nestjs/platform-express@10.4.6) '@swc/cli': specifier: ^0.4.0 - version: 0.4.0(@swc/core@1.7.26)(chokidar@3.6.0) + version: 0.4.0(@swc/core@1.7.40)(chokidar@3.6.0) '@swc/core': - specifier: ^1.7.26 - version: 1.7.26 + specifier: ^1.7.40 + version: 1.7.40 '@types/compression': specifier: ^1.7.5 version: 1.7.5 @@ -151,8 +151,8 @@ importers: specifier: ^5.0.0 version: 5.0.0 '@types/jest': - specifier: ^29.5.13 - version: 29.5.13 + specifier: ^29.5.14 + version: 29.5.14 '@types/ms': specifier: ^0.7.34 version: 0.7.34 @@ -200,7 +200,7 @@ importers: version: 9.1.6 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@22.8.2)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@22.8.2)(typescript@5.6.3)) + version: 29.7.0(@types/node@22.8.2)(ts-node@10.9.2(@swc/core@1.7.40)(@types/node@22.8.2)(typescript@5.6.3)) lint-staged: specifier: ^15.2.10 version: 15.2.10 @@ -221,13 +221,13 @@ importers: version: 7.0.0 ts-jest: specifier: ^29.2.4 - version: 29.2.5(@babel/core@7.24.7)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.24.7))(jest@29.7.0(@types/node@22.8.2)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@22.8.2)(typescript@5.6.3)))(typescript@5.6.3) + version: 29.2.5(@babel/core@7.24.7)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.24.7))(jest@29.7.0(@types/node@22.8.2)(ts-node@10.9.2(@swc/core@1.7.40)(@types/node@22.8.2)(typescript@5.6.3)))(typescript@5.6.3) ts-loader: specifier: ^9.5.1 - version: 9.5.1(typescript@5.6.3)(webpack@5.94.0(@swc/core@1.7.26)) + version: 9.5.1(typescript@5.6.3)(webpack@5.94.0(@swc/core@1.7.40)) ts-node: specifier: ^10.9.2 - version: 10.9.2(@swc/core@1.7.26)(@types/node@22.8.2)(typescript@5.6.3) + version: 10.9.2(@swc/core@1.7.40)(@types/node@22.8.2)(typescript@5.6.3) tsconfig-paths: specifier: ^4.2.0 version: 4.2.0 @@ -1270,8 +1270,8 @@ packages: peerDependencies: typescript: '>=4.8.2' - '@nestjs/swagger@7.4.2': - resolution: {integrity: sha512-Mu6TEn1M/owIvAx2B4DUQObQXqo2028R2s9rSZ/hJEgBK95+doTwS0DjmVA2wTeZTyVtXOoN7CsoM5pONBzvKQ==} + '@nestjs/swagger@8.0.1': + resolution: {integrity: sha512-kW0dlsZXXWQgSSJHvk0fzg6kHvLcJ6trpbfvj5UN8DWIyCdCS/MGNshDE3P82xxKcg/pLZH7z41qYpFiawkGvQ==} peerDependencies: '@fastify/static': ^6.0.0 || ^7.0.0 '@nestjs/common': ^9.0.0 || ^10.0.0 @@ -1539,68 +1539,68 @@ packages: chokidar: optional: true - '@swc/core-darwin-arm64@1.7.26': - resolution: {integrity: sha512-FF3CRYTg6a7ZVW4yT9mesxoVVZTrcSWtmZhxKCYJX9brH4CS/7PRPjAKNk6kzWgWuRoglP7hkjQcd6EpMcZEAw==} + '@swc/core-darwin-arm64@1.7.40': + resolution: {integrity: sha512-LRRrCiRJLb1kpQtxMNNsr5W82Inr0dy5Imho+4HQzVx/Ismi0qX4hQBgzJAnyOBNLK1+OBVb/912UVhKXppdfQ==} engines: {node: '>=10'} cpu: [arm64] os: [darwin] - '@swc/core-darwin-x64@1.7.26': - resolution: {integrity: sha512-az3cibZdsay2HNKmc4bjf62QVukuiMRh5sfM5kHR/JMTrLyS6vSw7Ihs3UTkZjUxkLTT8ro54LI6sV6sUQUbLQ==} + '@swc/core-darwin-x64@1.7.40': + resolution: {integrity: sha512-Lpl0XK/4fLzS5jsK48opUuGXrqJXwqJckYYPwyGbCfCXm4MsBe+7dX2hq/Kc4YMY25+NeTmzAXhla8TT4WYD/g==} engines: {node: '>=10'} cpu: [x64] os: [darwin] - '@swc/core-linux-arm-gnueabihf@1.7.26': - resolution: {integrity: sha512-VYPFVJDO5zT5U3RpCdHE5v1gz4mmR8BfHecUZTmD2v1JeFY6fv9KArJUpjrHEEsjK/ucXkQFmJ0jaiWXmpOV9Q==} + '@swc/core-linux-arm-gnueabihf@1.7.40': + resolution: {integrity: sha512-4bEvvjptpoc5BRPr/R419h6fXTEuub+frpxxlxBOEKxgXjAF/S3xdxyPijUAakmW/xXBF0u7OC4KYI+38yQp6g==} engines: {node: '>=10'} cpu: [arm] os: [linux] - '@swc/core-linux-arm64-gnu@1.7.26': - resolution: {integrity: sha512-YKevOV7abpjcAzXrhsl+W48Z9mZvgoVs2eP5nY+uoMAdP2b3GxC0Df1Co0I90o2lkzO4jYBpTMcZlmUXLdXn+Q==} + '@swc/core-linux-arm64-gnu@1.7.40': + resolution: {integrity: sha512-v2fBlHJ/6Ovz0L2xFAI9TRiKyl9DTdx139PuAHD9gyzp16Utl/W0MPd4t2cYdkI6hPXE9PsJCSzMOrduh+YoDg==} engines: {node: '>=10'} cpu: [arm64] os: [linux] - '@swc/core-linux-arm64-musl@1.7.26': - resolution: {integrity: sha512-3w8iZICMkQQON0uIcvz7+Q1MPOW6hJ4O5ETjA0LSP/tuKqx30hIniCGOgPDnv3UTMruLUnQbtBwVCZTBKR3Rkg==} + '@swc/core-linux-arm64-musl@1.7.40': + resolution: {integrity: sha512-uMkduQuU4LFVkW6txv8AVArT8GjJVJ5IHoWloXaUBMT447iE8NALmpePdZWhMyj6KV7j0y23CM5rzV/I2eNGLg==} engines: {node: '>=10'} cpu: [arm64] os: [linux] - '@swc/core-linux-x64-gnu@1.7.26': - resolution: {integrity: sha512-c+pp9Zkk2lqb06bNGkR2Looxrs7FtGDMA4/aHjZcCqATgp348hOKH5WPvNLBl+yPrISuWjbKDVn3NgAvfvpH4w==} + '@swc/core-linux-x64-gnu@1.7.40': + resolution: {integrity: sha512-4LZdY1MBSnXyTpW5fpBU/+JGAhkuHT+VnFTDNegRboN5nSPh7y0Yvn4LmIioESV+sWzjKkEXujJPGjrp+oSp5w==} engines: {node: '>=10'} cpu: [x64] os: [linux] - '@swc/core-linux-x64-musl@1.7.26': - resolution: {integrity: sha512-PgtyfHBF6xG87dUSSdTJHwZ3/8vWZfNIXQV2GlwEpslrOkGqy+WaiiyE7Of7z9AvDILfBBBcJvJ/r8u980wAfQ==} + '@swc/core-linux-x64-musl@1.7.40': + resolution: {integrity: sha512-FPjOwT3SgI6PAwH1O8bhOGBPzuvzOlzKeCtxLaCjruHJu9V8KKBrMTWOZT/FJyYC9mX5Ip1+l9j30UqUZdQxtA==} engines: {node: '>=10'} cpu: [x64] os: [linux] - '@swc/core-win32-arm64-msvc@1.7.26': - resolution: {integrity: sha512-9TNXPIJqFynlAOrRD6tUQjMq7KApSklK3R/tXgIxc7Qx+lWu8hlDQ/kVPLpU7PWvMMwC/3hKBW+p5f+Tms1hmA==} + '@swc/core-win32-arm64-msvc@1.7.40': + resolution: {integrity: sha512-//ovXdD9GsTmhPmXJlXnIbRQkeuL6PSrYSr7uCMNcclrUdJG0YkO0GMM2afUKYbdJcunylDDWsSS8PFWn0QxmA==} engines: {node: '>=10'} cpu: [arm64] os: [win32] - '@swc/core-win32-ia32-msvc@1.7.26': - resolution: {integrity: sha512-9YngxNcG3177GYdsTum4V98Re+TlCeJEP4kEwEg9EagT5s3YejYdKwVAkAsJszzkXuyRDdnHUpYbTrPG6FiXrQ==} + '@swc/core-win32-ia32-msvc@1.7.40': + resolution: {integrity: sha512-iD/1auVhHGlhWAPrWmfRWL3w4AvXIWGVXZiSA109/xnRIPiHKb/HqqTp/qB94E/ZHMPRgLKkLTNwamlkueUs8g==} engines: {node: '>=10'} cpu: [ia32] os: [win32] - '@swc/core-win32-x64-msvc@1.7.26': - resolution: {integrity: sha512-VR+hzg9XqucgLjXxA13MtV5O3C0bK0ywtLIBw/+a+O+Oc6mxFWHtdUeXDbIi5AiPbn0fjgVJMqYnyjGyyX8u0w==} + '@swc/core-win32-x64-msvc@1.7.40': + resolution: {integrity: sha512-ZlFAV1WFPhhWQ/8esiygmetkb905XIcMMtHRRG0FBGCllO+HVL5nikUaLDgTClz1onmEY9sMXUFQeoPtvliV+w==} engines: {node: '>=10'} cpu: [x64] os: [win32] - '@swc/core@1.7.26': - resolution: {integrity: sha512-f5uYFf+TmMQyYIoxkn/evWhNGuUzC730dFwAKGwBVHHVoPyak1/GvJUm6i1SKl+2Hrj9oN0i3WSoWWZ4pgI8lw==} + '@swc/core@1.7.40': + resolution: {integrity: sha512-0HIzM5vigVT5IvNum+pPuST9p8xFhN6mhdIKju7qYYeNuZG78lwms/2d8WgjTJJlzp6JlPguXGrMMNzjQw0qNg==} engines: {node: '>=10'} peerDependencies: '@swc/helpers': '*' @@ -1611,8 +1611,8 @@ packages: '@swc/counter@0.1.3': resolution: {integrity: sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==} - '@swc/types@0.1.12': - resolution: {integrity: sha512-wBJA+SdtkbFhHjTMYH+dEH1y4VpfGdAc2Kw/LK09i9bXd/K6j6PkDcFCEzb6iVfZMkPRrl/q0e3toqTAJdkIVA==} + '@swc/types@0.1.13': + resolution: {integrity: sha512-JL7eeCk6zWCbiYQg2xQSdLXQJl8Qoc9rXmG2cEKvHe3CKwMHwHGpfOb8frzNLmbycOo6I51qxnLnn9ESf4I20Q==} '@szmarczak/http-timer@4.0.6': resolution: {integrity: sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==} @@ -1714,8 +1714,8 @@ packages: '@types/istanbul-reports@3.0.4': resolution: {integrity: sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==} - '@types/jest@29.5.13': - resolution: {integrity: sha512-wd+MVEZCHt23V0/L642O5APvspWply/rGY5BcW4SUETo2UzPU3Z26qr8jC2qxpimI2jjx9h7+2cj2FwIr01bXg==} + '@types/jest@29.5.14': + resolution: {integrity: sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ==} '@types/json-schema@7.0.15': resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} @@ -7100,7 +7100,7 @@ snapshots: jest-util: 29.7.0 slash: 3.0.0 - '@jest/core@29.7.0(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@22.8.2)(typescript@5.6.3))': + '@jest/core@29.7.0(ts-node@10.9.2(@swc/core@1.7.40)(@types/node@22.8.2)(typescript@5.6.3))': dependencies: '@jest/console': 29.7.0 '@jest/reporters': 29.7.0 @@ -7114,7 +7114,7 @@ snapshots: exit: 0.1.2 graceful-fs: 4.2.11 jest-changed-files: 29.7.0 - jest-config: 29.7.0(@types/node@22.8.2)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@22.8.2)(typescript@5.6.3)) + jest-config: 29.7.0(@types/node@22.8.2)(ts-node@10.9.2(@swc/core@1.7.40)(@types/node@22.8.2)(typescript@5.6.3)) jest-haste-map: 29.7.0 jest-message-util: 29.7.0 jest-regex-util: 29.6.3 @@ -7535,7 +7535,7 @@ snapshots: cache-manager: 5.7.6 rxjs: 7.8.1 - '@nestjs/cli@10.4.5(@swc/cli@0.4.0(@swc/core@1.7.26)(chokidar@3.6.0))(@swc/core@1.7.26)': + '@nestjs/cli@10.4.5(@swc/cli@0.4.0(@swc/core@1.7.40)(chokidar@3.6.0))(@swc/core@1.7.40)': dependencies: '@angular-devkit/core': 17.3.8(chokidar@3.6.0) '@angular-devkit/schematics': 17.3.8(chokidar@3.6.0) @@ -7545,7 +7545,7 @@ snapshots: chokidar: 3.6.0 cli-table3: 0.6.5 commander: 4.1.1 - fork-ts-checker-webpack-plugin: 9.0.2(typescript@5.3.3)(webpack@5.94.0(@swc/core@1.7.26)) + fork-ts-checker-webpack-plugin: 9.0.2(typescript@5.3.3)(webpack@5.94.0(@swc/core@1.7.40)) glob: 10.4.2 inquirer: 8.2.6 node-emoji: 1.11.0 @@ -7554,11 +7554,11 @@ snapshots: tsconfig-paths: 4.2.0 tsconfig-paths-webpack-plugin: 4.1.0 typescript: 5.3.3 - webpack: 5.94.0(@swc/core@1.7.26) + webpack: 5.94.0(@swc/core@1.7.40) webpack-node-externals: 3.0.0 optionalDependencies: - '@swc/cli': 0.4.0(@swc/core@1.7.26)(chokidar@3.6.0) - '@swc/core': 1.7.26 + '@swc/cli': 0.4.0(@swc/core@1.7.40)(chokidar@3.6.0) + '@swc/core': 1.7.40 transitivePeerDependencies: - esbuild - uglify-js @@ -7647,7 +7647,7 @@ snapshots: transitivePeerDependencies: - chokidar - '@nestjs/swagger@7.4.2(@nestjs/common@10.4.6(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.6)(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)': + '@nestjs/swagger@8.0.1(@nestjs/common@10.4.6(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.6)(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)': dependencies: '@microsoft/tsdoc': 0.15.0 '@nestjs/common': 10.4.6(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) @@ -7662,7 +7662,7 @@ snapshots: class-transformer: 0.5.1 class-validator: 0.14.1 - '@nestjs/terminus@10.2.3(@nestjs/axios@3.1.1(@nestjs/common@10.4.6(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(axios@1.7.7)(rxjs@7.8.1))(@nestjs/common@10.4.6(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.6)(@nestjs/typeorm@10.0.2(@nestjs/common@10.4.6(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.6)(reflect-metadata@0.2.2)(rxjs@7.8.1)(typeorm@0.3.20(ioredis@5.4.1)(pg@8.13.1)(redis@4.7.0)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@22.8.2)(typescript@5.6.3))))(reflect-metadata@0.2.2)(rxjs@7.8.1)(typeorm@0.3.20(ioredis@5.4.1)(pg@8.13.1)(redis@4.7.0)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@22.8.2)(typescript@5.6.3)))': + '@nestjs/terminus@10.2.3(@nestjs/axios@3.1.1(@nestjs/common@10.4.6(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(axios@1.7.7)(rxjs@7.8.1))(@nestjs/common@10.4.6(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.6)(@nestjs/typeorm@10.0.2(@nestjs/common@10.4.6(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.6)(reflect-metadata@0.2.2)(rxjs@7.8.1)(typeorm@0.3.20(ioredis@5.4.1)(pg@8.13.1)(redis@4.7.0)(ts-node@10.9.2(@swc/core@1.7.40)(@types/node@22.8.2)(typescript@5.6.3))))(reflect-metadata@0.2.2)(rxjs@7.8.1)(typeorm@0.3.20(ioredis@5.4.1)(pg@8.13.1)(redis@4.7.0)(ts-node@10.9.2(@swc/core@1.7.40)(@types/node@22.8.2)(typescript@5.6.3)))': dependencies: '@nestjs/common': 10.4.6(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) '@nestjs/core': 10.4.6(@nestjs/common@10.4.6(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.6)(encoding@0.1.13)(reflect-metadata@0.2.2)(rxjs@7.8.1) @@ -7672,8 +7672,8 @@ snapshots: rxjs: 7.8.1 optionalDependencies: '@nestjs/axios': 3.1.1(@nestjs/common@10.4.6(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(axios@1.7.7)(rxjs@7.8.1) - '@nestjs/typeorm': 10.0.2(@nestjs/common@10.4.6(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.6)(reflect-metadata@0.2.2)(rxjs@7.8.1)(typeorm@0.3.20(ioredis@5.4.1)(pg@8.13.1)(redis@4.7.0)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@22.8.2)(typescript@5.6.3))) - typeorm: 0.3.20(ioredis@5.4.1)(pg@8.13.1)(redis@4.7.0)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@22.8.2)(typescript@5.6.3)) + '@nestjs/typeorm': 10.0.2(@nestjs/common@10.4.6(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.6)(reflect-metadata@0.2.2)(rxjs@7.8.1)(typeorm@0.3.20(ioredis@5.4.1)(pg@8.13.1)(redis@4.7.0)(ts-node@10.9.2(@swc/core@1.7.40)(@types/node@22.8.2)(typescript@5.6.3))) + typeorm: 0.3.20(ioredis@5.4.1)(pg@8.13.1)(redis@4.7.0)(ts-node@10.9.2(@swc/core@1.7.40)(@types/node@22.8.2)(typescript@5.6.3)) '@nestjs/testing@10.4.6(@nestjs/common@10.4.6(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.6)(@nestjs/platform-express@10.4.6)': dependencies: @@ -7683,13 +7683,13 @@ snapshots: optionalDependencies: '@nestjs/platform-express': 10.4.6(@nestjs/common@10.4.6(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.6) - '@nestjs/typeorm@10.0.2(@nestjs/common@10.4.6(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.6)(reflect-metadata@0.2.2)(rxjs@7.8.1)(typeorm@0.3.20(ioredis@5.4.1)(pg@8.13.1)(redis@4.7.0)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@22.8.2)(typescript@5.6.3)))': + '@nestjs/typeorm@10.0.2(@nestjs/common@10.4.6(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.6)(reflect-metadata@0.2.2)(rxjs@7.8.1)(typeorm@0.3.20(ioredis@5.4.1)(pg@8.13.1)(redis@4.7.0)(ts-node@10.9.2(@swc/core@1.7.40)(@types/node@22.8.2)(typescript@5.6.3)))': dependencies: '@nestjs/common': 10.4.6(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1) '@nestjs/core': 10.4.6(@nestjs/common@10.4.6(class-transformer@0.5.1)(class-validator@0.14.1)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.6)(encoding@0.1.13)(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)(pg@8.13.1)(redis@4.7.0)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@22.8.2)(typescript@5.6.3)) + typeorm: 0.3.20(ioredis@5.4.1)(pg@8.13.1)(redis@4.7.0)(ts-node@10.9.2(@swc/core@1.7.40)(@types/node@22.8.2)(typescript@5.6.3)) uuid: 9.0.1 '@nodelib/fs.scandir@2.1.5': @@ -7828,10 +7828,10 @@ snapshots: '@sqltools/formatter@1.2.5': {} - '@swc/cli@0.4.0(@swc/core@1.7.26)(chokidar@3.6.0)': + '@swc/cli@0.4.0(@swc/core@1.7.40)(chokidar@3.6.0)': dependencies: '@mole-inc/bin-wrapper': 8.0.1 - '@swc/core': 1.7.26 + '@swc/core': 1.7.40 '@swc/counter': 0.1.3 commander: 8.3.0 fast-glob: 3.3.2 @@ -7843,55 +7843,55 @@ snapshots: optionalDependencies: chokidar: 3.6.0 - '@swc/core-darwin-arm64@1.7.26': + '@swc/core-darwin-arm64@1.7.40': optional: true - '@swc/core-darwin-x64@1.7.26': + '@swc/core-darwin-x64@1.7.40': optional: true - '@swc/core-linux-arm-gnueabihf@1.7.26': + '@swc/core-linux-arm-gnueabihf@1.7.40': optional: true - '@swc/core-linux-arm64-gnu@1.7.26': + '@swc/core-linux-arm64-gnu@1.7.40': optional: true - '@swc/core-linux-arm64-musl@1.7.26': + '@swc/core-linux-arm64-musl@1.7.40': optional: true - '@swc/core-linux-x64-gnu@1.7.26': + '@swc/core-linux-x64-gnu@1.7.40': optional: true - '@swc/core-linux-x64-musl@1.7.26': + '@swc/core-linux-x64-musl@1.7.40': optional: true - '@swc/core-win32-arm64-msvc@1.7.26': + '@swc/core-win32-arm64-msvc@1.7.40': optional: true - '@swc/core-win32-ia32-msvc@1.7.26': + '@swc/core-win32-ia32-msvc@1.7.40': optional: true - '@swc/core-win32-x64-msvc@1.7.26': + '@swc/core-win32-x64-msvc@1.7.40': optional: true - '@swc/core@1.7.26': + '@swc/core@1.7.40': dependencies: '@swc/counter': 0.1.3 - '@swc/types': 0.1.12 + '@swc/types': 0.1.13 optionalDependencies: - '@swc/core-darwin-arm64': 1.7.26 - '@swc/core-darwin-x64': 1.7.26 - '@swc/core-linux-arm-gnueabihf': 1.7.26 - '@swc/core-linux-arm64-gnu': 1.7.26 - '@swc/core-linux-arm64-musl': 1.7.26 - '@swc/core-linux-x64-gnu': 1.7.26 - '@swc/core-linux-x64-musl': 1.7.26 - '@swc/core-win32-arm64-msvc': 1.7.26 - '@swc/core-win32-ia32-msvc': 1.7.26 - '@swc/core-win32-x64-msvc': 1.7.26 + '@swc/core-darwin-arm64': 1.7.40 + '@swc/core-darwin-x64': 1.7.40 + '@swc/core-linux-arm-gnueabihf': 1.7.40 + '@swc/core-linux-arm64-gnu': 1.7.40 + '@swc/core-linux-arm64-musl': 1.7.40 + '@swc/core-linux-x64-gnu': 1.7.40 + '@swc/core-linux-x64-musl': 1.7.40 + '@swc/core-win32-arm64-msvc': 1.7.40 + '@swc/core-win32-ia32-msvc': 1.7.40 + '@swc/core-win32-x64-msvc': 1.7.40 '@swc/counter@0.1.3': {} - '@swc/types@0.1.12': + '@swc/types@0.1.13': dependencies: '@swc/counter': 0.1.3 @@ -8021,7 +8021,7 @@ snapshots: dependencies: '@types/istanbul-lib-report': 3.0.3 - '@types/jest@29.5.13': + '@types/jest@29.5.14': dependencies: expect: 29.7.0 pretty-format: 29.7.0 @@ -9448,13 +9448,13 @@ snapshots: optionalDependencies: typescript: 5.6.3 - create-jest@29.7.0(@types/node@22.8.2)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@22.8.2)(typescript@5.6.3)): + create-jest@29.7.0(@types/node@22.8.2)(ts-node@10.9.2(@swc/core@1.7.40)(@types/node@22.8.2)(typescript@5.6.3)): 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@22.8.2)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@22.8.2)(typescript@5.6.3)) + jest-config: 29.7.0(@types/node@22.8.2)(ts-node@10.9.2(@swc/core@1.7.40)(@types/node@22.8.2)(typescript@5.6.3)) jest-util: 29.7.0 prompts: 2.4.2 transitivePeerDependencies: @@ -10158,7 +10158,7 @@ snapshots: cross-spawn: 7.0.3 signal-exit: 4.1.0 - fork-ts-checker-webpack-plugin@9.0.2(typescript@5.3.3)(webpack@5.94.0(@swc/core@1.7.26)): + fork-ts-checker-webpack-plugin@9.0.2(typescript@5.3.3)(webpack@5.94.0(@swc/core@1.7.40)): dependencies: '@babel/code-frame': 7.24.7 chalk: 4.1.2 @@ -10173,7 +10173,7 @@ snapshots: semver: 7.6.3 tapable: 2.2.1 typescript: 5.3.3 - webpack: 5.94.0(@swc/core@1.7.26) + webpack: 5.94.0(@swc/core@1.7.40) form-data@4.0.0: dependencies: @@ -10727,16 +10727,16 @@ snapshots: - babel-plugin-macros - supports-color - jest-cli@29.7.0(@types/node@22.8.2)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@22.8.2)(typescript@5.6.3)): + jest-cli@29.7.0(@types/node@22.8.2)(ts-node@10.9.2(@swc/core@1.7.40)(@types/node@22.8.2)(typescript@5.6.3)): dependencies: - '@jest/core': 29.7.0(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@22.8.2)(typescript@5.6.3)) + '@jest/core': 29.7.0(ts-node@10.9.2(@swc/core@1.7.40)(@types/node@22.8.2)(typescript@5.6.3)) '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 chalk: 4.1.2 - create-jest: 29.7.0(@types/node@22.8.2)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@22.8.2)(typescript@5.6.3)) + create-jest: 29.7.0(@types/node@22.8.2)(ts-node@10.9.2(@swc/core@1.7.40)(@types/node@22.8.2)(typescript@5.6.3)) exit: 0.1.2 import-local: 3.1.0 - jest-config: 29.7.0(@types/node@22.8.2)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@22.8.2)(typescript@5.6.3)) + jest-config: 29.7.0(@types/node@22.8.2)(ts-node@10.9.2(@swc/core@1.7.40)(@types/node@22.8.2)(typescript@5.6.3)) jest-util: 29.7.0 jest-validate: 29.7.0 yargs: 17.7.2 @@ -10746,7 +10746,7 @@ snapshots: - supports-color - ts-node - jest-config@29.7.0(@types/node@22.8.2)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@22.8.2)(typescript@5.6.3)): + jest-config@29.7.0(@types/node@22.8.2)(ts-node@10.9.2(@swc/core@1.7.40)(@types/node@22.8.2)(typescript@5.6.3)): dependencies: '@babel/core': 7.24.7 '@jest/test-sequencer': 29.7.0 @@ -10772,7 +10772,7 @@ snapshots: strip-json-comments: 3.1.1 optionalDependencies: '@types/node': 22.8.2 - ts-node: 10.9.2(@swc/core@1.7.26)(@types/node@22.8.2)(typescript@5.6.3) + ts-node: 10.9.2(@swc/core@1.7.40)(@types/node@22.8.2)(typescript@5.6.3) transitivePeerDependencies: - babel-plugin-macros - supports-color @@ -10998,12 +10998,12 @@ snapshots: merge-stream: 2.0.0 supports-color: 8.1.1 - jest@29.7.0(@types/node@22.8.2)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@22.8.2)(typescript@5.6.3)): + jest@29.7.0(@types/node@22.8.2)(ts-node@10.9.2(@swc/core@1.7.40)(@types/node@22.8.2)(typescript@5.6.3)): dependencies: - '@jest/core': 29.7.0(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@22.8.2)(typescript@5.6.3)) + '@jest/core': 29.7.0(ts-node@10.9.2(@swc/core@1.7.40)(@types/node@22.8.2)(typescript@5.6.3)) '@jest/types': 29.6.3 import-local: 3.1.0 - jest-cli: 29.7.0(@types/node@22.8.2)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@22.8.2)(typescript@5.6.3)) + jest-cli: 29.7.0(@types/node@22.8.2)(ts-node@10.9.2(@swc/core@1.7.40)(@types/node@22.8.2)(typescript@5.6.3)) transitivePeerDependencies: - '@types/node' - babel-plugin-macros @@ -13068,16 +13068,16 @@ snapshots: dependencies: memoizerific: 1.11.3 - terser-webpack-plugin@5.3.10(@swc/core@1.7.26)(webpack@5.94.0(@swc/core@1.7.26)): + terser-webpack-plugin@5.3.10(@swc/core@1.7.40)(webpack@5.94.0(@swc/core@1.7.40)): dependencies: '@jridgewell/trace-mapping': 0.3.25 jest-worker: 27.5.1 schema-utils: 3.3.0 serialize-javascript: 6.0.2 terser: 5.31.6 - webpack: 5.94.0(@swc/core@1.7.26) + webpack: 5.94.0(@swc/core@1.7.40) optionalDependencies: - '@swc/core': 1.7.26 + '@swc/core': 1.7.40 terser@5.31.6: dependencies: @@ -13157,12 +13157,12 @@ snapshots: dependencies: typescript: 5.6.3 - ts-jest@29.2.5(@babel/core@7.24.7)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.24.7))(jest@29.7.0(@types/node@22.8.2)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@22.8.2)(typescript@5.6.3)))(typescript@5.6.3): + ts-jest@29.2.5(@babel/core@7.24.7)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.24.7))(jest@29.7.0(@types/node@22.8.2)(ts-node@10.9.2(@swc/core@1.7.40)(@types/node@22.8.2)(typescript@5.6.3)))(typescript@5.6.3): dependencies: bs-logger: 0.2.6 ejs: 3.1.10 fast-json-stable-stringify: 2.1.0 - jest: 29.7.0(@types/node@22.8.2)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@22.8.2)(typescript@5.6.3)) + jest: 29.7.0(@types/node@22.8.2)(ts-node@10.9.2(@swc/core@1.7.40)(@types/node@22.8.2)(typescript@5.6.3)) jest-util: 29.7.0 json5: 2.2.3 lodash.memoize: 4.1.2 @@ -13176,7 +13176,7 @@ snapshots: '@jest/types': 29.6.3 babel-jest: 29.7.0(@babel/core@7.24.7) - ts-loader@9.5.1(typescript@5.6.3)(webpack@5.94.0(@swc/core@1.7.26)): + ts-loader@9.5.1(typescript@5.6.3)(webpack@5.94.0(@swc/core@1.7.40)): dependencies: chalk: 4.1.2 enhanced-resolve: 5.17.0 @@ -13184,9 +13184,9 @@ snapshots: semver: 7.6.3 source-map: 0.7.4 typescript: 5.6.3 - webpack: 5.94.0(@swc/core@1.7.26) + webpack: 5.94.0(@swc/core@1.7.40) - ts-node@10.9.2(@swc/core@1.7.26)(@types/node@22.8.2)(typescript@5.6.3): + ts-node@10.9.2(@swc/core@1.7.40)(@types/node@22.8.2)(typescript@5.6.3): dependencies: '@cspotcode/source-map-support': 0.8.1 '@tsconfig/node10': 1.0.11 @@ -13204,7 +13204,7 @@ snapshots: v8-compile-cache-lib: 3.0.1 yn: 3.1.1 optionalDependencies: - '@swc/core': 1.7.26 + '@swc/core': 1.7.40 tsconfig-paths-webpack-plugin@4.1.0: dependencies: @@ -13239,7 +13239,7 @@ snapshots: typedarray@0.0.6: {} - typeorm-extension@3.6.2(typeorm@0.3.20(ioredis@5.4.1)(pg@8.13.1)(redis@4.7.0)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@22.8.2)(typescript@5.6.3))): + typeorm-extension@3.6.2(typeorm@0.3.20(ioredis@5.4.1)(pg@8.13.1)(redis@4.7.0)(ts-node@10.9.2(@swc/core@1.7.40)(@types/node@22.8.2)(typescript@5.6.3))): dependencies: '@faker-js/faker': 8.4.1 consola: 3.2.3 @@ -13249,10 +13249,10 @@ snapshots: rapiq: 0.9.0 reflect-metadata: 0.2.2 smob: 1.5.0 - typeorm: 0.3.20(ioredis@5.4.1)(pg@8.13.1)(redis@4.7.0)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@22.8.2)(typescript@5.6.3)) + typeorm: 0.3.20(ioredis@5.4.1)(pg@8.13.1)(redis@4.7.0)(ts-node@10.9.2(@swc/core@1.7.40)(@types/node@22.8.2)(typescript@5.6.3)) yargs: 17.7.2 - typeorm@0.3.20(ioredis@5.4.1)(pg@8.13.1)(redis@4.7.0)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@22.8.2)(typescript@5.6.3)): + typeorm@0.3.20(ioredis@5.4.1)(pg@8.13.1)(redis@4.7.0)(ts-node@10.9.2(@swc/core@1.7.40)(@types/node@22.8.2)(typescript@5.6.3)): dependencies: '@sqltools/formatter': 1.2.5 app-root-path: 3.1.0 @@ -13273,7 +13273,7 @@ snapshots: ioredis: 5.4.1 pg: 8.13.1 redis: 4.7.0 - ts-node: 10.9.2(@swc/core@1.7.26)(@types/node@22.8.2)(typescript@5.6.3) + ts-node: 10.9.2(@swc/core@1.7.40)(@types/node@22.8.2)(typescript@5.6.3) transitivePeerDependencies: - supports-color @@ -13477,7 +13477,7 @@ snapshots: webpack-sources@3.2.3: {} - webpack@5.94.0(@swc/core@1.7.26): + webpack@5.94.0(@swc/core@1.7.40): dependencies: '@types/estree': 1.0.5 '@webassemblyjs/ast': 1.12.1 @@ -13499,7 +13499,7 @@ snapshots: neo-async: 2.6.2 schema-utils: 3.3.0 tapable: 2.2.1 - terser-webpack-plugin: 5.3.10(@swc/core@1.7.26)(webpack@5.94.0(@swc/core@1.7.26)) + terser-webpack-plugin: 5.3.10(@swc/core@1.7.40)(webpack@5.94.0(@swc/core@1.7.40)) watchpack: 2.4.2 webpack-sources: 3.2.3 transitivePeerDependencies: diff --git a/src/decorators/field.decorators.ts b/src/decorators/field.decorators.ts index 42dcf1f..f799ade 100644 --- a/src/decorators/field.decorators.ts +++ b/src/decorators/field.decorators.ts @@ -48,9 +48,12 @@ interface IStringFieldOptions extends IFieldOptions { toUpperCase?: boolean; } +interface IEnumFieldOptions extends IFieldOptions { + enumName?: string; +} + type IBooleanFieldOptions = IFieldOptions; type ITokenFieldOptions = IFieldOptions; -type IEnumFieldOptions = IFieldOptions; type IClassFieldOptions = IFieldOptions; export function NumberField( @@ -65,7 +68,10 @@ export function NumberField( } if (options.swagger !== false) { - decorators.push(ApiProperty({ type: Number, ...options })); + const { required = true, ...restOptions } = options; + decorators.push( + ApiProperty({ type: Number, required: !!required, ...restOptions }), + ); } if (options.int) { @@ -111,8 +117,14 @@ export function StringField( } if (options.swagger !== false) { + const { required = true, ...restOptions } = options; decorators.push( - ApiProperty({ type: String, ...options, isArray: options.each }), + ApiProperty({ + type: String, + required: !!required, + ...restOptions, + isArray: options.each, + }), ); } @@ -147,8 +159,14 @@ export function TokenField( } if (options.swagger !== false) { + const { required = true, ...restOptions } = options; decorators.push( - ApiProperty({ type: String, ...options, isArray: options.each }), + ApiProperty({ + type: String, + required: !!required, + ...restOptions, + isArray: options.each, + }), ); } @@ -202,7 +220,10 @@ export function BooleanField( } if (options.swagger !== false) { - decorators.push(ApiProperty({ type: Boolean, ...options })); + const { required = true, ...restOptions } = options; + decorators.push( + ApiProperty({ type: Boolean, required: !!required, ...restOptions }), + ); } return applyDecorators(...decorators); @@ -233,7 +254,10 @@ export function EmailField( } if (options.swagger !== false) { - decorators.push(ApiProperty({ type: String, ...options })); + const { required = true, ...restOptions } = options; + decorators.push( + ApiProperty({ type: String, required: !!required, ...restOptions }), + ); } return applyDecorators(...decorators); @@ -261,12 +285,14 @@ export function UUIDField( } if (options.swagger !== false) { + const { required = true, ...restOptions } = options; decorators.push( ApiProperty({ type: options.each ? [String] : String, format: 'uuid', isArray: options.each, - ...options, + required: !!required, + ...restOptions, }), ); } @@ -319,7 +345,10 @@ export function DateField( } if (options.swagger !== false) { - decorators.push(ApiProperty({ type: Date, ...options })); + const { required = true, ...restOptions } = options; + decorators.push( + ApiProperty({ type: Date, required: !!required, ...restOptions }), + ); } return applyDecorators(...decorators); @@ -348,12 +377,14 @@ export function EnumField( } if (options.swagger !== false) { + const { required = true, ...restOptions } = options; decorators.push( ApiProperty({ - type: 'enum', enum: getEnum(), + enumName: options.enumName || getVariableName(getEnum), isArray: options.each, - ...options, + required: !!required, + ...restOptions, }), ); } @@ -392,10 +423,12 @@ export function ClassField( } if (options.swagger !== false) { + const { required = true, ...restOptions } = options; decorators.push( ApiProperty({ type: () => getClass(), - ...options, + required: !!required, + ...restOptions, }), ); } @@ -413,3 +446,7 @@ export function ClassFieldOptional( ClassField(getClass, { required: false, ...options }), ); } + +function getVariableName(variableFunction: () => any) { + return variableFunction.toString().split('.').pop(); +}