http-request-manager 19.0.0 → 19.2.5

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.
Files changed (166) hide show
  1. package/README.md +585 -300
  2. package/fesm2022/http-request-manager.mjs +9434 -3133
  3. package/fesm2022/http-request-manager.mjs.map +1 -1
  4. package/package.json +7 -9
  5. package/types/http-request-manager.d.ts +3546 -0
  6. package/esm2022/http-request-manager.mjs +0 -5
  7. package/esm2022/lib/http-request-manager.module.mjs +0 -186
  8. package/esm2022/lib/http-request-services-demo/database-data-demo/database-data-demo.component.mjs +0 -71
  9. package/esm2022/lib/http-request-services-demo/http-request-services-demo.component.mjs +0 -45
  10. package/esm2022/lib/http-request-services-demo/local-storage-demo/local-storage-demo.component.mjs +0 -173
  11. package/esm2022/lib/http-request-services-demo/local-storage-signals-demo/local-storage-signals-demo.component.mjs +0 -184
  12. package/esm2022/lib/http-request-services-demo/request-manager-demo/file-downloader/download-file/download-file.component.mjs +0 -80
  13. package/esm2022/lib/http-request-services-demo/request-manager-demo/file-downloader/file-download.module.mjs +0 -42
  14. package/esm2022/lib/http-request-services-demo/request-manager-demo/file-downloader/file-downloader.component.mjs +0 -88
  15. package/esm2022/lib/http-request-services-demo/request-manager-demo/file-downloader/models/download-labels-model.mjs +0 -11
  16. package/esm2022/lib/http-request-services-demo/request-manager-demo/file-downloader/spinner/spinner.component.mjs +0 -29
  17. package/esm2022/lib/http-request-services-demo/request-manager-demo/models/sample-ai-prompt.mjs +0 -9
  18. package/esm2022/lib/http-request-services-demo/request-manager-demo/models/sample-client-info.mjs +0 -12
  19. package/esm2022/lib/http-request-services-demo/request-manager-demo/models/sample-mapper-client-info.mjs +0 -14
  20. package/esm2022/lib/http-request-services-demo/request-manager-demo/request-manager-demo.component.mjs +0 -315
  21. package/esm2022/lib/http-request-services-demo/request-manager-state-demo/request-manager-state-demo.component.mjs +0 -270
  22. package/esm2022/lib/http-request-services-demo/request-manager-state-demo/services/state-manager-demo.service.mjs +0 -67
  23. package/esm2022/lib/http-request-services-demo/request-signals-manager-demo/models/sample-ai-prompt.mjs +0 -9
  24. package/esm2022/lib/http-request-services-demo/request-signals-manager-demo/models/sample-client-info.mjs +0 -12
  25. package/esm2022/lib/http-request-services-demo/request-signals-manager-demo/models/sample-mapper-client-info.mjs +0 -14
  26. package/esm2022/lib/http-request-services-demo/request-signals-manager-demo/request-signals-manager-demo.component.mjs +0 -336
  27. package/esm2022/lib/index.mjs +0 -4
  28. package/esm2022/lib/interceptors/credentials.interceptor.mjs +0 -14
  29. package/esm2022/lib/interceptors/index.mjs +0 -5
  30. package/esm2022/lib/interceptors/models/error-settings.model.mjs +0 -10
  31. package/esm2022/lib/interceptors/proxy-debugger.interceptor.mjs +0 -47
  32. package/esm2022/lib/interceptors/request-error.interceptor.mjs +0 -49
  33. package/esm2022/lib/interceptors/request-header.interceptor.mjs +0 -41
  34. package/esm2022/lib/models/config-http-options.model.mjs +0 -18
  35. package/esm2022/lib/models/config-local-storage-options.model.mjs +0 -12
  36. package/esm2022/lib/models/config-options.model.mjs +0 -12
  37. package/esm2022/lib/models/config-token.model.mjs +0 -8
  38. package/esm2022/lib/models/data-type.enum.mjs +0 -7
  39. package/esm2022/lib/models/database-storage.model.mjs +0 -10
  40. package/esm2022/lib/models/index.mjs +0 -7
  41. package/esm2022/lib/models/retry-options.model.mjs +0 -10
  42. package/esm2022/lib/services/database-manager-services/database.manager.service.mjs +0 -119
  43. package/esm2022/lib/services/database-manager-services/db.storage.service.mjs +0 -143
  44. package/esm2022/lib/services/database-manager-services/index.mjs +0 -4
  45. package/esm2022/lib/services/database-manager-services/models/table-schema.mjs +0 -20
  46. package/esm2022/lib/services/index.mjs +0 -6
  47. package/esm2022/lib/services/local-storage-manager-service/index.mjs +0 -4
  48. package/esm2022/lib/services/local-storage-manager-service/local-storage-manager.service.mjs +0 -302
  49. package/esm2022/lib/services/local-storage-manager-service/local-storage-signals-manager.service.mjs +0 -277
  50. package/esm2022/lib/services/local-storage-manager-service/models/global-store-options.model.mjs +0 -13
  51. package/esm2022/lib/services/local-storage-manager-service/models/index.mjs +0 -6
  52. package/esm2022/lib/services/local-storage-manager-service/models/setting-options.model.mjs +0 -17
  53. package/esm2022/lib/services/local-storage-manager-service/models/storage-data.model.mjs +0 -10
  54. package/esm2022/lib/services/local-storage-manager-service/models/storage-option.model.mjs +0 -12
  55. package/esm2022/lib/services/local-storage-manager-service/models/storage-type.enum.mjs +0 -7
  56. package/esm2022/lib/services/request-manager-services/http-manager-signals.service.mjs +0 -199
  57. package/esm2022/lib/services/request-manager-services/http-manager.service.mjs +0 -207
  58. package/esm2022/lib/services/request-manager-services/index.mjs +0 -6
  59. package/esm2022/lib/services/request-manager-services/request-signals.service.mjs +0 -170
  60. package/esm2022/lib/services/request-manager-services/request.service.mjs +0 -191
  61. package/esm2022/lib/services/request-manager-services/rxjs-operators/countdown.mjs +0 -9
  62. package/esm2022/lib/services/request-manager-services/rxjs-operators/delay-retry.mjs +0 -10
  63. package/esm2022/lib/services/request-manager-services/rxjs-operators/index.mjs +0 -5
  64. package/esm2022/lib/services/request-manager-services/rxjs-operators/request-polling.mjs +0 -33
  65. package/esm2022/lib/services/request-manager-services/rxjs-operators/request-streaming.mjs +0 -19
  66. package/esm2022/lib/services/request-manager-state-service/http-manager-state.store.mjs +0 -360
  67. package/esm2022/lib/services/request-manager-state-service/index.mjs +0 -3
  68. package/esm2022/lib/services/request-manager-state-service/models/api-request.model.mjs +0 -21
  69. package/esm2022/lib/services/request-manager-state-service/models/index.mjs +0 -3
  70. package/esm2022/lib/services/request-manager-state-service/models/request-options.model.mjs +0 -10
  71. package/esm2022/lib/services/request-manager-state-service/models/ws-options.model.mjs +0 -12
  72. package/esm2022/lib/services/utils/app.service.mjs +0 -26
  73. package/esm2022/lib/services/utils/encryption/asymmetrical-encryption.service.mjs +0 -186
  74. package/esm2022/lib/services/utils/encryption/encryption-test.service.mjs +0 -35
  75. package/esm2022/lib/services/utils/encryption/index.mjs +0 -4
  76. package/esm2022/lib/services/utils/encryption/random.mjs +0 -52
  77. package/esm2022/lib/services/utils/encryption/symmetrical-encryption.service.mjs +0 -77
  78. package/esm2022/lib/services/utils/headers.service.mjs +0 -21
  79. package/esm2022/lib/services/utils/index.mjs +0 -6
  80. package/esm2022/lib/services/utils/object-merger.service.mjs +0 -70
  81. package/esm2022/lib/services/utils/path-query.service.mjs +0 -54
  82. package/esm2022/lib/services/utils/utils.service.mjs +0 -155
  83. package/esm2022/lib/services/ws-manager-service/models/assortment-data.model.mjs +0 -10
  84. package/esm2022/lib/services/ws-manager-service/websocket.service.mjs +0 -133
  85. package/esm2022/public-api.mjs +0 -11
  86. package/http-request-manager-19.0.0.tgz +0 -0
  87. package/index.d.ts +0 -5
  88. package/lib/http-request-manager.module.d.ts +0 -35
  89. package/lib/http-request-services-demo/database-data-demo/database-data-demo.component.d.ts +0 -19
  90. package/lib/http-request-services-demo/http-request-services-demo.component.d.ts +0 -32
  91. package/lib/http-request-services-demo/local-storage-demo/local-storage-demo.component.d.ts +0 -56
  92. package/lib/http-request-services-demo/local-storage-signals-demo/local-storage-signals-demo.component.d.ts +0 -55
  93. package/lib/http-request-services-demo/request-manager-demo/file-downloader/download-file/download-file.component.d.ts +0 -26
  94. package/lib/http-request-services-demo/request-manager-demo/file-downloader/file-download.module.d.ts +0 -13
  95. package/lib/http-request-services-demo/request-manager-demo/file-downloader/file-downloader.component.d.ts +0 -27
  96. package/lib/http-request-services-demo/request-manager-demo/file-downloader/models/download-labels-model.d.ts +0 -12
  97. package/lib/http-request-services-demo/request-manager-demo/file-downloader/spinner/spinner.component.d.ts +0 -16
  98. package/lib/http-request-services-demo/request-manager-demo/models/sample-ai-prompt.d.ts +0 -8
  99. package/lib/http-request-services-demo/request-manager-demo/models/sample-client-info.d.ts +0 -14
  100. package/lib/http-request-services-demo/request-manager-demo/models/sample-mapper-client-info.d.ts +0 -14
  101. package/lib/http-request-services-demo/request-manager-demo/request-manager-demo.component.d.ts +0 -107
  102. package/lib/http-request-services-demo/request-manager-state-demo/request-manager-state-demo.component.d.ts +0 -122
  103. package/lib/http-request-services-demo/request-manager-state-demo/services/state-manager-demo.service.d.ts +0 -15
  104. package/lib/http-request-services-demo/request-signals-manager-demo/models/sample-ai-prompt.d.ts +0 -8
  105. package/lib/http-request-services-demo/request-signals-manager-demo/models/sample-client-info.d.ts +0 -14
  106. package/lib/http-request-services-demo/request-signals-manager-demo/models/sample-mapper-client-info.d.ts +0 -14
  107. package/lib/http-request-services-demo/request-signals-manager-demo/request-signals-manager-demo.component.d.ts +0 -106
  108. package/lib/index.d.ts +0 -3
  109. package/lib/interceptors/credentials.interceptor.d.ts +0 -8
  110. package/lib/interceptors/index.d.ts +0 -4
  111. package/lib/interceptors/models/error-settings.model.d.ts +0 -10
  112. package/lib/interceptors/proxy-debugger.interceptor.d.ts +0 -12
  113. package/lib/interceptors/request-error.interceptor.d.ts +0 -10
  114. package/lib/interceptors/request-header.interceptor.d.ts +0 -15
  115. package/lib/models/config-http-options.model.d.ts +0 -21
  116. package/lib/models/config-local-storage-options.model.d.ts +0 -13
  117. package/lib/models/config-options.model.d.ts +0 -12
  118. package/lib/models/config-token.model.d.ts +0 -8
  119. package/lib/models/data-type.enum.d.ts +0 -5
  120. package/lib/models/database-storage.model.d.ts +0 -10
  121. package/lib/models/index.d.ts +0 -6
  122. package/lib/models/retry-options.model.d.ts +0 -10
  123. package/lib/services/database-manager-services/database.manager.service.d.ts +0 -31
  124. package/lib/services/database-manager-services/db.storage.service.d.ts +0 -26
  125. package/lib/services/database-manager-services/index.d.ts +0 -3
  126. package/lib/services/database-manager-services/models/table-schema.d.ts +0 -11
  127. package/lib/services/index.d.ts +0 -4
  128. package/lib/services/local-storage-manager-service/index.d.ts +0 -3
  129. package/lib/services/local-storage-manager-service/local-storage-manager.service.d.ts +0 -86
  130. package/lib/services/local-storage-manager-service/local-storage-signals-manager.service.d.ts +0 -64
  131. package/lib/services/local-storage-manager-service/models/global-store-options.model.d.ts +0 -15
  132. package/lib/services/local-storage-manager-service/models/index.d.ts +0 -5
  133. package/lib/services/local-storage-manager-service/models/setting-options.model.d.ts +0 -15
  134. package/lib/services/local-storage-manager-service/models/storage-data.model.d.ts +0 -10
  135. package/lib/services/local-storage-manager-service/models/storage-option.model.d.ts +0 -13
  136. package/lib/services/local-storage-manager-service/models/storage-type.enum.d.ts +0 -5
  137. package/lib/services/request-manager-services/http-manager-signals.service.d.ts +0 -38
  138. package/lib/services/request-manager-services/http-manager.service.d.ts +0 -41
  139. package/lib/services/request-manager-services/index.d.ts +0 -4
  140. package/lib/services/request-manager-services/request-signals.service.d.ts +0 -26
  141. package/lib/services/request-manager-services/request.service.d.ts +0 -28
  142. package/lib/services/request-manager-services/rxjs-operators/countdown.d.ts +0 -2
  143. package/lib/services/request-manager-services/rxjs-operators/delay-retry.d.ts +0 -2
  144. package/lib/services/request-manager-services/rxjs-operators/index.d.ts +0 -4
  145. package/lib/services/request-manager-services/rxjs-operators/request-polling.d.ts +0 -2
  146. package/lib/services/request-manager-services/rxjs-operators/request-streaming.d.ts +0 -2
  147. package/lib/services/request-manager-state-service/http-manager-state.store.d.ts +0 -64
  148. package/lib/services/request-manager-state-service/index.d.ts +0 -2
  149. package/lib/services/request-manager-state-service/models/api-request.model.d.ts +0 -30
  150. package/lib/services/request-manager-state-service/models/index.d.ts +0 -2
  151. package/lib/services/request-manager-state-service/models/request-options.model.d.ts +0 -10
  152. package/lib/services/request-manager-state-service/models/ws-options.model.d.ts +0 -14
  153. package/lib/services/utils/app.service.d.ts +0 -8
  154. package/lib/services/utils/encryption/asymmetrical-encryption.service.d.ts +0 -17
  155. package/lib/services/utils/encryption/encryption-test.service.d.ts +0 -10
  156. package/lib/services/utils/encryption/index.d.ts +0 -3
  157. package/lib/services/utils/encryption/random.d.ts +0 -7
  158. package/lib/services/utils/encryption/symmetrical-encryption.service.d.ts +0 -14
  159. package/lib/services/utils/headers.service.d.ts +0 -10
  160. package/lib/services/utils/index.d.ts +0 -5
  161. package/lib/services/utils/object-merger.service.d.ts +0 -14
  162. package/lib/services/utils/path-query.service.d.ts +0 -11
  163. package/lib/services/utils/utils.service.d.ts +0 -24
  164. package/lib/services/ws-manager-service/models/assortment-data.model.d.ts +0 -10
  165. package/lib/services/ws-manager-service/websocket.service.d.ts +0 -21
  166. package/public-api.d.ts +0 -7
package/README.md CHANGED
@@ -1,362 +1,647 @@
1
- # Request Manager Service Documentation
2
-
3
- ## Summary of the Lib
4
- The HTTPManagerService is a collection of 4 services for HTTP and Local Storage management.
5
-
6
- ## Installation
7
-
8
- `npm install http-request-manager`
9
-
10
- ## Services
11
-
12
- ### HTTP Manager Service:
13
-
14
- Http service simplifies http requests in the following ways
15
- - Define a fixed endpoint service
16
- - Provide a fixed set of headers or add to the headers on request
17
- - Proxy Config Support
18
- - Adapter for strict type checking for incoming data
19
- - Mapper for data transformation for outgoing data
20
- - Polling requests automatically
21
- - Retry requests if failure
22
- - Stream http requests from endpoint service
23
- - Display Error provides a Toast (Snackbar) notification on error
24
-
25
- ### HTTP State Manager Service
26
-
27
- Http service simplifies http request state management in the following ways
28
- - Inherits from HTTP Manager Service for config options
29
- - Creates a Component Store state (NGRX)
30
- - Selectors for data and selecting data records
31
- - Create, Update and Delete automatically updates data by endpoint and state on success
32
- - Get keeps state of records
33
-
34
- ### Database Storage Manager (Coming soon)
35
- - Inherits from HTTP State Manager Service for config options
36
- - Manages HTTP Requests caching data in local DB (IndexedDB) using DixieJS
37
- - Requests check first local DB and if data is not stale, request is made and updates DB
38
- - Expiry time/date can be set for DB records for caching
39
-
40
- ### Local/Session Storage
41
- - Allows for Local and Storage management for data Persistence
42
- - Component Store (NGRX) State for changes on storage
43
- - Encryption for data
44
- - Expiry time/date can be set for stores
45
-
46
- ## Using the Services
47
-
48
- There are three ways to use the service, depending on your needs:
49
-
50
- ### Injecting the Service (Single Usage)
51
-
52
- ```ts
53
- httpManagerService = inject(HTTPManagerService)
54
- ```
55
-
56
- - This approach provides a singleton state for the service, as services are provided in root (@Injectable({ providedIn: 'root' })).
57
- - Any components or services that inject this service will share the same state, meaning they all have access to:
58
- - data$ (observable for data)
59
- - isPending$ (loading state)
60
- - countDown$ (loading state)
61
- - error$ (error state)
62
- - Methods associated with the service
63
- - Since there is only one shared state, it can be reused across components without creating new instances.
64
-
65
- Here is a very simple example
66
-
67
- ```ts
68
- //Define your API request details using the `ApiRequest` adapter
69
- const apiOptions = ApiRequest.adapt({
70
- server: 'myApiUrl/rest/clients' // or ['myApiUrl', 'rest', 'clients']
1
+ <!-- markdownlint-disable MD013 MD060 -->
2
+
3
+ # HTTP Request Manager - Angular Library
4
+
5
+ [![TypeScript](https://img.shields.io/badge/TypeScript-007ACC?style=flat&logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
6
+ [![Angular](https://img.shields.io/badge/Angular-DD0031?style=flat&logo=angular&logoColor=white)](https://angular.io/)
7
+ [![RxJS](https://img.shields.io/badge/RxJS-B7178C?style=flat&logo=reactivex&logoColor=white)](https://rxjs.dev/)
8
+
9
+ A comprehensive Angular library providing enterprise-grade HTTP request management, state management, real-time communication, and local data persistence.
10
+
11
+ This README is the main documentation hub for the library. Detailed service guides live in `src/docs/`, and this page links to the observable/ngrx services for older Angular applications and the signal-based services for newer Angular applications in parallel.
12
+
13
+ ## 🚀 Features
14
+
15
+ ### Core Capabilities
16
+
17
+ | Feature | Description | Angular 14-18 / Observable + NgRx | Angular 19+ / Signals |
18
+ |---------|-------------|----------------------------------|------------------------|
19
+ | **🌐 HTTP Request Management** | Retry, polling, streaming, file downloads | [`HTTPManagerService`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/HTTP_MANAGER_README.md) | [`HTTPManagerSignalsService`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/HTTP_SINGNALS_MANAGER_README.md) |
20
+ | **🔄 State Management** | CRUD state, persistence, derived state | [`HTTPManagerStateService`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/HTTP_STATE_MANAGER_README.md) and [`StoreStateManagerService`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/COMPLETE_API_REFERENCE.md#storestatemanagerservice) | [`StoreStateManagerSignalsService`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/STORE_STATE_SIGNALS_README.md) |
21
+ | **💬 Real-Time Communication** | WebSocket channels, tracking, messaging | [`WebSocketManagerService`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/WS_MANAGER_README.md) and [`WebSocketMessageService`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/WEBSOCKET_MESSAGE_SERVICE.md) | [`WebSocketSignalsManagerService`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/WEBSOCKET_SIGNALS_README.md) and [`MessageTrackerSignalsService`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/MESSAGE_TRACKER_SIGNALS_README.md) |
22
+ | **💾 Data Persistence** | Local/session storage and offline caching | [`LocalStorageManagerService`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/LOCAL_STORAGE_README.md) and [`DatabaseManagerService`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/DATABASE_README.md) | [`LocalStorageSignalsManagerService`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/LOCAL_STORAGE_SIGNALS_README.md) |
23
+ | **⚡ Utility Functions** | JSON handling, encryption, headers, validation | [`UtilsService`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/UTILS_README.md) | Uses the same utility layer |
24
+
25
+ ### Key Benefits
26
+
27
+ - **Type-Safe** - Full TypeScript support with generics
28
+ - **Offline-First** - Built-in IndexedDB caching
29
+ - **Real-Time Ready** - Seamless WebSocket integration
30
+ - **Secure** - AES & RSA encryption support for sensitive data
31
+ - **Scalable** - ComponentStore-based architecture
32
+ - **Flexible** - Works with Observables or Signals
33
+
34
+ ### 🚀 Advanced Features
35
+
36
+ | Feature | Description | Learn More |
37
+ |---------|-------------|------------|
38
+ | **🔐 Enterprise Encryption** | AES symmetric + RSA asymmetric encryption | [`Encryption Utils`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/UTILS_README.md#encryption) |
39
+ | **📡 Streaming Support** | NDJSON & Server-Sent Events (SSE) | [`HTTP Manager`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/HTTP_MANAGER_README.md#streaming) |
40
+ | **📄 File Downloads** | Progress tracking for large files | [`HTTP Manager`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/HTTP_MANAGER_README.md#file-downloads) |
41
+ | **📊 Pagination** | Built-in pagination with page tracking | [`HTTP State Manager`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/HTTP_STATE_MANAGER_README.md#pagination) |
42
+ | **🔔 Smart Notifications** | Persistent notifications with DB storage | [`WebSocket Guide`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/ADVANCED_WEBSOCKET.md#notifications) |
43
+ | **👥 Presence Tracking** | Real-time user presence by channel | [`WebSocket Guide`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/ADVANCED_WEBSOCKET.md#presence) |
44
+ | **🔄 Message Replay** | Automatic message history on reconnect | [`WebSocket Guide`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/ADVANCED_WEBSOCKET.md#message-replay) |
45
+ | **🏷️ Channel Architecture** | SYS-, PUB-, MES- channel prefixes | [`WebSocket Guide`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/ADVANCED_WEBSOCKET.md#channels) |
46
+ | **🔌 Singleton WebSocket** | Single connection across ALL instances | [`WebSocket Guide`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/ADVANCED_WEBSOCKET.md#singleton) |
47
+ | **✨ Unified Message Service** | Type-safe WebSocket messaging with auto prefixes | [`WebSocket Message Service`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/WEBSOCKET_MESSAGE_SERVICE.md) |
48
+ | **🚀 Batch Requests** | Execute multiple HTTP requests with sequential/parallel modes | [`Batch Request Guide`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/BATCH_REQUEST_README.md) |
49
+
50
+ ## 📋 Table of Contents
51
+
52
+ - [Quick Start](#-quick-start)
53
+ - [Configuration](#️-configuration)
54
+ - [Services Overview](#-services-overview)
55
+ - [Documentation Paths](#-documentation-paths)
56
+ - [Architecture](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/ARCHITECTURE.md)
57
+ - [Interceptors](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/INTERCEPTOR_README.md)
58
+ - [Advanced Features](#-advanced-features)
59
+ - [Batch Requests](#batch-requests)
60
+ - [Detailed Documentation](#-detailed-documentation)
61
+ - [Demo Examples](#-demo-examples)
62
+ - [Migration Guide](#-migration-guide)
63
+
64
+ ## 🚀 Quick Start
65
+
66
+ ### Installation & Setup (2 minutes)
67
+
68
+ #### 1. Import Module
69
+
70
+ ```typescript
71
+ // app.module.ts
72
+ import { HttpRequestManagerModule } from 'http-request-manager';
73
+
74
+ @NgModule({
75
+ imports: [
76
+ HttpRequestManagerModule.forRoot({
77
+ httpRequestOptions: {
78
+ server: 'http://localhost:8080', // Your API base URL
79
+ retry: { times: 3, delay: 2 },
80
+ displayError: true
81
+ }
71
82
  })
83
+ ]
84
+ })
85
+ export class AppModule { }
86
+ ```
72
87
 
73
- onFetchData() {
74
-
75
- this.httpManagerService.getRequest<any>(apiOptions)
76
- .pipe(
77
- catchError(error => {
78
- return throwError(() => this.errorHandling(error, 'GET'))
79
- })
80
- ).subscribe(data => console.log(data)))
81
-
82
- }
83
- ```
84
-
85
- ### Example
86
- In this example, we define the endpoint URL as myApiUrl. This will return the data from the observable for your use case.
87
-
88
- The endpoint can be:
89
-
90
- A direct URL (e.g., https://apple.com/clients).
91
- A proxy-config file (recommended to avoid CORS issues).
92
- A string, an array of strings, or numbers—similar to Angular’s Router.navigate() API.
93
- The HTTP Service Manager automatically sanitizes the endpoint by removing redundant `/` characters and validating the URL.
94
-
95
- You can also add query parameters by passing an object:
96
-
97
- ```ts
98
- { sortBy: 'asc', filter: ['samples', 'testing'] }
99
- ```
100
-
101
- This translates to: `https://apple.com/clients?sortBy=asc&filter=samples,testing`
102
-
103
- There are a number of other options available in the `ApiRequest` adapter
104
-
105
-
106
- ### Extending a Component or Service with the Service (Multiple Instances - preferred method)
107
-
108
- This approach creates a new instance of the service for each component or service that extends it, ensuring each instance maintains its own independent state.
109
-
110
- ### Observables
111
- - Similar to the first approach, instead of one instance of the state you are creating a new state instance
112
- - CRUD operations return Observables, similar to HttpClient.
113
- - This allows for custom error handling and executing additional actions after the request completes.
114
- - Since HTTP requests are asynchronous, you must subscribe to the Observable to receive data:
115
-
116
- ```ts
117
- myService.getData().subscribe(response => {
118
- console.log(response);
119
- });
120
- ```
121
-
122
- - Alternatively, you can use the async pipe for automatic subscription and cleanup:
123
-
124
- ```ts
125
- {{ myData$ | async }}
126
- ```
88
+ #### 2. Provide APP_ID (if using encryption)
127
89
 
128
- ### Example
129
- First we need to extend the Component or Service (recommended approach) with the `HTTPManagerService`
90
+ ```typescript
91
+ // app.module.ts
92
+ import { APP_ID } from '@angular/core';
130
93
 
131
- Component Example:
132
- ```ts
133
- export class RequestManagerDemoComponent extends HTTPManagerService<any> implements OnInit {
94
+ @NgModule({
95
+ providers: [
96
+ { provide: APP_ID, useValue: "your-unique-guid-here" }
97
+ ]
98
+ })
99
+ export class AppModule { }
100
+ ```
134
101
 
135
- constructor() {
136
- super()
137
- }
102
+ ### Simple Examples
103
+
104
+ #### Basic HTTP Request
105
+
106
+ ```typescript
107
+ import { Component, inject } from '@angular/core';
108
+ import { HTTPManagerService, ApiRequest } from 'http-request-manager';
109
+
110
+ @Component({
111
+ selector: 'app-users',
112
+ template: `
113
+ <div *ngIf="isLoading$ | async">Loading...</div>
114
+ <div *ngIf="error$ | async as error" class="error">
115
+ Error: {{ error.message }}
116
+ </div>
117
+ <div *ngFor="let user of data$ | async">
118
+ {{ user.name }}
119
+ </div>
120
+ `
121
+ })
122
+ export class UsersComponent {
123
+ httpManager = inject(HTTPManagerService);
124
+
125
+ data$ = this.httpManager.data$;
126
+ isLoading$ = this.httpManager.isPending$;
127
+ error$ = this.httpManager.error$;
128
+
129
+ ngOnInit() {
130
+ this.httpManager.getRequest(
131
+ ApiRequest.adapt({ path: ['users'] })
132
+ ).subscribe();
138
133
  }
139
- ```
140
-
141
- Service Example:
142
- ```ts
143
- @Injectable({
144
- providedIn: 'root'
145
- })
146
- export class myAPIService extends HTTPManagerService<any> {
147
-
148
- constructor() {
149
- super()
150
- }
134
+ }
135
+ ```
151
136
 
137
+ #### State Management with CRUD
138
+
139
+ ```typescript
140
+ @Injectable({ providedIn: 'root' })
141
+ export class UsersStore extends HTTPManagerStateService<User> {
142
+
143
+ constructor() {
144
+ super(
145
+ ApiRequest.adapt({
146
+ server: 'http://localhost:8080',
147
+ path: ['users']
148
+ }),
149
+ DataType.ARRAY
150
+ );
152
151
  }
153
- ```
154
-
155
- In this example, we define the endpoint URL as myApiUrl. This will return the data from the observable for your use case.
156
152
 
157
- The endpoint can be:
153
+ // Public API
154
+ loadUsers() { this.fetchRecords(); }
155
+ addUser(user: User) { this.createRecord(user); }
156
+ updateUser(user: User) { this.updateRecord(user); }
157
+ deleteUser(id: number) { this.deleteRecord(id); }
158
+ }
159
+
160
+ // Component
161
+ @Component({
162
+ selector: 'app-users',
163
+ template: `
164
+ <button (click)="store.loadUsers()">Load</button>
165
+ <div *ngFor="let user of store.data$ | async">
166
+ {{ user.name }}
167
+ <button (click)="store.deleteUser(user.id)">Delete</button>
168
+ </div>
169
+ `
170
+ })
171
+ export class UsersComponent {
172
+ store = inject(UsersStore);
173
+ }
174
+ ```
158
175
 
159
- A direct URL (e.g., https://apple.com/clients).
160
- A proxy-config file (recommended to avoid CORS issues).
161
- A string, an array of strings, or numbers—similar to Angular’s Router.navigate() API.
162
- The HTTP Service Manager automatically sanitizes the endpoint by removing redundant `/` characters and validating the URL.
176
+ ## ⚙️ Configuration
177
+
178
+ ### Module Initialization (`forRoot`)
179
+
180
+ Configure the library globally using the `forRoot` method:
181
+
182
+ ```typescript
183
+ import { HttpRequestManagerModule } from 'http-request-manager';
184
+
185
+ @NgModule({
186
+ imports: [
187
+ HttpRequestManagerModule.forRoot({
188
+ httpRequestOptions: {
189
+ server: 'https://api.example.com',
190
+ headers: { 'Authorization': 'Bearer token' },
191
+ retry: { times: 3, delay: 2 },
192
+ displayError: true
193
+ },
194
+ LocalStorageOptions: {
195
+ storageName: 'my-app-data',
196
+ storageSettingsName: 'my-app-settings',
197
+ options: {
198
+ encrypted: true,
199
+ expiresIn: '7d'
200
+ }
201
+ }
202
+ })
203
+ ]
204
+ })
205
+ export class AppModule { }
206
+ ```
163
207
 
164
- You can also add query parameters by passing an object:
165
- ```ts
166
- { sortBy: 'asc', filter: ['samples', 'testing'] }
208
+ ### Configuration Options
209
+
210
+ #### HTTP Options (`ConfigHTTPOptions`)
211
+
212
+ | Option | Type | Description | Default |
213
+ |--------|------|-------------|---------|
214
+ | `server` | `string` | Base URL for API requests | `''` |
215
+ | `path` | `any[]` | Default path segments | `[]` |
216
+ | `headers` | `any` | Default headers | `{}` |
217
+ | `polling` | `number` | Default polling interval (seconds) | `0` |
218
+ | `retry` | `RetryOptions` | Default retry configuration | `{ times: 0, delay: 3 }` |
219
+ | `stream` | `boolean` | Enable streaming by default | `false` |
220
+ | `displayError` | `boolean` | Show toast errors by default | `false` |
221
+
222
+ #### Local Storage Options (`LocalStorageOptions`)
223
+
224
+ | Option | Type | Description | Default |
225
+ |--------|------|-------------|---------|
226
+ | `storageName` | `string` | Key for storing data | `'storage'` |
227
+ | `storageSettingsName` | `string` | Key for settings metadata | `'global-storage'` |
228
+ | `options` | `SettingOptions` | Default storage settings | `{ storage: StorageType.GLOBAL, expires: 0, expiresIn: '', encrypted: false }` |
229
+
230
+ #### Retry Options (`RetryOptions`)
231
+
232
+ | Option | Type | Description | Default |
233
+ |--------|------|-------------|---------|
234
+ | `times` | `number` | Number of retry attempts | `0` |
235
+ | `delay` | `number` | Delay between retries (seconds) | `3` |
236
+
237
+ ## 📚 Services Overview
238
+
239
+ ### Angular 14-18: Observable + NgRx Services
240
+
241
+ | Service | Description | Use Case |
242
+ |---------|-------------|----------|
243
+ | [`HTTPManagerService`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/HTTP_MANAGER_README.md) | Observable-based HTTP client with retry, polling, streaming | Simple API calls with loading states |
244
+ | [`HTTPManagerStateService`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/HTTP_STATE_MANAGER_README.md) | ComponentStore + HTTP + WebSocket + IndexedDB | CRUD with auto state sync and real-time updates |
245
+ | [`WebSocketManagerService`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/WS_MANAGER_README.md) | Singleton WebSocket connection manager | Real-time messaging and notifications |
246
+ | [`WebSocketMessageService`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/WEBSOCKET_MESSAGE_SERVICE.md) | Unified type-safe message sending service | Simplified WebSocket messaging with auto prefixes |
247
+ | [`LocalStorageManagerService`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/LOCAL_STORAGE_README.md) | Secure local/session storage with encryption | User preferences and session data |
248
+ | [`DatabaseManagerService`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/DATABASE_README.md) | IndexedDB wrapper via Dexie.js | Offline-first data access |
249
+ | [`StoreStateManagerService`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/COMPLETE_API_REFERENCE.md#storestatemanagerservice) | Persistent ComponentStore with localStorage sync | Application state persistence |
250
+
251
+ ### Angular 19+: Signal-Based Services
252
+
253
+ | Service | Description | Use Case |
254
+ |---------|-------------|----------|
255
+ | [`HTTPManagerSignalsService`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/HTTP_SINGNALS_MANAGER_README.md) | Signal-based HTTP client for modern reactive UI | Modern Angular with Signals |
256
+ | [`LocalStorageSignalsManagerService`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/LOCAL_STORAGE_SIGNALS_README.md) | Signal-based local/session storage | Reactive persisted UI state |
257
+ | [`StoreStateManagerSignalsService`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/STORE_STATE_SIGNALS_README.md) | Signal-based persistent state service | App state persistence with computed derivations |
258
+ | [`WebSocketSignalsManagerService`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/WEBSOCKET_SIGNALS_README.md) | Signal-based WebSocket manager | Signal-driven real-time dashboards and messaging |
259
+ | [`MessageTrackerSignalsService`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/MESSAGE_TRACKER_SIGNALS_README.md) | Signal-based channel/message tracking | Presence, counters, last-message views |
260
+
261
+ ### Shared Utilities
262
+
263
+ | Service | Description | Use Case |
264
+ |---------|-------------|----------|
265
+ | [`UtilsService`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/UTILS_README.md) | Utilities: encryption, headers, merging, path/query | Helper functions |
266
+
267
+ ### Common Use Cases
268
+
269
+ | Use Case | Service to Use | Key Features |
270
+ |----------|---------------|--------------|
271
+ | Simple API calls | `HTTPManagerService` | Observables, retry, polling |
272
+ | Modern reactive UI | `HTTPManagerSignalsService` | Angular Signals |
273
+ | CRUD operations | `HTTPManagerStateService` | Auto state updates, pagination |
274
+ | Real-time chat | `HTTPManagerStateService` + WebSocket | PUB- messaging channels |
275
+ | Persistent notifications | `HTTPManagerStateService` + WebSocket | MES- channels with DB storage |
276
+ | State synchronization | `HTTPManagerStateService` + WebSocket | SYS- private channels |
277
+ | **Unified WebSocket messaging** | **`WebSocketMessageService`** | **Type-safe, auto prefixes, validation** |
278
+ | User preferences | `LocalStorageManagerService` | Encryption, expiration |
279
+ | Offline-first | `DatabaseManagerService` | IndexedDB caching, querying |
280
+ | Large local datasets | `DatabaseManagerService` | Bulk operations, indexing |
281
+ | Secure data storage | `LocalStorageManagerService` | AES encryption |
282
+ | File transfers | `HTTPManagerService` | Download progress tracking |
283
+ | Live data streams | `HTTPManagerService` | NDJSON, SSE streaming |
284
+
285
+ ## 📖 Documentation Paths
286
+
287
+ All detailed service guides live in `src/docs/`. Use this README as the entry point, then choose the track that matches the Angular version in your app.
288
+
289
+ ### Angular 14-18: Observable + NgRx Track
290
+
291
+ | Category | Documentation |
292
+ |----------|---------------|
293
+ | HTTP | [HTTP Manager](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/HTTP_MANAGER_README.md) |
294
+ | State | [HTTP State Manager](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/HTTP_STATE_MANAGER_README.md) and [Store State API Reference](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/COMPLETE_API_REFERENCE.md#storestatemanagerservice) |
295
+ | Real-Time | [WebSocket Manager](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/WS_MANAGER_README.md) and [WebSocket Message Service](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/WEBSOCKET_MESSAGE_SERVICE.md) |
296
+ | Persistence | [Local Storage](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/LOCAL_STORAGE_README.md) and [Database](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/DATABASE_README.md) |
297
+
298
+ ### Angular 19+: Signal Track
299
+
300
+ | Category | Documentation |
301
+ |----------|---------------|
302
+ | Overview | [Signal Services Overview](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/SIGNAL_SERVICES_README.md) |
303
+ | HTTP | [HTTP Manager Signals](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/HTTP_SINGNALS_MANAGER_README.md) |
304
+ | State | [Store State Signals](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/STORE_STATE_SIGNALS_README.md) |
305
+ | Real-Time | [WebSocket Signals](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/WEBSOCKET_SIGNALS_README.md) and [Message Tracker Signals](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/MESSAGE_TRACKER_SIGNALS_README.md) |
306
+ | Persistence | [Local Storage Signals](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/LOCAL_STORAGE_SIGNALS_README.md) |
307
+
308
+ ## 🏗️ Architecture
309
+
310
+ For detailed system architecture, data flows, and design patterns, see:
311
+
312
+ 📋 **[Architecture Documentation](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/ARCHITECTURE.md)**
313
+
314
+ ### System Overview
315
+
316
+ ```text
317
+ ┌─────────────────────────────────────────────────────────────────┐
318
+ │ Angular Application │
319
+ ├─────────────────────────────────────────────────────────────────┤
320
+ │ ┌────────────────┐ ┌────────────────┐ ┌──────────────────┐ │
321
+ │ │ Components │ │ Components │ │ Components │ │
322
+ │ │ (Signals) │ │ (Observables) │ │ (State Store) │ │
323
+ │ └───────┬────────┘ └───────┬────────┘ └────────┬─────────┘ │
324
+ │ │ │ │ │
325
+ │ ▼ ▼ ▼ │
326
+ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────────┐ │
327
+ │ │HTTPManager │ │HTTPManager │ │HTTPManager │ │
328
+ │ │SignalsService│ │Service │ │StateService │ │
329
+ │ └──────┬───────┘ └──────┬───────┘ └────────┬─────────┘ │
330
+ │ │ │ │ │
331
+ │ └───────────────────┴──────────────────────┘ │
332
+ │ │ │
333
+ │ ▼ │
334
+ │ ┌─────────────────┐ │
335
+ │ │ HttpClient │ │
336
+ │ │ (Angular) │ │
337
+ │ └────────┬────────┘ │
338
+ │ │ │
339
+ ├─────────────────────────────┼───────────────────────────────────┤
340
+ │ │ │
341
+ │ ┌──────────────────────────┼──────────────────────┐ │
342
+ │ │ Storage Layer │ │
343
+ │ ├──────────────────────────┼──────────────────────┤ │
344
+ │ │ ┌────────────────┐ │ ┌─────────────┐ │ │
345
+ │ │ │LocalStorage │ │ │IndexedDB │ │ │
346
+ │ │ │Manager Service │ │ │(Dexie.js) │ │ │
347
+ │ │ └────────────────┘ │ └─────────────┘ │ │
348
+ │ └──────────────────────────┼──────────────────────┘ │
349
+ │ │ │
350
+ │ ┌──────────────────────────┼──────────────────────┐ │
351
+ │ │ WebSocket Layer │ │
352
+ │ ├──────────────────────────┼──────────────────────┤ │
353
+ │ │ ┌─────────────────────────────────────┐ │ │
354
+ │ │ │ WebsocketService │ │ │
355
+ │ │ └─────────────────────────────────────┘ │ │
356
+ │ └─────────────────────────────────────────────────┘ │
357
+ └─────────────────────────────────────────────────────────────────┘
167
358
  ```
168
- This translates to: `https://apple.com/clients?sortBy=asc&filter=samples,testing`
169
359
 
170
- Lets define these query params as a variable called `PARAMS` and use them in the following request.
360
+ ## 🔧 Interceptors
171
361
 
172
- There are a number of other options available in the `ApiRequest` adapter
362
+ The library provides several HTTP interceptors that are automatically configured:
173
363
 
174
- No we can define a method:
175
- In this example take note that the clientID has been passed to the method and the param after the apiOptions allows for further customization for the api request being made. In this case we extended the the base path defined in the `ApiRequest` options. We also added the `PARAMS` for query parameters.
364
+ 📋 **[Interceptors Documentation](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/INTERCEPTOR_README.md)**
176
365
 
177
- Define your API request options using the 'ApiRequest' adapter
366
+ ### Available Interceptors
178
367
 
179
- ```ts
180
- const apiOptions = ApiRequest.adapt({
181
- server: ['myApiUrl', 'rest', 'clients']
182
- })
368
+ | Interceptor | Purpose | Automatically Applied |
369
+ |-------------|---------|----------------------|
370
+ | **RequestErrorInterceptor** | Handles 400/500 errors with toast notifications | ✅ Yes |
371
+ | **RequestHeadersInterceptor** | Adds Content-Type, Accept-Language, Current-Date | ✅ Yes |
372
+ | **CredentialsInterceptor** | Adds `withCredentials: true` for CORS | ✅ Yes |
373
+ | **ProxyDebuggerInterceptor** | Debug logging for development | ⚙️ Configurable |
183
374
 
184
- // Dynamically change these params
185
- const PARAMS = {
186
- sortBy: 'asc',
187
- filter: ['samples', 'testing']
188
- }
375
+ ### Manual Configuration
189
376
 
190
- onFetchData(clientId) {
191
-
192
- this.httpManagerService.getRequest<any>(apiOptions, [clientId, this.PARAMS])
193
- .pipe(
194
- catchError(error => {
195
- return throwError(() => this.errorHandling(error, 'GET'))
196
- })
197
- ).subscribe(data => console.log(data)))
377
+ ```typescript
378
+ // app.module.ts
379
+ providers: [
380
+ { provide: HTTP_INTERCEPTORS, useClass: WithCredentialsInterceptor, multi: true },
381
+ { provide: HTTP_INTERCEPTORS, useClass: RequestHeadersInterceptor, multi: true },
382
+ { provide: HTTP_INTERCEPTORS, useClass: RequestErrorInterceptor, multi: true }
383
+ ]
384
+ ```
198
385
 
199
- }
200
- ```
386
+ ### Customization
201
387
 
388
+ Error handling can be customized with `ErrorSettings`:
202
389
 
203
- ### State Observable
204
- - When executing CRUD operations, their results are automatically pushed into the data$ observable within the service.
205
- - This means you can bind the data$ observable to a component to automatically update UI elements.
206
- - Using this approach enables state management across components and allows data refresh actions without needing additional logic.
390
+ ```typescript
391
+ import { ErrorSettings } from 'http-request-manager';
207
392
 
208
- ### Example
209
- First we need to extend the Component or Service (recommended approach) with the `HTTPManagerService`
393
+ const customSettings: ErrorSettings = {
394
+ displayError: true,
395
+ displayWarning: true,
396
+ customHandler: (error) => {
397
+ // Custom error handling logic
398
+ }
399
+ };
400
+ ```
210
401
 
211
- Component Example:
212
- The structure would be: Component extends `HTTPManagerService`
402
+ ## 📚 Detailed Documentation
213
403
 
214
- ```ts
215
- export class RequestManagerDemoComponent extends HTTPManagerService<any> implements OnInit {
404
+ For in-depth documentation on each service and component, refer to the following detailed guides:
216
405
 
217
- constructor() {
218
- super()
219
- }
220
- }
221
- ```
406
+ ### Detailed Docs for Angular 14-18
222
407
 
223
- Service Example:
224
- The structure would be: Component injects a service call `clientsService` and `clientsService` extends `HTTPManagerService`
408
+ | Documentation | Description |
409
+ |---------------|-------------|
410
+ | 📖 [HTTP Manager Service](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/HTTP_MANAGER_README.md) | Observable-based HTTP client with retry, polling, streaming, and error handling |
411
+ | 📖 [HTTP Manager State Service](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/HTTP_STATE_MANAGER_README.md) | ComponentStore integration with automatic CRUD state updates and WebSocket sync |
412
+ | 📖 [WebSocket Manager Service](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/WS_MANAGER_README.md) | WebSocket connection management with channel-based messaging and notifications |
413
+ | 📖 [Local Storage Manager Service](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/LOCAL_STORAGE_README.md) | Secure local/session storage with encryption and expiration |
414
+ | 📖 [Database Manager Service](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/DATABASE_README.md) | IndexedDB wrapper via Dexie.js with Observable API for offline-first apps |
415
+ | 📖 [Store State Manager Service](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/COMPLETE_API_REFERENCE.md#storestatemanagerservice) | Persistent ComponentStore synchronized with local/session storage |
416
+ | 📖 [WebSocket Message Service](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/WEBSOCKET_MESSAGE_SERVICE.md) | Type-safe WebSocket message sending with channel prefix helpers |
417
+ | 🚀 [Batch Request Service](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/BATCH_REQUEST_README.md) | Execute multiple HTTP requests with sequential/parallel modes and configurable error handling |
418
+
419
+ ### Detailed Docs for Angular 19+
420
+
421
+ | Documentation | Description |
422
+ |---------------|-------------|
423
+ | 📖 [Signal Services Overview](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/SIGNAL_SERVICES_README.md) | Overview of the signal-based service set and migration guidance |
424
+ | 📖 [HTTP Manager Signals Service](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/HTTP_SINGNALS_MANAGER_README.md) | Signal-based HTTP client for modern reactive UI with Angular Signals |
425
+ | 📖 [Local Storage Signals Manager Service](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/LOCAL_STORAGE_SIGNALS_README.md) | Signal-based persisted storage patterns |
426
+ | 📖 [Store State Signals Manager Service](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/STORE_STATE_SIGNALS_README.md) | Signal-based state persistence and computed state |
427
+ | 📖 [WebSocket Signals Manager Service](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/WEBSOCKET_SIGNALS_README.md) | Signal-driven WebSocket connection and subscription management |
428
+ | 📖 [Message Tracker Signals Service](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/MESSAGE_TRACKER_SIGNALS_README.md) | Signal-based message counting, presence, and channel metadata |
429
+ | 🚀 [Batch Request Service](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/BATCH_REQUEST_README.md) | Execute multiple HTTP requests with sequential/parallel modes and configurable error handling |
430
+
431
+ ### Shared Services
432
+
433
+ | Documentation | Description |
434
+ |---------------|-------------|
435
+ | 📖 [Utils Service](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/UTILS_README.md) | Utility functions for JSON handling, encryption, headers, and validation |
436
+
437
+ ### Core Components
438
+
439
+ | Documentation | Description |
440
+ |---------------|-------------|
441
+ | 🏗️ [Architecture](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/ARCHITECTURE.md) | System architecture, data flows, and design patterns |
442
+ | 🔧 [Interceptors](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/INTERCEPTOR_README.md) | HTTP interceptors for error handling, headers, authentication, and debugging |
443
+
444
+ ### Additional Resources
445
+
446
+ - **Request Manager Services** - Detailed API documentation for the request manager services ([`src/lib/services/request-manager-services/README.md`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/lib/services/request-manager-services/README.md))
447
+ - **Encryption Utils** - Encryption utility documentation ([`src/lib/services/utils/encryption/README.md`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/lib/services/utils/encryption/README.md))
448
+
449
+ ## 🎮 Demo Examples
450
+
451
+ Comprehensive demo components showcase all library features in action:
452
+
453
+ ### Available Demos
454
+
455
+ Located in [`src/lib/http-request-services-demo/`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/lib/http-request-services-demo/):
456
+
457
+ | Demo Component | Features Demonstrated |
458
+ |----------------|----------------------|
459
+ | **HttpRequestServicesDemoComponent** | Main demo hub with service selection |
460
+ | **RequestManagerDemoComponent** | HTTP CRUD, file downloads, streaming, polling, retry |
461
+ | **RequestManagerStateDemoComponent** | State management, pagination, WebSocket sync, IndexedDB caching |
462
+ | **RequestManagerWsDemoComponent** | Real-time chat, AI messaging, notifications, presence tracking |
463
+ | **LocalStorageDemoComponent** | Encrypted storage, expiration, reactive signals |
464
+ | **LocalStorageSignalsDemoComponent** | Signal-based localStorage API |
465
+ | **DatabaseDataDemoComponent** | IndexedDB CRUD, querying, bulk operations |
466
+ | **RequestSignalsManagerDemoComponent** | Signal-based HTTP with file downloads |
467
+ | **StoreStateManagerDemoComponent** | Persistent state with localStorage sync |
468
+
469
+ ### Demo Features
470
+
471
+ **HTTP Service Demos:**
472
+
473
+ - ✅ Basic CRUD operations
474
+ - ✅ File download with progress tracking
475
+ - ✅ Streaming responses (NDJSON, SSE)
476
+ - ✅ Polling with countdown timers
477
+ - ✅ Retry logic with custom delays
478
+ - ✅ Error handling with toast notifications
479
+
480
+ **State Management Demos:**
481
+
482
+ - ✅ ComponentStore integration
483
+ - ✅ Automatic state updates
484
+ - ✅ Pagination controls
485
+ - ✅ WebSocket real-time sync
486
+ - ✅ IndexedDB caching
487
+ - ✅ Database clear/refresh
488
+
489
+ **WebSocket Demos:**
490
+
491
+ - ✅ Channel-based messaging (PUB- channels)
492
+ - ✅ Private state sync (SYS- channels)
493
+ - ✅ Persistent notifications (MES- channels)
494
+ - ✅ User presence tracking
495
+ - ✅ Message history & replay
496
+ - ✅ AI chat integration
497
+ - ✅ Multi-room support
498
+
499
+ **Storage Demos:**
500
+
501
+ - ✅ Encrypted localStorage
502
+ - ✅ SessionStorage usage
503
+ - ✅ Expiration management
504
+ - ✅ Signal-based API
505
+ - ✅ Reactive updates
506
+
507
+ ### Usage
508
+
509
+ ```html
510
+ <app-http-request-services-demo
511
+ [server]="'http://localhost:8080'"
512
+ [wsServer]="'ws://localhost:8080'"
513
+ [jwtToken]="'your-jwt-token'"
514
+ [adapter]="myAdapterFunction"
515
+ [mapper]="myMapperFunction">
516
+ </app-http-request-services-demo>
517
+ ```
225
518
 
226
- ```ts
227
- @Injectable({
228
- providedIn: 'root'
229
- })
230
- export class myAPIService extends HTTPManagerService<any> {
519
+ ### Sample Models
231
520
 
232
- constructor() {
233
- super()
234
- }
521
+ Demo includes production-ready sample models:
235
522
 
236
- }
237
- ```
523
+ - `User` - User data structures
524
+ - `ClientInfo` - Client details
525
+ - `SessionData` - Session management
526
+ - `AIMessage` - AI chat messages
527
+ - `Notification` - Notification structures
238
528
 
239
- In this example, we define the endpoint URL as myApiUrl.
529
+ ## 📖 Migration Guide
240
530
 
241
- Lets define these query params as a variable called `PARAMS` and use them in the following request.
531
+ ### From HttpClient to HTTPManagerService
242
532
 
243
- No we can define a method:
244
- In this example the clientID has been passed to the method.
245
- We also added the `PARAMS` for query parameters.
533
+ **Before:**
246
534
 
247
- Define your API request options using the 'ApiRequest' adapter
535
+ ```typescript
536
+ http.get('api/users').subscribe(users => {
537
+ this.users = users;
538
+ this.loading = false;
539
+ });
540
+ ```
248
541
 
249
- ```ts
250
- const apiOptions = ApiRequest.adapt({
251
- server: ['myApiUrl', 'rest', 'clients']
252
- })
542
+ **After:**
253
543
 
254
- // Dynamically change these params
255
- const PARAMS = {
256
- sortBy: 'asc',
257
- filter: ['samples', 'testing']
258
- }
544
+ ```typescript
545
+ httpManager.getRequest(
546
+ ApiRequest.adapt({ path: ['users'] })
547
+ ).subscribe();
259
548
 
260
- onFetchData(clientId: number) {
261
- this.httpManagerService.getRequest<any>(apiOptions, [clientId, this.PARAMS]).subscribe()
262
- }
263
- ```
549
+ data$ = this.httpManager.data$;
550
+ isLoading$ = this.httpManager.isPending$;
551
+ ```
264
552
 
265
- In the above case we are not using the data returning from the Observable but rather executing the api call, like a refresh if called again
553
+ ### From Manual State to HTTPManagerStateService
266
554
 
267
- To access the data from the observable, you need to bind the observable if your using a component that injects the service that extends the `HTTPManagerService`
555
+ **Before:**
268
556
 
269
- In the component where the service was injected, we define
557
+ ```typescript
558
+ users: User[] = [];
559
+ loading = false;
270
560
 
271
- ```ts
272
- data$ = this.clientsService.data$
273
- isPending$ = this.clientsService.isPending$
274
- error$ = this.clientsService.error$
275
- ```
276
- By doing this gives your component the state of the data and other feedback states for the request that now you can use in your template.
561
+ loadUsers() {
562
+ this.loading = true;
563
+ this.http.get('api/users').subscribe(users => {
564
+ this.users = users;
565
+ this.loading = false;
566
+ });
567
+ }
277
568
 
278
- ```ts
279
- {{ data$ | async }}
280
- {{ isPending$ | async }}
281
- {{ error$ | async }}
569
+ addUser(user: User) {
570
+ this.http.post('api/users', user).subscribe(newUser => {
571
+ this.users = [...this.users, newUser];
572
+ });
573
+ }
282
574
  ```
283
575
 
576
+ **After:**
284
577
 
285
- ### ApiRequest Options
286
- The following are the available options when configuring an ApiRequest object:
287
-
288
- ```ts
289
- apiRequest = ApiRequest.adapt({
290
- server: string,
291
- path: any[],
292
- headers: any,
293
- adapter?: any,
294
- mapper?: any,
295
- polling?: number, // in seconds (undefined | 0 = none)
296
- retry: RetryOptions,
297
- stream?: boolean
298
- displayError: boolean
299
- });
578
+ ```typescript
579
+ @Injectable()
580
+ export class UsersStore extends HTTPManagerStateService<User> {
581
+ constructor() {
582
+ super(ApiRequest.adapt({ path: ['users'] }), DataType.ARRAY);
583
+ }
584
+
585
+ loadUsers() { this.fetchRecords(); }
586
+ addUser(user: User) { this.createRecord(user); }
587
+ }
588
+
589
+ // Component
590
+ data$ = this.usersStore.data$;
591
+ isLoading$ = this.usersStore.isPending$;
300
592
  ```
301
593
 
302
- | **Property** | **Description** | **Type** | **Required** |
303
- |--------------|--------------------------------------------------------------------------------|---------------------------|------------|
304
- | `server` | The base URL or service endpoint for the API request. | `string` | ✅ |
305
- | `path` | Additional paths to append to the base URL for constructing the full API endpoint. | `any[]` | ✅ |
306
- | `headers` | Custom headers to include in the request, provided as an object. | `any` | ✅ |
307
- | `adapter` | A model adapter used to transform incoming data (e.g., `DistrictData.adapt`). | `any` | ❌ |
308
- | `mapper` | A model adapter used to map outgoing data before sending it to the server (e.g., `DistrictData.mapper`). | `any` | ❌ |
309
- | `polling` | Enables periodic polling, where the request will be made every specified number of seconds. | `number` (seconds) | ❌ |
310
- | `retry` | Retry logic using `RetryOptions`, which includes: <br> - `times`: Number of retry attempts. <br> - `delay`: Delay in milliseconds between retries. | `RetryOptions` | ✅ |
311
- | `stream` | A flag to indicate whether the request expects a stream of data from the server. | `boolean` | ❌ |
312
- | `displayError` | A flag to indicate whether to present the error from the request in a snackbar notification. | `boolean` | ✅ |
594
+ ## 📋 API Reference
313
595
 
596
+ ### Core Models
314
597
 
315
- ### Additional Observables for Request Status
316
- - countdown$: If polling is active, this property gives feedback on when the next request will take place. It starts from the specified time in seconds and counts down to 0, triggering the next request and restarting the countdown.
317
- - error$: This returns any HTTP error that occurs during the request.
318
- - isPending$: This boolean value indicates whether the request is pending (true) or has been completed (false).
319
- - data$: You can access the data fetched in the request using the data$ observable. This provides the response from the server, which can be used for further processing or displaying in the UI.
598
+ All models follow the `<Name>Interface` + `<Name>Model` pattern with static `adapt()` methods.
320
599
 
321
- ## Importing Module forRoot() Configuration
600
+ | Model | Description | Documentation |
601
+ |-------|-------------|---------------|
602
+ | **ApiRequest** | HTTP request configuration | [`Models Guide`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/MODELS_README.md#apirequest) |
603
+ | **RetryOptions** | Retry behavior settings | [`Models Guide`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/MODELS_README.md#retryoptions) |
604
+ | **DataType** | Data structure type (ARRAY, OBJECT) | [`Models Guide`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/MODELS_README.md#datatype) |
605
+ | **DatabaseStorage** | IndexedDB configuration | [`Models Guide`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/MODELS_README.md#databasestorage) |
606
+ | **SettingOptions** | Storage settings | [`Models Guide`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/MODELS_README.md#settingoptions) |
607
+ | **WSOptions** | WebSocket configuration | [`Models Guide`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/MODELS_README.md#wsoptions) |
608
+ | **ConfigOptions** | Global library configuration | [`Models Guide`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/MODELS_README.md#configoptions) |
609
+ | **StateStorageOptions** | Persistent state configuration | [`Models Guide`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/MODELS_README.md#statestorageoptions) |
610
+ | **TableSchemaDef** | Database table schema | [`Models Guide`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/MODELS_README.md#tableschemadef) |
611
+ | **ChannelMessage** | WebSocket message structure | [`Models Guide`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/MODELS_README.md#channelmessage) |
612
+ | **WSUser** | WebSocket user info | [`Models Guide`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/MODELS_README.md#wsuser) |
322
613
 
614
+ ### Enums
323
615
 
324
- # Available Interceptors
616
+ | Enum | Values | Description |
617
+ |------|--------|-------------|
618
+ | **DataType** | `ARRAY`, `OBJECT` | Response data structure |
619
+ | **StreamType** | `NDJSON`, `SSE` | Streaming response types |
620
+ | **StorageType** | `GLOBAL`, `SESSION` | Storage scope |
621
+ | **CommunicationType** | `subscribe`, `unsubscribe`, `message`, `notification`, etc. | WebSocket message types |
622
+ | **ChannelType** | `SYS`, `PUB`, `MES` | Channel prefixes |
623
+ | **ToastColors** | `SUCCESS`, `WARN`, `ERROR`, `INFO` | Toast notification colors |
325
624
 
326
- There are 3 interceptors that you can import into your project for api requests.
625
+ ### Configuration Tokens
327
626
 
328
- You may add these interceptors in your `AppModule` file as providers and import them into as providers.
627
+ | Token | Type | Purpose |
628
+ |-------|------|---------|
629
+ | **CONFIG_SETTINGS_TOKEN** | `ConfigOptions` | Global library configuration |
630
+ | **APP_ID** | `string` | Application ID for encryption |
329
631
 
330
- ```ts
331
- providers: [
332
- { provide: HTTP_INTERCEPTORS, useClass: WithCredentialsInterceptor, multi: true },
333
- { provide: HTTP_INTERCEPTORS, useClass: RequestHeadersInterceptor, multi: true },
334
- { provide: HTTP_INTERCEPTORS, useClass: RequestErrorInterceptor, multi: true }
335
- ],
336
- ```
337
-
338
- Or you can use all intercepts above by importing the `HttpRequestManagerModule` in your `AppModule`
632
+ ### Complete API Documentation
339
633
 
340
- - **RequestErrorInterceptor**
634
+ For comprehensive API reference with all methods, parameters, and examples:
635
+ 📋 **[Complete API Reference](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/COMPLETE_API_REFERENCE.md)**
341
636
 
342
- This interceptor handles errors of type 400 and 500. This interceptor is applicable when you need to display UI for the user to indicate a server or request error has occurred. The Status and Error Text is displayed in a `toast-message` modal.
637
+ ## 🤝 Contributing
343
638
 
344
- - **WithCredentialsInterceptor**
639
+ This library is designed to be enterprise-ready and production-safe. All features include comprehensive error handling, TypeScript support, and extensive configuration options.
345
640
 
346
- Adds to your request header
641
+ ## 📄 License
347
642
 
348
- ```json
349
- { credentials: true }
350
- ```
643
+ This project is part of the Angular application library suite.
351
644
 
352
- - **RequestHeadersInterceptor**
645
+ ---
353
646
 
354
- Adds to your request - current local `language` (i18n) selection and `current date` to every request
355
-
356
- ```json
357
- {
358
- 'Content-Type': 'application/json',
359
- 'Accept-Language': this.language || 'en-CA',
360
- 'Current-Date': this.currentDate
361
- }
362
- ```
647
+ **Need help?** Check out the detailed documentation for each service, explore the demo examples, or review the architecture documentation for implementation guidance.