test1b.ts 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import { AcknowledgementService } from "../services/acknowledgement.service";
  2. import { StreamingService } from "./test-streamOBS";
  3. import { MessageAuditorService } from "../services/message-auditor.service";
  4. import { IncomingMessageService } from "../services/incomingMessage.service";
  5. import { map, Observable } from "rxjs";
  6. import { LogSetting } from "../dependencies/log/type/datatype";
  7. import { BaseMessage } from "../dependencies/log/dependencies/msgutil/interface/export";
  8. const acknowledge = new AcknowledgementService()
  9. const streamService = new StreamingService()
  10. /* -------------- TEST -------------------- */
  11. // change payload into Observable<BaseMessage>
  12. const payload: Observable<BaseMessage> = streamService.stream();
  13. // Configure Log Setting
  14. let storage: LogSetting = {
  15. storage: "File",
  16. setting: {
  17. appName: 'Default from client',
  18. appLocName: 'To be generated in client',
  19. logLocName: 'To be generated in client',
  20. }
  21. }
  22. let dataSet: LogSetting & { incomingObservable: Observable<BaseMessage> } = {
  23. storage: storage.storage,
  24. setting: storage.setting,
  25. customSetting: storage.customSetting,
  26. incomingObservable: payload
  27. }
  28. // incoming.init(dataSet)
  29. acknowledge.init(storage).then(() => {
  30. acknowledge.subscribe(dataSet.incomingObservable)
  31. })