@sumaris-net/ngx-components 1.9.4 → 1.9.7
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/bundles/sumaris-net.ngx-components.umd.js +142 -83
- package/bundles/sumaris-net.ngx-components.umd.js.map +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js.map +1 -1
- package/doc/changelog.md +2 -1
- package/esm2015/src/app/core/account/account.js +2 -2
- package/esm2015/src/app/core/form/entity-editor.class.js +3 -2
- package/esm2015/src/app/core/graphql/graphql.service.js +2 -6
- package/esm2015/src/app/core/register/confirm/confirm.js +2 -2
- package/esm2015/src/app/core/services/account.service.js +127 -73
- package/esm2015/src/environments/environment.class.js +1 -1
- package/esm2015/src/environments/environment.js +9 -3
- package/fesm2015/sumaris-net.ngx-components.js +128 -76
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +1 -1
- package/src/app/core/services/account.service.d.ts +18 -5
- package/src/environments/environment.class.d.ts +8 -1
- package/sumaris-net.ngx-components.metadata.json +1 -1
package/package.json
CHANGED
|
@@ -13,6 +13,10 @@ import { FormFieldDefinition } from '../../shared/form/field.model';
|
|
|
13
13
|
import { AuthTokenType, NetworkService } from './network.service';
|
|
14
14
|
import { FileService } from '../../shared/file/file.service';
|
|
15
15
|
import { Referential } from './model/referential.model';
|
|
16
|
+
import { ShowToastOptions } from '../../shared/toasts';
|
|
17
|
+
import { OverlayEventDetail } from '@ionic/core';
|
|
18
|
+
import { ToastController } from '@ionic/angular';
|
|
19
|
+
import { TranslateService } from '@ngx-translate/core';
|
|
16
20
|
export declare interface AccountDetails {
|
|
17
21
|
loaded: boolean;
|
|
18
22
|
keypair: KeyPair;
|
|
@@ -35,6 +39,9 @@ export declare interface IsEmailExistsVariables {
|
|
|
35
39
|
email: string;
|
|
36
40
|
hash: string;
|
|
37
41
|
}
|
|
42
|
+
export interface AccountWatchOptions {
|
|
43
|
+
intervalInSeconds?: number;
|
|
44
|
+
}
|
|
38
45
|
export declare class AccountService extends BaseGraphqlService<Account, any, number, Account> {
|
|
39
46
|
private cryptoService;
|
|
40
47
|
protected network: NetworkService;
|
|
@@ -42,13 +49,16 @@ export declare class AccountService extends BaseGraphqlService<Account, any, num
|
|
|
42
49
|
protected settings: LocalSettingsService;
|
|
43
50
|
protected storage: Storage;
|
|
44
51
|
protected file: FileService;
|
|
52
|
+
private translate;
|
|
53
|
+
private toastController;
|
|
45
54
|
protected environment: any;
|
|
46
55
|
onLogin: Subject<Account>;
|
|
47
56
|
onLogout: Subject<any>;
|
|
48
57
|
onChange: Subject<Account>;
|
|
49
58
|
onAuthTokenChange: Subject<string>;
|
|
50
59
|
onAuthBasicChange: Subject<string>;
|
|
51
|
-
private
|
|
60
|
+
private _listenChangesSubscription;
|
|
61
|
+
private readonly _enableListenChanges;
|
|
52
62
|
private _cache;
|
|
53
63
|
private _$additionalFields;
|
|
54
64
|
private _tokenType$;
|
|
@@ -57,7 +67,7 @@ export declare class AccountService extends BaseGraphqlService<Account, any, num
|
|
|
57
67
|
get department(): Department;
|
|
58
68
|
get tokenType(): AuthTokenType;
|
|
59
69
|
set tokenType(value: AuthTokenType);
|
|
60
|
-
constructor(cryptoService: CryptoService, network: NetworkService, graphql: GraphqlService, settings: LocalSettingsService, storage: Storage, file: FileService, environment: any);
|
|
70
|
+
constructor(cryptoService: CryptoService, network: NetworkService, graphql: GraphqlService, settings: LocalSettingsService, storage: Storage, file: FileService, translate: TranslateService, toastController: ToastController, environment: any);
|
|
61
71
|
ngOnStart(): Promise<Account>;
|
|
62
72
|
protected ngOnStop(): Promise<void>;
|
|
63
73
|
isLogin(): boolean;
|
|
@@ -78,7 +88,7 @@ export declare class AccountService extends BaseGraphqlService<Account, any, num
|
|
|
78
88
|
register(data: RegisterData): Promise<Account>;
|
|
79
89
|
authenticate(data?: AuthData): Promise<void>;
|
|
80
90
|
login(data: AuthData): Promise<Account>;
|
|
81
|
-
|
|
91
|
+
reload(): Promise<Account>;
|
|
82
92
|
/**
|
|
83
93
|
* Create or update an user account, to the remote storage
|
|
84
94
|
*
|
|
@@ -110,8 +120,7 @@ export declare class AccountService extends BaseGraphqlService<Account, any, num
|
|
|
110
120
|
isEmailExists(email: string): Promise<boolean>;
|
|
111
121
|
sendConfirmationEmail(email: string, locale?: string): Promise<boolean>;
|
|
112
122
|
confirmEmail(email: String, code: String): Promise<boolean>;
|
|
113
|
-
|
|
114
|
-
listenChanges(): Subscription;
|
|
123
|
+
listenChanges(opts?: AccountWatchOptions): Subscription;
|
|
115
124
|
get additionalFields(): FormFieldDefinition[];
|
|
116
125
|
get $additionalFields(): Observable<FormFieldDefinition[]>;
|
|
117
126
|
getAdditionalField(key: string): FormFieldDefinition | undefined;
|
|
@@ -142,6 +151,10 @@ export declare class AccountService extends BaseGraphqlService<Account, any, num
|
|
|
142
151
|
*/
|
|
143
152
|
protected saveSettingsRemotely(settings: UserSettings): Promise<void>;
|
|
144
153
|
protected authenticateAndGetToken(token?: string, counter?: number): Promise<string>;
|
|
154
|
+
protected startListenChanges(opts?: AccountWatchOptions): Subscription;
|
|
155
|
+
protected stopListenChanges(): void;
|
|
156
|
+
protected watchChanges(opts?: AccountWatchOptions): Observable<Account>;
|
|
145
157
|
protected copyIdAndUpdateDate(source: Account | undefined, target: Account): void;
|
|
146
158
|
protected copyIdAndUpdateDateSettings(source: UserSettings | undefined, target: UserSettings): void;
|
|
159
|
+
protected showToast<T = any>(opts: ShowToastOptions): Promise<OverlayEventDetail<T>>;
|
|
147
160
|
}
|
|
@@ -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,12 @@ export declare class Environment {
|
|
|
39
38
|
username?: string;
|
|
40
39
|
password?: string;
|
|
41
40
|
};
|
|
41
|
+
account?: {
|
|
42
|
+
enableListenChanges?: boolean;
|
|
43
|
+
listenIntervalInSeconds?: number;
|
|
44
|
+
};
|
|
45
|
+
entityEditor?: {
|
|
46
|
+
enableListenChanges?: boolean;
|
|
47
|
+
listenIntervalInSeconds?: number;
|
|
48
|
+
};
|
|
42
49
|
}
|