http-request-manager 18.5.18 → 18.5.20

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.
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "http-request-manager",
3
- "version": "18.5.18",
3
+ "version": "18.5.20",
4
4
  "homepage": "https://wavecoders.ca",
5
5
  "author": "Mike Bonifacio <wavecoders@gmail.com> (http://wavecoders@gmail.com/)",
6
6
  "description": "This is an Angular Module containing Components/Services using Material",
@@ -216,12 +216,17 @@ declare class ChannelInfo implements ChannelInfoInterface {
216
216
 
217
217
  interface WSUserInterface {
218
218
  sessionId: string;
219
- content: any;
219
+ ldap?: string;
220
+ name?: string;
221
+ email?: string;
222
+ [key: string]: any;
220
223
  }
221
224
  declare class WSUser implements WSUserInterface {
222
225
  sessionId: string;
223
- content: any;
224
- constructor(sessionId: string, content: any);
226
+ ldap: string;
227
+ name: string;
228
+ email: string;
229
+ constructor(sessionId?: string, ldap?: string, name?: string, email?: string);
225
230
  static adapt(item?: any): WSUser;
226
231
  }
227
232
 
@@ -321,19 +326,13 @@ declare class DatabaseManagerService extends DbService {
321
326
  }
322
327
 
323
328
  interface ChannelMessageInterface {
324
- sessionId: string;
329
+ sessionId: any;
325
330
  content: any;
326
- message: string;
327
- users: WSUser[];
328
- issued: number;
329
331
  }
330
332
  declare class ChannelMessage implements ChannelMessageInterface {
331
- sessionId: string;
333
+ sessionId: any;
332
334
  content: any;
333
- message: string;
334
- users: WSUser[];
335
- issued: number;
336
- constructor(sessionId: string, content: any, message?: string, users?: WSUser[], issued?: number);
335
+ constructor(sessionId?: any, content?: any);
337
336
  static adapt(item?: any): ChannelMessage;
338
337
  }
339
338
 
@@ -385,7 +384,7 @@ declare class HTTPManagerStateService<T extends {
385
384
  userAction$: Observable<any>;
386
385
  wsConnection: boolean;
387
386
  wsOptions: WSOptions;
388
- connectionStatus$?: Observable<boolean>;
387
+ connectionStatus$: Observable<boolean>;
389
388
  constructor(apiOptions: ApiRequest, dataType: DataType | undefined, database?: DatabaseStorage | undefined);
390
389
  setApiRequestOptions(apiOptions?: ApiRequest, dataType?: DataType, database?: DatabaseStorage): void;
391
390
  private setupConnectionStatus;
@@ -414,6 +413,42 @@ declare class HTTPManagerStateService<T extends {
414
413
  readonly fetchStream: (options?: RequestOptions) => ((observableOrValue?: any) => rxjs.Subscription) | ((observableOrValue: any) => rxjs.Subscription);
415
414
  private wsCommunication;
416
415
  wsMessaging(message: ChannelMessage, channels?: string[]): void;
416
+ /**
417
+ * Subscribe to a single channel
418
+ */
419
+ subscribeToChannel(channel: string): void;
420
+ /**
421
+ * Subscribe to multiple channels at once
422
+ */
423
+ subscribeToChannels(channels: string[]): void;
424
+ /**
425
+ * Unsubscribe from a channel
426
+ */
427
+ unsubscribeFromChannel(channel: string): void;
428
+ /**
429
+ * Get observable of currently subscribed channels
430
+ */
431
+ get subscribedChannels$(): Observable<Set<string>>;
432
+ /**
433
+ * Get current subscribed channels synchronously
434
+ */
435
+ getSubscribedChannels(): Set<string>;
436
+ /**
437
+ * Create a new channel on the server
438
+ */
439
+ createChannel(channel: string): void;
440
+ /**
441
+ * Delete a channel from the server
442
+ */
443
+ deleteChannel(channel: string): void;
444
+ /**
445
+ * Request list of all channels from server
446
+ */
447
+ getAllChannels(): void;
448
+ /**
449
+ * Get users in a specific channel
450
+ */
451
+ getUsersInChannel(channel: string): void;
417
452
  private isEmpty;
418
453
  private updateRequestOptions;
419
454
  static ɵfac: i0.ɵɵFactoryDeclaration<HTTPManagerStateService<any>, never>;
@@ -427,14 +462,25 @@ declare class WebsocketService {
427
462
  private connectionStatus;
428
463
  connectionStatus$: Observable<boolean>;
429
464
  private isSubscribed;
465
+ private subscribedChannels;
466
+ subscribedChannels$: Observable<Set<string>>;
467
+ private lastOptions;
430
468
  private getSessionId;
431
469
  private sendSubscribe;
432
470
  connect(options: WSOptions, jwtToken: string): void;
433
471
  disconnect(): void;
434
472
  subscribeToChannel(channelName: string): void;
473
+ subscribeToChannels(channelNames: string[]): void;
474
+ unsubscribeFromChannel(channel: string): void;
435
475
  unsubscribeToChannel(channel: string): void;
476
+ getSubscribedChannels(): Set<string>;
436
477
  sendBroadcast(content: any): void;
437
478
  sendMessageInChannel(channel: string, content: any): void;
479
+ /**
480
+ * Send a message to a specific channel for channel-based messaging
481
+ * This uses the 'message' type which broadcasts to all subscribers in the channel
482
+ */
483
+ sendChannelMessage(channel: string, content: any): void;
438
484
  sendMessageToUser(user: string, content: any): void;
439
485
  getAllChannels(): void;
440
486
  createChannel(channel: string): void;
@@ -1453,7 +1499,7 @@ declare class StateRequestServiceDemo extends HTTPManagerStateService<any> {
1453
1499
  nextRetry$: rxjs.Observable<number>;
1454
1500
  constructor();
1455
1501
  updateConnection(server: string, wsServer: string, jwtToken: string, user: any): void;
1456
- sendMessage(data: ChannelMessage): void;
1502
+ sendMessage(data: ChannelMessage, channels?: string[]): void;
1457
1503
  getAllChannels(): void;
1458
1504
  static ɵfac: i0.ɵɵFactoryDeclaration<StateRequestServiceDemo, never>;
1459
1505
  static ɵprov: i0.ɵɵInjectableDeclaration<StateRequestServiceDemo>;
@@ -1472,7 +1518,7 @@ declare class RequestManagerWsDemoComponent implements OnInit {
1472
1518
  user$: Observable<WSUser | null>;
1473
1519
  attempts$: Observable<number>;
1474
1520
  nextRetry$: Observable<number>;
1475
- connectionStatus$: Observable<boolean> | undefined;
1521
+ connectionStatus$: Observable<boolean>;
1476
1522
  data$: Observable<any>;
1477
1523
  isPending$: Observable<boolean>;
1478
1524
  ngOnInit(): void;
@@ -1579,27 +1625,26 @@ declare class WsDataControlComponent implements OnInit {
1579
1625
  static ɵcmp: i0.ɵɵComponentDeclaration<WsDataControlComponent, "app-ws-data-control", never, { "server": { "alias": "server"; "required": false; }; "wsServer": { "alias": "wsServer"; "required": false; }; "jwtToken": { "alias": "jwtToken"; "required": false; }; "user": { "alias": "user"; "required": false; }; "path": { "alias": "path"; "required": false; }; "wsChannel": { "alias": "wsChannel"; "required": false; }; }, {}, never, never, false, never>;
1580
1626
  }
1581
1627
 
1582
- declare class WsMessagingComponent implements OnInit {
1628
+ declare class WsMessagingComponent implements OnInit, OnDestroy {
1583
1629
  server: string;
1584
1630
  wsServer: string;
1585
1631
  jwtToken: string;
1586
1632
  user: any;
1633
+ private destroy$;
1587
1634
  fb: FormBuilder;
1588
1635
  stateRequestServiceDemo: StateRequestServiceDemo;
1589
- channels$: Observable<string[] | null>;
1636
+ channels$: Observable<string[]>;
1590
1637
  user$: Observable<WSUser | null>;
1591
- users$: Observable<any[]>;
1592
1638
  data$: Observable<any>;
1593
- connectionStatus$: Observable<boolean> | undefined;
1639
+ connectionStatus$: Observable<boolean>;
1594
1640
  messages: _angular_forms.FormGroup<{
1595
- channels: FormControl<WSUser[] | null>;
1596
- toUsers: FormControl<WSUser[] | null>;
1641
+ channels: FormControl<string[] | null>;
1597
1642
  content: FormControl<string | null>;
1598
1643
  }>;
1599
1644
  get channels(): FormControl;
1600
- get toUsers(): FormControl;
1601
1645
  get content(): FormControl;
1602
1646
  get isValid(): boolean;
1647
+ get selectedChannels(): any;
1603
1648
  communicationMessages$: Observable<any[]>;
1604
1649
  latestCommunicationMessages$: Observable<any>;
1605
1650
  chat$: Observable<{
@@ -1607,8 +1652,8 @@ declare class WsMessagingComponent implements OnInit {
1607
1652
  messages: any[];
1608
1653
  } | any>;
1609
1654
  ngOnInit(): void;
1655
+ ngOnDestroy(): void;
1610
1656
  onSendMessage(user: WSUser): void;
1611
- onSendAlert(): void;
1612
1657
  static ɵfac: i0.ɵɵFactoryDeclaration<WsMessagingComponent, never>;
1613
1658
  static ɵcmp: i0.ɵɵComponentDeclaration<WsMessagingComponent, "app-ws-messaging", never, { "server": { "alias": "server"; "required": false; }; "wsServer": { "alias": "wsServer"; "required": false; }; "jwtToken": { "alias": "jwtToken"; "required": false; }; "user": { "alias": "user"; "required": false; }; }, {}, never, never, false, never>;
1614
1659
  }
Binary file