@nestjs/swagger
Advanced tools
Comparing version 5.3.0-next.1 to 6.0.0
@@ -6,4 +6,4 @@ "use strict"; | ||
function ApiBasicAuth(name = 'basic') { | ||
return api_security_decorator_1.ApiSecurity(name); | ||
return (0, api_security_decorator_1.ApiSecurity)(name); | ||
} | ||
exports.ApiBasicAuth = ApiBasicAuth; |
@@ -6,4 +6,4 @@ "use strict"; | ||
function ApiBearerAuth(name = 'bearer') { | ||
return api_security_decorator_1.ApiSecurity(name); | ||
return (0, api_security_decorator_1.ApiSecurity)(name); | ||
} | ||
exports.ApiBearerAuth = ApiBearerAuth; |
@@ -12,13 +12,13 @@ "use strict"; | ||
function ApiBody(options) { | ||
const [type, isArray] = helpers_1.getTypeIsArrayTuple(options.type, options.isArray); | ||
const param = Object.assign(Object.assign({ in: 'body' }, lodash_1.omit(options, 'enum')), { type, | ||
const [type, isArray] = (0, helpers_1.getTypeIsArrayTuple)(options.type, options.isArray); | ||
const param = Object.assign(Object.assign({ in: 'body' }, (0, lodash_1.omit)(options, 'enum')), { type, | ||
isArray }); | ||
if (enum_utils_1.isEnumArray(options)) { | ||
enum_utils_1.addEnumArraySchema(param, options); | ||
if ((0, enum_utils_1.isEnumArray)(options)) { | ||
(0, enum_utils_1.addEnumArraySchema)(param, options); | ||
} | ||
else if (enum_utils_1.isEnumDefined(options)) { | ||
enum_utils_1.addEnumSchema(param, options); | ||
else if ((0, enum_utils_1.isEnumDefined)(options)) { | ||
(0, enum_utils_1.addEnumSchema)(param, options); | ||
} | ||
return helpers_1.createParamDecorator(param, defaultBodyMetadata); | ||
return (0, helpers_1.createParamDecorator)(param, defaultBodyMetadata); | ||
} | ||
exports.ApiBody = ApiBody; |
@@ -7,4 +7,4 @@ "use strict"; | ||
function ApiConsumes(...mimeTypes) { | ||
return helpers_1.createMixedDecorator(constants_1.DECORATORS.API_CONSUMES, mimeTypes); | ||
return (0, helpers_1.createMixedDecorator)(constants_1.DECORATORS.API_CONSUMES, mimeTypes); | ||
} | ||
exports.ApiConsumes = ApiConsumes; |
@@ -6,4 +6,4 @@ "use strict"; | ||
function ApiCookieAuth(name = 'cookie') { | ||
return api_security_decorator_1.ApiSecurity(name); | ||
return (0, api_security_decorator_1.ApiSecurity)(name); | ||
} | ||
exports.ApiCookieAuth = ApiCookieAuth; |
@@ -7,4 +7,4 @@ "use strict"; | ||
function ApiExcludeController(disable = true) { | ||
return helpers_1.createClassDecorator(constants_1.DECORATORS.API_EXCLUDE_CONTROLLER, [disable]); | ||
return (0, helpers_1.createClassDecorator)(constants_1.DECORATORS.API_EXCLUDE_CONTROLLER, [disable]); | ||
} | ||
exports.ApiExcludeController = ApiExcludeController; |
@@ -7,3 +7,3 @@ "use strict"; | ||
function ApiExcludeEndpoint(disable = true) { | ||
return helpers_1.createMethodDecorator(constants_1.DECORATORS.API_EXCLUDE_ENDPOINT, { | ||
return (0, helpers_1.createMethodDecorator)(constants_1.DECORATORS.API_EXCLUDE_ENDPOINT, { | ||
disable | ||
@@ -10,0 +10,0 @@ }); |
@@ -12,6 +12,6 @@ "use strict"; | ||
const extensionObject = { | ||
[extensionKey]: lodash_1.clone(extensionProperties) | ||
[extensionKey]: (0, lodash_1.clone)(extensionProperties) | ||
}; | ||
return helpers_1.createMixedDecorator(constants_1.DECORATORS.API_EXTENSION, extensionObject); | ||
return (0, helpers_1.createMixedDecorator)(constants_1.DECORATORS.API_EXTENSION, extensionObject); | ||
} | ||
exports.ApiExtension = ApiExtension; |
@@ -12,4 +12,4 @@ "use strict"; | ||
function ApiHeader(options) { | ||
const param = lodash_1.pickBy({ | ||
name: lodash_1.isNil(options.name) ? defaultHeaderOptions.name : options.name, | ||
const param = (0, lodash_1.pickBy)({ | ||
name: (0, lodash_1.isNil)(options.name) ? defaultHeaderOptions.name : options.name, | ||
in: 'header', | ||
@@ -19,8 +19,8 @@ description: options.description, | ||
schema: Object.assign(Object.assign({}, (options.schema || {})), { type: 'string' }) | ||
}, lodash_1.negate(lodash_1.isUndefined)); | ||
}, (0, lodash_1.negate)(lodash_1.isUndefined)); | ||
if (options.enum) { | ||
const enumValues = enum_utils_1.getEnumValues(options.enum); | ||
const enumValues = (0, enum_utils_1.getEnumValues)(options.enum); | ||
param.schema = { | ||
enum: enumValues, | ||
type: enum_utils_1.getEnumType(enumValues) | ||
type: (0, enum_utils_1.getEnumType)(enumValues) | ||
}; | ||
@@ -30,5 +30,5 @@ } | ||
if (descriptor) { | ||
return helpers_1.createParamDecorator(param, defaultHeaderOptions)(target, key, descriptor); | ||
return (0, helpers_1.createParamDecorator)(param, defaultHeaderOptions)(target, key, descriptor); | ||
} | ||
return helpers_1.createClassDecorator(constants_1.DECORATORS.API_HEADERS, [param])(target); | ||
return (0, helpers_1.createClassDecorator)(constants_1.DECORATORS.API_HEADERS, [param])(target); | ||
}; | ||
@@ -35,0 +35,0 @@ } |
@@ -6,4 +6,4 @@ "use strict"; | ||
function ApiOAuth2(scopes, name = 'oauth2') { | ||
return api_security_decorator_1.ApiSecurity(name, scopes); | ||
return (0, api_security_decorator_1.ApiSecurity)(name, scopes); | ||
} | ||
exports.ApiOAuth2 = ApiOAuth2; |
@@ -11,4 +11,4 @@ "use strict"; | ||
function ApiOperation(options) { | ||
return helpers_1.createMethodDecorator(constants_1.DECORATORS.API_OPERATION, lodash_1.pickBy(Object.assign(Object.assign({}, defaultOperationOptions), options), lodash_1.negate(lodash_1.isUndefined))); | ||
return (0, helpers_1.createMethodDecorator)(constants_1.DECORATORS.API_OPERATION, (0, lodash_1.pickBy)(Object.assign(Object.assign({}, defaultOperationOptions), options), (0, lodash_1.negate)(lodash_1.isUndefined))); | ||
} | ||
exports.ApiOperation = ApiOperation; |
@@ -12,3 +12,3 @@ "use strict"; | ||
function ApiParam(options) { | ||
const param = Object.assign({ name: lodash_1.isNil(options.name) ? defaultParamOptions.name : options.name, in: 'path' }, lodash_1.omit(options, 'enum')); | ||
const param = Object.assign({ name: (0, lodash_1.isNil)(options.name) ? defaultParamOptions.name : options.name, in: 'path' }, (0, lodash_1.omit)(options, 'enum')); | ||
const apiParamMetadata = options; | ||
@@ -18,4 +18,4 @@ if (apiParamMetadata.enum) { | ||
const paramSchema = param.schema; | ||
const enumValues = enum_utils_1.getEnumValues(apiParamMetadata.enum); | ||
paramSchema.type = enum_utils_1.getEnumType(enumValues); | ||
const enumValues = (0, enum_utils_1.getEnumValues)(apiParamMetadata.enum); | ||
paramSchema.type = (0, enum_utils_1.getEnumType)(enumValues); | ||
paramSchema.enum = enumValues; | ||
@@ -26,4 +26,4 @@ if (apiParamMetadata.enumName) { | ||
} | ||
return helpers_1.createParamDecorator(param, defaultParamOptions); | ||
return (0, helpers_1.createParamDecorator)(param, defaultParamOptions); | ||
} | ||
exports.ApiParam = ApiParam; |
@@ -7,4 +7,4 @@ "use strict"; | ||
function ApiProduces(...mimeTypes) { | ||
return helpers_1.createMixedDecorator(constants_1.DECORATORS.API_PRODUCES, mimeTypes); | ||
return (0, helpers_1.createMixedDecorator)(constants_1.DECORATORS.API_PRODUCES, mimeTypes); | ||
} | ||
exports.ApiProduces = ApiProduces; |
@@ -13,3 +13,3 @@ "use strict"; | ||
function createApiPropertyDecorator(options = {}, overrideExisting = true) { | ||
const [type, isArray] = helpers_1.getTypeIsArrayTuple(options.type, options.isArray); | ||
const [type, isArray] = (0, helpers_1.getTypeIsArrayTuple)(options.type, options.isArray); | ||
options = Object.assign(Object.assign({}, options), { type, | ||
@@ -19,5 +19,5 @@ isArray }); | ||
options.type = 'array'; | ||
const enumValues = enum_utils_1.getEnumValues(options.enum); | ||
const enumValues = (0, enum_utils_1.getEnumValues)(options.enum); | ||
options.items = { | ||
type: enum_utils_1.getEnumType(enumValues), | ||
type: (0, enum_utils_1.getEnumType)(enumValues), | ||
enum: enumValues | ||
@@ -28,5 +28,5 @@ }; | ||
else if (options.enum) { | ||
const enumValues = enum_utils_1.getEnumValues(options.enum); | ||
const enumValues = (0, enum_utils_1.getEnumValues)(options.enum); | ||
options.enum = enumValues; | ||
options.type = enum_utils_1.getEnumType(enumValues); | ||
options.type = (0, enum_utils_1.getEnumType)(enumValues); | ||
} | ||
@@ -42,3 +42,3 @@ if (Array.isArray(options.type)) { | ||
} | ||
return helpers_1.createPropertyDecorator(constants_1.DECORATORS.API_MODEL_PROPERTIES, options, overrideExisting); | ||
return (0, helpers_1.createPropertyDecorator)(constants_1.DECORATORS.API_MODEL_PROPERTIES, options, overrideExisting); | ||
} | ||
@@ -45,0 +45,0 @@ exports.createApiPropertyDecorator = createApiPropertyDecorator; |
@@ -13,9 +13,9 @@ "use strict"; | ||
const apiQueryMetadata = options; | ||
const [type, isArray] = helpers_1.getTypeIsArrayTuple(apiQueryMetadata.type, apiQueryMetadata.isArray); | ||
const param = Object.assign(Object.assign({ name: lodash_1.isNil(options.name) ? defaultQueryOptions.name : options.name, in: 'query' }, lodash_1.omit(options, 'enum')), { type }); | ||
if (enum_utils_1.isEnumArray(options)) { | ||
enum_utils_1.addEnumArraySchema(param, options); | ||
const [type, isArray] = (0, helpers_1.getTypeIsArrayTuple)(apiQueryMetadata.type, apiQueryMetadata.isArray); | ||
const param = Object.assign(Object.assign({ name: (0, lodash_1.isNil)(options.name) ? defaultQueryOptions.name : options.name, in: 'query' }, (0, lodash_1.omit)(options, 'enum')), { type }); | ||
if ((0, enum_utils_1.isEnumArray)(options)) { | ||
(0, enum_utils_1.addEnumArraySchema)(param, options); | ||
} | ||
else if (enum_utils_1.isEnumDefined(options)) { | ||
enum_utils_1.addEnumSchema(param, options); | ||
else if ((0, enum_utils_1.isEnumDefined)(options)) { | ||
(0, enum_utils_1.addEnumSchema)(param, options); | ||
} | ||
@@ -25,4 +25,4 @@ if (isArray) { | ||
} | ||
return helpers_1.createParamDecorator(param, defaultQueryOptions); | ||
return (0, helpers_1.createParamDecorator)(param, defaultQueryOptions); | ||
} | ||
exports.ApiQuery = ApiQuery; |
@@ -9,3 +9,3 @@ "use strict"; | ||
function ApiResponse(options) { | ||
const [type, isArray] = helpers_1.getTypeIsArrayTuple(options.type, options.isArray); | ||
const [type, isArray] = (0, helpers_1.getTypeIsArrayTuple)(options.type, options.isArray); | ||
options.type = type; | ||
@@ -15,3 +15,3 @@ options.isArray = isArray; | ||
const groupedMetadata = { | ||
[options.status || 'default']: lodash_1.omit(options, 'status') | ||
[options.status || 'default']: (0, lodash_1.omit)(options, 'status') | ||
}; | ||
@@ -18,0 +18,0 @@ return (target, key, descriptor) => { |
@@ -9,3 +9,3 @@ "use strict"; | ||
let metadata; | ||
if (lodash_1.isString(name)) { | ||
if ((0, lodash_1.isString)(name)) { | ||
metadata = [{ [name]: requirements }]; | ||
@@ -18,7 +18,7 @@ } | ||
if (descriptor) { | ||
metadata = extend_metadata_util_1.extendMetadata(metadata, constants_1.DECORATORS.API_SECURITY, descriptor.value); | ||
metadata = (0, extend_metadata_util_1.extendMetadata)(metadata, constants_1.DECORATORS.API_SECURITY, descriptor.value); | ||
Reflect.defineMetadata(constants_1.DECORATORS.API_SECURITY, metadata, descriptor.value); | ||
return descriptor; | ||
} | ||
metadata = extend_metadata_util_1.extendMetadata(metadata, constants_1.DECORATORS.API_SECURITY, target); | ||
metadata = (0, extend_metadata_util_1.extendMetadata)(metadata, constants_1.DECORATORS.API_SECURITY, target); | ||
Reflect.defineMetadata(constants_1.DECORATORS.API_SECURITY, metadata, target); | ||
@@ -25,0 +25,0 @@ return target; |
@@ -7,4 +7,4 @@ "use strict"; | ||
function ApiTags(...tags) { | ||
return helpers_1.createMixedDecorator(constants_1.DECORATORS.API_TAGS, tags); | ||
return (0, helpers_1.createMixedDecorator)(constants_1.DECORATORS.API_TAGS, tags); | ||
} | ||
exports.ApiTags = ApiTags; |
@@ -32,3 +32,3 @@ "use strict"; | ||
if (existingMetadata) { | ||
const newMetadata = lodash_1.pickBy(metadata, lodash_1.negate(lodash_1.isUndefined)); | ||
const newMetadata = (0, lodash_1.pickBy)(metadata, (0, lodash_1.negate)(lodash_1.isUndefined)); | ||
const metadataToSave = overrideExisting | ||
@@ -40,3 +40,3 @@ ? Object.assign(Object.assign({}, existingMetadata), newMetadata) : Object.assign(Object.assign({}, newMetadata), existingMetadata); | ||
const type = (_d = (_c = (_b = (_a = target === null || target === void 0 ? void 0 : target.constructor) === null || _a === void 0 ? void 0 : _a[plugin_constants_1.METADATA_FACTORY_NAME]) === null || _b === void 0 ? void 0 : _b.call(_a)[propertyKey]) === null || _c === void 0 ? void 0 : _c.type) !== null && _d !== void 0 ? _d : Reflect.getMetadata('design:type', target, propertyKey); | ||
Reflect.defineMetadata(metakey, Object.assign({ type }, lodash_1.pickBy(metadata, lodash_1.negate(lodash_1.isUndefined))), target, propertyKey); | ||
Reflect.defineMetadata(metakey, Object.assign({ type }, (0, lodash_1.pickBy)(metadata, (0, lodash_1.negate)(lodash_1.isUndefined))), target, propertyKey); | ||
} | ||
@@ -71,3 +71,3 @@ }; | ||
...parameters, | ||
Object.assign(Object.assign({}, initial), lodash_1.pickBy(metadata, lodash_1.negate(lodash_1.isUndefined))) | ||
Object.assign(Object.assign({}, initial), (0, lodash_1.pickBy)(metadata, (0, lodash_1.negate)(lodash_1.isUndefined))) | ||
], descriptor.value); | ||
@@ -85,3 +85,3 @@ return descriptor; | ||
} | ||
const isInputArray = lodash_1.isArray(input); | ||
const isInputArray = (0, lodash_1.isArray)(input); | ||
const type = isInputArray ? input[0] : input; | ||
@@ -88,0 +88,0 @@ return [type, isInputArray]; |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k; |
@@ -10,3 +10,3 @@ "use strict"; | ||
this.logger = new common_1.Logger(DocumentBuilder.name); | ||
this.document = document_base_1.buildDocumentBase(); | ||
this.document = (0, document_base_1.buildDocumentBase)(); | ||
} | ||
@@ -50,7 +50,7 @@ setTitle(title) { | ||
addTag(name, description = '', externalDocs) { | ||
this.document.tags = this.document.tags.concat(lodash_1.pickBy({ | ||
this.document.tags = this.document.tags.concat((0, lodash_1.pickBy)({ | ||
name, | ||
description, | ||
externalDocs | ||
}, lodash_1.negate(lodash_1.isUndefined))); | ||
}, (0, lodash_1.negate)(lodash_1.isUndefined))); | ||
return this; | ||
@@ -64,3 +64,3 @@ } | ||
let securityRequirement; | ||
if (lodash_1.isString(name)) { | ||
if ((0, lodash_1.isString)(name)) { | ||
securityRequirement = { [name]: requirements }; | ||
@@ -67,0 +67,0 @@ } |
@@ -19,4 +19,4 @@ "use strict"; | ||
const parametersMetadata = parameterMetadataAccessor.explore(instance, prototype, method); | ||
const noExplicitMetadata = lodash_1.isNil(explicitParameters); | ||
if (noExplicitMetadata && lodash_1.isNil(parametersMetadata)) { | ||
const noExplicitMetadata = (0, lodash_1.isNil)(explicitParameters); | ||
if (noExplicitMetadata && (0, lodash_1.isNil)(parametersMetadata)) { | ||
return undefined; | ||
@@ -27,6 +27,6 @@ } | ||
if (!noExplicitMetadata) { | ||
const mergeImplicitAndExplicit = (item) => lodash_1.assign(item, lodash_1.find(explicitParameters, ['name', item.name])); | ||
const mergeImplicitAndExplicit = (item) => (0, lodash_1.assign)(item, (0, lodash_1.find)(explicitParameters, ['name', item.name])); | ||
properties = removeBodyMetadataIfExplicitExists(properties, explicitParameters); | ||
properties = lodash_1.map(properties, mergeImplicitAndExplicit); | ||
properties = lodash_1.unionWith(properties, explicitParameters, (arrVal, othVal) => { | ||
properties = (0, lodash_1.map)(properties, mergeImplicitAndExplicit); | ||
properties = (0, lodash_1.unionWith)(properties, explicitParameters, (arrVal, othVal) => { | ||
return arrVal.name === othVal.name && arrVal.in === othVal.in; | ||
@@ -41,8 +41,8 @@ }); | ||
function removeBodyMetadataIfExplicitExists(properties, explicitParams) { | ||
const isBodyReflected = lodash_1.some(properties, (p) => p.in === 'body'); | ||
const isBodyDefinedExplicitly = lodash_1.some(explicitParams, (p) => p.in === 'body'); | ||
const isBodyReflected = (0, lodash_1.some)(properties, (p) => p.in === 'body'); | ||
const isBodyDefinedExplicitly = (0, lodash_1.some)(explicitParams, (p) => p.in === 'body'); | ||
if (isBodyReflected && isBodyDefinedExplicitly) { | ||
return lodash_1.omitBy(properties, (p) => p.in === 'body'); | ||
return (0, lodash_1.omitBy)(properties, (p) => p.in === 'body'); | ||
} | ||
return properties; | ||
} |
@@ -27,3 +27,3 @@ "use strict"; | ||
const methodProduces = Reflect.getMetadata(constants_2.DECORATORS.API_PRODUCES, method); | ||
const produces = merge_and_uniq_util_1.mergeAndUniq(lodash_1.get(classProduces, 'produces'), methodProduces); | ||
const produces = (0, merge_and_uniq_util_1.mergeAndUniq)((0, lodash_1.get)(classProduces, 'produces'), methodProduces); | ||
return mapResponsesToSwaggerResponses(responses, schemas, produces); | ||
@@ -51,7 +51,7 @@ } | ||
}; | ||
const omitParamType = (param) => lodash_1.omit(param, 'type'); | ||
const omitParamType = (param) => (0, lodash_1.omit)(param, 'type'); | ||
const mapResponsesToSwaggerResponses = (responses, schemas, produces = ['application/json']) => { | ||
produces = shared_utils_1.isEmpty(produces) ? ['application/json'] : produces; | ||
const openApiResponses = lodash_1.mapValues(responses, (response) => responseObjectFactory.create(response, produces, schemas)); | ||
return lodash_1.mapValues(openApiResponses, omitParamType); | ||
produces = (0, shared_utils_1.isEmpty)(produces) ? ['application/json'] : produces; | ||
const openApiResponses = (0, lodash_1.mapValues)(responses, (response) => responseObjectFactory.create(response, produces, schemas)); | ||
return (0, lodash_1.mapValues)(openApiResponses, omitParamType); | ||
}; |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k; |
export { OpenAPIObject } from './open-api-spec.interface'; | ||
export * from './swagger-custom-options.interface'; | ||
export * from './swagger-document-options.interface'; | ||
export * from './legacy-swagger-custom-options.interfaces'; |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -15,2 +19,1 @@ if (k2 === undefined) k2 = k; | ||
__exportStar(require("./swagger-document-options.interface"), exports); | ||
__exportStar(require("./legacy-swagger-custom-options.interfaces"), exports); |
@@ -11,3 +11,3 @@ "use strict"; | ||
const before = (options, program) => { | ||
options = merge_options_1.mergePluginOptions(options); | ||
options = (0, merge_options_1.mergePluginOptions)(options); | ||
return (ctx) => { | ||
@@ -14,0 +14,0 @@ return (sf) => { |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k; |
@@ -14,6 +14,6 @@ "use strict"; | ||
const mergePluginOptions = (options = {}) => { | ||
if (shared_utils_1.isString(options.dtoFileNameSuffix)) { | ||
if ((0, shared_utils_1.isString)(options.dtoFileNameSuffix)) { | ||
options.dtoFileNameSuffix = [options.dtoFileNameSuffix]; | ||
} | ||
if (shared_utils_1.isString(options.controllerFileNameSuffix)) { | ||
if ((0, shared_utils_1.isString)(options.controllerFileNameSuffix)) { | ||
options.controllerFileNameSuffix = [options.controllerFileNameSuffix]; | ||
@@ -20,0 +20,0 @@ } |
@@ -125,6 +125,6 @@ "use strict"; | ||
}); | ||
const leadingCommentRanges = typescript_1.getLeadingCommentRanges(sourceText, node.getFullStart()); | ||
const leadingCommentRanges = (0, typescript_1.getLeadingCommentRanges)(sourceText, node.getFullStart()); | ||
introspectCommentsAndExamples(leadingCommentRanges); | ||
if (!commentResult.length) { | ||
const trailingCommentRanges = typescript_1.getTrailingCommentRanges(sourceText, node.getFullStart()); | ||
const trailingCommentRanges = (0, typescript_1.getTrailingCommentRanges)(sourceText, node.getFullStart()); | ||
introspectCommentsAndExamples(trailingCommentRanges); | ||
@@ -146,3 +146,3 @@ } | ||
.expression; | ||
if (plugin_utils_1.isDynamicallyAdded(identifier)) { | ||
if ((0, plugin_utils_1.isDynamicallyAdded)(identifier)) { | ||
return undefined; | ||
@@ -149,0 +149,0 @@ } |
@@ -11,3 +11,3 @@ "use strict"; | ||
try { | ||
const decoratorName = ast_utils_1.getDecoratorName(item); | ||
const decoratorName = (0, ast_utils_1.getDecoratorName)(item); | ||
return names.includes(decoratorName); | ||
@@ -22,4 +22,4 @@ } | ||
function getTypeReferenceAsString(type, typeChecker) { | ||
if (ast_utils_1.isArray(type)) { | ||
const arrayType = ast_utils_1.getTypeArguments(type)[0]; | ||
if ((0, ast_utils_1.isArray)(type)) { | ||
const arrayType = (0, ast_utils_1.getTypeArguments)(type)[0]; | ||
const elementType = getTypeReferenceAsString(arrayType, typeChecker); | ||
@@ -31,17 +31,17 @@ if (!elementType) { | ||
} | ||
if (ast_utils_1.isBoolean(type)) { | ||
if ((0, ast_utils_1.isBoolean)(type)) { | ||
return Boolean.name; | ||
} | ||
if (ast_utils_1.isNumber(type)) { | ||
if ((0, ast_utils_1.isNumber)(type)) { | ||
return Number.name; | ||
} | ||
if (ast_utils_1.isBigInt(type)) { | ||
if ((0, ast_utils_1.isBigInt)(type)) { | ||
return BigInt.name; | ||
} | ||
if (ast_utils_1.isString(type) || ast_utils_1.isStringLiteral(type)) { | ||
if ((0, ast_utils_1.isString)(type) || (0, ast_utils_1.isStringLiteral)(type)) { | ||
return String.name; | ||
} | ||
if (isPromiseOrObservable(ast_utils_1.getText(type, typeChecker))) { | ||
const typeArguments = ast_utils_1.getTypeArguments(type); | ||
const elementType = getTypeReferenceAsString(lodash_1.head(typeArguments), typeChecker); | ||
if (isPromiseOrObservable((0, ast_utils_1.getText)(type, typeChecker))) { | ||
const typeArguments = (0, ast_utils_1.getTypeArguments)(type); | ||
const elementType = getTypeReferenceAsString((0, lodash_1.head)(typeArguments), typeChecker); | ||
if (!elementType) { | ||
@@ -53,6 +53,6 @@ return undefined; | ||
if (type.isClass()) { | ||
return ast_utils_1.getText(type, typeChecker); | ||
return (0, ast_utils_1.getText)(type, typeChecker); | ||
} | ||
try { | ||
const text = ast_utils_1.getText(type, typeChecker); | ||
const text = (0, ast_utils_1.getText)(type, typeChecker); | ||
if (text === Date.name) { | ||
@@ -72,7 +72,7 @@ return text; | ||
text === 'object' || | ||
ast_utils_1.isInterface(type) || | ||
(type.isUnionOrIntersection() && !ast_utils_1.isEnum(type))) { | ||
(0, ast_utils_1.isInterface)(type) || | ||
(type.isUnionOrIntersection() && !(0, ast_utils_1.isEnum)(type))) { | ||
return 'Object'; | ||
} | ||
if (ast_utils_1.isEnum(type)) { | ||
if ((0, ast_utils_1.isEnum)(type)) { | ||
return undefined; | ||
@@ -111,3 +111,3 @@ } | ||
try { | ||
if (path_1.isAbsolute(importPath)) { | ||
if ((0, path_1.isAbsolute)(importPath)) { | ||
throw {}; | ||
@@ -146,3 +146,3 @@ } | ||
function isAutoGeneratedEnumUnion(type, typeChecker) { | ||
if (type.isUnionOrIntersection() && !ast_utils_1.isEnum(type)) { | ||
if (type.isUnionOrIntersection() && !(0, ast_utils_1.isEnum)(type)) { | ||
if (!type.types) { | ||
@@ -182,3 +182,3 @@ return undefined; | ||
function isAutoGeneratedTypeUnion(type) { | ||
if (type.isUnionOrIntersection() && !ast_utils_1.isEnum(type)) { | ||
if (type.isUnionOrIntersection() && !(0, ast_utils_1.isEnum)(type)) { | ||
if (!type.types) { | ||
@@ -196,4 +196,4 @@ return false; | ||
function extractTypeArgumentIfArray(type) { | ||
if (ast_utils_1.isArray(type)) { | ||
type = ast_utils_1.getTypeArguments(type)[0]; | ||
if ((0, ast_utils_1.isArray)(type)) { | ||
type = (0, ast_utils_1.getTypeArguments)(type)[0]; | ||
if (!type) { | ||
@@ -200,0 +200,0 @@ return undefined; |
@@ -35,3 +35,3 @@ "use strict"; | ||
const existingDecorators = removeExistingApiOperationDecorator | ||
? compilerNode.decorators.filter((item) => ast_utils_1.getDecoratorName(item) !== decorators_1.ApiOperation.name) | ||
? compilerNode.decorators.filter((item) => (0, ast_utils_1.getDecoratorName)(item) !== decorators_1.ApiOperation.name) | ||
: compilerNode.decorators; | ||
@@ -51,5 +51,5 @@ return factory.updateMethodDeclaration(compilerNode, [ | ||
const keyToGenerate = options.controllerKeyOfComment; | ||
const apiOperationDecorator = plugin_utils_1.getDecoratorOrUndefinedByNames([decorators_1.ApiOperation.name], nodeArray); | ||
const apiOperationDecorator = (0, plugin_utils_1.getDecoratorOrUndefinedByNames)([decorators_1.ApiOperation.name], nodeArray); | ||
const apiOperationExpr = apiOperationDecorator && | ||
lodash_1.head(ast_utils_1.getDecoratorArguments(apiOperationDecorator)); | ||
(0, lodash_1.head)((0, ast_utils_1.getDecoratorArguments)(apiOperationDecorator)); | ||
const apiOperationExprProperties = apiOperationExpr && | ||
@@ -60,4 +60,4 @@ apiOperationExpr.properties; | ||
!apiOperationExprProperties || | ||
!plugin_utils_1.hasPropertyKey(keyToGenerate, apiOperationExprProperties)) { | ||
const [extractedComments] = ast_utils_1.getMainCommentAndExamplesOfNode(node, sourceFile, typeChecker); | ||
!(0, plugin_utils_1.hasPropertyKey)(keyToGenerate, apiOperationExprProperties)) { | ||
const [extractedComments] = (0, ast_utils_1.getMainCommentAndExamplesOfNode)(node, sourceFile, typeChecker); | ||
if (!extractedComments) { | ||
@@ -71,3 +71,3 @@ return []; | ||
const apiOperationDecoratorArguments = factory.createNodeArray([ | ||
factory.createObjectLiteralExpression(lodash_1.compact(properties)) | ||
factory.createObjectLiteralExpression((0, lodash_1.compact)(properties)) | ||
]); | ||
@@ -95,6 +95,6 @@ if (apiOperationDecorator) { | ||
]; | ||
return factory.createObjectLiteralExpression(lodash_1.compact(properties)); | ||
return factory.createObjectLiteralExpression((0, lodash_1.compact)(properties)); | ||
} | ||
createTypePropertyAssignment(factory, node, typeChecker, existingProperties, hostFilename) { | ||
if (plugin_utils_1.hasPropertyKey('type', existingProperties)) { | ||
if ((0, plugin_utils_1.hasPropertyKey)('type', existingProperties)) { | ||
return undefined; | ||
@@ -107,3 +107,3 @@ } | ||
} | ||
let typeReference = plugin_utils_1.getTypeReferenceAsString(type, typeChecker); | ||
let typeReference = (0, plugin_utils_1.getTypeReferenceAsString)(type, typeChecker); | ||
if (!typeReference) { | ||
@@ -115,7 +115,7 @@ return undefined; | ||
} | ||
typeReference = plugin_utils_1.replaceImportPath(typeReference, hostFilename); | ||
typeReference = (0, plugin_utils_1.replaceImportPath)(typeReference, hostFilename); | ||
return factory.createPropertyAssignment('type', factory.createIdentifier(typeReference)); | ||
} | ||
createStatusPropertyAssignment(factory, node, existingProperties) { | ||
if (plugin_utils_1.hasPropertyKey('status', existingProperties)) { | ||
if ((0, plugin_utils_1.hasPropertyKey)('status', existingProperties)) { | ||
return undefined; | ||
@@ -128,5 +128,5 @@ } | ||
const decorators = node.decorators; | ||
const httpCodeDecorator = plugin_utils_1.getDecoratorOrUndefinedByNames(['HttpCode'], decorators); | ||
const httpCodeDecorator = (0, plugin_utils_1.getDecoratorOrUndefinedByNames)(['HttpCode'], decorators); | ||
if (httpCodeDecorator) { | ||
const argument = lodash_1.head(ast_utils_1.getDecoratorArguments(httpCodeDecorator)); | ||
const argument = (0, lodash_1.head)((0, ast_utils_1.getDecoratorArguments)(httpCodeDecorator)); | ||
if (argument) { | ||
@@ -136,3 +136,3 @@ return argument; | ||
} | ||
const postDecorator = plugin_utils_1.getDecoratorOrUndefinedByNames(['Post'], decorators); | ||
const postDecorator = (0, plugin_utils_1.getDecoratorOrUndefinedByNames)(['Post'], decorators); | ||
if (postDecorator) { | ||
@@ -139,0 +139,0 @@ return factory.createIdentifier('201'); |
@@ -18,3 +18,3 @@ "use strict"; | ||
const decorators = node.decorators; | ||
const hidePropertyDecorator = plugin_utils_1.getDecoratorOrUndefinedByNames([decorators_1.ApiHideProperty.name], decorators); | ||
const hidePropertyDecorator = (0, plugin_utils_1.getDecoratorOrUndefinedByNames)([decorators_1.ApiHideProperty.name], decorators); | ||
if (hidePropertyDecorator) { | ||
@@ -59,4 +59,4 @@ return node; | ||
...existingProperties, | ||
!plugin_utils_1.hasPropertyKey('required', existingProperties) && | ||
factory.createPropertyAssignment('required', ast_utils_1.createBooleanLiteral(factory, isRequired)), | ||
!(0, plugin_utils_1.hasPropertyKey)('required', existingProperties) && | ||
factory.createPropertyAssignment('required', (0, ast_utils_1.createBooleanLiteral)(factory, isRequired)), | ||
...this.createTypePropertyAssignments(factory, node.type, typeChecker, existingProperties, hostFilename), | ||
@@ -70,7 +70,7 @@ ...this.createDescriptionAndExamplePropertyAssigments(factory, node, typeChecker, existingProperties, options, sourceFile), | ||
} | ||
return factory.createObjectLiteralExpression(lodash_1.compact(lodash_1.flatten(properties))); | ||
return factory.createObjectLiteralExpression((0, lodash_1.compact)((0, lodash_1.flatten)(properties))); | ||
} | ||
createTypePropertyAssignments(factory, node, typeChecker, existingProperties, hostFilename) { | ||
const key = 'type'; | ||
if (plugin_utils_1.hasPropertyKey(key, existingProperties)) { | ||
if ((0, plugin_utils_1.hasPropertyKey)(key, existingProperties)) { | ||
return []; | ||
@@ -97,3 +97,3 @@ } | ||
if (isNullable) { | ||
const nullablePropertyAssignment = factory.createPropertyAssignment('nullable', ast_utils_1.createBooleanLiteral(factory, true)); | ||
const nullablePropertyAssignment = factory.createPropertyAssignment('nullable', (0, ast_utils_1.createBooleanLiteral)(factory, true)); | ||
resultArray.push(nullablePropertyAssignment); | ||
@@ -109,7 +109,7 @@ } | ||
} | ||
let typeReference = plugin_utils_1.getTypeReferenceAsString(type, typeChecker); | ||
let typeReference = (0, plugin_utils_1.getTypeReferenceAsString)(type, typeChecker); | ||
if (!typeReference) { | ||
return []; | ||
} | ||
typeReference = plugin_utils_1.replaceImportPath(typeReference, hostFilename); | ||
typeReference = (0, plugin_utils_1.replaceImportPath)(typeReference, hostFilename); | ||
return [ | ||
@@ -121,3 +121,3 @@ factory.createPropertyAssignment(key, factory.createArrowFunction(undefined, undefined, [], undefined, undefined, factory.createIdentifier(typeReference))) | ||
const key = 'enum'; | ||
if (plugin_utils_1.hasPropertyKey(key, existingProperties)) { | ||
if ((0, plugin_utils_1.hasPropertyKey)(key, existingProperties)) { | ||
return undefined; | ||
@@ -129,7 +129,7 @@ } | ||
} | ||
if (plugin_utils_1.isAutoGeneratedTypeUnion(type)) { | ||
if ((0, plugin_utils_1.isAutoGeneratedTypeUnion)(type)) { | ||
const types = type.types; | ||
type = types[types.length - 1]; | ||
} | ||
const typeIsArrayTuple = plugin_utils_1.extractTypeArgumentIfArray(type); | ||
const typeIsArrayTuple = (0, plugin_utils_1.extractTypeArgumentIfArray)(type); | ||
if (!typeIsArrayTuple) { | ||
@@ -141,5 +141,5 @@ return undefined; | ||
const isEnumMember = type.symbol && type.symbol.flags === ts.SymbolFlags.EnumMember; | ||
if (!ast_utils_1.isEnum(type) || isEnumMember) { | ||
if (!(0, ast_utils_1.isEnum)(type) || isEnumMember) { | ||
if (!isEnumMember) { | ||
type = plugin_utils_1.isAutoGeneratedEnumUnion(type, typeChecker); | ||
type = (0, plugin_utils_1.isAutoGeneratedEnumUnion)(type, typeChecker); | ||
} | ||
@@ -149,3 +149,3 @@ if (!type) { | ||
} | ||
const typeIsArrayTuple = plugin_utils_1.extractTypeArgumentIfArray(type); | ||
const typeIsArrayTuple = (0, plugin_utils_1.extractTypeArgumentIfArray)(type); | ||
if (!typeIsArrayTuple) { | ||
@@ -157,3 +157,3 @@ return undefined; | ||
} | ||
const enumRef = plugin_utils_1.replaceImportPath(ast_utils_1.getText(type, typeChecker), hostFilename); | ||
const enumRef = (0, plugin_utils_1.replaceImportPath)((0, ast_utils_1.getText)(type, typeChecker), hostFilename); | ||
const enumProperty = factory.createPropertyAssignment(key, factory.createIdentifier(enumRef)); | ||
@@ -169,3 +169,3 @@ if (isArrayType) { | ||
const key = 'default'; | ||
if (plugin_utils_1.hasPropertyKey(key, existingProperties)) { | ||
if ((0, plugin_utils_1.hasPropertyKey)(key, existingProperties)) { | ||
return undefined; | ||
@@ -193,3 +193,3 @@ } | ||
return [ | ||
factory.createPropertyAssignment('minimum', ast_utils_1.createPrimitiveLiteral(factory, 1)) | ||
factory.createPropertyAssignment('minimum', (0, ast_utils_1.createPrimitiveLiteral)(factory, 1)) | ||
]; | ||
@@ -199,9 +199,9 @@ }); | ||
return [ | ||
factory.createPropertyAssignment('maximum', ast_utils_1.createPrimitiveLiteral(factory, -1)) | ||
factory.createPropertyAssignment('maximum', (0, ast_utils_1.createPrimitiveLiteral)(factory, -1)) | ||
]; | ||
}); | ||
this.addPropertiesByValidationDecorator(factory, 'Length', decorators, assignments, (decoratorRef) => { | ||
const decoratorArguments = ast_utils_1.getDecoratorArguments(decoratorRef); | ||
const decoratorArguments = (0, ast_utils_1.getDecoratorArguments)(decoratorRef); | ||
const result = []; | ||
result.push(factory.createPropertyAssignment('minLength', lodash_1.head(decoratorArguments))); | ||
result.push(factory.createPropertyAssignment('minLength', (0, lodash_1.head)(decoratorArguments))); | ||
if (decoratorArguments.length > 1) { | ||
@@ -216,3 +216,3 @@ result.push(factory.createPropertyAssignment('maxLength', decoratorArguments[1])); | ||
this.addPropertiesByValidationDecorator(factory, decoratorName, decorators, assignments, (decoratorRef) => { | ||
const argument = lodash_1.head(ast_utils_1.getDecoratorArguments(decoratorRef)); | ||
const argument = (0, lodash_1.head)((0, ast_utils_1.getDecoratorArguments)(decoratorRef)); | ||
if (argument) { | ||
@@ -225,3 +225,3 @@ return [factory.createPropertyAssignment(propertyKey, argument)]; | ||
addPropertiesByValidationDecorator(factory, decoratorName, decorators, assignments, addPropertyAssignments) { | ||
const decoratorRef = plugin_utils_1.getDecoratorOrUndefinedByNames([decoratorName], decorators); | ||
const decoratorRef = (0, plugin_utils_1.getDecoratorOrUndefinedByNames)([decoratorName], decorators); | ||
if (!decoratorRef) { | ||
@@ -250,10 +250,10 @@ return; | ||
const propertyAssignments = []; | ||
const [comments, examples] = ast_utils_1.getMainCommentAndExamplesOfNode(node, sourceFile, typeChecker, true); | ||
const [comments, examples] = (0, ast_utils_1.getMainCommentAndExamplesOfNode)(node, sourceFile, typeChecker, true); | ||
const keyOfComment = options.dtoKeyOfComment; | ||
if (!plugin_utils_1.hasPropertyKey(keyOfComment, existingProperties) && comments) { | ||
if (!(0, plugin_utils_1.hasPropertyKey)(keyOfComment, existingProperties) && comments) { | ||
const descriptionPropertyAssignment = factory.createPropertyAssignment(keyOfComment, factory.createStringLiteral(comments)); | ||
propertyAssignments.push(descriptionPropertyAssignment); | ||
} | ||
const hasExampleOrExamplesKey = plugin_utils_1.hasPropertyKey('example', existingProperties) || | ||
plugin_utils_1.hasPropertyKey('examples', existingProperties); | ||
const hasExampleOrExamplesKey = (0, plugin_utils_1.hasPropertyKey)('example', existingProperties) || | ||
(0, plugin_utils_1.hasPropertyKey)('examples', existingProperties); | ||
if (!hasExampleOrExamplesKey && examples.length) { | ||
@@ -274,5 +274,5 @@ if (examples.length === 1) { | ||
? factory.createArrayLiteralExpression(item.map((item) => this.createLiteralFromAnyValue(factory, item))) | ||
: ast_utils_1.createPrimitiveLiteral(factory, item); | ||
: (0, ast_utils_1.createPrimitiveLiteral)(factory, item); | ||
} | ||
} | ||
exports.ModelClassVisitor = ModelClassVisitor; |
@@ -1,1 +0,1 @@ | ||
export declare const BUILT_IN_TYPES: (ObjectConstructor | ArrayConstructor | StringConstructor | NumberConstructor | BooleanConstructor)[]; | ||
export declare const BUILT_IN_TYPES: (ArrayConstructor | StringConstructor | ObjectConstructor | NumberConstructor | BooleanConstructor)[]; |
@@ -15,3 +15,3 @@ "use strict"; | ||
.filter(shared_utils_1.isString) | ||
.filter((key) => key.charAt(0) === ':' && !shared_utils_1.isFunction(prototype[key])) | ||
.filter((key) => key.charAt(0) === ':' && !(0, shared_utils_1.isFunction)(prototype[key])) | ||
.map((key) => key.slice(1)); | ||
@@ -31,3 +31,3 @@ } | ||
properties.forEach((key) => { | ||
api_property_decorator_1.createApiPropertyDecorator(metadata[key], false)(classPrototype, key); | ||
(0, api_property_decorator_1.createApiPropertyDecorator)(metadata[key], false)(classPrototype, key); | ||
}); | ||
@@ -34,0 +34,0 @@ } while ((prototype = Reflect.getPrototypeOf(prototype)) && |
@@ -13,3 +13,3 @@ "use strict"; | ||
const routeArgsMetadata = Reflect.getMetadata(constants_1.ROUTE_ARGS_METADATA, instance.constructor, method.name) || {}; | ||
const parametersWithType = lodash_1.mapValues(reverse_object_keys_util_1.reverseObjectKeys(routeArgsMetadata), (param) => ({ | ||
const parametersWithType = (0, lodash_1.mapValues)((0, reverse_object_keys_util_1.reverseObjectKeys)(routeArgsMetadata), (param) => ({ | ||
type: types[param.index], | ||
@@ -20,4 +20,4 @@ name: param.data, | ||
const excludePredicate = (val) => val.in === PARAM_TOKEN_PLACEHOLDER || (val.name && val.in === 'body'); | ||
const parameters = lodash_1.omitBy(lodash_1.mapValues(parametersWithType, (val, key) => (Object.assign(Object.assign({}, val), { in: this.mapParamType(key) }))), excludePredicate); | ||
return !lodash_1.isEmpty(parameters) ? parameters : undefined; | ||
const parameters = (0, lodash_1.omitBy)((0, lodash_1.mapValues)(parametersWithType, (val, key) => (Object.assign(Object.assign({}, val), { in: this.mapParamType(key) }))), excludePredicate); | ||
return !(0, lodash_1.isEmpty)(parameters) ? parameters : undefined; | ||
} | ||
@@ -24,0 +24,0 @@ mapParamType(key) { |
@@ -13,3 +13,3 @@ "use strict"; | ||
transformModelToProperties(parameters) { | ||
const properties = lodash_1.flatMap(parameters, (param) => { | ||
const properties = (0, lodash_1.flatMap)(parameters, (param) => { | ||
if (!param || param.type === Object) { | ||
@@ -21,4 +21,4 @@ return undefined; | ||
} | ||
if (is_body_parameter_util_1.isBodyParameter(param)) { | ||
const isCtor = param.type && shared_utils_1.isFunction(param.type); | ||
if ((0, is_body_parameter_util_1.isBodyParameter)(param)) { | ||
const isCtor = param.type && (0, shared_utils_1.isFunction)(param.type); | ||
const name = isCtor ? param.type.name : param.type; | ||
@@ -25,0 +25,0 @@ return Object.assign(Object.assign({}, param), { name }); |
@@ -21,8 +21,8 @@ "use strict"; | ||
const { type, isArray } = response; | ||
response = lodash_1.omit(response, ['isArray']); | ||
response = (0, lodash_1.omit)(response, ['isArray']); | ||
if (!type) { | ||
return this.responseObjectMapper.wrapSchemaWithContent(response, produces); | ||
} | ||
if (is_built_in_type_util_1.isBuiltInType(type)) { | ||
const typeName = type && lodash_1.isFunction(type) ? type.name : type; | ||
if ((0, is_built_in_type_util_1.isBuiltInType)(type)) { | ||
const typeName = type && (0, lodash_1.isFunction)(type) ? type.name : type; | ||
const swaggerType = this.swaggerTypesMapper.mapTypeToOpenAPIType(typeName); | ||
@@ -29,0 +29,0 @@ if (isArray) { |
@@ -16,3 +16,3 @@ "use strict"; | ||
items: { | ||
$ref: utils_1.getSchemaPath(name) | ||
$ref: (0, utils_1.getSchemaPath)(name) | ||
} | ||
@@ -25,3 +25,3 @@ } | ||
schema: { | ||
$ref: utils_1.getSchemaPath(name) | ||
$ref: (0, utils_1.getSchemaPath)(name) | ||
} | ||
@@ -37,5 +37,5 @@ })); | ||
}); | ||
return Object.assign(Object.assign({}, lodash_1.omit(response, 'schema')), content); | ||
return Object.assign(Object.assign({}, (0, lodash_1.omit)(response, 'schema')), content); | ||
} | ||
} | ||
exports.ResponseObjectMapper = ResponseObjectMapper; |
@@ -34,3 +34,5 @@ import { Type } from '@nestjs/common'; | ||
enumName?: string; | ||
default?: any; | ||
externalDocs?: import("../interfaces/open-api-spec.interface").ExternalDocumentationObject; | ||
description?: string; | ||
nullable?: boolean; | ||
@@ -51,5 +53,3 @@ discriminator?: import("../interfaces/open-api-spec.interface").DiscriminatorObject; | ||
patternProperties?: any; | ||
description?: string; | ||
format?: string; | ||
default?: any; | ||
title?: string; | ||
@@ -76,3 +76,5 @@ multipleOf?: number; | ||
enumName?: string; | ||
default?: any; | ||
externalDocs?: import("../interfaces/open-api-spec.interface").ExternalDocumentationObject; | ||
description?: string; | ||
nullable?: boolean; | ||
@@ -94,5 +96,3 @@ discriminator?: import("../interfaces/open-api-spec.interface").DiscriminatorObject; | ||
patternProperties?: any; | ||
description?: string; | ||
format?: string; | ||
default?: any; | ||
title?: string; | ||
@@ -99,0 +99,0 @@ multipleOf?: number; |
@@ -22,3 +22,3 @@ "use strict"; | ||
if (this.isLazyTypeFunc(param.type)) { | ||
[param.type, param.isArray] = helpers_1.getTypeIsArrayTuple(param.type(), undefined); | ||
[param.type, param.isArray] = (0, helpers_1.getTypeIsArrayTuple)(param.type(), undefined); | ||
} | ||
@@ -31,3 +31,3 @@ if (this.isPrimitiveType(param.type)) { | ||
} | ||
if (!is_body_parameter_util_1.isBodyParameter(param)) { | ||
if (!(0, is_body_parameter_util_1.isBodyParameter)(param)) { | ||
return this.createQueryOrParamSchema(param, schemas); | ||
@@ -37,5 +37,5 @@ } | ||
const name = param.name || modelName; | ||
const schema = Object.assign(Object.assign({}, (param.schema || {})), { $ref: utils_1.getSchemaPath(modelName) }); | ||
const schema = Object.assign(Object.assign({}, (param.schema || {})), { $ref: (0, utils_1.getSchemaPath)(modelName) }); | ||
const isArray = param.isArray; | ||
param = lodash_1.omit(param, 'isArray'); | ||
param = (0, lodash_1.omit)(param, 'isArray'); | ||
if (isArray) { | ||
@@ -50,3 +50,3 @@ return Object.assign(Object.assign({}, param), { name, schema: { | ||
}); | ||
return lodash_1.flatten(parameterObjects); | ||
return (0, lodash_1.flatten)(parameterObjects); | ||
} | ||
@@ -57,6 +57,6 @@ createQueryOrParamSchema(param, schemas) { | ||
} | ||
if (is_date_ctor_util_1.isDateCtor(param.type)) { | ||
if ((0, is_date_ctor_util_1.isDateCtor)(param.type)) { | ||
return Object.assign(Object.assign({ format: 'date-time' }, param), { type: 'string' }); | ||
} | ||
if (lodash_1.isFunction(param.type)) { | ||
if ((0, lodash_1.isFunction)(param.type)) { | ||
const propertiesWithType = this.extractPropertiesFromType(param.type, schemas); | ||
@@ -68,3 +68,3 @@ if (!propertiesWithType) { | ||
var _a; | ||
const parameterObject = Object.assign(Object.assign({}, lodash_1.omit(property, 'enumName')), { in: 'query', required: (_a = property.required) !== null && _a !== void 0 ? _a : true }); | ||
const parameterObject = Object.assign(Object.assign({}, (0, lodash_1.omit)(property, 'enumName')), { in: 'query', required: (_a = property.required) !== null && _a !== void 0 ? _a : true }); | ||
return parameterObject; | ||
@@ -80,3 +80,3 @@ }); | ||
} | ||
const extraModels = api_extra_models_explorer_1.exploreGlobalApiExtraModelsMetadata(type); | ||
const extraModels = (0, api_extra_models_explorer_1.exploreGlobalApiExtraModelsMetadata)(type); | ||
extraModels.forEach((item) => this.exploreModelSchema(item, schemas, pendingSchemasRefs)); | ||
@@ -105,3 +105,3 @@ this.modelPropertiesAccessor.applyMetadataFactory(prototype); | ||
type: 'object', | ||
properties: lodash_1.mapValues(lodash_1.keyBy(propertiesWithType, 'name'), (property) => lodash_1.omit(property, ['name', 'isArray', 'required', 'enumName'])) | ||
properties: (0, lodash_1.mapValues)((0, lodash_1.keyBy)(propertiesWithType, 'name'), (property) => (0, lodash_1.omit)(property, ['name', 'isArray', 'required', 'enumName'])) | ||
}; | ||
@@ -125,3 +125,3 @@ const typeDefinitionRequiredFields = propertiesWithType | ||
metadata.type = metadata.type(); | ||
[metadata.type, metadata.isArray] = helpers_1.getTypeIsArrayTuple(metadata.type, metadata.isArray); | ||
[metadata.type, metadata.isArray] = (0, helpers_1.getTypeIsArrayTuple)(metadata.type, metadata.isArray); | ||
} | ||
@@ -136,3 +136,3 @@ if (Array.isArray(metadata.type)) { | ||
const enumName = param.enumName; | ||
const $ref = utils_1.getSchemaPath(enumName); | ||
const $ref = (0, utils_1.getSchemaPath)(enumName); | ||
if (!(enumName in schemas)) { | ||
@@ -153,3 +153,3 @@ const _enum = param.enum | ||
: { $ref }; | ||
return lodash_1.omit(param, ['isArray', 'items', 'enumName', 'enum']); | ||
return (0, lodash_1.omit)(param, ['isArray', 'items', 'enumName', 'enum']); | ||
} | ||
@@ -161,3 +161,3 @@ createEnumSchemaType(key, metadata, schemas) { | ||
const enumName = metadata.enumName; | ||
const $ref = utils_1.getSchemaPath(enumName); | ||
const $ref = (0, utils_1.getSchemaPath)(enumName); | ||
if (!(enumName in schemas)) { | ||
@@ -178,6 +178,6 @@ schemas[enumName] = { | ||
} | ||
return lodash_1.omit(paramObject, pathsToOmit); | ||
return (0, lodash_1.omit)(paramObject, pathsToOmit); | ||
} | ||
createNotBuiltInTypeReference(key, metadata, trueMetadataType, schemas, pendingSchemaRefs) { | ||
if (shared_utils_1.isUndefined(trueMetadataType)) { | ||
if ((0, shared_utils_1.isUndefined)(trueMetadataType)) { | ||
throw new Error(`A circular dependency has been detected (property key: "${key}"). Please, make sure that each side of a bidirectional relationships are using lazy resolvers ("type: () => ClassType").`); | ||
@@ -190,3 +190,3 @@ } | ||
} | ||
const $ref = utils_1.getSchemaPath(schemaObjectName); | ||
const $ref = (0, utils_1.getSchemaPath)(schemaObjectName); | ||
if (metadata.isArray) { | ||
@@ -196,3 +196,3 @@ return this.transformToArraySchemaProperty(metadata, key, { $ref }); | ||
const keysToRemove = ['type', 'isArray', 'required']; | ||
const validMetadataObject = lodash_1.omit(metadata, keysToRemove); | ||
const validMetadataObject = (0, lodash_1.omit)(metadata, keysToRemove); | ||
const extraMetadataKeys = Object.keys(validMetadataObject); | ||
@@ -211,9 +211,9 @@ if (extraMetadataKeys.length > 0) { | ||
const [movedProperties, keysToMove] = this.extractPropertyModifiers(metadata); | ||
const schemaHost = Object.assign(Object.assign({}, lodash_1.omit(metadata, [...keysToRemove, ...keysToMove])), { name: metadata.name || key, type: 'array', items: lodash_1.isString(type) | ||
const schemaHost = Object.assign(Object.assign({}, (0, lodash_1.omit)(metadata, [...keysToRemove, ...keysToMove])), { name: metadata.name || key, type: 'array', items: (0, lodash_1.isString)(type) | ||
? Object.assign({ type }, movedProperties) : Object.assign(Object.assign({}, type), movedProperties) }); | ||
schemaHost.items = lodash_1.omitBy(schemaHost.items, shared_utils_1.isUndefined); | ||
schemaHost.items = (0, lodash_1.omitBy)(schemaHost.items, shared_utils_1.isUndefined); | ||
return schemaHost; | ||
} | ||
mapArrayCtorParam(param) { | ||
return Object.assign(Object.assign({}, lodash_1.omit(param, 'type')), { schema: { | ||
return Object.assign(Object.assign({}, (0, lodash_1.omit)(param, 'type')), { schema: { | ||
type: 'array', | ||
@@ -230,7 +230,7 @@ items: { | ||
const propertyCompilerMetadata = literalObj[key]; | ||
if (enum_utils_1.isEnumArray(propertyCompilerMetadata)) { | ||
if ((0, enum_utils_1.isEnumArray)(propertyCompilerMetadata)) { | ||
propertyCompilerMetadata.type = 'array'; | ||
const enumValues = enum_utils_1.getEnumValues(propertyCompilerMetadata.enum); | ||
const enumValues = (0, enum_utils_1.getEnumValues)(propertyCompilerMetadata.enum); | ||
propertyCompilerMetadata.items = { | ||
type: enum_utils_1.getEnumType(enumValues), | ||
type: (0, enum_utils_1.getEnumType)(enumValues), | ||
enum: enumValues | ||
@@ -241,9 +241,9 @@ }; | ||
else if (propertyCompilerMetadata.enum) { | ||
const enumValues = enum_utils_1.getEnumValues(propertyCompilerMetadata.enum); | ||
const enumValues = (0, enum_utils_1.getEnumValues)(propertyCompilerMetadata.enum); | ||
propertyCompilerMetadata.enum = enumValues; | ||
propertyCompilerMetadata.type = enum_utils_1.getEnumType(enumValues); | ||
propertyCompilerMetadata.type = (0, enum_utils_1.getEnumType)(enumValues); | ||
} | ||
const propertyMetadata = this.mergePropertyWithMetadata(key, Object, schemas, [], propertyCompilerMetadata); | ||
const keysToRemove = ['isArray', 'name']; | ||
const validMetadataObject = lodash_1.omit(propertyMetadata, keysToRemove); | ||
const validMetadataObject = (0, lodash_1.omit)(propertyMetadata, keysToRemove); | ||
properties[key] = validMetadataObject; | ||
@@ -261,3 +261,3 @@ }); | ||
const schemaMetadata = this.createSchemaMetadata(key, metadata, schemas, pendingSchemaRefs, type); | ||
return lodash_1.omit(schemaMetadata, ['isArray', 'name']); | ||
return (0, lodash_1.omit)(schemaMetadata, ['isArray', 'name']); | ||
} | ||
@@ -277,4 +277,4 @@ return { | ||
} | ||
if (lodash_1.isString(trueType)) { | ||
if (enum_utils_1.isEnumMetadata(metadata)) { | ||
if ((0, lodash_1.isString)(trueType)) { | ||
if ((0, enum_utils_1.isEnumMetadata)(metadata)) { | ||
return this.createEnumSchemaType(key, metadata, schemas); | ||
@@ -287,3 +287,3 @@ } | ||
} | ||
if (is_date_ctor_util_1.isDateCtor(trueType)) { | ||
if ((0, is_date_ctor_util_1.isDateCtor)(trueType)) { | ||
if (metadata.isArray) { | ||
@@ -300,3 +300,3 @@ return this.transformToArraySchemaProperty(metadata, key, { | ||
} | ||
if (!is_built_in_type_util_1.isBuiltInType(trueType)) { | ||
if (!(0, is_built_in_type_util_1.isBuiltInType)(trueType)) { | ||
return this.createNotBuiltInTypeReference(key, metadata, trueType, schemas, pendingSchemaRefs); | ||
@@ -323,10 +323,10 @@ } | ||
isPrimitiveType(type) { | ||
return (lodash_1.isFunction(type) && | ||
return ((0, lodash_1.isFunction)(type) && | ||
[String, Boolean, Number].some((item) => item === type)); | ||
} | ||
isLazyTypeFunc(type) { | ||
return lodash_1.isFunction(type) && type.name == 'type'; | ||
return (0, lodash_1.isFunction)(type) && type.name == 'type'; | ||
} | ||
getTypeName(type) { | ||
return type && lodash_1.isFunction(type) ? type.name : type; | ||
return type && (0, lodash_1.isFunction)(type) ? type.name : type; | ||
} | ||
@@ -360,5 +360,5 @@ isObjectLiteral(obj) { | ||
]; | ||
return [lodash_1.pick(metadata, modifierKeys), modifierKeys]; | ||
return [(0, lodash_1.pick)(metadata, modifierKeys), modifierKeys]; | ||
} | ||
} | ||
exports.SchemaObjectFactory = SchemaObjectFactory; |
@@ -23,6 +23,6 @@ "use strict"; | ||
const { type } = param; | ||
const typeName = type && lodash_1.isFunction(type) | ||
const typeName = type && (0, lodash_1.isFunction)(type) | ||
? this.mapTypeToOpenAPIType(type.name) | ||
: this.mapTypeToOpenAPIType(type); | ||
const paramWithTypeMetadata = lodash_1.omitBy(Object.assign(Object.assign({}, param), { type: typeName }), lodash_1.isUndefined); | ||
const paramWithTypeMetadata = (0, lodash_1.omitBy)(Object.assign(Object.assign({}, param), { type: typeName }), lodash_1.isUndefined); | ||
if (this.isEnumArrayType(paramWithTypeMetadata)) { | ||
@@ -34,3 +34,3 @@ return this.mapEnumArrayType(paramWithTypeMetadata, this.keysToRemove); | ||
} | ||
return Object.assign(Object.assign({}, lodash_1.omit(param, this.keysToRemove)), { schema: lodash_1.omitBy(Object.assign(Object.assign(Object.assign({}, this.getSchemaOptions(param)), (param.schema || {})), { enum: paramWithTypeMetadata.enum, type: paramWithTypeMetadata.type, $ref: paramWithTypeMetadata.$ref }), lodash_1.isUndefined) }); | ||
return Object.assign(Object.assign({}, (0, lodash_1.omit)(param, this.keysToRemove)), { schema: (0, lodash_1.omitBy)(Object.assign(Object.assign(Object.assign({}, this.getSchemaOptions(param)), (param.schema || {})), { enum: paramWithTypeMetadata.enum, type: paramWithTypeMetadata.type, $ref: paramWithTypeMetadata.$ref }), lodash_1.isUndefined) }); | ||
}); | ||
@@ -45,8 +45,8 @@ } | ||
mapEnumArrayType(param, keysToRemove) { | ||
return Object.assign(Object.assign({}, lodash_1.omit(param, keysToRemove)), { schema: Object.assign(Object.assign({}, this.getSchemaOptions(param)), { type: 'array', items: param.items }) }); | ||
return Object.assign(Object.assign({}, (0, lodash_1.omit)(param, keysToRemove)), { schema: Object.assign(Object.assign({}, this.getSchemaOptions(param)), { type: 'array', items: param.items }) }); | ||
} | ||
mapArrayType(param, keysToRemove) { | ||
const items = param.items || | ||
lodash_1.omitBy(Object.assign(Object.assign({}, (param.schema || {})), { enum: param.enum, type: this.mapTypeToOpenAPIType(param.type) }), lodash_1.isUndefined); | ||
return Object.assign(Object.assign({}, lodash_1.omit(param, keysToRemove)), { schema: Object.assign(Object.assign({}, this.getSchemaOptions(param)), { type: 'array', items }) }); | ||
(0, lodash_1.omitBy)(Object.assign(Object.assign({}, (param.schema || {})), { enum: param.enum, type: this.mapTypeToOpenAPIType(param.type) }), lodash_1.isUndefined); | ||
return Object.assign(Object.assign({}, (0, lodash_1.omit)(param, keysToRemove)), { schema: Object.assign(Object.assign({}, this.getSchemaOptions(param)), { type: 'array', items }) }); | ||
} | ||
@@ -56,3 +56,3 @@ getSchemaOptions(param) { | ||
const optionsObject = schemaKeys.reduce((acc, key) => (Object.assign(Object.assign({}, acc), { [key]: param[key] })), {}); | ||
return lodash_1.omitBy(optionsObject, lodash_1.isUndefined); | ||
return (0, lodash_1.omitBy)(optionsObject, lodash_1.isUndefined); | ||
} | ||
@@ -66,3 +66,3 @@ isEnumArrayType(param) { | ||
omitParamKeys(param) { | ||
return lodash_1.omit(param, this.keysToRemove); | ||
return (0, lodash_1.omit)(param, this.keysToRemove); | ||
} | ||
@@ -69,0 +69,0 @@ getSchemaOptionsKeys() { |
@@ -56,3 +56,3 @@ "use strict"; | ||
const self = this; | ||
const excludeController = api_exclude_controller_explorer_1.exploreApiExcludeControllerMetadata(metatype); | ||
const excludeController = (0, api_exclude_controller_explorer_1.exploreApiExcludeControllerMetadata)(metatype); | ||
if (excludeController) { | ||
@@ -62,13 +62,13 @@ return []; | ||
const globalMetadata = this.exploreGlobalMetadata(metatype); | ||
const ctrlExtraModels = api_extra_models_explorer_1.exploreGlobalApiExtraModelsMetadata(metatype); | ||
const ctrlExtraModels = (0, api_extra_models_explorer_1.exploreGlobalApiExtraModelsMetadata)(metatype); | ||
this.registerExtraModels(ctrlExtraModels); | ||
const denormalizedPaths = this.metadataScanner.scanFromPrototype(instance, prototype, (name) => { | ||
const targetCallback = prototype[name]; | ||
const excludeEndpoint = api_exclude_endpoint_explorer_1.exploreApiExcludeEndpointMetadata(instance, prototype, targetCallback); | ||
const excludeEndpoint = (0, api_exclude_endpoint_explorer_1.exploreApiExcludeEndpointMetadata)(instance, prototype, targetCallback); | ||
if (excludeEndpoint && excludeEndpoint.disable) { | ||
return; | ||
} | ||
const ctrlExtraModels = api_extra_models_explorer_1.exploreApiExtraModelsMetadata(instance, prototype, targetCallback); | ||
const ctrlExtraModels = (0, api_extra_models_explorer_1.exploreApiExtraModelsMetadata)(instance, prototype, targetCallback); | ||
this.registerExtraModels(ctrlExtraModels); | ||
const methodMetadata = lodash_1.mapValues(documentResolvers, (explorers) => explorers.reduce((metadata, fn) => { | ||
const methodMetadata = (0, lodash_1.mapValues)(documentResolvers, (explorers) => explorers.reduce((metadata, fn) => { | ||
const exploredMetadata = fn.call(self, instance, prototype, targetCallback, metatype, globalPrefix, modulePath, applicationConfig); | ||
@@ -78,3 +78,3 @@ if (!exploredMetadata) { | ||
} | ||
if (!lodash_1.isArray(exploredMetadata)) { | ||
if (!(0, lodash_1.isArray)(exploredMetadata)) { | ||
if (Array.isArray(metadata)) { | ||
@@ -85,3 +85,3 @@ return metadata.map((item) => (Object.assign(Object.assign({}, item), exploredMetadata))); | ||
} | ||
return lodash_1.isArray(metadata) | ||
return (0, lodash_1.isArray)(metadata) | ||
? [...metadata, ...exploredMetadata] | ||
@@ -93,12 +93,12 @@ : exploredMetadata; | ||
endpointMetadata = Object.assign(Object.assign({}, methodMetadata), { root: endpointMetadata }); | ||
const mergedMethodMetadata = this.mergeMetadata(globalMetadata, lodash_1.omitBy(endpointMetadata, lodash_1.isEmpty)); | ||
return this.migrateOperationSchema(Object.assign(Object.assign({ responses: {} }, lodash_1.omit(globalMetadata, 'chunks')), mergedMethodMetadata), prototype, targetCallback); | ||
const mergedMethodMetadata = this.mergeMetadata(globalMetadata, (0, lodash_1.omitBy)(endpointMetadata, lodash_1.isEmpty)); | ||
return this.migrateOperationSchema(Object.assign(Object.assign({ responses: {} }, (0, lodash_1.omit)(globalMetadata, 'chunks')), mergedMethodMetadata), prototype, targetCallback); | ||
}); | ||
} | ||
const mergedMethodMetadata = this.mergeMetadata(globalMetadata, lodash_1.omitBy(methodMetadata, lodash_1.isEmpty)); | ||
const mergedMethodMetadata = this.mergeMetadata(globalMetadata, (0, lodash_1.omitBy)(methodMetadata, lodash_1.isEmpty)); | ||
return [ | ||
this.migrateOperationSchema(Object.assign(Object.assign({ responses: {} }, lodash_1.omit(globalMetadata, 'chunks')), mergedMethodMetadata), prototype, targetCallback) | ||
this.migrateOperationSchema(Object.assign(Object.assign({ responses: {} }, (0, lodash_1.omit)(globalMetadata, 'chunks')), mergedMethodMetadata), prototype, targetCallback) | ||
]; | ||
}); | ||
return lodash_1.flatten(denormalizedPaths).filter((path) => { var _a; return (_a = path.root) === null || _a === void 0 ? void 0 : _a.path; }); | ||
return (0, lodash_1.flatten)(denormalizedPaths).filter((path) => { var _a; return (_a = path.root) === null || _a === void 0 ? void 0 : _a.path; }); | ||
} | ||
@@ -114,3 +114,3 @@ exploreGlobalMetadata(metatype) { | ||
.map((explorer) => explorer.call(explorer, metatype)) | ||
.filter((val) => !shared_utils_1.isUndefined(val)) | ||
.filter((val) => !(0, shared_utils_1.isUndefined)(val)) | ||
.reduce((curr, next) => { | ||
@@ -126,3 +126,3 @@ if (next.depth) { | ||
const methodPath = Reflect.getMetadata(constants_1.PATH_METADATA, method); | ||
if (shared_utils_1.isUndefined(methodPath)) { | ||
if ((0, shared_utils_1.isUndefined)(methodPath)) { | ||
return undefined; | ||
@@ -156,13 +156,13 @@ } | ||
validateRoutePath(path) { | ||
if (shared_utils_1.isUndefined(path)) { | ||
if ((0, shared_utils_1.isUndefined)(path)) { | ||
return ''; | ||
} | ||
if (Array.isArray(path)) { | ||
path = lodash_1.head(path); | ||
path = (0, lodash_1.head)(path); | ||
} | ||
let pathWithParams = ''; | ||
for (const item of pathToRegexp.parse(path)) { | ||
pathWithParams += shared_utils_1.isString(item) ? item : `${item.prefix}{${item.name}}`; | ||
pathWithParams += (0, shared_utils_1.isString)(item) ? item : `${item.prefix}{${item.name}}`; | ||
} | ||
return pathWithParams === '/' ? '' : shared_utils_1.addLeadingSlash(pathWithParams); | ||
return pathWithParams === '/' ? '' : (0, shared_utils_1.addLeadingSlash)(pathWithParams); | ||
} | ||
@@ -186,6 +186,6 @@ mergeMetadata(globalMetadata, methodMetadata) { | ||
chunks.forEach((chunk) => { | ||
methodMetadata = lodash_1.mapValues(methodMetadata, deepMerge(chunk)); | ||
methodMetadata = (0, lodash_1.mapValues)(methodMetadata, deepMerge(chunk)); | ||
}); | ||
} | ||
return lodash_1.mapValues(methodMetadata, deepMerge(globalMetadata)); | ||
return (0, lodash_1.mapValues)(methodMetadata, deepMerge(globalMetadata)); | ||
} | ||
@@ -196,3 +196,3 @@ deepMergeMetadata(globalValue, methodValue, maxDepth, currentDepthLevel = 0) { | ||
} | ||
return lodash_1.mapValues(methodValue, (value, key) => { | ||
return (0, lodash_1.mapValues)(methodValue, (value, key) => { | ||
if (key in globalValue) { | ||
@@ -205,3 +205,3 @@ return this.deepMergeMetadata(globalValue[key], methodValue[key], maxDepth, currentDepthLevel + 1); | ||
mergeValues(globalValue, methodValue) { | ||
if (!lodash_1.isArray(globalValue)) { | ||
if (!(0, lodash_1.isArray)(globalValue)) { | ||
return Object.assign(Object.assign({}, globalValue), methodValue); | ||
@@ -212,3 +212,3 @@ } | ||
migrateOperationSchema(document, prototype, method) { | ||
const parametersObject = lodash_1.get(document, 'root.parameters'); | ||
const parametersObject = (0, lodash_1.get)(document, 'root.parameters'); | ||
const requestBodyIndex = (parametersObject || []).findIndex(is_body_parameter_util_1.isBodyParameter); | ||
@@ -222,6 +222,6 @@ if (requestBodyIndex < 0) { | ||
const methodConsumes = Reflect.getMetadata(constants_2.DECORATORS.API_CONSUMES, method); | ||
let consumes = merge_and_uniq_util_1.mergeAndUniq(classConsumes, methodConsumes); | ||
consumes = lodash_1.isEmpty(consumes) ? ['application/json'] : consumes; | ||
let consumes = (0, merge_and_uniq_util_1.mergeAndUniq)(classConsumes, methodConsumes); | ||
consumes = (0, lodash_1.isEmpty)(consumes) ? ['application/json'] : consumes; | ||
const keysToRemove = ['schema', 'in', 'name', 'examples']; | ||
document.root.requestBody = Object.assign(Object.assign({}, lodash_1.omit(requestBody, keysToRemove)), this.mimetypeContentWrapper.wrap(consumes, lodash_1.pick(requestBody, ['schema', 'examples']))); | ||
document.root.requestBody = Object.assign(Object.assign({}, (0, lodash_1.omit)(requestBody, keysToRemove)), this.mimetypeContentWrapper.wrap(consumes, (0, lodash_1.pick)(requestBody, ['schema', 'examples']))); | ||
return document; | ||
@@ -228,0 +228,0 @@ } |
import { INestApplication } from '@nestjs/common'; | ||
import { OpenAPIObject, LegacySwaggerCustomOptions, SwaggerDocumentOptions } from './interfaces'; | ||
import { OpenAPIObject, SwaggerDocumentOptions, SwaggerCustomOptions } from './interfaces'; | ||
export declare class SwaggerModule { | ||
@@ -7,3 +7,3 @@ static createDocument(app: INestApplication, config: Omit<OpenAPIObject, 'paths'>, options?: SwaggerDocumentOptions): OpenAPIObject; | ||
private static serveDocuments; | ||
static setup(path: string, app: INestApplication, document: OpenAPIObject, options?: LegacySwaggerCustomOptions): void; | ||
static setup(path: string, app: INestApplication, document: OpenAPIObject, options?: SwaggerCustomOptions): void; | ||
} |
@@ -10,3 +10,2 @@ "use strict"; | ||
const swagger_ui_1 = require("./swagger-ui"); | ||
const backward_compatilibity_layer_1 = require("./backward-compatilibity-layer"); | ||
class SwaggerModule { | ||
@@ -16,3 +15,3 @@ static createDocument(app, config, options = {}) { | ||
const document = swaggerScanner.scanApplication(app, options); | ||
document.components = assign_two_levels_deep_1.assignTwoLevelsDeep({}, config.components, document.components); | ||
document.components = (0, assign_two_levels_deep_1.assignTwoLevelsDeep)({}, config.components, document.components); | ||
return Object.assign(Object.assign({ openapi: '3.0.0', paths: {} }, config), document); | ||
@@ -56,19 +55,12 @@ } | ||
static setup(path, app, document, options) { | ||
const globalPrefix = get_global_prefix_1.getGlobalPrefix(app); | ||
const finalPath = validate_path_util_1.validatePath((options === null || options === void 0 ? void 0 : options.useGlobalPrefix) && globalPrefix && !globalPrefix.match(/^(\/?)$/) | ||
? `${globalPrefix}${validate_path_util_1.validatePath(path)}` | ||
const globalPrefix = (0, get_global_prefix_1.getGlobalPrefix)(app); | ||
const finalPath = (0, validate_path_util_1.validatePath)((options === null || options === void 0 ? void 0 : options.useGlobalPrefix) && globalPrefix && !globalPrefix.match(/^(\/?)$/) | ||
? `${globalPrefix}${(0, validate_path_util_1.validatePath)(path)}` | ||
: path); | ||
const { customOptions, extra } = backward_compatilibity_layer_1.processSwaggerOptions(options); | ||
const yamlDocument = jsyaml.dump(document); | ||
const jsonDocument = JSON.stringify(document); | ||
const html = swagger_ui_1.buildSwaggerHTML(finalPath, document, customOptions); | ||
const swaggerInitJS = swagger_ui_1.buildSwaggerInitJS(document, customOptions); | ||
const html = (0, swagger_ui_1.buildSwaggerHTML)(finalPath, document, options); | ||
const swaggerInitJS = (0, swagger_ui_1.buildSwaggerInitJS)(document, options); | ||
const httpAdapter = app.getHttpAdapter(); | ||
const isFastify = httpAdapter && httpAdapter.getType() === 'fastify'; | ||
if (isFastify) { | ||
backward_compatilibity_layer_1.serveDocumentsFastify(finalPath, httpAdapter, swaggerInitJS, yamlDocument, jsonDocument, html, extra); | ||
} | ||
else { | ||
SwaggerModule.serveDocuments(finalPath, httpAdapter, swaggerInitJS, yamlDocument, jsonDocument, html); | ||
} | ||
SwaggerModule.serveDocuments(finalPath, httpAdapter, swaggerInitJS, yamlDocument, jsonDocument, html); | ||
SwaggerModule.serveStatic(finalPath, app); | ||
@@ -75,0 +67,0 @@ } |
@@ -25,3 +25,3 @@ "use strict"; | ||
const globalPrefix = !ignoreGlobalPrefix | ||
? strip_last_slash_util_1.stripLastSlash(get_global_prefix_1.getGlobalPrefix(app)) | ||
? (0, strip_last_slash_util_1.stripLastSlash)((0, get_global_prefix_1.getGlobalPrefix)(app)) | ||
: ''; | ||
@@ -45,3 +45,3 @@ const denormalizedPaths = modules.map(({ routes, metatype, relatedModules }) => { | ||
this.addExtraModels(schemas, extraModels); | ||
return Object.assign(Object.assign({}, this.transformer.normalizePaths(lodash_1.flatten(denormalizedPaths))), { components: { | ||
return Object.assign(Object.assign({}, this.transformer.normalizePaths((0, lodash_1.flatten)(denormalizedPaths))), { components: { | ||
schemas: schemas | ||
@@ -52,6 +52,6 @@ } }); | ||
const denormalizedArray = [...routes.values()].map((ctrl) => this.explorer.exploreController(ctrl, applicationConfig, modulePath, globalPrefix, operationIdFactory)); | ||
return lodash_1.flatten(denormalizedArray); | ||
return (0, lodash_1.flatten)(denormalizedArray); | ||
} | ||
getModules(modulesContainer, include) { | ||
if (!include || lodash_1.isEmpty(include)) { | ||
if (!include || (0, lodash_1.isEmpty)(include)) { | ||
return [...modulesContainer.values()]; | ||
@@ -58,0 +58,0 @@ } |
@@ -7,8 +7,8 @@ "use strict"; | ||
normalizePaths(denormalizedDoc) { | ||
const roots = lodash_1.filter(denormalizedDoc, (r) => r.root); | ||
const groupedByPath = lodash_1.groupBy(roots, ({ root }) => root.path); | ||
const paths = lodash_1.mapValues(groupedByPath, (routes) => { | ||
const keyByMethod = lodash_1.keyBy(routes, ({ root }) => root.method); | ||
return lodash_1.mapValues(keyByMethod, (route) => { | ||
return Object.assign(Object.assign({}, lodash_1.omit(route.root, ['method', 'path'])), lodash_1.omit(route, 'root')); | ||
const roots = (0, lodash_1.filter)(denormalizedDoc, (r) => r.root); | ||
const groupedByPath = (0, lodash_1.groupBy)(roots, ({ root }) => root.path); | ||
const paths = (0, lodash_1.mapValues)(groupedByPath, (routes) => { | ||
const keyByMethod = (0, lodash_1.keyBy)(routes, ({ root }) => root.method); | ||
return (0, lodash_1.mapValues)(keyByMethod, (route) => { | ||
return Object.assign(Object.assign({}, (0, lodash_1.omit)(route.root, ['method', 'path'])), (0, lodash_1.omit)(route, 'root')); | ||
}); | ||
@@ -15,0 +15,0 @@ }); |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k; |
@@ -14,3 +14,3 @@ "use strict"; | ||
}; | ||
const jsInitOptions = helpers_1.buildJSInitOptions(swaggerInitOptions); | ||
const jsInitOptions = (0, helpers_1.buildJSInitOptions)(swaggerInitOptions); | ||
return constants_1.jsTemplateString.replace('<% swaggerOptions %>', jsInitOptions); | ||
@@ -17,0 +17,0 @@ } |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k; |
@@ -15,15 +15,15 @@ "use strict"; | ||
constructor() { | ||
mapped_types_1.inheritPropertyInitializers(this, classARef); | ||
mapped_types_1.inheritPropertyInitializers(this, classBRef); | ||
(0, mapped_types_1.inheritPropertyInitializers)(this, classARef); | ||
(0, mapped_types_1.inheritPropertyInitializers)(this, classBRef); | ||
} | ||
} | ||
mapped_types_1.inheritValidationMetadata(classARef, IntersectionTypeClass); | ||
mapped_types_1.inheritTransformationMetadata(classARef, IntersectionTypeClass); | ||
mapped_types_1.inheritValidationMetadata(classBRef, IntersectionTypeClass); | ||
mapped_types_1.inheritTransformationMetadata(classBRef, IntersectionTypeClass); | ||
mapped_types_utils_1.clonePluginMetadataFactory(IntersectionTypeClass, classARef.prototype); | ||
mapped_types_utils_1.clonePluginMetadataFactory(IntersectionTypeClass, classBRef.prototype); | ||
(0, mapped_types_1.inheritValidationMetadata)(classARef, IntersectionTypeClass); | ||
(0, mapped_types_1.inheritTransformationMetadata)(classARef, IntersectionTypeClass); | ||
(0, mapped_types_1.inheritValidationMetadata)(classBRef, IntersectionTypeClass); | ||
(0, mapped_types_1.inheritTransformationMetadata)(classBRef, IntersectionTypeClass); | ||
(0, mapped_types_utils_1.clonePluginMetadataFactory)(IntersectionTypeClass, classARef.prototype); | ||
(0, mapped_types_utils_1.clonePluginMetadataFactory)(IntersectionTypeClass, classBRef.prototype); | ||
fieldsOfA.forEach((propertyKey) => { | ||
const metadata = Reflect.getMetadata(constants_1.DECORATORS.API_MODEL_PROPERTIES, classARef.prototype, propertyKey); | ||
const decoratorFactory = decorators_1.ApiProperty(metadata); | ||
const decoratorFactory = (0, decorators_1.ApiProperty)(metadata); | ||
decoratorFactory(IntersectionTypeClass.prototype, propertyKey); | ||
@@ -33,3 +33,3 @@ }); | ||
const metadata = Reflect.getMetadata(constants_1.DECORATORS.API_MODEL_PROPERTIES, classBRef.prototype, propertyKey); | ||
const decoratorFactory = decorators_1.ApiProperty(metadata); | ||
const decoratorFactory = (0, decorators_1.ApiProperty)(metadata); | ||
decoratorFactory(IntersectionTypeClass.prototype, propertyKey); | ||
@@ -36,0 +36,0 @@ }); |
@@ -18,11 +18,11 @@ "use strict"; | ||
constructor() { | ||
mapped_types_1.inheritPropertyInitializers(this, classRef, isInheritedPredicate); | ||
(0, mapped_types_1.inheritPropertyInitializers)(this, classRef, isInheritedPredicate); | ||
} | ||
} | ||
mapped_types_1.inheritValidationMetadata(classRef, OmitTypeClass, isInheritedPredicate); | ||
mapped_types_1.inheritTransformationMetadata(classRef, OmitTypeClass, isInheritedPredicate); | ||
mapped_types_utils_1.clonePluginMetadataFactory(OmitTypeClass, classRef.prototype, (metadata) => lodash_1.omit(metadata, keys)); | ||
(0, mapped_types_1.inheritValidationMetadata)(classRef, OmitTypeClass, isInheritedPredicate); | ||
(0, mapped_types_1.inheritTransformationMetadata)(classRef, OmitTypeClass, isInheritedPredicate); | ||
(0, mapped_types_utils_1.clonePluginMetadataFactory)(OmitTypeClass, classRef.prototype, (metadata) => (0, lodash_1.omit)(metadata, keys)); | ||
fields.forEach((propertyKey) => { | ||
const metadata = Reflect.getMetadata(constants_1.DECORATORS.API_MODEL_PROPERTIES, classRef.prototype, propertyKey); | ||
const decoratorFactory = decorators_1.ApiProperty(metadata); | ||
const decoratorFactory = (0, decorators_1.ApiProperty)(metadata); | ||
decoratorFactory(OmitTypeClass.prototype, propertyKey); | ||
@@ -29,0 +29,0 @@ }); |
@@ -16,17 +16,17 @@ "use strict"; | ||
constructor() { | ||
mapped_types_1.inheritPropertyInitializers(this, classRef); | ||
(0, mapped_types_1.inheritPropertyInitializers)(this, classRef); | ||
} | ||
} | ||
mapped_types_1.inheritValidationMetadata(classRef, PartialTypeClass); | ||
mapped_types_1.inheritTransformationMetadata(classRef, PartialTypeClass); | ||
mapped_types_utils_1.clonePluginMetadataFactory(PartialTypeClass, classRef.prototype, (metadata) => lodash_1.mapValues(metadata, (item) => (Object.assign(Object.assign({}, item), { required: false })))); | ||
(0, mapped_types_1.inheritValidationMetadata)(classRef, PartialTypeClass); | ||
(0, mapped_types_1.inheritTransformationMetadata)(classRef, PartialTypeClass); | ||
(0, mapped_types_utils_1.clonePluginMetadataFactory)(PartialTypeClass, classRef.prototype, (metadata) => (0, lodash_1.mapValues)(metadata, (item) => (Object.assign(Object.assign({}, item), { required: false })))); | ||
fields.forEach((key) => { | ||
const metadata = Reflect.getMetadata(constants_1.DECORATORS.API_MODEL_PROPERTIES, classRef.prototype, key) || {}; | ||
const decoratorFactory = decorators_1.ApiProperty(Object.assign(Object.assign({}, metadata), { required: false })); | ||
const decoratorFactory = (0, decorators_1.ApiProperty)(Object.assign(Object.assign({}, metadata), { required: false })); | ||
decoratorFactory(PartialTypeClass.prototype, key); | ||
mapped_types_1.applyIsOptionalDecorator(PartialTypeClass, key); | ||
(0, mapped_types_1.applyIsOptionalDecorator)(PartialTypeClass, key); | ||
}); | ||
if (PartialTypeClass[plugin_constants_1.METADATA_FACTORY_NAME]) { | ||
const pluginFields = Object.keys(PartialTypeClass[plugin_constants_1.METADATA_FACTORY_NAME]()); | ||
pluginFields.forEach((key) => mapped_types_1.applyIsOptionalDecorator(PartialTypeClass, key)); | ||
pluginFields.forEach((key) => (0, mapped_types_1.applyIsOptionalDecorator)(PartialTypeClass, key)); | ||
} | ||
@@ -33,0 +33,0 @@ return PartialTypeClass; |
@@ -18,11 +18,11 @@ "use strict"; | ||
constructor() { | ||
mapped_types_1.inheritPropertyInitializers(this, classRef, isInheritedPredicate); | ||
(0, mapped_types_1.inheritPropertyInitializers)(this, classRef, isInheritedPredicate); | ||
} | ||
} | ||
mapped_types_1.inheritValidationMetadata(classRef, PickTypeClass, isInheritedPredicate); | ||
mapped_types_1.inheritTransformationMetadata(classRef, PickTypeClass, isInheritedPredicate); | ||
mapped_types_utils_1.clonePluginMetadataFactory(PickTypeClass, classRef.prototype, (metadata) => lodash_1.pick(metadata, keys)); | ||
(0, mapped_types_1.inheritValidationMetadata)(classRef, PickTypeClass, isInheritedPredicate); | ||
(0, mapped_types_1.inheritTransformationMetadata)(classRef, PickTypeClass, isInheritedPredicate); | ||
(0, mapped_types_utils_1.clonePluginMetadataFactory)(PickTypeClass, classRef.prototype, (metadata) => (0, lodash_1.pick)(metadata, keys)); | ||
fields.forEach((propertyKey) => { | ||
const metadata = Reflect.getMetadata(constants_1.DECORATORS.API_MODEL_PROPERTIES, classRef.prototype, propertyKey); | ||
const decoratorFactory = decorators_1.ApiProperty(metadata); | ||
const decoratorFactory = (0, decorators_1.ApiProperty)(metadata); | ||
decoratorFactory(PickTypeClass.prototype, propertyKey); | ||
@@ -29,0 +29,0 @@ }); |
@@ -6,3 +6,3 @@ "use strict"; | ||
function getSchemaPath(model) { | ||
const modelName = shared_utils_1.isString(model) ? model : model && model.name; | ||
const modelName = (0, shared_utils_1.isString)(model) ? model : model && model.name; | ||
return `#/components/schemas/${modelName}`; | ||
@@ -9,0 +9,0 @@ } |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k; |
@@ -7,4 +7,4 @@ "use strict"; | ||
function isBuiltInType(type) { | ||
return lodash_1.isFunction(type) && constants_1.BUILT_IN_TYPES.some((item) => item === type); | ||
return (0, lodash_1.isFunction)(type) && constants_1.BUILT_IN_TYPES.some((item) => item === type); | ||
} | ||
exports.isBuiltInType = isBuiltInType; |
@@ -6,4 +6,4 @@ "use strict"; | ||
function mergeAndUniq(a = [], b = []) { | ||
return lodash_1.uniq(lodash_1.merge(a, b)); | ||
return (0, lodash_1.uniq)((0, lodash_1.merge)(a, b)); | ||
} | ||
exports.mergeAndUniq = mergeAndUniq; |
{ | ||
"name": "@nestjs/swagger", | ||
"version": "5.3.0-next.1", | ||
"version": "6.0.0", | ||
"description": "Nest - modern, fast, powerful node.js web framework (@swagger)", | ||
@@ -31,42 +31,43 @@ "author": "Kamil Mysliwiec", | ||
"path-to-regexp": "3.2.0", | ||
"swagger-ui-dist": "4.10.3" | ||
"swagger-ui-dist": "4.12.0" | ||
}, | ||
"devDependencies": { | ||
"@commitlint/cli": "16.2.3", | ||
"@commitlint/config-angular": "16.2.3", | ||
"@nestjs/common": "8.4.4", | ||
"@nestjs/core": "8.4.4", | ||
"@nestjs/platform-express": "8.4.4", | ||
"@nestjs/platform-fastify": "8.4.4", | ||
"@types/jest": "27.4.1", | ||
"@commitlint/cli": "17.0.3", | ||
"@commitlint/config-angular": "17.0.3", | ||
"@fastify/static": "6.4.0", | ||
"@nestjs/common": "9.0.0", | ||
"@nestjs/core": "9.0.0", | ||
"@nestjs/platform-express": "9.0.0", | ||
"@nestjs/platform-fastify": "9.0.0", | ||
"@types/jest": "28.1.4", | ||
"@types/js-yaml": "4.0.5", | ||
"@types/lodash": "4.14.182", | ||
"@types/node": "16.11.27", | ||
"@typescript-eslint/eslint-plugin": "5.20.0", | ||
"@typescript-eslint/parser": "5.20.0", | ||
"@types/node": "17.0.35", | ||
"@typescript-eslint/eslint-plugin": "5.30.5", | ||
"@typescript-eslint/parser": "5.30.5", | ||
"class-transformer": "0.5.1", | ||
"class-validator": "0.13.2", | ||
"eslint": "8.13.0", | ||
"eslint": "8.19.0", | ||
"eslint-config-prettier": "8.5.0", | ||
"eslint-plugin-import": "2.26.0", | ||
"express": "4.17.3", | ||
"fastify-static": "4.6.1", | ||
"husky": "7.0.4", | ||
"jest": "27.5.1", | ||
"lint-staged": "12.3.8", | ||
"prettier": "2.6.2", | ||
"express": "4.18.1", | ||
"husky": "8.0.1", | ||
"jest": "28.1.2", | ||
"lint-staged": "13.0.3", | ||
"openapi-types": "11.1.0", | ||
"prettier": "2.7.1", | ||
"reflect-metadata": "0.1.13", | ||
"release-it": "14.14.2", | ||
"release-it": "15.1.1", | ||
"swagger-parser": "10.0.3", | ||
"ts-jest": "27.1.4", | ||
"typescript": "4.3.5" | ||
"ts-jest": "28.0.5", | ||
"typescript": "4.7.4" | ||
}, | ||
"peerDependencies": { | ||
"@nestjs/common": "^8.0.0", | ||
"@nestjs/core": "^8.0.0", | ||
"fastify-static": "^4.6.1", | ||
"@fastify/static": "^6.0.0", | ||
"@nestjs/common": "^9.0.0", | ||
"@nestjs/core": "^9.0.0", | ||
"reflect-metadata": "^0.1.12" | ||
}, | ||
"peerDependenciesMeta": { | ||
"fastify-static": { | ||
"@fastify/static": { | ||
"optional": true | ||
@@ -73,0 +74,0 @@ } |
<p align="center"> | ||
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo_text.svg" width="320" alt="Nest Logo" /></a> | ||
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="120" alt="Nest Logo" /></a> | ||
</p> | ||
<p align="center">A progressive <a href="http://nodejs.org" target="blank">Node.js</a> framework for building efficient and scalable server-side applications.</p> | ||
<p align="center"> | ||
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a> | ||
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a> | ||
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/dm/@nestjs/core.svg" alt="NPM Downloads" /></a> | ||
<a href="https://circleci.com/gh/nestjs/nest" target="_blank"><img src="https://img.shields.io/circleci/build/github/nestjs/nest/master" alt="CircleCI" /></a> | ||
<a href="https://coveralls.io/github/nestjs/nest?branch=master"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#5" alt="Coverage" /></a> | ||
<a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a> | ||
<a href="https://opencollective.com/nest#backer"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a> | ||
<a href="https://opencollective.com/nest#sponsor"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a> | ||
<p align="center">A progressive <a href="http://nodejs.org" target="blank">Node.js</a> framework for building efficient and scalable server-side applications.</p> | ||
<p align="center"> | ||
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a> | ||
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a> | ||
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/dm/@nestjs/core.svg" alt="NPM Downloads" /></a> | ||
<a href="https://circleci.com/gh/nestjs/nest" target="_blank"><img src="https://img.shields.io/circleci/build/github/nestjs/nest/master" alt="CircleCI" /></a> | ||
<a href="https://coveralls.io/github/nestjs/nest?branch=master"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#5" alt="Coverage" /></a> | ||
<a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a> | ||
<a href="https://opencollective.com/nest#backer"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a> | ||
<a href="https://opencollective.com/nest#sponsor"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a> | ||
<a href="https://paypal.me/kamilmysliwiec"><img src="https://img.shields.io/badge/Donate-PayPal-dc3d53.svg"/></a> | ||
@@ -28,3 +28,3 @@ <a href="https://twitter.com/nestframework"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow"></a> | ||
```bash | ||
$ npm i --save @nestjs/swagger | ||
$ npm i --save @nestjs/swagger | ||
``` | ||
@@ -31,0 +31,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
270693
5467
1
29
+ Added@fastify/accept-negotiator@1.1.0(transitive)
+ Added@fastify/send@2.1.0(transitive)
+ Added@fastify/static@6.12.0(transitive)
+ Added@lukeed/csprng@1.1.0(transitive)
+ Added@lukeed/ms@2.0.2(transitive)
+ Added@nestjs/common@9.4.3(transitive)
+ Added@nestjs/core@9.4.3(transitive)
+ Addedbrace-expansion@2.0.1(transitive)
+ Addeddepd@2.0.0(transitive)
+ Addedfast-decode-uri-component@1.0.1(transitive)
+ Addedfastify-plugin@4.5.1(transitive)
+ Addedglob@8.1.0(transitive)
+ Addedhttp-errors@2.0.0(transitive)
+ Addedmime@3.0.0(transitive)
+ Addedminimatch@5.1.6(transitive)
+ Addedstatuses@2.0.1(transitive)
+ Addedswagger-ui-dist@4.12.0(transitive)
+ Addedtslib@2.5.3(transitive)
+ Addeduid@2.0.2(transitive)
- Removed@nestjs/core@8.4.7(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removeddebug@2.6.9(transitive)
- Removeddepd@1.1.2(transitive)
- Removeddestroy@1.0.4(transitive)
- Removedee-first@1.1.1(transitive)
- Removedencodeurl@1.0.2(transitive)
- Removedencoding-negotiator@2.0.1(transitive)
- Removedetag@1.8.1(transitive)
- Removedfastify-plugin@3.0.1(transitive)
- Removedfastify-static@4.6.14.7.0(transitive)
- Removedfresh@0.5.2(transitive)
- Removedglob@7.2.3(transitive)
- Removedhttp-errors@1.8.1(transitive)
- Removedmime@1.6.0(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedms@2.0.02.1.3(transitive)
- Removedobject-hash@3.0.0(transitive)
- Removedon-finished@2.3.0(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedprocess-warning@1.0.0(transitive)
- Removedrange-parser@1.2.1(transitive)
- Removedreadable-stream@3.6.2(transitive)
- Removedsend@0.17.2(transitive)
- Removedstatuses@1.5.0(transitive)
- Removedstring_decoder@1.3.0(transitive)
- Removedswagger-ui-dist@4.10.3(transitive)
- Removedutil-deprecate@1.0.2(transitive)
Updatedswagger-ui-dist@4.12.0