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.
- package/README.md +585 -300
- package/fesm2022/http-request-manager.mjs +9434 -3133
- package/fesm2022/http-request-manager.mjs.map +1 -1
- package/package.json +7 -9
- package/types/http-request-manager.d.ts +3546 -0
- package/esm2022/http-request-manager.mjs +0 -5
- package/esm2022/lib/http-request-manager.module.mjs +0 -186
- package/esm2022/lib/http-request-services-demo/database-data-demo/database-data-demo.component.mjs +0 -71
- package/esm2022/lib/http-request-services-demo/http-request-services-demo.component.mjs +0 -45
- package/esm2022/lib/http-request-services-demo/local-storage-demo/local-storage-demo.component.mjs +0 -173
- package/esm2022/lib/http-request-services-demo/local-storage-signals-demo/local-storage-signals-demo.component.mjs +0 -184
- package/esm2022/lib/http-request-services-demo/request-manager-demo/file-downloader/download-file/download-file.component.mjs +0 -80
- package/esm2022/lib/http-request-services-demo/request-manager-demo/file-downloader/file-download.module.mjs +0 -42
- package/esm2022/lib/http-request-services-demo/request-manager-demo/file-downloader/file-downloader.component.mjs +0 -88
- package/esm2022/lib/http-request-services-demo/request-manager-demo/file-downloader/models/download-labels-model.mjs +0 -11
- package/esm2022/lib/http-request-services-demo/request-manager-demo/file-downloader/spinner/spinner.component.mjs +0 -29
- package/esm2022/lib/http-request-services-demo/request-manager-demo/models/sample-ai-prompt.mjs +0 -9
- package/esm2022/lib/http-request-services-demo/request-manager-demo/models/sample-client-info.mjs +0 -12
- package/esm2022/lib/http-request-services-demo/request-manager-demo/models/sample-mapper-client-info.mjs +0 -14
- package/esm2022/lib/http-request-services-demo/request-manager-demo/request-manager-demo.component.mjs +0 -315
- package/esm2022/lib/http-request-services-demo/request-manager-state-demo/request-manager-state-demo.component.mjs +0 -270
- package/esm2022/lib/http-request-services-demo/request-manager-state-demo/services/state-manager-demo.service.mjs +0 -67
- package/esm2022/lib/http-request-services-demo/request-signals-manager-demo/models/sample-ai-prompt.mjs +0 -9
- package/esm2022/lib/http-request-services-demo/request-signals-manager-demo/models/sample-client-info.mjs +0 -12
- package/esm2022/lib/http-request-services-demo/request-signals-manager-demo/models/sample-mapper-client-info.mjs +0 -14
- package/esm2022/lib/http-request-services-demo/request-signals-manager-demo/request-signals-manager-demo.component.mjs +0 -336
- package/esm2022/lib/index.mjs +0 -4
- package/esm2022/lib/interceptors/credentials.interceptor.mjs +0 -14
- package/esm2022/lib/interceptors/index.mjs +0 -5
- package/esm2022/lib/interceptors/models/error-settings.model.mjs +0 -10
- package/esm2022/lib/interceptors/proxy-debugger.interceptor.mjs +0 -47
- package/esm2022/lib/interceptors/request-error.interceptor.mjs +0 -49
- package/esm2022/lib/interceptors/request-header.interceptor.mjs +0 -41
- package/esm2022/lib/models/config-http-options.model.mjs +0 -18
- package/esm2022/lib/models/config-local-storage-options.model.mjs +0 -12
- package/esm2022/lib/models/config-options.model.mjs +0 -12
- package/esm2022/lib/models/config-token.model.mjs +0 -8
- package/esm2022/lib/models/data-type.enum.mjs +0 -7
- package/esm2022/lib/models/database-storage.model.mjs +0 -10
- package/esm2022/lib/models/index.mjs +0 -7
- package/esm2022/lib/models/retry-options.model.mjs +0 -10
- package/esm2022/lib/services/database-manager-services/database.manager.service.mjs +0 -119
- package/esm2022/lib/services/database-manager-services/db.storage.service.mjs +0 -143
- package/esm2022/lib/services/database-manager-services/index.mjs +0 -4
- package/esm2022/lib/services/database-manager-services/models/table-schema.mjs +0 -20
- package/esm2022/lib/services/index.mjs +0 -6
- package/esm2022/lib/services/local-storage-manager-service/index.mjs +0 -4
- package/esm2022/lib/services/local-storage-manager-service/local-storage-manager.service.mjs +0 -302
- package/esm2022/lib/services/local-storage-manager-service/local-storage-signals-manager.service.mjs +0 -277
- package/esm2022/lib/services/local-storage-manager-service/models/global-store-options.model.mjs +0 -13
- package/esm2022/lib/services/local-storage-manager-service/models/index.mjs +0 -6
- package/esm2022/lib/services/local-storage-manager-service/models/setting-options.model.mjs +0 -17
- package/esm2022/lib/services/local-storage-manager-service/models/storage-data.model.mjs +0 -10
- package/esm2022/lib/services/local-storage-manager-service/models/storage-option.model.mjs +0 -12
- package/esm2022/lib/services/local-storage-manager-service/models/storage-type.enum.mjs +0 -7
- package/esm2022/lib/services/request-manager-services/http-manager-signals.service.mjs +0 -199
- package/esm2022/lib/services/request-manager-services/http-manager.service.mjs +0 -207
- package/esm2022/lib/services/request-manager-services/index.mjs +0 -6
- package/esm2022/lib/services/request-manager-services/request-signals.service.mjs +0 -170
- package/esm2022/lib/services/request-manager-services/request.service.mjs +0 -191
- package/esm2022/lib/services/request-manager-services/rxjs-operators/countdown.mjs +0 -9
- package/esm2022/lib/services/request-manager-services/rxjs-operators/delay-retry.mjs +0 -10
- package/esm2022/lib/services/request-manager-services/rxjs-operators/index.mjs +0 -5
- package/esm2022/lib/services/request-manager-services/rxjs-operators/request-polling.mjs +0 -33
- package/esm2022/lib/services/request-manager-services/rxjs-operators/request-streaming.mjs +0 -19
- package/esm2022/lib/services/request-manager-state-service/http-manager-state.store.mjs +0 -360
- package/esm2022/lib/services/request-manager-state-service/index.mjs +0 -3
- package/esm2022/lib/services/request-manager-state-service/models/api-request.model.mjs +0 -21
- package/esm2022/lib/services/request-manager-state-service/models/index.mjs +0 -3
- package/esm2022/lib/services/request-manager-state-service/models/request-options.model.mjs +0 -10
- package/esm2022/lib/services/request-manager-state-service/models/ws-options.model.mjs +0 -12
- package/esm2022/lib/services/utils/app.service.mjs +0 -26
- package/esm2022/lib/services/utils/encryption/asymmetrical-encryption.service.mjs +0 -186
- package/esm2022/lib/services/utils/encryption/encryption-test.service.mjs +0 -35
- package/esm2022/lib/services/utils/encryption/index.mjs +0 -4
- package/esm2022/lib/services/utils/encryption/random.mjs +0 -52
- package/esm2022/lib/services/utils/encryption/symmetrical-encryption.service.mjs +0 -77
- package/esm2022/lib/services/utils/headers.service.mjs +0 -21
- package/esm2022/lib/services/utils/index.mjs +0 -6
- package/esm2022/lib/services/utils/object-merger.service.mjs +0 -70
- package/esm2022/lib/services/utils/path-query.service.mjs +0 -54
- package/esm2022/lib/services/utils/utils.service.mjs +0 -155
- package/esm2022/lib/services/ws-manager-service/models/assortment-data.model.mjs +0 -10
- package/esm2022/lib/services/ws-manager-service/websocket.service.mjs +0 -133
- package/esm2022/public-api.mjs +0 -11
- package/http-request-manager-19.0.0.tgz +0 -0
- package/index.d.ts +0 -5
- package/lib/http-request-manager.module.d.ts +0 -35
- package/lib/http-request-services-demo/database-data-demo/database-data-demo.component.d.ts +0 -19
- package/lib/http-request-services-demo/http-request-services-demo.component.d.ts +0 -32
- package/lib/http-request-services-demo/local-storage-demo/local-storage-demo.component.d.ts +0 -56
- package/lib/http-request-services-demo/local-storage-signals-demo/local-storage-signals-demo.component.d.ts +0 -55
- package/lib/http-request-services-demo/request-manager-demo/file-downloader/download-file/download-file.component.d.ts +0 -26
- package/lib/http-request-services-demo/request-manager-demo/file-downloader/file-download.module.d.ts +0 -13
- package/lib/http-request-services-demo/request-manager-demo/file-downloader/file-downloader.component.d.ts +0 -27
- package/lib/http-request-services-demo/request-manager-demo/file-downloader/models/download-labels-model.d.ts +0 -12
- package/lib/http-request-services-demo/request-manager-demo/file-downloader/spinner/spinner.component.d.ts +0 -16
- package/lib/http-request-services-demo/request-manager-demo/models/sample-ai-prompt.d.ts +0 -8
- package/lib/http-request-services-demo/request-manager-demo/models/sample-client-info.d.ts +0 -14
- package/lib/http-request-services-demo/request-manager-demo/models/sample-mapper-client-info.d.ts +0 -14
- package/lib/http-request-services-demo/request-manager-demo/request-manager-demo.component.d.ts +0 -107
- package/lib/http-request-services-demo/request-manager-state-demo/request-manager-state-demo.component.d.ts +0 -122
- package/lib/http-request-services-demo/request-manager-state-demo/services/state-manager-demo.service.d.ts +0 -15
- package/lib/http-request-services-demo/request-signals-manager-demo/models/sample-ai-prompt.d.ts +0 -8
- package/lib/http-request-services-demo/request-signals-manager-demo/models/sample-client-info.d.ts +0 -14
- package/lib/http-request-services-demo/request-signals-manager-demo/models/sample-mapper-client-info.d.ts +0 -14
- package/lib/http-request-services-demo/request-signals-manager-demo/request-signals-manager-demo.component.d.ts +0 -106
- package/lib/index.d.ts +0 -3
- package/lib/interceptors/credentials.interceptor.d.ts +0 -8
- package/lib/interceptors/index.d.ts +0 -4
- package/lib/interceptors/models/error-settings.model.d.ts +0 -10
- package/lib/interceptors/proxy-debugger.interceptor.d.ts +0 -12
- package/lib/interceptors/request-error.interceptor.d.ts +0 -10
- package/lib/interceptors/request-header.interceptor.d.ts +0 -15
- package/lib/models/config-http-options.model.d.ts +0 -21
- package/lib/models/config-local-storage-options.model.d.ts +0 -13
- package/lib/models/config-options.model.d.ts +0 -12
- package/lib/models/config-token.model.d.ts +0 -8
- package/lib/models/data-type.enum.d.ts +0 -5
- package/lib/models/database-storage.model.d.ts +0 -10
- package/lib/models/index.d.ts +0 -6
- package/lib/models/retry-options.model.d.ts +0 -10
- package/lib/services/database-manager-services/database.manager.service.d.ts +0 -31
- package/lib/services/database-manager-services/db.storage.service.d.ts +0 -26
- package/lib/services/database-manager-services/index.d.ts +0 -3
- package/lib/services/database-manager-services/models/table-schema.d.ts +0 -11
- package/lib/services/index.d.ts +0 -4
- package/lib/services/local-storage-manager-service/index.d.ts +0 -3
- package/lib/services/local-storage-manager-service/local-storage-manager.service.d.ts +0 -86
- package/lib/services/local-storage-manager-service/local-storage-signals-manager.service.d.ts +0 -64
- package/lib/services/local-storage-manager-service/models/global-store-options.model.d.ts +0 -15
- package/lib/services/local-storage-manager-service/models/index.d.ts +0 -5
- package/lib/services/local-storage-manager-service/models/setting-options.model.d.ts +0 -15
- package/lib/services/local-storage-manager-service/models/storage-data.model.d.ts +0 -10
- package/lib/services/local-storage-manager-service/models/storage-option.model.d.ts +0 -13
- package/lib/services/local-storage-manager-service/models/storage-type.enum.d.ts +0 -5
- package/lib/services/request-manager-services/http-manager-signals.service.d.ts +0 -38
- package/lib/services/request-manager-services/http-manager.service.d.ts +0 -41
- package/lib/services/request-manager-services/index.d.ts +0 -4
- package/lib/services/request-manager-services/request-signals.service.d.ts +0 -26
- package/lib/services/request-manager-services/request.service.d.ts +0 -28
- package/lib/services/request-manager-services/rxjs-operators/countdown.d.ts +0 -2
- package/lib/services/request-manager-services/rxjs-operators/delay-retry.d.ts +0 -2
- package/lib/services/request-manager-services/rxjs-operators/index.d.ts +0 -4
- package/lib/services/request-manager-services/rxjs-operators/request-polling.d.ts +0 -2
- package/lib/services/request-manager-services/rxjs-operators/request-streaming.d.ts +0 -2
- package/lib/services/request-manager-state-service/http-manager-state.store.d.ts +0 -64
- package/lib/services/request-manager-state-service/index.d.ts +0 -2
- package/lib/services/request-manager-state-service/models/api-request.model.d.ts +0 -30
- package/lib/services/request-manager-state-service/models/index.d.ts +0 -2
- package/lib/services/request-manager-state-service/models/request-options.model.d.ts +0 -10
- package/lib/services/request-manager-state-service/models/ws-options.model.d.ts +0 -14
- package/lib/services/utils/app.service.d.ts +0 -8
- package/lib/services/utils/encryption/asymmetrical-encryption.service.d.ts +0 -17
- package/lib/services/utils/encryption/encryption-test.service.d.ts +0 -10
- package/lib/services/utils/encryption/index.d.ts +0 -3
- package/lib/services/utils/encryption/random.d.ts +0 -7
- package/lib/services/utils/encryption/symmetrical-encryption.service.d.ts +0 -14
- package/lib/services/utils/headers.service.d.ts +0 -10
- package/lib/services/utils/index.d.ts +0 -5
- package/lib/services/utils/object-merger.service.d.ts +0 -14
- package/lib/services/utils/path-query.service.d.ts +0 -11
- package/lib/services/utils/utils.service.d.ts +0 -24
- package/lib/services/ws-manager-service/models/assortment-data.model.d.ts +0 -10
- package/lib/services/ws-manager-service/websocket.service.d.ts +0 -21
- package/public-api.d.ts +0 -7
package/README.md
CHANGED
|
@@ -1,362 +1,647 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
###
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
###
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
1
|
+
<!-- markdownlint-disable MD013 MD060 -->
|
|
2
|
+
|
|
3
|
+
# HTTP Request Manager - Angular Library
|
|
4
|
+
|
|
5
|
+
[](https://www.typescriptlang.org/)
|
|
6
|
+
[](https://angular.io/)
|
|
7
|
+
[](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
|
-
|
|
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
|
-
|
|
129
|
-
|
|
90
|
+
```typescript
|
|
91
|
+
// app.module.ts
|
|
92
|
+
import { APP_ID } from '@angular/core';
|
|
130
93
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
94
|
+
@NgModule({
|
|
95
|
+
providers: [
|
|
96
|
+
{ provide: APP_ID, useValue: "your-unique-guid-here" }
|
|
97
|
+
]
|
|
98
|
+
})
|
|
99
|
+
export class AppModule { }
|
|
100
|
+
```
|
|
134
101
|
|
|
135
|
-
|
|
136
|
-
|
|
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
|
-
|
|
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
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
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
|
-
|
|
165
|
-
|
|
166
|
-
|
|
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
|
-
|
|
360
|
+
## 🔧 Interceptors
|
|
171
361
|
|
|
172
|
-
|
|
362
|
+
The library provides several HTTP interceptors that are automatically configured:
|
|
173
363
|
|
|
174
|
-
|
|
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
|
-
|
|
366
|
+
### Available Interceptors
|
|
178
367
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
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
|
-
|
|
185
|
-
const PARAMS = {
|
|
186
|
-
sortBy: 'asc',
|
|
187
|
-
filter: ['samples', 'testing']
|
|
188
|
-
}
|
|
375
|
+
### Manual Configuration
|
|
189
376
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
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
|
-
|
|
204
|
-
|
|
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
|
-
|
|
209
|
-
|
|
393
|
+
const customSettings: ErrorSettings = {
|
|
394
|
+
displayError: true,
|
|
395
|
+
displayWarning: true,
|
|
396
|
+
customHandler: (error) => {
|
|
397
|
+
// Custom error handling logic
|
|
398
|
+
}
|
|
399
|
+
};
|
|
400
|
+
```
|
|
210
401
|
|
|
211
|
-
|
|
212
|
-
The structure would be: Component extends `HTTPManagerService`
|
|
402
|
+
## 📚 Detailed Documentation
|
|
213
403
|
|
|
214
|
-
|
|
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
|
-
|
|
218
|
-
super()
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
```
|
|
406
|
+
### Detailed Docs for Angular 14-18
|
|
222
407
|
|
|
223
|
-
|
|
224
|
-
|
|
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
|
-
|
|
227
|
-
@Injectable({
|
|
228
|
-
providedIn: 'root'
|
|
229
|
-
})
|
|
230
|
-
export class myAPIService extends HTTPManagerService<any> {
|
|
519
|
+
### Sample Models
|
|
231
520
|
|
|
232
|
-
|
|
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
|
-
|
|
529
|
+
## 📖 Migration Guide
|
|
240
530
|
|
|
241
|
-
|
|
531
|
+
### From HttpClient to HTTPManagerService
|
|
242
532
|
|
|
243
|
-
|
|
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
|
-
|
|
535
|
+
```typescript
|
|
536
|
+
http.get('api/users').subscribe(users => {
|
|
537
|
+
this.users = users;
|
|
538
|
+
this.loading = false;
|
|
539
|
+
});
|
|
540
|
+
```
|
|
248
541
|
|
|
249
|
-
|
|
250
|
-
const apiOptions = ApiRequest.adapt({
|
|
251
|
-
server: ['myApiUrl', 'rest', 'clients']
|
|
252
|
-
})
|
|
542
|
+
**After:**
|
|
253
543
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
}
|
|
544
|
+
```typescript
|
|
545
|
+
httpManager.getRequest(
|
|
546
|
+
ApiRequest.adapt({ path: ['users'] })
|
|
547
|
+
).subscribe();
|
|
259
548
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
```
|
|
549
|
+
data$ = this.httpManager.data$;
|
|
550
|
+
isLoading$ = this.httpManager.isPending$;
|
|
551
|
+
```
|
|
264
552
|
|
|
265
|
-
|
|
553
|
+
### From Manual State to HTTPManagerStateService
|
|
266
554
|
|
|
267
|
-
|
|
555
|
+
**Before:**
|
|
268
556
|
|
|
269
|
-
|
|
557
|
+
```typescript
|
|
558
|
+
users: User[] = [];
|
|
559
|
+
loading = false;
|
|
270
560
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
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
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
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
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
625
|
+
### Configuration Tokens
|
|
327
626
|
|
|
328
|
-
|
|
627
|
+
| Token | Type | Purpose |
|
|
628
|
+
|-------|------|---------|
|
|
629
|
+
| **CONFIG_SETTINGS_TOKEN** | `ConfigOptions` | Global library configuration |
|
|
630
|
+
| **APP_ID** | `string` | Application ID for encryption |
|
|
329
631
|
|
|
330
|
-
|
|
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
|
-
|
|
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
|
-
|
|
637
|
+
## 🤝 Contributing
|
|
343
638
|
|
|
344
|
-
-
|
|
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
|
-
|
|
641
|
+
## 📄 License
|
|
347
642
|
|
|
348
|
-
|
|
349
|
-
{ credentials: true }
|
|
350
|
-
```
|
|
643
|
+
This project is part of the Angular application library suite.
|
|
351
644
|
|
|
352
|
-
|
|
645
|
+
---
|
|
353
646
|
|
|
354
|
-
|
|
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.
|