http-request-manager 18.16.6 → 18.16.11
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
CHANGED
|
@@ -16,12 +16,13 @@ This README is the main documentation hub for the library. Detailed service guid
|
|
|
16
16
|
|
|
17
17
|
| Feature | Description | Angular 14-18 / Observable + NgRx | Angular 19+ / Signals |
|
|
18
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/
|
|
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_SIGNALS_MANAGER_README.md) |
|
|
20
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/STORE_STATE_MANAGER_README.md) | [`StoreStateManagerSignalsService`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/STORE_STATE_SIGNALS_README.md) |
|
|
21
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), [`WebSocketMessageService`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/WEBSOCKET_MESSAGE_SERVICE.md), and [`MessageTrackerService`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/MESSAGE_TRACKER_README.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
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
23
|
| **🗄️ Database Queries** | MySQL-syntax SQL queries on IndexedDB — the recommended way to query data | [`DexieSqlService`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/SQL_DIXIE_README.md) | Uses the same service |
|
|
24
24
|
| **⚡ Utility Functions** | JSON handling, encryption, headers, validation, logging | [`UtilsService`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/UTILS_README.md), [`Encryption`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/ENCRYPTION_README.md), [`Logger`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/LOGGER_README.md) | Uses the same utility layer |
|
|
25
|
+
| **🔧 Utility Services** | Headers, path/query, merging, base request classes | [`Utility Services`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/UTILS_SERVICES_README.md) | Internal and helper services |
|
|
25
26
|
|
|
26
27
|
### Key Benefits
|
|
27
28
|
|
|
@@ -286,6 +287,42 @@ export class AppModule { }
|
|
|
286
287
|
| `times` | `number` | Number of retry attempts | `0` |
|
|
287
288
|
| `delay` | `number` | Delay between retries (seconds) | `3` |
|
|
288
289
|
|
|
290
|
+
#### WebSocket Options (`WSOptions`)
|
|
291
|
+
|
|
292
|
+
| Option | Type | Description | Default |
|
|
293
|
+
|--------|------|-------------|---------|
|
|
294
|
+
| `id` | `string` | Channel identifier (used to construct channel names) | `''` |
|
|
295
|
+
| `wsServer` | `string` | WebSocket server URL | `''` |
|
|
296
|
+
| `jwtToken` | `string` | JWT token for authentication | `''` |
|
|
297
|
+
| `permissions` | `string[]` | Permission levels for the connection | `[]` |
|
|
298
|
+
| `channels` | `string[]` | Additional channels to subscribe to | `[]` |
|
|
299
|
+
| `user` | `any` | User information for presence tracking | `undefined` |
|
|
300
|
+
| `retry` | `RetryOptions` | Retry configuration for reconnection | `{ times: 0, delay: 3 }` |
|
|
301
|
+
|
|
302
|
+
### Injection Tokens
|
|
303
|
+
|
|
304
|
+
| Token | Type | Purpose | Required |
|
|
305
|
+
|-------|------|---------|----------|
|
|
306
|
+
| `CONFIG_SETTINGS_TOKEN` | `ConfigOptions` | Global library configuration (provided by `forRoot()`) | Yes (via `forRoot()`) |
|
|
307
|
+
| `APP_ID` | `string` | Unique application ID for encryption key generation | Yes (if using encryption) |
|
|
308
|
+
|
|
309
|
+
### Providing APP_ID
|
|
310
|
+
|
|
311
|
+
If using encryption features (localStorage encryption, AES/RSA encryption), you must provide a unique `APP_ID`:
|
|
312
|
+
|
|
313
|
+
```typescript
|
|
314
|
+
import { APP_ID } from '@angular/core';
|
|
315
|
+
|
|
316
|
+
@NgModule({
|
|
317
|
+
providers: [
|
|
318
|
+
{ provide: APP_ID, useValue: 'your-unique-app-guid-here' }
|
|
319
|
+
]
|
|
320
|
+
})
|
|
321
|
+
export class AppModule { }
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
> **Important:** The `APP_ID` is used as the encryption key for `SymmetricalEncryptionService`. Use a strong, unique value per application.
|
|
325
|
+
|
|
289
326
|
## 📚 Services Overview
|
|
290
327
|
|
|
291
328
|
### Angular 14-18: Observable + NgRx Services
|
|
@@ -305,7 +342,7 @@ export class AppModule { }
|
|
|
305
342
|
|
|
306
343
|
| Service | Description | Use Case |
|
|
307
344
|
|---------|-------------|----------|
|
|
308
|
-
| [`HTTPManagerSignalsService`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/
|
|
345
|
+
| [`HTTPManagerSignalsService`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/HTTP_SIGNALS_MANAGER_README.md) | Signal-based HTTP client for modern reactive UI | Modern Angular with Signals |
|
|
309
346
|
| [`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 |
|
|
310
347
|
| [`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 |
|
|
311
348
|
| [`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 |
|
|
@@ -316,6 +353,7 @@ export class AppModule { }
|
|
|
316
353
|
| Service | Description | Use Case |
|
|
317
354
|
|---------|-------------|----------|
|
|
318
355
|
| [`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 |
|
|
356
|
+
| [`Utility Services`](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/UTILS_SERVICES_README.md) | Headers, path/query, merging, base request classes | Internal and helper services |
|
|
319
357
|
|
|
320
358
|
### Common Use Cases
|
|
321
359
|
|
|
@@ -355,7 +393,7 @@ All detailed service guides live in `src/docs/`. Use this README as the entry po
|
|
|
355
393
|
| Category | Documentation |
|
|
356
394
|
|----------|---------------|
|
|
357
395
|
| Overview | [Signal Services Overview](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/SIGNAL_SERVICES_README.md) |
|
|
358
|
-
| HTTP | [HTTP Manager Signals](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/
|
|
396
|
+
| HTTP | [HTTP Manager Signals](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/HTTP_SIGNALS_MANAGER_README.md) |
|
|
359
397
|
| State | [Store State Signals](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/STORE_STATE_SIGNALS_README.md) |
|
|
360
398
|
| 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) |
|
|
361
399
|
| Persistence | [Local Storage Signals](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/LOCAL_STORAGE_SIGNALS_README.md) |
|
|
@@ -481,7 +519,7 @@ For in-depth documentation on each service and component, refer to the following
|
|
|
481
519
|
| Documentation | Description |
|
|
482
520
|
|---------------|-------------|
|
|
483
521
|
| 📖 [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 |
|
|
484
|
-
| 📖 [HTTP Manager Signals Service](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/
|
|
522
|
+
| 📖 [HTTP Manager Signals Service](https://github.com/micheleboni/npm-angular/tree/main/projects/http-request-manager/src/docs/HTTP_SIGNALS_MANAGER_README.md) | Signal-based HTTP client for modern reactive UI with Angular Signals |
|
|
485
523
|
| 📖 [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 |
|
|
486
524
|
| 📖 [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 |
|
|
487
525
|
| 📖 [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 |
|
|
@@ -908,54 +908,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
908
908
|
}]
|
|
909
909
|
}], ctorParameters: () => [] });
|
|
910
910
|
|
|
911
|
-
class NormalizedRequestOptionsModel {
|
|
912
|
-
constructor(pathKey = '', query = {}, hasQuery = false) {
|
|
913
|
-
this.pathKey = pathKey;
|
|
914
|
-
this.query = query;
|
|
915
|
-
this.hasQuery = hasQuery;
|
|
916
|
-
}
|
|
917
|
-
static adapt(item) {
|
|
918
|
-
return new NormalizedRequestOptionsModel(item?.pathKey, item?.query, item?.hasQuery);
|
|
919
|
-
}
|
|
920
|
-
}
|
|
921
|
-
|
|
922
|
-
class PathTrackerStateModel {
|
|
923
|
-
constructor(consumedValuesByKey = {}, watchExpiresAt) {
|
|
924
|
-
this.consumedValuesByKey = consumedValuesByKey;
|
|
925
|
-
this.watchExpiresAt = watchExpiresAt;
|
|
926
|
-
}
|
|
927
|
-
static adapt(item) {
|
|
928
|
-
return new PathTrackerStateModel(item?.consumedValuesByKey && typeof item.consumedValuesByKey === 'object' ? item.consumedValuesByKey : {}, item?.watchExpiresAt);
|
|
929
|
-
}
|
|
930
|
-
}
|
|
931
|
-
|
|
932
|
-
class QueryTrackerStateModel {
|
|
933
|
-
constructor(paths = {}) {
|
|
934
|
-
this.paths = paths;
|
|
935
|
-
}
|
|
936
|
-
static adapt(item) {
|
|
937
|
-
const paths = {};
|
|
938
|
-
if (item?.paths && typeof item.paths === 'object') {
|
|
939
|
-
Object.keys(item.paths).forEach((key) => {
|
|
940
|
-
paths[key] = PathTrackerStateModel.adapt(item.paths[key]);
|
|
941
|
-
});
|
|
942
|
-
}
|
|
943
|
-
return new QueryTrackerStateModel(paths);
|
|
944
|
-
}
|
|
945
|
-
}
|
|
946
|
-
|
|
947
|
-
class QueryParamsTrackerOptionsModel {
|
|
948
|
-
constructor(mode, watchParams, watchExpiresAt, watchParamsExpire) {
|
|
949
|
-
this.mode = mode;
|
|
950
|
-
this.watchParams = watchParams;
|
|
951
|
-
this.watchExpiresAt = watchExpiresAt;
|
|
952
|
-
this.watchParamsExpire = watchParamsExpire;
|
|
953
|
-
}
|
|
954
|
-
static adapt(item) {
|
|
955
|
-
return new QueryParamsTrackerOptionsModel(item?.mode, Array.isArray(item?.watchParams) ? item.watchParams : [], item?.watchExpiresAt, item?.watchParamsExpire);
|
|
956
|
-
}
|
|
957
|
-
}
|
|
958
|
-
|
|
959
911
|
class StreamConfigModel {
|
|
960
912
|
constructor(streamType = StreamType.AI_STREAMING, totalHeader = 'X-Total-Count') {
|
|
961
913
|
this.streamType = streamType;
|
|
@@ -2581,7 +2533,13 @@ class WebSocketMessageService {
|
|
|
2581
2533
|
return false;
|
|
2582
2534
|
}
|
|
2583
2535
|
const channel = `${ChannelType$1.STATE}-${path.join('/')}`;
|
|
2584
|
-
|
|
2536
|
+
// Send flat payload to avoid double-nesting:
|
|
2537
|
+
// sendMessageInChannel wraps content in { type, subscribedChannel, content },
|
|
2538
|
+
// so we pass { method, path, user } directly instead of the full StateMessage
|
|
2539
|
+
this.wsManagerService.sendMessageInChannel(channel, {
|
|
2540
|
+
...payload.content,
|
|
2541
|
+
user: payload.sessionId
|
|
2542
|
+
});
|
|
2585
2543
|
return true;
|
|
2586
2544
|
}
|
|
2587
2545
|
/**
|
|
@@ -5156,17 +5114,15 @@ class ApiRequest {
|
|
|
5156
5114
|
}
|
|
5157
5115
|
|
|
5158
5116
|
class RequestOptions {
|
|
5159
|
-
constructor(path = [], headers = {}, forceRefresh, ignoreQueryParams, queryParamsExpiresIn
|
|
5117
|
+
constructor(path = [], headers = {}, forceRefresh, ignoreQueryParams, queryParamsExpiresIn) {
|
|
5160
5118
|
this.path = path;
|
|
5161
5119
|
this.headers = headers;
|
|
5162
5120
|
this.forceRefresh = forceRefresh;
|
|
5163
5121
|
this.ignoreQueryParams = ignoreQueryParams;
|
|
5164
5122
|
this.queryParamsExpiresIn = queryParamsExpiresIn;
|
|
5165
|
-
this.watchParams = watchParams;
|
|
5166
|
-
this.watchExpiresAt = watchExpiresAt;
|
|
5167
5123
|
}
|
|
5168
5124
|
static adapt(item) {
|
|
5169
|
-
return new RequestOptions(item?.path, item?.headers, item?.forceRefresh, Array.isArray(item?.ignoreQueryParams) ? item.ignoreQueryParams : [], item?.queryParamsExpiresIn
|
|
5125
|
+
return new RequestOptions(item?.path, item?.headers, item?.forceRefresh, Array.isArray(item?.ignoreQueryParams) ? item.ignoreQueryParams : [], item?.queryParamsExpiresIn);
|
|
5170
5126
|
}
|
|
5171
5127
|
}
|
|
5172
5128
|
|
|
@@ -6573,7 +6529,6 @@ class ChannelMessage {
|
|
|
6573
6529
|
}
|
|
6574
6530
|
}
|
|
6575
6531
|
|
|
6576
|
-
// import { QueryParamsTrackerService } from '../utils/query-params-tracker.service';
|
|
6577
6532
|
const API_OPTS = new InjectionToken('API_OPTS');
|
|
6578
6533
|
/**
|
|
6579
6534
|
* Channel type enum for different communication purposes
|
|
@@ -6616,7 +6571,6 @@ class HTTPManagerStateService extends ComponentStore {
|
|
|
6616
6571
|
this.localStorageManagerService = inject(LocalStorageManagerService);
|
|
6617
6572
|
this.utils = inject(UtilsService);
|
|
6618
6573
|
this.logger = inject(LoggerService);
|
|
6619
|
-
// private queryParamsTrackerService = inject(QueryParamsTrackerService)
|
|
6620
6574
|
this.error$ = this.httpManagerService.error$;
|
|
6621
6575
|
this.isPending$ = this.httpManagerService.isPending$.pipe(delay(1));
|
|
6622
6576
|
this.operationSuccess = new BehaviorSubject(null);
|
|
@@ -6783,23 +6737,26 @@ class HTTPManagerStateService extends ComponentStore {
|
|
|
6783
6737
|
break;
|
|
6784
6738
|
case 'statemanagerMessage':
|
|
6785
6739
|
case 'stateMangerMessage':
|
|
6786
|
-
// CRITICAL DEBUG: Log channel comparison
|
|
6787
6740
|
console.log('🔍 [STATE STORE] stateMangerMessage received:', {
|
|
6788
6741
|
messageChannel: message.channel,
|
|
6789
6742
|
ourChannel: this.apiOptions.ws?.id,
|
|
6790
6743
|
channelsMatch: message.channel === this.apiOptions.ws?.id,
|
|
6791
|
-
senderSessionId: message.data
|
|
6744
|
+
senderSessionId: message.data?.sessionId?.id || message.data?.sessionId,
|
|
6792
6745
|
ourSessionId: this.ownSessionId
|
|
6793
6746
|
});
|
|
6794
|
-
//
|
|
6795
|
-
//
|
|
6796
|
-
|
|
6747
|
+
// Handle both direct payload and StateMessage-wrapped payload:
|
|
6748
|
+
// Direct: { method, path, user }
|
|
6749
|
+
// Wrapped: { sessionId, content: { method, path } }
|
|
6750
|
+
const stateManagerSenderId = message.data?.sessionId?.id || message.data?.sessionId;
|
|
6751
|
+
const stateManagerContent = message.data?.content?.content
|
|
6752
|
+
? message.data.content.content
|
|
6753
|
+
: message.data?.content;
|
|
6797
6754
|
console.log('🔍 State Manager: Sender sessionId:', stateManagerSenderId, 'Own sessionId:', this.ownSessionId);
|
|
6798
6755
|
if (stateManagerSenderId !== this.ownSessionId) {
|
|
6799
6756
|
console.log('💬 State Manager Message:', message.data);
|
|
6800
|
-
console.log('📥 Fetching record with path:',
|
|
6757
|
+
console.log('📥 Fetching record with path:', stateManagerContent?.path, 'method:', stateManagerContent?.method);
|
|
6801
6758
|
this.userAction.next(message.data);
|
|
6802
|
-
this.fetchRecord(RequestOptions.adapt({ path:
|
|
6759
|
+
this.fetchRecord(RequestOptions.adapt({ path: stateManagerContent?.path }), stateManagerContent?.method);
|
|
6803
6760
|
}
|
|
6804
6761
|
else {
|
|
6805
6762
|
console.log('⏭️ Skipping own message (sessionId match)');
|
|
@@ -8179,6 +8136,9 @@ class HTTPManagerStateService extends ComponentStore {
|
|
|
8179
8136
|
this._requestCachePaths.set(tableName, this.resolvePath(options?.path).filter(p => typeof p === 'string' || typeof p === 'number').map(String));
|
|
8180
8137
|
this.localStorageManagerService.store$(tableName).pipe(take(1), tap((storeData) => {
|
|
8181
8138
|
const currentCache = storeData?.requestCache || {};
|
|
8139
|
+
const currentEntry = currentCache[type] || {};
|
|
8140
|
+
const currentQueryParams = { ...(currentEntry.queryParams || {}) };
|
|
8141
|
+
const currentQueryParamsExpires = currentEntry.queryParamsExpires ?? null;
|
|
8182
8142
|
this.localStorageManagerService.updateStore({
|
|
8183
8143
|
name: tableName,
|
|
8184
8144
|
data: {
|
|
@@ -8186,11 +8146,13 @@ class HTTPManagerStateService extends ComponentStore {
|
|
|
8186
8146
|
requestCache: {
|
|
8187
8147
|
...currentCache,
|
|
8188
8148
|
[type]: {
|
|
8189
|
-
...
|
|
8149
|
+
...currentEntry,
|
|
8190
8150
|
signature,
|
|
8191
8151
|
savedAt: Date.now(),
|
|
8192
8152
|
path: this.resolvePath(options?.path),
|
|
8193
|
-
headers: this.filterHeaders(options?.headers)
|
|
8153
|
+
headers: this.filterHeaders(options?.headers),
|
|
8154
|
+
queryParams: currentQueryParams,
|
|
8155
|
+
queryParamsExpires: currentQueryParamsExpires,
|
|
8194
8156
|
}
|
|
8195
8157
|
}
|
|
8196
8158
|
}
|
|
@@ -8210,7 +8172,6 @@ class HTTPManagerStateService extends ComponentStore {
|
|
|
8210
8172
|
}
|
|
8211
8173
|
}
|
|
8212
8174
|
if (Array.isArray(pathArray) && pathArray.length > 0) {
|
|
8213
|
-
// this.queryParamsTrackerService.clearTrackingForPath(pathArray.join('/'))
|
|
8214
8175
|
this._requestCachePaths.delete(tableName);
|
|
8215
8176
|
}
|
|
8216
8177
|
if (!storeData)
|
|
@@ -8356,11 +8317,11 @@ class HTTPManagerStateService extends ComponentStore {
|
|
|
8356
8317
|
accepted = true;
|
|
8357
8318
|
}
|
|
8358
8319
|
});
|
|
8359
|
-
|
|
8360
|
-
|
|
8361
|
-
|
|
8362
|
-
|
|
8363
|
-
|
|
8320
|
+
const newExpiry = this.trackerBuildExpiryEpoch(options?.queryParamsExpiresIn);
|
|
8321
|
+
if (newExpiry !== null) {
|
|
8322
|
+
queryParamsExpires = newExpiry;
|
|
8323
|
+
}
|
|
8324
|
+
if (accepted || newExpiry !== null) {
|
|
8364
8325
|
this.localStorageManagerService.store$(tableName).pipe(take(1), tap((latestStoreData) => {
|
|
8365
8326
|
const currentCache = latestStoreData?.requestCache || {};
|
|
8366
8327
|
const currentEntry = currentCache[type] || {};
|
|
@@ -10708,7 +10669,7 @@ class RequestManagerStateDemoComponent {
|
|
|
10708
10669
|
const apiOptions = ApiRequest.adapt({ ...currentOptions, path: pathReq });
|
|
10709
10670
|
return { apiOptions: apiOptions, path: pathReq };
|
|
10710
10671
|
}
|
|
10711
|
-
|
|
10672
|
+
parseIgnoreParams(value) {
|
|
10712
10673
|
if (!value || typeof value !== 'string') {
|
|
10713
10674
|
return [];
|
|
10714
10675
|
}
|
|
@@ -10717,25 +10678,16 @@ class RequestManagerStateDemoComponent {
|
|
|
10717
10678
|
.map((item) => item.trim())
|
|
10718
10679
|
.filter((item) => item.length > 0);
|
|
10719
10680
|
}
|
|
10720
|
-
normalizeWatchExpiry(value) {
|
|
10721
|
-
if (typeof value === 'undefined' || value === null || value === '') {
|
|
10722
|
-
return undefined;
|
|
10723
|
-
}
|
|
10724
|
-
if (typeof value === 'string' && value.trim().toLowerCase() === 'never') {
|
|
10725
|
-
return undefined;
|
|
10726
|
-
}
|
|
10727
|
-
return value;
|
|
10728
|
-
}
|
|
10729
10681
|
buildDemoRequestOptions(path, headers) {
|
|
10730
10682
|
const dbValue = this.database || {};
|
|
10731
10683
|
const isDbEnabled = !!this.DBState?.checked;
|
|
10732
|
-
const
|
|
10684
|
+
const parsedIgnoreQueryParams = this.parseIgnoreParams(dbValue?.ignoreQueryParams);
|
|
10733
10685
|
return RequestOptions.adapt({
|
|
10734
10686
|
path,
|
|
10735
10687
|
headers,
|
|
10736
10688
|
forceRefresh: false,
|
|
10737
|
-
|
|
10738
|
-
|
|
10689
|
+
ignoreQueryParams: isDbEnabled && parsedIgnoreQueryParams.length > 0 ? parsedIgnoreQueryParams : undefined,
|
|
10690
|
+
queryParamsExpiresIn: isDbEnabled ? dbValue?.queryParamsExpiresIn : undefined,
|
|
10739
10691
|
});
|
|
10740
10692
|
}
|
|
10741
10693
|
onSetStateOptions() {
|
|
@@ -13734,5 +13686,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
13734
13686
|
* Generated bundle index. Do not edit.
|
|
13735
13687
|
*/
|
|
13736
13688
|
|
|
13737
|
-
export { ApiRequest, AppService, AsymmetricalEncryptionService, BatchOptions, BatchResult, CONFIG_SETTINGS_TOKEN, ChannelType, ConfigHTTPOptions, ConfigOptions, DataType, DatabaseDataDemoComponent, DatabaseManagerService, DatabaseStorage, DbService, DexieSqlService, ErrorDisplaySettings, ExecutionPlanType, GlobalStoreOptions, HTTPManagerService, HTTPManagerSignalsService, HTTPManagerStateService, HeadersService, HttpRequestManagerModule, HttpRequestServicesDemoComponent, InvalidFileInfoModel, LocalStorageDemoComponent, LocalStorageManagerService, LocalStorageOptions, LocalStorageSignalsDemoComponent, LocalStorageSignalsManagerService, LoggerService,
|
|
13689
|
+
export { ApiRequest, AppService, AsymmetricalEncryptionService, BatchOptions, BatchResult, CONFIG_SETTINGS_TOKEN, ChannelType, ConfigHTTPOptions, ConfigOptions, DataType, DatabaseDataDemoComponent, DatabaseManagerService, DatabaseStorage, DbService, DexieSqlService, ErrorDisplaySettings, ExecutionPlanType, GlobalStoreOptions, HTTPManagerService, HTTPManagerSignalsService, HTTPManagerStateService, HeadersService, HttpRequestManagerModule, HttpRequestServicesDemoComponent, InvalidFileInfoModel, LocalStorageDemoComponent, LocalStorageManagerService, LocalStorageOptions, LocalStorageSignalsDemoComponent, LocalStorageSignalsManagerService, LoggerService, NotificationMessage, OperationResultModel, ParsingResultModel, PathQueryService, PublicMessage, Random, RandomHSLColor, RandomHexColor, RandomNumber, RandomNumbers, RandomNumbersUnique, RandomPaletteColor, RandomSignature, RandomStr, RandomVisibleColor, RequestErrorInterceptor, RequestHeadersInterceptor, RequestManagerDemoComponent, RequestManagerStateDemoComponent, RequestOptions, RequestService, RequestSignalsService, RetryOptions, SettingOptions, SqlParseError, SqlValidationError, StateMessage, StateOperationResult, StateStorageOptions, StorageData, StorageOption, StorageType, StoreStateManagerService, StoreStateManagerSignalsService, StoreStateSignalsDemoComponent, StreamConfigModel, StreamEventMetadataModel, StreamEventModel, StreamOutputModel, StreamProgressModel, StreamType, SymmetricalEncryptionService, TableSchemaDef, UUID, UUID_STR, UploadDemoComponent, UploadValidationErrorModel, UserData, UtilsService, WSOptions, WebSocketMessageService, WithCredentialsInterceptor, calculateBatchProgress, countdown, createChannelName, delayedRetry, isErrorState, isPendingState, isSuccessState, requestPolling, requestStreaming, streamAI, streamAuto, streamEvents, streamJSON, streamNDJSON };
|
|
13738
13690
|
//# sourceMappingURL=http-request-manager.mjs.map
|