@sumaris-net/ngx-components 18.21.0 → 18.21.1
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 +3 -0
- package/esm2022/src/app/admin/users/person.service.mjs +2 -1
- package/esm2022/src/app/admin/users/users.mjs +3 -3
- package/esm2022/src/app/core/services/base-entity-service.class.mjs +19 -10
- package/esm2022/src/app/shared/services/entity-service.class.mjs +1 -1
- package/fesm2022/sumaris-net.ngx-components.mjs +21 -11
- package/fesm2022/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 -9
- package/src/app/shared/services/entity-service.class.d.ts +20 -17
- package/src/assets/manifest.json +1 -1
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import { InternalRefetchQueriesInclude,
|
|
2
|
+
import { InternalRefetchQueriesInclude, WatchQueryFetchPolicy } from '@apollo/client/core';
|
|
3
3
|
import { SortDirection } from '@angular/material/sort';
|
|
4
4
|
import { BaseGraphqlService } from './base-graphql-service.class';
|
|
5
|
-
import { EntitiesServiceLoadOptions, EntitiesServiceWatchOptions, EntityServiceListenChangesOptions, EntityServiceSaveOptions, IEntitiesService, IEntityService, LoadResult } from '../../shared/services/entity-service.class';
|
|
5
|
+
import { EntitiesServiceDeleteOptions, EntitiesServiceLoadOptions, EntitiesServiceWatchOptions, EntityServiceListenChangesOptions, EntityServiceSaveOptions, 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';
|
|
@@ -57,7 +57,7 @@ export interface EntityServiceRefetchQueriesOptions<T = any> {
|
|
|
57
57
|
}>>) => InternalRefetchQueriesInclude) | InternalRefetchQueriesInclude;
|
|
58
58
|
policy?: MutableWatchQueriesUpdatePolicy;
|
|
59
59
|
}
|
|
60
|
-
export declare abstract class BaseEntityService<T extends Entity<T, ID>, F extends EntityFilter<F, T, ID>, ID = number, WO extends EntitiesServiceWatchOptions = EntitiesServiceWatchOptions<T>, LO extends EntitiesServiceLoadOptions = EntitiesServiceLoadOptions<T>, 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> {
|
|
60
|
+
export declare abstract class BaseEntityService<T extends Entity<T, ID>, F extends EntityFilter<F, T, ID>, ID = number, WO extends EntitiesServiceWatchOptions = EntitiesServiceWatchOptions<T>, LO extends EntitiesServiceLoadOptions = EntitiesServiceLoadOptions<T>, DO extends EntitiesServiceDeleteOptions = EntitiesServiceDeleteOptions<T>, 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> {
|
|
61
61
|
protected graphql: GraphqlService;
|
|
62
62
|
protected platform: PlatformService;
|
|
63
63
|
protected dataType: new () => T;
|
|
@@ -94,13 +94,11 @@ export declare abstract class BaseEntityService<T extends Entity<T, ID>, F exten
|
|
|
94
94
|
/**
|
|
95
95
|
* Delete referential entities
|
|
96
96
|
*/
|
|
97
|
-
deleteAll(entities: T[], opts?:
|
|
98
|
-
update: MutationUpdaterFn<any>;
|
|
99
|
-
}> | any): Promise<any>;
|
|
97
|
+
deleteAll(entities: T[], opts?: DO | any): Promise<any>;
|
|
100
98
|
/**
|
|
101
99
|
* Delete a referential entity
|
|
102
100
|
*/
|
|
103
|
-
delete(entity: T, opts?:
|
|
101
|
+
delete(entity: T, opts?: DO | any): Promise<any>;
|
|
104
102
|
listenChanges(id: ID, opts?: EntityServiceListenChangesOptions<T>): Observable<T>;
|
|
105
103
|
copyIdAndUpdateDate(source: T, target: T): void;
|
|
106
104
|
fromObject(source: any, opts?: {
|
|
@@ -131,6 +129,6 @@ export declare abstract class BaseEntityService<T extends Entity<T, ID>, F exten
|
|
|
131
129
|
}>>) => InternalRefetchQueriesInclude) | InternalRefetchQueriesInclude;
|
|
132
130
|
protected getLoadQueries(): DocumentNode[];
|
|
133
131
|
protected getLoadQueryNames(): string[];
|
|
134
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<BaseEntityService<any, any, any, any, any, any, any, any>, never>;
|
|
135
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<BaseEntityService<any, any, any, any, any, any, any, any>, never, never, {}, {}, never, never, false, never>;
|
|
132
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BaseEntityService<any, any, any, any, any, any, any, any, any>, never>;
|
|
133
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<BaseEntityService<any, any, any, any, any, any, any, any, any>, never, never, {}, {}, never, never, false, never>;
|
|
136
134
|
}
|
|
@@ -25,34 +25,33 @@ export type SuggestFn<T, F> = (value: any, filter?: F, sortBy?: string | keyof T
|
|
|
25
25
|
export declare interface SuggestService<T, F> {
|
|
26
26
|
suggest: SuggestFn<T, F>;
|
|
27
27
|
}
|
|
28
|
-
export declare interface EntityServiceLoadOptions<
|
|
28
|
+
export declare interface EntityServiceLoadOptions<T = any, V = any> {
|
|
29
29
|
fetchPolicy?: FetchPolicy;
|
|
30
30
|
trash?: boolean;
|
|
31
|
-
toEntity?: boolean | ((source: any, opts?: any) =>
|
|
31
|
+
toEntity?: boolean | ((source: any, opts?: any) => T);
|
|
32
32
|
query?: any;
|
|
33
|
-
variables?:
|
|
34
|
-
[key: string]: any;
|
|
35
|
-
}
|
|
36
|
-
export declare interface EntityServiceDeleteOptions<E = any> {
|
|
33
|
+
variables?: V;
|
|
37
34
|
[key: string]: any;
|
|
38
35
|
}
|
|
39
|
-
export declare interface EntityServiceWatchOptions<T = any> {
|
|
36
|
+
export declare interface EntityServiceWatchOptions<T = any, V = any> {
|
|
37
|
+
query?: any;
|
|
38
|
+
variables?: V;
|
|
40
39
|
fetchPolicy?: WatchQueryFetchPolicy;
|
|
41
40
|
trash?: boolean;
|
|
42
41
|
toEntity?: boolean | ((source: any, opts?: any) => T);
|
|
43
|
-
query?: any;
|
|
44
|
-
variables?: any;
|
|
45
42
|
[key: string]: any;
|
|
46
43
|
}
|
|
47
|
-
export declare interface EntityServiceListenChangesOptions<T = any> {
|
|
44
|
+
export declare interface EntityServiceListenChangesOptions<T = any, V = any> {
|
|
45
|
+
query?: any;
|
|
46
|
+
variables?: V;
|
|
48
47
|
interval?: number;
|
|
49
48
|
fetchPolicy?: FetchPolicy;
|
|
50
|
-
toEntity?: boolean | ((source: any) => T);
|
|
51
|
-
query?: any;
|
|
52
|
-
variables?: any;
|
|
49
|
+
toEntity?: boolean | ((source: any, opts?: any) => T);
|
|
53
50
|
[key: string]: any;
|
|
54
51
|
}
|
|
55
52
|
export interface EntityServiceSaveOptions<T = any, V = any> {
|
|
53
|
+
query?: any;
|
|
54
|
+
variables?: V;
|
|
56
55
|
refetchQueries?: MutationBaseOptions<T>['refetchQueries'];
|
|
57
56
|
awaitRefetchQueries?: boolean;
|
|
58
57
|
update?: MutationUpdaterFn<{
|
|
@@ -62,6 +61,10 @@ export interface EntityServiceSaveOptions<T = any, V = any> {
|
|
|
62
61
|
}, V, any, ApolloCache<{
|
|
63
62
|
data: any;
|
|
64
63
|
}>>;
|
|
64
|
+
[key: string]: any;
|
|
65
|
+
}
|
|
66
|
+
export declare interface EntityServiceDeleteOptions<T = any, V = any> extends Omit<EntityServiceSaveOptions<T, V>, 'query'> {
|
|
67
|
+
mutation?: any;
|
|
65
68
|
}
|
|
66
69
|
export declare interface IEntityService<T, ID = any, LO = EntityServiceLoadOptions<T>, SO = EntityServiceSaveOptions<T>, DO = EntityServiceDeleteOptions<T>> {
|
|
67
70
|
load(id: ID, opts?: LO): Promise<T>;
|
|
@@ -70,15 +73,15 @@ export declare interface IEntityService<T, ID = any, LO = EntityServiceLoadOptio
|
|
|
70
73
|
delete(data: T, opts?: DO): Promise<any>;
|
|
71
74
|
listenChanges(id: ID, opts?: any): Observable<T | undefined>;
|
|
72
75
|
}
|
|
73
|
-
export declare interface EntitiesServiceLoadOptions<T = any> extends EntityServiceLoadOptions<T> {
|
|
76
|
+
export declare interface EntitiesServiceLoadOptions<T = any, V = any> extends EntityServiceLoadOptions<T, V> {
|
|
74
77
|
withTotal?: boolean;
|
|
75
78
|
}
|
|
76
|
-
export declare interface EntitiesServiceWatchOptions<T = any> extends EntityServiceWatchOptions<T> {
|
|
79
|
+
export declare interface EntitiesServiceWatchOptions<T = any, V = any> extends EntityServiceWatchOptions<T, V> {
|
|
77
80
|
withTotal?: boolean;
|
|
78
81
|
}
|
|
79
|
-
export declare interface EntitiesServiceSaveOptions<T = any> extends EntityServiceSaveOptions<T> {
|
|
82
|
+
export declare interface EntitiesServiceSaveOptions<T = any, V = any> extends EntityServiceSaveOptions<T, V> {
|
|
80
83
|
}
|
|
81
|
-
export declare interface EntitiesServiceDeleteOptions<T = any> extends EntityServiceDeleteOptions<T> {
|
|
84
|
+
export declare interface EntitiesServiceDeleteOptions<T = any, V = any> extends EntityServiceDeleteOptions<T, V> {
|
|
82
85
|
}
|
|
83
86
|
export declare interface IEntitiesService<T, F, O extends EntitiesServiceWatchOptions = EntitiesServiceWatchOptions<T>, SO extends EntitiesServiceSaveOptions = EntitiesServiceSaveOptions<T>, DO extends EntitiesServiceDeleteOptions = EntitiesServiceDeleteOptions<T>> {
|
|
84
87
|
readonly defaultFetchPolicy?: WatchQueryFetchPolicy;
|
package/src/assets/manifest.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "ngx-sumaris-components",
|
|
3
3
|
"short_name": "ngx-sumaris-components",
|
|
4
4
|
"manifest_version": 1,
|
|
5
|
-
"version": "18.21.
|
|
5
|
+
"version": "18.21.1",
|
|
6
6
|
"default_locale": "fr",
|
|
7
7
|
"description": "Angular components for building beautiful and responsive Apps",
|
|
8
8
|
"icons": [{
|