http-request-manager 18.5.9 → 18.5.10

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.
@@ -735,37 +735,22 @@ class ChannelInfo {
735
735
  }
736
736
  }
737
737
 
738
- var CommunicationType;
739
- (function (CommunicationType) {
740
- CommunicationType[CommunicationType["MESSAGE"] = 0] = "MESSAGE";
741
- CommunicationType[CommunicationType["ALERT"] = 1] = "ALERT";
742
- CommunicationType[CommunicationType["OTHER"] = 2] = "OTHER";
743
- })(CommunicationType || (CommunicationType = {}));
744
-
745
- class ChannelMessage {
746
- constructor(fromUser = null, toUser = null, content = null, issued = new Date(), type = CommunicationType.MESSAGE) {
747
- this.fromUser = fromUser;
748
- this.toUser = toUser;
738
+ class WSUser {
739
+ constructor(sessionId, content) {
740
+ this.sessionId = sessionId;
749
741
  this.content = content;
750
- this.issued = issued;
751
- this.type = type;
752
742
  }
753
743
  static adapt(item) {
754
- return new ChannelMessage(item?.fromUser, item?.toUser, item?.content, item?.issued, item?.type);
744
+ return new WSUser(item?.sessionId, item?.content);
755
745
  }
756
746
  }
757
747
 
758
- class UserMessage {
759
- constructor(fromUser, toUser, content, issued) {
760
- this.fromUser = fromUser;
761
- this.toUser = toUser;
762
- this.content = content;
763
- this.issued = issued;
764
- }
765
- static adapt(item) {
766
- return new UserMessage(item?.fromUser, item?.name?.toUser, item?.content, item?.name?.issued);
767
- }
768
- }
748
+ var CommunicationType;
749
+ (function (CommunicationType) {
750
+ CommunicationType[CommunicationType["MESSAGE"] = 0] = "MESSAGE";
751
+ CommunicationType[CommunicationType["ALERT"] = 1] = "ALERT";
752
+ CommunicationType[CommunicationType["OTHER"] = 2] = "OTHER";
753
+ })(CommunicationType || (CommunicationType = {}));
769
754
 
770
755
  class WebsocketService {
771
756
  constructor() {
@@ -889,7 +874,7 @@ class WebsocketService {
889
874
  sendMessageInChannel(channel, content) {
890
875
  if (this.socket?.readyState === WebSocket.OPEN) {
891
876
  this.socket.send(JSON.stringify({ type: 'stateMangerMessage', subscribedChannel: channel, content }));
892
- console.log(`💬 Send message: ${content}`);
877
+ console.log(`💬 Send message:`, content);
893
878
  }
894
879
  else {
895
880
  console.error('WebSocket is not open. Cannot send message.');
@@ -898,7 +883,7 @@ class WebsocketService {
898
883
  sendMessageToUser(user, content) {
899
884
  if (this.socket?.readyState === WebSocket.OPEN) {
900
885
  this.socket.send(JSON.stringify({ type: 'userMessage', subscribedChannel: user, content }));
901
- console.log(`💬 Send message: ${content}`);
886
+ console.log(`💬 Send message:`, content);
902
887
  }
903
888
  else {
904
889
  console.error('WebSocket is not open. Cannot send message.');
@@ -1841,16 +1826,6 @@ class WSOptions {
1841
1826
  }
1842
1827
  }
1843
1828
 
1844
- class WSUser {
1845
- constructor(id = '', adapter) {
1846
- this.id = id;
1847
- this.adapter = adapter;
1848
- }
1849
- static adapt(item) {
1850
- return new WSUser(item?.id, item?.adapter);
1851
- }
1852
- }
1853
-
1854
1829
  class ObjectMergerService {
1855
1830
  constructor(configOptions) {
1856
1831
  this.configOptions = configOptions;
@@ -2582,10 +2557,8 @@ class DbService extends Dexie {
2582
2557
  await this.dbReady;
2583
2558
  const safeTableName = this.cleanTableName(tableName);
2584
2559
  const safeSchema = schema.trim();
2585
- if (this.tableExists(safeTableName)) {
2586
- console.log(`Table ${safeTableName} already exists.`);
2560
+ if (this.tableExists(safeTableName))
2587
2561
  return;
2588
- }
2589
2562
  const currentSchema = this.getCurrentSchema();
2590
2563
  console.log('Current Schema before update:', currentSchema);
2591
2564
  currentSchema[safeTableName] = safeSchema;
@@ -2838,6 +2811,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
2838
2811
  }]
2839
2812
  }], ctorParameters: () => [] });
2840
2813
 
2814
+ class ChannelMessage {
2815
+ constructor(sessionId = '', content, message = '', users = [], issued = Math.floor(new Date().getTime() / 1000)) {
2816
+ this.sessionId = sessionId;
2817
+ this.content = content;
2818
+ this.message = message;
2819
+ this.users = users;
2820
+ this.issued = issued;
2821
+ }
2822
+ static adapt(item) {
2823
+ return new ChannelMessage(item?.sessionId, item?.content, item?.message, (item?.users) ? item?.users.map((userItem) => WSUser.adapt(userItem)) : [], item?.issued);
2824
+ }
2825
+ }
2826
+
2841
2827
  const API_OPTS = new InjectionToken('API_OPTS');
2842
2828
  const defaultState = {
2843
2829
  data: [],
@@ -2887,27 +2873,20 @@ class HTTPManagerStateService extends ComponentStore {
2887
2873
  // WebSocket
2888
2874
  this.initWS = this.effect((wsOptions$) => wsOptions$.pipe(tap((wsOptions) => {
2889
2875
  this.wsOptions = wsOptions;
2890
- if (wsOptions?.wsServer)
2891
- this.httpManagerService.connect(wsOptions, wsOptions.jwtToken);
2892
2876
  }), switchMap((wsOptions) => merge(this.httpManagerService.connectionStatus$.pipe(tap((isConnected) => {
2893
2877
  this.wsConnection = isConnected;
2894
- if (isConnected) {
2895
- console.log('🟢 WebSocket connection is open.');
2896
- }
2897
- else {
2898
- console.log('🔴 WebSocket connection is closed.');
2899
- }
2900
2878
  })), this.httpManagerService.messages$.pipe(tap((message) => {
2901
2879
  if (!message)
2902
2880
  return;
2903
- console.log('Received:', message.type);
2881
+ console.log('Received:', message);
2904
2882
  if (message.error === 'JWT_INVALID') {
2905
2883
  this.shouldRetry = false;
2906
2884
  this.httpManagerService.disconnect();
2907
2885
  }
2908
2886
  if (message.type === 'success') {
2909
2887
  if (message.data.sessionId !== this.user.value?.sessionId) {
2910
- this.user.next(message.data);
2888
+ const user = WSUser.adapt(message.data);
2889
+ this.user.next(user);
2911
2890
  }
2912
2891
  }
2913
2892
  switch (message.type) {
@@ -2923,7 +2902,7 @@ class HTTPManagerStateService extends ComponentStore {
2923
2902
  break;
2924
2903
  case 'stateMangerMessage':
2925
2904
  ;
2926
- if (message.data.sessionId !== this.user.value.sessionId) {
2905
+ if (message.data.sessionId !== this.user.value?.sessionId) {
2927
2906
  console.log('💬 Message:', message.data);
2928
2907
  this.userAction.next(message.data);
2929
2908
  this.fetchRecord(RequestOptions.adapt({ path: message.data.content.path }), message.data.content.method);
@@ -3264,6 +3243,12 @@ class HTTPManagerStateService extends ComponentStore {
3264
3243
  this.dataType = (dataType) ? dataType : DataType.ARRAY;
3265
3244
  this.hasDatabase = (this.database?.table) ? true : false;
3266
3245
  this.database = (this.hasDatabase) ? DatabaseStorage.adapt(database) : undefined;
3246
+ // Update WebSocket retry settings when options change
3247
+ if (this.apiOptions.ws?.retry) {
3248
+ this.maxRetries = this.apiOptions.ws.retry.times || 3;
3249
+ this.retryDelay = (this.apiOptions.ws.retry.delay && this.apiOptions.ws.retry.delay * 1000) || 5 * 1000;
3250
+ this.wsNextRetry.next(this.retryDelay);
3251
+ }
3267
3252
  if (this.database)
3268
3253
  this.initDBStorage();
3269
3254
  if (this.apiOptions.ws)
@@ -3271,7 +3256,14 @@ class HTTPManagerStateService extends ComponentStore {
3271
3256
  }
3272
3257
  // WebSocket
3273
3258
  setupConnectionStatus() {
3274
- return this.httpManagerService.connectionStatus$.pipe(distinctUntilChanged(), switchMap(status => {
3259
+ return this.httpManagerService.connectionStatus$.pipe(distinctUntilChanged(), tap(status => {
3260
+ if (status === true) {
3261
+ console.log('🟢 WebSocket connection is open.');
3262
+ }
3263
+ else {
3264
+ console.log('🔴 WebSocket connection is closed.');
3265
+ }
3266
+ }), switchMap(status => {
3275
3267
  if (status === true) {
3276
3268
  this.shouldRetry = true;
3277
3269
  this.wsRetryAttempts.next(0);
@@ -3286,7 +3278,9 @@ class HTTPManagerStateService extends ComponentStore {
3286
3278
  const attempt = i + 1;
3287
3279
  this.wsRetryAttempts.next(attempt);
3288
3280
  countdownEnder$.next();
3281
+ // Attempt connection on each retry
3289
3282
  if (this.apiOptions.ws?.wsServer) {
3283
+ console.log(`🔄 Retry attempt #${attempt}/${this.maxRetries}`);
3290
3284
  this.httpManagerService.connect(this.apiOptions.ws, this.apiOptions.ws.jwtToken || '');
3291
3285
  }
3292
3286
  if (attempt === this.maxRetries) {
@@ -3378,20 +3372,19 @@ class HTTPManagerStateService extends ComponentStore {
3378
3372
  this.httpManagerService.sendMessageInChannel(wsServer, { method, path, user: this.apiOptions.ws.user });
3379
3373
  }
3380
3374
  }
3381
- wsMessaging(message, channel) {
3375
+ wsMessaging(message, channels) {
3382
3376
  const user = this.user.value || this.user.value;
3383
3377
  const messageInfo = ChannelMessage.adapt({ ...message, fromUser: user });
3384
3378
  if (this.wsConnection && this.apiOptions.ws) {
3385
- const wsServer = (channel) ? channel : this.apiOptions.ws.id;
3386
- if (messageInfo.toUser === 'allChannels') {
3387
- this.httpManagerService.sendBroadcast(messageInfo);
3388
- }
3389
- else if (messageInfo.toUser === 'allInChannel') {
3390
- this.httpManagerService.sendMessageInChannel(wsServer, messageInfo);
3391
- }
3392
- else {
3393
- this.httpManagerService.sendMessageToUser(wsServer, messageInfo);
3394
- }
3379
+ const wsServer = (channels) ? channels : this.apiOptions.ws.id;
3380
+ debugger;
3381
+ // if(messageInfo.toUser === 'allChannels') {
3382
+ // this.httpManagerService.sendBroadcast(messageInfo)
3383
+ // } else if(messageInfo.toUser === 'allInChannel') {
3384
+ // this.httpManagerService.sendMessageInChannel(wsServer, messageInfo)
3385
+ // } else {
3386
+ // this.httpManagerService.sendMessageToUser(wsServer, messageInfo)
3387
+ // }
3395
3388
  }
3396
3389
  }
3397
3390
  // --------------------------------------------------------------------------------------------------
@@ -4100,8 +4093,8 @@ class StateRequestServiceDemo extends HTTPManagerStateService {
4100
4093
  jwtToken,
4101
4094
  user, // user object
4102
4095
  retry: RetryOptions.adapt({
4103
- times: 3,
4104
- delay: 10,
4096
+ times: 10,
4097
+ delay: 5,
4105
4098
  }),
4106
4099
  }
4107
4100
  });
@@ -4110,6 +4103,7 @@ class StateRequestServiceDemo extends HTTPManagerStateService {
4110
4103
  });
4111
4104
  }
4112
4105
  sendMessage(data) {
4106
+ debugger;
4113
4107
  console.log('sendMessage', data);
4114
4108
  this.wsMessaging(data);
4115
4109
  }
@@ -4182,6 +4176,7 @@ class StateDataRequestService extends HTTPManagerStateService {
4182
4176
  this.createRecord(newData, RequestOptions.adapt({ path: ['ai', 'tests'] }));
4183
4177
  }
4184
4178
  sendMessage(data) {
4179
+ debugger;
4185
4180
  console.log('sendMessage', data);
4186
4181
  this.wsMessaging(data);
4187
4182
  }
@@ -4246,11 +4241,11 @@ class WsDataControlComponent {
4246
4241
  this.stateDataRequestService.deleteData(lastRec);
4247
4242
  }
4248
4243
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WsDataControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4249
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: WsDataControlComponent, selector: "app-ws-data-control", inputs: { server: "server", wsServer: "wsServer", jwtToken: "jwtToken", user: "user" }, ngImport: i0, template: "@if ((data$ | async); as data) {\n <div style=\"margin: 1rem;\">\n @if ((users$ |async); as users) {\n <div>\n @if (users.length > 0) {\n <h3 style=\"margin: 0;\">Connected Users</h3>\n } @else {\n <h3 style=\"margin: 0;\">No Users</h3>\n }\n <mat-chip-listbox>\n @for (user of users; track user) {\n <mat-chip-option [selected]=\"isUser(user, (user$ | async))\">\n {{ user.content.name }}\n </mat-chip-option>\n }\n </mat-chip-listbox>\n </div>\n }\n <div style=\"margin-top: 1rem; margin-bottom: 1rem;\">\n <mat-divider></mat-divider>\n </div>\n\n <div class=\"box\" style=\"margin-bottom: 1rem;\" *ngIf=\"(userAction$ | async) as userAction\">\n {{ userAction?.content.user.name }} has {{ userAction?.content.method }}\n </div>\n\n <h3 style=\"margin: 0;\">Data Actions</h3>\n <div style=\"display: flex; gap: 1rem; margin-bottom: 1rem;\">\n <button mat-stroked-button (click)=\"onGetData()\">Get Data</button>\n <div style=\"flex:1\"></div>\n <button mat-stroked-button color=\"accent\" (click)=\"onUpdateData(data)\">Update Data</button>\n <button mat-stroked-button color=\"warn\" (click)=\"onRemoveData(data)\">Remove Data</button>\n <button mat-stroked-button color=\"primary\" (click)=\"onAddData()\">Add Data</button>\n </div>\n @if (data.length > 0) {\n <div>\n <table mat-table [dataSource]=\"data\" style=\"border: 1px solid grey;\">\n <ng-container matColumnDef=\"id\">\n <th mat-header-cell *matHeaderCellDef> ID </th>\n <td mat-cell *matCellDef=\"let element\"> {{element.id}} </td>\n </ng-container>\n <ng-container matColumnDef=\"spiffe\">\n <th mat-header-cell *matHeaderCellDef> Spiffe </th>\n <td mat-cell *matCellDef=\"let element\"> {{element.spiffe}} </td>\n </ng-container>\n <ng-container matColumnDef=\"name\">\n <th mat-header-cell *matHeaderCellDef> Name </th>\n <td mat-cell *matCellDef=\"let element\"> {{element.first_name}} {{element.last_name}}</td>\n </ng-container>\n <ng-container matColumnDef=\"email\">\n <th mat-header-cell *matHeaderCellDef> Email </th>\n <td mat-cell *matCellDef=\"let element\"> {{element.email}} </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef=\"['id', 'spiffe', 'name', 'email']\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: ['id', 'spiffe', 'name', 'email'];\"></tr>\n </table>\n <div style=\"border: 1px solid grey; padding: .5rem; border-top: none;\">\n <h3 style=\"margin: 0;\">Total Records {{ data.length }}</h3>\n </div>\n </div>\n } @else {\n <div style=\"margin-top: 1rem; font-style: italic;\">\n No Data Available\n </div>\n }\n </div>\n}\n\n", styles: [".box{padding:.5rem;border:1px solid rgb(174,174,13);background-color:#ececaf}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatChipListbox, selector: "mat-chip-listbox", inputs: ["multiple", "aria-orientation", "selectable", "compareWith", "required", "hideSingleSelectionIndicator", "value"], outputs: ["change"] }, { kind: "component", type: i3$1.MatChipOption, selector: "mat-basic-chip-option, [mat-basic-chip-option], mat-chip-option, [mat-chip-option]", inputs: ["selectable", "selected"], outputs: ["selectionChange"] }, { kind: "component", type: i8.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i8.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i8.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i8.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i8.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i8.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i8.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i8.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i8.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i8.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i11.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }] }); }
4244
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: WsDataControlComponent, selector: "app-ws-data-control", inputs: { server: "server", wsServer: "wsServer", jwtToken: "jwtToken", user: "user" }, ngImport: i0, template: "@if ((data$ | async); as data) {\n <div style=\"margin: 1rem;\">\n @if ((users$ |async); as users) {\n <div>\n @if (users.length > 0) {\n <h3 style=\"margin: 0;\">Connected Users</h3>\n } @else {\n <h3 style=\"margin: 0;\">No Users</h3>\n }\n <mat-chip-set>\n @for (user of users; track user) {\n <mat-chip\n [class.user-chip--primary]=\"isUser(user, (user$ | async))\"\n [style.color]=\"isUser(user, (user$ | async)) ? '#fff' : null\"\n [disableRipple]=\"true\"\n >\n {{ user.content.name }}\n </mat-chip>\n }\n </mat-chip-set>\n </div>\n }\n <div style=\"margin-top: 1rem; margin-bottom: 1rem;\">\n <mat-divider></mat-divider>\n </div>\n\n <div class=\"box\" style=\"margin-bottom: 1rem;\" *ngIf=\"(userAction$ | async) as userAction\">\n {{ userAction?.content.user.name }} has {{ userAction?.content.method }}\n </div>\n\n <h3 style=\"margin: 0;\">Data Actions</h3>\n <div style=\"display: flex; gap: 1rem; margin-bottom: 1rem;\">\n <button mat-stroked-button (click)=\"onGetData()\">Get Data</button>\n <div style=\"flex:1\"></div>\n <button mat-stroked-button color=\"accent\" (click)=\"onUpdateData(data)\">Update Data</button>\n <button mat-stroked-button color=\"warn\" (click)=\"onRemoveData(data)\">Remove Data</button>\n <button mat-stroked-button color=\"primary\" (click)=\"onAddData()\">Add Data</button>\n </div>\n @if (data.length > 0) {\n <div>\n <table mat-table [dataSource]=\"data\" style=\"border: 1px solid grey;\">\n <ng-container matColumnDef=\"id\">\n <th mat-header-cell *matHeaderCellDef> ID </th>\n <td mat-cell *matCellDef=\"let element\"> {{element.id}} </td>\n </ng-container>\n <ng-container matColumnDef=\"spiffe\">\n <th mat-header-cell *matHeaderCellDef> Spiffe </th>\n <td mat-cell *matCellDef=\"let element\"> {{element.spiffe}} </td>\n </ng-container>\n <ng-container matColumnDef=\"name\">\n <th mat-header-cell *matHeaderCellDef> Name </th>\n <td mat-cell *matCellDef=\"let element\"> {{element.first_name}} {{element.last_name}}</td>\n </ng-container>\n <ng-container matColumnDef=\"email\">\n <th mat-header-cell *matHeaderCellDef> Email </th>\n <td mat-cell *matCellDef=\"let element\"> {{element.email}} </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef=\"['id', 'spiffe', 'name', 'email']\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: ['id', 'spiffe', 'name', 'email'];\"></tr>\n </table>\n <div style=\"border: 1px solid grey; padding: .5rem; border-top: none;\">\n <h3 style=\"margin: 0;\">Total Records {{ data.length }}</h3>\n </div>\n </div>\n } @else {\n <div style=\"margin-top: 1rem; font-style: italic;\">\n No Data Available\n </div>\n }\n </div>\n}\n\n", styles: [".user-chip--primary{background-color:var(--mdc-theme-primary, var(--md-sys-color-primary, #3f51b5))!important;color:#fff!important;--mdc-evolution-chip-container-color: var(--mdc-theme-primary, var(--md-sys-color-primary, #3f51b5));--mdc-evolution-chip-label-text-color: #fff}.user-chip--primary :is(.mdc-evolution-chip__text-label,.mdc-evolution-chip__action,.mdc-evolution-chip__cell,.mat-mdc-chip-action-label){color:#fff!important}.user-chip--primary,.user-chip--primary *{color:#fff!important}:host ::ng-deep .user-chip--primary{background-color:var(--mdc-theme-primary, var(--md-sys-color-primary, #3f51b5))!important;color:#fff!important;--mdc-evolution-chip-container-color: var(--mdc-theme-primary, var(--md-sys-color-primary, #3f51b5));--mdc-evolution-chip-label-text-color: #fff}:host ::ng-deep .user-chip--primary .mdc-evolution-chip__text-label,:host ::ng-deep .user-chip--primary .mdc-evolution-chip__action,:host ::ng-deep .user-chip--primary .mdc-evolution-chip__cell,:host ::ng-deep .user-chip--primary .mat-mdc-chip-action-label,:host ::ng-deep .user-chip--primary *{color:#fff!important}.box{padding:.5rem;border:1px solid rgb(174,174,13);background-color:#ececaf}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["role", "id", "aria-label", "aria-description", "value", "color", "removable", "highlighted", "disableRipple", "disabled"], outputs: ["removed", "destroyed"], exportAs: ["matChip"] }, { kind: "component", type: i3$1.MatChipSet, selector: "mat-chip-set", inputs: ["disabled", "role", "tabIndex"] }, { kind: "component", type: i8.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i8.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i8.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i8.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i8.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i8.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i8.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i8.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i8.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i8.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i11.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }] }); }
4250
4245
  }
4251
4246
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WsDataControlComponent, decorators: [{
4252
4247
  type: Component,
4253
- args: [{ selector: 'app-ws-data-control', standalone: false, template: "@if ((data$ | async); as data) {\n <div style=\"margin: 1rem;\">\n @if ((users$ |async); as users) {\n <div>\n @if (users.length > 0) {\n <h3 style=\"margin: 0;\">Connected Users</h3>\n } @else {\n <h3 style=\"margin: 0;\">No Users</h3>\n }\n <mat-chip-listbox>\n @for (user of users; track user) {\n <mat-chip-option [selected]=\"isUser(user, (user$ | async))\">\n {{ user.content.name }}\n </mat-chip-option>\n }\n </mat-chip-listbox>\n </div>\n }\n <div style=\"margin-top: 1rem; margin-bottom: 1rem;\">\n <mat-divider></mat-divider>\n </div>\n\n <div class=\"box\" style=\"margin-bottom: 1rem;\" *ngIf=\"(userAction$ | async) as userAction\">\n {{ userAction?.content.user.name }} has {{ userAction?.content.method }}\n </div>\n\n <h3 style=\"margin: 0;\">Data Actions</h3>\n <div style=\"display: flex; gap: 1rem; margin-bottom: 1rem;\">\n <button mat-stroked-button (click)=\"onGetData()\">Get Data</button>\n <div style=\"flex:1\"></div>\n <button mat-stroked-button color=\"accent\" (click)=\"onUpdateData(data)\">Update Data</button>\n <button mat-stroked-button color=\"warn\" (click)=\"onRemoveData(data)\">Remove Data</button>\n <button mat-stroked-button color=\"primary\" (click)=\"onAddData()\">Add Data</button>\n </div>\n @if (data.length > 0) {\n <div>\n <table mat-table [dataSource]=\"data\" style=\"border: 1px solid grey;\">\n <ng-container matColumnDef=\"id\">\n <th mat-header-cell *matHeaderCellDef> ID </th>\n <td mat-cell *matCellDef=\"let element\"> {{element.id}} </td>\n </ng-container>\n <ng-container matColumnDef=\"spiffe\">\n <th mat-header-cell *matHeaderCellDef> Spiffe </th>\n <td mat-cell *matCellDef=\"let element\"> {{element.spiffe}} </td>\n </ng-container>\n <ng-container matColumnDef=\"name\">\n <th mat-header-cell *matHeaderCellDef> Name </th>\n <td mat-cell *matCellDef=\"let element\"> {{element.first_name}} {{element.last_name}}</td>\n </ng-container>\n <ng-container matColumnDef=\"email\">\n <th mat-header-cell *matHeaderCellDef> Email </th>\n <td mat-cell *matCellDef=\"let element\"> {{element.email}} </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef=\"['id', 'spiffe', 'name', 'email']\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: ['id', 'spiffe', 'name', 'email'];\"></tr>\n </table>\n <div style=\"border: 1px solid grey; padding: .5rem; border-top: none;\">\n <h3 style=\"margin: 0;\">Total Records {{ data.length }}</h3>\n </div>\n </div>\n } @else {\n <div style=\"margin-top: 1rem; font-style: italic;\">\n No Data Available\n </div>\n }\n </div>\n}\n\n", styles: [".box{padding:.5rem;border:1px solid rgb(174,174,13);background-color:#ececaf}\n"] }]
4248
+ args: [{ selector: 'app-ws-data-control', standalone: false, template: "@if ((data$ | async); as data) {\n <div style=\"margin: 1rem;\">\n @if ((users$ |async); as users) {\n <div>\n @if (users.length > 0) {\n <h3 style=\"margin: 0;\">Connected Users</h3>\n } @else {\n <h3 style=\"margin: 0;\">No Users</h3>\n }\n <mat-chip-set>\n @for (user of users; track user) {\n <mat-chip\n [class.user-chip--primary]=\"isUser(user, (user$ | async))\"\n [style.color]=\"isUser(user, (user$ | async)) ? '#fff' : null\"\n [disableRipple]=\"true\"\n >\n {{ user.content.name }}\n </mat-chip>\n }\n </mat-chip-set>\n </div>\n }\n <div style=\"margin-top: 1rem; margin-bottom: 1rem;\">\n <mat-divider></mat-divider>\n </div>\n\n <div class=\"box\" style=\"margin-bottom: 1rem;\" *ngIf=\"(userAction$ | async) as userAction\">\n {{ userAction?.content.user.name }} has {{ userAction?.content.method }}\n </div>\n\n <h3 style=\"margin: 0;\">Data Actions</h3>\n <div style=\"display: flex; gap: 1rem; margin-bottom: 1rem;\">\n <button mat-stroked-button (click)=\"onGetData()\">Get Data</button>\n <div style=\"flex:1\"></div>\n <button mat-stroked-button color=\"accent\" (click)=\"onUpdateData(data)\">Update Data</button>\n <button mat-stroked-button color=\"warn\" (click)=\"onRemoveData(data)\">Remove Data</button>\n <button mat-stroked-button color=\"primary\" (click)=\"onAddData()\">Add Data</button>\n </div>\n @if (data.length > 0) {\n <div>\n <table mat-table [dataSource]=\"data\" style=\"border: 1px solid grey;\">\n <ng-container matColumnDef=\"id\">\n <th mat-header-cell *matHeaderCellDef> ID </th>\n <td mat-cell *matCellDef=\"let element\"> {{element.id}} </td>\n </ng-container>\n <ng-container matColumnDef=\"spiffe\">\n <th mat-header-cell *matHeaderCellDef> Spiffe </th>\n <td mat-cell *matCellDef=\"let element\"> {{element.spiffe}} </td>\n </ng-container>\n <ng-container matColumnDef=\"name\">\n <th mat-header-cell *matHeaderCellDef> Name </th>\n <td mat-cell *matCellDef=\"let element\"> {{element.first_name}} {{element.last_name}}</td>\n </ng-container>\n <ng-container matColumnDef=\"email\">\n <th mat-header-cell *matHeaderCellDef> Email </th>\n <td mat-cell *matCellDef=\"let element\"> {{element.email}} </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef=\"['id', 'spiffe', 'name', 'email']\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: ['id', 'spiffe', 'name', 'email'];\"></tr>\n </table>\n <div style=\"border: 1px solid grey; padding: .5rem; border-top: none;\">\n <h3 style=\"margin: 0;\">Total Records {{ data.length }}</h3>\n </div>\n </div>\n } @else {\n <div style=\"margin-top: 1rem; font-style: italic;\">\n No Data Available\n </div>\n }\n </div>\n}\n\n", styles: [".user-chip--primary{background-color:var(--mdc-theme-primary, var(--md-sys-color-primary, #3f51b5))!important;color:#fff!important;--mdc-evolution-chip-container-color: var(--mdc-theme-primary, var(--md-sys-color-primary, #3f51b5));--mdc-evolution-chip-label-text-color: #fff}.user-chip--primary :is(.mdc-evolution-chip__text-label,.mdc-evolution-chip__action,.mdc-evolution-chip__cell,.mat-mdc-chip-action-label){color:#fff!important}.user-chip--primary,.user-chip--primary *{color:#fff!important}:host ::ng-deep .user-chip--primary{background-color:var(--mdc-theme-primary, var(--md-sys-color-primary, #3f51b5))!important;color:#fff!important;--mdc-evolution-chip-container-color: var(--mdc-theme-primary, var(--md-sys-color-primary, #3f51b5));--mdc-evolution-chip-label-text-color: #fff}:host ::ng-deep .user-chip--primary .mdc-evolution-chip__text-label,:host ::ng-deep .user-chip--primary .mdc-evolution-chip__action,:host ::ng-deep .user-chip--primary .mdc-evolution-chip__cell,:host ::ng-deep .user-chip--primary .mat-mdc-chip-action-label,:host ::ng-deep .user-chip--primary *{color:#fff!important}.box{padding:.5rem;border:1px solid rgb(174,174,13);background-color:#ececaf}\n"] }]
4254
4249
  }], propDecorators: { server: [{
4255
4250
  type: Input
4256
4251
  }], wsServer: [{
@@ -4261,49 +4256,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
4261
4256
  type: Input
4262
4257
  }] } });
4263
4258
 
4264
- class WsNotificationsComponent {
4265
- constructor() { }
4266
- ngOnInit() {
4267
- }
4268
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WsNotificationsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4269
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: WsNotificationsComponent, selector: "app-ws-notifications", ngImport: i0, template: "<p>\n ws-notifications works!\n</p>\n", styles: [""] }); }
4270
- }
4271
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WsNotificationsComponent, decorators: [{
4272
- type: Component,
4273
- args: [{ selector: 'app-ws-notifications', standalone: false, template: "<p>\n ws-notifications works!\n</p>\n" }]
4274
- }], ctorParameters: () => [] });
4275
-
4276
- class WsAiMessagingComponent {
4277
- constructor() { }
4278
- ngOnInit() {
4279
- }
4280
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WsAiMessagingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4281
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: WsAiMessagingComponent, selector: "app-ws-ai-messaging", ngImport: i0, template: "<p>\n ws-ai-messaging works!\n</p>\n", styles: [""] }); }
4282
- }
4283
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WsAiMessagingComponent, decorators: [{
4284
- type: Component,
4285
- args: [{ selector: 'app-ws-ai-messaging', standalone: false, template: "<p>\n ws-ai-messaging works!\n</p>\n" }]
4286
- }], ctorParameters: () => [] });
4287
-
4288
- class RequestManagerWsDemoComponent {
4259
+ class WsMessagingComponent {
4289
4260
  constructor() {
4290
- this.httpManagerService = inject(HTTPManagerService);
4291
- this.stateRequestServiceDemo = inject(StateRequestServiceDemo);
4292
4261
  this.fb = inject(FormBuilder);
4262
+ this.stateRequestServiceDemo = inject(StateRequestServiceDemo);
4293
4263
  this.user$ = this.stateRequestServiceDemo.user$;
4294
4264
  this.users$ = this.stateRequestServiceDemo.userList$;
4295
- this.attempts$ = this.stateRequestServiceDemo.attempts$;
4296
- this.nextRetry$ = this.stateRequestServiceDemo.nextRetry$;
4297
- this.connectionStatus$ = this.stateRequestServiceDemo.status$;
4265
+ this.data$ = this.stateRequestServiceDemo.data$;
4298
4266
  this.messages = this.fb.group({
4299
- toUser: this.fb.control(null, Validators.required),
4267
+ toUsers: this.fb.control(null, Validators.required),
4300
4268
  content: this.fb.control(null, Validators.required),
4301
4269
  });
4302
- this.data$ = this.stateRequestServiceDemo.data$;
4303
- this.isPending$ = this.stateRequestServiceDemo.isPending$;
4304
- this.fromMe = (user, fromUser) => {
4305
- return user === fromUser;
4306
- };
4307
4270
  this.communicationMessages$ = this.stateRequestServiceDemo.communicationMessages$;
4308
4271
  this.latestCommunicationMessages$ = this.stateRequestServiceDemo.latestCommunicationMessages$;
4309
4272
  this.chat$ = combineLatest([this.user$, this.communicationMessages$])
@@ -4342,27 +4305,33 @@ class RequestManagerWsDemoComponent {
4342
4305
  return { user: mainUser, messages };
4343
4306
  }));
4344
4307
  }
4345
- get toUser() {
4346
- return this.messages.get('toUser');
4308
+ get toUsers() {
4309
+ return this.messages.get('toUsers');
4347
4310
  }
4348
4311
  get content() {
4349
4312
  return this.messages.get('content');
4350
4313
  }
4351
4314
  get isValid() {
4352
- return this.toUser.valid;
4315
+ return this.toUsers.valid;
4353
4316
  }
4354
4317
  ngOnInit() {
4355
4318
  this.stateRequestServiceDemo.updateConnection(this.server, this.wsServer, this.jwtToken, this.user);
4319
+ // this.stateRequestServiceDemo.getData()
4356
4320
  }
4357
- onSendMessage() {
4321
+ onSendMessage(user) {
4358
4322
  this.messages.markAllAsTouched();
4359
4323
  if (this.messages.invalid)
4360
4324
  return;
4361
- const message = ChannelMessage.adapt(this.messages.value);
4325
+ const message = ChannelMessage.adapt({
4326
+ message: this.messages.value.content,
4327
+ ...user,
4328
+ users: this.toUsers.value,
4329
+ });
4362
4330
  this.stateRequestServiceDemo.sendMessage(message);
4363
4331
  this.content.reset();
4364
4332
  }
4365
4333
  onSendAlert() {
4334
+ debugger;
4366
4335
  this.messages.markAllAsTouched();
4367
4336
  if (this.messages.invalid)
4368
4337
  return;
@@ -4370,12 +4339,123 @@ class RequestManagerWsDemoComponent {
4370
4339
  this.stateRequestServiceDemo.sendMessage(message);
4371
4340
  this.content.reset();
4372
4341
  }
4342
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WsMessagingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4343
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: WsMessagingComponent, selector: "app-ws-messaging", inputs: { server: "server", wsServer: "wsServer", jwtToken: "jwtToken", user: "user" }, ngImport: i0, template: "@if ((user$ | async); as user) {\n\n @if ((data$ | async); as data) {\n <div style=\"margin: 1rem; display: flex; gap: 1rem; flex-direction: column;\">\n @if ((user$ | async); as userInfo) {\n <div>\n @if ((users$ | async); as users) {\n <div>\n <div style=\"display: flex; gap: 1rem\">\n <div style=\"flex:1\" [formGroup]=\"messages\">\n <div style=\"display:flex\">\n <mat-form-field style=\"flex:1\" appearance=\"outline\">\n <mat-label>Users</mat-label>\n <mat-select formControlName=\"toUsers\" multiple #userSelect>\n <mat-select-trigger>\n {{ (userSelect.value?.[0] === 'allChannels' ? 'All Users' : userSelect.value?.[0]?.content?.name) || '' }}\n @if ((userSelect.value?.length || 0) > 1) {\n <span class=\"example-additional-selection\">\n (+{{(userSelect.value?.length || 0) - 1}} {{userSelect.value?.length === 2 ? 'other' : 'others'}})\n </span>\n }\n </mat-select-trigger>\n <mat-option value=\"allChannels\">\n All Users\n </mat-option>\n @for (user of users; track user) {\n <mat-option [value]=\"user\">\n {{ user.content.name }}\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n <div style=\"display:flex\">\n <mat-form-field style=\"flex:1\" appearance=\"outline\">\n <mat-label>Send a Message</mat-label>\n <textarea\n matInput placeholder=\"Ex. It makes me feel...\"\n formControlName=\"content\"\n (keydown.enter)=\"onSendMessage(user); $event.preventDefault()\"\n [disabled]=\"!isValid\"\n ></textarea>\n </mat-form-field>\n </div>\n <div style=\"display:flex; gap: .5rem;\">\n <div style=\"flex:1\"></div>\n <button mat-stroked-button (click)=\"onSendAlert()\" color=\"warn\">\n Send Alert\n </button>\n <button mat-stroked-button (click)=\"onSendMessage(user)\">\n Send Message\n </button>\n </div>\n </div>\n </div>\n @if ((chat$ | async); as chat) {\n <div style=\"border: thin gray solid; padding: 1rem; margin-top: 1rem;\">\n <!-- <app-messenger-chat\n [user]=\"chat.user\"\n [messages]=\"chat.messages\"\n ></app-messenger-chat> -->\n </div>\n }\n </div>\n }\n </div>\n }\n </div>\n }\n\n}\n", styles: [""], dependencies: [{ kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i2$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "component", type: i4.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "directive", type: i4.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i5.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i12.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }] }); }
4344
+ }
4345
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WsMessagingComponent, decorators: [{
4346
+ type: Component,
4347
+ args: [{ selector: 'app-ws-messaging', standalone: false, template: "@if ((user$ | async); as user) {\n\n @if ((data$ | async); as data) {\n <div style=\"margin: 1rem; display: flex; gap: 1rem; flex-direction: column;\">\n @if ((user$ | async); as userInfo) {\n <div>\n @if ((users$ | async); as users) {\n <div>\n <div style=\"display: flex; gap: 1rem\">\n <div style=\"flex:1\" [formGroup]=\"messages\">\n <div style=\"display:flex\">\n <mat-form-field style=\"flex:1\" appearance=\"outline\">\n <mat-label>Users</mat-label>\n <mat-select formControlName=\"toUsers\" multiple #userSelect>\n <mat-select-trigger>\n {{ (userSelect.value?.[0] === 'allChannels' ? 'All Users' : userSelect.value?.[0]?.content?.name) || '' }}\n @if ((userSelect.value?.length || 0) > 1) {\n <span class=\"example-additional-selection\">\n (+{{(userSelect.value?.length || 0) - 1}} {{userSelect.value?.length === 2 ? 'other' : 'others'}})\n </span>\n }\n </mat-select-trigger>\n <mat-option value=\"allChannels\">\n All Users\n </mat-option>\n @for (user of users; track user) {\n <mat-option [value]=\"user\">\n {{ user.content.name }}\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n <div style=\"display:flex\">\n <mat-form-field style=\"flex:1\" appearance=\"outline\">\n <mat-label>Send a Message</mat-label>\n <textarea\n matInput placeholder=\"Ex. It makes me feel...\"\n formControlName=\"content\"\n (keydown.enter)=\"onSendMessage(user); $event.preventDefault()\"\n [disabled]=\"!isValid\"\n ></textarea>\n </mat-form-field>\n </div>\n <div style=\"display:flex; gap: .5rem;\">\n <div style=\"flex:1\"></div>\n <button mat-stroked-button (click)=\"onSendAlert()\" color=\"warn\">\n Send Alert\n </button>\n <button mat-stroked-button (click)=\"onSendMessage(user)\">\n Send Message\n </button>\n </div>\n </div>\n </div>\n @if ((chat$ | async); as chat) {\n <div style=\"border: thin gray solid; padding: 1rem; margin-top: 1rem;\">\n <!-- <app-messenger-chat\n [user]=\"chat.user\"\n [messages]=\"chat.messages\"\n ></app-messenger-chat> -->\n </div>\n }\n </div>\n }\n </div>\n }\n </div>\n }\n\n}\n" }]
4348
+ }], propDecorators: { server: [{
4349
+ type: Input
4350
+ }], wsServer: [{
4351
+ type: Input
4352
+ }], jwtToken: [{
4353
+ type: Input
4354
+ }], user: [{
4355
+ type: Input
4356
+ }] } });
4357
+
4358
+ class WsNotificationsComponent {
4359
+ constructor() { }
4360
+ ngOnInit() {
4361
+ }
4362
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WsNotificationsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4363
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: WsNotificationsComponent, selector: "app-ws-notifications", ngImport: i0, template: "<p>\n ws-notifications coming soon!\n</p>\n", styles: [""] }); }
4364
+ }
4365
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WsNotificationsComponent, decorators: [{
4366
+ type: Component,
4367
+ args: [{ selector: 'app-ws-notifications', standalone: false, template: "<p>\n ws-notifications coming soon!\n</p>\n" }]
4368
+ }], ctorParameters: () => [] });
4369
+
4370
+ class WsAiMessagingComponent {
4371
+ constructor() { }
4372
+ ngOnInit() {
4373
+ }
4374
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WsAiMessagingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4375
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: WsAiMessagingComponent, selector: "app-ws-ai-messaging", ngImport: i0, template: "<p>\n ws-ai-messaging coming soon!\n</p>\n", styles: [""] }); }
4376
+ }
4377
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WsAiMessagingComponent, decorators: [{
4378
+ type: Component,
4379
+ args: [{ selector: 'app-ws-ai-messaging', standalone: false, template: "<p>\n ws-ai-messaging coming soon!\n</p>\n" }]
4380
+ }], ctorParameters: () => [] });
4381
+
4382
+ class RequestManagerWsDemoComponent {
4383
+ constructor() {
4384
+ this.httpManagerService = inject(HTTPManagerService);
4385
+ this.stateRequestServiceDemo = inject(StateRequestServiceDemo);
4386
+ this.fb = inject(FormBuilder);
4387
+ this.user$ = this.stateRequestServiceDemo.user$;
4388
+ // users$ = this.stateRequestServiceDemo.userList$
4389
+ this.attempts$ = this.stateRequestServiceDemo.attempts$;
4390
+ this.nextRetry$ = this.stateRequestServiceDemo.nextRetry$;
4391
+ this.connectionStatus$ = this.stateRequestServiceDemo.status$;
4392
+ // data$ = this.stateRequestServiceDemo.data$;
4393
+ this.isPending$ = this.stateRequestServiceDemo.isPending$;
4394
+ }
4395
+ // messages = this.fb.group<any>({
4396
+ // toUser: this.fb.control<string|null>(null, Validators.required),
4397
+ // content: this.fb.control<string|null>(null, Validators.required),
4398
+ // })
4399
+ // get toUser() {
4400
+ // return this.messages.get('toUser') as FormControl
4401
+ // }
4402
+ // get content() {
4403
+ // return this.messages.get('content') as FormControl
4404
+ // }
4405
+ // get isValid() {
4406
+ // return this.toUser.valid
4407
+ // }
4408
+ // fromMe = (user: string, fromUser: string) => {
4409
+ // return user === fromUser
4410
+ // }
4411
+ // communicationMessages$ = this.stateRequestServiceDemo.communicationMessages$
4412
+ // latestCommunicationMessages$ = this.stateRequestServiceDemo.latestCommunicationMessages$
4413
+ // chat$: Observable<{ user: any, messages: any[]}|any> = combineLatest([this.user$, this.communicationMessages$])
4414
+ // .pipe(
4415
+ // map(([user, messages]: any) => ({ user, messages })),
4416
+ // map(obj => {
4417
+ // if(!obj.user) return EMPTY
4418
+ // // const mainUser = UserName.adapt({
4419
+ // // id: obj.user.username,
4420
+ // // first: obj.user?.name?.first,
4421
+ // // last: obj.user?.name?.last,
4422
+ // // })
4423
+ // const mainUser = ''
4424
+ // const messages = obj.messages.map((item: any) => {
4425
+ // if(item.toUser === 'allChannels') {
4426
+ // // item.toUser = UserName.adapt({
4427
+ // // id: '',
4428
+ // // first: 'All Users',
4429
+ // // last: '',
4430
+ // // })
4431
+ // }
4432
+ // // return Message.adapt({
4433
+ // // fromUser: {
4434
+ // // id: item.fromUser.username,
4435
+ // // first: item.fromUser?.name?.first,
4436
+ // // last: item.fromUser?.name?.last,
4437
+ // // },
4438
+ // // toUser: {
4439
+ // // id: item.toUser.username,
4440
+ // // first: item.toUser?.name?.first,
4441
+ // // last: item.toUser?.name?.last,
4442
+ // // },
4443
+ // // content: item.content,
4444
+ // // date: item.issued,
4445
+ // // })
4446
+ // })
4447
+ // return { user: mainUser, messages }
4448
+ // })
4449
+ // );
4450
+ ngOnInit() {
4451
+ // this.stateRequestServiceDemo.updateConnection(this.server, this.wsServer, this.jwtToken, this.user);
4452
+ }
4373
4453
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RequestManagerWsDemoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4374
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: RequestManagerWsDemoComponent, selector: "app-request-manager-ws-demo", inputs: { server: "server", wsServer: "wsServer", jwtToken: "jwtToken", user: "user" }, ngImport: i0, template: "<div style=\"margin: 2rem;\">\n\n <h2 style=\"display: flex;\">\n <span style=\"flex:1\">HTTP Request State Manager - Websockets</span>\n @if ((connectionStatus$ | async); as connected) {\n <span>\n WS -\n <span style=\"color: green;\">Connected</span>\n </span>\n } @else {\n <span style=\"color: red;\">Disconnected {{ attempts$ | async }} - {{ nextRetry$ |async }}</span>\n }\n </h2>\n\n <div>\n\n @if ((user$ | async); as userInfo) {\n <div>\n <mat-toolbar>\n <div style=\"display: flex; flex:1\">\n <div style=\"flex:1\">{{ userInfo.content.name }}</div>\n <div>({{ userInfo.content.ldap }})</div>\n </div>\n </mat-toolbar>\n </div>\n }\n\n @if ((isPending$ | async)) {\n <div>\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n </div>\n }\n\n <mat-tab-group animationDuration=\"0ms\">\n\n <mat-tab label=\"WS - Data Control\">\n <!-- DATA CONTROL -->\n <app-ws-data-control\n [server]=\"server\"\n [wsServer]=\"wsServer\"\n [jwtToken]=\"jwtToken\"\n [user]=\"user\"\n ></app-ws-data-control>\n\n </mat-tab>\n\n <mat-tab label=\"WS - Messaging\">\n\n <!-- <app-ws-messaging\n [server]=\"server\"\n [wsServer]=\"wsServer\"\n [jwtToken]=\"jwtToken\"\n [user]=\"user\"\n ></app-ws-messaging> -->\n\n </mat-tab>\n\n <mat-tab label=\"WS - Notifications\" [disabled]=\"true\">\n <app-ws-notifications></app-ws-notifications>\n WS - Custom Messaging\n </mat-tab>\n\n <mat-tab label=\"WS - AI Messaging\" [disabled]=\"true\">\n <app-ws-ai-messaging></app-ws-ai-messaging>\n WS - AI Messaging\n </mat-tab>\n\n </mat-tab-group>\n</div>\n\n</div>\n\n", styles: [""], dependencies: [{ kind: "component", type: i1$3.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass"], exportAs: ["matTab"] }, { kind: "component", type: i1$3.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "fitInkBarToContent", "mat-stretch-tabs", "dynamicHeight", "selectedIndex", "headerPosition", "animationDuration", "contentTabIndex", "disablePagination", "disableRipple", "preserveContent", "backgroundColor", "aria-label", "aria-labelledby"], outputs: ["selectedIndexChange", "focusChange", "animationDone", "selectedTabChange"], exportAs: ["matTabGroup"] }, { kind: "component", type: i9.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "component", type: i3$2.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "component", type: WsDataControlComponent, selector: "app-ws-data-control", inputs: ["server", "wsServer", "jwtToken", "user"] }, { kind: "component", type: WsNotificationsComponent, selector: "app-ws-notifications" }, { kind: "component", type: WsAiMessagingComponent, selector: "app-ws-ai-messaging" }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }] }); }
4454
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: RequestManagerWsDemoComponent, selector: "app-request-manager-ws-demo", inputs: { server: "server", wsServer: "wsServer", jwtToken: "jwtToken", user: "user" }, ngImport: i0, template: "<div style=\"margin: 2rem;\">\n\n <h2 style=\"display: flex;\">\n <span style=\"flex:1\">HTTP Request State Manager - Websockets</span>\n @if ((connectionStatus$ | async); as connected) {\n <span>\n WS -\n <span style=\"color: green;\">Connected</span>\n </span>\n } @else {\n <span style=\"color: red;\">Disconnected {{ attempts$ | async }} - {{ nextRetry$ |async }}</span>\n }\n </h2>\n\n <div>\n\n @if ((user$ | async); as userInfo) {\n <div>\n <mat-toolbar>\n <div style=\"display: flex; flex:1\">\n <div style=\"flex:1\">{{ userInfo.content.name }}</div>\n <div>({{ userInfo.content.ldap }})</div>\n </div>\n </mat-toolbar>\n </div>\n }\n\n @if ((isPending$ | async)) {\n <div>\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n </div>\n }\n\n <mat-tab-group animationDuration=\"0ms\">\n\n <mat-tab label=\"WS - Data Control\">\n <!-- DATA CONTROL -->\n <app-ws-data-control\n [server]=\"server\"\n [wsServer]=\"wsServer\"\n [jwtToken]=\"jwtToken\"\n [user]=\"user\"\n ></app-ws-data-control>\n\n </mat-tab>\n\n <mat-tab label=\"WS - Messaging\">\n <!-- MESSAGING -->\n <app-ws-messaging\n [server]=\"server\"\n [wsServer]=\"wsServer\"\n [jwtToken]=\"jwtToken\"\n [user]=\"user\"\n ></app-ws-messaging>\n\n </mat-tab>\n\n <mat-tab label=\"WS - Notifications\" [disabled]=\"true\">\n <!-- WS - Custom Messaging -->\n <app-ws-notifications></app-ws-notifications>\n </mat-tab>\n\n <mat-tab label=\"WS - AI Messaging\" [disabled]=\"true\">\n <!-- WS - AI Messaging -->\n <app-ws-ai-messaging></app-ws-ai-messaging>\n </mat-tab>\n\n </mat-tab-group>\n</div>\n\n</div>\n\n", styles: [""], dependencies: [{ kind: "component", type: i1$3.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass"], exportAs: ["matTab"] }, { kind: "component", type: i1$3.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "fitInkBarToContent", "mat-stretch-tabs", "dynamicHeight", "selectedIndex", "headerPosition", "animationDuration", "contentTabIndex", "disablePagination", "disableRipple", "preserveContent", "backgroundColor", "aria-label", "aria-labelledby"], outputs: ["selectedIndexChange", "focusChange", "animationDone", "selectedTabChange"], exportAs: ["matTabGroup"] }, { kind: "component", type: i9.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "component", type: i3$2.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "component", type: WsDataControlComponent, selector: "app-ws-data-control", inputs: ["server", "wsServer", "jwtToken", "user"] }, { kind: "component", type: WsMessagingComponent, selector: "app-ws-messaging", inputs: ["server", "wsServer", "jwtToken", "user"] }, { kind: "component", type: WsNotificationsComponent, selector: "app-ws-notifications" }, { kind: "component", type: WsAiMessagingComponent, selector: "app-ws-ai-messaging" }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }] }); }
4375
4455
  }
4376
4456
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RequestManagerWsDemoComponent, decorators: [{
4377
4457
  type: Component,
4378
- args: [{ selector: 'app-request-manager-ws-demo', standalone: false, template: "<div style=\"margin: 2rem;\">\n\n <h2 style=\"display: flex;\">\n <span style=\"flex:1\">HTTP Request State Manager - Websockets</span>\n @if ((connectionStatus$ | async); as connected) {\n <span>\n WS -\n <span style=\"color: green;\">Connected</span>\n </span>\n } @else {\n <span style=\"color: red;\">Disconnected {{ attempts$ | async }} - {{ nextRetry$ |async }}</span>\n }\n </h2>\n\n <div>\n\n @if ((user$ | async); as userInfo) {\n <div>\n <mat-toolbar>\n <div style=\"display: flex; flex:1\">\n <div style=\"flex:1\">{{ userInfo.content.name }}</div>\n <div>({{ userInfo.content.ldap }})</div>\n </div>\n </mat-toolbar>\n </div>\n }\n\n @if ((isPending$ | async)) {\n <div>\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n </div>\n }\n\n <mat-tab-group animationDuration=\"0ms\">\n\n <mat-tab label=\"WS - Data Control\">\n <!-- DATA CONTROL -->\n <app-ws-data-control\n [server]=\"server\"\n [wsServer]=\"wsServer\"\n [jwtToken]=\"jwtToken\"\n [user]=\"user\"\n ></app-ws-data-control>\n\n </mat-tab>\n\n <mat-tab label=\"WS - Messaging\">\n\n <!-- <app-ws-messaging\n [server]=\"server\"\n [wsServer]=\"wsServer\"\n [jwtToken]=\"jwtToken\"\n [user]=\"user\"\n ></app-ws-messaging> -->\n\n </mat-tab>\n\n <mat-tab label=\"WS - Notifications\" [disabled]=\"true\">\n <app-ws-notifications></app-ws-notifications>\n WS - Custom Messaging\n </mat-tab>\n\n <mat-tab label=\"WS - AI Messaging\" [disabled]=\"true\">\n <app-ws-ai-messaging></app-ws-ai-messaging>\n WS - AI Messaging\n </mat-tab>\n\n </mat-tab-group>\n</div>\n\n</div>\n\n" }]
4458
+ args: [{ selector: 'app-request-manager-ws-demo', standalone: false, template: "<div style=\"margin: 2rem;\">\n\n <h2 style=\"display: flex;\">\n <span style=\"flex:1\">HTTP Request State Manager - Websockets</span>\n @if ((connectionStatus$ | async); as connected) {\n <span>\n WS -\n <span style=\"color: green;\">Connected</span>\n </span>\n } @else {\n <span style=\"color: red;\">Disconnected {{ attempts$ | async }} - {{ nextRetry$ |async }}</span>\n }\n </h2>\n\n <div>\n\n @if ((user$ | async); as userInfo) {\n <div>\n <mat-toolbar>\n <div style=\"display: flex; flex:1\">\n <div style=\"flex:1\">{{ userInfo.content.name }}</div>\n <div>({{ userInfo.content.ldap }})</div>\n </div>\n </mat-toolbar>\n </div>\n }\n\n @if ((isPending$ | async)) {\n <div>\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n </div>\n }\n\n <mat-tab-group animationDuration=\"0ms\">\n\n <mat-tab label=\"WS - Data Control\">\n <!-- DATA CONTROL -->\n <app-ws-data-control\n [server]=\"server\"\n [wsServer]=\"wsServer\"\n [jwtToken]=\"jwtToken\"\n [user]=\"user\"\n ></app-ws-data-control>\n\n </mat-tab>\n\n <mat-tab label=\"WS - Messaging\">\n <!-- MESSAGING -->\n <app-ws-messaging\n [server]=\"server\"\n [wsServer]=\"wsServer\"\n [jwtToken]=\"jwtToken\"\n [user]=\"user\"\n ></app-ws-messaging>\n\n </mat-tab>\n\n <mat-tab label=\"WS - Notifications\" [disabled]=\"true\">\n <!-- WS - Custom Messaging -->\n <app-ws-notifications></app-ws-notifications>\n </mat-tab>\n\n <mat-tab label=\"WS - AI Messaging\" [disabled]=\"true\">\n <!-- WS - AI Messaging -->\n <app-ws-ai-messaging></app-ws-ai-messaging>\n </mat-tab>\n\n </mat-tab-group>\n</div>\n\n</div>\n\n" }]
4379
4459
  }], propDecorators: { server: [{
4380
4460
  type: Input
4381
4461
  }], wsServer: [{
@@ -4804,100 +4884,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
4804
4884
  args: [{ selector: 'app-store-state-manager-demo', providers: [SettingsStateService], standalone: false, template: "<div style=\"margin: 2rem;\">\n\n <h2>\n <span>Store State Manager</span>\n <span style=\"margin-left: .5rem;\">\n <mat-icon color=\"accent\">fiber_new</mat-icon>\n </span>\n </h2>\n\n {{ dataState$ | async | json}}\n\n <div style=\"display: flex; gap:.5rem; margin-top: 1rem; margin-bottom: 1rem;\">\n <button mat-stroked-button (click)=\"onUpdateEnum_1()\">Update Start</button>\n <button mat-stroked-button (click)=\"onUpdateEnum_2()\">Update End</button>\n <button mat-stroked-button (click)=\"onGetEnum_1()\">Dump</button>\n </div>\n\n <div>\n <h3 style=\"margin: 0;\">Enum 1</h3>\n {{ dataEnum$ | async | json}}\n </div>\n\n</div>\n" }]
4805
4885
  }] });
4806
4886
 
4807
- class WsMessagingComponent {
4808
- constructor() {
4809
- this.fb = inject(FormBuilder);
4810
- this.stateRequestServiceDemo = inject(StateRequestServiceDemo);
4811
- this.user$ = this.stateRequestServiceDemo.user$;
4812
- this.users$ = this.stateRequestServiceDemo.userList$;
4813
- this.data$ = this.stateRequestServiceDemo.data$;
4814
- this.messages = this.fb.group({
4815
- toUser: this.fb.control(null, Validators.required),
4816
- content: this.fb.control(null, Validators.required),
4817
- });
4818
- this.communicationMessages$ = this.stateRequestServiceDemo.communicationMessages$;
4819
- this.latestCommunicationMessages$ = this.stateRequestServiceDemo.latestCommunicationMessages$;
4820
- this.chat$ = combineLatest([this.user$, this.communicationMessages$])
4821
- .pipe(map$1(([user, messages]) => ({ user, messages })), map$1(obj => {
4822
- if (!obj.user)
4823
- return EMPTY;
4824
- // const mainUser = UserName.adapt({
4825
- // id: obj.user.username,
4826
- // first: obj.user?.name?.first,
4827
- // last: obj.user?.name?.last,
4828
- // })
4829
- const mainUser = '';
4830
- const messages = obj.messages.map((item) => {
4831
- if (item.toUser === 'allChannels') {
4832
- // item.toUser = UserName.adapt({
4833
- // id: '',
4834
- // first: 'All Users',
4835
- // last: '',
4836
- // })
4837
- }
4838
- // return Message.adapt({
4839
- // fromUser: {
4840
- // id: item.fromUser.username,
4841
- // first: item.fromUser?.name?.first,
4842
- // last: item.fromUser?.name?.last,
4843
- // },
4844
- // toUser: {
4845
- // id: item.toUser.username,
4846
- // first: item.toUser?.name?.first,
4847
- // last: item.toUser?.name?.last,
4848
- // },
4849
- // content: item.content,
4850
- // date: item.issued,
4851
- // })
4852
- });
4853
- return { user: mainUser, messages };
4854
- }));
4855
- }
4856
- get toUser() {
4857
- return this.messages.get('toUser');
4858
- }
4859
- get content() {
4860
- return this.messages.get('content');
4861
- }
4862
- get isValid() {
4863
- return this.toUser.valid;
4864
- }
4865
- ngOnInit() {
4866
- this.stateRequestServiceDemo.updateConnection(this.server, this.wsServer, this.jwtToken, this.user);
4867
- // this.stateRequestServiceDemo.getData()
4868
- }
4869
- onSendMessage() {
4870
- this.messages.markAllAsTouched();
4871
- if (this.messages.invalid)
4872
- return;
4873
- const message = ChannelMessage.adapt(this.messages.value);
4874
- this.stateRequestServiceDemo.sendMessage(message);
4875
- this.content.reset();
4876
- }
4877
- onSendAlert() {
4878
- this.messages.markAllAsTouched();
4879
- if (this.messages.invalid)
4880
- return;
4881
- const message = ChannelMessage.adapt({ ...this.messages.value, type: CommunicationType.ALERT });
4882
- this.stateRequestServiceDemo.sendMessage(message);
4883
- this.content.reset();
4884
- }
4885
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WsMessagingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4886
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: WsMessagingComponent, selector: "app-ws-messaging", inputs: { server: "server", wsServer: "wsServer", jwtToken: "jwtToken", user: "user" }, ngImport: i0, template: "@if ((data$ | async); as data) {\n <div style=\"margin: 1rem; display: flex; gap: 1rem; flex-direction: column;\">\n @if ((user$ | async); as userInfo) {\n <div>\n @if ((users$ | async); as users) {\n <div >\n <div style=\"display: flex; gap: 1rem\">\n <div style=\"flex:1\" [formGroup]=\"messages\">\n <div style=\"display:flex\">\n <mat-form-field style=\"flex:1\" appearance=\"outline\">\n <mat-label>Users</mat-label>\n <mat-select formControlName=\"toUser\">\n <mat-option value=\"allChannels\" #selectedUser>\n All Users\n </mat-option>\n @for (user of users; track user) {\n <mat-option [value]=\"user\">\n {{ user.username }}\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n <div style=\"display:flex\">\n <mat-form-field style=\"flex:1\" appearance=\"outline\">\n <mat-label>Send a Message</mat-label>\n <textarea\n matInput placeholder=\"Ex. It makes me feel...\"\n formControlName=\"content\"\n (keydown.enter)=\"onSendMessage(); $event.preventDefault()\"\n [disabled]=\"!isValid\"\n ></textarea>\n </mat-form-field>\n </div>\n <div style=\"display:flex; gap: .5rem;\">\n <div style=\"flex:1\"></div>\n <button mat-stroked-button (click)=\"onSendMessage()\" color=\"warn\">\n Send Alert\n </button>\n <button mat-stroked-button (click)=\"onSendAlert()\">\n Send Message\n </button>\n </div>\n </div>\n </div>\n @if ((chat$ | async); as chat) {\n <div style=\"border: thin gray solid; padding: 1rem; margin-top: 1rem;\">\n <!-- <app-messenger-chat\n [user]=\"chat.user\"\n [messages]=\"chat.messages\"\n ></app-messenger-chat> -->\n </div>\n }\n </div>\n }\n </div>\n }\n</div>\n}\n", styles: [""], dependencies: [{ kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i2$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "component", type: i4.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i5.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i12.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }] }); }
4887
- }
4888
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WsMessagingComponent, decorators: [{
4889
- type: Component,
4890
- args: [{ selector: 'app-ws-messaging', standalone: false, template: "@if ((data$ | async); as data) {\n <div style=\"margin: 1rem; display: flex; gap: 1rem; flex-direction: column;\">\n @if ((user$ | async); as userInfo) {\n <div>\n @if ((users$ | async); as users) {\n <div >\n <div style=\"display: flex; gap: 1rem\">\n <div style=\"flex:1\" [formGroup]=\"messages\">\n <div style=\"display:flex\">\n <mat-form-field style=\"flex:1\" appearance=\"outline\">\n <mat-label>Users</mat-label>\n <mat-select formControlName=\"toUser\">\n <mat-option value=\"allChannels\" #selectedUser>\n All Users\n </mat-option>\n @for (user of users; track user) {\n <mat-option [value]=\"user\">\n {{ user.username }}\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n <div style=\"display:flex\">\n <mat-form-field style=\"flex:1\" appearance=\"outline\">\n <mat-label>Send a Message</mat-label>\n <textarea\n matInput placeholder=\"Ex. It makes me feel...\"\n formControlName=\"content\"\n (keydown.enter)=\"onSendMessage(); $event.preventDefault()\"\n [disabled]=\"!isValid\"\n ></textarea>\n </mat-form-field>\n </div>\n <div style=\"display:flex; gap: .5rem;\">\n <div style=\"flex:1\"></div>\n <button mat-stroked-button (click)=\"onSendMessage()\" color=\"warn\">\n Send Alert\n </button>\n <button mat-stroked-button (click)=\"onSendAlert()\">\n Send Message\n </button>\n </div>\n </div>\n </div>\n @if ((chat$ | async); as chat) {\n <div style=\"border: thin gray solid; padding: 1rem; margin-top: 1rem;\">\n <!-- <app-messenger-chat\n [user]=\"chat.user\"\n [messages]=\"chat.messages\"\n ></app-messenger-chat> -->\n </div>\n }\n </div>\n }\n </div>\n }\n</div>\n}\n" }]
4891
- }], propDecorators: { server: [{
4892
- type: Input
4893
- }], wsServer: [{
4894
- type: Input
4895
- }], jwtToken: [{
4896
- type: Input
4897
- }], user: [{
4898
- type: Input
4899
- }] } });
4900
-
4901
4887
  // import { MessengerChatModule } from 'src/app/components/messenger-chat/messenger-chat.module';
4902
4888
  // import { StoreStateManagerModule } from "src/app/beta_components/store-state-manager/store-state-manager.module";
4903
4889
  class HttpRequestManagerModule {
@@ -6029,5 +6015,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
6029
6015
  * Generated bundle index. Do not edit.
6030
6016
  */
6031
6017
 
6032
- export { ApiRequest, AppService, AsymmetricalEncryptionService, CONFIG_SETTINGS_TOKEN, ChannelInfo, ChannelMessage, CommunicationType, ConfigHTTPOptions, ConfigOptions, DataType, DatabaseDataDemoComponent, DatabaseManagerService, DatabaseStorage, DbService, ErrorDisplaySettings, GlobalStoreOptions, HTTPManagerService, HTTPManagerSignalsService, HTTPManagerStateService, HeadersService, HttpRequestManagerModule, HttpRequestServicesDemoComponent, LocalStorageDemoComponent, LocalStorageManagerService, LocalStorageOptions, LocalStorageSignalsManagerService, PathQueryService, Random, RandomNumber, RandomNumbers, RandomNumbersUnique, RandomSignature, RandomStr, RequestErrorInterceptor, RequestHeadersInterceptor, RequestManagerDemoComponent, RequestManagerStateDemoComponent, RequestOptions, RequestService, RequestSignalsService, RetryOptions, SettingOptions, StateStorageOptions, StorageData, StorageOption, StorageType, StoreStateManagerService, SymmetricalEncryptionService, TableSchemaDef, UUID, UUID_STR, UserMessage, UtilsService, WSOptions, WSUser, WebsocketService, WithCredentialsInterceptor, countdown, delayedRetry, requestPolling, requestStreaming };
6018
+ export { ApiRequest, AppService, AsymmetricalEncryptionService, CONFIG_SETTINGS_TOKEN, ChannelInfo, CommunicationType, ConfigHTTPOptions, ConfigOptions, DataType, DatabaseDataDemoComponent, DatabaseManagerService, DatabaseStorage, DbService, ErrorDisplaySettings, GlobalStoreOptions, HTTPManagerService, HTTPManagerSignalsService, HTTPManagerStateService, HeadersService, HttpRequestManagerModule, HttpRequestServicesDemoComponent, LocalStorageDemoComponent, LocalStorageManagerService, LocalStorageOptions, LocalStorageSignalsManagerService, PathQueryService, Random, RandomNumber, RandomNumbers, RandomNumbersUnique, RandomSignature, RandomStr, RequestErrorInterceptor, RequestHeadersInterceptor, RequestManagerDemoComponent, RequestManagerStateDemoComponent, RequestOptions, RequestService, RequestSignalsService, RetryOptions, SettingOptions, StateStorageOptions, StorageData, StorageOption, StorageType, StoreStateManagerService, SymmetricalEncryptionService, TableSchemaDef, UUID, UUID_STR, UtilsService, WSOptions, WSUser, WebsocketService, WithCredentialsInterceptor, countdown, delayedRetry, requestPolling, requestStreaming };
6033
6019
  //# sourceMappingURL=http-request-manager.mjs.map