@sumaris-net/ngx-components 2.4.57 → 2.4.59

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 (52) hide show
  1. package/doc/changelog.md +8 -0
  2. package/esm2020/public_api.mjs +11 -3
  3. package/esm2020/src/app/core/graphql/graphql.service.mjs +2 -2
  4. package/esm2020/src/app/core/graphql/graphql.utils.mjs +1 -1
  5. package/esm2020/src/app/core/services/network.service.mjs +17 -4
  6. package/esm2020/src/app/core/services/platform.service.mjs +24 -5
  7. package/esm2020/src/app/core/services/storage/entities-storage.service.mjs +2 -2
  8. package/esm2020/src/app/core/services/storage/entity-store.class.mjs +1 -1
  9. package/esm2020/src/app/core/table/table.class.mjs +1 -1
  10. package/esm2020/src/app/shared/debug/debug-service.class.mjs +3 -0
  11. package/esm2020/src/app/shared/file/json.utils.mjs +4 -4
  12. package/esm2020/src/app/shared/logging/log-level.model.mjs +48 -0
  13. package/esm2020/src/app/shared/logging/logger.model.mjs +47 -0
  14. package/esm2020/src/app/shared/logging/logging-service.class.mjs +121 -0
  15. package/esm2020/src/app/shared/logging/logging-service.config.mjs +2 -0
  16. package/esm2020/src/app/shared/logging/logging-service.module.mjs +30 -0
  17. package/esm2020/src/app/shared/shared.module.mjs +3 -3
  18. package/esm2020/src/app/shared/shared.testing.module.mjs +16 -8
  19. package/esm2020/src/app/shared/storage/storage-explorer.component.mjs +262 -0
  20. package/esm2020/src/app/shared/storage/storage-explorer.module.mjs +60 -0
  21. package/esm2020/src/app/shared/storage/storage.service.mjs +132 -0
  22. package/esm2020/src/app/shared/storage/storage.utils.mjs +13 -0
  23. package/esm2020/src/app/social/user-event/testing/user-event.testing.service.mjs +1 -1
  24. package/esm2020/src/environments/environment.class.mjs +1 -1
  25. package/esm2020/src/environments/environment.mjs +7 -2
  26. package/fesm2015/sumaris-net.ngx-components.mjs +965 -376
  27. package/fesm2015/sumaris-net.ngx-components.mjs.map +1 -1
  28. package/fesm2020/sumaris-net.ngx-components.mjs +941 -383
  29. package/fesm2020/sumaris-net.ngx-components.mjs.map +1 -1
  30. package/package.json +1 -1
  31. package/public_api.d.ts +10 -2
  32. package/src/app/core/graphql/graphql.service.d.ts +1 -1
  33. package/src/app/core/graphql/graphql.utils.d.ts +1 -1
  34. package/src/app/core/services/network.service.d.ts +5 -2
  35. package/src/app/core/services/platform.service.d.ts +6 -3
  36. package/src/app/core/services/storage/entities-storage.service.d.ts +1 -1
  37. package/src/app/core/services/storage/entity-store.class.d.ts +1 -1
  38. package/src/app/shared/debug/debug-service.class.d.ts +5 -0
  39. package/src/app/shared/logging/log-level.model.d.ts +38 -0
  40. package/src/app/shared/logging/logger.model.d.ts +68 -0
  41. package/src/app/shared/logging/logging-service.class.d.ts +39 -0
  42. package/src/app/shared/logging/logging-service.config.d.ts +25 -0
  43. package/src/app/shared/logging/logging-service.module.d.ts +9 -0
  44. package/src/app/shared/shared.testing.module.d.ts +2 -1
  45. package/src/app/shared/storage/storage-explorer.component.d.ts +58 -0
  46. package/src/app/shared/storage/storage-explorer.module.d.ts +16 -0
  47. package/src/app/shared/{services/storage → storage}/storage.service.d.ts +2 -2
  48. package/src/assets/i18n/fr.json +3 -0
  49. package/src/environments/environment.class.d.ts +2 -0
  50. package/esm2020/src/app/shared/services/storage/storage.service.mjs +0 -132
  51. package/esm2020/src/app/shared/services/storage/storage.utils.mjs +0 -13
  52. /package/src/app/shared/{services/storage → storage}/storage.utils.d.ts +0 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sumaris-net/ngx-components",
3
3
  "description": "SUMARiS Angular components",
4
- "version": "2.4.57",
4
+ "version": "2.4.59",
5
5
  "author": "contact@e-is.pro",
6
6
  "license": "AGPL-3.0",
7
7
  "readmeFilename": "README.md",
package/public_api.d.ts CHANGED
@@ -50,6 +50,13 @@ export * from './src/app/shared/image/gallery/image-gallery.component';
50
50
  export * from './src/app/shared/image/gallery/image-gallery.module';
51
51
  export * from './src/app/shared/image/image.model';
52
52
  export * from './src/app/shared/image/image.module';
53
+ export * from './src/app/shared/storage/storage-explorer.component';
54
+ export * from './src/app/shared/storage/storage-explorer.module';
55
+ export * from './src/app/shared/logging/log-level.model';
56
+ export * from './src/app/shared/logging/logger.model';
57
+ export * from './src/app/shared/logging/logging-service.class';
58
+ export * from './src/app/shared/logging/logging-service.config';
59
+ export * from './src/app/shared/logging/logging-service.module';
53
60
  export * from './src/app/shared/directives/directives.module';
54
61
  export * from './src/app/shared/directives/autofocus.directive';
55
62
  export * from './src/app/shared/directives/ng-var.directive';
@@ -85,9 +92,10 @@ export * from './src/app/shared/services/memory-entity-service.class';
85
92
  export * from './src/app/shared/services/progress-bar.service';
86
93
  export * from './src/app/shared/services/translate-context.service';
87
94
  export * from './src/app/shared/services/job.utils';
88
- export * from './src/app/shared/services/storage/storage.service';
89
- export * from './src/app/shared/services/storage/storage.utils';
95
+ export * from './src/app/shared/storage/storage.service';
96
+ export * from './src/app/shared/storage/storage.utils';
90
97
  export * from './src/app/shared/validator/form-error-adapter.class';
98
+ export * from './src/app/shared/debug/debug-service.class';
91
99
  export * from './src/app/shared/types';
92
100
  export * from './src/app/shared/dates';
93
101
  export * from './src/app/shared/functions';
@@ -14,7 +14,7 @@ import { Cache } from '@apollo/client/cache/core/types/Cache';
14
14
  import { CryptoService } from '../services/crypto.service';
15
15
  import { PropertiesMap } from '../../shared/types';
16
16
  import { StartableService } from '../../shared/services/startable-service.class';
17
- import { StorageService } from '../../shared/services/storage/storage.service';
17
+ import { StorageService } from '../../shared/storage/storage.service';
18
18
  import { DocumentNode } from 'graphql';
19
19
  import * as i0 from "@angular/core";
20
20
  export interface WatchQueryOptions<V> {
@@ -2,7 +2,7 @@ import { ApolloClient, ApolloLink, Operation } from '@apollo/client/core';
2
2
  import { Observable } from 'rxjs';
3
3
  import { PersistentStorage } from 'apollo3-cache-persist';
4
4
  import { ConnectionType } from '../services/network.types';
5
- import { StorageService } from '../../shared/services/storage/storage.service';
5
+ import { StorageService } from '../../shared/storage/storage.service';
6
6
  export declare const NativeWebSocket: any;
7
7
  export declare type EmptyObject = {
8
8
  [key: string]: any;
@@ -15,6 +15,7 @@ import { OverlayEventDetail } from '@ionic/core';
15
15
  import { AppManifest, NodeInfo } from './network.utils';
16
16
  import { StartableObservableService } from '../../shared/services/startable-observable-service.class';
17
17
  import { ConnectionType, NetworkEventType } from './network.types';
18
+ import { ILoggingService } from '../../shared/logging/logger.model';
18
19
  import * as i0 from "@angular/core";
19
20
  export declare const PEER_URL_REGEXP: RegExp;
20
21
  export declare class NetworkService extends StartableObservableService<Peer, Peer> {
@@ -27,6 +28,7 @@ export declare class NetworkService extends StartableObservableService<Peer, Pee
27
28
  private cache;
28
29
  private http;
29
30
  protected environment: any;
31
+ private loggingService;
30
32
  private network;
31
33
  private translate;
32
34
  private toastController;
@@ -34,6 +36,7 @@ export declare class NetworkService extends StartableObservableService<Peer, Pee
34
36
  onNetworkStatusChanges: BehaviorSubject<ConnectionType>;
35
37
  onResetNetworkCache: EventEmitter<any>;
36
38
  private readonly _mobile;
39
+ private readonly _logger;
37
40
  private _timerSubscription;
38
41
  private readonly _timerRefreshPeriod;
39
42
  private readonly _timerRefreshCondition;
@@ -45,7 +48,7 @@ export declare class NetworkService extends StartableObservableService<Peer, Pee
45
48
  get connectionType(): ConnectionType;
46
49
  get peer(): Peer;
47
50
  set peer(peer: Peer);
48
- constructor(_document: any, platform: Platform, modalCtrl: ModalController, cryptoService: CryptoService, storage: Storage, settings: LocalSettingsService, cache: CacheService, http: HttpClient, environment: any, network: Network, translate: TranslateService, toastController: ToastController);
51
+ constructor(_document: any, platform: Platform, modalCtrl: ModalController, cryptoService: CryptoService, storage: Storage, settings: LocalSettingsService, cache: CacheService, http: HttpClient, environment: any, loggingService: ILoggingService, network: Network, translate: TranslateService, toastController: ToastController);
49
52
  /**
50
53
  * Register to network event
51
54
  *
@@ -141,6 +144,6 @@ export declare class NetworkService extends StartableObservableService<Peer, Pee
141
144
  protected showToast<T = any>(opts: ShowToastOptions): Promise<OverlayEventDetail<T>>;
142
145
  protected addListener<T = any>(name: NetworkEventType, callback: (data?: T) => Promise<void>): Subscription;
143
146
  protected emit<T = any>(name: NetworkEventType, data?: T): Promise<void[]>;
144
- static ɵfac: i0.ɵɵFactoryDeclaration<NetworkService, [null, null, null, null, null, null, null, null, null, { optional: true; }, { optional: true; }, { optional: true; }]>;
147
+ static ɵfac: i0.ɵɵFactoryDeclaration<NetworkService, [null, null, null, null, null, null, null, null, null, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }]>;
145
148
  static ɵprov: i0.ɵɵInjectableDeclaration<NetworkService>;
146
149
  }
@@ -14,8 +14,9 @@ import { ConfigService } from './config.service';
14
14
  import { MomentDateAdapter } from '@angular/material-moment-adapter';
15
15
  import { Downloader, DownloadRequest } from '@ionic-native/downloader/ngx';
16
16
  import { StartableService } from '../../shared/services/startable-service.class';
17
- import { StorageService } from '../../shared/services/storage/storage.service';
17
+ import { StorageService } from '../../shared/storage/storage.service';
18
18
  import { OpenOptions } from '@capacitor/browser';
19
+ import { ILoggingService } from '../../shared/logging/logger.model';
19
20
  import * as i0 from "@angular/core";
20
21
  export declare const AndroidOsEnvironment: Readonly<{
21
22
  DIRECTORY_DOWNLOADS: string;
@@ -36,15 +37,17 @@ export declare class PlatformService extends StartableService {
36
37
  private cache;
37
38
  private audioProvider;
38
39
  protected environment: any;
40
+ private loggingService;
39
41
  private downloader;
42
+ private _logger;
40
43
  private _mobile;
41
44
  private _cordova;
42
45
  private _capacitor;
43
46
  private _android;
44
47
  private _ios;
48
+ constructor(ionicPlatform: Platform, cdkPlatform: CdkPlatform, toastController: ToastController, translate: TranslateService, dateAdapter: MomentDateAdapter, storageService: StorageService, entitiesStorage: EntitiesStorage, settings: LocalSettingsService, networkService: NetworkService, accountService: AccountService, configService: ConfigService, cache: CacheService, audioProvider: AudioProvider, environment: any, loggingService: ILoggingService, downloader: Downloader);
45
49
  private _downloadingJobs;
46
50
  private checkAppVersionTimer;
47
- constructor(ionicPlatform: Platform, cdkPlatform: CdkPlatform, toastController: ToastController, translate: TranslateService, dateAdapter: MomentDateAdapter, storageService: StorageService, entitiesStorage: EntitiesStorage, settings: LocalSettingsService, networkService: NetworkService, accountService: AccountService, configService: ConfigService, cache: CacheService, audioProvider: AudioProvider, environment: any, downloader: Downloader);
48
51
  is(platformName: Platforms): boolean;
49
52
  get mobile(): boolean;
50
53
  /**
@@ -86,6 +89,6 @@ export declare class PlatformService extends StartableService {
86
89
  }): Promise<void>;
87
90
  protected showToast(opts: ShowToastOptions): Promise<HTMLIonToastElement>;
88
91
  protected onStartupError(err: any): Promise<void>;
89
- static ɵfac: i0.ɵɵFactoryDeclaration<PlatformService, [null, null, null, null, null, null, null, null, null, null, null, null, null, null, { optional: true; }]>;
92
+ static ɵfac: i0.ɵɵFactoryDeclaration<PlatformService, [null, null, null, null, null, null, null, null, null, null, null, null, null, null, { optional: true; }, { optional: true; }]>;
90
93
  static ɵprov: i0.ɵɵInjectableDeclaration<PlatformService>;
91
94
  }
@@ -7,7 +7,7 @@ import { EntityStorageLoadOptions, EntityStore, EntityStoreTypePolicy } from './
7
7
  import { IProgressBarService } from '../../../shared/services/progress-bar.service';
8
8
  import { Environment } from '../../../../environments/environment.class';
9
9
  import { StartableService } from '../../../shared/services/startable-service.class';
10
- import { IStorage } from '../../../shared/services/storage/storage.utils';
10
+ import { IStorage } from '../../../shared/storage/storage.utils';
11
11
  import * as i0 from "@angular/core";
12
12
  export interface EntitiesStorageTypePolicies {
13
13
  [__typename: string]: EntityStoreTypePolicy;
@@ -1,7 +1,7 @@
1
1
  import { Observable } from 'rxjs';
2
2
  import { Entity, IEntity } from '../model/entity.model';
3
3
  import { LoadResult } from '../../../shared/services/entity-service.class';
4
- import { IStorage } from '../../../shared/services/storage/storage.utils';
4
+ import { IStorage } from '../../../shared/storage/storage.utils';
5
5
  export declare const ENTITIES_STORAGE_KEY_PREFIX = "entities";
6
6
  export declare type EntityStoreTypePolicyMode = 'default' | 'by-id';
7
7
  export declare interface EntityStoreTypePolicy<T extends Entity<T, any> = Entity<any, any>, K = keyof T> {
@@ -0,0 +1,5 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ export declare const APP_DEBUG_DATA_SERVICE: InjectionToken<IDebugDataService>;
3
+ export interface IDebugDataService {
4
+ sendDebugData: (data: any) => Promise<void>;
5
+ }
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Logging levels.
3
+ * Based on https://github.com/Ritzlgrmft/ionic-logging-service/blob/main/projects/ionic-logging-service/src/lib/log-level.model.ts
4
+ */
5
+ export declare enum LogLevel {
6
+ /**
7
+ * All events should be logged.
8
+ */
9
+ ALL = 0,
10
+ /**
11
+ * A fine-grained debug message, typically capturing the flow through the application.
12
+ */
13
+ TRACE = 1,
14
+ /**
15
+ * A general debugging event.
16
+ */
17
+ DEBUG = 2,
18
+ /**
19
+ * An event for informational purposes.
20
+ */
21
+ INFO = 3,
22
+ /**
23
+ * An event that might possible lead to an error.
24
+ */
25
+ WARN = 4,
26
+ /**
27
+ * An error in the application, possibly recoverable.
28
+ */
29
+ ERROR = 5,
30
+ /**
31
+ * A severe error that will prevent the application from continuing.
32
+ */
33
+ FATAL = 6,
34
+ /**
35
+ * No events will be logged.
36
+ */
37
+ OFF = 7
38
+ }
@@ -0,0 +1,68 @@
1
+ import { LogLevel } from './log-level.model';
2
+ import { Moment } from 'moment';
3
+ import { LoggingServiceConfig } from './logging-service.config';
4
+ import { AppColors } from '../types';
5
+ export interface ILoggingService {
6
+ configure(configuration: LoggingServiceConfig): Promise<void>;
7
+ getLogger(loggerName: string): ILogger;
8
+ }
9
+ export interface ILoggingAppender {
10
+ append(loggerName: string, level: LogLevel, message: string): any;
11
+ }
12
+ export interface ILogger {
13
+ /**
14
+ * Logs a message at level TRACE.
15
+ *
16
+ * @param methodName name of the method
17
+ * @param params optional parameters to be logged; objects will be formatted as JSON
18
+ */
19
+ trace(methodName: string, ...params: any[]): void;
20
+ /**
21
+ * Logs a message at level DEBUG.
22
+ *
23
+ * @param methodName name of the method
24
+ * @param params optional parameters to be logged; objects will be formatted as JSON
25
+ */
26
+ debug(methodName: string, ...params: any[]): void;
27
+ /**
28
+ * Logs a message at level INFO.
29
+ *
30
+ * @param methodName name of the method
31
+ * @param params optional parameters to be logged; objects will be formatted as JSON
32
+ */
33
+ info(methodName: string, ...params: any[]): void;
34
+ /**
35
+ * Logs a message at level WARN.
36
+ *
37
+ * @param methodName name of the method
38
+ * @param params optional parameters to be logged; objects will be formatted as JSON
39
+ */
40
+ warn(methodName: string, ...params: any[]): void;
41
+ /**
42
+ * Logs a message at level ERROR.
43
+ *
44
+ * @param methodName name of the method
45
+ * @param params optional parameters to be logged; objects will be formatted as JSON
46
+ */
47
+ error(methodName: string, ...params: any[]): any;
48
+ /**
49
+ * Logs a message at level FATAL.
50
+ *
51
+ * @param methodName name of the method
52
+ * @param params optional parameters to be logged; objects will be formatted as JSON
53
+ */
54
+ fatal(methodName: string, ...params: any[]): any;
55
+ }
56
+ export interface Log {
57
+ loggerName: string;
58
+ level: LogLevel;
59
+ message: string;
60
+ date: Moment;
61
+ }
62
+ export declare class LogUtils {
63
+ static fromObject(source: any): Log;
64
+ static asObject(source: Log): any;
65
+ static fromObjects(sources: any[]): Log[];
66
+ static levelToString(level: LogLevel): string;
67
+ static levelToColor(level: LogLevel): AppColors;
68
+ }
@@ -0,0 +1,39 @@
1
+ import { ILogger, ILoggingAppender, ILoggingService, Log } from './logger.model';
2
+ import { InjectionToken } from '@angular/core';
3
+ import { BehaviorSubject } from 'rxjs';
4
+ import { IStorage } from '../storage/storage.utils';
5
+ import { Environment } from '../../../environments/environment.class';
6
+ import { LoggingServiceConfig } from './logging-service.config';
7
+ import { LogLevel } from './log-level.model';
8
+ import { StartableService } from '../services/startable-service.class';
9
+ import * as i0 from "@angular/core";
10
+ export declare class Logger implements ILogger {
11
+ private _name;
12
+ private _appender;
13
+ constructor(_name: string, _appender: ILoggingAppender);
14
+ trace(methodName: string, ...params: any[]): void;
15
+ debug(methodName: string, ...params: any[]): void;
16
+ info(methodName: string, ...params: any[]): void;
17
+ warn(methodName: string, ...params: any[]): void;
18
+ error(methodName: string, ...params: any[]): void;
19
+ fatal(methodName: string, ...params: any[]): void;
20
+ private toString;
21
+ }
22
+ export declare const APP_LOGGING_SERVICE: InjectionToken<ILoggingService>;
23
+ export declare class LoggingService extends StartableService<void> implements ILoggingService, ILoggingAppender {
24
+ private storage;
25
+ protected environment: Environment;
26
+ _dataSubject: BehaviorSubject<Log[]>;
27
+ _debounceTimeMs: number;
28
+ _storageKey: string;
29
+ _maxMessages: number;
30
+ _saving: boolean;
31
+ constructor(storage: IStorage, environment: Environment);
32
+ configure(config: LoggingServiceConfig): Promise<void>;
33
+ protected ngOnStart(opts?: LoggingServiceConfig): Promise<void>;
34
+ getLogger(loggerName: string): ILogger;
35
+ append(loggerName: string, level: LogLevel, message: string): void;
36
+ protected storeLocally(): Promise<void>;
37
+ static ɵfac: i0.ɵɵFactoryDeclaration<LoggingService, never>;
38
+ static ɵprov: i0.ɵɵInjectableDeclaration<LoggingService>;
39
+ }
@@ -0,0 +1,25 @@
1
+ export interface LoggingServiceConfig {
2
+ localStorageAppender?: {
3
+ /**
4
+ * Key which is used to store the messages in the local storage.
5
+ *
6
+ * Default: 'log'.
7
+ */
8
+ localStorageKey: string;
9
+ /**
10
+ * Maximum number of log messages stored by the appender.
11
+ *
12
+ * Default: 250.
13
+ */
14
+ maxMessages?: number;
15
+ /**
16
+ * Threshold.
17
+ *
18
+ * Valid values are: ALL, DEBUG, ERROR, FATAL, INFO, OFF, TRACE, WARN
19
+ *
20
+ * Default: WARN.
21
+ */
22
+ threshold?: string;
23
+ debounceTimeMs?: number;
24
+ };
25
+ }
@@ -0,0 +1,9 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "@angular/common";
3
+ import * as i2 from "@ionic/angular";
4
+ import * as i3 from "@ngx-translate/core";
5
+ export declare class LoggingServiceModule {
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<LoggingServiceModule, never>;
7
+ static ɵmod: i0.ɵɵNgModuleDeclaration<LoggingServiceModule, never, [typeof i1.CommonModule, typeof i2.IonicModule, typeof i3.TranslateModule], never>;
8
+ static ɵinj: i0.ɵɵInjectorDeclaration<LoggingServiceModule>;
9
+ }
@@ -8,9 +8,10 @@ import * as i5 from "./toast/toast.testing.module";
8
8
  import * as i6 from "./upload-file/testing/upload-file.testing.module";
9
9
  import * as i7 from "./image/gallery/testing/gallery.testing.module";
10
10
  import * as i8 from "./audio/audio.testing.module";
11
+ import * as i9 from "./storage/storage-explorer.module";
11
12
  export declare const SHARED_TESTING_PAGES: TestingPage[];
12
13
  export declare class SharedTestingModule {
13
14
  static ɵfac: i0.ɵɵFactoryDeclaration<SharedTestingModule, never>;
14
- static ɵmod: i0.ɵɵNgModuleDeclaration<SharedTestingModule, never, [typeof i1.CommonModule, typeof i2.IonicModule, typeof i3.TranslateModule, typeof i4.MaterialTestingModule, typeof i5.ToastTestingModule, typeof i6.UploadFileTestingModule, typeof i7.ImageGalleryTestingModule, typeof i8.AudioTestingModule], [typeof i4.MaterialTestingModule, typeof i5.ToastTestingModule, typeof i6.UploadFileTestingModule, typeof i7.ImageGalleryTestingModule, typeof i8.AudioTestingModule]>;
15
+ static ɵmod: i0.ɵɵNgModuleDeclaration<SharedTestingModule, never, [typeof i1.CommonModule, typeof i2.IonicModule, typeof i3.TranslateModule, typeof i4.MaterialTestingModule, typeof i5.ToastTestingModule, typeof i6.UploadFileTestingModule, typeof i7.ImageGalleryTestingModule, typeof i8.AudioTestingModule, typeof i9.StorageExplorerModule], [typeof i4.MaterialTestingModule, typeof i5.ToastTestingModule, typeof i6.UploadFileTestingModule, typeof i7.ImageGalleryTestingModule, typeof i8.AudioTestingModule, typeof i9.StorageExplorerModule]>;
15
16
  static ɵinj: i0.ɵɵInjectorDeclaration<SharedTestingModule>;
16
17
  }
@@ -0,0 +1,58 @@
1
+ import { ChangeDetectorRef, InjectionToken, OnInit } from '@angular/core';
2
+ import { AlertController, IonModal, Platform, ToastController } from '@ionic/angular';
3
+ import { BehaviorSubject } from 'rxjs';
4
+ import { IStorage } from './storage.utils';
5
+ import { IDebugDataService } from '../debug/debug-service.class';
6
+ import { TranslateService } from '@ngx-translate/core';
7
+ import { Environment } from '../../../environments/environment.class';
8
+ import { Log, LogUtils } from '../logging/logger.model';
9
+ import { MomentDateAdapter } from '@angular/material-moment-adapter';
10
+ import { LogLevel } from '../logging/log-level.model';
11
+ import * as i0 from "@angular/core";
12
+ declare type StorageItemInfo = {
13
+ key: string;
14
+ type: 'array' | 'object' | 'string' | 'number';
15
+ total: number;
16
+ };
17
+ export declare const APP_STORAGE_EXPLORER_PROTECTED_KEYS: InjectionToken<string[]>;
18
+ export declare class StorageExplorerComponent implements OnInit {
19
+ protected platform: Platform;
20
+ protected toastController: ToastController;
21
+ protected alertCtrl: AlertController;
22
+ protected translate: TranslateService;
23
+ protected dateAdapter: MomentDateAdapter;
24
+ protected cd: ChangeDetectorRef;
25
+ protected readonly storage: IStorage;
26
+ protected readonly environment: Environment;
27
+ protected readonly debugDataService: IDebugDataService;
28
+ private readonly _protectedKeys;
29
+ private _logPrefix;
30
+ protected $loading: BehaviorSubject<boolean>;
31
+ protected $items: BehaviorSubject<StorageItemInfo[]>;
32
+ protected _logKey: string;
33
+ protected data: any;
34
+ protected logs: Log[];
35
+ protected key: string;
36
+ mobile: boolean;
37
+ showSendButton: boolean;
38
+ sendDataModal: IonModal;
39
+ viewDataModal: IonModal;
40
+ constructor(platform: Platform, toastController: ToastController, alertCtrl: AlertController, translate: TranslateService, dateAdapter: MomentDateAdapter, cd: ChangeDetectorRef, storage: IStorage, environment: Environment, debugDataService: IDebugDataService, _protectedKeys: string[]);
41
+ ngOnInit(): void;
42
+ sendDataClick(event: Event, key: string): Promise<void>;
43
+ viewDataClick(event: Event, key: string): Promise<void>;
44
+ sendData(key: string): Promise<void>;
45
+ downloadAsJson(key: string): Promise<void>;
46
+ copyToClipboard(key: string): Promise<void>;
47
+ protected start(): Promise<void>;
48
+ protected refresh(): Promise<void>;
49
+ protected toString(key: string, data: any, html?: boolean): string;
50
+ protected toLogs(data: any): Log[];
51
+ protected clear(key: string): Promise<void>;
52
+ protected trackByFn(index: number, item: StorageItemInfo): any;
53
+ protected levelToColor(level: LogLevel): string;
54
+ protected levelToString: typeof LogUtils.levelToString;
55
+ static ɵfac: i0.ɵɵFactoryDeclaration<StorageExplorerComponent, [null, null, null, null, null, null, null, null, { optional: true; }, { optional: true; }]>;
56
+ static ɵcmp: i0.ɵɵComponentDeclaration<StorageExplorerComponent, "app-storage-explorer", never, { "mobile": "mobile"; "showSendButton": "showSendButton"; }, {}, never, never, false>;
57
+ }
58
+ export {};
@@ -0,0 +1,16 @@
1
+ import { TestingPage } from '../testing/tests.page';
2
+ import * as i0 from "@angular/core";
3
+ import * as i1 from "./storage-explorer.component";
4
+ import * as i2 from "@ionic/angular";
5
+ import * as i3 from "@angular/common";
6
+ import * as i4 from "@ngx-translate/core";
7
+ import * as i5 from "@angular/router";
8
+ import * as i6 from "@rx-angular/template/for";
9
+ import * as i7 from "../pipes/pipes.module";
10
+ import * as i8 from "../material/material.module";
11
+ export declare const SHARED_STORAGE_TESTING_PAGES: TestingPage[];
12
+ export declare class StorageExplorerModule {
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<StorageExplorerModule, never>;
14
+ static ɵmod: i0.ɵɵNgModuleDeclaration<StorageExplorerModule, [typeof i1.StorageExplorerComponent], [typeof i2.IonicModule, typeof i3.CommonModule, typeof i4.TranslateModule, typeof i5.RouterModule, typeof i6.ForModule, typeof i7.SharedPipesModule, typeof i8.SharedMaterialModule], [typeof i1.StorageExplorerComponent]>;
15
+ static ɵinj: i0.ɵɵInjectorDeclaration<StorageExplorerModule>;
16
+ }
@@ -1,8 +1,8 @@
1
1
  import { Storage } from '@ionic/storage-angular';
2
2
  import { IStorage } from './storage.utils';
3
- import { StartableService } from '../startable-service.class';
3
+ import { StartableService } from '../services/startable-service.class';
4
4
  import { Platform } from '@ionic/angular';
5
- import { Environment } from '../../../../environments/environment.class';
5
+ import { Environment } from '../../../environments/environment.class';
6
6
  import * as i0 from "@angular/core";
7
7
  export declare class StorageService extends StartableService<Storage> implements IStorage<Storage> {
8
8
  private platform;
@@ -10,6 +10,7 @@
10
10
  "BTN_APPLY": "Appliquer",
11
11
  "BTN_BURST_INPUT": "Mode rafale",
12
12
  "BTN_BURST_INPUT_HELP": "Saisir en mode rafale",
13
+ "BTN_COPY": "Copier",
13
14
  "BTN_CLEAR": "Vider",
14
15
  "BTN_CLOSE": "Fermer",
15
16
  "BTN_DONE": "Terminer",
@@ -263,6 +264,7 @@
263
264
  "REFERENTIAL": {
264
265
  "LABEL": "Code",
265
266
  "NAME": "Libellé",
267
+ "TYPE": "Type",
266
268
  "STATUS_ENUM": {
267
269
  "ENABLE": "Actif à la saisie",
268
270
  "DISABLE": "Inactif à la saisie",
@@ -573,6 +575,7 @@
573
575
  "INFO": {
574
576
  "ALERT_HEADER": "Information",
575
577
  "SYNCHRONIZATION_SUCCEED": "Synchronisation terminée avec succès !<br/>Les données ont bien été recues par le serveur.",
578
+ "COPY_SUCCEED": "Copier avec succès !",
576
579
  "DEBUG_DATA_SEND": "Demande d'aide envoyée à l'administrateur.",
577
580
  "DATA_MIGRATION_STARTED": "Restauration de données en cours.<br/><b>Veuillez patienter...</b>",
578
581
  "DATA_MIGRATION_SUCCEED": "Restauration de données <b>terminée avec succès</b> !",
@@ -2,6 +2,7 @@ import { FetchPolicy } from '@apollo/client/core';
2
2
  import { StorageConfig } from '@ionic/storage';
3
3
  import { InjectionToken } from '@angular/core';
4
4
  import { CacheConfig } from 'ionic-cache/lib/interfaces/cache-config.interface';
5
+ import { LoggingServiceConfig } from '../app/shared/logging/logging-service.config';
5
6
  export declare const ENVIRONMENT: InjectionToken<Environment>;
6
7
  export declare class Environment {
7
8
  name: string;
@@ -31,6 +32,7 @@ export declare class Environment {
31
32
  defaultDepartmentId?: number;
32
33
  defaultAppName?: string;
33
34
  defaultAndroidInstallUrl?: string;
35
+ logging?: Partial<LoggingServiceConfig>;
34
36
  cache?: Partial<CacheConfig>;
35
37
  storage?: Partial<StorageConfig>;
36
38
  storageSavePeriodMs?: number;