@sumaris-net/ngx-components 1.22.11-rc9 → 1.22.11
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 +538 -355
- package/bundles/sumaris-net.ngx-components.umd.js.map +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js +2 -2
- package/bundles/sumaris-net.ngx-components.umd.min.js.map +1 -1
- package/esm2015/public_api.js +2 -2
- package/esm2015/src/app/admin/users/list/users.js +2 -3
- package/esm2015/src/app/core/form/entity-editor-modal.class.js +3 -2
- package/esm2015/src/app/core/form/entity-editor.class.js +5 -4
- package/esm2015/src/app/core/menu/menu.component.js +1 -1
- package/esm2015/src/app/core/services/account.service.js +2 -2
- package/esm2015/src/app/core/services/model/person.model.js +4 -2
- package/esm2015/src/app/shared/file/file.service.js +18 -18
- package/esm2015/src/app/shared/file/file.utils.js +1 -1
- package/esm2015/src/app/shared/file/images.utils.js +166 -0
- package/esm2015/src/app/social/job/progression/job-progression.list.js +1 -1
- package/esm2015/src/app/social/user-event/notification/user-event-notification.icon.js +7 -6
- package/esm2015/src/app/social/user-event/notification/user-event-notification.list.js +48 -24
- package/esm2015/src/app/social/user-event/testing/user-event.testing.js +61 -10
- package/esm2015/src/app/social/user-event/testing/user-event.testing.model.js +103 -0
- package/esm2015/src/app/social/user-event/testing/user-event.testing.service.js +40 -31
- package/esm2015/src/app/social/user-event/user-event.model.js +2 -106
- package/esm2015/src/app/social/user-event/user-event.module.js +4 -2
- package/esm2015/src/app/social/user-event/user-event.service.js +65 -49
- package/fesm2015/sumaris-net.ngx-components.js +407 -313
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +1 -1
- package/public_api.d.ts +1 -1
- package/src/app/admin/users/list/users.d.ts +0 -2
- package/src/app/core/form/entity-editor.class.d.ts +1 -1
- package/src/app/shared/file/file.service.d.ts +5 -5
- package/src/app/shared/file/images.utils.d.ts +19 -0
- package/src/app/social/user-event/notification/user-event-notification.list.d.ts +18 -14
- package/src/app/social/user-event/testing/user-event.testing.d.ts +11 -3
- package/src/app/social/user-event/testing/user-event.testing.model.d.ts +41 -0
- package/src/app/social/user-event/testing/user-event.testing.service.d.ts +7 -6
- package/src/app/social/user-event/user-event.model.d.ts +10 -44
- package/src/app/social/user-event/user-event.service.d.ts +9 -8
- package/sumaris-net.ngx-components.metadata.json +1 -1
- package/esm2015/src/app/shared/file/base64-image-reader.js +0 -141
- package/esm2015/src/app/social/user-event/user-event.fragments.js +0 -27
- package/src/app/shared/file/base64-image-reader.d.ts +0 -18
- package/src/app/social/user-event/user-event.fragments.d.ts +0 -4
package/package.json
CHANGED
package/public_api.d.ts
CHANGED
|
@@ -90,6 +90,7 @@ export * from './src/app/shared/alerts';
|
|
|
90
90
|
export * from './src/app/shared/platforms';
|
|
91
91
|
export * from './src/app/shared/file/file.utils';
|
|
92
92
|
export * from './src/app/shared/file/csv.utils';
|
|
93
|
+
export * from './src/app/shared/file/images.utils';
|
|
93
94
|
export * from './src/app/shared/file/uri.utils';
|
|
94
95
|
export * from './src/app/shared/hotkeys/shared-hotkeys.module';
|
|
95
96
|
export * from './src/app/shared/hotkeys/hotkeys.service';
|
|
@@ -169,7 +170,6 @@ export * from './src/app/social/social.module';
|
|
|
169
170
|
export * from './src/app/social/social.errors';
|
|
170
171
|
export * from './src/app/social/user-event/user-event.module';
|
|
171
172
|
export * from './src/app/social/user-event/user-event.model';
|
|
172
|
-
export * from './src/app/social/user-event/user-event.fragments';
|
|
173
173
|
export * from './src/app/social/user-event/user-event.service';
|
|
174
174
|
export * from './src/app/social/user-event/notification/user-event-notification.icon';
|
|
175
175
|
export * from './src/app/social/job/job.module';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ChangeDetectorRef, Injector, OnInit } from '@angular/core';
|
|
2
2
|
import { Person } from '../../../core/services/model/person.model';
|
|
3
|
-
import { referentialToString } from '../../../core/services/model/referential.model';
|
|
4
3
|
import { PersonService } from '../../services/person.service';
|
|
5
4
|
import { AccountService } from '../../../core/services/account.service';
|
|
6
5
|
import { AbstractControl, FormBuilder, FormGroup } from '@angular/forms';
|
|
@@ -37,6 +36,5 @@ export declare class UsersPage extends AppTable<Person, PersonFilter> implements
|
|
|
37
36
|
protected restoreFilterOrLoad(): Promise<void>;
|
|
38
37
|
clearControlValue(event: UIEvent, formControl: AbstractControl): boolean;
|
|
39
38
|
openComposeMessageModal(event?: Event): Promise<any>;
|
|
40
|
-
referentialToString: typeof referentialToString;
|
|
41
39
|
protected markForCheck(): void;
|
|
42
40
|
}
|
|
@@ -56,7 +56,7 @@ export declare abstract class AppEntityEditor<T extends Entity<T, ID>, S extends
|
|
|
56
56
|
protected readonly dateFormat: DateFormatPipe;
|
|
57
57
|
protected readonly cd: ChangeDetectorRef;
|
|
58
58
|
protected readonly settings: LocalSettingsService;
|
|
59
|
-
protected readonly
|
|
59
|
+
protected readonly environment: Environment;
|
|
60
60
|
protected errorTranslator: FormErrorTranslator;
|
|
61
61
|
readonly savingSubject: BehaviorSubject<boolean>;
|
|
62
62
|
data: T;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Platform } from '@ionic/angular';
|
|
2
|
-
import {
|
|
2
|
+
import { ImageResizeOptions } from './images.utils';
|
|
3
3
|
import { HttpClient } from '@angular/common/http';
|
|
4
4
|
export declare class FileService {
|
|
5
5
|
private platform;
|
|
@@ -10,11 +10,11 @@ export declare class FileService {
|
|
|
10
10
|
private _imageDirectory;
|
|
11
11
|
get canUseFileSystem(): boolean;
|
|
12
12
|
constructor(platform: Platform, http: HttpClient, environment: any);
|
|
13
|
-
getImages(sources: string[], opts?:
|
|
14
|
-
|
|
13
|
+
getImages(sources: string[], opts?: ImageResizeOptions & {
|
|
14
|
+
outputType?: 'fileUrl' | 'dataUrl';
|
|
15
15
|
}): Promise<string[]>;
|
|
16
|
-
getImage(
|
|
17
|
-
|
|
16
|
+
getImage(fileUrl: string, opts?: ImageResizeOptions & {
|
|
17
|
+
outputType?: 'fileUrl' | 'dataUrl';
|
|
18
18
|
}): Promise<string>;
|
|
19
19
|
protected start(): void;
|
|
20
20
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { FileEvent } from '../upload-file/upload-file.model';
|
|
3
|
+
export declare const IMAGE_DEFAULTS: {
|
|
4
|
+
MAX_HEIGHT: number;
|
|
5
|
+
MAX_WIDTH: number;
|
|
6
|
+
THUMB_MAX_HEIGHT: number;
|
|
7
|
+
THUMB_MAX_WIDTH: number;
|
|
8
|
+
};
|
|
9
|
+
export declare interface ImageResizeOptions {
|
|
10
|
+
maxWidth?: number;
|
|
11
|
+
maxHeight?: number;
|
|
12
|
+
thumbnail?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare class ImagesUtils {
|
|
15
|
+
static readAsDataURL(file: File, opts?: ImageResizeOptions): Observable<FileEvent<string>>;
|
|
16
|
+
static readAndResizeFromUrl(fileUrl: string, opts?: ImageResizeOptions): Promise<string>;
|
|
17
|
+
static resizeBase64(dataUrl: string, opts?: ImageResizeOptions): Promise<string>;
|
|
18
|
+
protected static createImageOnLoadResizeFn(resolve: any, reject: any, opts?: ImageResizeOptions): (event: any) => void;
|
|
19
|
+
}
|
|
@@ -1,55 +1,59 @@
|
|
|
1
1
|
import { ChangeDetectorRef, EventEmitter, OnDestroy, OnInit, QueryList } from '@angular/core';
|
|
2
|
-
import { IUserEvent, IUserEventFilter,
|
|
2
|
+
import { IUserEvent, IUserEventFilter, IUserEventAction } from '../user-event.model';
|
|
3
3
|
import { BehaviorSubject, Subscription } from 'rxjs';
|
|
4
4
|
import { IonContent, IonItem, PopoverController } from '@ionic/angular';
|
|
5
5
|
import { IUserEventService } from '../user-event.service';
|
|
6
6
|
import { LocalSettingsService } from '../../../core/services/local-settings.service';
|
|
7
7
|
import { FetchMoreFn, LoadResult } from '../../../shared/services/entity-service.class';
|
|
8
8
|
import { SortDirection } from '@angular/material/sort';
|
|
9
|
-
export interface UserEventNotificationListOptions {
|
|
9
|
+
export interface UserEventNotificationListOptions<E extends IUserEvent<any> = IUserEvent<any>, F extends IUserEventFilter<any> = IUserEventFilter<any>> {
|
|
10
10
|
debug?: boolean;
|
|
11
11
|
titleI18n?: string;
|
|
12
|
-
readEvent?: EventEmitter<
|
|
13
|
-
readEvents?: EventEmitter<
|
|
12
|
+
readEvent?: EventEmitter<E>;
|
|
13
|
+
readEvents?: EventEmitter<E[]>;
|
|
14
|
+
filter?: Partial<F>;
|
|
14
15
|
}
|
|
15
|
-
export declare class UserEventNotificationList<E extends IUserEvent<any> = IUserEvent<any>> implements OnInit, OnDestroy, UserEventNotificationListOptions {
|
|
16
|
+
export declare class UserEventNotificationList<E extends IUserEvent<any> = IUserEvent<any>, F extends IUserEventFilter<any> = IUserEventFilter<any>> implements OnInit, OnDestroy, UserEventNotificationListOptions<E, F> {
|
|
16
17
|
protected cd: ChangeDetectorRef;
|
|
17
18
|
protected popoverController: PopoverController;
|
|
18
19
|
protected settings: LocalSettingsService;
|
|
19
20
|
userEventService: IUserEventService<E, IUserEventFilter<any>>;
|
|
20
|
-
protected
|
|
21
|
+
protected _subscriptions: Subscription;
|
|
21
22
|
protected _fetchMoreFn: FetchMoreFn<LoadResult<E>>;
|
|
22
|
-
protected _fetchingMore: boolean;
|
|
23
23
|
protected _fetchMoreSubscription: Subscription;
|
|
24
|
+
protected _$pageSize: BehaviorSubject<number>;
|
|
25
|
+
fetchingMore: boolean;
|
|
26
|
+
$items: BehaviorSubject<E[]>;
|
|
27
|
+
$itemCount: BehaviorSubject<number>;
|
|
24
28
|
debug: boolean;
|
|
25
29
|
mobile: boolean;
|
|
26
30
|
titleI18n: string;
|
|
27
|
-
pageSize: number;
|
|
28
31
|
sortBy: string;
|
|
29
32
|
sortDirection: SortDirection;
|
|
30
|
-
filter: Partial<
|
|
33
|
+
filter: Partial<F>;
|
|
31
34
|
enableInfiniteScroll: boolean;
|
|
35
|
+
set pageSize(value: number);
|
|
36
|
+
get pageSize(): number;
|
|
32
37
|
readEvent: EventEmitter<E>;
|
|
33
38
|
readEvents: EventEmitter<E[]>;
|
|
34
39
|
ionContent: IonContent;
|
|
35
40
|
ionItems: QueryList<IonItem>;
|
|
36
|
-
$items: BehaviorSubject<E[]>;
|
|
37
|
-
$itemCount: BehaviorSubject<number>;
|
|
38
41
|
get canFetchMore(): boolean;
|
|
39
42
|
constructor(cd: ChangeDetectorRef, popoverController: PopoverController, settings: LocalSettingsService, userEventService: IUserEventService<E, IUserEventFilter<any>>);
|
|
40
43
|
ngOnInit(): void;
|
|
41
44
|
ngOnDestroy(): void;
|
|
42
45
|
click(event: UIEvent, userEvent: E): void;
|
|
43
|
-
isDefaultAction(action:
|
|
46
|
+
isDefaultAction(action: IUserEventAction): boolean;
|
|
44
47
|
markAsRead(event: UIEvent, userEvent: E): void;
|
|
45
48
|
markAllAsRead(event: UIEvent): void;
|
|
46
|
-
executeAction(event: UIEvent, action:
|
|
49
|
+
executeAction(event: UIEvent, action: IUserEventAction, userEvent: IUserEvent<any>): Promise<void>;
|
|
47
50
|
dismiss(): void;
|
|
48
51
|
fetchMore(event?: CustomEvent & {
|
|
49
52
|
target?: EventTarget & {
|
|
50
53
|
complete?: () => void;
|
|
51
54
|
};
|
|
52
55
|
}): Promise<void>;
|
|
53
|
-
|
|
56
|
+
trackByFn(index: number, item: E): number;
|
|
57
|
+
protected initInfiniteScroll(threshold?: string): Promise<void>;
|
|
54
58
|
protected markForCheck(): void;
|
|
55
59
|
}
|
|
@@ -1,23 +1,31 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OnDestroy } from '@angular/core';
|
|
2
2
|
import { Router } from '@angular/router';
|
|
3
3
|
import { AlertController } from '@ionic/angular';
|
|
4
4
|
import { TranslateService } from '@ngx-translate/core';
|
|
5
5
|
import { UserEventTestService } from './user-event.testing.service';
|
|
6
6
|
import { AppUserEventNotificationIcon } from '../notification/user-event-notification.icon';
|
|
7
|
-
|
|
7
|
+
import { UserEventTest } from './user-event.testing.model';
|
|
8
|
+
export declare class UserEventTestingPage implements OnDestroy {
|
|
8
9
|
protected userEventService: UserEventTestService;
|
|
9
10
|
protected router: Router;
|
|
10
11
|
protected alertController: AlertController;
|
|
11
12
|
protected translateService: TranslateService;
|
|
13
|
+
private _timerSubscription;
|
|
12
14
|
notification: AppUserEventNotificationIcon;
|
|
15
|
+
get timerStarted(): boolean;
|
|
13
16
|
constructor(userEventService: UserEventTestService, router: Router, alertController: AlertController, translateService: TranslateService);
|
|
14
|
-
|
|
17
|
+
ngOnDestroy(): void;
|
|
18
|
+
protected customize(userEvent: UserEventTest): void;
|
|
15
19
|
addNotification(): void;
|
|
16
20
|
addError(): void;
|
|
17
21
|
addWarning(): void;
|
|
18
22
|
addDebug(): void;
|
|
19
23
|
addNotificationWithLink(): void;
|
|
20
24
|
addNotificationWithAction(): void;
|
|
25
|
+
addMany(count?: number): void;
|
|
26
|
+
startTimer(period?: number): void;
|
|
27
|
+
stopTimer(): void;
|
|
28
|
+
addRandom(value: number): void;
|
|
21
29
|
addNotificationWithDefaultAction(): void;
|
|
22
30
|
protected showMessage(text: string): Promise<void>;
|
|
23
31
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Entity, EntityAsObjectOptions } from '../../../core/services/model/entity.model';
|
|
2
|
+
import { Moment } from 'moment';
|
|
3
|
+
import { IconRef } from '../../../shared/types';
|
|
4
|
+
import { EventLevel, IUserEvent, IUserEventFilter, IUserEventAction } from '../user-event.model';
|
|
5
|
+
import { EntityFilter } from '../../../core/services/model/filter.model';
|
|
6
|
+
import { FilterFn } from '../../../shared/services/entity-service.class';
|
|
7
|
+
import { StoreObject } from '@apollo/client/core';
|
|
8
|
+
export declare class UserEventTest extends Entity<UserEventTest> implements IUserEvent<UserEventTest> {
|
|
9
|
+
static fromObject: (source: any, opts?: any) => UserEventTest;
|
|
10
|
+
type: string;
|
|
11
|
+
level: EventLevel;
|
|
12
|
+
issuer: string;
|
|
13
|
+
recipient: string;
|
|
14
|
+
updateDate: Moment;
|
|
15
|
+
creationDate: Moment;
|
|
16
|
+
readDate: Moment;
|
|
17
|
+
message: string | undefined;
|
|
18
|
+
content: string | any;
|
|
19
|
+
hash: string;
|
|
20
|
+
signature: string;
|
|
21
|
+
readSignature: string;
|
|
22
|
+
avatar?: string;
|
|
23
|
+
avatarIcon?: IconRef;
|
|
24
|
+
icon?: IconRef;
|
|
25
|
+
actions?: IUserEventAction[];
|
|
26
|
+
constructor();
|
|
27
|
+
asObject(opts?: EntityAsObjectOptions): any;
|
|
28
|
+
fromObject(source: any): void;
|
|
29
|
+
}
|
|
30
|
+
export declare class UserEventTestFilter extends EntityFilter<UserEventTestFilter, UserEventTest> implements IUserEventFilter<UserEventTest> {
|
|
31
|
+
static fromObject: (source: any, opts?: any) => UserEventTestFilter;
|
|
32
|
+
types: string[];
|
|
33
|
+
levels: EventLevel[];
|
|
34
|
+
issuers: string[];
|
|
35
|
+
recipients: string[];
|
|
36
|
+
startDate: Moment;
|
|
37
|
+
excludeRead: boolean;
|
|
38
|
+
fromObject(source: any, opts?: any): void;
|
|
39
|
+
protected buildFilter(): FilterFn<UserEventTest>[];
|
|
40
|
+
asObject(opts?: EntityAsObjectOptions): StoreObject;
|
|
41
|
+
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AbstractUserEventService, UserEventLoadOptions, UserEventWatchOptions } from '../user-event.service';
|
|
2
|
-
import { IUserEvent, UserEvent, UserEventFilter } from '../user-event.model';
|
|
3
2
|
import { Observable } from 'rxjs';
|
|
4
3
|
import { GraphqlService } from '../../../core/graphql/graphql.service';
|
|
5
4
|
import { AccountService } from '../../../core/services/account.service';
|
|
@@ -9,23 +8,25 @@ import { Environment } from '../../../../environments/environment.class';
|
|
|
9
8
|
import { FetchPolicy } from '@apollo/client/core';
|
|
10
9
|
import { EntityServiceLoadOptions, LoadResult } from '../../../shared/services/entity-service.class';
|
|
11
10
|
import { SortDirection } from '@angular/material/sort';
|
|
12
|
-
|
|
11
|
+
import { UserEventTest, UserEventTestFilter } from './user-event.testing.model';
|
|
12
|
+
export declare class UserEventTestService extends AbstractUserEventService<UserEventTest, UserEventTestFilter> {
|
|
13
13
|
protected graphql: GraphqlService;
|
|
14
14
|
protected accountService: AccountService;
|
|
15
15
|
protected network: NetworkService;
|
|
16
16
|
protected translate: TranslateService;
|
|
17
17
|
protected environment: Environment;
|
|
18
|
-
private userEvents;
|
|
18
|
+
private $userEvents;
|
|
19
|
+
private $newUserEvents;
|
|
19
20
|
constructor(graphql: GraphqlService, accountService: AccountService, network: NetworkService, translate: TranslateService, environment: Environment);
|
|
20
|
-
fromObject(source: any):
|
|
21
|
-
add(entity:
|
|
21
|
+
fromObject(source: any): UserEventTest;
|
|
22
|
+
add(entity: UserEventTest): Promise<void>;
|
|
22
23
|
asFilter(filter: Partial<any>): any;
|
|
23
24
|
count(filter: any, options?: {
|
|
24
25
|
fetchPolicy?: FetchPolicy;
|
|
25
26
|
}): Promise<number>;
|
|
26
27
|
delete(entity: any): Promise<any>;
|
|
27
28
|
deleteAll(data: any[], opts?: any): Promise<any>;
|
|
28
|
-
|
|
29
|
+
listenAllChanges(filter: any, options?: UserEventWatchOptions & {
|
|
29
30
|
interval?: number;
|
|
30
31
|
fetchPolicy?: FetchPolicy;
|
|
31
32
|
}): Observable<any[]>;
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import { Moment } from 'moment';
|
|
2
|
-
import { Entity,
|
|
3
|
-
import {
|
|
4
|
-
import { FilterFn } from '../../shared/services/entity-service.class';
|
|
2
|
+
import { Entity, IEntity } from '../../core/services/model/entity.model';
|
|
3
|
+
import { IEntityFilter } from '../../core/services/model/filter.model';
|
|
5
4
|
import { AppColors, IconRef } from '../../shared/types';
|
|
6
|
-
import { StoreObject } from '@apollo/client/core';
|
|
7
|
-
export declare const UserEventTypes: {
|
|
8
|
-
DEBUG_DATA: string;
|
|
9
|
-
INBOX_MESSAGE: string;
|
|
10
|
-
};
|
|
11
5
|
export declare type EventLevel = 'ERROR' | 'WARNING' | 'INFO' | 'DEBUG';
|
|
12
6
|
export interface IUserEvent<E extends Entity<E>, U = string, L = EventLevel> extends IEntity<E> {
|
|
13
7
|
issuer: U;
|
|
@@ -21,30 +15,9 @@ export interface IUserEvent<E extends Entity<E>, U = string, L = EventLevel> ext
|
|
|
21
15
|
content?: string | any;
|
|
22
16
|
avatar?: string;
|
|
23
17
|
avatarIcon?: IconRef;
|
|
18
|
+
avatarJdenticon?: any;
|
|
24
19
|
icon?: IconRef;
|
|
25
|
-
actions?:
|
|
26
|
-
}
|
|
27
|
-
export declare class UserEvent extends Entity<UserEvent> implements IUserEvent<UserEvent> {
|
|
28
|
-
static fromObject: (source: any, opts?: any) => UserEvent;
|
|
29
|
-
type: string;
|
|
30
|
-
level: EventLevel;
|
|
31
|
-
issuer: string;
|
|
32
|
-
recipient: string;
|
|
33
|
-
updateDate: Moment;
|
|
34
|
-
creationDate: Moment;
|
|
35
|
-
readDate: Moment;
|
|
36
|
-
message: string | undefined;
|
|
37
|
-
content: string | any;
|
|
38
|
-
hash: string;
|
|
39
|
-
signature: string;
|
|
40
|
-
readSignature: string;
|
|
41
|
-
avatar?: string;
|
|
42
|
-
avatarIcon?: IconRef;
|
|
43
|
-
icon?: IconRef;
|
|
44
|
-
actions?: UserEventAction[];
|
|
45
|
-
constructor();
|
|
46
|
-
asObject(opts?: EntityAsObjectOptions): any;
|
|
47
|
-
fromObject(source: any): void;
|
|
20
|
+
actions?: IUserEventAction[];
|
|
48
21
|
}
|
|
49
22
|
export interface IUserEventFilter<E extends IUserEvent<E, U, L>, U = string, L = EventLevel> extends IEntityFilter<any, E> {
|
|
50
23
|
types: string[];
|
|
@@ -54,19 +27,7 @@ export interface IUserEventFilter<E extends IUserEvent<E, U, L>, U = string, L =
|
|
|
54
27
|
startDate: Moment;
|
|
55
28
|
excludeRead: boolean;
|
|
56
29
|
}
|
|
57
|
-
export
|
|
58
|
-
static fromObject: (source: any, opts?: any) => UserEventFilter;
|
|
59
|
-
types: string[];
|
|
60
|
-
levels: EventLevel[];
|
|
61
|
-
issuers: string[];
|
|
62
|
-
recipients: string[];
|
|
63
|
-
startDate: Moment;
|
|
64
|
-
excludeRead: boolean;
|
|
65
|
-
fromObject(source: any, opts?: any): void;
|
|
66
|
-
protected buildFilter(): FilterFn<UserEvent>[];
|
|
67
|
-
asObject(opts?: EntityAsObjectOptions): StoreObject;
|
|
68
|
-
}
|
|
69
|
-
export interface UserEventAction {
|
|
30
|
+
export interface IUserEventAction {
|
|
70
31
|
name: string | any;
|
|
71
32
|
title?: string;
|
|
72
33
|
color?: AppColors;
|
|
@@ -74,3 +35,8 @@ export interface UserEventAction {
|
|
|
74
35
|
default?: boolean;
|
|
75
36
|
executeAction: (event: IUserEvent<any>) => any | Promise<any>;
|
|
76
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated use IUserEventAction instead
|
|
40
|
+
*/
|
|
41
|
+
export interface UserEventAction extends IUserEventAction {
|
|
42
|
+
}
|
|
@@ -29,12 +29,12 @@ export interface IUserEventMutations {
|
|
|
29
29
|
deleteByIds: any;
|
|
30
30
|
}
|
|
31
31
|
export interface IUserEventSubscriptions {
|
|
32
|
-
|
|
32
|
+
listenAllChanges: any;
|
|
33
33
|
listenCountChanges?: any;
|
|
34
34
|
}
|
|
35
35
|
export interface IUserEventListener<E extends IUserEvent<E>> {
|
|
36
36
|
accept: (E: any) => boolean;
|
|
37
|
-
onReceived?: (E: any) => E | undefined;
|
|
37
|
+
onReceived?: (E: any) => Promise<E> | E | undefined;
|
|
38
38
|
onRead?: (E: any) => Promise<void> | void;
|
|
39
39
|
}
|
|
40
40
|
export interface UserEventServiceOptions<Q extends IUserEventQueries = IUserEventQueries, M extends IUserEventMutations = IUserEventMutations, S extends IUserEventSubscriptions = IUserEventSubscriptions> extends BaseGraphqlServiceOptions {
|
|
@@ -52,13 +52,13 @@ export interface IUserEventService<E extends IUserEvent<E>, F extends IUserEvent
|
|
|
52
52
|
interval?: number;
|
|
53
53
|
fetchPolicy?: FetchPolicy;
|
|
54
54
|
}): Observable<number>;
|
|
55
|
-
|
|
55
|
+
listenAllChanges(filter: Partial<F>, options?: WO & {
|
|
56
56
|
interval?: number;
|
|
57
57
|
fetchPolicy?: FetchPolicy;
|
|
58
58
|
}): Observable<E[]>;
|
|
59
59
|
save(entity: E, options?: EntityServiceLoadOptions): Promise<E>;
|
|
60
60
|
delete(entity: E): Promise<any>;
|
|
61
|
-
|
|
61
|
+
markAllAsRead(entities: E[]): any;
|
|
62
62
|
registerListener(listener: IUserEventListener<E>): any;
|
|
63
63
|
resetCount(): any;
|
|
64
64
|
}
|
|
@@ -85,7 +85,7 @@ export declare abstract class AbstractUserEventService<E extends IUserEvent<E, a
|
|
|
85
85
|
watchAll(offset: number, size: number, sortBy?: string, sortDirection?: SortDirection, filter?: Partial<F>, options?: WO): Observable<LoadResult<E>>;
|
|
86
86
|
watchPage(page: Page, filter?: Partial<F>, opts?: WO): Observable<LoadResult<E>>;
|
|
87
87
|
loadPage(page: Page, filter?: Partial<F>, opts?: LO): Promise<LoadResult<E>>;
|
|
88
|
-
add(entity: E): void
|
|
88
|
+
add(entity: E): Promise<void>;
|
|
89
89
|
count(filter: Partial<F>, options?: {
|
|
90
90
|
fetchPolicy?: FetchPolicy;
|
|
91
91
|
}): Promise<number>;
|
|
@@ -93,22 +93,23 @@ export declare abstract class AbstractUserEventService<E extends IUserEvent<E, a
|
|
|
93
93
|
interval?: number;
|
|
94
94
|
fetchPolicy?: FetchPolicy;
|
|
95
95
|
}): Observable<number>;
|
|
96
|
-
|
|
96
|
+
listenAllChanges(filter: Partial<F>, opts?: WO & {
|
|
97
97
|
interval?: number;
|
|
98
98
|
fetchPolicy?: FetchPolicy;
|
|
99
|
+
toEntity?: boolean;
|
|
99
100
|
}): Observable<E[]>;
|
|
100
101
|
delete(entity: E): Promise<any>;
|
|
101
102
|
deleteAll(entities: E[], opts?: any): Promise<any>;
|
|
102
103
|
save(entity: E, options?: EntityServiceLoadOptions): Promise<E>;
|
|
103
104
|
saveAll(entities: E[], opts?: any): Promise<E[]>;
|
|
104
|
-
|
|
105
|
+
markAllAsRead(entities: E[]): Promise<void>;
|
|
105
106
|
registerListener(listener: IUserEventListener<E>): void;
|
|
106
107
|
resetCount(): void;
|
|
107
108
|
protected onLogin(): Promise<void>;
|
|
108
109
|
protected onLogout(): void;
|
|
109
110
|
protected startListenCountChanges(): void;
|
|
110
111
|
protected stopListenCountChanges(): void;
|
|
111
|
-
protected processUserEvent(source: any, that?: AbstractUserEventService<E, F>): E
|
|
112
|
+
protected processUserEvent(source: any, that?: AbstractUserEventService<E, F>): Promise<E>;
|
|
112
113
|
protected defaultMarkAsRead(userEvents: E[]): Promise<void>;
|
|
113
114
|
protected defaultFilter(): F;
|
|
114
115
|
protected defaultRecipient(): any;
|