@sumaris-net/ngx-components 2.2.1-rc8 → 2.2.1-rc9
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/doc/changelog.md +1 -1
- package/esm2020/src/app/core/services/base-entity-service.class.mjs +21 -12
- package/esm2020/src/app/shared/material/chips/material.chips.mjs +5 -4
- package/esm2020/src/app/shared/services/entity-service.class.mjs +1 -1
- package/fesm2015/sumaris-net.ngx-components.mjs +22 -28
- package/fesm2015/sumaris-net.ngx-components.mjs.map +1 -1
- package/fesm2020/sumaris-net.ngx-components.mjs +23 -14
- package/fesm2020/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/src/app/core/services/base-entity-service.class.d.ts +7 -21
- package/src/app/shared/services/entity-service.class.d.ts +20 -10
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import {
|
|
2
|
+
import { InternalRefetchQueriesInclude, MutationUpdaterFn } from '@apollo/client/core';
|
|
3
3
|
import { SortDirection } from '@angular/material/sort';
|
|
4
4
|
import { BaseGraphqlService } from './base-graphql-service.class';
|
|
5
|
-
import { EntitiesServiceWatchOptions,
|
|
5
|
+
import { EntitiesServiceLoadOptions, EntitiesServiceWatchOptions, EntityServiceListenChangesOptions, IEntitiesService, IEntityService, LoadResult } from '../../shared/services/entity-service.class';
|
|
6
6
|
import { GraphqlService } from '../graphql/graphql.service';
|
|
7
7
|
import { PlatformService } from './platform.service';
|
|
8
8
|
import { Entity, EntityAsObjectOptions } from './model/entity.model';
|
|
@@ -45,7 +45,7 @@ export interface EntitySaveOptions {
|
|
|
45
45
|
data: any;
|
|
46
46
|
}>;
|
|
47
47
|
}
|
|
48
|
-
export declare abstract class BaseEntityService<T extends Entity<T, ID>, F extends EntityFilter<F, T, ID>, ID = number, WO extends EntitiesServiceWatchOptions = EntitiesServiceWatchOptions, LO extends
|
|
48
|
+
export declare abstract class BaseEntityService<T extends Entity<T, ID>, F extends EntityFilter<F, T, ID>, ID = number, WO extends EntitiesServiceWatchOptions = EntitiesServiceWatchOptions, LO extends EntitiesServiceLoadOptions = EntitiesServiceLoadOptions, Q extends BaseEntityGraphqlQueries = BaseEntityGraphqlQueries, M extends BaseEntityGraphqlMutations = BaseEntityGraphqlMutations, S extends BaseEntityGraphqlSubscriptions = BaseEntityGraphqlSubscriptions> extends BaseGraphqlService<T, F, ID> implements IEntitiesService<T, F, WO>, IEntityService<T, ID, LO> {
|
|
49
49
|
protected graphql: GraphqlService;
|
|
50
50
|
protected platform: PlatformService;
|
|
51
51
|
protected dataType: new () => T;
|
|
@@ -61,19 +61,11 @@ export declare abstract class BaseEntityService<T extends Entity<T, ID>, F exten
|
|
|
61
61
|
protected readonly defaultSortDirection: SortDirection;
|
|
62
62
|
protected readonly watchQueriesUpdatePolicy: MutableWatchQueriesUpdatePolicy;
|
|
63
63
|
protected constructor(graphql: GraphqlService, platform: PlatformService, dataType: new () => T, filterType: new () => F, options: BaseEntityServiceOptions<T, ID, Q, M, S>);
|
|
64
|
-
watch(id: number, opts?: WO
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
load(id: ID, opts?: LO & {
|
|
68
|
-
query?: any;
|
|
69
|
-
}): Promise<T>;
|
|
70
|
-
watchAll(offset: number, size: number, sortBy?: string, sortDirection?: SortDirection, filter?: F, opts?: WO & {
|
|
71
|
-
query?: any;
|
|
72
|
-
}): Observable<LoadResult<T>>;
|
|
64
|
+
watch(id: number, opts?: WO): Observable<T>;
|
|
65
|
+
load(id: ID, opts?: LO): Promise<T>;
|
|
66
|
+
watchAll(offset: number, size: number, sortBy?: string, sortDirection?: SortDirection, filter?: F, opts?: WO): Observable<LoadResult<T>>;
|
|
73
67
|
loadAll(offset: number, size: number, sortBy?: string, sortDirection?: SortDirection, filter?: Partial<F>, opts?: LO & {
|
|
74
|
-
query?: any;
|
|
75
68
|
debug?: boolean;
|
|
76
|
-
withTotal?: boolean;
|
|
77
69
|
}): Promise<LoadResult<T>>;
|
|
78
70
|
countAll(filter?: Partial<F>, opts?: LO): Promise<number>;
|
|
79
71
|
canUserWrite(data: T, opts?: any): boolean;
|
|
@@ -95,13 +87,7 @@ export declare abstract class BaseEntityService<T extends Entity<T, ID>, F exten
|
|
|
95
87
|
* Delete a referential entity
|
|
96
88
|
*/
|
|
97
89
|
delete(entity: T, opts?: EntitySaveOptions | any): Promise<any>;
|
|
98
|
-
listenChanges(id: ID, opts?:
|
|
99
|
-
query?: any;
|
|
100
|
-
variables?: any;
|
|
101
|
-
interval?: number;
|
|
102
|
-
fetchPolicy?: FetchPolicy;
|
|
103
|
-
toEntity?: boolean;
|
|
104
|
-
}): Observable<T>;
|
|
90
|
+
listenChanges(id: ID, opts?: EntityServiceListenChangesOptions): Observable<T>;
|
|
105
91
|
copyIdAndUpdateDate(source: T, target: T): void;
|
|
106
92
|
fromObject(source: any): T;
|
|
107
93
|
asFilter(source: any): F;
|
|
@@ -28,6 +28,24 @@ export declare interface EntityServiceLoadOptions {
|
|
|
28
28
|
fetchPolicy?: FetchPolicy;
|
|
29
29
|
trash?: boolean;
|
|
30
30
|
toEntity?: boolean;
|
|
31
|
+
query?: any;
|
|
32
|
+
variables?: any;
|
|
33
|
+
[key: string]: any;
|
|
34
|
+
}
|
|
35
|
+
export declare interface EntityServiceWatchOptions {
|
|
36
|
+
fetchPolicy?: WatchQueryFetchPolicy;
|
|
37
|
+
trash?: boolean;
|
|
38
|
+
toEntity?: boolean;
|
|
39
|
+
query?: any;
|
|
40
|
+
variables?: any;
|
|
41
|
+
[key: string]: any;
|
|
42
|
+
}
|
|
43
|
+
export declare interface EntityServiceListenChangesOptions {
|
|
44
|
+
interval?: number;
|
|
45
|
+
fetchPolicy?: FetchPolicy;
|
|
46
|
+
toEntity?: boolean;
|
|
47
|
+
query?: any;
|
|
48
|
+
variables?: any;
|
|
31
49
|
[key: string]: any;
|
|
32
50
|
}
|
|
33
51
|
export declare interface IEntityService<T, ID = any, LO = EntityServiceLoadOptions> {
|
|
@@ -37,19 +55,11 @@ export declare interface IEntityService<T, ID = any, LO = EntityServiceLoadOptio
|
|
|
37
55
|
delete(data: T, opts?: any): Promise<any>;
|
|
38
56
|
listenChanges(id: ID, opts?: any): Observable<T | undefined>;
|
|
39
57
|
}
|
|
40
|
-
export declare interface EntitiesServiceLoadOptions {
|
|
41
|
-
fetchPolicy?: FetchPolicy;
|
|
42
|
-
trash?: boolean;
|
|
58
|
+
export declare interface EntitiesServiceLoadOptions extends EntityServiceLoadOptions {
|
|
43
59
|
withTotal?: boolean;
|
|
44
|
-
toEntity?: boolean;
|
|
45
|
-
[key: string]: any;
|
|
46
60
|
}
|
|
47
|
-
export declare interface EntitiesServiceWatchOptions {
|
|
48
|
-
fetchPolicy?: WatchQueryFetchPolicy;
|
|
49
|
-
trash?: boolean;
|
|
61
|
+
export declare interface EntitiesServiceWatchOptions extends EntityServiceWatchOptions {
|
|
50
62
|
withTotal?: boolean;
|
|
51
|
-
toEntity?: boolean;
|
|
52
|
-
[key: string]: any;
|
|
53
63
|
}
|
|
54
64
|
export declare interface IEntitiesService<T, F, O extends EntitiesServiceWatchOptions = EntitiesServiceWatchOptions> {
|
|
55
65
|
watchAll(offset: number, size: number, sortBy?: string, sortDirection?: SortDirection, filter?: Partial<F>, options?: O): Observable<LoadResult<T>>;
|