import { AcknowledgementService } from "../services/acknowledgement.service"; import { StreamingService } from "./test-streamOBS"; import { MessageSyncrhonizationService } from "../services/synchronization.service"; import { IncomingMessageService } from "../services/incomingMessage.service"; import { map, Observable } from "rxjs"; import { LogSetting, MessageLog } from "../dependencies/fisloggingservice/type/datatype"; import { BaseMessage } from "../dependencies/fisappmessagejsutilty/dependencies/dependencies"; const incoming = new IncomingMessageService() const syncrhonize = new MessageSyncrhonizationService() const streamService = new StreamingService() /* -------------- TEST -------------------- */ // change payload into Observable const payload: Observable = streamService.stream().pipe( map(dataSet => ({ header: dataSet.appLogLocId, data: dataSet })) ); const payload2: Observable = streamService.stream().pipe( map( data => data.appData.msgId ) ) // Configure Log Setting let storage: LogSetting = { storage: "MongoDB", setting: { appName: 'Default from client', appLocName: 'To be generated in client', logLocName: 'To be generated in client', }, customSetting: { server: "localhost:27017", collection: "logs" } } let dataSet: LogSetting & { incomingObservable: Observable } = { storage: storage.storage, setting: storage.setting, customSetting: storage.customSetting, incomingObservable: payload } // incoming.init(dataSet) syncrhonize.subscribe(payload2) // acknowledge.init(storage).then(() => { // acknowledge.subscribe(payload) // }).catch((e) => console.error(e))