chore(deps): update express-openapi-validator to v4.8.0

pull/193/head
sct 4 years ago
parent 77f3f99fbb
commit 96f3861c90

@ -375,6 +375,7 @@ components:
example: 1 example: 1
logoPath: logoPath:
type: string type: string
nullable: true
originCountry: originCountry:
type: string type: string
name: name:
@ -428,7 +429,8 @@ components:
releaseDate: releaseDate:
type: string type: string
revenue: revenue:
type: string type: number
nullable: true
runtime: runtime:
type: number type: number
spokenLanguages: spokenLanguages:
@ -476,6 +478,7 @@ components:
type: string type: string
airDate: airDate:
type: string type: string
nullable: true
episodeNumber: episodeNumber:
type: number type: number
overview: overview:
@ -483,11 +486,12 @@ components:
productionCode: productionCode:
type: string type: string
seasonNumber: seasonNumber:
type: string type: number
showId: showId:
type: number type: number
stillPath: stillPath:
type: string type: string
nullable: true
voteAverage: voteAverage:
type: number type: number
voteCount: voteCount:
@ -499,6 +503,7 @@ components:
type: number type: number
airDate: airDate:
type: string type: string
nullable: true
episodeCount: episodeCount:
type: number type: number
name: name:
@ -536,6 +541,7 @@ components:
type: number type: number
profilePath: profilePath:
type: string type: string
nullable: true
episodeRunTime: episodeRunTime:
type: array type: array
items: items:
@ -658,6 +664,7 @@ components:
tvdbId: tvdbId:
type: number type: number
readOnly: true readOnly: true
nullable: true
status: status:
type: number type: number
requests: requests:
@ -696,6 +703,7 @@ components:
type: number type: number
profilePath: profilePath:
type: string type: string
nullable: true
Crew: Crew:
type: object type: object
properties: properties:
@ -715,25 +723,34 @@ components:
type: string type: string
profilePath: profilePath:
type: string type: string
nullable: true
ExternalIds: ExternalIds:
type: object type: object
properties: properties:
facebookId: facebookId:
type: string type: string
nullable: true
freebaseId: freebaseId:
type: string type: string
nullable: true
freebaseMid: freebaseMid:
type: string type: string
nullable: true
imdbId: imdbId:
type: string type: string
nullable: true
instagramId: instagramId:
type: string type: string
nullable: true
tvdbId: tvdbId:
type: string type: number
nullable: true
tvrageId: tvrageId:
type: string type: number
nullable: true
twitterId: twitterId:
type: string type: string
nullable: true
ServiceProfile: ServiceProfile:
type: object type: object
properties: properties:

@ -24,7 +24,7 @@
"cookie-parser": "^1.4.5", "cookie-parser": "^1.4.5",
"email-templates": "^8.0.0", "email-templates": "^8.0.0",
"express": "^4.17.1", "express": "^4.17.1",
"express-openapi-validator": "^3.16.15", "express-openapi-validator": "^4.8.0",
"express-session": "^1.17.1", "express-session": "^1.17.1",
"formik": "^2.2.1", "formik": "^2.2.1",
"intl": "^1.2.5", "intl": "^1.2.5",

@ -9,7 +9,7 @@ import session, { Store } from 'express-session';
import { TypeormStore } from 'connect-typeorm/out'; import { TypeormStore } from 'connect-typeorm/out';
import YAML from 'yamljs'; import YAML from 'yamljs';
import swaggerUi from 'swagger-ui-express'; import swaggerUi from 'swagger-ui-express';
import { OpenApiValidator } from 'express-openapi-validator'; import * as OpenApiValidator from 'express-openapi-validator';
import { Session } from './entity/Session'; import { Session } from './entity/Session';
import { getSettings } from './lib/settings'; import { getSettings } from './lib/settings';
import logger from './logger'; import logger from './logger';
@ -61,11 +61,12 @@ app
); );
const apiDocs = YAML.load(API_SPEC_PATH); const apiDocs = YAML.load(API_SPEC_PATH);
server.use('/api-docs', swaggerUi.serve, swaggerUi.setup(apiDocs)); server.use('/api-docs', swaggerUi.serve, swaggerUi.setup(apiDocs));
await new OpenApiValidator({ server.use(
OpenApiValidator.middleware({
apiSpec: API_SPEC_PATH, apiSpec: API_SPEC_PATH,
validateRequests: true, validateRequests: true,
validateResponses: true, })
}).install(server); );
/** /**
* This is a workaround to convert dates to strings before they are validated by * This is a workaround to convert dates to strings before they are validated by
* OpenAPI validator. Otherwise, they are treated as objects instead of strings * OpenAPI validator. Otherwise, they are treated as objects instead of strings

@ -12,8 +12,8 @@ const mediaRoutes = Router();
mediaRoutes.get('/', async (req, res, next) => { mediaRoutes.get('/', async (req, res, next) => {
const mediaRepository = getRepository(Media); const mediaRepository = getRepository(Media);
const pageSize = Number(req.query.take) ?? 20; const pageSize = req.query.take ? Number(req.query.take) : 20;
const skip = Number(req.query.skip) ?? 0; const skip = req.query.skip ? Number(req.query.skip) : 0;
let statusFilter: let statusFilter:
| MediaStatus | MediaStatus

@ -15,8 +15,8 @@ const requestRoutes = Router();
requestRoutes.get('/', async (req, res, next) => { requestRoutes.get('/', async (req, res, next) => {
const requestRepository = getRepository(MediaRequest); const requestRepository = getRepository(MediaRequest);
try { try {
const pageSize = Number(req.query.take) ?? 20; const pageSize = req.query.take ? Number(req.query.take) : 20;
const skip = Number(req.query.skip) ?? 0; const skip = req.query.skip ? Number(req.query.skip) : 0;
let statusFilter: let statusFilter:
| MediaRequestStatus | MediaRequestStatus

@ -2579,7 +2579,7 @@ ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.3, ajv@^6.12.4:
json-schema-traverse "^0.4.1" json-schema-traverse "^0.4.1"
uri-js "^4.2.2" uri-js "^4.2.2"
ajv@^6.12.5: ajv@^6.12.5, ajv@^6.12.6:
version "6.12.6" version "6.12.6"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4"
integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==
@ -4715,14 +4715,6 @@ dayjs@^1.9.6:
resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.9.6.tgz#6f0c77d76ac1ff63720dd1197e5cb87b67943d70" resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.9.6.tgz#6f0c77d76ac1ff63720dd1197e5cb87b67943d70"
integrity sha512-HngNLtPEBWRo8EFVmHFmSXAjtCX8rGNqeXQI0Gh7wCTSqwaKgPIDqu9m07wABVopNwzvOeCb+2711vQhDlcIXw== integrity sha512-HngNLtPEBWRo8EFVmHFmSXAjtCX8rGNqeXQI0Gh7wCTSqwaKgPIDqu9m07wABVopNwzvOeCb+2711vQhDlcIXw==
deasync@^0.1.20:
version "0.1.20"
resolved "https://registry.yarnpkg.com/deasync/-/deasync-0.1.20.tgz#546fd2660688a1eeed55edce2308c5cf7104f9da"
integrity sha512-E1GI7jMI57hL30OX6Ht/hfQU8DO4AuB9m72WFm4c38GNbUD4Q03//XZaOIHZiY+H1xUaomcot5yk2q/qIZQkGQ==
dependencies:
bindings "^1.5.0"
node-addon-api "^1.7.1"
debug@2.6.9, debug@^2.2.0, debug@^2.3.3: debug@2.6.9, debug@^2.2.0, debug@^2.3.3:
version "2.6.9" version "2.6.9"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
@ -5734,24 +5726,23 @@ expand-tilde@^2.0.0, expand-tilde@^2.0.2:
dependencies: dependencies:
homedir-polyfill "^1.0.1" homedir-polyfill "^1.0.1"
express-openapi-validator@^3.16.15: express-openapi-validator@^4.8.0:
version "3.16.15" version "4.8.0"
resolved "https://registry.yarnpkg.com/express-openapi-validator/-/express-openapi-validator-3.16.15.tgz#f382c2de474b373cadc0ce5ed5a2e7a4f1d5629f" resolved "https://registry.yarnpkg.com/express-openapi-validator/-/express-openapi-validator-4.8.0.tgz#f45d52728bd4efabd71c43c4a8424892173ffff9"
integrity sha512-Xd+lZ84iyV68KKk45ZQgkANtlDnpJ0KYcUgen8ASaS25svb5V/KF35zlzsqTNYz5KcpMDBHnueYFdCTzvIRxUA== integrity sha512-cDcMOiawm0ZCMKKltn0ySwQum6gSV8kxImc19UDu3Wu67GFDYe7qQHwmVcAISR/AxfpPkzum/LphYqZDfVRr1w==
dependencies: dependencies:
ajv "^6.12.4" ajv "^6.12.6"
content-type "^1.0.4" content-type "^1.0.4"
js-yaml "^3.14.0" js-yaml "^3.14.0"
json-schema-ref-parser "^9.0.6" json-schema-ref-parser "^9.0.6"
lodash.clonedeep "^4.5.0"
lodash.merge "^4.6.2" lodash.merge "^4.6.2"
lodash.uniq "^4.5.0" lodash.uniq "^4.5.0"
lodash.zipobject "^4.1.3" lodash.zipobject "^4.1.3"
media-typer "^1.1.0" media-typer "^1.1.0"
multer "^1.4.2" multer "^1.4.2"
ono "^7.1.3" ono "^7.1.3"
path-to-regexp "^6.1.0" path-to-regexp "^6.2.0"
optionalDependencies:
deasync "^0.1.20"
express-session@^1.15.6, express-session@^1.17.1: express-session@^1.15.6, express-session@^1.17.1:
version "1.17.1" version "1.17.1"
@ -9118,11 +9109,6 @@ node-addon-api@2.0.0:
resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.0.tgz#f9afb8d777a91525244b01775ea0ddbe1125483b" resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.0.tgz#f9afb8d777a91525244b01775ea0ddbe1125483b"
integrity sha512-ASCL5U13as7HhOExbT6OlWJJUV/lLzL2voOSP1UVehpRD8FbSrSDjfScK/KwAvVTI5AS6r4VwbOMlIqtvRidnA== integrity sha512-ASCL5U13as7HhOExbT6OlWJJUV/lLzL2voOSP1UVehpRD8FbSrSDjfScK/KwAvVTI5AS6r4VwbOMlIqtvRidnA==
node-addon-api@^1.7.1:
version "1.7.2"
resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-1.7.2.tgz#3df30b95720b53c24e59948b49532b662444f54d"
integrity sha512-ibPK3iA+vaY1eEjESkQkM0BbCqFOaZMiXRTtdB0u7b4djtY6JnsjvPdUHVMg6xQt3B8fpTTWHI9A+ADjM9frzg==
node-addon-api@^3.0.2: node-addon-api@^3.0.2:
version "3.0.2" version "3.0.2"
resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-3.0.2.tgz#04bc7b83fd845ba785bb6eae25bc857e1ef75681" resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-3.0.2.tgz#04bc7b83fd845ba785bb6eae25bc857e1ef75681"
@ -10200,10 +10186,10 @@ path-to-regexp@0.1.7:
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c"
integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=
path-to-regexp@^6.1.0: path-to-regexp@^6.2.0:
version "6.1.0" version "6.2.0"
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-6.1.0.tgz#0b18f88b7a0ce0bfae6a25990c909ab86f512427" resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-6.2.0.tgz#f7b3803336104c346889adece614669230645f38"
integrity sha512-h9DqehX3zZZDCEm+xbfU0ZmwCGFCAAraPJWMXJ4+v32NjZJilVg3k1TcKsRgIb8IQ/izZSaydDc1OhJCZvs2Dw== integrity sha512-f66KywYG6+43afgE/8j/GoiNyygk/bnoCbps++3ErRKsIYkGGupyv07R2Ok5m9i67Iqc+T2g1eAUGUPzWhYTyg==
path-type@^2.0.0: path-type@^2.0.0:
version "2.0.0" version "2.0.0"

Loading…
Cancel
Save