http-request-manager 0.0.20 → 4.1.2

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.
Files changed (79) hide show
  1. package/README.md +44 -253
  2. package/esm2022/lib/http-request-manager.module.mjs +145 -0
  3. package/esm2022/lib/http-request-services-demo/http-request-services-demo.component.mjs +41 -0
  4. package/esm2022/lib/http-request-services-demo/local-storage-demo/local-storage-demo.component.mjs +175 -0
  5. package/esm2022/lib/http-request-services-demo/request-manager-demo/file-downloader/download-file/download-file.component.mjs +80 -0
  6. package/esm2022/lib/http-request-services-demo/request-manager-demo/file-downloader/file-download.module.mjs +42 -0
  7. package/esm2022/lib/http-request-services-demo/request-manager-demo/file-downloader/file-downloader.component.mjs +85 -0
  8. package/esm2022/lib/http-request-services-demo/request-manager-demo/file-downloader/models/download-labels-model.mjs +11 -0
  9. package/esm2022/lib/http-request-services-demo/request-manager-demo/file-downloader/spinner/spinner.component.mjs +29 -0
  10. package/esm2022/lib/http-request-services-demo/request-manager-demo/models/sample-ai-prompt.mjs +9 -0
  11. package/esm2022/lib/http-request-services-demo/request-manager-demo/models/sample-client-info.mjs +12 -0
  12. package/esm2022/lib/http-request-services-demo/request-manager-demo/models/sample-mapper-client-info.mjs +10 -0
  13. package/esm2022/lib/http-request-services-demo/request-manager-demo/request-manager-demo.component.mjs +276 -0
  14. package/esm2022/lib/http-request-services-demo/request-manager-state-demo/request-manager-state-demo.component.mjs +268 -0
  15. package/esm2022/lib/http-request-services-demo/request-manager-state-demo/services/state-manager-demo.service.mjs +75 -0
  16. package/esm2022/lib/index.mjs +4 -0
  17. package/esm2022/lib/interceptors/proxy-debugger.interceptor.mjs +47 -0
  18. package/esm2022/lib/interceptors/request-error.interceptor.mjs +5 -5
  19. package/esm2022/lib/models/config-http-options.model.mjs +18 -0
  20. package/esm2022/lib/models/config-local-storage-options.model.mjs +12 -0
  21. package/esm2022/lib/models/config-options.model.mjs +12 -0
  22. package/esm2022/lib/models/config-token.model.mjs +8 -0
  23. package/esm2022/lib/models/index.mjs +4 -1
  24. package/esm2022/lib/models/retry-options.model.mjs +3 -3
  25. package/esm2022/lib/services/index.mjs +1 -1
  26. package/esm2022/lib/services/local-storage-manager-service/local-storage-manager.service.mjs +34 -9
  27. package/esm2022/lib/services/local-storage-manager-service/models/index.mjs +1 -2
  28. package/esm2022/lib/services/local-storage-manager-service/models/setting-options.model.mjs +2 -2
  29. package/esm2022/lib/services/local-storage-manager-service/models/storage-option.model.mjs +3 -3
  30. package/esm2022/lib/services/request-manager-services/http-manager.service.mjs +87 -51
  31. package/esm2022/lib/services/request-manager-services/request.service.mjs +70 -28
  32. package/esm2022/lib/services/request-manager-services/rxjs-operators/delay-retry.mjs +7 -5
  33. package/esm2022/lib/services/request-manager-services/rxjs-operators/request-streaming.mjs +1 -1
  34. package/esm2022/lib/services/request-manager-state-service/http-manager-state.store.mjs +6 -39
  35. package/esm2022/lib/services/utils/app.service.mjs +7 -1
  36. package/esm2022/lib/services/utils/object-merger.service.mjs +34 -0
  37. package/esm2022/lib/services/utils/path-query.service.mjs +2 -1
  38. package/esm2022/lib/services/utils/utils.service.mjs +23 -2
  39. package/esm2022/public-api.mjs +4 -4
  40. package/fesm2022/http-request-manager.mjs +1782 -435
  41. package/fesm2022/http-request-manager.mjs.map +1 -1
  42. package/http-request-manager-4.1.2.tgz +0 -0
  43. package/lib/http-request-manager.module.d.ts +33 -0
  44. package/lib/http-request-services-demo/http-request-services-demo.component.d.ts +24 -0
  45. package/lib/http-request-services-demo/local-storage-demo/local-storage-demo.component.d.ts +56 -0
  46. package/lib/http-request-services-demo/request-manager-demo/file-downloader/download-file/download-file.component.d.ts +26 -0
  47. package/lib/http-request-services-demo/request-manager-demo/file-downloader/file-download.module.d.ts +13 -0
  48. package/lib/http-request-services-demo/request-manager-demo/file-downloader/file-downloader.component.d.ts +26 -0
  49. package/lib/http-request-services-demo/request-manager-demo/file-downloader/models/download-labels-model.d.ts +12 -0
  50. package/lib/http-request-services-demo/request-manager-demo/file-downloader/spinner/spinner.component.d.ts +16 -0
  51. package/lib/http-request-services-demo/request-manager-demo/models/sample-ai-prompt.d.ts +8 -0
  52. package/lib/http-request-services-demo/request-manager-demo/models/sample-client-info.d.ts +14 -0
  53. package/lib/http-request-services-demo/request-manager-demo/models/sample-mapper-client-info.d.ts +10 -0
  54. package/lib/http-request-services-demo/request-manager-demo/request-manager-demo.component.d.ts +98 -0
  55. package/lib/http-request-services-demo/request-manager-state-demo/request-manager-state-demo.component.d.ts +110 -0
  56. package/lib/http-request-services-demo/request-manager-state-demo/services/state-manager-demo.service.d.ts +16 -0
  57. package/lib/index.d.ts +3 -0
  58. package/lib/interceptors/proxy-debugger.interceptor.d.ts +12 -0
  59. package/lib/interceptors/request-error.interceptor.d.ts +1 -1
  60. package/lib/models/config-http-options.model.d.ts +21 -0
  61. package/lib/models/config-local-storage-options.model.d.ts +13 -0
  62. package/lib/models/config-options.model.d.ts +12 -0
  63. package/lib/models/config-token.model.d.ts +8 -0
  64. package/lib/models/index.d.ts +3 -0
  65. package/lib/services/local-storage-manager-service/local-storage-manager.service.d.ts +7 -2
  66. package/lib/services/local-storage-manager-service/models/index.d.ts +0 -1
  67. package/lib/services/local-storage-manager-service/models/setting-options.model.d.ts +2 -2
  68. package/lib/services/local-storage-manager-service/models/storage-option.model.d.ts +4 -4
  69. package/lib/services/request-manager-services/http-manager.service.d.ts +12 -7
  70. package/lib/services/request-manager-services/request.service.d.ts +1 -0
  71. package/lib/services/request-manager-services/rxjs-operators/delay-retry.d.ts +1 -1
  72. package/lib/services/request-manager-state-service/http-manager-state.store.d.ts +11 -15
  73. package/lib/services/utils/object-merger.service.d.ts +7 -0
  74. package/lib/services/utils/utils.service.d.ts +1 -1
  75. package/package.json +27 -18
  76. package/public-api.d.ts +3 -3
  77. package/esm2022/lib/services/local-storage-manager-service/models/storage-option-settings.model.mjs +0 -13
  78. package/http-request-manager-0.0.20.tgz +0 -0
  79. package/lib/services/local-storage-manager-service/models/storage-option-settings.model.d.ts +0 -15
Binary file
@@ -0,0 +1,33 @@
1
+ import { ModuleWithProviders } from '@angular/core';
2
+ import { ConfigOptions } from './models';
3
+ import * as i0 from "@angular/core";
4
+ import * as i1 from "./http-request-services-demo/http-request-services-demo.component";
5
+ import * as i2 from "./http-request-services-demo/request-manager-state-demo/request-manager-state-demo.component";
6
+ import * as i3 from "./http-request-services-demo/request-manager-demo/request-manager-demo.component";
7
+ import * as i4 from "./http-request-services-demo/local-storage-demo/local-storage-demo.component";
8
+ import * as i5 from "@angular/common";
9
+ import * as i6 from "toast-message-display";
10
+ import * as i7 from "@angular/forms";
11
+ import * as i8 from "@angular/material/button";
12
+ import * as i9 from "@angular/material/select";
13
+ import * as i10 from "@angular/material/chips";
14
+ import * as i11 from "@angular/material/menu";
15
+ import * as i12 from "@angular/material/icon";
16
+ import * as i13 from "@angular/material/table";
17
+ import * as i14 from "@angular/material/toolbar";
18
+ import * as i15 from "@angular/material/button-toggle";
19
+ import * as i16 from "@angular/material/autocomplete";
20
+ import * as i17 from "@angular/material/progress-bar";
21
+ import * as i18 from "@angular/material/slide-toggle";
22
+ import * as i19 from "@angular/material/divider";
23
+ import * as i20 from "@angular/material/form-field";
24
+ import * as i21 from "@angular/material/input";
25
+ import * as i22 from "@ngx-translate/core";
26
+ import * as i23 from "@angular/material/sidenav";
27
+ import * as i24 from "./http-request-services-demo/request-manager-demo/file-downloader/file-download.module";
28
+ export declare class HttpRequestManagerModule {
29
+ static forRoot(config?: ConfigOptions): ModuleWithProviders<HttpRequestManagerModule>;
30
+ static ɵfac: i0.ɵɵFactoryDeclaration<HttpRequestManagerModule, never>;
31
+ static ɵmod: i0.ɵɵNgModuleDeclaration<HttpRequestManagerModule, [typeof i1.HttpRequestServicesDemoComponent, typeof i2.RequestManagerStateDemoComponent, typeof i3.RequestManagerDemoComponent, typeof i4.LocalStorageDemoComponent], [typeof i5.CommonModule, typeof i6.ToastMessageModule, typeof i7.FormsModule, typeof i7.ReactiveFormsModule, typeof i8.MatButtonModule, typeof i9.MatSelectModule, typeof i10.MatChipsModule, typeof i11.MatMenuModule, typeof i12.MatIconModule, typeof i13.MatTableModule, typeof i14.MatToolbarModule, typeof i15.MatButtonToggleModule, typeof i16.MatAutocompleteModule, typeof i17.MatProgressBarModule, typeof i18.MatSlideToggleModule, typeof i19.MatDividerModule, typeof i20.MatFormFieldModule, typeof i21.MatInputModule, typeof i18.MatSlideToggleModule, typeof i22.TranslateModule, typeof i23.MatSidenavModule, typeof i24.FileDownloaderModule], [typeof i1.HttpRequestServicesDemoComponent]>;
32
+ static ɵinj: i0.ɵɵInjectorDeclaration<HttpRequestManagerModule>;
33
+ }
@@ -0,0 +1,24 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { ConfigOptions } from '../models/config-options.model';
3
+ import * as i0 from "@angular/core";
4
+ export declare class HttpRequestServicesDemoComponent implements OnInit {
5
+ private configOptions?;
6
+ requestTypes: ({
7
+ name: string;
8
+ value: string;
9
+ divider?: undefined;
10
+ disabled?: undefined;
11
+ } | {
12
+ name: string;
13
+ value: string;
14
+ divider: boolean;
15
+ disabled: boolean;
16
+ })[];
17
+ selectedService: string;
18
+ injectionOptions?: ConfigOptions;
19
+ constructor(configOptions?: ConfigOptions | undefined);
20
+ ngOnInit(): void;
21
+ onSelected(type: number): void;
22
+ static ɵfac: i0.ɵɵFactoryDeclaration<HttpRequestServicesDemoComponent, never>;
23
+ static ɵcmp: i0.ɵɵComponentDeclaration<HttpRequestServicesDemoComponent, "app-http-request-services-demo", never, {}, {}, never, never, false, never>;
24
+ }
@@ -0,0 +1,56 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { LocalStorageManagerService, SettingOptions, StorageOption, StorageType } from '../../services/local-storage-manager-service';
3
+ import { FormBuilder } from '@angular/forms';
4
+ import { BehaviorSubject, Observable } from 'rxjs';
5
+ import { ConfigOptions, LocalStorageOptions, UtilsService } from '../../services';
6
+ import * as i0 from "@angular/core";
7
+ export declare class LocalStorageDemoComponent implements OnInit {
8
+ private configOptions?;
9
+ fb: FormBuilder;
10
+ utils: UtilsService;
11
+ type$: BehaviorSubject<StorageType>;
12
+ get type(): number;
13
+ typeControl: import("@angular/forms").FormControl<string | null>;
14
+ localStorageManagerService: LocalStorageManagerService;
15
+ settings$: Observable<any>;
16
+ setting$: (store: string) => Observable<StorageOption | null>;
17
+ storageForm: import("@angular/forms").FormGroup<{
18
+ store: import("@angular/forms").FormControl<string | null>;
19
+ type: import("@angular/forms").FormControl<string | null>;
20
+ settingType: import("@angular/forms").FormControl<string | null>;
21
+ encrypted: import("@angular/forms").FormControl<boolean | null>;
22
+ data: import("@angular/forms").FormControl<string | null>;
23
+ }>;
24
+ newStoreForm: import("@angular/forms").FormGroup<{
25
+ name: import("@angular/forms").FormControl<string | null>;
26
+ storage: import("@angular/forms").FormControl<string | null>;
27
+ encrypted: import("@angular/forms").FormControl<boolean | null>;
28
+ data: import("@angular/forms").FormControl<string | null>;
29
+ expiresIn: import("@angular/forms").FormControl<string | null>;
30
+ }>;
31
+ store$?: Observable<any>;
32
+ storeData$: Observable<any> | undefined;
33
+ expiresIn: (epoch: number) => string | undefined;
34
+ get isValid(): boolean;
35
+ get isValidData(): boolean;
36
+ isValidJSON: (str: string) => boolean;
37
+ displayedColumns: string[];
38
+ filterData: (values: SettingOptions[]) => SettingOptions[];
39
+ data$?: Observable<any>;
40
+ store: any;
41
+ create: boolean;
42
+ storeProps?: LocalStorageOptions;
43
+ options?: SettingOptions;
44
+ constructor(configOptions?: ConfigOptions | undefined);
45
+ ngOnInit(): void;
46
+ onCreateStore(): void;
47
+ onUpdateStore(store: any): void;
48
+ onSelectedRow(store: any): void;
49
+ onCreate(): void;
50
+ onDelete(store: StorageOption): void;
51
+ onCancel(): void;
52
+ onUpdate(store: StorageOption, data: any): void;
53
+ onReset(): void;
54
+ static ɵfac: i0.ɵɵFactoryDeclaration<LocalStorageDemoComponent, never>;
55
+ static ɵcmp: i0.ɵɵComponentDeclaration<LocalStorageDemoComponent, "app-local-storage-demo", never, {}, {}, never, never, false, never>;
56
+ }
@@ -0,0 +1,26 @@
1
+ import { EventEmitter, OnInit } from '@angular/core';
2
+ import { ProgressSpinnerMode } from '@angular/material/progress-spinner';
3
+ import * as i0 from "@angular/core";
4
+ export declare class DownloadFileComponent implements OnInit {
5
+ private subscriptions;
6
+ event?: Function;
7
+ displayError: number;
8
+ diameter: number;
9
+ mode: ProgressSpinnerMode;
10
+ isPending: boolean;
11
+ active: boolean;
12
+ disabled: boolean;
13
+ error: EventEmitter<void>;
14
+ private _progress;
15
+ set progress(value: any);
16
+ get progress(): any;
17
+ private _hasError;
18
+ private errorTimerActive;
19
+ set hasError(value: boolean | any);
20
+ get hasError(): boolean | any;
21
+ ngOnInit(): void;
22
+ onAction(): void;
23
+ ngOnDestroy(): void;
24
+ static ɵfac: i0.ɵɵFactoryDeclaration<DownloadFileComponent, never>;
25
+ static ɵcmp: i0.ɵɵComponentDeclaration<DownloadFileComponent, "app-download-file", never, { "event": { "alias": "event"; "required": false; }; "displayError": { "alias": "displayError"; "required": false; }; "diameter": { "alias": "diameter"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "isPending": { "alias": "isPending"; "required": false; }; "active": { "alias": "active"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "progress": { "alias": "progress"; "required": false; }; "hasError": { "alias": "hasError"; "required": false; }; }, { "error": "error"; }, never, never, false, never>;
26
+ }
@@ -0,0 +1,13 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./spinner/spinner.component";
3
+ import * as i2 from "./download-file/download-file.component";
4
+ import * as i3 from "./file-downloader.component";
5
+ import * as i4 from "@angular/common";
6
+ import * as i5 from "@angular/material/icon";
7
+ import * as i6 from "@angular/material/progress-spinner";
8
+ import * as i7 from "@angular/material/button";
9
+ export declare class FileDownloaderModule {
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<FileDownloaderModule, never>;
11
+ static ɵmod: i0.ɵɵNgModuleDeclaration<FileDownloaderModule, [typeof i1.SpinnerComponent, typeof i2.DownloadFileComponent, typeof i3.FileDownloaderComponent], [typeof i4.CommonModule, typeof i5.MatIconModule, typeof i6.MatProgressSpinnerModule, typeof i7.MatButtonModule], [typeof i3.FileDownloaderComponent]>;
12
+ static ɵinj: i0.ɵɵInjectorDeclaration<FileDownloaderModule>;
13
+ }
@@ -0,0 +1,26 @@
1
+ import { EventEmitter, OnInit } from '@angular/core';
2
+ import { DownloadLabels } from './models/download-labels-model';
3
+ import { HTTPManagerService } from '../../../services/request-manager-services';
4
+ import { ApiRequest } from '../../../services';
5
+ import { Subscription } from 'rxjs';
6
+ import * as i0 from "@angular/core";
7
+ export declare class FileDownloaderComponent extends HTTPManagerService<any> implements OnInit {
8
+ delayError: number;
9
+ apiRequest: ApiRequest;
10
+ displayErrorMessage: boolean;
11
+ _labels: import("./models/download-labels-model").DownloadLabelsInterface;
12
+ set labels(value: DownloadLabels);
13
+ active: boolean;
14
+ subscription: Subscription;
15
+ get labels(): DownloadLabels;
16
+ completed: EventEmitter<void>;
17
+ failed: EventEmitter<string>;
18
+ disabled: boolean;
19
+ constructor();
20
+ ngOnInit(): void;
21
+ onDownloadStreaming(): Subscription | undefined;
22
+ onError(message: string): void;
23
+ OnDestroy(): void;
24
+ static ɵfac: i0.ɵɵFactoryDeclaration<FileDownloaderComponent, never>;
25
+ static ɵcmp: i0.ɵɵComponentDeclaration<FileDownloaderComponent, "app-file-downloader", never, { "delayError": { "alias": "delayError"; "required": false; }; "apiRequest": { "alias": "apiRequest"; "required": false; }; "displayErrorMessage": { "alias": "displayErrorMessage"; "required": false; }; "labels": { "alias": "labels"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "completed": "completed"; "failed": "failed"; }, never, never, false, never>;
26
+ }
@@ -0,0 +1,12 @@
1
+ export interface DownloadLabelsInterface {
2
+ error: string;
3
+ action: string;
4
+ icon: string;
5
+ }
6
+ export declare class DownloadLabels implements DownloadLabelsInterface {
7
+ error: string;
8
+ action: string;
9
+ icon: string;
10
+ constructor(error?: string, action?: string, icon?: string);
11
+ static adapt(item?: any): DownloadLabelsInterface;
12
+ }
@@ -0,0 +1,16 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { ThemePalette } from '@angular/material/core';
3
+ import { ProgressSpinnerMode } from '@angular/material/progress-spinner';
4
+ import * as i0 from "@angular/core";
5
+ export declare class SpinnerComponent implements OnInit {
6
+ color: ThemePalette;
7
+ diameter?: number;
8
+ display?: string | number;
9
+ mode?: ProgressSpinnerMode;
10
+ strokeWidth?: number;
11
+ value: number;
12
+ constructor();
13
+ ngOnInit(): void;
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<SpinnerComponent, never>;
15
+ static ɵcmp: i0.ɵɵComponentDeclaration<SpinnerComponent, "app-spinner", never, { "color": { "alias": "color"; "required": false; }; "diameter": { "alias": "diameter"; "required": false; }; "display": { "alias": "display"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "strokeWidth": { "alias": "strokeWidth"; "required": false; }; "value": { "alias": "value"; "required": false; }; }, {}, never, never, false, never>;
16
+ }
@@ -0,0 +1,8 @@
1
+ export interface AIPromptInterface {
2
+ response: string;
3
+ }
4
+ export declare class AIPrompt implements AIPromptInterface {
5
+ response: string;
6
+ constructor(response?: string);
7
+ static adapt(item?: any): AIPrompt;
8
+ }
@@ -0,0 +1,14 @@
1
+ export interface ClientInfoInterface {
2
+ domain: string;
3
+ service: string;
4
+ id: number;
5
+ name: string;
6
+ }
7
+ export declare class ClientInfo implements ClientInfoInterface {
8
+ domain: string;
9
+ service: string;
10
+ id: number;
11
+ name: string;
12
+ constructor(domain?: string, service?: string, id?: number, name?: string);
13
+ static adapt(item?: any): ClientInfo;
14
+ }
@@ -0,0 +1,10 @@
1
+ export interface ClientInfoMapperInterface {
2
+ id: number;
3
+ name: string;
4
+ }
5
+ export declare class ClientInfoMapper implements ClientInfoMapperInterface {
6
+ id: number;
7
+ name: string;
8
+ constructor(id?: number, name?: string);
9
+ static adapt(item?: any): ClientInfoMapper;
10
+ }
@@ -0,0 +1,98 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { BehaviorSubject, Observable } from 'rxjs';
3
+ import { FormArray } from '@angular/forms';
4
+ import { ClientInfo } from './models/sample-client-info';
5
+ import { ClientInfoMapper } from './models/sample-mapper-client-info';
6
+ import { AIPrompt } from './models/sample-ai-prompt';
7
+ import { ApiRequest, HTTPManagerService } from '../..';
8
+ import * as i0 from "@angular/core";
9
+ export declare class RequestManagerDemoComponent implements OnInit {
10
+ displayedColumns: string[];
11
+ private fb;
12
+ private toastMessage;
13
+ httpManagerService: HTTPManagerService<any>;
14
+ isPending$: Observable<boolean>;
15
+ countdown$: Observable<number>;
16
+ GET_error$: BehaviorSubject<string>;
17
+ POST_error$: BehaviorSubject<string>;
18
+ PUT_error$: BehaviorSubject<string>;
19
+ DELETE_error$: BehaviorSubject<string>;
20
+ STREAM_error$: BehaviorSubject<string>;
21
+ STREAM_AI_error$: BehaviorSubject<string>;
22
+ GET$?: Observable<any>;
23
+ POST$?: Observable<any>;
24
+ PUT$?: Observable<any>;
25
+ DELETE$?: Observable<any>;
26
+ STREAM_AI$?: Observable<any>;
27
+ STREAM$?: Observable<any>;
28
+ requestParams: {
29
+ GET: ApiRequest;
30
+ POST: ApiRequest;
31
+ PUT: ApiRequest;
32
+ DELETE: ApiRequest;
33
+ STREAM: ApiRequest;
34
+ };
35
+ failedState: any;
36
+ pollingState: any;
37
+ questionControl: import("@angular/forms").FormControl<string | null>;
38
+ downloadRequest: ApiRequest;
39
+ sampleClientData: {
40
+ id: number;
41
+ name: string;
42
+ domain: string;
43
+ service: string;
44
+ spiffe: string;
45
+ secret: string;
46
+ created: number;
47
+ modified: number;
48
+ icon: string;
49
+ imageFile: string;
50
+ };
51
+ requestForm: import("@angular/forms").FormGroup<{
52
+ path: import("@angular/forms").FormControl<string | null>;
53
+ headers: FormArray<import("@angular/forms").FormControl<unknown>>;
54
+ adapter: import("@angular/forms").FormControl<null>;
55
+ retry: import("@angular/forms").FormGroup<{
56
+ times: import("@angular/forms").FormControl<number | null>;
57
+ delay: import("@angular/forms").FormControl<number | null>;
58
+ }>;
59
+ polling: import("@angular/forms").FormControl<number | null>;
60
+ }>;
61
+ sampleAdaptors: ({
62
+ label: string;
63
+ value: typeof ClientInfo.adapt;
64
+ } | {
65
+ label: string;
66
+ value: typeof AIPrompt.adapt;
67
+ })[];
68
+ sampleMappers: ({
69
+ label: string;
70
+ value: typeof ClientInfoMapper.adapt;
71
+ } | {
72
+ label: string;
73
+ value: typeof AIPrompt.adapt;
74
+ })[];
75
+ get retry(): {
76
+ times: number | null;
77
+ delay: number | null;
78
+ } | undefined;
79
+ get headers(): FormArray;
80
+ get isValid(): boolean;
81
+ arrayObjectsToObjects: (arr: any[]) => any;
82
+ constructor();
83
+ ngOnInit(): void;
84
+ addHeader(): void;
85
+ removeHeader(index: number): void;
86
+ compileRequest(): ApiRequest;
87
+ onGetRequest(): void;
88
+ onCreateRequest(): void;
89
+ onUpdateRequest(): void;
90
+ onDeleteRequest(): void;
91
+ onStreamPostRequest(): void;
92
+ onStreamRequest(): void;
93
+ onDownloadCompleted(): void;
94
+ onDownloadFailed(err: string): void;
95
+ errorHandling(err: any, type: string): void;
96
+ static ɵfac: i0.ɵɵFactoryDeclaration<RequestManagerDemoComponent, never>;
97
+ static ɵcmp: i0.ɵɵComponentDeclaration<RequestManagerDemoComponent, "app-request-manager-demo", never, {}, {}, never, never, false, never>;
98
+ }
@@ -0,0 +1,110 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { StateManagerDemoService } from './services/state-manager-demo.service';
3
+ import { FormBuilder, FormArray } from '@angular/forms';
4
+ import { Observable, BehaviorSubject } from 'rxjs';
5
+ import { ClientInfo } from '../request-manager-demo/models/sample-client-info';
6
+ import { ClientInfoMapper } from '../request-manager-demo/models/sample-mapper-client-info';
7
+ import { AIPrompt } from '../request-manager-demo/models/sample-ai-prompt';
8
+ import { HTTPManagerService, ApiRequest } from '../../services';
9
+ import * as i0 from "@angular/core";
10
+ export declare class RequestManagerStateDemoComponent implements OnInit {
11
+ stateManagerDemoService: StateManagerDemoService;
12
+ displayedColumns: string[];
13
+ selectedRecord$?: Observable<ClientInfo | null>;
14
+ fb: FormBuilder;
15
+ httpManagerService: HTTPManagerService<any>;
16
+ isPending$: Observable<boolean>;
17
+ error$: Observable<boolean>;
18
+ countdown$: Observable<number>;
19
+ GET_error$: BehaviorSubject<string>;
20
+ POST_error$: BehaviorSubject<string>;
21
+ PUT_error$: BehaviorSubject<string>;
22
+ DELETE_error$: BehaviorSubject<string>;
23
+ STREAM_error$: BehaviorSubject<string>;
24
+ GET$: BehaviorSubject<any>;
25
+ POST$: BehaviorSubject<null>;
26
+ PUT$: BehaviorSubject<null>;
27
+ DELETE$: BehaviorSubject<null>;
28
+ STREAM: BehaviorSubject<null>;
29
+ STREAM$: Observable<null>;
30
+ STREAM_AI: BehaviorSubject<null>;
31
+ STREAM_AI$: Observable<any>;
32
+ failedState: any;
33
+ pollingState: any;
34
+ questionControl: import("@angular/forms").FormControl<string | null>;
35
+ requestType: string;
36
+ get dataObservable$(): BehaviorSubject<any> | BehaviorSubject<null>;
37
+ sampleClientData: {
38
+ id: number;
39
+ name: string;
40
+ domain: string;
41
+ service: string;
42
+ spiffe: string;
43
+ secret: string;
44
+ created: number;
45
+ modified: number;
46
+ icon: string;
47
+ imageFile: string;
48
+ };
49
+ selectedRecord: import("@angular/forms").FormControl<null>;
50
+ requestForm: import("@angular/forms").FormGroup<{
51
+ datatype: import("@angular/forms").FormControl<string | null>;
52
+ path: import("@angular/forms").FormControl<string | null>;
53
+ headers: FormArray<import("@angular/forms").FormControl<unknown>>;
54
+ adapter: import("@angular/forms").FormControl<null>;
55
+ mapper: import("@angular/forms").FormControl<null>;
56
+ retry: import("@angular/forms").FormGroup<{
57
+ times: import("@angular/forms").FormControl<number | null>;
58
+ delay: import("@angular/forms").FormControl<number | null>;
59
+ }>;
60
+ polling: import("@angular/forms").FormControl<number | null>;
61
+ database: import("@angular/forms").FormGroup<{
62
+ table: import("@angular/forms").FormControl<string | null>;
63
+ expiresIn: import("@angular/forms").FormControl<string | null>;
64
+ }>;
65
+ }>;
66
+ get hasChanged(): boolean;
67
+ get dataType(): string | null | undefined;
68
+ get database(): {
69
+ table: string | null;
70
+ expiresIn: string | null;
71
+ } | undefined;
72
+ get retry(): {
73
+ times: number | null;
74
+ delay: number | null;
75
+ } | undefined;
76
+ sampleAdaptors: ({
77
+ label: string;
78
+ value: typeof ClientInfo.adapt;
79
+ } | {
80
+ label: string;
81
+ value: typeof AIPrompt.adapt;
82
+ })[];
83
+ sampleMappers: ({
84
+ label: string;
85
+ value: typeof ClientInfoMapper.adapt;
86
+ } | {
87
+ label: string;
88
+ value: typeof AIPrompt.adapt;
89
+ })[];
90
+ get headers(): FormArray;
91
+ get isValid(): boolean;
92
+ arrayObjectsToObjects: (arr: any[]) => any;
93
+ constructor();
94
+ ngOnInit(): void;
95
+ addHeader(): void;
96
+ removeHeader(index: number): void;
97
+ compileRequest(): ApiRequest;
98
+ onSetStateOptions(): void;
99
+ onClearRecords(): void;
100
+ onRefreshRecords(): void;
101
+ onGetRequest(): void;
102
+ onCreateRequest(): void;
103
+ onUpdateRequest(): void;
104
+ onDeleteRequest(): void;
105
+ onStreamPostRequest(): void;
106
+ onStreamRequest(): void;
107
+ errorHandling(err: any, type: string): void;
108
+ static ɵfac: i0.ɵɵFactoryDeclaration<RequestManagerStateDemoComponent, never>;
109
+ static ɵcmp: i0.ɵɵComponentDeclaration<RequestManagerStateDemoComponent, "app-request-manager-state-demo", never, {}, {}, never, never, false, never>;
110
+ }
@@ -0,0 +1,16 @@
1
+ import { DataType, DatabaseStorage } from '../../../models';
2
+ import { HTTPManagerStateService, ApiRequest } from '../../../services';
3
+ import { ClientInfo } from '../../request-manager-demo/models/sample-client-info';
4
+ import * as i0 from "@angular/core";
5
+ export declare class StateManagerDemoService extends HTTPManagerStateService<any> {
6
+ constructor();
7
+ setAPIOptions(apiOptions: ApiRequest, dataType: DataType, database?: DatabaseStorage): void;
8
+ getClients(): void;
9
+ createClient(data: any): void;
10
+ updateClient(data: ClientInfo): void;
11
+ deleteClient(data: ClientInfo): void;
12
+ streamRequest(): void;
13
+ streamAIRequest(data: any): void;
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<StateManagerDemoService, never>;
15
+ static ɵprov: i0.ɵɵInjectableDeclaration<StateManagerDemoService>;
16
+ }
package/lib/index.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ export * from "./services/index";
2
+ export * from "./interceptors/index";
3
+ export * from "./models/index";
@@ -0,0 +1,12 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ import { HttpInterceptor, HttpRequest, HttpHandler, HttpEvent } from '@angular/common/http';
3
+ import { Observable } from 'rxjs';
4
+ import * as i0 from "@angular/core";
5
+ export declare const PROXY_CONFIG: InjectionToken<Record<string, any>>;
6
+ export declare class ProxyDebuggerInterceptor implements HttpInterceptor {
7
+ private proxyConfig;
8
+ constructor(proxyConfig: Record<string, any>);
9
+ intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<ProxyDebuggerInterceptor, [{ optional: true; }]>;
11
+ static ɵprov: i0.ɵɵInjectableDeclaration<ProxyDebuggerInterceptor>;
12
+ }
@@ -1,6 +1,6 @@
1
1
  import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';
2
2
  import { Observable } from 'rxjs';
3
- import { ToastMessageService } from 'toast-message';
3
+ import { ToastMessageService } from 'toast-message-display';
4
4
  import * as i0 from "@angular/core";
5
5
  export declare class RequestErrorInterceptor implements HttpInterceptor {
6
6
  toastMessage: ToastMessageService;
@@ -0,0 +1,21 @@
1
+ import { RetryOptions } from "./retry-options.model";
2
+ export interface ConfigHTTPOptionsInterface {
3
+ server: string;
4
+ path?: any[];
5
+ headers?: any;
6
+ polling?: number;
7
+ retry?: RetryOptions;
8
+ stream?: boolean;
9
+ displayError?: boolean;
10
+ }
11
+ export declare class ConfigHTTPOptions implements ConfigHTTPOptionsInterface {
12
+ server: string;
13
+ path?: any[] | undefined;
14
+ headers?: any;
15
+ polling?: number | undefined;
16
+ retry?: RetryOptions | undefined;
17
+ stream?: boolean | undefined;
18
+ displayError?: boolean | undefined;
19
+ constructor(server?: string, path?: any[] | undefined, headers?: any, polling?: number | undefined, retry?: RetryOptions | undefined, stream?: boolean | undefined, displayError?: boolean | undefined);
20
+ static adapt(item?: any): ConfigHTTPOptions;
21
+ }
@@ -0,0 +1,13 @@
1
+ import { SettingOptions } from "../services";
2
+ export interface LocalStorageOptionsInterface {
3
+ storageName?: string;
4
+ storageSettingsName?: string;
5
+ options?: SettingOptions;
6
+ }
7
+ export declare class LocalStorageOptions implements LocalStorageOptionsInterface {
8
+ storageName?: string | undefined;
9
+ storageSettingsName?: string | undefined;
10
+ options?: SettingOptions | undefined;
11
+ constructor(storageName?: string | undefined, storageSettingsName?: string | undefined, options?: SettingOptions | undefined);
12
+ static adapt(item?: any): LocalStorageOptions;
13
+ }
@@ -0,0 +1,12 @@
1
+ import { ConfigHTTPOptions } from "./config-http-options.model";
2
+ import { LocalStorageOptions } from "./config-local-storage-options.model";
3
+ export interface ConfigOptionsInterface {
4
+ httpRequestOptions?: ConfigHTTPOptions;
5
+ LocalStorageOptions?: LocalStorageOptions;
6
+ }
7
+ export declare class ConfigOptions implements ConfigOptionsInterface {
8
+ httpRequestOptions?: ConfigHTTPOptions | undefined;
9
+ LocalStorageOptions?: LocalStorageOptions | undefined;
10
+ constructor(httpRequestOptions?: ConfigHTTPOptions | undefined, LocalStorageOptions?: LocalStorageOptions | undefined);
11
+ static adapt(item?: any): ConfigOptions;
12
+ }
@@ -0,0 +1,8 @@
1
+ import { InjectionToken } from "@angular/core";
2
+ import { ConfigOptions } from "./config-options.model";
3
+ /**
4
+ * An injection token that provides the configuration settings for the application.
5
+ * This token can be used to inject the `ConfigSettings` instance into components or services
6
+ * that require access to the application configuration.
7
+ */
8
+ export declare const CONFIG_SETTINGS_TOKEN: InjectionToken<ConfigOptions>;
@@ -1,3 +1,6 @@
1
1
  export * from './database-storage.model';
2
2
  export * from './retry-options.model';
3
3
  export * from './data-type.enum';
4
+ export * from './config-http-options.model';
5
+ export * from './config-local-storage-options.model';
6
+ export * from './config-options.model';
@@ -7,6 +7,8 @@ import { SettingOptions } from './models/setting-options.model';
7
7
  import { StorageData } from './models/storage-data.model';
8
8
  import { EncryptionTestService } from '../utils/encryption/encryption-test.service';
9
9
  import { AppService } from '../utils/app.service';
10
+ import { ConfigOptions } from '../request-manager-services';
11
+ import { ObjectMergerService } from '../utils/object-merger.service';
10
12
  import * as i0 from "@angular/core";
11
13
  export interface State {
12
14
  localStores: StorageData[];
@@ -14,12 +16,15 @@ export interface State {
14
16
  settings: StorageOption[];
15
17
  }
16
18
  export declare class LocalStorageManagerService extends ComponentStore<State> implements OnDestroy {
19
+ private config;
17
20
  storageName: string;
18
21
  storageSettingsName: string;
22
+ defaultOptions: SettingOptions;
19
23
  stateRetrieved: boolean;
20
24
  encrypted: boolean;
21
25
  app: AppService;
22
26
  utils: UtilsService;
27
+ objectMergerService: ObjectMergerService;
23
28
  encryption: SymmetricalEncryptionService;
24
29
  encryptionTest: EncryptionTestService;
25
30
  private readonly data$;
@@ -31,7 +36,7 @@ export declare class LocalStorageManagerService extends ComponentStore<State> im
31
36
  persistence$: import("rxjs").Subscription;
32
37
  startTimer(): void;
33
38
  private updateState;
34
- constructor();
39
+ constructor(config: ConfigOptions);
35
40
  readonly setStore: (observableOrValue: {
36
41
  id: string;
37
42
  name: string;
@@ -69,7 +74,7 @@ export declare class LocalStorageManagerService extends ComponentStore<State> im
69
74
  resetStore(): void;
70
75
  private persistState;
71
76
  private expired;
72
- private retrieveState;
77
+ retrieveState(): void;
73
78
  private isObjectOrArray;
74
79
  private isString;
75
80
  private fixAndParseJSON;
@@ -1,6 +1,5 @@
1
1
  export * from "./global-store-options.model";
2
2
  export * from "./setting-options.model";
3
3
  export * from "./storage-data.model";
4
- export * from "./storage-option-settings.model";
5
4
  export * from "./storage-option.model";
6
5
  export * from "./storage-type.enum";
@@ -6,10 +6,10 @@ export interface SettingOptionsInterface {
6
6
  encrypted?: boolean;
7
7
  }
8
8
  export declare class SettingOptions implements SettingOptionsInterface {
9
- storage: StorageType;
9
+ storage?: StorageType | undefined;
10
10
  expires?: number | undefined;
11
11
  expiresIn?: string | undefined;
12
12
  encrypted?: boolean | undefined;
13
- constructor(storage?: StorageType, expires?: number | undefined, expiresIn?: string | undefined, encrypted?: boolean | undefined);
13
+ constructor(storage?: StorageType | undefined, expires?: number | undefined, expiresIn?: string | undefined, encrypted?: boolean | undefined);
14
14
  static adapt(item?: any): SettingOptions;
15
15
  }