From 92c1e754e2c059e01d8636fccfd91a295363a673 Mon Sep 17 00:00:00 2001 From: Aditya <38064122+bettercallav@users.noreply.github.com> Date: Wed, 27 Sep 2023 16:24:46 +1000 Subject: [PATCH 1/2] revert: handler signature change --- src/handlers/ClientHandler.ts | 4 ++-- src/handlers/RawHandler.ts | 9 +++------ src/handlers/UnaryHandler.ts | 4 ++-- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/handlers/ClientHandler.ts b/src/handlers/ClientHandler.ts index 6a3c93f..0aea354 100644 --- a/src/handlers/ClientHandler.ts +++ b/src/handlers/ClientHandler.ts @@ -8,12 +8,12 @@ abstract class ClientHandler< Input extends JSONValue = JSONValue, Output extends JSONValue = JSONValue, > extends Handler { - public handle = async function* ( + public handle = async ( input: AsyncIterableIterator, cancel: (reason?: any) => void, meta: Record | undefined, ctx: ContextTimed, - ): AsyncIterableIterator { + ): Promise => { throw new ErrorRPCMethodNotImplemented(); }; } diff --git a/src/handlers/RawHandler.ts b/src/handlers/RawHandler.ts index 500ce99..01fd1d7 100644 --- a/src/handlers/RawHandler.ts +++ b/src/handlers/RawHandler.ts @@ -6,16 +6,13 @@ import { ErrorRPCMethodNotImplemented } from '../errors'; abstract class RawHandler< Container extends ContainerType = ContainerType, - Input extends JSONValue = JSONValue, // Define Input type if needed - Output extends JSONValue = JSONValue, // Define Output type if needed > extends Handler { - public handle = async function* ( - input: AsyncIterableIterator, // Change this based on your specific needs + public handle = async ( + input: [JSONRPCRequest, ReadableStream], cancel: (reason?: any) => void, meta: Record | undefined, ctx: ContextTimed, - ): AsyncIterableIterator { - // Change return type to AsyncIterableIterator + ): Promise<[JSONValue, ReadableStream]> => { throw new ErrorRPCMethodNotImplemented('This method must be overridden'); }; } diff --git a/src/handlers/UnaryHandler.ts b/src/handlers/UnaryHandler.ts index 22ee1e2..0a1e37b 100644 --- a/src/handlers/UnaryHandler.ts +++ b/src/handlers/UnaryHandler.ts @@ -8,12 +8,12 @@ abstract class UnaryHandler< Input extends JSONValue = JSONValue, Output extends JSONValue = JSONValue, > extends Handler { - public handle = async function* ( + public handle = async ( input: Input, cancel: (reason?: any) => void, meta: Record | undefined, ctx: ContextTimed, - ): AsyncIterableIterator { + ): Promise => { throw new ErrorRPCMethodNotImplemented('This method must be overridden'); }; } From cbcc2951a97deb0653f0ae7fe4ae37a890005018 Mon Sep 17 00:00:00 2001 From: Aditya <38064122+bettercallav@users.noreply.github.com> Date: Wed, 27 Sep 2023 16:24:55 +1000 Subject: [PATCH 2/2] 0.1.6 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2e87d4e..c22b69a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@matrixai/rpc", - "version": "0.1.5", + "version": "0.1.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@matrixai/rpc", - "version": "0.1.5", + "version": "0.1.6", "license": "Apache-2.0", "dependencies": { "@matrixai/async-init": "^1.9.4", diff --git a/package.json b/package.json index c63d3c8..3eb1198 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@matrixai/rpc", - "version": "0.1.5", + "version": "0.1.6", "author": "Matrix AI", "contributors": [ {