@elastic/ems-client 8.5.3 → 8.6.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/.backportrc.json CHANGED
@@ -1,16 +1,17 @@
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
- }
2
+ "repoOwner": "elastic",
3
+ "repoName": "ems-client",
4
+ "targetBranchChoices": [
5
+ "master",
6
+ "7.17"
12
7
  ],
13
- "labels": [
14
- "backport"
15
- ]
16
- }
8
+ "branchLabelMapping": {
9
+ "^v8.\\d+.\\d+$": "master",
10
+ "^v7.\\d+.\\d+$": "v7.17"
11
+ },
12
+ "targetPRLabels": ["backport"],
13
+ "commitConflicts": true,
14
+ "autoMerge": false,
15
+ "autoMergeMethod": "squash",
16
+ "fork": false
17
+ }
@@ -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,27 @@ 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.1] - 2024-12-23
7
+ ### Changed
8
+ - Removed node-fetch #519
9
+
10
+ ## [8.6.0] - 2024-12-13
11
+ ### Added
12
+ - Include color options for new EMS styles #478
7
13
 
14
+ ### Changed
15
+ - Dependencies reorganization and validation against Kibana #289
16
+ - Update dependencies (search PRs for `is:pr label:8.5.4,dependencies`)
17
+
18
+ ## [8.5.3] - 2024-07-10
8
19
  ### Changed
9
20
  - Update dependencies #242
10
21
 
11
22
  ## [8.5.2] - 2024-07-05
12
-
13
23
  ## Changed
14
24
  - Update dependencies #232 #233 #234 #235
15
25
 
16
26
  ## [8.5.1] - 2023-11-09
17
-
18
27
  ### Added
19
28
  - Add a new `getEmsVersion` method #204
20
29
  - Include OpenAPI specification #196 #197
@@ -26,83 +35,70 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
26
35
  - Migration to Node 20 #208
27
36
 
28
37
  ## [8.5.0] - 2023-08-23
29
-
30
38
  - Migration from Jenkins to Buildkite for automatic testing #145 #147
31
39
  - Detached the releases of EMS Client from the services consumed #185
32
40
  - Updated the client to support date based versions #185
33
41
  - Update dependencies #159 #165 #173 #176 #181 #184
34
42
 
35
43
  ## [8.4.0] - 2023-01-11
36
-
37
44
  - Default EMS version is 8.4
38
45
  - Add types to colorOperationDefaults #123
39
46
  - Update dependencies #131 #133 #134 #138
40
47
 
41
48
  ## [8.3.3] - 2022-05-24
42
-
43
49
  - Make percentage an optional parameter #117
44
50
  - Make color and operation optional parameters #118
45
51
 
46
52
  ## [8.3.2] - 2022-05-16
47
-
48
53
  - Export `blendMode` type #111
49
54
  - Fix transforming color definitions with stops #112
50
55
 
51
56
  ## [8.3.1] - 2022-05-06
52
-
53
57
  - Added static methods to help translating basemap labels and blending colors to paint properties #105
54
58
  - Add optional `format` argument to `getMinZoom` and `getMaxZoom` #90
55
59
 
56
60
  ## [8.3.0] - 2022-04-18
57
-
58
61
  ### Changed
59
62
  - Default EMS version is 8.3 #104
60
63
  - Bump maplibre-gl to 2.1.9 #103
61
64
 
62
65
  ## [8.2.0] - 2022-03-24
63
-
64
66
  ### Changed
65
67
  - Default EMS version is 8.2
66
68
  - Removed getOrigin method #91
67
69
 
68
70
  ## [8.1.0] - 2021-11-09
69
-
70
71
  ### Changed
71
72
  - Default EMS version is 8.1
72
73
  - Export EmsSprite and EmsSpritesheet types
73
74
  - Inherit types from maplibre-gl
74
75
 
75
76
  ## [8.0.0] - 2021-10-20
76
-
77
77
  ### Changed
78
78
  - Default EMS version is 8.0
79
79
  - Remove unused API descriptors
80
80
 
81
81
  ## [7.16.0] - 2021-10-13
82
-
83
82
  ### Changed
84
83
  - Default EMS version is 7.16
85
84
  - Update dependencies using `yarn upgrade`
86
85
  - Better error handling for HTTP responses
87
86
 
88
87
  ## [7.15.1] - 2021-09-01
89
-
90
88
  ### Changed
91
89
  - Unpinned `semver` dependency [#77](https://github.com/elastic/ems-client/pull/77)
92
90
 
93
91
  ## [7.15.0] - 2021-08-12
94
-
95
92
  ### Changed
96
93
  - Default EMS version is 7.15
97
94
  - Updated dependencies via `yarn upgrade`
98
95
  - Fix linting issues
96
+
99
97
  ## [7.14.0] - 2021-06-15
100
98
  ### Added
101
-
102
99
  - New getters for optional field metadata `alias`, `regex`, and `values` #69
103
100
 
104
101
  ### Changed
105
-
106
102
  - Default EMS version is 7.14
107
103
  - **Breaking change** @elastic/ems-client is now licensed under the Elastic License v2. See the LICENSE.txt file in this repository #64
108
104
 
@@ -116,7 +112,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
116
112
  - Updated dependencies using `yarn upgrade` and #44 #50
117
113
  - Add functions to get specific file formats #53
118
114
 
119
-
120
115
  ## [7.10.0] - 2020-08-17
121
116
  ### Changed
122
117
  - Default EMS version is 7.10
@@ -143,7 +138,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
143
138
  - Convert source code to Typescript
144
139
  - Added better linting with eslint and prettier
145
140
 
146
-
147
141
  ## [7.8.1] - 2020-04-06
148
142
  ### Fixed
149
143
  - Correctly handle API urls that end in slashes
@@ -178,14 +172,11 @@ always needed and in fact breaks some client-side use of this lib
178
172
  - Correctly handle API urls that end in slashes
179
173
 
180
174
  ## [7.6.0] - 2020-01-13
181
-
182
175
  ### Added
183
176
  - 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
177
 
185
178
  ### Changed
186
-
187
179
  - 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
180
  - Handle relative URLs in EMS v7.6 manifests.
190
181
 
191
182
  ### Deprecated
@@ -207,7 +198,6 @@ Bump version to match the corresponding Elastic Maps Service version. This relea
207
198
  ### Fixed
208
199
  - Update browser entry point that was pointing to an incorrect path, which fell back to the main entry
209
200
 
210
-
211
201
  ## [1.0.2] - 2019-10-15
212
202
 
213
203
  ### Fixed
@@ -219,5 +209,4 @@ Bump version to match the corresponding Elastic Maps Service version. This relea
219
209
  - Downgrade node-fetch dependency to fix fetch error
220
210
 
221
211
  ## [1.0.0] - 2019-08-26
222
-
223
212
  - 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.1",
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,44 @@
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
+ "semver": "^7.6.3",
41
41
  "topojson-client": "^3.1.0"
42
42
  },
43
43
  "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"
44
+ "@babel/cli": "7.26.4",
45
+ "@babel/core": "7.26.0",
46
+ "@babel/plugin-proposal-class-properties": "7.18.6",
47
+ "@babel/preset-env": "7.26.0",
48
+ "@babel/preset-typescript": "7.26.0",
49
+ "@eslint/core": "0.9.1",
50
+ "@eslint/js": "9.17.0",
51
+ "@types/chroma-js": "2.4.5",
52
+ "@types/eslint__js": "8.42.3",
53
+ "@types/jest": "29.5.14",
54
+ "@types/lodash": "4.17.13",
55
+ "@types/lru-cache": "5.1.1",
56
+ "@types/node": "20.17.10",
57
+ "@types/semver": "7.5.8",
58
+ "@types/topojson-specification": "1.0.5",
59
+ "@typescript-eslint/eslint-plugin": "8.18.1",
60
+ "@typescript-eslint/parser": "8.18.1",
61
+ "babel-jest": "29.7.0",
62
+ "eslint": "9.17.0",
63
+ "eslint-config-prettier": "9.1.0",
64
+ "eslint-plugin-prettier": "5.2.1",
65
+ "globals": "15.14.0",
66
+ "husky": "9.1.7",
67
+ "jest": "29.7.0",
68
+ "prettier": "3.4.2",
69
+ "ts-jest": "29.2.5",
70
+ "typescript": "5.7.2",
71
+ "typescript-eslint": "8.18.1"
73
72
  },
74
73
  "engines": {
75
74
  "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.5",
9
+ "v8.6.1"
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
@@ -8,7 +8,6 @@ import _ from 'lodash';
8
8
  import { TMSService } from './tms_service';
9
9
  import { EMSFormatType, FileLayer } from './file_layer';
10
10
  import { FeatureCollection } from 'geojson';
11
- import { Response } from 'node-fetch';
12
11
 
13
12
  import semverCoerce from 'semver/functions/coerce';
14
13
  import semverValid from 'semver/functions/valid';
@@ -101,10 +100,10 @@ type BaseClientConfig = {
101
100
  tileApiUrl: string;
102
101
  fileApiUrl: string;
103
102
  emsVersion?: string;
104
- htmlSanitizer?: Function;
103
+ htmlSanitizer?: (x: string) => string;
105
104
  language?: string;
106
105
  landingPageUrl?: string;
107
- fetchFunction: Function;
106
+ fetchFunction: (url: RequestInfo) => Promise<Response>;
108
107
  proxyPath?: string;
109
108
  cacheSize?: number;
110
109
  };
@@ -209,8 +208,8 @@ export class EMSClient {
209
208
  readonly EMS_LOAD_TIMEOUT = 32000;
210
209
  private _queryParams: QueryParams;
211
210
  private readonly _appVersion: string;
212
- private readonly _fetchFunction: Function;
213
- private readonly _sanitizer: Function;
211
+ private readonly _fetchFunction: (url: RequestInfo) => Promise<Response>;
212
+ private readonly _sanitizer: (x: string) => string;
214
213
  private readonly _fileApiUrl: string;
215
214
  private readonly _tileApiUrl: string;
216
215
  private readonly _emsVersion: string;
@@ -223,11 +222,11 @@ export class EMSClient {
223
222
  /**
224
223
  * these methods are assigned outside the constructor
225
224
  */
226
- private _getMainCatalog!: Function;
227
- private _getDefaultTMSCatalog!: Function;
228
- private _getDefaultFileCatalog!: Function;
229
- private _loadTMSServices!: Function;
230
- private _loadFileLayers!: Function;
225
+ private _getMainCatalog!: () => Promise<EmsCatalogManifest>;
226
+ private _getDefaultTMSCatalog!: () => Promise<EmsTmsCatalog>;
227
+ private _getDefaultFileCatalog!: () => Promise<EmsFileCatalog>;
228
+ private _loadTMSServices!: () => Promise<TMSService[]>;
229
+ private _loadFileLayers!: () => Promise<FileLayer[]>;
231
230
 
232
231
  constructor(config: ClientConfig | DeprecatedClientConfig) {
233
232
  // 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(',')})`;
@@ -11,10 +11,10 @@ type BaseClientConfig = {
11
11
  tileApiUrl: string;
12
12
  fileApiUrl: string;
13
13
  emsVersion?: string;
14
- htmlSanitizer?: Function;
14
+ htmlSanitizer?: (x: string) => string;
15
15
  language?: string;
16
16
  landingPageUrl?: string;
17
- fetchFunction: Function;
17
+ fetchFunction: (url: RequestInfo) => Promise<Response>;
18
18
  proxyPath?: string;
19
19
  cacheSize?: number;
20
20
  };
@@ -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
  }]);
@@ -6,7 +6,6 @@
6
6
  */
7
7
 
8
8
  import { EMSClient } from '../src';
9
- import fetch from 'node-fetch';
10
9
 
11
10
  import EMS_CATALOGUE from './ems_mocks/sample_manifest.json';
12
11
  import EMS_FILES from './ems_mocks/sample_files.json';
@@ -42,7 +41,7 @@ export function getEMSClient(options = {}) {
42
41
 
43
42
  const getManifestMock = jest
44
43
  .spyOn(emsClient, 'getManifest')
45
- .mockImplementation(async (url: string): Promise<Object | unknown> => {
44
+ .mockImplementation(async (url: string): Promise<object | unknown> => {
46
45
  //simulate network calls
47
46
  if (url.startsWith('https://foobar')) {
48
47
  return EMS_CATALOGUE;