Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pbkit/grpc-web-client

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pbkit/grpc-web-client - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

4

lib/index.d.ts

@@ -34,2 +34,6 @@ import type { RpcClientImpl } from "@pbkit/runtime/rpc";

}
export declare class GrpcWebError extends Error {
status: Status;
constructor(status: Status, message: string);
}
export declare function createGrpcWebClientImpl(config: CreateGrpcWebClientImplConfig): RpcClientImpl<Metadata, Header, Trailer>;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createGrpcWebClientImpl = exports.Status = void 0;
exports.createGrpcWebClientImpl = exports.GrpcWebError = exports.Status = void 0;
const event_buffer_1 = require("@pbkit/runtime/async/event-buffer");

@@ -27,2 +27,9 @@ const observer_1 = require("@pbkit/runtime/async/observer");

})(Status = exports.Status || (exports.Status = {}));
class GrpcWebError extends Error {
constructor(status, message) {
super(message);
this.status = status;
}
}
exports.GrpcWebError = GrpcWebError;
function createGrpcWebClientImpl(config) {

@@ -55,9 +62,15 @@ return (methodDescriptor) => {

grpcClient.onMessage(eventBuffer.push);
grpcClient.onEnd((status, statusMessage, trailer) => {
grpcClient.onEnd((_status, statusMessage, trailer) => {
const status = String(_status);
if (_status > grpc_web_1.grpc.Code.Canceled) {
eventBuffer.error(new GrpcWebError(status, statusMessage));
}
else {
eventBuffer.finish();
}
trailerPromise.resolve({
...grpcMetadataToRecord(trailer),
status: status.toString(),
status,
statusMessage,
});
eventBuffer.finish();
});

@@ -64,0 +77,0 @@ (async () => {

4

package.json
{
"name": "@pbkit/grpc-web-client",
"packageManager": "yarn@3.1.1",
"version": "0.1.1",
"version": "0.1.2",
"description": "pbkit grpc web client",

@@ -21,3 +21,3 @@ "main": "lib/index.js",

"@improbable-eng/grpc-web-node-http-transport": "^0.14.1",
"@pbkit/runtime": "^0.0.21",
"@pbkit/runtime": "^0.0.35",
"google-protobuf": "^3.18.0-rc.2"

@@ -24,0 +24,0 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc