diff --git a/packages/nestjs-grpc-reflection/src/controllers/grpc-reflection.controller.ts b/packages/nestjs-grpc-reflection/src/controllers/grpc-reflection.controller.ts index e931d235..9864316d 100644 --- a/packages/nestjs-grpc-reflection/src/controllers/grpc-reflection.controller.ts +++ b/packages/nestjs-grpc-reflection/src/controllers/grpc-reflection.controller.ts @@ -36,7 +36,7 @@ export class GrpcReflectionController { validHost: '', originalRequest: reflectionRequest, fileDescriptorResponse: { - fileDescriptorProto: [fileDescriptorProto], + fileDescriptorProto: [fileDescriptorProto as unknown as Uint8Array], }, }) } else { diff --git a/packages/nestjs-grpc-reflection/src/grpc/grpc-services.registry.ts b/packages/nestjs-grpc-reflection/src/grpc/grpc-services.registry.ts index c6d5f89c..0a9705e7 100644 --- a/packages/nestjs-grpc-reflection/src/grpc/grpc-services.registry.ts +++ b/packages/nestjs-grpc-reflection/src/grpc/grpc-services.registry.ts @@ -1,8 +1,7 @@ import type { ServiceDefinition } from '@grpc/proto-loader' import { Injectable } from '@nestjs/common' -// @ts-expect-error -import { FileDescriptorProto } from 'google-protobuf/google/protobuf/descriptor_pb' +import { FileDescriptorProto } from 'google-protobuf/google/protobuf/descriptor_pb.js' @Injectable() export class GrpcServicesRegistry { @@ -28,32 +27,27 @@ export class GrpcServicesRegistry { getFileDescriptorProtoByFileContainingSymbol( fileContainingSymbol: string - // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents ): FileDescriptorProto | undefined { - // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents + // @ts-expect-error return this.services.reduce((fileDescriptorProto, service) => { if (fileDescriptorProto) { - // eslint-disable-next-line @typescript-eslint/no-unsafe-return return fileDescriptorProto } - // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-redundant-type-constituents + // @ts-expect-error return Object.values(service).reduce(( descriptor, method ) => { if (descriptor) { - // eslint-disable-next-line @typescript-eslint/no-unsafe-return return descriptor } if (method.path.includes(fileContainingSymbol)) { return method.requestType.fileDescriptorProtos.find((fdp) => { - // eslint-disable-next-line @typescript-eslint/no-unsafe-call const fileDescriptor = FileDescriptorProto.deserializeBinary(fdp) - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call - return fileContainingSymbol.includes(fileDescriptor.getPackage()) + return fileContainingSymbol.includes(fileDescriptor.getPackage()!) }) }