@aventusjs/cli 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -123,40 +123,14 @@ interface SocketRoute<T = any> {
123
123
  }
124
124
  }
125
125
 
126
- namespace Routes {
127
- abstract class StorableRoute<T extends Aventus.IData> extends Aventus.HttpRoute {
128
- GetAll(): Promise<Aventus.ResultWithError<T[]>>;
129
- Create(body: {
130
- item: T;
131
- } | FormData): Promise<Aventus.ResultWithError<T>>;
132
- CreateMany(body: {
133
- list: T[];
134
- } | FormData): Promise<Aventus.ResultWithError<T[]>>;
135
- GetById(id: number): Promise<Aventus.ResultWithError<T>>;
136
- GetByIds(body: {
137
- ids: number[];
138
- } | FormData): Promise<Aventus.ResultWithError<T[]>>;
139
- Update(id: number, body: {
140
- item: T;
141
- } | FormData): Promise<Aventus.ResultWithError<T>>;
142
- UpdateMany(body: {
143
- list: T[];
144
- } | FormData): Promise<Aventus.ResultWithError<T[]>>;
145
- Delete(id: number): Promise<Aventus.ResultWithError<T>>;
146
- DeleteMany(body: {
147
- ids: number[];
148
- } | FormData): Promise<Aventus.ResultWithError<T[]>>;
149
- abstract StorableName(): string;
150
- }
151
- }
152
-
153
126
  namespace Routes {
154
127
  enum RouteErrorCode {
155
128
  UnknowError = 0,
156
129
  FormContentTypeUnknown = 1,
157
130
  CantGetValueFromBody = 2,
158
131
  CantMoveFile = 3,
159
- CantCreateFolders = 4
132
+ CantCreateFolders = 4,
133
+ RouteAlreadyExist = 5
160
134
  }
161
135
  }
162
136
 
@@ -167,14 +141,6 @@ interface IStorableTimestamp extends Aventus.IData {
167
141
  }
168
142
  }
169
143
 
170
- namespace Data {
171
- @Convertible()
172
- class FieldErrorInfo {
173
- static get Fullname(): string;
174
- Name: string;
175
- }
176
- }
177
-
178
144
  namespace Tools {
179
145
  interface IWithError<T extends Aventus.GenericError> {
180
146
  }
@@ -254,6 +220,14 @@ abstract class SharpClass {
254
220
  }
255
221
  }
256
222
 
223
+ namespace Data {
224
+ @Convertible()
225
+ class FieldErrorInfo extends Data.SharpClass {
226
+ static get Fullname(): string;
227
+ Name: string;
228
+ }
229
+ }
230
+
257
231
  namespace Data {
258
232
  @Convertible()
259
233
  class AventusFile {
@@ -317,6 +291,34 @@ class ResultWithError<T, U extends Aventus.GenericError = Aventus.GenericError>
317
291
  }
318
292
  }
319
293
 
294
+ namespace Routes {
295
+ abstract class StorableRouter<T extends Aventus.IData> extends Aventus.HttpRoute {
296
+ constructor();
297
+ GetAll(): Promise<Tools.ResultWithError<T[]>>;
298
+ Create(body: {
299
+ item: T;
300
+ } | FormData): Promise<Tools.ResultWithError<T>>;
301
+ CreateMany(body: {
302
+ list: T[];
303
+ } | FormData): Promise<Tools.ResultWithError<T[]>>;
304
+ GetById(id: number): Promise<Tools.ResultWithError<T>>;
305
+ GetByIds(body: {
306
+ ids: number[];
307
+ } | FormData): Promise<Tools.ResultWithError<T[]>>;
308
+ Update(id: number, body: {
309
+ item: T;
310
+ } | FormData): Promise<Tools.ResultWithError<T>>;
311
+ UpdateMany(body: {
312
+ list: T[];
313
+ } | FormData): Promise<Tools.ResultWithError<T[]>>;
314
+ Delete(id: number): Promise<Tools.ResultWithError<T>>;
315
+ DeleteMany(body: {
316
+ ids: number[];
317
+ } | FormData): Promise<Tools.ResultWithError<T[]>>;
318
+ abstract StorableName(): string;
319
+ }
320
+ }
321
+
320
322
  namespace Data {
321
323
  @Convertible()
322
324
  class ResultWithDataError<T> extends Tools.ResultWithError<T, Data.DataError> {
@@ -516,11 +518,11 @@ abstract class WsEvent<T extends any = any> {
516
518
  }
517
519
 
518
520
  namespace WebSocket {
519
- type WsEventType = abstract new (...args: any[]) => WebSocket.WsEvent;
521
+ type ExtractResultFrom<T extends WebSocket.WsEvent, U = any> = T extends WebSocket.WsEvent<infer U> ? U : never;
520
522
  }
521
523
 
522
524
  namespace WebSocket {
523
- type ExtractResultFrom<T extends WebSocket.WsEvent, U = any> = T extends WebSocket.WsEvent<infer U> ? U : never;
525
+ type WsEventType = abstract new (...args: any[]) => WebSocket.WsEvent;
524
526
  }
525
527
 
526
528
  type ExtractResponse<T extends WebSocket.WsEvent<U>, U = any> = T extends WebSocket.WsEvent<infer U> ? Aventus.ResultWithError<Aventus.ExtractFromError<U>> : never;
@@ -532,12 +534,12 @@ class StorableWsRoute_DeleteMany<T extends Aventus.IData> extends WebSocket.WsEv
532
534
  */
533
535
  protected path(): string;
534
536
  StorableName: () => string;
535
- constructor(endpoint: WebSocket.EndPoint, getPrefix: () => string, StorableName: () => string);
537
+ constructor(endpoint: WebSocket.EndPoint, getPrefix?: () => string, StorableName?: () => string);
536
538
  }
537
539
  }
538
540
 
539
541
  namespace WebSocket {
540
- class StorableWsRoute_Delete<T> extends WebSocket.WsEvent<T> {
542
+ class StorableWsRouter_Delete<T> extends WebSocket.WsEvent<T> {
541
543
  StorableName: () => string;
542
544
  constructor(endpoint: WebSocket.EndPoint, getPrefix: () => string, StorableName: () => string);
543
545
  /**
@@ -554,12 +556,12 @@ class StorableWsRoute_UpdateMany<T extends Aventus.IData> extends WebSocket.WsEv
554
556
  */
555
557
  protected path(): string;
556
558
  StorableName: () => string;
557
- constructor(endpoint: WebSocket.EndPoint, getPrefix: () => string, StorableName: () => string);
559
+ constructor(endpoint: WebSocket.EndPoint, getPrefix?: () => string, StorableName?: () => string);
558
560
  }
559
561
  }
560
562
 
561
563
  namespace WebSocket {
562
- class StorableWsRoute_Update<T> extends WebSocket.WsEvent<T> {
564
+ class StorableWsRouter_Update<T> extends WebSocket.WsEvent<T> {
563
565
  StorableName: () => string;
564
566
  constructor(endpoint: WebSocket.EndPoint, getPrefix: () => string, StorableName: () => string);
565
567
  /**
@@ -570,7 +572,7 @@ class StorableWsRoute_Update<T> extends WebSocket.WsEvent<T> {
570
572
  }
571
573
 
572
574
  namespace WebSocket {
573
- class StorableWsRoute_GetByIds<T> extends WebSocket.WsEvent<T[]> {
575
+ class StorableWsRouter_GetByIds<T> extends WebSocket.WsEvent<T[]> {
574
576
  StorableName: () => string;
575
577
  constructor(endpoint: WebSocket.EndPoint, getPrefix: () => string, StorableName: () => string);
576
578
  /**
@@ -581,7 +583,7 @@ class StorableWsRoute_GetByIds<T> extends WebSocket.WsEvent<T[]> {
581
583
  }
582
584
 
583
585
  namespace WebSocket {
584
- class StorableWsRoute_GetById<T> extends WebSocket.WsEvent<T> {
586
+ class StorableWsRouter_GetById<T> extends WebSocket.WsEvent<T> {
585
587
  StorableName: () => string;
586
588
  constructor(endpoint: WebSocket.EndPoint, getPrefix: () => string, StorableName: () => string);
587
589
  /**
@@ -597,13 +599,24 @@ class StorableWsRoute_CreateMany<T extends Aventus.IData> extends WebSocket.WsEv
597
599
  * @inheritdoc
598
600
  */
599
601
  protected path(): string;
602
+ StorableName: () => string;
603
+ constructor(endpoint: WebSocket.EndPoint, getPrefix?: () => string, StorableName?: () => string);
604
+ }
605
+ }
606
+
607
+ namespace WebSocket {
608
+ class StorableWsRouter_Create<T> extends WebSocket.WsEvent<T> {
600
609
  StorableName: () => string;
601
610
  constructor(endpoint: WebSocket.EndPoint, getPrefix: () => string, StorableName: () => string);
611
+ /**
612
+ * @inheritdoc
613
+ */
614
+ protected path(): string;
602
615
  }
603
616
  }
604
617
 
605
618
  namespace WebSocket {
606
- class StorableWsRoute_Create<T> extends WebSocket.WsEvent<T> {
619
+ class StorableWsRouter_GetAll<T> extends WebSocket.WsEvent<T[]> {
607
620
  StorableName: () => string;
608
621
  constructor(endpoint: WebSocket.EndPoint, getPrefix: () => string, StorableName: () => string);
609
622
  /**
@@ -614,60 +627,60 @@ class StorableWsRoute_Create<T> extends WebSocket.WsEvent<T> {
614
627
  }
615
628
 
616
629
  namespace WebSocket {
617
- class Route {
630
+ type RouterRoutes = {
631
+ [name: string]: WebSocket.WsEvent;
632
+ };
633
+ }
634
+
635
+ namespace WebSocket {
636
+ class Router<T extends WebSocket.RouterRoutes> {
618
637
  readonly endpoint: WebSocket.EndPoint;
638
+ events: T;
619
639
  constructor(endpoint?: WebSocket.EndPoint);
620
640
  getPrefix(): string;
641
+ protected defineEvents(): Partial<T>;
621
642
  }
622
643
  }
623
644
 
624
645
  namespace WebSocket {
625
- type WsRouteType = abstract new (...args: any[]) => WebSocket.Route;
646
+ type WsRouterType = abstract new (...args: any[]) => WebSocket.Router<any>;
626
647
  }
627
648
 
628
649
  namespace WebSocket {
629
- class StorableWsRoute_GetAll<T> extends WebSocket.WsEvent<T[]> {
630
- StorableName: () => string;
631
- constructor(endpoint: WebSocket.EndPoint, getPrefix: () => string, StorableName: () => string);
632
- /**
633
- * @inheritdoc
634
- */
635
- protected path(): string;
636
- }
650
+ type StorableWsRouter__Routes<T extends Aventus.IData> = {
651
+ GetAll: WebSocket.StorableWsRouter_GetAll<T>;
652
+ Create: WebSocket.StorableWsRouter_Create<T>;
653
+ CreateMany: WebSocket.StorableWsRoute_CreateMany<T>;
654
+ GetById: WebSocket.StorableWsRouter_GetById<T>;
655
+ GetByIds: WebSocket.StorableWsRouter_GetByIds<T>;
656
+ Update: WebSocket.StorableWsRouter_Update<T>;
657
+ UpdateMany: WebSocket.StorableWsRoute_UpdateMany<T>;
658
+ Delete: WebSocket.StorableWsRouter_Delete<T>;
659
+ DeleteMany: WebSocket.StorableWsRoute_DeleteMany<T>;
660
+ };
637
661
  }
638
662
 
639
663
  namespace WebSocket {
640
- abstract class StorableWsRoute<T extends Aventus.IData> extends WebSocket.Route {
641
- events: {
642
- GetAll: WebSocket.StorableWsRoute_GetAll<T>;
643
- Create: WebSocket.StorableWsRoute_Create<T>;
644
- CreateMany: WebSocket.StorableWsRoute_CreateMany<T>;
645
- GetById: WebSocket.StorableWsRoute_GetById<T>;
646
- GetByIds: WebSocket.StorableWsRoute_GetByIds<T>;
647
- Update: WebSocket.StorableWsRoute_Update<T>;
648
- UpdateMany: WebSocket.StorableWsRoute_UpdateMany<T>;
649
- Delete: WebSocket.StorableWsRoute_Delete<T>;
650
- DeleteMany: WebSocket.StorableWsRoute_DeleteMany<T>;
651
- };
652
- constructor(endpoint?: WebSocket.EndPoint);
653
- GetAll(options?: WebSocket.WsRouteSendOptions): Promise<ExtractResponse<WebSocket.StorableWsRoute_GetAll<T>>>;
664
+ abstract class StorableWsRouter<T extends Aventus.IData, __Route extends WebSocket.StorableWsRouter__Routes<T> = WebSocket.StorableWsRouter__Routes<T>> extends WebSocket.Router<__Route> {
665
+ protected defineEvents(): Partial<__Route>;
666
+ GetAll(options?: WebSocket.WsRouteSendOptions): Promise<ExtractResponse<WebSocket.StorableWsRouter_GetAll<T>>>;
654
667
  Create(body: {
655
668
  item: T;
656
- } | FormData, options?: WebSocket.WsRouteSendOptions): Promise<ExtractResponse<WebSocket.StorableWsRoute_Create<T>>>;
669
+ } | FormData, options?: WebSocket.WsRouteSendOptions): Promise<ExtractResponse<WebSocket.StorableWsRouter_Create<T>>>;
657
670
  CreateMany(body: {
658
671
  list: T[];
659
672
  } | FormData, options?: WebSocket.WsRouteSendOptions): Promise<ExtractResponse<WebSocket.StorableWsRoute_CreateMany<T>>>;
660
- GetById(id: number, options?: WebSocket.WsRouteSendOptions): Promise<ExtractResponse<WebSocket.StorableWsRoute_GetById<T>>>;
673
+ GetById(id: number, options?: WebSocket.WsRouteSendOptions): Promise<ExtractResponse<WebSocket.StorableWsRouter_GetById<T>>>;
661
674
  GetByIds(body: {
662
675
  ids: number[];
663
- } | FormData, options?: WebSocket.WsRouteSendOptions): Promise<ExtractResponse<WebSocket.StorableWsRoute_GetByIds<T>>>;
676
+ } | FormData, options?: WebSocket.WsRouteSendOptions): Promise<ExtractResponse<WebSocket.StorableWsRouter_GetByIds<T>>>;
664
677
  Update(id: number, body: {
665
678
  item: T;
666
- } | FormData, options?: WebSocket.WsRouteSendOptions): Promise<ExtractResponse<WebSocket.StorableWsRoute_Update<T>>>;
679
+ } | FormData, options?: WebSocket.WsRouteSendOptions): Promise<ExtractResponse<WebSocket.StorableWsRouter_Update<T>>>;
667
680
  UpdateMany(body: {
668
681
  list: T[];
669
682
  } | FormData, options?: WebSocket.WsRouteSendOptions): Promise<ExtractResponse<WebSocket.StorableWsRoute_UpdateMany<T>>>;
670
- Delete(id: number, options?: WebSocket.WsRouteSendOptions): Promise<ExtractResponse<WebSocket.StorableWsRoute_Delete<T>>>;
683
+ Delete(id: number, options?: WebSocket.WsRouteSendOptions): Promise<ExtractResponse<WebSocket.StorableWsRouter_Delete<T>>>;
671
684
  DeleteMany(body: {
672
685
  ids: number[];
673
686
  } | FormData, options?: WebSocket.WsRouteSendOptions): Promise<ExtractResponse<WebSocket.StorableWsRoute_DeleteMany<T>>>;
@@ -699,8 +712,8 @@ class VoidWithWsError extends Tools.VoidWithError<WebSocket.WsError> {
699
712
  namespace RAM {
700
713
  abstract class RamHttp<T extends Data.Storable> extends Aventus.Ram<T> {
701
714
  protected getAllDone: boolean;
702
- protected routes: Routes.StorableRoute<T>;
703
- abstract defineRoutes(): Routes.StorableRoute<T>;
715
+ protected routes: Routes.StorableRouter<T>;
716
+ abstract defineRoutes(): Routes.StorableRouter<T>;
704
717
  protected constructor();
705
718
  protected beforeGetAll(result: Aventus.ResultRamWithError<Map<number, Aventus.RamItem<T>>>): Promise<void>;
706
719
  protected beforeGetById(id: number, result: Aventus.ResultRamWithError<Aventus.RamItem<T>>): Promise<void>;
@@ -742,7 +755,7 @@ abstract class RamWebSocket<T extends Data.Storable> extends Aventus.Ram<T> {
742
755
  protected otherDeleteListLocked: {
743
756
  [uid: string]: true;
744
757
  };
745
- abstract defineRoutes(): WebSocket.StorableWsRoute<T>;
758
+ abstract defineRoutes(): WebSocket.StorableWsRouter<T>;
746
759
  protected constructor();
747
760
  protected addEventsBindings(): void;
748
761
  protected listenOnStart(): RAM.RamWebSocketListenOnStart;
@@ -774,7 +787,7 @@ abstract class RamWebSocket<T extends Data.Storable> extends Aventus.Ram<T> {
774
787
  }
775
788
  //#endregion js def //
776
789
  //#region js src //
777
- {"namespace":"AventusSharp","available":[{"code":"Data.Storable=class Storable extends Aventus.Data {\n Id = 0;\n /**\n * @inerhit\n */\n toJSON() {\n let toAvoid = ['className', 'namespace'];\n return Aventus.Json.classToJson(this, {\n isValidKey: (key) => !toAvoid.includes(key),\n beforeEnd: (result) => {\n let resultTemp = {};\n if (result.$type) {\n resultTemp.$type = result.$type;\n for (let key in result) {\n if (key != '$type') {\n resultTemp[key] = result[key];\n }\n }\n return resultTemp;\n }\n return result;\n }\n });\n }\n}\nData.Storable.Namespace=`AventusSharp.Data`;\r\nData.Storable.$schema={...(Aventus.Data?.$schema ?? {}), \"Id\":\"number\"};\r\nAventus.Converter.register(Data.Storable.Fullname, Data.Storable);\r\n_.Data.Storable=Data.Storable;\r\n","dependances":[{"fullName":"Aventus.Data","isStrong":true},{"fullName":"Aventus.IData","isStrong":true},{"fullName":"Aventus.Json","isStrong":false}],"fullName":"AventusSharp.Data.Storable","required":false,"type":2,"isExported":true,"convertibleName":""},{"code":"Data.StorableTimestamp=class StorableTimestamp extends Data.Storable {\n CreatedDate = new Date();\n UpdatedDate = new Date();\n}\nData.StorableTimestamp.Namespace=`AventusSharp.Data`;\r\nData.StorableTimestamp.$schema={...(Data.Storable?.$schema ?? {}), \"CreatedDate\":\"Date\",\"UpdatedDate\":\"Date\"};\r\nAventus.Converter.register(Data.StorableTimestamp.Fullname, Data.StorableTimestamp);\r\n_.Data.StorableTimestamp=Data.StorableTimestamp;\r\n","dependances":[{"fullName":"AventusSharp.Data.Storable","isStrong":true},{"fullName":"Aventus.IData","isStrong":true},{"fullName":"Date","isStrong":false}],"fullName":"AventusSharp.Data.StorableTimestamp","required":false,"type":2,"isExported":true,"convertibleName":""},{"code":"(function (WsErrorCode) {\n WsErrorCode[WsErrorCode[\"UnknowError\"] = 0] = \"UnknowError\";\n WsErrorCode[WsErrorCode[\"CantDefineAssembly\"] = 1] = \"CantDefineAssembly\";\n WsErrorCode[WsErrorCode[\"ConfigError\"] = 2] = \"ConfigError\";\n WsErrorCode[WsErrorCode[\"MultipleMainEndpoint\"] = 3] = \"MultipleMainEndpoint\";\n WsErrorCode[WsErrorCode[\"CantGetValueFromBody\"] = 4] = \"CantGetValueFromBody\";\n WsErrorCode[WsErrorCode[\"NoConnection\"] = 5] = \"NoConnection\";\n WsErrorCode[WsErrorCode[\"NoEndPoint\"] = 6] = \"NoEndPoint\";\n WsErrorCode[WsErrorCode[\"NoPath\"] = 7] = \"NoPath\";\n})(WebSocket.WsErrorCode || (WebSocket.WsErrorCode = {}));\n_.WebSocket.WsErrorCode=WebSocket.WsErrorCode;\r\n","dependances":[],"fullName":"AventusSharp.WebSocket.WsErrorCode","required":false,"type":6,"isExported":true,"convertibleName":""},{"code":"(function (SocketErrorCode) {\n SocketErrorCode[SocketErrorCode[\"socketClosed\"] = 0] = \"socketClosed\";\n SocketErrorCode[SocketErrorCode[\"timeout\"] = 1] = \"timeout\";\n SocketErrorCode[SocketErrorCode[\"differentChannel\"] = 2] = \"differentChannel\";\n SocketErrorCode[SocketErrorCode[\"unknow\"] = 3] = \"unknow\";\n})(WebSocket.SocketErrorCode || (WebSocket.SocketErrorCode = {}));\n_.WebSocket.SocketErrorCode=WebSocket.SocketErrorCode;\r\n","dependances":[],"fullName":"AventusSharp.WebSocket.SocketErrorCode","required":false,"type":6,"isExported":true,"convertibleName":""},{"code":"WebSocket.Socket=class Socket {\n static Debug = false;\n static connections = {};\n static getInstance(url, el) {\n if (!this.connections[url]) {\n this.connections[url] = new WebSocket.Socket(url, el);\n }\n else {\n this.connections[url].registerEl(el);\n }\n return this.connections[url];\n }\n socket;\n url;\n elements = [];\n reopenInterval = 0;\n onOpen = new Aventus.Callback();\n onClose = new Aventus.Callback();\n onError = new Aventus.Callback();\n onMessage = new Aventus.Callback();\n get readyState() {\n return this.socket.readyState;\n }\n constructor(url, el) {\n this.url = url;\n this.elements = [el];\n this.socket = this.createWebSocket();\n this.reopen = this.reopen.bind(this);\n this.onClose.add(this.reopen);\n }\n registerEl(el) {\n if (!this.elements.includes(el)) {\n this.elements.push(el);\n }\n }\n createWebSocket() {\n this.removeSocket();\n const socket = new window.WebSocket(this.url);\n socket.onopen = (e) => {\n clearInterval(this.reopenInterval);\n this.onOpen.trigger([e]);\n };\n socket.onclose = (e) => {\n this.onClose.trigger([e]);\n };\n socket.onerror = (e) => {\n this.onError.trigger([e]);\n };\n socket.onmessage = (e) => {\n this.onMessage.trigger([e]);\n };\n this.socket = socket;\n return socket;\n }\n removeSocket() {\n if (this.socket) {\n this.socket.onopen = null;\n this.socket.onclose = null;\n this.socket.onerror = null;\n this.socket.onmessage = null;\n this.socket.close();\n }\n }\n reopen() {\n clearInterval(this.reopenInterval);\n this.reopenInterval = setInterval(async () => {\n console.warn(\"try reopen socket \");\n await this.createWebSocket();\n if (this.isReady()) {\n clearInterval(this.reopenInterval);\n }\n }, 5000);\n }\n close(el, code, reason) {\n let index = this.elements.indexOf(el);\n if (index != -1) {\n this.elements.splice(0, 1);\n }\n if (this.elements.length == 0) {\n this.removeSocket();\n delete WebSocket.Socket.connections[this.url];\n }\n }\n send(data) {\n this.socket.send(data);\n }\n /**\n * Check if socket is ready\n */\n isReady() {\n return this.socket.readyState == 1;\n }\n}\nWebSocket.Socket.Namespace=`AventusSharp.WebSocket`;\r\n_.WebSocket.Socket=WebSocket.Socket;\r\n","dependances":[{"fullName":"AventusSharp.WebSocket.Socket","isStrong":false},{"fullName":"WebSocket","isStrong":false},{"fullName":"Aventus.Callback","isStrong":false},{"fullName":"Event","isStrong":false},{"fullName":"MessageEvent","isStrong":false},{"fullName":"ArrayBufferLike","isStrong":false},{"fullName":"Blob","isStrong":false},{"fullName":"ArrayBufferView","isStrong":false}],"fullName":"AventusSharp.WebSocket.Socket","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"Routes.StorableRoute=class StorableRoute extends Aventus.HttpRoute {\n async GetAll() {\n const request = new Aventus.HttpRequest(`${this.getPrefix()}/${this.StorableName()}`, Aventus.HttpMethod.GET);\n return await request.queryJSON(this.router);\n }\n async Create(body) {\n const request = new Aventus.HttpRequest(`${this.getPrefix()}/${this.StorableName()}`, Aventus.HttpMethod.POST);\n request.setBody(body);\n return await request.queryJSON(this.router);\n }\n async CreateMany(body) {\n const request = new Aventus.HttpRequest(`${this.getPrefix()}/${this.StorableName()}s`, Aventus.HttpMethod.POST);\n request.setBody(body);\n return await request.queryJSON(this.router);\n }\n async GetById(id) {\n const request = new Aventus.HttpRequest(`${this.getPrefix()}/${this.StorableName()}/${id}`, Aventus.HttpMethod.GET);\n return await request.queryJSON(this.router);\n }\n async GetByIds(body) {\n const request = new Aventus.HttpRequest(`${this.getPrefix()}/${this.StorableName()}/getbyids`, Aventus.HttpMethod.POST);\n request.setBody(body);\n return await request.queryJSON(this.router);\n }\n async Update(id, body) {\n const request = new Aventus.HttpRequest(`${this.getPrefix()}/${this.StorableName()}/${id}`, Aventus.HttpMethod.PUT);\n request.setBody(body);\n return await request.queryJSON(this.router);\n }\n async UpdateMany(body) {\n const request = new Aventus.HttpRequest(`${this.getPrefix()}/${this.StorableName()}s`, Aventus.HttpMethod.PUT);\n request.setBody(body);\n return await request.queryJSON(this.router);\n }\n async Delete(id) {\n const request = new Aventus.HttpRequest(`${this.getPrefix()}/${this.StorableName()}/${id}`, Aventus.HttpMethod.DELETE);\n return await request.queryJSON(this.router);\n }\n async DeleteMany(body) {\n const request = new Aventus.HttpRequest(`${this.getPrefix()}/${this.StorableName()}s`, Aventus.HttpMethod.DELETE);\n request.setBody(body);\n return await request.queryJSON(this.router);\n }\n}\nRoutes.StorableRoute.Namespace=`AventusSharp.Routes`;\r\n_.Routes.StorableRoute=Routes.StorableRoute;\r\n","dependances":[{"fullName":"Aventus.HttpRoute","isStrong":true},{"fullName":"Aventus.IData","isStrong":false},{"fullName":"Promise","isStrong":false},{"fullName":"Aventus.ResultWithError","isStrong":false},{"fullName":"Aventus.HttpRequest","isStrong":false},{"fullName":"Aventus.HttpMethod","isStrong":false},{"fullName":"TypeResult","isStrong":false},{"fullName":"FormData","isStrong":false}],"fullName":"AventusSharp.Routes.StorableRoute","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"(function (RouteErrorCode) {\n RouteErrorCode[RouteErrorCode[\"UnknowError\"] = 0] = \"UnknowError\";\n RouteErrorCode[RouteErrorCode[\"FormContentTypeUnknown\"] = 1] = \"FormContentTypeUnknown\";\n RouteErrorCode[RouteErrorCode[\"CantGetValueFromBody\"] = 2] = \"CantGetValueFromBody\";\n RouteErrorCode[RouteErrorCode[\"CantMoveFile\"] = 3] = \"CantMoveFile\";\n RouteErrorCode[RouteErrorCode[\"CantCreateFolders\"] = 4] = \"CantCreateFolders\";\n})(Routes.RouteErrorCode || (Routes.RouteErrorCode = {}));\n_.Routes.RouteErrorCode=Routes.RouteErrorCode;\r\n","dependances":[],"fullName":"AventusSharp.Routes.RouteErrorCode","required":false,"type":6,"isExported":true,"convertibleName":""},{"code":"Data.FieldErrorInfo=class FieldErrorInfo {\n static get Fullname() { return \"AventusSharp.Data.FieldErrorInfo, AventusSharp\"; }\n Name;\n}\nData.FieldErrorInfo.Namespace=`AventusSharp.Data`;\r\nData.FieldErrorInfo.$schema={\"Name\":\"string\"};\r\nAventus.Converter.register(Data.FieldErrorInfo.Fullname, Data.FieldErrorInfo);\r\n_.Data.FieldErrorInfo=Data.FieldErrorInfo;\r\n","dependances":[{"fullName":"Convertible","isStrong":false}],"fullName":"AventusSharp.Data.FieldErrorInfo","required":false,"type":1,"isExported":true,"convertibleName":"Fullname"},{"code":"(function (DataErrorCode) {\n DataErrorCode[DataErrorCode[\"DefaultDMGenericType\"] = 0] = \"DefaultDMGenericType\";\n DataErrorCode[DataErrorCode[\"DMOnlyForceInherit\"] = 1] = \"DMOnlyForceInherit\";\n DataErrorCode[DataErrorCode[\"TypeNotStorable\"] = 2] = \"TypeNotStorable\";\n DataErrorCode[DataErrorCode[\"TypeTooMuchStorable\"] = 3] = \"TypeTooMuchStorable\";\n DataErrorCode[DataErrorCode[\"GenericNotAbstract\"] = 4] = \"GenericNotAbstract\";\n DataErrorCode[DataErrorCode[\"ParentNotAbstract\"] = 5] = \"ParentNotAbstract\";\n DataErrorCode[DataErrorCode[\"InfiniteLoop\"] = 6] = \"InfiniteLoop\";\n DataErrorCode[DataErrorCode[\"InterfaceNotUnique\"] = 7] = \"InterfaceNotUnique\";\n DataErrorCode[DataErrorCode[\"SelfReferecingDependance\"] = 8] = \"SelfReferecingDependance\";\n DataErrorCode[DataErrorCode[\"DMNotExist\"] = 9] = \"DMNotExist\";\n DataErrorCode[DataErrorCode[\"DMAlreadyExist\"] = 10] = \"DMAlreadyExist\";\n DataErrorCode[DataErrorCode[\"MethodNotFound\"] = 11] = \"MethodNotFound\";\n DataErrorCode[DataErrorCode[\"StorageDisconnected\"] = 12] = \"StorageDisconnected\";\n DataErrorCode[DataErrorCode[\"StorageNotFound\"] = 13] = \"StorageNotFound\";\n DataErrorCode[DataErrorCode[\"NoConnectionInsideStorage\"] = 14] = \"NoConnectionInsideStorage\";\n DataErrorCode[DataErrorCode[\"TypeNotExistInsideStorage\"] = 15] = \"TypeNotExistInsideStorage\";\n DataErrorCode[DataErrorCode[\"UnknowError\"] = 16] = \"UnknowError\";\n DataErrorCode[DataErrorCode[\"NoItemProvided\"] = 17] = \"NoItemProvided\";\n DataErrorCode[DataErrorCode[\"NoTransactionInProgress\"] = 18] = \"NoTransactionInProgress\";\n DataErrorCode[DataErrorCode[\"WrongType\"] = 19] = \"WrongType\";\n DataErrorCode[DataErrorCode[\"NoTypeIdentifierFoundInsideQuery\"] = 20] = \"NoTypeIdentifierFoundInsideQuery\";\n DataErrorCode[DataErrorCode[\"ItemNoExistInsideStorage\"] = 21] = \"ItemNoExistInsideStorage\";\n DataErrorCode[DataErrorCode[\"ItemAlreadyExist\"] = 22] = \"ItemAlreadyExist\";\n DataErrorCode[DataErrorCode[\"ValidationError\"] = 23] = \"ValidationError\";\n DataErrorCode[DataErrorCode[\"GetAllNotAllowed\"] = 24] = \"GetAllNotAllowed\";\n DataErrorCode[DataErrorCode[\"GetByIdNotAllowed\"] = 25] = \"GetByIdNotAllowed\";\n DataErrorCode[DataErrorCode[\"GetByIdsNotAllowed\"] = 26] = \"GetByIdsNotAllowed\";\n DataErrorCode[DataErrorCode[\"WhereNotAllowed\"] = 27] = \"WhereNotAllowed\";\n DataErrorCode[DataErrorCode[\"CreateNotAllowed\"] = 28] = \"CreateNotAllowed\";\n DataErrorCode[DataErrorCode[\"UpdateNotAllowed\"] = 29] = \"UpdateNotAllowed\";\n DataErrorCode[DataErrorCode[\"DeleteNotAllowed\"] = 30] = \"DeleteNotAllowed\";\n DataErrorCode[DataErrorCode[\"NumberOfItemsNotMatching\"] = 31] = \"NumberOfItemsNotMatching\";\n DataErrorCode[DataErrorCode[\"FieldTypeNotFound\"] = 32] = \"FieldTypeNotFound\";\n DataErrorCode[DataErrorCode[\"MemberNotFound\"] = 33] = \"MemberNotFound\";\n DataErrorCode[DataErrorCode[\"TooMuchMemberFound\"] = 34] = \"TooMuchMemberFound\";\n DataErrorCode[DataErrorCode[\"TypeNotFound\"] = 35] = \"TypeNotFound\";\n DataErrorCode[DataErrorCode[\"ReverseLinkNotExist\"] = 36] = \"ReverseLinkNotExist\";\n DataErrorCode[DataErrorCode[\"ErrorCreatingReverseQuery\"] = 37] = \"ErrorCreatingReverseQuery\";\n DataErrorCode[DataErrorCode[\"LinkNotSet\"] = 38] = \"LinkNotSet\";\n})(Data.DataErrorCode || (Data.DataErrorCode = {}));\n_.Data.DataErrorCode=Data.DataErrorCode;\r\n","dependances":[],"fullName":"AventusSharp.Data.DataErrorCode","required":false,"type":6,"isExported":true,"convertibleName":""},{"code":"Data.SharpClass=class SharpClass {\n /**\n * The current namespace\n */\n get namespace() {\n return this.constructor['Namespace'];\n }\n /**\n * Get the unique type for the data. Define it as the namespace + class name\n */\n get $type() {\n return this.constructor['Fullname'];\n }\n /**\n * Get the name of the class\n */\n get className() {\n return this.constructor.name;\n }\n /**\n * Clone the object by transforming a parsed JSON string back into the original type\n */\n clone() {\n return Aventus.Converter.transform(JSON.parse(JSON.stringify(this)));\n }\n /**\n * Get a JSON for the current object\n */\n toJSON() {\n let toAvoid = ['className', 'namespace'];\n return Aventus.Json.classToJson(this, {\n isValidKey: (key) => !toAvoid.includes(key),\n beforeEnd: (result) => {\n let resultTemp = {};\n if (result.$type) {\n resultTemp.$type = result.$type;\n for (let key in result) {\n if (key != '$type') {\n resultTemp[key] = result[key];\n }\n }\n return resultTemp;\n }\n return result;\n }\n });\n }\n}\nData.SharpClass.Namespace=`AventusSharp.Data`;\r\n_.Data.SharpClass=Data.SharpClass;\r\n","dependances":[{"fullName":"Aventus.Converter","isStrong":false},{"fullName":"Aventus.Json","isStrong":false}],"fullName":"AventusSharp.Data.SharpClass","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"Data.AventusFile=class AventusFile {\n static get Fullname() { return \"AventusSharp.Data.AventusFile, AventusSharp\"; }\n Uri;\n Upload;\n /**\n * Get the unique type for the data. Define it as the namespace + class name\n */\n get $type() {\n return this.constructor['Fullname'];\n }\n /**\n * @inerhit\n */\n toJSON() {\n let toAvoid = ['className', 'namespace'];\n return Aventus.Json.classToJson(this, {\n isValidKey: (key) => !toAvoid.includes(key),\n beforeEnd: (result) => {\n let resultTemp = {};\n if (result.$type) {\n resultTemp.$type = result.$type;\n for (let key in result) {\n if (key != '$type') {\n resultTemp[key] = result[key];\n }\n }\n return resultTemp;\n }\n return result;\n }\n });\n }\n}\nData.AventusFile.Namespace=`AventusSharp.Data`;\r\nData.AventusFile.$schema={\"Uri\":\"string\",\"Upload\":\"File\",\"$type\":\"string\"};\r\nAventus.Converter.register(Data.AventusFile.Fullname, Data.AventusFile);\r\n_.Data.AventusFile=Data.AventusFile;\r\n","dependances":[{"fullName":"Convertible","isStrong":false},{"fullName":"Uri","isStrong":false},{"fullName":"File","isStrong":false},{"fullName":"Aventus.Json","isStrong":false}],"fullName":"AventusSharp.Data.AventusFile","required":false,"type":1,"isExported":true,"convertibleName":"Fullname"},{"code":"Data.Datetime=class Datetime extends Data.SharpClass {\n static get Fullname() { return \"AventusSharp.Data.Datetime, AventusSharp\"; }\n DateTime;\n}\nData.Datetime.Namespace=`AventusSharp.Data`;\r\nData.Datetime.$schema={...(Data.SharpClass?.$schema ?? {}), \"DateTime\":\"AventusSharp.RealDate\"};\r\nAventus.Converter.register(Data.Datetime.Fullname, Data.Datetime);\r\n_.Data.Datetime=Data.Datetime;\r\n","dependances":[{"fullName":"AventusSharp.Data.SharpClass","isStrong":true},{"fullName":"Convertible","isStrong":false},{"fullName":"AventusSharp.RealDate","isStrong":false}],"fullName":"AventusSharp.Data.Datetime","required":false,"type":1,"isExported":true,"convertibleName":"Fullname"},{"code":"Data.Date=class Date extends Data.SharpClass {\n static get Fullname() { return \"AventusSharp.Data.Date, AventusSharp\"; }\n DateTime;\n}\nData.Date.Namespace=`AventusSharp.Data`;\r\nData.Date.$schema={...(Data.SharpClass?.$schema ?? {}), \"DateTime\":\"AventusSharp.RealDate\"};\r\nAventus.Converter.register(Data.Date.Fullname, Data.Date);\r\n_.Data.Date=Data.Date;\r\n","dependances":[{"fullName":"AventusSharp.Data.SharpClass","isStrong":true},{"fullName":"Convertible","isStrong":false},{"fullName":"AventusSharp.RealDate","isStrong":false}],"fullName":"AventusSharp.Data.Date","required":false,"type":1,"isExported":true,"convertibleName":"Fullname"},{"code":"Data.DataError=class DataError extends Aventus.GenericError {\n static get Fullname() { return \"AventusSharp.Data.DataError, AventusSharp\"; }\n}\nData.DataError.Namespace=`AventusSharp.Data`;\r\nData.DataError.$schema={...(Aventus.GenericError?.$schema ?? {}), };\r\nAventus.Converter.register(Data.DataError.Fullname, Data.DataError);\r\n_.Data.DataError=Data.DataError;\r\n","dependances":[{"fullName":"Aventus.GenericError","isStrong":true},{"fullName":"AventusSharp.Data.DataErrorCode","isStrong":true},{"fullName":"Convertible","isStrong":false}],"fullName":"AventusSharp.Data.DataError","required":false,"type":1,"isExported":true,"convertibleName":"Fullname"},{"code":"Tools.VoidWithError=class VoidWithError extends Aventus.VoidWithError {\n static get Fullname() { return \"AventusSharp.Tools.VoidWithError, AventusSharp\"; }\n}\nTools.VoidWithError.Namespace=`AventusSharp.Tools`;\r\nTools.VoidWithError.$schema={...(Aventus.VoidWithError?.$schema ?? {}), };\r\nAventus.Converter.register(Tools.VoidWithError.Fullname, Tools.VoidWithError);\r\n_.Tools.VoidWithError=Tools.VoidWithError;\r\n","dependances":[{"fullName":"Aventus.VoidWithError","isStrong":true},{"fullName":"AventusSharp.Tools.IWithError","isStrong":true},{"fullName":"Convertible","isStrong":false},{"fullName":"Aventus.GenericError","isStrong":false}],"fullName":"AventusSharp.Tools.VoidWithError","required":false,"type":1,"isExported":true,"convertibleName":"Fullname"},{"code":"Data.VoidWithDataError=class VoidWithDataError extends Tools.VoidWithError {\n static get Fullname() { return \"AventusSharp.Data.VoidWithDataError, AventusSharp\"; }\n}\nData.VoidWithDataError.Namespace=`AventusSharp.Data`;\r\nData.VoidWithDataError.$schema={...(Tools.VoidWithError?.$schema ?? {}), };\r\nAventus.Converter.register(Data.VoidWithDataError.Fullname, Data.VoidWithDataError);\r\n_.Data.VoidWithDataError=Data.VoidWithDataError;\r\n","dependances":[{"fullName":"AventusSharp.Tools.VoidWithError","isStrong":true},{"fullName":"AventusSharp.Data.DataError","isStrong":false},{"fullName":"Convertible","isStrong":false}],"fullName":"AventusSharp.Data.VoidWithDataError","required":false,"type":1,"isExported":true,"convertibleName":"Fullname"},{"code":"Tools.ResultWithError=class ResultWithError extends Aventus.ResultWithError {\n static get Fullname() { return \"AventusSharp.Tools.ResultWithError, AventusSharp\"; }\n}\nTools.ResultWithError.Namespace=`AventusSharp.Tools`;\r\nTools.ResultWithError.$schema={...(Aventus.ResultWithError?.$schema ?? {}), };\r\nAventus.Converter.register(Tools.ResultWithError.Fullname, Tools.ResultWithError);\r\n_.Tools.ResultWithError=Tools.ResultWithError;\r\n","dependances":[{"fullName":"Aventus.ResultWithError","isStrong":true},{"fullName":"AventusSharp.Tools.IResultWithError","isStrong":true},{"fullName":"Convertible","isStrong":false},{"fullName":"Aventus.GenericError","isStrong":false}],"fullName":"AventusSharp.Tools.ResultWithError","required":false,"type":1,"isExported":true,"convertibleName":"Fullname"},{"code":"Data.ResultWithDataError=class ResultWithDataError extends Tools.ResultWithError {\n static get Fullname() { return \"AventusSharp.Data.ResultWithDataError, AventusSharp\"; }\n}\nData.ResultWithDataError.Namespace=`AventusSharp.Data`;\r\nData.ResultWithDataError.$schema={...(Tools.ResultWithError?.$schema ?? {}), };\r\nAventus.Converter.register(Data.ResultWithDataError.Fullname, Data.ResultWithDataError);\r\n_.Data.ResultWithDataError=Data.ResultWithDataError;\r\n","dependances":[{"fullName":"AventusSharp.Tools.ResultWithError","isStrong":true},{"fullName":"AventusSharp.Data.DataError","isStrong":false},{"fullName":"Convertible","isStrong":false}],"fullName":"AventusSharp.Data.ResultWithDataError","required":false,"type":1,"isExported":true,"convertibleName":"Fullname"},{"code":"Routes.RouteError=class RouteError extends Aventus.GenericError {\n static get Fullname() { return \"AventusSharp.Routes.RouteError, AventusSharp\"; }\n}\nRoutes.RouteError.Namespace=`AventusSharp.Routes`;\r\nRoutes.RouteError.$schema={...(Aventus.GenericError?.$schema ?? {}), };\r\nAventus.Converter.register(Routes.RouteError.Fullname, Routes.RouteError);\r\n_.Routes.RouteError=Routes.RouteError;\r\n","dependances":[{"fullName":"Aventus.GenericError","isStrong":true},{"fullName":"AventusSharp.Routes.RouteErrorCode","isStrong":true},{"fullName":"Convertible","isStrong":false}],"fullName":"AventusSharp.Routes.RouteError","required":false,"type":1,"isExported":true,"convertibleName":"Fullname"},{"code":"Routes.ResultWithRouteError=class ResultWithRouteError extends Tools.ResultWithError {\n static get Fullname() { return \"AventusSharp.Routes.ResultWithRouteError, AventusSharp\"; }\n}\nRoutes.ResultWithRouteError.Namespace=`AventusSharp.Routes`;\r\nRoutes.ResultWithRouteError.$schema={...(Tools.ResultWithError?.$schema ?? {}), };\r\nAventus.Converter.register(Routes.ResultWithRouteError.Fullname, Routes.ResultWithRouteError);\r\n_.Routes.ResultWithRouteError=Routes.ResultWithRouteError;\r\n","dependances":[{"fullName":"AventusSharp.Tools.ResultWithError","isStrong":true},{"fullName":"AventusSharp.Routes.RouteError","isStrong":false},{"fullName":"Convertible","isStrong":false}],"fullName":"AventusSharp.Routes.ResultWithRouteError","required":false,"type":1,"isExported":true,"convertibleName":"Fullname"},{"code":"Routes.VoidWithRouteError=class VoidWithRouteError extends Tools.VoidWithError {\n static get Fullname() { return \"AventusSharp.Routes.VoidWithRouteError, AventusSharp\"; }\n}\nRoutes.VoidWithRouteError.Namespace=`AventusSharp.Routes`;\r\nRoutes.VoidWithRouteError.$schema={...(Tools.VoidWithError?.$schema ?? {}), };\r\nAventus.Converter.register(Routes.VoidWithRouteError.Fullname, Routes.VoidWithRouteError);\r\n_.Routes.VoidWithRouteError=Routes.VoidWithRouteError;\r\n","dependances":[{"fullName":"AventusSharp.Tools.VoidWithError","isStrong":true},{"fullName":"AventusSharp.Routes.RouteError","isStrong":false},{"fullName":"Convertible","isStrong":false}],"fullName":"AventusSharp.Routes.VoidWithRouteError","required":false,"type":1,"isExported":true,"convertibleName":"Fullname"},{"code":"WebSocket.SocketError=class SocketError extends Aventus.GenericError {\n}\nWebSocket.SocketError.Namespace=`AventusSharp.WebSocket`;\r\n_.WebSocket.SocketError=WebSocket.SocketError;\r\n","dependances":[{"fullName":"Aventus.GenericError","isStrong":true},{"fullName":"AventusSharp.WebSocket.SocketErrorCode","isStrong":false}],"fullName":"AventusSharp.WebSocket.SocketError","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"WebSocket.Connection=class Connection {\n static Debug = false;\n options;\n waitingList = {};\n memoryBeforeOpen = [];\n socket;\n actionGuard = new Aventus.ActionGuard();\n /**\n * Create a singleton\n */\n static getInstance() {\n return Aventus.Instance.get(WebSocket.Connection);\n }\n constructor() {\n this.options = this._configure(this.configure({}));\n this._onOpen = this._onOpen.bind(this);\n this._onClose = this._onClose.bind(this);\n this._onError = this._onError.bind(this);\n this.onMessage = this.onMessage.bind(this);\n if (this.options.autoStart) {\n this.open();\n }\n }\n onOpen = new Aventus.Callback();\n onClose = new Aventus.Callback();\n onError = new Aventus.Callback();\n /**\n * Configure a new Websocket\n */\n _configure(options = {}) {\n if (!options.host) {\n options.host = window.location.hostname;\n }\n if (!options.hasOwnProperty('useHttps')) {\n options.useHttps = window.location.protocol == \"https:\";\n }\n if (!options.port) {\n if (window.location.port) {\n options.port = parseInt(window.location.port);\n }\n else {\n options.port = options.useHttps ? 443 : 80;\n }\n }\n if (!options.routes) {\n options.routes = {};\n }\n if (!options.socketName) {\n options.socketName = \"\";\n }\n if (options.log === undefined) {\n options.log = WebSocket.Connection.Debug;\n }\n if (options.autoStart === undefined) {\n options.autoStart = true;\n }\n if (options.sendPing !== undefined && options.sendPing <= 0) {\n options.sendPing = undefined;\n }\n if (options.logPrefix === undefined) {\n options.logPrefix = \"\";\n }\n return options;\n }\n getUrl() {\n let protocol = \"ws\";\n if (this.options.useHttps) {\n protocol = \"wss\";\n }\n let url = protocol + \"://\" + this.options.host + \":\" + this.options.port + this.options.socketName;\n return url;\n }\n /**\n * Add a new route to listen to the websocket\n */\n addRoute(newRoute) {\n if (!this.options.routes.hasOwnProperty(newRoute.channel)) {\n this.options.routes[newRoute.channel] = [];\n }\n for (let info of this.options.routes[newRoute.channel]) {\n if (info.callback == newRoute.callback) {\n return;\n }\n }\n const { params, regex } = Aventus.Uri.prepare(newRoute.channel);\n let prepared = {\n callback: newRoute.callback,\n channel: newRoute.channel,\n regex,\n params\n };\n this.options.routes[newRoute.channel].push(prepared);\n }\n /**\n * The route to remove\n * @param route - The route to remove\n */\n removeRoute(route) {\n for (let i = 0; i < this.options.routes[route.channel].length; i++) {\n let info = this.options.routes[route.channel][i];\n if (info.callback == route.callback) {\n this.options.routes[route.channel].splice(i, 1);\n i--;\n }\n }\n }\n openCallback;\n /**\n * Try to open the websocket\n */\n open() {\n return this.actionGuard.run([\"open\"], () => {\n return new Promise((resolve) => {\n try {\n let url = this.getUrl();\n this.log(\"Opening \" + url);\n this.openCallback = (isOpen) => {\n resolve(isOpen);\n };\n this.socket = WebSocket.Socket.getInstance(url, this);\n this.socket.onOpen.add(this._onOpen);\n this.socket.onClose.add(this._onClose);\n this.socket.onError.add(this._onError);\n this.socket.onMessage.add(this.onMessage);\n if (this.socket.isReady()) {\n this._onOpen();\n }\n }\n catch (e) {\n console.log(e);\n resolve(false);\n }\n });\n });\n }\n jsonReplacer(key, value) {\n if (this[key] instanceof Date) {\n return Aventus.DateConverter.converter.toString(this[key]);\n }\n return value;\n }\n /**\n * Send a message though the websocket\n * @param channelName The channel on which the message is sent\n * @param data The data to send\n * @param options the options to add to the message (typically the uid)\n */\n async sendMessage(options) {\n let result = new Tools.VoidWithError();\n if (!this.socket || this.socket.readyState != 1) {\n let isOpen = await this.open();\n if (!isOpen) {\n result.errors.push(new WebSocket.SocketError(WebSocket.SocketErrorCode.socketClosed, \"Socket not ready ! Please ensure that it is open and ready to send message\"));\n this.log('Socket not ready ! Please ensure that it is open and ready to send message');\n if (this.options.allowSendBeforeOpen) {\n this.memoryBeforeOpen.push(options);\n }\n return result;\n }\n }\n if (this.socket && this.socket.readyState == 1) {\n try {\n let message = {\n channel: options.channel,\n };\n if (options.uid) {\n message.uid = options.uid;\n }\n if (options.body) {\n message.data = options.body;\n this.log(message);\n if (typeof options.body != 'string') {\n message.data = JSON.stringify(options.body, this.jsonReplacer);\n }\n }\n else if (options.channel != \"/ping\") {\n this.log(message);\n }\n this.socket.send(JSON.stringify(message));\n }\n catch (e) {\n result.errors.push(new WebSocket.SocketError(WebSocket.SocketErrorCode.unknow, e));\n }\n }\n else {\n result.errors.push(new WebSocket.SocketError(WebSocket.SocketErrorCode.socketClosed, \"Socket not ready ! Please ensure that it is open and ready to send message\"));\n this.log('Socket not ready ! Please ensure that it is open and ready to send message');\n if (this.options.allowSendBeforeOpen) {\n this.memoryBeforeOpen.push(options);\n }\n }\n return result;\n }\n /**\n * Send a message though the websocket and wait one answer give in parameters callbacks\n * @param channelName The channel on which the message is sent\n * @param body The data to send\n * @param timeout The timeout before the request failed\n */\n sendMessageAndWait(options) {\n return new Promise(async (resolve) => {\n let result = new Aventus.ResultWithError();\n try {\n let _uid = options.uid ? options.uid : Aventus.uuidv4();\n options.uid = _uid;\n let timeoutInfo;\n this.waitingList[_uid] = (channel, data) => {\n clearTimeout(timeoutInfo);\n if (channel.toLowerCase() != options.channel.toLowerCase()) {\n result.errors.push(new WebSocket.SocketError(WebSocket.SocketErrorCode.differentChannel, `We sent a message on ${options.channel} but we receive on ${channel}`));\n resolve(result);\n }\n else {\n if (data instanceof Aventus.VoidWithError) {\n for (let error of data.errors) {\n result.errors.push(error);\n }\n if (data instanceof Aventus.ResultWithError) {\n result.result = data.result;\n }\n }\n else {\n result.result = data;\n }\n resolve(result);\n }\n };\n if (options.timeout !== undefined) {\n timeoutInfo = setTimeout(() => {\n delete this.waitingList[_uid];\n result.errors.push(new WebSocket.SocketError(WebSocket.SocketErrorCode.timeout, \"No message received after \" + options.timeout + \"ms\"));\n resolve(result);\n }, options.timeout);\n }\n let sendMessageResult = await this.sendMessage(options);\n if (!sendMessageResult.success) {\n for (let error of sendMessageResult.errors) {\n result.errors.push(error);\n }\n resolve(result);\n }\n }\n catch (e) {\n result.errors.push(new WebSocket.SocketError(WebSocket.SocketErrorCode.unknow, e));\n resolve(result);\n }\n });\n }\n ;\n /**\n * Check if socket is ready\n */\n isReady() {\n if (this.socket && this.socket.isReady()) {\n return true;\n }\n return false;\n }\n sendPingTimeout = 0;\n sendPing() {\n this.sendMessage({\n channel: \"/ping\",\n });\n }\n startPing() {\n clearInterval(this.sendPingTimeout);\n this.sendPingTimeout = setInterval(() => {\n this.sendPing();\n }, 5000);\n }\n stopPing() {\n clearInterval(this.sendPingTimeout);\n }\n _onOpen() {\n if (this.socket?.isReady()) {\n if (this.openCallback) {\n this.openCallback(true);\n this.openCallback = undefined;\n }\n let protocol = \"ws\";\n if (this.options.useHttps) {\n protocol = \"wss\";\n }\n this.log(`Connection successfully established to ${this.getUrl()}!`);\n this.onOpen.trigger([]);\n for (let i = 0; i < this.memoryBeforeOpen.length; i++) {\n this.sendMessage(this.memoryBeforeOpen[i]);\n }\n this.memoryBeforeOpen = [];\n if (this.options.sendPing) {\n this.startPing();\n }\n }\n else {\n if (this.openCallback) {\n this.openCallback(false);\n this.openCallback = undefined;\n }\n }\n }\n errorOccur = false;\n _onError(event) {\n this.errorOccur = true;\n if (this.openCallback) {\n this.openCallback(false);\n this.openCallback = undefined;\n return;\n }\n this.log('An error has occured');\n this.onError.trigger([event]);\n }\n _onClose(event) {\n this.stopPing();\n if (this.errorOccur) {\n this.errorOccur = false;\n return;\n }\n this.log('Closing connection');\n this.onClose.trigger([event]);\n }\n /**\n * Close the current connection\n */\n close() {\n if (this.socket) {\n this.socket.onOpen.remove(this._onOpen);\n this.socket.onClose.remove(this._onClose);\n this.socket.onError.remove(this._onError);\n this.socket.onMessage.remove(this.onMessage);\n this.socket.close(this);\n delete this.socket;\n }\n }\n onMessage(event) {\n let response = JSON.parse(event.data);\n this.log(response);\n let data = {};\n try {\n data = Aventus.Converter.transform(JSON.parse(response.data));\n }\n catch (e) {\n console.error(e);\n }\n for (let channel in this.options.routes) {\n let current = this.options.routes[channel];\n for (let info of current) {\n let params = Aventus.Uri.getParams(info, response.channel);\n if (params) {\n let valueCb = data;\n if (data instanceof Aventus.ResultWithError) {\n valueCb = data.result;\n }\n else if (data instanceof Aventus.VoidWithError) {\n valueCb = undefined;\n }\n info.callback(valueCb, params, response.uid);\n }\n }\n }\n if (response.uid) {\n if (this.waitingList.hasOwnProperty(response.uid)) {\n this.waitingList[response.uid](response.channel, data);\n delete this.waitingList[response.uid];\n }\n }\n }\n /**\n * Print a msg inside the console\n */\n log(message) {\n if (this.options.log) {\n const now = new Date();\n const hours = (now.getHours()).toLocaleString(undefined, { minimumIntegerDigits: 2 });\n const minutes = (now.getMinutes()).toLocaleString(undefined, { minimumIntegerDigits: 2 });\n const seconds = (now.getSeconds()).toLocaleString(undefined, { minimumIntegerDigits: 2 });\n const prefix = this.options.logPrefix ? `[${this.options.logPrefix}] ` : '';\n if (message instanceof Object) {\n let cloneMessage = JSON.parse(JSON.stringify(message, this.jsonReplacer));\n if (cloneMessage.data && typeof cloneMessage.data == 'string') {\n cloneMessage.data = JSON.parse(cloneMessage.data);\n }\n console.log(`${prefix}[${hours}:${minutes}:${seconds}]: `, cloneMessage);\n }\n else {\n console.log(`${prefix}[${hours}:${minutes}:${seconds}]: `, message);\n }\n }\n }\n}\nWebSocket.Connection.Namespace=`AventusSharp.WebSocket`;\r\n_.WebSocket.Connection=WebSocket.Connection;\r\n","dependances":[{"fullName":"Required","isStrong":false},{"fullName":"AventusSharp.WebSocket.ConnectionOptions","isStrong":false},{"fullName":"AventusSharp.WebSocket.SocketSendMessageOptions","isStrong":false},{"fullName":"AventusSharp.WebSocket.Socket","isStrong":false},{"fullName":"Aventus.ActionGuard","isStrong":false},{"fullName":"AventusSharp.WebSocket.Connection","isStrong":false},{"fullName":"Aventus.Instance","isStrong":false},{"fullName":"Aventus.Callback","isStrong":false},{"fullName":"Event","isStrong":false},{"fullName":"AventusSharp.WebSocket.SocketRoute","isStrong":false},{"fullName":"Aventus.Uri","isStrong":false},{"fullName":"AventusSharp.WebSocket.InternalSocketRoute","isStrong":false},{"fullName":"Promise","isStrong":false},{"fullName":"Date","isStrong":false},{"fullName":"Aventus.DateConverter","isStrong":false},{"fullName":"Aventus.VoidWithError","isStrong":false},{"fullName":"AventusSharp.Tools.VoidWithError","isStrong":false},{"fullName":"AventusSharp.WebSocket.SocketError","isStrong":false},{"fullName":"AventusSharp.WebSocket.SocketErrorCode","isStrong":false},{"fullName":"AventusSharp.WebSocket.SocketMessage","isStrong":false},{"fullName":"Aventus.ResultWithError","isStrong":false},{"fullName":"Aventus.ExtractFromError","isStrong":false},{"fullName":"T","isStrong":false},{"fullName":"Aventus.uuidv4","isStrong":false},{"fullName":"MessageEvent","isStrong":false},{"fullName":"Aventus.Converter","isStrong":false}],"fullName":"AventusSharp.WebSocket.Connection","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"WebSocket.EndPoint=class EndPoint extends WebSocket.Connection {\n /**\n * Create a singleton\n */\n static getInstance() {\n return Aventus.Instance.get(WebSocket.EndPoint);\n }\n constructor() {\n super();\n this.register();\n }\n register() {\n }\n /**\n * @inheritdoc\n */\n configure(options) {\n options.socketName = this.path;\n options.sendPing = 5000;\n return options;\n }\n get path() {\n return \"/ws\";\n }\n ;\n}\nWebSocket.EndPoint.Namespace=`AventusSharp.WebSocket`;\r\n_.WebSocket.EndPoint=WebSocket.EndPoint;\r\n","dependances":[{"fullName":"AventusSharp.WebSocket.Connection","isStrong":true},{"fullName":"AventusSharp.WebSocket.EndPoint","isStrong":false},{"fullName":"Aventus.Instance","isStrong":false},{"fullName":"AventusSharp.WebSocket.ConnectionOptions","isStrong":false}],"fullName":"AventusSharp.WebSocket.EndPoint","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"WebSocket.WsEvent=class WsEvent {\n endpoint;\n onTrigger = new Aventus.Callback();\n routeInfo;\n _listening = false;\n get listening() {\n return this._listening;\n }\n getPrefix;\n constructor(endpoint, getPrefix) {\n this.endpoint = endpoint ?? WebSocket.EndPoint.getInstance();\n this.getPrefix = getPrefix ?? (() => \"\");\n this.onEvent = this.onEvent.bind(this);\n }\n init() {\n this.routeInfo = {\n channel: this.path(),\n callback: this.onEvent\n };\n if (this.listenOnBoot()) {\n this.listen();\n }\n }\n /**\n * Override this method to tell that the event must listen when created\n */\n listenOnBoot() {\n return false;\n }\n /**\n * Add the event to the endpoint. After that, the on trigger event can be triggered\n */\n listen() {\n if (!this._listening) {\n this._listening = true;\n if (!this.routeInfo) {\n this.routeInfo = {\n channel: this.path(),\n callback: this.onEvent\n };\n }\n this.endpoint.addRoute(this.routeInfo);\n }\n }\n /**\n * Remove the event from the endpoint. After that, the on trigger event won't be triggered\n */\n stop() {\n if (this._listening) {\n this._listening = false;\n this.endpoint.removeRoute(this.routeInfo);\n }\n }\n onEvent(data, params, uid) {\n this.onTrigger.trigger([data, params, uid]);\n }\n}\nWebSocket.WsEvent.Namespace=`AventusSharp.WebSocket`;\r\n_.WebSocket.WsEvent=WebSocket.WsEvent;\r\n","dependances":[{"fullName":"AventusSharp.WebSocket.EndPoint","isStrong":false},{"fullName":"Aventus.Callback","isStrong":false},{"fullName":"Aventus.ExtractFromError","isStrong":false},{"fullName":"Aventus.UriParamsValue","isStrong":false},{"fullName":"AventusSharp.WebSocket.SocketRoute","isStrong":false}],"fullName":"AventusSharp.WebSocket.WsEvent","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"WebSocket.StorableWsRoute_DeleteMany=class StorableWsRoute_DeleteMany extends WebSocket.WsEvent {\n /**\n * @inheritdoc\n */\n path() {\n return `${this.getPrefix()}/${this.StorableName()}/DeleteMany`;\n }\n StorableName;\n constructor(endpoint, getPrefix, StorableName) {\n super(endpoint, getPrefix);\n this.StorableName = StorableName;\n }\n}\nWebSocket.StorableWsRoute_DeleteMany.Namespace=`AventusSharp.WebSocket`;\r\n_.WebSocket.StorableWsRoute_DeleteMany=WebSocket.StorableWsRoute_DeleteMany;\r\n","dependances":[{"fullName":"AventusSharp.WebSocket.WsEvent","isStrong":true},{"fullName":"AventusSharp.Tools.ResultWithError","isStrong":false},{"fullName":"Aventus.IData","isStrong":false},{"fullName":"AventusSharp.WebSocket.EndPoint","isStrong":false}],"fullName":"AventusSharp.WebSocket.StorableWsRoute_DeleteMany","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"WebSocket.StorableWsRoute_Delete=class StorableWsRoute_Delete extends WebSocket.WsEvent {\n StorableName;\n constructor(endpoint, getPrefix, StorableName) {\n super(endpoint, getPrefix);\n this.StorableName = StorableName;\n }\n /**\n * @inheritdoc\n */\n path() {\n return `${this.getPrefix()}/${this.StorableName()}/{id:number}/Delete`;\n }\n}\nWebSocket.StorableWsRoute_Delete.Namespace=`AventusSharp.WebSocket`;\r\n_.WebSocket.StorableWsRoute_Delete=WebSocket.StorableWsRoute_Delete;\r\n","dependances":[{"fullName":"AventusSharp.WebSocket.WsEvent","isStrong":true},{"fullName":"AventusSharp.WebSocket.EndPoint","isStrong":false}],"fullName":"AventusSharp.WebSocket.StorableWsRoute_Delete","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"WebSocket.StorableWsRoute_UpdateMany=class StorableWsRoute_UpdateMany extends WebSocket.WsEvent {\n /**\n * @inheritdoc\n */\n path() {\n return `${this.getPrefix()}/${this.StorableName()}/UpdateMany`;\n }\n StorableName;\n constructor(endpoint, getPrefix, StorableName) {\n super(endpoint, getPrefix);\n this.StorableName = StorableName;\n }\n}\nWebSocket.StorableWsRoute_UpdateMany.Namespace=`AventusSharp.WebSocket`;\r\n_.WebSocket.StorableWsRoute_UpdateMany=WebSocket.StorableWsRoute_UpdateMany;\r\n","dependances":[{"fullName":"AventusSharp.WebSocket.WsEvent","isStrong":true},{"fullName":"AventusSharp.Tools.ResultWithError","isStrong":false},{"fullName":"Aventus.IData","isStrong":false},{"fullName":"AventusSharp.WebSocket.EndPoint","isStrong":false}],"fullName":"AventusSharp.WebSocket.StorableWsRoute_UpdateMany","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"WebSocket.StorableWsRoute_Update=class StorableWsRoute_Update extends WebSocket.WsEvent {\n StorableName;\n constructor(endpoint, getPrefix, StorableName) {\n super(endpoint, getPrefix);\n this.StorableName = StorableName;\n }\n /**\n * @inheritdoc\n */\n path() {\n return `${this.getPrefix()}/${this.StorableName()}/{id:number}/Update`;\n }\n}\nWebSocket.StorableWsRoute_Update.Namespace=`AventusSharp.WebSocket`;\r\n_.WebSocket.StorableWsRoute_Update=WebSocket.StorableWsRoute_Update;\r\n","dependances":[{"fullName":"AventusSharp.WebSocket.WsEvent","isStrong":true},{"fullName":"AventusSharp.WebSocket.EndPoint","isStrong":false}],"fullName":"AventusSharp.WebSocket.StorableWsRoute_Update","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"WebSocket.StorableWsRoute_GetByIds=class StorableWsRoute_GetByIds extends WebSocket.WsEvent {\n StorableName;\n constructor(endpoint, getPrefix, StorableName) {\n super(endpoint, getPrefix);\n this.StorableName = StorableName;\n }\n /**\n * @inheritdoc\n */\n path() {\n return `${this.getPrefix()}/${this.StorableName()}s`;\n }\n}\nWebSocket.StorableWsRoute_GetByIds.Namespace=`AventusSharp.WebSocket`;\r\n_.WebSocket.StorableWsRoute_GetByIds=WebSocket.StorableWsRoute_GetByIds;\r\n","dependances":[{"fullName":"AventusSharp.WebSocket.WsEvent","isStrong":true},{"fullName":"AventusSharp.WebSocket.EndPoint","isStrong":false}],"fullName":"AventusSharp.WebSocket.StorableWsRoute_GetByIds","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"WebSocket.StorableWsRoute_GetById=class StorableWsRoute_GetById extends WebSocket.WsEvent {\n StorableName;\n constructor(endpoint, getPrefix, StorableName) {\n super(endpoint, getPrefix);\n this.StorableName = StorableName;\n }\n /**\n * @inheritdoc\n */\n path() {\n return `${this.getPrefix()}/${this.StorableName()}/{id:number}`;\n }\n}\nWebSocket.StorableWsRoute_GetById.Namespace=`AventusSharp.WebSocket`;\r\n_.WebSocket.StorableWsRoute_GetById=WebSocket.StorableWsRoute_GetById;\r\n","dependances":[{"fullName":"AventusSharp.WebSocket.WsEvent","isStrong":true},{"fullName":"AventusSharp.WebSocket.EndPoint","isStrong":false}],"fullName":"AventusSharp.WebSocket.StorableWsRoute_GetById","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"WebSocket.StorableWsRoute_CreateMany=class StorableWsRoute_CreateMany extends WebSocket.WsEvent {\n /**\n * @inheritdoc\n */\n path() {\n return `${this.getPrefix()}/${this.StorableName()}/CreateMany`;\n }\n StorableName;\n constructor(endpoint, getPrefix, StorableName) {\n super(endpoint, getPrefix);\n this.StorableName = StorableName;\n }\n}\nWebSocket.StorableWsRoute_CreateMany.Namespace=`AventusSharp.WebSocket`;\r\n_.WebSocket.StorableWsRoute_CreateMany=WebSocket.StorableWsRoute_CreateMany;\r\n","dependances":[{"fullName":"AventusSharp.WebSocket.WsEvent","isStrong":true},{"fullName":"AventusSharp.Tools.ResultWithError","isStrong":false},{"fullName":"Aventus.IData","isStrong":false},{"fullName":"AventusSharp.WebSocket.EndPoint","isStrong":false}],"fullName":"AventusSharp.WebSocket.StorableWsRoute_CreateMany","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"WebSocket.StorableWsRoute_Create=class StorableWsRoute_Create extends WebSocket.WsEvent {\n StorableName;\n constructor(endpoint, getPrefix, StorableName) {\n super(endpoint, getPrefix);\n this.StorableName = StorableName;\n }\n /**\n * @inheritdoc\n */\n path() {\n return `${this.getPrefix()}/${this.StorableName()}/Create`;\n }\n}\nWebSocket.StorableWsRoute_Create.Namespace=`AventusSharp.WebSocket`;\r\n_.WebSocket.StorableWsRoute_Create=WebSocket.StorableWsRoute_Create;\r\n","dependances":[{"fullName":"AventusSharp.WebSocket.WsEvent","isStrong":true},{"fullName":"AventusSharp.WebSocket.EndPoint","isStrong":false}],"fullName":"AventusSharp.WebSocket.StorableWsRoute_Create","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"WebSocket.Route=class Route {\n endpoint;\n constructor(endpoint) {\n this.endpoint = endpoint ?? WebSocket.EndPoint.getInstance();\n }\n getPrefix() {\n return \"\";\n }\n}\nWebSocket.Route.Namespace=`AventusSharp.WebSocket`;\r\n_.WebSocket.Route=WebSocket.Route;\r\n","dependances":[{"fullName":"AventusSharp.WebSocket.EndPoint","isStrong":false}],"fullName":"AventusSharp.WebSocket.Route","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"WebSocket.StorableWsRoute_GetAll=class StorableWsRoute_GetAll extends WebSocket.WsEvent {\n StorableName;\n constructor(endpoint, getPrefix, StorableName) {\n super(endpoint, getPrefix);\n this.StorableName = StorableName;\n }\n /**\n * @inheritdoc\n */\n path() {\n return `${this.getPrefix()}/${this.StorableName()}`;\n }\n}\nWebSocket.StorableWsRoute_GetAll.Namespace=`AventusSharp.WebSocket`;\r\n_.WebSocket.StorableWsRoute_GetAll=WebSocket.StorableWsRoute_GetAll;\r\n","dependances":[{"fullName":"AventusSharp.WebSocket.WsEvent","isStrong":true},{"fullName":"AventusSharp.WebSocket.EndPoint","isStrong":false}],"fullName":"AventusSharp.WebSocket.StorableWsRoute_GetAll","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"WebSocket.StorableWsRoute=class StorableWsRoute extends WebSocket.Route {\n events;\n constructor(endpoint) {\n super(endpoint);\n this.events = {\n GetAll: new WebSocket.StorableWsRoute_GetAll(this.endpoint, this.getPrefix, this.StorableName),\n Create: new WebSocket.StorableWsRoute_Create(this.endpoint, this.getPrefix, this.StorableName),\n CreateMany: new WebSocket.StorableWsRoute_CreateMany(this.endpoint, this.getPrefix, this.StorableName),\n GetById: new WebSocket.StorableWsRoute_GetById(this.endpoint, this.getPrefix, this.StorableName),\n GetByIds: new WebSocket.StorableWsRoute_GetByIds(this.endpoint, this.getPrefix, this.StorableName),\n Update: new WebSocket.StorableWsRoute_Update(this.endpoint, this.getPrefix, this.StorableName),\n UpdateMany: new WebSocket.StorableWsRoute_UpdateMany(this.endpoint, this.getPrefix, this.StorableName),\n Delete: new WebSocket.StorableWsRoute_Delete(this.endpoint, this.getPrefix, this.StorableName),\n DeleteMany: new WebSocket.StorableWsRoute_DeleteMany(this.endpoint, this.getPrefix, this.StorableName),\n };\n for (let key in this.events) {\n this.events[key].init();\n }\n }\n async GetAll(options = {}) {\n const info = {\n channel: `${this.getPrefix()}/${this.StorableName()}`,\n ...options,\n };\n return await this.endpoint.sendMessageAndWait(info);\n }\n async Create(body, options = {}) {\n const info = {\n channel: `${this.getPrefix()}/${this.StorableName()}/Create`,\n body: body,\n ...options,\n };\n return await this.endpoint.sendMessageAndWait(info);\n }\n async CreateMany(body, options = {}) {\n const info = {\n channel: `${this.getPrefix()}/${this.StorableName()}/CreateMany`,\n body: body,\n ...options,\n };\n return await this.endpoint.sendMessageAndWait(info);\n }\n async GetById(id, options = {}) {\n const info = {\n channel: `${this.getPrefix()}/${this.StorableName()}/${id}`,\n ...options,\n };\n return await this.endpoint.sendMessageAndWait(info);\n }\n async GetByIds(body, options = {}) {\n const info = {\n channel: `${this.getPrefix()}/${this.StorableName()}/getbyids`,\n body: body,\n ...options,\n };\n return await this.endpoint.sendMessageAndWait(info);\n }\n async Update(id, body, options = {}) {\n const info = {\n channel: `${this.getPrefix()}/${this.StorableName()}/${id}/Update`,\n body: body,\n ...options,\n };\n return await this.endpoint.sendMessageAndWait(info);\n }\n async UpdateMany(body, options = {}) {\n const info = {\n channel: `${this.getPrefix()}/${this.StorableName()}/UpdateMany`,\n body: body,\n ...options,\n };\n return await this.endpoint.sendMessageAndWait(info);\n }\n async Delete(id, options = {}) {\n const info = {\n channel: `${this.getPrefix()}/${this.StorableName()}/${id}/Delete`,\n ...options,\n };\n return await this.endpoint.sendMessageAndWait(info);\n }\n async DeleteMany(body, options = {}) {\n const info = {\n channel: `${this.getPrefix()}/${this.StorableName()}/DeleteMany`,\n body: body,\n ...options,\n };\n return await this.endpoint.sendMessageAndWait(info);\n }\n}\nWebSocket.StorableWsRoute.Namespace=`AventusSharp.WebSocket`;\r\n_.WebSocket.StorableWsRoute=WebSocket.StorableWsRoute;\r\n","dependances":[{"fullName":"AventusSharp.WebSocket.Route","isStrong":true},{"fullName":"Aventus.IData","isStrong":false},{"fullName":"AventusSharp.WebSocket.StorableWsRoute_GetAll","isStrong":false},{"fullName":"AventusSharp.WebSocket.StorableWsRoute_Create","isStrong":false},{"fullName":"AventusSharp.WebSocket.StorableWsRoute_CreateMany","isStrong":false},{"fullName":"AventusSharp.WebSocket.StorableWsRoute_GetById","isStrong":false},{"fullName":"AventusSharp.WebSocket.StorableWsRoute_GetByIds","isStrong":false},{"fullName":"AventusSharp.WebSocket.StorableWsRoute_Update","isStrong":false},{"fullName":"AventusSharp.WebSocket.StorableWsRoute_UpdateMany","isStrong":false},{"fullName":"AventusSharp.WebSocket.StorableWsRoute_Delete","isStrong":false},{"fullName":"AventusSharp.WebSocket.StorableWsRoute_DeleteMany","isStrong":false},{"fullName":"AventusSharp.WebSocket.EndPoint","isStrong":false},{"fullName":"AventusSharp.WebSocket.WsRouteSendOptions","isStrong":false},{"fullName":"Promise","isStrong":false},{"fullName":"AventusSharp.ExtractResponse","isStrong":false},{"fullName":"AventusSharp.WebSocket.SocketSendMessageOptions","isStrong":false},{"fullName":"FormData","isStrong":false}],"fullName":"AventusSharp.WebSocket.StorableWsRoute","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"WebSocket.WsError=class WsError extends Aventus.GenericError {\n static get Fullname() { return \"AventusSharp.WebSocket.WsError, AventusSharp\"; }\n}\nWebSocket.WsError.Namespace=`AventusSharp.WebSocket`;\r\nWebSocket.WsError.$schema={...(Aventus.GenericError?.$schema ?? {}), };\r\nAventus.Converter.register(WebSocket.WsError.Fullname, WebSocket.WsError);\r\n_.WebSocket.WsError=WebSocket.WsError;\r\n","dependances":[{"fullName":"Aventus.GenericError","isStrong":true},{"fullName":"AventusSharp.WebSocket.WsErrorCode","isStrong":true},{"fullName":"Convertible","isStrong":false}],"fullName":"AventusSharp.WebSocket.WsError","required":false,"type":1,"isExported":true,"convertibleName":"Fullname"},{"code":"WebSocket.ResultWithWsError=class ResultWithWsError extends Tools.ResultWithError {\n static get Fullname() { return \"AventusSharp.WebSocket.ResultWithWsError, AventusSharp\"; }\n}\nWebSocket.ResultWithWsError.Namespace=`AventusSharp.WebSocket`;\r\nWebSocket.ResultWithWsError.$schema={...(Tools.ResultWithError?.$schema ?? {}), };\r\nAventus.Converter.register(WebSocket.ResultWithWsError.Fullname, WebSocket.ResultWithWsError);\r\n_.WebSocket.ResultWithWsError=WebSocket.ResultWithWsError;\r\n","dependances":[{"fullName":"AventusSharp.Tools.ResultWithError","isStrong":true},{"fullName":"AventusSharp.WebSocket.WsError","isStrong":false},{"fullName":"Convertible","isStrong":false}],"fullName":"AventusSharp.WebSocket.ResultWithWsError","required":false,"type":1,"isExported":true,"convertibleName":"Fullname"},{"code":"WebSocket.VoidWithWsError=class VoidWithWsError extends Tools.VoidWithError {\n static get Fullname() { return \"AventusSharp.WebSocket.VoidWithWsError, AventusSharp\"; }\n}\nWebSocket.VoidWithWsError.Namespace=`AventusSharp.WebSocket`;\r\nWebSocket.VoidWithWsError.$schema={...(Tools.VoidWithError?.$schema ?? {}), };\r\nAventus.Converter.register(WebSocket.VoidWithWsError.Fullname, WebSocket.VoidWithWsError);\r\n_.WebSocket.VoidWithWsError=WebSocket.VoidWithWsError;\r\n","dependances":[{"fullName":"AventusSharp.Tools.VoidWithError","isStrong":true},{"fullName":"AventusSharp.WebSocket.WsError","isStrong":false},{"fullName":"Convertible","isStrong":false}],"fullName":"AventusSharp.WebSocket.VoidWithWsError","required":false,"type":1,"isExported":true,"convertibleName":"Fullname"},{"code":"RAM.RamHttp=class RamHttp extends Aventus.Ram {\n getAllDone = false;\n routes;\n constructor() {\n super();\n this.routes = this.defineRoutes();\n }\n async beforeGetAll(result) {\n if (!this.getAllDone) {\n let response = await this.routes.GetAll();\n if (response.success && response.result) {\n for (let item of response.result) {\n let resultTemp = new Aventus.ResultRamWithError();\n await this.addOrUpdateData(item, resultTemp);\n if (!resultTemp.success) {\n result.errors = [...result.errors, ...resultTemp.errors];\n }\n }\n this.getAllDone = true;\n }\n else {\n result.errors = [...result.errors, ...response.errors];\n }\n }\n }\n async beforeGetById(id, result) {\n if (this.records.has(id)) {\n return;\n }\n else {\n let response = await this.routes.GetById(id);\n if (response.success && response.result) {\n let resultTemp = new Aventus.ResultRamWithError();\n await this.addOrUpdateData(response.result, resultTemp);\n if (!resultTemp.success) {\n result.errors = [...result.errors, ...resultTemp.errors];\n }\n else {\n result.result = resultTemp.result;\n }\n }\n else {\n result.errors = [...result.errors, ...response.errors];\n }\n }\n }\n async beforeGetByIds(ids, result) {\n let missingIds = [];\n for (let id of ids) {\n if (!this.records.has(id)) {\n missingIds.push(id);\n }\n }\n if (missingIds.length > 0) {\n result.result = [];\n let response = await this.routes.GetByIds({ ids: missingIds });\n if (response.success && response.result) {\n for (let item of response.result) {\n let resultTemp = new Aventus.ResultRamWithError();\n await this.addOrUpdateData(item, resultTemp);\n if (!resultTemp.success || !resultTemp.result) {\n result.errors = [...result.errors, ...resultTemp.errors];\n }\n else if (!result.result.includes(resultTemp.result)) {\n result.result.push(resultTemp.result);\n }\n }\n }\n else {\n result.errors = [...result.errors, ...response.errors];\n }\n }\n }\n async beforeCreateItem(item, fromList, result) {\n if (fromList) {\n return;\n }\n let response = await this.routes.Create({ item });\n if (response.success && response.result) {\n result.result = this.getObjectForRam(response.result);\n }\n else {\n result.errors = [...result.errors, ...response.errors];\n }\n }\n async beforeCreateList(list, result) {\n let response = await this.routes.CreateMany({ list });\n if (response.success && response.result) {\n result.result = [];\n for (let element of response.result) {\n result.result.push(this.getObjectForRam(element));\n }\n }\n else {\n result.errors = [...result.errors, ...response.errors];\n }\n }\n async beforeUpdateItem(item, fromList, result) {\n if (fromList) {\n return;\n }\n let response = await this.routes.Update(item.Id, { item });\n if (response.success && response.result) {\n result.result = this.getObjectForRam(response.result);\n }\n else {\n result.errors = [...result.errors, ...response.errors];\n }\n }\n async beforeUpdateList(list, result) {\n let response = await this.routes.UpdateMany({ list });\n if (response.success && response.result) {\n result.result = [];\n for (let element of response.result) {\n result.result.push(this.getObjectForRam(element));\n }\n }\n else {\n result.errors = [...result.errors, ...response.errors];\n }\n }\n async beforeDeleteItem(item, fromList, result) {\n if (fromList) {\n return;\n }\n let response = await this.routes.Delete(item.Id);\n if (!response.success) {\n result.errors = [...result.errors, ...response.errors];\n }\n }\n async beforeDeleteList(list, result) {\n let response = await this.routes.DeleteMany({ ids: list.map(t => t.Id) });\n if (!response.success) {\n result.errors = [...result.errors, ...response.errors];\n }\n }\n}\nRAM.RamHttp.Namespace=`AventusSharp.RAM`;\r\n_.RAM.RamHttp=RAM.RamHttp;\r\n","dependances":[{"fullName":"Aventus.Ram","isStrong":true},{"fullName":"AventusSharp.Data.Storable","isStrong":false},{"fullName":"AventusSharp.Routes.StorableRoute","isStrong":false},{"fullName":"Aventus.ResultRamWithError","isStrong":false},{"fullName":"Map","isStrong":false},{"fullName":"Aventus.RamItem","isStrong":false},{"fullName":"Promise","isStrong":false},{"fullName":"Aventus.VoidWithError","isStrong":false}],"fullName":"AventusSharp.RAM.RamHttp","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"RAM.RamWebSocket=class RamWebSocket extends Aventus.Ram {\n getAllDone = false;\n routes;\n otherGetAllLocked = {};\n otherGetByIdLocked = {};\n otherCreateItemLocked = {};\n otherCreateListLocked = {};\n otherUpdateItemLocked = {};\n otherUpdateListLocked = {};\n otherDeleteItemLocked = {};\n otherDeleteListLocked = {};\n constructor() {\n super();\n this.routes = this.defineRoutes();\n this.addEventsBindings();\n this.otherGetAll = this.otherGetAll.bind(this);\n this.otherGetById = this.otherGetById.bind(this);\n this.otherCreateItem = this.otherCreateItem.bind(this);\n this.otherCreateList = this.otherCreateList.bind(this);\n this.otherUpdateItem = this.otherUpdateItem.bind(this);\n this.otherUpdateList = this.otherUpdateList.bind(this);\n this.otherDeleteItem = this.otherDeleteItem.bind(this);\n this.otherDeleteList = this.otherDeleteList.bind(this);\n }\n addEventsBindings() {\n const autoListen = this.listenOnStart();\n this.routes.events.GetAll.onTrigger.add(this.otherGetAll, this);\n if (autoListen.GetAll) {\n this.routes.events.GetAll.listen();\n }\n else {\n this.routes.events.GetAll.stop();\n }\n this.routes.events.GetById.onTrigger.add(this.otherGetById, this);\n if (autoListen.GetById) {\n this.routes.events.GetById.listen();\n }\n else {\n this.routes.events.GetById.stop();\n }\n this.routes.events.Create.onTrigger.add(this.otherCreateItem, this);\n if (autoListen.Create) {\n this.routes.events.Create.listen();\n }\n else {\n this.routes.events.Create.stop();\n }\n this.routes.events.CreateMany.onTrigger.add(this.otherCreateList, this);\n if (autoListen.CreateMany) {\n this.routes.events.CreateMany.listen();\n }\n else {\n this.routes.events.CreateMany.stop();\n }\n this.routes.events.Update.onTrigger.add(this.otherUpdateItem, this);\n if (autoListen.Update) {\n this.routes.events.Update.listen();\n }\n else {\n this.routes.events.Update.stop();\n }\n this.routes.events.UpdateMany.onTrigger.add(this.otherUpdateList, this);\n if (autoListen.UpdateMany) {\n this.routes.events.UpdateMany.listen();\n }\n else {\n this.routes.events.UpdateMany.stop();\n }\n this.routes.events.Delete.onTrigger.add(this.otherDeleteItem, this);\n if (autoListen.Delete) {\n this.routes.events.Delete.listen();\n }\n else {\n this.routes.events.Delete.stop();\n }\n this.routes.events.DeleteMany.onTrigger.add(this.otherDeleteList, this);\n if (autoListen.DeleteMany) {\n this.routes.events.DeleteMany.listen();\n }\n else {\n this.routes.events.DeleteMany.stop();\n }\n }\n listenOnStart() {\n return {\n GetAll: false,\n GetById: false,\n Create: true,\n CreateMany: true,\n Update: true,\n UpdateMany: true,\n Delete: true,\n DeleteMany: true,\n };\n }\n async otherGetAll(items, params, uid) {\n if (uid && this.otherGetAllLocked[uid])\n return;\n for (let item of items) {\n let resultTemp = new Aventus.ResultRamWithError();\n await this.addOrUpdateData(item, resultTemp);\n }\n }\n async beforeGetAll(result) {\n if (!this.getAllDone) {\n let uid = Aventus.uuidv4();\n this.otherGetAllLocked[uid] = true;\n let response = await this.routes.GetAll({ uid });\n delete this.otherGetAllLocked[uid];\n if (!response)\n return;\n if (response.success && response.result) {\n for (let item of response.result) {\n let resultTemp = new Aventus.ResultRamWithError();\n await this.addOrUpdateData(item, resultTemp);\n if (!resultTemp.success) {\n result.errors = [...result.errors, ...resultTemp.errors];\n }\n }\n }\n else {\n result.errors = [...result.errors, ...response.errors];\n }\n }\n }\n async otherGetById(item, params, uid) {\n if (uid && this.otherGetByIdLocked[uid])\n return;\n let resultTemp = new Aventus.ResultRamWithError();\n await this.addOrUpdateData(item, resultTemp);\n }\n async beforeGetById(id, result) {\n if (this.records.has(id)) {\n return;\n }\n else {\n let uid = Aventus.uuidv4();\n this.otherGetByIdLocked[uid] = true;\n let response = await this.routes.GetById(id, { uid });\n delete this.otherGetByIdLocked[uid];\n if (!response)\n return;\n if (response.success && response.result) {\n let resultTemp = new Aventus.ResultRamWithError();\n await this.addOrUpdateData(response.result, resultTemp);\n if (!resultTemp.success) {\n result.errors = [...result.errors, ...resultTemp.errors];\n }\n }\n else {\n result.errors = [...result.errors, ...response.errors];\n }\n }\n }\n async beforeGetByIds(ids, result) {\n let missingIds = [];\n for (let id of ids) {\n if (!this.records.has(id)) {\n missingIds.push(id);\n }\n }\n if (missingIds.length > 0) {\n let response = await this.routes.GetByIds({ ids: missingIds });\n if (response.success && response.result) {\n for (let item of response.result) {\n let resultTemp = new Aventus.ResultRamWithError();\n await this.addOrUpdateData(item, resultTemp);\n if (!resultTemp.success) {\n result.errors = [...result.errors, ...resultTemp.errors];\n }\n }\n }\n else {\n result.errors = [...result.errors, ...response.errors];\n }\n }\n }\n async otherCreateItem(item, params, uid) {\n if (uid && this.otherCreateItemLocked[uid])\n return;\n let resultTemp = new Aventus.ResultRamWithError();\n await this.addOrUpdateData(item, resultTemp);\n if (resultTemp.success && resultTemp.result) {\n this.publish('created', resultTemp.result);\n }\n }\n async beforeCreateItem(item, fromList, result) {\n if (fromList) {\n return;\n }\n let uid = Aventus.uuidv4();\n this.otherCreateItemLocked[uid] = true;\n let response = await this.routes.Create({ item }, { uid });\n delete this.otherCreateItemLocked[uid];\n if (response.success && response.result) {\n result.result = this.getObjectForRam(response.result);\n }\n else {\n result.errors = [...result.errors, ...response.errors];\n }\n }\n async otherCreateList(items, params, uid) {\n if (uid && this.otherCreateListLocked[uid])\n return;\n for (let item of items) {\n let resultTemp = new Aventus.ResultRamWithError();\n await this.addOrUpdateData(item, resultTemp);\n if (resultTemp.success && resultTemp.result) {\n this.publish('created', resultTemp.result);\n }\n }\n }\n async beforeCreateList(list, result) {\n let uid = Aventus.uuidv4();\n this.otherCreateListLocked[uid] = true;\n let response = await this.routes.CreateMany({ list }, { uid });\n delete this.otherCreateListLocked[uid];\n if (response.success && response.result) {\n result.result = [];\n for (let element of response.result) {\n result.result.push(this.getObjectForRam(element));\n }\n }\n else {\n result.errors = [...result.errors, ...response.errors];\n }\n }\n async otherUpdateItem(item, params, uid) {\n if (uid && this.otherUpdateItemLocked[uid])\n return;\n let resultTemp = new Aventus.ResultRamWithError();\n await this.addOrUpdateData(item, resultTemp);\n if (resultTemp.success && resultTemp.result) {\n this.publish('updated', resultTemp.result);\n }\n }\n async beforeUpdateItem(item, fromList, result) {\n if (fromList) {\n return;\n }\n let uid = Aventus.uuidv4();\n this.otherUpdateItemLocked[uid] = true;\n let response = await this.routes.Update(item.Id, { item }, { uid });\n delete this.otherUpdateItemLocked[uid];\n if (response.success && response.result) {\n result.result = this.getObjectForRam(response.result);\n }\n else {\n result.errors = [...result.errors, ...response.errors];\n }\n }\n async otherUpdateList(items, params, uid) {\n if (uid && this.otherUpdateListLocked[uid])\n return;\n for (let item of items) {\n let resultTemp = new Aventus.ResultRamWithError();\n await this.addOrUpdateData(item, resultTemp);\n if (resultTemp.success && resultTemp.result) {\n this.publish('updated', resultTemp.result);\n }\n }\n }\n async beforeUpdateList(list, result) {\n let uid = Aventus.uuidv4();\n this.otherUpdateListLocked[uid] = true;\n let response = await this.routes.UpdateMany({ list }, { uid });\n delete this.otherUpdateListLocked[uid];\n if (response.success && response.result) {\n result.result = [];\n for (let element of response.result) {\n result.result.push(this.getObjectForRam(element));\n }\n }\n else {\n result.errors = [...result.errors, ...response.errors];\n }\n }\n otherDeleteItem(item, params, uid) {\n if (uid && this.otherDeleteItemLocked[uid])\n return;\n let resultTemp = new Aventus.ResultRamWithError();\n this.deleteData(item, resultTemp);\n if (resultTemp.success && resultTemp.result) {\n this.publish('deleted', resultTemp.result);\n this.recordsSubscribers.delete(resultTemp.result.Id);\n }\n }\n async beforeDeleteItem(item, fromList, result) {\n if (fromList) {\n return;\n }\n let uid = Aventus.uuidv4();\n this.otherDeleteItemLocked[uid] = true;\n let response = await this.routes.Delete(item.Id, { uid });\n delete this.otherDeleteItemLocked[uid];\n if (!response.success) {\n result.errors = [...result.errors, ...response.errors];\n }\n }\n otherDeleteList(items, params, uid) {\n if (uid && this.otherDeleteListLocked[uid])\n return;\n for (let item of items) {\n let resultTemp = new Aventus.ResultRamWithError();\n this.deleteData(item, resultTemp);\n if (resultTemp.success && resultTemp.result) {\n this.publish('deleted', resultTemp.result);\n this.recordsSubscribers.delete(resultTemp.result.Id);\n }\n }\n }\n async beforeDeleteList(list, result) {\n let uid = Aventus.uuidv4();\n this.otherDeleteListLocked[uid] = true;\n let response = await this.routes.DeleteMany({ ids: list.map(t => t.Id) }, { uid });\n delete this.otherDeleteListLocked[uid];\n if (!response.success) {\n result.errors = [...result.errors, ...response.errors];\n }\n }\n /**\n * Delete element inside Ram without firing delete event\n */\n deleteData(item, result) {\n try {\n let idWithError = this.getIdWithError(item);\n if (idWithError.success && idWithError.result !== undefined) {\n let id = idWithError.result;\n if (this.records.has(id)) {\n result.result = this.records.get(id);\n this.records.delete(id);\n }\n else {\n result.errors.push(new Aventus.RamError(Aventus.RamErrorCode.noItemInsideRam, \"can't delete the item \" + id + \" because it wasn't found inside ram\"));\n }\n }\n else {\n result.errors = [...result.errors, ...idWithError.errors];\n }\n }\n catch (e) {\n result.errors.push(new Aventus.RamError(Aventus.RamErrorCode.unknow, e));\n }\n }\n}\nRAM.RamWebSocket.Namespace=`AventusSharp.RAM`;\r\n_.RAM.RamWebSocket=RAM.RamWebSocket;\r\n","dependances":[{"fullName":"Aventus.Ram","isStrong":true},{"fullName":"AventusSharp.Data.Storable","isStrong":false},{"fullName":"AventusSharp.WebSocket.StorableWsRoute","isStrong":false},{"fullName":"AventusSharp.RAM.RamWebSocketListenOnStart","isStrong":false},{"fullName":"BindThis","isStrong":false},{"fullName":"Aventus.ExtractFromError","isStrong":false},{"fullName":"Aventus.UriParams","isStrong":false},{"fullName":"Aventus.ResultRamWithError","isStrong":false},{"fullName":"Aventus.RamItem","isStrong":false},{"fullName":"Map","isStrong":false},{"fullName":"Promise","isStrong":false},{"fullName":"Aventus.uuidv4","isStrong":false},{"fullName":"Aventus.VoidWithError","isStrong":false},{"fullName":"Aventus.KeysObject","isStrong":false},{"fullName":"Aventus.RamError","isStrong":false},{"fullName":"Aventus.RamErrorCode","isStrong":false}],"fullName":"AventusSharp.RAM.RamWebSocket","required":false,"type":1,"isExported":true,"convertibleName":""}],"existing":[{"fullName":"AventusSharp.WebSocket.WsRouterOptions","dependances":[]},{"fullName":"AventusSharp.RAM.RamWebSocketListenOnStart","dependances":[]},{"fullName":"AventusSharp.WebSocket.WsRouteSendOptions","dependances":[]},{"fullName":"AventusSharp.WebSocket.SocketMessage","dependances":[]},{"fullName":"AventusSharp.WebSocket.SocketSendMessageOptions","dependances":[]},{"fullName":"AventusSharp.WebSocket.SocketRoute","dependances":[{"fullName":"Aventus.UriParamsValue","isStrong":false}]},{"fullName":"AventusSharp.Data.IStorableTimestamp","dependances":[{"fullName":"Aventus.IData","isStrong":true},{"fullName":"Date","isStrong":false}]},{"fullName":"AventusSharp.Tools.IWithError","dependances":[{"fullName":"Aventus.GenericError","isStrong":false}]},{"fullName":"AventusSharp.Tools.IResultWithError","dependances":[{"fullName":"AventusSharp.Tools.IWithError","isStrong":true},{"fullName":"Aventus.GenericError","isStrong":false}]},{"fullName":"AventusSharp.RealDate","dependances":[{"fullName":"Date","isStrong":false}]},{"fullName":"AventusSharp.WebSocket.InternalSocketRoute","dependances":[{"fullName":"AventusSharp.WebSocket.SocketRoute","isStrong":false},{"fullName":"Aventus.PreparedUri","isStrong":false}]},{"fullName":"AventusSharp.WebSocket.ConnectionOptions","dependances":[{"fullName":"AventusSharp.WebSocket.InternalSocketRoute","isStrong":false}]},{"fullName":"AventusSharp.WebSocket.WsEndPointType","dependances":[{"fullName":"AventusSharp.WebSocket.EndPoint","isStrong":false}]},{"fullName":"AventusSharp.WebSocket.WsEventType","dependances":[{"fullName":"AventusSharp.WebSocket.WsEvent","isStrong":false}]},{"fullName":"AventusSharp.WebSocket.ExtractResultFrom","dependances":[{"fullName":"AventusSharp.WebSocket.WsEvent","isStrong":false},{"fullName":"T","isStrong":false},{"fullName":"U","isStrong":false}]},{"fullName":"AventusSharp.ExtractResponse","dependances":[{"fullName":"AventusSharp.WebSocket.WsEvent","isStrong":false},{"fullName":"U","isStrong":false},{"fullName":"T","isStrong":false},{"fullName":"Aventus.ResultWithError","isStrong":false},{"fullName":"Aventus.ExtractFromError","isStrong":false}]},{"fullName":"AventusSharp.WebSocket.WsRouteType","dependances":[{"fullName":"AventusSharp.WebSocket.Route","isStrong":false}]}]}
790
+ {"namespace":"AventusSharp","available":[{"code":"Data.Storable=class Storable extends Aventus.Data {\n Id = 0;\n /**\n * @inerhit\n */\n toJSON() {\n let toAvoid = ['className', 'namespace'];\n return Aventus.Json.classToJson(this, {\n isValidKey: (key) => !toAvoid.includes(key),\n beforeEnd: (result) => {\n let resultTemp = {};\n if (result.$type) {\n resultTemp.$type = result.$type;\n for (let key in result) {\n if (key != '$type') {\n resultTemp[key] = result[key];\n }\n }\n return resultTemp;\n }\n return result;\n }\n });\n }\n}\nData.Storable.Namespace=`AventusSharp.Data`;\r\nData.Storable.$schema={...(Aventus.Data?.$schema ?? {}), \"Id\":\"number\"};\r\nAventus.Converter.register(Data.Storable.Fullname, Data.Storable);\r\n_.Data.Storable=Data.Storable;\r\n","dependances":[{"fullName":"Aventus.Data","isStrong":true},{"fullName":"Aventus.IData","isStrong":true},{"fullName":"Aventus.Json","isStrong":false}],"fullName":"AventusSharp.Data.Storable","required":false,"type":2,"isExported":true,"convertibleName":""},{"code":"Data.StorableTimestamp=class StorableTimestamp extends Data.Storable {\n CreatedDate = new Date();\n UpdatedDate = new Date();\n}\nData.StorableTimestamp.Namespace=`AventusSharp.Data`;\r\nData.StorableTimestamp.$schema={...(Data.Storable?.$schema ?? {}), \"CreatedDate\":\"Date\",\"UpdatedDate\":\"Date\"};\r\nAventus.Converter.register(Data.StorableTimestamp.Fullname, Data.StorableTimestamp);\r\n_.Data.StorableTimestamp=Data.StorableTimestamp;\r\n","dependances":[{"fullName":"AventusSharp.Data.Storable","isStrong":true},{"fullName":"Aventus.IData","isStrong":true}],"fullName":"AventusSharp.Data.StorableTimestamp","required":false,"type":2,"isExported":true,"convertibleName":""},{"code":"(function (WsErrorCode) {\n WsErrorCode[WsErrorCode[\"UnknowError\"] = 0] = \"UnknowError\";\n WsErrorCode[WsErrorCode[\"CantDefineAssembly\"] = 1] = \"CantDefineAssembly\";\n WsErrorCode[WsErrorCode[\"ConfigError\"] = 2] = \"ConfigError\";\n WsErrorCode[WsErrorCode[\"MultipleMainEndpoint\"] = 3] = \"MultipleMainEndpoint\";\n WsErrorCode[WsErrorCode[\"CantGetValueFromBody\"] = 4] = \"CantGetValueFromBody\";\n WsErrorCode[WsErrorCode[\"NoConnection\"] = 5] = \"NoConnection\";\n WsErrorCode[WsErrorCode[\"NoEndPoint\"] = 6] = \"NoEndPoint\";\n WsErrorCode[WsErrorCode[\"NoPath\"] = 7] = \"NoPath\";\n})(WebSocket.WsErrorCode || (WebSocket.WsErrorCode = {}));\n_.WebSocket.WsErrorCode=WebSocket.WsErrorCode;\r\n","dependances":[],"fullName":"AventusSharp.WebSocket.WsErrorCode","required":false,"type":6,"isExported":true,"convertibleName":""},{"code":"(function (SocketErrorCode) {\n SocketErrorCode[SocketErrorCode[\"socketClosed\"] = 0] = \"socketClosed\";\n SocketErrorCode[SocketErrorCode[\"timeout\"] = 1] = \"timeout\";\n SocketErrorCode[SocketErrorCode[\"differentChannel\"] = 2] = \"differentChannel\";\n SocketErrorCode[SocketErrorCode[\"unknow\"] = 3] = \"unknow\";\n})(WebSocket.SocketErrorCode || (WebSocket.SocketErrorCode = {}));\n_.WebSocket.SocketErrorCode=WebSocket.SocketErrorCode;\r\n","dependances":[],"fullName":"AventusSharp.WebSocket.SocketErrorCode","required":false,"type":6,"isExported":true,"convertibleName":""},{"code":"WebSocket.Socket=class Socket {\n static Debug = false;\n static connections = {};\n static getInstance(url, el) {\n if (!this.connections[url]) {\n this.connections[url] = new WebSocket.Socket(url, el);\n }\n else {\n this.connections[url].registerEl(el);\n }\n return this.connections[url];\n }\n socket;\n url;\n elements = [];\n reopenInterval = 0;\n onOpen = new Aventus.Callback();\n onClose = new Aventus.Callback();\n onError = new Aventus.Callback();\n onMessage = new Aventus.Callback();\n get readyState() {\n return this.socket.readyState;\n }\n constructor(url, el) {\n this.url = url;\n this.elements = [el];\n this.socket = this.createWebSocket();\n this.reopen = this.reopen.bind(this);\n this.onClose.add(this.reopen);\n }\n registerEl(el) {\n if (!this.elements.includes(el)) {\n this.elements.push(el);\n }\n }\n createWebSocket() {\n this.removeSocket();\n const socket = new window.WebSocket(this.url);\n socket.onopen = (e) => {\n clearInterval(this.reopenInterval);\n this.onOpen.trigger([e]);\n };\n socket.onclose = (e) => {\n this.onClose.trigger([e]);\n };\n socket.onerror = (e) => {\n this.onError.trigger([e]);\n };\n socket.onmessage = (e) => {\n this.onMessage.trigger([e]);\n };\n this.socket = socket;\n return socket;\n }\n removeSocket() {\n if (this.socket) {\n this.socket.onopen = null;\n this.socket.onclose = null;\n this.socket.onerror = null;\n this.socket.onmessage = null;\n this.socket.close();\n }\n }\n reopen() {\n clearInterval(this.reopenInterval);\n this.reopenInterval = setInterval(async () => {\n console.warn(\"try reopen socket \");\n await this.createWebSocket();\n if (this.isReady()) {\n clearInterval(this.reopenInterval);\n }\n }, 5000);\n }\n close(el, code, reason) {\n let index = this.elements.indexOf(el);\n if (index != -1) {\n this.elements.splice(0, 1);\n }\n if (this.elements.length == 0) {\n this.removeSocket();\n delete WebSocket.Socket.connections[this.url];\n }\n }\n send(data) {\n this.socket.send(data);\n }\n /**\n * Check if socket is ready\n */\n isReady() {\n return this.socket.readyState == 1;\n }\n}\nWebSocket.Socket.Namespace=`AventusSharp.WebSocket`;\r\n_.WebSocket.Socket=WebSocket.Socket;\r\n","dependances":[{"fullName":"AventusSharp.WebSocket.Socket","isStrong":false},{"fullName":"Aventus.Callback","isStrong":false}],"fullName":"AventusSharp.WebSocket.Socket","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"(function (RouteErrorCode) {\n RouteErrorCode[RouteErrorCode[\"UnknowError\"] = 0] = \"UnknowError\";\n RouteErrorCode[RouteErrorCode[\"FormContentTypeUnknown\"] = 1] = \"FormContentTypeUnknown\";\n RouteErrorCode[RouteErrorCode[\"CantGetValueFromBody\"] = 2] = \"CantGetValueFromBody\";\n RouteErrorCode[RouteErrorCode[\"CantMoveFile\"] = 3] = \"CantMoveFile\";\n RouteErrorCode[RouteErrorCode[\"CantCreateFolders\"] = 4] = \"CantCreateFolders\";\n RouteErrorCode[RouteErrorCode[\"RouteAlreadyExist\"] = 5] = \"RouteAlreadyExist\";\n})(Routes.RouteErrorCode || (Routes.RouteErrorCode = {}));\n_.Routes.RouteErrorCode=Routes.RouteErrorCode;\r\n","dependances":[],"fullName":"AventusSharp.Routes.RouteErrorCode","required":false,"type":6,"isExported":true,"convertibleName":""},{"code":"(function (DataErrorCode) {\n DataErrorCode[DataErrorCode[\"DefaultDMGenericType\"] = 0] = \"DefaultDMGenericType\";\n DataErrorCode[DataErrorCode[\"DMOnlyForceInherit\"] = 1] = \"DMOnlyForceInherit\";\n DataErrorCode[DataErrorCode[\"TypeNotStorable\"] = 2] = \"TypeNotStorable\";\n DataErrorCode[DataErrorCode[\"TypeTooMuchStorable\"] = 3] = \"TypeTooMuchStorable\";\n DataErrorCode[DataErrorCode[\"GenericNotAbstract\"] = 4] = \"GenericNotAbstract\";\n DataErrorCode[DataErrorCode[\"ParentNotAbstract\"] = 5] = \"ParentNotAbstract\";\n DataErrorCode[DataErrorCode[\"InfiniteLoop\"] = 6] = \"InfiniteLoop\";\n DataErrorCode[DataErrorCode[\"InterfaceNotUnique\"] = 7] = \"InterfaceNotUnique\";\n DataErrorCode[DataErrorCode[\"SelfReferecingDependance\"] = 8] = \"SelfReferecingDependance\";\n DataErrorCode[DataErrorCode[\"DMNotExist\"] = 9] = \"DMNotExist\";\n DataErrorCode[DataErrorCode[\"DMAlreadyExist\"] = 10] = \"DMAlreadyExist\";\n DataErrorCode[DataErrorCode[\"MethodNotFound\"] = 11] = \"MethodNotFound\";\n DataErrorCode[DataErrorCode[\"StorageDisconnected\"] = 12] = \"StorageDisconnected\";\n DataErrorCode[DataErrorCode[\"StorageNotFound\"] = 13] = \"StorageNotFound\";\n DataErrorCode[DataErrorCode[\"NoConnectionInsideStorage\"] = 14] = \"NoConnectionInsideStorage\";\n DataErrorCode[DataErrorCode[\"TypeNotExistInsideStorage\"] = 15] = \"TypeNotExistInsideStorage\";\n DataErrorCode[DataErrorCode[\"UnknowError\"] = 16] = \"UnknowError\";\n DataErrorCode[DataErrorCode[\"NoItemProvided\"] = 17] = \"NoItemProvided\";\n DataErrorCode[DataErrorCode[\"NoTransactionInProgress\"] = 18] = \"NoTransactionInProgress\";\n DataErrorCode[DataErrorCode[\"WrongType\"] = 19] = \"WrongType\";\n DataErrorCode[DataErrorCode[\"NoTypeIdentifierFoundInsideQuery\"] = 20] = \"NoTypeIdentifierFoundInsideQuery\";\n DataErrorCode[DataErrorCode[\"ItemNoExistInsideStorage\"] = 21] = \"ItemNoExistInsideStorage\";\n DataErrorCode[DataErrorCode[\"ItemAlreadyExist\"] = 22] = \"ItemAlreadyExist\";\n DataErrorCode[DataErrorCode[\"ValidationError\"] = 23] = \"ValidationError\";\n DataErrorCode[DataErrorCode[\"GetAllNotAllowed\"] = 24] = \"GetAllNotAllowed\";\n DataErrorCode[DataErrorCode[\"GetByIdNotAllowed\"] = 25] = \"GetByIdNotAllowed\";\n DataErrorCode[DataErrorCode[\"GetByIdsNotAllowed\"] = 26] = \"GetByIdsNotAllowed\";\n DataErrorCode[DataErrorCode[\"WhereNotAllowed\"] = 27] = \"WhereNotAllowed\";\n DataErrorCode[DataErrorCode[\"CreateNotAllowed\"] = 28] = \"CreateNotAllowed\";\n DataErrorCode[DataErrorCode[\"UpdateNotAllowed\"] = 29] = \"UpdateNotAllowed\";\n DataErrorCode[DataErrorCode[\"DeleteNotAllowed\"] = 30] = \"DeleteNotAllowed\";\n DataErrorCode[DataErrorCode[\"NumberOfItemsNotMatching\"] = 31] = \"NumberOfItemsNotMatching\";\n DataErrorCode[DataErrorCode[\"FieldTypeNotFound\"] = 32] = \"FieldTypeNotFound\";\n DataErrorCode[DataErrorCode[\"MemberNotFound\"] = 33] = \"MemberNotFound\";\n DataErrorCode[DataErrorCode[\"TooMuchMemberFound\"] = 34] = \"TooMuchMemberFound\";\n DataErrorCode[DataErrorCode[\"TypeNotFound\"] = 35] = \"TypeNotFound\";\n DataErrorCode[DataErrorCode[\"ReverseLinkNotExist\"] = 36] = \"ReverseLinkNotExist\";\n DataErrorCode[DataErrorCode[\"ErrorCreatingReverseQuery\"] = 37] = \"ErrorCreatingReverseQuery\";\n DataErrorCode[DataErrorCode[\"LinkNotSet\"] = 38] = \"LinkNotSet\";\n})(Data.DataErrorCode || (Data.DataErrorCode = {}));\n_.Data.DataErrorCode=Data.DataErrorCode;\r\n","dependances":[],"fullName":"AventusSharp.Data.DataErrorCode","required":false,"type":6,"isExported":true,"convertibleName":""},{"code":"Data.SharpClass=class SharpClass {\n /**\n * The current namespace\n */\n get namespace() {\n return this.constructor['Namespace'];\n }\n /**\n * Get the unique type for the data. Define it as the namespace + class name\n */\n get $type() {\n return this.constructor['Fullname'];\n }\n /**\n * Get the name of the class\n */\n get className() {\n return this.constructor.name;\n }\n /**\n * Clone the object by transforming a parsed JSON string back into the original type\n */\n clone() {\n return Aventus.Converter.transform(JSON.parse(JSON.stringify(this)));\n }\n /**\n * Get a JSON for the current object\n */\n toJSON() {\n let toAvoid = ['className', 'namespace'];\n return Aventus.Json.classToJson(this, {\n isValidKey: (key) => !toAvoid.includes(key),\n beforeEnd: (result) => {\n let resultTemp = {};\n if (result.$type) {\n resultTemp.$type = result.$type;\n for (let key in result) {\n if (key != '$type') {\n resultTemp[key] = result[key];\n }\n }\n return resultTemp;\n }\n return result;\n }\n });\n }\n}\nData.SharpClass.Namespace=`AventusSharp.Data`;\r\n_.Data.SharpClass=Data.SharpClass;\r\n","dependances":[{"fullName":"Aventus.Converter","isStrong":false},{"fullName":"Aventus.Json","isStrong":false}],"fullName":"AventusSharp.Data.SharpClass","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"Data.FieldErrorInfo=class FieldErrorInfo extends Data.SharpClass {\n static get Fullname() { return \"AventusSharp.Data.FieldErrorInfo, AventusSharp\"; }\n Name;\n}\nData.FieldErrorInfo.Namespace=`AventusSharp.Data`;\r\nData.FieldErrorInfo.$schema={...(Data.SharpClass?.$schema ?? {}), \"Name\":\"string\"};\r\nAventus.Converter.register(Data.FieldErrorInfo.Fullname, Data.FieldErrorInfo);\r\n_.Data.FieldErrorInfo=Data.FieldErrorInfo;\r\n","dependances":[{"fullName":"AventusSharp.Data.SharpClass","isStrong":true},{"fullName":"Convertible","isStrong":false}],"fullName":"AventusSharp.Data.FieldErrorInfo","required":false,"type":1,"isExported":true,"convertibleName":"Fullname"},{"code":"Data.AventusFile=class AventusFile {\n static get Fullname() { return \"AventusSharp.Data.AventusFile, AventusSharp\"; }\n Uri;\n Upload;\n /**\n * Get the unique type for the data. Define it as the namespace + class name\n */\n get $type() {\n return this.constructor['Fullname'];\n }\n /**\n * @inerhit\n */\n toJSON() {\n let toAvoid = ['className', 'namespace'];\n return Aventus.Json.classToJson(this, {\n isValidKey: (key) => !toAvoid.includes(key),\n beforeEnd: (result) => {\n let resultTemp = {};\n if (result.$type) {\n resultTemp.$type = result.$type;\n for (let key in result) {\n if (key != '$type') {\n resultTemp[key] = result[key];\n }\n }\n return resultTemp;\n }\n return result;\n }\n });\n }\n}\nData.AventusFile.Namespace=`AventusSharp.Data`;\r\nData.AventusFile.$schema={\"Uri\":\"string\",\"Upload\":\"File\",\"$type\":\"string\"};\r\nAventus.Converter.register(Data.AventusFile.Fullname, Data.AventusFile);\r\n_.Data.AventusFile=Data.AventusFile;\r\n","dependances":[{"fullName":"Convertible","isStrong":false},{"fullName":"Uri","isStrong":false},{"fullName":"Aventus.Json","isStrong":false}],"fullName":"AventusSharp.Data.AventusFile","required":false,"type":1,"isExported":true,"convertibleName":"Fullname"},{"code":"Data.Datetime=class Datetime extends Data.SharpClass {\n static get Fullname() { return \"AventusSharp.Data.Datetime, AventusSharp\"; }\n DateTime;\n}\nData.Datetime.Namespace=`AventusSharp.Data`;\r\nData.Datetime.$schema={...(Data.SharpClass?.$schema ?? {}), \"DateTime\":\"AventusSharp.RealDate\"};\r\nAventus.Converter.register(Data.Datetime.Fullname, Data.Datetime);\r\n_.Data.Datetime=Data.Datetime;\r\n","dependances":[{"fullName":"AventusSharp.Data.SharpClass","isStrong":true},{"fullName":"Convertible","isStrong":false},{"fullName":"AventusSharp.RealDate","isStrong":false}],"fullName":"AventusSharp.Data.Datetime","required":false,"type":1,"isExported":true,"convertibleName":"Fullname"},{"code":"Data.Date=class Date extends Data.SharpClass {\n static get Fullname() { return \"AventusSharp.Data.Date, AventusSharp\"; }\n DateTime;\n}\nData.Date.Namespace=`AventusSharp.Data`;\r\nData.Date.$schema={...(Data.SharpClass?.$schema ?? {}), \"DateTime\":\"AventusSharp.RealDate\"};\r\nAventus.Converter.register(Data.Date.Fullname, Data.Date);\r\n_.Data.Date=Data.Date;\r\n","dependances":[{"fullName":"AventusSharp.Data.SharpClass","isStrong":true},{"fullName":"Convertible","isStrong":false},{"fullName":"AventusSharp.RealDate","isStrong":false}],"fullName":"AventusSharp.Data.Date","required":false,"type":1,"isExported":true,"convertibleName":"Fullname"},{"code":"Data.DataError=class DataError extends Aventus.GenericError {\n static get Fullname() { return \"AventusSharp.Data.DataError, AventusSharp\"; }\n}\nData.DataError.Namespace=`AventusSharp.Data`;\r\nData.DataError.$schema={...(Aventus.GenericError?.$schema ?? {}), };\r\nAventus.Converter.register(Data.DataError.Fullname, Data.DataError);\r\n_.Data.DataError=Data.DataError;\r\n","dependances":[{"fullName":"Aventus.GenericError","isStrong":true},{"fullName":"AventusSharp.Data.DataErrorCode","isStrong":true},{"fullName":"Convertible","isStrong":false}],"fullName":"AventusSharp.Data.DataError","required":false,"type":1,"isExported":true,"convertibleName":"Fullname"},{"code":"Tools.VoidWithError=class VoidWithError extends Aventus.VoidWithError {\n static get Fullname() { return \"AventusSharp.Tools.VoidWithError, AventusSharp\"; }\n}\nTools.VoidWithError.Namespace=`AventusSharp.Tools`;\r\nTools.VoidWithError.$schema={...(Aventus.VoidWithError?.$schema ?? {}), };\r\nAventus.Converter.register(Tools.VoidWithError.Fullname, Tools.VoidWithError);\r\n_.Tools.VoidWithError=Tools.VoidWithError;\r\n","dependances":[{"fullName":"Aventus.VoidWithError","isStrong":true},{"fullName":"AventusSharp.Tools.IWithError","isStrong":true},{"fullName":"Convertible","isStrong":false},{"fullName":"Aventus.GenericError","isStrong":false}],"fullName":"AventusSharp.Tools.VoidWithError","required":false,"type":1,"isExported":true,"convertibleName":"Fullname"},{"code":"Data.VoidWithDataError=class VoidWithDataError extends Tools.VoidWithError {\n static get Fullname() { return \"AventusSharp.Data.VoidWithDataError, AventusSharp\"; }\n}\nData.VoidWithDataError.Namespace=`AventusSharp.Data`;\r\nData.VoidWithDataError.$schema={...(Tools.VoidWithError?.$schema ?? {}), };\r\nAventus.Converter.register(Data.VoidWithDataError.Fullname, Data.VoidWithDataError);\r\n_.Data.VoidWithDataError=Data.VoidWithDataError;\r\n","dependances":[{"fullName":"AventusSharp.Tools.VoidWithError","isStrong":true},{"fullName":"AventusSharp.Data.DataError","isStrong":false},{"fullName":"Convertible","isStrong":false}],"fullName":"AventusSharp.Data.VoidWithDataError","required":false,"type":1,"isExported":true,"convertibleName":"Fullname"},{"code":"Tools.ResultWithError=class ResultWithError extends Aventus.ResultWithError {\n static get Fullname() { return \"AventusSharp.Tools.ResultWithError, AventusSharp\"; }\n}\nTools.ResultWithError.Namespace=`AventusSharp.Tools`;\r\nTools.ResultWithError.$schema={...(Aventus.ResultWithError?.$schema ?? {}), };\r\nAventus.Converter.register(Tools.ResultWithError.Fullname, Tools.ResultWithError);\r\n_.Tools.ResultWithError=Tools.ResultWithError;\r\n","dependances":[{"fullName":"Aventus.ResultWithError","isStrong":true},{"fullName":"AventusSharp.Tools.IResultWithError","isStrong":true},{"fullName":"Convertible","isStrong":false},{"fullName":"Aventus.GenericError","isStrong":false}],"fullName":"AventusSharp.Tools.ResultWithError","required":false,"type":1,"isExported":true,"convertibleName":"Fullname"},{"code":"Routes.StorableRouter=class StorableRouter extends Aventus.HttpRoute {\n constructor() {\n super();\n this.GetAll = this.GetAll.bind(this);\n this.Create = this.Create.bind(this);\n this.CreateMany = this.CreateMany.bind(this);\n this.GetById = this.GetById.bind(this);\n this.GetByIds = this.GetByIds.bind(this);\n this.Update = this.Update.bind(this);\n this.UpdateMany = this.UpdateMany.bind(this);\n this.Delete = this.Delete.bind(this);\n this.DeleteMany = this.DeleteMany.bind(this);\n }\n async GetAll() {\n const request = new Aventus.HttpRequest(`${this.getPrefix()}/${this.StorableName()}`, Aventus.HttpMethod.GET);\n return await request.queryJSON(this.router);\n }\n async Create(body) {\n const request = new Aventus.HttpRequest(`${this.getPrefix()}/${this.StorableName()}`, Aventus.HttpMethod.POST);\n request.setBody(body);\n return await request.queryJSON(this.router);\n }\n async CreateMany(body) {\n const request = new Aventus.HttpRequest(`${this.getPrefix()}/${this.StorableName()}s`, Aventus.HttpMethod.POST);\n request.setBody(body);\n return await request.queryJSON(this.router);\n }\n async GetById(id) {\n const request = new Aventus.HttpRequest(`${this.getPrefix()}/${this.StorableName()}/${id}`, Aventus.HttpMethod.GET);\n return await request.queryJSON(this.router);\n }\n async GetByIds(body) {\n const request = new Aventus.HttpRequest(`${this.getPrefix()}/${this.StorableName()}/getbyids`, Aventus.HttpMethod.POST);\n request.setBody(body);\n return await request.queryJSON(this.router);\n }\n async Update(id, body) {\n const request = new Aventus.HttpRequest(`${this.getPrefix()}/${this.StorableName()}/${id}`, Aventus.HttpMethod.PUT);\n request.setBody(body);\n return await request.queryJSON(this.router);\n }\n async UpdateMany(body) {\n const request = new Aventus.HttpRequest(`${this.getPrefix()}/${this.StorableName()}s`, Aventus.HttpMethod.PUT);\n request.setBody(body);\n return await request.queryJSON(this.router);\n }\n async Delete(id) {\n const request = new Aventus.HttpRequest(`${this.getPrefix()}/${this.StorableName()}/${id}`, Aventus.HttpMethod.DELETE);\n return await request.queryJSON(this.router);\n }\n async DeleteMany(body) {\n const request = new Aventus.HttpRequest(`${this.getPrefix()}/${this.StorableName()}s`, Aventus.HttpMethod.DELETE);\n request.setBody(body);\n return await request.queryJSON(this.router);\n }\n}\nRoutes.StorableRouter.Namespace=`AventusSharp.Routes`;\r\n_.Routes.StorableRouter=Routes.StorableRouter;\r\n","dependances":[{"fullName":"Aventus.HttpRoute","isStrong":true},{"fullName":"Debugger","isStrong":false},{"fullName":"Aventus.IData","isStrong":false},{"fullName":"BindThis","isStrong":false},{"fullName":"AventusSharp.Tools.ResultWithError","isStrong":false},{"fullName":"Aventus.HttpRequest","isStrong":false},{"fullName":"Aventus.HttpMethod","isStrong":false},{"fullName":"TypeResult","isStrong":false}],"fullName":"AventusSharp.Routes.StorableRouter","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"Data.ResultWithDataError=class ResultWithDataError extends Tools.ResultWithError {\n static get Fullname() { return \"AventusSharp.Data.ResultWithDataError, AventusSharp\"; }\n}\nData.ResultWithDataError.Namespace=`AventusSharp.Data`;\r\nData.ResultWithDataError.$schema={...(Tools.ResultWithError?.$schema ?? {}), };\r\nAventus.Converter.register(Data.ResultWithDataError.Fullname, Data.ResultWithDataError);\r\n_.Data.ResultWithDataError=Data.ResultWithDataError;\r\n","dependances":[{"fullName":"AventusSharp.Tools.ResultWithError","isStrong":true},{"fullName":"AventusSharp.Data.DataError","isStrong":false},{"fullName":"Convertible","isStrong":false}],"fullName":"AventusSharp.Data.ResultWithDataError","required":false,"type":1,"isExported":true,"convertibleName":"Fullname"},{"code":"Routes.RouteError=class RouteError extends Aventus.GenericError {\n static get Fullname() { return \"AventusSharp.Routes.RouteError, AventusSharp\"; }\n}\nRoutes.RouteError.Namespace=`AventusSharp.Routes`;\r\nRoutes.RouteError.$schema={...(Aventus.GenericError?.$schema ?? {}), };\r\nAventus.Converter.register(Routes.RouteError.Fullname, Routes.RouteError);\r\n_.Routes.RouteError=Routes.RouteError;\r\n","dependances":[{"fullName":"Aventus.GenericError","isStrong":true},{"fullName":"AventusSharp.Routes.RouteErrorCode","isStrong":true},{"fullName":"Convertible","isStrong":false}],"fullName":"AventusSharp.Routes.RouteError","required":false,"type":1,"isExported":true,"convertibleName":"Fullname"},{"code":"Routes.ResultWithRouteError=class ResultWithRouteError extends Tools.ResultWithError {\n static get Fullname() { return \"AventusSharp.Routes.ResultWithRouteError, AventusSharp\"; }\n}\nRoutes.ResultWithRouteError.Namespace=`AventusSharp.Routes`;\r\nRoutes.ResultWithRouteError.$schema={...(Tools.ResultWithError?.$schema ?? {}), };\r\nAventus.Converter.register(Routes.ResultWithRouteError.Fullname, Routes.ResultWithRouteError);\r\n_.Routes.ResultWithRouteError=Routes.ResultWithRouteError;\r\n","dependances":[{"fullName":"AventusSharp.Tools.ResultWithError","isStrong":true},{"fullName":"AventusSharp.Routes.RouteError","isStrong":false},{"fullName":"Convertible","isStrong":false}],"fullName":"AventusSharp.Routes.ResultWithRouteError","required":false,"type":1,"isExported":true,"convertibleName":"Fullname"},{"code":"Routes.VoidWithRouteError=class VoidWithRouteError extends Tools.VoidWithError {\n static get Fullname() { return \"AventusSharp.Routes.VoidWithRouteError, AventusSharp\"; }\n}\nRoutes.VoidWithRouteError.Namespace=`AventusSharp.Routes`;\r\nRoutes.VoidWithRouteError.$schema={...(Tools.VoidWithError?.$schema ?? {}), };\r\nAventus.Converter.register(Routes.VoidWithRouteError.Fullname, Routes.VoidWithRouteError);\r\n_.Routes.VoidWithRouteError=Routes.VoidWithRouteError;\r\n","dependances":[{"fullName":"AventusSharp.Tools.VoidWithError","isStrong":true},{"fullName":"AventusSharp.Routes.RouteError","isStrong":false},{"fullName":"Convertible","isStrong":false}],"fullName":"AventusSharp.Routes.VoidWithRouteError","required":false,"type":1,"isExported":true,"convertibleName":"Fullname"},{"code":"WebSocket.SocketError=class SocketError extends Aventus.GenericError {\n}\nWebSocket.SocketError.Namespace=`AventusSharp.WebSocket`;\r\n_.WebSocket.SocketError=WebSocket.SocketError;\r\n","dependances":[{"fullName":"Aventus.GenericError","isStrong":true},{"fullName":"AventusSharp.WebSocket.SocketErrorCode","isStrong":false}],"fullName":"AventusSharp.WebSocket.SocketError","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"WebSocket.Connection=class Connection {\n static Debug = false;\n options;\n waitingList = {};\n memoryBeforeOpen = [];\n socket;\n actionGuard = new Aventus.ActionGuard();\n /**\n * Create a singleton\n */\n static getInstance() {\n return Aventus.Instance.get(WebSocket.Connection);\n }\n constructor() {\n this.options = this._configure(this.configure({}));\n this._onOpen = this._onOpen.bind(this);\n this._onClose = this._onClose.bind(this);\n this._onError = this._onError.bind(this);\n this.onMessage = this.onMessage.bind(this);\n if (this.options.autoStart) {\n this.open();\n }\n }\n onOpen = new Aventus.Callback();\n onClose = new Aventus.Callback();\n onError = new Aventus.Callback();\n /**\n * Configure a new Websocket\n */\n _configure(options = {}) {\n if (!options.host) {\n options.host = window.location.hostname;\n }\n if (!options.hasOwnProperty('useHttps')) {\n options.useHttps = window.location.protocol == \"https:\";\n }\n if (!options.port) {\n if (window.location.port) {\n options.port = parseInt(window.location.port);\n }\n else {\n options.port = options.useHttps ? 443 : 80;\n }\n }\n if (!options.routes) {\n options.routes = {};\n }\n if (!options.socketName) {\n options.socketName = \"\";\n }\n if (options.log === undefined) {\n options.log = WebSocket.Connection.Debug;\n }\n if (options.autoStart === undefined) {\n options.autoStart = true;\n }\n if (options.sendPing !== undefined && options.sendPing <= 0) {\n options.sendPing = undefined;\n }\n if (options.logPrefix === undefined) {\n options.logPrefix = \"\";\n }\n return options;\n }\n getUrl() {\n let protocol = \"ws\";\n if (this.options.useHttps) {\n protocol = \"wss\";\n }\n let url = protocol + \"://\" + this.options.host + \":\" + this.options.port + this.options.socketName;\n return url;\n }\n /**\n * Add a new route to listen to the websocket\n */\n addRoute(newRoute) {\n if (!this.options.routes.hasOwnProperty(newRoute.channel)) {\n this.options.routes[newRoute.channel] = [];\n }\n for (let info of this.options.routes[newRoute.channel]) {\n if (info.callback == newRoute.callback) {\n return;\n }\n }\n const { params, regex } = Aventus.Uri.prepare(newRoute.channel);\n let prepared = {\n callback: newRoute.callback,\n channel: newRoute.channel,\n regex,\n params\n };\n this.options.routes[newRoute.channel].push(prepared);\n }\n /**\n * The route to remove\n * @param route - The route to remove\n */\n removeRoute(route) {\n for (let i = 0; i < this.options.routes[route.channel].length; i++) {\n let info = this.options.routes[route.channel][i];\n if (info.callback == route.callback) {\n this.options.routes[route.channel].splice(i, 1);\n i--;\n }\n }\n }\n openCallback;\n /**\n * Try to open the websocket\n */\n open() {\n return this.actionGuard.run([\"open\"], () => {\n return new Promise((resolve) => {\n try {\n let url = this.getUrl();\n this.log(\"Opening \" + url);\n this.openCallback = (isOpen) => {\n resolve(isOpen);\n };\n this.socket = WebSocket.Socket.getInstance(url, this);\n this.socket.onOpen.add(this._onOpen);\n this.socket.onClose.add(this._onClose);\n this.socket.onError.add(this._onError);\n this.socket.onMessage.add(this.onMessage);\n if (this.socket.isReady()) {\n this._onOpen();\n }\n }\n catch (e) {\n console.log(e);\n resolve(false);\n }\n });\n });\n }\n jsonReplacer(key, value) {\n if (this[key] instanceof Date) {\n return Aventus.DateConverter.converter.toString(this[key]);\n }\n return value;\n }\n /**\n * Send a message though the websocket\n * @param channelName The channel on which the message is sent\n * @param data The data to send\n * @param options the options to add to the message (typically the uid)\n */\n async sendMessage(options) {\n let result = new Tools.VoidWithError();\n if (!this.socket || this.socket.readyState != 1) {\n let isOpen = await this.open();\n if (!isOpen) {\n result.errors.push(new WebSocket.SocketError(WebSocket.SocketErrorCode.socketClosed, \"Socket not ready ! Please ensure that it is open and ready to send message\"));\n this.log('Socket not ready ! Please ensure that it is open and ready to send message');\n if (this.options.allowSendBeforeOpen) {\n this.memoryBeforeOpen.push(options);\n }\n return result;\n }\n }\n if (this.socket && this.socket.readyState == 1) {\n try {\n let message = {\n channel: options.channel,\n };\n if (options.uid) {\n message.uid = options.uid;\n }\n if (options.body) {\n message.data = options.body;\n this.log(message);\n if (typeof options.body != 'string') {\n message.data = JSON.stringify(options.body, this.jsonReplacer);\n }\n }\n else if (options.channel != \"/ping\") {\n this.log(message);\n }\n this.socket.send(JSON.stringify(message));\n }\n catch (e) {\n result.errors.push(new WebSocket.SocketError(WebSocket.SocketErrorCode.unknow, e));\n }\n }\n else {\n result.errors.push(new WebSocket.SocketError(WebSocket.SocketErrorCode.socketClosed, \"Socket not ready ! Please ensure that it is open and ready to send message\"));\n this.log('Socket not ready ! Please ensure that it is open and ready to send message');\n if (this.options.allowSendBeforeOpen) {\n this.memoryBeforeOpen.push(options);\n }\n }\n return result;\n }\n /**\n * Send a message though the websocket and wait one answer give in parameters callbacks\n * @param channelName The channel on which the message is sent\n * @param body The data to send\n * @param timeout The timeout before the request failed\n */\n sendMessageAndWait(options) {\n return new Promise(async (resolve) => {\n let result = new Aventus.ResultWithError();\n try {\n let _uid = options.uid ? options.uid : Aventus.uuidv4();\n options.uid = _uid;\n let timeoutInfo;\n this.waitingList[_uid] = (channel, data) => {\n clearTimeout(timeoutInfo);\n if (channel.toLowerCase() != options.channel.toLowerCase()) {\n result.errors.push(new WebSocket.SocketError(WebSocket.SocketErrorCode.differentChannel, `We sent a message on ${options.channel} but we receive on ${channel}`));\n resolve(result);\n }\n else {\n if (data instanceof Aventus.VoidWithError) {\n for (let error of data.errors) {\n result.errors.push(error);\n }\n if (data instanceof Aventus.ResultWithError) {\n result.result = data.result;\n }\n }\n else {\n result.result = data;\n }\n resolve(result);\n }\n };\n if (options.timeout !== undefined) {\n timeoutInfo = setTimeout(() => {\n delete this.waitingList[_uid];\n result.errors.push(new WebSocket.SocketError(WebSocket.SocketErrorCode.timeout, \"No message received after \" + options.timeout + \"ms\"));\n resolve(result);\n }, options.timeout);\n }\n let sendMessageResult = await this.sendMessage(options);\n if (!sendMessageResult.success) {\n for (let error of sendMessageResult.errors) {\n result.errors.push(error);\n }\n resolve(result);\n }\n }\n catch (e) {\n result.errors.push(new WebSocket.SocketError(WebSocket.SocketErrorCode.unknow, e));\n resolve(result);\n }\n });\n }\n ;\n /**\n * Check if socket is ready\n */\n isReady() {\n if (this.socket && this.socket.isReady()) {\n return true;\n }\n return false;\n }\n sendPingTimeout = 0;\n sendPing() {\n this.sendMessage({\n channel: \"/ping\",\n });\n }\n startPing() {\n clearInterval(this.sendPingTimeout);\n this.sendPingTimeout = setInterval(() => {\n this.sendPing();\n }, 5000);\n }\n stopPing() {\n clearInterval(this.sendPingTimeout);\n }\n _onOpen() {\n if (this.socket?.isReady()) {\n if (this.openCallback) {\n this.openCallback(true);\n this.openCallback = undefined;\n }\n let protocol = \"ws\";\n if (this.options.useHttps) {\n protocol = \"wss\";\n }\n this.log(`Connection successfully established to ${this.getUrl()}!`);\n this.onOpen.trigger([]);\n for (let i = 0; i < this.memoryBeforeOpen.length; i++) {\n this.sendMessage(this.memoryBeforeOpen[i]);\n }\n this.memoryBeforeOpen = [];\n if (this.options.sendPing) {\n this.startPing();\n }\n }\n else {\n if (this.openCallback) {\n this.openCallback(false);\n this.openCallback = undefined;\n }\n }\n }\n errorOccur = false;\n _onError(event) {\n this.errorOccur = true;\n if (this.openCallback) {\n this.openCallback(false);\n this.openCallback = undefined;\n return;\n }\n this.log('An error has occured');\n this.onError.trigger([event]);\n }\n _onClose(event) {\n this.stopPing();\n if (this.errorOccur) {\n this.errorOccur = false;\n return;\n }\n this.log('Closing connection');\n this.onClose.trigger([event]);\n }\n /**\n * Close the current connection\n */\n close() {\n if (this.socket) {\n this.socket.onOpen.remove(this._onOpen);\n this.socket.onClose.remove(this._onClose);\n this.socket.onError.remove(this._onError);\n this.socket.onMessage.remove(this.onMessage);\n this.socket.close(this);\n delete this.socket;\n }\n }\n onMessage(event) {\n let response = JSON.parse(event.data);\n this.log(response);\n let data = {};\n try {\n data = Aventus.Converter.transform(JSON.parse(response.data));\n }\n catch (e) {\n console.error(e);\n }\n for (let channel in this.options.routes) {\n let current = this.options.routes[channel];\n for (let info of current) {\n let params = Aventus.Uri.getParams(info, response.channel);\n if (params) {\n let valueCb = data;\n if (data instanceof Aventus.ResultWithError) {\n valueCb = data.result;\n }\n else if (data instanceof Aventus.VoidWithError) {\n valueCb = undefined;\n }\n info.callback(valueCb, params, response.uid);\n }\n }\n }\n if (response.uid) {\n if (this.waitingList.hasOwnProperty(response.uid)) {\n this.waitingList[response.uid](response.channel, data);\n delete this.waitingList[response.uid];\n }\n }\n }\n /**\n * Print a msg inside the console\n */\n log(message) {\n if (this.options.log) {\n const now = new Date();\n const hours = (now.getHours()).toLocaleString(undefined, { minimumIntegerDigits: 2 });\n const minutes = (now.getMinutes()).toLocaleString(undefined, { minimumIntegerDigits: 2 });\n const seconds = (now.getSeconds()).toLocaleString(undefined, { minimumIntegerDigits: 2 });\n const prefix = this.options.logPrefix ? `[${this.options.logPrefix}] ` : '';\n if (message instanceof Object) {\n let cloneMessage = JSON.parse(JSON.stringify(message, this.jsonReplacer));\n if (cloneMessage.data && typeof cloneMessage.data == 'string') {\n cloneMessage.data = JSON.parse(cloneMessage.data);\n }\n console.log(`${prefix}[${hours}:${minutes}:${seconds}]: `, cloneMessage);\n }\n else {\n console.log(`${prefix}[${hours}:${minutes}:${seconds}]: `, message);\n }\n }\n }\n}\nWebSocket.Connection.Namespace=`AventusSharp.WebSocket`;\r\n_.WebSocket.Connection=WebSocket.Connection;\r\n","dependances":[{"fullName":"AventusSharp.WebSocket.ConnectionOptions","isStrong":false},{"fullName":"AventusSharp.WebSocket.SocketSendMessageOptions","isStrong":false},{"fullName":"AventusSharp.WebSocket.Socket","isStrong":false},{"fullName":"Aventus.ActionGuard","isStrong":false},{"fullName":"AventusSharp.WebSocket.Connection","isStrong":false},{"fullName":"Aventus.Instance","isStrong":false},{"fullName":"Aventus.Callback","isStrong":false},{"fullName":"AventusSharp.WebSocket.SocketRoute","isStrong":false},{"fullName":"Aventus.Uri","isStrong":false},{"fullName":"AventusSharp.WebSocket.InternalSocketRoute","isStrong":false},{"fullName":"Aventus.DateConverter","isStrong":false},{"fullName":"Aventus.VoidWithError","isStrong":false},{"fullName":"AventusSharp.Tools.VoidWithError","isStrong":false},{"fullName":"AventusSharp.WebSocket.SocketError","isStrong":false},{"fullName":"AventusSharp.WebSocket.SocketErrorCode","isStrong":false},{"fullName":"AventusSharp.WebSocket.SocketMessage","isStrong":false},{"fullName":"Aventus.ResultWithError","isStrong":false},{"fullName":"Aventus.ExtractFromError","isStrong":false},{"fullName":"T","isStrong":false},{"fullName":"Aventus.uuidv4","isStrong":false},{"fullName":"Aventus.Converter","isStrong":false}],"fullName":"AventusSharp.WebSocket.Connection","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"WebSocket.EndPoint=class EndPoint extends WebSocket.Connection {\n /**\n * Create a singleton\n */\n static getInstance() {\n return Aventus.Instance.get(WebSocket.EndPoint);\n }\n constructor() {\n super();\n this.register();\n }\n register() {\n }\n /**\n * @inheritdoc\n */\n configure(options) {\n options.socketName = this.path;\n options.sendPing = 5000;\n return options;\n }\n get path() {\n return \"/ws\";\n }\n ;\n}\nWebSocket.EndPoint.Namespace=`AventusSharp.WebSocket`;\r\n_.WebSocket.EndPoint=WebSocket.EndPoint;\r\n","dependances":[{"fullName":"AventusSharp.WebSocket.Connection","isStrong":true},{"fullName":"AventusSharp.WebSocket.EndPoint","isStrong":false},{"fullName":"Aventus.Instance","isStrong":false},{"fullName":"AventusSharp.WebSocket.ConnectionOptions","isStrong":false}],"fullName":"AventusSharp.WebSocket.EndPoint","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"WebSocket.WsEvent=class WsEvent {\n endpoint;\n onTrigger = new Aventus.Callback();\n routeInfo;\n _listening = false;\n get listening() {\n return this._listening;\n }\n getPrefix;\n constructor(endpoint, getPrefix) {\n this.endpoint = endpoint ?? WebSocket.EndPoint.getInstance();\n this.getPrefix = getPrefix ?? (() => \"\");\n this.onEvent = this.onEvent.bind(this);\n }\n init() {\n this.routeInfo = {\n channel: this.path(),\n callback: this.onEvent\n };\n if (this.listenOnBoot()) {\n this.listen();\n }\n }\n /**\n * Override this method to tell that the event must listen when created\n */\n listenOnBoot() {\n return false;\n }\n /**\n * Add the event to the endpoint. After that, the on trigger event can be triggered\n */\n listen() {\n if (!this._listening) {\n this._listening = true;\n if (!this.routeInfo) {\n this.routeInfo = {\n channel: this.path(),\n callback: this.onEvent\n };\n }\n this.endpoint.addRoute(this.routeInfo);\n }\n }\n /**\n * Remove the event from the endpoint. After that, the on trigger event won't be triggered\n */\n stop() {\n if (this._listening) {\n this._listening = false;\n this.endpoint.removeRoute(this.routeInfo);\n }\n }\n onEvent(data, params, uid) {\n this.onTrigger.trigger([data, params, uid]);\n }\n}\nWebSocket.WsEvent.Namespace=`AventusSharp.WebSocket`;\r\n_.WebSocket.WsEvent=WebSocket.WsEvent;\r\n","dependances":[{"fullName":"AventusSharp.WebSocket.EndPoint","isStrong":false},{"fullName":"Aventus.Callback","isStrong":false},{"fullName":"Aventus.ExtractFromError","isStrong":false},{"fullName":"Aventus.UriParamsValue","isStrong":false},{"fullName":"AventusSharp.WebSocket.SocketRoute","isStrong":false}],"fullName":"AventusSharp.WebSocket.WsEvent","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"WebSocket.StorableWsRoute_DeleteMany=class StorableWsRoute_DeleteMany extends WebSocket.WsEvent {\n /**\n * @inheritdoc\n */\n path() {\n return `${this.getPrefix()}/${this.StorableName()}/DeleteMany`;\n }\n StorableName;\n constructor(endpoint, getPrefix, StorableName) {\n super(endpoint, getPrefix);\n this.StorableName = StorableName ?? (() => \"\");\n }\n}\nWebSocket.StorableWsRoute_DeleteMany.Namespace=`AventusSharp.WebSocket`;\r\n_.WebSocket.StorableWsRoute_DeleteMany=WebSocket.StorableWsRoute_DeleteMany;\r\n","dependances":[{"fullName":"AventusSharp.WebSocket.WsEvent","isStrong":true},{"fullName":"AventusSharp.Tools.ResultWithError","isStrong":false},{"fullName":"Aventus.IData","isStrong":false},{"fullName":"AventusSharp.WebSocket.EndPoint","isStrong":false}],"fullName":"AventusSharp.WebSocket.StorableWsRoute_DeleteMany","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"WebSocket.StorableWsRouter_Delete=class StorableWsRouter_Delete extends WebSocket.WsEvent {\n StorableName;\n constructor(endpoint, getPrefix, StorableName) {\n super(endpoint, getPrefix);\n this.StorableName = StorableName;\n }\n /**\n * @inheritdoc\n */\n path() {\n return `${this.getPrefix()}/${this.StorableName()}/{id:number}/Delete`;\n }\n}\nWebSocket.StorableWsRouter_Delete.Namespace=`AventusSharp.WebSocket`;\r\n_.WebSocket.StorableWsRouter_Delete=WebSocket.StorableWsRouter_Delete;\r\n","dependances":[{"fullName":"AventusSharp.WebSocket.WsEvent","isStrong":true},{"fullName":"AventusSharp.WebSocket.EndPoint","isStrong":false}],"fullName":"AventusSharp.WebSocket.StorableWsRouter_Delete","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"WebSocket.StorableWsRoute_UpdateMany=class StorableWsRoute_UpdateMany extends WebSocket.WsEvent {\n /**\n * @inheritdoc\n */\n path() {\n return `${this.getPrefix()}/${this.StorableName()}/UpdateMany`;\n }\n StorableName;\n constructor(endpoint, getPrefix, StorableName) {\n super(endpoint, getPrefix);\n this.StorableName = StorableName ?? (() => \"\");\n }\n}\nWebSocket.StorableWsRoute_UpdateMany.Namespace=`AventusSharp.WebSocket`;\r\n_.WebSocket.StorableWsRoute_UpdateMany=WebSocket.StorableWsRoute_UpdateMany;\r\n","dependances":[{"fullName":"AventusSharp.WebSocket.WsEvent","isStrong":true},{"fullName":"AventusSharp.Tools.ResultWithError","isStrong":false},{"fullName":"Aventus.IData","isStrong":false},{"fullName":"AventusSharp.WebSocket.EndPoint","isStrong":false}],"fullName":"AventusSharp.WebSocket.StorableWsRoute_UpdateMany","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"WebSocket.StorableWsRouter_Update=class StorableWsRouter_Update extends WebSocket.WsEvent {\n StorableName;\n constructor(endpoint, getPrefix, StorableName) {\n super(endpoint, getPrefix);\n this.StorableName = StorableName;\n }\n /**\n * @inheritdoc\n */\n path() {\n return `${this.getPrefix()}/${this.StorableName()}/{id:number}/Update`;\n }\n}\nWebSocket.StorableWsRouter_Update.Namespace=`AventusSharp.WebSocket`;\r\n_.WebSocket.StorableWsRouter_Update=WebSocket.StorableWsRouter_Update;\r\n","dependances":[{"fullName":"AventusSharp.WebSocket.WsEvent","isStrong":true},{"fullName":"AventusSharp.WebSocket.EndPoint","isStrong":false}],"fullName":"AventusSharp.WebSocket.StorableWsRouter_Update","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"WebSocket.StorableWsRouter_GetByIds=class StorableWsRouter_GetByIds extends WebSocket.WsEvent {\n StorableName;\n constructor(endpoint, getPrefix, StorableName) {\n super(endpoint, getPrefix);\n this.StorableName = StorableName;\n }\n /**\n * @inheritdoc\n */\n path() {\n return `${this.getPrefix()}/${this.StorableName()}/getbyids`;\n }\n}\nWebSocket.StorableWsRouter_GetByIds.Namespace=`AventusSharp.WebSocket`;\r\n_.WebSocket.StorableWsRouter_GetByIds=WebSocket.StorableWsRouter_GetByIds;\r\n","dependances":[{"fullName":"AventusSharp.WebSocket.WsEvent","isStrong":true},{"fullName":"AventusSharp.WebSocket.EndPoint","isStrong":false}],"fullName":"AventusSharp.WebSocket.StorableWsRouter_GetByIds","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"WebSocket.StorableWsRouter_GetById=class StorableWsRouter_GetById extends WebSocket.WsEvent {\n StorableName;\n constructor(endpoint, getPrefix, StorableName) {\n super(endpoint, getPrefix);\n this.StorableName = StorableName;\n }\n /**\n * @inheritdoc\n */\n path() {\n return `${this.getPrefix()}/${this.StorableName()}/{id:number}`;\n }\n}\nWebSocket.StorableWsRouter_GetById.Namespace=`AventusSharp.WebSocket`;\r\n_.WebSocket.StorableWsRouter_GetById=WebSocket.StorableWsRouter_GetById;\r\n","dependances":[{"fullName":"AventusSharp.WebSocket.WsEvent","isStrong":true},{"fullName":"AventusSharp.WebSocket.EndPoint","isStrong":false}],"fullName":"AventusSharp.WebSocket.StorableWsRouter_GetById","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"WebSocket.StorableWsRoute_CreateMany=class StorableWsRoute_CreateMany extends WebSocket.WsEvent {\n /**\n * @inheritdoc\n */\n path() {\n return `${this.getPrefix()}/${this.StorableName()}/CreateMany`;\n }\n StorableName;\n constructor(endpoint, getPrefix, StorableName) {\n super(endpoint, getPrefix);\n this.StorableName = StorableName ?? (() => \"\");\n }\n}\nWebSocket.StorableWsRoute_CreateMany.Namespace=`AventusSharp.WebSocket`;\r\n_.WebSocket.StorableWsRoute_CreateMany=WebSocket.StorableWsRoute_CreateMany;\r\n","dependances":[{"fullName":"AventusSharp.WebSocket.WsEvent","isStrong":true},{"fullName":"AventusSharp.Tools.ResultWithError","isStrong":false},{"fullName":"Aventus.IData","isStrong":false},{"fullName":"AventusSharp.WebSocket.EndPoint","isStrong":false}],"fullName":"AventusSharp.WebSocket.StorableWsRoute_CreateMany","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"WebSocket.StorableWsRouter_Create=class StorableWsRouter_Create extends WebSocket.WsEvent {\n StorableName;\n constructor(endpoint, getPrefix, StorableName) {\n super(endpoint, getPrefix);\n this.StorableName = StorableName;\n }\n /**\n * @inheritdoc\n */\n path() {\n return `${this.getPrefix()}/${this.StorableName()}/Create`;\n }\n}\nWebSocket.StorableWsRouter_Create.Namespace=`AventusSharp.WebSocket`;\r\n_.WebSocket.StorableWsRouter_Create=WebSocket.StorableWsRouter_Create;\r\n","dependances":[{"fullName":"AventusSharp.WebSocket.WsEvent","isStrong":true},{"fullName":"AventusSharp.WebSocket.EndPoint","isStrong":false}],"fullName":"AventusSharp.WebSocket.StorableWsRouter_Create","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"WebSocket.StorableWsRouter_GetAll=class StorableWsRouter_GetAll extends WebSocket.WsEvent {\n StorableName;\n constructor(endpoint, getPrefix, StorableName) {\n super(endpoint, getPrefix);\n this.StorableName = StorableName;\n }\n /**\n * @inheritdoc\n */\n path() {\n return `${this.getPrefix()}/${this.StorableName()}`;\n }\n}\nWebSocket.StorableWsRouter_GetAll.Namespace=`AventusSharp.WebSocket`;\r\n_.WebSocket.StorableWsRouter_GetAll=WebSocket.StorableWsRouter_GetAll;\r\n","dependances":[{"fullName":"AventusSharp.WebSocket.WsEvent","isStrong":true},{"fullName":"AventusSharp.WebSocket.EndPoint","isStrong":false}],"fullName":"AventusSharp.WebSocket.StorableWsRouter_GetAll","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"WebSocket.Router=class Router {\n endpoint;\n events;\n constructor(endpoint) {\n this.endpoint = endpoint ?? WebSocket.EndPoint.getInstance();\n this.events = this.defineEvents();\n for (let key in this.events) {\n this.events[key].init();\n }\n }\n getPrefix() {\n return \"\";\n }\n defineEvents() {\n return {};\n }\n}\nWebSocket.Router.Namespace=`AventusSharp.WebSocket`;\r\n_.WebSocket.Router=WebSocket.Router;\r\n","dependances":[{"fullName":"AventusSharp.WebSocket.RouterRoutes","isStrong":false},{"fullName":"AventusSharp.WebSocket.EndPoint","isStrong":false}],"fullName":"AventusSharp.WebSocket.Router","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"WebSocket.StorableWsRouter=class StorableWsRouter extends WebSocket.Router {\n defineEvents() {\n return {\n ...super.defineEvents(),\n GetAll: new WebSocket.StorableWsRouter_GetAll(this.endpoint, this.getPrefix, this.StorableName),\n Create: new WebSocket.StorableWsRouter_Create(this.endpoint, this.getPrefix, this.StorableName),\n CreateMany: new WebSocket.StorableWsRoute_CreateMany(this.endpoint, this.getPrefix, this.StorableName),\n GetById: new WebSocket.StorableWsRouter_GetById(this.endpoint, this.getPrefix, this.StorableName),\n GetByIds: new WebSocket.StorableWsRouter_GetByIds(this.endpoint, this.getPrefix, this.StorableName),\n Update: new WebSocket.StorableWsRouter_Update(this.endpoint, this.getPrefix, this.StorableName),\n UpdateMany: new WebSocket.StorableWsRoute_UpdateMany(this.endpoint, this.getPrefix, this.StorableName),\n Delete: new WebSocket.StorableWsRouter_Delete(this.endpoint, this.getPrefix, this.StorableName),\n DeleteMany: new WebSocket.StorableWsRoute_DeleteMany(this.endpoint, this.getPrefix, this.StorableName),\n };\n }\n async GetAll(options = {}) {\n const info = {\n channel: `${this.getPrefix()}/${this.StorableName()}`,\n ...options,\n };\n return await this.endpoint.sendMessageAndWait(info);\n }\n async Create(body, options = {}) {\n const info = {\n channel: `${this.getPrefix()}/${this.StorableName()}/Create`,\n body: body,\n ...options,\n };\n return await this.endpoint.sendMessageAndWait(info);\n }\n async CreateMany(body, options = {}) {\n const info = {\n channel: `${this.getPrefix()}/${this.StorableName()}/CreateMany`,\n body: body,\n ...options,\n };\n return await this.endpoint.sendMessageAndWait(info);\n }\n async GetById(id, options = {}) {\n const info = {\n channel: `${this.getPrefix()}/${this.StorableName()}/${id}`,\n ...options,\n };\n return await this.endpoint.sendMessageAndWait(info);\n }\n async GetByIds(body, options = {}) {\n const info = {\n channel: `${this.getPrefix()}/${this.StorableName()}/getbyids`,\n body: body,\n ...options,\n };\n return await this.endpoint.sendMessageAndWait(info);\n }\n async Update(id, body, options = {}) {\n const info = {\n channel: `${this.getPrefix()}/${this.StorableName()}/${id}/Update`,\n body: body,\n ...options,\n };\n return await this.endpoint.sendMessageAndWait(info);\n }\n async UpdateMany(body, options = {}) {\n const info = {\n channel: `${this.getPrefix()}/${this.StorableName()}/UpdateMany`,\n body: body,\n ...options,\n };\n return await this.endpoint.sendMessageAndWait(info);\n }\n async Delete(id, options = {}) {\n const info = {\n channel: `${this.getPrefix()}/${this.StorableName()}/${id}/Delete`,\n ...options,\n };\n return await this.endpoint.sendMessageAndWait(info);\n }\n async DeleteMany(body, options = {}) {\n const info = {\n channel: `${this.getPrefix()}/${this.StorableName()}/DeleteMany`,\n body: body,\n ...options,\n };\n return await this.endpoint.sendMessageAndWait(info);\n }\n}\nWebSocket.StorableWsRouter.Namespace=`AventusSharp.WebSocket`;\r\n_.WebSocket.StorableWsRouter=WebSocket.StorableWsRouter;\r\n","dependances":[{"fullName":"AventusSharp.WebSocket.Router","isStrong":true},{"fullName":"Aventus.IData","isStrong":false},{"fullName":"AventusSharp.WebSocket.StorableWsRouter__Routes","isStrong":false},{"fullName":"AventusSharp.WebSocket.StorableWsRouter_GetAll","isStrong":false},{"fullName":"AventusSharp.WebSocket.StorableWsRouter_Create","isStrong":false},{"fullName":"AventusSharp.WebSocket.StorableWsRoute_CreateMany","isStrong":false},{"fullName":"AventusSharp.WebSocket.StorableWsRouter_GetById","isStrong":false},{"fullName":"AventusSharp.WebSocket.StorableWsRouter_GetByIds","isStrong":false},{"fullName":"AventusSharp.WebSocket.StorableWsRouter_Update","isStrong":false},{"fullName":"AventusSharp.WebSocket.StorableWsRoute_UpdateMany","isStrong":false},{"fullName":"AventusSharp.WebSocket.StorableWsRouter_Delete","isStrong":false},{"fullName":"AventusSharp.WebSocket.StorableWsRoute_DeleteMany","isStrong":false},{"fullName":"AventusSharp.WebSocket.WsRouteSendOptions","isStrong":false},{"fullName":"AventusSharp.ExtractResponse","isStrong":false},{"fullName":"AventusSharp.WebSocket.SocketSendMessageOptions","isStrong":false}],"fullName":"AventusSharp.WebSocket.StorableWsRouter","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"WebSocket.WsError=class WsError extends Aventus.GenericError {\n static get Fullname() { return \"AventusSharp.WebSocket.WsError, AventusSharp\"; }\n}\nWebSocket.WsError.Namespace=`AventusSharp.WebSocket`;\r\nWebSocket.WsError.$schema={...(Aventus.GenericError?.$schema ?? {}), };\r\nAventus.Converter.register(WebSocket.WsError.Fullname, WebSocket.WsError);\r\n_.WebSocket.WsError=WebSocket.WsError;\r\n","dependances":[{"fullName":"Aventus.GenericError","isStrong":true},{"fullName":"AventusSharp.WebSocket.WsErrorCode","isStrong":true},{"fullName":"Convertible","isStrong":false}],"fullName":"AventusSharp.WebSocket.WsError","required":false,"type":1,"isExported":true,"convertibleName":"Fullname"},{"code":"WebSocket.ResultWithWsError=class ResultWithWsError extends Tools.ResultWithError {\n static get Fullname() { return \"AventusSharp.WebSocket.ResultWithWsError, AventusSharp\"; }\n}\nWebSocket.ResultWithWsError.Namespace=`AventusSharp.WebSocket`;\r\nWebSocket.ResultWithWsError.$schema={...(Tools.ResultWithError?.$schema ?? {}), };\r\nAventus.Converter.register(WebSocket.ResultWithWsError.Fullname, WebSocket.ResultWithWsError);\r\n_.WebSocket.ResultWithWsError=WebSocket.ResultWithWsError;\r\n","dependances":[{"fullName":"AventusSharp.Tools.ResultWithError","isStrong":true},{"fullName":"AventusSharp.WebSocket.WsError","isStrong":false},{"fullName":"Convertible","isStrong":false}],"fullName":"AventusSharp.WebSocket.ResultWithWsError","required":false,"type":1,"isExported":true,"convertibleName":"Fullname"},{"code":"WebSocket.VoidWithWsError=class VoidWithWsError extends Tools.VoidWithError {\n static get Fullname() { return \"AventusSharp.WebSocket.VoidWithWsError, AventusSharp\"; }\n}\nWebSocket.VoidWithWsError.Namespace=`AventusSharp.WebSocket`;\r\nWebSocket.VoidWithWsError.$schema={...(Tools.VoidWithError?.$schema ?? {}), };\r\nAventus.Converter.register(WebSocket.VoidWithWsError.Fullname, WebSocket.VoidWithWsError);\r\n_.WebSocket.VoidWithWsError=WebSocket.VoidWithWsError;\r\n","dependances":[{"fullName":"AventusSharp.Tools.VoidWithError","isStrong":true},{"fullName":"AventusSharp.WebSocket.WsError","isStrong":false},{"fullName":"Convertible","isStrong":false}],"fullName":"AventusSharp.WebSocket.VoidWithWsError","required":false,"type":1,"isExported":true,"convertibleName":"Fullname"},{"code":"RAM.RamHttp=class RamHttp extends Aventus.Ram {\n getAllDone = false;\n routes;\n constructor() {\n super();\n this.routes = this.defineRoutes();\n }\n async beforeGetAll(result) {\n if (!this.getAllDone) {\n let response = await this.routes.GetAll();\n if (response.success && response.result) {\n for (let item of response.result) {\n let resultTemp = new Aventus.ResultRamWithError();\n await this.addOrUpdateData(item, resultTemp);\n if (!resultTemp.success) {\n result.errors = [...result.errors, ...resultTemp.errors];\n }\n }\n this.getAllDone = true;\n }\n else {\n result.errors = [...result.errors, ...response.errors];\n }\n }\n }\n async beforeGetById(id, result) {\n if (this.records.has(id)) {\n return;\n }\n else {\n let response = await this.routes.GetById(id);\n if (response.success && response.result) {\n let resultTemp = new Aventus.ResultRamWithError();\n await this.addOrUpdateData(response.result, resultTemp);\n if (!resultTemp.success) {\n result.errors = [...result.errors, ...resultTemp.errors];\n }\n else {\n result.result = resultTemp.result;\n }\n }\n else {\n result.errors = [...result.errors, ...response.errors];\n }\n }\n }\n async beforeGetByIds(ids, result) {\n let missingIds = [];\n for (let id of ids) {\n if (!this.records.has(id)) {\n missingIds.push(id);\n }\n }\n if (missingIds.length > 0) {\n result.result = [];\n let response = await this.routes.GetByIds({ ids: missingIds });\n if (response.success && response.result) {\n for (let item of response.result) {\n let resultTemp = new Aventus.ResultRamWithError();\n await this.addOrUpdateData(item, resultTemp);\n if (!resultTemp.success || !resultTemp.result) {\n result.errors = [...result.errors, ...resultTemp.errors];\n }\n else if (!result.result.includes(resultTemp.result)) {\n result.result.push(resultTemp.result);\n }\n }\n }\n else {\n result.errors = [...result.errors, ...response.errors];\n }\n }\n }\n async beforeCreateItem(item, fromList, result) {\n if (fromList) {\n return;\n }\n let response = await this.routes.Create({ item });\n if (response.success && response.result) {\n result.result = this.getObjectForRam(response.result);\n }\n else {\n result.errors = [...result.errors, ...response.errors];\n }\n }\n async beforeCreateList(list, result) {\n let response = await this.routes.CreateMany({ list });\n if (response.success && response.result) {\n result.result = [];\n for (let element of response.result) {\n result.result.push(this.getObjectForRam(element));\n }\n }\n else {\n result.errors = [...result.errors, ...response.errors];\n }\n }\n async beforeUpdateItem(item, fromList, result) {\n if (fromList) {\n return;\n }\n let response = await this.routes.Update(item.Id, { item });\n if (response.success && response.result) {\n result.result = this.getObjectForRam(response.result);\n }\n else {\n result.errors = [...result.errors, ...response.errors];\n }\n }\n async beforeUpdateList(list, result) {\n let response = await this.routes.UpdateMany({ list });\n if (response.success && response.result) {\n result.result = [];\n for (let element of response.result) {\n result.result.push(this.getObjectForRam(element));\n }\n }\n else {\n result.errors = [...result.errors, ...response.errors];\n }\n }\n async beforeDeleteItem(item, fromList, result) {\n if (fromList) {\n return;\n }\n let response = await this.routes.Delete(item.Id);\n if (!response.success) {\n result.errors = [...result.errors, ...response.errors];\n }\n }\n async beforeDeleteList(list, result) {\n let response = await this.routes.DeleteMany({ ids: list.map(t => t.Id) });\n if (!response.success) {\n result.errors = [...result.errors, ...response.errors];\n }\n }\n}\nRAM.RamHttp.Namespace=`AventusSharp.RAM`;\r\n_.RAM.RamHttp=RAM.RamHttp;\r\n","dependances":[{"fullName":"Aventus.Ram","isStrong":true},{"fullName":"AventusSharp.Data.Storable","isStrong":false},{"fullName":"AventusSharp.Routes.StorableRouter","isStrong":false},{"fullName":"Aventus.ResultRamWithError","isStrong":false},{"fullName":"Aventus.RamItem","isStrong":false},{"fullName":"Aventus.VoidWithError","isStrong":false}],"fullName":"AventusSharp.RAM.RamHttp","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"RAM.RamWebSocket=class RamWebSocket extends Aventus.Ram {\n getAllDone = false;\n routes;\n otherGetAllLocked = {};\n otherGetByIdLocked = {};\n otherCreateItemLocked = {};\n otherCreateListLocked = {};\n otherUpdateItemLocked = {};\n otherUpdateListLocked = {};\n otherDeleteItemLocked = {};\n otherDeleteListLocked = {};\n constructor() {\n super();\n this.routes = this.defineRoutes();\n this.addEventsBindings();\n this.otherGetAll = this.otherGetAll.bind(this);\n this.otherGetById = this.otherGetById.bind(this);\n this.otherCreateItem = this.otherCreateItem.bind(this);\n this.otherCreateList = this.otherCreateList.bind(this);\n this.otherUpdateItem = this.otherUpdateItem.bind(this);\n this.otherUpdateList = this.otherUpdateList.bind(this);\n this.otherDeleteItem = this.otherDeleteItem.bind(this);\n this.otherDeleteList = this.otherDeleteList.bind(this);\n }\n addEventsBindings() {\n const autoListen = this.listenOnStart();\n this.routes.events.GetAll.onTrigger.add(this.otherGetAll, this);\n if (autoListen.GetAll) {\n this.routes.events.GetAll.listen();\n }\n else {\n this.routes.events.GetAll.stop();\n }\n this.routes.events.GetById.onTrigger.add(this.otherGetById, this);\n if (autoListen.GetById) {\n this.routes.events.GetById.listen();\n }\n else {\n this.routes.events.GetById.stop();\n }\n this.routes.events.Create.onTrigger.add(this.otherCreateItem, this);\n if (autoListen.Create) {\n this.routes.events.Create.listen();\n }\n else {\n this.routes.events.Create.stop();\n }\n this.routes.events.CreateMany.onTrigger.add(this.otherCreateList, this);\n if (autoListen.CreateMany) {\n this.routes.events.CreateMany.listen();\n }\n else {\n this.routes.events.CreateMany.stop();\n }\n this.routes.events.Update.onTrigger.add(this.otherUpdateItem, this);\n if (autoListen.Update) {\n this.routes.events.Update.listen();\n }\n else {\n this.routes.events.Update.stop();\n }\n this.routes.events.UpdateMany.onTrigger.add(this.otherUpdateList, this);\n if (autoListen.UpdateMany) {\n this.routes.events.UpdateMany.listen();\n }\n else {\n this.routes.events.UpdateMany.stop();\n }\n this.routes.events.Delete.onTrigger.add(this.otherDeleteItem, this);\n if (autoListen.Delete) {\n this.routes.events.Delete.listen();\n }\n else {\n this.routes.events.Delete.stop();\n }\n this.routes.events.DeleteMany.onTrigger.add(this.otherDeleteList, this);\n if (autoListen.DeleteMany) {\n this.routes.events.DeleteMany.listen();\n }\n else {\n this.routes.events.DeleteMany.stop();\n }\n }\n listenOnStart() {\n return {\n GetAll: false,\n GetById: false,\n Create: true,\n CreateMany: true,\n Update: true,\n UpdateMany: true,\n Delete: true,\n DeleteMany: true,\n };\n }\n async otherGetAll(items, params, uid) {\n if (uid && this.otherGetAllLocked[uid])\n return;\n for (let item of items) {\n let resultTemp = new Aventus.ResultRamWithError();\n await this.addOrUpdateData(item, resultTemp);\n }\n }\n async beforeGetAll(result) {\n if (!this.getAllDone) {\n let uid = Aventus.uuidv4();\n this.otherGetAllLocked[uid] = true;\n let response = await this.routes.GetAll({ uid });\n delete this.otherGetAllLocked[uid];\n if (!response)\n return;\n if (response.success && response.result) {\n for (let item of response.result) {\n let resultTemp = new Aventus.ResultRamWithError();\n await this.addOrUpdateData(item, resultTemp);\n if (!resultTemp.success) {\n result.errors = [...result.errors, ...resultTemp.errors];\n }\n }\n }\n else {\n result.errors = [...result.errors, ...response.errors];\n }\n }\n }\n async otherGetById(item, params, uid) {\n if (uid && this.otherGetByIdLocked[uid])\n return;\n let resultTemp = new Aventus.ResultRamWithError();\n await this.addOrUpdateData(item, resultTemp);\n }\n async beforeGetById(id, result) {\n if (this.records.has(id)) {\n return;\n }\n else {\n let uid = Aventus.uuidv4();\n this.otherGetByIdLocked[uid] = true;\n let response = await this.routes.GetById(id, { uid });\n delete this.otherGetByIdLocked[uid];\n if (!response)\n return;\n if (response.success && response.result) {\n let resultTemp = new Aventus.ResultRamWithError();\n await this.addOrUpdateData(response.result, resultTemp);\n if (!resultTemp.success) {\n result.errors = [...result.errors, ...resultTemp.errors];\n }\n }\n else {\n result.errors = [...result.errors, ...response.errors];\n }\n }\n }\n async beforeGetByIds(ids, result) {\n let missingIds = [];\n for (let id of ids) {\n if (!this.records.has(id)) {\n missingIds.push(id);\n }\n }\n if (missingIds.length > 0) {\n let response = await this.routes.GetByIds({ ids: missingIds });\n if (response.success && response.result) {\n for (let item of response.result) {\n let resultTemp = new Aventus.ResultRamWithError();\n await this.addOrUpdateData(item, resultTemp);\n if (!resultTemp.success) {\n result.errors = [...result.errors, ...resultTemp.errors];\n }\n }\n }\n else {\n result.errors = [...result.errors, ...response.errors];\n }\n }\n }\n async otherCreateItem(item, params, uid) {\n if (uid && this.otherCreateItemLocked[uid])\n return;\n let resultTemp = new Aventus.ResultRamWithError();\n await this.addOrUpdateData(item, resultTemp);\n if (resultTemp.success && resultTemp.result) {\n this.publish('created', resultTemp.result);\n }\n }\n async beforeCreateItem(item, fromList, result) {\n if (fromList) {\n return;\n }\n let uid = Aventus.uuidv4();\n this.otherCreateItemLocked[uid] = true;\n let response = await this.routes.Create({ item }, { uid });\n delete this.otherCreateItemLocked[uid];\n if (response.success && response.result) {\n result.result = this.getObjectForRam(response.result);\n }\n else {\n result.errors = [...result.errors, ...response.errors];\n }\n }\n async otherCreateList(items, params, uid) {\n if (uid && this.otherCreateListLocked[uid])\n return;\n for (let item of items) {\n let resultTemp = new Aventus.ResultRamWithError();\n await this.addOrUpdateData(item, resultTemp);\n if (resultTemp.success && resultTemp.result) {\n this.publish('created', resultTemp.result);\n }\n }\n }\n async beforeCreateList(list, result) {\n let uid = Aventus.uuidv4();\n this.otherCreateListLocked[uid] = true;\n let response = await this.routes.CreateMany({ list }, { uid });\n delete this.otherCreateListLocked[uid];\n if (response.success && response.result) {\n result.result = [];\n for (let element of response.result) {\n result.result.push(this.getObjectForRam(element));\n }\n }\n else {\n result.errors = [...result.errors, ...response.errors];\n }\n }\n async otherUpdateItem(item, params, uid) {\n if (uid && this.otherUpdateItemLocked[uid])\n return;\n let resultTemp = new Aventus.ResultRamWithError();\n await this.addOrUpdateData(item, resultTemp);\n if (resultTemp.success && resultTemp.result) {\n this.publish('updated', resultTemp.result);\n }\n }\n async beforeUpdateItem(item, fromList, result) {\n if (fromList) {\n return;\n }\n let uid = Aventus.uuidv4();\n this.otherUpdateItemLocked[uid] = true;\n let response = await this.routes.Update(item.Id, { item }, { uid });\n delete this.otherUpdateItemLocked[uid];\n if (response.success && response.result) {\n result.result = this.getObjectForRam(response.result);\n }\n else {\n result.errors = [...result.errors, ...response.errors];\n }\n }\n async otherUpdateList(items, params, uid) {\n if (uid && this.otherUpdateListLocked[uid])\n return;\n for (let item of items) {\n let resultTemp = new Aventus.ResultRamWithError();\n await this.addOrUpdateData(item, resultTemp);\n if (resultTemp.success && resultTemp.result) {\n this.publish('updated', resultTemp.result);\n }\n }\n }\n async beforeUpdateList(list, result) {\n let uid = Aventus.uuidv4();\n this.otherUpdateListLocked[uid] = true;\n let response = await this.routes.UpdateMany({ list }, { uid });\n delete this.otherUpdateListLocked[uid];\n if (response.success && response.result) {\n result.result = [];\n for (let element of response.result) {\n result.result.push(this.getObjectForRam(element));\n }\n }\n else {\n result.errors = [...result.errors, ...response.errors];\n }\n }\n otherDeleteItem(item, params, uid) {\n if (uid && this.otherDeleteItemLocked[uid])\n return;\n let resultTemp = new Aventus.ResultRamWithError();\n this.deleteData(item, resultTemp);\n if (resultTemp.success && resultTemp.result) {\n this.publish('deleted', resultTemp.result);\n this.recordsSubscribers.delete(resultTemp.result.Id);\n }\n }\n async beforeDeleteItem(item, fromList, result) {\n if (fromList) {\n return;\n }\n let uid = Aventus.uuidv4();\n this.otherDeleteItemLocked[uid] = true;\n let response = await this.routes.Delete(item.Id, { uid });\n delete this.otherDeleteItemLocked[uid];\n if (!response.success) {\n result.errors = [...result.errors, ...response.errors];\n }\n }\n otherDeleteList(items, params, uid) {\n if (uid && this.otherDeleteListLocked[uid])\n return;\n for (let item of items) {\n let resultTemp = new Aventus.ResultRamWithError();\n this.deleteData(item, resultTemp);\n if (resultTemp.success && resultTemp.result) {\n this.publish('deleted', resultTemp.result);\n this.recordsSubscribers.delete(resultTemp.result.Id);\n }\n }\n }\n async beforeDeleteList(list, result) {\n let uid = Aventus.uuidv4();\n this.otherDeleteListLocked[uid] = true;\n let response = await this.routes.DeleteMany({ ids: list.map(t => t.Id) }, { uid });\n delete this.otherDeleteListLocked[uid];\n if (!response.success) {\n result.errors = [...result.errors, ...response.errors];\n }\n }\n /**\n * Delete element inside Ram without firing delete event\n */\n deleteData(item, result) {\n try {\n let idWithError = this.getIdWithError(item);\n if (idWithError.success && idWithError.result !== undefined) {\n let id = idWithError.result;\n if (this.records.has(id)) {\n result.result = this.records.get(id);\n this.records.delete(id);\n }\n else {\n result.errors.push(new Aventus.RamError(Aventus.RamErrorCode.noItemInsideRam, \"can't delete the item \" + id + \" because it wasn't found inside ram\"));\n }\n }\n else {\n result.errors = [...result.errors, ...idWithError.errors];\n }\n }\n catch (e) {\n result.errors.push(new Aventus.RamError(Aventus.RamErrorCode.unknow, e));\n }\n }\n}\nRAM.RamWebSocket.Namespace=`AventusSharp.RAM`;\r\n_.RAM.RamWebSocket=RAM.RamWebSocket;\r\n","dependances":[{"fullName":"Aventus.Ram","isStrong":true},{"fullName":"AventusSharp.Data.Storable","isStrong":false},{"fullName":"AventusSharp.WebSocket.StorableWsRouter","isStrong":false},{"fullName":"AventusSharp.RAM.RamWebSocketListenOnStart","isStrong":false},{"fullName":"BindThis","isStrong":false},{"fullName":"Aventus.ExtractFromError","isStrong":false},{"fullName":"Aventus.UriParams","isStrong":false},{"fullName":"Aventus.ResultRamWithError","isStrong":false},{"fullName":"Aventus.RamItem","isStrong":false},{"fullName":"Aventus.uuidv4","isStrong":false},{"fullName":"Aventus.VoidWithError","isStrong":false},{"fullName":"Aventus.KeysObject","isStrong":false},{"fullName":"Aventus.RamError","isStrong":false},{"fullName":"Aventus.RamErrorCode","isStrong":false}],"fullName":"AventusSharp.RAM.RamWebSocket","required":false,"type":1,"isExported":true,"convertibleName":""}],"existing":[{"fullName":"AventusSharp.WebSocket.WsRouterOptions","dependances":[]},{"fullName":"AventusSharp.RAM.RamWebSocketListenOnStart","dependances":[]},{"fullName":"AventusSharp.WebSocket.WsRouteSendOptions","dependances":[]},{"fullName":"AventusSharp.WebSocket.SocketMessage","dependances":[]},{"fullName":"AventusSharp.WebSocket.SocketSendMessageOptions","dependances":[]},{"fullName":"AventusSharp.WebSocket.SocketRoute","dependances":[{"fullName":"Aventus.UriParamsValue","isStrong":false}]},{"fullName":"AventusSharp.Data.IStorableTimestamp","dependances":[{"fullName":"Aventus.IData","isStrong":true}]},{"fullName":"AventusSharp.Tools.IWithError","dependances":[{"fullName":"Aventus.GenericError","isStrong":false}]},{"fullName":"AventusSharp.Tools.IResultWithError","dependances":[{"fullName":"AventusSharp.Tools.IWithError","isStrong":true},{"fullName":"Aventus.GenericError","isStrong":false}]},{"fullName":"AventusSharp.RealDate","dependances":[]},{"fullName":"AventusSharp.WebSocket.InternalSocketRoute","dependances":[{"fullName":"AventusSharp.WebSocket.SocketRoute","isStrong":false},{"fullName":"Aventus.PreparedUri","isStrong":false}]},{"fullName":"AventusSharp.WebSocket.ConnectionOptions","dependances":[{"fullName":"AventusSharp.WebSocket.InternalSocketRoute","isStrong":false}]},{"fullName":"AventusSharp.WebSocket.WsEndPointType","dependances":[{"fullName":"AventusSharp.WebSocket.EndPoint","isStrong":false}]},{"fullName":"AventusSharp.WebSocket.ExtractResultFrom","dependances":[{"fullName":"AventusSharp.WebSocket.WsEvent","isStrong":false},{"fullName":"T","isStrong":false},{"fullName":"U","isStrong":false}]},{"fullName":"AventusSharp.WebSocket.WsEventType","dependances":[{"fullName":"AventusSharp.WebSocket.WsEvent","isStrong":false}]},{"fullName":"AventusSharp.ExtractResponse","dependances":[{"fullName":"AventusSharp.WebSocket.WsEvent","isStrong":false},{"fullName":"U","isStrong":false},{"fullName":"T","isStrong":false},{"fullName":"Aventus.ResultWithError","isStrong":false},{"fullName":"Aventus.ExtractFromError","isStrong":false}]},{"fullName":"AventusSharp.WebSocket.RouterRoutes","dependances":[{"fullName":"AventusSharp.WebSocket.WsEvent","isStrong":false}]},{"fullName":"AventusSharp.WebSocket.WsRouterType","dependances":[{"fullName":"AventusSharp.WebSocket.Router","isStrong":false}]},{"fullName":"AventusSharp.WebSocket.StorableWsRouter__Routes","dependances":[{"fullName":"Aventus.IData","isStrong":false},{"fullName":"AventusSharp.WebSocket.StorableWsRouter_GetAll","isStrong":false},{"fullName":"T","isStrong":false},{"fullName":"AventusSharp.WebSocket.StorableWsRouter_Create","isStrong":false},{"fullName":"AventusSharp.WebSocket.StorableWsRoute_CreateMany","isStrong":false},{"fullName":"AventusSharp.WebSocket.StorableWsRouter_GetById","isStrong":false},{"fullName":"AventusSharp.WebSocket.StorableWsRouter_GetByIds","isStrong":false},{"fullName":"AventusSharp.WebSocket.StorableWsRouter_Update","isStrong":false},{"fullName":"AventusSharp.WebSocket.StorableWsRoute_UpdateMany","isStrong":false},{"fullName":"AventusSharp.WebSocket.StorableWsRouter_Delete","isStrong":false},{"fullName":"AventusSharp.WebSocket.StorableWsRoute_DeleteMany","isStrong":false}]}]}
778
791
  //#endregion js src //
779
792
  //#region css def //
780
793
  {}