test2a.ts 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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, take } from "rxjs";
  6. import { LogSetting, MessageLog } from "../dependencies/log/type/datatype";
  7. import { BaseMessage } from "../dependencies/fisappmessagejsutilty/dependencies/dependencies";
  8. const incoming = new IncomingMessageService()
  9. const syncrhonize = new MessageAuditorService()
  10. const acknowledge = new AcknowledgementService()
  11. const streamService = new StreamingService()
  12. /* -------------- TEST -------------------- */
  13. // change payload into Observable<BaseMessage>
  14. const payload: Observable<BaseMessage> = streamService.stream().pipe(take(3));
  15. // Configure Log Setting
  16. let storage: LogSetting = {
  17. storage: "MongoDB",
  18. cacheMessageLimit: 0,
  19. setting: {
  20. appName: 'Default from client',
  21. appLocName: 'To be generated in client',
  22. logLocName: 'To be generated in client',
  23. },
  24. customSetting: {
  25. srv: true,
  26. user: "testDB",
  27. password: "h1nt1OyXw6QeUnzS",
  28. server: "cluster0.29sklte.mongodb.net",
  29. database: "log",
  30. }
  31. }
  32. let dataSet: LogSetting & { incomingObservable: Observable<BaseMessage> } = {
  33. storage: storage.storage,
  34. setting: storage.setting,
  35. customSetting: storage.customSetting,
  36. incomingObservable: payload
  37. }
  38. incoming.init(dataSet)