arlas-web-core 24.0.0-beta.1 → 24.0.0
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/README.md +5 -5
- package/index.d.ts +6 -0
- package/{src/index.ts → index.js} +4 -7
- package/index.js.map +1 -0
- package/models/collaboration.d.ts +29 -0
- package/{src/models/collaboration.ts → models/collaboration.js} +6 -30
- package/models/collaboration.js.map +1 -0
- package/models/contributor.d.ts +57 -0
- package/models/contributor.js +125 -0
- package/models/contributor.js.map +1 -0
- package/models/projections.d.ts +35 -0
- package/models/projections.js +38 -0
- package/models/projections.js.map +1 -0
- package/package.json +3 -19
- package/services/collaborativesearch.service.d.ts +353 -0
- package/{src/services/collaborativesearch.service.ts → services/collaborativesearch.service.js} +176 -368
- package/services/collaborativesearch.service.js.map +1 -0
- package/services/config.service.d.ts +31 -0
- package/{src/services/config.service.ts → services/config.service.js} +12 -16
- package/services/config.service.js.map +1 -0
- package/utils/utils.d.ts +22 -0
- package/utils/utils.js +63 -0
- package/utils/utils.js.map +1 -0
- package/.editorconfig +0 -13
- package/.eslintignore +0 -2
- package/.eslintrc.json +0 -155
- package/.github/workflows/main.yml +0 -45
- package/CHANGELOG.md +0 -514
- package/CONTRIBUTING.md +0 -48
- package/NOTICE.txt +0 -10
- package/README-NPM.md +0 -78
- package/build.sh +0 -9
- package/jsconfig.json +0 -13
- package/mkDocs.sh +0 -18
- package/package-release.json +0 -26
- package/release.sh +0 -426
- package/src/models/contributor.ts +0 -165
- package/src/models/projections.ts +0 -58
- package/src/utils/utils.ts +0 -80
- package/tsconfig-build.json +0 -21
- package/tsconfig.json +0 -15
- package/tslint.json +0 -116
- /package/{LICENSE.txt → LICENSE} +0 -0
package/README.md
CHANGED
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
[](https://badge.fury.io/js/arlas-web-core)
|
|
5
5
|
|
|
6
6
|
`arlas-web-core ` is a typescript library that provides :
|
|
7
|
-
- A collaborative search service (`CSS`) that coordinates the [ARLAS-web-contributors](https://
|
|
8
|
-
- A configuration service that allows to read and parse a configuration file (that is used by the `CSS` & other services in [ARLAS-wui-toolkit](https://
|
|
7
|
+
- A collaborative search service (`CSS`) that coordinates the [ARLAS-web-contributors](https://www.npmjs.com/package/arlas-web-contributors) collaborations.
|
|
8
|
+
- A configuration service that allows to read and parse a configuration file (that is used by the `CSS` & other services in [ARLAS-wui-toolkit](https://www.npmjs.com/package/arlas-wui-toolkit)).
|
|
9
9
|
|
|
10
10
|
## Install
|
|
11
11
|
|
|
12
|
-
To install this library in your
|
|
12
|
+
To install this library in your web application, add the dependency in your `package.json` file.
|
|
13
13
|
|
|
14
14
|
```shell
|
|
15
15
|
$ npm install --save arlas-web-core
|
|
@@ -17,7 +17,7 @@ $ npm install --save arlas-web-core
|
|
|
17
17
|
|
|
18
18
|
## Documentation
|
|
19
19
|
|
|
20
|
-
Please find the documentation [here](
|
|
20
|
+
Please find the documentation [here](http://docs.arlas.io/arlas-tech/current/classes/_src_app_services_startup_startup_service_.arlascollaborativesearchservice/)
|
|
21
21
|
|
|
22
22
|
## Build
|
|
23
23
|
|
|
@@ -68,7 +68,7 @@ We use [SemVer](http://semver.org/) for versioning : `x.y.z`.
|
|
|
68
68
|
|
|
69
69
|
## Authors
|
|
70
70
|
|
|
71
|
-
* **Gisaïa** - *Initial work* - [Gisaïa](http://gisaia.
|
|
71
|
+
* **Gisaïa** - *Initial work* - [Gisaïa](http://gisaia.fr/)
|
|
72
72
|
|
|
73
73
|
See also the list of [contributors](https://github.com/gisaia/ARLAS-web-core/graphs/contributors) who participated in this project.
|
|
74
74
|
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { CollaborativesearchService } from './services/collaborativesearch.service';
|
|
2
|
+
export { ConfigService } from './services/config.service';
|
|
3
|
+
export { projType, TiledSearch, GeohashAggregation, GeoTileAggregation } from './models/projections';
|
|
4
|
+
export { Contributor } from './models/contributor';
|
|
5
|
+
export { Collaboration, OperationEnum, CollaborationEvent } from './models/collaboration';
|
|
6
|
+
export { fromEntries, CollectionCount, CollectionAggField } from './utils/utils';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { GeoTileAggregation } from './models/projections';
|
|
2
1
|
/*
|
|
3
2
|
* Licensed to Gisaïa under one or more contributor
|
|
4
3
|
* license agreements. See the NOTICE.txt file distributed with
|
|
@@ -17,12 +16,10 @@ import { GeoTileAggregation } from './models/projections';
|
|
|
17
16
|
* specific language governing permissions and limitations
|
|
18
17
|
* under the License.
|
|
19
18
|
*/
|
|
20
|
-
|
|
21
19
|
export { CollaborativesearchService } from './services/collaborativesearch.service';
|
|
22
20
|
export { ConfigService } from './services/config.service';
|
|
23
|
-
export { projType
|
|
21
|
+
export { projType } from './models/projections';
|
|
24
22
|
export { Contributor } from './models/contributor';
|
|
25
|
-
export {
|
|
26
|
-
export { fromEntries
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
export { OperationEnum } from './models/collaboration';
|
|
24
|
+
export { fromEntries } from './utils/utils';
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAuD,MAAM,sBAAsB,CAAC;AACrG,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAiB,aAAa,EAAsB,MAAM,wBAAwB,CAAC;AAC1F,OAAO,EAAE,WAAW,EAAuC,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Filter } from 'arlas-api';
|
|
2
|
+
/**
|
|
3
|
+
* - A filter object from ARLAS API.
|
|
4
|
+
* - A boolean to know if the filter of the collaboration is enabled.
|
|
5
|
+
*/
|
|
6
|
+
export interface Collaboration {
|
|
7
|
+
filters: Map<string, Filter[]>;
|
|
8
|
+
enabled: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface FilterOnCollection extends Filter {
|
|
11
|
+
collection: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* - An id of a contributor.
|
|
15
|
+
* - An operation add/remove.
|
|
16
|
+
* - If the operation is for all the contributors
|
|
17
|
+
*/
|
|
18
|
+
export interface CollaborationEvent {
|
|
19
|
+
id: string;
|
|
20
|
+
operation: OperationEnum;
|
|
21
|
+
all: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* - Enum of operation.
|
|
25
|
+
*/
|
|
26
|
+
export declare enum OperationEnum {
|
|
27
|
+
add = 0,
|
|
28
|
+
remove = 1
|
|
29
|
+
}
|
|
@@ -16,36 +16,12 @@
|
|
|
16
16
|
* specific language governing permissions and limitations
|
|
17
17
|
* under the License.
|
|
18
18
|
*/
|
|
19
|
-
|
|
20
|
-
import { Filter } from 'arlas-api';
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* - A filter object from ARLAS API.
|
|
24
|
-
* - A boolean to know if the filter of the collaboration is enabled.
|
|
25
|
-
*/
|
|
26
|
-
export interface Collaboration {
|
|
27
|
-
filters: Map<string, Filter[]>;
|
|
28
|
-
enabled: boolean;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface FilterOnCollection extends Filter {
|
|
32
|
-
collection: string;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* - An id of a contributor.
|
|
37
|
-
* - An operation add/remove.
|
|
38
|
-
* - If the operation is for all the contributors
|
|
39
|
-
*/
|
|
40
|
-
export interface CollaborationEvent {
|
|
41
|
-
id: string;
|
|
42
|
-
operation: OperationEnum;
|
|
43
|
-
all: boolean;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
19
|
/**
|
|
47
20
|
* - Enum of operation.
|
|
48
21
|
*/
|
|
49
|
-
export
|
|
50
|
-
|
|
51
|
-
|
|
22
|
+
export var OperationEnum;
|
|
23
|
+
(function (OperationEnum) {
|
|
24
|
+
OperationEnum[OperationEnum["add"] = 0] = "add";
|
|
25
|
+
OperationEnum[OperationEnum["remove"] = 1] = "remove";
|
|
26
|
+
})(OperationEnum || (OperationEnum = {}));
|
|
27
|
+
//# sourceMappingURL=collaboration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collaboration.js","sourceRoot":"","sources":["../../src/models/collaboration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AA4BH;;EAEE;AACF,MAAM,CAAN,IAAY,aAEX;AAFD,WAAY,aAAa;IACvB,+CAAG,CAAA;IAAE,qDAAM,CAAA;AACb,CAAC,EAFW,aAAa,KAAb,aAAa,QAExB"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ConfigService } from '../services/config.service';
|
|
2
|
+
import { CollaborativesearchService } from '../services/collaborativesearch.service';
|
|
3
|
+
import { CollaborationEvent, Collaboration } from './collaboration';
|
|
4
|
+
import { Observable, Subject } from 'rxjs';
|
|
5
|
+
import { CollectionAggField } from '../utils/utils';
|
|
6
|
+
export declare abstract class Contributor {
|
|
7
|
+
identifier: string;
|
|
8
|
+
configService: ConfigService;
|
|
9
|
+
collaborativeSearcheService: CollaborativesearchService;
|
|
10
|
+
private name;
|
|
11
|
+
private fetchedData;
|
|
12
|
+
private _updateData;
|
|
13
|
+
isDataUpdating: boolean;
|
|
14
|
+
collection: string;
|
|
15
|
+
collections: CollectionAggField[];
|
|
16
|
+
endCollaborationEvent: Subject<unknown>;
|
|
17
|
+
protected cacheDuration: number;
|
|
18
|
+
/**
|
|
19
|
+
* @param identifier string identifier of the contributor.
|
|
20
|
+
* @param configService configService of the contributor.
|
|
21
|
+
*/
|
|
22
|
+
constructor(identifier: string, configService: ConfigService, collaborativeSearcheService: CollaborativesearchService, collection?: string);
|
|
23
|
+
/**
|
|
24
|
+
* @returns package name of contributor used in configuration.
|
|
25
|
+
*/
|
|
26
|
+
abstract getPackageName(): string;
|
|
27
|
+
/**
|
|
28
|
+
* @param key a `key` defined in configuration.
|
|
29
|
+
* @returns value of the `key` in configuration.
|
|
30
|
+
*/
|
|
31
|
+
getConfigValue(key: string): any;
|
|
32
|
+
/**
|
|
33
|
+
* @returns name of contributor set in configuration.
|
|
34
|
+
*/
|
|
35
|
+
getName(): string;
|
|
36
|
+
/**
|
|
37
|
+
* @returns set the name of the contributor
|
|
38
|
+
*/
|
|
39
|
+
setName(name: string): void;
|
|
40
|
+
/**
|
|
41
|
+
* @returns whether the data of contributor should be updated.
|
|
42
|
+
*/
|
|
43
|
+
get updateData(): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* @param value set if the data of contributor should be updated or not.
|
|
46
|
+
*/
|
|
47
|
+
set updateData(value: boolean);
|
|
48
|
+
/**
|
|
49
|
+
* @returns name and live informations about filter contributor.
|
|
50
|
+
*/
|
|
51
|
+
abstract getFilterDisplayName(): string;
|
|
52
|
+
abstract fetchData(collaborationEvent: CollaborationEvent): Observable<any>;
|
|
53
|
+
abstract computeData(data: any): any;
|
|
54
|
+
abstract setData(data: any): any;
|
|
55
|
+
abstract setSelection(data: any, c: Collaboration): any;
|
|
56
|
+
updateFromCollaboration(collaborationEvent: CollaborationEvent): void;
|
|
57
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Licensed to Gisaïa under one or more contributor
|
|
3
|
+
* license agreements. See the NOTICE.txt file distributed with
|
|
4
|
+
* this work for additional information regarding copyright
|
|
5
|
+
* ownership. Gisaïa licenses this file to you under
|
|
6
|
+
* the Apache License, Version 2.0 (the "License"); you may
|
|
7
|
+
* not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing,
|
|
13
|
+
* software distributed under the License is distributed on an
|
|
14
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
* KIND, either express or implied. See the License for the
|
|
16
|
+
* specific language governing permissions and limitations
|
|
17
|
+
* under the License.
|
|
18
|
+
*/
|
|
19
|
+
import { Subject } from 'rxjs';
|
|
20
|
+
import { map, finalize, debounceTime } from 'rxjs/operators';
|
|
21
|
+
import { hasAtLeastOneCommon as hasAtLeastOneCommon } from '../utils/utils';
|
|
22
|
+
export class Contributor {
|
|
23
|
+
/**
|
|
24
|
+
* @param identifier string identifier of the contributor.
|
|
25
|
+
* @param configService configService of the contributor.
|
|
26
|
+
*/
|
|
27
|
+
constructor(identifier, configService, collaborativeSearcheService, collection) {
|
|
28
|
+
this.identifier = identifier;
|
|
29
|
+
this.configService = configService;
|
|
30
|
+
this.collaborativeSearcheService = collaborativeSearcheService;
|
|
31
|
+
this._updateData = true;
|
|
32
|
+
this.isDataUpdating = false;
|
|
33
|
+
this.endCollaborationEvent = new Subject();
|
|
34
|
+
if (!!collection) {
|
|
35
|
+
this.collection = collection;
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
this.collection = this.collaborativeSearcheService.defaultCollection;
|
|
39
|
+
}
|
|
40
|
+
const configDebounceTime = this.configService.getValue('arlas.server.debounceCollaborationTime');
|
|
41
|
+
const debounceDuration = configDebounceTime !== undefined ? configDebounceTime : 750;
|
|
42
|
+
const configName = this.getConfigValue('name');
|
|
43
|
+
const configCacheDuration = this.getConfigValue('cache_duration');
|
|
44
|
+
this.cacheDuration = configCacheDuration ? configCacheDuration : this.collaborativeSearcheService.max_age;
|
|
45
|
+
this.name = configName ? configName : this.identifier;
|
|
46
|
+
// Register the contributor in collaborativeSearcheService registry
|
|
47
|
+
this.collaborativeSearcheService.register(this.identifier, this);
|
|
48
|
+
// Subscribe a bus to update data and selection
|
|
49
|
+
this.collaborativeSearcheService.collaborationBus.pipe(debounceTime(debounceDuration))
|
|
50
|
+
.subscribe({
|
|
51
|
+
next: (collaborationEvent) => {
|
|
52
|
+
// Update only contributor of same collection that the current collaboration or on the init whit the url
|
|
53
|
+
let collaborationCollections;
|
|
54
|
+
if (!!this.collaborativeSearcheService.registry.get(collaborationEvent.id)) {
|
|
55
|
+
collaborationCollections = this.collaborativeSearcheService.registry.get(collaborationEvent.id).collections;
|
|
56
|
+
}
|
|
57
|
+
const cs1 = !!this.collections ? this.collections.map(c => c.collectionName) : [];
|
|
58
|
+
const cs2 = !!collaborationCollections ? collaborationCollections.map(c => c.collectionName) : [];
|
|
59
|
+
const update = collaborationEvent.id === 'url' || collaborationEvent.id === 'all' || hasAtLeastOneCommon(cs1, cs2);
|
|
60
|
+
if (this._updateData && update) {
|
|
61
|
+
this.updateFromCollaboration(collaborationEvent);
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
error: (error) => this.collaborativeSearcheService.collaborationErrorBus.next(error)
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* @param key a `key` defined in configuration.
|
|
69
|
+
* @returns value of the `key` in configuration.
|
|
70
|
+
*/
|
|
71
|
+
getConfigValue(key) {
|
|
72
|
+
let configValue = null;
|
|
73
|
+
const contributor = this.configService.getValue('arlas.web.contributors').find(contrib => contrib.identifier === this.identifier);
|
|
74
|
+
if (contributor) {
|
|
75
|
+
configValue = contributor[key];
|
|
76
|
+
}
|
|
77
|
+
return configValue;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* @returns name of contributor set in configuration.
|
|
81
|
+
*/
|
|
82
|
+
getName() {
|
|
83
|
+
return this.name;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* @returns set the name of the contributor
|
|
87
|
+
*/
|
|
88
|
+
setName(name) {
|
|
89
|
+
this.name = name;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* @returns whether the data of contributor should be updated.
|
|
93
|
+
*/
|
|
94
|
+
get updateData() {
|
|
95
|
+
return this._updateData;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* @param value set if the data of contributor should be updated or not.
|
|
99
|
+
*/
|
|
100
|
+
set updateData(value) {
|
|
101
|
+
this._updateData = value;
|
|
102
|
+
}
|
|
103
|
+
updateFromCollaboration(collaborationEvent) {
|
|
104
|
+
this.collaborativeSearcheService.ongoingSubscribe.next(1);
|
|
105
|
+
this.isDataUpdating = true;
|
|
106
|
+
this.fetchData(collaborationEvent)
|
|
107
|
+
.pipe(map(f => this.computeData(f)), map(f => {
|
|
108
|
+
this.fetchedData = f;
|
|
109
|
+
this.setData(f);
|
|
110
|
+
}), finalize(() => {
|
|
111
|
+
this.setSelection(this.fetchedData, this.collaborativeSearcheService.getCollaboration(this.identifier));
|
|
112
|
+
this.collaborativeSearcheService.contribFilterBus
|
|
113
|
+
.next(this.collaborativeSearcheService.registry.get(this.identifier));
|
|
114
|
+
this.collaborativeSearcheService.ongoingSubscribe.
|
|
115
|
+
next(-1);
|
|
116
|
+
this.isDataUpdating = false;
|
|
117
|
+
this.endCollaborationEvent.next({});
|
|
118
|
+
}))
|
|
119
|
+
.subscribe({
|
|
120
|
+
next: (data) => data,
|
|
121
|
+
error: (error) => this.collaborativeSearcheService.collaborationErrorBus.next(error)
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=contributor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contributor.js","sourceRoot":"","sources":["../../src/models/contributor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAKH,OAAO,EAAc,OAAO,EAAE,MAAM,MAAM,CAAC;AAC3C,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAsB,mBAAmB,IAAI,mBA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,CAAC,gBAAgB;iBAC5C,IAAI,CAAC,IAAI,CAAC,2BAA2B,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;YAC1E,IAAI,CAAC,2BAA2B,CAAC,gBAAgB;gBAC7C,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;YACb,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;YAC5B,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACxC,CAAC,CAAC,CACL;aACA,SAAS,CAAC;YACP,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI;YACpB,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,2BAA2B,CAAC,qBAAqB,CAAC,IAAI,CAAC,KAAK,CAAC;SACvF,CAAC,CAAC;IAEX,CAAC;CACJ"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Search, Aggregation } from 'arlas-api';
|
|
2
|
+
/**
|
|
3
|
+
* Enum ARLAS SERVER type of request.
|
|
4
|
+
*/
|
|
5
|
+
export declare enum projType {
|
|
6
|
+
aggregate = 0,
|
|
7
|
+
geoaggregate = 1,
|
|
8
|
+
geohashgeoaggregate = 2,
|
|
9
|
+
geotilegeoaggregate = 3,
|
|
10
|
+
count = 4,
|
|
11
|
+
search = 5,
|
|
12
|
+
geosearch = 6,
|
|
13
|
+
tiledgeosearch = 7,
|
|
14
|
+
/** range is deprecated and will be removed in v13.0.0 */
|
|
15
|
+
range = 8,
|
|
16
|
+
compute = 9,
|
|
17
|
+
shapesearch = 10,
|
|
18
|
+
shapeaggregate = 11
|
|
19
|
+
}
|
|
20
|
+
export interface TiledSearch {
|
|
21
|
+
search: Search;
|
|
22
|
+
x: number;
|
|
23
|
+
y: number;
|
|
24
|
+
z: number;
|
|
25
|
+
}
|
|
26
|
+
export interface GeohashAggregation {
|
|
27
|
+
geohash: string;
|
|
28
|
+
aggregations: Array<Aggregation>;
|
|
29
|
+
}
|
|
30
|
+
export interface GeoTileAggregation {
|
|
31
|
+
x: number;
|
|
32
|
+
y: number;
|
|
33
|
+
z: number;
|
|
34
|
+
aggregations: Array<Aggregation>;
|
|
35
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Licensed to Gisaïa under one or more contributor
|
|
3
|
+
* license agreements. See the NOTICE.txt file distributed with
|
|
4
|
+
* this work for additional information regarding copyright
|
|
5
|
+
* ownership. Gisaïa licenses this file to you under
|
|
6
|
+
* the Apache License, Version 2.0 (the "License"); you may
|
|
7
|
+
* not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing,
|
|
13
|
+
* software distributed under the License is distributed on an
|
|
14
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
* KIND, either express or implied. See the License for the
|
|
16
|
+
* specific language governing permissions and limitations
|
|
17
|
+
* under the License.
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* Enum ARLAS SERVER type of request.
|
|
21
|
+
*/
|
|
22
|
+
export var projType;
|
|
23
|
+
(function (projType) {
|
|
24
|
+
projType[projType["aggregate"] = 0] = "aggregate";
|
|
25
|
+
projType[projType["geoaggregate"] = 1] = "geoaggregate";
|
|
26
|
+
projType[projType["geohashgeoaggregate"] = 2] = "geohashgeoaggregate";
|
|
27
|
+
projType[projType["geotilegeoaggregate"] = 3] = "geotilegeoaggregate";
|
|
28
|
+
projType[projType["count"] = 4] = "count";
|
|
29
|
+
projType[projType["search"] = 5] = "search";
|
|
30
|
+
projType[projType["geosearch"] = 6] = "geosearch";
|
|
31
|
+
projType[projType["tiledgeosearch"] = 7] = "tiledgeosearch";
|
|
32
|
+
/** range is deprecated and will be removed in v13.0.0 */
|
|
33
|
+
projType[projType["range"] = 8] = "range";
|
|
34
|
+
projType[projType["compute"] = 9] = "compute";
|
|
35
|
+
projType[projType["shapesearch"] = 10] = "shapesearch";
|
|
36
|
+
projType[projType["shapeaggregate"] = 11] = "shapeaggregate";
|
|
37
|
+
})(projType || (projType = {}));
|
|
38
|
+
//# sourceMappingURL=projections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projections.js","sourceRoot":"","sources":["../../src/models/projections.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAIH;;EAEE;AACF,MAAM,CAAN,IAAY,QAcX;AAdD,WAAY,QAAQ;IAClB,iDAAS,CAAA;IACT,uDAAY,CAAA;IACZ,qEAAmB,CAAA;IACnB,qEAAmB,CAAA;IACnB,yCAAK,CAAA;IACL,2CAAM,CAAA;IACN,iDAAS,CAAA;IACT,2DAAc,CAAA;IACd,yDAAyD;IACzD,yCAAK,CAAA;IACL,6CAAO,CAAA;IACP,sDAAW,CAAA;IACX,4DAAc,CAAA;AAChB,CAAC,EAdW,QAAQ,KAAR,QAAQ,QAcnB"}
|
package/package.json
CHANGED
|
@@ -1,23 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "arlas-web-core",
|
|
3
|
-
"version": "24.0.0
|
|
3
|
+
"version": "24.0.0",
|
|
4
4
|
"description": "Core Service Library for ARLAS Web App",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"build-release": "tsc -p tsconfig-build.json && cp -r patches dist/",
|
|
7
|
-
"clean": "npm cache clear && rimraf -- dist",
|
|
8
|
-
"test": "echo \"Error: no test specified\" && exit 1",
|
|
9
|
-
"lint": "eslint . --ext .ts",
|
|
10
|
-
"postinstall": "patch-package"
|
|
11
|
-
},
|
|
12
5
|
"repository": {
|
|
13
6
|
"type": "git",
|
|
14
7
|
"url": "https://github.com/gisaia/ARLAS-web-core.git"
|
|
15
8
|
},
|
|
16
|
-
"author": "gisaia",
|
|
9
|
+
"author": "gisaia-team",
|
|
17
10
|
"license": "Apache-2.0",
|
|
18
11
|
"dependencies": {
|
|
19
|
-
"arlas-api": "
|
|
20
|
-
"patch-package": "^6.4.7",
|
|
12
|
+
"arlas-api": "24.0.0",
|
|
21
13
|
"rxjs": "~7.4.0"
|
|
22
14
|
},
|
|
23
15
|
"overrides": {
|
|
@@ -27,14 +19,6 @@
|
|
|
27
19
|
}
|
|
28
20
|
}
|
|
29
21
|
},
|
|
30
|
-
"devDependencies": {
|
|
31
|
-
"@types/node": "16.11.20",
|
|
32
|
-
"@typescript-eslint/eslint-plugin": "^5.27.1",
|
|
33
|
-
"@typescript-eslint/parser": "^5.27.1",
|
|
34
|
-
"eslint": "^8.17.0",
|
|
35
|
-
"rimraf": "^2.6.2",
|
|
36
|
-
"typescript": "~4.6.0"
|
|
37
|
-
},
|
|
38
22
|
"bugs": {
|
|
39
23
|
"url": "https://github.com/gisaia/ARLAS-web-core/issues"
|
|
40
24
|
},
|