@sumaris-net/ngx-components 2.4.151 → 2.4.153

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 (40) hide show
  1. package/esm2020/src/app/core/form/properties/testing/properties-form.test.mjs +1 -1
  2. package/esm2020/src/app/core/graphql/graphql.service.mjs +5 -5
  3. package/esm2020/src/app/core/home/home.mjs +2 -2
  4. package/esm2020/src/app/core/menu/menu.component.mjs +2 -2
  5. package/esm2020/src/app/core/menu/testing/menu-other.testing.mjs +1 -1
  6. package/esm2020/src/app/core/menu/testing/menu.testing.mjs +1 -1
  7. package/esm2020/src/app/core/register/register-confirm.page.mjs +1 -1
  8. package/esm2020/src/app/core/services/config.service.mjs +10 -8
  9. package/esm2020/src/app/core/services/network.service.mjs +62 -48
  10. package/esm2020/src/app/core/services/network.types.mjs +1 -1
  11. package/esm2020/src/app/core/services/platform.service.mjs +2 -1
  12. package/esm2020/src/app/shared/http/http.utils.mjs +15 -11
  13. package/esm2020/src/app/shared/image/gallery/image-gallery.component.mjs +2 -2
  14. package/esm2020/src/app/shared/image/gallery/testing/gallery.testing.mjs +1 -1
  15. package/esm2020/src/app/shared/material/autocomplete/testing/autocomplete.test.mjs +1 -1
  16. package/esm2020/src/app/shared/material/badge/badge.test.mjs +1 -1
  17. package/esm2020/src/app/shared/material/chips/testing/chips.test.mjs +1 -1
  18. package/esm2020/src/app/shared/material/datetime/testing/mat-date-time.test.mjs +1 -1
  19. package/esm2020/src/app/shared/material/datetime/testing/mat-date.test.mjs +1 -1
  20. package/esm2020/src/app/shared/material/datetime/testing/mat-dateshort.test.mjs +1 -1
  21. package/esm2020/src/app/shared/material/latlong/testing/latlong.test.mjs +1 -1
  22. package/esm2020/src/app/shared/material/numpad/testing/numpad.test.mjs +1 -1
  23. package/esm2020/src/app/shared/material/swipe/testing/swipe.test.mjs +1 -1
  24. package/esm2020/src/app/shared/services/memory-entity-service.class.mjs +6 -6
  25. package/esm2020/src/app/shared/storage/storage-explorer.component.mjs +1 -1
  26. package/esm2020/src/app/shared/testing/observable.test.mjs +1 -1
  27. package/esm2020/src/app/shared/testing/tests.page.mjs +1 -1
  28. package/esm2020/src/app/social/user-event/user-event.service.mjs +35 -22
  29. package/esm2020/src/environments/environment.class.mjs +1 -1
  30. package/fesm2015/sumaris-net.ngx-components.mjs +288 -255
  31. package/fesm2015/sumaris-net.ngx-components.mjs.map +1 -1
  32. package/fesm2020/sumaris-net.ngx-components.mjs +281 -247
  33. package/fesm2020/sumaris-net.ngx-components.mjs.map +1 -1
  34. package/package.json +1 -1
  35. package/src/app/core/services/network.service.d.ts +11 -10
  36. package/src/app/shared/http/http.utils.d.ts +1 -0
  37. package/src/app/shared/services/memory-entity-service.class.d.ts +7 -3
  38. package/src/app/social/user-event/user-event.service.d.ts +5 -0
  39. package/src/assets/manifest.json +1 -1
  40. package/src/environments/environment.class.d.ts +1 -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.151",
4
+ "version": "2.4.153",
5
5
  "author": "contact@e-is.pro",
6
6
  "license": "AGPL-3.0",
7
7
  "readmeFilename": "README.md",
@@ -1,5 +1,4 @@
1
1
  import { EventEmitter } from '@angular/core';
2
- import { CryptoService } from './crypto.service';
3
2
  import { TranslateService } from '@ngx-translate/core';
4
3
  import { Storage } from '@ionic/storage-angular';
5
4
  import { Peer } from './model/peer.model';
@@ -19,11 +18,10 @@ import { ConnectionType, NetworkEventType } from './network.types';
19
18
  import { ILoggingService } from '../../shared/logging/logger.model';
20
19
  import * as i0 from "@angular/core";
21
20
  export declare const PEER_URL_REGEXP: RegExp;
21
+ export declare const NETWORK_DEFAULT_CONNECTION_TIMEOUT = 10000;
22
22
  export declare class NetworkService extends StartableObservableService<Peer, Peer> {
23
23
  private _document;
24
- private platform;
25
24
  private modalCtrl;
26
- private cryptoService;
27
25
  private storage;
28
26
  private settings;
29
27
  private cache;
@@ -43,13 +41,15 @@ export declare class NetworkService extends StartableObservableService<Peer, Pee
43
41
  private readonly _timerRefreshCondition;
44
42
  private _deviceConnectionType;
45
43
  private _forceOffline;
44
+ private readonly _connectionTimeout;
46
45
  private _listeners;
47
46
  get online(): boolean;
48
47
  get offline(): boolean;
49
48
  get connectionType(): ConnectionType;
50
49
  get peer(): Peer;
51
50
  set peer(peer: Peer);
52
- constructor(_document: any, platform: Platform, modalCtrl: ModalController, cryptoService: CryptoService, storage: Storage, settings: LocalSettingsService, cache: CacheService, http: HttpClient, environment: Environment, loggingService: ILoggingService, network: Network, translate: TranslateService, toastController: ToastController);
51
+ get connectionTimeout(): number;
52
+ constructor(_document: any, platform: Platform, modalCtrl: ModalController, storage: Storage, settings: LocalSettingsService, cache: CacheService, http: HttpClient, environment: Environment, loggingService: ILoggingService, network: Network, translate: TranslateService, toastController: ToastController);
53
53
  /**
54
54
  * Register to network event
55
55
  *
@@ -78,14 +78,14 @@ export declare class NetworkService extends StartableObservableService<Peer, Pee
78
78
  * @param peer
79
79
  * @param opts
80
80
  */
81
- checkPeerAlive(peer?: string | Peer, opts?: {
82
- checkCompatible?: boolean;
83
- displayToast?: boolean;
84
- }): Promise<NodeInfo>;
81
+ checkPeerAlive(peer?: string | Peer): Promise<NodeInfo>;
85
82
  checkPeerCompatible(peerInfo: NodeInfo, opts?: {
86
83
  showToast?: boolean;
87
84
  }): Promise<boolean>;
88
- getNodeInfo(peer?: string | Peer): Promise<NodeInfo>;
85
+ getNodeInfo(peer?: string | Peer, opts?: {
86
+ nocache?: boolean;
87
+ timeout?: number;
88
+ }): Promise<NodeInfo>;
89
89
  getAppManifest(peer?: string | Peer, opts?: {
90
90
  nocache?: boolean;
91
91
  }): Promise<AppManifest | undefined>;
@@ -135,6 +135,7 @@ export declare class NetworkService extends StartableObservableService<Peer, Pee
135
135
  };
136
136
  responseType?: 'json';
137
137
  nocache?: boolean;
138
+ timeout?: number;
138
139
  }): Promise<T>;
139
140
  protected getUri(path: string): string;
140
141
  protected onDeviceConnectionChanged(connectionType?: string): void;
@@ -145,6 +146,6 @@ export declare class NetworkService extends StartableObservableService<Peer, Pee
145
146
  protected showToast<T = any>(opts: ShowToastOptions): Promise<OverlayEventDetail<T>>;
146
147
  protected addListener<T = any>(name: NetworkEventType, callback: (data?: T) => Promise<void>): Subscription;
147
148
  protected emit<T = any>(name: NetworkEventType, data?: T): Promise<void[]>;
148
- static ɵfac: i0.ɵɵFactoryDeclaration<NetworkService, [null, null, null, null, null, null, null, null, null, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }]>;
149
+ static ɵfac: i0.ɵɵFactoryDeclaration<NetworkService, [null, null, null, null, null, null, null, null, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }]>;
149
150
  static ɵprov: i0.ɵɵInjectableDeclaration<NetworkService>;
150
151
  }
@@ -14,6 +14,7 @@ export declare class HttpUtils {
14
14
  }): Promise<string>;
15
15
  static getJson<T>(http: HttpClient, uri: string, opts?: {
16
16
  nocache?: boolean;
17
+ timeout?: number;
17
18
  headers?: HttpHeaders | {
18
19
  [header: string]: string | string[];
19
20
  };
@@ -23,13 +23,15 @@ export declare class InMemoryEntitiesService<T extends IEntity<T, ID>, F = any,
23
23
  debug: boolean;
24
24
  private _hiddenData;
25
25
  readonly dirtySubject: BehaviorSubject<boolean>;
26
- private readonly savingSubject;
26
+ readonly savingSubject: BehaviorSubject<boolean>;
27
+ protected readonly sortByReplacement: {
28
+ [key: string]: string;
29
+ };
27
30
  private readonly _sortFn;
28
31
  private readonly _onLoad;
29
32
  private readonly _onSaveFn;
30
33
  private readonly _equalsFn;
31
34
  private readonly _filterFnFactory;
32
- private readonly _sortByReplacement;
33
35
  set value(data: T[]);
34
36
  get value(): T[];
35
37
  get saving(): boolean;
@@ -39,7 +41,9 @@ export declare class InMemoryEntitiesService<T extends IEntity<T, ID>, F = any,
39
41
  protected ngOnStop(): Promise<void>;
40
42
  ngOnDestroy(): void;
41
43
  setValue(data: T[]): void;
42
- loadAll(offset: number, size: number, sortBy?: string, sortDirection?: SortDirection, filter?: F, opts?: EntitiesServiceLoadOptions): Promise<LoadResult<T>>;
44
+ loadAll(offset: number, size: number, sortBy?: string, sortDirection?: SortDirection, filter?: F, opts?: EntitiesServiceLoadOptions & {
45
+ updateHiddenData?: boolean;
46
+ }): Promise<LoadResult<T>>;
43
47
  watchAll(offset: number, size: number, sortBy?: string, sortDirection?: SortDirection, filterData?: F, options?: any): Observable<LoadResult<T>>;
44
48
  saveAll(data: T[], options?: any): Promise<T[]>;
45
49
  deleteAll(dataToRemove: T[], options?: any): Promise<any>;
@@ -11,6 +11,8 @@ import { NetworkService } from '../../core/services/network.service';
11
11
  import { BaseGraphqlService, BaseGraphqlServiceOptions } from '../../core/services/base-graphql-service.class';
12
12
  import { Moment } from 'moment';
13
13
  import { IStartableService } from '../../shared/services/startable-service.class';
14
+ import { DocumentNode } from 'graphql/index';
15
+ import { MutableWatchQueriesUpdatePolicy } from '../../core/services/base-entity-service.class';
14
16
  import * as i0 from "@angular/core";
15
17
  export declare const APP_USER_EVENT_SERVICE: InjectionToken<IUserEventService<any, any, number, UserEventWatchOptions, UserEventLoadOptions>>;
16
18
  export declare interface UserEventLoadOptions extends EntitiesServiceLoadOptions {
@@ -42,6 +44,7 @@ export interface UserEventServiceOptions<Q extends IUserEventQueries = IUserEven
42
44
  queries: Q;
43
45
  mutations?: Partial<M>;
44
46
  subscriptions?: Partial<S>;
47
+ watchQueriesUpdatePolicy?: MutableWatchQueriesUpdatePolicy;
45
48
  }
46
49
  export interface IUserEventService<E extends IUserEvent<E, ID>, F extends IUserEventFilter<E, ID>, ID = number, WO extends UserEventWatchOptions = UserEventWatchOptions, LO extends UserEventLoadOptions = UserEventLoadOptions> extends IEntitiesService<E, F, WO>, IStartableService {
47
50
  countSubject: Observable<number>;
@@ -74,6 +77,7 @@ export declare abstract class AbstractUserEventService<E extends IUserEvent<E, I
74
77
  protected readonly mutations: Partial<M>;
75
78
  protected readonly subscriptions: Partial<S>;
76
79
  protected readonly _countSubject: BehaviorSubject<number>;
80
+ protected readonly watchQueriesUpdatePolicy: MutableWatchQueriesUpdatePolicy;
77
81
  protected resetCountDate: Moment;
78
82
  protected listeners: IUserEventListener<E, ID>[];
79
83
  private _subscriptions;
@@ -119,6 +123,7 @@ export declare abstract class AbstractUserEventService<E extends IUserEvent<E, I
119
123
  protected fillDefaultProperties(entity: E): void;
120
124
  protected unreadEvents(events: E[]): number;
121
125
  protected copyIdAndUpdateDate(source: E, target: E): void;
126
+ protected getLoadQueries(): DocumentNode[];
122
127
  static ɵfac: i0.ɵɵFactoryDeclaration<AbstractUserEventService<any, any, any, any, any, any, any, any>, never>;
123
128
  static ɵdir: i0.ɵɵDirectiveDeclaration<AbstractUserEventService<any, any, any, any, any, any, any, any>, never, never, {}, {}, never, never, false>;
124
129
  }
@@ -2,7 +2,7 @@
2
2
  "name": "ngx-sumaris-components",
3
3
  "short_name": "ngx-sumaris-components",
4
4
  "manifest_version": 1,
5
- "version": "2.4.151",
5
+ "version": "2.4.153",
6
6
  "default_locale": "fr",
7
7
  "description": "Angular components for building beautiful and responsive Apps",
8
8
  "icons": [{
@@ -10,6 +10,7 @@ export declare class Environment {
10
10
  production: boolean;
11
11
  externalEnvironmentUrl?: string;
12
12
  baseUrl: string;
13
+ connectionTimeout?: number;
13
14
  sameUrlPeer?: boolean;
14
15
  defaultPeer?: {
15
16
  host: string;