@elastic/ems-client 8.5.3 → 8.6.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 CHANGED
@@ -1,16 +1,10 @@
1
1
  {
2
- "upstream": "elastic/ems-client",
3
- "branches": [
4
- {
5
- "name": "8.4",
6
- "checked": true
7
- },
8
- {
9
- "name": "7.17",
10
- "checked": true
11
- }
12
- ],
13
- "labels": [
14
- "backport"
15
- ]
16
- }
2
+ "repoOwner": "elastic",
3
+ "repoName": "ems-file-service",
4
+ "targetBranches": ["7.17"],
5
+ "targetPRLabels": ["backport"],
6
+ "commitConflicts": true,
7
+ "autoMerge": true,
8
+ "autoMergeMethod": "squash",
9
+ "fork": false
10
+ }
@@ -46,7 +46,7 @@ const main = async function () {
46
46
  const emsClientPackageJson = JSON.parse(fs.readFileSync('package.json'));
47
47
  const emsClientDeps = {
48
48
  ...emsClientPackageJson['dependencies'],
49
- ...emsClientPackageJson['devDependencies']
49
+ // ...emsClientPackageJson['devDependencies']
50
50
  };
51
51
 
52
52
  console.log(`ems-client@${emsClientPackageJson['version']}`);
@@ -1,5 +1,5 @@
1
1
  agents:
2
- image: "docker.elastic.co/ci-agent-images/ems/buildkite-agent-node20:0.4"
2
+ image: "docker.elastic.co/ci-agent-images/ems/buildkite-agent-node20:0.5@sha256:01d63c1c1e9895e410a8b50c0eb0ce8e986c354085a11ed1d00355a12935ac5e"
3
3
  cpu: "2"
4
4
  memory: "2G"
5
5
 
@@ -0,0 +1,24 @@
1
+ name: Automatic backport action
2
+
3
+ on:
4
+ pull_request_target:
5
+ types: ["labeled", "closed"]
6
+
7
+ jobs:
8
+ backport:
9
+ name: Backport PR
10
+ if: github.event.pull_request.merged == true && !(contains(github.event.pull_request.labels.*.name, 'backport'))
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - name: Backport Action
14
+ uses: sorenlouv/backport-github-action@ad888e978060bc1b2798690dd9d03c4036560947 # v9.5.1
15
+ with:
16
+ github_token: ${{ secrets.GITHUB_TOKEN }}
17
+
18
+ - name: Info log
19
+ if: ${{ success() }}
20
+ run: cat ~/.backport/backport.info.log
21
+
22
+ - name: Debug log
23
+ if: ${{ failure() }}
24
+ run: cat ~/.backport/backport.debug.log
package/CHANGELOG.md CHANGED
@@ -3,18 +3,23 @@ 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
- ## [8.5.3] - 2024-07-10
6
+ ## [8.6.0] - 2024-12-13
7
+ ### Added
8
+ - Include color options for new EMS styles #478
9
+
10
+ ### Changed
11
+ - Dependencies reorganization and validation against Kibana #289
12
+ - Update dependencies (search PRs for `is:pr label:8.5.4,dependencies`)
7
13
 
14
+ ## [8.5.3] - 2024-07-10
8
15
  ### Changed
9
16
  - Update dependencies #242
10
17
 
11
18
  ## [8.5.2] - 2024-07-05
12
-
13
19
  ## Changed
14
20
  - Update dependencies #232 #233 #234 #235
15
21
 
16
22
  ## [8.5.1] - 2023-11-09
17
-
18
23
  ### Added
19
24
  - Add a new `getEmsVersion` method #204
20
25
  - Include OpenAPI specification #196 #197
@@ -26,83 +31,70 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
26
31
  - Migration to Node 20 #208
27
32
 
28
33
  ## [8.5.0] - 2023-08-23
29
-
30
34
  - Migration from Jenkins to Buildkite for automatic testing #145 #147
31
35
  - Detached the releases of EMS Client from the services consumed #185
32
36
  - Updated the client to support date based versions #185
33
37
  - Update dependencies #159 #165 #173 #176 #181 #184
34
38
 
35
39
  ## [8.4.0] - 2023-01-11
36
-
37
40
  - Default EMS version is 8.4
38
41
  - Add types to colorOperationDefaults #123
39
42
  - Update dependencies #131 #133 #134 #138
40
43
 
41
44
  ## [8.3.3] - 2022-05-24
42
-
43
45
  - Make percentage an optional parameter #117
44
46
  - Make color and operation optional parameters #118
45
47
 
46
48
  ## [8.3.2] - 2022-05-16
47
-
48
49
  - Export `blendMode` type #111
49
50
  - Fix transforming color definitions with stops #112
50
51
 
51
52
  ## [8.3.1] - 2022-05-06
52
-
53
53
  - Added static methods to help translating basemap labels and blending colors to paint properties #105
54
54
  - Add optional `format` argument to `getMinZoom` and `getMaxZoom` #90
55
55
 
56
56
  ## [8.3.0] - 2022-04-18
57
-
58
57
  ### Changed
59
58
  - Default EMS version is 8.3 #104
60
59
  - Bump maplibre-gl to 2.1.9 #103
61
60
 
62
61
  ## [8.2.0] - 2022-03-24
63
-
64
62
  ### Changed
65
63
  - Default EMS version is 8.2
66
64
  - Removed getOrigin method #91
67
65
 
68
66
  ## [8.1.0] - 2021-11-09
69
-
70
67
  ### Changed
71
68
  - Default EMS version is 8.1
72
69
  - Export EmsSprite and EmsSpritesheet types
73
70
  - Inherit types from maplibre-gl
74
71
 
75
72
  ## [8.0.0] - 2021-10-20
76
-
77
73
  ### Changed
78
74
  - Default EMS version is 8.0
79
75
  - Remove unused API descriptors
80
76
 
81
77
  ## [7.16.0] - 2021-10-13
82
-
83
78
  ### Changed
84
79
  - Default EMS version is 7.16
85
80
  - Update dependencies using `yarn upgrade`
86
81
  - Better error handling for HTTP responses
87
82
 
88
83
  ## [7.15.1] - 2021-09-01
89
-
90
84
  ### Changed
91
85
  - Unpinned `semver` dependency [#77](https://github.com/elastic/ems-client/pull/77)
92
86
 
93
87
  ## [7.15.0] - 2021-08-12
94
-
95
88
  ### Changed
96
89
  - Default EMS version is 7.15
97
90
  - Updated dependencies via `yarn upgrade`
98
91
  - Fix linting issues
92
+
99
93
  ## [7.14.0] - 2021-06-15
100
94
  ### Added
101
-
102
95
  - New getters for optional field metadata `alias`, `regex`, and `values` #69
103
96
 
104
97
  ### Changed
105
-
106
98
  - Default EMS version is 7.14
107
99
  - **Breaking change** @elastic/ems-client is now licensed under the Elastic License v2. See the LICENSE.txt file in this repository #64
108
100
 
@@ -116,7 +108,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
116
108
  - Updated dependencies using `yarn upgrade` and #44 #50
117
109
  - Add functions to get specific file formats #53
118
110
 
119
-
120
111
  ## [7.10.0] - 2020-08-17
121
112
  ### Changed
122
113
  - Default EMS version is 7.10
@@ -143,7 +134,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
143
134
  - Convert source code to Typescript
144
135
  - Added better linting with eslint and prettier
145
136
 
146
-
147
137
  ## [7.8.1] - 2020-04-06
148
138
  ### Fixed
149
139
  - Correctly handle API urls that end in slashes
@@ -178,14 +168,11 @@ always needed and in fact breaks some client-side use of this lib
178
168
  - Correctly handle API urls that end in slashes
179
169
 
180
170
  ## [7.6.0] - 2020-01-13
181
-
182
171
  ### Added
183
172
  - Two new parameters were introduced, `tileApiUrl` and `fileApiUrl`. These should be used instead of `manifestServiceUrl`. These parameters should be set to their respective domains (e.g. `https://tiles.maps.elastic.co`, `https://vector.maps.elastic.co`). [#13](https://github.com/elastic/ems-client/pull/13)
184
173
 
185
174
  ### Changed
186
-
187
175
  - Starting with v7.6, new Elastic Maps Service (EMS) versions will be released with every matching major and minor release of the Elastic Stack. New releases of ems-client will also be released to match the EMS versions.
188
-
189
176
  - Handle relative URLs in EMS v7.6 manifests.
190
177
 
191
178
  ### Deprecated
@@ -207,7 +194,6 @@ Bump version to match the corresponding Elastic Maps Service version. This relea
207
194
  ### Fixed
208
195
  - Update browser entry point that was pointing to an incorrect path, which fell back to the main entry
209
196
 
210
-
211
197
  ## [1.0.2] - 2019-10-15
212
198
 
213
199
  ### Fixed
@@ -219,5 +205,4 @@ Bump version to match the corresponding Elastic Maps Service version. This relea
219
205
  - Downgrade node-fetch dependency to fix fetch error
220
206
 
221
207
  ## [1.0.0] - 2019-08-26
222
-
223
208
  - Initial release. Compatible with Elastic Maps Service v7.2.0.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elastic/ems-client",
3
- "version": "8.5.3",
3
+ "version": "8.6.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",
@@ -31,45 +31,46 @@
31
31
  },
32
32
  "homepage": "https://github.com/elastic/ems-client#readme",
33
33
  "dependencies": {
34
- "@types/geojson": "^7946.0.14",
35
- "@types/topojson-client": "^3.1.4",
36
- "@types/topojson-specification": "^1.0.5",
37
- "chroma-js": "^2.1.0",
34
+ "@types/geojson": "7946.0.15",
35
+ "@types/topojson-client": "3.1.5",
36
+ "chroma-js": "^2.6.0",
38
37
  "lodash": "^4.17.21",
39
38
  "lru-cache": "^4.1.5",
40
- "semver": "^7.6.2",
39
+ "maplibre-gl": "3.1.0",
40
+ "node-fetch": "2.7.0",
41
+ "semver": "^7.6.3",
41
42
  "topojson-client": "^3.1.0"
42
43
  },
43
44
  "devDependencies": {
44
- "@babel/cli": "^7.6.4",
45
- "@babel/core": "^7.5.5",
46
- "@babel/plugin-proposal-class-properties": "^7.5.5",
47
- "@babel/preset-env": "^7.5.5",
48
- "@babel/preset-typescript": "^7.9.0",
49
- "@eslint/js": "^9.3.0",
50
- "@types/chroma-js": "^2.1.3",
51
- "@types/eslint__js": "^8.42.3",
52
- "@types/jest": "^29.5.12",
53
- "@types/lodash": "^4.14.150",
54
- "@types/lru-cache": "^5.1.0",
55
- "@types/node": "^20.12.13",
56
- "@types/node-fetch": "^2.5.7",
57
- "@types/semver": "^7.1.0",
58
- "@typescript-eslint/eslint-plugin": "^7.11.0",
59
- "@typescript-eslint/parser": "^7.11.0",
60
- "babel-jest": "^29.7.0",
61
- "eslint": "^9.3.0",
62
- "eslint-config-prettier": "^9.1.0",
63
- "eslint-plugin-prettier": "^5.1.3",
64
- "globals": "^15.3.0",
65
- "husky": "^9.0.11",
66
- "jest": "^29.7.0",
67
- "maplibre-gl": "3.1.0",
68
- "node-fetch": "^2.7.0",
69
- "prettier": "^3.2.5",
70
- "ts-jest": "^29.1.4",
71
- "typescript": "^5.4.5",
72
- "typescript-eslint": "^7.11.0"
45
+ "@babel/cli": "7.26.4",
46
+ "@babel/core": "7.26.0",
47
+ "@babel/plugin-proposal-class-properties": "7.18.6",
48
+ "@babel/preset-env": "7.26.0",
49
+ "@babel/preset-typescript": "7.26.0",
50
+ "@eslint/core": "0.9.1",
51
+ "@eslint/js": "9.17.0",
52
+ "@types/chroma-js": "2.4.5",
53
+ "@types/eslint__js": "8.42.3",
54
+ "@types/jest": "29.5.14",
55
+ "@types/lodash": "4.17.13",
56
+ "@types/lru-cache": "5.1.1",
57
+ "@types/node": "20.17.10",
58
+ "@types/node-fetch": "2.6.12",
59
+ "@types/semver": "7.5.8",
60
+ "@types/topojson-specification": "1.0.5",
61
+ "@typescript-eslint/eslint-plugin": "8.18.1",
62
+ "@typescript-eslint/parser": "8.18.1",
63
+ "babel-jest": "29.7.0",
64
+ "eslint": "9.17.0",
65
+ "eslint-config-prettier": "9.1.0",
66
+ "eslint-plugin-prettier": "5.2.1",
67
+ "globals": "15.14.0",
68
+ "husky": "9.1.7",
69
+ "jest": "29.7.0",
70
+ "prettier": "3.4.2",
71
+ "ts-jest": "29.2.5",
72
+ "typescript": "5.7.2",
73
+ "typescript-eslint": "8.18.1"
73
74
  },
74
75
  "engines": {
75
76
  "node": ">=18 <=20"
package/renovate.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3
+ "extends": [
4
+ "local>elastic/renovate-config"
5
+ ],
6
+ "labels": [
7
+ "dependencies",
8
+ "v7.17.4",
9
+ "v8.6.0"
10
+ ],
11
+ "packageRules": [
12
+ {
13
+ "matchUpdateTypes": ["minor", "patch"],
14
+ "automerge": true
15
+ },
16
+ {
17
+ "matchDepTypes": ["devDependencies"],
18
+ "automerge": true
19
+ }
20
+ ]
21
+ }
package/src/ems_client.ts CHANGED
@@ -19,6 +19,7 @@ import { format as formatUrl, parse as parseUrl, UrlObject } from 'url';
19
19
  import { toAbsoluteUrl } from './utils';
20
20
  import { ParsedUrlQueryInput } from 'querystring';
21
21
  import LRUCache from 'lru-cache';
22
+ import { RequestInfo } from 'node-fetch';
22
23
 
23
24
  const REST_API_REGEX = /\d{4}-\d{2}-\d{2}/;
24
25
  export const LATEST_API_URL_PATH = 'latest';
@@ -101,10 +102,10 @@ type BaseClientConfig = {
101
102
  tileApiUrl: string;
102
103
  fileApiUrl: string;
103
104
  emsVersion?: string;
104
- htmlSanitizer?: Function;
105
+ htmlSanitizer?: (x: string) => string;
105
106
  language?: string;
106
107
  landingPageUrl?: string;
107
- fetchFunction: Function;
108
+ fetchFunction: (url: RequestInfo) => Promise<Response>;
108
109
  proxyPath?: string;
109
110
  cacheSize?: number;
110
111
  };
@@ -209,8 +210,8 @@ export class EMSClient {
209
210
  readonly EMS_LOAD_TIMEOUT = 32000;
210
211
  private _queryParams: QueryParams;
211
212
  private readonly _appVersion: string;
212
- private readonly _fetchFunction: Function;
213
- private readonly _sanitizer: Function;
213
+ private readonly _fetchFunction: (url: RequestInfo) => Promise<Response>;
214
+ private readonly _sanitizer: (x: string) => string;
214
215
  private readonly _fileApiUrl: string;
215
216
  private readonly _tileApiUrl: string;
216
217
  private readonly _emsVersion: string;
@@ -223,11 +224,11 @@ export class EMSClient {
223
224
  /**
224
225
  * these methods are assigned outside the constructor
225
226
  */
226
- private _getMainCatalog!: Function;
227
- private _getDefaultTMSCatalog!: Function;
228
- private _getDefaultFileCatalog!: Function;
229
- private _loadTMSServices!: Function;
230
- private _loadFileLayers!: Function;
227
+ private _getMainCatalog!: () => Promise<EmsCatalogManifest>;
228
+ private _getDefaultTMSCatalog!: () => Promise<EmsTmsCatalog>;
229
+ private _getDefaultFileCatalog!: () => Promise<EmsFileCatalog>;
230
+ private _loadTMSServices!: () => Promise<TMSService[]>;
231
+ private _loadFileLayers!: () => Promise<FileLayer[]>;
231
232
 
232
233
  constructor(config: ClientConfig | DeprecatedClientConfig) {
233
234
  // Remove kbnVersion in 8.0
@@ -132,6 +132,9 @@ export class TMSService extends AbstractEmsService {
132
132
  { style: 'road_map', operation: 'mix', percentage: 0.25 },
133
133
  { style: 'road_map_desaturated', operation: 'screen', percentage: 0.25 },
134
134
  { style: 'dark_map', operation: 'dodge', percentage: 0.25 },
135
+ { style: 'high_contrast', operation: 'screen', percentage: 0.25 },
136
+ { style: 'road_map_desaturated_v9', operation: 'screen', percentage: 0.25 },
137
+ { style: 'dark_map_v9', operation: 'dodge', percentage: 0.25 },
135
138
  ];
136
139
 
137
140
  protected readonly _config: TMSServiceConfig;
package/src/utils.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  * 2.0.
6
6
  */
7
7
 
8
- import chroma, { ChromaStatic } from 'chroma-js';
8
+ import chroma, { ChromaStatic, Color } from 'chroma-js';
9
9
  import {
10
10
  ColorSpecification,
11
11
  DataDrivenPropertyValueSpecification,
@@ -63,7 +63,10 @@ export type blendMode = Parameters<ChromaStatic['blend']>[2] | 'mix';
63
63
  /*
64
64
  Function to transform a maplibre color definition by a given function.
65
65
  */
66
- function transformColor(paintColor: mbColorDefinition, func: Function): mbColorDefinition {
66
+ function transformColor(
67
+ paintColor: mbColorDefinition,
68
+ func: (color: string) => Color
69
+ ): mbColorDefinition {
67
70
  if (typeof paintColor == 'string') {
68
71
  const modifiedColor = func(paintColor);
69
72
  return `rgba(${modifiedColor.rgba().join(',')})`;
@@ -1,6 +1,8 @@
1
1
  import { TMSService } from './tms_service';
2
2
  import { EMSFormatType, FileLayer } from './file_layer';
3
3
  import { FeatureCollection } from 'geojson';
4
+ import { Response } from 'node-fetch';
5
+ import { RequestInfo } from 'node-fetch';
4
6
  export declare const LATEST_API_URL_PATH = "latest";
5
7
  type LocalizedStrings = {
6
8
  [key: string]: string;
@@ -11,10 +13,10 @@ type BaseClientConfig = {
11
13
  tileApiUrl: string;
12
14
  fileApiUrl: string;
13
15
  emsVersion?: string;
14
- htmlSanitizer?: Function;
16
+ htmlSanitizer?: (x: string) => string;
15
17
  language?: string;
16
18
  landingPageUrl?: string;
17
- fetchFunction: Function;
19
+ fetchFunction: (url: RequestInfo) => Promise<Response>;
18
20
  proxyPath?: string;
19
21
  cacheSize?: number;
20
22
  };
@@ -499,4 +499,16 @@ _defineProperty(TMSService, "colorOperationDefaults", [{
499
499
  style: 'dark_map',
500
500
  operation: 'dodge',
501
501
  percentage: 0.25
502
+ }, {
503
+ style: 'high_contrast',
504
+ operation: 'screen',
505
+ percentage: 0.25
506
+ }, {
507
+ style: 'road_map_desaturated_v9',
508
+ operation: 'screen',
509
+ percentage: 0.25
510
+ }, {
511
+ style: 'dark_map_v9',
512
+ operation: 'dodge',
513
+ percentage: 0.25
502
514
  }]);
@@ -0,0 +1,4 @@
1
+ export declare const ORIGIN: {
2
+ EMS: string;
3
+ KIBANA_YML: string;
4
+ };
@@ -164,7 +164,7 @@ export var EMSClient = /*#__PURE__*/function () {
164
164
  }, {
165
165
  key: "getManifest",
166
166
  value: (function () {
167
- var _getManifest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(endpointUrl) {
167
+ var _getManifest = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(endpointUrl) {
168
168
  var url, response;
169
169
  return _regeneratorRuntime().wrap(function _callee$(_context) {
170
170
  while (1) switch (_context.prev = _context.next) {
@@ -240,7 +240,7 @@ export var EMSClient = /*#__PURE__*/function () {
240
240
  }, {
241
241
  key: "getMainManifest",
242
242
  value: function () {
243
- var _getMainManifest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
243
+ var _getMainManifest = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
244
244
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
245
245
  while (1) switch (_context2.prev = _context2.next) {
246
246
  case 0:
@@ -262,7 +262,7 @@ export var EMSClient = /*#__PURE__*/function () {
262
262
  }, {
263
263
  key: "getDefaultFileManifest",
264
264
  value: function () {
265
- var _getDefaultFileManifest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
265
+ var _getDefaultFileManifest = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
266
266
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
267
267
  while (1) switch (_context3.prev = _context3.next) {
268
268
  case 0:
@@ -284,7 +284,7 @@ export var EMSClient = /*#__PURE__*/function () {
284
284
  }, {
285
285
  key: "getDefaultTMSManifest",
286
286
  value: function () {
287
- var _getDefaultTMSManifest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
287
+ var _getDefaultTMSManifest = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
288
288
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
289
289
  while (1) switch (_context4.prev = _context4.next) {
290
290
  case 0:
@@ -306,7 +306,7 @@ export var EMSClient = /*#__PURE__*/function () {
306
306
  }, {
307
307
  key: "getFileLayers",
308
308
  value: function () {
309
- var _getFileLayers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
309
+ var _getFileLayers = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
310
310
  return _regeneratorRuntime().wrap(function _callee5$(_context5) {
311
311
  while (1) switch (_context5.prev = _context5.next) {
312
312
  case 0:
@@ -328,7 +328,7 @@ export var EMSClient = /*#__PURE__*/function () {
328
328
  }, {
329
329
  key: "getTMSServices",
330
330
  value: function () {
331
- var _getTMSServices = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
331
+ var _getTMSServices = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
332
332
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
333
333
  while (1) switch (_context6.prev = _context6.next) {
334
334
  case 0:
@@ -393,7 +393,7 @@ export var EMSClient = /*#__PURE__*/function () {
393
393
  }, {
394
394
  key: "findFileLayerById",
395
395
  value: function () {
396
- var _findFileLayerById = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(id) {
396
+ var _findFileLayerById = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(id) {
397
397
  var fileLayers, i;
398
398
  return _regeneratorRuntime().wrap(function _callee7$(_context7) {
399
399
  while (1) switch (_context7.prev = _context7.next) {
@@ -431,7 +431,7 @@ export var EMSClient = /*#__PURE__*/function () {
431
431
  }, {
432
432
  key: "findTMSServiceById",
433
433
  value: function () {
434
- var _findTMSServiceById = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(id) {
434
+ var _findTMSServiceById = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(id) {
435
435
  var tmsServices, i;
436
436
  return _regeneratorRuntime().wrap(function _callee8$(_context8) {
437
437
  while (1) switch (_context8.prev = _context8.next) {
@@ -501,7 +501,7 @@ export var EMSClient = /*#__PURE__*/function () {
501
501
  value: function _invalidateSettings() {
502
502
  var _this2 = this;
503
503
  this._cache.reset();
504
- this._getMainCatalog = _.once( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
504
+ this._getMainCatalog = _.once(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
505
505
  var services, version, _version;
506
506
  return _regeneratorRuntime().wrap(function _callee9$(_context9) {
507
507
  while (1) switch (_context9.prev = _context9.next) {
@@ -530,7 +530,7 @@ export var EMSClient = /*#__PURE__*/function () {
530
530
  }
531
531
  }, _callee9);
532
532
  })));
533
- this._getDefaultTMSCatalog = _.once( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
533
+ this._getDefaultTMSCatalog = _.once(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
534
534
  var catalogue, firstService, url;
535
535
  return _regeneratorRuntime().wrap(function _callee10$(_context10) {
536
536
  while (1) switch (_context10.prev = _context10.next) {
@@ -561,7 +561,7 @@ export var EMSClient = /*#__PURE__*/function () {
561
561
  }
562
562
  }, _callee10);
563
563
  })));
564
- this._getDefaultFileCatalog = _.once( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
564
+ this._getDefaultFileCatalog = _.once(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
565
565
  var catalogue, firstService, url;
566
566
  return _regeneratorRuntime().wrap(function _callee11$(_context11) {
567
567
  while (1) switch (_context11.prev = _context11.next) {
@@ -594,7 +594,7 @@ export var EMSClient = /*#__PURE__*/function () {
594
594
  })));
595
595
 
596
596
  //Cache the actual instances of TMSService as these in turn cache sub-manifests for the style-files
597
- this._loadTMSServices = _.once( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
597
+ this._loadTMSServices = _.once(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
598
598
  var tmsManifest;
599
599
  return _regeneratorRuntime().wrap(function _callee12$(_context12) {
600
600
  while (1) switch (_context12.prev = _context12.next) {
@@ -612,7 +612,7 @@ export var EMSClient = /*#__PURE__*/function () {
612
612
  }
613
613
  }, _callee12);
614
614
  })));
615
- this._loadFileLayers = _.once( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
615
+ this._loadFileLayers = _.once(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
616
616
  var fileManifest;
617
617
  return _regeneratorRuntime().wrap(function _callee13$(_context13) {
618
618
  while (1) switch (_context13.prev = _context13.next) {
@@ -45,7 +45,7 @@ export var FileLayer = /*#__PURE__*/function (_AbstractEmsService) {
45
45
  return _createClass(FileLayer, [{
46
46
  key: "getGeoJson",
47
47
  value: function () {
48
- var _getGeoJson = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
48
+ var _getGeoJson = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
49
49
  var cachedGeoJson, format, fetchUrl, geojson, fetchedJson, _meta$feature_collect, meta, featureCollectionPath;
50
50
  return _regeneratorRuntime().wrap(function _callee$(_context) {
51
51
  while (1) switch (_context.prev = _context.next) {
@@ -40,7 +40,7 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
40
40
  _classCallCheck(this, TMSService);
41
41
  _this = _callSuper(this, TMSService, [config, emsClient, proxyPath]);
42
42
  _defineProperty(_this, "_config", void 0);
43
- _defineProperty(_this, "_getRasterStyleJson", _.once( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
43
+ _defineProperty(_this, "_getRasterStyleJson", _.once(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
44
44
  var rasterUrl, url;
45
45
  return _regeneratorRuntime().wrap(function _callee$(_context) {
46
46
  while (1) switch (_context.prev = _context.next) {
@@ -60,7 +60,7 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
60
60
  }
61
61
  }, _callee);
62
62
  }))));
63
- _defineProperty(_this, "_getVectorStyleJsonRaw", _.once( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
63
+ _defineProperty(_this, "_getVectorStyleJsonRaw", _.once(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
64
64
  var vectorUrl, url, vectorJson;
65
65
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
66
66
  while (1) switch (_context2.prev = _context2.next) {
@@ -84,7 +84,7 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
84
84
  }
85
85
  }, _callee2);
86
86
  }))));
87
- _defineProperty(_this, "_getVectorStyleJsonInlined", _.once( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
87
+ _defineProperty(_this, "_getVectorStyleJsonInlined", _.once(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
88
88
  var vectorJson, inlinedSources, sources, _iterator, _step, _sourceName, url, _sourceJson$tiles, sourceUrl, extendedUrl, sourceJson, tiles;
89
89
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
90
90
  while (1) switch (_context3.prev = _context3.next) {
@@ -180,7 +180,7 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
180
180
  return _createClass(TMSService, [{
181
181
  key: "getDefaultRasterStyle",
182
182
  value: function () {
183
- var _getDefaultRasterStyle = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
183
+ var _getDefaultRasterStyle = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
184
184
  var _this2 = this;
185
185
  var tileJson, tiles;
186
186
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
@@ -216,7 +216,7 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
216
216
  }, {
217
217
  key: "getUrlTemplate",
218
218
  value: function () {
219
- var _getUrlTemplate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
219
+ var _getUrlTemplate = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
220
220
  var tileJson, directUrl;
221
221
  return _regeneratorRuntime().wrap(function _callee5$(_context5) {
222
222
  while (1) switch (_context5.prev = _context5.next) {
@@ -247,7 +247,7 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
247
247
  }, {
248
248
  key: "getUrlTemplateForVector",
249
249
  value: function () {
250
- var _getUrlTemplateForVector = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(sourceId) {
250
+ var _getUrlTemplateForVector = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(sourceId) {
251
251
  var _tileJson$sources$sou;
252
252
  var tileJson, url, directUrl;
253
253
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
@@ -280,7 +280,7 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
280
280
  }, {
281
281
  key: "getVectorStyleSheet",
282
282
  value: function () {
283
- var _getVectorStyleSheet = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
283
+ var _getVectorStyleSheet = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
284
284
  return _regeneratorRuntime().wrap(function _callee7$(_context7) {
285
285
  while (1) switch (_context7.prev = _context7.next) {
286
286
  case 0:
@@ -302,7 +302,7 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
302
302
  }, {
303
303
  key: "getVectorStyleSheetRaw",
304
304
  value: function () {
305
- var _getVectorStyleSheetRaw = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
305
+ var _getVectorStyleSheetRaw = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
306
306
  return _regeneratorRuntime().wrap(function _callee8$(_context8) {
307
307
  while (1) switch (_context8.prev = _context8.next) {
308
308
  case 0:
@@ -324,7 +324,7 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
324
324
  }, {
325
325
  key: "getSpriteSheetMeta",
326
326
  value: function () {
327
- var _getSpriteSheetMeta = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
327
+ var _getSpriteSheetMeta = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
328
328
  var isRetina,
329
329
  metaUrl,
330
330
  spritePngs,
@@ -372,7 +372,7 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
372
372
  }, {
373
373
  key: "getSpriteSheetJsonPath",
374
374
  value: function () {
375
- var _getSpriteSheetJsonPath = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
375
+ var _getSpriteSheetJsonPath = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
376
376
  var isRetina,
377
377
  spriteSheetRootPath,
378
378
  suffix,
@@ -407,7 +407,7 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
407
407
  }, {
408
408
  key: "getSpriteSheetPngPath",
409
409
  value: function () {
410
- var _getSpriteSheetPngPath = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
410
+ var _getSpriteSheetPngPath = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
411
411
  var isRetina,
412
412
  spriteSheetRootPath,
413
413
  suffix,
@@ -447,7 +447,7 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
447
447
  }, {
448
448
  key: "getMinZoom",
449
449
  value: function () {
450
- var _getMinZoom = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
450
+ var _getMinZoom = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
451
451
  var format,
452
452
  _ref4,
453
453
  sources,
@@ -511,7 +511,7 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
511
511
  }, {
512
512
  key: "getMaxZoom",
513
513
  value: function () {
514
- var _getMaxZoom = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
514
+ var _getMaxZoom = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
515
515
  var format,
516
516
  _ref6,
517
517
  sources,
@@ -613,7 +613,7 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
613
613
  }, {
614
614
  key: "_getSpriteSheetRootPath",
615
615
  value: function () {
616
- var _getSpriteSheetRootPath2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
616
+ var _getSpriteSheetRootPath2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
617
617
  var vectorStyleJson;
618
618
  return _regeneratorRuntime().wrap(function _callee14$(_context14) {
619
619
  while (1) switch (_context14.prev = _context14.next) {
@@ -643,7 +643,7 @@ export var TMSService = /*#__PURE__*/function (_AbstractEmsService) {
643
643
  }, {
644
644
  key: "_getUrlTemplateForGlyphs",
645
645
  value: function () {
646
- var _getUrlTemplateForGlyphs2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
646
+ var _getUrlTemplateForGlyphs2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
647
647
  var vectorStyleJson;
648
648
  return _regeneratorRuntime().wrap(function _callee15$(_context15) {
649
649
  while (1) switch (_context15.prev = _context15.next) {
@@ -929,4 +929,16 @@ _defineProperty(TMSService, "colorOperationDefaults", [{
929
929
  style: 'dark_map',
930
930
  operation: 'dodge',
931
931
  percentage: 0.25
932
+ }, {
933
+ style: 'high_contrast',
934
+ operation: 'screen',
935
+ percentage: 0.25
936
+ }, {
937
+ style: 'road_map_desaturated_v9',
938
+ operation: 'screen',
939
+ percentage: 0.25
940
+ }, {
941
+ style: 'dark_map_v9',
942
+ operation: 'dodge',
943
+ percentage: 0.25
932
944
  }]);
@@ -42,7 +42,7 @@ export function getEMSClient(options = {}) {
42
42
 
43
43
  const getManifestMock = jest
44
44
  .spyOn(emsClient, 'getManifest')
45
- .mockImplementation(async (url: string): Promise<Object | unknown> => {
45
+ .mockImplementation(async (url: string): Promise<object | unknown> => {
46
46
  //simulate network calls
47
47
  if (url.startsWith('https://foobar')) {
48
48
  return EMS_CATALOGUE;