@mapcreator/api 5.0.0-alpha.72 → 5.0.0-alpha.73

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/LICENSE CHANGED
@@ -1,29 +1,29 @@
1
- BSD 3-Clause License
2
-
3
- Copyright (c) 2024, Mapcreator
4
- All rights reserved.
5
-
6
- Redistribution and use in source and binary forms, with or without
7
- modification, are permitted provided that the following conditions are met:
8
-
9
- * Redistributions of source code must retain the above copyright notice, this
10
- list of conditions and the following disclaimer.
11
-
12
- * Redistributions in binary form must reproduce the above copyright notice,
13
- this list of conditions and the following disclaimer in the documentation
14
- and/or other materials provided with the distribution.
15
-
16
- * Neither the name of the copyright holder nor the names of its
17
- contributors may be used to endorse or promote products derived from
18
- this software without specific prior written permission.
19
-
20
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2024, Mapcreator
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ * Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ * Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ * Neither the name of the copyright holder nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/README.md CHANGED
@@ -1,86 +1,86 @@
1
- # Mapcreator Javascript API
2
-
3
- The Mapcreator API is a powerful mapping service built for our front-end applications. This library is released to
4
- provide a painless way of talking to the api using Javascript. See the LICENSE file for licensing information. Api
5
- tokens can be granted through support requests.
6
-
7
- ## Table of contents
8
-
9
- * [Installation](#installation)
10
- * [Quick start](#quick-start)
11
- * [Common usage](#common-usage)
12
- * [Publishing](#publishing)
13
-
14
- ### Installation
15
-
16
- ```bash
17
- npm install @mapcreator/api --save
18
- ```
19
-
20
- ### Quick start
21
-
22
- ```javascript
23
- import { authenticate, initImplicitFlow } from '@mapcreator/api/oauth';
24
-
25
- /**
26
- * You need to initialize the authentication module.
27
- * This is an important step that should be completed as soon as possible after general application init.
28
- *
29
- * @param {string} apiUrl - Full API URL, like 'https://api.mapcreator.io'
30
- * @param {string} clientId - OAuth client id, issued for particular application
31
- * @param {string} [redirectUrl] - Callback URL, typically your application URL
32
- * @param {string[]} [scopes] - A list of required scopes, like ['mapcreator']
33
- */
34
- initImplicitFlow(
35
- import.meta.env.VITE_API_HOST,
36
- import.meta.env.VITE_API_CLIENT_ID,
37
- import.meta.env.VITE_API_REDIRECT_URL,
38
- ['mapcreator'],
39
- );
40
-
41
- // ...
42
-
43
- /**
44
- * The subsequent command should lead to two scenarios.
45
- * If the initialization function was able to obtain the token from the local storage or from the address bar,
46
- * then this command is NO-OP. If the token is not found or has expired, then a redirect will be made to the
47
- * authentication page (the application will unload), but when it redirects back again (see the parameter above),
48
- * this method won't do anything and the application will be able to continue its work.
49
- */
50
- authenticate();
51
- ```
52
-
53
- ### Common usage
54
-
55
- The library exports independent methods for accessing the API. The recommended pattern for importing and using methods
56
- looks like this:
57
-
58
- ```typescript
59
- import { updateJob } from '@mapcreator/api/job';
60
-
61
- await updateJob(someJobId, newJobTitle);
62
- ```
63
-
64
- You can also import methods by specifying only the package name, but this results in the use of a common file with
65
- re-exports and can negatively affect the size of the resulting code if you do not need some parts of the API.
66
-
67
- ```typescript
68
- import { type LayerFaq, listLayerFaqs } from '@mapcreator/api';
69
-
70
- const layerFaqs: LayerFaq = await listLayerFaqs();
71
- ```
72
-
73
- TypeScript types are also exposed, and you can use them whenever needed.
74
-
75
- Please consult the contents of the library. All API access files (they are located in `api` sub-folder and each file
76
- generally describes methods for accessing specific entity) describe both the API type and the data type returned
77
- to the application. We sincerely hope this helps you make your app development easier.
78
-
79
- ## Publishing
80
- ```shell
81
- npm version patch # minor | major
82
- npm publish
83
- ```
84
- Until the contents of the package are stabilized, it is suggested to use the scheme with the **alpha** or **beta**
85
- suffixes. And therefore the call to the first command should be replaced by manual modification of the `package.json`
86
- and `package-lock.json` files (will need to change in three places).
1
+ # Mapcreator Javascript API
2
+
3
+ The Mapcreator API is a powerful mapping service built for our front-end applications. This library is released to
4
+ provide a painless way of talking to the api using Javascript. See the LICENSE file for licensing information. Api
5
+ tokens can be granted through support requests.
6
+
7
+ ## Table of contents
8
+
9
+ * [Installation](#installation)
10
+ * [Quick start](#quick-start)
11
+ * [Common usage](#common-usage)
12
+ * [Publishing](#publishing)
13
+
14
+ ### Installation
15
+
16
+ ```bash
17
+ npm install @mapcreator/api --save
18
+ ```
19
+
20
+ ### Quick start
21
+
22
+ ```javascript
23
+ import { authenticate, initImplicitFlow } from '@mapcreator/api/oauth';
24
+
25
+ /**
26
+ * You need to initialize the authentication module.
27
+ * This is an important step that should be completed as soon as possible after general application init.
28
+ *
29
+ * @param {string} apiUrl - Full API URL, like 'https://api.mapcreator.io'
30
+ * @param {string} clientId - OAuth client id, issued for particular application
31
+ * @param {string} [redirectUrl] - Callback URL, typically your application URL
32
+ * @param {string[]} [scopes] - A list of required scopes, like ['mapcreator']
33
+ */
34
+ initImplicitFlow(
35
+ import.meta.env.VITE_API_HOST,
36
+ import.meta.env.VITE_API_CLIENT_ID,
37
+ import.meta.env.VITE_API_REDIRECT_URL,
38
+ ['mapcreator'],
39
+ );
40
+
41
+ // ...
42
+
43
+ /**
44
+ * The subsequent command should lead to two scenarios.
45
+ * If the initialization function was able to obtain the token from the local storage or from the address bar,
46
+ * then this command is NO-OP. If the token is not found or has expired, then a redirect will be made to the
47
+ * authentication page (the application will unload), but when it redirects back again (see the parameter above),
48
+ * this method won't do anything and the application will be able to continue its work.
49
+ */
50
+ authenticate();
51
+ ```
52
+
53
+ ### Common usage
54
+
55
+ The library exports independent methods for accessing the API. The recommended pattern for importing and using methods
56
+ looks like this:
57
+
58
+ ```typescript
59
+ import { updateJob } from '@mapcreator/api/job';
60
+
61
+ await updateJob(someJobId, newJobTitle);
62
+ ```
63
+
64
+ You can also import methods by specifying only the package name, but this results in the use of a common file with
65
+ re-exports and can negatively affect the size of the resulting code if you do not need some parts of the API.
66
+
67
+ ```typescript
68
+ import { type LayerFaq, listLayerFaqs } from '@mapcreator/api';
69
+
70
+ const layerFaqs: LayerFaq = await listLayerFaqs();
71
+ ```
72
+
73
+ TypeScript types are also exposed, and you can use them whenever needed.
74
+
75
+ Please consult the contents of the library. All API access files (they are located in `api` sub-folder and each file
76
+ generally describes methods for accessing specific entity) describe both the API type and the data type returned
77
+ to the application. We sincerely hope this helps you make your app development easier.
78
+
79
+ ## Publishing
80
+ ```shell
81
+ npm version patch # minor | major
82
+ npm publish
83
+ ```
84
+ Until the contents of the package are stabilized, it is suggested to use the scheme with the **alpha** or **beta**
85
+ suffixes. And therefore the call to the first command should be replaced by manual modification of the `package.json`
86
+ and `package-lock.json` files (will need to change in three places).
@@ -1,242 +1,46 @@
1
- import { type ApiCommonData, type ApiError, type ApiSuccess, type Flatten } from '../utils.js';
2
- import type { FeatureCollection, Polygon } from 'geojson';
3
- type FieldName = 'id' | 'name' | 'description' | 'previewJson' | 'previewPath';
4
- export type PartialVectorChoropleth = Pick<VectorChoropleth, FieldName>;
5
- export type VectorChoropleth = {
6
- id: number;
7
- name: string;
8
- description: string;
9
- previewPath: string | null;
10
- previewJson: FeatureCollection | null;
11
- vectorSetUrl: string;
12
- sourceLayerName: string;
13
- lngMin: number;
14
- lngMax: number;
15
- latMin: number;
16
- latMax: number;
17
- keys: string[];
18
- properties: Array<Record<string, unknown>>;
1
+ import type { Polygon } from 'geojson';
2
+ import { RequireAtLeastOne } from 'type-fest';
3
+ export type ApiSearchPoint = {
4
+ lat: number;
5
+ lng: number;
19
6
  };
20
- export type ApiVectorChoropleth = {
21
- data: {
22
- id: number;
23
- name: string;
24
- description: string;
25
- preview_path: string | null;
26
- preview_json: FeatureCollection | null;
27
- vector_set_url: string;
28
- source_layer_name: string;
29
- lng_min: number;
30
- lng_max: number;
31
- lat_min: number;
32
- lat_max: number;
33
- keys: string[];
34
- properties: Array<Record<string, unknown>>;
35
- } & ApiCommonData;
36
- } & Omit<ApiSuccess, 'data'> | ApiError;
37
- export type ApiVectorChoroplethData = Flatten<Exclude<ApiVectorChoropleth, ApiError>['data']>;
38
- export declare function listVectorChoropleths(name: string): Promise<PartialVectorChoropleth[]>;
39
- export declare function getVectorChoropleth(choroplethId: number): Promise<VectorChoropleth>;
40
- export type SearchBounds = {
7
+ export type ApiSearchBounds = {
41
8
  min_lat: number;
42
9
  min_lng: number;
43
10
  max_lat: number;
44
11
  max_lng: number;
45
12
  };
46
- export type PolygonChoropleth = {
47
- sml: string;
48
- id: number;
49
- vectorSource: string;
50
- sourceLayer: string;
51
- featureId: number;
52
- svgPreview: string;
53
- previewPath: string;
54
- allowSingle: boolean;
55
- properties: Record<string, unknown>;
56
- boundingBox: Polygon;
57
- restrictedOwnership: number[] | null;
58
- linkId: number | null;
59
- cloning: boolean;
60
- nativeTranslation: {
61
- polygonId: number;
62
- name: string;
63
- };
64
- englishTranslation?: {
65
- polygonId: number;
66
- name: string;
67
- };
68
- translations?: Array<{
69
- polygonId: number;
70
- language: string;
71
- name: string;
72
- }>;
73
- parentGroups: GroupChoropleth[];
74
- };
75
- export type ApiPolygonChoropleth = {
76
- data: {
77
- sml: string;
78
- id: number;
79
- vector_source: string;
80
- source_layer: string;
81
- feature_id: number;
82
- svg_preview: string;
83
- preview_path: string;
84
- allow_single: boolean;
85
- properties: Record<string, unknown>;
86
- bounding_box: Polygon;
87
- restricted_ownership: number[] | null;
88
- link_id: number | null;
89
- cloning: boolean;
90
- native_translation: {
91
- polygon_id: number;
92
- name: string;
93
- };
94
- english_translation?: {
95
- polygon_id: number;
96
- name: string;
97
- };
98
- translations?: Array<{
99
- polygon_id: number;
100
- language: string;
101
- name: string;
102
- }>;
103
- parent_groups: ApiGroupChoroplethData[];
104
- } & ApiCommonData;
105
- } & Omit<ApiSuccess, 'data'> | ApiError;
106
- export type ApiPolygonChoroplethData = Flatten<Exclude<ApiPolygonChoropleth, ApiError>['data']>;
107
- export declare function listPolygonChoropleths(name: string, languages: string[], searchBounds?: SearchBounds, withParentGroups?: boolean): Promise<PolygonChoropleth[]>;
108
- export type GroupChoropleth = {
13
+ type SingleOrGroupedAreaBase = {
109
14
  id: number;
110
- polygonId: number;
111
- relationId: number;
112
- childrenCount: number;
113
- sml?: string;
15
+ title: string;
16
+ subtitle: string;
114
17
  svgPreview: string;
115
- previewPath: string;
116
- uniqueProperties: string[];
117
18
  boundingBox: Polygon;
118
- partialProperties: string[];
119
- restrictedOwnership: number[] | null;
120
- linkId: number | null;
121
- cloning: boolean;
122
- laravelThroughKey?: number;
123
- nativeParentTranslation: {
124
- polygonId: number;
125
- name: string;
126
- laravelThroughKey: number;
127
- };
128
- nativeRelationTranslation: {
129
- relationId: number;
130
- name: string;
131
- laravelThroughKey: number;
132
- };
133
- englishParentTranslation?: {
134
- polygonId: number;
135
- name: string;
136
- laravelThroughKey: number;
137
- };
138
- englishRelationTranslation?: {
139
- relationId: number;
140
- name: string;
141
- laravelThroughKey: number;
142
- };
143
- parentTranslations?: Array<{
144
- polygonId: number;
145
- name: string;
146
- language: string;
147
- laravelThroughKey: number;
148
- }>;
149
- relationTranslations?: Array<{
150
- relationId: number;
151
- name: string;
152
- language: string;
153
- laravelThroughKey: number;
154
- }>;
155
19
  };
156
- export type ApiGroupChoropleth = {
157
- data: {
158
- id: number;
159
- polygon_id: number;
160
- relation_id: number;
161
- children_count: number;
162
- sml?: number;
163
- svg_preview: string;
164
- preview_path: string;
165
- unique_properties: string[];
166
- bounding_box: Polygon;
167
- partial_properties: string[];
168
- restricted_ownership: number[] | null;
169
- link_id: number | null;
170
- cloning: boolean;
171
- laravel_through_key?: number;
172
- native_parent_translation: {
173
- polygon_id: number;
174
- name: string;
175
- laravel_through_key: number;
176
- };
177
- native_relation_translation: {
178
- relation_id: number;
179
- name: string;
180
- laravel_through_key: number;
181
- };
182
- english_parent_translation?: {
183
- polygon_id: number;
184
- name: string;
185
- laravel_through_key: number;
186
- };
187
- english_relation_translation?: {
188
- relation_id: number;
189
- name: string;
190
- laravel_through_key: number;
191
- };
192
- parent_translations?: Array<{
193
- polygon_id: number;
194
- name: string;
195
- language: string;
196
- laravel_through_key: number;
197
- }>;
198
- relation_translations?: Array<{
199
- relation_id: number;
200
- name: string;
201
- language: string;
202
- laravel_through_key: number;
203
- }>;
204
- } & ApiCommonData;
205
- } & Omit<ApiSuccess, 'data'> | ApiError;
206
- export type ApiGroupChoroplethData = Flatten<Exclude<ApiGroupChoropleth, ApiError>['data']>;
207
- export declare function listGroupChoropleths(name: string, languages: string[], searchBounds?: SearchBounds): Promise<GroupChoropleth[]>;
208
- export declare function listChildrenGroupChoropleths(groupId: number, languages: string[]): Promise<PolygonChoropleth[]>;
209
- export type MatchedGroup = {
210
- id: number;
211
- sml: number;
212
- childrenCount: number;
213
- matchField: string;
214
- property: string;
215
- name: string;
20
+ export type GroupedArea = SingleOrGroupedAreaBase & {
21
+ isGroup: true;
216
22
  };
217
- export type ApiMatchedGroup = {
218
- id: number;
219
- sml: number;
220
- children_count: number;
221
- match_field: string;
222
- property: string;
223
- name: string;
224
- };
225
- export declare function getGroupsByDataSample(sample: Record<string, string[]>, language: string): Promise<MatchedGroup[]>;
226
- export type BoundPolygon = {
227
- index: number;
228
- id: number;
229
- sml: number;
230
- name: string;
231
- inputName: string;
232
- };
233
- export type ApiBoundPolygon = {
234
- index: number;
23
+ export type SingleArea = SingleOrGroupedAreaBase & {
24
+ isGroup: false;
25
+ vectorSource: string;
26
+ sourceLayer: string;
27
+ featureId: number;
28
+ properties: Record<string, string>;
29
+ };
30
+ export type SingleOrGroupedArea = SingleArea | GroupedArea;
31
+ export declare function searchSingleOrGroupedAreas(language: string, search: RequireAtLeastOne<{
32
+ searchBounds?: ApiSearchBounds;
33
+ query?: string;
34
+ searchPoint?: ApiSearchPoint;
35
+ }>, mode?: 'polygon' | 'group' | 'both'): Promise<SingleOrGroupedArea[]>;
36
+ export type GroupedAreaChild = {
235
37
  id: number;
236
- sml: number;
237
- name: string;
238
- input_name: string;
38
+ title: string;
39
+ vectorSource: string;
40
+ sourceLayer: string;
41
+ featureId: number;
42
+ properties: Record<string, string>;
239
43
  };
240
- export declare function getBoundPolygons(groupId: number, property: string, data: string[], language: string): Promise<BoundPolygon[]>;
44
+ export declare function groupedAreaChildren(groupId: number, language: string): Promise<GroupedAreaChild[]>;
241
45
  export {};
242
46
  //# sourceMappingURL=choropleth.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"choropleth.d.ts","sourceRoot":"","sources":["../../src/api/choropleth.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,OAAO,EAMb,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAG1D,KAAK,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,aAAa,GAAG,aAAa,GAAG,aAAa,CAAC;AAoB/E,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC;AAExE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAEtC,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IAExB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IA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M,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG,WAAW,CAAC;AAE3D,wBAAsB,0BAA0B,CAC9C,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,iBAAiB,CAAC;IACxB,YAAY,CAAC,EAAE,eAAe,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,cAAc,CAAC;CAC9B,CAAC,EACF,IAAI,GAAE,SAAS,GAAG,OAAO,GAAG,MAAe,GAC1C,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAwBhC;AAeD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACpC,CAAC;AAEF,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAYxG"}
@@ -1,79 +1,28 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.listVectorChoropleths = listVectorChoropleths;
4
- exports.getVectorChoropleth = getVectorChoropleth;
5
- exports.listPolygonChoropleths = listPolygonChoropleths;
6
- exports.listGroupChoropleths = listGroupChoropleths;
7
- exports.listChildrenGroupChoropleths = listChildrenGroupChoropleths;
8
- exports.getGroupsByDataSample = getGroupsByDataSample;
9
- exports.getBoundPolygons = getBoundPolygons;
3
+ exports.searchSingleOrGroupedAreas = searchSingleOrGroupedAreas;
4
+ exports.groupedAreaChildren = groupedAreaChildren;
10
5
  const utils_js_1 = require("../utils.js");
11
- const processGroupData = (group) => (Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, group), group.nativeParentTranslation && { nativeParentTranslation: (0, utils_js_1.toAppType)(group.nativeParentTranslation) }), group.nativeRelationTranslation && { nativeRelationTranslation: (0, utils_js_1.toAppType)(group.nativeRelationTranslation) }), group.englishParentTranslation && { englishParentTranslation: (0, utils_js_1.toAppType)(group.englishParentTranslation) }), group.englishRelationTranslation && { englishRelationTranslation: (0, utils_js_1.toAppType)(group.englishRelationTranslation) }), group.parentTranslations && { parentTranslations: (0, utils_js_1.ensureArray)(group.parentTranslations).map(utils_js_1.toAppType) }), group.relationTranslations && { relationTranslations: (0, utils_js_1.ensureArray)(group.relationTranslations).map(utils_js_1.toAppType) }));
12
- const processPolygonData = (polygon) => (Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, polygon), polygon.parentGroups && { parentGroups: (0, utils_js_1.ensureArray)(polygon.parentGroups).map(utils_js_1.toAppType).map(processGroupData) }), polygon.nativeTranslation && { nativeTranslation: (0, utils_js_1.toAppType)(polygon.nativeTranslation) }), polygon.englishTranslation && { englishTranslation: (0, utils_js_1.toAppType)(polygon.englishTranslation) }), polygon.translations && { translations: (0, utils_js_1.ensureArray)(polygon.translations).map(utils_js_1.toAppType) }));
13
- async function listVectorChoropleths(name) {
14
- const pathname = `/v1/choropleths/vector`;
15
- const query = (0, utils_js_1.getSearchParams)({ search: { name } });
16
- const path = `${pathname}?${query}`;
17
- // Only request first 50 results
18
- const headers = Object.assign({}, utils_js_1.defaultListHeader);
19
- const options = { withMeta: true };
20
- return (0, utils_js_1.request)(path, null, headers, options)
21
- .catch((error) => {
22
- if (error instanceof utils_js_1.APIMeta) {
23
- return error.data;
24
- }
25
- throw error;
6
+ async function searchSingleOrGroupedAreas(language, search, mode = 'both') {
7
+ /**
8
+ * TODO When SAGA search on click is implemented, remove mode and make searchBounds required
9
+ */
10
+ return (0, utils_js_1.request)(`/v1/choropleth/polygons/search?${(0, utils_js_1.getSearchParams)(Object.assign(Object.assign(Object.assign(Object.assign({ language }, search.searchBounds), (search.query && { query: search.query })), (search.searchPoint && { point: search.searchPoint })), { mode }))}`).then(result => {
11
+ result.forEach(elem => {
12
+ elem.boundingBox = JSON.parse(elem.boundingBox);
13
+ if (!elem.isGroup) {
14
+ elem.properties = JSON.parse(elem.properties);
15
+ }
16
+ });
17
+ return result;
26
18
  });
27
19
  }
28
- async function getVectorChoropleth(choroplethId) {
29
- const path = `/v1/choropleths/vector/${choroplethId}`;
30
- return (0, utils_js_1.request)(path);
31
- }
32
- async function listPolygonChoropleths(name, languages, searchBounds, withParentGroups = false) {
33
- const pathname = `/v1/choropleth/polygons`;
34
- const query = (0, utils_js_1.getSearchParams)(Object.assign({ search: { name, allow_single: true }, with_parent_groups: withParentGroups, languages }, searchBounds));
35
- const path = `${pathname}?${query}`;
36
- // Only request first 50 results
37
- const headers = Object.assign({}, utils_js_1.defaultListHeader);
38
- const options = { withMeta: true };
39
- return (0, utils_js_1.request)(path, null, headers, options)
40
- .catch((error) => {
41
- if (error instanceof utils_js_1.APIMeta) {
42
- return error.data;
43
- }
44
- throw error;
45
- })
46
- .then(result => result.map(processPolygonData));
47
- }
48
- async function listGroupChoropleths(name, languages, searchBounds) {
49
- const pathname = `/v1/choropleth/groups`;
50
- const query = (0, utils_js_1.getSearchParams)(Object.assign({ search: { name }, languages }, searchBounds));
51
- const path = `${pathname}?${query}`;
52
- // Only request first 50 results
53
- const headers = Object.assign({}, utils_js_1.defaultListHeader);
54
- const options = { withMeta: true };
55
- return (0, utils_js_1.request)(path, null, headers, options)
56
- .catch((error) => {
57
- if (error instanceof utils_js_1.APIMeta) {
58
- return error.data;
59
- }
60
- throw error;
61
- })
62
- .then(result => result.map(processGroupData));
63
- }
64
- async function listChildrenGroupChoropleths(groupId, languages) {
65
- const pathname = `/v1/choropleth/groups/${groupId}/children`;
66
- const query = (0, utils_js_1.getSearchParams)({ languages });
67
- const path = `${pathname}?${query}`;
68
- return (0, utils_js_1.request)(path).then(polygons => polygons.map(processPolygonData));
69
- }
70
- async function getGroupsByDataSample(sample, language) {
71
- const path = `/v1/choropleth/groups/sample`;
72
- return (0, utils_js_1.request)(path, { sample, language });
73
- }
74
- async function getBoundPolygons(groupId, property, data, language) {
75
- const path = `/v1/choropleth/groups/bind`;
76
- const postBody = { group_id: groupId, property, data, language };
77
- return (0, utils_js_1.request)(path, postBody);
20
+ async function groupedAreaChildren(groupId, language) {
21
+ return (0, utils_js_1.request)(`/v1/choropleth/groups/${groupId}/children-optimized?${(0, utils_js_1.getSearchParams)({ language })}`).then(result => {
22
+ result.forEach(elem => {
23
+ elem.properties = JSON.parse(elem.properties);
24
+ });
25
+ return result;
26
+ });
78
27
  }
79
28
  //# sourceMappingURL=choropleth.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"choropleth.js","sourceRoot":"","sources":["../../src/api/choropleth.ts"],"names":[],"mappings":";;AA+EA,sDAqBC;AAED,kDAIC;AAyED,wDAkCC;AAwGD,oDA0BC;AAED,oEAaC;AAoBD,sDAWC;AAkBD,4CAcC;AAraD,0CAWqB;AAMrB,MAAM,gBAAgB,GAAG,CAAC,KAAsB,EAAmB,EAAE,CAAC,uGACjE,KAAK,GACL,KAAK,CAAC,uBAAuB,IAAI,EAAE,uBAAuB,EAAE,IAAA,oBAAS,EAAC,KAAK,CAAC,uBAAuB,CAAC,EAAE,GACtG,KAAK,CAAC,yBAAyB,IAAI,EAAE,yBAAyB,EAAE,IAAA,oBAAS,EAAC,KAAK,CAAC,yBAAyB,CAAC,EAAE,GAC5G,KAAK,CAAC,wBAAwB,IAAI,EAAE,wBAAwB,EAAE,IAAA,oBAAS,EAAC,KAAK,CAAC,wBAAwB,CAAC,EAAE,GACzG,KAAK,CAAC,0BAA0B,IAAI,EAAE,0BAA0B,EAAE,IAAA,oBAAS,EAAC,KAAK,CAAC,0BAA0B,CAAC,EAAE,GAC/G,KAAK,CAAC,kBAAkB,IAAI,EAAE,kBAAkB,EAAE,IAAA,s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