12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- /* General interface used for office work/ */
- import { Observable, Subject } from "rxjs"
- import { BaseMessage } from "../dependencies/logging/interface/export";
- export interface ConnectionState {
- uuid?: string | number;
- status: 'BUFFER' | 'DIRECT_PUBLISH' | 'LIMIT_EXCEEDED' | 'TARGET_PUBLISH' | 'TARGET_BUFFER'
- 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 interface ConnectionAttribute {
- ConnectionID: ConnectionID,
- outGoing: StreamAttribute,
- inComing: StreamAttribute,
- connectionStatus: Subject<ConnectionState> | null
- }
- export interface StreamAttribute {
- StreamID?: string,
- PublisherID?: string,
- SubscriberID?: string,
- PublisherInstance?: any,
- SubscriberInstance?: any,
- serverUrl?: string,
- MessageToBePublished: Observable<Message> | null
- MessageToBeReceived: Subject<Message> | null
- }
- export interface ConnectionRequest {
- database?: string,
- server?: ServerRequest,
- client?: ClientRequest
- }
- export interface ServerRequest {
- name: string,
- serverUrl: string,
- connectionType: 'GRPC' | 'HTTP' | 'Socket',
- messageToBePublishedFromApplication: Subject<Message>
- }
- export interface ClientRequest {
- name: string,
- targetServer: string,
- connectionType: 'GRPC' | 'HTTP' | 'Socket',
- messageToBeReceivedFromRemote: Subject<Message>
- }
- export interface ConnectionID {
- local: string,
- remote: string
- }
- export interface ClientNotificationState {
- event: string,
- message: string,
- status?: 'ONLINE' | 'OFFLINE' | null
- }
- export interface WrappedMessage {
- timeReceived: any, // this property is for sender to sort
- payload: BaseMessage,
- thisMessageID?: string,
- previousMessageID?: string // this property is for receiver to sort
- }
|