http-request-manager 18.7.10 → 18.7.12
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 +223 -1282
- package/fesm2022/http-request-manager.mjs +485 -122
- package/fesm2022/http-request-manager.mjs.map +1 -1
- package/http-request-manager-18.7.12.tgz +0 -0
- package/package.json +1 -1
- package/types/http-request-manager.d.ts +118 -22
- package/http-request-manager-18.7.10.tgz +0 -0
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "http-request-manager",
|
|
3
|
-
"version": "18.7.
|
|
3
|
+
"version": "18.7.12",
|
|
4
4
|
"homepage": "https://wavecoders.ca",
|
|
5
5
|
"author": "Mike Bonifacio <wavecoders@gmail.com> (http://wavecoders@gmail.com/)",
|
|
6
6
|
"description": "This is an Angular Module containing Components/Services using Material",
|
|
@@ -174,6 +174,20 @@ declare class WSOptions implements WSOptionsInterface {
|
|
|
174
174
|
static adapt(item?: any): WSOptions;
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
+
/**
|
|
178
|
+
* Enum representing valid streaming format types
|
|
179
|
+
*
|
|
180
|
+
* This enum defines all supported streaming formats for HTTP requests.
|
|
181
|
+
* Each enum value corresponds to a specific data format and parsing strategy.
|
|
182
|
+
*/
|
|
183
|
+
declare enum StreamType {
|
|
184
|
+
JSON = "json",
|
|
185
|
+
NDJSON = "ndjson",
|
|
186
|
+
AI_STREAMING = "ai_streaming",
|
|
187
|
+
EVENT_STREAM = "event_stream",
|
|
188
|
+
AUTO = "auto"
|
|
189
|
+
}
|
|
190
|
+
|
|
177
191
|
interface ApiRequestInterface {
|
|
178
192
|
server: string;
|
|
179
193
|
path?: any[];
|
|
@@ -183,6 +197,7 @@ interface ApiRequestInterface {
|
|
|
183
197
|
polling?: number;
|
|
184
198
|
retry?: RetryOptions;
|
|
185
199
|
stream?: boolean;
|
|
200
|
+
streamType?: StreamType;
|
|
186
201
|
displayError?: boolean;
|
|
187
202
|
saveAs?: string;
|
|
188
203
|
fileContentHeader?: string;
|
|
@@ -197,11 +212,12 @@ declare class ApiRequest implements ApiRequestInterface {
|
|
|
197
212
|
polling?: number | undefined;
|
|
198
213
|
retry?: RetryOptions | undefined;
|
|
199
214
|
stream?: boolean | undefined;
|
|
215
|
+
streamType?: StreamType | undefined;
|
|
200
216
|
displayError?: boolean | undefined;
|
|
201
217
|
saveAs?: string | undefined;
|
|
202
218
|
fileContentHeader?: string | undefined;
|
|
203
219
|
ws?: WSOptions | undefined;
|
|
204
|
-
constructor(server?: string, path?: any[] | undefined, headers?: any, adapter?: any, mapper?: any, polling?: number | undefined, retry?: RetryOptions | undefined, stream?: boolean | undefined, displayError?: boolean | undefined, saveAs?: string | undefined, fileContentHeader?: string | undefined, ws?: WSOptions | undefined);
|
|
220
|
+
constructor(server?: string, path?: any[] | undefined, headers?: any, adapter?: any, mapper?: any, polling?: number | undefined, retry?: RetryOptions | undefined, stream?: boolean | undefined, streamType?: StreamType | undefined, displayError?: boolean | undefined, saveAs?: string | undefined, fileContentHeader?: string | undefined, ws?: WSOptions | undefined);
|
|
205
221
|
static adapt(item?: any): ApiRequest;
|
|
206
222
|
}
|
|
207
223
|
|
|
@@ -232,6 +248,28 @@ declare class WSUser implements WSUserInterface {
|
|
|
232
248
|
static adapt(item?: any): WSUser;
|
|
233
249
|
}
|
|
234
250
|
|
|
251
|
+
interface ChannelMessageDataInterface {
|
|
252
|
+
channel: string;
|
|
253
|
+
users: WSUser[];
|
|
254
|
+
}
|
|
255
|
+
declare class ChannelMessageData implements ChannelMessageDataInterface {
|
|
256
|
+
channel: string;
|
|
257
|
+
users: WSUser[];
|
|
258
|
+
constructor(channel: string, users?: WSUser[]);
|
|
259
|
+
static adapt(item?: any): ChannelMessageData;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
interface ChannelMessageInterface {
|
|
263
|
+
sessionId: any;
|
|
264
|
+
content: any;
|
|
265
|
+
}
|
|
266
|
+
declare class ChannelMessage implements ChannelMessageInterface {
|
|
267
|
+
sessionId: any;
|
|
268
|
+
content: any;
|
|
269
|
+
constructor(sessionId?: any, content?: any);
|
|
270
|
+
static adapt(item?: any): ChannelMessage;
|
|
271
|
+
}
|
|
272
|
+
|
|
235
273
|
declare enum CommunicationType {
|
|
236
274
|
MESSAGE = 0,
|
|
237
275
|
ALERT = 1,
|
|
@@ -327,17 +365,6 @@ declare class DatabaseManagerService extends DbService {
|
|
|
327
365
|
static ɵprov: i0.ɵɵInjectableDeclaration<DatabaseManagerService>;
|
|
328
366
|
}
|
|
329
367
|
|
|
330
|
-
interface ChannelMessageInterface {
|
|
331
|
-
sessionId: any;
|
|
332
|
-
content: any;
|
|
333
|
-
}
|
|
334
|
-
declare class ChannelMessage implements ChannelMessageInterface {
|
|
335
|
-
sessionId: any;
|
|
336
|
-
content: any;
|
|
337
|
-
constructor(sessionId?: any, content?: any);
|
|
338
|
-
static adapt(item?: any): ChannelMessage;
|
|
339
|
-
}
|
|
340
|
-
|
|
341
368
|
/**
|
|
342
369
|
* Channel type enum for different communication purposes
|
|
343
370
|
* - STATE: Private channels for state synchronization (SYS- prefix)
|
|
@@ -809,7 +836,33 @@ declare function delayedRetry<T>(delayMs: number, maxRetry?: number): (src: Obse
|
|
|
809
836
|
|
|
810
837
|
declare function requestPolling<T>(pollInterval: number, stopCondition$: Observable<any>, isPending$: any): (source: Observable<T>) => Observable<T>;
|
|
811
838
|
|
|
812
|
-
|
|
839
|
+
interface StreamConfig {
|
|
840
|
+
streamType: StreamType;
|
|
841
|
+
addMetadata?: boolean;
|
|
842
|
+
}
|
|
843
|
+
/**
|
|
844
|
+
* COMPREHENSIVE REQUEST STREAMING OPERATOR - FULLY ABSTRACTED
|
|
845
|
+
*
|
|
846
|
+
* Single function that handles ALL streaming formats without hardcoded assumptions:
|
|
847
|
+
* - JSON format (Individual JSON objects)
|
|
848
|
+
* - NDJSON format (Newline delimited JSON)
|
|
849
|
+
* - AI streaming format (Real-time AI responses)
|
|
850
|
+
* - Server-Sent Events format
|
|
851
|
+
* - Auto-detection mode
|
|
852
|
+
*
|
|
853
|
+
* Usage:
|
|
854
|
+
* this.http.get(url, options).pipe(requestStreaming()).subscribe(data => {...})
|
|
855
|
+
* this.http.get(url, options).pipe(requestStreaming({ streamType: StreamType.NDJSON })).subscribe(data => {...})
|
|
856
|
+
*/
|
|
857
|
+
declare function requestStreaming(config?: StreamConfig): OperatorFunction<any, any>;
|
|
858
|
+
/**
|
|
859
|
+
* Convenience functions for common use cases
|
|
860
|
+
*/
|
|
861
|
+
declare function streamJSON(): OperatorFunction<any, any>;
|
|
862
|
+
declare function streamNDJSON(): OperatorFunction<any, any>;
|
|
863
|
+
declare function streamAI(): OperatorFunction<any, any>;
|
|
864
|
+
declare function streamEvents(): OperatorFunction<any, any>;
|
|
865
|
+
declare function streamAuto(): OperatorFunction<any, any>;
|
|
813
866
|
|
|
814
867
|
interface State {
|
|
815
868
|
localStores: StorageData[];
|
|
@@ -988,6 +1041,35 @@ declare class PathQueryService {
|
|
|
988
1041
|
static ɵprov: i0.ɵɵInjectableDeclaration<PathQueryService>;
|
|
989
1042
|
}
|
|
990
1043
|
|
|
1044
|
+
/**
|
|
1045
|
+
* Generate a random hex color code
|
|
1046
|
+
* @returns A random hex color string (e.g., "#FF5733")
|
|
1047
|
+
*/
|
|
1048
|
+
declare const RandomHexColor: () => string;
|
|
1049
|
+
/**
|
|
1050
|
+
* Generate a random hex color with constraints to ensure good visibility
|
|
1051
|
+
* @param options Optional constraints for color generation
|
|
1052
|
+
* @returns A random hex color string with good contrast
|
|
1053
|
+
*/
|
|
1054
|
+
declare const RandomVisibleColor: (options?: {
|
|
1055
|
+
minBrightness?: number;
|
|
1056
|
+
maxBrightness?: number;
|
|
1057
|
+
}) => string;
|
|
1058
|
+
/**
|
|
1059
|
+
* Generate a random color from a predefined palette
|
|
1060
|
+
* @returns A hex color from a set of visually distinct colors
|
|
1061
|
+
*/
|
|
1062
|
+
declare const RandomPaletteColor: () => string;
|
|
1063
|
+
/**
|
|
1064
|
+
* Generate a random HSL color
|
|
1065
|
+
* @param options Optional constraints for HSL generation
|
|
1066
|
+
* @returns A random HSL color string (e.g., "hsl(120, 100%, 50%)")
|
|
1067
|
+
*/
|
|
1068
|
+
declare const RandomHSLColor: (options?: {
|
|
1069
|
+
saturation?: [number, number];
|
|
1070
|
+
lightness?: [number, number];
|
|
1071
|
+
}) => string;
|
|
1072
|
+
|
|
991
1073
|
declare class AsymmetricalEncryptionService {
|
|
992
1074
|
constructor();
|
|
993
1075
|
generateKeyPair(modulusLength?: number): Observable<CryptoKeyPair>;
|
|
@@ -1056,12 +1138,14 @@ interface UserDataInterface {
|
|
|
1056
1138
|
ldap: string;
|
|
1057
1139
|
name: string;
|
|
1058
1140
|
email: string;
|
|
1141
|
+
color: string;
|
|
1059
1142
|
}
|
|
1060
1143
|
declare class UserData implements UserDataInterface {
|
|
1061
1144
|
ldap: string;
|
|
1062
1145
|
name: string;
|
|
1063
1146
|
email: string;
|
|
1064
|
-
|
|
1147
|
+
color: string;
|
|
1148
|
+
constructor(ldap?: string, name?: string, email?: string, color?: string);
|
|
1065
1149
|
static adapt(item?: any): UserData;
|
|
1066
1150
|
}
|
|
1067
1151
|
|
|
@@ -1162,6 +1246,11 @@ declare class RequestManagerStateDemoComponent implements OnInit {
|
|
|
1162
1246
|
displayedColumns: string[];
|
|
1163
1247
|
selectedRecord$?: Observable<ClientInfo$1 | null>;
|
|
1164
1248
|
fb: FormBuilder;
|
|
1249
|
+
streamTypes: {
|
|
1250
|
+
id: string;
|
|
1251
|
+
value: string;
|
|
1252
|
+
}[];
|
|
1253
|
+
streamType: string;
|
|
1165
1254
|
httpManagerService: HTTPManagerService<any>;
|
|
1166
1255
|
isPending$: Observable<boolean>;
|
|
1167
1256
|
error$: Observable<boolean>;
|
|
@@ -1250,6 +1339,7 @@ declare class RequestManagerStateDemoComponent implements OnInit {
|
|
|
1250
1339
|
props: (adapter: any) => any;
|
|
1251
1340
|
constructor();
|
|
1252
1341
|
ngOnInit(): void;
|
|
1342
|
+
onStreamType(type: string): void;
|
|
1253
1343
|
addHeader(): void;
|
|
1254
1344
|
removeHeader(index: number): void;
|
|
1255
1345
|
compileRequest(): {
|
|
@@ -1299,6 +1389,11 @@ declare class RequestManagerDemoComponent implements OnInit {
|
|
|
1299
1389
|
DELETE: ApiRequest;
|
|
1300
1390
|
STREAM: ApiRequest;
|
|
1301
1391
|
};
|
|
1392
|
+
streamTypes: {
|
|
1393
|
+
id: string;
|
|
1394
|
+
value: string;
|
|
1395
|
+
}[];
|
|
1396
|
+
streamType: string;
|
|
1302
1397
|
failedState: any;
|
|
1303
1398
|
pollingState: any;
|
|
1304
1399
|
questionControl: _angular_forms.FormControl<string | null>;
|
|
@@ -1353,6 +1448,7 @@ declare class RequestManagerDemoComponent implements OnInit {
|
|
|
1353
1448
|
arrayObjectsToObjects: (arr: any[]) => any;
|
|
1354
1449
|
constructor();
|
|
1355
1450
|
ngOnInit(): void;
|
|
1451
|
+
onStreamType(type: string): void;
|
|
1356
1452
|
addHeader(): void;
|
|
1357
1453
|
removeHeader(index: number): void;
|
|
1358
1454
|
compileRequest(): {
|
|
@@ -1800,12 +1896,12 @@ declare class RequestManagerWsDemoComponent implements OnInit {
|
|
|
1800
1896
|
user: any;
|
|
1801
1897
|
path: string[];
|
|
1802
1898
|
wsChannel: string;
|
|
1803
|
-
user$: Observable<WSUser | null>;
|
|
1804
|
-
attempts$: Observable<number>;
|
|
1805
|
-
nextRetry$: Observable<number>;
|
|
1806
|
-
connectionStatus$: Observable<boolean>;
|
|
1807
|
-
data$: Observable<any>;
|
|
1808
|
-
isPending$: Observable<boolean>;
|
|
1899
|
+
user$: rxjs.Observable<WSUser | null>;
|
|
1900
|
+
attempts$: rxjs.Observable<number>;
|
|
1901
|
+
nextRetry$: rxjs.Observable<number>;
|
|
1902
|
+
connectionStatus$: rxjs.Observable<boolean>;
|
|
1903
|
+
data$: rxjs.Observable<any>;
|
|
1904
|
+
isPending$: rxjs.Observable<boolean>;
|
|
1809
1905
|
ngOnInit(): void;
|
|
1810
1906
|
static ɵfac: i0.ɵɵFactoryDeclaration<RequestManagerWsDemoComponent, never>;
|
|
1811
1907
|
static ɵcmp: i0.ɵɵComponentDeclaration<RequestManagerWsDemoComponent, "app-request-manager-ws-demo", never, { "server": { "alias": "server"; "required": false; }; "wsServer": { "alias": "wsServer"; "required": false; }; "jwtToken": { "alias": "jwtToken"; "required": false; }; "user": { "alias": "user"; "required": false; }; "path": { "alias": "path"; "required": false; }; "wsChannel": { "alias": "wsChannel"; "required": false; }; }, {}, never, never, false, never>;
|
|
@@ -2155,5 +2251,5 @@ declare class HttpRequestManagerModule {
|
|
|
2155
2251
|
static ɵinj: i0.ɵɵInjectorDeclaration<HttpRequestManagerModule>;
|
|
2156
2252
|
}
|
|
2157
2253
|
|
|
2158
|
-
export { ApiRequest, AppService, AsymmetricalEncryptionService, CONFIG_SETTINGS_TOKEN, ChannelInfo, ChannelType, CommunicationType, ConfigHTTPOptions, ConfigOptions, DataType, DatabaseDataDemoComponent, DatabaseManagerService, DatabaseStorage, DbService, ErrorDisplaySettings, GlobalStoreOptions, HTTPManagerService, HTTPManagerSignalsService, HTTPManagerStateService, HeadersService, HttpRequestManagerModule, HttpRequestServicesDemoComponent, LocalStorageDemoComponent, LocalStorageManagerService, LocalStorageOptions, LocalStorageSignalsManagerService, PathQueryService, Random, RandomNumber, RandomNumbers, RandomNumbersUnique, RandomSignature, RandomStr, RequestErrorInterceptor, RequestHeadersInterceptor, RequestManagerDemoComponent, RequestManagerStateDemoComponent, RequestOptions, RequestService, RequestSignalsService, RetryOptions, SettingOptions, StateStorageOptions, StorageData, StorageOption, StorageType, StoreStateManagerService, SymmetricalEncryptionService, TableSchemaDef, UUID, UUID_STR, UtilsService, WSOptions, WSUser, WebsocketService, WithCredentialsInterceptor, countdown, createChannelName, delayedRetry, requestPolling, requestStreaming };
|
|
2159
|
-
export type { APIStateManagerData, ApiRequestInterface, ChannelInfoInterface, ConfigHTTPOptionsInterface, ConfigOptionsInterface, DatabaseStorageInterface, ErrorDisplaySettingsInterface, GlobalStoreOptionsInterface, LocalStorageOptionsInterface, RequestOptionsInterface, RetryOptionsInterface, SettingOptionsInterface, State, StateStorageOptionsInterface, StateStoreManagerData, StorageDataInterface, StorageOptionInterface, TableRecord, TableSchemaDefInterface, WSOptionsInterface, WSUserInterface };
|
|
2254
|
+
export { ApiRequest, AppService, AsymmetricalEncryptionService, CONFIG_SETTINGS_TOKEN, ChannelInfo, ChannelMessage, ChannelMessageData, ChannelType, CommunicationType, ConfigHTTPOptions, ConfigOptions, DataType, DatabaseDataDemoComponent, DatabaseManagerService, DatabaseStorage, DbService, ErrorDisplaySettings, GlobalStoreOptions, HTTPManagerService, HTTPManagerSignalsService, HTTPManagerStateService, HeadersService, HttpRequestManagerModule, HttpRequestServicesDemoComponent, LocalStorageDemoComponent, LocalStorageManagerService, LocalStorageOptions, LocalStorageSignalsDemoComponent, LocalStorageSignalsManagerService, PathQueryService, Random, RandomHSLColor, RandomHexColor, RandomNumber, RandomNumbers, RandomNumbersUnique, RandomPaletteColor, RandomSignature, RandomStr, RandomVisibleColor, RequestErrorInterceptor, RequestHeadersInterceptor, RequestManagerDemoComponent, RequestManagerStateDemoComponent, RequestManagerWsDemoComponent, RequestOptions, RequestService, RequestSignalsManagerDemoComponent, RequestSignalsService, RetryOptions, SettingOptions, StateStorageOptions, StorageData, StorageOption, StorageType, StoreStateManagerDemoComponent, StoreStateManagerService, StreamType, SymmetricalEncryptionService, TableSchemaDef, UUID, UUID_STR, UtilsService, WSOptions, WSUser, WebsocketService, WithCredentialsInterceptor, countdown, createChannelName, delayedRetry, requestPolling, requestStreaming, streamAI, streamAuto, streamEvents, streamJSON, streamNDJSON };
|
|
2255
|
+
export type { APIStateManagerData, ApiRequestInterface, ChannelInfoInterface, ChannelMessageDataInterface, ChannelMessageInterface, ConfigHTTPOptionsInterface, ConfigOptionsInterface, DatabaseStorageInterface, ErrorDisplaySettingsInterface, GlobalStoreOptionsInterface, LocalStorageOptionsInterface, RequestOptionsInterface, RetryOptionsInterface, SettingOptionsInterface, State, StateStorageOptionsInterface, StateStoreManagerData, StorageDataInterface, StorageOptionInterface, StreamConfig, TableRecord, TableSchemaDefInterface, WSOptionsInterface, WSUserInterface };
|
|
Binary file
|