http-request-manager 18.7.10 → 18.7.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.
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "http-request-manager",
3
- "version": "18.7.10",
3
+ "version": "18.7.11",
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
 
@@ -809,7 +825,33 @@ declare function delayedRetry<T>(delayMs: number, maxRetry?: number): (src: Obse
809
825
 
810
826
  declare function requestPolling<T>(pollInterval: number, stopCondition$: Observable<any>, isPending$: any): (source: Observable<T>) => Observable<T>;
811
827
 
812
- declare function requestStreaming(): OperatorFunction<any, any>;
828
+ interface StreamConfig {
829
+ streamType: StreamType;
830
+ addMetadata?: boolean;
831
+ }
832
+ /**
833
+ * COMPREHENSIVE REQUEST STREAMING OPERATOR - FULLY ABSTRACTED
834
+ *
835
+ * Single function that handles ALL streaming formats without hardcoded assumptions:
836
+ * - JSON format (Individual JSON objects)
837
+ * - NDJSON format (Newline delimited JSON)
838
+ * - AI streaming format (Real-time AI responses)
839
+ * - Server-Sent Events format
840
+ * - Auto-detection mode
841
+ *
842
+ * Usage:
843
+ * this.http.get(url, options).pipe(requestStreaming()).subscribe(data => {...})
844
+ * this.http.get(url, options).pipe(requestStreaming({ streamType: StreamType.NDJSON })).subscribe(data => {...})
845
+ */
846
+ declare function requestStreaming(config?: StreamConfig): OperatorFunction<any, any>;
847
+ /**
848
+ * Convenience functions for common use cases
849
+ */
850
+ declare function streamJSON(): OperatorFunction<any, any>;
851
+ declare function streamNDJSON(): OperatorFunction<any, any>;
852
+ declare function streamAI(): OperatorFunction<any, any>;
853
+ declare function streamEvents(): OperatorFunction<any, any>;
854
+ declare function streamAuto(): OperatorFunction<any, any>;
813
855
 
814
856
  interface State {
815
857
  localStores: StorageData[];
@@ -988,6 +1030,35 @@ declare class PathQueryService {
988
1030
  static ɵprov: i0.ɵɵInjectableDeclaration<PathQueryService>;
989
1031
  }
990
1032
 
1033
+ /**
1034
+ * Generate a random hex color code
1035
+ * @returns A random hex color string (e.g., "#FF5733")
1036
+ */
1037
+ declare const RandomHexColor: () => string;
1038
+ /**
1039
+ * Generate a random hex color with constraints to ensure good visibility
1040
+ * @param options Optional constraints for color generation
1041
+ * @returns A random hex color string with good contrast
1042
+ */
1043
+ declare const RandomVisibleColor: (options?: {
1044
+ minBrightness?: number;
1045
+ maxBrightness?: number;
1046
+ }) => string;
1047
+ /**
1048
+ * Generate a random color from a predefined palette
1049
+ * @returns A hex color from a set of visually distinct colors
1050
+ */
1051
+ declare const RandomPaletteColor: () => string;
1052
+ /**
1053
+ * Generate a random HSL color
1054
+ * @param options Optional constraints for HSL generation
1055
+ * @returns A random HSL color string (e.g., "hsl(120, 100%, 50%)")
1056
+ */
1057
+ declare const RandomHSLColor: (options?: {
1058
+ saturation?: [number, number];
1059
+ lightness?: [number, number];
1060
+ }) => string;
1061
+
991
1062
  declare class AsymmetricalEncryptionService {
992
1063
  constructor();
993
1064
  generateKeyPair(modulusLength?: number): Observable<CryptoKeyPair>;
@@ -1056,12 +1127,14 @@ interface UserDataInterface {
1056
1127
  ldap: string;
1057
1128
  name: string;
1058
1129
  email: string;
1130
+ color: string;
1059
1131
  }
1060
1132
  declare class UserData implements UserDataInterface {
1061
1133
  ldap: string;
1062
1134
  name: string;
1063
1135
  email: string;
1064
- constructor(ldap?: string, name?: string, email?: string);
1136
+ color: string;
1137
+ constructor(ldap?: string, name?: string, email?: string, color?: string);
1065
1138
  static adapt(item?: any): UserData;
1066
1139
  }
1067
1140
 
@@ -1162,6 +1235,11 @@ declare class RequestManagerStateDemoComponent implements OnInit {
1162
1235
  displayedColumns: string[];
1163
1236
  selectedRecord$?: Observable<ClientInfo$1 | null>;
1164
1237
  fb: FormBuilder;
1238
+ streamTypes: {
1239
+ id: string;
1240
+ value: string;
1241
+ }[];
1242
+ streamType: string;
1165
1243
  httpManagerService: HTTPManagerService<any>;
1166
1244
  isPending$: Observable<boolean>;
1167
1245
  error$: Observable<boolean>;
@@ -1250,6 +1328,7 @@ declare class RequestManagerStateDemoComponent implements OnInit {
1250
1328
  props: (adapter: any) => any;
1251
1329
  constructor();
1252
1330
  ngOnInit(): void;
1331
+ onStreamType(type: string): void;
1253
1332
  addHeader(): void;
1254
1333
  removeHeader(index: number): void;
1255
1334
  compileRequest(): {
@@ -1299,6 +1378,11 @@ declare class RequestManagerDemoComponent implements OnInit {
1299
1378
  DELETE: ApiRequest;
1300
1379
  STREAM: ApiRequest;
1301
1380
  };
1381
+ streamTypes: {
1382
+ id: string;
1383
+ value: string;
1384
+ }[];
1385
+ streamType: string;
1302
1386
  failedState: any;
1303
1387
  pollingState: any;
1304
1388
  questionControl: _angular_forms.FormControl<string | null>;
@@ -1353,6 +1437,7 @@ declare class RequestManagerDemoComponent implements OnInit {
1353
1437
  arrayObjectsToObjects: (arr: any[]) => any;
1354
1438
  constructor();
1355
1439
  ngOnInit(): void;
1440
+ onStreamType(type: string): void;
1356
1441
  addHeader(): void;
1357
1442
  removeHeader(index: number): void;
1358
1443
  compileRequest(): {
@@ -1800,12 +1885,12 @@ declare class RequestManagerWsDemoComponent implements OnInit {
1800
1885
  user: any;
1801
1886
  path: string[];
1802
1887
  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>;
1888
+ user$: rxjs.Observable<WSUser | null>;
1889
+ attempts$: rxjs.Observable<number>;
1890
+ nextRetry$: rxjs.Observable<number>;
1891
+ connectionStatus$: rxjs.Observable<boolean>;
1892
+ data$: rxjs.Observable<any>;
1893
+ isPending$: rxjs.Observable<boolean>;
1809
1894
  ngOnInit(): void;
1810
1895
  static ɵfac: i0.ɵɵFactoryDeclaration<RequestManagerWsDemoComponent, never>;
1811
1896
  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 +2240,5 @@ declare class HttpRequestManagerModule {
2155
2240
  static ɵinj: i0.ɵɵInjectorDeclaration<HttpRequestManagerModule>;
2156
2241
  }
2157
2242
 
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 };
2243
+ 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, RandomHSLColor, RandomHexColor, RandomNumber, RandomNumbers, RandomNumbersUnique, RandomPaletteColor, RandomSignature, RandomStr, RandomVisibleColor, RequestErrorInterceptor, RequestHeadersInterceptor, RequestManagerDemoComponent, RequestManagerStateDemoComponent, RequestOptions, RequestService, RequestSignalsService, RetryOptions, SettingOptions, StateStorageOptions, StorageData, StorageOption, StorageType, StoreStateManagerService, StreamType, SymmetricalEncryptionService, TableSchemaDef, UUID, UUID_STR, UtilsService, WSOptions, WSUser, WebsocketService, WithCredentialsInterceptor, countdown, createChannelName, delayedRetry, requestPolling, requestStreaming, streamAI, streamAuto, streamEvents, streamJSON, streamNDJSON };
2244
+ export type { APIStateManagerData, ApiRequestInterface, ChannelInfoInterface, ConfigHTTPOptionsInterface, ConfigOptionsInterface, DatabaseStorageInterface, ErrorDisplaySettingsInterface, GlobalStoreOptionsInterface, LocalStorageOptionsInterface, RequestOptionsInterface, RetryOptionsInterface, SettingOptionsInterface, State, StateStorageOptionsInterface, StateStoreManagerData, StorageDataInterface, StorageOptionInterface, StreamConfig, TableRecord, TableSchemaDefInterface, WSOptionsInterface, WSUserInterface };
Binary file