@v1nt1248/3nclient-lib 0.0.23 → 0.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@v1nt1248/3nclient-lib",
3
3
  "license": "AGPL-3.0-or-later",
4
4
  "author": "v1nt1248",
5
- "version": "0.0.23",
5
+ "version": "0.0.25",
6
6
  "description": "Library for 3NWeb clients",
7
7
  "private": false,
8
8
  "type": "module",
@@ -39,7 +39,6 @@
39
39
  "dayjs": "^1.11.9",
40
40
  "lodash": "^4.17.21",
41
41
  "mitt": "^3.0.1",
42
- "protobufjs": "^7.2.5",
43
42
  "sanitize-html": "^2.11.0",
44
43
  "tslib": "^2.6.2"
45
44
  },
@@ -1,4 +0,0 @@
1
- export { SQLiteOn3NStorage } from './sqlite-on-3nstorage';
2
- export type { BindParams, Database, QueryExecResult } from './sqlite-on-3nstorage';
3
- export { makeObservableMethodCaller, makeReqRepMethodCaller, makeServiceCaller, } from './ipc-service-caller';
4
- export { SingleConnectionIPCWrap, MultiConnectionIPCWrap, IPCWrap, } from './ipc-service';
@@ -1,12 +0,0 @@
1
- type RPCConnection = web3n.rpc.client.RPCConnection;
2
- type PassedDatum = web3n.rpc.PassedDatum;
3
- export interface TransformOpts {
4
- unpackReply?: ((reply: PassedDatum | undefined) => any) | 'noop';
5
- packRequest?: ((args: any[]) => PassedDatum | undefined) | 'noop';
6
- }
7
- export declare function makeReqRepMethodCaller<F extends Function>(connection: RPCConnection, method: string, transforms?: TransformOpts): F;
8
- export declare function makeObservableMethodCaller<F extends Function>(connection: RPCConnection, method: string, transforms?: TransformOpts): F;
9
- export declare function makeServiceCaller<T>(connection: RPCConnection, reqRepMethods?: (keyof T)[], obsMethods?: (keyof T)[], transforms?: {
10
- [method in keyof T]: TransformOpts;
11
- }): Partial<T>;
12
- export {};
@@ -1,60 +0,0 @@
1
- type IncomingConnection = web3n.rpc.service.IncomingConnection;
2
- type PassedDatum = web3n.rpc.PassedDatum;
3
- type Observer<T> = web3n.Observer<T>;
4
- export type HandleObservingCall = (obs: Observer<any>, ...requestArgs: any[]) => (() => void);
5
- export type HandleReqReplyCall = (...requestArgs: any[]) => Promise<any>;
6
- export interface TransformOpts {
7
- unpackRequest?: ((req: PassedDatum | undefined) => any[]) | 'noop';
8
- packReply?: ((reply: any) => PassedDatum | undefined) | 'noop';
9
- }
10
- declare class ConnectionState {
11
- private readonly disconnect;
12
- private readonly calls;
13
- private isRunning;
14
- constructor(disconnect: () => void);
15
- acceptsMsgs(): boolean;
16
- stop(): void;
17
- hasCall(callNum: number): boolean;
18
- cancelCall(callNum: number): void;
19
- completeCall(callNum: number): void;
20
- registerReqReplyCall(callNum: number): void;
21
- registerObservableCall(callNum: number, cancel: () => void): void;
22
- }
23
- export declare abstract class IPCWrap {
24
- readonly srvName: string;
25
- protected readonly connections: Map<web3n.rpc.service.IncomingConnection, ConnectionState>;
26
- private readonly methods;
27
- constructor(srvName: string);
28
- addReqReplyMethod(method: string, srv: object | undefined, func: HandleReqReplyCall, transforms?: TransformOpts): void;
29
- exposeReqReplyMethods<T extends object>(srv: T, methods: (keyof T)[], transforms?: {
30
- [method in keyof T]: TransformOpts;
31
- }): void;
32
- addObservableMethod(method: string, srv: object | undefined, func: HandleObservingCall, transforms?: TransformOpts): void;
33
- exposeObservableMethods<T extends object>(srv: T, methods: (keyof T)[], transforms?: {
34
- [method in keyof T]: TransformOpts;
35
- }): void;
36
- private onMsg;
37
- private callReqReplyHandler;
38
- private callObsHandler;
39
- startIPC(): () => void;
40
- stopIPC(): void;
41
- protected onConnection(connection: IncomingConnection): Promise<void>;
42
- protected onConnectionCompletion(connection: IncomingConnection, connectionState: ConnectionState): Promise<void>;
43
- protected onConnectionError(connection: IncomingConnection, connectionState: ConnectionState, err: any): Promise<void>;
44
- protected abstract onListeningCompletion(): Promise<void>;
45
- protected abstract onListeningError(err: any): Promise<void>;
46
- }
47
- export declare class SingleConnectionIPCWrap extends IPCWrap {
48
- constructor(srvName: string);
49
- protected onListeningCompletion(): Promise<void>;
50
- protected onListeningError(err: any): Promise<void>;
51
- protected onConnectionCompletion(connection: IncomingConnection, connectionState: ConnectionState): Promise<void>;
52
- protected onConnectionError(connection: IncomingConnection, connectionState: ConnectionState, err: any): Promise<void>;
53
- }
54
- export declare class MultiConnectionIPCWrap extends IPCWrap {
55
- constructor(srvName: string);
56
- protected onListeningCompletion(): Promise<void>;
57
- protected onListeningError(err: any): Promise<void>;
58
- protected onConnectionError(connection: IncomingConnection, connectionState: ConnectionState, err: any): Promise<void>;
59
- }
60
- export {};
@@ -1,8 +0,0 @@
1
- /**
2
- * This function creates a copy of json entity with a caveat that Buffer and
3
- * byte arrays are shared between original and a copy.
4
- * @param orig is an object, which copy is created. Buffer and byte arrays
5
- * passed through like primitives.
6
- * @param excludeTopFields is an optional list of fields to exclude from copy.
7
- */
8
- export declare function copyJSON<T>(orig: T, excludeTopFields?: string[]): T;
@@ -1,5 +0,0 @@
1
- export declare function serializeArgs(args: any[]): {
2
- bytes: Uint8Array;
3
- passedByReference?: any[];
4
- };
5
- export declare function deserializeArgs(bytes: Uint8Array, passedByReference: any[] | undefined): any[];
@@ -1,10 +0,0 @@
1
- /// <reference types="node" />
2
- export declare class ProtoType<T extends object> {
3
- private readonly type;
4
- private constructor();
5
- static for<T extends object>(type: any): ProtoType<T>;
6
- pack(msg: T): Buffer;
7
- unpack(bytes: Buffer | void): T;
8
- packToBase64(msg: T): string;
9
- unpackFromBase64(str: string): T;
10
- }
@@ -1,3 +0,0 @@
1
- /** Namespace json_ipc. */
2
- export declare namespace json_ipc {
3
- }