@sumaris-net/ngx-components 1.9.2 → 1.9.5

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.
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": "1.9.2",
4
+ "version": "1.9.5",
5
5
  "author": "contact@e-is.pro",
6
6
  "license": "AGPL-3.0",
7
7
  "readmeFilename": "README.md",
@@ -1,5 +1,5 @@
1
1
  import { AfterViewInit, ChangeDetectorRef, EventEmitter, Injector, OnDestroy, OnInit } from '@angular/core';
2
- import { Subject } from 'rxjs';
2
+ import { Subject, Subscription } from 'rxjs';
3
3
  import { AddToPageHistoryOptions, LocalSettingsService } from '../services/local-settings.service';
4
4
  import { Entity } from '../services/model/entity.model';
5
5
  import { UsageMode } from '../services/model/settings.model';
@@ -51,7 +51,7 @@ export declare abstract class AppEntityEditor<T extends Entity<T, ID>, S extends
51
51
  protected errorTranslator: FormErrorTranslator;
52
52
  data: T;
53
53
  saving: boolean;
54
- hasRemoteListener: boolean;
54
+ listenRemoteSubscription: Subscription;
55
55
  defaultBackHref: string;
56
56
  historyIcon: {
57
57
  icon?: string;
@@ -94,6 +94,7 @@ export declare abstract class AppEntityEditor<T extends Entity<T, ID>, S extends
94
94
  [key: string]: any;
95
95
  }): Promise<void>;
96
96
  startListenRemoteChanges(): void;
97
+ stopListenRemoteChanges(): void;
97
98
  updateView(data: T | null, opts?: {
98
99
  emitEvent?: boolean;
99
100
  openTabIndex?: number;
@@ -35,6 +35,9 @@ export declare interface IsEmailExistsVariables {
35
35
  email: string;
36
36
  hash: string;
37
37
  }
38
+ export interface AccountWatchOptions {
39
+ intervalInSecond?: number;
40
+ }
38
41
  export declare class AccountService extends BaseGraphqlService<Account, any, number, Account> {
39
42
  private cryptoService;
40
43
  protected network: NetworkService;
@@ -48,7 +51,8 @@ export declare class AccountService extends BaseGraphqlService<Account, any, num
48
51
  onChange: Subject<Account>;
49
52
  onAuthTokenChange: Subject<string>;
50
53
  onAuthBasicChange: Subject<string>;
51
- private _stopWatching$;
54
+ private _listenChangesSubscription;
55
+ private readonly _enableListenChanges;
52
56
  private _cache;
53
57
  private _$additionalFields;
54
58
  private _tokenType$;
@@ -78,7 +82,7 @@ export declare class AccountService extends BaseGraphqlService<Account, any, num
78
82
  register(data: RegisterData): Promise<Account>;
79
83
  authenticate(data?: AuthData): Promise<void>;
80
84
  login(data: AuthData): Promise<Account>;
81
- refresh(): Promise<Account>;
85
+ reload(): Promise<Account>;
82
86
  /**
83
87
  * Create or update an user account, to the remote storage
84
88
  *
@@ -110,8 +114,7 @@ export declare class AccountService extends BaseGraphqlService<Account, any, num
110
114
  isEmailExists(email: string): Promise<boolean>;
111
115
  sendConfirmationEmail(email: string, locale?: string): Promise<boolean>;
112
116
  confirmEmail(email: String, code: String): Promise<boolean>;
113
- watch(): Observable<Account>;
114
- listenChanges(): Subscription;
117
+ listenChanges(opts?: AccountWatchOptions): Subscription;
115
118
  get additionalFields(): FormFieldDefinition[];
116
119
  get $additionalFields(): Observable<FormFieldDefinition[]>;
117
120
  getAdditionalField(key: string): FormFieldDefinition | undefined;
@@ -142,6 +145,9 @@ export declare class AccountService extends BaseGraphqlService<Account, any, num
142
145
  */
143
146
  protected saveSettingsRemotely(settings: UserSettings): Promise<void>;
144
147
  protected authenticateAndGetToken(token?: string, counter?: number): Promise<string>;
148
+ protected startListenChanges(opts?: AccountWatchOptions): Subscription;
149
+ protected stopListenChanges(): void;
150
+ protected watchChanges(opts?: AccountWatchOptions): Observable<Account>;
145
151
  protected copyIdAndUpdateDate(source: Account | undefined, target: Account): void;
146
152
  protected copyIdAndUpdateDateSettings(source: UserSettings | undefined, target: UserSettings): void;
147
153
  }
@@ -7,7 +7,6 @@ export declare class Environment {
7
7
  version: string;
8
8
  production: boolean;
9
9
  baseUrl: string;
10
- listenRemoteChanges?: boolean;
11
10
  defaultPeer?: {
12
11
  host: string;
13
12
  port: number;
@@ -39,4 +38,11 @@ export declare class Environment {
39
38
  username?: string;
40
39
  password?: string;
41
40
  };
41
+ account?: {
42
+ enableListenChanges?: boolean;
43
+ listenIntervalInSecond?: number;
44
+ };
45
+ entityEditor?: {
46
+ enableListenChanges?: boolean;
47
+ };
42
48
  }