@sumaris-net/ngx-components 2.0.0-rc11 → 2.0.0-rc13
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/esm2020/src/app/core/services/account.service.mjs +18 -19
- package/esm2020/src/app/core/services/base-graphql-service.class.mjs +5 -5
- package/esm2020/src/app/core/services/base58.mjs +2 -2
- package/esm2020/src/app/core/services/crypto.service.mjs +79 -94
- package/esm2020/src/app/core/services/local-settings.service.mjs +2 -3
- package/esm2020/src/app/core/services/model/peer.model.mjs +3 -3
- package/esm2020/src/app/core/services/platform.service.mjs +2 -3
- package/esm2020/src/app/core/table/table.class.mjs +4 -12
- package/esm2020/src/app/shared/dates.mjs +2 -3
- package/esm2020/src/app/shared/material/datetime/testing/mat-date-time.test.mjs +2 -3
- package/esm2020/src/app/shared/material/datetime/testing/mat-date.test.mjs +2 -3
- package/esm2020/src/app/shared/material/swipe/testing/swipe.test.mjs +2 -3
- package/esm2020/src/app/shared/pipes/date-diff-duration.pipe.mjs +2 -3
- package/esm2020/src/app/shared/validator/validators.mjs +2 -3
- package/esm2020/src/app/social/user-event/testing/user-event.testing.mjs +2 -3
- package/esm2020/src/app/social/user-event/user-event.service.mjs +2 -3
- package/esm2020/src/app/vendor.mjs +3 -5
- package/fesm2015/sumaris-net.ngx-components.mjs +132 -161
- package/fesm2015/sumaris-net.ngx-components.mjs.map +1 -1
- package/fesm2020/sumaris-net.ngx-components.mjs +127 -164
- package/fesm2020/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +2 -1
- package/src/app/core/services/account.service.d.ts +5 -6
- package/src/app/core/services/base-graphql-service.class.d.ts +9 -8
- package/src/app/core/services/crypto.service.d.ts +23 -18
- package/src/app/core/table/table.class.d.ts +2 -6
- package/src/app/shared/dates.d.ts +2 -3
- package/src/app/shared/material/swipe/testing/swipe.test.d.ts +1 -2
- package/src/app/vendor.d.ts +0 -2
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.0.0-
|
|
4
|
+
"version": "2.0.0-rc13",
|
|
5
5
|
"author": "contact@e-is.pro",
|
|
6
6
|
"license": "AGPL-3.0",
|
|
7
7
|
"readmeFilename": "README.md",
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"access": "public"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
+
"@noble/ed25519": "^1.7.1",
|
|
12
13
|
"clone": "~2.1.2",
|
|
13
14
|
"tslib": "~2.3.1"
|
|
14
15
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Keypair } from './crypto.service';
|
|
2
2
|
import { Department } from './model/department.model';
|
|
3
3
|
import { Account } from './model/account.model';
|
|
4
4
|
import { Person, UserProfileLabel } from './model/person.model';
|
|
@@ -20,7 +20,7 @@ import { TranslateService } from '@ngx-translate/core';
|
|
|
20
20
|
import * as i0 from "@angular/core";
|
|
21
21
|
export declare interface AccountDetails {
|
|
22
22
|
loaded: boolean;
|
|
23
|
-
keypair:
|
|
23
|
+
keypair: Keypair;
|
|
24
24
|
authToken: string;
|
|
25
25
|
authBasic?: string;
|
|
26
26
|
pubkey: string;
|
|
@@ -44,7 +44,6 @@ export interface AccountWatchOptions {
|
|
|
44
44
|
intervalInSeconds?: number;
|
|
45
45
|
}
|
|
46
46
|
export declare class AccountService extends BaseGraphqlService<Account, any, number, Account> {
|
|
47
|
-
private cryptoService;
|
|
48
47
|
protected network: NetworkService;
|
|
49
48
|
protected graphql: GraphqlService;
|
|
50
49
|
protected settings: LocalSettingsService;
|
|
@@ -69,7 +68,7 @@ export declare class AccountService extends BaseGraphqlService<Account, any, num
|
|
|
69
68
|
get department(): Department;
|
|
70
69
|
get tokenType(): AuthTokenType;
|
|
71
70
|
set tokenType(value: AuthTokenType);
|
|
72
|
-
constructor(
|
|
71
|
+
constructor(network: NetworkService, graphql: GraphqlService, settings: LocalSettingsService, storage: Storage, file: FileService, translate: TranslateService, toastController: ToastController, environment: any);
|
|
73
72
|
ngOnStart(): Promise<Account>;
|
|
74
73
|
protected ngOnStop(): Promise<void>;
|
|
75
74
|
isLogin(): boolean;
|
|
@@ -147,7 +146,7 @@ export declare class AccountService extends BaseGraphqlService<Account, any, num
|
|
|
147
146
|
* @param account
|
|
148
147
|
* @param keyPair
|
|
149
148
|
*/
|
|
150
|
-
protected saveRemotely(account: Account, keyPair?:
|
|
149
|
+
protected saveRemotely(account: Account, keyPair?: Keypair): Promise<Account>;
|
|
151
150
|
/**
|
|
152
151
|
* Create or update user settings
|
|
153
152
|
*
|
|
@@ -161,6 +160,6 @@ export declare class AccountService extends BaseGraphqlService<Account, any, num
|
|
|
161
160
|
protected copyIdAndUpdateDate(source: Account | undefined, target: Account): void;
|
|
162
161
|
protected copyIdAndUpdateDateSettings(source: UserSettings | undefined, target: UserSettings): void;
|
|
163
162
|
protected showToast<T = any>(opts: ShowToastOptions): Promise<OverlayEventDetail<T>>;
|
|
164
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AccountService, [null, null, null, null, null,
|
|
163
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AccountService, [null, null, null, null, null, { optional: true; }, { optional: true; }, null]>;
|
|
165
164
|
static ɵprov: i0.ɵɵInjectableDeclaration<AccountService>;
|
|
166
165
|
}
|
|
@@ -8,6 +8,7 @@ import { QueryRef } from 'apollo-angular';
|
|
|
8
8
|
import { PureQueryOptions } from '@apollo/client/core/types';
|
|
9
9
|
import { DocumentNode } from 'graphql';
|
|
10
10
|
import { StartableService } from '../../shared/services/startable-service.class';
|
|
11
|
+
import { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
11
12
|
import * as i0 from "@angular/core";
|
|
12
13
|
export interface QueryVariables<F = any> extends Partial<Page> {
|
|
13
14
|
filter?: F;
|
|
@@ -30,15 +31,15 @@ export interface MutableWatchQueryOptions<D, T = any, V = EmptyObject> extends W
|
|
|
30
31
|
insertFilterFn?: (data: T) => boolean;
|
|
31
32
|
sortFn?: (a: T, b: T) => number;
|
|
32
33
|
}
|
|
33
|
-
export interface MutableWatchQueryDescription<
|
|
34
|
+
export interface MutableWatchQueryDescription<TData, TEntityClass = any, TVariables = EmptyObject> extends PureQueryOptions<TVariables, TData> {
|
|
34
35
|
id?: string;
|
|
35
|
-
query: DocumentNode
|
|
36
|
-
queryRef: QueryRef<
|
|
37
|
-
variables:
|
|
38
|
-
arrayFieldName: keyof
|
|
39
|
-
totalFieldName?: keyof
|
|
40
|
-
insertFilterFn?: (data:
|
|
41
|
-
sortFn?: (a:
|
|
36
|
+
query: DocumentNode | TypedDocumentNode<TData, TVariables>;
|
|
37
|
+
queryRef: QueryRef<TData, TVariables>;
|
|
38
|
+
variables: TVariables;
|
|
39
|
+
arrayFieldName: keyof TData;
|
|
40
|
+
totalFieldName?: keyof TData;
|
|
41
|
+
insertFilterFn?: (data: TEntityClass) => boolean;
|
|
42
|
+
sortFn?: (a: TEntityClass, b: TEntityClass) => number;
|
|
42
43
|
counter: number;
|
|
43
44
|
}
|
|
44
45
|
export interface FindMutableWatchQueriesOptions {
|
|
@@ -1,39 +1,44 @@
|
|
|
1
|
+
import { Params } from '@polkadot/util-crypto/scrypt/types';
|
|
2
|
+
import { Keypair } from '@polkadot/util-crypto/types';
|
|
1
3
|
import * as i0 from "@angular/core";
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
4
|
+
export declare const ED25519_SEED_LENGTH = 32;
|
|
5
|
+
export declare const SCRYPT_PARAMS: {
|
|
6
|
+
SIMPLE: Params;
|
|
7
|
+
DEFAULT: Params;
|
|
8
|
+
SECURE: Params;
|
|
9
|
+
HARDEST: Params;
|
|
10
|
+
EXTREME: Params;
|
|
11
|
+
};
|
|
12
|
+
export { Keypair };
|
|
11
13
|
export declare class CryptoService {
|
|
14
|
+
private static _ready;
|
|
15
|
+
private static get started();
|
|
16
|
+
private static ready;
|
|
12
17
|
/**
|
|
13
|
-
* Generate sign keypair,
|
|
18
|
+
* Generate a sign keypair, using scrypt, from a salt and a password
|
|
14
19
|
*
|
|
15
20
|
* @param salt
|
|
16
21
|
* @param password
|
|
17
22
|
* @param scryptParams
|
|
18
23
|
*/
|
|
19
|
-
scryptKeypair(salt: string, password: string, scryptParams?:
|
|
24
|
+
static scryptKeypair(salt: string, password: string, scryptParams?: Params): Promise<Keypair>;
|
|
20
25
|
/**
|
|
21
26
|
* Sign a message, from a key pair
|
|
22
27
|
*/
|
|
23
|
-
sign(message: string, keypair:
|
|
28
|
+
static sign(message: string, keypair: Keypair): Promise<string>;
|
|
24
29
|
/**
|
|
25
30
|
* Sign a message, from a key pair
|
|
26
31
|
*/
|
|
27
|
-
verify(message: string, signature: string,
|
|
32
|
+
static verify(message: string, signature: string, publicKey: string): Promise<boolean>;
|
|
28
33
|
/**
|
|
29
|
-
* Hash (using SHA256) a message
|
|
34
|
+
* Hash (using SHA256) a message, as Hex
|
|
30
35
|
*/
|
|
31
|
-
sha256(message: string): string;
|
|
36
|
+
static sha256(message: string): string;
|
|
32
37
|
/**
|
|
33
|
-
* Hash (using SHA512) a message
|
|
38
|
+
* Hash (using SHA512) a message, as Hex
|
|
34
39
|
*/
|
|
35
|
-
sha512(message: string): string;
|
|
36
|
-
encodeBase64(message: string): string;
|
|
40
|
+
static sha512(message: string): string;
|
|
41
|
+
static encodeBase64(message: string): string;
|
|
37
42
|
static ɵfac: i0.ɵɵFactoryDeclaration<CryptoService, never>;
|
|
38
43
|
static ɵprov: i0.ɵɵInjectableDeclaration<CryptoService>;
|
|
39
44
|
}
|
|
@@ -126,10 +126,6 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
|
|
|
126
126
|
get filter(): F;
|
|
127
127
|
get empty(): boolean;
|
|
128
128
|
onRefresh: EventEmitter<any>;
|
|
129
|
-
onOpenIdAndRow: EventEmitter<{
|
|
130
|
-
id: ID;
|
|
131
|
-
row: TableElement<T>;
|
|
132
|
-
}>;
|
|
133
129
|
onOpenRow: EventEmitter<TableElement<T>>;
|
|
134
130
|
onNewRow: EventEmitter<any>;
|
|
135
131
|
onStartEditingRow: EventEmitter<TableElement<T>>;
|
|
@@ -237,7 +233,7 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
|
|
|
237
233
|
setFilter(filter: F, opts?: {
|
|
238
234
|
emitEvent?: boolean;
|
|
239
235
|
}): void;
|
|
240
|
-
confirmAndAdd(event?: Event, row?: TableElement<T>):
|
|
236
|
+
confirmAndAdd(event?: Event, row?: TableElement<T>): Promise<boolean>;
|
|
241
237
|
confirmAndBackward(event?: Event, row?: TableElement<T>): boolean;
|
|
242
238
|
confirmAndForward(event?: Event, row?: TableElement<T>): boolean | Promise<boolean>;
|
|
243
239
|
/**
|
|
@@ -400,5 +396,5 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
|
|
|
400
396
|
private startCellValueChanges;
|
|
401
397
|
private stopCellValueChanges;
|
|
402
398
|
static ɵfac: i0.ɵɵFactoryDeclaration<AppTable<any, any, any>, never>;
|
|
403
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<AppTable<any, any, any>, never, never, { "settingsId": "settingsId"; "debug": "debug"; "i18nColumnPrefix": "i18nColumnPrefix"; "i18nColumnSuffix": "i18nColumnSuffix"; "autoLoad": "autoLoad"; "readOnly": "readOnly"; "inlineEdition": "inlineEdition"; "focusFirstColumn": "focusFirstColumn"; "confirmBeforeDelete": "confirmBeforeDelete"; "confirmBeforeCancel": "confirmBeforeCancel"; "undoableDeletion": "undoableDeletion"; "saveBeforeDelete": "saveBeforeDelete"; "keepEditedRowOnSave": "keepEditedRowOnSave"; "saveBeforeSort": "saveBeforeSort"; "saveBeforeFilter": "saveBeforeFilter"; "propagateRowError": "propagateRowError"; "defaultSortBy": "defaultSortBy"; "defaultSortDirection": "defaultSortDirection"; "defaultPageSize": "defaultPageSize"; "defaultPageSizeOptions": "defaultPageSizeOptions"; "focusColumn": "focusColumn"; "dataSource": "dataSource"; "filter": "filter"; "disabled": "disabled"; "paginator": "paginator"; }, { "onRefresh": "onRefresh"; "
|
|
399
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AppTable<any, any, any>, never, never, { "settingsId": "settingsId"; "debug": "debug"; "i18nColumnPrefix": "i18nColumnPrefix"; "i18nColumnSuffix": "i18nColumnSuffix"; "autoLoad": "autoLoad"; "readOnly": "readOnly"; "inlineEdition": "inlineEdition"; "focusFirstColumn": "focusFirstColumn"; "confirmBeforeDelete": "confirmBeforeDelete"; "confirmBeforeCancel": "confirmBeforeCancel"; "undoableDeletion": "undoableDeletion"; "saveBeforeDelete": "saveBeforeDelete"; "keepEditedRowOnSave": "keepEditedRowOnSave"; "saveBeforeSort": "saveBeforeSort"; "saveBeforeFilter": "saveBeforeFilter"; "propagateRowError": "propagateRowError"; "defaultSortBy": "defaultSortBy"; "defaultSortDirection": "defaultSortDirection"; "defaultPageSize": "defaultPageSize"; "defaultPageSizeOptions": "defaultPageSizeOptions"; "focusColumn": "focusColumn"; "dataSource": "dataSource"; "filter": "filter"; "disabled": "disabled"; "paginator": "paginator"; }, { "onRefresh": "onRefresh"; "onOpenRow": "onOpenRow"; "onNewRow": "onNewRow"; "onStartEditingRow": "onStartEditingRow"; "onConfirmEditCreateRow": "onConfirmEditCreateRow"; "onCancelOrDeleteRow": "onCancelOrDeleteRow"; "onBeforeDeleteRows": "onBeforeDeleteRows"; "onBeforeCancelRows": "onBeforeCancelRows"; "onBeforeSave": "onBeforeSave"; "onAfterDeletedRows": "onAfterDeletedRows"; "onSort": "onSort"; "onDirty": "onDirty"; "onError": "onError"; }, never, never, false>;
|
|
404
400
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as momentImported from 'moment';
|
|
2
1
|
import { Duration, Moment, unitOfTime } from 'moment';
|
|
3
2
|
export declare const DATE_UNIX_TIMESTAMP = "X";
|
|
4
3
|
export declare const DATE_UNIX_MS_TIMESTAMP = "x";
|
|
@@ -31,6 +30,6 @@ export declare class DateUtils {
|
|
|
31
30
|
}
|
|
32
31
|
export declare function toDateISOString(value: any): string | undefined;
|
|
33
32
|
export declare function fromDateISOString(value: any): Moment | undefined;
|
|
34
|
-
export declare function fromUnixTimestamp(timeInSec: number):
|
|
35
|
-
export declare function fromUnixMsTimestamp(timeInMs: number):
|
|
33
|
+
export declare function fromUnixTimestamp(timeInSec: number): Moment;
|
|
34
|
+
export declare function fromUnixMsTimestamp(timeInMs: number): Moment;
|
|
36
35
|
export declare function toDuration(value: number, unit?: moment.unitOfTime.DurationConstructor): Duration;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { OnInit } from '@angular/core';
|
|
2
2
|
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
|
3
|
-
import * as momentImported from 'moment';
|
|
4
3
|
import { BehaviorSubject } from 'rxjs';
|
|
5
4
|
import { Moment } from 'moment';
|
|
6
5
|
import { DateFormatPipe } from '../../../pipes/date-format.pipe';
|
|
@@ -10,7 +9,7 @@ export declare class SwipeTestPage implements OnInit {
|
|
|
10
9
|
protected formBuilder: UntypedFormBuilder;
|
|
11
10
|
protected dateFormatPipe: DateFormatPipe;
|
|
12
11
|
form: UntypedFormGroup;
|
|
13
|
-
$dates: BehaviorSubject<
|
|
12
|
+
$dates: BehaviorSubject<Moment[]>;
|
|
14
13
|
private _today;
|
|
15
14
|
constructor(formBuilder: UntypedFormBuilder, dateFormatPipe: DateFormatPipe);
|
|
16
15
|
ngOnInit(): void;
|