@mapcreator/api 0.0.0-wms.0 → 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/insetMap.js +1 -1
- package/cjs/api/insetMap.js.map +1 -1
- package/cjs/api/job.d.ts +1 -0
- package/cjs/api/job.d.ts.map +1 -1
- package/cjs/api/job.js.map +1 -1
- package/cjs/api/jobResult.d.ts +1 -1
- package/cjs/api/jobResult.d.ts.map +1 -1
- package/cjs/api/jobResult.js +1 -1
- package/cjs/api/jobResult.js.map +1 -1
- package/cjs/api/jobRevision.d.ts +2 -2
- package/cjs/api/jobRevision.d.ts.map +1 -1
- package/cjs/api/jobRevision.js +1 -1
- package/cjs/api/jobRevision.js.map +1 -1
- package/cjs/api/organisation.d.ts +2 -1
- package/cjs/api/organisation.d.ts.map +1 -1
- package/cjs/api/organisation.js +1 -2
- package/cjs/api/organisation.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/insetMap.js +1 -1
- package/esm/api/insetMap.js.map +1 -1
- package/esm/api/job.d.ts +1 -0
- package/esm/api/job.d.ts.map +1 -1
- package/esm/api/job.js.map +1 -1
- package/esm/api/jobResult.d.ts +1 -1
- package/esm/api/jobResult.d.ts.map +1 -1
- package/esm/api/jobResult.js +1 -1
- package/esm/api/jobResult.js.map +1 -1
- package/esm/api/jobRevision.d.ts +2 -2
- package/esm/api/jobRevision.d.ts.map +1 -1
- package/esm/api/jobRevision.js +1 -1
- package/esm/api/jobRevision.js.map +1 -1
- package/esm/api/organisation.d.ts +2 -1
- package/esm/api/organisation.d.ts.map +1 -1
- package/esm/api/organisation.js +1 -2
- package/esm/api/organisation.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/apiCommon.ts +70 -70
- package/src/api/choropleth.ts +359 -359
- package/src/api/color.ts +22 -22
- package/src/api/dimension.ts +44 -44
- package/src/api/dimensionSet.ts +20 -20
- package/src/api/feature.ts +22 -22
- package/src/api/font.ts +49 -49
- package/src/api/fontFamily.ts +43 -43
- package/src/api/highlight.ts +87 -87
- package/src/api/insetMap.ts +96 -96
- package/src/api/job.ts +130 -129
- package/src/api/jobResult.ts +95 -95
- package/src/api/jobRevision.ts +279 -278
- package/src/api/jobShare.ts +35 -35
- package/src/api/jobType.ts +26 -26
- package/src/api/language.ts +19 -19
- package/src/api/layer.ts +38 -38
- package/src/api/layerFaq.ts +53 -53
- package/src/api/layerGroup.ts +69 -69
- package/src/api/mapstyleSet.ts +48 -48
- package/src/api/message.ts +80 -80
- package/src/api/organisation.ts +95 -95
- package/src/api/resources.ts +146 -144
- package/src/api/svg.ts +33 -33
- package/src/api/svgSet.ts +56 -56
- package/src/api/user.ts +327 -327
- package/src/index.ts +43 -43
- package/src/oauth.ts +314 -314
- package/src/utils.ts +342 -342
package/src/api/color.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import type { ApiCommonData, ApiError, ApiSuccess, Flatten, Revivers } from '../utils.js';
|
|
2
|
-
|
|
3
|
-
export type Color = {
|
|
4
|
-
id: number;
|
|
5
|
-
hex: string;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export type ApiColor = {
|
|
9
|
-
data: {
|
|
10
|
-
id: number; // The color id (sortable)
|
|
11
|
-
name: string; // The name of the color (searchable, sortable)
|
|
12
|
-
hex: string; // The hex value of the color (searchable, sortable)
|
|
13
|
-
order?: number; // TODO: not present in API specification!
|
|
14
|
-
} & ApiCommonData;
|
|
15
|
-
} & Omit<ApiSuccess, 'data'> | ApiError;
|
|
16
|
-
|
|
17
|
-
export type ApiColorData = Flatten<Exclude<ApiColor, ApiError>['data']>;
|
|
18
|
-
|
|
19
|
-
export const colorRevivers: Revivers<ApiColor, Color> = {
|
|
20
|
-
name: undefined,
|
|
21
|
-
order: undefined,
|
|
22
|
-
};
|
|
1
|
+
import type { ApiCommonData, ApiError, ApiSuccess, Flatten, Revivers } from '../utils.js';
|
|
2
|
+
|
|
3
|
+
export type Color = {
|
|
4
|
+
id: number;
|
|
5
|
+
hex: string;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export type ApiColor = {
|
|
9
|
+
data: {
|
|
10
|
+
id: number; // The color id (sortable)
|
|
11
|
+
name: string; // The name of the color (searchable, sortable)
|
|
12
|
+
hex: string; // The hex value of the color (searchable, sortable)
|
|
13
|
+
order?: number; // TODO: not present in API specification!
|
|
14
|
+
} & ApiCommonData;
|
|
15
|
+
} & Omit<ApiSuccess, 'data'> | ApiError;
|
|
16
|
+
|
|
17
|
+
export type ApiColorData = Flatten<Exclude<ApiColor, ApiError>['data']>;
|
|
18
|
+
|
|
19
|
+
export const colorRevivers: Revivers<ApiColor, Color> = {
|
|
20
|
+
name: undefined,
|
|
21
|
+
order: undefined,
|
|
22
|
+
};
|
package/src/api/dimension.ts
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import type { ApiCommonData, ApiError, ApiSuccess, Flatten, Revivers } from '../utils.js';
|
|
2
|
-
|
|
3
|
-
export type OutputUnit =
|
|
4
|
-
| 'millimeter'
|
|
5
|
-
| 'centimeter'
|
|
6
|
-
| 'inch'
|
|
7
|
-
| 'pixel'
|
|
8
|
-
| 'pica';
|
|
9
|
-
|
|
10
|
-
export type Dimension = {
|
|
11
|
-
id: number;
|
|
12
|
-
dimensionSetId: number;
|
|
13
|
-
name: string;
|
|
14
|
-
width: number;
|
|
15
|
-
height: number;
|
|
16
|
-
dpi: number;
|
|
17
|
-
unit: OutputUnit;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export type ApiDimension = {
|
|
21
|
-
data: {
|
|
22
|
-
id: number; // The dimension id (sortable)
|
|
23
|
-
dimension_set_id: number; // The id of the dimension set
|
|
24
|
-
name: string; // The name of dimension (searchable, sortable)
|
|
25
|
-
width: number; // The width of the dimension (searchable, sortable)
|
|
26
|
-
height: number; // The height of the dimension (searchable, sortable)
|
|
27
|
-
dpi: number; // The dpi of the dimension
|
|
28
|
-
unit: string; // The unit of this dimension
|
|
29
|
-
} & ApiCommonData;
|
|
30
|
-
} & Omit<ApiSuccess, 'data'> | ApiError;
|
|
31
|
-
|
|
32
|
-
export type ApiDimensionData = Flatten<Exclude<ApiDimension, ApiError>['data']>;
|
|
33
|
-
|
|
34
|
-
const keyToUnit: { [key: string]: OutputUnit } = {
|
|
35
|
-
MM: 'millimeter',
|
|
36
|
-
CM: 'centimeter',
|
|
37
|
-
IN: 'inch',
|
|
38
|
-
PX: 'pixel',
|
|
39
|
-
PICA: 'pica',
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export const dimensionRevivers: Revivers<ApiDimension, Dimension> = {
|
|
43
|
-
unit: (data: ApiDimensionData) => keyToUnit[data.unit],
|
|
44
|
-
};
|
|
1
|
+
import type { ApiCommonData, ApiError, ApiSuccess, Flatten, Revivers } from '../utils.js';
|
|
2
|
+
|
|
3
|
+
export type OutputUnit =
|
|
4
|
+
| 'millimeter'
|
|
5
|
+
| 'centimeter'
|
|
6
|
+
| 'inch'
|
|
7
|
+
| 'pixel'
|
|
8
|
+
| 'pica';
|
|
9
|
+
|
|
10
|
+
export type Dimension = {
|
|
11
|
+
id: number;
|
|
12
|
+
dimensionSetId: number;
|
|
13
|
+
name: string;
|
|
14
|
+
width: number;
|
|
15
|
+
height: number;
|
|
16
|
+
dpi: number;
|
|
17
|
+
unit: OutputUnit;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type ApiDimension = {
|
|
21
|
+
data: {
|
|
22
|
+
id: number; // The dimension id (sortable)
|
|
23
|
+
dimension_set_id: number; // The id of the dimension set
|
|
24
|
+
name: string; // The name of dimension (searchable, sortable)
|
|
25
|
+
width: number; // The width of the dimension (searchable, sortable)
|
|
26
|
+
height: number; // The height of the dimension (searchable, sortable)
|
|
27
|
+
dpi: number; // The dpi of the dimension
|
|
28
|
+
unit: string; // The unit of this dimension
|
|
29
|
+
} & ApiCommonData;
|
|
30
|
+
} & Omit<ApiSuccess, 'data'> | ApiError;
|
|
31
|
+
|
|
32
|
+
export type ApiDimensionData = Flatten<Exclude<ApiDimension, ApiError>['data']>;
|
|
33
|
+
|
|
34
|
+
const keyToUnit: { [key: string]: OutputUnit } = {
|
|
35
|
+
MM: 'millimeter',
|
|
36
|
+
CM: 'centimeter',
|
|
37
|
+
IN: 'inch',
|
|
38
|
+
PX: 'pixel',
|
|
39
|
+
PICA: 'pica',
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const dimensionRevivers: Revivers<ApiDimension, Dimension> = {
|
|
43
|
+
unit: (data: ApiDimensionData) => keyToUnit[data.unit],
|
|
44
|
+
};
|
package/src/api/dimensionSet.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import type { ApiCommonData, ApiError, ApiSuccess, Flatten, Revivers } from '../utils.js';
|
|
2
|
-
|
|
3
|
-
export type DimensionSet = {
|
|
4
|
-
id: number;
|
|
5
|
-
name: string;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export type ApiDimensionSet = {
|
|
9
|
-
data: {
|
|
10
|
-
id: number; // The dimension set id (sortable)
|
|
11
|
-
name: string; // The dimension set name (searchable, sortable)
|
|
12
|
-
order?: number; // TODO: not present in API specification!
|
|
13
|
-
} & ApiCommonData;
|
|
14
|
-
} & Omit<ApiSuccess, 'data'> | ApiError;
|
|
15
|
-
|
|
16
|
-
export type ApiDimensionSetData = Flatten<Exclude<ApiDimensionSet, ApiError>['data']>;
|
|
17
|
-
|
|
18
|
-
export const dimensionSetRevivers: Revivers<ApiDimensionSet, DimensionSet> = {
|
|
19
|
-
order: undefined,
|
|
20
|
-
};
|
|
1
|
+
import type { ApiCommonData, ApiError, ApiSuccess, Flatten, Revivers } from '../utils.js';
|
|
2
|
+
|
|
3
|
+
export type DimensionSet = {
|
|
4
|
+
id: number;
|
|
5
|
+
name: string;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export type ApiDimensionSet = {
|
|
9
|
+
data: {
|
|
10
|
+
id: number; // The dimension set id (sortable)
|
|
11
|
+
name: string; // The dimension set name (searchable, sortable)
|
|
12
|
+
order?: number; // TODO: not present in API specification!
|
|
13
|
+
} & ApiCommonData;
|
|
14
|
+
} & Omit<ApiSuccess, 'data'> | ApiError;
|
|
15
|
+
|
|
16
|
+
export type ApiDimensionSetData = Flatten<Exclude<ApiDimensionSet, ApiError>['data']>;
|
|
17
|
+
|
|
18
|
+
export const dimensionSetRevivers: Revivers<ApiDimensionSet, DimensionSet> = {
|
|
19
|
+
order: undefined,
|
|
20
|
+
};
|
package/src/api/feature.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import type { ApiCommonData, ApiError, ApiSuccess, Flatten, Revivers } from '../utils.js';
|
|
2
|
-
|
|
3
|
-
export type Feature = {
|
|
4
|
-
id: number;
|
|
5
|
-
name: string;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export type ApiFeature = {
|
|
9
|
-
data: {
|
|
10
|
-
id: number; // The feature id
|
|
11
|
-
name: string; // The feature name (searchable, sortable)
|
|
12
|
-
description: string; // The description of the feature (searchable, sortable)
|
|
13
|
-
order?: number; // TODO: not present in API specification!
|
|
14
|
-
} & ApiCommonData;
|
|
15
|
-
} & Omit<ApiSuccess, 'data'> | ApiError;
|
|
16
|
-
|
|
17
|
-
export type ApiFeatureData = Flatten<Exclude<ApiFeature, ApiError>['data']>;
|
|
18
|
-
|
|
19
|
-
export const featureRevivers: Revivers<ApiFeature, Feature> = {
|
|
20
|
-
description: undefined,
|
|
21
|
-
order: undefined,
|
|
22
|
-
};
|
|
1
|
+
import type { ApiCommonData, ApiError, ApiSuccess, Flatten, Revivers } from '../utils.js';
|
|
2
|
+
|
|
3
|
+
export type Feature = {
|
|
4
|
+
id: number;
|
|
5
|
+
name: string;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export type ApiFeature = {
|
|
9
|
+
data: {
|
|
10
|
+
id: number; // The feature id
|
|
11
|
+
name: string; // The feature name (searchable, sortable)
|
|
12
|
+
description: string; // The description of the feature (searchable, sortable)
|
|
13
|
+
order?: number; // TODO: not present in API specification!
|
|
14
|
+
} & ApiCommonData;
|
|
15
|
+
} & Omit<ApiSuccess, 'data'> | ApiError;
|
|
16
|
+
|
|
17
|
+
export type ApiFeatureData = Flatten<Exclude<ApiFeature, ApiError>['data']>;
|
|
18
|
+
|
|
19
|
+
export const featureRevivers: Revivers<ApiFeature, Feature> = {
|
|
20
|
+
description: undefined,
|
|
21
|
+
order: undefined,
|
|
22
|
+
};
|
package/src/api/font.ts
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import { type ApiCommonData, type ApiError, type ApiSuccess, type Flatten, type Revivers, getSearchParams, request } from '../utils.js';
|
|
2
|
-
|
|
3
|
-
export type Font = {
|
|
4
|
-
id: number;
|
|
5
|
-
fontFamilyId: number;
|
|
6
|
-
name: string;
|
|
7
|
-
label: string;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export type ApiFont = {
|
|
11
|
-
data: {
|
|
12
|
-
id: number; // The id of the font (sortable)
|
|
13
|
-
font_family_id: number; // The id of the font family
|
|
14
|
-
name: string; // The name of the font (searchable, sortable)
|
|
15
|
-
style: string; // The font style (searchable, sortable)
|
|
16
|
-
stretch: string; // The font stretch (searchable, sortable)
|
|
17
|
-
weight: number; // The font weight (searchable, sortable)
|
|
18
|
-
label: string; // The label of the font (searchable, sortable)
|
|
19
|
-
order?: number; // TODO: not present in API specification!
|
|
20
|
-
} & ApiCommonData;
|
|
21
|
-
} & Omit<ApiSuccess, 'data'> | ApiError;
|
|
22
|
-
|
|
23
|
-
export type ApiFontData = Flatten<Exclude<ApiFont, ApiError>['data']>;
|
|
24
|
-
|
|
25
|
-
type FontSearchOptions = {
|
|
26
|
-
family?: string;
|
|
27
|
-
style?: string;
|
|
28
|
-
weight?: string;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export const fontRevivers: Revivers<ApiFont, Font> = {
|
|
32
|
-
style: undefined,
|
|
33
|
-
stretch: undefined,
|
|
34
|
-
weight: undefined,
|
|
35
|
-
order: undefined,
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export async function getFonts(searchOptions: FontSearchOptions): Promise<Font[] | Font> {
|
|
39
|
-
const pathname = `/v1/fonts/search`;
|
|
40
|
-
const query = getSearchParams(searchOptions);
|
|
41
|
-
|
|
42
|
-
const path = `${pathname}?${query}`;
|
|
43
|
-
|
|
44
|
-
type ApiFontArray = {
|
|
45
|
-
data: ApiFontData[];
|
|
46
|
-
} & Omit<ApiSuccess, 'data'> | ApiError;
|
|
47
|
-
|
|
48
|
-
return request<ApiFontArray, Font>(path);
|
|
49
|
-
}
|
|
1
|
+
import { type ApiCommonData, type ApiError, type ApiSuccess, type Flatten, type Revivers, getSearchParams, request } from '../utils.js';
|
|
2
|
+
|
|
3
|
+
export type Font = {
|
|
4
|
+
id: number;
|
|
5
|
+
fontFamilyId: number;
|
|
6
|
+
name: string;
|
|
7
|
+
label: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type ApiFont = {
|
|
11
|
+
data: {
|
|
12
|
+
id: number; // The id of the font (sortable)
|
|
13
|
+
font_family_id: number; // The id of the font family
|
|
14
|
+
name: string; // The name of the font (searchable, sortable)
|
|
15
|
+
style: string; // The font style (searchable, sortable)
|
|
16
|
+
stretch: string; // The font stretch (searchable, sortable)
|
|
17
|
+
weight: number; // The font weight (searchable, sortable)
|
|
18
|
+
label: string; // The label of the font (searchable, sortable)
|
|
19
|
+
order?: number; // TODO: not present in API specification!
|
|
20
|
+
} & ApiCommonData;
|
|
21
|
+
} & Omit<ApiSuccess, 'data'> | ApiError;
|
|
22
|
+
|
|
23
|
+
export type ApiFontData = Flatten<Exclude<ApiFont, ApiError>['data']>;
|
|
24
|
+
|
|
25
|
+
type FontSearchOptions = {
|
|
26
|
+
family?: string;
|
|
27
|
+
style?: string;
|
|
28
|
+
weight?: string;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const fontRevivers: Revivers<ApiFont, Font> = {
|
|
32
|
+
style: undefined,
|
|
33
|
+
stretch: undefined,
|
|
34
|
+
weight: undefined,
|
|
35
|
+
order: undefined,
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export async function getFonts(searchOptions: FontSearchOptions): Promise<Font[] | Font> {
|
|
39
|
+
const pathname = `/v1/fonts/search`;
|
|
40
|
+
const query = getSearchParams(searchOptions);
|
|
41
|
+
|
|
42
|
+
const path = `${pathname}?${query}`;
|
|
43
|
+
|
|
44
|
+
type ApiFontArray = {
|
|
45
|
+
data: ApiFontData[];
|
|
46
|
+
} & Omit<ApiSuccess, 'data'> | ApiError;
|
|
47
|
+
|
|
48
|
+
return request<ApiFontArray, Font>(path);
|
|
49
|
+
}
|
package/src/api/fontFamily.ts
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { type ApiFontData, type Font, fontRevivers } from './font.js';
|
|
2
|
-
import {
|
|
3
|
-
type ApiCommonData,
|
|
4
|
-
type ApiError,
|
|
5
|
-
type ApiSuccess,
|
|
6
|
-
type Flatten,
|
|
7
|
-
type Revivers,
|
|
8
|
-
defaultListHeader,
|
|
9
|
-
getSearchParams,
|
|
10
|
-
request,
|
|
11
|
-
} from '../utils.js';
|
|
12
|
-
|
|
13
|
-
export type FontFamily = {
|
|
14
|
-
id: number;
|
|
15
|
-
name: string;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export type ApiFontFamily = {
|
|
19
|
-
data: {
|
|
20
|
-
id: number; // The id of the font family (sortable)
|
|
21
|
-
name: string; // The name of the font family (searchable, sortable)
|
|
22
|
-
order?: number; // TODO: not present in API specification!
|
|
23
|
-
} & ApiCommonData;
|
|
24
|
-
} & Omit<ApiSuccess, 'data'> | ApiError;
|
|
25
|
-
|
|
26
|
-
export type ApiFontFamilyData = Flatten<Exclude<ApiFontFamily, ApiError>['data']>;
|
|
27
|
-
|
|
28
|
-
export const fontFamilyRevivers: Revivers<ApiFontFamily, FontFamily> = {
|
|
29
|
-
order: undefined,
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export async function listFontFamilyFonts(fontFamilyId: number): Promise<Font[]> {
|
|
33
|
-
const pathname = `/v1/fonts/families/${fontFamilyId}/items`;
|
|
34
|
-
const query = getSearchParams({ sort: 'order' });
|
|
35
|
-
const path = `${pathname}?${query}`;
|
|
36
|
-
const options = { revivers: fontRevivers };
|
|
37
|
-
|
|
38
|
-
type ApiFontArray = {
|
|
39
|
-
data: ApiFontData[];
|
|
40
|
-
} & Omit<ApiSuccess, 'data'> | ApiError;
|
|
41
|
-
|
|
42
|
-
return request<ApiFontArray, Font>(path, null, defaultListHeader, options);
|
|
43
|
-
}
|
|
1
|
+
import { type ApiFontData, type Font, fontRevivers } from './font.js';
|
|
2
|
+
import {
|
|
3
|
+
type ApiCommonData,
|
|
4
|
+
type ApiError,
|
|
5
|
+
type ApiSuccess,
|
|
6
|
+
type Flatten,
|
|
7
|
+
type Revivers,
|
|
8
|
+
defaultListHeader,
|
|
9
|
+
getSearchParams,
|
|
10
|
+
request,
|
|
11
|
+
} from '../utils.js';
|
|
12
|
+
|
|
13
|
+
export type FontFamily = {
|
|
14
|
+
id: number;
|
|
15
|
+
name: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export type ApiFontFamily = {
|
|
19
|
+
data: {
|
|
20
|
+
id: number; // The id of the font family (sortable)
|
|
21
|
+
name: string; // The name of the font family (searchable, sortable)
|
|
22
|
+
order?: number; // TODO: not present in API specification!
|
|
23
|
+
} & ApiCommonData;
|
|
24
|
+
} & Omit<ApiSuccess, 'data'> | ApiError;
|
|
25
|
+
|
|
26
|
+
export type ApiFontFamilyData = Flatten<Exclude<ApiFontFamily, ApiError>['data']>;
|
|
27
|
+
|
|
28
|
+
export const fontFamilyRevivers: Revivers<ApiFontFamily, FontFamily> = {
|
|
29
|
+
order: undefined,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export async function listFontFamilyFonts(fontFamilyId: number): Promise<Font[]> {
|
|
33
|
+
const pathname = `/v1/fonts/families/${fontFamilyId}/items`;
|
|
34
|
+
const query = getSearchParams({ sort: 'order' });
|
|
35
|
+
const path = `${pathname}?${query}`;
|
|
36
|
+
const options = { revivers: fontRevivers };
|
|
37
|
+
|
|
38
|
+
type ApiFontArray = {
|
|
39
|
+
data: ApiFontData[];
|
|
40
|
+
} & Omit<ApiSuccess, 'data'> | ApiError;
|
|
41
|
+
|
|
42
|
+
return request<ApiFontArray, Font>(path, null, defaultListHeader, options);
|
|
43
|
+
}
|
package/src/api/highlight.ts
CHANGED
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
import type { FeatureCollection } from 'geojson';
|
|
2
|
-
import type { SnakeCase } from 'type-fest';
|
|
3
|
-
import {
|
|
4
|
-
APIMeta,
|
|
5
|
-
type ApiCommonData,
|
|
6
|
-
type ApiError,
|
|
7
|
-
type ApiSuccess,
|
|
8
|
-
type Flatten,
|
|
9
|
-
defaultListHeader,
|
|
10
|
-
getSearchParams,
|
|
11
|
-
request,
|
|
12
|
-
} from '../utils.js';
|
|
13
|
-
|
|
14
|
-
type FieldName = 'id' | 'name' | 'description' | 'previewPath' | 'previewJson';
|
|
15
|
-
|
|
16
|
-
export type PartialVectorHighlight = Pick<VectorHighlight, FieldName>;
|
|
17
|
-
|
|
18
|
-
export type VectorHighlight = {
|
|
19
|
-
id: number;
|
|
20
|
-
name: string;
|
|
21
|
-
description: string;
|
|
22
|
-
previewPath: string | null;
|
|
23
|
-
previewJson: FeatureCollection | null;
|
|
24
|
-
|
|
25
|
-
vectorSetUrl: string;
|
|
26
|
-
sourceLayerName: string;
|
|
27
|
-
|
|
28
|
-
lngMin: number;
|
|
29
|
-
lngMax: number;
|
|
30
|
-
latMin: number;
|
|
31
|
-
latMax: number;
|
|
32
|
-
|
|
33
|
-
keys: string[];
|
|
34
|
-
properties: Record<string, unknown>;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export type ApiVectorHighlight = {
|
|
38
|
-
data: {
|
|
39
|
-
id: number;
|
|
40
|
-
name: string;
|
|
41
|
-
description: string;
|
|
42
|
-
preview_path: string | null;
|
|
43
|
-
preview_json: FeatureCollection | null;
|
|
44
|
-
|
|
45
|
-
vector_set_url: string;
|
|
46
|
-
source_layer_name: string;
|
|
47
|
-
|
|
48
|
-
lng_min: number;
|
|
49
|
-
lng_max: number;
|
|
50
|
-
lat_min: number;
|
|
51
|
-
lat_max: number;
|
|
52
|
-
|
|
53
|
-
keys: string[];
|
|
54
|
-
properties: Record<string, unknown>;
|
|
55
|
-
} & ApiCommonData;
|
|
56
|
-
} & Omit<ApiSuccess, 'data'> | ApiError;
|
|
57
|
-
|
|
58
|
-
export type ApiVectorHighlightData = Flatten<Exclude<ApiVectorHighlight, ApiError>['data']>;
|
|
59
|
-
|
|
60
|
-
export async function listVectorHighlights(name: string): Promise<PartialVectorHighlight[]> {
|
|
61
|
-
const pathname = `/v1/highlights/vector`;
|
|
62
|
-
const query = getSearchParams({ search: { name } });
|
|
63
|
-
const path = `${pathname}?${query}`;
|
|
64
|
-
|
|
65
|
-
// Only request first 50 results
|
|
66
|
-
const headers = { ...defaultListHeader };
|
|
67
|
-
const options = { withMeta: true };
|
|
68
|
-
|
|
69
|
-
type ApiVectorHighlightArray = {
|
|
70
|
-
data: Array<Pick<ApiVectorHighlightData, SnakeCase<FieldName>>>;
|
|
71
|
-
} & Omit<ApiSuccess, 'data'> | ApiError;
|
|
72
|
-
|
|
73
|
-
return request<ApiVectorHighlightArray, PartialVectorHighlight>(path, null, headers, options)
|
|
74
|
-
.catch((error: Error) => {
|
|
75
|
-
if (error instanceof APIMeta) {
|
|
76
|
-
return (error as APIMeta<ApiVectorHighlightArray, PartialVectorHighlight>).data;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
throw error;
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export async function getVectorHighlight(highlightId: number): Promise<VectorHighlight> {
|
|
84
|
-
const path = `/v1/highlights/vector/${highlightId}`;
|
|
85
|
-
|
|
86
|
-
return request<ApiVectorHighlight, VectorHighlight>(path);
|
|
87
|
-
}
|
|
1
|
+
import type { FeatureCollection } from 'geojson';
|
|
2
|
+
import type { SnakeCase } from 'type-fest';
|
|
3
|
+
import {
|
|
4
|
+
APIMeta,
|
|
5
|
+
type ApiCommonData,
|
|
6
|
+
type ApiError,
|
|
7
|
+
type ApiSuccess,
|
|
8
|
+
type Flatten,
|
|
9
|
+
defaultListHeader,
|
|
10
|
+
getSearchParams,
|
|
11
|
+
request,
|
|
12
|
+
} from '../utils.js';
|
|
13
|
+
|
|
14
|
+
type FieldName = 'id' | 'name' | 'description' | 'previewPath' | 'previewJson';
|
|
15
|
+
|
|
16
|
+
export type PartialVectorHighlight = Pick<VectorHighlight, FieldName>;
|
|
17
|
+
|
|
18
|
+
export type VectorHighlight = {
|
|
19
|
+
id: number;
|
|
20
|
+
name: string;
|
|
21
|
+
description: string;
|
|
22
|
+
previewPath: string | null;
|
|
23
|
+
previewJson: FeatureCollection | null;
|
|
24
|
+
|
|
25
|
+
vectorSetUrl: string;
|
|
26
|
+
sourceLayerName: string;
|
|
27
|
+
|
|
28
|
+
lngMin: number;
|
|
29
|
+
lngMax: number;
|
|
30
|
+
latMin: number;
|
|
31
|
+
latMax: number;
|
|
32
|
+
|
|
33
|
+
keys: string[];
|
|
34
|
+
properties: Record<string, unknown>;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export type ApiVectorHighlight = {
|
|
38
|
+
data: {
|
|
39
|
+
id: number;
|
|
40
|
+
name: string;
|
|
41
|
+
description: string;
|
|
42
|
+
preview_path: string | null;
|
|
43
|
+
preview_json: FeatureCollection | null;
|
|
44
|
+
|
|
45
|
+
vector_set_url: string;
|
|
46
|
+
source_layer_name: string;
|
|
47
|
+
|
|
48
|
+
lng_min: number;
|
|
49
|
+
lng_max: number;
|
|
50
|
+
lat_min: number;
|
|
51
|
+
lat_max: number;
|
|
52
|
+
|
|
53
|
+
keys: string[];
|
|
54
|
+
properties: Record<string, unknown>;
|
|
55
|
+
} & ApiCommonData;
|
|
56
|
+
} & Omit<ApiSuccess, 'data'> | ApiError;
|
|
57
|
+
|
|
58
|
+
export type ApiVectorHighlightData = Flatten<Exclude<ApiVectorHighlight, ApiError>['data']>;
|
|
59
|
+
|
|
60
|
+
export async function listVectorHighlights(name: string): Promise<PartialVectorHighlight[]> {
|
|
61
|
+
const pathname = `/v1/highlights/vector`;
|
|
62
|
+
const query = getSearchParams({ search: { name } });
|
|
63
|
+
const path = `${pathname}?${query}`;
|
|
64
|
+
|
|
65
|
+
// Only request first 50 results
|
|
66
|
+
const headers = { ...defaultListHeader };
|
|
67
|
+
const options = { withMeta: true };
|
|
68
|
+
|
|
69
|
+
type ApiVectorHighlightArray = {
|
|
70
|
+
data: Array<Pick<ApiVectorHighlightData, SnakeCase<FieldName>>>;
|
|
71
|
+
} & Omit<ApiSuccess, 'data'> | ApiError;
|
|
72
|
+
|
|
73
|
+
return request<ApiVectorHighlightArray, PartialVectorHighlight>(path, null, headers, options)
|
|
74
|
+
.catch((error: Error) => {
|
|
75
|
+
if (error instanceof APIMeta) {
|
|
76
|
+
return (error as APIMeta<ApiVectorHighlightArray, PartialVectorHighlight>).data;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
throw error;
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export async function getVectorHighlight(highlightId: number): Promise<VectorHighlight> {
|
|
84
|
+
const path = `/v1/highlights/vector/${highlightId}`;
|
|
85
|
+
|
|
86
|
+
return request<ApiVectorHighlight, VectorHighlight>(path);
|
|
87
|
+
}
|