http-request-manager 18.15.25 → 18.15.27

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "http-request-manager",
3
- "version": "18.15.25",
3
+ "version": "18.15.27",
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",
@@ -1,9 +1,10 @@
1
1
  import * as rxjs from 'rxjs';
2
- import { Observable, OperatorFunction, Subscription, BehaviorSubject } from 'rxjs';
2
+ import { Observable, Subscription, BehaviorSubject, OperatorFunction } from 'rxjs';
3
3
  import * as i0 from '@angular/core';
4
4
  import { InjectionToken, OnDestroy, Injector, OnInit, EventEmitter, ModuleWithProviders } from '@angular/core';
5
5
  import { ComponentStore } from '@ngrx/component-store';
6
6
  import { HttpClient, HttpHeaders, HttpInterceptor, HttpRequest, HttpHandler, HttpEvent } from '@angular/common/http';
7
+ import * as http_request_manager from 'http-request-manager';
7
8
  import * as i18 from 'toast-message-display';
8
9
  import { ToastMessageDisplayService } from 'toast-message-display';
9
10
  import Dexie, { Table } from 'dexie';
@@ -153,86 +154,6 @@ declare class AppService {
153
154
  static ɵprov: i0.ɵɵInjectableDeclaration<AppService>;
154
155
  }
155
156
 
156
- declare function countdown(duration: number): Observable<number>;
157
-
158
- declare function delayedRetry<T>(delayMs: number, maxRetry?: number): (src: Observable<T>) => Observable<T>;
159
-
160
- declare function requestPolling<T>(pollInterval: number, stopCondition$: Observable<any>, isPending$: any): (source: Observable<T>) => Observable<T>;
161
-
162
- /**
163
- * Enum representing valid streaming format types
164
- *
165
- * This enum defines all supported streaming formats for HTTP requests.
166
- * Each enum value corresponds to a specific data format and parsing strategy.
167
- */
168
- declare enum StreamType {
169
- JSON = "json",
170
- NDJSON = "ndjson",
171
- AI_STREAMING = "ai_streaming",
172
- EVENT_STREAM = "event_stream",
173
- AUTO = "auto"
174
- }
175
-
176
- interface StreamConfig {
177
- streamType: StreamType;
178
- totalHeader?: string;
179
- }
180
- /**
181
- * Progress information for streaming responses
182
- */
183
- interface StreamProgress {
184
- received: number;
185
- total?: number;
186
- percent: number;
187
- stage: 'connecting' | 'streaming' | 'complete' | 'error';
188
- }
189
- /**
190
- * Combined output from streaming operators
191
- */
192
- interface StreamOutput<T> {
193
- data: T[];
194
- progress: StreamProgress;
195
- endpoint?: string;
196
- }
197
- interface StreamEvent<T = any> {
198
- type: 'progress' | 'complete' | 'data';
199
- data: T;
200
- metadata?: {
201
- timestamp: Date;
202
- streamType: StreamType;
203
- contentLength?: number;
204
- };
205
- }
206
- interface ParsingResult<T = any> {
207
- success: boolean;
208
- data?: T[];
209
- error?: string;
210
- }
211
- /**
212
- * COMPREHENSIVE REQUEST STREAMING OPERATOR - FULLY ABSTRACTED
213
- * Refactored for better type safety and memory management
214
- *
215
- * Single function that handles ALL streaming formats without hardcoded assumptions:
216
- * - JSON format (Individual JSON objects)
217
- * - NDJSON format (Newline delimited JSON)
218
- * - AI streaming format (Real-time AI responses)
219
- * - Server-Sent Events format
220
- * - Auto-detection mode
221
- *
222
- * Usage:
223
- * this.http.get(url, options).pipe(requestStreaming()).subscribe(data => {...})
224
- * this.http.get(url, options).pipe(requestStreaming({ streamType: StreamType.NDJSON })).subscribe(data => {...})
225
- */
226
- declare function requestStreaming<T = any>(config?: StreamConfig): OperatorFunction<any, StreamOutput<T>>;
227
- /**
228
- * Convenience functions for common use cases
229
- */
230
- declare function streamJSON<T = any>(): OperatorFunction<any, StreamOutput<T>>;
231
- declare function streamNDJSON<T = any>(): OperatorFunction<any, StreamOutput<T>>;
232
- declare function streamAI<T = any>(): OperatorFunction<any, StreamOutput<T>>;
233
- declare function streamEvents<T = any>(): OperatorFunction<any, StreamOutput<T>>;
234
- declare function streamAuto<T = any>(): OperatorFunction<any, StreamOutput<T>>;
235
-
236
157
  interface WSOptionsInterface {
237
158
  id: string;
238
159
  wsServer: string;
@@ -256,6 +177,20 @@ declare class WSOptions implements WSOptionsInterface {
256
177
  static adapt(item?: any): WSOptions;
257
178
  }
258
179
 
180
+ /**
181
+ * Enum representing valid streaming format types
182
+ *
183
+ * This enum defines all supported streaming formats for HTTP requests.
184
+ * Each enum value corresponds to a specific data format and parsing strategy.
185
+ */
186
+ declare enum StreamType {
187
+ JSON = "json",
188
+ NDJSON = "ndjson",
189
+ AI_STREAMING = "ai_streaming",
190
+ EVENT_STREAM = "event_stream",
191
+ AUTO = "auto"
192
+ }
193
+
259
194
  interface ApiRequestInterface {
260
195
  server: string;
261
196
  path?: any[];
@@ -309,6 +244,21 @@ declare class ApiRequest implements ApiRequestInterface {
309
244
  static adapt(item?: any): ApiRequest;
310
245
  }
311
246
 
247
+ interface StreamProgressInterface {
248
+ received: number;
249
+ total?: number;
250
+ percent: number;
251
+ stage: 'connecting' | 'streaming' | 'complete' | 'error';
252
+ }
253
+ declare class StreamProgressModel implements StreamProgressInterface {
254
+ received: number;
255
+ total?: number | undefined;
256
+ percent: number;
257
+ stage: 'connecting' | 'streaming' | 'complete' | 'error';
258
+ constructor(received?: number, total?: number | undefined, percent?: number, stage?: 'connecting' | 'streaming' | 'complete' | 'error');
259
+ static adapt(item?: any): StreamProgressModel;
260
+ }
261
+
312
262
  interface WSUserInterface {
313
263
  id: string;
314
264
  ldap?: string;
@@ -460,6 +410,69 @@ declare class OperationResultModel implements OperationResultInterface {
460
410
  static adapt(item?: any): OperationResultModel;
461
411
  }
462
412
 
413
+ interface StreamConfigInterface {
414
+ streamType: StreamType;
415
+ totalHeader?: string;
416
+ }
417
+ declare class StreamConfigModel implements StreamConfigInterface {
418
+ streamType: StreamType;
419
+ totalHeader: string;
420
+ constructor(streamType?: StreamType, totalHeader?: string);
421
+ static adapt(item?: any): StreamConfigModel;
422
+ }
423
+
424
+ interface StreamOutputInterface<T = any> {
425
+ data: T[];
426
+ progress: StreamProgressModel;
427
+ endpoint?: string;
428
+ }
429
+ declare class StreamOutputModel<T = any> implements StreamOutputInterface<T> {
430
+ data: T[];
431
+ progress: StreamProgressModel;
432
+ endpoint?: string | undefined;
433
+ constructor(data?: T[], progress?: StreamProgressModel, endpoint?: string | undefined);
434
+ static adapt<T = any>(item?: any): StreamOutputModel<T>;
435
+ }
436
+
437
+ interface StreamEventMetadataInterface {
438
+ timestamp: Date;
439
+ streamType: StreamType;
440
+ contentLength?: number;
441
+ }
442
+ declare class StreamEventMetadataModel implements StreamEventMetadataInterface {
443
+ timestamp: Date;
444
+ streamType: StreamType;
445
+ contentLength?: number | undefined;
446
+ constructor(timestamp?: Date, streamType?: StreamType, contentLength?: number | undefined);
447
+ static adapt(item?: any): StreamEventMetadataModel;
448
+ }
449
+
450
+ interface StreamEventInterface<T = any> {
451
+ type: 'progress' | 'complete' | 'data';
452
+ data: T;
453
+ metadata?: StreamEventMetadataModel;
454
+ }
455
+ declare class StreamEventModel<T = any> implements StreamEventInterface<T> {
456
+ type: 'progress' | 'complete' | 'data';
457
+ data: T;
458
+ metadata?: StreamEventMetadataModel | undefined;
459
+ constructor(type?: 'progress' | 'complete' | 'data', data?: T, metadata?: StreamEventMetadataModel | undefined);
460
+ static adapt<T = any>(item?: any): StreamEventModel<T>;
461
+ }
462
+
463
+ interface ParsingResultInterface<T = any> {
464
+ success: boolean;
465
+ data?: T[];
466
+ error?: string;
467
+ }
468
+ declare class ParsingResultModel<T = any> implements ParsingResultInterface<T> {
469
+ success: boolean;
470
+ data?: T[] | undefined;
471
+ error?: string | undefined;
472
+ constructor(success?: boolean, data?: T[] | undefined, error?: string | undefined);
473
+ static adapt<T = any>(item?: any): ParsingResultModel<T>;
474
+ }
475
+
463
476
  interface TableSchemaDefInterface {
464
477
  table: string;
465
478
  schema: string;
@@ -1148,8 +1161,8 @@ declare class RequestService extends WebsocketService {
1148
1161
  isPending$: Observable<boolean>;
1149
1162
  progress: BehaviorSubject<number>;
1150
1163
  progress$: Observable<number>;
1151
- streamProgress: BehaviorSubject<StreamProgress>;
1152
- streamProgress$: Observable<StreamProgress>;
1164
+ streamProgress: BehaviorSubject<StreamProgressModel>;
1165
+ streamProgress$: Observable<StreamProgressModel>;
1153
1166
  getRecordRequest<T>(options: ApiRequest): Observable<T>;
1154
1167
  getRecordRequest<T>(options: ApiRequest): Observable<T>;
1155
1168
  getRecordRequest<T>(options: ApiRequest & {
@@ -1540,7 +1553,7 @@ declare class HTTPManagerService<T> extends RequestService {
1540
1553
  data$: Observable<any>;
1541
1554
  private polling$;
1542
1555
  config: ApiRequest;
1543
- streamProgress$: Observable<StreamProgress>;
1556
+ streamProgress$: Observable<http_request_manager.StreamProgressModel>;
1544
1557
  constructor(configOptions?: ConfigOptions | undefined);
1545
1558
  /**
1546
1559
  * Connect to WebSocket server
@@ -1881,6 +1894,37 @@ declare class HTTPManagerSignalsService<T> extends RequestSignalsService {
1881
1894
  static ɵprov: i0.ɵɵInjectableDeclaration<HTTPManagerSignalsService<any>>;
1882
1895
  }
1883
1896
 
1897
+ declare function countdown(duration: number): Observable<number>;
1898
+
1899
+ declare function delayedRetry<T>(delayMs: number, maxRetry?: number): (src: Observable<T>) => Observable<T>;
1900
+
1901
+ declare function requestPolling<T>(pollInterval: number, stopCondition$: Observable<any>, isPending$: any): (source: Observable<T>) => Observable<T>;
1902
+
1903
+ /**
1904
+ * COMPREHENSIVE REQUEST STREAMING OPERATOR - FULLY ABSTRACTED
1905
+ * Refactored for better type safety and memory management
1906
+ *
1907
+ * Single function that handles ALL streaming formats without hardcoded assumptions:
1908
+ * - JSON format (Individual JSON objects)
1909
+ * - NDJSON format (Newline delimited JSON)
1910
+ * - AI streaming format (Real-time AI responses)
1911
+ * - Server-Sent Events format
1912
+ * - Auto-detection mode
1913
+ *
1914
+ * Usage:
1915
+ * this.http.get(url, options).pipe(requestStreaming()).subscribe(data => {...})
1916
+ * this.http.get(url, options).pipe(requestStreaming({ streamType: StreamType.NDJSON })).subscribe(data => {...})
1917
+ */
1918
+ declare function requestStreaming<T = any>(config?: StreamConfigModel): OperatorFunction<any, StreamOutputModel<T>>;
1919
+ /**
1920
+ * Convenience functions for common use cases
1921
+ */
1922
+ declare function streamJSON<T = any>(): OperatorFunction<any, StreamOutputModel<T>>;
1923
+ declare function streamNDJSON<T = any>(): OperatorFunction<any, StreamOutputModel<T>>;
1924
+ declare function streamAI<T = any>(): OperatorFunction<any, StreamOutputModel<T>>;
1925
+ declare function streamEvents<T = any>(): OperatorFunction<any, StreamOutputModel<T>>;
1926
+ declare function streamAuto<T = any>(): OperatorFunction<any, StreamOutputModel<T>>;
1927
+
1884
1928
  interface State {
1885
1929
  localStores: StorageData[];
1886
1930
  sessionStores: StorageData[];
@@ -3823,5 +3867,5 @@ declare class StoreStateSignalsDemoComponent implements OnInit {
3823
3867
  static ɵcmp: i0.ɵɵComponentDeclaration<StoreStateSignalsDemoComponent, "app-store-state-signals-demo", never, {}, {}, never, never, false, never>;
3824
3868
  }
3825
3869
 
3826
- export { ApiRequest, AppService, AsymmetricalEncryptionService, BatchOptions, BatchResult, CONFIG_SETTINGS_TOKEN, ChannelType, ConfigHTTPOptions, ConfigOptions, DataType, DatabaseDataDemoComponent, DatabaseManagerService, DatabaseStorage, DbService, ErrorDisplaySettings, GlobalStoreOptions, HTTPManagerService, HTTPManagerSignalsService, HTTPManagerStateService, HeadersService, HttpRequestManagerModule, HttpRequestServicesDemoComponent, InvalidFileInfoModel, LocalStorageDemoComponent, LocalStorageManagerService, LocalStorageOptions, LocalStorageSignalsDemoComponent, LocalStorageSignalsManagerService, LoggerService, NormalizedRequestOptionsModel, NotificationMessage, OperationResultModel, PathQueryService, PathTrackerStateModel, PublicMessage, QueryParamsTrackerOptionsModel, QueryTrackerStateModel, Random, RandomHSLColor, RandomHexColor, RandomNumber, RandomNumbers, RandomNumbersUnique, RandomPaletteColor, RandomSignature, RandomStr, RandomVisibleColor, RequestErrorInterceptor, RequestHeadersInterceptor, RequestManagerDemoComponent, RequestManagerStateDemoComponent, RequestOptions, RequestService, RequestSignalsService, RetryOptions, SettingOptions, StateMessage, StateOperationResult, StateStorageOptions, StorageData, StorageOption, StorageType, StoreStateManagerService, StoreStateManagerSignalsService, StoreStateSignalsDemoComponent, 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 };
3827
- export type { APIStateManagerData, ApiRequestInterface, BatchErrorState, BatchOptionsInterface, BatchPendingState, BatchProgress, BatchRequestState, BatchResultInterface, BatchSuccessState, ConfigHTTPOptionsInterface, ConfigOptionsInterface, DatabaseStorageInterface, ErrorDisplaySettingsInterface, GlobalStoreOptionsInterface, InvalidFileInfoInterface, LocalStorageOptionsInterface, NormalizedQueryParams, NormalizedRequestOptionsInterface, NotificationMessageInterface, OperationResultInterface, ParsingResult, PathTrackerStateInterface, PublicMessageInterface, QueryParamsTrackerOptionsInterface, QueryTrackerStateInterface, QueryValue, RequestOptionsInterface, RetryOptionsInterface, SettingOptionsInterface, State, StateMessageInterface, StateOperationResultInterface, StateStorageOptionsInterface, StateStoreManagerData$1 as StateStoreManagerData, StorageDataInterface, StorageOptionInterface, StreamConfig, StreamEvent, StreamOutput, StreamProgress, TableRecord, TableSchemaDefInterface, UploadValidationErrorInterface, UserDataInterface, WSOptionsInterface };
3870
+ export { ApiRequest, AppService, AsymmetricalEncryptionService, BatchOptions, BatchResult, CONFIG_SETTINGS_TOKEN, ChannelType, ConfigHTTPOptions, ConfigOptions, DataType, DatabaseDataDemoComponent, DatabaseManagerService, DatabaseStorage, DbService, ErrorDisplaySettings, GlobalStoreOptions, HTTPManagerService, HTTPManagerSignalsService, HTTPManagerStateService, HeadersService, HttpRequestManagerModule, HttpRequestServicesDemoComponent, InvalidFileInfoModel, LocalStorageDemoComponent, LocalStorageManagerService, LocalStorageOptions, LocalStorageSignalsDemoComponent, LocalStorageSignalsManagerService, LoggerService, NormalizedRequestOptionsModel, NotificationMessage, OperationResultModel, ParsingResultModel, PathQueryService, PathTrackerStateModel, PublicMessage, QueryParamsTrackerOptionsModel, QueryTrackerStateModel, Random, RandomHSLColor, RandomHexColor, RandomNumber, RandomNumbers, RandomNumbersUnique, RandomPaletteColor, RandomSignature, RandomStr, RandomVisibleColor, RequestErrorInterceptor, RequestHeadersInterceptor, RequestManagerDemoComponent, RequestManagerStateDemoComponent, RequestOptions, RequestService, RequestSignalsService, RetryOptions, SettingOptions, 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 };
3871
+ export type { APIStateManagerData, ApiRequestInterface, BatchErrorState, BatchOptionsInterface, BatchPendingState, BatchProgress, BatchRequestState, BatchResultInterface, BatchSuccessState, ConfigHTTPOptionsInterface, ConfigOptionsInterface, DatabaseStorageInterface, ErrorDisplaySettingsInterface, GlobalStoreOptionsInterface, InvalidFileInfoInterface, LocalStorageOptionsInterface, NormalizedQueryParams, NormalizedRequestOptionsInterface, NotificationMessageInterface, OperationResultInterface, ParsingResultInterface, PathTrackerStateInterface, PublicMessageInterface, QueryParamsTrackerOptionsInterface, QueryTrackerStateInterface, QueryValue, RequestOptionsInterface, RetryOptionsInterface, SettingOptionsInterface, State, StateMessageInterface, StateOperationResultInterface, StateStorageOptionsInterface, StateStoreManagerData$1 as StateStoreManagerData, StorageDataInterface, StorageOptionInterface, StreamConfigInterface, StreamEventInterface, StreamEventMetadataInterface, StreamOutputInterface, StreamProgressInterface, TableRecord, TableSchemaDefInterface, UploadValidationErrorInterface, UserDataInterface, WSOptionsInterface };
Binary file