@grpc.ts/core
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -1,11 +0,2 @@ | ||
import type { ServiceClient } from '@grpc/grpc-js/build/src/make-client'; | ||
import type { IClientProps } from './interface'; | ||
interface IGetServiceOptionsProps { | ||
packageName?: string; | ||
} | ||
type TGetServiceFunc = <T extends ServiceClient = ServiceClient>(serviceName: string, options?: IGetServiceOptionsProps) => T | undefined; | ||
export interface IGrpcClientProps { | ||
getService: TGetServiceFunc; | ||
} | ||
export declare function createClient({ url, options, credentials: creds, package: packageInfo, packageDefinitionOptions, }: IClientProps): Promise<IGrpcClientProps>; | ||
export {}; | ||
import type { IClientProps, IGrpcClientWrapperProps } from './interface'; | ||
export declare function createClient({ url, options, credentials: creds, package: packageInfo, packageDefinitionOptions, }: IClientProps): Promise<IGrpcClientWrapperProps>; |
export { createSecureContext } from 'tls'; | ||
export { credentials } from '@grpc/grpc-js'; | ||
export { credentials, Metadata, type ServerUnaryCall } from '@grpc/grpc-js'; | ||
export type { ServiceClient } from '@grpc/grpc-js/build/src/make-client'; | ||
export type { Timestamp } from 'google-protobuf/google/protobuf/timestamp_pb'; | ||
export * from './dataType'; | ||
@@ -8,2 +9,2 @@ export * from './client'; | ||
export * from './utils'; | ||
export type { IClientProps, IServerProps } from './interface'; | ||
export type { IClientProps, IServerProps, IServerWrapperProps, TAddUnaryHandlerFunc, IAddUnaryHandlerOptionsProps, } from './interface'; |
import type { Options } from '@grpc/proto-loader'; | ||
import type { ServiceClient } from '@grpc/grpc-js/build/src/make-client'; | ||
import type { ChannelCredentials, ServerCredentials } from '@grpc/grpc-js'; | ||
import type { Server, Metadata, ServerUnaryCall, ServerCredentials, ChannelCredentials } from '@grpc/grpc-js'; | ||
export type TCompressionAlgorithms = 'identity' | 'deflate' | 'gzip'; | ||
@@ -55,2 +55,32 @@ export interface IChannelOptionsProps { | ||
} | ||
export interface IAddUnaryHandlerOptionsProps { | ||
package?: string; | ||
} | ||
type TUnaryHandlerFunc<TRequest = unknown, TResponse = unknown> = (request: TRequest, metadata: Metadata, call: ServerUnaryCall<TRequest, TResponse>) => TResponse; | ||
export type TAddUnaryHandlerFunc = (serviceName: string, rpcName: string, impl: TUnaryHandlerFunc, options?: IAddUnaryHandlerOptionsProps) => void; | ||
export interface IServerWrapperProps { | ||
server: Server; | ||
addUnaryHandler: TAddUnaryHandlerFunc; | ||
} | ||
interface IGetServiceOptionsProps { | ||
packageName?: string; | ||
} | ||
export type TGetServiceFunc = <T extends ServiceClient = ServiceClient>(serviceName: string, options?: IGetServiceOptionsProps) => T | undefined; | ||
export interface IGrpcClientWrapperProps { | ||
close: () => void; | ||
getService: TGetServiceFunc; | ||
getPackages: () => IClientsProps; | ||
} | ||
export interface IGrpcServerProps extends IServerProps { | ||
serverName?: string; | ||
} | ||
export interface IGrpcServerListProps { | ||
[key: string]: IServerWrapperProps; | ||
} | ||
export interface IGrpcClientProps extends IClientProps { | ||
clientName?: string; | ||
} | ||
export interface IGrpcClientListProps { | ||
[key: string]: IGrpcClientWrapperProps; | ||
} | ||
export {}; |
@@ -1,13 +0,2 @@ | ||
import { Server, type Metadata, type ServerUnaryCall } from '@grpc/grpc-js'; | ||
import type { IServerProps } from './interface'; | ||
interface IAddUnaryHandlerOptionsProps { | ||
package?: string; | ||
} | ||
type TUnaryHandlerFunc<TRequest = unknown, TResponse = unknown> = (request: TRequest, metadata: Metadata, call: ServerUnaryCall<TRequest, TResponse>) => TResponse; | ||
type TAddUnaryHandlerFunc = (serviceName: string, rpcName: string, impl: TUnaryHandlerFunc, options?: IAddUnaryHandlerOptionsProps) => void; | ||
export interface IServerObjProps { | ||
server: Server; | ||
addUnaryHandler: TAddUnaryHandlerFunc; | ||
} | ||
export declare function createServer({ url, options, credentials: creds, package: packageInfo, packageDefinitionOptions, }: IServerProps): Promise<IServerObjProps>; | ||
export {}; | ||
import type { IServerProps, IServerWrapperProps } from './interface'; | ||
export declare function createServer({ url, options, credentials: creds, package: packageInfo, packageDefinitionOptions, }: IServerProps): Promise<IServerWrapperProps>; |
{ | ||
"name": "@grpc.ts/core", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"license": "MIT", | ||
@@ -34,3 +34,3 @@ "directories": { | ||
"dependencies": { | ||
"@grpc/grpc-js": "^1.8.13", | ||
"@grpc/grpc-js": "^1.8.14", | ||
"@grpc/proto-loader": "^0.7.6", | ||
@@ -37,0 +37,0 @@ "google-protobuf": "^3.21.2" |
@@ -14,3 +14,3 @@ A wrapper of [@grpc/grpc-js](https://github.com/grpc/grpc-node) for Node.JS. | ||
pnpm add @gprc-ts/core | ||
pnpm add @grpc.ts/core | ||
``` | ||
@@ -17,0 +17,0 @@ |
Sorry, the diff of this file is not supported yet
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
41644
12
1003
+ Added@types/node@22.10.0(transitive)
- Removed@types/node@22.10.1(transitive)
Updated@grpc/grpc-js@^1.8.14