@aventusjs/cli 0.0.37 → 0.0.38

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.
@@ -1,979 +1,961 @@
1
- // AventusSharp@Main:1.0.7
2
- // npm:@aventusjs/sharp
3
- //#region js def //
4
- declare global {
5
-
6
- namespace AventusSharp{
7
- namespace WebSocket {
8
- interface WsRouterOptions {
9
- url: string;
10
- }
11
- }
12
-
13
- namespace RAM {
14
- type RamWebSocketListenOnStart = {
15
- GetAll: boolean;
16
- GetById: boolean;
17
- Create: boolean;
18
- CreateMany: boolean;
19
- Update: boolean;
20
- UpdateMany: boolean;
21
- Delete: boolean;
22
- DeleteMany: boolean;
23
- };
24
- }
25
-
26
- namespace WebSocket {
27
- interface WsRouteSendOptions {
28
- uid?: string;
29
- timeout?: number;
30
- }
31
- }
32
-
33
- namespace WebSocket {
34
- interface SocketMessage {
35
- channel: string;
36
- data?: any;
37
- uid?: string;
38
- }
39
- }
40
-
41
- namespace WebSocket {
42
- enum SocketErrorCode {
43
- socketClosed = 0,
44
- timeout = 1,
45
- differentChannel = 2,
46
- unknow = 3
47
- }
48
- }
49
-
50
- namespace WebSocket {
51
- class Socket {
52
- static Debug: boolean;
53
- private static connections;
54
- static getInstance(url: string, el: any): AventusSharp.WebSocket.Socket;
55
- private socket;
56
- private url;
57
- private elements;
58
- private reopenInterval;
59
- onOpen: Aventus.Callback<(ev: Event) => any>;
60
- onClose: Aventus.Callback<(ev: Event) => any>;
61
- onError: Aventus.Callback<(ev: Event) => any>;
62
- onMessage: Aventus.Callback<(ev: MessageEvent<any>) => any>;
63
- get readyState(): number;
64
- protected constructor(url: string, el: any);
65
- protected registerEl(el: any): void;
66
- private createWebSocket;
67
- protected removeSocket(): void;
68
- protected reopen(): void;
69
- close(el: any, code?: number | undefined, reason?: string | undefined): void;
70
- send(data: BufferSource | Blob | string): void;
71
- /**
72
- * Check if socket is ready
73
- */
74
- isReady(): boolean;
75
- }
76
- }
77
-
78
- namespace WebSocket {
79
- interface SocketSendMessageOptions {
80
- channel: string;
81
- body?: {
82
- [key: string | number]: any;
83
- };
84
- timeout?: number;
85
- uid?: string;
86
- }
87
- }
88
-
89
- namespace WebSocket {
90
- interface SocketRoute<T = any> {
91
- channel: string;
92
- callback: (data: T, params: Aventus.UriParamsValue, uid?: string) => void;
93
- }
94
- }
95
-
96
- namespace Data {
97
- abstract class Storable extends Aventus.Data implements Aventus.IData {
98
- Id: number;
99
- /**
100
- * @inerhit
101
- */
102
- toJSON(): any;
103
- }
104
- }
105
-
106
- namespace Data {
107
- abstract class StorableTimestamp extends AventusSharp.Data.Storable implements Aventus.IData {
108
- CreatedDate: Date;
109
- UpdatedDate: Date;
110
- }
111
- }
112
-
113
- namespace WebSocket {
114
- enum WsErrorCode {
115
- UnknownError = 0,
116
- CantDefineAssembly = 1,
117
- ConfigError = 2,
118
- MultipleMainEndpoint = 3,
119
- CantGetValueFromBody = 4,
120
- NoConnection = 5,
121
- NoEndPoint = 6,
122
- NoPath = 7
123
- }
124
- }
125
-
126
- namespace SSE {
127
- enum SSEErrorCode {
128
- UnknownError = 0,
129
- CantDefineAssembly = 1,
130
- ConfigError = 2,
131
- MultipleMainEndpoint = 3,
132
- CantGetValueFromBody = 4,
133
- NoEndPoint = 5
134
- }
135
- }
136
-
137
- namespace Routes {
138
- enum RouteErrorCode {
139
- UnknownError = 0,
140
- FormContentTypeUnknown = 1,
141
- CantGetValueFromBody = 2,
142
- CantMoveFile = 3,
143
- CantCreateFolders = 4,
144
- RouteAlreadyExist = 5,
145
- ConfigError = 6
146
- }
147
- }
148
-
149
- namespace Data {
150
- interface IStorableTimestamp extends Aventus.IData {
151
- CreatedDate: Date;
152
- UpdatedDate: Date;
153
- }
154
- }
155
-
156
- namespace Data {
157
- enum DataErrorCode {
158
- DefaultDMGenericType = 0,
159
- DMOnlyForceInherit = 1,
160
- TypeNotStorable = 2,
161
- TypeTooMuchStorable = 3,
162
- GenericNotAbstract = 4,
163
- ParentNotAbstract = 5,
164
- InfiniteLoop = 6,
165
- InterfaceNotUnique = 7,
166
- SelfReferecingDependency = 8,
167
- DMNotExist = 9,
168
- DMAlreadyExist = 10,
169
- MethodNotFound = 11,
170
- StorageDisconnected = 12,
171
- StorageNotFound = 13,
172
- NoConnectionInsideStorage = 14,
173
- TypeNotExistInsideStorage = 15,
174
- UnknownError = 16,
175
- NoItemProvided = 17,
176
- NoTransactionInProgress = 18,
177
- WrongType = 19,
178
- NoTypeIdentifierFoundInsideQuery = 20,
179
- ItemNoExistInsideStorage = 21,
180
- ItemAlreadyExist = 22,
181
- ValidationError = 23,
182
- GetAllNotAllowed = 24,
183
- GetByIdNotAllowed = 25,
184
- GetByIdsNotAllowed = 26,
185
- WhereNotAllowed = 27,
186
- CreateNotAllowed = 28,
187
- UpdateNotAllowed = 29,
188
- DeleteNotAllowed = 30,
189
- NumberOfItemsNotMatching = 31,
190
- FieldTypeNotFound = 32,
191
- MemberNotFound = 33,
192
- TooMuchMemberFound = 34,
193
- TypeNotFound = 35,
194
- ReverseLinkNotExist = 36,
195
- ReverseLinkExist = 37,
196
- ErrorCreatingReverseQuery = 38,
197
- LinkNotSet = 39,
198
- MultipleProvidersNotSet = 40,
199
- FileNotFound = 41,
200
- PyramidNotFound = 42,
201
- IsReadOnly = 43,
202
- ReverseLinkNotPrepared = 44,
203
- ExternalStorageNotPrepared = 45
204
- }
205
- }
206
-
207
- namespace Tools {
208
- interface IWithError<T extends Aventus.GenericError> {
209
- success: boolean;
210
- }
211
- }
212
-
213
- namespace Tools {
214
- interface IResultWithError<T extends Aventus.GenericError> extends AventusSharp.Tools.IWithError<T> {
215
- }
216
- }
217
-
218
- namespace Data.CustomTableMembers {
219
- enum ImageFileErrorCode {
220
- UnknownError = 0,
221
- NotValidImage = 1,
222
- FileNotSvg = 2,
223
- NoSize = 3
224
- }
225
- }
226
-
227
- namespace Data {
228
- abstract class SharpClass {
229
- /**
230
- * The current namespace
231
- */
232
- get namespace(): string;
233
- /**
234
- * Get the unique type for the data. Define it as the namespace + class name
235
- */
236
- get $type(): string;
237
- /**
238
- * Get the name of the class
239
- */
240
- get className(): string;
241
- /**
242
- * Clone the object by transforming a parsed JSON string back into the original type
243
- */
244
- clone(): this;
245
- /**
246
- * Get a JSON for the current object
247
- */
248
- toJSON(): any;
249
- }
250
- }
251
-
252
- namespace Routes.Request {
253
- abstract class Request extends AventusSharp.Data.SharpClass {
254
- }
255
- }
256
-
257
- namespace Routes.Response {
258
- abstract class Resource extends AventusSharp.Data.SharpClass {
259
- toRequest<T extends AventusSharp.Routes.Request.Request>(request: new () => T): T;
260
- }
261
- }
262
-
263
- namespace Data {
264
- @Convertible()
265
- class FieldErrorInfo extends AventusSharp.Data.SharpClass {
266
- /** Fullname of the class */
267
- static get Fullname(): string;
268
- Name: string;
269
- }
270
- }
271
-
272
- namespace Data.CustomTableMembers {
273
- abstract class AventusFile<T> {
274
- Uri: string;
275
- Upload?: File;
276
- /**
277
- * Get the unique type for the data. Define it as the namespace + class name
278
- */
279
- get $type(): string;
280
- /**
281
- * @inerhit
282
- */
283
- toJSON(): any;
284
- }
285
- }
286
-
287
- namespace Data.CustomTableMembers {
288
- abstract class AventusImage<T extends Aventus.IData> extends AventusSharp.Data.CustomTableMembers.AventusFile<T> {
289
- }
290
- }
291
-
292
- type RealDate = Date;
293
-
294
- namespace Data {
295
- @Convertible()
296
- class Datetime extends AventusSharp.Data.SharpClass {
297
- static get Fullname(): string;
298
- DateTime: AventusSharp.RealDate;
299
- }
300
- }
301
-
302
- namespace Data {
303
- @Convertible()
304
- class Date extends AventusSharp.Data.SharpClass {
305
- static get Fullname(): string;
306
- DateTime: AventusSharp.RealDate;
307
- }
308
- }
309
-
310
- namespace Data.CustomTableMembers {
311
- @Convertible()
312
- class ImageFileError extends Aventus.GenericError<typeof AventusSharp.Data.CustomTableMembers.ImageFileErrorCode> {
313
- /** Fullname of the class */
314
- static get Fullname(): string;
315
- }
316
- }
317
-
318
- namespace Tools {
319
- @Convertible()
320
- class VoidWithError<T extends Aventus.GenericError = Aventus.GenericError> extends Aventus.VoidWithError<T> implements AventusSharp.Tools.IWithError<T>, AventusSharp.Tools.IWithError<T> {
321
- /** Fullname of the class */
322
- static get Fullname(): string;
323
- }
324
- }
325
-
326
- namespace Data.CustomTableMembers {
327
- @Convertible()
328
- class VoidWithImageFileError extends AventusSharp.Tools.VoidWithError<AventusSharp.Data.CustomTableMembers.ImageFileError> {
329
- /** Fullname of the class */
330
- static get Fullname(): string;
331
- }
332
- }
333
-
334
- namespace Tools {
335
- @Convertible()
336
- class ResultWithError<T, U extends Aventus.GenericError = Aventus.GenericError> extends Aventus.ResultWithError<T, U> implements AventusSharp.Tools.IResultWithError<U>, AventusSharp.Tools.IResultWithError<U> {
337
- /** Fullname of the class */
338
- static get Fullname(): string;
339
- }
340
- }
341
-
342
- namespace Routes {
343
- abstract class StorableRouter<T extends Aventus.IData, U extends AventusSharp.Routes.Request.Request | T = T, R extends AventusSharp.Routes.Response.Resource | T = T, S extends AventusSharp.Routes.Response.Resource | T = R> extends Aventus.HttpRoute {
344
-
345
- @BindThis()
346
- GetAll(): Promise<AventusSharp.Tools.ResultWithError<R[]>>;
347
- @BindThis()
348
- Create(body: {
349
- item: U;
350
- }): Promise<AventusSharp.Tools.ResultWithError<S>>;
351
- @BindThis()
352
- CreateMany(body: {
353
- list: U[];
354
- }): Promise<AventusSharp.Tools.ResultWithError<S[]>>;
355
- @BindThis()
356
- GetById(id: number): Promise<AventusSharp.Tools.ResultWithError<S>>;
357
- @BindThis()
358
- GetByIds(body: {
359
- ids: number[];
360
- }): Promise<AventusSharp.Tools.ResultWithError<S[]>>;
361
- @BindThis()
362
- Update(id: number, body: {
363
- item: U;
364
- }): Promise<AventusSharp.Tools.ResultWithError<S>>;
365
- @BindThis()
366
- UpdateMany(body: {
367
- list: U[];
368
- }): Promise<AventusSharp.Tools.ResultWithError<S[]>>;
369
- @BindThis()
370
- Delete(id: number): Promise<AventusSharp.Tools.ResultWithError<boolean>>;
371
- @BindThis()
372
- DeleteMany(body: {
373
- ids: number[];
374
- }): Promise<AventusSharp.Tools.ResultWithError<boolean>>;
375
- abstract StorableName(): string;
376
- }
377
- }
378
-
379
- namespace Data.CustomTableMembers {
380
- @Convertible()
381
- class ResultWithImageFileError<T> extends AventusSharp.Tools.ResultWithError<T, AventusSharp.Data.CustomTableMembers.ImageFileError> {
382
- /** Fullname of the class */
383
- static get Fullname(): string;
384
- }
385
- }
386
-
387
- namespace Data {
388
- @Convertible()
389
- class DataError extends Aventus.GenericError<typeof AventusSharp.Data.DataErrorCode> {
390
- /** Fullname of the class */
391
- static get Fullname(): string;
392
- }
393
- }
394
-
395
- namespace Data {
396
- @Convertible()
397
- class ResultWithDataError<T> extends AventusSharp.Tools.ResultWithError<T, AventusSharp.Data.DataError> {
398
- /** Fullname of the class */
399
- static get Fullname(): string;
400
- }
401
- }
402
-
403
- namespace Data {
404
- @Convertible()
405
- class VoidWithDataError extends AventusSharp.Tools.VoidWithError<AventusSharp.Data.DataError> {
406
- /** Fullname of the class */
407
- static get Fullname(): string;
408
- }
409
- }
410
-
411
- namespace Routes {
412
- @Convertible()
413
- class RouteError extends Aventus.GenericError<typeof AventusSharp.Routes.RouteErrorCode> {
414
- /** Fullname of the class */
415
- static get Fullname(): string;
416
- }
417
- }
418
-
419
- namespace Routes {
420
- @Convertible()
421
- class ResultWithRouteError<T> extends AventusSharp.Tools.ResultWithError<T, AventusSharp.Routes.RouteError> {
422
- /** Fullname of the class */
423
- static get Fullname(): string;
424
- }
425
- }
426
-
427
- namespace Routes {
428
- @Convertible()
429
- class VoidWithRouteError extends AventusSharp.Tools.VoidWithError<AventusSharp.Routes.RouteError> {
430
- /** Fullname of the class */
431
- static get Fullname(): string;
432
- }
433
- }
434
-
435
- namespace SSE {
436
- @Convertible()
437
- class SSEError extends Aventus.GenericError<typeof AventusSharp.SSE.SSEErrorCode> {
438
- /** Fullname of the class */
439
- static get Fullname(): string;
440
- }
441
- }
442
-
443
- namespace SSE {
444
- @Convertible()
445
- class ResultWithSSEError<T> extends AventusSharp.Tools.ResultWithError<T, AventusSharp.SSE.SSEError> {
446
- /** Fullname of the class */
447
- static get Fullname(): string;
448
- }
449
- }
450
-
451
- namespace SSE {
452
- @Convertible()
453
- class VoidWithSSEError extends AventusSharp.Tools.VoidWithError<AventusSharp.SSE.SSEError> {
454
- /** Fullname of the class */
455
- static get Fullname(): string;
456
- }
457
- }
458
-
459
- namespace WebSocket {
460
- @Convertible()
461
- class WsError extends Aventus.GenericError<typeof AventusSharp.WebSocket.WsErrorCode> {
462
- /** Fullname of the class */
463
- static get Fullname(): string;
464
- }
465
- }
466
-
467
- namespace WebSocket {
468
- @Convertible()
469
- class ResultWithWsError<T> extends AventusSharp.Tools.ResultWithError<T, AventusSharp.WebSocket.WsError> {
470
- /** Fullname of the class */
471
- static get Fullname(): string;
472
- }
473
- }
474
-
475
- namespace WebSocket {
476
- @Convertible()
477
- class VoidWithWsError extends AventusSharp.Tools.VoidWithError<AventusSharp.WebSocket.WsError> {
478
- /** Fullname of the class */
479
- static get Fullname(): string;
480
- }
481
- }
482
-
483
- class Maui {
484
- private static config;
485
- static configure(config: Partial<___AventusSharp.MauiConfig>): Promise<void>;
486
- private static loadBlazor;
487
- private static overridedFetch;
488
- private static overrideFetch;
489
- }
490
-
491
- namespace RAM {
492
- class RamCompletor<T> {
493
- protected objects: T[];
494
- protected fields: ___AventusSharp.RAM.ItemField<T, any>[];
495
- constructor(objects?: T | T[]);
496
- add<U extends Aventus.IRamData>(field: ___AventusSharp.RAM.ItemField<T, U>): AventusSharp.RAM.RamCompletor<T>;
497
- run(): Promise<Aventus.VoidWithError>;
498
- }
499
- }
500
-
501
- namespace RAM {
502
- abstract class RamHttp<Item extends AventusSharp.Data.Storable, Request extends AventusSharp.Routes.Request.Request | Item = Item, ResourceSimple extends AventusSharp.Routes.Response.Resource | Item = Item, ResourceDetails extends ResourceSimple = ResourceSimple> extends Aventus.Ram<Item, Request, ResourceSimple, ResourceDetails> {
503
- protected getAllDone: boolean;
504
- protected routes: AventusSharp.Routes.StorableRouter<Item, Request, ResourceSimple, ResourceDetails>;
505
- abstract defineRoutes(): AventusSharp.Routes.StorableRouter<Item, Request, ResourceSimple, ResourceDetails>;
506
- protected constructor();
507
- protected beforeGetAll(): Promise<Aventus.VoidWithError>;
508
- protected beforeGetById(id: number): Promise<Aventus.VoidWithError>;
509
- protected beforeGetByIds(ids: number[]): Promise<Aventus.VoidWithError>;
510
- complete(objects?: ResourceDetails | ResourceDetails[]): AventusSharp.RAM.RamCompletor<ResourceDetails>;
511
- protected transformCreateRequestToItem(item: Request): Promise<Aventus.ResultWithError<ResourceDetails>>;
512
- protected transformCreateRequestListToItem(list: Request[]): Promise<Aventus.ResultWithError<ResourceDetails[]>>;
513
- protected transformUpdateRequestToItem(item: Request): Promise<Aventus.ResultWithError<ResourceDetails>>;
514
- protected transformUpdateRequestListToItem(list: Request[]): Promise<Aventus.ResultWithError<ResourceDetails[]>>;
515
- protected beforeDeleteItem(item: ResourceDetails, fromList: boolean): Promise<Aventus.VoidWithError>;
516
- protected beforeDeleteList(list: ResourceDetails[]): Promise<Aventus.VoidWithError>;
517
- }
518
- }
519
-
520
- namespace WebSocket {
521
- type InternalSocketRoute = AventusSharp.WebSocket.SocketRoute & Aventus.PreparedUri;
522
- }
523
-
524
- namespace WebSocket {
525
- interface ConnectionOptions {
526
- /** Enable or disable log */
527
- log?: boolean;
528
- /** A tag to prefix your log */
529
- logPrefix?: string;
530
- /** Determine the host for the ws connection. By default it's the same as your current url */
531
- host?: string;
532
- /** Determine the port for the ws connection. By default 80 or 443 depends of http or https */
533
- port?: number;
534
- /** Determine if the https must be used. The default value depend of the current http connection */
535
- useHttps?: boolean;
536
- /** Define a list of predefined routes to use */
537
- routes?: {
538
- [key: string]: AventusSharp.WebSocket.InternalSocketRoute[];
539
- };
540
- /**
541
- * Define the name for the websocket
542
- * It ll open the ws connection on /ws/${socketName}
543
- */
544
- socketName?: string;
545
- /**
546
- * Define if the message must be buffered before the socket open.
547
- * If true, when the socket is opened, all messages in buffered will be sent
548
- */
549
- allowSendBeforeOpen?: boolean;
550
- /**
551
- * Define the websocket connection must be open during creation
552
- */
553
- autoStart?: boolean;
554
- /**
555
- * Define if a /ping msg must be sent
556
- */
557
- sendPing?: number;
558
- }
559
- }
560
-
561
- namespace WebSocket {
562
- class SocketError extends Aventus.GenericError<AventusSharp.WebSocket.SocketErrorCode> {
563
- }
564
- }
565
-
566
- namespace WebSocket {
567
- abstract class Connection {
568
- static Debug: boolean;
569
- protected options: Required<AventusSharp.WebSocket.ConnectionOptions>;
570
- protected waitingList: {
571
- [uuid: string]: (channel: string, data: any) => void;
572
- };
573
- protected memoryBeforeOpen: AventusSharp.WebSocket.SocketSendMessageOptions[];
574
- protected socket?: AventusSharp.WebSocket.Socket;
575
- protected actionGuard: Aventus.ActionGuard;
576
- /**
577
- * Create a singleton
578
- */
579
- static getInstance(): AventusSharp.WebSocket.Connection;
580
- protected constructor();
581
- readonly onOpen: Aventus.Callback<() => void>;
582
- readonly onClose: Aventus.Callback<(event: Event) => void>;
583
- readonly onError: Aventus.Callback<(event: Event) => void>;
584
- /**
585
- * Define the configuration for your websocket
586
- */
587
- protected abstract configure(options: AventusSharp.WebSocket.ConnectionOptions): AventusSharp.WebSocket.ConnectionOptions;
588
- /**
589
- * Configure a new Websocket
590
- */
591
- protected _configure(options?: AventusSharp.WebSocket.ConnectionOptions): Required<AventusSharp.WebSocket.ConnectionOptions>;
592
- private getUrl;
593
- /**
594
- * Add a new route to listen to the websocket
595
- */
596
- addRoute(newRoute: AventusSharp.WebSocket.SocketRoute): void;
597
- /**
598
- * The route to remove
599
- * @param route - The route to remove
600
- */
601
- removeRoute(route: AventusSharp.WebSocket.SocketRoute): void;
602
- protected openCallback: ((isOpen: boolean) => void) | undefined;
603
- /**
604
- * Try to open the websocket
605
- */
606
- open(): Promise<boolean>;
607
- protected jsonReplacer(key: string, value: any): any;
608
- /**
609
- * Send a message though the websocket
610
- * @param channelName The channel on which the message is sent
611
- * @param data The data to send
612
- * @param options the options to add to the message (typically the uid)
613
- */
614
- sendMessage<T>(options: AventusSharp.WebSocket.SocketSendMessageOptions): Promise<Aventus.VoidWithError>;
615
- /**
616
- * Send a message though the websocket and wait one answer give in parameters callbacks
617
- * @param channelName The channel on which the message is sent
618
- * @param body The data to send
619
- * @param timeout The timeout before the request failed
620
- */
621
- sendMessageAndWait<T>(options: AventusSharp.WebSocket.SocketSendMessageOptions): Promise<Aventus.ResultWithError<Aventus.ExtractFromError<T>>>;
622
- /**
623
- * Check if socket is ready
624
- */
625
- isReady(): boolean;
626
- protected sendPingTimeout: number;
627
- protected sendPing(): void;
628
- protected startPing(): void;
629
- protected stopPing(): void;
630
- protected _onOpen(): void;
631
- protected errorOccur: boolean;
632
- protected _onError(event: Event): void;
633
- protected _onClose(event: Event): void;
634
- /**
635
- * Close the current connection
636
- */
637
- close(): void;
638
- protected onMessage(event: MessageEvent<any>): void;
639
- /**
640
- * Print a msg inside the console
641
- */
642
- protected log(message: {} | string): void;
643
- }
644
- }
645
-
646
- namespace WebSocket {
647
- class EndPoint extends AventusSharp.WebSocket.Connection {
648
- /**
649
- * Create a singleton
650
- */
651
- static getInstance(): AventusSharp.WebSocket.EndPoint;
652
- protected constructor();
653
- protected register(): void;
654
- /**
655
- * @inheritdoc
656
- */
657
- protected configure(options: AventusSharp.WebSocket.ConnectionOptions): AventusSharp.WebSocket.ConnectionOptions;
658
- protected get path(): string;
659
- }
660
- }
661
-
662
- namespace WebSocket {
663
- type WsEndPointType = (abstract new (...args: any[]) => AventusSharp.WebSocket.EndPoint);
664
- }
665
-
666
- namespace WebSocket {
667
- abstract class WsEvent<T extends any = any> {
668
- protected endpoint: AventusSharp.WebSocket.EndPoint;
669
- onTrigger: Aventus.Callback<(item: Aventus.ExtractFromError<T>, params: Aventus.UriParamsValue, uid?: string) => void>;
670
- protected routeInfo: AventusSharp.WebSocket.SocketRoute<Aventus.ExtractFromError<T>>;
671
- protected _listening: boolean;
672
- get listening(): boolean;
673
- getPrefix: () => string;
674
- constructor(endpoint?: AventusSharp.WebSocket.EndPoint, getPrefix?: () => string);
675
- init(): void;
676
- /**
677
- * Define the websocket path
678
- */
679
- protected abstract path(): string;
680
- /**
681
- * Override this method to tell that the event must listen when created
682
- */
683
- protected listenOnBoot(): boolean;
684
- /**
685
- * Add the event to the endpoint. After that, the on trigger event can be triggered
686
- */
687
- listen(): void;
688
- /**
689
- * Remove the event from the endpoint. After that, the on trigger event won't be triggered
690
- */
691
- stop(): void;
692
- protected onEvent(data: Aventus.ExtractFromError<T>, params: Aventus.UriParamsValue, uid?: string): void;
693
- }
694
- }
695
-
696
- namespace WebSocket {
697
- type ExtractResultFrom<T extends AventusSharp.WebSocket.WsEvent, U = any> = T extends AventusSharp.WebSocket.WsEvent<infer U> ? U : never;
698
- }
699
-
700
- namespace WebSocket {
701
- type WsEventType = abstract new (...args: any[]) => AventusSharp.WebSocket.WsEvent;
702
- }
703
-
704
- type ExtractResponse<T extends AventusSharp.WebSocket.WsEvent<U>, U = any> = T extends AventusSharp.WebSocket.WsEvent<infer U> ? Aventus.ResultWithError<Aventus.ExtractFromError<U>> : never;
705
-
706
- namespace WebSocket {
707
- class StorableWsRoute_DeleteMany extends AventusSharp.WebSocket.WsEvent<Aventus.ResultWithError<number[]>> {
708
- /**
709
- * @inheritdoc
710
- */
711
- protected path(): string;
712
- StorableName: () => string;
713
- constructor(endpoint: AventusSharp.WebSocket.EndPoint, getPrefix?: () => string, StorableName?: () => string);
714
- }
715
- }
716
-
717
- namespace WebSocket {
718
- class StorableWsRouter_Delete extends AventusSharp.WebSocket.WsEvent<number> {
719
- StorableName: () => string;
720
- constructor(endpoint: AventusSharp.WebSocket.EndPoint, getPrefix: () => string, StorableName: () => string);
721
- /**
722
- * @inheritdoc
723
- */
724
- protected path(): string;
725
- }
726
- }
727
-
728
- namespace WebSocket {
729
- class StorableWsRoute_UpdateMany<T> extends AventusSharp.WebSocket.WsEvent<Aventus.ResultWithError<T[]>> {
730
- /**
731
- * @inheritdoc
732
- */
733
- protected path(): string;
734
- StorableName: () => string;
735
- constructor(endpoint: AventusSharp.WebSocket.EndPoint, getPrefix?: () => string, StorableName?: () => string);
736
- }
737
- }
738
-
739
- namespace WebSocket {
740
- class StorableWsRouter_Update<T> extends AventusSharp.WebSocket.WsEvent<T> {
741
- StorableName: () => string;
742
- constructor(endpoint: AventusSharp.WebSocket.EndPoint, getPrefix: () => string, StorableName: () => string);
743
- /**
744
- * @inheritdoc
745
- */
746
- protected path(): string;
747
- }
748
- }
749
-
750
- namespace WebSocket {
751
- class StorableWsRouter_GetByIds<T> extends AventusSharp.WebSocket.WsEvent<T[]> {
752
- StorableName: () => string;
753
- constructor(endpoint: AventusSharp.WebSocket.EndPoint, getPrefix: () => string, StorableName: () => string);
754
- /**
755
- * @inheritdoc
756
- */
757
- protected path(): string;
758
- }
759
- }
760
-
761
- namespace WebSocket {
762
- class StorableWsRouter_GetById<T> extends AventusSharp.WebSocket.WsEvent<T> {
763
- StorableName: () => string;
764
- constructor(endpoint: AventusSharp.WebSocket.EndPoint, getPrefix: () => string, StorableName: () => string);
765
- /**
766
- * @inheritdoc
767
- */
768
- protected path(): string;
769
- }
770
- }
771
-
772
- namespace WebSocket {
773
- class StorableWsRoute_CreateMany<T> extends AventusSharp.WebSocket.WsEvent<Aventus.ResultWithError<T[]>> {
774
- /**
775
- * @inheritdoc
776
- */
777
- protected path(): string;
778
- StorableName: () => string;
779
- constructor(endpoint: AventusSharp.WebSocket.EndPoint, getPrefix?: () => string, StorableName?: () => string);
780
- }
781
- }
782
-
783
- namespace WebSocket {
784
- class StorableWsRouter_Create<T> extends AventusSharp.WebSocket.WsEvent<T> {
785
- StorableName: () => string;
786
- constructor(endpoint: AventusSharp.WebSocket.EndPoint, getPrefix: () => string, StorableName: () => string);
787
- /**
788
- * @inheritdoc
789
- */
790
- protected path(): string;
791
- }
792
- }
793
-
794
- namespace WebSocket {
795
- class StorableWsRouter_GetAll<T> extends AventusSharp.WebSocket.WsEvent<T[]> {
796
- StorableName: () => string;
797
- constructor(endpoint: AventusSharp.WebSocket.EndPoint, getPrefix: () => string, StorableName: () => string);
798
- /**
799
- * @inheritdoc
800
- */
801
- protected path(): string;
802
- }
803
- }
804
-
805
- namespace WebSocket {
806
- type RouterRoutes = {
807
- [name: string]: AventusSharp.WebSocket.WsEvent;
808
- };
809
- }
810
-
811
- namespace WebSocket {
812
- class Router<T extends AventusSharp.WebSocket.RouterRoutes> {
813
- readonly endpoint: AventusSharp.WebSocket.EndPoint;
814
- events: T;
815
- constructor(endpoint?: AventusSharp.WebSocket.EndPoint);
816
- getPrefix(): string;
817
- protected defineEvents(): Partial<T>;
818
- }
819
- }
820
-
821
- namespace WebSocket {
822
- type WsRouterType = abstract new (...args: any[]) => AventusSharp.WebSocket.Router<any>;
823
- }
824
-
825
- namespace WebSocket {
826
- type StorableWsRouter__Routes<T extends Aventus.IData, U extends AventusSharp.Routes.Request.Request | T = T, R extends AventusSharp.Routes.Response.Resource | T = T, S extends AventusSharp.Routes.Response.Resource | T = R> = {
827
- GetAll: AventusSharp.WebSocket.StorableWsRouter_GetAll<R>;
828
- Create: AventusSharp.WebSocket.StorableWsRouter_Create<S>;
829
- CreateMany: AventusSharp.WebSocket.StorableWsRoute_CreateMany<S>;
830
- GetById: AventusSharp.WebSocket.StorableWsRouter_GetById<S>;
831
- GetByIds: AventusSharp.WebSocket.StorableWsRouter_GetByIds<S>;
832
- Update: AventusSharp.WebSocket.StorableWsRouter_Update<S>;
833
- UpdateMany: AventusSharp.WebSocket.StorableWsRoute_UpdateMany<S>;
834
- Delete: AventusSharp.WebSocket.StorableWsRouter_Delete;
835
- DeleteMany: AventusSharp.WebSocket.StorableWsRoute_DeleteMany;
836
- };
837
- }
838
-
839
- namespace WebSocket {
840
- abstract class StorableWsRouter<T extends Aventus.IData, U extends AventusSharp.Routes.Request.Request | T = T, R extends AventusSharp.Routes.Response.Resource | T = T, S extends AventusSharp.Routes.Response.Resource | T = R, __Route extends AventusSharp.WebSocket.StorableWsRouter__Routes<T, U, R, S> = AventusSharp.WebSocket.StorableWsRouter__Routes<T, U, R, S>> extends AventusSharp.WebSocket.Router<__Route> {
841
- protected defineEvents(): Partial<__Route>;
842
- GetAll(options?: AventusSharp.WebSocket.WsRouteSendOptions): Promise<AventusSharp.ExtractResponse<AventusSharp.WebSocket.StorableWsRouter_GetAll<R>>>;
843
- Create(body: {
844
- request: U;
845
- }, options?: AventusSharp.WebSocket.WsRouteSendOptions): Promise<AventusSharp.ExtractResponse<AventusSharp.WebSocket.StorableWsRouter_Create<S>>>;
846
- CreateMany(body: {
847
- list: U[];
848
- }, options?: AventusSharp.WebSocket.WsRouteSendOptions): Promise<AventusSharp.ExtractResponse<AventusSharp.WebSocket.StorableWsRoute_CreateMany<T>>>;
849
- GetById(id: number, options?: AventusSharp.WebSocket.WsRouteSendOptions): Promise<AventusSharp.ExtractResponse<AventusSharp.WebSocket.StorableWsRouter_GetById<S>>>;
850
- GetByIds(body: {
851
- ids: number[];
852
- }, options?: AventusSharp.WebSocket.WsRouteSendOptions): Promise<AventusSharp.ExtractResponse<AventusSharp.WebSocket.StorableWsRouter_GetByIds<S>>>;
853
- Update(id: number, body: {
854
- request: U;
855
- }, options?: AventusSharp.WebSocket.WsRouteSendOptions): Promise<AventusSharp.ExtractResponse<AventusSharp.WebSocket.StorableWsRouter_Update<S>>>;
856
- UpdateMany(body: {
857
- list: U[];
858
- }, options?: AventusSharp.WebSocket.WsRouteSendOptions): Promise<AventusSharp.ExtractResponse<AventusSharp.WebSocket.StorableWsRoute_UpdateMany<T>>>;
859
- Delete(id: number, options?: AventusSharp.WebSocket.WsRouteSendOptions): Promise<AventusSharp.ExtractResponse<AventusSharp.WebSocket.StorableWsRouter_Delete>>;
860
- DeleteMany(body: {
861
- ids: number[];
862
- }, options?: AventusSharp.WebSocket.WsRouteSendOptions): Promise<AventusSharp.ExtractResponse<AventusSharp.WebSocket.StorableWsRoute_DeleteMany>>;
863
- abstract StorableName(): string;
864
- }
865
- }
866
-
867
- namespace RAM {
868
- abstract class RamWebSocket<Item extends AventusSharp.Data.Storable, Request extends AventusSharp.Routes.Request.Request | Item = Item, ResourceSimple extends AventusSharp.Routes.Response.Resource | Item = Item, ResourceDetails extends ResourceSimple = ResourceSimple> extends Aventus.Ram<Item, Request, ResourceSimple, ResourceDetails> {
869
- protected getAllDone: boolean;
870
- private routes;
871
- protected otherGetAllLocked: {
872
- [uid: string]: true;
873
- };
874
- protected otherGetByIdLocked: {
875
- [uid: string]: true;
876
- };
877
- protected otherCreateItemLocked: {
878
- [uid: string]: true;
879
- };
880
- protected otherCreateListLocked: {
881
- [uid: string]: true;
882
- };
883
- protected otherUpdateItemLocked: {
884
- [uid: string]: true;
885
- };
886
- protected otherUpdateListLocked: {
887
- [uid: string]: true;
888
- };
889
- protected otherDeleteItemLocked: {
890
- [uid: string]: true;
891
- };
892
- protected otherDeleteListLocked: {
893
- [uid: string]: true;
894
- };
895
- abstract defineRoutes(): AventusSharp.WebSocket.StorableWsRouter<Item, Request, ResourceSimple, ResourceDetails>;
896
- protected constructor();
897
- protected addOrUpdateData(item: ResourceDetails | Aventus.ExtractFromError<ResourceDetails> | ResourceSimple | Aventus.ExtractFromError<ResourceSimple>): Promise<AventusSharp.Tools.ResultWithError<{
898
- kind: "created" | "updated";
899
- value: Aventus.RamItem<ResourceDetails, Request>;
900
- }>>;
901
- protected addEventsBindings(): void;
902
- protected listenOnStart(): AventusSharp.RAM.RamWebSocketListenOnStart;
903
- complete(objects?: ResourceDetails | ResourceDetails[]): AventusSharp.RAM.RamCompletor<ResourceDetails>;
904
- @BindThis()
905
- protected otherGetAll(items: ResourceSimple[], params: Aventus.UriParamsValue, uid?: string): Promise<void>;
906
- protected beforeGetAll(): Promise<AventusSharp.Tools.VoidWithError>;
907
- @BindThis()
908
- protected otherGetById(item: Aventus.ExtractFromError<ResourceDetails>, params: Aventus.UriParamsValue, uid?: string): any;
909
- protected beforeGetById(id: number): Promise<AventusSharp.Tools.VoidWithError>;
910
- protected beforeGetByIds(ids: number[]): Promise<AventusSharp.Tools.VoidWithError>;
911
- @BindThis()
912
- protected otherCreateItem(item: Aventus.ExtractFromError<ResourceDetails>, params: Aventus.UriParamsValue, uid?: string): any;
913
- protected transformCreateRequestListToItem(list: Request[]): Promise<AventusSharp.Tools.ResultWithError<ResourceDetails[]>>;
914
- protected transformCreateRequestToItem(item: Request): Promise<AventusSharp.Tools.ResultWithError<ResourceDetails>>;
915
- @BindThis()
916
- protected otherCreateList(items: Aventus.ExtractFromError<ResourceDetails[]>, params: Aventus.UriParamsValue, uid?: string): any;
917
- @BindThis()
918
- protected otherUpdateItem(item: Aventus.ExtractFromError<ResourceDetails>, params: Aventus.UriParamsValue, uid?: string): any;
919
- protected transformUpdateRequestListToItem(list: Request[]): Promise<AventusSharp.Tools.ResultWithError<ResourceDetails[]>>;
920
- protected transformUpdateRequestToItem(item: Request): Promise<AventusSharp.Tools.ResultWithError<ResourceDetails>>;
921
- @BindThis()
922
- protected otherUpdateList(items: Aventus.ExtractFromError<ResourceDetails[]>, params: Aventus.UriParamsValue, uid?: string): any;
923
- @BindThis()
924
- protected otherDeleteItem(id: Aventus.ExtractFromError<number>, params: Aventus.UriParamsValue, uid?: string): void;
925
- protected beforeDeleteItem(item: ResourceDetails, fromList: boolean): Promise<AventusSharp.Tools.VoidWithError>;
926
- @BindThis()
927
- protected otherDeleteList(ids: number[], params: Aventus.UriParamsValue, uid?: string): void;
928
- protected beforeDeleteList(list: ResourceDetails[]): Promise<AventusSharp.Tools.VoidWithError>;
929
- /**
930
- * Delete element inside Ram without firing delete event
931
- */
932
- protected deleteData(id: number): AventusSharp.Tools.ResultWithError<Aventus.RamItem<ResourceDetails, Request>>;
933
- }
934
- }
935
-
936
- }
937
- }
938
- declare module ___AventusSharp {
939
- namespace RAM {
940
- type KeysOfType<T, U> = {
941
- [K in keyof T]: NonNullable<T[K]> extends U ? K : never;
942
- }[keyof T];
943
- }
944
-
945
- namespace RAM {
946
- type NumberKeys<T> = {
947
- [K in keyof T]: T[K] extends number ? K : never;
948
- }[keyof T];
949
- }
950
-
951
- type MauiConfig = {
952
- filter: (url: string, method: string) => boolean;
953
- showLog: boolean;
954
- autoLoad: boolean;
955
- };
956
-
957
- namespace RAM {
958
- type ItemField<T, U extends Aventus.IRamData> = {
959
- id: AventusSharp.RAM.NumberKeys<T>;
960
- obj: AventusSharp.RAM.KeysOfType<T, U>;
961
- ram: typeof Aventus.Ram<U>;
962
- };
963
- }
964
- }//#endregion js def //
965
- //#region js src //
966
- {"namespace":"AventusSharp","available":[{"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__as1(_.WebSocket, 'SocketErrorCode', WebSocket.SocketErrorCode);\n","dependencies":[],"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`;\n__as1(_.WebSocket, 'Socket', WebSocket.Socket);\n","dependencies":[{"fullName":"AventusSharp.WebSocket.Socket","isStrong":false},{"fullName":"Aventus.Callback","isStrong":false}],"fullName":"AventusSharp.WebSocket.Socket","required":false,"type":1,"isExported":true,"convertibleName":""},{"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`;\nData.Storable.$schema={...(Aventus.Data?.$schema ?? {}), \"Id\":\"number\"};\nAventus.Converter.register(Data.Storable.Fullname, Data.Storable);\n__as1(_.Data, 'Storable', Data.Storable);\n","dependencies":[{"fullName":"Aventus.Data","isStrong":true},{"fullName":"Aventus.IData","isStrong":true}],"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`;\nData.StorableTimestamp.$schema={...(Data.Storable?.$schema ?? {}), \"CreatedDate\":\"Date\",\"UpdatedDate\":\"Date\"};\nAventus.Converter.register(Data.StorableTimestamp.Fullname, Data.StorableTimestamp);\n__as1(_.Data, 'StorableTimestamp', Data.StorableTimestamp);\n","dependencies":[{"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[\"UnknownError\"] = 0] = \"UnknownError\";\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__as1(_.WebSocket, 'WsErrorCode', WebSocket.WsErrorCode);\n","dependencies":[],"fullName":"AventusSharp.WebSocket.WsErrorCode","required":false,"type":6,"isExported":true,"convertibleName":""},{"code":"(function (SSEErrorCode) {\n SSEErrorCode[SSEErrorCode[\"UnknownError\"] = 0] = \"UnknownError\";\n SSEErrorCode[SSEErrorCode[\"CantDefineAssembly\"] = 1] = \"CantDefineAssembly\";\n SSEErrorCode[SSEErrorCode[\"ConfigError\"] = 2] = \"ConfigError\";\n SSEErrorCode[SSEErrorCode[\"MultipleMainEndpoint\"] = 3] = \"MultipleMainEndpoint\";\n SSEErrorCode[SSEErrorCode[\"CantGetValueFromBody\"] = 4] = \"CantGetValueFromBody\";\n SSEErrorCode[SSEErrorCode[\"NoEndPoint\"] = 5] = \"NoEndPoint\";\n})(SSE.SSEErrorCode || (SSE.SSEErrorCode = {}));\n__as1(_.SSE, 'SSEErrorCode', SSE.SSEErrorCode);\n","dependencies":[],"fullName":"AventusSharp.SSE.SSEErrorCode","required":false,"type":6,"isExported":true,"convertibleName":""},{"code":"(function (RouteErrorCode) {\n RouteErrorCode[RouteErrorCode[\"UnknownError\"] = 0] = \"UnknownError\";\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 RouteErrorCode[RouteErrorCode[\"ConfigError\"] = 6] = \"ConfigError\";\n})(Routes.RouteErrorCode || (Routes.RouteErrorCode = {}));\n__as1(_.Routes, 'RouteErrorCode', Routes.RouteErrorCode);\n","dependencies":[],"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[\"SelfReferecingDependency\"] = 8] = \"SelfReferecingDependency\";\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[\"UnknownError\"] = 16] = \"UnknownError\";\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[\"ReverseLinkExist\"] = 37] = \"ReverseLinkExist\";\n DataErrorCode[DataErrorCode[\"ErrorCreatingReverseQuery\"] = 38] = \"ErrorCreatingReverseQuery\";\n DataErrorCode[DataErrorCode[\"LinkNotSet\"] = 39] = \"LinkNotSet\";\n DataErrorCode[DataErrorCode[\"MultipleProvidersNotSet\"] = 40] = \"MultipleProvidersNotSet\";\n DataErrorCode[DataErrorCode[\"FileNotFound\"] = 41] = \"FileNotFound\";\n DataErrorCode[DataErrorCode[\"PyramidNotFound\"] = 42] = \"PyramidNotFound\";\n DataErrorCode[DataErrorCode[\"IsReadOnly\"] = 43] = \"IsReadOnly\";\n DataErrorCode[DataErrorCode[\"ReverseLinkNotPrepared\"] = 44] = \"ReverseLinkNotPrepared\";\n DataErrorCode[DataErrorCode[\"ExternalStorageNotPrepared\"] = 45] = \"ExternalStorageNotPrepared\";\n})(Data.DataErrorCode || (Data.DataErrorCode = {}));\n__as1(_.Data, 'DataErrorCode', Data.DataErrorCode);\n","dependencies":[],"fullName":"AventusSharp.Data.DataErrorCode","required":false,"type":6,"isExported":true,"convertibleName":""},{"code":"(function (ImageFileErrorCode) {\n ImageFileErrorCode[ImageFileErrorCode[\"UnknownError\"] = 0] = \"UnknownError\";\n ImageFileErrorCode[ImageFileErrorCode[\"NotValidImage\"] = 1] = \"NotValidImage\";\n ImageFileErrorCode[ImageFileErrorCode[\"FileNotSvg\"] = 2] = \"FileNotSvg\";\n ImageFileErrorCode[ImageFileErrorCode[\"NoSize\"] = 3] = \"NoSize\";\n})(Data.CustomTableMembers.ImageFileErrorCode || (Data.CustomTableMembers.ImageFileErrorCode = {}));\n__as1(_.Data.CustomTableMembers, 'ImageFileErrorCode', Data.CustomTableMembers.ImageFileErrorCode);\n","dependencies":[],"fullName":"AventusSharp.Data.CustomTableMembers.ImageFileErrorCode","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`;\n__as1(_.Data, 'SharpClass', Data.SharpClass);\n","dependencies":[],"fullName":"AventusSharp.Data.SharpClass","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"Routes.Request.Request=class Request extends Data.SharpClass {\n}\nRoutes.Request.Request.Namespace=`AventusSharp.Routes.Request`;\n__as1(_.Routes.Request, 'Request', Routes.Request.Request);\n","dependencies":[{"fullName":"AventusSharp.Data.SharpClass","isStrong":true}],"fullName":"AventusSharp.Routes.Request.Request","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"Routes.Response.Resource=class Resource extends Data.SharpClass {\n toRequest(request) {\n const result = new request();\n const resourceClone = Aventus.clone(this);\n Aventus.Json.classFromJson(result, resourceClone, {\n replaceUndefined: true\n });\n return result;\n }\n}\nRoutes.Response.Resource.Namespace=`AventusSharp.Routes.Response`;\n__as1(_.Routes.Response, 'Resource', Routes.Response.Resource);\n","dependencies":[{"fullName":"AventusSharp.Data.SharpClass","isStrong":true},{"fullName":"AventusSharp.Routes.Request.Request","isStrong":false},{"fullName":"T","isStrong":false},{"fullName":"Aventus.clone","isStrong":false},{"fullName":"Aventus.Json","isStrong":false}],"fullName":"AventusSharp.Routes.Response.Resource","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"Data.FieldErrorInfo=class FieldErrorInfo extends _.Data.SharpClass {\n static get Fullname() { return \"AventusSharp.Data.FieldErrorInfo, AventusSharp.Core\"; }\n Name;\n}\nData.FieldErrorInfo.Namespace=`AventusSharp.Data`;\nData.FieldErrorInfo.$schema={...(Data.SharpClass?.$schema ?? {}), \"Name\":\"string\"};\nAventus.Converter.register(Data.FieldErrorInfo.Fullname, Data.FieldErrorInfo);\n__as1(_.Data, 'FieldErrorInfo', Data.FieldErrorInfo);\n","dependencies":[{"fullName":"AventusSharp.Data.SharpClass","isStrong":true},{"fullName":"Convertible","isStrong":false}],"fullName":"AventusSharp.Data.FieldErrorInfo","required":false,"type":1,"isExported":true,"convertibleName":"Fullname"},{"code":"Data.CustomTableMembers.AventusFile=class AventusFile {\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.CustomTableMembers.AventusFile.Namespace=`AventusSharp.Data.CustomTableMembers`;\n__as1(_.Data.CustomTableMembers, 'AventusFile', Data.CustomTableMembers.AventusFile);\n","dependencies":[],"fullName":"AventusSharp.Data.CustomTableMembers.AventusFile","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"Data.CustomTableMembers.AventusImage=class AventusImage extends _.Data.CustomTableMembers.AventusFile {\n}\nData.CustomTableMembers.AventusImage.Namespace=`AventusSharp.Data.CustomTableMembers`;\n__as1(_.Data.CustomTableMembers, 'AventusImage', Data.CustomTableMembers.AventusImage);\n","dependencies":[{"fullName":"AventusSharp.Data.CustomTableMembers.AventusFile","isStrong":true},{"fullName":"Aventus.IData","isStrong":false}],"fullName":"AventusSharp.Data.CustomTableMembers.AventusImage","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"Data.Datetime=class Datetime extends _.Data.SharpClass {\n static get Fullname() { return \"AventusSharp.Data.Datetime, AventusSharp.Core\"; }\n DateTime;\n}\nData.Datetime.Namespace=`AventusSharp.Data`;\nData.Datetime.$schema={...(Data.SharpClass?.$schema ?? {}), \"DateTime\":\"AventusSharp.RealDate\"};\nAventus.Converter.register(Data.Datetime.Fullname, Data.Datetime);\n__as1(_.Data, 'Datetime', Data.Datetime);\n","dependencies":[{"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.Core\"; }\n DateTime;\n}\nData.Date.Namespace=`AventusSharp.Data`;\nData.Date.$schema={...(Data.SharpClass?.$schema ?? {}), \"DateTime\":\"AventusSharp.RealDate\"};\nAventus.Converter.register(Data.Date.Fullname, Data.Date);\n__as1(_.Data, 'Date', Data.Date);\n","dependencies":[{"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.CustomTableMembers.ImageFileError=class ImageFileError extends Aventus.GenericError {\n static get Fullname() { return \"AventusSharp.Data.CustomTableMembers.ImageFileError, AventusSharp.Core\"; }\n}\nData.CustomTableMembers.ImageFileError.Namespace=`AventusSharp.Data.CustomTableMembers`;\nData.CustomTableMembers.ImageFileError.$schema={...(Aventus.GenericError?.$schema ?? {}), };\nAventus.Converter.register(Data.CustomTableMembers.ImageFileError.Fullname, Data.CustomTableMembers.ImageFileError);\n__as1(_.Data.CustomTableMembers, 'ImageFileError', Data.CustomTableMembers.ImageFileError);\n","dependencies":[{"fullName":"Aventus.GenericError","isStrong":true},{"fullName":"AventusSharp.Data.CustomTableMembers.ImageFileErrorCode","isStrong":true},{"fullName":"Convertible","isStrong":false}],"fullName":"AventusSharp.Data.CustomTableMembers.ImageFileError","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.Core\"; }\n}\nTools.VoidWithError.Namespace=`AventusSharp.Tools`;\nTools.VoidWithError.$schema={...(Aventus.VoidWithError?.$schema ?? {}), };\nAventus.Converter.register(Tools.VoidWithError.Fullname, Tools.VoidWithError);\n__as1(_.Tools, 'VoidWithError', Tools.VoidWithError);\n","dependencies":[{"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.CustomTableMembers.VoidWithImageFileError=class VoidWithImageFileError extends Tools.VoidWithError {\n static get Fullname() { return \"AventusSharp.Data.CustomTableMembers.VoidWithImageFileError, AventusSharp.Core\"; }\n}\nData.CustomTableMembers.VoidWithImageFileError.Namespace=`AventusSharp.Data.CustomTableMembers`;\nData.CustomTableMembers.VoidWithImageFileError.$schema={...(Tools.VoidWithError?.$schema ?? {}), };\nAventus.Converter.register(Data.CustomTableMembers.VoidWithImageFileError.Fullname, Data.CustomTableMembers.VoidWithImageFileError);\n__as1(_.Data.CustomTableMembers, 'VoidWithImageFileError', Data.CustomTableMembers.VoidWithImageFileError);\n","dependencies":[{"fullName":"AventusSharp.Tools.VoidWithError","isStrong":true},{"fullName":"AventusSharp.Data.CustomTableMembers.ImageFileError","isStrong":false},{"fullName":"Convertible","isStrong":false}],"fullName":"AventusSharp.Data.CustomTableMembers.VoidWithImageFileError","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.Core\"; }\n}\nTools.ResultWithError.Namespace=`AventusSharp.Tools`;\nTools.ResultWithError.$schema={...(Aventus.ResultWithError?.$schema ?? {}), };\nAventus.Converter.register(Tools.ResultWithError.Fullname, Tools.ResultWithError);\n__as1(_.Tools, 'ResultWithError', Tools.ResultWithError);\n","dependencies":[{"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(router) {\n super(router);\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`;\n__as1(_.Routes, 'StorableRouter', Routes.StorableRouter);\n","dependencies":[{"fullName":"Aventus.HttpRoute","isStrong":true},{"fullName":"Aventus.IData","isStrong":false},{"fullName":"AventusSharp.Routes.Request.Request","isStrong":false},{"fullName":"AventusSharp.Routes.Response.Resource","isStrong":false},{"fullName":"BindThis","isStrong":false},{"fullName":"AventusSharp.Tools.ResultWithError","isStrong":false},{"fullName":"TypeResult","isStrong":false}],"fullName":"AventusSharp.Routes.StorableRouter","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"Data.CustomTableMembers.ResultWithImageFileError=class ResultWithImageFileError extends Tools.ResultWithError {\n static get Fullname() { return \"AventusSharp.Data.CustomTableMembers.ResultWithImageFileError, AventusSharp.Core\"; }\n}\nData.CustomTableMembers.ResultWithImageFileError.Namespace=`AventusSharp.Data.CustomTableMembers`;\nData.CustomTableMembers.ResultWithImageFileError.$schema={...(Tools.ResultWithError?.$schema ?? {}), };\nAventus.Converter.register(Data.CustomTableMembers.ResultWithImageFileError.Fullname, Data.CustomTableMembers.ResultWithImageFileError);\n__as1(_.Data.CustomTableMembers, 'ResultWithImageFileError', Data.CustomTableMembers.ResultWithImageFileError);\n","dependencies":[{"fullName":"AventusSharp.Tools.ResultWithError","isStrong":true},{"fullName":"AventusSharp.Data.CustomTableMembers.ImageFileError","isStrong":false},{"fullName":"Convertible","isStrong":false}],"fullName":"AventusSharp.Data.CustomTableMembers.ResultWithImageFileError","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.Core\"; }\n}\nData.DataError.Namespace=`AventusSharp.Data`;\nData.DataError.$schema={...(Aventus.GenericError?.$schema ?? {}), };\nAventus.Converter.register(Data.DataError.Fullname, Data.DataError);\n__as1(_.Data, 'DataError', Data.DataError);\n","dependencies":[{"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":"Data.ResultWithDataError=class ResultWithDataError extends Tools.ResultWithError {\n static get Fullname() { return \"AventusSharp.Data.ResultWithDataError, AventusSharp.Core\"; }\n}\nData.ResultWithDataError.Namespace=`AventusSharp.Data`;\nData.ResultWithDataError.$schema={...(Tools.ResultWithError?.$schema ?? {}), };\nAventus.Converter.register(Data.ResultWithDataError.Fullname, Data.ResultWithDataError);\n__as1(_.Data, 'ResultWithDataError', Data.ResultWithDataError);\n","dependencies":[{"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":"Data.VoidWithDataError=class VoidWithDataError extends Tools.VoidWithError {\n static get Fullname() { return \"AventusSharp.Data.VoidWithDataError, AventusSharp.Core\"; }\n}\nData.VoidWithDataError.Namespace=`AventusSharp.Data`;\nData.VoidWithDataError.$schema={...(Tools.VoidWithError?.$schema ?? {}), };\nAventus.Converter.register(Data.VoidWithDataError.Fullname, Data.VoidWithDataError);\n__as1(_.Data, 'VoidWithDataError', Data.VoidWithDataError);\n","dependencies":[{"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":"Routes.RouteError=class RouteError extends Aventus.GenericError {\n static get Fullname() { return \"AventusSharp.Routes.RouteError, AventusSharp.Core\"; }\n}\nRoutes.RouteError.Namespace=`AventusSharp.Routes`;\nRoutes.RouteError.$schema={...(Aventus.GenericError?.$schema ?? {}), };\nAventus.Converter.register(Routes.RouteError.Fullname, Routes.RouteError);\n__as1(_.Routes, 'RouteError', Routes.RouteError);\n","dependencies":[{"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.Core\"; }\n}\nRoutes.ResultWithRouteError.Namespace=`AventusSharp.Routes`;\nRoutes.ResultWithRouteError.$schema={...(Tools.ResultWithError?.$schema ?? {}), };\nAventus.Converter.register(Routes.ResultWithRouteError.Fullname, Routes.ResultWithRouteError);\n__as1(_.Routes, 'ResultWithRouteError', Routes.ResultWithRouteError);\n","dependencies":[{"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.Core\"; }\n}\nRoutes.VoidWithRouteError.Namespace=`AventusSharp.Routes`;\nRoutes.VoidWithRouteError.$schema={...(Tools.VoidWithError?.$schema ?? {}), };\nAventus.Converter.register(Routes.VoidWithRouteError.Fullname, Routes.VoidWithRouteError);\n__as1(_.Routes, 'VoidWithRouteError', Routes.VoidWithRouteError);\n","dependencies":[{"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":"SSE.SSEError=class SSEError extends Aventus.GenericError {\n static get Fullname() { return \"AventusSharp.SSE.SSEError, AventusSharp.AspNetCore\"; }\n}\nSSE.SSEError.Namespace=`AventusSharp.SSE`;\nSSE.SSEError.$schema={...(Aventus.GenericError?.$schema ?? {}), };\nAventus.Converter.register(SSE.SSEError.Fullname, SSE.SSEError);\n__as1(_.SSE, 'SSEError', SSE.SSEError);\n","dependencies":[{"fullName":"Aventus.GenericError","isStrong":true},{"fullName":"AventusSharp.SSE.SSEErrorCode","isStrong":true},{"fullName":"Convertible","isStrong":false}],"fullName":"AventusSharp.SSE.SSEError","required":false,"type":1,"isExported":true,"convertibleName":"Fullname"},{"code":"SSE.ResultWithSSEError=class ResultWithSSEError extends Tools.ResultWithError {\n static get Fullname() { return \"AventusSharp.SSE.ResultWithSSEError, AventusSharp.AspNetCore\"; }\n}\nSSE.ResultWithSSEError.Namespace=`AventusSharp.SSE`;\nSSE.ResultWithSSEError.$schema={...(Tools.ResultWithError?.$schema ?? {}), };\nAventus.Converter.register(SSE.ResultWithSSEError.Fullname, SSE.ResultWithSSEError);\n__as1(_.SSE, 'ResultWithSSEError', SSE.ResultWithSSEError);\n","dependencies":[{"fullName":"AventusSharp.Tools.ResultWithError","isStrong":true},{"fullName":"AventusSharp.SSE.SSEError","isStrong":false},{"fullName":"Convertible","isStrong":false}],"fullName":"AventusSharp.SSE.ResultWithSSEError","required":false,"type":1,"isExported":true,"convertibleName":"Fullname"},{"code":"SSE.VoidWithSSEError=class VoidWithSSEError extends Tools.VoidWithError {\n static get Fullname() { return \"AventusSharp.SSE.VoidWithSSEError, AventusSharp.AspNetCore\"; }\n}\nSSE.VoidWithSSEError.Namespace=`AventusSharp.SSE`;\nSSE.VoidWithSSEError.$schema={...(Tools.VoidWithError?.$schema ?? {}), };\nAventus.Converter.register(SSE.VoidWithSSEError.Fullname, SSE.VoidWithSSEError);\n__as1(_.SSE, 'VoidWithSSEError', SSE.VoidWithSSEError);\n","dependencies":[{"fullName":"AventusSharp.Tools.VoidWithError","isStrong":true},{"fullName":"AventusSharp.SSE.SSEError","isStrong":false},{"fullName":"Convertible","isStrong":false}],"fullName":"AventusSharp.SSE.VoidWithSSEError","required":false,"type":1,"isExported":true,"convertibleName":"Fullname"},{"code":"WebSocket.WsError=class WsError extends Aventus.GenericError {\n static get Fullname() { return \"AventusSharp.WebSocket.WsError, AventusSharp.AspNetCore\"; }\n}\nWebSocket.WsError.Namespace=`AventusSharp.WebSocket`;\nWebSocket.WsError.$schema={...(Aventus.GenericError?.$schema ?? {}), };\nAventus.Converter.register(WebSocket.WsError.Fullname, WebSocket.WsError);\n__as1(_.WebSocket, 'WsError', WebSocket.WsError);\n","dependencies":[{"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.AspNetCore\"; }\n}\nWebSocket.ResultWithWsError.Namespace=`AventusSharp.WebSocket`;\nWebSocket.ResultWithWsError.$schema={...(Tools.ResultWithError?.$schema ?? {}), };\nAventus.Converter.register(WebSocket.ResultWithWsError.Fullname, WebSocket.ResultWithWsError);\n__as1(_.WebSocket, 'ResultWithWsError', WebSocket.ResultWithWsError);\n","dependencies":[{"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.AspNetCore\"; }\n}\nWebSocket.VoidWithWsError.Namespace=`AventusSharp.WebSocket`;\nWebSocket.VoidWithWsError.$schema={...(Tools.VoidWithError?.$schema ?? {}), };\nAventus.Converter.register(WebSocket.VoidWithWsError.Fullname, WebSocket.VoidWithWsError);\n__as1(_.WebSocket, 'VoidWithWsError', WebSocket.VoidWithWsError);\n","dependencies":[{"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":"let Maui=class Maui {\n static config = {\n filter: (url, method) => url.includes(\"/api\"),\n showLog: false,\n autoLoad: true,\n };\n static async configure(config) {\n this.config = {\n ...config,\n ...this.config\n };\n this.overrideFetch();\n if (this.config.autoLoad)\n await this.loadBlazor();\n }\n static loadBlazor() {\n return new Promise(async (resolve) => {\n const script = document.createElement(\"script\");\n script.setAttribute(\"autostart\", \"false\");\n script.src = \"/_framework/blazor.webview.js\";\n script.onload = function () {\n const w = window;\n w.Blazor.start().then(() => {\n resolve();\n });\n };\n document.head.appendChild(script);\n });\n }\n static overridedFetch = false;\n static overrideFetch() {\n if (this.overridedFetch)\n return;\n this.overridedFetch = true;\n const originalFetch = window.fetch;\n window.fetch = async (input, init = {}) => {\n const url = typeof input === 'string' ? input : input.url;\n const method = init.method || 'GET';\n if (this.config.filter(url, method)) {\n let bodyArray = null;\n const headers = init.headers;\n let contentType = headers?.['Content-Type'] || '';\n if (init.body) {\n if (init.body instanceof FormData) {\n const response = new Response(init.body);\n bodyArray = new Uint8Array(await response.arrayBuffer());\n contentType = response.headers.get('content-type');\n }\n else if (typeof init.body === 'string') {\n bodyArray = new TextEncoder().encode(init.body);\n if (!contentType)\n contentType = 'application/json';\n }\n else {\n bodyArray = new Uint8Array(await new Response(init.body).arrayBuffer());\n }\n if (this.config.showLog) {\n console.log(`${url} (${method})`, init.body);\n }\n }\n else if (this.config.showLog) {\n console.log(`${url} (${method})`);\n }\n const w = window;\n const result = await w.DotNet.invokeMethodAsync('AventusSharp.Maui', 'EmulateRequest', method, url, bodyArray, contentType);\n const responseHeaders = new Headers(result.headers);\n const mimeType = responseHeaders.get('content-type') || 'application/octet-stream';\n if (this.config.showLog) {\n console.groupCollapsed(`%c[${method}] ${url.substring(url.indexOf('/api'))} -> Status: ${result.status}`, `color: ${result.status === 200 ? '#4CAF50' : '#F44336'}; font-weight: bold;`);\n }\n let decodedContent = new TextDecoder().decode(result.content);\n let parsedResponse = decodedContent;\n if (mimeType == \"application/json\") {\n try {\n parsedResponse = JSON.parse(decodedContent);\n }\n catch (e) { }\n }\n let parsedPayload = init.body;\n if (typeof parsedPayload === 'string') {\n try {\n parsedPayload = JSON.parse(parsedPayload);\n }\n catch (e) { }\n }\n if (this.config.showLog) {\n console.table({\n \"Request\": { Méthode: method, URL: url, \"Payload Type\": contentType },\n \"Response\": { Statut: result.status, Type: typeof parsedResponse }\n });\n console.log(\"%cPayload Content :\", \"color: #2196F3; font-weight: bold;\", init.body || \"None\");\n console.log(\"%cResponse Content :\", \"color: #9C27B0; font-weight: bold;\", parsedResponse);\n console.groupEnd();\n }\n return new Response(result.content.length == 0 ? null : result.content, {\n status: result.status,\n headers: responseHeaders\n });\n }\n return originalFetch(input, init);\n };\n }\n}\nMaui.Namespace=`AventusSharp`;\n__as1(_, 'Maui', Maui);\n","dependencies":[{"fullName":"AventusSharp.MauiConfig","isStrong":true}],"fullName":"AventusSharp.Maui","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"RAM.RamCompletor=class RamCompletor {\n objects = [];\n fields = [];\n constructor(objects) {\n if (!objects) {\n objects = [];\n }\n else if (!Array.isArray(objects)) {\n objects = [objects];\n }\n this.objects = objects;\n }\n add(field) {\n this.fields.push(field);\n return this;\n }\n async run() {\n const objects = this.objects;\n const fields = this.fields;\n const result = new Aventus.VoidWithError();\n if (objects.length == 0)\n return result;\n const listIds = {};\n const mapRecords = {};\n for (let field of fields) {\n let objKey = field.obj;\n let idKey = field.id;\n listIds[objKey] = [];\n mapRecords[objKey] = {};\n for (let _value of objects) {\n let value = _value;\n if (value[idKey]) {\n const listId = listIds[objKey];\n const mapRecord = mapRecords[objKey];\n if (value[objKey])\n continue;\n if (!listId.includes(value[idKey]))\n listId.push(value[idKey]);\n if (!mapRecord[value[idKey]]) {\n mapRecord[value[idKey]] = [];\n }\n mapRecord[value[idKey]].push(value);\n }\n }\n }\n for (let field of fields) {\n let objKey = field.obj;\n if (!listIds[objKey] || !mapRecords[objKey])\n continue;\n const listId = listIds[objKey];\n const mapRecord = mapRecords[objKey];\n if (listId.length > 0) {\n const ram = Aventus.Instance.get(field.ram);\n const resultTemp = await result.extractAsync(() => ram.getByIdsWithError(listId));\n if (resultTemp) {\n for (let item of resultTemp) {\n if (mapRecord[item.Id]) {\n for (let record of mapRecord[item.Id]) {\n record[objKey] = item;\n }\n }\n }\n }\n }\n }\n return result;\n }\n}\nRAM.RamCompletor.Namespace=`AventusSharp.RAM`;\n__as1(_.RAM, 'RamCompletor', RAM.RamCompletor);\n","dependencies":[{"fullName":"AventusSharp.RAM.ItemField","isStrong":false},{"fullName":"Aventus.IRamData","isStrong":false},{"fullName":"U","isStrong":false},{"fullName":"AventusSharp.RAM.RamCompletor","isStrong":false},{"fullName":"Aventus.VoidWithError","isStrong":false}],"fullName":"AventusSharp.RAM.RamCompletor","required":false,"type":1,"isExported":true,"convertibleName":""},{"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() {\n const result = new Aventus.VoidWithError();\n if (!this.getAllDone) {\n const list = await result.extractAsync(this.routes.GetAll);\n if (!list)\n return result;\n for (let item of list) {\n await result.runAsync(() => this.addOrUpdateData(item));\n }\n this.getAllDone = true;\n }\n return result;\n }\n async beforeGetById(id) {\n const result = new Aventus.VoidWithError();\n if (this.records.has(id)) {\n return result;\n }\n else {\n const item = await result.extractAsync(() => this.routes.GetById(id));\n if (item) {\n await result.runAsync(() => this.addOrUpdateData(item));\n }\n }\n return result;\n }\n async beforeGetByIds(ids) {\n const result = new Aventus.VoidWithError();\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 const response = await result.extractAsync(() => this.routes.GetByIds({ ids: missingIds }));\n if (response) {\n for (let item of response) {\n await result.runAsync(() => this.addOrUpdateData(item));\n }\n }\n }\n return result;\n }\n complete(objects) {\n return new _.RAM.RamCompletor(objects);\n }\n transformCreateRequestToItem(item) {\n return this.routes.Create({ item: item });\n }\n transformCreateRequestListToItem(list) {\n return this.routes.CreateMany({ list });\n }\n async transformUpdateRequestToItem(item) {\n const result = new Aventus.ResultWithError();\n const id = result.extract(() => this.getIdWithError(item));\n if (id === undefined)\n return result;\n return await this.routes.Update(id, { item: item });\n }\n transformUpdateRequestListToItem(list) {\n return this.routes.UpdateMany({ list });\n }\n async beforeDeleteItem(item, fromList) {\n const result = new Aventus.VoidWithError();\n if (fromList) {\n return result;\n }\n const id = result.extract(() => this.getIdWithError(item));\n if (id === undefined)\n return result;\n await result.runAsync(() => this.routes.Delete(id));\n return result;\n }\n async beforeDeleteList(list) {\n const result = new Aventus.VoidWithError();\n if (list.length == 0)\n return result;\n const ids = [];\n for (let item of list) {\n const id = result.extract(() => this.getIdWithError(item));\n if (id === undefined)\n return result;\n ids.push(id);\n }\n await result.runAsync(() => this.routes.DeleteMany({ ids }));\n return result;\n }\n}\nRAM.RamHttp.Namespace=`AventusSharp.RAM`;\n__as1(_.RAM, 'RamHttp', RAM.RamHttp);\n","dependencies":[{"fullName":"Aventus.Ram","isStrong":true},{"fullName":"AventusSharp.Data.Storable","isStrong":false},{"fullName":"AventusSharp.Routes.Request.Request","isStrong":false},{"fullName":"AventusSharp.Routes.Response.Resource","isStrong":false},{"fullName":"AventusSharp.Routes.StorableRouter","isStrong":false},{"fullName":"Aventus.VoidWithError","isStrong":false},{"fullName":"AventusSharp.RAM.RamCompletor","isStrong":false},{"fullName":"Aventus.ResultWithError","isStrong":false}],"fullName":"AventusSharp.RAM.RamHttp","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"WebSocket.SocketError=class SocketError extends Aventus.GenericError {\n}\nWebSocket.SocketError.Namespace=`AventusSharp.WebSocket`;\nWebSocket.SocketError.$schema={...(Aventus.GenericError?.$schema ?? {}), };\nAventus.Converter.register(WebSocket.SocketError.Fullname, WebSocket.SocketError);\n__as1(_.WebSocket, 'SocketError', WebSocket.SocketError);\n","dependencies":[{"fullName":"Aventus.GenericError","isStrong":true},{"fullName":"AventusSharp.WebSocket.SocketErrorCode","isStrong":false}],"fullName":"AventusSharp.WebSocket.SocketError","required":false,"type":1,"isExported":true,"convertibleName":"Fullname"},{"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 const t = this;\n if (t[key] instanceof Date) {\n return Aventus.DateConverter.converter.toString(t[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`;\n__as1(_.WebSocket, 'Connection', WebSocket.Connection);\n","dependencies":[{"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.Callback","isStrong":false},{"fullName":"AventusSharp.WebSocket.SocketRoute","isStrong":false},{"fullName":"AventusSharp.WebSocket.InternalSocketRoute","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":"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`;\n__as1(_.WebSocket, 'EndPoint', WebSocket.EndPoint);\n","dependencies":[{"fullName":"AventusSharp.WebSocket.Connection","isStrong":true},{"fullName":"AventusSharp.WebSocket.EndPoint","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`;\n__as1(_.WebSocket, 'WsEvent', WebSocket.WsEvent);\n","dependencies":[{"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`;\n__as1(_.WebSocket, 'StorableWsRoute_DeleteMany', WebSocket.StorableWsRoute_DeleteMany);\n","dependencies":[{"fullName":"AventusSharp.WebSocket.WsEvent","isStrong":true},{"fullName":"Aventus.ResultWithError","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`;\n__as1(_.WebSocket, 'StorableWsRouter_Delete', WebSocket.StorableWsRouter_Delete);\n","dependencies":[{"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`;\n__as1(_.WebSocket, 'StorableWsRoute_UpdateMany', WebSocket.StorableWsRoute_UpdateMany);\n","dependencies":[{"fullName":"AventusSharp.WebSocket.WsEvent","isStrong":true},{"fullName":"Aventus.ResultWithError","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`;\n__as1(_.WebSocket, 'StorableWsRouter_Update', WebSocket.StorableWsRouter_Update);\n","dependencies":[{"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`;\n__as1(_.WebSocket, 'StorableWsRouter_GetByIds', WebSocket.StorableWsRouter_GetByIds);\n","dependencies":[{"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`;\n__as1(_.WebSocket, 'StorableWsRouter_GetById', WebSocket.StorableWsRouter_GetById);\n","dependencies":[{"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`;\n__as1(_.WebSocket, 'StorableWsRoute_CreateMany', WebSocket.StorableWsRoute_CreateMany);\n","dependencies":[{"fullName":"AventusSharp.WebSocket.WsEvent","isStrong":true},{"fullName":"Aventus.ResultWithError","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`;\n__as1(_.WebSocket, 'StorableWsRouter_Create', WebSocket.StorableWsRouter_Create);\n","dependencies":[{"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`;\n__as1(_.WebSocket, 'StorableWsRouter_GetAll', WebSocket.StorableWsRouter_GetAll);\n","dependencies":[{"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`;\n__as1(_.WebSocket, 'Router', WebSocket.Router);\n","dependencies":[{"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`;\n__as1(_.WebSocket, 'StorableWsRouter', WebSocket.StorableWsRouter);\n","dependencies":[{"fullName":"AventusSharp.WebSocket.Router","isStrong":true},{"fullName":"Aventus.IData","isStrong":false},{"fullName":"AventusSharp.Routes.Request.Request","isStrong":false},{"fullName":"AventusSharp.Routes.Response.Resource","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":"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 addOrUpdateData(item) {\n return super.addOrUpdateData(item);\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 complete(objects) {\n return new _.RAM.RamCompletor(objects);\n }\n async otherGetAll(items, params, uid) {\n if (uid && this.otherGetAllLocked[uid])\n return;\n for (let item of items) {\n await this.addOrUpdateData(item);\n }\n }\n async beforeGetAll() {\n const result = new Tools.VoidWithError();\n if (!this.getAllDone) {\n let uid = Aventus.uuidv4();\n this.otherGetAllLocked[uid] = true;\n const list = await result.extractAsync(() => this.routes.GetAll({ uid }));\n delete this.otherGetAllLocked[uid];\n if (!list)\n return result;\n for (let item of list) {\n await result.runAsync(() => this.addOrUpdateData(item));\n }\n }\n return result;\n }\n async otherGetById(item, params, uid) {\n if (uid && this.otherGetByIdLocked[uid])\n return;\n await this.addOrUpdateData(item);\n }\n async beforeGetById(id) {\n const result = new Tools.VoidWithError();\n if (this.records.has(id)) {\n return result;\n }\n let uid = Aventus.uuidv4();\n this.otherGetByIdLocked[uid] = true;\n const item = await result.extractAsync(() => this.routes.GetById(id));\n delete this.otherGetByIdLocked[uid];\n if (!item)\n return result;\n await result.runAsync(() => this.addOrUpdateData(item));\n return result;\n }\n async beforeGetByIds(ids) {\n const result = new Tools.VoidWithError();\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 const response = await result.extractAsync(() => this.routes.GetByIds({ ids: missingIds }));\n if (!response)\n return result;\n for (let item of response) {\n await result.runAsync(() => this.addOrUpdateData(item));\n }\n }\n return result;\n }\n async otherCreateItem(item, params, uid) {\n if (uid && this.otherCreateItemLocked[uid])\n return;\n const resultTemp = await this.addOrUpdateData(item);\n if (resultTemp.success && resultTemp.result) {\n this.publish('created', resultTemp.result.value);\n }\n }\n async transformCreateRequestListToItem(list) {\n const uid = Aventus.uuidv4();\n this.otherCreateListLocked[uid] = true;\n const result = await this.routes.CreateMany({ list });\n delete this.otherCreateListLocked[uid];\n return result;\n }\n async transformCreateRequestToItem(item) {\n const uid = Aventus.uuidv4();\n this.otherCreateItemLocked[uid] = true;\n const result = await this.routes.Create({ request: item });\n delete this.otherCreateItemLocked[uid];\n return result;\n }\n async otherCreateList(items, params, uid) {\n if (uid && this.otherCreateListLocked[uid])\n return;\n for (let item of items) {\n const resultTemp = await this.addOrUpdateData(item);\n if (resultTemp.success && resultTemp.result) {\n this.publish('created', resultTemp.result.value);\n }\n }\n }\n async otherUpdateItem(item, params, uid) {\n if (uid && this.otherUpdateItemLocked[uid])\n return;\n const resultTemp = await this.addOrUpdateData(item);\n if (resultTemp.success && resultTemp.result) {\n this.publish('updated', resultTemp.result.value);\n }\n }\n async transformUpdateRequestListToItem(list) {\n let uid = Aventus.uuidv4();\n this.otherUpdateListLocked[uid] = true;\n const result = await this.routes.UpdateMany({ list });\n delete this.otherUpdateListLocked[uid];\n return result;\n }\n async transformUpdateRequestToItem(item) {\n const result = new Tools.ResultWithError();\n const id = result.extract(() => this.getIdWithError(item));\n if (id === undefined)\n return result;\n let uid = Aventus.uuidv4();\n this.otherUpdateItemLocked[uid] = true;\n const temp = await this.routes.Update(id, { request: item });\n delete this.otherUpdateItemLocked[uid];\n return temp;\n }\n async otherUpdateList(items, params, uid) {\n if (uid && this.otherUpdateListLocked[uid])\n return;\n for (let item of items) {\n const resultTemp = await this.addOrUpdateData(item);\n if (resultTemp.success && resultTemp.result) {\n this.publish('updated', resultTemp.result.value);\n }\n }\n }\n otherDeleteItem(id, params, uid) {\n if (uid && this.otherDeleteItemLocked[uid])\n return;\n const resultTemp = this.deleteData(id);\n if (resultTemp.success && resultTemp.result) {\n this.publish('deleted', resultTemp.result);\n this.recordsSubscribers.delete(id);\n }\n }\n async beforeDeleteItem(item, fromList) {\n const result = new Tools.VoidWithError();\n if (fromList) {\n return result;\n }\n let uid = Aventus.uuidv4();\n this.otherDeleteItemLocked[uid] = true;\n const id = await result.extract(() => this.getIdWithError(item));\n if (id === undefined)\n return result;\n await result.runAsync(() => this.routes.Delete(id, { uid }));\n delete this.otherDeleteItemLocked[uid];\n return result;\n }\n otherDeleteList(ids, params, uid) {\n if (uid && this.otherDeleteListLocked[uid])\n return;\n for (let id of ids) {\n const resultTemp = this.deleteData(id);\n if (resultTemp.success && resultTemp.result) {\n this.publish('deleted', resultTemp.result);\n this.recordsSubscribers.delete(id);\n }\n }\n }\n async beforeDeleteList(list) {\n const result = new Tools.VoidWithError();\n if (list.length == 0)\n return result;\n const ids = [];\n for (let item of list) {\n const id = result.extract(() => this.getIdWithError(item));\n if (id === undefined)\n return result;\n ids.push(id);\n }\n let uid = Aventus.uuidv4();\n this.otherDeleteListLocked[uid] = true;\n await result.runAsync(() => this.routes.DeleteMany({ ids }));\n delete this.otherDeleteListLocked[uid];\n return result;\n }\n /**\n * Delete element inside Ram without firing delete event\n */\n deleteData(id) {\n const result = new Tools.ResultWithError();\n try {\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 catch (e) {\n result.errors.push(new Aventus.RamError(Aventus.RamErrorCode.unknow, e));\n }\n return result;\n }\n}\nRAM.RamWebSocket.Namespace=`AventusSharp.RAM`;\n__as1(_.RAM, 'RamWebSocket', RAM.RamWebSocket);\n","dependencies":[{"fullName":"Aventus.Ram","isStrong":true},{"fullName":"AventusSharp.Data.Storable","isStrong":false},{"fullName":"AventusSharp.Routes.Request.Request","isStrong":false},{"fullName":"AventusSharp.Routes.Response.Resource","isStrong":false},{"fullName":"AventusSharp.WebSocket.StorableWsRouter","isStrong":false},{"fullName":"Aventus.ExtractFromError","isStrong":false},{"fullName":"AventusSharp.Tools.ResultWithError","isStrong":false},{"fullName":"Aventus.RamItem","isStrong":false},{"fullName":"AventusSharp.RAM.RamWebSocketListenOnStart","isStrong":false},{"fullName":"AventusSharp.RAM.RamCompletor","isStrong":false},{"fullName":"BindThis","isStrong":false},{"fullName":"Aventus.UriParamsValue","isStrong":false},{"fullName":"AventusSharp.Tools.VoidWithError","isStrong":false},{"fullName":"Aventus.uuidv4","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","dependencies":[]},{"fullName":"AventusSharp.RAM.RamWebSocketListenOnStart","dependencies":[]},{"fullName":"AventusSharp.WebSocket.WsRouteSendOptions","dependencies":[]},{"fullName":"AventusSharp.WebSocket.SocketMessage","dependencies":[]},{"fullName":"AventusSharp.WebSocket.SocketSendMessageOptions","dependencies":[]},{"fullName":"AventusSharp.WebSocket.SocketRoute","dependencies":[{"fullName":"Aventus.UriParamsValue","isStrong":false}]},{"fullName":"AventusSharp.RAM.KeysOfType","dependencies":[{"fullName":"T","isStrong":false},{"fullName":"U","isStrong":false},{"fullName":"K","isStrong":false}]},{"fullName":"AventusSharp.RAM.NumberKeys","dependencies":[{"fullName":"T","isStrong":false},{"fullName":"K","isStrong":false}]},{"fullName":"AventusSharp.MauiConfig","dependencies":[]},{"fullName":"AventusSharp.Data.IStorableTimestamp","dependencies":[{"fullName":"Aventus.IData","isStrong":true}]},{"fullName":"AventusSharp.Tools.IWithError","dependencies":[{"fullName":"Aventus.GenericError","isStrong":false}]},{"fullName":"AventusSharp.Tools.IResultWithError","dependencies":[{"fullName":"AventusSharp.Tools.IWithError","isStrong":true},{"fullName":"Aventus.GenericError","isStrong":false}]},{"fullName":"AventusSharp.RealDate","dependencies":[]},{"fullName":"AventusSharp.RAM.ItemField","dependencies":[{"fullName":"Aventus.IRamData","isStrong":false},{"fullName":"AventusSharp.RAM.NumberKeys","isStrong":false},{"fullName":"T","isStrong":false},{"fullName":"AventusSharp.RAM.KeysOfType","isStrong":false},{"fullName":"U","isStrong":false}]},{"fullName":"AventusSharp.WebSocket.InternalSocketRoute","dependencies":[{"fullName":"AventusSharp.WebSocket.SocketRoute","isStrong":false},{"fullName":"Aventus.PreparedUri","isStrong":false}]},{"fullName":"AventusSharp.WebSocket.ConnectionOptions","dependencies":[{"fullName":"AventusSharp.WebSocket.InternalSocketRoute","isStrong":false}]},{"fullName":"AventusSharp.WebSocket.WsEndPointType","dependencies":[{"fullName":"AventusSharp.WebSocket.EndPoint","isStrong":false}]},{"fullName":"AventusSharp.WebSocket.ExtractResultFrom","dependencies":[{"fullName":"AventusSharp.WebSocket.WsEvent","isStrong":false},{"fullName":"T","isStrong":false},{"fullName":"U","isStrong":false}]},{"fullName":"AventusSharp.WebSocket.WsEventType","dependencies":[{"fullName":"AventusSharp.WebSocket.WsEvent","isStrong":false}]},{"fullName":"AventusSharp.ExtractResponse","dependencies":[{"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","dependencies":[{"fullName":"AventusSharp.WebSocket.WsEvent","isStrong":false}]},{"fullName":"AventusSharp.WebSocket.WsRouterType","dependencies":[{"fullName":"AventusSharp.WebSocket.Router","isStrong":false}]},{"fullName":"AventusSharp.WebSocket.StorableWsRouter__Routes","dependencies":[{"fullName":"Aventus.IData","isStrong":false},{"fullName":"AventusSharp.Routes.Request.Request","isStrong":false},{"fullName":"T","isStrong":false},{"fullName":"AventusSharp.Routes.Response.Resource","isStrong":false},{"fullName":"R","isStrong":false},{"fullName":"AventusSharp.WebSocket.StorableWsRouter_GetAll","isStrong":false},{"fullName":"AventusSharp.WebSocket.StorableWsRouter_Create","isStrong":false},{"fullName":"S","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}]}]}
967
- //#endregion js src //
968
- //#region css def //
969
- {}
970
- //#endregion css def //
971
- //#region css //
972
- {}
973
- //#endregion css //
974
- //#region html //
975
- {}
976
- //#endregion html //
977
- //#region dependencies //
978
- {}
979
- //#endregion dependencies //
1
+ // AventusSharp@Main:1.0.7
2
+ // npm:@aventusjs/sharp
3
+ //#region js def //
4
+ declare global {
5
+
6
+ namespace AventusSharp{
7
+ namespace WebSocket {
8
+ interface WsRouterOptions {
9
+ url: string;
10
+ }
11
+ }
12
+
13
+ namespace RAM {
14
+ type RamWebSocketListenOnStart = {
15
+ GetAll: boolean;
16
+ GetById: boolean;
17
+ Create: boolean;
18
+ CreateMany: boolean;
19
+ Update: boolean;
20
+ UpdateMany: boolean;
21
+ Delete: boolean;
22
+ DeleteMany: boolean;
23
+ };
24
+ }
25
+
26
+ namespace WebSocket {
27
+ interface WsRouteSendOptions {
28
+ uid?: string;
29
+ timeout?: number;
30
+ }
31
+ }
32
+
33
+ namespace WebSocket {
34
+ interface SocketMessage {
35
+ channel: string;
36
+ data?: any;
37
+ uid?: string;
38
+ }
39
+ }
40
+
41
+ namespace WebSocket {
42
+ enum SocketErrorCode {
43
+ socketClosed = 0,
44
+ timeout = 1,
45
+ differentChannel = 2,
46
+ unknow = 3
47
+ }
48
+ }
49
+
50
+ namespace WebSocket {
51
+ class Socket {
52
+ static Debug: boolean;
53
+ private static connections;
54
+ static getInstance(url: string, el: any): AventusSharp.WebSocket.Socket;
55
+ private socket;
56
+ private url;
57
+ private elements;
58
+ private reopenInterval;
59
+ onOpen: Aventus.Callback<(ev: Event) => any>;
60
+ onClose: Aventus.Callback<(ev: Event) => any>;
61
+ onError: Aventus.Callback<(ev: Event) => any>;
62
+ onMessage: Aventus.Callback<(ev: MessageEvent<any>) => any>;
63
+ get readyState(): number;
64
+ protected constructor(url: string, el: any);
65
+ protected registerEl(el: any): void;
66
+ private createWebSocket;
67
+ protected removeSocket(): void;
68
+ protected reopen(): void;
69
+ close(el: any, code?: number | undefined, reason?: string | undefined): void;
70
+ send(data: BufferSource | Blob | string): void;
71
+ /**
72
+ * Check if socket is ready
73
+ */
74
+ isReady(): boolean;
75
+ }
76
+ }
77
+
78
+ namespace WebSocket {
79
+ interface SocketSendMessageOptions {
80
+ channel: string;
81
+ body?: {
82
+ [key: string | number]: any;
83
+ };
84
+ timeout?: number;
85
+ uid?: string;
86
+ }
87
+ }
88
+
89
+ namespace WebSocket {
90
+ interface SocketRoute<T = any> {
91
+ channel: string;
92
+ callback: (data: T, params: Aventus.UriParamsValue, uid?: string) => void;
93
+ }
94
+ }
95
+
96
+ namespace Data {
97
+ abstract class Storable extends Aventus.Data implements Aventus.IData {
98
+ Id: number;
99
+ /**
100
+ * @inerhit
101
+ */
102
+ toJSON(): any;
103
+ }
104
+ }
105
+
106
+ namespace Data {
107
+ abstract class StorableTimestamp extends AventusSharp.Data.Storable implements Aventus.IData {
108
+ CreatedDate: Aventus.DateTime;
109
+ UpdatedDate: Aventus.DateTime;
110
+ }
111
+ }
112
+
113
+ namespace WebSocket {
114
+ enum WsErrorCode {
115
+ UnknownError = 0,
116
+ CantDefineAssembly = 1,
117
+ ConfigError = 2,
118
+ MultipleMainEndpoint = 3,
119
+ CantGetValueFromBody = 4,
120
+ NoConnection = 5,
121
+ NoEndPoint = 6,
122
+ NoPath = 7
123
+ }
124
+ }
125
+
126
+ namespace SSE {
127
+ enum SSEErrorCode {
128
+ UnknownError = 0,
129
+ CantDefineAssembly = 1,
130
+ ConfigError = 2,
131
+ MultipleMainEndpoint = 3,
132
+ CantGetValueFromBody = 4,
133
+ NoEndPoint = 5
134
+ }
135
+ }
136
+
137
+ namespace Routes {
138
+ enum RouteErrorCode {
139
+ UnknownError = 0,
140
+ FormContentTypeUnknown = 1,
141
+ CantGetValueFromBody = 2,
142
+ CantMoveFile = 3,
143
+ CantCreateFolders = 4,
144
+ RouteAlreadyExist = 5,
145
+ ConfigError = 6
146
+ }
147
+ }
148
+
149
+ namespace Data {
150
+ interface IStorableTimestamp extends Aventus.IData {
151
+ CreatedDate: Aventus.DateTime;
152
+ UpdatedDate: Aventus.DateTime;
153
+ }
154
+ }
155
+
156
+ namespace Data {
157
+ enum DataErrorCode {
158
+ DefaultDMGenericType = 0,
159
+ DMOnlyForceInherit = 1,
160
+ TypeNotStorable = 2,
161
+ TypeTooMuchStorable = 3,
162
+ GenericNotAbstract = 4,
163
+ ParentNotAbstract = 5,
164
+ InfiniteLoop = 6,
165
+ InterfaceNotUnique = 7,
166
+ SelfReferecingDependency = 8,
167
+ DMNotExist = 9,
168
+ DMAlreadyExist = 10,
169
+ MethodNotFound = 11,
170
+ StorageDisconnected = 12,
171
+ StorageNotFound = 13,
172
+ NoConnectionInsideStorage = 14,
173
+ TypeNotExistInsideStorage = 15,
174
+ UnknownError = 16,
175
+ NoItemProvided = 17,
176
+ NoTransactionInProgress = 18,
177
+ WrongType = 19,
178
+ NoTypeIdentifierFoundInsideQuery = 20,
179
+ ItemNoExistInsideStorage = 21,
180
+ ItemAlreadyExist = 22,
181
+ ValidationError = 23,
182
+ GetAllNotAllowed = 24,
183
+ GetByIdNotAllowed = 25,
184
+ GetByIdsNotAllowed = 26,
185
+ WhereNotAllowed = 27,
186
+ CreateNotAllowed = 28,
187
+ UpdateNotAllowed = 29,
188
+ DeleteNotAllowed = 30,
189
+ NumberOfItemsNotMatching = 31,
190
+ FieldTypeNotFound = 32,
191
+ MemberNotFound = 33,
192
+ TooMuchMemberFound = 34,
193
+ TypeNotFound = 35,
194
+ ReverseLinkNotExist = 36,
195
+ ReverseLinkExist = 37,
196
+ ErrorCreatingReverseQuery = 38,
197
+ LinkNotSet = 39,
198
+ MultipleProvidersNotSet = 40,
199
+ FileNotFound = 41,
200
+ PyramidNotFound = 42,
201
+ IsReadOnly = 43,
202
+ ReverseLinkNotPrepared = 44,
203
+ ExternalStorageNotPrepared = 45
204
+ }
205
+ }
206
+
207
+ namespace Tools {
208
+ interface IWithError<T extends Aventus.GenericError> {
209
+ success: boolean;
210
+ }
211
+ }
212
+
213
+ namespace Tools {
214
+ interface IResultWithError<T extends Aventus.GenericError> extends AventusSharp.Tools.IWithError<T> {
215
+ }
216
+ }
217
+
218
+ namespace Data.CustomTableMembers {
219
+ enum ImageFileErrorCode {
220
+ UnknownError = 0,
221
+ NotValidImage = 1,
222
+ FileNotSvg = 2,
223
+ NoSize = 3
224
+ }
225
+ }
226
+
227
+ namespace Data {
228
+ abstract class SharpClass {
229
+ /**
230
+ * The current namespace
231
+ */
232
+ get namespace(): string;
233
+ /**
234
+ * Get the unique type for the data. Define it as the namespace + class name
235
+ */
236
+ get $type(): string;
237
+ /**
238
+ * Get the name of the class
239
+ */
240
+ get className(): string;
241
+ /**
242
+ * Clone the object by transforming a parsed JSON string back into the original type
243
+ */
244
+ clone(): this;
245
+ /**
246
+ * Get a JSON for the current object
247
+ */
248
+ toJSON(): any;
249
+ }
250
+ }
251
+
252
+ namespace Routes.Request {
253
+ abstract class Request extends AventusSharp.Data.SharpClass {
254
+ }
255
+ }
256
+
257
+ namespace Routes.Response {
258
+ abstract class Resource extends AventusSharp.Data.SharpClass {
259
+ toRequest<T extends AventusSharp.Routes.Request.Request>(request: new () => T): T;
260
+ }
261
+ }
262
+
263
+ namespace Data {
264
+ @Convertible()
265
+ class FieldErrorInfo extends AventusSharp.Data.SharpClass {
266
+ /** Fullname of the class */
267
+ static get Fullname(): string;
268
+ Name: string;
269
+ }
270
+ }
271
+
272
+ namespace Data.CustomTableMembers {
273
+ abstract class AventusFile<T> {
274
+ Uri: string;
275
+ Upload?: File;
276
+ /**
277
+ * Get the unique type for the data. Define it as the namespace + class name
278
+ */
279
+ get $type(): string;
280
+ /**
281
+ * @inerhit
282
+ */
283
+ toJSON(): any;
284
+ }
285
+ }
286
+
287
+ namespace Data.CustomTableMembers {
288
+ abstract class AventusImage<T extends Aventus.IData> extends AventusSharp.Data.CustomTableMembers.AventusFile<T> {
289
+ }
290
+ }
291
+
292
+ namespace Data.CustomTableMembers {
293
+ @Convertible()
294
+ class ImageFileError extends Aventus.GenericError<typeof AventusSharp.Data.CustomTableMembers.ImageFileErrorCode> {
295
+ /** Fullname of the class */
296
+ static get Fullname(): string;
297
+ }
298
+ }
299
+
300
+ namespace Tools {
301
+ @Convertible()
302
+ class VoidWithError<T extends Aventus.GenericError = Aventus.GenericError> extends Aventus.VoidWithError<T> implements AventusSharp.Tools.IWithError<T>, AventusSharp.Tools.IWithError<T> {
303
+ /** Fullname of the class */
304
+ static get Fullname(): string;
305
+ }
306
+ }
307
+
308
+ namespace Data.CustomTableMembers {
309
+ @Convertible()
310
+ class VoidWithImageFileError extends AventusSharp.Tools.VoidWithError<AventusSharp.Data.CustomTableMembers.ImageFileError> {
311
+ /** Fullname of the class */
312
+ static get Fullname(): string;
313
+ }
314
+ }
315
+
316
+ namespace Tools {
317
+ @Convertible()
318
+ class ResultWithError<T, U extends Aventus.GenericError = Aventus.GenericError> extends Aventus.ResultWithError<T, U> implements AventusSharp.Tools.IResultWithError<U>, AventusSharp.Tools.IResultWithError<U> {
319
+ /** Fullname of the class */
320
+ static get Fullname(): string;
321
+ }
322
+ }
323
+
324
+ namespace Routes {
325
+ abstract class StorableRouter<T extends Aventus.IData, U extends AventusSharp.Routes.Request.Request | T = T, R extends AventusSharp.Routes.Response.Resource | T = T, S extends AventusSharp.Routes.Response.Resource | T = R> extends Aventus.HttpRoute {
326
+
327
+ @BindThis()
328
+ GetAll(): Promise<AventusSharp.Tools.ResultWithError<R[]>>;
329
+ @BindThis()
330
+ Create(body: {
331
+ item: U;
332
+ }): Promise<AventusSharp.Tools.ResultWithError<S>>;
333
+ @BindThis()
334
+ CreateMany(body: {
335
+ list: U[];
336
+ }): Promise<AventusSharp.Tools.ResultWithError<S[]>>;
337
+ @BindThis()
338
+ GetById(id: number): Promise<AventusSharp.Tools.ResultWithError<S>>;
339
+ @BindThis()
340
+ GetByIds(body: {
341
+ ids: number[];
342
+ }): Promise<AventusSharp.Tools.ResultWithError<S[]>>;
343
+ @BindThis()
344
+ Update(id: number, body: {
345
+ item: U;
346
+ }): Promise<AventusSharp.Tools.ResultWithError<S>>;
347
+ @BindThis()
348
+ UpdateMany(body: {
349
+ list: U[];
350
+ }): Promise<AventusSharp.Tools.ResultWithError<S[]>>;
351
+ @BindThis()
352
+ Delete(id: number): Promise<AventusSharp.Tools.ResultWithError<boolean>>;
353
+ @BindThis()
354
+ DeleteMany(body: {
355
+ ids: number[];
356
+ }): Promise<AventusSharp.Tools.ResultWithError<boolean>>;
357
+ abstract StorableName(): string;
358
+ }
359
+ }
360
+
361
+ namespace Data.CustomTableMembers {
362
+ @Convertible()
363
+ class ResultWithImageFileError<T> extends AventusSharp.Tools.ResultWithError<T, AventusSharp.Data.CustomTableMembers.ImageFileError> {
364
+ /** Fullname of the class */
365
+ static get Fullname(): string;
366
+ }
367
+ }
368
+
369
+ namespace Data {
370
+ @Convertible()
371
+ class DataError extends Aventus.GenericError<typeof AventusSharp.Data.DataErrorCode> {
372
+ /** Fullname of the class */
373
+ static get Fullname(): string;
374
+ }
375
+ }
376
+
377
+ namespace Data {
378
+ @Convertible()
379
+ class ResultWithDataError<T> extends AventusSharp.Tools.ResultWithError<T, AventusSharp.Data.DataError> {
380
+ /** Fullname of the class */
381
+ static get Fullname(): string;
382
+ }
383
+ }
384
+
385
+ namespace Data {
386
+ @Convertible()
387
+ class VoidWithDataError extends AventusSharp.Tools.VoidWithError<AventusSharp.Data.DataError> {
388
+ /** Fullname of the class */
389
+ static get Fullname(): string;
390
+ }
391
+ }
392
+
393
+ namespace Routes {
394
+ @Convertible()
395
+ class RouteError extends Aventus.GenericError<typeof AventusSharp.Routes.RouteErrorCode> {
396
+ /** Fullname of the class */
397
+ static get Fullname(): string;
398
+ }
399
+ }
400
+
401
+ namespace Routes {
402
+ @Convertible()
403
+ class ResultWithRouteError<T> extends AventusSharp.Tools.ResultWithError<T, AventusSharp.Routes.RouteError> {
404
+ /** Fullname of the class */
405
+ static get Fullname(): string;
406
+ }
407
+ }
408
+
409
+ namespace Routes {
410
+ @Convertible()
411
+ class VoidWithRouteError extends AventusSharp.Tools.VoidWithError<AventusSharp.Routes.RouteError> {
412
+ /** Fullname of the class */
413
+ static get Fullname(): string;
414
+ }
415
+ }
416
+
417
+ namespace SSE {
418
+ @Convertible()
419
+ class SSEError extends Aventus.GenericError<typeof AventusSharp.SSE.SSEErrorCode> {
420
+ /** Fullname of the class */
421
+ static get Fullname(): string;
422
+ }
423
+ }
424
+
425
+ namespace SSE {
426
+ @Convertible()
427
+ class ResultWithSSEError<T> extends AventusSharp.Tools.ResultWithError<T, AventusSharp.SSE.SSEError> {
428
+ /** Fullname of the class */
429
+ static get Fullname(): string;
430
+ }
431
+ }
432
+
433
+ namespace SSE {
434
+ @Convertible()
435
+ class VoidWithSSEError extends AventusSharp.Tools.VoidWithError<AventusSharp.SSE.SSEError> {
436
+ /** Fullname of the class */
437
+ static get Fullname(): string;
438
+ }
439
+ }
440
+
441
+ namespace WebSocket {
442
+ @Convertible()
443
+ class WsError extends Aventus.GenericError<typeof AventusSharp.WebSocket.WsErrorCode> {
444
+ /** Fullname of the class */
445
+ static get Fullname(): string;
446
+ }
447
+ }
448
+
449
+ namespace WebSocket {
450
+ @Convertible()
451
+ class ResultWithWsError<T> extends AventusSharp.Tools.ResultWithError<T, AventusSharp.WebSocket.WsError> {
452
+ /** Fullname of the class */
453
+ static get Fullname(): string;
454
+ }
455
+ }
456
+
457
+ namespace WebSocket {
458
+ @Convertible()
459
+ class VoidWithWsError extends AventusSharp.Tools.VoidWithError<AventusSharp.WebSocket.WsError> {
460
+ /** Fullname of the class */
461
+ static get Fullname(): string;
462
+ }
463
+ }
464
+
465
+ class Maui {
466
+ private static config;
467
+ static configure(config: Partial<___AventusSharp.MauiConfig>): Promise<void>;
468
+ private static loadBlazor;
469
+ private static overridedFetch;
470
+ private static overrideFetch;
471
+ }
472
+
473
+ namespace RAM {
474
+ class RamCompletor<T> {
475
+ protected objects: T[];
476
+ protected fields: ___AventusSharp.RAM.ItemField<T, any>[];
477
+ constructor(objects?: T | T[]);
478
+ add<U extends Aventus.IRamData>(field: ___AventusSharp.RAM.ItemField<T, U>): AventusSharp.RAM.RamCompletor<T>;
479
+ run(): Promise<Aventus.VoidWithError>;
480
+ }
481
+ }
482
+
483
+ namespace RAM {
484
+ abstract class RamHttp<Item extends AventusSharp.Data.Storable, Request extends AventusSharp.Routes.Request.Request | Item = Item, ResourceSimple extends AventusSharp.Routes.Response.Resource | Item = Item, ResourceDetails extends ResourceSimple = ResourceSimple> extends Aventus.Ram<Item, Request, ResourceSimple, ResourceDetails> {
485
+ protected getAllDone: boolean;
486
+ protected routes: AventusSharp.Routes.StorableRouter<Item, Request, ResourceSimple, ResourceDetails>;
487
+ abstract defineRoutes(): AventusSharp.Routes.StorableRouter<Item, Request, ResourceSimple, ResourceDetails>;
488
+ protected constructor();
489
+ protected beforeGetAll(): Promise<Aventus.VoidWithError>;
490
+ protected beforeGetById(id: number): Promise<Aventus.VoidWithError>;
491
+ protected beforeGetByIds(ids: number[]): Promise<Aventus.VoidWithError>;
492
+ complete(objects?: ResourceDetails | ResourceDetails[]): AventusSharp.RAM.RamCompletor<ResourceDetails>;
493
+ protected transformCreateRequestToItem(item: Request): Promise<Aventus.ResultWithError<ResourceDetails>>;
494
+ protected transformCreateRequestListToItem(list: Request[]): Promise<Aventus.ResultWithError<ResourceDetails[]>>;
495
+ protected transformUpdateRequestToItem(item: Request): Promise<Aventus.ResultWithError<ResourceDetails>>;
496
+ protected transformUpdateRequestListToItem(list: Request[]): Promise<Aventus.ResultWithError<ResourceDetails[]>>;
497
+ protected beforeDeleteItem(item: ResourceDetails, fromList: boolean): Promise<Aventus.VoidWithError>;
498
+ protected beforeDeleteList(list: ResourceDetails[]): Promise<Aventus.VoidWithError>;
499
+ }
500
+ }
501
+
502
+ namespace WebSocket {
503
+ type InternalSocketRoute = AventusSharp.WebSocket.SocketRoute & Aventus.PreparedUri;
504
+ }
505
+
506
+ namespace WebSocket {
507
+ interface ConnectionOptions {
508
+ /** Enable or disable log */
509
+ log?: boolean;
510
+ /** A tag to prefix your log */
511
+ logPrefix?: string;
512
+ /** Determine the host for the ws connection. By default it's the same as your current url */
513
+ host?: string;
514
+ /** Determine the port for the ws connection. By default 80 or 443 depends of http or https */
515
+ port?: number;
516
+ /** Determine if the https must be used. The default value depend of the current http connection */
517
+ useHttps?: boolean;
518
+ /** Define a list of predefined routes to use */
519
+ routes?: {
520
+ [key: string]: AventusSharp.WebSocket.InternalSocketRoute[];
521
+ };
522
+ /**
523
+ * Define the name for the websocket
524
+ * It ll open the ws connection on /ws/${socketName}
525
+ */
526
+ socketName?: string;
527
+ /**
528
+ * Define if the message must be buffered before the socket open.
529
+ * If true, when the socket is opened, all messages in buffered will be sent
530
+ */
531
+ allowSendBeforeOpen?: boolean;
532
+ /**
533
+ * Define the websocket connection must be open during creation
534
+ */
535
+ autoStart?: boolean;
536
+ /**
537
+ * Define if a /ping msg must be sent
538
+ */
539
+ sendPing?: number;
540
+ }
541
+ }
542
+
543
+ namespace WebSocket {
544
+ class SocketError extends Aventus.GenericError<AventusSharp.WebSocket.SocketErrorCode> {
545
+ }
546
+ }
547
+
548
+ namespace WebSocket {
549
+ abstract class Connection {
550
+ static Debug: boolean;
551
+ protected options: Required<AventusSharp.WebSocket.ConnectionOptions>;
552
+ protected waitingList: {
553
+ [uuid: string]: (channel: string, data: any) => void;
554
+ };
555
+ protected memoryBeforeOpen: AventusSharp.WebSocket.SocketSendMessageOptions[];
556
+ protected socket?: AventusSharp.WebSocket.Socket;
557
+ protected actionGuard: Aventus.ActionGuard;
558
+ /**
559
+ * Create a singleton
560
+ */
561
+ static getInstance(): AventusSharp.WebSocket.Connection;
562
+ protected constructor();
563
+ readonly onOpen: Aventus.Callback<() => void>;
564
+ readonly onClose: Aventus.Callback<(event: Event) => void>;
565
+ readonly onError: Aventus.Callback<(event: Event) => void>;
566
+ /**
567
+ * Define the configuration for your websocket
568
+ */
569
+ protected abstract configure(options: AventusSharp.WebSocket.ConnectionOptions): AventusSharp.WebSocket.ConnectionOptions;
570
+ /**
571
+ * Configure a new Websocket
572
+ */
573
+ protected _configure(options?: AventusSharp.WebSocket.ConnectionOptions): Required<AventusSharp.WebSocket.ConnectionOptions>;
574
+ private getUrl;
575
+ /**
576
+ * Add a new route to listen to the websocket
577
+ */
578
+ addRoute(newRoute: AventusSharp.WebSocket.SocketRoute): void;
579
+ /**
580
+ * The route to remove
581
+ * @param route - The route to remove
582
+ */
583
+ removeRoute(route: AventusSharp.WebSocket.SocketRoute): void;
584
+ protected openCallback: ((isOpen: boolean) => void) | undefined;
585
+ /**
586
+ * Try to open the websocket
587
+ */
588
+ open(): Promise<boolean>;
589
+ protected jsonReplacer(key: string, value: any): any;
590
+ /**
591
+ * Send a message though the websocket
592
+ * @param channelName The channel on which the message is sent
593
+ * @param data The data to send
594
+ * @param options the options to add to the message (typically the uid)
595
+ */
596
+ sendMessage<T>(options: AventusSharp.WebSocket.SocketSendMessageOptions): Promise<Aventus.VoidWithError>;
597
+ /**
598
+ * Send a message though the websocket and wait one answer give in parameters callbacks
599
+ * @param channelName The channel on which the message is sent
600
+ * @param body The data to send
601
+ * @param timeout The timeout before the request failed
602
+ */
603
+ sendMessageAndWait<T>(options: AventusSharp.WebSocket.SocketSendMessageOptions): Promise<Aventus.ResultWithError<Aventus.ExtractFromError<T>>>;
604
+ /**
605
+ * Check if socket is ready
606
+ */
607
+ isReady(): boolean;
608
+ protected sendPingTimeout: number;
609
+ protected sendPing(): void;
610
+ protected startPing(): void;
611
+ protected stopPing(): void;
612
+ protected _onOpen(): void;
613
+ protected errorOccur: boolean;
614
+ protected _onError(event: Event): void;
615
+ protected _onClose(event: Event): void;
616
+ /**
617
+ * Close the current connection
618
+ */
619
+ close(): void;
620
+ protected onMessage(event: MessageEvent<any>): void;
621
+ /**
622
+ * Print a msg inside the console
623
+ */
624
+ protected log(message: {} | string): void;
625
+ }
626
+ }
627
+
628
+ namespace WebSocket {
629
+ class EndPoint extends AventusSharp.WebSocket.Connection {
630
+ /**
631
+ * Create a singleton
632
+ */
633
+ static getInstance(): AventusSharp.WebSocket.EndPoint;
634
+ protected constructor();
635
+ protected register(): void;
636
+ /**
637
+ * @inheritdoc
638
+ */
639
+ protected configure(options: AventusSharp.WebSocket.ConnectionOptions): AventusSharp.WebSocket.ConnectionOptions;
640
+ protected get path(): string;
641
+ }
642
+ }
643
+
644
+ namespace WebSocket {
645
+ type WsEndPointType = (abstract new (...args: any[]) => AventusSharp.WebSocket.EndPoint);
646
+ }
647
+
648
+ namespace WebSocket {
649
+ abstract class WsEvent<T extends any = any> {
650
+ protected endpoint: AventusSharp.WebSocket.EndPoint;
651
+ onTrigger: Aventus.Callback<(item: Aventus.ExtractFromError<T>, params: Aventus.UriParamsValue, uid?: string) => void>;
652
+ protected routeInfo: AventusSharp.WebSocket.SocketRoute<Aventus.ExtractFromError<T>>;
653
+ protected _listening: boolean;
654
+ get listening(): boolean;
655
+ getPrefix: () => string;
656
+ constructor(endpoint?: AventusSharp.WebSocket.EndPoint, getPrefix?: () => string);
657
+ init(): void;
658
+ /**
659
+ * Define the websocket path
660
+ */
661
+ protected abstract path(): string;
662
+ /**
663
+ * Override this method to tell that the event must listen when created
664
+ */
665
+ protected listenOnBoot(): boolean;
666
+ /**
667
+ * Add the event to the endpoint. After that, the on trigger event can be triggered
668
+ */
669
+ listen(): void;
670
+ /**
671
+ * Remove the event from the endpoint. After that, the on trigger event won't be triggered
672
+ */
673
+ stop(): void;
674
+ protected onEvent(data: Aventus.ExtractFromError<T>, params: Aventus.UriParamsValue, uid?: string): void;
675
+ }
676
+ }
677
+
678
+ namespace WebSocket {
679
+ type ExtractResultFrom<T extends AventusSharp.WebSocket.WsEvent, U = any> = T extends AventusSharp.WebSocket.WsEvent<infer U> ? U : never;
680
+ }
681
+
682
+ namespace WebSocket {
683
+ type WsEventType = abstract new (...args: any[]) => AventusSharp.WebSocket.WsEvent;
684
+ }
685
+
686
+ type ExtractResponse<T extends AventusSharp.WebSocket.WsEvent<U>, U = any> = T extends AventusSharp.WebSocket.WsEvent<infer U> ? Aventus.ResultWithError<Aventus.ExtractFromError<U>> : never;
687
+
688
+ namespace WebSocket {
689
+ class StorableWsRoute_DeleteMany extends AventusSharp.WebSocket.WsEvent<Aventus.ResultWithError<number[]>> {
690
+ /**
691
+ * @inheritdoc
692
+ */
693
+ protected path(): string;
694
+ StorableName: () => string;
695
+ constructor(endpoint: AventusSharp.WebSocket.EndPoint, getPrefix?: () => string, StorableName?: () => string);
696
+ }
697
+ }
698
+
699
+ namespace WebSocket {
700
+ class StorableWsRouter_Delete extends AventusSharp.WebSocket.WsEvent<number> {
701
+ StorableName: () => string;
702
+ constructor(endpoint: AventusSharp.WebSocket.EndPoint, getPrefix: () => string, StorableName: () => string);
703
+ /**
704
+ * @inheritdoc
705
+ */
706
+ protected path(): string;
707
+ }
708
+ }
709
+
710
+ namespace WebSocket {
711
+ class StorableWsRoute_UpdateMany<T> extends AventusSharp.WebSocket.WsEvent<Aventus.ResultWithError<T[]>> {
712
+ /**
713
+ * @inheritdoc
714
+ */
715
+ protected path(): string;
716
+ StorableName: () => string;
717
+ constructor(endpoint: AventusSharp.WebSocket.EndPoint, getPrefix?: () => string, StorableName?: () => string);
718
+ }
719
+ }
720
+
721
+ namespace WebSocket {
722
+ class StorableWsRouter_Update<T> extends AventusSharp.WebSocket.WsEvent<T> {
723
+ StorableName: () => string;
724
+ constructor(endpoint: AventusSharp.WebSocket.EndPoint, getPrefix: () => string, StorableName: () => string);
725
+ /**
726
+ * @inheritdoc
727
+ */
728
+ protected path(): string;
729
+ }
730
+ }
731
+
732
+ namespace WebSocket {
733
+ class StorableWsRouter_GetByIds<T> extends AventusSharp.WebSocket.WsEvent<T[]> {
734
+ StorableName: () => string;
735
+ constructor(endpoint: AventusSharp.WebSocket.EndPoint, getPrefix: () => string, StorableName: () => string);
736
+ /**
737
+ * @inheritdoc
738
+ */
739
+ protected path(): string;
740
+ }
741
+ }
742
+
743
+ namespace WebSocket {
744
+ class StorableWsRouter_GetById<T> extends AventusSharp.WebSocket.WsEvent<T> {
745
+ StorableName: () => string;
746
+ constructor(endpoint: AventusSharp.WebSocket.EndPoint, getPrefix: () => string, StorableName: () => string);
747
+ /**
748
+ * @inheritdoc
749
+ */
750
+ protected path(): string;
751
+ }
752
+ }
753
+
754
+ namespace WebSocket {
755
+ class StorableWsRoute_CreateMany<T> extends AventusSharp.WebSocket.WsEvent<Aventus.ResultWithError<T[]>> {
756
+ /**
757
+ * @inheritdoc
758
+ */
759
+ protected path(): string;
760
+ StorableName: () => string;
761
+ constructor(endpoint: AventusSharp.WebSocket.EndPoint, getPrefix?: () => string, StorableName?: () => string);
762
+ }
763
+ }
764
+
765
+ namespace WebSocket {
766
+ class StorableWsRouter_Create<T> extends AventusSharp.WebSocket.WsEvent<T> {
767
+ StorableName: () => string;
768
+ constructor(endpoint: AventusSharp.WebSocket.EndPoint, getPrefix: () => string, StorableName: () => string);
769
+ /**
770
+ * @inheritdoc
771
+ */
772
+ protected path(): string;
773
+ }
774
+ }
775
+
776
+ namespace WebSocket {
777
+ class StorableWsRouter_GetAll<T> extends AventusSharp.WebSocket.WsEvent<T[]> {
778
+ StorableName: () => string;
779
+ constructor(endpoint: AventusSharp.WebSocket.EndPoint, getPrefix: () => string, StorableName: () => string);
780
+ /**
781
+ * @inheritdoc
782
+ */
783
+ protected path(): string;
784
+ }
785
+ }
786
+
787
+ namespace WebSocket {
788
+ type RouterRoutes = {
789
+ [name: string]: AventusSharp.WebSocket.WsEvent;
790
+ };
791
+ }
792
+
793
+ namespace WebSocket {
794
+ class Router<T extends AventusSharp.WebSocket.RouterRoutes> {
795
+ readonly endpoint: AventusSharp.WebSocket.EndPoint;
796
+ events: T;
797
+ constructor(endpoint?: AventusSharp.WebSocket.EndPoint);
798
+ getPrefix(): string;
799
+ protected defineEvents(): Partial<T>;
800
+ }
801
+ }
802
+
803
+ namespace WebSocket {
804
+ type WsRouterType = abstract new (...args: any[]) => AventusSharp.WebSocket.Router<any>;
805
+ }
806
+
807
+ namespace WebSocket {
808
+ type StorableWsRouter__Routes<T extends Aventus.IData, U extends AventusSharp.Routes.Request.Request | T = T, R extends AventusSharp.Routes.Response.Resource | T = T, S extends AventusSharp.Routes.Response.Resource | T = R> = {
809
+ GetAll: AventusSharp.WebSocket.StorableWsRouter_GetAll<R>;
810
+ Create: AventusSharp.WebSocket.StorableWsRouter_Create<S>;
811
+ CreateMany: AventusSharp.WebSocket.StorableWsRoute_CreateMany<S>;
812
+ GetById: AventusSharp.WebSocket.StorableWsRouter_GetById<S>;
813
+ GetByIds: AventusSharp.WebSocket.StorableWsRouter_GetByIds<S>;
814
+ Update: AventusSharp.WebSocket.StorableWsRouter_Update<S>;
815
+ UpdateMany: AventusSharp.WebSocket.StorableWsRoute_UpdateMany<S>;
816
+ Delete: AventusSharp.WebSocket.StorableWsRouter_Delete;
817
+ DeleteMany: AventusSharp.WebSocket.StorableWsRoute_DeleteMany;
818
+ };
819
+ }
820
+
821
+ namespace WebSocket {
822
+ abstract class StorableWsRouter<T extends Aventus.IData, U extends AventusSharp.Routes.Request.Request | T = T, R extends AventusSharp.Routes.Response.Resource | T = T, S extends AventusSharp.Routes.Response.Resource | T = R, __Route extends AventusSharp.WebSocket.StorableWsRouter__Routes<T, U, R, S> = AventusSharp.WebSocket.StorableWsRouter__Routes<T, U, R, S>> extends AventusSharp.WebSocket.Router<__Route> {
823
+ protected defineEvents(): Partial<__Route>;
824
+ GetAll(options?: AventusSharp.WebSocket.WsRouteSendOptions): Promise<AventusSharp.ExtractResponse<AventusSharp.WebSocket.StorableWsRouter_GetAll<R>>>;
825
+ Create(body: {
826
+ request: U;
827
+ }, options?: AventusSharp.WebSocket.WsRouteSendOptions): Promise<AventusSharp.ExtractResponse<AventusSharp.WebSocket.StorableWsRouter_Create<S>>>;
828
+ CreateMany(body: {
829
+ list: U[];
830
+ }, options?: AventusSharp.WebSocket.WsRouteSendOptions): Promise<AventusSharp.ExtractResponse<AventusSharp.WebSocket.StorableWsRoute_CreateMany<T>>>;
831
+ GetById(id: number, options?: AventusSharp.WebSocket.WsRouteSendOptions): Promise<AventusSharp.ExtractResponse<AventusSharp.WebSocket.StorableWsRouter_GetById<S>>>;
832
+ GetByIds(body: {
833
+ ids: number[];
834
+ }, options?: AventusSharp.WebSocket.WsRouteSendOptions): Promise<AventusSharp.ExtractResponse<AventusSharp.WebSocket.StorableWsRouter_GetByIds<S>>>;
835
+ Update(id: number, body: {
836
+ request: U;
837
+ }, options?: AventusSharp.WebSocket.WsRouteSendOptions): Promise<AventusSharp.ExtractResponse<AventusSharp.WebSocket.StorableWsRouter_Update<S>>>;
838
+ UpdateMany(body: {
839
+ list: U[];
840
+ }, options?: AventusSharp.WebSocket.WsRouteSendOptions): Promise<AventusSharp.ExtractResponse<AventusSharp.WebSocket.StorableWsRoute_UpdateMany<T>>>;
841
+ Delete(id: number, options?: AventusSharp.WebSocket.WsRouteSendOptions): Promise<AventusSharp.ExtractResponse<AventusSharp.WebSocket.StorableWsRouter_Delete>>;
842
+ DeleteMany(body: {
843
+ ids: number[];
844
+ }, options?: AventusSharp.WebSocket.WsRouteSendOptions): Promise<AventusSharp.ExtractResponse<AventusSharp.WebSocket.StorableWsRoute_DeleteMany>>;
845
+ abstract StorableName(): string;
846
+ }
847
+ }
848
+
849
+ namespace RAM {
850
+ abstract class RamWebSocket<Item extends AventusSharp.Data.Storable, Request extends AventusSharp.Routes.Request.Request | Item = Item, ResourceSimple extends AventusSharp.Routes.Response.Resource | Item = Item, ResourceDetails extends ResourceSimple = ResourceSimple> extends Aventus.Ram<Item, Request, ResourceSimple, ResourceDetails> {
851
+ protected getAllDone: boolean;
852
+ private routes;
853
+ protected otherGetAllLocked: {
854
+ [uid: string]: true;
855
+ };
856
+ protected otherGetByIdLocked: {
857
+ [uid: string]: true;
858
+ };
859
+ protected otherCreateItemLocked: {
860
+ [uid: string]: true;
861
+ };
862
+ protected otherCreateListLocked: {
863
+ [uid: string]: true;
864
+ };
865
+ protected otherUpdateItemLocked: {
866
+ [uid: string]: true;
867
+ };
868
+ protected otherUpdateListLocked: {
869
+ [uid: string]: true;
870
+ };
871
+ protected otherDeleteItemLocked: {
872
+ [uid: string]: true;
873
+ };
874
+ protected otherDeleteListLocked: {
875
+ [uid: string]: true;
876
+ };
877
+ abstract defineRoutes(): AventusSharp.WebSocket.StorableWsRouter<Item, Request, ResourceSimple, ResourceDetails>;
878
+ protected constructor();
879
+ protected addOrUpdateData(item: ResourceDetails | Aventus.ExtractFromError<ResourceDetails> | ResourceSimple | Aventus.ExtractFromError<ResourceSimple>): Promise<AventusSharp.Tools.ResultWithError<{
880
+ kind: "created" | "updated";
881
+ value: Aventus.RamItem<ResourceDetails, Request>;
882
+ }>>;
883
+ protected addEventsBindings(): void;
884
+ protected listenOnStart(): AventusSharp.RAM.RamWebSocketListenOnStart;
885
+ complete(objects?: ResourceDetails | ResourceDetails[]): AventusSharp.RAM.RamCompletor<ResourceDetails>;
886
+ @BindThis()
887
+ protected otherGetAll(items: ResourceSimple[], params: Aventus.UriParamsValue, uid?: string): Promise<void>;
888
+ protected beforeGetAll(): Promise<AventusSharp.Tools.VoidWithError>;
889
+ @BindThis()
890
+ protected otherGetById(item: Aventus.ExtractFromError<ResourceDetails>, params: Aventus.UriParamsValue, uid?: string): any;
891
+ protected beforeGetById(id: number): Promise<AventusSharp.Tools.VoidWithError>;
892
+ protected beforeGetByIds(ids: number[]): Promise<AventusSharp.Tools.VoidWithError>;
893
+ @BindThis()
894
+ protected otherCreateItem(item: Aventus.ExtractFromError<ResourceDetails>, params: Aventus.UriParamsValue, uid?: string): any;
895
+ protected transformCreateRequestListToItem(list: Request[]): Promise<AventusSharp.Tools.ResultWithError<ResourceDetails[]>>;
896
+ protected transformCreateRequestToItem(item: Request): Promise<AventusSharp.Tools.ResultWithError<ResourceDetails>>;
897
+ @BindThis()
898
+ protected otherCreateList(items: Aventus.ExtractFromError<ResourceDetails[]>, params: Aventus.UriParamsValue, uid?: string): any;
899
+ @BindThis()
900
+ protected otherUpdateItem(item: Aventus.ExtractFromError<ResourceDetails>, params: Aventus.UriParamsValue, uid?: string): any;
901
+ protected transformUpdateRequestListToItem(list: Request[]): Promise<AventusSharp.Tools.ResultWithError<ResourceDetails[]>>;
902
+ protected transformUpdateRequestToItem(item: Request): Promise<AventusSharp.Tools.ResultWithError<ResourceDetails>>;
903
+ @BindThis()
904
+ protected otherUpdateList(items: Aventus.ExtractFromError<ResourceDetails[]>, params: Aventus.UriParamsValue, uid?: string): any;
905
+ @BindThis()
906
+ protected otherDeleteItem(id: Aventus.ExtractFromError<number>, params: Aventus.UriParamsValue, uid?: string): void;
907
+ protected beforeDeleteItem(item: ResourceDetails, fromList: boolean): Promise<AventusSharp.Tools.VoidWithError>;
908
+ @BindThis()
909
+ protected otherDeleteList(ids: number[], params: Aventus.UriParamsValue, uid?: string): void;
910
+ protected beforeDeleteList(list: ResourceDetails[]): Promise<AventusSharp.Tools.VoidWithError>;
911
+ /**
912
+ * Delete element inside Ram without firing delete event
913
+ */
914
+ protected deleteData(id: number): AventusSharp.Tools.ResultWithError<Aventus.RamItem<ResourceDetails, Request>>;
915
+ }
916
+ }
917
+
918
+ }
919
+ }
920
+ declare module ___AventusSharp {
921
+ namespace RAM {
922
+ type KeysOfType<T, U> = {
923
+ [K in keyof T]: NonNullable<T[K]> extends U ? K : never;
924
+ }[keyof T];
925
+ }
926
+
927
+ namespace RAM {
928
+ type NumberKeys<T> = {
929
+ [K in keyof T]: T[K] extends number ? K : never;
930
+ }[keyof T];
931
+ }
932
+
933
+ type MauiConfig = {
934
+ filter: (url: string, method: string) => boolean;
935
+ showLog: boolean;
936
+ autoLoad: boolean;
937
+ };
938
+
939
+ namespace RAM {
940
+ type ItemField<T, U extends Aventus.IRamData> = {
941
+ id: AventusSharp.RAM.NumberKeys<T>;
942
+ obj: AventusSharp.RAM.KeysOfType<T, U>;
943
+ ram: typeof Aventus.Ram<U>;
944
+ };
945
+ }
946
+ }//#endregion js def //
947
+ //#region js src //
948
+ {"namespace":"AventusSharp","available":[{"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__as1(_.WebSocket, 'SocketErrorCode', WebSocket.SocketErrorCode);\n","dependencies":[],"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`;\n__as1(_.WebSocket, 'Socket', WebSocket.Socket);\n","dependencies":[{"fullName":"AventusSharp.WebSocket.Socket","isStrong":false},{"fullName":"Aventus.Callback","isStrong":false}],"fullName":"AventusSharp.WebSocket.Socket","required":false,"type":1,"isExported":true,"convertibleName":""},{"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`;\nData.Storable.$schema={...(Aventus.Data?.$schema ?? {}), \"Id\":\"number\"};\nAventus.Converter.register(Data.Storable.Fullname, Data.Storable);\n__as1(_.Data, 'Storable', Data.Storable);\n","dependencies":[{"fullName":"Aventus.Data","isStrong":true},{"fullName":"Aventus.IData","isStrong":true}],"fullName":"AventusSharp.Data.Storable","required":false,"type":2,"isExported":true,"convertibleName":""},{"code":"Data.StorableTimestamp=class StorableTimestamp extends Data.Storable {\n CreatedDate = Aventus.DateTime.utcNow;\n UpdatedDate = Aventus.DateTime.utcNow;\n}\nData.StorableTimestamp.Namespace=`AventusSharp.Data`;\nData.StorableTimestamp.$schema={...(Data.Storable?.$schema ?? {}), \"CreatedDate\":\"Aventus.DateTime\",\"UpdatedDate\":\"Aventus.DateTime\"};\nAventus.Converter.register(Data.StorableTimestamp.Fullname, Data.StorableTimestamp);\n__as1(_.Data, 'StorableTimestamp', Data.StorableTimestamp);\n","dependencies":[{"fullName":"AventusSharp.Data.Storable","isStrong":true},{"fullName":"Aventus.IData","isStrong":true},{"fullName":"Aventus.DateTime","isStrong":false}],"fullName":"AventusSharp.Data.StorableTimestamp","required":false,"type":2,"isExported":true,"convertibleName":""},{"code":"(function (WsErrorCode) {\n WsErrorCode[WsErrorCode[\"UnknownError\"] = 0] = \"UnknownError\";\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__as1(_.WebSocket, 'WsErrorCode', WebSocket.WsErrorCode);\n","dependencies":[],"fullName":"AventusSharp.WebSocket.WsErrorCode","required":false,"type":6,"isExported":true,"convertibleName":""},{"code":"(function (SSEErrorCode) {\n SSEErrorCode[SSEErrorCode[\"UnknownError\"] = 0] = \"UnknownError\";\n SSEErrorCode[SSEErrorCode[\"CantDefineAssembly\"] = 1] = \"CantDefineAssembly\";\n SSEErrorCode[SSEErrorCode[\"ConfigError\"] = 2] = \"ConfigError\";\n SSEErrorCode[SSEErrorCode[\"MultipleMainEndpoint\"] = 3] = \"MultipleMainEndpoint\";\n SSEErrorCode[SSEErrorCode[\"CantGetValueFromBody\"] = 4] = \"CantGetValueFromBody\";\n SSEErrorCode[SSEErrorCode[\"NoEndPoint\"] = 5] = \"NoEndPoint\";\n})(SSE.SSEErrorCode || (SSE.SSEErrorCode = {}));\n__as1(_.SSE, 'SSEErrorCode', SSE.SSEErrorCode);\n","dependencies":[],"fullName":"AventusSharp.SSE.SSEErrorCode","required":false,"type":6,"isExported":true,"convertibleName":""},{"code":"(function (RouteErrorCode) {\n RouteErrorCode[RouteErrorCode[\"UnknownError\"] = 0] = \"UnknownError\";\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 RouteErrorCode[RouteErrorCode[\"ConfigError\"] = 6] = \"ConfigError\";\n})(Routes.RouteErrorCode || (Routes.RouteErrorCode = {}));\n__as1(_.Routes, 'RouteErrorCode', Routes.RouteErrorCode);\n","dependencies":[],"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[\"SelfReferecingDependency\"] = 8] = \"SelfReferecingDependency\";\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[\"UnknownError\"] = 16] = \"UnknownError\";\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[\"ReverseLinkExist\"] = 37] = \"ReverseLinkExist\";\n DataErrorCode[DataErrorCode[\"ErrorCreatingReverseQuery\"] = 38] = \"ErrorCreatingReverseQuery\";\n DataErrorCode[DataErrorCode[\"LinkNotSet\"] = 39] = \"LinkNotSet\";\n DataErrorCode[DataErrorCode[\"MultipleProvidersNotSet\"] = 40] = \"MultipleProvidersNotSet\";\n DataErrorCode[DataErrorCode[\"FileNotFound\"] = 41] = \"FileNotFound\";\n DataErrorCode[DataErrorCode[\"PyramidNotFound\"] = 42] = \"PyramidNotFound\";\n DataErrorCode[DataErrorCode[\"IsReadOnly\"] = 43] = \"IsReadOnly\";\n DataErrorCode[DataErrorCode[\"ReverseLinkNotPrepared\"] = 44] = \"ReverseLinkNotPrepared\";\n DataErrorCode[DataErrorCode[\"ExternalStorageNotPrepared\"] = 45] = \"ExternalStorageNotPrepared\";\n})(Data.DataErrorCode || (Data.DataErrorCode = {}));\n__as1(_.Data, 'DataErrorCode', Data.DataErrorCode);\n","dependencies":[],"fullName":"AventusSharp.Data.DataErrorCode","required":false,"type":6,"isExported":true,"convertibleName":""},{"code":"(function (ImageFileErrorCode) {\n ImageFileErrorCode[ImageFileErrorCode[\"UnknownError\"] = 0] = \"UnknownError\";\n ImageFileErrorCode[ImageFileErrorCode[\"NotValidImage\"] = 1] = \"NotValidImage\";\n ImageFileErrorCode[ImageFileErrorCode[\"FileNotSvg\"] = 2] = \"FileNotSvg\";\n ImageFileErrorCode[ImageFileErrorCode[\"NoSize\"] = 3] = \"NoSize\";\n})(Data.CustomTableMembers.ImageFileErrorCode || (Data.CustomTableMembers.ImageFileErrorCode = {}));\n__as1(_.Data.CustomTableMembers, 'ImageFileErrorCode', Data.CustomTableMembers.ImageFileErrorCode);\n","dependencies":[],"fullName":"AventusSharp.Data.CustomTableMembers.ImageFileErrorCode","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`;\n__as1(_.Data, 'SharpClass', Data.SharpClass);\n","dependencies":[],"fullName":"AventusSharp.Data.SharpClass","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"Routes.Request.Request=class Request extends Data.SharpClass {\n}\nRoutes.Request.Request.Namespace=`AventusSharp.Routes.Request`;\n__as1(_.Routes.Request, 'Request', Routes.Request.Request);\n","dependencies":[{"fullName":"AventusSharp.Data.SharpClass","isStrong":true}],"fullName":"AventusSharp.Routes.Request.Request","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"Routes.Response.Resource=class Resource extends Data.SharpClass {\n toRequest(request) {\n const result = new request();\n const resourceClone = Aventus.clone(this);\n Aventus.Json.classFromJson(result, resourceClone, {\n replaceUndefined: true\n });\n return result;\n }\n}\nRoutes.Response.Resource.Namespace=`AventusSharp.Routes.Response`;\n__as1(_.Routes.Response, 'Resource', Routes.Response.Resource);\n","dependencies":[{"fullName":"AventusSharp.Data.SharpClass","isStrong":true},{"fullName":"AventusSharp.Routes.Request.Request","isStrong":false},{"fullName":"T","isStrong":false},{"fullName":"Aventus.clone","isStrong":false},{"fullName":"Aventus.Json","isStrong":false}],"fullName":"AventusSharp.Routes.Response.Resource","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"Data.FieldErrorInfo=class FieldErrorInfo extends _.Data.SharpClass {\n static get Fullname() { return \"AventusSharp.Data.FieldErrorInfo, AventusSharp.Core\"; }\n Name;\n}\nData.FieldErrorInfo.Namespace=`AventusSharp.Data`;\nData.FieldErrorInfo.$schema={...(Data.SharpClass?.$schema ?? {}), \"Name\":\"string\"};\nAventus.Converter.register(Data.FieldErrorInfo.Fullname, Data.FieldErrorInfo);\n__as1(_.Data, 'FieldErrorInfo', Data.FieldErrorInfo);\n","dependencies":[{"fullName":"AventusSharp.Data.SharpClass","isStrong":true},{"fullName":"Convertible","isStrong":false}],"fullName":"AventusSharp.Data.FieldErrorInfo","required":false,"type":1,"isExported":true,"convertibleName":"Fullname"},{"code":"Data.CustomTableMembers.AventusFile=class AventusFile {\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.CustomTableMembers.AventusFile.Namespace=`AventusSharp.Data.CustomTableMembers`;\n__as1(_.Data.CustomTableMembers, 'AventusFile', Data.CustomTableMembers.AventusFile);\n","dependencies":[],"fullName":"AventusSharp.Data.CustomTableMembers.AventusFile","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"Data.CustomTableMembers.AventusImage=class AventusImage extends _.Data.CustomTableMembers.AventusFile {\n}\nData.CustomTableMembers.AventusImage.Namespace=`AventusSharp.Data.CustomTableMembers`;\n__as1(_.Data.CustomTableMembers, 'AventusImage', Data.CustomTableMembers.AventusImage);\n","dependencies":[{"fullName":"AventusSharp.Data.CustomTableMembers.AventusFile","isStrong":true},{"fullName":"Aventus.IData","isStrong":false}],"fullName":"AventusSharp.Data.CustomTableMembers.AventusImage","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"Data.CustomTableMembers.ImageFileError=class ImageFileError extends Aventus.GenericError {\n static get Fullname() { return \"AventusSharp.Data.CustomTableMembers.ImageFileError, AventusSharp.Core\"; }\n}\nData.CustomTableMembers.ImageFileError.Namespace=`AventusSharp.Data.CustomTableMembers`;\nData.CustomTableMembers.ImageFileError.$schema={...(Aventus.GenericError?.$schema ?? {}), };\nAventus.Converter.register(Data.CustomTableMembers.ImageFileError.Fullname, Data.CustomTableMembers.ImageFileError);\n__as1(_.Data.CustomTableMembers, 'ImageFileError', Data.CustomTableMembers.ImageFileError);\n","dependencies":[{"fullName":"Aventus.GenericError","isStrong":true},{"fullName":"AventusSharp.Data.CustomTableMembers.ImageFileErrorCode","isStrong":true},{"fullName":"Convertible","isStrong":false}],"fullName":"AventusSharp.Data.CustomTableMembers.ImageFileError","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.Core\"; }\n}\nTools.VoidWithError.Namespace=`AventusSharp.Tools`;\nTools.VoidWithError.$schema={...(Aventus.VoidWithError?.$schema ?? {}), };\nAventus.Converter.register(Tools.VoidWithError.Fullname, Tools.VoidWithError);\n__as1(_.Tools, 'VoidWithError', Tools.VoidWithError);\n","dependencies":[{"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.CustomTableMembers.VoidWithImageFileError=class VoidWithImageFileError extends Tools.VoidWithError {\n static get Fullname() { return \"AventusSharp.Data.CustomTableMembers.VoidWithImageFileError, AventusSharp.Core\"; }\n}\nData.CustomTableMembers.VoidWithImageFileError.Namespace=`AventusSharp.Data.CustomTableMembers`;\nData.CustomTableMembers.VoidWithImageFileError.$schema={...(Tools.VoidWithError?.$schema ?? {}), };\nAventus.Converter.register(Data.CustomTableMembers.VoidWithImageFileError.Fullname, Data.CustomTableMembers.VoidWithImageFileError);\n__as1(_.Data.CustomTableMembers, 'VoidWithImageFileError', Data.CustomTableMembers.VoidWithImageFileError);\n","dependencies":[{"fullName":"AventusSharp.Tools.VoidWithError","isStrong":true},{"fullName":"AventusSharp.Data.CustomTableMembers.ImageFileError","isStrong":false},{"fullName":"Convertible","isStrong":false}],"fullName":"AventusSharp.Data.CustomTableMembers.VoidWithImageFileError","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.Core\"; }\n}\nTools.ResultWithError.Namespace=`AventusSharp.Tools`;\nTools.ResultWithError.$schema={...(Aventus.ResultWithError?.$schema ?? {}), };\nAventus.Converter.register(Tools.ResultWithError.Fullname, Tools.ResultWithError);\n__as1(_.Tools, 'ResultWithError', Tools.ResultWithError);\n","dependencies":[{"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(router) {\n super(router);\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`;\n__as1(_.Routes, 'StorableRouter', Routes.StorableRouter);\n","dependencies":[{"fullName":"Aventus.HttpRoute","isStrong":true},{"fullName":"Aventus.IData","isStrong":false},{"fullName":"AventusSharp.Routes.Request.Request","isStrong":false},{"fullName":"AventusSharp.Routes.Response.Resource","isStrong":false},{"fullName":"BindThis","isStrong":false},{"fullName":"AventusSharp.Tools.ResultWithError","isStrong":false},{"fullName":"TypeResult","isStrong":false}],"fullName":"AventusSharp.Routes.StorableRouter","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"Data.CustomTableMembers.ResultWithImageFileError=class ResultWithImageFileError extends Tools.ResultWithError {\n static get Fullname() { return \"AventusSharp.Data.CustomTableMembers.ResultWithImageFileError, AventusSharp.Core\"; }\n}\nData.CustomTableMembers.ResultWithImageFileError.Namespace=`AventusSharp.Data.CustomTableMembers`;\nData.CustomTableMembers.ResultWithImageFileError.$schema={...(Tools.ResultWithError?.$schema ?? {}), };\nAventus.Converter.register(Data.CustomTableMembers.ResultWithImageFileError.Fullname, Data.CustomTableMembers.ResultWithImageFileError);\n__as1(_.Data.CustomTableMembers, 'ResultWithImageFileError', Data.CustomTableMembers.ResultWithImageFileError);\n","dependencies":[{"fullName":"AventusSharp.Tools.ResultWithError","isStrong":true},{"fullName":"AventusSharp.Data.CustomTableMembers.ImageFileError","isStrong":false},{"fullName":"Convertible","isStrong":false}],"fullName":"AventusSharp.Data.CustomTableMembers.ResultWithImageFileError","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.Core\"; }\n}\nData.DataError.Namespace=`AventusSharp.Data`;\nData.DataError.$schema={...(Aventus.GenericError?.$schema ?? {}), };\nAventus.Converter.register(Data.DataError.Fullname, Data.DataError);\n__as1(_.Data, 'DataError', Data.DataError);\n","dependencies":[{"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":"Data.ResultWithDataError=class ResultWithDataError extends Tools.ResultWithError {\n static get Fullname() { return \"AventusSharp.Data.ResultWithDataError, AventusSharp.Core\"; }\n}\nData.ResultWithDataError.Namespace=`AventusSharp.Data`;\nData.ResultWithDataError.$schema={...(Tools.ResultWithError?.$schema ?? {}), };\nAventus.Converter.register(Data.ResultWithDataError.Fullname, Data.ResultWithDataError);\n__as1(_.Data, 'ResultWithDataError', Data.ResultWithDataError);\n","dependencies":[{"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":"Data.VoidWithDataError=class VoidWithDataError extends Tools.VoidWithError {\n static get Fullname() { return \"AventusSharp.Data.VoidWithDataError, AventusSharp.Core\"; }\n}\nData.VoidWithDataError.Namespace=`AventusSharp.Data`;\nData.VoidWithDataError.$schema={...(Tools.VoidWithError?.$schema ?? {}), };\nAventus.Converter.register(Data.VoidWithDataError.Fullname, Data.VoidWithDataError);\n__as1(_.Data, 'VoidWithDataError', Data.VoidWithDataError);\n","dependencies":[{"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":"Routes.RouteError=class RouteError extends Aventus.GenericError {\n static get Fullname() { return \"AventusSharp.Routes.RouteError, AventusSharp.Core\"; }\n}\nRoutes.RouteError.Namespace=`AventusSharp.Routes`;\nRoutes.RouteError.$schema={...(Aventus.GenericError?.$schema ?? {}), };\nAventus.Converter.register(Routes.RouteError.Fullname, Routes.RouteError);\n__as1(_.Routes, 'RouteError', Routes.RouteError);\n","dependencies":[{"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.Core\"; }\n}\nRoutes.ResultWithRouteError.Namespace=`AventusSharp.Routes`;\nRoutes.ResultWithRouteError.$schema={...(Tools.ResultWithError?.$schema ?? {}), };\nAventus.Converter.register(Routes.ResultWithRouteError.Fullname, Routes.ResultWithRouteError);\n__as1(_.Routes, 'ResultWithRouteError', Routes.ResultWithRouteError);\n","dependencies":[{"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.Core\"; }\n}\nRoutes.VoidWithRouteError.Namespace=`AventusSharp.Routes`;\nRoutes.VoidWithRouteError.$schema={...(Tools.VoidWithError?.$schema ?? {}), };\nAventus.Converter.register(Routes.VoidWithRouteError.Fullname, Routes.VoidWithRouteError);\n__as1(_.Routes, 'VoidWithRouteError', Routes.VoidWithRouteError);\n","dependencies":[{"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":"SSE.SSEError=class SSEError extends Aventus.GenericError {\n static get Fullname() { return \"AventusSharp.SSE.SSEError, AventusSharp.AspNetCore\"; }\n}\nSSE.SSEError.Namespace=`AventusSharp.SSE`;\nSSE.SSEError.$schema={...(Aventus.GenericError?.$schema ?? {}), };\nAventus.Converter.register(SSE.SSEError.Fullname, SSE.SSEError);\n__as1(_.SSE, 'SSEError', SSE.SSEError);\n","dependencies":[{"fullName":"Aventus.GenericError","isStrong":true},{"fullName":"AventusSharp.SSE.SSEErrorCode","isStrong":true},{"fullName":"Convertible","isStrong":false}],"fullName":"AventusSharp.SSE.SSEError","required":false,"type":1,"isExported":true,"convertibleName":"Fullname"},{"code":"SSE.ResultWithSSEError=class ResultWithSSEError extends Tools.ResultWithError {\n static get Fullname() { return \"AventusSharp.SSE.ResultWithSSEError, AventusSharp.AspNetCore\"; }\n}\nSSE.ResultWithSSEError.Namespace=`AventusSharp.SSE`;\nSSE.ResultWithSSEError.$schema={...(Tools.ResultWithError?.$schema ?? {}), };\nAventus.Converter.register(SSE.ResultWithSSEError.Fullname, SSE.ResultWithSSEError);\n__as1(_.SSE, 'ResultWithSSEError', SSE.ResultWithSSEError);\n","dependencies":[{"fullName":"AventusSharp.Tools.ResultWithError","isStrong":true},{"fullName":"AventusSharp.SSE.SSEError","isStrong":false},{"fullName":"Convertible","isStrong":false}],"fullName":"AventusSharp.SSE.ResultWithSSEError","required":false,"type":1,"isExported":true,"convertibleName":"Fullname"},{"code":"SSE.VoidWithSSEError=class VoidWithSSEError extends Tools.VoidWithError {\n static get Fullname() { return \"AventusSharp.SSE.VoidWithSSEError, AventusSharp.AspNetCore\"; }\n}\nSSE.VoidWithSSEError.Namespace=`AventusSharp.SSE`;\nSSE.VoidWithSSEError.$schema={...(Tools.VoidWithError?.$schema ?? {}), };\nAventus.Converter.register(SSE.VoidWithSSEError.Fullname, SSE.VoidWithSSEError);\n__as1(_.SSE, 'VoidWithSSEError', SSE.VoidWithSSEError);\n","dependencies":[{"fullName":"AventusSharp.Tools.VoidWithError","isStrong":true},{"fullName":"AventusSharp.SSE.SSEError","isStrong":false},{"fullName":"Convertible","isStrong":false}],"fullName":"AventusSharp.SSE.VoidWithSSEError","required":false,"type":1,"isExported":true,"convertibleName":"Fullname"},{"code":"WebSocket.WsError=class WsError extends Aventus.GenericError {\n static get Fullname() { return \"AventusSharp.WebSocket.WsError, AventusSharp.AspNetCore\"; }\n}\nWebSocket.WsError.Namespace=`AventusSharp.WebSocket`;\nWebSocket.WsError.$schema={...(Aventus.GenericError?.$schema ?? {}), };\nAventus.Converter.register(WebSocket.WsError.Fullname, WebSocket.WsError);\n__as1(_.WebSocket, 'WsError', WebSocket.WsError);\n","dependencies":[{"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.AspNetCore\"; }\n}\nWebSocket.ResultWithWsError.Namespace=`AventusSharp.WebSocket`;\nWebSocket.ResultWithWsError.$schema={...(Tools.ResultWithError?.$schema ?? {}), };\nAventus.Converter.register(WebSocket.ResultWithWsError.Fullname, WebSocket.ResultWithWsError);\n__as1(_.WebSocket, 'ResultWithWsError', WebSocket.ResultWithWsError);\n","dependencies":[{"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.AspNetCore\"; }\n}\nWebSocket.VoidWithWsError.Namespace=`AventusSharp.WebSocket`;\nWebSocket.VoidWithWsError.$schema={...(Tools.VoidWithError?.$schema ?? {}), };\nAventus.Converter.register(WebSocket.VoidWithWsError.Fullname, WebSocket.VoidWithWsError);\n__as1(_.WebSocket, 'VoidWithWsError', WebSocket.VoidWithWsError);\n","dependencies":[{"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":"let Maui=class Maui {\n static config = {\n filter: (url, method) => url.includes(\"/api\"),\n showLog: false,\n autoLoad: true,\n };\n static async configure(config) {\n this.config = {\n ...config,\n ...this.config\n };\n this.overrideFetch();\n if (this.config.autoLoad)\n await this.loadBlazor();\n }\n static loadBlazor() {\n return new Promise(async (resolve) => {\n const script = document.createElement(\"script\");\n script.setAttribute(\"autostart\", \"false\");\n script.src = \"/_framework/blazor.webview.js\";\n script.onload = function () {\n const w = window;\n w.Blazor.start().then(() => {\n resolve();\n });\n };\n document.head.appendChild(script);\n });\n }\n static overridedFetch = false;\n static overrideFetch() {\n if (this.overridedFetch)\n return;\n this.overridedFetch = true;\n const originalFetch = window.fetch;\n window.fetch = async (input, init = {}) => {\n const url = typeof input === 'string' ? input : input.url;\n const method = init.method || 'GET';\n if (this.config.filter(url, method)) {\n let bodyArray = null;\n const headers = init.headers;\n let contentType = headers?.['Content-Type'] || '';\n if (init.body) {\n if (init.body instanceof FormData) {\n const response = new Response(init.body);\n bodyArray = new Uint8Array(await response.arrayBuffer());\n contentType = response.headers.get('content-type');\n }\n else if (typeof init.body === 'string') {\n bodyArray = new TextEncoder().encode(init.body);\n if (!contentType)\n contentType = 'application/json';\n }\n else {\n bodyArray = new Uint8Array(await new Response(init.body).arrayBuffer());\n }\n if (this.config.showLog) {\n console.log(`${url} (${method})`, init.body);\n }\n }\n else if (this.config.showLog) {\n console.log(`${url} (${method})`);\n }\n const w = window;\n const result = await w.DotNet.invokeMethodAsync('AventusSharp.Maui', 'EmulateRequest', method, url, bodyArray, contentType);\n const responseHeaders = new Headers(result.headers);\n const mimeType = responseHeaders.get('content-type') || 'application/octet-stream';\n if (this.config.showLog) {\n console.groupCollapsed(`%c[${method}] ${url.substring(url.indexOf('/api'))} -> Status: ${result.status}`, `color: ${result.status === 200 ? '#4CAF50' : '#F44336'}; font-weight: bold;`);\n }\n let decodedContent = new TextDecoder().decode(result.content);\n let parsedResponse = decodedContent;\n if (mimeType == \"application/json\") {\n try {\n parsedResponse = JSON.parse(decodedContent);\n }\n catch (e) { }\n }\n let parsedPayload = init.body;\n if (typeof parsedPayload === 'string') {\n try {\n parsedPayload = JSON.parse(parsedPayload);\n }\n catch (e) { }\n }\n if (this.config.showLog) {\n console.table({\n \"Request\": { Méthode: method, URL: url, \"Payload Type\": contentType },\n \"Response\": { Statut: result.status, Type: typeof parsedResponse }\n });\n console.log(\"%cPayload Content :\", \"color: #2196F3; font-weight: bold;\", init.body || \"None\");\n console.log(\"%cResponse Content :\", \"color: #9C27B0; font-weight: bold;\", parsedResponse);\n console.groupEnd();\n }\n return new Response(result.content.length == 0 ? null : result.content, {\n status: result.status,\n headers: responseHeaders\n });\n }\n return originalFetch(input, init);\n };\n }\n}\nMaui.Namespace=`AventusSharp`;\n__as1(_, 'Maui', Maui);\n","dependencies":[{"fullName":"AventusSharp.MauiConfig","isStrong":true}],"fullName":"AventusSharp.Maui","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"RAM.RamCompletor=class RamCompletor {\n objects = [];\n fields = [];\n constructor(objects) {\n if (!objects) {\n objects = [];\n }\n else if (!Array.isArray(objects)) {\n objects = [objects];\n }\n this.objects = objects;\n }\n add(field) {\n this.fields.push(field);\n return this;\n }\n async run() {\n const objects = this.objects;\n const fields = this.fields;\n const result = new Aventus.VoidWithError();\n if (objects.length == 0)\n return result;\n const listIds = {};\n const mapRecords = {};\n for (let field of fields) {\n let objKey = field.obj;\n let idKey = field.id;\n listIds[objKey] = [];\n mapRecords[objKey] = {};\n for (let _value of objects) {\n let value = _value;\n if (value[idKey]) {\n const listId = listIds[objKey];\n const mapRecord = mapRecords[objKey];\n if (value[objKey])\n continue;\n if (!listId.includes(value[idKey]))\n listId.push(value[idKey]);\n if (!mapRecord[value[idKey]]) {\n mapRecord[value[idKey]] = [];\n }\n mapRecord[value[idKey]].push(value);\n }\n }\n }\n for (let field of fields) {\n let objKey = field.obj;\n if (!listIds[objKey] || !mapRecords[objKey])\n continue;\n const listId = listIds[objKey];\n const mapRecord = mapRecords[objKey];\n if (listId.length > 0) {\n const ram = Aventus.Instance.get(field.ram);\n const resultTemp = await result.extractAsync(() => ram.getByIdsWithError(listId));\n if (resultTemp) {\n for (let item of resultTemp) {\n if (mapRecord[item.Id]) {\n for (let record of mapRecord[item.Id]) {\n record[objKey] = item;\n }\n }\n }\n }\n }\n }\n return result;\n }\n}\nRAM.RamCompletor.Namespace=`AventusSharp.RAM`;\n__as1(_.RAM, 'RamCompletor', RAM.RamCompletor);\n","dependencies":[{"fullName":"AventusSharp.RAM.ItemField","isStrong":false},{"fullName":"Aventus.IRamData","isStrong":false},{"fullName":"U","isStrong":false},{"fullName":"AventusSharp.RAM.RamCompletor","isStrong":false},{"fullName":"Aventus.VoidWithError","isStrong":false}],"fullName":"AventusSharp.RAM.RamCompletor","required":false,"type":1,"isExported":true,"convertibleName":""},{"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() {\n const result = new Aventus.VoidWithError();\n if (!this.getAllDone) {\n const list = await result.extractAsync(this.routes.GetAll);\n if (!list)\n return result;\n for (let item of list) {\n await result.runAsync(() => this.addOrUpdateData(item));\n }\n this.getAllDone = true;\n }\n return result;\n }\n async beforeGetById(id) {\n const result = new Aventus.VoidWithError();\n if (this.records.has(id)) {\n return result;\n }\n else {\n const item = await result.extractAsync(() => this.routes.GetById(id));\n if (item) {\n await result.runAsync(() => this.addOrUpdateData(item));\n }\n }\n return result;\n }\n async beforeGetByIds(ids) {\n const result = new Aventus.VoidWithError();\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 const response = await result.extractAsync(() => this.routes.GetByIds({ ids: missingIds }));\n if (response) {\n for (let item of response) {\n await result.runAsync(() => this.addOrUpdateData(item));\n }\n }\n }\n return result;\n }\n complete(objects) {\n return new _.RAM.RamCompletor(objects);\n }\n transformCreateRequestToItem(item) {\n return this.routes.Create({ item: item });\n }\n transformCreateRequestListToItem(list) {\n return this.routes.CreateMany({ list });\n }\n async transformUpdateRequestToItem(item) {\n const result = new Aventus.ResultWithError();\n const id = result.extract(() => this.getIdWithError(item));\n if (id === undefined)\n return result;\n return await this.routes.Update(id, { item: item });\n }\n transformUpdateRequestListToItem(list) {\n return this.routes.UpdateMany({ list });\n }\n async beforeDeleteItem(item, fromList) {\n const result = new Aventus.VoidWithError();\n if (fromList) {\n return result;\n }\n const id = result.extract(() => this.getIdWithError(item));\n if (id === undefined)\n return result;\n await result.runAsync(() => this.routes.Delete(id));\n return result;\n }\n async beforeDeleteList(list) {\n const result = new Aventus.VoidWithError();\n if (list.length == 0)\n return result;\n const ids = [];\n for (let item of list) {\n const id = result.extract(() => this.getIdWithError(item));\n if (id === undefined)\n return result;\n ids.push(id);\n }\n await result.runAsync(() => this.routes.DeleteMany({ ids }));\n return result;\n }\n}\nRAM.RamHttp.Namespace=`AventusSharp.RAM`;\n__as1(_.RAM, 'RamHttp', RAM.RamHttp);\n","dependencies":[{"fullName":"Aventus.Ram","isStrong":true},{"fullName":"AventusSharp.Data.Storable","isStrong":false},{"fullName":"AventusSharp.Routes.Request.Request","isStrong":false},{"fullName":"AventusSharp.Routes.Response.Resource","isStrong":false},{"fullName":"AventusSharp.Routes.StorableRouter","isStrong":false},{"fullName":"Aventus.VoidWithError","isStrong":false},{"fullName":"AventusSharp.RAM.RamCompletor","isStrong":false},{"fullName":"Aventus.ResultWithError","isStrong":false}],"fullName":"AventusSharp.RAM.RamHttp","required":false,"type":1,"isExported":true,"convertibleName":""},{"code":"WebSocket.SocketError=class SocketError extends Aventus.GenericError {\n}\nWebSocket.SocketError.Namespace=`AventusSharp.WebSocket`;\nWebSocket.SocketError.$schema={...(Aventus.GenericError?.$schema ?? {}), };\nAventus.Converter.register(WebSocket.SocketError.Fullname, WebSocket.SocketError);\n__as1(_.WebSocket, 'SocketError', WebSocket.SocketError);\n","dependencies":[{"fullName":"Aventus.GenericError","isStrong":true},{"fullName":"AventusSharp.WebSocket.SocketErrorCode","isStrong":false}],"fullName":"AventusSharp.WebSocket.SocketError","required":false,"type":1,"isExported":true,"convertibleName":"Fullname"},{"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 const t = this;\n if (t[key] instanceof Aventus.Date || t[key] instanceof Aventus.DateTime || t[key] instanceof Aventus.Time) {\n return Aventus.DateConverter.converter.toString(t[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 = Aventus.DateTime.now;\n const hours = (now.hour).toLocaleString(undefined, { minimumIntegerDigits: 2 });\n const minutes = (now.minute).toLocaleString(undefined, { minimumIntegerDigits: 2 });\n const seconds = (now.second).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`;\n__as1(_.WebSocket, 'Connection', WebSocket.Connection);\n","dependencies":[{"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.Callback","isStrong":false},{"fullName":"AventusSharp.WebSocket.SocketRoute","isStrong":false},{"fullName":"AventusSharp.WebSocket.InternalSocketRoute","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":"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`;\n__as1(_.WebSocket, 'EndPoint', WebSocket.EndPoint);\n","dependencies":[{"fullName":"AventusSharp.WebSocket.Connection","isStrong":true},{"fullName":"AventusSharp.WebSocket.EndPoint","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`;\n__as1(_.WebSocket, 'WsEvent', WebSocket.WsEvent);\n","dependencies":[{"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`;\n__as1(_.WebSocket, 'StorableWsRoute_DeleteMany', WebSocket.StorableWsRoute_DeleteMany);\n","dependencies":[{"fullName":"AventusSharp.WebSocket.WsEvent","isStrong":true},{"fullName":"Aventus.ResultWithError","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`;\n__as1(_.WebSocket, 'StorableWsRouter_Delete', WebSocket.StorableWsRouter_Delete);\n","dependencies":[{"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`;\n__as1(_.WebSocket, 'StorableWsRoute_UpdateMany', WebSocket.StorableWsRoute_UpdateMany);\n","dependencies":[{"fullName":"AventusSharp.WebSocket.WsEvent","isStrong":true},{"fullName":"Aventus.ResultWithError","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`;\n__as1(_.WebSocket, 'StorableWsRouter_Update', WebSocket.StorableWsRouter_Update);\n","dependencies":[{"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`;\n__as1(_.WebSocket, 'StorableWsRouter_GetByIds', WebSocket.StorableWsRouter_GetByIds);\n","dependencies":[{"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`;\n__as1(_.WebSocket, 'StorableWsRouter_GetById', WebSocket.StorableWsRouter_GetById);\n","dependencies":[{"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`;\n__as1(_.WebSocket, 'StorableWsRoute_CreateMany', WebSocket.StorableWsRoute_CreateMany);\n","dependencies":[{"fullName":"AventusSharp.WebSocket.WsEvent","isStrong":true},{"fullName":"Aventus.ResultWithError","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`;\n__as1(_.WebSocket, 'StorableWsRouter_Create', WebSocket.StorableWsRouter_Create);\n","dependencies":[{"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`;\n__as1(_.WebSocket, 'StorableWsRouter_GetAll', WebSocket.StorableWsRouter_GetAll);\n","dependencies":[{"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`;\n__as1(_.WebSocket, 'Router', WebSocket.Router);\n","dependencies":[{"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`;\n__as1(_.WebSocket, 'StorableWsRouter', WebSocket.StorableWsRouter);\n","dependencies":[{"fullName":"AventusSharp.WebSocket.Router","isStrong":true},{"fullName":"Aventus.IData","isStrong":false},{"fullName":"AventusSharp.Routes.Request.Request","isStrong":false},{"fullName":"AventusSharp.Routes.Response.Resource","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":"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 addOrUpdateData(item) {\n return super.addOrUpdateData(item);\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 complete(objects) {\n return new _.RAM.RamCompletor(objects);\n }\n async otherGetAll(items, params, uid) {\n if (uid && this.otherGetAllLocked[uid])\n return;\n for (let item of items) {\n await this.addOrUpdateData(item);\n }\n }\n async beforeGetAll() {\n const result = new Tools.VoidWithError();\n if (!this.getAllDone) {\n let uid = Aventus.uuidv4();\n this.otherGetAllLocked[uid] = true;\n const list = await result.extractAsync(() => this.routes.GetAll({ uid }));\n delete this.otherGetAllLocked[uid];\n if (!list)\n return result;\n for (let item of list) {\n await result.runAsync(() => this.addOrUpdateData(item));\n }\n }\n return result;\n }\n async otherGetById(item, params, uid) {\n if (uid && this.otherGetByIdLocked[uid])\n return;\n await this.addOrUpdateData(item);\n }\n async beforeGetById(id) {\n const result = new Tools.VoidWithError();\n if (this.records.has(id)) {\n return result;\n }\n let uid = Aventus.uuidv4();\n this.otherGetByIdLocked[uid] = true;\n const item = await result.extractAsync(() => this.routes.GetById(id));\n delete this.otherGetByIdLocked[uid];\n if (!item)\n return result;\n await result.runAsync(() => this.addOrUpdateData(item));\n return result;\n }\n async beforeGetByIds(ids) {\n const result = new Tools.VoidWithError();\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 const response = await result.extractAsync(() => this.routes.GetByIds({ ids: missingIds }));\n if (!response)\n return result;\n for (let item of response) {\n await result.runAsync(() => this.addOrUpdateData(item));\n }\n }\n return result;\n }\n async otherCreateItem(item, params, uid) {\n if (uid && this.otherCreateItemLocked[uid])\n return;\n const resultTemp = await this.addOrUpdateData(item);\n if (resultTemp.success && resultTemp.result) {\n this.publish('created', resultTemp.result.value);\n }\n }\n async transformCreateRequestListToItem(list) {\n const uid = Aventus.uuidv4();\n this.otherCreateListLocked[uid] = true;\n const result = await this.routes.CreateMany({ list });\n delete this.otherCreateListLocked[uid];\n return result;\n }\n async transformCreateRequestToItem(item) {\n const uid = Aventus.uuidv4();\n this.otherCreateItemLocked[uid] = true;\n const result = await this.routes.Create({ request: item });\n delete this.otherCreateItemLocked[uid];\n return result;\n }\n async otherCreateList(items, params, uid) {\n if (uid && this.otherCreateListLocked[uid])\n return;\n for (let item of items) {\n const resultTemp = await this.addOrUpdateData(item);\n if (resultTemp.success && resultTemp.result) {\n this.publish('created', resultTemp.result.value);\n }\n }\n }\n async otherUpdateItem(item, params, uid) {\n if (uid && this.otherUpdateItemLocked[uid])\n return;\n const resultTemp = await this.addOrUpdateData(item);\n if (resultTemp.success && resultTemp.result) {\n this.publish('updated', resultTemp.result.value);\n }\n }\n async transformUpdateRequestListToItem(list) {\n let uid = Aventus.uuidv4();\n this.otherUpdateListLocked[uid] = true;\n const result = await this.routes.UpdateMany({ list });\n delete this.otherUpdateListLocked[uid];\n return result;\n }\n async transformUpdateRequestToItem(item) {\n const result = new Tools.ResultWithError();\n const id = result.extract(() => this.getIdWithError(item));\n if (id === undefined)\n return result;\n let uid = Aventus.uuidv4();\n this.otherUpdateItemLocked[uid] = true;\n const temp = await this.routes.Update(id, { request: item });\n delete this.otherUpdateItemLocked[uid];\n return temp;\n }\n async otherUpdateList(items, params, uid) {\n if (uid && this.otherUpdateListLocked[uid])\n return;\n for (let item of items) {\n const resultTemp = await this.addOrUpdateData(item);\n if (resultTemp.success && resultTemp.result) {\n this.publish('updated', resultTemp.result.value);\n }\n }\n }\n otherDeleteItem(id, params, uid) {\n if (uid && this.otherDeleteItemLocked[uid])\n return;\n const resultTemp = this.deleteData(id);\n if (resultTemp.success && resultTemp.result) {\n this.publish('deleted', resultTemp.result);\n this.recordsSubscribers.delete(id);\n }\n }\n async beforeDeleteItem(item, fromList) {\n const result = new Tools.VoidWithError();\n if (fromList) {\n return result;\n }\n let uid = Aventus.uuidv4();\n this.otherDeleteItemLocked[uid] = true;\n const id = await result.extract(() => this.getIdWithError(item));\n if (id === undefined)\n return result;\n await result.runAsync(() => this.routes.Delete(id, { uid }));\n delete this.otherDeleteItemLocked[uid];\n return result;\n }\n otherDeleteList(ids, params, uid) {\n if (uid && this.otherDeleteListLocked[uid])\n return;\n for (let id of ids) {\n const resultTemp = this.deleteData(id);\n if (resultTemp.success && resultTemp.result) {\n this.publish('deleted', resultTemp.result);\n this.recordsSubscribers.delete(id);\n }\n }\n }\n async beforeDeleteList(list) {\n const result = new Tools.VoidWithError();\n if (list.length == 0)\n return result;\n const ids = [];\n for (let item of list) {\n const id = result.extract(() => this.getIdWithError(item));\n if (id === undefined)\n return result;\n ids.push(id);\n }\n let uid = Aventus.uuidv4();\n this.otherDeleteListLocked[uid] = true;\n await result.runAsync(() => this.routes.DeleteMany({ ids }));\n delete this.otherDeleteListLocked[uid];\n return result;\n }\n /**\n * Delete element inside Ram without firing delete event\n */\n deleteData(id) {\n const result = new Tools.ResultWithError();\n try {\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 catch (e) {\n result.errors.push(new Aventus.RamError(Aventus.RamErrorCode.unknow, e));\n }\n return result;\n }\n}\nRAM.RamWebSocket.Namespace=`AventusSharp.RAM`;\n__as1(_.RAM, 'RamWebSocket', RAM.RamWebSocket);\n","dependencies":[{"fullName":"Aventus.Ram","isStrong":true},{"fullName":"AventusSharp.Data.Storable","isStrong":false},{"fullName":"AventusSharp.Routes.Request.Request","isStrong":false},{"fullName":"AventusSharp.Routes.Response.Resource","isStrong":false},{"fullName":"AventusSharp.WebSocket.StorableWsRouter","isStrong":false},{"fullName":"Aventus.ExtractFromError","isStrong":false},{"fullName":"AventusSharp.Tools.ResultWithError","isStrong":false},{"fullName":"Aventus.RamItem","isStrong":false},{"fullName":"AventusSharp.RAM.RamWebSocketListenOnStart","isStrong":false},{"fullName":"AventusSharp.RAM.RamCompletor","isStrong":false},{"fullName":"BindThis","isStrong":false},{"fullName":"Aventus.UriParamsValue","isStrong":false},{"fullName":"AventusSharp.Tools.VoidWithError","isStrong":false},{"fullName":"Aventus.uuidv4","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","dependencies":[]},{"fullName":"AventusSharp.RAM.RamWebSocketListenOnStart","dependencies":[]},{"fullName":"AventusSharp.WebSocket.WsRouteSendOptions","dependencies":[]},{"fullName":"AventusSharp.WebSocket.SocketMessage","dependencies":[]},{"fullName":"AventusSharp.WebSocket.SocketSendMessageOptions","dependencies":[]},{"fullName":"AventusSharp.WebSocket.SocketRoute","dependencies":[{"fullName":"Aventus.UriParamsValue","isStrong":false}]},{"fullName":"AventusSharp.RAM.KeysOfType","dependencies":[{"fullName":"T","isStrong":false},{"fullName":"U","isStrong":false},{"fullName":"K","isStrong":false}]},{"fullName":"AventusSharp.RAM.NumberKeys","dependencies":[{"fullName":"T","isStrong":false},{"fullName":"K","isStrong":false}]},{"fullName":"AventusSharp.MauiConfig","dependencies":[]},{"fullName":"AventusSharp.Data.IStorableTimestamp","dependencies":[{"fullName":"Aventus.IData","isStrong":true},{"fullName":"Aventus.DateTime","isStrong":false}]},{"fullName":"AventusSharp.Tools.IWithError","dependencies":[{"fullName":"Aventus.GenericError","isStrong":false}]},{"fullName":"AventusSharp.Tools.IResultWithError","dependencies":[{"fullName":"AventusSharp.Tools.IWithError","isStrong":true},{"fullName":"Aventus.GenericError","isStrong":false}]},{"fullName":"AventusSharp.RAM.ItemField","dependencies":[{"fullName":"Aventus.IRamData","isStrong":false},{"fullName":"AventusSharp.RAM.NumberKeys","isStrong":false},{"fullName":"T","isStrong":false},{"fullName":"AventusSharp.RAM.KeysOfType","isStrong":false},{"fullName":"U","isStrong":false}]},{"fullName":"AventusSharp.WebSocket.InternalSocketRoute","dependencies":[{"fullName":"AventusSharp.WebSocket.SocketRoute","isStrong":false},{"fullName":"Aventus.PreparedUri","isStrong":false}]},{"fullName":"AventusSharp.WebSocket.ConnectionOptions","dependencies":[{"fullName":"AventusSharp.WebSocket.InternalSocketRoute","isStrong":false}]},{"fullName":"AventusSharp.WebSocket.WsEndPointType","dependencies":[{"fullName":"AventusSharp.WebSocket.EndPoint","isStrong":false}]},{"fullName":"AventusSharp.WebSocket.ExtractResultFrom","dependencies":[{"fullName":"AventusSharp.WebSocket.WsEvent","isStrong":false},{"fullName":"T","isStrong":false},{"fullName":"U","isStrong":false}]},{"fullName":"AventusSharp.WebSocket.WsEventType","dependencies":[{"fullName":"AventusSharp.WebSocket.WsEvent","isStrong":false}]},{"fullName":"AventusSharp.ExtractResponse","dependencies":[{"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","dependencies":[{"fullName":"AventusSharp.WebSocket.WsEvent","isStrong":false}]},{"fullName":"AventusSharp.WebSocket.WsRouterType","dependencies":[{"fullName":"AventusSharp.WebSocket.Router","isStrong":false}]},{"fullName":"AventusSharp.WebSocket.StorableWsRouter__Routes","dependencies":[{"fullName":"Aventus.IData","isStrong":false},{"fullName":"AventusSharp.Routes.Request.Request","isStrong":false},{"fullName":"T","isStrong":false},{"fullName":"AventusSharp.Routes.Response.Resource","isStrong":false},{"fullName":"R","isStrong":false},{"fullName":"AventusSharp.WebSocket.StorableWsRouter_GetAll","isStrong":false},{"fullName":"AventusSharp.WebSocket.StorableWsRouter_Create","isStrong":false},{"fullName":"S","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}]}]}
949
+ //#endregion js src //
950
+ //#region css def //
951
+ {}
952
+ //#endregion css def //
953
+ //#region css //
954
+ {}
955
+ //#endregion css //
956
+ //#region html //
957
+ {}
958
+ //#endregion html //
959
+ //#region dependencies //
960
+ {}
961
+ //#endregion dependencies //