@sumaris-net/ngx-components 18.16.6 → 18.16.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/doc/changelog.md +4 -0
- package/esm2022/src/app/core/graphql/graphql.service.mjs +16 -30
- package/esm2022/src/app/core/services/account.service.mjs +3 -3
- package/esm2022/src/app/core/services/local-settings.service.mjs +3 -3
- package/esm2022/src/app/core/services/network.service.mjs +100 -32
- package/esm2022/src/app/social/feed/feed.service.mjs +2 -2
- package/esm2022/src/environments/environment.mjs +2 -1
- package/fesm2022/sumaris-net.ngx-components.mjs +119 -65
- package/fesm2022/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/src/app/core/graphql/graphql.service.d.ts +5 -9
- package/src/app/core/services/network.service.d.ts +28 -10
- package/src/app/shared/inputs.d.ts +1 -1
- package/src/assets/manifest.json +1 -1
package/package.json
CHANGED
|
@@ -16,6 +16,7 @@ import { PropertyMap } from '../../shared/types';
|
|
|
16
16
|
import { StartableService } from '../../shared/services/startable-service.class';
|
|
17
17
|
import { StorageService } from '../../shared/storage/storage.service';
|
|
18
18
|
import { DocumentNode } from 'graphql';
|
|
19
|
+
import { LocalSettingsService } from '../services/local-settings.service';
|
|
19
20
|
import * as i0 from "@angular/core";
|
|
20
21
|
export interface WatchQueryOptions<V> {
|
|
21
22
|
query: any;
|
|
@@ -35,23 +36,19 @@ export interface MutateQueryOptions<TData, TVariables = OperationVariables, TCon
|
|
|
35
36
|
}
|
|
36
37
|
export declare const APP_GRAPHQL_TYPE_POLICIES: InjectionToken<TypePolicies>;
|
|
37
38
|
export declare const APP_GRAPHQL_FRAGMENTS: InjectionToken<DocumentNode[]>;
|
|
38
|
-
export interface ConnectionParams extends Record<string, string> {
|
|
39
|
-
authToken?: string;
|
|
40
|
-
authBasic?: string;
|
|
41
|
-
}
|
|
42
39
|
export declare class GraphqlService extends StartableService<ApolloClient<any>> {
|
|
43
40
|
private platform;
|
|
44
41
|
private apollo;
|
|
45
42
|
private httpLink;
|
|
46
43
|
private network;
|
|
47
44
|
private storage;
|
|
45
|
+
private settings;
|
|
48
46
|
protected environment: Environment;
|
|
49
47
|
private typePolicies;
|
|
50
48
|
private fragments;
|
|
51
49
|
private readonly _networkStatusChanged$;
|
|
52
50
|
private httpParams;
|
|
53
51
|
private wsParams;
|
|
54
|
-
private connectionParams;
|
|
55
52
|
private readonly _defaultFetchPolicy;
|
|
56
53
|
private onNetworkError;
|
|
57
54
|
private customErrors;
|
|
@@ -59,9 +56,8 @@ export declare class GraphqlService extends StartableService<ApolloClient<any>>
|
|
|
59
56
|
get client(): ApolloClient<any>;
|
|
60
57
|
get cache(): ApolloCache<any>;
|
|
61
58
|
get defaultFetchPolicy(): WatchQueryFetchPolicy;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
setAuthBasic(basic: string): Promise<void>;
|
|
59
|
+
private get connectionParams();
|
|
60
|
+
constructor(platform: Platform, apollo: Apollo, httpLink: HttpLink, network: NetworkService, storage: StorageService, settings: LocalSettingsService, environment: Environment, typePolicies: TypePolicies, fragments: DocumentNode[]);
|
|
65
61
|
/**
|
|
66
62
|
* Allow to add a field resolver
|
|
67
63
|
* (see doc: https://www.apollographql.com/docs/react/data/local-state/#handling-client-fields-with-resolvers)
|
|
@@ -137,6 +133,6 @@ export declare class GraphqlService extends StartableService<ApolloClient<any>>
|
|
|
137
133
|
private createAppErrorByCode;
|
|
138
134
|
private getI18nErrorMessageByCode;
|
|
139
135
|
private toAppError;
|
|
140
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<GraphqlService, [null, null, null, null, null, null, { optional: true; }, { optional: true; }]>;
|
|
136
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GraphqlService, [null, null, null, null, null, null, null, { optional: true; }, { optional: true; }]>;
|
|
141
137
|
static ɵprov: i0.ɵɵInjectableDeclaration<GraphqlService>;
|
|
142
138
|
}
|
|
@@ -17,6 +17,10 @@ import { StartableObservableService } from '../../shared/services/startable-obse
|
|
|
17
17
|
import { NetworkEventType } from './network.types';
|
|
18
18
|
import { ILoggingService } from '../../shared/logging/logger.model';
|
|
19
19
|
import * as i0 from "@angular/core";
|
|
20
|
+
export interface ConnectionParams extends Record<string, string> {
|
|
21
|
+
authToken?: string;
|
|
22
|
+
authBasic?: string;
|
|
23
|
+
}
|
|
20
24
|
export declare const PEER_URL_REGEXP: RegExp;
|
|
21
25
|
export declare const NETWORK_DEFAULT_CONNECTION_TIMEOUT = 10000;
|
|
22
26
|
export declare class NetworkService extends StartableObservableService<Peer, Peer> {
|
|
@@ -41,6 +45,7 @@ export declare class NetworkService extends StartableObservableService<Peer, Pee
|
|
|
41
45
|
private _deviceConnectionType;
|
|
42
46
|
private _forceOffline;
|
|
43
47
|
private readonly _connectionTimeout;
|
|
48
|
+
private readonly _connectionParams;
|
|
44
49
|
private _listeners;
|
|
45
50
|
get online(): boolean;
|
|
46
51
|
get offline(): boolean;
|
|
@@ -49,6 +54,7 @@ export declare class NetworkService extends StartableObservableService<Peer, Pee
|
|
|
49
54
|
get peer(): Peer;
|
|
50
55
|
set peer(peer: Peer);
|
|
51
56
|
get connectionTimeout(): number;
|
|
57
|
+
get connectionParams(): ConnectionParams;
|
|
52
58
|
constructor(_document: any, platform: Platform, modalCtrl: ModalController, storage: Storage, settings: LocalSettingsService, cache: CacheService, http: HttpClient, environment: Environment, loggingService: ILoggingService, translate: TranslateService, toastController: ToastController);
|
|
53
59
|
/**
|
|
54
60
|
* Register to network event
|
|
@@ -111,7 +117,27 @@ export declare class NetworkService extends StartableObservableService<Peer, Pee
|
|
|
111
117
|
clearCache(opts?: {
|
|
112
118
|
emitEvent?: boolean;
|
|
113
119
|
}): Promise<void>;
|
|
114
|
-
|
|
120
|
+
/**
|
|
121
|
+
* Sends a GET request to the specified path and returns a promise of the response.
|
|
122
|
+
*
|
|
123
|
+
* @param {string} path The endpoint path to send the GET request to.
|
|
124
|
+
* @param {Object} [opts] Optional parameters for the GET request.
|
|
125
|
+
* @param {HttpHeaders | Object} [opts.headers] Headers to include in the request. Can be an instance of HttpHeaders or an object with header key-value pairs.
|
|
126
|
+
* @param {'json'} [opts.responseType] The type of response expected. Defaults to 'json'.
|
|
127
|
+
* @param {boolean} [opts.nocache] If true, indicates that the response should not be cached.
|
|
128
|
+
* @param {number} [opts.timeout] The timeout for the request in milliseconds.
|
|
129
|
+
* @return {Promise<T>} A promise that resolves with the response of type T.
|
|
130
|
+
*/
|
|
131
|
+
get<T>(path: string, opts?: {
|
|
132
|
+
headers?: HttpHeaders | {
|
|
133
|
+
[header: string]: string | string[];
|
|
134
|
+
};
|
|
135
|
+
responseType?: 'json';
|
|
136
|
+
nocache?: boolean;
|
|
137
|
+
timeout?: number;
|
|
138
|
+
}): Promise<T>;
|
|
139
|
+
setAuthToken(token: string): Promise<void>;
|
|
140
|
+
setAuthBasic(basic: string): Promise<void>;
|
|
115
141
|
protected ngOnStart(peer?: Peer): Promise<Peer>;
|
|
116
142
|
protected ngOnAfterStart(peer: Peer): Promise<void>;
|
|
117
143
|
protected ngOnStop(): void;
|
|
@@ -138,15 +164,7 @@ export declare class NetworkService extends StartableObservableService<Peer, Pee
|
|
|
138
164
|
responseType?: 'text';
|
|
139
165
|
nocache?: boolean;
|
|
140
166
|
}): Promise<string>;
|
|
141
|
-
protected
|
|
142
|
-
headers?: HttpHeaders | {
|
|
143
|
-
[header: string]: string | string[];
|
|
144
|
-
};
|
|
145
|
-
responseType?: 'json';
|
|
146
|
-
nocache?: boolean;
|
|
147
|
-
timeout?: number;
|
|
148
|
-
}): Promise<T>;
|
|
149
|
-
protected addVersionHeader<T extends {
|
|
167
|
+
protected addAppHeaders<T extends {
|
|
150
168
|
headers?: HttpHeaders | {
|
|
151
169
|
[header: string]: string | string[];
|
|
152
170
|
};
|
|
@@ -17,7 +17,7 @@ export interface InputElement extends FocusableElement {
|
|
|
17
17
|
}
|
|
18
18
|
export declare function isInputElement(object: any): object is InputElement;
|
|
19
19
|
export declare function asInputElement<T = any>(object: ElementRef<T>): InputElement | undefined;
|
|
20
|
-
export declare function tabindexComparator(a: InputElement, b: InputElement):
|
|
20
|
+
export declare function tabindexComparator(a: InputElement, b: InputElement): 1 | -1 | 0;
|
|
21
21
|
export interface CanGainFocusOptions {
|
|
22
22
|
minTabindex?: number;
|
|
23
23
|
maxTabindex?: number;
|
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.16.
|
|
5
|
+
"version": "18.16.7",
|
|
6
6
|
"default_locale": "fr",
|
|
7
7
|
"description": "Angular components for building beautiful and responsive Apps",
|
|
8
8
|
"icons": [{
|