http-request-manager 18.11.23 → 18.12.1

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.11.23",
3
+ "version": "18.12.1",
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",
@@ -4,37 +4,37 @@ 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 i17 from 'toast-message-display';
7
+ import * as i18 from 'toast-message-display';
8
8
  import { ToastMessageDisplayService } from 'toast-message-display';
9
9
  import Dexie, { Table } from 'dexie';
10
- import * as i35 from '@ngx-translate/core';
10
+ import * as i36 from '@ngx-translate/core';
11
11
  import { TranslateService } from '@ngx-translate/core';
12
12
  import * as _angular_forms from '@angular/forms';
13
13
  import { FormArray, FormBuilder, FormControl } from '@angular/forms';
14
14
  import { DataSource } from '@angular/cdk/collections';
15
15
  import * as i4 from '@angular/common';
16
16
  import * as i7 from '@angular/material/button';
17
- import * as i20 from '@angular/material/tabs';
18
- import * as i21 from '@angular/material/select';
19
- import * as i22 from '@angular/material/chips';
20
- import * as i23 from '@angular/material/menu';
17
+ import * as i21 from '@angular/material/tabs';
18
+ import * as i22 from '@angular/material/select';
19
+ import * as i23 from '@angular/material/chips';
20
+ import * as i24 from '@angular/material/menu';
21
21
  import * as i5 from '@angular/material/icon';
22
- import * as i25 from '@angular/material/table';
23
- import * as i26 from '@angular/material/button-toggle';
24
- import * as i27 from '@angular/material/autocomplete';
25
- import * as i28 from '@angular/material/progress-bar';
22
+ import * as i26 from '@angular/material/table';
23
+ import * as i27 from '@angular/material/button-toggle';
24
+ import * as i28 from '@angular/material/autocomplete';
25
+ import * as i29 from '@angular/material/progress-bar';
26
26
  import * as i6 from '@angular/material/progress-spinner';
27
27
  import { ProgressSpinnerMode } from '@angular/material/progress-spinner';
28
- import * as i30 from '@angular/material/slide-toggle';
29
- import * as i31 from '@angular/material/divider';
30
- import * as i32 from '@angular/material/form-field';
31
- import * as i33 from '@angular/material/input';
32
- import * as i34 from '@angular/material/toolbar';
33
- import * as i36 from '@angular/material/sidenav';
34
- import * as i37 from '@angular/material/datepicker';
35
- import * as i38 from '@angular/material/core';
28
+ import * as i31 from '@angular/material/slide-toggle';
29
+ import * as i32 from '@angular/material/divider';
30
+ import * as i33 from '@angular/material/form-field';
31
+ import * as i34 from '@angular/material/input';
32
+ import * as i35 from '@angular/material/toolbar';
33
+ import * as i37 from '@angular/material/sidenav';
34
+ import * as i38 from '@angular/material/datepicker';
35
+ import * as i39 from '@angular/material/core';
36
36
  import { ThemePalette } from '@angular/material/core';
37
- import * as i39 from '@angular/material/card';
37
+ import * as i40 from '@angular/material/card';
38
38
 
39
39
  declare enum StorageType {
40
40
  GLOBAL = 0,
@@ -208,6 +208,12 @@ interface ApiRequestInterface {
208
208
  fileContentHeader?: string;
209
209
  ws?: WSOptions;
210
210
  env?: string;
211
+ uploadFiles?: File | File[];
212
+ uploadFieldName?: string;
213
+ uploadHttpMethod?: 'POST' | 'PUT';
214
+ allowedTypes?: string[];
215
+ maxFileSize?: number;
216
+ maxTotalSize?: number;
211
217
  }
212
218
  declare class ApiRequest implements ApiRequestInterface {
213
219
  server: string;
@@ -227,7 +233,13 @@ declare class ApiRequest implements ApiRequestInterface {
227
233
  fileContentHeader?: string | undefined;
228
234
  ws?: WSOptions | undefined;
229
235
  env?: string | undefined;
230
- 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, displaySuccess?: boolean | undefined, successMessage?: string | undefined, errorMessage?: string | undefined, saveAs?: string | undefined, fileContentHeader?: string | undefined, ws?: WSOptions | undefined, env?: string | undefined);
236
+ uploadFiles?: (File | File[]) | undefined;
237
+ uploadFieldName?: string | undefined;
238
+ uploadHttpMethod?: ("POST" | "PUT") | undefined;
239
+ allowedTypes?: string[] | undefined;
240
+ maxFileSize?: number | undefined;
241
+ maxTotalSize?: number | undefined;
242
+ 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, displaySuccess?: boolean | undefined, successMessage?: string | undefined, errorMessage?: string | undefined, saveAs?: string | undefined, fileContentHeader?: string | undefined, ws?: WSOptions | undefined, env?: string | undefined, uploadFiles?: (File | File[]) | undefined, uploadFieldName?: string | undefined, uploadHttpMethod?: ("POST" | "PUT") | undefined, allowedTypes?: string[] | undefined, maxFileSize?: number | undefined, maxTotalSize?: number | undefined);
231
243
  static adapt(item?: any): ApiRequest;
232
244
  }
233
245
 
@@ -1029,6 +1041,9 @@ declare class RequestService extends WebsocketService {
1029
1041
  private request;
1030
1042
  private requestStreaming;
1031
1043
  downloadFileRequest(options: ApiRequest): Observable<any>;
1044
+ uploadFileRequest(options: ApiRequest): Observable<any>;
1045
+ private validateUploadFiles;
1046
+ private buildFormData;
1032
1047
  private handleFinalize;
1033
1048
  private downloadFile;
1034
1049
  private createFileType;
@@ -1183,6 +1198,33 @@ declare class ConfigOptions implements ConfigOptionsInterface {
1183
1198
  */
1184
1199
  declare const CONFIG_SETTINGS_TOKEN: InjectionToken<ConfigOptions>;
1185
1200
 
1201
+ interface InvalidFileInfoInterface {
1202
+ fileName: string;
1203
+ fileSize: number;
1204
+ fileType: string;
1205
+ errors: string[];
1206
+ }
1207
+ declare class InvalidFileInfoModel implements InvalidFileInfoInterface {
1208
+ fileName: string;
1209
+ fileSize: number;
1210
+ fileType: string;
1211
+ errors: string[];
1212
+ constructor(fileName?: string, fileSize?: number, fileType?: string, errors?: string[]);
1213
+ static adapt(item?: any): InvalidFileInfoModel;
1214
+ }
1215
+ interface UploadValidationErrorInterface {
1216
+ invalidFiles: InvalidFileInfoModel[];
1217
+ validFilesCount: number;
1218
+ totalFilesCount: number;
1219
+ }
1220
+ declare class UploadValidationErrorModel implements UploadValidationErrorInterface {
1221
+ invalidFiles: InvalidFileInfoModel[];
1222
+ validFilesCount: number;
1223
+ totalFilesCount: number;
1224
+ constructor(invalidFiles?: InvalidFileInfoModel[], validFilesCount?: number, totalFilesCount?: number);
1225
+ static adapt(item?: any): UploadValidationErrorModel;
1226
+ }
1227
+
1186
1228
  interface UserDataInterface {
1187
1229
  ldap: string;
1188
1230
  name: string;
@@ -1478,6 +1520,7 @@ declare class HTTPManagerService<T> extends RequestService {
1478
1520
  }>(data: T, options: ApiRequest, params?: any[]): Observable<T>;
1479
1521
  deleteRequest<T>(options: ApiRequest, params?: any[]): Observable<T>;
1480
1522
  downloadRequest<T>(options: ApiRequest, params?: any[], saveAs?: string): Observable<T>;
1523
+ uploadRequest<T>(files: File | File[], options: ApiRequest, params?: any[]): Observable<T>;
1481
1524
  private createObservable;
1482
1525
  private createRequest;
1483
1526
  private prepareRequestData;
@@ -1551,6 +1594,9 @@ declare class RequestSignalsService extends WebsocketService {
1551
1594
  private request;
1552
1595
  private requestStreamingOperator;
1553
1596
  downloadFileRequest(options: ApiRequest): Observable<any>;
1597
+ uploadFileRequest(options: ApiRequest): Observable<any>;
1598
+ private validateUploadFiles;
1599
+ private buildFormData;
1554
1600
  private handleFinalize;
1555
1601
  private downloadFile;
1556
1602
  private createFileType;
@@ -1668,6 +1714,7 @@ declare class HTTPManagerSignalsService<T> extends RequestSignalsService {
1668
1714
  }>(data: T, options: ApiRequest, params?: any[]): Observable<T>;
1669
1715
  deleteRequest<T>(options: ApiRequest, params?: any[]): Observable<T>;
1670
1716
  downloadRequest<T>(options: ApiRequest, params?: any[], saveAs?: string): Observable<T>;
1717
+ uploadRequest<T>(files: File | File[], options: ApiRequest, params?: any[]): Observable<T>;
1671
1718
  private createObservable;
1672
1719
  private createRequest;
1673
1720
  private prepareRequestData;
@@ -2237,6 +2284,12 @@ declare class HttpRequestServicesDemoComponent implements OnInit {
2237
2284
  new: boolean;
2238
2285
  divider?: undefined;
2239
2286
  disabled?: undefined;
2287
+ } | {
2288
+ name: string;
2289
+ value: string;
2290
+ new: boolean;
2291
+ divider: boolean;
2292
+ disabled?: undefined;
2240
2293
  } | {
2241
2294
  name: string;
2242
2295
  value: string;
@@ -3456,6 +3509,42 @@ declare class WsChatsComponent implements OnInit {
3456
3509
  static ɵcmp: i0.ɵɵComponentDeclaration<WsChatsComponent, "app-ws-chats", never, {}, {}, never, never, false, never>;
3457
3510
  }
3458
3511
 
3512
+ interface UploadStateInterface {
3513
+ selectedFiles: File[];
3514
+ isUploading: boolean;
3515
+ progress: number;
3516
+ currentFile: string | null;
3517
+ errorMessage: string | null;
3518
+ successMessage: string | null;
3519
+ }
3520
+ declare class UploadStateModel implements UploadStateInterface {
3521
+ selectedFiles: File[];
3522
+ isUploading: boolean;
3523
+ progress: number;
3524
+ currentFile: string | null;
3525
+ errorMessage: string | null;
3526
+ successMessage: string | null;
3527
+ constructor(selectedFiles?: File[], isUploading?: boolean, progress?: number, currentFile?: string | null, errorMessage?: string | null, successMessage?: string | null);
3528
+ static adapt(item?: any): UploadStateModel;
3529
+ }
3530
+
3531
+ declare class UploadDemoComponent implements OnInit, OnDestroy {
3532
+ private httpManager;
3533
+ private toastService;
3534
+ uploadState: UploadStateModel;
3535
+ allowedTypes: string[];
3536
+ maxFileSize: number;
3537
+ ngOnInit(): void;
3538
+ ngOnDestroy(): void;
3539
+ onFileSelected(event: Event): void;
3540
+ validateFile(file: File): string | null;
3541
+ clearSelection(): void;
3542
+ startUpload(): void;
3543
+ getFileSizeString(size: number): string;
3544
+ static ɵfac: i0.ɵɵFactoryDeclaration<UploadDemoComponent, never>;
3545
+ static ɵcmp: i0.ɵɵComponentDeclaration<UploadDemoComponent, "lib-upload-demo", never, {}, {}, never, never, false, never>;
3546
+ }
3547
+
3459
3548
  declare class SpinnerComponent implements OnInit {
3460
3549
  color: ThemePalette;
3461
3550
  diameter?: number;
@@ -3537,7 +3626,7 @@ declare class FileDownloaderModule {
3537
3626
  declare class HttpRequestManagerModule {
3538
3627
  static forRoot(config?: ConfigOptions): ModuleWithProviders<HttpRequestManagerModule>;
3539
3628
  static ɵfac: i0.ɵɵFactoryDeclaration<HttpRequestManagerModule, never>;
3540
- static ɵmod: i0.ɵɵNgModuleDeclaration<HttpRequestManagerModule, [typeof RequestManagerBasicDemoComponent, typeof HttpRequestServicesDemoComponent, typeof RequestManagerStateDemoComponent, typeof RequestManagerDemoComponent, typeof RequestSignalsManagerDemoComponent, typeof LocalStorageDemoComponent, typeof LocalStorageSignalsDemoComponent, typeof RequestManagerWsDemoComponent, typeof StoreStateManagerDemoComponent, typeof DatabaseDataDemoComponent, typeof WsDataControlComponent, typeof WsMessagingComponent, typeof WsNotificationsComponent, typeof WsAiMessagingComponent, typeof WsChatsComponent], [typeof i4.CommonModule, typeof i17.ToastMessageDisplayModule, typeof _angular_forms.FormsModule, typeof _angular_forms.ReactiveFormsModule, typeof i7.MatButtonModule, typeof i20.MatTabsModule, typeof i21.MatSelectModule, typeof i22.MatChipsModule, typeof i23.MatMenuModule, typeof i5.MatIconModule, typeof i25.MatTableModule, typeof i26.MatButtonToggleModule, typeof i27.MatAutocompleteModule, typeof i28.MatProgressBarModule, typeof i6.MatProgressSpinnerModule, typeof i30.MatSlideToggleModule, typeof i31.MatDividerModule, typeof i32.MatFormFieldModule, typeof i33.MatInputModule, typeof i34.MatToolbarModule, typeof i30.MatSlideToggleModule, typeof i35.TranslateModule, typeof i36.MatSidenavModule, typeof i37.MatDatepickerModule, typeof i38.MatNativeDateModule, typeof i39.MatCardModule, typeof FileDownloaderModule], [typeof HttpRequestServicesDemoComponent]>;
3629
+ static ɵmod: i0.ɵɵNgModuleDeclaration<HttpRequestManagerModule, [typeof RequestManagerBasicDemoComponent, typeof HttpRequestServicesDemoComponent, typeof RequestManagerStateDemoComponent, typeof RequestManagerDemoComponent, typeof RequestSignalsManagerDemoComponent, typeof LocalStorageDemoComponent, typeof LocalStorageSignalsDemoComponent, typeof RequestManagerWsDemoComponent, typeof StoreStateManagerDemoComponent, typeof DatabaseDataDemoComponent, typeof WsDataControlComponent, typeof WsMessagingComponent, typeof WsNotificationsComponent, typeof WsAiMessagingComponent, typeof WsChatsComponent, typeof UploadDemoComponent], [typeof i4.CommonModule, typeof i18.ToastMessageDisplayModule, typeof _angular_forms.FormsModule, typeof _angular_forms.ReactiveFormsModule, typeof i7.MatButtonModule, typeof i21.MatTabsModule, typeof i22.MatSelectModule, typeof i23.MatChipsModule, typeof i24.MatMenuModule, typeof i5.MatIconModule, typeof i26.MatTableModule, typeof i27.MatButtonToggleModule, typeof i28.MatAutocompleteModule, typeof i29.MatProgressBarModule, typeof i6.MatProgressSpinnerModule, typeof i31.MatSlideToggleModule, typeof i32.MatDividerModule, typeof i33.MatFormFieldModule, typeof i34.MatInputModule, typeof i35.MatToolbarModule, typeof i31.MatSlideToggleModule, typeof i36.TranslateModule, typeof i37.MatSidenavModule, typeof i38.MatDatepickerModule, typeof i39.MatNativeDateModule, typeof i40.MatCardModule, typeof FileDownloaderModule], [typeof HttpRequestServicesDemoComponent, typeof UploadDemoComponent]>;
3541
3630
  static ɵinj: i0.ɵɵInjectorDeclaration<HttpRequestManagerModule>;
3542
3631
  }
3543
3632
 
@@ -3556,5 +3645,5 @@ declare class StoreStateSignalsDemoComponent implements OnInit {
3556
3645
  static ɵcmp: i0.ɵɵComponentDeclaration<StoreStateSignalsDemoComponent, "app-store-state-signals-demo", never, {}, {}, never, never, false, never>;
3557
3646
  }
3558
3647
 
3559
- 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, LocalStorageDemoComponent, LocalStorageManagerService, LocalStorageOptions, LocalStorageSignalsDemoComponent, LocalStorageSignalsManagerService, LoggerService, NotificationMessage, PathQueryService, PublicMessage, Random, RandomHSLColor, RandomHexColor, RandomNumber, RandomNumbers, RandomNumbersUnique, RandomPaletteColor, RandomSignature, RandomStr, RandomVisibleColor, RequestErrorInterceptor, RequestHeadersInterceptor, RequestManagerDemoComponent, RequestManagerStateDemoComponent, RequestOptions, RequestService, RequestSignalsService, RetryOptions, SettingOptions, StateMessage, StateStorageOptions, StorageData, StorageOption, StorageType, StoreStateManagerService, StoreStateManagerSignalsService, StoreStateSignalsDemoComponent, StreamType, SymmetricalEncryptionService, TableSchemaDef, UUID, UUID_STR, UserData, UtilsService, WSOptions, WebSocketMessageService, WithCredentialsInterceptor, calculateBatchProgress, countdown, createChannelName, delayedRetry, isErrorState, isPendingState, isSuccessState, requestPolling, requestStreaming, streamAI, streamAuto, streamEvents, streamJSON, streamNDJSON };
3560
- export type { APIStateManagerData, ApiRequestInterface, BatchErrorState, BatchOptionsInterface, BatchPendingState, BatchProgress, BatchRequestState, BatchResultInterface, BatchSuccessState, ConfigHTTPOptionsInterface, ConfigOptionsInterface, DatabaseStorageInterface, ErrorDisplaySettingsInterface, GlobalStoreOptionsInterface, LocalStorageOptionsInterface, NotificationMessageInterface, ParsingResult, PublicMessageInterface, RequestOptionsInterface, RetryOptionsInterface, SettingOptionsInterface, State, StateMessageInterface, StateStorageOptionsInterface, StateStoreManagerData$1 as StateStoreManagerData, StorageDataInterface, StorageOptionInterface, StreamConfig, StreamEvent, TableRecord, TableSchemaDefInterface, UserDataInterface, WSOptionsInterface };
3648
+ 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, NotificationMessage, PathQueryService, PublicMessage, Random, RandomHSLColor, RandomHexColor, RandomNumber, RandomNumbers, RandomNumbersUnique, RandomPaletteColor, RandomSignature, RandomStr, RandomVisibleColor, RequestErrorInterceptor, RequestHeadersInterceptor, RequestManagerDemoComponent, RequestManagerStateDemoComponent, RequestOptions, RequestService, RequestSignalsService, RetryOptions, SettingOptions, StateMessage, 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 };
3649
+ export type { APIStateManagerData, ApiRequestInterface, BatchErrorState, BatchOptionsInterface, BatchPendingState, BatchProgress, BatchRequestState, BatchResultInterface, BatchSuccessState, ConfigHTTPOptionsInterface, ConfigOptionsInterface, DatabaseStorageInterface, ErrorDisplaySettingsInterface, GlobalStoreOptionsInterface, InvalidFileInfoInterface, LocalStorageOptionsInterface, NotificationMessageInterface, ParsingResult, PublicMessageInterface, RequestOptionsInterface, RetryOptionsInterface, SettingOptionsInterface, State, StateMessageInterface, StateStorageOptionsInterface, StateStoreManagerData$1 as StateStoreManagerData, StorageDataInterface, StorageOptionInterface, StreamConfig, StreamEvent, TableRecord, TableSchemaDefInterface, UploadValidationErrorInterface, UserDataInterface, WSOptionsInterface };
Binary file