diff --git a/packages/grpc-js/src/channelz.ts b/packages/grpc-js/src/channelz.ts index c207e567c..263ba00b6 100644 --- a/packages/grpc-js/src/channelz.ts +++ b/packages/grpc-js/src/channelz.ts @@ -881,11 +881,8 @@ export function getChannelzServiceDefinition(): ChannelzDefinition { oneofs: true, includeDirs: [`${__dirname}/../../proto`], }); - const channelzGrpcObject = loadPackageDefinition( - loadedProto - ) as unknown as ChannelzProtoGrpcType; - loadedChannelzDefinition = - channelzGrpcObject.grpc.channelz.v1.Channelz.service; + const channelzGrpcObject = loadPackageDefinition(loadedProto) as ChannelzProtoGrpcType; + loadedChannelzDefinition = channelzGrpcObject.grpc.channelz.v1.Channelz.service; return loadedChannelzDefinition; } diff --git a/packages/grpc-js/src/generated/channelz.ts b/packages/grpc-js/src/generated/channelz.ts index a81ffae5b..88f5b7574 100644 --- a/packages/grpc-js/src/generated/channelz.ts +++ b/packages/grpc-js/src/generated/channelz.ts @@ -1,13 +1,13 @@ import type * as grpc from '../index'; import type { MessageTypeDefinition } from '@grpc/proto-loader'; -import type { ChannelzClient as _grpc_channelz_v1_ChannelzClient, ChannelzDefinition as _grpc_channelz_v1_ChannelzDefinition } from './grpc/channelz/v1/Channelz.ts'; +import type { ChannelzClient as _grpc_channelz_v1_ChannelzClient, ChannelzDefinition as _grpc_channelz_v1_ChannelzDefinition } from './grpc/channelz/v1/Channelz'; -type SubtypeConstructor any, Subtype> = { - new(...args: ConstructorParameters): Subtype; -}; +type SubtypeConstructor = { + new (address: string, credentials: grpc.ChannelCredentials, options?: Partial): Subtype; +} & grpc.ServiceClientConstructor; -export interface ProtoGrpcType { +export interface ProtoGrpcType extends grpc.GrpcObject { google: { protobuf: { Any: MessageTypeDefinition @@ -38,7 +38,7 @@ export interface ProtoGrpcType { * Channelz is a service exposed by gRPC servers that provides detailed debug * information. */ - Channelz: SubtypeConstructor & { service: _grpc_channelz_v1_ChannelzDefinition } + Channelz: SubtypeConstructor<_grpc_channelz_v1_ChannelzClient> & { service: _grpc_channelz_v1_ChannelzDefinition } GetChannelRequest: MessageTypeDefinition GetChannelResponse: MessageTypeDefinition GetServerRequest: MessageTypeDefinition diff --git a/packages/grpc-js/src/generated/grpc/channelz/v1/Address.ts b/packages/grpc-js/src/generated/grpc/channelz/v1/Address.ts index 5215e42ef..259cfeabe 100644 --- a/packages/grpc-js/src/generated/grpc/channelz/v1/Address.ts +++ b/packages/grpc-js/src/generated/grpc/channelz/v1/Address.ts @@ -1,6 +1,6 @@ // Original file: proto/channelz.proto -import type { Any as _google_protobuf_Any, Any__Output as _google_protobuf_Any__Output } from '../../../google/protobuf/Any.ts'; +import type { Any as _google_protobuf_Any, Any__Output as _google_protobuf_Any__Output } from '../../../google/protobuf/Any'; /** * An address type not included above. diff --git a/packages/grpc-js/src/generated/grpc/channelz/v1/Channel.ts b/packages/grpc-js/src/generated/grpc/channelz/v1/Channel.ts index 5be617e11..93b4a261d 100644 --- a/packages/grpc-js/src/generated/grpc/channelz/v1/Channel.ts +++ b/packages/grpc-js/src/generated/grpc/channelz/v1/Channel.ts @@ -1,9 +1,9 @@ // Original file: proto/channelz.proto -import type { ChannelRef as _grpc_channelz_v1_ChannelRef, ChannelRef__Output as _grpc_channelz_v1_ChannelRef__Output } from '../../../grpc/channelz/v1/ChannelRef.ts'; -import type { ChannelData as _grpc_channelz_v1_ChannelData, ChannelData__Output as _grpc_channelz_v1_ChannelData__Output } from '../../../grpc/channelz/v1/ChannelData.ts'; -import type { SubchannelRef as _grpc_channelz_v1_SubchannelRef, SubchannelRef__Output as _grpc_channelz_v1_SubchannelRef__Output } from '../../../grpc/channelz/v1/SubchannelRef.ts'; -import type { SocketRef as _grpc_channelz_v1_SocketRef, SocketRef__Output as _grpc_channelz_v1_SocketRef__Output } from '../../../grpc/channelz/v1/SocketRef.ts'; +import type { ChannelRef as _grpc_channelz_v1_ChannelRef, ChannelRef__Output as _grpc_channelz_v1_ChannelRef__Output } from '../../../grpc/channelz/v1/ChannelRef'; +import type { ChannelData as _grpc_channelz_v1_ChannelData, ChannelData__Output as _grpc_channelz_v1_ChannelData__Output } from '../../../grpc/channelz/v1/ChannelData'; +import type { SubchannelRef as _grpc_channelz_v1_SubchannelRef, SubchannelRef__Output as _grpc_channelz_v1_SubchannelRef__Output } from '../../../grpc/channelz/v1/SubchannelRef'; +import type { SocketRef as _grpc_channelz_v1_SocketRef, SocketRef__Output as _grpc_channelz_v1_SocketRef__Output } from '../../../grpc/channelz/v1/SocketRef'; /** * Channel is a logical grouping of channels, subchannels, and sockets. diff --git a/packages/grpc-js/src/generated/grpc/channelz/v1/ChannelData.ts b/packages/grpc-js/src/generated/grpc/channelz/v1/ChannelData.ts index d1de968a1..6d6824af4 100644 --- a/packages/grpc-js/src/generated/grpc/channelz/v1/ChannelData.ts +++ b/packages/grpc-js/src/generated/grpc/channelz/v1/ChannelData.ts @@ -1,8 +1,8 @@ // Original file: proto/channelz.proto -import type { ChannelConnectivityState as _grpc_channelz_v1_ChannelConnectivityState, ChannelConnectivityState__Output as _grpc_channelz_v1_ChannelConnectivityState__Output } from '../../../grpc/channelz/v1/ChannelConnectivityState.ts'; -import type { ChannelTrace as _grpc_channelz_v1_ChannelTrace, ChannelTrace__Output as _grpc_channelz_v1_ChannelTrace__Output } from '../../../grpc/channelz/v1/ChannelTrace.ts'; -import type { Timestamp as _google_protobuf_Timestamp, Timestamp__Output as _google_protobuf_Timestamp__Output } from '../../../google/protobuf/Timestamp.ts'; +import type { ChannelConnectivityState as _grpc_channelz_v1_ChannelConnectivityState, ChannelConnectivityState__Output as _grpc_channelz_v1_ChannelConnectivityState__Output } from '../../../grpc/channelz/v1/ChannelConnectivityState'; +import type { ChannelTrace as _grpc_channelz_v1_ChannelTrace, ChannelTrace__Output as _grpc_channelz_v1_ChannelTrace__Output } from '../../../grpc/channelz/v1/ChannelTrace'; +import type { Timestamp as _google_protobuf_Timestamp, Timestamp__Output as _google_protobuf_Timestamp__Output } from '../../../google/protobuf/Timestamp'; import type { Long } from '@grpc/proto-loader'; /** diff --git a/packages/grpc-js/src/generated/grpc/channelz/v1/ChannelTrace.ts b/packages/grpc-js/src/generated/grpc/channelz/v1/ChannelTrace.ts index 60c8e682a..7dbc8d924 100644 --- a/packages/grpc-js/src/generated/grpc/channelz/v1/ChannelTrace.ts +++ b/packages/grpc-js/src/generated/grpc/channelz/v1/ChannelTrace.ts @@ -1,7 +1,7 @@ // Original file: proto/channelz.proto -import type { Timestamp as _google_protobuf_Timestamp, Timestamp__Output as _google_protobuf_Timestamp__Output } from '../../../google/protobuf/Timestamp.ts'; -import type { ChannelTraceEvent as _grpc_channelz_v1_ChannelTraceEvent, ChannelTraceEvent__Output as _grpc_channelz_v1_ChannelTraceEvent__Output } from '../../../grpc/channelz/v1/ChannelTraceEvent.ts'; +import type { Timestamp as _google_protobuf_Timestamp, Timestamp__Output as _google_protobuf_Timestamp__Output } from '../../../google/protobuf/Timestamp'; +import type { ChannelTraceEvent as _grpc_channelz_v1_ChannelTraceEvent, ChannelTraceEvent__Output as _grpc_channelz_v1_ChannelTraceEvent__Output } from '../../../grpc/channelz/v1/ChannelTraceEvent'; import type { Long } from '@grpc/proto-loader'; /** diff --git a/packages/grpc-js/src/generated/grpc/channelz/v1/ChannelTraceEvent.ts b/packages/grpc-js/src/generated/grpc/channelz/v1/ChannelTraceEvent.ts index 33c6230ef..403e4f123 100644 --- a/packages/grpc-js/src/generated/grpc/channelz/v1/ChannelTraceEvent.ts +++ b/packages/grpc-js/src/generated/grpc/channelz/v1/ChannelTraceEvent.ts @@ -1,8 +1,8 @@ // Original file: proto/channelz.proto -import type { Timestamp as _google_protobuf_Timestamp, Timestamp__Output as _google_protobuf_Timestamp__Output } from '../../../google/protobuf/Timestamp.ts'; -import type { ChannelRef as _grpc_channelz_v1_ChannelRef, ChannelRef__Output as _grpc_channelz_v1_ChannelRef__Output } from '../../../grpc/channelz/v1/ChannelRef.ts'; -import type { SubchannelRef as _grpc_channelz_v1_SubchannelRef, SubchannelRef__Output as _grpc_channelz_v1_SubchannelRef__Output } from '../../../grpc/channelz/v1/SubchannelRef.ts'; +import type { Timestamp as _google_protobuf_Timestamp, Timestamp__Output as _google_protobuf_Timestamp__Output } from '../../../google/protobuf/Timestamp'; +import type { ChannelRef as _grpc_channelz_v1_ChannelRef, ChannelRef__Output as _grpc_channelz_v1_ChannelRef__Output } from '../../../grpc/channelz/v1/ChannelRef'; +import type { SubchannelRef as _grpc_channelz_v1_SubchannelRef, SubchannelRef__Output as _grpc_channelz_v1_SubchannelRef__Output } from '../../../grpc/channelz/v1/SubchannelRef'; // Original file: proto/channelz.proto diff --git a/packages/grpc-js/src/generated/grpc/channelz/v1/Channelz.ts b/packages/grpc-js/src/generated/grpc/channelz/v1/Channelz.ts index deafde315..d562f7307 100644 --- a/packages/grpc-js/src/generated/grpc/channelz/v1/Channelz.ts +++ b/packages/grpc-js/src/generated/grpc/channelz/v1/Channelz.ts @@ -2,26 +2,26 @@ import type * as grpc from '../../../../index' import type { MethodDefinition } from '@grpc/proto-loader' -import type { GetChannelRequest as _grpc_channelz_v1_GetChannelRequest, GetChannelRequest__Output as _grpc_channelz_v1_GetChannelRequest__Output } from '../../../grpc/channelz/v1/GetChannelRequest.ts'; -import type { GetChannelResponse as _grpc_channelz_v1_GetChannelResponse, GetChannelResponse__Output as _grpc_channelz_v1_GetChannelResponse__Output } from '../../../grpc/channelz/v1/GetChannelResponse.ts'; -import type { GetServerRequest as _grpc_channelz_v1_GetServerRequest, GetServerRequest__Output as _grpc_channelz_v1_GetServerRequest__Output } from '../../../grpc/channelz/v1/GetServerRequest.ts'; -import type { GetServerResponse as _grpc_channelz_v1_GetServerResponse, GetServerResponse__Output as _grpc_channelz_v1_GetServerResponse__Output } from '../../../grpc/channelz/v1/GetServerResponse.ts'; -import type { GetServerSocketsRequest as _grpc_channelz_v1_GetServerSocketsRequest, GetServerSocketsRequest__Output as _grpc_channelz_v1_GetServerSocketsRequest__Output } from '../../../grpc/channelz/v1/GetServerSocketsRequest.ts'; -import type { GetServerSocketsResponse as _grpc_channelz_v1_GetServerSocketsResponse, GetServerSocketsResponse__Output as _grpc_channelz_v1_GetServerSocketsResponse__Output } from '../../../grpc/channelz/v1/GetServerSocketsResponse.ts'; -import type { GetServersRequest as _grpc_channelz_v1_GetServersRequest, GetServersRequest__Output as _grpc_channelz_v1_GetServersRequest__Output } from '../../../grpc/channelz/v1/GetServersRequest.ts'; -import type { GetServersResponse as _grpc_channelz_v1_GetServersResponse, GetServersResponse__Output as _grpc_channelz_v1_GetServersResponse__Output } from '../../../grpc/channelz/v1/GetServersResponse.ts'; -import type { GetSocketRequest as _grpc_channelz_v1_GetSocketRequest, GetSocketRequest__Output as _grpc_channelz_v1_GetSocketRequest__Output } from '../../../grpc/channelz/v1/GetSocketRequest.ts'; -import type { GetSocketResponse as _grpc_channelz_v1_GetSocketResponse, GetSocketResponse__Output as _grpc_channelz_v1_GetSocketResponse__Output } from '../../../grpc/channelz/v1/GetSocketResponse.ts'; -import type { GetSubchannelRequest as _grpc_channelz_v1_GetSubchannelRequest, GetSubchannelRequest__Output as _grpc_channelz_v1_GetSubchannelRequest__Output } from '../../../grpc/channelz/v1/GetSubchannelRequest.ts'; -import type { GetSubchannelResponse as _grpc_channelz_v1_GetSubchannelResponse, GetSubchannelResponse__Output as _grpc_channelz_v1_GetSubchannelResponse__Output } from '../../../grpc/channelz/v1/GetSubchannelResponse.ts'; -import type { GetTopChannelsRequest as _grpc_channelz_v1_GetTopChannelsRequest, GetTopChannelsRequest__Output as _grpc_channelz_v1_GetTopChannelsRequest__Output } from '../../../grpc/channelz/v1/GetTopChannelsRequest.ts'; -import type { GetTopChannelsResponse as _grpc_channelz_v1_GetTopChannelsResponse, GetTopChannelsResponse__Output as _grpc_channelz_v1_GetTopChannelsResponse__Output } from '../../../grpc/channelz/v1/GetTopChannelsResponse.ts'; +import type { GetChannelRequest as _grpc_channelz_v1_GetChannelRequest, GetChannelRequest__Output as _grpc_channelz_v1_GetChannelRequest__Output } from '../../../grpc/channelz/v1/GetChannelRequest'; +import type { GetChannelResponse as _grpc_channelz_v1_GetChannelResponse, GetChannelResponse__Output as _grpc_channelz_v1_GetChannelResponse__Output } from '../../../grpc/channelz/v1/GetChannelResponse'; +import type { GetServerRequest as _grpc_channelz_v1_GetServerRequest, GetServerRequest__Output as _grpc_channelz_v1_GetServerRequest__Output } from '../../../grpc/channelz/v1/GetServerRequest'; +import type { GetServerResponse as _grpc_channelz_v1_GetServerResponse, GetServerResponse__Output as _grpc_channelz_v1_GetServerResponse__Output } from '../../../grpc/channelz/v1/GetServerResponse'; +import type { GetServerSocketsRequest as _grpc_channelz_v1_GetServerSocketsRequest, GetServerSocketsRequest__Output as _grpc_channelz_v1_GetServerSocketsRequest__Output } from '../../../grpc/channelz/v1/GetServerSocketsRequest'; +import type { GetServerSocketsResponse as _grpc_channelz_v1_GetServerSocketsResponse, GetServerSocketsResponse__Output as _grpc_channelz_v1_GetServerSocketsResponse__Output } from '../../../grpc/channelz/v1/GetServerSocketsResponse'; +import type { GetServersRequest as _grpc_channelz_v1_GetServersRequest, GetServersRequest__Output as _grpc_channelz_v1_GetServersRequest__Output } from '../../../grpc/channelz/v1/GetServersRequest'; +import type { GetServersResponse as _grpc_channelz_v1_GetServersResponse, GetServersResponse__Output as _grpc_channelz_v1_GetServersResponse__Output } from '../../../grpc/channelz/v1/GetServersResponse'; +import type { GetSocketRequest as _grpc_channelz_v1_GetSocketRequest, GetSocketRequest__Output as _grpc_channelz_v1_GetSocketRequest__Output } from '../../../grpc/channelz/v1/GetSocketRequest'; +import type { GetSocketResponse as _grpc_channelz_v1_GetSocketResponse, GetSocketResponse__Output as _grpc_channelz_v1_GetSocketResponse__Output } from '../../../grpc/channelz/v1/GetSocketResponse'; +import type { GetSubchannelRequest as _grpc_channelz_v1_GetSubchannelRequest, GetSubchannelRequest__Output as _grpc_channelz_v1_GetSubchannelRequest__Output } from '../../../grpc/channelz/v1/GetSubchannelRequest'; +import type { GetSubchannelResponse as _grpc_channelz_v1_GetSubchannelResponse, GetSubchannelResponse__Output as _grpc_channelz_v1_GetSubchannelResponse__Output } from '../../../grpc/channelz/v1/GetSubchannelResponse'; +import type { GetTopChannelsRequest as _grpc_channelz_v1_GetTopChannelsRequest, GetTopChannelsRequest__Output as _grpc_channelz_v1_GetTopChannelsRequest__Output } from '../../../grpc/channelz/v1/GetTopChannelsRequest'; +import type { GetTopChannelsResponse as _grpc_channelz_v1_GetTopChannelsResponse, GetTopChannelsResponse__Output as _grpc_channelz_v1_GetTopChannelsResponse__Output } from '../../../grpc/channelz/v1/GetTopChannelsResponse'; /** * Channelz is a service exposed by gRPC servers that provides detailed debug * information. */ -export interface ChannelzClient extends grpc.Client { +export interface ChannelzClient extends grpc.ServiceClient { /** * Returns a single Channel, or else a NOT_FOUND code. */ diff --git a/packages/grpc-js/src/generated/grpc/channelz/v1/GetChannelResponse.ts b/packages/grpc-js/src/generated/grpc/channelz/v1/GetChannelResponse.ts index 48fb040ec..2e967a458 100644 --- a/packages/grpc-js/src/generated/grpc/channelz/v1/GetChannelResponse.ts +++ b/packages/grpc-js/src/generated/grpc/channelz/v1/GetChannelResponse.ts @@ -1,6 +1,6 @@ // Original file: proto/channelz.proto -import type { Channel as _grpc_channelz_v1_Channel, Channel__Output as _grpc_channelz_v1_Channel__Output } from '../../../grpc/channelz/v1/Channel.ts'; +import type { Channel as _grpc_channelz_v1_Channel, Channel__Output as _grpc_channelz_v1_Channel__Output } from '../../../grpc/channelz/v1/Channel'; export interface GetChannelResponse { /** diff --git a/packages/grpc-js/src/generated/grpc/channelz/v1/GetServerResponse.ts b/packages/grpc-js/src/generated/grpc/channelz/v1/GetServerResponse.ts index ee853985c..fe0078209 100644 --- a/packages/grpc-js/src/generated/grpc/channelz/v1/GetServerResponse.ts +++ b/packages/grpc-js/src/generated/grpc/channelz/v1/GetServerResponse.ts @@ -1,6 +1,6 @@ // Original file: proto/channelz.proto -import type { Server as _grpc_channelz_v1_Server, Server__Output as _grpc_channelz_v1_Server__Output } from '../../../grpc/channelz/v1/Server.ts'; +import type { Server as _grpc_channelz_v1_Server, Server__Output as _grpc_channelz_v1_Server__Output } from '../../../grpc/channelz/v1/Server'; export interface GetServerResponse { /** diff --git a/packages/grpc-js/src/generated/grpc/channelz/v1/GetServerSocketsResponse.ts b/packages/grpc-js/src/generated/grpc/channelz/v1/GetServerSocketsResponse.ts index 577b2ca13..112f277e3 100644 --- a/packages/grpc-js/src/generated/grpc/channelz/v1/GetServerSocketsResponse.ts +++ b/packages/grpc-js/src/generated/grpc/channelz/v1/GetServerSocketsResponse.ts @@ -1,6 +1,6 @@ // Original file: proto/channelz.proto -import type { SocketRef as _grpc_channelz_v1_SocketRef, SocketRef__Output as _grpc_channelz_v1_SocketRef__Output } from '../../../grpc/channelz/v1/SocketRef.ts'; +import type { SocketRef as _grpc_channelz_v1_SocketRef, SocketRef__Output as _grpc_channelz_v1_SocketRef__Output } from '../../../grpc/channelz/v1/SocketRef'; export interface GetServerSocketsResponse { /** diff --git a/packages/grpc-js/src/generated/grpc/channelz/v1/GetServersResponse.ts b/packages/grpc-js/src/generated/grpc/channelz/v1/GetServersResponse.ts index d232b6654..b07893b8c 100644 --- a/packages/grpc-js/src/generated/grpc/channelz/v1/GetServersResponse.ts +++ b/packages/grpc-js/src/generated/grpc/channelz/v1/GetServersResponse.ts @@ -1,6 +1,6 @@ // Original file: proto/channelz.proto -import type { Server as _grpc_channelz_v1_Server, Server__Output as _grpc_channelz_v1_Server__Output } from '../../../grpc/channelz/v1/Server.ts'; +import type { Server as _grpc_channelz_v1_Server, Server__Output as _grpc_channelz_v1_Server__Output } from '../../../grpc/channelz/v1/Server'; export interface GetServersResponse { /** diff --git a/packages/grpc-js/src/generated/grpc/channelz/v1/GetSocketResponse.ts b/packages/grpc-js/src/generated/grpc/channelz/v1/GetSocketResponse.ts index 2e62b04e0..b6304b7f0 100644 --- a/packages/grpc-js/src/generated/grpc/channelz/v1/GetSocketResponse.ts +++ b/packages/grpc-js/src/generated/grpc/channelz/v1/GetSocketResponse.ts @@ -1,6 +1,6 @@ // Original file: proto/channelz.proto -import type { Socket as _grpc_channelz_v1_Socket, Socket__Output as _grpc_channelz_v1_Socket__Output } from '../../../grpc/channelz/v1/Socket.ts'; +import type { Socket as _grpc_channelz_v1_Socket, Socket__Output as _grpc_channelz_v1_Socket__Output } from '../../../grpc/channelz/v1/Socket'; export interface GetSocketResponse { /** diff --git a/packages/grpc-js/src/generated/grpc/channelz/v1/GetSubchannelResponse.ts b/packages/grpc-js/src/generated/grpc/channelz/v1/GetSubchannelResponse.ts index 4896a1196..57d2bf2dc 100644 --- a/packages/grpc-js/src/generated/grpc/channelz/v1/GetSubchannelResponse.ts +++ b/packages/grpc-js/src/generated/grpc/channelz/v1/GetSubchannelResponse.ts @@ -1,6 +1,6 @@ // Original file: proto/channelz.proto -import type { Subchannel as _grpc_channelz_v1_Subchannel, Subchannel__Output as _grpc_channelz_v1_Subchannel__Output } from '../../../grpc/channelz/v1/Subchannel.ts'; +import type { Subchannel as _grpc_channelz_v1_Subchannel, Subchannel__Output as _grpc_channelz_v1_Subchannel__Output } from '../../../grpc/channelz/v1/Subchannel'; export interface GetSubchannelResponse { /** diff --git a/packages/grpc-js/src/generated/grpc/channelz/v1/GetTopChannelsResponse.ts b/packages/grpc-js/src/generated/grpc/channelz/v1/GetTopChannelsResponse.ts index 8a3c8dbf2..d96e63673 100644 --- a/packages/grpc-js/src/generated/grpc/channelz/v1/GetTopChannelsResponse.ts +++ b/packages/grpc-js/src/generated/grpc/channelz/v1/GetTopChannelsResponse.ts @@ -1,6 +1,6 @@ // Original file: proto/channelz.proto -import type { Channel as _grpc_channelz_v1_Channel, Channel__Output as _grpc_channelz_v1_Channel__Output } from '../../../grpc/channelz/v1/Channel.ts'; +import type { Channel as _grpc_channelz_v1_Channel, Channel__Output as _grpc_channelz_v1_Channel__Output } from '../../../grpc/channelz/v1/Channel'; export interface GetTopChannelsResponse { /** diff --git a/packages/grpc-js/src/generated/grpc/channelz/v1/Security.ts b/packages/grpc-js/src/generated/grpc/channelz/v1/Security.ts index a084dbe0f..e555d698e 100644 --- a/packages/grpc-js/src/generated/grpc/channelz/v1/Security.ts +++ b/packages/grpc-js/src/generated/grpc/channelz/v1/Security.ts @@ -1,6 +1,6 @@ // Original file: proto/channelz.proto -import type { Any as _google_protobuf_Any, Any__Output as _google_protobuf_Any__Output } from '../../../google/protobuf/Any.ts'; +import type { Any as _google_protobuf_Any, Any__Output as _google_protobuf_Any__Output } from '../../../google/protobuf/Any'; export interface _grpc_channelz_v1_Security_OtherSecurity { /** diff --git a/packages/grpc-js/src/generated/grpc/channelz/v1/Server.ts b/packages/grpc-js/src/generated/grpc/channelz/v1/Server.ts index a96d79b4a..958343358 100644 --- a/packages/grpc-js/src/generated/grpc/channelz/v1/Server.ts +++ b/packages/grpc-js/src/generated/grpc/channelz/v1/Server.ts @@ -1,8 +1,8 @@ // Original file: proto/channelz.proto -import type { ServerRef as _grpc_channelz_v1_ServerRef, ServerRef__Output as _grpc_channelz_v1_ServerRef__Output } from '../../../grpc/channelz/v1/ServerRef.ts'; -import type { ServerData as _grpc_channelz_v1_ServerData, ServerData__Output as _grpc_channelz_v1_ServerData__Output } from '../../../grpc/channelz/v1/ServerData.ts'; -import type { SocketRef as _grpc_channelz_v1_SocketRef, SocketRef__Output as _grpc_channelz_v1_SocketRef__Output } from '../../../grpc/channelz/v1/SocketRef.ts'; +import type { ServerRef as _grpc_channelz_v1_ServerRef, ServerRef__Output as _grpc_channelz_v1_ServerRef__Output } from '../../../grpc/channelz/v1/ServerRef'; +import type { ServerData as _grpc_channelz_v1_ServerData, ServerData__Output as _grpc_channelz_v1_ServerData__Output } from '../../../grpc/channelz/v1/ServerData'; +import type { SocketRef as _grpc_channelz_v1_SocketRef, SocketRef__Output as _grpc_channelz_v1_SocketRef__Output } from '../../../grpc/channelz/v1/SocketRef'; /** * Server represents a single server. There may be multiple servers in a single diff --git a/packages/grpc-js/src/generated/grpc/channelz/v1/ServerData.ts b/packages/grpc-js/src/generated/grpc/channelz/v1/ServerData.ts index 588f6ae8e..ce48e36f5 100644 --- a/packages/grpc-js/src/generated/grpc/channelz/v1/ServerData.ts +++ b/packages/grpc-js/src/generated/grpc/channelz/v1/ServerData.ts @@ -1,7 +1,7 @@ // Original file: proto/channelz.proto -import type { ChannelTrace as _grpc_channelz_v1_ChannelTrace, ChannelTrace__Output as _grpc_channelz_v1_ChannelTrace__Output } from '../../../grpc/channelz/v1/ChannelTrace.ts'; -import type { Timestamp as _google_protobuf_Timestamp, Timestamp__Output as _google_protobuf_Timestamp__Output } from '../../../google/protobuf/Timestamp.ts'; +import type { ChannelTrace as _grpc_channelz_v1_ChannelTrace, ChannelTrace__Output as _grpc_channelz_v1_ChannelTrace__Output } from '../../../grpc/channelz/v1/ChannelTrace'; +import type { Timestamp as _google_protobuf_Timestamp, Timestamp__Output as _google_protobuf_Timestamp__Output } from '../../../google/protobuf/Timestamp'; import type { Long } from '@grpc/proto-loader'; /** diff --git a/packages/grpc-js/src/generated/grpc/channelz/v1/Socket.ts b/packages/grpc-js/src/generated/grpc/channelz/v1/Socket.ts index b2eec20af..5829afe98 100644 --- a/packages/grpc-js/src/generated/grpc/channelz/v1/Socket.ts +++ b/packages/grpc-js/src/generated/grpc/channelz/v1/Socket.ts @@ -1,9 +1,9 @@ // Original file: proto/channelz.proto -import type { SocketRef as _grpc_channelz_v1_SocketRef, SocketRef__Output as _grpc_channelz_v1_SocketRef__Output } from '../../../grpc/channelz/v1/SocketRef.ts'; -import type { SocketData as _grpc_channelz_v1_SocketData, SocketData__Output as _grpc_channelz_v1_SocketData__Output } from '../../../grpc/channelz/v1/SocketData.ts'; -import type { Address as _grpc_channelz_v1_Address, Address__Output as _grpc_channelz_v1_Address__Output } from '../../../grpc/channelz/v1/Address.ts'; -import type { Security as _grpc_channelz_v1_Security, Security__Output as _grpc_channelz_v1_Security__Output } from '../../../grpc/channelz/v1/Security.ts'; +import type { SocketRef as _grpc_channelz_v1_SocketRef, SocketRef__Output as _grpc_channelz_v1_SocketRef__Output } from '../../../grpc/channelz/v1/SocketRef'; +import type { SocketData as _grpc_channelz_v1_SocketData, SocketData__Output as _grpc_channelz_v1_SocketData__Output } from '../../../grpc/channelz/v1/SocketData'; +import type { Address as _grpc_channelz_v1_Address, Address__Output as _grpc_channelz_v1_Address__Output } from '../../../grpc/channelz/v1/Address'; +import type { Security as _grpc_channelz_v1_Security, Security__Output as _grpc_channelz_v1_Security__Output } from '../../../grpc/channelz/v1/Security'; /** * Information about an actual connection. Pronounced "sock-ay". diff --git a/packages/grpc-js/src/generated/grpc/channelz/v1/SocketData.ts b/packages/grpc-js/src/generated/grpc/channelz/v1/SocketData.ts index 807d8a2a9..c62d4d10c 100644 --- a/packages/grpc-js/src/generated/grpc/channelz/v1/SocketData.ts +++ b/packages/grpc-js/src/generated/grpc/channelz/v1/SocketData.ts @@ -1,8 +1,8 @@ // Original file: proto/channelz.proto -import type { Timestamp as _google_protobuf_Timestamp, Timestamp__Output as _google_protobuf_Timestamp__Output } from '../../../google/protobuf/Timestamp.ts'; -import type { Int64Value as _google_protobuf_Int64Value, Int64Value__Output as _google_protobuf_Int64Value__Output } from '../../../google/protobuf/Int64Value.ts'; -import type { SocketOption as _grpc_channelz_v1_SocketOption, SocketOption__Output as _grpc_channelz_v1_SocketOption__Output } from '../../../grpc/channelz/v1/SocketOption.ts'; +import type { Timestamp as _google_protobuf_Timestamp, Timestamp__Output as _google_protobuf_Timestamp__Output } from '../../../google/protobuf/Timestamp'; +import type { Int64Value as _google_protobuf_Int64Value, Int64Value__Output as _google_protobuf_Int64Value__Output } from '../../../google/protobuf/Int64Value'; +import type { SocketOption as _grpc_channelz_v1_SocketOption, SocketOption__Output as _grpc_channelz_v1_SocketOption__Output } from '../../../grpc/channelz/v1/SocketOption'; import type { Long } from '@grpc/proto-loader'; /** diff --git a/packages/grpc-js/src/generated/grpc/channelz/v1/SocketOption.ts b/packages/grpc-js/src/generated/grpc/channelz/v1/SocketOption.ts index a2a545a4c..115b36aae 100644 --- a/packages/grpc-js/src/generated/grpc/channelz/v1/SocketOption.ts +++ b/packages/grpc-js/src/generated/grpc/channelz/v1/SocketOption.ts @@ -1,6 +1,6 @@ // Original file: proto/channelz.proto -import type { Any as _google_protobuf_Any, Any__Output as _google_protobuf_Any__Output } from '../../../google/protobuf/Any.ts'; +import type { Any as _google_protobuf_Any, Any__Output as _google_protobuf_Any__Output } from '../../../google/protobuf/Any'; /** * SocketOption represents socket options for a socket. Specifically, these diff --git a/packages/grpc-js/src/generated/grpc/channelz/v1/SocketOptionLinger.ts b/packages/grpc-js/src/generated/grpc/channelz/v1/SocketOptionLinger.ts index ca0d801fe..d83fa3238 100644 --- a/packages/grpc-js/src/generated/grpc/channelz/v1/SocketOptionLinger.ts +++ b/packages/grpc-js/src/generated/grpc/channelz/v1/SocketOptionLinger.ts @@ -1,6 +1,6 @@ // Original file: proto/channelz.proto -import type { Duration as _google_protobuf_Duration, Duration__Output as _google_protobuf_Duration__Output } from '../../../google/protobuf/Duration.ts'; +import type { Duration as _google_protobuf_Duration, Duration__Output as _google_protobuf_Duration__Output } from '../../../google/protobuf/Duration'; /** * For use with SocketOption's additional field. This is primarily used for diff --git a/packages/grpc-js/src/generated/grpc/channelz/v1/SocketOptionTimeout.ts b/packages/grpc-js/src/generated/grpc/channelz/v1/SocketOptionTimeout.ts index b49a68374..185839b2c 100644 --- a/packages/grpc-js/src/generated/grpc/channelz/v1/SocketOptionTimeout.ts +++ b/packages/grpc-js/src/generated/grpc/channelz/v1/SocketOptionTimeout.ts @@ -1,6 +1,6 @@ // Original file: proto/channelz.proto -import type { Duration as _google_protobuf_Duration, Duration__Output as _google_protobuf_Duration__Output } from '../../../google/protobuf/Duration.ts'; +import type { Duration as _google_protobuf_Duration, Duration__Output as _google_protobuf_Duration__Output } from '../../../google/protobuf/Duration'; /** * For use with SocketOption's additional field. This is primarily used for diff --git a/packages/grpc-js/src/generated/grpc/channelz/v1/Subchannel.ts b/packages/grpc-js/src/generated/grpc/channelz/v1/Subchannel.ts index 937d39749..7122fac83 100644 --- a/packages/grpc-js/src/generated/grpc/channelz/v1/Subchannel.ts +++ b/packages/grpc-js/src/generated/grpc/channelz/v1/Subchannel.ts @@ -1,9 +1,9 @@ // Original file: proto/channelz.proto -import type { SubchannelRef as _grpc_channelz_v1_SubchannelRef, SubchannelRef__Output as _grpc_channelz_v1_SubchannelRef__Output } from '../../../grpc/channelz/v1/SubchannelRef.ts'; -import type { ChannelData as _grpc_channelz_v1_ChannelData, ChannelData__Output as _grpc_channelz_v1_ChannelData__Output } from '../../../grpc/channelz/v1/ChannelData.ts'; -import type { ChannelRef as _grpc_channelz_v1_ChannelRef, ChannelRef__Output as _grpc_channelz_v1_ChannelRef__Output } from '../../../grpc/channelz/v1/ChannelRef.ts'; -import type { SocketRef as _grpc_channelz_v1_SocketRef, SocketRef__Output as _grpc_channelz_v1_SocketRef__Output } from '../../../grpc/channelz/v1/SocketRef.ts'; +import type { SubchannelRef as _grpc_channelz_v1_SubchannelRef, SubchannelRef__Output as _grpc_channelz_v1_SubchannelRef__Output } from '../../../grpc/channelz/v1/SubchannelRef'; +import type { ChannelData as _grpc_channelz_v1_ChannelData, ChannelData__Output as _grpc_channelz_v1_ChannelData__Output } from '../../../grpc/channelz/v1/ChannelData'; +import type { ChannelRef as _grpc_channelz_v1_ChannelRef, ChannelRef__Output as _grpc_channelz_v1_ChannelRef__Output } from '../../../grpc/channelz/v1/ChannelRef'; +import type { SocketRef as _grpc_channelz_v1_SocketRef, SocketRef__Output as _grpc_channelz_v1_SocketRef__Output } from '../../../grpc/channelz/v1/SocketRef'; /** * Subchannel is a logical grouping of channels, subchannels, and sockets. diff --git a/packages/grpc-js/test/generated/Request.ts b/packages/grpc-js/test/generated/Request.ts index d64ebb6ea..e4b28270f 100644 --- a/packages/grpc-js/test/generated/Request.ts +++ b/packages/grpc-js/test/generated/Request.ts @@ -5,10 +5,12 @@ export interface Request { 'error'?: (boolean); 'message'?: (string); 'errorAfter'?: (number); + 'responseLength'?: (number); } export interface Request__Output { 'error': (boolean); 'message': (string); 'errorAfter': (number); + 'responseLength': (number); } diff --git a/packages/grpc-js/test/generated/TestService.ts b/packages/grpc-js/test/generated/TestService.ts index e477c99b5..30386fe7b 100644 --- a/packages/grpc-js/test/generated/TestService.ts +++ b/packages/grpc-js/test/generated/TestService.ts @@ -5,7 +5,7 @@ import type { MethodDefinition } from '@grpc/proto-loader' import type { Request as _Request, Request__Output as _Request__Output } from './Request'; import type { Response as _Response, Response__Output as _Response__Output } from './Response'; -export interface TestServiceClient extends grpc.Client { +export interface TestServiceClient extends grpc.ServiceClient { BidiStream(metadata: grpc.Metadata, options?: grpc.CallOptions): grpc.ClientDuplexStream<_Request, _Response__Output>; BidiStream(options?: grpc.CallOptions): grpc.ClientDuplexStream<_Request, _Response__Output>; bidiStream(metadata: grpc.Metadata, options?: grpc.CallOptions): grpc.ClientDuplexStream<_Request, _Response__Output>; diff --git a/packages/grpc-js/test/generated/test_service.ts b/packages/grpc-js/test/generated/test_service.ts index 364acddeb..f6b387b8b 100644 --- a/packages/grpc-js/test/generated/test_service.ts +++ b/packages/grpc-js/test/generated/test_service.ts @@ -3,13 +3,13 @@ import type { MessageTypeDefinition } from '@grpc/proto-loader'; import type { TestServiceClient as _TestServiceClient, TestServiceDefinition as _TestServiceDefinition } from './TestService'; -type SubtypeConstructor any, Subtype> = { - new(...args: ConstructorParameters): Subtype; -}; +type SubtypeConstructor = { + new (address: string, credentials: grpc.ChannelCredentials, options?: Partial): Subtype; +} & grpc.ServiceClientConstructor; -export interface ProtoGrpcType { +export interface ProtoGrpcType extends grpc.GrpcObject { Request: MessageTypeDefinition Response: MessageTypeDefinition - TestService: SubtypeConstructor & { service: _TestServiceDefinition } + TestService: SubtypeConstructor<_TestServiceClient> & { service: _TestServiceDefinition } } diff --git a/packages/grpc-js/test/test-channelz.ts b/packages/grpc-js/test/test-channelz.ts index 5c3dc3d7d..9093100a6 100644 --- a/packages/grpc-js/test/test-channelz.ts +++ b/packages/grpc-js/test/test-channelz.ts @@ -32,9 +32,7 @@ const loadedChannelzProto = protoLoader.loadSync('channelz.proto', { oneofs: true, includeDirs: [`${__dirname}/../../proto`], }); -const channelzGrpcObject = grpc.loadPackageDefinition( - loadedChannelzProto -) as unknown as ProtoGrpcType; +const channelzGrpcObject = grpc.loadPackageDefinition(loadedChannelzProto) as ProtoGrpcType; const TestServiceClient = loadProtoFile( `${__dirname}/fixtures/test_service.proto` diff --git a/packages/grpc-js/test/test-server.ts b/packages/grpc-js/test/test-server.ts index 1ea14097f..da3b3855a 100644 --- a/packages/grpc-js/test/test-server.ts +++ b/packages/grpc-js/test/test-server.ts @@ -55,9 +55,7 @@ const loadedTestServiceProto = protoLoader.loadSync( } ); -const testServiceGrpcObject = grpc.loadPackageDefinition( - loadedTestServiceProto -) as unknown as TestServiceGrpcType; +const testServiceGrpcObject: TestServiceGrpcType = grpc.loadPackageDefinition(loadedTestServiceProto) as TestServiceGrpcType; const ca = fs.readFileSync(path.join(__dirname, 'fixtures', 'ca.pem')); const key = fs.readFileSync(path.join(__dirname, 'fixtures', 'server1.key')); diff --git a/packages/proto-loader/README.md b/packages/proto-loader/README.md index 3ee672725..8aa5c14c4 100644 --- a/packages/proto-loader/README.md +++ b/packages/proto-loader/README.md @@ -122,9 +122,7 @@ const exampleServer: ExampleHandlers = { }; const packageDefinition = protoLoader.loadSync('./proto/example.proto'); -const proto = (grpc.loadPackageDefinition( - packageDefinition -) as unknown) as ProtoGrpcType; +const proto: ProtoGrpcType = grpc.loadPackageDefinition(packageDefinition) as ProtoGrpcType; const server = new grpc.Server(); server.addService(proto.example_package.Example.service, exampleServer); diff --git a/packages/proto-loader/bin/proto-loader-gen-types.ts b/packages/proto-loader/bin/proto-loader-gen-types.ts index 1e02eefd7..bd53c9e1d 100644 --- a/packages/proto-loader/bin/proto-loader-gen-types.ts +++ b/packages/proto-loader/bin/proto-loader-gen-types.ts @@ -729,7 +729,7 @@ function generateSingleLoadedDefinitionType(formatter: TextFormatter, nested: Pr formatComment(formatter, nested.comment, nested.options); } const typeInterfaceName = getTypeInterfaceName(nested); - formatter.writeLine(`${nested.name}: SubtypeConstructor & { service: ${typeInterfaceName}Definition }`); + formatter.writeLine(`${nested.name}: SubtypeConstructor<${typeInterfaceName}Client> & { service: ${typeInterfaceName}Definition }`); } else if (nested instanceof Protobuf.Enum) { formatter.writeLine(`${nested.name}: EnumTypeDefinition`); } else if (nested instanceof Protobuf.Type) { @@ -760,9 +760,9 @@ function generateRootFile(formatter: TextFormatter, root: Protobuf.Root, options generateServiceImports(formatter, root, options); formatter.writeLine(''); - formatter.writeLine('type SubtypeConstructor any, Subtype> = grpc.ServiceClientConstructor & {'); - formatter.writeLine(' new(...args: ConstructorParameters): Subtype;'); - formatter.writeLine('};'); + formatter.writeLine('type SubtypeConstructor = {'); + formatter.writeLine(' new (address: string, credentials: grpc.ChannelCredentials, options?: Partial): Subtype;'); + formatter.writeLine('} & grpc.ServiceClientConstructor;'); formatter.writeLine(''); formatter.writeLine('export interface ProtoGrpcType extends grpc.GrpcObject {'); diff --git a/packages/proto-loader/golden-generated/echo.ts b/packages/proto-loader/golden-generated/echo.ts index 600e2864c..93f28c066 100644 --- a/packages/proto-loader/golden-generated/echo.ts +++ b/packages/proto-loader/golden-generated/echo.ts @@ -4,11 +4,11 @@ import type { EnumTypeDefinition, MessageTypeDefinition } from '@grpc/proto-load import type { OperationsClient as _google_longrunning_OperationsClient, OperationsDefinition as _google_longrunning_OperationsDefinition } from './google/longrunning/Operations'; import type { EchoClient as _google_showcase_v1beta1_EchoClient, EchoDefinition as _google_showcase_v1beta1_EchoDefinition } from './google/showcase/v1beta1/Echo'; -type SubtypeConstructor any, Subtype> = { - new(...args: ConstructorParameters): Subtype; -}; +type SubtypeConstructor = { + new (address: string, credentials: grpc.ChannelCredentials, options?: Partial): Subtype; +} & grpc.ServiceClientConstructor; -export interface ProtoGrpcType { +export interface ProtoGrpcType extends grpc.GrpcObject { google: { api: { CustomHttpPattern: MessageTypeDefinition @@ -35,7 +35,7 @@ export interface ProtoGrpcType { * returns long-running operations should implement the `Operations` interface * so developers can have a consistent client experience. */ - Operations: SubtypeConstructor & { service: _google_longrunning_OperationsDefinition } + Operations: SubtypeConstructor<_google_longrunning_OperationsClient> & { service: _google_longrunning_OperationsDefinition } WaitOperationRequest: MessageTypeDefinition } protobuf: { @@ -78,7 +78,7 @@ export interface ProtoGrpcType { * paginated calls. Set the 'showcase-trailer' metadata key on any method * to have the values echoed in the response trailers. */ - Echo: SubtypeConstructor & { service: _google_showcase_v1beta1_EchoDefinition } + Echo: SubtypeConstructor<_google_showcase_v1beta1_EchoClient> & { service: _google_showcase_v1beta1_EchoDefinition } EchoRequest: MessageTypeDefinition EchoResponse: MessageTypeDefinition ExpandRequest: MessageTypeDefinition diff --git a/packages/proto-loader/golden-generated/google/longrunning/Operations.ts b/packages/proto-loader/golden-generated/google/longrunning/Operations.ts index 00d6a95d2..a21f88be4 100644 --- a/packages/proto-loader/golden-generated/google/longrunning/Operations.ts +++ b/packages/proto-loader/golden-generated/google/longrunning/Operations.ts @@ -22,7 +22,7 @@ import type { IWaitOperationRequest as I_google_longrunning_WaitOperationRequest * returns long-running operations should implement the `Operations` interface * so developers can have a consistent client experience. */ -export interface OperationsClient extends grpc.Client { +export interface OperationsClient extends grpc.ServiceClient { /** * Starts asynchronous cancellation on a long-running operation. The server * makes a best effort to cancel the operation, but success is not diff --git a/packages/proto-loader/golden-generated/google/showcase/v1beta1/Echo.ts b/packages/proto-loader/golden-generated/google/showcase/v1beta1/Echo.ts index a0330fe68..bf51bfdbe 100644 --- a/packages/proto-loader/golden-generated/google/showcase/v1beta1/Echo.ts +++ b/packages/proto-loader/golden-generated/google/showcase/v1beta1/Echo.ts @@ -19,7 +19,7 @@ import type { IWaitRequest as I_google_showcase_v1beta1_WaitRequest, OWaitReques * paginated calls. Set the 'showcase-trailer' metadata key on any method * to have the values echoed in the response trailers. */ -export interface EchoClient extends grpc.Client { +export interface EchoClient extends grpc.ServiceClient { /** * This method will block (wait) for the requested amount of time * and then return the response or error.