From 64a4665a259979286fb9bd122dd417da3af7898a Mon Sep 17 00:00:00 2001 From: Julian Pollinger Date: Thu, 14 Nov 2024 17:22:07 +0100 Subject: [PATCH] build: fix build --- common/config/rush/pnpm-lock.yaml | 39 +--- rita-http/docs/swagger.json | 307 +++++++++++++++--------------- rita-http/package.json | 2 +- rita-http/tsconfig.json | 36 ++-- 4 files changed, 176 insertions(+), 208 deletions(-) diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 3bf22d6..7b7a875 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -188,8 +188,8 @@ importers: specifier: workspace:* version: link:../plugins/http '@tsoa/runtime': - specifier: ^5.0.0 - version: 5.0.0 + specifier: ^6.5.1 + version: 6.5.1 body-parser: specifier: ^1.20.3 version: 1.20.3 @@ -2033,16 +2033,6 @@ packages: yargs: 17.7.2 dev: false - /@tsoa/runtime@5.0.0: - resolution: {integrity: sha512-DY0x7ZhNRF9FcwCZXQQbQhVj3bfZe0LScNyqp0c8PhDTj0gRMjY4ESVpihopRzhQtamReJoDRg3FhEu4BlSVtA==} - engines: {node: '>=12.0.0', yarn: '>=1.9.4'} - dependencies: - '@types/multer': 1.4.10 - promise.any: 2.0.6 - reflect-metadata: 0.1.13 - validator: 13.11.0 - dev: false - /@tsoa/runtime@6.5.1: resolution: {integrity: sha512-fllTz/LrHw+BJvKTREGyrnnfkusHdPivsHNNfwy5v1ZaKfxTFjSSADwm8mu64zw/SFrNeyx8N7Mr9z1ujeV1Rw==} engines: {node: '>=18.0.0', yarn: '>=1.9.4'} @@ -2294,12 +2284,6 @@ packages: resolution: {integrity: sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==} dev: true - /@types/multer@1.4.10: - resolution: {integrity: sha512-6l9mYMhUe8wbnz/67YIjc7ZJyQNZoKq7fRXVf7nMdgWgalD0KyzJ2ywI7hoATUSXSbTu9q2HBiEwzy0tNN1v2w==} - dependencies: - '@types/express': 4.17.21 - dev: false - /@types/multer@1.4.12: resolution: {integrity: sha512-pQ2hoqvXiJt2FP9WQVLPRO+AmiIm/ZYkavPlIQnx282u4ZrVdztx0pkh3jjpQt0Kz+YI0YhSG264y08UJKoUQg==} dependencies: @@ -9267,10 +9251,6 @@ packages: esprima: 4.0.1 dev: true - /reflect-metadata@0.1.13: - resolution: {integrity: sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==} - dev: false - /reflect-metadata@0.2.2: resolution: {integrity: sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==} @@ -9700,12 +9680,6 @@ packages: lru-cache: 6.0.0 dev: true - /semver@7.6.2: - resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} - engines: {node: '>=10'} - hasBin: true - dev: true - /semver@7.6.3: resolution: {integrity: sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==} engines: {node: '>=10'} @@ -10637,7 +10611,7 @@ packages: json5: 2.2.3 lodash.memoize: 4.1.2 make-error: 1.3.6 - semver: 7.6.2 + semver: 7.6.3 typescript: 4.9.5 yargs-parser: 20.2.9 dev: true @@ -10652,7 +10626,7 @@ packages: chalk: 4.1.2 enhanced-resolve: 5.15.0 micromatch: 4.0.5 - semver: 7.6.2 + semver: 7.6.3 source-map: 0.7.4 typescript: 4.9.5 webpack: 5.96.1(webpack-cli@4.9.2) @@ -11275,11 +11249,6 @@ packages: spdx-expression-parse: 3.0.1 dev: true - /validator@13.11.0: - resolution: {integrity: sha512-Ii+sehpSfZy+At5nPdnyMhx78fEoPDkR2XW/zimHEL3MyGJQOCQ7WeP20jPYRz7ZCpcKLB21NxuXHF3bxjStBQ==} - engines: {node: '>= 0.10'} - dev: false - /validator@13.12.0: resolution: {integrity: sha512-c1Q0mCiPlgdTVVVIJIrBuxNicYE+t/7oKeI9MWLj3fh/uq2Pxh/3eeWbVZ4OcGW1TUf53At0njHw5SMdA3tmMg==} engines: {node: '>= 0.10'} diff --git a/rita-http/docs/swagger.json b/rita-http/docs/swagger.json index 42f8619..b504974 100644 --- a/rita-http/docs/swagger.json +++ b/rita-http/docs/swagger.json @@ -1,4 +1,5 @@ { + "openapi": "3.0.0", "components": { "examples": {}, "headers": {}, @@ -6,74 +7,40 @@ "requestBodies": {}, "responses": {}, "schemas": { - "evaluationResult": { + "Record_string.string_": { + "properties": {}, + "additionalProperties": { + "type": "string" + }, + "type": "object", + "description": "Construct a type with a set of properties K of type T" + }, + "welcomeMessage": { "properties": { - "details": { + "plugins": { "items": { - "properties": { - "result": { - "type": "boolean" - }, - "id": { - "type": "string" - } - }, - "required": [ - "result", - "id" - ], - "type": "object" + "$ref": "#/components/schemas/Record_string.string_" }, "type": "array" }, - "counts": { - "properties": { - "false": { - "type": "number", - "format": "double" - }, - "true": { - "type": "number", - "format": "double" - } - }, - "required": [ - "false", - "true" - ], - "type": "object" - }, - "result": { - "type": "boolean" - } - }, - "required": [ - "details", - "counts", - "result" - ], - "type": "object", - "description": "Type of results of an evaluation" - }, - "errorResponse": { - "properties": { - "details": { + "ritaVersion": { "type": "string" }, "message": { "type": "string" + }, + "version": { + "type": "string" } }, "required": [ - "message" + "plugins", + "ritaVersion", + "message", + "version" ], - "type": "object" - }, - "evaluationData": { - "properties": {}, - "additionalProperties": {}, "type": "object", - "description": "type of data to evaluate against" + "description": "Root controller" }, "Ruleset": { "properties": { @@ -95,6 +62,20 @@ "type": "object", "additionalProperties": false }, + "errorResponse": { + "properties": { + "details": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + }, "ritaBody": { "properties": { "rules": { @@ -123,37 +104,60 @@ "type": "object", "description": "Type for the body of a request, that edits rita" }, - "Record_string.string_": { - "properties": {}, - "type": "object", - "description": "Construct a type with a set of properties K of type T" - }, - "welcomeMessage": { + "evaluationResult": { "properties": { - "plugins": { + "details": { "items": { - "$ref": "#/components/schemas/Record_string.string_" + "properties": { + "result": { + "type": "boolean" + }, + "id": { + "type": "string" + } + }, + "required": [ + "result", + "id" + ], + "type": "object" }, "type": "array" }, - "ritaVersion": { - "type": "string" - }, - "message": { - "type": "string" + "counts": { + "properties": { + "false": { + "type": "number", + "format": "double" + }, + "true": { + "type": "number", + "format": "double" + } + }, + "required": [ + "false", + "true" + ], + "type": "object" }, - "version": { - "type": "string" + "result": { + "type": "boolean" } }, "required": [ - "plugins", - "ritaVersion", - "message", - "version" + "details", + "counts", + "result" ], "type": "object", - "description": "Root controller" + "description": "Type of results of an evaluation" + }, + "evaluationData": { + "properties": {}, + "additionalProperties": {}, + "type": "object", + "description": "type of data to evaluate against" } }, "securitySchemes": { @@ -180,80 +184,34 @@ "name": "Julian Pollinger" } }, - "openapi": "3.0.0", "paths": { - "/evaluate/{rulesetID}": { - "post": { - "operationId": "EvaluateRuleset", + "/": { + "get": { + "operationId": "GetWelcome", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/evaluationResult" - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/errorResponse" - } - } - } - }, - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/errorResponse" - } - } - } - }, - "422": { - "description": "Validation Error: An invalid object has been passed", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/errorResponse" + "$ref": "#/components/schemas/welcomeMessage" + }, + "examples": { + "Example 1": { + "value": { + "version": "3.0.0", + "message": "Welcome to the RITA API.", + "ritaVersion": "3.0.1", + "plugins": [] + } + } } } } } }, - "security": [ - { - "api_key": [ - "evaluate" - ] - } - ], - "parameters": [ - { - "in": "path", - "name": "rulesetID", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/evaluationData" - } - } - } - } + "security": [], + "parameters": [] } }, "/rulesets": { @@ -447,33 +405,78 @@ ] } }, - "/": { - "get": { - "operationId": "GetWelcome", + "/evaluate/{rulesetID}": { + "post": { + "operationId": "EvaluateRuleset", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/welcomeMessage" - }, - "examples": { - "Example 1": { - "value": { - "version": "3.0.0", - "message": "Welcome to the RITA API.", - "ritaVersion": "3.0.1", - "plugins": [] - } - } + "$ref": "#/components/schemas/evaluationResult" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + }, + "422": { + "description": "Validation Error: An invalid object has been passed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" } } } } }, - "security": [], - "parameters": [] + "security": [ + { + "api_key": [ + "evaluate" + ] + } + ], + "parameters": [ + { + "in": "path", + "name": "rulesetID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/evaluationData" + } + } + } + } } } }, diff --git a/rita-http/package.json b/rita-http/package.json index 2d7ca37..64d3c08 100644 --- a/rita-http/package.json +++ b/rita-http/package.json @@ -40,7 +40,7 @@ "@educorvi/persistent-rita": "workspace:^6.0.1", "@educorvi/rita": "workspace:^5.3.3", "@educorvi/rita-plugin-http": "workspace:*", - "@tsoa/runtime": "^5.0.0", + "@tsoa/runtime": "^6.5.1", "body-parser": "^1.20.3", "dotenv": "^16.4.5", "express": "^4.21.1", diff --git a/rita-http/tsconfig.json b/rita-http/tsconfig.json index d0a7ff0..45ae32c 100644 --- a/rita-http/tsconfig.json +++ b/rita-http/tsconfig.json @@ -1,23 +1,19 @@ { - "compilerOptions": { - "module": "commonjs", - "esModuleInterop": true, - "target": "es6", - "noImplicitAny": true, - "moduleResolution": "node", - "sourceMap": true, - "outDir": "dist", - "baseUrl": ".", - "paths": { - "*": [ - "node_modules/*" - ] + "compilerOptions": { + "module": "commonjs", + "esModuleInterop": true, + "target": "es2021", + "noImplicitAny": true, + "moduleResolution": "node", + "sourceMap": true, + "outDir": "dist", + "baseUrl": ".", + "paths": { + "*": ["node_modules/*"] + }, + "resolveJsonModule": true, + "experimentalDecorators": true, + "emitDecoratorMetadata": true }, - "resolveJsonModule": true, - "experimentalDecorators": true, - "emitDecoratorMetadata": true - }, - "include": [ - "src/**/*" - ] + "include": ["src/**/*"] }