@elastic/ems-client 7.16.0 → 8.2.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/.backportrc.json +24 -3
- package/CHANGELOG.md +20 -0
- package/package.json +2 -1
- package/src/ems_client.ts +1 -1
- package/src/ems_service.ts +0 -6
- package/src/index.ts +1 -2
- package/src/tms_service.ts +31 -53
- package/target/ems_service.d.ts +0 -2
- package/target/index.d.ts +1 -2
- package/target/node/ems_client.js +1 -1
- package/target/node/ems_service.js +0 -6
- package/target/node/index.js +12 -8
- package/target/node/tms_service.js +22 -19
- package/target/tms_service.d.ts +10 -30
- package/target/web/ems_client.js +1 -1
- package/target/web/ems_service.js +0 -6
- package/target/web/index.js +1 -2
- package/target/web/tms_service.js +42 -41
- package/test/ems_client.test.ts +2 -2
- package/api-extractor.json +0 -364
- package/etc/ems-client.api.md +0 -154
- package/src/origin.ts +0 -11
- package/target/node/origin.js +0 -18
- package/target/origin.d.ts +0 -4
- package/target/web/origin.js +0 -10
package/.backportrc.json
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"upstream": "elastic/ems-client",
|
|
3
|
-
"branches": [
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
"branches": [
|
|
4
|
+
{
|
|
5
|
+
"name": "8.1",
|
|
6
|
+
"checked": true
|
|
7
|
+
},
|
|
8
|
+
"8.0",
|
|
9
|
+
"7.17",
|
|
10
|
+
"7.16",
|
|
11
|
+
"7.16",
|
|
12
|
+
"7.15",
|
|
13
|
+
"7.14",
|
|
14
|
+
"7.12",
|
|
15
|
+
"7.11",
|
|
16
|
+
"7.10",
|
|
17
|
+
"7.9",
|
|
18
|
+
"7.8",
|
|
19
|
+
"7.7",
|
|
20
|
+
"7.6",
|
|
21
|
+
"7.2"
|
|
22
|
+
],
|
|
23
|
+
"labels": [
|
|
24
|
+
"backport"
|
|
25
|
+
]
|
|
26
|
+
}
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,26 @@ All notable changes to this project will be documented in this file.
|
|
|
3
3
|
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
5
5
|
|
|
6
|
+
|
|
7
|
+
## [8.2.0] - 2022-03-24
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
- Default EMS version is 8.2
|
|
11
|
+
- Removed getOrigin method #91
|
|
12
|
+
|
|
13
|
+
## [8.1.0] - 2021-11-09
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
- Default EMS version is 8.1
|
|
17
|
+
- Export EmsSprite and EmsSpritesheet types
|
|
18
|
+
- Inherit types from maplibre-gl
|
|
19
|
+
|
|
20
|
+
## [8.0.0] - 2021-10-20
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
- Default EMS version is 8.0
|
|
24
|
+
- Remove unused API descriptors
|
|
25
|
+
|
|
6
26
|
## [7.16.0] - 2021-10-13
|
|
7
27
|
|
|
8
28
|
### Changed
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elastic/ems-client",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.2.0",
|
|
4
4
|
"description": "JavaScript client library for the Elastic Maps Service",
|
|
5
5
|
"main": "target/node/index.js",
|
|
6
6
|
"browser": "target/web/index.js",
|
|
@@ -63,6 +63,7 @@
|
|
|
63
63
|
"eslint-plugin-prettier": "^3.1.3",
|
|
64
64
|
"husky": "^4.2.5",
|
|
65
65
|
"jest": "^26.4.0",
|
|
66
|
+
"maplibre-gl": "^1.15.2",
|
|
66
67
|
"node-fetch": "^2.6.1",
|
|
67
68
|
"prettier": "^2.0.5",
|
|
68
69
|
"ts-jest": "^26.2.0",
|
package/src/ems_client.ts
CHANGED
|
@@ -16,7 +16,7 @@ import { toAbsoluteUrl } from './utils';
|
|
|
16
16
|
import { ParsedUrlQueryInput } from 'querystring';
|
|
17
17
|
import LRUCache from 'lru-cache';
|
|
18
18
|
|
|
19
|
-
const DEFAULT_EMS_VERSION = '
|
|
19
|
+
const DEFAULT_EMS_VERSION = '8.2';
|
|
20
20
|
|
|
21
21
|
type URLMeaningfulParts = {
|
|
22
22
|
auth?: string | null;
|
package/src/ems_service.ts
CHANGED
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { EMSClient, BaseEmsServiceConfig } from './ems_client';
|
|
9
|
-
import { ORIGIN } from './origin';
|
|
10
9
|
import { toAbsoluteUrl } from './utils';
|
|
11
10
|
|
|
12
11
|
export interface IEmsService {
|
|
@@ -15,7 +14,6 @@ export interface IEmsService {
|
|
|
15
14
|
getDisplayName(): string;
|
|
16
15
|
getId(): string;
|
|
17
16
|
hasId(id: string): boolean;
|
|
18
|
-
getOrigin(): string;
|
|
19
17
|
getApiUrl(): string;
|
|
20
18
|
}
|
|
21
19
|
|
|
@@ -50,10 +48,6 @@ export abstract class AbstractEmsService implements IEmsService {
|
|
|
50
48
|
return attributions.join('|');
|
|
51
49
|
}
|
|
52
50
|
|
|
53
|
-
getOrigin(): string {
|
|
54
|
-
return ORIGIN.EMS;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
51
|
/**
|
|
58
52
|
* Checks if url is absolute. If not, prepend the basePath.
|
|
59
53
|
*/
|
package/src/index.ts
CHANGED
package/src/tms_service.ts
CHANGED
|
@@ -6,52 +6,31 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import _ from 'lodash';
|
|
9
|
+
import { Style as MapLibreStyle, VectorSource as MapLibreVectorSource } from 'maplibre-gl';
|
|
9
10
|
import { EMSClient, EmsTmsFormat, TMSServiceConfig } from './ems_client';
|
|
10
11
|
import { AbstractEmsService } from './ems_service';
|
|
11
12
|
|
|
12
|
-
type
|
|
13
|
-
type: 'vector';
|
|
14
|
-
url: string;
|
|
15
|
-
tiles: string[];
|
|
16
|
-
bounds?: number[];
|
|
17
|
-
scheme?: 'xyz' | 'tms';
|
|
18
|
-
minzoom?: number;
|
|
19
|
-
maxzoom?: number;
|
|
20
|
-
attribution?: string;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
type EmsVectorSources = {
|
|
24
|
-
[sourceName: string]: EmsVectorSource;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
type EmsVectorStyle = {
|
|
28
|
-
sources: EmsVectorSources;
|
|
29
|
-
sprite: string;
|
|
30
|
-
glyphs: string;
|
|
31
|
-
bearing?: number;
|
|
32
|
-
center?: number[];
|
|
33
|
-
layers?: unknown[];
|
|
34
|
-
metadata?: unknown;
|
|
35
|
-
name?: string;
|
|
36
|
-
pitch?: number;
|
|
37
|
-
light?: unknown;
|
|
38
|
-
transition?: unknown;
|
|
39
|
-
version: number;
|
|
40
|
-
zoom?: number;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
type EmsSprite = {
|
|
13
|
+
export type EmsSprite = {
|
|
44
14
|
height: number;
|
|
45
15
|
pixelRatio: number;
|
|
46
16
|
width: number;
|
|
47
17
|
x: number;
|
|
48
18
|
y: number;
|
|
19
|
+
sdf?: boolean;
|
|
49
20
|
};
|
|
50
21
|
|
|
51
|
-
type EmsSpriteSheet = {
|
|
22
|
+
export type EmsSpriteSheet = {
|
|
52
23
|
[spriteName: string]: EmsSprite;
|
|
53
24
|
};
|
|
54
25
|
|
|
26
|
+
type EmsVectorSources = {
|
|
27
|
+
[sourceName: string]: MapLibreVectorSource;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
type EmsVectorStyle = MapLibreStyle & {
|
|
31
|
+
sources: EmsVectorSources;
|
|
32
|
+
};
|
|
33
|
+
|
|
55
34
|
type EmsRasterStyle = {
|
|
56
35
|
tilejson: string;
|
|
57
36
|
name: string;
|
|
@@ -98,19 +77,20 @@ export class TMSService extends AbstractEmsService {
|
|
|
98
77
|
const { sources } = vectorJson;
|
|
99
78
|
for (const sourceName of Object.getOwnPropertyNames(sources)) {
|
|
100
79
|
const { url } = sources[sourceName];
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
80
|
+
if (url) {
|
|
81
|
+
const sourceUrl = this._proxyPath + this._getAbsoluteUrl(url);
|
|
82
|
+
const extendedUrl = this._emsClient.extendUrlWithParams(sourceUrl);
|
|
83
|
+
const sourceJson = await this._emsClient.getManifest<MapLibreVectorSource>(extendedUrl);
|
|
84
|
+
const tiles = sourceJson?.tiles?.map((tileUrl) => {
|
|
85
|
+
const directUrl = this._proxyPath + this._getAbsoluteUrl(tileUrl);
|
|
86
|
+
return this._emsClient.extendUrlWithParams(directUrl);
|
|
87
|
+
});
|
|
88
|
+
inlinedSources[sourceName] = {
|
|
89
|
+
...sourceJson,
|
|
90
|
+
type: 'vector',
|
|
91
|
+
tiles,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
114
94
|
}
|
|
115
95
|
return {
|
|
116
96
|
...vectorJson,
|
|
@@ -155,11 +135,9 @@ export class TMSService extends AbstractEmsService {
|
|
|
155
135
|
|
|
156
136
|
async getUrlTemplateForVector(sourceId: string): Promise<string> {
|
|
157
137
|
const tileJson = await this._getVectorStyleJsonInlined();
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
if (tileJson.sources[sourceId] && tileJson.sources[sourceId].tiles) {
|
|
162
|
-
const directUrl = this._proxyPath + this._getAbsoluteUrl(tileJson.sources[sourceId].tiles[0]);
|
|
138
|
+
const url = tileJson?.sources[sourceId]?.tiles?.pop();
|
|
139
|
+
if (url) {
|
|
140
|
+
const directUrl = this._proxyPath + this._getAbsoluteUrl(url);
|
|
163
141
|
return this._emsClient.extendUrlWithParams(directUrl);
|
|
164
142
|
} else {
|
|
165
143
|
return '';
|
|
@@ -271,7 +249,7 @@ export class TMSService extends AbstractEmsService {
|
|
|
271
249
|
|
|
272
250
|
private async _getSpriteSheetRootPath(): Promise<string> {
|
|
273
251
|
const vectorStyleJson = await this._getVectorStyleJsonRaw();
|
|
274
|
-
if (vectorStyleJson) {
|
|
252
|
+
if (vectorStyleJson?.sprite) {
|
|
275
253
|
return this._proxyPath + this._getAbsoluteUrl(vectorStyleJson.sprite);
|
|
276
254
|
} else {
|
|
277
255
|
return '';
|
|
@@ -280,7 +258,7 @@ export class TMSService extends AbstractEmsService {
|
|
|
280
258
|
|
|
281
259
|
private async _getUrlTemplateForGlyphs(): Promise<string> {
|
|
282
260
|
const vectorStyleJson = await this._getVectorStyleJsonRaw();
|
|
283
|
-
if (vectorStyleJson) {
|
|
261
|
+
if (vectorStyleJson?.glyphs) {
|
|
284
262
|
return this._proxyPath + this._getAbsoluteUrl(vectorStyleJson.glyphs);
|
|
285
263
|
} else {
|
|
286
264
|
return '';
|
package/target/ems_service.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ export interface IEmsService {
|
|
|
8
8
|
getDisplayName(): string;
|
|
9
9
|
getId(): string;
|
|
10
10
|
hasId(id: string): boolean;
|
|
11
|
-
getOrigin(): string;
|
|
12
11
|
getApiUrl(): string;
|
|
13
12
|
}
|
|
14
13
|
export declare abstract class AbstractEmsService implements IEmsService {
|
|
@@ -21,7 +20,6 @@ export declare abstract class AbstractEmsService implements IEmsService {
|
|
|
21
20
|
label: string;
|
|
22
21
|
}[];
|
|
23
22
|
getMarkdownAttribution(): string;
|
|
24
|
-
getOrigin(): string;
|
|
25
23
|
/**
|
|
26
24
|
* Checks if url is absolute. If not, prepend the basePath.
|
|
27
25
|
*/
|
package/target/index.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
23
23
|
|
|
24
24
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
25
25
|
|
|
26
|
-
const DEFAULT_EMS_VERSION = '
|
|
26
|
+
const DEFAULT_EMS_VERSION = '8.2';
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* plugins cannot have upstream dependencies on core/*-kibana.
|
|
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.AbstractEmsService = void 0;
|
|
7
7
|
|
|
8
|
-
var _origin = require("./origin");
|
|
9
|
-
|
|
10
8
|
var _utils = require("./utils");
|
|
11
9
|
|
|
12
10
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -56,10 +54,6 @@ class AbstractEmsService {
|
|
|
56
54
|
|
|
57
55
|
return attributions.join('|');
|
|
58
56
|
}
|
|
59
|
-
|
|
60
|
-
getOrigin() {
|
|
61
|
-
return _origin.ORIGIN.EMS;
|
|
62
|
-
}
|
|
63
57
|
/**
|
|
64
58
|
* Checks if url is absolute. If not, prepend the basePath.
|
|
65
59
|
*/
|
package/target/node/index.js
CHANGED
|
@@ -9,22 +9,28 @@ Object.defineProperty(exports, "EMSClient", {
|
|
|
9
9
|
return _ems_client.EMSClient;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
Object.defineProperty(exports, "
|
|
12
|
+
Object.defineProperty(exports, "EmsSprite", {
|
|
13
13
|
enumerable: true,
|
|
14
14
|
get: function () {
|
|
15
|
-
return
|
|
15
|
+
return _tms_service.EmsSprite;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
Object.defineProperty(exports, "
|
|
18
|
+
Object.defineProperty(exports, "EmsSpriteSheet", {
|
|
19
19
|
enumerable: true,
|
|
20
20
|
get: function () {
|
|
21
|
-
return
|
|
21
|
+
return _tms_service.EmsSpriteSheet;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
Object.defineProperty(exports, "
|
|
24
|
+
Object.defineProperty(exports, "FileLayer", {
|
|
25
25
|
enumerable: true,
|
|
26
26
|
get: function () {
|
|
27
|
-
return
|
|
27
|
+
return _file_layer.FileLayer;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "FileLayerField", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _ems_client.FileLayerField;
|
|
28
34
|
}
|
|
29
35
|
});
|
|
30
36
|
Object.defineProperty(exports, "TMSService", {
|
|
@@ -36,8 +42,6 @@ Object.defineProperty(exports, "TMSService", {
|
|
|
36
42
|
|
|
37
43
|
var _ems_client = require("./ems_client");
|
|
38
44
|
|
|
39
|
-
var _origin = require("./origin");
|
|
40
|
-
|
|
41
45
|
var _file_layer = require("./file_layer");
|
|
42
46
|
|
|
43
47
|
var _tms_service = require("./tms_service");
|
|
@@ -59,20 +59,24 @@ class TMSService extends _ems_service.AbstractEmsService {
|
|
|
59
59
|
url
|
|
60
60
|
} = sources[sourceName];
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
if (url) {
|
|
63
|
+
var _sourceJson$tiles;
|
|
63
64
|
|
|
64
|
-
|
|
65
|
+
const sourceUrl = this._proxyPath + this._getAbsoluteUrl(url);
|
|
65
66
|
|
|
66
|
-
|
|
67
|
-
const extendedTileUrls = sourceJson.tiles.map(tileUrl => {
|
|
68
|
-
const url = this._proxyPath + this._getAbsoluteUrl(tileUrl);
|
|
67
|
+
const extendedUrl = this._emsClient.extendUrlWithParams(sourceUrl);
|
|
69
68
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
69
|
+
const sourceJson = await this._emsClient.getManifest(extendedUrl);
|
|
70
|
+
const tiles = sourceJson === null || sourceJson === void 0 ? void 0 : (_sourceJson$tiles = sourceJson.tiles) === null || _sourceJson$tiles === void 0 ? void 0 : _sourceJson$tiles.map(tileUrl => {
|
|
71
|
+
const directUrl = this._proxyPath + this._getAbsoluteUrl(tileUrl);
|
|
72
|
+
|
|
73
|
+
return this._emsClient.extendUrlWithParams(directUrl);
|
|
74
|
+
});
|
|
75
|
+
inlinedSources[sourceName] = { ...sourceJson,
|
|
76
|
+
type: 'vector',
|
|
77
|
+
tiles
|
|
78
|
+
};
|
|
79
|
+
}
|
|
76
80
|
}
|
|
77
81
|
|
|
78
82
|
return { ...vectorJson,
|
|
@@ -116,14 +120,13 @@ class TMSService extends _ems_service.AbstractEmsService {
|
|
|
116
120
|
}
|
|
117
121
|
|
|
118
122
|
async getUrlTemplateForVector(sourceId) {
|
|
119
|
-
|
|
123
|
+
var _tileJson$sources$sou, _tileJson$sources$sou2;
|
|
120
124
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
125
|
+
const tileJson = await this._getVectorStyleJsonInlined();
|
|
126
|
+
const url = tileJson === null || tileJson === void 0 ? void 0 : (_tileJson$sources$sou = tileJson.sources[sourceId]) === null || _tileJson$sources$sou === void 0 ? void 0 : (_tileJson$sources$sou2 = _tileJson$sources$sou.tiles) === null || _tileJson$sources$sou2 === void 0 ? void 0 : _tileJson$sources$sou2.pop();
|
|
124
127
|
|
|
125
|
-
if (
|
|
126
|
-
const directUrl = this._proxyPath + this._getAbsoluteUrl(
|
|
128
|
+
if (url) {
|
|
129
|
+
const directUrl = this._proxyPath + this._getAbsoluteUrl(url);
|
|
127
130
|
|
|
128
131
|
return this._emsClient.extendUrlWithParams(directUrl);
|
|
129
132
|
} else {
|
|
@@ -241,7 +244,7 @@ class TMSService extends _ems_service.AbstractEmsService {
|
|
|
241
244
|
async _getSpriteSheetRootPath() {
|
|
242
245
|
const vectorStyleJson = await this._getVectorStyleJsonRaw();
|
|
243
246
|
|
|
244
|
-
if (vectorStyleJson) {
|
|
247
|
+
if (vectorStyleJson !== null && vectorStyleJson !== void 0 && vectorStyleJson.sprite) {
|
|
245
248
|
return this._proxyPath + this._getAbsoluteUrl(vectorStyleJson.sprite);
|
|
246
249
|
} else {
|
|
247
250
|
return '';
|
|
@@ -251,7 +254,7 @@ class TMSService extends _ems_service.AbstractEmsService {
|
|
|
251
254
|
async _getUrlTemplateForGlyphs() {
|
|
252
255
|
const vectorStyleJson = await this._getVectorStyleJsonRaw();
|
|
253
256
|
|
|
254
|
-
if (vectorStyleJson) {
|
|
257
|
+
if (vectorStyleJson !== null && vectorStyleJson !== void 0 && vectorStyleJson.glyphs) {
|
|
255
258
|
return this._proxyPath + this._getAbsoluteUrl(vectorStyleJson.glyphs);
|
|
256
259
|
} else {
|
|
257
260
|
return '';
|
package/target/tms_service.d.ts
CHANGED
|
@@ -1,43 +1,23 @@
|
|
|
1
|
+
import { Style as MapLibreStyle, VectorSource as MapLibreVectorSource } from 'maplibre-gl';
|
|
1
2
|
import { EMSClient, TMSServiceConfig } from './ems_client';
|
|
2
3
|
import { AbstractEmsService } from './ems_service';
|
|
3
|
-
declare type
|
|
4
|
-
type: 'vector';
|
|
5
|
-
url: string;
|
|
6
|
-
tiles: string[];
|
|
7
|
-
bounds?: number[];
|
|
8
|
-
scheme?: 'xyz' | 'tms';
|
|
9
|
-
minzoom?: number;
|
|
10
|
-
maxzoom?: number;
|
|
11
|
-
attribution?: string;
|
|
12
|
-
};
|
|
13
|
-
declare type EmsVectorSources = {
|
|
14
|
-
[sourceName: string]: EmsVectorSource;
|
|
15
|
-
};
|
|
16
|
-
declare type EmsVectorStyle = {
|
|
17
|
-
sources: EmsVectorSources;
|
|
18
|
-
sprite: string;
|
|
19
|
-
glyphs: string;
|
|
20
|
-
bearing?: number;
|
|
21
|
-
center?: number[];
|
|
22
|
-
layers?: unknown[];
|
|
23
|
-
metadata?: unknown;
|
|
24
|
-
name?: string;
|
|
25
|
-
pitch?: number;
|
|
26
|
-
light?: unknown;
|
|
27
|
-
transition?: unknown;
|
|
28
|
-
version: number;
|
|
29
|
-
zoom?: number;
|
|
30
|
-
};
|
|
31
|
-
declare type EmsSprite = {
|
|
4
|
+
export declare type EmsSprite = {
|
|
32
5
|
height: number;
|
|
33
6
|
pixelRatio: number;
|
|
34
7
|
width: number;
|
|
35
8
|
x: number;
|
|
36
9
|
y: number;
|
|
10
|
+
sdf?: boolean;
|
|
37
11
|
};
|
|
38
|
-
declare type EmsSpriteSheet = {
|
|
12
|
+
export declare type EmsSpriteSheet = {
|
|
39
13
|
[spriteName: string]: EmsSprite;
|
|
40
14
|
};
|
|
15
|
+
declare type EmsVectorSources = {
|
|
16
|
+
[sourceName: string]: MapLibreVectorSource;
|
|
17
|
+
};
|
|
18
|
+
declare type EmsVectorStyle = MapLibreStyle & {
|
|
19
|
+
sources: EmsVectorSources;
|
|
20
|
+
};
|
|
41
21
|
declare type EmsRasterStyle = {
|
|
42
22
|
tilejson: string;
|
|
43
23
|
name: string;
|
package/target/web/ems_client.js
CHANGED
|
@@ -23,7 +23,7 @@ import semver from 'semver';
|
|
|
23
23
|
import { format as formatUrl, parse as parseUrl } from 'url';
|
|
24
24
|
import { toAbsoluteUrl } from './utils';
|
|
25
25
|
import LRUCache from 'lru-cache';
|
|
26
|
-
var DEFAULT_EMS_VERSION = '
|
|
26
|
+
var DEFAULT_EMS_VERSION = '8.2';
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* plugins cannot have upstream dependencies on core/*-kibana.
|
|
@@ -12,7 +12,6 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
12
12
|
* 2.0; you may not use this file except in compliance with the Elastic License
|
|
13
13
|
* 2.0.
|
|
14
14
|
*/
|
|
15
|
-
import { ORIGIN } from './origin';
|
|
16
15
|
import { toAbsoluteUrl } from './utils';
|
|
17
16
|
export var AbstractEmsService = /*#__PURE__*/function () {
|
|
18
17
|
function AbstractEmsService(config, emsClient, proxyPath) {
|
|
@@ -70,11 +69,6 @@ export var AbstractEmsService = /*#__PURE__*/function () {
|
|
|
70
69
|
|
|
71
70
|
return attributions.join('|');
|
|
72
71
|
}
|
|
73
|
-
}, {
|
|
74
|
-
key: "getOrigin",
|
|
75
|
-
value: function getOrigin() {
|
|
76
|
-
return ORIGIN.EMS;
|
|
77
|
-
}
|
|
78
72
|
/**
|
|
79
73
|
* Checks if url is absolute. If not, prepend the basePath.
|
|
80
74
|
*/
|
package/target/web/index.js
CHANGED
|
@@ -5,6 +5,5 @@
|
|
|
5
5
|
* 2.0.
|
|
6
6
|
*/
|
|
7
7
|
export { EMSClient, FileLayerField } from './ems_client';
|
|
8
|
-
export { ORIGIN } from './origin';
|
|
9
8
|
export { FileLayer } from './file_layer';
|
|
10
|
-
export { TMSService } from './tms_service';
|
|
9
|
+
export { TMSService, EmsSprite, EmsSpriteSheet } from './tms_service';
|
|
@@ -118,7 +118,7 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
|
118
118
|
}))));
|
|
119
119
|
|
|
120
120
|
_defineProperty(_assertThisInitialized(_this), "_getVectorStyleJsonInlined", _.once( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
|
|
121
|
-
var vectorJson, inlinedSources, sources, _iterator, _step, _sourceName, url, sourceUrl, extendedUrl, sourceJson,
|
|
121
|
+
var vectorJson, inlinedSources, sources, _iterator, _step, _sourceName, url, _sourceJson$tiles, sourceUrl, extendedUrl, sourceJson, tiles;
|
|
122
122
|
|
|
123
123
|
return regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
124
124
|
while (1) {
|
|
@@ -131,7 +131,7 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
|
131
131
|
vectorJson = _context3.sent;
|
|
132
132
|
|
|
133
133
|
if (!vectorJson) {
|
|
134
|
-
_context3.next =
|
|
134
|
+
_context3.next = 44;
|
|
135
135
|
break;
|
|
136
136
|
}
|
|
137
137
|
|
|
@@ -144,64 +144,70 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
|
144
144
|
|
|
145
145
|
case 9:
|
|
146
146
|
if ((_step = _iterator.n()).done) {
|
|
147
|
-
_context3.next =
|
|
147
|
+
_context3.next = 22;
|
|
148
148
|
break;
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
_sourceName = _step.value;
|
|
152
152
|
url = sources[_sourceName].url;
|
|
153
|
+
|
|
154
|
+
if (!url) {
|
|
155
|
+
_context3.next = 20;
|
|
156
|
+
break;
|
|
157
|
+
}
|
|
158
|
+
|
|
153
159
|
sourceUrl = _this._proxyPath + _this._getAbsoluteUrl(url);
|
|
154
160
|
extendedUrl = _this._emsClient.extendUrlWithParams(sourceUrl);
|
|
155
|
-
_context3.next =
|
|
161
|
+
_context3.next = 17;
|
|
156
162
|
return _this._emsClient.getManifest(extendedUrl);
|
|
157
163
|
|
|
158
|
-
case
|
|
164
|
+
case 17:
|
|
159
165
|
sourceJson = _context3.sent;
|
|
160
|
-
|
|
161
|
-
var
|
|
166
|
+
tiles = sourceJson === null || sourceJson === void 0 ? void 0 : (_sourceJson$tiles = sourceJson.tiles) === null || _sourceJson$tiles === void 0 ? void 0 : _sourceJson$tiles.map(function (tileUrl) {
|
|
167
|
+
var directUrl = _this._proxyPath + _this._getAbsoluteUrl(tileUrl);
|
|
162
168
|
|
|
163
|
-
return _this._emsClient.extendUrlWithParams(
|
|
169
|
+
return _this._emsClient.extendUrlWithParams(directUrl);
|
|
164
170
|
});
|
|
165
171
|
inlinedSources[_sourceName] = _objectSpread(_objectSpread({}, sourceJson), {}, {
|
|
166
172
|
type: 'vector',
|
|
167
|
-
tiles:
|
|
173
|
+
tiles: tiles
|
|
168
174
|
});
|
|
169
175
|
|
|
170
|
-
case
|
|
176
|
+
case 20:
|
|
171
177
|
_context3.next = 9;
|
|
172
178
|
break;
|
|
173
179
|
|
|
174
|
-
case
|
|
175
|
-
_context3.next =
|
|
180
|
+
case 22:
|
|
181
|
+
_context3.next = 27;
|
|
176
182
|
break;
|
|
177
183
|
|
|
178
|
-
case
|
|
179
|
-
_context3.prev =
|
|
184
|
+
case 24:
|
|
185
|
+
_context3.prev = 24;
|
|
180
186
|
_context3.t0 = _context3["catch"](7);
|
|
181
187
|
|
|
182
188
|
_iterator.e(_context3.t0);
|
|
183
189
|
|
|
184
|
-
case
|
|
185
|
-
_context3.prev =
|
|
190
|
+
case 27:
|
|
191
|
+
_context3.prev = 27;
|
|
186
192
|
|
|
187
193
|
_iterator.f();
|
|
188
194
|
|
|
189
|
-
return _context3.finish(
|
|
195
|
+
return _context3.finish(27);
|
|
190
196
|
|
|
191
|
-
case
|
|
197
|
+
case 30:
|
|
192
198
|
_context3.t1 = _objectSpread;
|
|
193
199
|
_context3.t2 = _objectSpread({}, vectorJson);
|
|
194
200
|
_context3.t3 = {};
|
|
195
201
|
_context3.t4 = inlinedSources;
|
|
196
|
-
_context3.next =
|
|
202
|
+
_context3.next = 36;
|
|
197
203
|
return _this._getSpriteSheetRootPath();
|
|
198
204
|
|
|
199
|
-
case
|
|
205
|
+
case 36:
|
|
200
206
|
_context3.t5 = _context3.sent;
|
|
201
|
-
_context3.next =
|
|
207
|
+
_context3.next = 39;
|
|
202
208
|
return _this._getUrlTemplateForGlyphs();
|
|
203
209
|
|
|
204
|
-
case
|
|
210
|
+
case 39:
|
|
205
211
|
_context3.t6 = _context3.sent;
|
|
206
212
|
_context3.t7 = {
|
|
207
213
|
sources: _context3.t4,
|
|
@@ -210,15 +216,15 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
|
210
216
|
};
|
|
211
217
|
return _context3.abrupt("return", (0, _context3.t1)(_context3.t2, _context3.t3, _context3.t7));
|
|
212
218
|
|
|
213
|
-
case
|
|
219
|
+
case 44:
|
|
214
220
|
return _context3.abrupt("return");
|
|
215
221
|
|
|
216
|
-
case
|
|
222
|
+
case 45:
|
|
217
223
|
case "end":
|
|
218
224
|
return _context3.stop();
|
|
219
225
|
}
|
|
220
226
|
}
|
|
221
|
-
}, _callee3, null, [[7,
|
|
227
|
+
}, _callee3, null, [[7, 24, 27, 30]]);
|
|
222
228
|
}))));
|
|
223
229
|
|
|
224
230
|
_this._config = config;
|
|
@@ -315,7 +321,9 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
|
315
321
|
key: "getUrlTemplateForVector",
|
|
316
322
|
value: function () {
|
|
317
323
|
var _getUrlTemplateForVector = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6(sourceId) {
|
|
318
|
-
var
|
|
324
|
+
var _tileJson$sources$sou, _tileJson$sources$sou2;
|
|
325
|
+
|
|
326
|
+
var tileJson, url, directUrl;
|
|
319
327
|
return regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
320
328
|
while (1) {
|
|
321
329
|
switch (_context6.prev = _context6.next) {
|
|
@@ -325,27 +333,20 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
|
325
333
|
|
|
326
334
|
case 2:
|
|
327
335
|
tileJson = _context6.sent;
|
|
336
|
+
url = tileJson === null || tileJson === void 0 ? void 0 : (_tileJson$sources$sou = tileJson.sources[sourceId]) === null || _tileJson$sources$sou === void 0 ? void 0 : (_tileJson$sources$sou2 = _tileJson$sources$sou.tiles) === null || _tileJson$sources$sou2 === void 0 ? void 0 : _tileJson$sources$sou2.pop();
|
|
328
337
|
|
|
329
|
-
if (
|
|
330
|
-
_context6.next =
|
|
338
|
+
if (!url) {
|
|
339
|
+
_context6.next = 9;
|
|
331
340
|
break;
|
|
332
341
|
}
|
|
333
342
|
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
case 5:
|
|
337
|
-
if (!(tileJson.sources[sourceId] && tileJson.sources[sourceId].tiles)) {
|
|
338
|
-
_context6.next = 10;
|
|
339
|
-
break;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
directUrl = this._proxyPath + this._getAbsoluteUrl(tileJson.sources[sourceId].tiles[0]);
|
|
343
|
+
directUrl = this._proxyPath + this._getAbsoluteUrl(url);
|
|
343
344
|
return _context6.abrupt("return", this._emsClient.extendUrlWithParams(directUrl));
|
|
344
345
|
|
|
345
|
-
case
|
|
346
|
+
case 9:
|
|
346
347
|
return _context6.abrupt("return", '');
|
|
347
348
|
|
|
348
|
-
case
|
|
349
|
+
case 10:
|
|
349
350
|
case "end":
|
|
350
351
|
return _context6.stop();
|
|
351
352
|
}
|
|
@@ -703,7 +704,7 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
|
703
704
|
case 2:
|
|
704
705
|
vectorStyleJson = _context14.sent;
|
|
705
706
|
|
|
706
|
-
if (!vectorStyleJson) {
|
|
707
|
+
if (!(vectorStyleJson !== null && vectorStyleJson !== void 0 && vectorStyleJson.sprite)) {
|
|
707
708
|
_context14.next = 7;
|
|
708
709
|
break;
|
|
709
710
|
}
|
|
@@ -742,7 +743,7 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
|
|
|
742
743
|
case 2:
|
|
743
744
|
vectorStyleJson = _context15.sent;
|
|
744
745
|
|
|
745
|
-
if (!vectorStyleJson) {
|
|
746
|
+
if (!(vectorStyleJson !== null && vectorStyleJson !== void 0 && vectorStyleJson.glyphs)) {
|
|
746
747
|
_context15.next = 7;
|
|
747
748
|
break;
|
|
748
749
|
}
|
package/test/ems_client.test.ts
CHANGED
|
@@ -431,8 +431,8 @@ it('should retrieve vectorstylesheet with all sources inlined)', async () => {
|
|
|
431
431
|
|
|
432
432
|
expect(styleSheet!.layers!.length).toBe(111);
|
|
433
433
|
expect(styleSheet!.sprite).toBe('https://tiles.foobar/styles/osm-bright/sprite');
|
|
434
|
-
expect(styleSheet!.sources!.openmaptiles!.tiles
|
|
435
|
-
expect(styleSheet!.sources!.openmaptiles!.tiles[0]).toBe(
|
|
434
|
+
expect(styleSheet!.sources!.openmaptiles!.tiles!.length).toBe(1);
|
|
435
|
+
expect(styleSheet!.sources!.openmaptiles!.tiles![0]).toBe(
|
|
436
436
|
'https://tiles.foobar/data/v3/{z}/{x}/{y}.pbf?elastic_tile_service_tos=agree&my_app_name=tester&my_app_version=7.x.x'
|
|
437
437
|
);
|
|
438
438
|
expect(styleSheet!.sources!.openmaptiles!.type).toBe('vector');
|
package/api-extractor.json
DELETED
|
@@ -1,364 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Config file for API Extractor. For more info, please visit: https://api-extractor.com
|
|
3
|
-
*/
|
|
4
|
-
{
|
|
5
|
-
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Optionally specifies another JSON config file that this file extends from. This provides a way for
|
|
9
|
-
* standard settings to be shared across multiple projects.
|
|
10
|
-
*
|
|
11
|
-
* If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains
|
|
12
|
-
* the "extends" field. Otherwise, the first path segment is interpreted as an NPM package name, and will be
|
|
13
|
-
* resolved using NodeJS require().
|
|
14
|
-
*
|
|
15
|
-
* SUPPORTED TOKENS: none
|
|
16
|
-
* DEFAULT VALUE: ""
|
|
17
|
-
*/
|
|
18
|
-
// "extends": "./shared/api-extractor-base.json"
|
|
19
|
-
// "extends": "my-package/include/api-extractor-base.json"
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Determines the "<projectFolder>" token that can be used with other config file settings. The project folder
|
|
23
|
-
* typically contains the tsconfig.json and package.json config files, but the path is user-defined.
|
|
24
|
-
*
|
|
25
|
-
* The path is resolved relative to the folder of the config file that contains the setting.
|
|
26
|
-
*
|
|
27
|
-
* The default value for "projectFolder" is the token "<lookup>", which means the folder is determined by traversing
|
|
28
|
-
* parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder
|
|
29
|
-
* that contains a tsconfig.json file. If a tsconfig.json file cannot be found in this way, then an error
|
|
30
|
-
* will be reported.
|
|
31
|
-
*
|
|
32
|
-
* SUPPORTED TOKENS: <lookup>
|
|
33
|
-
* DEFAULT VALUE: "<lookup>"
|
|
34
|
-
*/
|
|
35
|
-
// "projectFolder": "..",
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis. API Extractor
|
|
39
|
-
* analyzes the symbols exported by this module.
|
|
40
|
-
*
|
|
41
|
-
* The file extension must be ".d.ts" and not ".ts".
|
|
42
|
-
*
|
|
43
|
-
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
|
44
|
-
* prepend a folder token such as "<projectFolder>".
|
|
45
|
-
*
|
|
46
|
-
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
|
|
47
|
-
*/
|
|
48
|
-
"mainEntryPointFilePath": "<projectFolder>/target/index.d.ts",
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* A list of NPM package names whose exports should be treated as part of this package.
|
|
52
|
-
*
|
|
53
|
-
* For example, suppose that Webpack is used to generate a distributed bundle for the project "library1",
|
|
54
|
-
* and another NPM package "library2" is embedded in this bundle. Some types from library2 may become part
|
|
55
|
-
* of the exported API for library1, but by default API Extractor would generate a .d.ts rollup that explicitly
|
|
56
|
-
* imports library2. To avoid this, we can specify:
|
|
57
|
-
*
|
|
58
|
-
* "bundledPackages": [ "library2" ],
|
|
59
|
-
*
|
|
60
|
-
* This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been
|
|
61
|
-
* local files for library1.
|
|
62
|
-
*/
|
|
63
|
-
"bundledPackages": [],
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Determines how the TypeScript compiler engine will be invoked by API Extractor.
|
|
67
|
-
*/
|
|
68
|
-
"compiler": {
|
|
69
|
-
/**
|
|
70
|
-
* Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project.
|
|
71
|
-
*
|
|
72
|
-
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
|
73
|
-
* prepend a folder token such as "<projectFolder>".
|
|
74
|
-
*
|
|
75
|
-
* Note: This setting will be ignored if "overrideTsconfig" is used.
|
|
76
|
-
*
|
|
77
|
-
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
|
|
78
|
-
* DEFAULT VALUE: "<projectFolder>/tsconfig.json"
|
|
79
|
-
*/
|
|
80
|
-
// "tsconfigFilePath": "<projectFolder>/tsconfig.json",
|
|
81
|
-
/**
|
|
82
|
-
* Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk.
|
|
83
|
-
* The object must conform to the TypeScript tsconfig schema:
|
|
84
|
-
*
|
|
85
|
-
* http://json.schemastore.org/tsconfig
|
|
86
|
-
*
|
|
87
|
-
* If omitted, then the tsconfig.json file will be read from the "projectFolder".
|
|
88
|
-
*
|
|
89
|
-
* DEFAULT VALUE: no overrideTsconfig section
|
|
90
|
-
*/
|
|
91
|
-
// "overrideTsconfig": {
|
|
92
|
-
// . . .
|
|
93
|
-
// }
|
|
94
|
-
/**
|
|
95
|
-
* This option causes the compiler to be invoked with the --skipLibCheck option. This option is not recommended
|
|
96
|
-
* and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when
|
|
97
|
-
* dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses
|
|
98
|
-
* for its analysis. Where possible, the underlying issue should be fixed rather than relying on skipLibCheck.
|
|
99
|
-
*
|
|
100
|
-
* DEFAULT VALUE: false
|
|
101
|
-
*/
|
|
102
|
-
// "skipLibCheck": true,
|
|
103
|
-
},
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Configures how the API report file (*.api.md) will be generated.
|
|
107
|
-
*/
|
|
108
|
-
"apiReport": {
|
|
109
|
-
/**
|
|
110
|
-
* (REQUIRED) Whether to generate an API report.
|
|
111
|
-
*/
|
|
112
|
-
"enabled": true
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* The filename for the API report files. It will be combined with "reportFolder" or "reportTempFolder" to produce
|
|
116
|
-
* a full file path.
|
|
117
|
-
*
|
|
118
|
-
* The file extension should be ".api.md", and the string should not contain a path separator such as "\" or "/".
|
|
119
|
-
*
|
|
120
|
-
* SUPPORTED TOKENS: <packageName>, <unscopedPackageName>
|
|
121
|
-
* DEFAULT VALUE: "<unscopedPackageName>.api.md"
|
|
122
|
-
*/
|
|
123
|
-
// "reportFileName": "<unscopedPackageName>.api.md",
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Specifies the folder where the API report file is written. The file name portion is determined by
|
|
127
|
-
* the "reportFileName" setting.
|
|
128
|
-
*
|
|
129
|
-
* The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy,
|
|
130
|
-
* e.g. for an API review.
|
|
131
|
-
*
|
|
132
|
-
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
|
133
|
-
* prepend a folder token such as "<projectFolder>".
|
|
134
|
-
*
|
|
135
|
-
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
|
|
136
|
-
* DEFAULT VALUE: "<projectFolder>/etc/"
|
|
137
|
-
*/
|
|
138
|
-
// "reportFolder": "<projectFolder>/etc/",
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* Specifies the folder where the temporary report file is written. The file name portion is determined by
|
|
142
|
-
* the "reportFileName" setting.
|
|
143
|
-
*
|
|
144
|
-
* After the temporary file is written to disk, it is compared with the file in the "reportFolder".
|
|
145
|
-
* If they are different, a production build will fail.
|
|
146
|
-
*
|
|
147
|
-
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
|
148
|
-
* prepend a folder token such as "<projectFolder>".
|
|
149
|
-
*
|
|
150
|
-
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
|
|
151
|
-
* DEFAULT VALUE: "<projectFolder>/temp/"
|
|
152
|
-
*/
|
|
153
|
-
// "reportTempFolder": "<projectFolder>/temp/"
|
|
154
|
-
},
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* Configures how the doc model file (*.api.json) will be generated.
|
|
158
|
-
*/
|
|
159
|
-
"docModel": {
|
|
160
|
-
/**
|
|
161
|
-
* (REQUIRED) Whether to generate a doc model file.
|
|
162
|
-
*/
|
|
163
|
-
"enabled": true
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* The output path for the doc model file. The file extension should be ".api.json".
|
|
167
|
-
*
|
|
168
|
-
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
|
169
|
-
* prepend a folder token such as "<projectFolder>".
|
|
170
|
-
*
|
|
171
|
-
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
|
|
172
|
-
* DEFAULT VALUE: "<projectFolder>/temp/<unscopedPackageName>.api.json"
|
|
173
|
-
*/
|
|
174
|
-
// "apiJsonFilePath": "<projectFolder>/temp/<unscopedPackageName>.api.json"
|
|
175
|
-
},
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* Configures how the .d.ts rollup file will be generated.
|
|
179
|
-
*/
|
|
180
|
-
"dtsRollup": {
|
|
181
|
-
/**
|
|
182
|
-
* (REQUIRED) Whether to generate the .d.ts rollup file.
|
|
183
|
-
*/
|
|
184
|
-
"enabled": true
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
* Specifies the output path for a .d.ts rollup file to be generated without any trimming.
|
|
188
|
-
* This file will include all declarations that are exported by the main entry point.
|
|
189
|
-
*
|
|
190
|
-
* If the path is an empty string, then this file will not be written.
|
|
191
|
-
*
|
|
192
|
-
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
|
193
|
-
* prepend a folder token such as "<projectFolder>".
|
|
194
|
-
*
|
|
195
|
-
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
|
|
196
|
-
* DEFAULT VALUE: "<projectFolder>/dist/<unscopedPackageName>.d.ts"
|
|
197
|
-
*/
|
|
198
|
-
// "untrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>.d.ts",
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release.
|
|
202
|
-
* This file will include only declarations that are marked as "@public" or "@beta".
|
|
203
|
-
*
|
|
204
|
-
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
|
205
|
-
* prepend a folder token such as "<projectFolder>".
|
|
206
|
-
*
|
|
207
|
-
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
|
|
208
|
-
* DEFAULT VALUE: ""
|
|
209
|
-
*/
|
|
210
|
-
// "betaTrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>-beta.d.ts",
|
|
211
|
-
|
|
212
|
-
/**
|
|
213
|
-
* Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release.
|
|
214
|
-
* This file will include only declarations that are marked as "@public".
|
|
215
|
-
*
|
|
216
|
-
* If the path is an empty string, then this file will not be written.
|
|
217
|
-
*
|
|
218
|
-
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
|
219
|
-
* prepend a folder token such as "<projectFolder>".
|
|
220
|
-
*
|
|
221
|
-
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
|
|
222
|
-
* DEFAULT VALUE: ""
|
|
223
|
-
*/
|
|
224
|
-
// "publicTrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>-public.d.ts",
|
|
225
|
-
|
|
226
|
-
/**
|
|
227
|
-
* When a declaration is trimmed, by default it will be replaced by a code comment such as
|
|
228
|
-
* "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the
|
|
229
|
-
* declaration completely.
|
|
230
|
-
*
|
|
231
|
-
* DEFAULT VALUE: false
|
|
232
|
-
*/
|
|
233
|
-
// "omitTrimmingComments": true
|
|
234
|
-
},
|
|
235
|
-
|
|
236
|
-
/**
|
|
237
|
-
* Configures how the tsdoc-metadata.json file will be generated.
|
|
238
|
-
*/
|
|
239
|
-
"tsdocMetadata": {
|
|
240
|
-
/**
|
|
241
|
-
* Whether to generate the tsdoc-metadata.json file.
|
|
242
|
-
*
|
|
243
|
-
* DEFAULT VALUE: true
|
|
244
|
-
*/
|
|
245
|
-
// "enabled": true,
|
|
246
|
-
/**
|
|
247
|
-
* Specifies where the TSDoc metadata file should be written.
|
|
248
|
-
*
|
|
249
|
-
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
|
250
|
-
* prepend a folder token such as "<projectFolder>".
|
|
251
|
-
*
|
|
252
|
-
* The default value is "<lookup>", which causes the path to be automatically inferred from the "tsdocMetadata",
|
|
253
|
-
* "typings" or "main" fields of the project's package.json. If none of these fields are set, the lookup
|
|
254
|
-
* falls back to "tsdoc-metadata.json" in the package folder.
|
|
255
|
-
*
|
|
256
|
-
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
|
|
257
|
-
* DEFAULT VALUE: "<lookup>"
|
|
258
|
-
*/
|
|
259
|
-
// "tsdocMetadataFilePath": "<projectFolder>/dist/tsdoc-metadata.json"
|
|
260
|
-
},
|
|
261
|
-
|
|
262
|
-
/**
|
|
263
|
-
* Specifies what type of newlines API Extractor should use when writing output files. By default, the output files
|
|
264
|
-
* will be written with Windows-style newlines. To use POSIX-style newlines, specify "lf" instead.
|
|
265
|
-
* To use the OS's default newline kind, specify "os".
|
|
266
|
-
*
|
|
267
|
-
* DEFAULT VALUE: "crlf"
|
|
268
|
-
*/
|
|
269
|
-
// "newlineKind": "crlf",
|
|
270
|
-
|
|
271
|
-
/**
|
|
272
|
-
* Configures how API Extractor reports error and warning messages produced during analysis.
|
|
273
|
-
*
|
|
274
|
-
* There are three sources of messages: compiler messages, API Extractor messages, and TSDoc messages.
|
|
275
|
-
*/
|
|
276
|
-
"messages": {
|
|
277
|
-
/**
|
|
278
|
-
* Configures handling of diagnostic messages reported by the TypeScript compiler engine while analyzing
|
|
279
|
-
* the input .d.ts files.
|
|
280
|
-
*
|
|
281
|
-
* TypeScript message identifiers start with "TS" followed by an integer. For example: "TS2551"
|
|
282
|
-
*
|
|
283
|
-
* DEFAULT VALUE: A single "default" entry with logLevel=warning.
|
|
284
|
-
*/
|
|
285
|
-
"compilerMessageReporting": {
|
|
286
|
-
/**
|
|
287
|
-
* Configures the default routing for messages that don't match an explicit rule in this table.
|
|
288
|
-
*/
|
|
289
|
-
"default": {
|
|
290
|
-
/**
|
|
291
|
-
* Specifies whether the message should be written to the the tool's output log. Note that
|
|
292
|
-
* the "addToApiReportFile" property may supersede this option.
|
|
293
|
-
*
|
|
294
|
-
* Possible values: "error", "warning", "none"
|
|
295
|
-
*
|
|
296
|
-
* Errors cause the build to fail and return a nonzero exit code. Warnings cause a production build fail
|
|
297
|
-
* and return a nonzero exit code. For a non-production build (e.g. when "api-extractor run" includes
|
|
298
|
-
* the "--local" option), the warning is displayed but the build will not fail.
|
|
299
|
-
*
|
|
300
|
-
* DEFAULT VALUE: "warning"
|
|
301
|
-
*/
|
|
302
|
-
"logLevel": "warning"
|
|
303
|
-
|
|
304
|
-
/**
|
|
305
|
-
* When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md),
|
|
306
|
-
* then the message will be written inside that file; otherwise, the message is instead logged according to
|
|
307
|
-
* the "logLevel" option.
|
|
308
|
-
*
|
|
309
|
-
* DEFAULT VALUE: false
|
|
310
|
-
*/
|
|
311
|
-
// "addToApiReportFile": false
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
// "TS2551": {
|
|
315
|
-
// "logLevel": "warning",
|
|
316
|
-
// "addToApiReportFile": true
|
|
317
|
-
// },
|
|
318
|
-
//
|
|
319
|
-
// . . .
|
|
320
|
-
},
|
|
321
|
-
|
|
322
|
-
/**
|
|
323
|
-
* Configures handling of messages reported by API Extractor during its analysis.
|
|
324
|
-
*
|
|
325
|
-
* API Extractor message identifiers start with "ae-". For example: "ae-extra-release-tag"
|
|
326
|
-
*
|
|
327
|
-
* DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings
|
|
328
|
-
*/
|
|
329
|
-
"extractorMessageReporting": {
|
|
330
|
-
"default": {
|
|
331
|
-
"logLevel": "warning"
|
|
332
|
-
// "addToApiReportFile": false
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
// "ae-extra-release-tag": {
|
|
336
|
-
// "logLevel": "warning",
|
|
337
|
-
// "addToApiReportFile": true
|
|
338
|
-
// },
|
|
339
|
-
//
|
|
340
|
-
// . . .
|
|
341
|
-
},
|
|
342
|
-
|
|
343
|
-
/**
|
|
344
|
-
* Configures handling of messages reported by the TSDoc parser when analyzing code comments.
|
|
345
|
-
*
|
|
346
|
-
* TSDoc message identifiers start with "tsdoc-". For example: "tsdoc-link-tag-unescaped-text"
|
|
347
|
-
*
|
|
348
|
-
* DEFAULT VALUE: A single "default" entry with logLevel=warning.
|
|
349
|
-
*/
|
|
350
|
-
"tsdocMessageReporting": {
|
|
351
|
-
"default": {
|
|
352
|
-
"logLevel": "warning"
|
|
353
|
-
// "addToApiReportFile": false
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
// "tsdoc-link-tag-unescaped-text": {
|
|
357
|
-
// "logLevel": "warning",
|
|
358
|
-
// "addToApiReportFile": true
|
|
359
|
-
// },
|
|
360
|
-
//
|
|
361
|
-
// . . .
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
}
|
package/etc/ems-client.api.md
DELETED
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
## API Report File for "@elastic/ems-client"
|
|
2
|
-
|
|
3
|
-
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
-
|
|
5
|
-
```ts
|
|
6
|
-
|
|
7
|
-
// @public (undocumented)
|
|
8
|
-
export class EMSClient {
|
|
9
|
-
// Warning: (ae-forgotten-export) The symbol "ClientConfig" needs to be exported by the entry point index.d.ts
|
|
10
|
-
// Warning: (ae-forgotten-export) The symbol "DeprecatedClientConfig" needs to be exported by the entry point index.d.ts
|
|
11
|
-
constructor(config: ClientConfig | DeprecatedClientConfig);
|
|
12
|
-
addQueryParams(additionalQueryParams: {
|
|
13
|
-
[key: string]: string;
|
|
14
|
-
}): void;
|
|
15
|
-
// (undocumented)
|
|
16
|
-
readonly EMS_LOAD_TIMEOUT = 32000;
|
|
17
|
-
// (undocumented)
|
|
18
|
-
extendUrlWithParams(url: string): string;
|
|
19
|
-
// (undocumented)
|
|
20
|
-
findFileLayerById(id: string): Promise<FileLayer | undefined>;
|
|
21
|
-
// (undocumented)
|
|
22
|
-
findTMSServiceById(id: string): Promise<TMSService | undefined>;
|
|
23
|
-
// Warning: (ae-forgotten-export) The symbol "EmsFileCatalog" needs to be exported by the entry point index.d.ts
|
|
24
|
-
//
|
|
25
|
-
// (undocumented)
|
|
26
|
-
getDefaultFileManifest(): Promise<EmsFileCatalog>;
|
|
27
|
-
// (undocumented)
|
|
28
|
-
getDefaultLocale(): string;
|
|
29
|
-
// Warning: (ae-forgotten-export) The symbol "EmsTmsCatalog" needs to be exported by the entry point index.d.ts
|
|
30
|
-
//
|
|
31
|
-
// (undocumented)
|
|
32
|
-
getDefaultTMSManifest(): Promise<EmsTmsCatalog>;
|
|
33
|
-
// (undocumented)
|
|
34
|
-
getFileApiUrl(): string;
|
|
35
|
-
// (undocumented)
|
|
36
|
-
getFileLayers(): Promise<FileLayer[]>;
|
|
37
|
-
// (undocumented)
|
|
38
|
-
getLandingPageUrl(): string;
|
|
39
|
-
// (undocumented)
|
|
40
|
-
getLocale(): string;
|
|
41
|
-
// Warning: (ae-forgotten-export) The symbol "EmsCatalogManifest" needs to be exported by the entry point index.d.ts
|
|
42
|
-
//
|
|
43
|
-
// (undocumented)
|
|
44
|
-
getMainManifest(): Promise<EmsCatalogManifest>;
|
|
45
|
-
getManifest<T>(manifestUrl: string): Promise<T>;
|
|
46
|
-
// (undocumented)
|
|
47
|
-
getTileApiUrl(): string;
|
|
48
|
-
// (undocumented)
|
|
49
|
-
getTMSServices(): Promise<TMSService[]>;
|
|
50
|
-
// (undocumented)
|
|
51
|
-
getValueInLanguage(i18nObject: {
|
|
52
|
-
[language: string]: string;
|
|
53
|
-
}): string;
|
|
54
|
-
// (undocumented)
|
|
55
|
-
sanitizeHtml(html: string): string;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// Warning: (ae-forgotten-export) The symbol "AbstractEmsService" needs to be exported by the entry point index.d.ts
|
|
59
|
-
//
|
|
60
|
-
// @public (undocumented)
|
|
61
|
-
export class FileLayer extends AbstractEmsService {
|
|
62
|
-
constructor(config: FileLayerConfig, emsClient: EMSClient, proxyPath: string);
|
|
63
|
-
// Warning: (ae-forgotten-export) The symbol "FileLayerConfig" needs to be exported by the entry point index.d.ts
|
|
64
|
-
//
|
|
65
|
-
// (undocumented)
|
|
66
|
-
protected readonly _config: FileLayerConfig;
|
|
67
|
-
// (undocumented)
|
|
68
|
-
getApiUrl(): string;
|
|
69
|
-
// (undocumented)
|
|
70
|
-
getCreatedAt(): string;
|
|
71
|
-
// (undocumented)
|
|
72
|
-
getDefaultFormatMeta(): {
|
|
73
|
-
[key: string]: string;
|
|
74
|
-
} | undefined;
|
|
75
|
-
// (undocumented)
|
|
76
|
-
getDefaultFormatType(): string;
|
|
77
|
-
// (undocumented)
|
|
78
|
-
getDefaultFormatUrl(): string;
|
|
79
|
-
// (undocumented)
|
|
80
|
-
getDisplayName(): string;
|
|
81
|
-
// (undocumented)
|
|
82
|
-
getEMSHotLink(): string;
|
|
83
|
-
// (undocumented)
|
|
84
|
-
getFields(): FileLayerConfig['fields'];
|
|
85
|
-
// (undocumented)
|
|
86
|
-
getFieldsInLanguage(): {
|
|
87
|
-
type: string;
|
|
88
|
-
name: string;
|
|
89
|
-
description: string;
|
|
90
|
-
}[];
|
|
91
|
-
// (undocumented)
|
|
92
|
-
getId(): string;
|
|
93
|
-
// (undocumented)
|
|
94
|
-
hasId(id: string): boolean;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
// @public (undocumented)
|
|
98
|
-
export const ORIGIN: {
|
|
99
|
-
EMS: string;
|
|
100
|
-
KIBANA_YML: string;
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
// @public (undocumented)
|
|
104
|
-
export class TMSService extends AbstractEmsService {
|
|
105
|
-
constructor(config: TMSServiceConfig, emsClient: EMSClient, proxyPath: string);
|
|
106
|
-
// Warning: (ae-forgotten-export) The symbol "TMSServiceConfig" needs to be exported by the entry point index.d.ts
|
|
107
|
-
//
|
|
108
|
-
// (undocumented)
|
|
109
|
-
protected readonly _config: TMSServiceConfig;
|
|
110
|
-
// (undocumented)
|
|
111
|
-
getApiUrl(): string;
|
|
112
|
-
// Warning: (ae-forgotten-export) The symbol "EmsRasterStyle" needs to be exported by the entry point index.d.ts
|
|
113
|
-
//
|
|
114
|
-
// (undocumented)
|
|
115
|
-
getDefaultRasterStyle(): Promise<EmsRasterStyle | undefined>;
|
|
116
|
-
// (undocumented)
|
|
117
|
-
getDisplayName(): string;
|
|
118
|
-
// (undocumented)
|
|
119
|
-
getId(): string;
|
|
120
|
-
// (undocumented)
|
|
121
|
-
getMaxZoom(): Promise<number | undefined>;
|
|
122
|
-
// (undocumented)
|
|
123
|
-
getMinZoom(): Promise<number | undefined>;
|
|
124
|
-
// (undocumented)
|
|
125
|
-
getSpriteSheetJsonPath(isRetina?: boolean): Promise<string>;
|
|
126
|
-
// (undocumented)
|
|
127
|
-
getSpriteSheetMeta(isRetina?: boolean): Promise<{
|
|
128
|
-
png: string;
|
|
129
|
-
json: EmsSpriteSheet;
|
|
130
|
-
} | undefined>;
|
|
131
|
-
// (undocumented)
|
|
132
|
-
getSpriteSheetPngPath(isRetina?: boolean): Promise<string>;
|
|
133
|
-
// (undocumented)
|
|
134
|
-
getUrlTemplate(): Promise<string>;
|
|
135
|
-
// (undocumented)
|
|
136
|
-
getUrlTemplateForVector(sourceId: string): Promise<string>;
|
|
137
|
-
// Warning: (ae-forgotten-export) The symbol "EmsVectorStyle" needs to be exported by the entry point index.d.ts
|
|
138
|
-
//
|
|
139
|
-
// (undocumented)
|
|
140
|
-
getVectorStyleSheet(): Promise<EmsVectorStyle | undefined>;
|
|
141
|
-
// (undocumented)
|
|
142
|
-
getVectorStyleSheetRaw(): Promise<EmsVectorStyle | undefined>;
|
|
143
|
-
// (undocumented)
|
|
144
|
-
hasId(id: string): boolean;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
// Warnings were encountered during analysis:
|
|
149
|
-
//
|
|
150
|
-
// target/tms_service.d.ts:66:9 - (ae-forgotten-export) The symbol "EmsSpriteSheet" needs to be exported by the entry point index.d.ts
|
|
151
|
-
|
|
152
|
-
// (No @packageDocumentation comment for this package)
|
|
153
|
-
|
|
154
|
-
```
|
package/src/origin.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
-
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
-
* 2.0; you may not use this file except in compliance with the Elastic License
|
|
5
|
-
* 2.0.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
export const ORIGIN = {
|
|
9
|
-
EMS: 'elastic_maps_service',
|
|
10
|
-
KIBANA_YML: 'self_hosted',
|
|
11
|
-
};
|
package/target/node/origin.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.ORIGIN = void 0;
|
|
7
|
-
|
|
8
|
-
/*
|
|
9
|
-
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
10
|
-
* or more contributor license agreements. Licensed under the Elastic License
|
|
11
|
-
* 2.0; you may not use this file except in compliance with the Elastic License
|
|
12
|
-
* 2.0.
|
|
13
|
-
*/
|
|
14
|
-
const ORIGIN = {
|
|
15
|
-
EMS: 'elastic_maps_service',
|
|
16
|
-
KIBANA_YML: 'self_hosted'
|
|
17
|
-
};
|
|
18
|
-
exports.ORIGIN = ORIGIN;
|
package/target/origin.d.ts
DELETED
package/target/web/origin.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
-
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
-
* 2.0; you may not use this file except in compliance with the Elastic License
|
|
5
|
-
* 2.0.
|
|
6
|
-
*/
|
|
7
|
-
export var ORIGIN = {
|
|
8
|
-
EMS: 'elastic_maps_service',
|
|
9
|
-
KIBANA_YML: 'self_hosted'
|
|
10
|
-
};
|