/* General interface used for office work/ */ import { Observable, Subject } from "rxjs" export interface ConnectionState { status: 'BUFFER' | 'DIRECT_PUBLISH'; reason?: string; payload?: any; } export interface MessageLog { appLogLocId: string, appData: { msgId: string, msgLogDateTime: string, msgDateTime: string, s msgTag: string[], msgPayload: string } } export interface ServerResponse { confirmationMessage: string, msgId: string } // https://grpc.io/docs/what-is-grpc/core-concepts/ export interface GrpcConnectionType { instanceType: '' | 'server' | 'client' } export interface Message { id: string, message: MessageLog | string } export type State = -1 | 0 | 1 // For status chain effect export type ConnectionStatus = `ON` | `OFF` export interface ConnectionAttribute { ConnectionID: ConnectionID, outGoing: StreamAttribute, inComing: StreamAttribute, connectionStatus: Subject | null } export interface StreamAttribute { StreamID?: string, PublisherID?: string, SubscriberID?: string, PublisherInstance?: any, SubscriberInstance?: any, serverUrl?: string, connectionState?: ConnectionStatus, MessageToBePublished: Observable | null MessageToBeReceived: Subject | null } export interface ConnectionRequest { database?: string, server?: ServerRequest, client?: ClientRequest } export interface ServerRequest { name: string, serverUrl: string, connectionType: 'GRPC' | 'HTTP' | 'Socket', messageToBePublishedFromApplication: Subject } export interface ClientRequest { name: string, targetServer: string, connectionType: 'GRPC' | 'HTTP' | 'Socket', messageToBeReceivedFromRemote: Subject } export interface ConnectionID { local: string, remote: string }