diff --git a/integration/nestjs-metadata-observables/hero.ts b/integration/nestjs-metadata-observables/hero.ts index ad3fbef77..16169a145 100644 --- a/integration/nestjs-metadata-observables/hero.ts +++ b/integration/nestjs-metadata-observables/hero.ts @@ -3,7 +3,7 @@ import { GrpcMethod, GrpcStreamMethod } from '@nestjs/microservices'; import { util, configure } from 'protobufjs/minimal'; import * as Long from 'long'; import { Observable } from 'rxjs'; -import { Metadata } from 'grpc'; +import { Metadata } from '@grpc/grpc-js'; export const protobufPackage = 'hero'; diff --git a/integration/nestjs-metadata-restparameters/hero.ts b/integration/nestjs-metadata-restparameters/hero.ts index e95f91070..a30688c2e 100644 --- a/integration/nestjs-metadata-restparameters/hero.ts +++ b/integration/nestjs-metadata-restparameters/hero.ts @@ -3,7 +3,7 @@ import { GrpcMethod, GrpcStreamMethod } from '@nestjs/microservices'; import { util, configure } from 'protobufjs/minimal'; import * as Long from 'long'; import { Observable } from 'rxjs'; -import { Metadata } from 'grpc'; +import { Metadata } from '@grpc/grpc-js'; export const protobufPackage = 'hero'; diff --git a/integration/nestjs-metadata/hero.ts b/integration/nestjs-metadata/hero.ts index 6813f3aa4..cd145b685 100644 --- a/integration/nestjs-metadata/hero.ts +++ b/integration/nestjs-metadata/hero.ts @@ -3,7 +3,7 @@ import { GrpcMethod, GrpcStreamMethod } from '@nestjs/microservices'; import { util, configure } from 'protobufjs/minimal'; import * as Long from 'long'; import { Observable } from 'rxjs'; -import { Metadata } from 'grpc'; +import { Metadata } from '@grpc/grpc-js'; export const protobufPackage = 'hero'; diff --git a/integration/only-types-grpc-metadata/only-types-grpc-metadata.ts b/integration/only-types-grpc-metadata/only-types-grpc-metadata.ts index 2a428d949..0a34c406e 100644 --- a/integration/only-types-grpc-metadata/only-types-grpc-metadata.ts +++ b/integration/only-types-grpc-metadata/only-types-grpc-metadata.ts @@ -1,5 +1,5 @@ /* eslint-disable */ -import { Metadata } from 'grpc'; +import { Metadata } from '@grpc/grpc-js'; export const protobufPackage = 'basic'; diff --git a/src/generate-nestjs.ts b/src/generate-nestjs.ts index 2194b569c..dc1efb43c 100644 --- a/src/generate-nestjs.ts +++ b/src/generate-nestjs.ts @@ -24,7 +24,7 @@ export function generateNestjsServiceController( const { options } = ctx; const chunks: Code[] = []; - const Metadata = options.outputServices === ServiceOption.GRPC ? imp('Metadata@@grpc/grpc-js') : imp('Metadata@grpc'); + const Metadata = imp('Metadata@@grpc/grpc-js'); maybeAddComment(sourceInfo, chunks, serviceDesc.options?.deprecated); const t = options.context ? `<${contextTypeVar}>` : ''; @@ -97,7 +97,7 @@ export function generateNestjsServiceClient( const { options } = ctx; const chunks: Code[] = []; - const Metadata = options.outputServices === ServiceOption.GRPC ? imp('Metadata@@grpc/grpc-js') : imp('Metadata@grpc'); + const Metadata = imp('Metadata@@grpc/grpc-js'); maybeAddComment(sourceInfo, chunks); const t = options.context ? `<${contextTypeVar}>` : ``; diff --git a/src/generate-services.ts b/src/generate-services.ts index f175ca177..3b015099f 100644 --- a/src/generate-services.ts +++ b/src/generate-services.ts @@ -64,7 +64,7 @@ export function generateService( // We have to use grpc.Metadata where grpc will come from @improbable-eng params.push(code`metadata?: grpc.Metadata`); } else if (options.addGrpcMetadata) { - const Metadata = imp('Metadata@grpc'); + const Metadata = imp('Metadata@@grpc/grpc-js'); const q = options.addNestjsRestParameter ? '' : '?'; params.push(code`metadata${q}: ${Metadata}`); }