Comparing version 1.0.5 to 1.0.6
@@ -24,3 +24,3 @@ "use strict"; | ||
? newMiddleware | ||
: nice_grpc_common_1.composeClientMiddleware(middleware, newMiddleware)); | ||
: (0, nice_grpc_common_1.composeClientMiddleware)(middleware, newMiddleware)); | ||
}, | ||
@@ -32,3 +32,3 @@ create(definition, channel, defaultCallOptions = {}) { | ||
const client = {}; | ||
const methodEntries = Object.entries(service_definitions_1.normalizeServiceDefinition(definition)); | ||
const methodEntries = Object.entries((0, service_definitions_1.normalizeServiceDefinition)(definition)); | ||
for (const [methodName, methodDefinition] of methodEntries) { | ||
@@ -41,6 +41,6 @@ const defaultOptions = { | ||
if (!methodDefinition.responseStream) { | ||
client[methodName] = createUnaryMethod_1.createUnaryMethod(methodDefinition, grpcClient, middleware, defaultOptions); | ||
client[methodName] = (0, createUnaryMethod_1.createUnaryMethod)(methodDefinition, grpcClient, middleware, defaultOptions); | ||
} | ||
else { | ||
client[methodName] = createServerStreamingMethod_1.createServerStreamingMethod(methodDefinition, grpcClient, middleware, defaultOptions); | ||
client[methodName] = (0, createServerStreamingMethod_1.createServerStreamingMethod)(methodDefinition, grpcClient, middleware, defaultOptions); | ||
} | ||
@@ -50,6 +50,6 @@ } | ||
if (!methodDefinition.responseStream) { | ||
client[methodName] = createClientStreamingMethod_1.createClientStreamingMethod(methodDefinition, grpcClient, middleware, defaultOptions); | ||
client[methodName] = (0, createClientStreamingMethod_1.createClientStreamingMethod)(methodDefinition, grpcClient, middleware, defaultOptions); | ||
} | ||
else { | ||
client[methodName] = createBidiStreamingMethod_1.createBidiStreamingMethod(methodDefinition, grpcClient, middleware, defaultOptions); | ||
client[methodName] = (0, createBidiStreamingMethod_1.createBidiStreamingMethod)(methodDefinition, grpcClient, middleware, defaultOptions); | ||
} | ||
@@ -56,0 +56,0 @@ } |
@@ -18,3 +18,3 @@ "use strict"; | ||
function createBidiStreamingMethod(definition, client, middleware, defaultOptions) { | ||
const grpcMethodDefinition = service_definitions_1.toGrpcJsMethodDefinition(definition); | ||
const grpcMethodDefinition = (0, service_definitions_1.toGrpcJsMethodDefinition)(definition); | ||
const methodDescriptor = { | ||
@@ -27,14 +27,14 @@ path: definition.path, | ||
async function* bidiStreamingMethod(request, options) { | ||
if (!isAsyncIterable_1.isAsyncIterable(request)) { | ||
if (!(0, isAsyncIterable_1.isAsyncIterable)(request)) { | ||
throw new Error('A middleware passed invalid request to next(): expected a single message for bidirectional streaming method'); | ||
} | ||
const { metadata = nice_grpc_common_1.Metadata(), signal = new node_abort_controller_1.default().signal, onHeader, onTrailer, } = options; | ||
const { metadata = (0, nice_grpc_common_1.Metadata)(), signal = new node_abort_controller_1.default().signal, onHeader, onTrailer, } = options; | ||
const pipeAbortController = new node_abort_controller_1.default(); | ||
const call = client.makeBidiStreamRequest(grpcMethodDefinition.path, grpcMethodDefinition.requestSerialize, grpcMethodDefinition.responseDeserialize, convertMetadata_1.convertMetadataToGrpcJs(metadata)); | ||
patchClientWritableStream_1.patchClientWritableStream(call); | ||
const call = client.makeBidiStreamRequest(grpcMethodDefinition.path, grpcMethodDefinition.requestSerialize, grpcMethodDefinition.responseDeserialize, (0, convertMetadata_1.convertMetadataToGrpcJs)(metadata)); | ||
(0, patchClientWritableStream_1.patchClientWritableStream)(call); | ||
call.on('metadata', metadata => { | ||
onHeader === null || onHeader === void 0 ? void 0 : onHeader(convertMetadata_1.convertMetadataFromGrpcJs(metadata)); | ||
onHeader === null || onHeader === void 0 ? void 0 : onHeader((0, convertMetadata_1.convertMetadataFromGrpcJs)(metadata)); | ||
}); | ||
call.on('status', status => { | ||
onTrailer === null || onTrailer === void 0 ? void 0 : onTrailer(convertMetadata_1.convertMetadataFromGrpcJs(status.metadata)); | ||
onTrailer === null || onTrailer === void 0 ? void 0 : onTrailer((0, convertMetadata_1.convertMetadataFromGrpcJs)(status.metadata)); | ||
}); | ||
@@ -45,3 +45,3 @@ let pipeError; | ||
}, err => { | ||
if (!abort_controller_x_1.isAbortError(err)) { | ||
if (!(0, abort_controller_x_1.isAbortError)(err)) { | ||
pipeError = err; | ||
@@ -57,6 +57,6 @@ call.cancel(); | ||
try { | ||
yield* readableToAsyncIterable_1.readableToAsyncIterable(call); | ||
yield* (0, readableToAsyncIterable_1.readableToAsyncIterable)(call); | ||
} | ||
catch (err) { | ||
throw wrapClientError_1.wrapClientError(err, definition.path); | ||
throw (0, wrapClientError_1.wrapClientError)(err, definition.path); | ||
} | ||
@@ -66,3 +66,3 @@ finally { | ||
signal.removeEventListener('abort', abortListener); | ||
abort_controller_x_1.throwIfAborted(signal); | ||
(0, abort_controller_x_1.throwIfAborted)(signal); | ||
call.cancel(); | ||
@@ -113,6 +113,6 @@ if (pipeError) { | ||
for await (const item of request) { | ||
abort_controller_x_1.throwIfAborted(signal); | ||
(0, abort_controller_x_1.throwIfAborted)(signal); | ||
const shouldContinue = call.write(item); | ||
if (!shouldContinue) { | ||
await abort_controller_x_1.waitForEvent(signal, call, 'drain'); | ||
await (0, abort_controller_x_1.waitForEvent)(signal, call, 'drain'); | ||
} | ||
@@ -119,0 +119,0 @@ } |
@@ -17,3 +17,3 @@ "use strict"; | ||
function createClientStreamingMethod(definition, client, middleware, defaultOptions) { | ||
const grpcMethodDefinition = service_definitions_1.toGrpcJsMethodDefinition(definition); | ||
const grpcMethodDefinition = (0, service_definitions_1.toGrpcJsMethodDefinition)(definition); | ||
const methodDescriptor = { | ||
@@ -26,12 +26,12 @@ path: definition.path, | ||
async function* clientStreamingMethod(request, options) { | ||
if (!isAsyncIterable_1.isAsyncIterable(request)) { | ||
if (!(0, isAsyncIterable_1.isAsyncIterable)(request)) { | ||
throw new Error('A middleware passed invalid request to next(): expected a single message for client streaming method'); | ||
} | ||
const { metadata = nice_grpc_common_1.Metadata(), signal = new node_abort_controller_1.default().signal, onHeader, onTrailer, } = options; | ||
return await abort_controller_x_1.execute(signal, (resolve, reject) => { | ||
const { metadata = (0, nice_grpc_common_1.Metadata)(), signal = new node_abort_controller_1.default().signal, onHeader, onTrailer, } = options; | ||
return await (0, abort_controller_x_1.execute)(signal, (resolve, reject) => { | ||
const pipeAbortController = new node_abort_controller_1.default(); | ||
const call = client.makeClientStreamRequest(grpcMethodDefinition.path, grpcMethodDefinition.requestSerialize, grpcMethodDefinition.responseDeserialize, convertMetadata_1.convertMetadataToGrpcJs(metadata), (err, response) => { | ||
const call = client.makeClientStreamRequest(grpcMethodDefinition.path, grpcMethodDefinition.requestSerialize, grpcMethodDefinition.responseDeserialize, (0, convertMetadata_1.convertMetadataToGrpcJs)(metadata), (err, response) => { | ||
pipeAbortController.abort(); | ||
if (err != null) { | ||
reject(wrapClientError_1.wrapClientError(err, definition.path)); | ||
reject((0, wrapClientError_1.wrapClientError)(err, definition.path)); | ||
} | ||
@@ -42,8 +42,8 @@ else { | ||
}); | ||
patchClientWritableStream_1.patchClientWritableStream(call); | ||
(0, patchClientWritableStream_1.patchClientWritableStream)(call); | ||
call.on('metadata', metadata => { | ||
onHeader === null || onHeader === void 0 ? void 0 : onHeader(convertMetadata_1.convertMetadataFromGrpcJs(metadata)); | ||
onHeader === null || onHeader === void 0 ? void 0 : onHeader((0, convertMetadata_1.convertMetadataFromGrpcJs)(metadata)); | ||
}); | ||
call.on('status', status => { | ||
onTrailer === null || onTrailer === void 0 ? void 0 : onTrailer(convertMetadata_1.convertMetadataFromGrpcJs(status.metadata)); | ||
onTrailer === null || onTrailer === void 0 ? void 0 : onTrailer((0, convertMetadata_1.convertMetadataFromGrpcJs)(status.metadata)); | ||
}); | ||
@@ -53,3 +53,3 @@ pipeRequest(pipeAbortController.signal, request, call).then(() => { | ||
}, err => { | ||
if (!abort_controller_x_1.isAbortError(err)) { | ||
if (!(0, abort_controller_x_1.isAbortError)(err)) { | ||
reject(err); | ||
@@ -97,6 +97,6 @@ call.cancel(); | ||
for await (const item of request) { | ||
abort_controller_x_1.throwIfAborted(signal); | ||
(0, abort_controller_x_1.throwIfAborted)(signal); | ||
const shouldContinue = call.write(item); | ||
if (!shouldContinue) { | ||
await abort_controller_x_1.waitForEvent(signal, call, 'drain'); | ||
await (0, abort_controller_x_1.waitForEvent)(signal, call, 'drain'); | ||
} | ||
@@ -103,0 +103,0 @@ } |
@@ -17,3 +17,3 @@ "use strict"; | ||
function createServerStreamingMethod(definition, client, middleware, defaultOptions) { | ||
const grpcMethodDefinition = service_definitions_1.toGrpcJsMethodDefinition(definition); | ||
const grpcMethodDefinition = (0, service_definitions_1.toGrpcJsMethodDefinition)(definition); | ||
const methodDescriptor = { | ||
@@ -26,12 +26,12 @@ path: definition.path, | ||
async function* serverStreamingMethod(request, options) { | ||
if (isAsyncIterable_1.isAsyncIterable(request)) { | ||
if ((0, isAsyncIterable_1.isAsyncIterable)(request)) { | ||
throw new Error('A middleware passed invalid request to next(): expected a single message for server streaming method'); | ||
} | ||
const { metadata = nice_grpc_common_1.Metadata(), signal = new node_abort_controller_1.default().signal, onHeader, onTrailer, } = options; | ||
const call = client.makeServerStreamRequest(grpcMethodDefinition.path, grpcMethodDefinition.requestSerialize, grpcMethodDefinition.responseDeserialize, request, convertMetadata_1.convertMetadataToGrpcJs(metadata)); | ||
const { metadata = (0, nice_grpc_common_1.Metadata)(), signal = new node_abort_controller_1.default().signal, onHeader, onTrailer, } = options; | ||
const call = client.makeServerStreamRequest(grpcMethodDefinition.path, grpcMethodDefinition.requestSerialize, grpcMethodDefinition.responseDeserialize, request, (0, convertMetadata_1.convertMetadataToGrpcJs)(metadata)); | ||
call.on('metadata', metadata => { | ||
onHeader === null || onHeader === void 0 ? void 0 : onHeader(convertMetadata_1.convertMetadataFromGrpcJs(metadata)); | ||
onHeader === null || onHeader === void 0 ? void 0 : onHeader((0, convertMetadata_1.convertMetadataFromGrpcJs)(metadata)); | ||
}); | ||
call.on('status', status => { | ||
onTrailer === null || onTrailer === void 0 ? void 0 : onTrailer(convertMetadata_1.convertMetadataFromGrpcJs(status.metadata)); | ||
onTrailer === null || onTrailer === void 0 ? void 0 : onTrailer((0, convertMetadata_1.convertMetadataFromGrpcJs)(status.metadata)); | ||
}); | ||
@@ -43,10 +43,10 @@ const abortListener = () => { | ||
try { | ||
yield* readableToAsyncIterable_1.readableToAsyncIterable(call); | ||
yield* (0, readableToAsyncIterable_1.readableToAsyncIterable)(call); | ||
} | ||
catch (err) { | ||
throw wrapClientError_1.wrapClientError(err, definition.path); | ||
throw (0, wrapClientError_1.wrapClientError)(err, definition.path); | ||
} | ||
finally { | ||
signal.removeEventListener('abort', abortListener); | ||
abort_controller_x_1.throwIfAborted(signal); | ||
(0, abort_controller_x_1.throwIfAborted)(signal); | ||
call.cancel(); | ||
@@ -53,0 +53,0 @@ } |
@@ -16,3 +16,3 @@ "use strict"; | ||
function createUnaryMethod(definition, client, middleware, defaultOptions) { | ||
const grpcMethodDefinition = service_definitions_1.toGrpcJsMethodDefinition(definition); | ||
const grpcMethodDefinition = (0, service_definitions_1.toGrpcJsMethodDefinition)(definition); | ||
const methodDescriptor = { | ||
@@ -25,10 +25,10 @@ path: definition.path, | ||
async function* unaryMethod(request, options) { | ||
if (isAsyncIterable_1.isAsyncIterable(request)) { | ||
if ((0, isAsyncIterable_1.isAsyncIterable)(request)) { | ||
throw new Error('A middleware passed invalid request to next(): expected a single message for unary method'); | ||
} | ||
const { metadata = nice_grpc_common_1.Metadata(), signal = new node_abort_controller_1.default().signal, onHeader, onTrailer, } = options; | ||
return await abort_controller_x_1.execute(signal, (resolve, reject) => { | ||
const call = client.makeUnaryRequest(grpcMethodDefinition.path, grpcMethodDefinition.requestSerialize, grpcMethodDefinition.responseDeserialize, request, convertMetadata_1.convertMetadataToGrpcJs(metadata), (err, response) => { | ||
const { metadata = (0, nice_grpc_common_1.Metadata)(), signal = new node_abort_controller_1.default().signal, onHeader, onTrailer, } = options; | ||
return await (0, abort_controller_x_1.execute)(signal, (resolve, reject) => { | ||
const call = client.makeUnaryRequest(grpcMethodDefinition.path, grpcMethodDefinition.requestSerialize, grpcMethodDefinition.responseDeserialize, request, (0, convertMetadata_1.convertMetadataToGrpcJs)(metadata), (err, response) => { | ||
if (err != null) { | ||
reject(wrapClientError_1.wrapClientError(err, definition.path)); | ||
reject((0, wrapClientError_1.wrapClientError)(err, definition.path)); | ||
} | ||
@@ -40,6 +40,6 @@ else { | ||
call.on('metadata', metadata => { | ||
onHeader === null || onHeader === void 0 ? void 0 : onHeader(convertMetadata_1.convertMetadataFromGrpcJs(metadata)); | ||
onHeader === null || onHeader === void 0 ? void 0 : onHeader((0, convertMetadata_1.convertMetadataFromGrpcJs)(metadata)); | ||
}); | ||
call.on('status', status => { | ||
onTrailer === null || onTrailer === void 0 ? void 0 : onTrailer(convertMetadata_1.convertMetadataFromGrpcJs(status.metadata)); | ||
onTrailer === null || onTrailer === void 0 ? void 0 : onTrailer((0, convertMetadata_1.convertMetadataFromGrpcJs)(status.metadata)); | ||
}); | ||
@@ -46,0 +46,0 @@ return () => { |
@@ -12,4 +12,4 @@ "use strict"; | ||
function createCallContext(call) { | ||
const header = nice_grpc_common_1.Metadata(); | ||
const trailer = nice_grpc_common_1.Metadata(); | ||
const header = (0, nice_grpc_common_1.Metadata)(); | ||
const trailer = (0, nice_grpc_common_1.Metadata)(); | ||
const abortController = new node_abort_controller_1.default(); | ||
@@ -25,7 +25,7 @@ if (call.cancelled) { | ||
return { | ||
metadata: convertMetadata_1.convertMetadataFromGrpcJs(call.metadata), | ||
metadata: (0, convertMetadata_1.convertMetadataFromGrpcJs)(call.metadata), | ||
peer: call.getPeer(), | ||
header, | ||
sendHeader() { | ||
call.sendMetadata(convertMetadata_1.convertMetadataToGrpcJs(header)); | ||
call.sendMetadata((0, convertMetadata_1.convertMetadataToGrpcJs)(header)); | ||
}, | ||
@@ -32,0 +32,0 @@ trailer, |
@@ -16,3 +16,3 @@ "use strict"; | ||
} | ||
else if (abort_controller_x_1.isAbortError(error)) { | ||
else if ((0, abort_controller_x_1.isAbortError)(error)) { | ||
return { | ||
@@ -19,0 +19,0 @@ code: grpc_js_1.status.CANCELLED, |
@@ -19,3 +19,3 @@ "use strict"; | ||
async function* bidiStreamingMethodHandler(request, context) { | ||
if (!isAsyncIterable_1.isAsyncIterable(request)) { | ||
if (!(0, isAsyncIterable_1.isAsyncIterable)(request)) { | ||
throw new Error('A middleware passed invalid request to next(): expected a single message for bidirectional streaming method'); | ||
@@ -35,6 +35,6 @@ } | ||
return call => { | ||
const context = createCallContext_1.createCallContext(call); | ||
const context = (0, createCallContext_1.createCallContext)(call); | ||
Promise.resolve() | ||
.then(async () => { | ||
const iterable = handler(readableToAsyncIterable_1.readableToAsyncIterable(call), context); | ||
const iterable = handler((0, readableToAsyncIterable_1.readableToAsyncIterable)(call), context); | ||
const iterator = iterable[Symbol.asyncIterator](); | ||
@@ -47,7 +47,7 @@ let result = await iterator.next(); | ||
if (!shouldContinue) { | ||
await abort_controller_x_1.waitForEvent(context.signal, call, 'drain'); | ||
await (0, abort_controller_x_1.waitForEvent)(context.signal, call, 'drain'); | ||
} | ||
} | ||
catch (err) { | ||
result = abort_controller_x_1.isAbortError(err) | ||
result = (0, abort_controller_x_1.isAbortError)(err) | ||
? await iterator.return() | ||
@@ -68,5 +68,5 @@ : await iterator.throw(err); | ||
.then(() => { | ||
call.end(convertMetadata_1.convertMetadataToGrpcJs(context.trailer)); | ||
call.end((0, convertMetadata_1.convertMetadataToGrpcJs)(context.trailer)); | ||
}, err => { | ||
call.destroy(createErrorStatusObject_1.createErrorStatusObject(definition.path, err, convertMetadata_1.convertMetadataToGrpcJs(context.trailer))); | ||
call.destroy((0, createErrorStatusObject_1.createErrorStatusObject)(definition.path, err, (0, convertMetadata_1.convertMetadataToGrpcJs)(context.trailer))); | ||
}); | ||
@@ -73,0 +73,0 @@ }; |
@@ -18,3 +18,3 @@ "use strict"; | ||
async function* clientStreamingMethodHandler(request, context) { | ||
if (!isAsyncIterable_1.isAsyncIterable(request)) { | ||
if (!(0, isAsyncIterable_1.isAsyncIterable)(request)) { | ||
throw new Error('A middleware passed invalid request to next(): expected a single message for client streaming method'); | ||
@@ -34,6 +34,6 @@ } | ||
return (call, callback) => { | ||
const context = createCallContext_1.createCallContext(call); | ||
const context = (0, createCallContext_1.createCallContext)(call); | ||
Promise.resolve() | ||
.then(async () => { | ||
const iterable = handler(readableToAsyncIterable_1.readableToAsyncIterable(call), context); | ||
const iterable = handler((0, readableToAsyncIterable_1.readableToAsyncIterable)(call), context); | ||
const iterator = iterable[Symbol.asyncIterator](); | ||
@@ -54,5 +54,5 @@ let result = await iterator.next(); | ||
.then(res => { | ||
callback(null, res, convertMetadata_1.convertMetadataToGrpcJs(context.trailer)); | ||
callback(null, res, (0, convertMetadata_1.convertMetadataToGrpcJs)(context.trailer)); | ||
}, err => { | ||
callback(createErrorStatusObject_1.createErrorStatusObject(definition.path, err, convertMetadata_1.convertMetadataToGrpcJs(context.trailer))); | ||
callback((0, createErrorStatusObject_1.createErrorStatusObject)(definition.path, err, (0, convertMetadata_1.convertMetadataToGrpcJs)(context.trailer))); | ||
}); | ||
@@ -59,0 +59,0 @@ }; |
@@ -18,3 +18,3 @@ "use strict"; | ||
async function* serverStreamingMethodHandler(request, context) { | ||
if (isAsyncIterable_1.isAsyncIterable(request)) { | ||
if ((0, isAsyncIterable_1.isAsyncIterable)(request)) { | ||
throw new Error('A middleware passed invalid request to next(): expected a single message for server streaming method'); | ||
@@ -34,3 +34,3 @@ } | ||
return call => { | ||
const context = createCallContext_1.createCallContext(call); | ||
const context = (0, createCallContext_1.createCallContext)(call); | ||
Promise.resolve() | ||
@@ -46,7 +46,7 @@ .then(async () => { | ||
if (!shouldContinue) { | ||
await abort_controller_x_1.waitForEvent(context.signal, call, 'drain'); | ||
await (0, abort_controller_x_1.waitForEvent)(context.signal, call, 'drain'); | ||
} | ||
} | ||
catch (err) { | ||
result = abort_controller_x_1.isAbortError(err) | ||
result = (0, abort_controller_x_1.isAbortError)(err) | ||
? await iterator.return() | ||
@@ -67,5 +67,5 @@ : await iterator.throw(err); | ||
.then(() => { | ||
call.end(convertMetadata_1.convertMetadataToGrpcJs(context.trailer)); | ||
call.end((0, convertMetadata_1.convertMetadataToGrpcJs)(context.trailer)); | ||
}, err => { | ||
call.destroy(createErrorStatusObject_1.createErrorStatusObject(definition.path, err, convertMetadata_1.convertMetadataToGrpcJs(context.trailer))); | ||
call.destroy((0, createErrorStatusObject_1.createErrorStatusObject)(definition.path, err, (0, convertMetadata_1.convertMetadataToGrpcJs)(context.trailer))); | ||
}); | ||
@@ -72,0 +72,0 @@ }; |
@@ -17,3 +17,3 @@ "use strict"; | ||
async function* unaryMethodHandler(request, context) { | ||
if (isAsyncIterable_1.isAsyncIterable(request)) { | ||
if ((0, isAsyncIterable_1.isAsyncIterable)(request)) { | ||
throw new Error('A middleware passed invalid request to next(): expected a single message for unary method'); | ||
@@ -33,3 +33,3 @@ } | ||
return (call, callback) => { | ||
const context = createCallContext_1.createCallContext(call); | ||
const context = (0, createCallContext_1.createCallContext)(call); | ||
Promise.resolve() | ||
@@ -53,5 +53,5 @@ .then(async () => { | ||
.then(res => { | ||
callback(null, res, convertMetadata_1.convertMetadataToGrpcJs(context.trailer)); | ||
callback(null, res, (0, convertMetadata_1.convertMetadataToGrpcJs)(context.trailer)); | ||
}, err => { | ||
callback(createErrorStatusObject_1.createErrorStatusObject(definition.path, err, convertMetadata_1.convertMetadataToGrpcJs(context.trailer))); | ||
callback((0, createErrorStatusObject_1.createErrorStatusObject)(definition.path, err, (0, convertMetadata_1.convertMetadataToGrpcJs)(context.trailer))); | ||
}); | ||
@@ -58,0 +58,0 @@ }; |
@@ -23,3 +23,3 @@ "use strict"; | ||
? newMiddleware | ||
: nice_grpc_common_1.composeServerMiddleware(middleware, newMiddleware)); | ||
: (0, nice_grpc_common_1.composeServerMiddleware)(middleware, newMiddleware)); | ||
}, | ||
@@ -31,3 +31,3 @@ add(definition, implementation) { | ||
services.push({ | ||
definition: service_definitions_1.normalizeServiceDefinition(definition), | ||
definition: (0, service_definitions_1.normalizeServiceDefinition)(definition), | ||
middleware, | ||
@@ -49,3 +49,3 @@ implementation, | ||
? newMiddleware | ||
: nice_grpc_common_1.composeServerMiddleware(middleware, newMiddleware)); | ||
: (0, nice_grpc_common_1.composeServerMiddleware)(middleware, newMiddleware)); | ||
}, | ||
@@ -64,7 +64,7 @@ ...createAddBuilder(middleware), | ||
if (!methodDefinition.responseStream) { | ||
grpcImplementation[methodName] = handleUnaryCall_1.createUnaryMethodHandler(methodDefinition, methodImplementation, middleware); | ||
grpcImplementation[methodName] = (0, handleUnaryCall_1.createUnaryMethodHandler)(methodDefinition, methodImplementation, middleware); | ||
} | ||
else { | ||
grpcImplementation[methodName] = | ||
handleServerStreamingCall_1.createServerStreamingMethodHandler(methodDefinition, methodImplementation, middleware); | ||
(0, handleServerStreamingCall_1.createServerStreamingMethodHandler)(methodDefinition, methodImplementation, middleware); | ||
} | ||
@@ -75,10 +75,10 @@ } | ||
grpcImplementation[methodName] = | ||
handleClientStreamingCall_1.createClientStreamingMethodHandler(methodDefinition, methodImplementation, middleware); | ||
(0, handleClientStreamingCall_1.createClientStreamingMethodHandler)(methodDefinition, methodImplementation, middleware); | ||
} | ||
else { | ||
grpcImplementation[methodName] = handleBidiStreamingCall_1.createBidiStreamingMethodHandler(methodDefinition, methodImplementation, middleware); | ||
grpcImplementation[methodName] = (0, handleBidiStreamingCall_1.createBidiStreamingMethodHandler)(methodDefinition, methodImplementation, middleware); | ||
} | ||
} | ||
} | ||
server.addService(service_definitions_1.toGrpcJsServiceDefinition(definition), grpcImplementation); | ||
server.addService((0, service_definitions_1.toGrpcJsServiceDefinition)(definition), grpcImplementation); | ||
} | ||
@@ -85,0 +85,0 @@ const port = await new Promise((resolve, reject) => { |
@@ -8,7 +8,7 @@ "use strict"; | ||
function normalizeServiceDefinition(definition) { | ||
if (grpc_js_1.isGrpcJsServiceDefinition(definition)) { | ||
return grpc_js_1.fromGrpcJsServiceDefinition(definition); | ||
if ((0, grpc_js_1.isGrpcJsServiceDefinition)(definition)) { | ||
return (0, grpc_js_1.fromGrpcJsServiceDefinition)(definition); | ||
} | ||
else if (ts_proto_1.isTsProtoServiceDefinition(definition)) { | ||
return ts_proto_1.fromTsProtoServiceDefinition(definition); | ||
else if ((0, ts_proto_1.isTsProtoServiceDefinition)(definition)) { | ||
return (0, ts_proto_1.fromTsProtoServiceDefinition)(definition); | ||
} | ||
@@ -15,0 +15,0 @@ else { |
@@ -38,3 +38,3 @@ "use strict"; | ||
function convertMetadataFromGrpcJs(grpcMetadata) { | ||
const metadata = nice_grpc_common_1.Metadata(); | ||
const metadata = (0, nice_grpc_common_1.Metadata)(); | ||
for (const key of Object.keys(grpcMetadata.getMap())) { | ||
@@ -41,0 +41,0 @@ const value = grpcMetadata.get(key); |
@@ -12,3 +12,3 @@ "use strict"; | ||
const origAttachHttp2Stream = http2CallStream.attachHttp2Stream; | ||
http2CallStream.attachHttp2Stream = function patchAttachHttp2Stream(stream, subchannel, extraFilterFactory) { | ||
http2CallStream.attachHttp2Stream = function patchAttachHttp2Stream(stream, ...rest) { | ||
const origWrite = stream.write; | ||
@@ -21,3 +21,3 @@ stream.write = function patchedWrite(...args) { | ||
}; | ||
return origAttachHttp2Stream.call(this, stream, subchannel, extraFilterFactory); | ||
return origAttachHttp2Stream.call(this, stream, ...rest); | ||
}; | ||
@@ -24,0 +24,0 @@ } |
{ | ||
"name": "nice-grpc", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "A Node.js gRPC library that is nice to you", | ||
@@ -49,3 +49,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@grpc/grpc-js": "^1.2.6", | ||
"@grpc/grpc-js": "^1.5.1", | ||
"abort-controller-x": "^0.2.4", | ||
@@ -55,3 +55,3 @@ "nice-grpc-common": "^1.0.4", | ||
}, | ||
"gitHead": "5d08d062313f513648d2632af85d77607513637c" | ||
"gitHead": "c1a525d031cd5f2f4498b92c9756970eff760b16" | ||
} |
@@ -18,4 +18,3 @@ import {ClientWritableStream} from '@grpc/grpc-js'; | ||
stream, | ||
subchannel, | ||
extraFilterFactory, | ||
...rest | ||
) { | ||
@@ -35,9 +34,4 @@ const origWrite = stream.write; | ||
return origAttachHttp2Stream.call( | ||
this, | ||
stream, | ||
subchannel, | ||
extraFilterFactory, | ||
); | ||
return origAttachHttp2Stream.call(this, stream, ...rest); | ||
}; | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
189510
3274
Updated@grpc/grpc-js@^1.5.1