@comparaonline/bff-utils
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -11,6 +11,6 @@ "use strict"; | ||
const responseJsonApiSchema = responseInterfaceName && | ||
(0, helpers_1.getJsonApiSchema)(responseInterfaceName, jsonApiCollectionName); | ||
return (0, common_1.applyDecorators)((0, common_1.Delete)(route), (0, common_1.Header)('Content-Type', constants_1.JSON_API_MEDIA_TYPE), (0, common_1.UseInterceptors)(interceptors_1.JsonApiHeaderValidationInterceptor), (0, swagger_1.ApiConsumes)(constants_1.JSON_API_MEDIA_TYPE), (0, swagger_1.ApiResponse)(Object.assign(Object.assign({ status: common_1.HttpStatus.OK, description }, (responseJsonApiSchema && { schema: responseJsonApiSchema })), (responseType && { type: responseType }))), (0, swagger_1.ApiProduces)(constants_1.JSON_API_MEDIA_TYPE)); | ||
helpers_1.getJsonApiSchema(responseInterfaceName, jsonApiCollectionName); | ||
return common_1.applyDecorators(common_1.Delete(route), common_1.Header('Content-Type', constants_1.JSON_API_MEDIA_TYPE), common_1.UseInterceptors(interceptors_1.JsonApiHeaderValidationInterceptor), swagger_1.ApiConsumes(constants_1.JSON_API_MEDIA_TYPE), swagger_1.ApiResponse(Object.assign(Object.assign({ status: common_1.HttpStatus.OK, description }, (responseJsonApiSchema && { schema: responseJsonApiSchema })), (responseType && { type: responseType }))), swagger_1.ApiProduces(constants_1.JSON_API_MEDIA_TYPE)); | ||
} | ||
exports.JsonApiEndpointDelete = JsonApiEndpointDelete; | ||
//# sourceMappingURL=json-api-endpoint-delete.js.map |
@@ -10,10 +10,10 @@ "use strict"; | ||
function JsonApiEndpointGet({ route, description, responseInterfaceName, collectionName, relatedResourcesConfiguration, metadataKey }) { | ||
const responseJsonApiSchema = (0, helpers_1.getJsonApiSchema)(responseInterfaceName, collectionName, relatedResourcesConfiguration, metadataKey); | ||
return (0, common_1.applyDecorators)((0, common_1.Get)(route), (0, common_1.UseInterceptors)(interceptors_1.JsonApiHeaderValidationInterceptor), (0, common_1.Header)('Content-Type', constants_1.JSON_API_MEDIA_TYPE), (0, swagger_1.ApiResponse)({ | ||
const responseJsonApiSchema = helpers_1.getJsonApiSchema(responseInterfaceName, collectionName, relatedResourcesConfiguration, metadataKey); | ||
return common_1.applyDecorators(common_1.Get(route), common_1.UseInterceptors(interceptors_1.JsonApiHeaderValidationInterceptor), common_1.Header('Content-Type', constants_1.JSON_API_MEDIA_TYPE), swagger_1.ApiResponse({ | ||
status: common_1.HttpStatus.OK, | ||
schema: responseJsonApiSchema, | ||
description | ||
}), (0, swagger_1.ApiProduces)(constants_1.JSON_API_MEDIA_TYPE)); | ||
}), swagger_1.ApiProduces(constants_1.JSON_API_MEDIA_TYPE)); | ||
} | ||
exports.JsonApiEndpointGet = JsonApiEndpointGet; | ||
//# sourceMappingURL=json-api-endpoint-get.js.map |
@@ -10,10 +10,10 @@ "use strict"; | ||
function JsonApiEndpointPost({ route, description, requestInterfaceName, responseInterfaceName, collectionName, responseType, relatedResourcesConfiguration, metadataKey, successfulHttpStatus }) { | ||
const requestJsonApiSchema = (0, helpers_1.getJsonApiSchema)(requestInterfaceName, collectionName, relatedResourcesConfiguration, metadataKey); | ||
const requestJsonApiSchema = helpers_1.getJsonApiSchema(requestInterfaceName, collectionName, relatedResourcesConfiguration, metadataKey); | ||
const responseJsonApiSchema = responseInterfaceName && | ||
(0, helpers_1.getJsonApiSchema)(responseInterfaceName, collectionName, relatedResourcesConfiguration, metadataKey); | ||
return (0, common_1.applyDecorators)((0, common_1.Post)(route), (0, common_1.Header)('Content-Type', constants_1.JSON_API_MEDIA_TYPE), (0, swagger_1.ApiBody)({ | ||
helpers_1.getJsonApiSchema(responseInterfaceName, collectionName, relatedResourcesConfiguration, metadataKey); | ||
return common_1.applyDecorators(common_1.Post(route), common_1.Header('Content-Type', constants_1.JSON_API_MEDIA_TYPE), swagger_1.ApiBody({ | ||
schema: requestJsonApiSchema | ||
}), (0, common_1.UseInterceptors)(interceptors_1.JsonApiHeaderValidationInterceptor, new interceptors_1.JsonApiBodyValidationInterceptor(requestJsonApiSchema), new interceptors_1.JsonApiDateTransformInterceptor(requestJsonApiSchema)), (0, swagger_1.ApiConsumes)(constants_1.JSON_API_MEDIA_TYPE), (0, swagger_1.ApiResponse)(Object.assign(Object.assign({ status: successfulHttpStatus || common_1.HttpStatus.CREATED, description }, (responseJsonApiSchema && { schema: responseJsonApiSchema })), (responseType && { type: responseType }))), (0, swagger_1.ApiProduces)(constants_1.JSON_API_MEDIA_TYPE)); | ||
}), common_1.UseInterceptors(interceptors_1.JsonApiHeaderValidationInterceptor, new interceptors_1.JsonApiBodyValidationInterceptor(requestJsonApiSchema), new interceptors_1.JsonApiDateTransformInterceptor(requestJsonApiSchema)), swagger_1.ApiConsumes(constants_1.JSON_API_MEDIA_TYPE), swagger_1.ApiResponse(Object.assign(Object.assign({ status: successfulHttpStatus || common_1.HttpStatus.CREATED, description }, (responseJsonApiSchema && { schema: responseJsonApiSchema })), (responseType && { type: responseType }))), swagger_1.ApiProduces(constants_1.JSON_API_MEDIA_TYPE)); | ||
} | ||
exports.JsonApiEndpointPost = JsonApiEndpointPost; | ||
//# sourceMappingURL=json-api-endpoint-post.js.map |
@@ -10,10 +10,10 @@ "use strict"; | ||
function JsonApiEndpointPut({ route, description, requestInterfaceName, responseInterfaceName, collectionName, responseType, relatedResourcesConfiguration, metadataKey }) { | ||
const requestJsonApiSchema = (0, helpers_1.getJsonApiSchema)(requestInterfaceName, collectionName, relatedResourcesConfiguration, metadataKey); | ||
const requestJsonApiSchema = helpers_1.getJsonApiSchema(requestInterfaceName, collectionName, relatedResourcesConfiguration, metadataKey); | ||
const responseJsonApiSchema = responseInterfaceName && | ||
(0, helpers_1.getJsonApiSchema)(responseInterfaceName, collectionName, relatedResourcesConfiguration, metadataKey); | ||
return (0, common_1.applyDecorators)((0, common_1.Put)(route), (0, common_1.Header)('Content-Type', constants_1.JSON_API_MEDIA_TYPE), (0, swagger_1.ApiBody)({ | ||
helpers_1.getJsonApiSchema(responseInterfaceName, collectionName, relatedResourcesConfiguration, metadataKey); | ||
return common_1.applyDecorators(common_1.Put(route), common_1.Header('Content-Type', constants_1.JSON_API_MEDIA_TYPE), swagger_1.ApiBody({ | ||
schema: requestJsonApiSchema | ||
}), (0, common_1.UseInterceptors)(interceptors_1.JsonApiHeaderValidationInterceptor, new interceptors_1.JsonApiBodyValidationInterceptor(requestJsonApiSchema), new interceptors_1.JsonApiDateTransformInterceptor(requestJsonApiSchema)), (0, swagger_1.ApiConsumes)(constants_1.JSON_API_MEDIA_TYPE), (0, swagger_1.ApiResponse)(Object.assign(Object.assign({ status: common_1.HttpStatus.OK, description }, (responseJsonApiSchema && { schema: responseJsonApiSchema })), (responseType && { type: responseType }))), (0, swagger_1.ApiProduces)(constants_1.JSON_API_MEDIA_TYPE)); | ||
}), common_1.UseInterceptors(interceptors_1.JsonApiHeaderValidationInterceptor, new interceptors_1.JsonApiBodyValidationInterceptor(requestJsonApiSchema), new interceptors_1.JsonApiDateTransformInterceptor(requestJsonApiSchema)), swagger_1.ApiConsumes(constants_1.JSON_API_MEDIA_TYPE), swagger_1.ApiResponse(Object.assign(Object.assign({ status: common_1.HttpStatus.OK, description }, (responseJsonApiSchema && { schema: responseJsonApiSchema })), (responseType && { type: responseType }))), swagger_1.ApiProduces(constants_1.JSON_API_MEDIA_TYPE)); | ||
} | ||
exports.JsonApiEndpointPut = JsonApiEndpointPut; | ||
//# sourceMappingURL=json-api-endpoint-put.js.map |
@@ -10,3 +10,3 @@ "use strict"; | ||
it('should return an empty object when interface does not exist', () => { | ||
const result = (0, json_api_schema_generator_1.getJsonApiSchema)('NonExistentInterface', 'test-collection-name'); | ||
const result = json_api_schema_generator_1.getJsonApiSchema('NonExistentInterface', 'test-collection-name'); | ||
expect(result).toEqual({}); | ||
@@ -13,0 +13,0 @@ }); |
@@ -7,3 +7,3 @@ "use strict"; | ||
it('should return an empty object when schema doesnt have the data property', () => { | ||
const result = (0, json_api_schema_helpers_1.addCollectionNameToSchema)({}, 'test-collection-name'); | ||
const result = json_api_schema_helpers_1.addCollectionNameToSchema({}, 'test-collection-name'); | ||
expect(result).toEqual({}); | ||
@@ -14,3 +14,3 @@ }); | ||
it('should return an empty object when schema doesnt have the data property', () => { | ||
const result = (0, json_api_schema_helpers_1.addRelationshipsToSchema)({}, []); | ||
const result = json_api_schema_helpers_1.addRelationshipsToSchema({}, []); | ||
expect(result).toEqual({}); | ||
@@ -21,3 +21,3 @@ }); | ||
it('should return an empty object when schema doesnt have the data property', () => { | ||
const result = (0, json_api_schema_helpers_1.removeKeyFromDataAttributes)({}, 'testProperty'); | ||
const result = json_api_schema_helpers_1.removeKeyFromDataAttributes({}, 'testProperty'); | ||
expect(result).toEqual({}); | ||
@@ -28,3 +28,3 @@ }); | ||
it('should return an empty object when schema doesnt have the data property', () => { | ||
const result = (0, json_api_schema_helpers_1.removeKeyFromDataProperties)({}, 'testProperty'); | ||
const result = json_api_schema_helpers_1.removeKeyFromDataProperties({}, 'testProperty'); | ||
expect(result).toEqual({}); | ||
@@ -31,0 +31,0 @@ }); |
@@ -13,3 +13,3 @@ "use strict"; | ||
}; | ||
const result = (0, json_schema_helpers_1.getPropertiesFromJsonSchema)(testSchema); | ||
const result = json_schema_helpers_1.getPropertiesFromJsonSchema(testSchema); | ||
expect(result).toEqual({}); | ||
@@ -23,3 +23,3 @@ }); | ||
}; | ||
const result = (0, json_schema_helpers_1.getPropertiesFromJsonSchema)(testSchema); | ||
const result = json_schema_helpers_1.getPropertiesFromJsonSchema(testSchema); | ||
expect(result).toEqual({}); | ||
@@ -43,3 +43,3 @@ }); | ||
}; | ||
const result = (0, json_schema_helpers_1.removeKeyFromSchemaProperties)(testSchema, ['prop1', 'prop2']); | ||
const result = json_schema_helpers_1.removeKeyFromSchemaProperties(testSchema, ['prop1', 'prop2']); | ||
expect(result.required).toEqual([]); | ||
@@ -46,0 +46,0 @@ }); |
@@ -12,6 +12,7 @@ "use strict"; | ||
try { | ||
schema = (0, json_schema_helpers_1.getJsonSchemaFromInterfaceName)(interfaceName); | ||
schema = json_schema_helpers_1.getJsonSchemaFromInterfaceName(interfaceName); | ||
} | ||
catch (e) { | ||
/* empty */ | ||
console.log('error generating schema ', e); | ||
} | ||
@@ -21,16 +22,16 @@ if (!schema) | ||
if (metadataKey) { | ||
schema = (0, json_api_schema_helpers_1.removeKeyFromDataAttributes)(schema, metadataKey); | ||
schema = json_api_schema_helpers_1.removeKeyFromDataAttributes(schema, metadataKey); | ||
} | ||
else { | ||
schema = (0, json_schema_helpers_1.removeKeyFromSchemaProperties)(schema, 'meta'); | ||
schema = json_schema_helpers_1.removeKeyFromSchemaProperties(schema, 'meta'); | ||
} | ||
schema = (0, json_api_schema_helpers_1.addCollectionNameToSchema)(schema, resourceCollectionName); | ||
schema = json_api_schema_helpers_1.addCollectionNameToSchema(schema, resourceCollectionName); | ||
if (relatedResourcesConfiguration) { | ||
schema = (0, json_api_schema_helpers_1.addRelationshipsToSchema)(schema, relatedResourcesConfiguration); | ||
return (0, json_api_schema_helpers_1.addIncludedResourcesToSchema)(schema, relatedResourcesConfiguration); | ||
schema = json_api_schema_helpers_1.addRelationshipsToSchema(schema, relatedResourcesConfiguration); | ||
return json_api_schema_helpers_1.addIncludedResourcesToSchema(schema, relatedResourcesConfiguration); | ||
} | ||
schema = (0, json_schema_helpers_1.removeKeyFromSchemaProperties)(schema, 'included'); | ||
return (0, json_api_schema_helpers_1.removeKeyFromDataProperties)(schema, 'relationships'); | ||
schema = json_schema_helpers_1.removeKeyFromSchemaProperties(schema, 'included'); | ||
return json_api_schema_helpers_1.removeKeyFromDataProperties(schema, 'relationships'); | ||
} | ||
exports.getJsonApiSchema = getJsonApiSchema; | ||
//# sourceMappingURL=json-api-schema-generator.js.map |
@@ -15,3 +15,3 @@ "use strict"; | ||
}, | ||
attributes: (0, json_schema_helpers_1.getJsonSchemaFromInterfaceName)(configuration.interfaceName) | ||
attributes: json_schema_helpers_1.getJsonSchemaFromInterfaceName(configuration.interfaceName) | ||
}, | ||
@@ -53,8 +53,8 @@ required: ['id', 'type', 'attributes'] | ||
}; | ||
const schemaProperties = (0, json_schema_helpers_1.getPropertiesFromJsonSchema)(schema); | ||
const schemaProperties = json_schema_helpers_1.getPropertiesFromJsonSchema(schema); | ||
const dataSchema = schemaProperties.data; | ||
if (!dataSchema) | ||
return {}; | ||
const newDataSchema = (0, json_schema_helpers_1.addPropertiesToJsonSchema)(dataSchema, typeProperty); | ||
return (0, json_schema_helpers_1.addPropertiesToJsonSchema)(schema, { | ||
const newDataSchema = json_schema_helpers_1.addPropertiesToJsonSchema(dataSchema, typeProperty); | ||
return json_schema_helpers_1.addPropertiesToJsonSchema(schema, { | ||
data: newDataSchema | ||
@@ -66,7 +66,7 @@ }); | ||
const keysToRemove = relatedResourcesConfiguration.map((configuration) => configuration.key); | ||
const schemaProperties = (0, json_schema_helpers_1.getPropertiesFromJsonSchema)(schema); | ||
const schemaProperties = json_schema_helpers_1.getPropertiesFromJsonSchema(schema); | ||
const dataSchema = schemaProperties.data; | ||
if (!dataSchema) | ||
return {}; | ||
const dataSchemaProperties = (0, json_schema_helpers_1.getPropertiesFromJsonSchema)(dataSchema); | ||
const dataSchemaProperties = json_schema_helpers_1.getPropertiesFromJsonSchema(dataSchema); | ||
const relationships = { | ||
@@ -78,8 +78,8 @@ properties: getRelationshipsProperties(relatedResourcesConfiguration), | ||
}; | ||
const attributes = (0, json_schema_helpers_1.removeKeyFromSchemaProperties)(dataSchemaProperties.attributes, keysToRemove); | ||
const newDataSchema = (0, json_schema_helpers_1.addPropertiesToJsonSchema)(dataSchema, { | ||
const attributes = json_schema_helpers_1.removeKeyFromSchemaProperties(dataSchemaProperties.attributes, keysToRemove); | ||
const newDataSchema = json_schema_helpers_1.addPropertiesToJsonSchema(dataSchema, { | ||
relationships, | ||
attributes | ||
}); | ||
return (0, json_schema_helpers_1.addPropertiesToJsonSchema)(schema, { | ||
return json_schema_helpers_1.addPropertiesToJsonSchema(schema, { | ||
data: newDataSchema | ||
@@ -90,3 +90,3 @@ }); | ||
function addIncludedResourcesToSchema(schema, relatedResourcesConfiguration) { | ||
return (0, json_schema_helpers_1.addPropertiesToJsonSchema)(schema, { | ||
return json_schema_helpers_1.addPropertiesToJsonSchema(schema, { | ||
included: { | ||
@@ -102,10 +102,10 @@ type: 'array', | ||
function removeKeyFromDataAttributes(schema, key) { | ||
const schemaProperties = (0, json_schema_helpers_1.getPropertiesFromJsonSchema)(schema); | ||
const schemaProperties = json_schema_helpers_1.getPropertiesFromJsonSchema(schema); | ||
const dataSchema = schemaProperties.data; | ||
if (!dataSchema) | ||
return {}; | ||
const dataSchemaProperties = (0, json_schema_helpers_1.getPropertiesFromJsonSchema)(dataSchema); | ||
const attributes = (0, json_schema_helpers_1.removeKeyFromSchemaProperties)(dataSchemaProperties.attributes, key); | ||
const newDataSchema = (0, json_schema_helpers_1.addPropertiesToJsonSchema)(dataSchema, { attributes }); | ||
return (0, json_schema_helpers_1.addPropertiesToJsonSchema)(schema, { | ||
const dataSchemaProperties = json_schema_helpers_1.getPropertiesFromJsonSchema(dataSchema); | ||
const attributes = json_schema_helpers_1.removeKeyFromSchemaProperties(dataSchemaProperties.attributes, key); | ||
const newDataSchema = json_schema_helpers_1.addPropertiesToJsonSchema(dataSchema, { attributes }); | ||
return json_schema_helpers_1.addPropertiesToJsonSchema(schema, { | ||
data: newDataSchema | ||
@@ -116,8 +116,8 @@ }); | ||
function removeKeyFromDataProperties(schema, key) { | ||
const schemaProperties = (0, json_schema_helpers_1.getPropertiesFromJsonSchema)(schema); | ||
const schemaProperties = json_schema_helpers_1.getPropertiesFromJsonSchema(schema); | ||
const dataSchema = schemaProperties.data; | ||
if (!dataSchema) | ||
return {}; | ||
const newDataSchema = (0, json_schema_helpers_1.removeKeyFromSchemaProperties)(dataSchema, key); | ||
return (0, json_schema_helpers_1.addPropertiesToJsonSchema)(schema, { | ||
const newDataSchema = json_schema_helpers_1.removeKeyFromSchemaProperties(dataSchema, key); | ||
return json_schema_helpers_1.addPropertiesToJsonSchema(schema, { | ||
data: newDataSchema | ||
@@ -124,0 +124,0 @@ }); |
@@ -12,3 +12,3 @@ "use strict"; | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires,global-require,import/no-unresolved | ||
const responseSchemas = require('../../../response-schemas.json'); | ||
const responseSchemas = require('build/web-server/response-schemas.json'); | ||
return responseSchemas && responseSchemas.definitions | ||
@@ -21,9 +21,11 @@ ? responseSchemas.definitions[interfaceName] | ||
if (!program && !schema) { | ||
program = TJS.getProgramFromFiles([(0, path_1.resolve)('./src/index.ts')], { | ||
program = TJS.getProgramFromFiles([path_1.resolve('./src/index.ts')], { | ||
resolveJsonModule: true, | ||
strictNullChecks: true | ||
strictNullChecks: true, | ||
skipLibCheck: true | ||
}); | ||
schema = TJS.generateSchema(program, '*', { | ||
ref: false, | ||
required: true | ||
required: true, | ||
ignoreErrors: true | ||
}); | ||
@@ -30,0 +32,0 @@ } |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = 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); | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
@@ -10,0 +6,0 @@ if (k2 === undefined) k2 = k; |
@@ -16,3 +16,3 @@ "use strict"; | ||
.mockImplementation((headerName) => headerName === 'Accept' ? constants_1.JSON_API_MEDIA_TYPE : constants_1.JSON_MEDIA_TYPE); | ||
const contextMock = (0, ts_jest_1.createMock)(); | ||
const contextMock = ts_jest_1.createMock(); | ||
contextMock.switchToHttp().getRequest.mockReturnValue({ | ||
@@ -22,3 +22,3 @@ header: headerFunctionMock, | ||
}); | ||
const nextMock = (0, ts_jest_1.createMock)(); | ||
const nextMock = ts_jest_1.createMock(); | ||
expect(() => interceptor.intercept(contextMock, nextMock)).toThrowError(common_1.UnsupportedMediaTypeException); | ||
@@ -32,3 +32,3 @@ expect(nextMock.handle).not.toHaveBeenCalled(); | ||
.mockImplementation((headerName) => headerName === 'Accept' ? constants_1.JSON_MEDIA_TYPE : constants_1.JSON_API_MEDIA_TYPE); | ||
const contextMock = (0, ts_jest_1.createMock)(); | ||
const contextMock = ts_jest_1.createMock(); | ||
contextMock.switchToHttp().getRequest.mockReturnValue({ | ||
@@ -38,3 +38,3 @@ header: headerFunctionMock, | ||
}); | ||
const nextMock = (0, ts_jest_1.createMock)(); | ||
const nextMock = ts_jest_1.createMock(); | ||
expect(() => interceptor.intercept(contextMock, nextMock)).toThrowError(common_1.NotAcceptableException); | ||
@@ -45,3 +45,3 @@ expect(nextMock.handle).not.toHaveBeenCalled(); | ||
const interceptor = new json_api_header_validation_interceptor_1.JsonApiHeaderValidationInterceptor(); | ||
const contextMock = (0, ts_jest_1.createMock)(); | ||
const contextMock = ts_jest_1.createMock(); | ||
contextMock.switchToHttp().getRequest.mockReturnValue({ | ||
@@ -51,3 +51,3 @@ header: jest.fn().mockReturnValue(constants_1.JSON_API_MEDIA_TYPE), | ||
}); | ||
const nextMock = (0, ts_jest_1.createMock)(); | ||
const nextMock = ts_jest_1.createMock(); | ||
interceptor.intercept(contextMock, nextMock); | ||
@@ -54,0 +54,0 @@ expect(nextMock.handle).toHaveBeenCalled(); |
@@ -31,3 +31,3 @@ "use strict"; | ||
JsonApiBodyValidationInterceptor = __decorate([ | ||
(0, common_1.Injectable)(), | ||
common_1.Injectable(), | ||
__metadata("design:paramtypes", [Object]) | ||
@@ -34,0 +34,0 @@ ], JsonApiBodyValidationInterceptor); |
@@ -41,7 +41,7 @@ "use strict"; | ||
this.dateFieldsPaths.forEach((dateFieldPath) => { | ||
const dateString = (0, lodash_1.get)(request.body, dateFieldPath); | ||
const dateString = lodash_1.get(request.body, dateFieldPath); | ||
if (!dateString) { | ||
return; | ||
} | ||
(0, lodash_1.set)(request.body, dateFieldPath, new Date(dateString)); | ||
lodash_1.set(request.body, dateFieldPath, new Date(dateString)); | ||
}); | ||
@@ -52,3 +52,3 @@ return next.handle(); | ||
JsonApiDateTransformInterceptor = __decorate([ | ||
(0, common_1.Injectable)(), | ||
common_1.Injectable(), | ||
__metadata("design:paramtypes", [Object]) | ||
@@ -55,0 +55,0 @@ ], JsonApiDateTransformInterceptor); |
@@ -29,5 +29,5 @@ "use strict"; | ||
JsonApiHeaderValidationInterceptor = __decorate([ | ||
(0, common_1.Injectable)() | ||
common_1.Injectable() | ||
], JsonApiHeaderValidationInterceptor); | ||
exports.JsonApiHeaderValidationInterceptor = JsonApiHeaderValidationInterceptor; | ||
//# sourceMappingURL=json-api-header-validation.interceptor.js.map |
@@ -17,3 +17,3 @@ "use strict"; | ||
__decorate([ | ||
(0, swagger_1.ApiPropertyOptional)(), | ||
swagger_1.ApiPropertyOptional(), | ||
__metadata("design:type", String) | ||
@@ -20,0 +20,0 @@ ], JsonApiQueryParams.prototype, "include", void 0); |
{ | ||
"name": "@comparaonline/bff-utils", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Util collection library for the BFFs built with Nest.js", | ||
@@ -51,13 +51,14 @@ "private": false, | ||
"ts-jest": "^29.0.3", | ||
"typescript": "^4.9.3" | ||
"typescript": "4.2.4" | ||
}, | ||
"dependencies": { | ||
"@nestjs/common": "^9.2.1", | ||
"@nestjs/swagger": "^6.1.3", | ||
"@nestjs/common": "^8.0.5", | ||
"@nestjs/core": "^8.0.5", | ||
"@nestjs/swagger": "^5.0.9", | ||
"jsonschema": "^1.4.1", | ||
"lodash": "^4.17.21", | ||
"reflect-metadata": "^0.1.13", | ||
"rxjs": "^7.6.0", | ||
"typescript-json-schema": "^0.55.0" | ||
"rxjs": "^7.3.0", | ||
"typescript-json-schema": "^0.51.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
4
85886
8
1131
+ Added@nestjs/core@^8.0.5
+ Added@nestjs/common@8.4.7(transitive)
+ Added@nestjs/core@8.4.7(transitive)
+ Added@nestjs/mapped-types@1.0.1(transitive)
+ Added@nestjs/swagger@5.2.1(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedaxios@0.27.2(transitive)
+ Addedcall-bind@1.0.7(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addeddefine-data-property@1.1.4(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addedes-define-property@1.0.0(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedfollow-redirects@1.15.6(transitive)
+ Addedform-data@4.0.0(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-intrinsic@1.2.4(transitive)
+ Addedgopd@1.0.1(transitive)
+ Addedhas-property-descriptors@1.0.2(transitive)
+ Addedhas-proto@1.0.3(transitive)
+ Addedhas-symbols@1.0.3(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedisarray@2.0.5(transitive)
+ Addedjson-stable-stringify@1.1.1(transitive)
+ Addedjsonify@0.0.1(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedobject-hash@3.0.0(transitive)
+ Addedobject-keys@1.1.1(transitive)
+ Addedset-function-length@1.2.2(transitive)
+ Addedtslib@2.4.0(transitive)
+ Addedtypescript@4.2.4(transitive)
+ Addedtypescript-json-schema@0.51.0(transitive)
+ Addeduuid@8.3.2(transitive)
- Removed@lukeed/csprng@1.1.0(transitive)
- Removed@nestjs/common@9.4.3(transitive)
- Removed@nestjs/core@9.4.3(transitive)
- Removed@nestjs/mapped-types@1.2.2(transitive)
- Removed@nestjs/swagger@6.3.0(transitive)
- Removedargparse@2.0.1(transitive)
- Removedjs-yaml@4.1.0(transitive)
- Removedpath-equal@1.2.5(transitive)
- Removedsafe-stable-stringify@2.4.3(transitive)
- Removedswagger-ui-dist@4.18.2(transitive)
- Removedtslib@2.5.3(transitive)
- Removedtypescript@4.8.4(transitive)
- Removedtypescript-json-schema@0.55.0(transitive)
- Removeduid@2.0.2(transitive)
Updated@nestjs/common@^8.0.5
Updated@nestjs/swagger@^5.0.9
Updatedrxjs@^7.3.0