|
@@ -1,5 +1,44 @@
|
|
|
-import { Observable } from "rxjs";
|
|
|
+import { Observable, of, take } from "rxjs";
|
|
|
import * as fs from "fs"
|
|
|
+import { LoggingService } from "../dependencies/fisloggingservice/services/logging-service";
|
|
|
+import { AcknowledgementService } from "../services/acknowledgemeent.service";
|
|
|
+import { StreamingService } from "./stream";
|
|
|
+import { SyncrhonizationService } from "../services/synchronization.service";
|
|
|
+import { LogSetting } from "../dependencies/fisloggingservice/type/datatype";
|
|
|
+const acknowledge = new AcknowledgementService()
|
|
|
+const syncrhonize = new SyncrhonizationService()
|
|
|
+const log = new LoggingService()
|
|
|
+const stream = new StreamingService()
|
|
|
|
|
|
+// Configure Log Setting
|
|
|
+const storage: LogSetting = {
|
|
|
+ storage: "File",
|
|
|
+ setting: {
|
|
|
+ appName: 'Default from client',
|
|
|
+ appLocName: 'To be generated in client',
|
|
|
+ logLocName: 'To be generated in client',
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
-console.log('Hellow World')
|
|
|
+console.log(`I am Client 1`)
|
|
|
+acknowledge.acknowledge()
|
|
|
+syncrhonize.synchronize()
|
|
|
+
|
|
|
+stream.stream().subscribe(data => {
|
|
|
+ // console.log(data)
|
|
|
+ let chainStream = of(data)
|
|
|
+ chainStream.subscribe(
|
|
|
+ // value => console.log(value),
|
|
|
+ error => console.error(error),
|
|
|
+ // () => console.log('Streaming completed')
|
|
|
+ );
|
|
|
+ log.init(storage).then(() => {
|
|
|
+ log.subscribe(data).then(() => {
|
|
|
+ log.filter({ msgId: "44f701a9-8ba7-4e07-bd66-f84db12ae481" }).catch(() => console.log(`Failed to resolve filter`))
|
|
|
+ }).catch(() => console.log(`Failed to resolve stream data`))
|
|
|
+
|
|
|
+ }).catch(() => console.log(`Failed to resolve init`))
|
|
|
+},
|
|
|
+ error => console.error(error),
|
|
|
+ () => console.log('Streaming completed')
|
|
|
+)
|