@mapcreator/api 0.0.0-saga.4 → 0.0.0-wms.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/cjs/api/choropleth.d.ts +195 -31
- package/cjs/api/choropleth.d.ts.map +1 -1
- package/cjs/api/choropleth.js +61 -21
- package/cjs/api/choropleth.js.map +1 -1
- package/cjs/api/resources.d.ts +1 -1
- package/cjs/api/resources.d.ts.map +1 -1
- package/cjs/api/resources.js.map +1 -1
- package/esm/api/choropleth.d.ts +195 -31
- package/esm/api/choropleth.d.ts.map +1 -1
- package/esm/api/choropleth.js +57 -20
- package/esm/api/choropleth.js.map +1 -1
- package/esm/api/resources.d.ts +1 -1
- package/esm/api/resources.d.ts.map +1 -1
- package/esm/api/resources.js.map +1 -1
- package/package.json +1 -1
- package/src/api/choropleth.ts +331 -98
- package/src/api/resources.ts +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"choropleth.d.ts","sourceRoot":"","sources":["../../src/api/choropleth.ts"],"names":[],"mappings":"
|
|
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,MAA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E,MAAM,CAAC;SAC7B,CAAC,CAAC;QACH,qBAAqB,CAAC,EAAE,KAAK,CAAC;YAC5B,WAAW,EAAE,MAAM,CAAC;YACpB,IAAI,EAAE,MAAM,CAAC;YACb,QAAQ,EAAE,MAAM,CAAC;YACjB,mBAAmB,EAAE,MAAM,CAAC;SAC7B,CAAC,CAAC;KACJ,GAAG,aAAa,CAAC;CACnB,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,GAAG,QAAQ,CAAC;AAExC,MAAM,MAAM,sBAAsB,GAAG,OAAO,CAAC,OAAO,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAE5F,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EAAE,EACnB,YAAY,CAAC,EAAE,YAAY,GAC1B,OAAO,CAAC,eAAe,EAAE,CAAC,CAsB5B;AAED,wBAAsB,4BAA4B,CAChD,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EAAE,GAClB,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAU9B"}
|
package/esm/api/choropleth.js
CHANGED
|
@@ -1,24 +1,61 @@
|
|
|
1
|
-
import { getSearchParams, request } from '../utils.js';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { APIMeta, defaultListHeader, ensureArray, getSearchParams, request, toAppType, } from '../utils.js';
|
|
2
|
+
const processGroupData = (group) => (Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, group), group.nativeParentTranslation && { nativeParentTranslation: toAppType(group.nativeParentTranslation) }), group.nativeRelationTranslation && { nativeRelationTranslation: toAppType(group.nativeRelationTranslation) }), group.englishParentTranslation && { englishParentTranslation: toAppType(group.englishParentTranslation) }), group.englishRelationTranslation && { englishRelationTranslation: toAppType(group.englishRelationTranslation) }), group.parentTranslations && { parentTranslations: ensureArray(group.parentTranslations).map(toAppType) }), group.relationTranslations && { relationTranslations: ensureArray(group.relationTranslations).map(toAppType) }));
|
|
3
|
+
const processPolygonData = (polygon) => (Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, polygon), polygon.parentGroups && { parentGroups: ensureArray(polygon.parentGroups).map(toAppType).map(processGroupData) }), polygon.nativeTranslation && { nativeTranslation: toAppType(polygon.nativeTranslation) }), polygon.englishTranslation && { englishTranslation: toAppType(polygon.englishTranslation) }), polygon.translations && { translations: ensureArray(polygon.translations).map(toAppType) }));
|
|
4
|
+
export async function listVectorChoropleths(name) {
|
|
5
|
+
const pathname = `/v1/choropleths/vector`;
|
|
6
|
+
const query = getSearchParams({ search: { name } });
|
|
7
|
+
const path = `${pathname}?${query}`;
|
|
8
|
+
// Only request first 50 results
|
|
9
|
+
const headers = Object.assign({}, defaultListHeader);
|
|
10
|
+
const options = { withMeta: true };
|
|
11
|
+
return request(path, null, headers, options)
|
|
12
|
+
.catch((error) => {
|
|
13
|
+
if (error instanceof APIMeta) {
|
|
14
|
+
return error.data;
|
|
15
|
+
}
|
|
16
|
+
throw error;
|
|
14
17
|
});
|
|
15
18
|
}
|
|
16
|
-
export async function
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
});
|
|
19
|
+
export async function getVectorChoropleth(choroplethId) {
|
|
20
|
+
const path = `/v1/choropleths/vector/${choroplethId}`;
|
|
21
|
+
return request(path);
|
|
22
|
+
}
|
|
23
|
+
export async function listPolygonChoropleths(name, languages, searchBounds, withParentGroups = false) {
|
|
24
|
+
const pathname = `/v1/choropleth/polygons`;
|
|
25
|
+
const query = getSearchParams(Object.assign({ search: { name, allow_single: true }, with_parent_groups: withParentGroups, languages }, searchBounds));
|
|
26
|
+
const path = `${pathname}?${query}`;
|
|
27
|
+
// Only request first 50 results
|
|
28
|
+
const headers = Object.assign({}, defaultListHeader);
|
|
29
|
+
const options = { withMeta: true };
|
|
30
|
+
return request(path, null, headers, options)
|
|
31
|
+
.catch((error) => {
|
|
32
|
+
if (error instanceof APIMeta) {
|
|
33
|
+
return error.data;
|
|
34
|
+
}
|
|
35
|
+
throw error;
|
|
36
|
+
})
|
|
37
|
+
.then(result => result.map(processPolygonData));
|
|
38
|
+
}
|
|
39
|
+
export async function listGroupChoropleths(name, languages, searchBounds) {
|
|
40
|
+
const pathname = `/v1/choropleth/groups`;
|
|
41
|
+
const query = getSearchParams(Object.assign({ search: { name }, languages }, searchBounds));
|
|
42
|
+
const path = `${pathname}?${query}`;
|
|
43
|
+
// Only request first 50 results
|
|
44
|
+
const headers = Object.assign({}, defaultListHeader);
|
|
45
|
+
const options = { withMeta: true };
|
|
46
|
+
return request(path, null, headers, options)
|
|
47
|
+
.catch((error) => {
|
|
48
|
+
if (error instanceof APIMeta) {
|
|
49
|
+
return error.data;
|
|
50
|
+
}
|
|
51
|
+
throw error;
|
|
52
|
+
})
|
|
53
|
+
.then(result => result.map(processGroupData));
|
|
54
|
+
}
|
|
55
|
+
export async function listChildrenGroupChoropleths(groupId, languages) {
|
|
56
|
+
const pathname = `/v1/choropleth/groups/${groupId}/children`;
|
|
57
|
+
const query = getSearchParams({ languages });
|
|
58
|
+
const path = `${pathname}?${query}`;
|
|
59
|
+
return request(path).then(polygons => polygons.map(processPolygonData));
|
|
23
60
|
}
|
|
24
61
|
//# sourceMappingURL=choropleth.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"choropleth.js","sourceRoot":"","sources":["../../src/api/choropleth.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"choropleth.js","sourceRoot":"","sources":["../../src/api/choropleth.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAKP,iBAAiB,EACjB,WAAW,EACX,eAAe,EACf,OAAO,EACP,SAAS,GACV,MAAM,aAA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AED,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAChD,OAAe,EACf,SAAmB;IAEnB,MAAM,QAAQ,GAAG,yBAAyB,OAAO,WAAW,CAAC;IAC7D,MAAM,KAAK,GAAG,eAAe,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC;IAC7C,MAAM,IAAI,GAAG,GAAG,QAAQ,IAAI,KAAK,EAAE,CAAC;IAMpC,OAAO,OAAO,CAA+C,IAAI,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,CAAC;AACxH,CAAC"}
|
package/esm/api/resources.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { type ApiLayerData, type Layer } from './layer.js';
|
|
|
11
11
|
import { type ApiColorData, type Color } from './color.js';
|
|
12
12
|
import { type ApiUserData, type User } from './user.js';
|
|
13
13
|
import { type ApiCommonData, type ApiError, type ApiSuccess } from '../utils.js';
|
|
14
|
-
export type CustomFeature = 'custom_dpi' | 'disable_company_maps' | 'eps_plus_log' | 'filename_is_job_title' | 'iframe_sandbox_attributes' | 'keep_layer_visibility' | 'no_copyright' | 'only_shared_company_maps' | 'pdf_output' | 'show_frelex_links' | 'svg_output' | 'svg-georef' | 'tiff_output' | 'video_export' | 'v5_video' | 'web_output' | 'web_download' | 'new_single_and_grouped_areas_menu' | 'export_templates' | 'export_video_tracking_data' | 'hosted_svg_output' | 'hosted_png_output' | 'hosted_jpg_output' | 'developer_menu';
|
|
14
|
+
export type CustomFeature = 'custom_dpi' | 'disable_company_maps' | 'eps_plus_log' | 'filename_is_job_title' | 'iframe_sandbox_attributes' | 'keep_layer_visibility' | 'no_copyright' | 'only_shared_company_maps' | 'pdf_output' | 'show_frelex_links' | 'svg_output' | 'svg-georef' | 'tiff_output' | 'video_export' | 'v5_video' | 'web_output' | 'web_download' | 'new_single_and_grouped_areas_menu' | 'export_templates' | 'export_video_tracking_data' | 'hosted_svg_output' | 'hosted_png_output' | 'hosted_jpg_output' | 'developer_menu' | 'external_sources';
|
|
15
15
|
export interface Resources {
|
|
16
16
|
organisation: Organisation;
|
|
17
17
|
user: User;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../../src/api/resources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,YAAY,EAAwB,MAAM,mBAAmB,CAAC;AACtG,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,YAAY,EAAwB,MAAM,mBAAmB,CAAC;AACtG,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,WAAW,EAAuB,MAAM,kBAAkB,CAAC;AAClG,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,SAAS,EAAqB,MAAM,gBAAgB,CAAC;AAC1F,OAAO,EAAE,KAAK,cAAc,EAAiC,MAAM,cAAc,CAAC;AAClF,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,OAAO,EAAmB,MAAM,cAAc,CAAC;AAClF,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,OAAO,EAAmB,MAAM,cAAc,CAAC;AAClF,OAAO,EAAe,KAAK,UAAU,EAAE,KAAK,GAAG,EAAe,MAAM,UAAU,CAAC;AAC/E,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,MAAM,EAAkB,MAAM,aAAa,CAAC;AAC9E,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,KAAK,EAAiB,MAAM,YAAY,CAAC;AAC1E,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,KAAK,EAAiB,MAAM,YAAY,CAAC;AAC1E,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,IAAI,EAAgB,MAAM,WAAW,CAAC;AAEtE,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,KAAK,UAAU,EAMhB,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,aAAa,GACrB,YAAY,GACZ,sBAAsB,GAC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ts
CHANGED
|
@@ -1,126 +1,359 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import {
|
|
2
|
+
APIMeta,
|
|
3
|
+
type ApiCommonData,
|
|
4
|
+
type ApiError,
|
|
5
|
+
type ApiSuccess,
|
|
6
|
+
type Flatten,
|
|
7
|
+
defaultListHeader,
|
|
8
|
+
ensureArray,
|
|
9
|
+
getSearchParams,
|
|
10
|
+
request,
|
|
11
|
+
toAppType,
|
|
12
|
+
} from '../utils.js';
|
|
13
|
+
import type { FeatureCollection, Polygon } from 'geojson';
|
|
14
|
+
import type { SnakeCase } from 'type-fest';
|
|
4
15
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
16
|
+
type FieldName = 'id' | 'name' | 'description' | 'previewJson' | 'previewPath';
|
|
17
|
+
|
|
18
|
+
const processGroupData = (group: GroupChoropleth): GroupChoropleth => ({
|
|
19
|
+
...group,
|
|
20
|
+
...group.nativeParentTranslation && { nativeParentTranslation: toAppType(group.nativeParentTranslation) },
|
|
21
|
+
...group.nativeRelationTranslation && { nativeRelationTranslation: toAppType(group.nativeRelationTranslation) },
|
|
22
|
+
...group.englishParentTranslation && { englishParentTranslation: toAppType(group.englishParentTranslation) },
|
|
23
|
+
...group.englishRelationTranslation && { englishRelationTranslation: toAppType(group.englishRelationTranslation) },
|
|
24
|
+
...group.parentTranslations && { parentTranslations: ensureArray(group.parentTranslations).map(toAppType) },
|
|
25
|
+
...group.relationTranslations && { relationTranslations: ensureArray(group.relationTranslations).map(toAppType) },
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
const processPolygonData = (polygon: PolygonChoropleth): PolygonChoropleth => ({
|
|
29
|
+
...polygon,
|
|
30
|
+
...polygon.parentGroups && { parentGroups: ensureArray(polygon.parentGroups).map(toAppType).map(processGroupData) },
|
|
31
|
+
...polygon.nativeTranslation && { nativeTranslation: toAppType(polygon.nativeTranslation) },
|
|
32
|
+
...polygon.englishTranslation && { englishTranslation: toAppType(polygon.englishTranslation) },
|
|
33
|
+
...polygon.translations && { translations: ensureArray(polygon.translations).map(toAppType) },
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export type PartialVectorChoropleth = Pick<VectorChoropleth, FieldName>;
|
|
37
|
+
|
|
38
|
+
export type VectorChoropleth = {
|
|
39
|
+
id: number;
|
|
40
|
+
name: string;
|
|
41
|
+
description: string;
|
|
42
|
+
previewPath: string | null;
|
|
43
|
+
previewJson: FeatureCollection | null;
|
|
44
|
+
|
|
45
|
+
vectorSetUrl: string;
|
|
46
|
+
sourceLayerName: string;
|
|
47
|
+
|
|
48
|
+
lngMin: number;
|
|
49
|
+
lngMax: number;
|
|
50
|
+
latMin: number;
|
|
51
|
+
latMax: number;
|
|
52
|
+
|
|
53
|
+
keys: string[];
|
|
54
|
+
properties: Array<Record<string, unknown>>;
|
|
8
55
|
};
|
|
9
56
|
|
|
10
|
-
export type
|
|
57
|
+
export type ApiVectorChoropleth = {
|
|
58
|
+
data: {
|
|
59
|
+
id: number;
|
|
60
|
+
name: string;
|
|
61
|
+
description: string;
|
|
62
|
+
preview_path: string | null;
|
|
63
|
+
preview_json: FeatureCollection | null;
|
|
64
|
+
|
|
65
|
+
vector_set_url: string;
|
|
66
|
+
source_layer_name: string;
|
|
67
|
+
|
|
68
|
+
lng_min: number;
|
|
69
|
+
lng_max: number;
|
|
70
|
+
lat_min: number;
|
|
71
|
+
lat_max: number;
|
|
72
|
+
|
|
73
|
+
keys: string[];
|
|
74
|
+
properties: Array<Record<string, unknown>>;
|
|
75
|
+
} & ApiCommonData;
|
|
76
|
+
} & Omit<ApiSuccess, 'data'> | ApiError;
|
|
77
|
+
|
|
78
|
+
export type ApiVectorChoroplethData = Flatten<Exclude<ApiVectorChoropleth, ApiError>['data']>;
|
|
79
|
+
|
|
80
|
+
export async function listVectorChoropleths(name: string): Promise<PartialVectorChoropleth[]> {
|
|
81
|
+
const pathname = `/v1/choropleths/vector`;
|
|
82
|
+
const query = getSearchParams({ search: { name } });
|
|
83
|
+
const path = `${pathname}?${query}`;
|
|
84
|
+
|
|
85
|
+
// Only request first 50 results
|
|
86
|
+
const headers = { ...defaultListHeader };
|
|
87
|
+
const options = { withMeta: true };
|
|
88
|
+
|
|
89
|
+
type ApiVectorChoroplethArray = {
|
|
90
|
+
data: Array<Pick<ApiVectorChoroplethData, SnakeCase<FieldName>>>;
|
|
91
|
+
} & Omit<ApiSuccess, 'data'> | ApiError;
|
|
92
|
+
|
|
93
|
+
return request<ApiVectorChoroplethArray, PartialVectorChoropleth>(path, null, headers, options)
|
|
94
|
+
.catch((error: Error) => {
|
|
95
|
+
if (error instanceof APIMeta) {
|
|
96
|
+
return (error as APIMeta<ApiVectorChoroplethArray, PartialVectorChoropleth>).data;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
throw error;
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export async function getVectorChoropleth(choroplethId: number): Promise<VectorChoropleth> {
|
|
104
|
+
const path = `/v1/choropleths/vector/${choroplethId}`;
|
|
105
|
+
|
|
106
|
+
return request<ApiVectorChoropleth, VectorChoropleth>(path);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export type SearchBounds = {
|
|
11
110
|
min_lat: number;
|
|
12
111
|
min_lng: number;
|
|
13
112
|
max_lat: number;
|
|
14
113
|
max_lng: number;
|
|
15
114
|
};
|
|
16
115
|
|
|
17
|
-
type
|
|
116
|
+
export type PolygonChoropleth = {
|
|
117
|
+
sml: string;
|
|
18
118
|
id: number;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
119
|
+
vectorSource: string;
|
|
120
|
+
sourceLayer: string;
|
|
121
|
+
featureId: number;
|
|
122
|
+
svgPreview: string;
|
|
123
|
+
previewPath: string;
|
|
124
|
+
allowSingle: boolean;
|
|
125
|
+
properties: Record<string, unknown>;
|
|
126
|
+
boundingBox: Polygon;
|
|
127
|
+
restrictedOwnership: number[] | null;
|
|
128
|
+
linkId: number | null;
|
|
129
|
+
cloning: boolean;
|
|
130
|
+
nativeTranslation: {
|
|
131
|
+
polygonId: number;
|
|
132
|
+
name: string;
|
|
133
|
+
};
|
|
134
|
+
englishTranslation?: {
|
|
135
|
+
polygonId: number;
|
|
136
|
+
name: string;
|
|
137
|
+
};
|
|
138
|
+
translations?: Array<{
|
|
139
|
+
polygonId: number;
|
|
140
|
+
language: string;
|
|
141
|
+
name: string;
|
|
142
|
+
}>;
|
|
143
|
+
parentGroups: GroupChoropleth[];
|
|
28
144
|
};
|
|
29
145
|
|
|
30
|
-
type
|
|
31
|
-
data:
|
|
146
|
+
export type ApiPolygonChoropleth = {
|
|
147
|
+
data: {
|
|
148
|
+
sml: string;
|
|
149
|
+
id: number;
|
|
150
|
+
vector_source: string;
|
|
151
|
+
source_layer: string;
|
|
152
|
+
feature_id: number;
|
|
153
|
+
svg_preview: string;
|
|
154
|
+
preview_path: string;
|
|
155
|
+
allow_single: boolean;
|
|
156
|
+
properties: Record<string, unknown>;
|
|
157
|
+
bounding_box: Polygon;
|
|
158
|
+
restricted_ownership: number[] | null;
|
|
159
|
+
link_id: number | null;
|
|
160
|
+
cloning: boolean;
|
|
161
|
+
native_translation: {
|
|
162
|
+
polygon_id: number;
|
|
163
|
+
name: string;
|
|
164
|
+
};
|
|
165
|
+
english_translation?: {
|
|
166
|
+
polygon_id: number;
|
|
167
|
+
name: string;
|
|
168
|
+
};
|
|
169
|
+
translations?: Array<{
|
|
170
|
+
polygon_id: number;
|
|
171
|
+
language: string;
|
|
172
|
+
name: string;
|
|
173
|
+
}>;
|
|
174
|
+
parent_groups: ApiGroupChoroplethData[];
|
|
175
|
+
} & ApiCommonData;
|
|
32
176
|
} & Omit<ApiSuccess, 'data'> | ApiError;
|
|
33
177
|
|
|
34
|
-
type
|
|
35
|
-
id: number;
|
|
36
|
-
title: string;
|
|
37
|
-
subtitle: string;
|
|
38
|
-
svgPreview: string;
|
|
39
|
-
boundingBox: Polygon;
|
|
40
|
-
};
|
|
178
|
+
export type ApiPolygonChoroplethData = Flatten<Exclude<ApiPolygonChoropleth, ApiError>['data']>;
|
|
41
179
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
180
|
+
export async function listPolygonChoropleths(
|
|
181
|
+
name: string,
|
|
182
|
+
languages: string[],
|
|
183
|
+
searchBounds?: SearchBounds,
|
|
184
|
+
withParentGroups = false,
|
|
185
|
+
): Promise<PolygonChoropleth[]> {
|
|
186
|
+
const pathname = `/v1/choropleth/polygons`;
|
|
187
|
+
const query = getSearchParams(
|
|
188
|
+
{
|
|
189
|
+
search: { name, allow_single: true },
|
|
190
|
+
with_parent_groups: withParentGroups,
|
|
191
|
+
languages,
|
|
192
|
+
...searchBounds,
|
|
193
|
+
},
|
|
194
|
+
);
|
|
195
|
+
const path = `${pathname}?${query}`;
|
|
46
196
|
|
|
47
|
-
//
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
};
|
|
197
|
+
// Only request first 50 results
|
|
198
|
+
const headers = { ...defaultListHeader };
|
|
199
|
+
const options = { withMeta: true };
|
|
200
|
+
|
|
201
|
+
type ApiPolygonChoroplethArray = {
|
|
202
|
+
data: ApiPolygonChoroplethData[];
|
|
203
|
+
} & Omit<ApiSuccess, 'data'> | ApiError;
|
|
55
204
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
mode: 'polygon' | 'group' | 'both' = 'both',
|
|
66
|
-
): Promise<SingleOrGroupedArea[]> {
|
|
67
|
-
/**
|
|
68
|
-
* TODO When SAGA search on click is implemented, remove mode and make searchBounds required
|
|
69
|
-
*/
|
|
70
|
-
return request<ApiSingleOrGroupedAreaArray, SingleOrGroupedArea>(
|
|
71
|
-
`/v1/choropleth/polygons/search?${getSearchParams({
|
|
72
|
-
language,
|
|
73
|
-
...search.searchBounds,
|
|
74
|
-
...(search.query && { query: search.query }),
|
|
75
|
-
...(search.searchPoint && { point: search.searchPoint }),
|
|
76
|
-
mode,
|
|
77
|
-
})}`,
|
|
78
|
-
).then(result => {
|
|
79
|
-
result.forEach(
|
|
80
|
-
elem => {
|
|
81
|
-
elem.boundingBox = JSON.parse(elem.boundingBox as unknown as string) as Polygon;
|
|
82
|
-
if (!elem.isGroup) {
|
|
83
|
-
elem.properties = JSON.parse(elem.properties as unknown as string) as Record<string, string>;
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
);
|
|
87
|
-
|
|
88
|
-
return result;
|
|
89
|
-
});
|
|
205
|
+
return request<ApiPolygonChoroplethArray, PolygonChoropleth>(path, null, headers, options)
|
|
206
|
+
.catch((error: Error) => {
|
|
207
|
+
if (error instanceof APIMeta) {
|
|
208
|
+
return (error as APIMeta<ApiPolygonChoroplethArray, PolygonChoropleth>).data;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
throw error;
|
|
212
|
+
})
|
|
213
|
+
.then(result => result.map(processPolygonData));
|
|
90
214
|
}
|
|
91
215
|
|
|
92
|
-
type
|
|
216
|
+
export type GroupChoropleth = {
|
|
93
217
|
id: number;
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
218
|
+
polygonId: number;
|
|
219
|
+
relationId: number;
|
|
220
|
+
childrenCount: number;
|
|
221
|
+
sml?: string;
|
|
222
|
+
svgPreview: string;
|
|
223
|
+
previewPath: string;
|
|
224
|
+
uniqueProperties: string[];
|
|
225
|
+
boundingBox: Polygon;
|
|
226
|
+
partialProperties: string[];
|
|
227
|
+
restrictedOwnership: number[] | null;
|
|
228
|
+
linkId: number | null;
|
|
229
|
+
cloning: boolean;
|
|
230
|
+
laravelThroughKey?: number;
|
|
231
|
+
nativeParentTranslation: {
|
|
232
|
+
polygonId: number;
|
|
233
|
+
name: string;
|
|
234
|
+
laravelThroughKey: number;
|
|
235
|
+
};
|
|
236
|
+
nativeRelationTranslation: {
|
|
237
|
+
relationId: number;
|
|
238
|
+
name: string;
|
|
239
|
+
laravelThroughKey: number;
|
|
240
|
+
};
|
|
241
|
+
englishParentTranslation?: {
|
|
242
|
+
polygonId: number;
|
|
243
|
+
name: string;
|
|
244
|
+
laravelThroughKey: number;
|
|
245
|
+
};
|
|
246
|
+
englishRelationTranslation?: {
|
|
247
|
+
relationId: number;
|
|
248
|
+
name: string;
|
|
249
|
+
laravelThroughKey: number;
|
|
250
|
+
};
|
|
251
|
+
parentTranslations?: Array<{
|
|
252
|
+
polygonId: number;
|
|
253
|
+
name: string;
|
|
254
|
+
language: string;
|
|
255
|
+
laravelThroughKey: number;
|
|
256
|
+
}>;
|
|
257
|
+
relationTranslations?: Array<{
|
|
258
|
+
relationId: number;
|
|
259
|
+
name: string;
|
|
260
|
+
language: string;
|
|
261
|
+
laravelThroughKey: number;
|
|
262
|
+
}>;
|
|
99
263
|
};
|
|
100
264
|
|
|
101
|
-
type
|
|
102
|
-
data:
|
|
265
|
+
export type ApiGroupChoropleth = {
|
|
266
|
+
data: {
|
|
267
|
+
id: number;
|
|
268
|
+
polygon_id: number;
|
|
269
|
+
relation_id: number;
|
|
270
|
+
children_count: number;
|
|
271
|
+
sml?: number;
|
|
272
|
+
svg_preview: string;
|
|
273
|
+
preview_path: string;
|
|
274
|
+
unique_properties: string[];
|
|
275
|
+
bounding_box: Polygon;
|
|
276
|
+
partial_properties: string[];
|
|
277
|
+
restricted_ownership: number[] | null;
|
|
278
|
+
link_id: number | null;
|
|
279
|
+
cloning: boolean;
|
|
280
|
+
laravel_through_key?: number;
|
|
281
|
+
native_parent_translation: {
|
|
282
|
+
polygon_id: number;
|
|
283
|
+
name: string;
|
|
284
|
+
laravel_through_key: number;
|
|
285
|
+
};
|
|
286
|
+
native_relation_translation: {
|
|
287
|
+
relation_id: number;
|
|
288
|
+
name: string;
|
|
289
|
+
laravel_through_key: number;
|
|
290
|
+
};
|
|
291
|
+
english_parent_translation?: {
|
|
292
|
+
polygon_id: number;
|
|
293
|
+
name: string;
|
|
294
|
+
laravel_through_key: number;
|
|
295
|
+
};
|
|
296
|
+
english_relation_translation?: {
|
|
297
|
+
relation_id: number;
|
|
298
|
+
name: string;
|
|
299
|
+
laravel_through_key: number;
|
|
300
|
+
};
|
|
301
|
+
parent_translations?: Array<{
|
|
302
|
+
polygon_id: number;
|
|
303
|
+
name: string;
|
|
304
|
+
language: string;
|
|
305
|
+
laravel_through_key: number;
|
|
306
|
+
}>;
|
|
307
|
+
relation_translations?: Array<{
|
|
308
|
+
relation_id: number;
|
|
309
|
+
name: string;
|
|
310
|
+
language: string;
|
|
311
|
+
laravel_through_key: number;
|
|
312
|
+
}>;
|
|
313
|
+
} & ApiCommonData;
|
|
103
314
|
} & Omit<ApiSuccess, 'data'> | ApiError;
|
|
104
315
|
|
|
105
|
-
export type
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
316
|
+
export type ApiGroupChoroplethData = Flatten<Exclude<ApiGroupChoropleth, ApiError>['data']>;
|
|
317
|
+
|
|
318
|
+
export async function listGroupChoropleths(
|
|
319
|
+
name: string,
|
|
320
|
+
languages: string[],
|
|
321
|
+
searchBounds?: SearchBounds,
|
|
322
|
+
): Promise<GroupChoropleth[]> {
|
|
323
|
+
const pathname = `/v1/choropleth/groups`;
|
|
324
|
+
const query = getSearchParams({ search: { name }, languages, ...searchBounds });
|
|
325
|
+
const path = `${pathname}?${query}`;
|
|
113
326
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
327
|
+
// Only request first 50 results
|
|
328
|
+
const headers = { ...defaultListHeader };
|
|
329
|
+
const options = { withMeta: true };
|
|
330
|
+
|
|
331
|
+
type ApiGroupChoroplethArray = {
|
|
332
|
+
data: ApiGroupChoroplethData[];
|
|
333
|
+
} & Omit<ApiSuccess, 'data'> | ApiError;
|
|
334
|
+
|
|
335
|
+
return request<ApiGroupChoroplethArray, GroupChoropleth>(path, null, headers, options)
|
|
336
|
+
.catch((error: Error) => {
|
|
337
|
+
if (error instanceof APIMeta) {
|
|
338
|
+
return (error as APIMeta<ApiGroupChoroplethArray, GroupChoropleth>).data;
|
|
121
339
|
}
|
|
122
|
-
);
|
|
123
340
|
|
|
124
|
-
|
|
125
|
-
|
|
341
|
+
throw error;
|
|
342
|
+
})
|
|
343
|
+
.then(result => result.map(processGroupData));
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
export async function listChildrenGroupChoropleths(
|
|
347
|
+
groupId: number,
|
|
348
|
+
languages: string[],
|
|
349
|
+
): Promise<PolygonChoropleth[]> {
|
|
350
|
+
const pathname = `/v1/choropleth/groups/${groupId}/children`;
|
|
351
|
+
const query = getSearchParams({ languages });
|
|
352
|
+
const path = `${pathname}?${query}`;
|
|
353
|
+
|
|
354
|
+
type ApiPolygonChoroplethArray = {
|
|
355
|
+
data: ApiPolygonChoroplethData[];
|
|
356
|
+
} & Omit<ApiSuccess, 'data'> | ApiError;
|
|
357
|
+
|
|
358
|
+
return request<ApiPolygonChoroplethArray, PolygonChoropleth>(path).then(polygons => polygons.map(processPolygonData));
|
|
126
359
|
}
|
package/src/api/resources.ts
CHANGED