http-request-manager 18.6.0 → 18.7.0

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.6.0",
3
+ "version": "18.7.0",
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",
@@ -30,6 +30,8 @@ import * as i29 from '@angular/material/form-field';
30
30
  import * as i30 from '@angular/material/input';
31
31
  import * as i31 from '@angular/material/toolbar';
32
32
  import * as i33 from '@angular/material/sidenav';
33
+ import * as i34 from '@angular/material/datepicker';
34
+ import * as i35 from '@angular/material/core';
33
35
  import { ThemePalette } from '@angular/material/core';
34
36
  import * as i6 from '@angular/material/progress-spinner';
35
37
  import { ProgressSpinnerMode } from '@angular/material/progress-spinner';
@@ -379,6 +381,14 @@ declare class HTTPManagerStateService<T extends {
379
381
  user$: Observable<WSUser | null>;
380
382
  private channels;
381
383
  channels$: Observable<string[] | null>;
384
+ private notificationChannels;
385
+ notificationChannels$: Observable<string[]>;
386
+ private todaysNotificationChannels;
387
+ todaysNotificationChannels$: Observable<string[]>;
388
+ private notificationMessages;
389
+ notificationMessages$: Observable<any[]>;
390
+ private latestNotification;
391
+ latestNotification$: Observable<any>;
382
392
  private communicationMessages;
383
393
  communicationMessages$: Observable<any[]>;
384
394
  private latestCommunicationMessages;
@@ -452,6 +462,34 @@ declare class HTTPManagerStateService<T extends {
452
462
  * Get users in a specific channel
453
463
  */
454
464
  getUsersInChannel(channel: string): void;
465
+ /**
466
+ * Create a notification channel on the server
467
+ */
468
+ createNotificationChannel(channel: string): void;
469
+ /**
470
+ * Request list of all notification channels from server (in-memory)
471
+ */
472
+ getNotificationChannels(): void;
473
+ /**
474
+ * Request list of today's notification channels from database
475
+ * Returns unique channels that have notifications posted today
476
+ */
477
+ getTodaysNotificationChannels(): void;
478
+ /**
479
+ * Subscribe to a notification channel with optional date filters
480
+ */
481
+ subscribeToNotificationChannel(channel: string, options?: {
482
+ startEpoch?: number;
483
+ endEpoch?: number;
484
+ }, user?: any): void;
485
+ /**
486
+ * Unsubscribe from a notification channel
487
+ */
488
+ unsubscribeFromNotificationChannel(channel: string): void;
489
+ /**
490
+ * Send a notification to a channel
491
+ */
492
+ sendNotification(channel: string, content: any): void;
455
493
  private isEmpty;
456
494
  private updateRequestOptions;
457
495
  static ɵfac: i0.ɵɵFactoryDeclaration<HTTPManagerStateService<any>, never>;
@@ -489,6 +527,34 @@ declare class WebsocketService {
489
527
  createChannel(channel: string): void;
490
528
  deleteChannel(channel: string): void;
491
529
  getUsersInChannel(channel: string): void;
530
+ /**
531
+ * Create a notification channel
532
+ */
533
+ createNotificationChannel(channel: string): void;
534
+ /**
535
+ * Get all notification channels (in-memory)
536
+ */
537
+ getNotificationChannels(): void;
538
+ /**
539
+ * Get today's notification channels from database
540
+ * Returns unique channels that have notifications posted today
541
+ */
542
+ getTodaysNotificationChannels(): void;
543
+ /**
544
+ * Subscribe to a notification channel with optional date filters
545
+ */
546
+ subscribeToNotificationChannel(channel: string, options?: {
547
+ startEpoch?: number;
548
+ endEpoch?: number;
549
+ }, user?: any): void;
550
+ /**
551
+ * Unsubscribe from a notification channel
552
+ */
553
+ unsubscribeFromNotificationChannel(channel: string): void;
554
+ /**
555
+ * Send a notification to a channel
556
+ */
557
+ sendNotification(channel: string, content: any): void;
492
558
  static ɵfac: i0.ɵɵFactoryDeclaration<WebsocketService, never>;
493
559
  static ɵprov: i0.ɵɵInjectableDeclaration<WebsocketService>;
494
560
  }
@@ -1497,12 +1563,98 @@ declare class LocalStorageSignalsDemoComponent implements OnInit {
1497
1563
  static ɵcmp: i0.ɵɵComponentDeclaration<LocalStorageSignalsDemoComponent, "app-local-storage-signals-demo", never, {}, {}, never, never, false, never>;
1498
1564
  }
1499
1565
 
1500
- declare class StateRequestServiceDemo extends HTTPManagerStateService<any> {
1566
+ /**
1567
+ * StateServiceDemo - Core state management and WebSocket connection service
1568
+ *
1569
+ * Handles:
1570
+ * - WebSocket connection setup
1571
+ * - Base HTTP state management
1572
+ * - Connection status and retry logic
1573
+ */
1574
+ declare class StateServiceDemo extends HTTPManagerStateService<any> {
1501
1575
  attempts$: rxjs.Observable<number>;
1502
1576
  nextRetry$: rxjs.Observable<number>;
1503
1577
  constructor();
1578
+ /**
1579
+ * Initialize WebSocket connection with server configuration
1580
+ */
1504
1581
  updateConnection(server: string, wsServer: string, jwtToken: string, user: any): void;
1505
- sendMessage(data: ChannelMessage, channels?: string[]): void;
1582
+ /**
1583
+ * Get all available channels
1584
+ */
1585
+ getAllChannels(): void;
1586
+ /**
1587
+ * Subscribe to a channel
1588
+ */
1589
+ subscribeToChannel(channel: string): void;
1590
+ /**
1591
+ * Unsubscribe from a channel
1592
+ */
1593
+ unsubscribeFromChannel(channel: string): void;
1594
+ /**
1595
+ * Create a notification channel (MES- prefix)
1596
+ */
1597
+ createNotificationChannel(channel: string): void;
1598
+ /**
1599
+ * Get all notification channels list (in-memory)
1600
+ */
1601
+ getNotificationChannels(): void;
1602
+ /**
1603
+ * Get today's notification channels from database
1604
+ * Returns unique channels that have notifications posted today
1605
+ */
1606
+ getTodaysNotificationChannels(): void;
1607
+ /**
1608
+ * Subscribe to notification channel with optional date filters
1609
+ */
1610
+ subscribeToNotificationChannel(channel: string, options?: {
1611
+ startEpoch?: number;
1612
+ endEpoch?: number;
1613
+ }, user?: any): void;
1614
+ /**
1615
+ * Unsubscribe from notification channel
1616
+ */
1617
+ unsubscribeFromNotificationChannel(channel: string): void;
1618
+ /**
1619
+ * Send a notification to a channel
1620
+ */
1621
+ sendNotification(channel: string, content: any): void;
1622
+ static ɵfac: i0.ɵɵFactoryDeclaration<StateServiceDemo, never>;
1623
+ static ɵprov: i0.ɵɵInjectableDeclaration<StateServiceDemo>;
1624
+ }
1625
+
1626
+ /**
1627
+ * MessageServiceDemo - Channel messaging service (PUB- prefix channels)
1628
+ *
1629
+ * Handles:
1630
+ * - Sending messages to channels
1631
+ * - Channel subscription for messaging
1632
+ * - Real-time message broadcast
1633
+ */
1634
+ declare class MessageServiceDemo {
1635
+ private stateService;
1636
+ channels$: rxjs.Observable<string[] | null>;
1637
+ subscribedChannels$: rxjs.Observable<Set<string>>;
1638
+ communicationMessages$: rxjs.Observable<any[]>;
1639
+ latestCommunicationMessages$: rxjs.Observable<any>;
1640
+ connectionStatus$: rxjs.Observable<boolean>;
1641
+ user$: rxjs.Observable<http_request_manager.WSUser | null>;
1642
+ data$: rxjs.Observable<any>;
1643
+ /**
1644
+ * Helper to ensure channel has PUB- prefix
1645
+ */
1646
+ private toPublicChannel;
1647
+ /**
1648
+ * Helper to strip PUB- prefix for display
1649
+ */
1650
+ private fromPublicChannel;
1651
+ /**
1652
+ * Create a new public channel
1653
+ */
1654
+ createChannel(channel: string): void;
1655
+ /**
1656
+ * Get all available channels
1657
+ */
1506
1658
  getAllChannels(): void;
1507
1659
  /**
1508
1660
  * Subscribe to a channel to receive messages
@@ -1512,13 +1664,78 @@ declare class StateRequestServiceDemo extends HTTPManagerStateService<any> {
1512
1664
  * Unsubscribe from a channel
1513
1665
  */
1514
1666
  unsubscribeFromChannel(channel: string): void;
1515
- static ɵfac: i0.ɵɵFactoryDeclaration<StateRequestServiceDemo, never>;
1516
- static ɵprov: i0.ɵɵInjectableDeclaration<StateRequestServiceDemo>;
1667
+ /**
1668
+ * Send a message to one or more channels
1669
+ */
1670
+ sendMessage(data: ChannelMessage, channels?: string[]): void;
1671
+ static ɵfac: i0.ɵɵFactoryDeclaration<MessageServiceDemo, never>;
1672
+ static ɵprov: i0.ɵɵInjectableDeclaration<MessageServiceDemo>;
1673
+ }
1674
+
1675
+ /**
1676
+ * NotificationServiceDemo - Notification channel service (MES- prefix channels)
1677
+ *
1678
+ * Handles:
1679
+ * - Creating notification channels
1680
+ * - Subscribing to notifications with date filters
1681
+ * - Sending notifications (persisted to database)
1682
+ * - Receiving real-time and historical notifications
1683
+ */
1684
+ declare class NotificationServiceDemo {
1685
+ private stateService;
1686
+ notificationChannels$: rxjs.Observable<string[]>;
1687
+ todaysNotificationChannels$: rxjs.Observable<string[]>;
1688
+ private subscribedNotificationChannelsSubject;
1689
+ subscribedNotificationChannels$: rxjs.Observable<Set<string>>;
1690
+ notificationMessages$: rxjs.Observable<any[]>;
1691
+ latestNotification$: rxjs.Observable<any>;
1692
+ connectionStatus$: rxjs.Observable<boolean>;
1693
+ /**
1694
+ * Helper to ensure channel has MES- prefix
1695
+ */
1696
+ private toNotificationChannel;
1697
+ /**
1698
+ * Helper to strip MES- prefix for display
1699
+ */
1700
+ private fromNotificationChannel;
1701
+ /**
1702
+ * Create a notification channel
1703
+ */
1704
+ createNotificationChannel(channel: string): void;
1705
+ /**
1706
+ * Get all notification channels (in-memory)
1707
+ */
1708
+ getNotificationChannels(): void;
1709
+ /**
1710
+ * Get today's notification channels from database
1711
+ * Returns unique channels that have notifications posted today
1712
+ */
1713
+ getTodaysNotificationChannels(): void;
1714
+ /**
1715
+ * Subscribe to a notification channel with optional date filter
1716
+ * @param channel Channel name (MES- prefix will be added if not present)
1717
+ * @param options { startEpoch?, endEpoch? }
1718
+ * @param user User info for subscription
1719
+ */
1720
+ subscribeToNotificationChannel(channel: string, options?: {
1721
+ startEpoch?: number;
1722
+ endEpoch?: number;
1723
+ }, user?: any): void;
1724
+ /**
1725
+ * Unsubscribe from a notification channel
1726
+ */
1727
+ unsubscribeFromNotificationChannel(channel: string): void;
1728
+ /**
1729
+ * Send a notification to a channel
1730
+ */
1731
+ sendNotification(channel: string, content: any, user?: any): void;
1732
+ static ɵfac: i0.ɵɵFactoryDeclaration<NotificationServiceDemo, never>;
1733
+ static ɵprov: i0.ɵɵInjectableDeclaration<NotificationServiceDemo>;
1517
1734
  }
1518
1735
 
1519
1736
  declare class RequestManagerWsDemoComponent implements OnInit {
1520
1737
  httpManagerService: HTTPManagerService<any>;
1521
- stateRequestServiceDemo: StateRequestServiceDemo;
1738
+ stateService: StateServiceDemo;
1522
1739
  fb: FormBuilder;
1523
1740
  server: string;
1524
1741
  wsServer: string;
@@ -1643,7 +1860,8 @@ declare class WsMessagingComponent implements OnInit, OnDestroy {
1643
1860
  user: any;
1644
1861
  private destroy$;
1645
1862
  fb: FormBuilder;
1646
- stateRequestServiceDemo: StateRequestServiceDemo;
1863
+ messageService: MessageServiceDemo;
1864
+ stateService: StateServiceDemo;
1647
1865
  toastService: ToastMessageDisplayService;
1648
1866
  channels$: Observable<string[]>;
1649
1867
  subscribedChannels$: Observable<string[]>;
@@ -1684,21 +1902,101 @@ declare class WsMessagingComponent implements OnInit, OnDestroy {
1684
1902
  * Auto-adds PUB- prefix for outgoing communication
1685
1903
  */
1686
1904
  onUnsubscribeFromChannel(channel: string): void;
1905
+ /**
1906
+ * Handle chip toggle for subscribe/unsubscribe
1907
+ */
1908
+ onChipToggle(channel: string, event: any): void;
1687
1909
  /**
1688
1910
  * Check if currently subscribed to a channel
1689
1911
  * Compares display names (without PUB- prefix)
1690
1912
  */
1691
1913
  isSubscribed(channel: string, subscribedChannels: string[]): boolean;
1914
+ /**
1915
+ * Handle chip click - toggle subscription state
1916
+ */
1917
+ onChipClick(channel: string, subscribedChannels: string[]): void;
1692
1918
  onSendMessage(user: WSUser): void;
1693
1919
  static ɵfac: i0.ɵɵFactoryDeclaration<WsMessagingComponent, never>;
1694
1920
  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>;
1695
1921
  }
1696
1922
 
1697
- declare class WsNotificationsComponent implements OnInit {
1698
- constructor();
1923
+ declare class WsNotificationsComponent implements OnInit, OnDestroy {
1924
+ server: string;
1925
+ wsServer: string;
1926
+ jwtToken: string;
1927
+ user: any;
1928
+ private destroy$;
1929
+ fb: FormBuilder;
1930
+ notificationService: NotificationServiceDemo;
1931
+ stateService: StateServiceDemo;
1932
+ todaysNotificationChannels$: rxjs.Observable<string[]>;
1933
+ subscribedNotificationChannels$: rxjs.Observable<string[]>;
1934
+ notificationMessages$: rxjs.Observable<any[]>;
1935
+ connectionStatus$: rxjs.Observable<boolean>;
1936
+ /**
1937
+ * Helper to ensure channel has MES- prefix for outgoing communication
1938
+ */
1939
+ private toNotificationChannel;
1940
+ newChannelName: FormControl<string | null>;
1941
+ selectedConnectionChannel: FormControl<string | null>;
1942
+ connectedChannel: string | null;
1943
+ displayedColumns: string[];
1944
+ dateFilter: _angular_forms.FormGroup<{
1945
+ startDate: FormControl<Date | null>;
1946
+ endDate: FormControl<Date | null>;
1947
+ }>;
1948
+ notificationForm: _angular_forms.FormGroup<{
1949
+ content: FormControl<string | null>;
1950
+ }>;
1951
+ get content(): FormControl;
1952
+ /**
1953
+ * Check if currently connected to a channel
1954
+ */
1955
+ isChannelConnected(subscribedChannels: string[]): boolean;
1956
+ /**
1957
+ * Connect to the selected channel
1958
+ */
1959
+ onConnectToChannel(): void;
1960
+ /**
1961
+ * Disconnect from the current channel
1962
+ */
1963
+ onDisconnectFromChannel(): void;
1699
1964
  ngOnInit(): void;
1965
+ ngOnDestroy(): void;
1966
+ /**
1967
+ * Create a new notification channel
1968
+ */
1969
+ onCreateChannel(): void;
1970
+ /**
1971
+ * Subscribe to a notification channel with optional date filter
1972
+ */
1973
+ onSubscribeToChannel(channel: string): void;
1974
+ /**
1975
+ * Unsubscribe from a notification channel
1976
+ */
1977
+ onUnsubscribeFromChannel(channel: string): void;
1978
+ /**
1979
+ * Check if currently subscribed to a channel
1980
+ */
1981
+ isSubscribed(channel: string, subscribedChannels: string[]): boolean;
1982
+ /**
1983
+ * Handle chip click - toggle subscription state
1984
+ */
1985
+ onChipClick(channel: string, subscribedChannels: string[]): void;
1986
+ /**
1987
+ * Send a notification
1988
+ */
1989
+ onSendNotification(): void;
1990
+ /**
1991
+ * Format epoch timestamp to readable date/time
1992
+ */
1993
+ formatTimestamp(epoch: number): string;
1994
+ /**
1995
+ * Get today's date in YYYY-MM-DD format for date input default
1996
+ */
1997
+ getTodayDate(): string;
1700
1998
  static ɵfac: i0.ɵɵFactoryDeclaration<WsNotificationsComponent, never>;
1701
- static ɵcmp: i0.ɵɵComponentDeclaration<WsNotificationsComponent, "app-ws-notifications", never, {}, {}, never, never, false, never>;
1999
+ static ɵcmp: i0.ɵɵComponentDeclaration<WsNotificationsComponent, "app-ws-notifications", 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>;
1702
2000
  }
1703
2001
 
1704
2002
  declare class WsAiMessagingComponent implements OnInit {
@@ -1789,7 +2087,7 @@ declare class FileDownloaderModule {
1789
2087
  declare class HttpRequestManagerModule {
1790
2088
  static forRoot(config?: ConfigOptions): ModuleWithProviders<HttpRequestManagerModule>;
1791
2089
  static ɵfac: i0.ɵɵFactoryDeclaration<HttpRequestManagerModule, never>;
1792
- static ɵmod: i0.ɵɵNgModuleDeclaration<HttpRequestManagerModule, [typeof HttpRequestServicesDemoComponent, typeof RequestManagerStateDemoComponent, typeof RequestManagerDemoComponent, typeof RequestSignalsManagerDemoComponent, typeof LocalStorageDemoComponent, typeof LocalStorageSignalsDemoComponent, typeof RequestManagerWsDemoComponent, typeof StoreStateManagerDemoComponent, typeof DatabaseDataDemoComponent, typeof WsDataControlComponent, typeof WsMessagingComponent, typeof WsNotificationsComponent, typeof WsAiMessagingComponent], [typeof i4.CommonModule, typeof i15.ToastMessageDisplayModule, typeof _angular_forms.FormsModule, typeof _angular_forms.ReactiveFormsModule, typeof i7.MatButtonModule, typeof i18.MatTabsModule, typeof i19.MatSelectModule, typeof i20.MatChipsModule, typeof i21.MatMenuModule, typeof i5.MatIconModule, typeof i23.MatTableModule, typeof i24.MatButtonToggleModule, typeof i25.MatAutocompleteModule, typeof i26.MatProgressBarModule, typeof i27.MatSlideToggleModule, typeof i28.MatDividerModule, typeof i29.MatFormFieldModule, typeof i30.MatInputModule, typeof i31.MatToolbarModule, typeof i27.MatSlideToggleModule, typeof i32.TranslateModule, typeof i33.MatSidenavModule, typeof FileDownloaderModule], [typeof HttpRequestServicesDemoComponent]>;
2090
+ static ɵmod: i0.ɵɵNgModuleDeclaration<HttpRequestManagerModule, [typeof HttpRequestServicesDemoComponent, typeof RequestManagerStateDemoComponent, typeof RequestManagerDemoComponent, typeof RequestSignalsManagerDemoComponent, typeof LocalStorageDemoComponent, typeof LocalStorageSignalsDemoComponent, typeof RequestManagerWsDemoComponent, typeof StoreStateManagerDemoComponent, typeof DatabaseDataDemoComponent, typeof WsDataControlComponent, typeof WsMessagingComponent, typeof WsNotificationsComponent, typeof WsAiMessagingComponent], [typeof i4.CommonModule, typeof i15.ToastMessageDisplayModule, typeof _angular_forms.FormsModule, typeof _angular_forms.ReactiveFormsModule, typeof i7.MatButtonModule, typeof i18.MatTabsModule, typeof i19.MatSelectModule, typeof i20.MatChipsModule, typeof i21.MatMenuModule, typeof i5.MatIconModule, typeof i23.MatTableModule, typeof i24.MatButtonToggleModule, typeof i25.MatAutocompleteModule, typeof i26.MatProgressBarModule, typeof i27.MatSlideToggleModule, typeof i28.MatDividerModule, typeof i29.MatFormFieldModule, typeof i30.MatInputModule, typeof i31.MatToolbarModule, typeof i27.MatSlideToggleModule, typeof i32.TranslateModule, typeof i33.MatSidenavModule, typeof i34.MatDatepickerModule, typeof i35.MatNativeDateModule, typeof FileDownloaderModule], [typeof HttpRequestServicesDemoComponent]>;
1793
2091
  static ɵinj: i0.ɵɵInjectorDeclaration<HttpRequestManagerModule>;
1794
2092
  }
1795
2093
 
Binary file