Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions proto/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,12 @@ generate-py:
--pyi_out=${NPI_PROTO_ROOT}/python/npiai_proto \
--grpc_python_out=${NPI_PROTO_ROOT}/python/npiai_proto \
api.proto

# https://github.com/grpc/grpc-web
generate-js:
mkdir -p ${NPI_PROTO_ROOT}/js/api
protoc -I=${NPI_PROTO_ROOT}/include \
-I=${NPI_PROTO_ROOT}/proto \
--js_out=import_style=commonjs,binary:${NPI_PROTO_ROOT}/js/api \
--grpc-web_out=import_style=commonjs+dts,mode=grpcwebtext:${NPI_PROTO_ROOT}/js/api \
api.proto
80 changes: 80 additions & 0 deletions proto/js/api/api_grpc_web_pb.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import * as grpcWeb from 'grpc-web';

import * as google_protobuf_empty_pb from 'google-protobuf/google/protobuf/empty_pb'; // proto import: "google/protobuf/empty.proto"
import * as api_pb from './api_pb'; // proto import: "api.proto"


export class AppServerClient {
constructor (hostname: string,
credentials?: null | { [index: string]: string; },
options?: null | { [index: string]: any; });

chat(
request: api_pb.Request,
metadata: grpcWeb.Metadata | undefined,
callback: (err: grpcWeb.RpcError,
response: api_pb.Response) => void
): grpcWeb.ClientReadableStream<api_pb.Response>;

getAppSchema(
request: api_pb.AppSchemaRequest,
metadata: grpcWeb.Metadata | undefined,
callback: (err: grpcWeb.RpcError,
response: api_pb.AppSchemaResponse) => void
): grpcWeb.ClientReadableStream<api_pb.AppSchemaResponse>;

authorize(
request: api_pb.AuthorizeRequest,
metadata: grpcWeb.Metadata | undefined,
callback: (err: grpcWeb.RpcError,
response: api_pb.AuthorizeResponse) => void
): grpcWeb.ClientReadableStream<api_pb.AuthorizeResponse>;

googleAuthCallback(
request: api_pb.AuthorizeRequest,
metadata: grpcWeb.Metadata | undefined,
callback: (err: grpcWeb.RpcError,
response: google_protobuf_empty_pb.Empty) => void
): grpcWeb.ClientReadableStream<google_protobuf_empty_pb.Empty>;

ping(
request: google_protobuf_empty_pb.Empty,
metadata: grpcWeb.Metadata | undefined,
callback: (err: grpcWeb.RpcError,
response: google_protobuf_empty_pb.Empty) => void
): grpcWeb.ClientReadableStream<google_protobuf_empty_pb.Empty>;

}

export class AppServerPromiseClient {
constructor (hostname: string,
credentials?: null | { [index: string]: string; },
options?: null | { [index: string]: any; });

chat(
request: api_pb.Request,
metadata?: grpcWeb.Metadata
): Promise<api_pb.Response>;

getAppSchema(
request: api_pb.AppSchemaRequest,
metadata?: grpcWeb.Metadata
): Promise<api_pb.AppSchemaResponse>;

authorize(
request: api_pb.AuthorizeRequest,
metadata?: grpcWeb.Metadata
): Promise<api_pb.AuthorizeResponse>;

googleAuthCallback(
request: api_pb.AuthorizeRequest,
metadata?: grpcWeb.Metadata
): Promise<google_protobuf_empty_pb.Empty>;

ping(
request: google_protobuf_empty_pb.Empty,
metadata?: grpcWeb.Metadata
): Promise<google_protobuf_empty_pb.Empty>;

}

Loading