Socket
Socket
Sign inDemoInstall

@nyth/common

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nyth/common - npm Package Compare versions

Comparing version 0.1.2 to 0.2.0

dist/base-adapter.d.ts

2

dist/index.d.ts
export { IRpcRequest, IRpcResult, IRpcExecutor, IRpcAdapter, IRpcAdapterConstructor, IRpcMethodHandler, IExecutor, IApplication, IRouting, IApplicationFactory, } from './typings';
export { IHttpAdapter } from './http-adapter';
export { ISerializer, defaultSerializer } from './serializer';
export { BaseAdapter } from './base-adapter';

14

dist/typings.d.ts

@@ -0,1 +1,3 @@

import { BaseAdapter } from './base-adapter';
import { ISerializer } from './serializer';
export interface IRpcRequest<T = undefined> {

@@ -11,8 +13,8 @@ readonly method: string;

}
export declare type IRpcExecutor = (rpcCall: IRpcRequest) => Promise<IRpcResult>;
export interface IRpcAdapter {
export type IRpcExecutor = (rpcCall: IRpcRequest) => Promise<IRpcResult>;
export interface IRpcAdapter extends BaseAdapter {
start(executor: IRpcExecutor): void | Promise<void>;
close(): void | Promise<void>;
}
export declare type IRpcAdapterConstructor<O = unknown> = new (options: O) => IRpcAdapter;
export type IRpcAdapterConstructor<O = unknown> = new (options: O, serializer?: ISerializer) => IRpcAdapter;
export interface IRpcMethodHandler<Result = unknown, CallData = undefined> {

@@ -22,3 +24,3 @@ validate(rpcCallPayload: unknown): rpcCallPayload is CallData;

}
export declare type IExecutor<Result = unknown, CallData = undefined> = (handler: IRpcMethodHandler<Result, CallData>) => Promise<Result>;
export type IExecutor<Result = unknown, CallData = undefined> = (handler: IRpcMethodHandler<Result, CallData>) => Promise<Result>;
export interface IApplication {

@@ -28,3 +30,3 @@ start(): Promise<void>;

}
export declare type IRouting = Record<string, IRpcMethodHandler>;
export declare type IApplicationFactory = (handlers: IRouting, adapter: IRpcAdapter) => IApplication;
export type IRouting = Record<string, IRpcMethodHandler>;
export type IApplicationFactory = (handlers: IRouting, adapter: IRpcAdapter) => IApplication;
{
"name": "@nyth/common",
"version": "0.1.2",
"version": "0.2.0",
"description": "nyth",

@@ -35,4 +35,4 @@ "author": "Andrey Sakharov <caxap_8787@mail.ru> (https://www.linkedin.com/in/andrey-sakharov/)",

"devDependencies": {
"@types/node": "^14.18.12",
"typescript": "^4.6.3"
"@types/node": "^20.2.5",
"typescript": "^5.1.3"
},

@@ -39,0 +39,0 @@ "publishConfig": {

Sorry, the diff of this file is not supported yet

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