@sumaris-net/ngx-components 2.6.21 → 2.6.22

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 (27) hide show
  1. package/esm2020/src/app/admin/users/users.mjs +2 -2
  2. package/esm2020/src/app/core/account/new-token.modal.mjs +19 -13
  3. package/esm2020/src/app/core/account/token.table.mjs +22 -18
  4. package/esm2020/src/app/core/graphql/graphql.service.mjs +29 -31
  5. package/esm2020/src/app/core/services/account.service.mjs +1 -2
  6. package/esm2020/src/app/core/services/config.service.mjs +10 -8
  7. package/esm2020/src/app/core/services/model/token.model.mjs +6 -2
  8. package/esm2020/src/app/core/services/network.service.mjs +55 -38
  9. package/esm2020/src/app/core/services/network.types.mjs +1 -1
  10. package/esm2020/src/app/core/services/platform.service.mjs +2 -1
  11. package/esm2020/src/app/shared/http/http.utils.mjs +15 -11
  12. package/esm2020/src/app/shared/services/memory-entity-service.class.mjs +6 -6
  13. package/esm2020/src/environments/environment.class.mjs +1 -1
  14. package/fesm2015/sumaris-net.ngx-components.mjs +126 -92
  15. package/fesm2015/sumaris-net.ngx-components.mjs.map +1 -1
  16. package/fesm2020/sumaris-net.ngx-components.mjs +124 -92
  17. package/fesm2020/sumaris-net.ngx-components.mjs.map +1 -1
  18. package/package.json +1 -1
  19. package/src/app/core/account/new-token.modal.d.ts +1 -3
  20. package/src/app/core/account/token.table.d.ts +5 -3
  21. package/src/app/core/graphql/graphql.service.d.ts +20 -22
  22. package/src/app/core/services/model/token.model.d.ts +1 -0
  23. package/src/app/core/services/network.service.d.ts +11 -7
  24. package/src/app/shared/http/http.utils.d.ts +1 -0
  25. package/src/app/shared/services/memory-entity-service.class.d.ts +4 -2
  26. package/src/assets/manifest.json +1 -1
  27. 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.6.21",
4
+ "version": "2.6.22",
5
5
  "author": "contact@e-is.pro",
6
6
  "license": "AGPL-3.0",
7
7
  "readmeFilename": "README.md",
@@ -3,7 +3,6 @@ import { TokenScope, UserToken } from '../services/model/token.model';
3
3
  import { UntypedFormGroup } from '@angular/forms';
4
4
  import { Injector, OnInit } from '@angular/core';
5
5
  import { UserTokenValidatorService } from '../services/validator/user-token.validator';
6
- import { TranslateService } from '@ngx-translate/core';
7
6
  import { MatAutocompleteFieldConfig } from '../../shared/material/autocomplete/material.autocomplete.config';
8
7
  import { IAppForm } from '../form/form.utils';
9
8
  import { AccountService } from '../services/account.service';
@@ -14,7 +13,6 @@ export interface INewTokenModalOptions extends IEntityEditorModalOptions<UserTok
14
13
  }
15
14
  export declare class NewTokenModal extends AppEntityEditorModal<UserToken> implements OnInit, INewTokenModalOptions {
16
15
  private injector;
17
- protected translate: TranslateService;
18
16
  protected validator: UserTokenValidatorService;
19
17
  protected accountService: AccountService;
20
18
  tokenForm: UntypedFormGroup;
@@ -23,7 +21,7 @@ export declare class NewTokenModal extends AppEntityEditorModal<UserToken> imple
23
21
  copiedLabel: string;
24
22
  tokenScopes: TokenScope[];
25
23
  existingNames: string[];
26
- constructor(injector: Injector, translate: TranslateService, validator: UserTokenValidatorService, accountService: AccountService);
24
+ constructor(injector: Injector, validator: UserTokenValidatorService, accountService: AccountService);
27
25
  get valid(): boolean;
28
26
  get invalid(): boolean;
29
27
  ngOnInit(): void;
@@ -1,4 +1,4 @@
1
- import { Injector, OnInit } from '@angular/core';
1
+ import { ChangeDetectorRef, Injector, OnInit } from '@angular/core';
2
2
  import { UntypedFormBuilder } from '@angular/forms';
3
3
  import { ValidatorService } from '@e-is/ngx-material-table';
4
4
  import { TokenScope, UserToken } from '../services/model/token.model';
@@ -9,9 +9,10 @@ export declare class UserTokenTable extends AppInMemoryTable<UserToken> implemen
9
9
  protected injector: Injector;
10
10
  protected formBuilder: UntypedFormBuilder;
11
11
  protected validatorService: ValidatorService;
12
+ protected cd: ChangeDetectorRef;
12
13
  protected tokenScopes: TokenScope[];
13
14
  useSticky: boolean;
14
- constructor(injector: Injector, formBuilder: UntypedFormBuilder, validatorService: ValidatorService, environment: Environment, tokenScopes: TokenScope[]);
15
+ constructor(injector: Injector, formBuilder: UntypedFormBuilder, validatorService: ValidatorService, cd: ChangeDetectorRef, environment: Environment, tokenScopes: TokenScope[]);
15
16
  ngOnInit(): void;
16
17
  get value(): UserToken[];
17
18
  set value(data: UserToken[]);
@@ -20,6 +21,7 @@ export declare class UserTokenTable extends AppInMemoryTable<UserToken> implemen
20
21
  }): void;
21
22
  addToken(event: UIEvent): Promise<void>;
22
23
  display(scopes: TokenScope[]): string;
23
- static ɵfac: i0.ɵɵFactoryDeclaration<UserTokenTable, [null, null, null, null, { optional: true; }]>;
24
+ protected markForCheck(): void;
25
+ static ɵfac: i0.ɵɵFactoryDeclaration<UserTokenTable, [null, null, null, null, null, { optional: true; }]>;
24
26
  static ɵcmp: i0.ɵɵComponentDeclaration<UserTokenTable, "app-user-token-table", never, { "useSticky": "useSticky"; }, {}, never, never, false>;
25
27
  }
@@ -1,22 +1,21 @@
1
- import { Observable } from 'rxjs';
2
- import { Apollo, ExtraSubscriptionOptions, QueryRef } from 'apollo-angular';
3
- import { ApolloCache, ApolloClient, FetchPolicy, MutationUpdaterFn, OperationVariables, TypePolicies, WatchQueryFetchPolicy } from '@apollo/client/core';
4
- import { ServiceError } from '../services/errors';
5
- import { InjectionToken } from '@angular/core';
6
- import { NetworkService } from '../services/network.service';
7
- import { EmptyObject } from './graphql.utils';
8
- import { Platform } from '@ionic/angular';
9
- import { IEntity } from '../services/model/entity.model';
10
- import { Resolvers } from '@apollo/client/core/types';
11
- import { HttpLink } from 'apollo-angular/http';
12
- import { ErrorPolicy, MutationBaseOptions } from '@apollo/client/core/watchQueryOptions';
13
- import { Cache } from '@apollo/client/cache/core/types/Cache';
14
- import { Environment } from '../../../environments/environment.class';
15
- import { CryptoService } from '../services/crypto.service';
16
- import { PropertiesMap } from '../../shared/types';
17
- import { StartableService } from '../../shared/services/startable-service.class';
18
- import { StorageService } from '../../shared/storage/storage.service';
19
- import { DocumentNode } from 'graphql';
1
+ import { Observable } from "rxjs";
2
+ import { Apollo, ExtraSubscriptionOptions, QueryRef } from "apollo-angular";
3
+ import { ApolloCache, ApolloClient, FetchPolicy, MutationUpdaterFn, OperationVariables, TypePolicies, WatchQueryFetchPolicy } from "@apollo/client/core";
4
+ import { ServiceError } from "../services/errors";
5
+ import { InjectionToken } from "@angular/core";
6
+ import { NetworkService } from "../services/network.service";
7
+ import { EmptyObject } from "./graphql.utils";
8
+ import { Platform } from "@ionic/angular";
9
+ import { IEntity } from "../services/model/entity.model";
10
+ import { Resolvers } from "@apollo/client/core/types";
11
+ import { HttpLink } from "apollo-angular/http";
12
+ import { ErrorPolicy, MutationBaseOptions } from "@apollo/client/core/watchQueryOptions";
13
+ import { Cache } from "@apollo/client/cache/core/types/Cache";
14
+ import { Environment } from "../../../environments/environment.class";
15
+ import { PropertiesMap } from "../../shared/types";
16
+ import { StartableService } from "../../shared/services/startable-service.class";
17
+ import { StorageService } from "../../shared/storage/storage.service";
18
+ import { DocumentNode } from "graphql";
20
19
  import * as i0 from "@angular/core";
21
20
  export interface WatchQueryOptions<V> {
22
21
  query: any;
@@ -50,7 +49,6 @@ export declare class GraphqlService extends StartableService<ApolloClient<any>>
50
49
  private httpLink;
51
50
  private network;
52
51
  private storage;
53
- private cryptoService;
54
52
  protected environment: Environment;
55
53
  private typePolicies;
56
54
  private fragments;
@@ -65,7 +63,7 @@ export declare class GraphqlService extends StartableService<ApolloClient<any>>
65
63
  get client(): ApolloClient<any>;
66
64
  get cache(): ApolloCache<any>;
67
65
  get defaultFetchPolicy(): WatchQueryFetchPolicy;
68
- constructor(platform: Platform, apollo: Apollo, httpLink: HttpLink, network: NetworkService, storage: StorageService, cryptoService: CryptoService, environment: Environment, typePolicies: TypePolicies, fragments: DocumentNode[]);
66
+ constructor(platform: Platform, apollo: Apollo, httpLink: HttpLink, network: NetworkService, storage: StorageService, environment: Environment, typePolicies: TypePolicies, fragments: DocumentNode[]);
69
67
  setAuthToken(token: string): Promise<void>;
70
68
  setAuthBasic(basic: string): Promise<void>;
71
69
  /**
@@ -144,6 +142,6 @@ export declare class GraphqlService extends StartableService<ApolloClient<any>>
144
142
  private createAppErrorByCode;
145
143
  private getI18nErrorMessageByCode;
146
144
  private toAppError;
147
- static ɵfac: i0.ɵɵFactoryDeclaration<GraphqlService, [null, null, null, null, null, null, null, { optional: true; }, { optional: true; }]>;
145
+ static ɵfac: i0.ɵɵFactoryDeclaration<GraphqlService, [null, null, null, null, null, null, { optional: true; }, { optional: true; }]>;
148
146
  static ɵprov: i0.ɵɵInjectableDeclaration<GraphqlService>;
149
147
  }
@@ -7,6 +7,7 @@ export declare class TokenScope {
7
7
  }
8
8
  export declare class UserToken extends Entity<UserToken> {
9
9
  static fromObject: (source: any, opts?: any) => UserToken;
10
+ static equals(t1: UserToken, t2: UserToken): boolean;
10
11
  pubkey: string;
11
12
  token: string;
12
13
  name: string;
@@ -18,13 +18,14 @@ import { ConnectionType, NetworkEventType } from './network.types';
18
18
  import { ILoggingService } from '../../shared/logging/logger.model';
19
19
  import * as i0 from "@angular/core";
20
20
  export declare const PEER_URL_REGEXP: RegExp;
21
+ export declare const NETWORK_DEFAULT_CONNECTION_TIMEOUT = 10000;
21
22
  export declare class NetworkService extends StartableObservableService<Peer, Peer> {
23
+ private _document;
22
24
  private modalCtrl;
23
25
  private storage;
24
26
  private settings;
25
27
  private cache;
26
28
  private http;
27
- private _document;
28
29
  protected environment: Environment;
29
30
  private loggingService;
30
31
  private translate;
@@ -40,13 +41,15 @@ export declare class NetworkService extends StartableObservableService<Peer, Pee
40
41
  private readonly _timerRefreshCondition;
41
42
  private _deviceConnectionType;
42
43
  private _forceOffline;
44
+ private readonly _connectionTimeout;
43
45
  private _listeners;
44
46
  get online(): boolean;
45
47
  get offline(): boolean;
46
48
  get connectionType(): ConnectionType;
47
49
  get peer(): Peer;
48
50
  set peer(peer: Peer);
49
- constructor(platform: Platform, modalCtrl: ModalController, storage: Storage, settings: LocalSettingsService, cache: CacheService, http: HttpClient, _document: any, 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);
50
53
  /**
51
54
  * Register to network event
52
55
  *
@@ -75,14 +78,14 @@ export declare class NetworkService extends StartableObservableService<Peer, Pee
75
78
  * @param peer
76
79
  * @param opts
77
80
  */
78
- checkPeerAlive(peer?: string | Peer, opts?: {
79
- checkCompatible?: boolean;
80
- displayToast?: boolean;
81
- }): Promise<NodeInfo>;
81
+ checkPeerAlive(peer?: string | Peer): Promise<NodeInfo>;
82
82
  checkPeerCompatible(peerInfo: NodeInfo, opts?: {
83
83
  showToast?: boolean;
84
84
  }): Promise<boolean>;
85
- getNodeInfo(peer?: string | Peer): Promise<NodeInfo>;
85
+ getNodeInfo(peer?: string | Peer, opts?: {
86
+ nocache?: boolean;
87
+ timeout?: number;
88
+ }): Promise<NodeInfo>;
86
89
  getAppManifest(peer?: string | Peer, opts?: {
87
90
  nocache?: boolean;
88
91
  }): Promise<AppManifest | undefined>;
@@ -132,6 +135,7 @@ export declare class NetworkService extends StartableObservableService<Peer, Pee
132
135
  };
133
136
  responseType?: 'json';
134
137
  nocache?: boolean;
138
+ timeout?: number;
135
139
  }): Promise<T>;
136
140
  protected getUri(path: string): string;
137
141
  protected onDeviceConnectionChanged(connectionType?: string): void;
@@ -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;
@@ -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.6.21",
5
+ "version": "2.6.22",
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;